@skyux/core
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("@angular/common"),require("rxjs/BehaviorSubject")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/common","rxjs/BehaviorSubject"],t):"object"==typeof exports?exports["skyux-core"]=t(require("@angular/core"),require("@angular/common"),require("rxjs/BehaviorSubject")):e["skyux-core"]=t(e["@angular/core"],e["@angular/common"],e["rxjs/BehaviorSubject"])}(this,function(e,t,r){return function(e){function __webpack_require__(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.i=function(e){return e},__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=8)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),o=function(){function SkyNumericService(e,t){this.currencyPipe=e,this.decimalPipe=t,this.symbols={skyux_numeric_billions_symbol:{_description:'Symbol to be used when abbreviating a "billion" number.',message:"B"},skyux_numeric_millions_symbol:{_description:'Symbol to be used when abbreviating a "million" number.',message:"M"},skyux_numeric_thousands_symbol:{_description:'Symbol to be used when abbreviating a "thousand" number.',message:"K"},skyux_numeric_trillions_symbol:{_description:'Symbol to be used when abbreviating a "trillion" number.',message:"T"}},this.symbolIndex=[{value:1e12,label:this.getSymbol("skyux_numeric_trillions_symbol")},{value:1e9,label:this.getSymbol("skyux_numeric_billions_symbol")},{value:1e6,label:this.getSymbol("skyux_numeric_millions_symbol")},{value:1e3,label:this.getSymbol("skyux_numeric_thousands_symbol")}]}return SkyNumericService.prototype.formatNumber=function(e,t){if(isNaN(e))return"";var r,i=/\.0+$|(\.[0-9]*[1-9])0+$/,n=this.symbolIndex.find(function(r){return t.truncate&&(e>=t.truncateAfter&&e>=r.value||-e>=t.truncateAfter&&-e>=r.value)});r=n?Number(Math.round(parseFloat(e/n.value+"e"+t.digits))+"e-"+t.digits).toString().replace(i,"$1")+n.label:Number(Math.round(parseFloat(e+"e"+t.digits))+"e-"+t.digits).toString().replace(i,"$1"),this.storeShortenSymbol(r);var o;switch(t.format.toLowerCase()){case"currency":var u=e>this.symbolIndex[this.symbolIndex.length-1].value,s=e%1!=0;o=!u&&s&&t.digits>=2?"1.2-"+t.digits:"1.0-"+t.digits,r=this.currencyPipe.transform(parseFloat(r),t.iso,!0,o);break;default:o=t.truncate?"1.0-"+t.digits:"1."+t.digits+"-"+t.digits,r=this.decimalPipe.transform(parseFloat(r),o)}return t.truncate&&(r=this.replaceShortenSymbol(r)),r},SkyNumericService.prototype.storeShortenSymbol=function(e){var t=this.symbolIndex.map(function(e){return e.label}),r=new RegExp(t.join("|"),"ig"),i=e.match(r);this.shortSymbol=i?i.toString():""},SkyNumericService.prototype.replaceShortenSymbol=function(e){var t=/(\d)(?!.*\d)/g.exec(e),r=t.index+t.length;return e.substring(0,r)+this.shortSymbol+e.substring(r)},SkyNumericService.prototype.getSymbol=function(e){return this.symbols[e].message},SkyNumericService}();o=__decorate([i.Injectable(),__metadata("design:paramtypes",[n.CurrencyPipe,n.DecimalPipe])],o),t.SkyNumericService=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function SkyLogService(){}return SkyLogService.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];window.console&&window.console.warn.apply(window.console,arguments)},SkyLogService}();n=__decorate([i.Injectable()],n),t.SkyLogService=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.xs=1]="xs",e[e.sm=2]="sm",e[e.md=3]="md",e[e.lg=4]="lg"}(t.SkyMediaBreakpoints||(t.SkyMediaBreakpoints={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(23),o=r(4),u=s=function(){function SkyMediaQueryService(e){var t=this;this.zone=e,this._current=o.SkyMediaBreakpoints.md,this.currentSubject=new n.BehaviorSubject(this.current),this.xsListener=function(e){t.setupListener(e,o.SkyMediaBreakpoints.xs)},this.smListener=function(e){t.setupListener(e,o.SkyMediaBreakpoints.sm)},this.mdListener=function(e){t.setupListener(e,o.SkyMediaBreakpoints.md)},this.lgListener=function(e){t.setupListener(e,o.SkyMediaBreakpoints.lg)},this.xsMql=matchMedia(s.xs),this.xsMql.addListener(this.xsListener),this.smMql=matchMedia(s.sm),this.smMql.addListener(this.smListener),this.mdMql=matchMedia(s.md),this.mdMql.addListener(this.mdListener),this.lgMql=matchMedia(s.lg),this.lgMql.addListener(this.lgListener),this.setupListener(this.xsMql,o.SkyMediaBreakpoints.xs),this.setupListener(this.smMql,o.SkyMediaBreakpoints.sm),this.setupListener(this.mdMql,o.SkyMediaBreakpoints.md),this.setupListener(this.lgMql,o.SkyMediaBreakpoints.lg)}return Object.defineProperty(SkyMediaQueryService.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),SkyMediaQueryService.prototype.subscribe=function(e){return this.currentSubject.subscribe({next:function(t){e(t)}})},SkyMediaQueryService.prototype.destroy=function(){this.xsMql.removeListener(this.xsListener),this.xsMql=void 0,this.xsListener=void 0,this.smMql.removeListener(this.smListener),this.smMql=void 0,this.smListener=void 0,this.mdMql.removeListener(this.mdListener),this.mdMql=void 0,this.mdListener=void 0,this.lgMql.removeListener(this.lgListener),this.lgMql=void 0,this.lgListener=void 0,this.currentSubject.complete()},SkyMediaQueryService.prototype.setupListener=function(e,t){var r=this;this.zone.run(function(){e.matches&&(r._current=t,r.currentSubject.next(t))})},SkyMediaQueryService}();u.xs="(max-width: 767px)",u.sm="(min-width: 768px) and (max-width: 991px)",u.md="(min-width: 992px) and (max-width: 1199px)",u.lg="(min-width: 1200px)",u=s=__decorate([i.Injectable(),__metadata("design:paramtypes",[i.NgZone])],u),t.SkyMediaQueryService=u;var s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),o=r(19),u=function(){function SkyNumericPipe(e){this.skyNumeric=e}return SkyNumericPipe.prototype.transform=function(e,t){var r=new o.NumericOptions;return t&&!1===t.truncate&&void 0===t.digits&&(t.digits=0),Object.assign(r,t),this.skyNumeric.formatNumber(e,r)},SkyNumericPipe}();u=__decorate([i.Pipe({name:"skyNumeric"}),__metadata("design:paramtypes",[n.SkyNumericService])],u),t.SkyNumericPipe=u},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(10)),__export(r(11)),__export(r(13)),__export(r(15)),__export(r(17)),__export(r(20))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function SkyAppFormat(){}return SkyAppFormat.prototype.formatText=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return String(e).replace(/\{(\d+)\}/g,function(e,r){return t[parseInt(r,10)]})},SkyAppFormat}();n=__decorate([i.Injectable()],n),t.SkyAppFormat=n;var o=function(){function SkyFormat(){}return SkyFormat.formatText=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return this.isEmpty(e)?"":String(e).replace(/\{(\d+)\}/g,function(e,r){return t[parseInt(r,10)]})},SkyFormat.isEmpty=function(e){return null===e||void 0===e},SkyFormat}();t.SkyFormat=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(9))},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(12)),__export(r(3))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),o=r(3),u=function(){function SkyLogModule(){}return SkyLogModule}();u=__decorate([i.NgModule({imports:[n.CommonModule],providers:[o.SkyLogService]})],u),t.SkyLogModule=u},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(14)),__export(r(5)),__export(r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),o=r(5),u=function(){function SkyMediaQueryModule(){}return SkyMediaQueryModule}();u=__decorate([i.NgModule({providers:[o.SkyMediaQueryService],imports:[n.CommonModule]})],u),t.SkyMediaQueryModule=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(16))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function MutationObserverService(){}return MutationObserverService.prototype.create=function(e){return new MutationObserver(e)},MutationObserverService}();n=__decorate([i.Injectable()],n),t.MutationObserverService=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(6);t.SkyNumericPipe=i.SkyNumericPipe;var n=r(2);t.SkyNumericService=n.SkyNumericService;var o=r(18);t.SkyNumericModule=o.SkyNumericModule},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),o=r(6),u=r(2),s=function(){function SkyNumericModule(){}return SkyNumericModule}();s=__decorate([i.NgModule({declarations:[o.SkyNumericPipe],providers:[u.SkyNumericService,n.CurrencyPipe,n.DecimalPipe],exports:[o.SkyNumericPipe]})],s),t.SkyNumericModule=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function NumericOptions(){this.digits=1,this.format="number",this.iso="USD",this.truncate=!0,this.truncateAfter=0}return NumericOptions}();t.NumericOptions=i},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(21)),__export(r(22))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function SkyWindowRefService(){}return SkyWindowRefService.prototype.getWindow=function(){return window},SkyWindowRefService}();n=__decorate([i.Injectable()],n),t.SkyWindowRefService=n},function(e,t,r){"use strict";function getWindow(){return window}Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function SkyAppWindowRef(){}return Object.defineProperty(SkyAppWindowRef.prototype,"nativeWindow",{get:function(){return getWindow()},enumerable:!0,configurable:!0}),SkyAppWindowRef}();n=__decorate([i.Injectable()],n),t.SkyAppWindowRef=n},function(e,t){e.exports=r}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("@angular/common"),require("rxjs/BehaviorSubject"),require("rxjs/Observable"),require("rxjs/add/observable/of")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/common","rxjs/BehaviorSubject","rxjs/Observable","rxjs/add/observable/of"],t):"object"==typeof exports?exports["skyux-core"]=t(require("@angular/core"),require("@angular/common"),require("rxjs/BehaviorSubject"),require("rxjs/Observable"),require("rxjs/add/observable/of")):e["skyux-core"]=t(e["@angular/core"],e["@angular/common"],e["rxjs/BehaviorSubject"],e["rxjs/Observable"],e["rxjs/add/observable/of"])}(this,function(e,t,r,i,n){return function(e){function __webpack_require__(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.i=function(e){return e},__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=8)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),o=function(){function SkyNumericService(e,t){this.currencyPipe=e,this.decimalPipe=t,this.symbols=r(25),this.symbolIndex=[{value:1e12,label:this.getSymbol("skyux_numeric_trillions_symbol")},{value:1e9,label:this.getSymbol("skyux_numeric_billions_symbol")},{value:1e6,label:this.getSymbol("skyux_numeric_millions_symbol")},{value:1e3,label:this.getSymbol("skyux_numeric_thousands_symbol")}]}return SkyNumericService.prototype.formatNumber=function(e,t){if(isNaN(e))return"";var r,i=/\.0+$|(\.[0-9]*[1-9])0+$/,n=this.symbolIndex.find(function(r){return t.truncate&&(e>=t.truncateAfter&&e>=r.value||-e>=t.truncateAfter&&-e>=r.value)});r=n?Number(Math.round(parseFloat(e/n.value+"e"+t.digits))+"e-"+t.digits).toString().replace(i,"$1")+n.label:Number(Math.round(parseFloat(e+"e"+t.digits))+"e-"+t.digits).toString().replace(i,"$1"),this.storeShortenSymbol(r);var o;switch(t.format.toLowerCase()){case"currency":var s=e>this.symbolIndex[this.symbolIndex.length-1].value,u=e%1!=0;o=t.minDigits?"1."+t.minDigits+"-"+t.digits:!s&&u&&t.digits>=2?"1.2-"+t.digits:"1.0-"+t.digits,r=this.currencyPipe.transform(parseFloat(r),t.iso,!0,o);break;default:o=t.minDigits?"1."+t.minDigits+"-"+t.digits:t.truncate?"1.0-"+t.digits:"1."+t.digits+"-"+t.digits,r=this.decimalPipe.transform(parseFloat(r),o)}return t.truncate&&(r=this.replaceShortenSymbol(r)),r},SkyNumericService.prototype.storeShortenSymbol=function(e){var t=this.symbolIndex.map(function(e){return e.label}),r=new RegExp(t.join("|"),"ig"),i=e.match(r);this.shortSymbol=i?i.toString():""},SkyNumericService.prototype.replaceShortenSymbol=function(e){var t=/(\d)(?!.*\d)/g.exec(e),r=t.index+t.length;return e.substring(0,r)+this.shortSymbol+e.substring(r)},SkyNumericService.prototype.getSymbol=function(e){return this.symbols[e].message},SkyNumericService}();o=__decorate([i.Injectable(),__metadata("design:paramtypes",[n.CurrencyPipe,n.DecimalPipe])],o),t.SkyNumericService=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function SkyLogService(){}return SkyLogService.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];window.console&&window.console.warn.apply(window.console,arguments)},SkyLogService}();n=__decorate([i.Injectable()],n),t.SkyLogService=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.xs=1]="xs",e[e.sm=2]="sm",e[e.md=3]="md",e[e.lg=4]="lg"}(t.SkyMediaBreakpoints||(t.SkyMediaBreakpoints={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(26),o=r(4),s=u=function(){function SkyMediaQueryService(e){var t=this;this.zone=e,this._current=o.SkyMediaBreakpoints.md,this.currentSubject=new n.BehaviorSubject(this.current),this.xsListener=function(e){t.setupListener(e,o.SkyMediaBreakpoints.xs)},this.smListener=function(e){t.setupListener(e,o.SkyMediaBreakpoints.sm)},this.mdListener=function(e){t.setupListener(e,o.SkyMediaBreakpoints.md)},this.lgListener=function(e){t.setupListener(e,o.SkyMediaBreakpoints.lg)},this.xsMql=matchMedia(u.xs),this.xsMql.addListener(this.xsListener),this.smMql=matchMedia(u.sm),this.smMql.addListener(this.smListener),this.mdMql=matchMedia(u.md),this.mdMql.addListener(this.mdListener),this.lgMql=matchMedia(u.lg),this.lgMql.addListener(this.lgListener),this.setupListener(this.xsMql,o.SkyMediaBreakpoints.xs),this.setupListener(this.smMql,o.SkyMediaBreakpoints.sm),this.setupListener(this.mdMql,o.SkyMediaBreakpoints.md),this.setupListener(this.lgMql,o.SkyMediaBreakpoints.lg)}return Object.defineProperty(SkyMediaQueryService.prototype,"current",{get:function(){return this._current},enumerable:!0,configurable:!0}),SkyMediaQueryService.prototype.subscribe=function(e){return this.currentSubject.subscribe({next:function(t){e(t)}})},SkyMediaQueryService.prototype.destroy=function(){this.xsMql.removeListener(this.xsListener),this.xsMql=void 0,this.xsListener=void 0,this.smMql.removeListener(this.smListener),this.smMql=void 0,this.smListener=void 0,this.mdMql.removeListener(this.mdListener),this.mdMql=void 0,this.mdListener=void 0,this.lgMql.removeListener(this.lgListener),this.lgMql=void 0,this.lgListener=void 0,this.currentSubject.complete()},SkyMediaQueryService.prototype.setupListener=function(e,t){var r=this;this.zone.run(function(){e.matches&&(r._current=t,r.currentSubject.next(t))})},SkyMediaQueryService}();s.xs="(max-width: 767px)",s.sm="(min-width: 768px) and (max-width: 991px)",s.md="(min-width: 992px) and (max-width: 1199px)",s.lg="(min-width: 1200px)",s=u=__decorate([i.Injectable(),__metadata("design:paramtypes",[i.NgZone])],s),t.SkyMediaQueryService=s;var u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),o=r(19),s=function(){function SkyNumericPipe(e){this.skyNumeric=e}return SkyNumericPipe.prototype.transform=function(e,t){var r=new o.NumericOptions;if(t&&!1===t.truncate&&void 0===t.digits&&(t.digits=0),t&&t.minDigits&&t.digits&&t.minDigits>t.digits)throw new Error("The `digits` property must be greater than or equal to the `minDigits` property");return t&&t.minDigits&&!t.digits&&(t.digits=t.minDigits),Object.assign(r,t),this.skyNumeric.formatNumber(e,r)},SkyNumericPipe}();s=__decorate([i.Pipe({name:"skyNumeric"}),__metadata("design:paramtypes",[n.SkyNumericService])],s),t.SkyNumericPipe=s},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(10)),__export(r(11)),__export(r(13)),__export(r(15)),__export(r(17)),__export(r(20)),__export(r(22))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(7))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function SkyAppFormat(){}return SkyAppFormat.prototype.formatText=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return String(e).replace(/\{(\d+)\}/g,function(e,r){return t[parseInt(r,10)]})},SkyAppFormat}();n=__decorate([i.Injectable()],n),t.SkyAppFormat=n;var o=function(){function SkyFormat(){}return SkyFormat.formatText=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return this.isEmpty(e)?"":String(e).replace(/\{(\d+)\}/g,function(e,r){return t[parseInt(r,10)]})},SkyFormat.isEmpty=function(e){return null===e||void 0===e},SkyFormat}();t.SkyFormat=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(9))},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(12)),__export(r(3))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),o=r(3),s=function(){function SkyLogModule(){}return SkyLogModule}();s=__decorate([i.NgModule({imports:[n.CommonModule],providers:[o.SkyLogService]})],s),t.SkyLogModule=s},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(14)),__export(r(5)),__export(r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),o=r(5),s=function(){function SkyMediaQueryModule(){}return SkyMediaQueryModule}();s=__decorate([i.NgModule({providers:[o.SkyMediaQueryService],imports:[n.CommonModule]})],s),t.SkyMediaQueryModule=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(16))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function MutationObserverService(){}return MutationObserverService.prototype.create=function(e){return new MutationObserver(e)},MutationObserverService}();n=__decorate([i.Injectable()],n),t.MutationObserverService=n},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(6)),__export(r(2)),__export(r(18))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),o=r(6),s=r(2),u=function(){function SkyNumericModule(){}return SkyNumericModule}();u=__decorate([i.NgModule({declarations:[o.SkyNumericPipe],providers:[s.SkyNumericService,n.CurrencyPipe,n.DecimalPipe],exports:[o.SkyNumericPipe]})],u),t.SkyNumericModule=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function NumericOptions(){this.digits=1,this.format="number",this.iso="USD",this.truncate=!0,this.truncateAfter=0}return NumericOptions}();t.NumericOptions=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(21))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(27);r(28);var o=function(){function SkyUIConfigService(){}return SkyUIConfigService.prototype.getConfig=function(e,t){return n.Observable.of(t)},SkyUIConfigService.prototype.setConfig=function(e,t){return n.Observable.of({})},SkyUIConfigService}();o=__decorate([i.Injectable()],o),t.SkyUIConfigService=o},function(e,t,r){"use strict";function __export(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),__export(r(23)),__export(r(24))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function SkyWindowRefService(){}return SkyWindowRefService.prototype.getWindow=function(){return window},SkyWindowRefService}();n=__decorate([i.Injectable()],n),t.SkyWindowRefService=n},function(e,t,r){"use strict";function getWindow(){return window}Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=function(){function SkyAppWindowRef(){}return Object.defineProperty(SkyAppWindowRef.prototype,"nativeWindow",{get:function(){return getWindow()},enumerable:!0,configurable:!0}),SkyAppWindowRef}();n=__decorate([i.Injectable()],n),t.SkyAppWindowRef=n},function(e,t){e.exports={skyux_numeric_billions_symbol:{_description:'Symbol to be used when abbreviating a "billion" number.',message:"B"},skyux_numeric_millions_symbol:{_description:'Symbol to be used when abbreviating a "million" number.',message:"M"},skyux_numeric_thousands_symbol:{_description:'Symbol to be used when abbreviating a "thousand" number.',message:"K"},skyux_numeric_trillions_symbol:{_description:'Symbol to be used when abbreviating a "trillion" number.',message:"T"}}},function(e,t){e.exports=r},function(e,t){e.exports=i},function(e,t){e.exports=n}])}); |
@@ -0,1 +1,6 @@ | ||
# 3.2.0 (2018-10-29) | ||
- Added `SkyUIConfigService`. [#37](https://github.com/blackbaud/skyux-core/pull/37) | ||
- Added option for minimum fraction digits to numeric service and pipe. [#34](https://github.com/blackbaud/skyux-core/pull/34) | ||
# 3.1.0 (2018-09-19) | ||
@@ -2,0 +7,0 @@ |
@@ -6,2 +6,3 @@ export * from './format'; | ||
export * from './numeric'; | ||
export * from './ui-config'; | ||
export * from './window'; |
@@ -6,3 +6,4 @@ export * from './format'; | ||
export * from './numeric'; | ||
export * from './ui-config'; | ||
export * from './window'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./format"},{"from":"./log"},{"from":"./media-query"},{"from":"./mutation"},{"from":"./numeric"},{"from":"./window"}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./format"},{"from":"./log"},{"from":"./media-query"},{"from":"./mutation"},{"from":"./numeric"},{"from":"./window"}]}] | ||
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./format"},{"from":"./log"},{"from":"./media-query"},{"from":"./mutation"},{"from":"./numeric"},{"from":"./ui-config"},{"from":"./window"}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./format"},{"from":"./log"},{"from":"./media-query"},{"from":"./mutation"},{"from":"./numeric"},{"from":"./ui-config"},{"from":"./window"}]}] |
@@ -1,3 +0,3 @@ | ||
export { SkyNumericPipe } from './numeric.pipe'; | ||
export { SkyNumericService } from './numeric.service'; | ||
export { SkyNumericModule } from './numeric.module'; | ||
export * from './numeric.pipe'; | ||
export * from './numeric.service'; | ||
export * from './numeric.module'; |
@@ -1,4 +0,4 @@ | ||
export { SkyNumericPipe } from './numeric.pipe'; | ||
export { SkyNumericService } from './numeric.service'; | ||
export { SkyNumericModule } from './numeric.module'; | ||
export * from './numeric.pipe'; | ||
export * from './numeric.service'; | ||
export * from './numeric.module'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./numeric.pipe","export":["SkyNumericPipe"]},{"from":"./numeric.service","export":["SkyNumericService"]},{"from":"./numeric.module","export":["SkyNumericModule"]}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./numeric.pipe","export":["SkyNumericPipe"]},{"from":"./numeric.service","export":["SkyNumericService"]},{"from":"./numeric.module","export":["SkyNumericModule"]}]}] | ||
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./numeric.pipe"},{"from":"./numeric.service"},{"from":"./numeric.module"}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./numeric.pipe"},{"from":"./numeric.service"},{"from":"./numeric.module"}]}] |
@@ -7,2 +7,3 @@ export declare class NumericOptions { | ||
truncateAfter?: number; | ||
minDigits?: number; | ||
} |
@@ -46,2 +46,10 @@ import { Pipe } from '@angular/core'; | ||
} | ||
// If the minimum digits is less than the set maximum digits then throw an error | ||
if (config && config.minDigits && config.digits && config.minDigits > config.digits) { | ||
throw new Error('The `digits` property must be greater than or equal to the `minDigits` property'); | ||
// If there is a minimum digits given but not a maximum then default the maximum to the minimum | ||
} | ||
else if (config && config.minDigits && !config.digits) { | ||
config.digits = config.minDigits; | ||
} | ||
Object.assign(options, config); | ||
@@ -48,0 +56,0 @@ return this.skyNumeric.formatNumber(value, options); |
@@ -12,20 +12,3 @@ // #region imports | ||
// We should switch to using SkyAppResources in the next major release. | ||
this.symbols = { | ||
"skyux_numeric_billions_symbol": { | ||
"_description": "Symbol to be used when abbreviating a \"billion\" number.", | ||
"message": "B" | ||
}, | ||
"skyux_numeric_millions_symbol": { | ||
"_description": "Symbol to be used when abbreviating a \"million\" number.", | ||
"message": "M" | ||
}, | ||
"skyux_numeric_thousands_symbol": { | ||
"_description": "Symbol to be used when abbreviating a \"thousand\" number.", | ||
"message": "K" | ||
}, | ||
"skyux_numeric_trillions_symbol": { | ||
"_description": "Symbol to be used when abbreviating a \"trillion\" number.", | ||
"message": "T" | ||
} | ||
}; | ||
this.symbols = require('!json-loader!.skypageslocales/resources_en_US.json'); | ||
this.symbolIndex = [ | ||
@@ -77,3 +60,6 @@ { value: 1E12, label: this.getSymbol('skyux_numeric_trillions_symbol') }, | ||
var isDecimal = (value % 1 !== 0); | ||
if (!isShortened && isDecimal && options.digits >= 2) { | ||
if (options.minDigits) { | ||
digits = "1." + options.minDigits + "-" + options.digits; | ||
} | ||
else if (!isShortened && isDecimal && options.digits >= 2) { | ||
digits = "1.2-" + options.digits; | ||
@@ -92,3 +78,6 @@ } | ||
// decimal separator | ||
if (options.truncate) { | ||
if (options.minDigits) { | ||
digits = "1." + options.minDigits + "-" + options.digits; | ||
} | ||
else if (options.truncate) { | ||
digits = "1.0-" + options.digits; | ||
@@ -95,0 +84,0 @@ } |
{ | ||
"name": "@skyux/core", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"description": "SKY UX Core", | ||
"main": "bundles/bundle.umd.js", | ||
"module": "index.js", | ||
"engines": { | ||
"node": ">=8.11.1" | ||
}, | ||
"scripts": { | ||
@@ -45,6 +42,6 @@ "build": "skyux build-public-library", | ||
"@angular/router": "4.3.6", | ||
"@blackbaud/skyux": "2.25.0", | ||
"@blackbaud/skyux-builder": "1.22.0", | ||
"@skyux-sdk/builder-plugin-skyux": "1.0.0-alpha.0", | ||
"@skyux-sdk/e2e": "3.0.0-alpha.0", | ||
"@blackbaud/skyux": "2.27.2", | ||
"@blackbaud/skyux-builder": "1.26.1", | ||
"@skyux-sdk/builder-plugin-skyux": "1.0.0-rc.3", | ||
"@skyux-sdk/e2e": "3.0.0", | ||
"core-js": "2.4.1", | ||
@@ -51,0 +48,0 @@ "rxjs": "5.4.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
78648
113
778