@skyux/core
Advanced tools
Comparing version 3.2.0 to 3.2.1
@@ -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"),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}])}); | ||
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("@angular/core"),require("@angular/common"),require("@skyux/i18n"),require("rxjs/BehaviorSubject"),require("rxjs/Observable"),require("rxjs/add/observable/of")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/common","@skyux/i18n","rxjs/BehaviorSubject","rxjs/Observable","rxjs/add/observable/of"],r):"object"==typeof exports?exports["skyux-core"]=r(require("@angular/core"),require("@angular/common"),require("@skyux/i18n"),require("rxjs/BehaviorSubject"),require("rxjs/Observable"),require("rxjs/add/observable/of")):e["skyux-core"]=r(e["@angular/core"],e["@angular/common"],e["@skyux/i18n"],e["rxjs/BehaviorSubject"],e["rxjs/Observable"],e["rxjs/add/observable/of"])}(this,function(e,r,t,i,n,o){return function(e){function __webpack_require__(t){if(r[t])return r[t].exports;var i=r[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}var r={};return __webpack_require__.m=e,__webpack_require__.c=r,__webpack_require__.i=function(e){return e},__webpack_require__.d=function(e,r,t){__webpack_require__.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,"a",r),r},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=9)}([function(r,t){r.exports=e},function(e,t){e.exports=r},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=t(1),o=t(7),s=function(){function SkyNumericService(e,r,t){this.currencyPipe=e,this.decimalPipe=r,this.resourcesService=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,r){if(isNaN(e))return"";var t,i=/\.0+$|(\.[0-9]*[1-9])0+$/,n=this.symbolIndex.find(function(t){return r.truncate&&(e>=r.truncateAfter&&e>=t.value||-e>=r.truncateAfter&&-e>=t.value)});t=n?Number(Math.round(parseFloat(e/n.value+"e"+r.digits))+"e-"+r.digits).toString().replace(i,"$1")+n.label:Number(Math.round(parseFloat(e+"e"+r.digits))+"e-"+r.digits).toString().replace(i,"$1"),this.storeShortenSymbol(t);var o;switch(r.format.toLowerCase()){case"currency":var s=e>this.symbolIndex[this.symbolIndex.length-1].value,u=e%1!=0;o=r.minDigits?"1."+r.minDigits+"-"+r.digits:!s&&u&&r.digits>=2?"1.2-"+r.digits:"1.0-"+r.digits,t=this.currencyPipe.transform(parseFloat(t),r.iso,!0,o);break;default:o=r.minDigits?"1."+r.minDigits+"-"+r.digits:r.truncate?"1.0-"+r.digits:"1."+r.digits+"-"+r.digits,t=this.decimalPipe.transform(parseFloat(t),o)}return r.truncate&&(t=this.replaceShortenSymbol(t)),t},SkyNumericService.prototype.storeShortenSymbol=function(e){var r=this.symbolIndex.map(function(e){return e.label}),t=new RegExp(r.join("|"),"ig"),i=e.match(t);this.shortSymbol=i?i.toString():""},SkyNumericService.prototype.replaceShortenSymbol=function(e){var r=/(\d)(?!.*\d)/g.exec(e),t=r.index+r.length;return e.substring(0,t)+this.shortSymbol+e.substring(t)},SkyNumericService.prototype.getSymbol=function(e){return this.resourcesService.getStringForLocale({locale:"en_US"},e)},SkyNumericService}();s=__decorate([i.Injectable(),__metadata("design:paramtypes",[n.CurrencyPipe,n.DecimalPipe,o.SkyLibResourcesService])],s),r.SkyNumericService=s},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=function(){function SkyLogService(){}return SkyLogService.prototype.warn=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];window.console&&window.console.warn.apply(window.console,arguments)},SkyLogService}();n=__decorate([i.Injectable()],n),r.SkyLogService=n},function(e,r,t){"use strict";Object.defineProperty(r,"__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"}(r.SkyMediaBreakpoints||(r.SkyMediaBreakpoints={}))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=t(29),o=t(4),s=u=function(){function SkyMediaQueryService(e){var r=this;this.zone=e,this._current=o.SkyMediaBreakpoints.md,this.currentSubject=new n.BehaviorSubject(this.current),this.xsListener=function(e){r.setupListener(e,o.SkyMediaBreakpoints.xs)},this.smListener=function(e){r.setupListener(e,o.SkyMediaBreakpoints.sm)},this.mdListener=function(e){r.setupListener(e,o.SkyMediaBreakpoints.md)},this.lgListener=function(e){r.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(r){e(r)}})},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,r){var t=this;this.zone.run(function(){e.matches&&(t._current=r,t.currentSubject.next(r))})},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),r.SkyMediaQueryService=s;var u},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=t(2),o=t(20),s=function(){function SkyNumericPipe(e){this.skyNumeric=e}return SkyNumericPipe.prototype.transform=function(e,r){var t=new o.NumericOptions;if(r&&!1===r.truncate&&void 0===r.digits&&(r.digits=0),r&&r.minDigits&&r.digits&&r.minDigits>r.digits)throw new Error("The `digits` property must be greater than or equal to the `minDigits` property");return r&&r.minDigits&&!r.digits&&(r.digits=r.minDigits),Object.assign(t,r),this.skyNumeric.formatNumber(e,t)},SkyNumericPipe}();s=__decorate([i.Pipe({name:"skyNumeric"}),__metadata("design:paramtypes",[n.SkyNumericService])],s),r.SkyNumericPipe=s},function(e,r){e.exports=t},function(e,r,t){"use strict";function __export(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0}),__export(t(11)),__export(t(12)),__export(t(14)),__export(t(16)),__export(t(18)),__export(t(23)),__export(t(25))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(t(8))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=function(){function SkyAppFormat(){}return SkyAppFormat.prototype.formatText=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return String(e).replace(/\{(\d+)\}/g,function(e,t){return r[parseInt(t,10)]})},SkyAppFormat}();n=__decorate([i.Injectable()],n),r.SkyAppFormat=n;var o=function(){function SkyFormat(){}return SkyFormat.formatText=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];return this.isEmpty(e)?"":String(e).replace(/\{(\d+)\}/g,function(e,t){return r[parseInt(t,10)]})},SkyFormat.isEmpty=function(e){return null===e||void 0===e},SkyFormat}();r.SkyFormat=o},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(t(10))},function(e,r,t){"use strict";function __export(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0}),__export(t(13)),__export(t(3))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=t(1),o=t(3),s=function(){function SkyLogModule(){}return SkyLogModule}();s=__decorate([i.NgModule({imports:[n.CommonModule],providers:[o.SkyLogService]})],s),r.SkyLogModule=s},function(e,r,t){"use strict";function __export(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0}),__export(t(15)),__export(t(5)),__export(t(4))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=t(1),o=t(5),s=function(){function SkyMediaQueryModule(){}return SkyMediaQueryModule}();s=__decorate([i.NgModule({providers:[o.SkyMediaQueryService],imports:[n.CommonModule]})],s),r.SkyMediaQueryModule=s},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(t(17))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=function(){function MutationObserverService(){}return MutationObserverService.prototype.create=function(e){return new MutationObserver(e)},MutationObserverService}();n=__decorate([i.Injectable()],n),r.MutationObserverService=n},function(e,r,t){"use strict";function __export(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0}),__export(t(6)),__export(t(2)),__export(t(19))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=t(1),o=t(22),s=t(6),u=t(2),c=function(){function SkyNumericModule(){}return SkyNumericModule}();c=__decorate([i.NgModule({declarations:[s.SkyNumericPipe],providers:[u.SkyNumericService,n.CurrencyPipe,n.DecimalPipe],imports:[o.SkyCoreResourcesModule],exports:[s.SkyNumericPipe]})],c),r.SkyNumericModule=c},function(e,r,t){"use strict";Object.defineProperty(r,"__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}();r.NumericOptions=i},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=t(7),o=t(28),s=function(){function SkyCoreResourcesModule(){}return SkyCoreResourcesModule}();s=__decorate([i.NgModule({providers:[{provide:n.SKY_LIB_RESOURCES_PROVIDERS,useClass:o.SkyCoreResourcesProvider,multi:!0}]})],s),r.SkyCoreResourcesModule=s},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(t(21))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}(t(24))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=t(30);t(31);var o=function(){function SkyUIConfigService(){}return SkyUIConfigService.prototype.getConfig=function(e,r){return n.Observable.of(r)},SkyUIConfigService.prototype.setConfig=function(e,r){return n.Observable.of({})},SkyUIConfigService}();o=__decorate([i.Injectable()],o),r.SkyUIConfigService=o},function(e,r,t){"use strict";function __export(e){for(var t in e)r.hasOwnProperty(t)||(r[t]=e[t])}Object.defineProperty(r,"__esModule",{value:!0}),__export(t(26)),__export(t(27))},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=function(){function SkyWindowRefService(){}return SkyWindowRefService.prototype.getWindow=function(){return window},SkyWindowRefService}();n=__decorate([i.Injectable()],n),r.SkyWindowRefService=n},function(e,r,t){"use strict";function getWindow(){return window}Object.defineProperty(r,"__esModule",{value:!0});var i=t(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),r.SkyAppWindowRef=n},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var i=t(0),n=function(){function SkyCoreResourcesProvider(){this.resources={en_US:{skyux_numeric_billions_symbol:"B",skyux_numeric_millions_symbol:"M",skyux_numeric_thousands_symbol:"K",skyux_numeric_trillions_symbol:"T"}}}return SkyCoreResourcesProvider.prototype.getString=function(e,r){var t=e.locale.replace("-","_"),i=this.resources[t];return i?i[r]:""},SkyCoreResourcesProvider}();n=__decorate([i.Injectable()],n),r.SkyCoreResourcesProvider=n},function(e,r){e.exports=i},function(e,r){e.exports=n},function(e,r){e.exports=o}])}); |
@@ -0,1 +1,5 @@ | ||
# 3.2.1 (2018-10-29) | ||
- Fixed numeric module to use correct locale resources provider. [#35](https://github.com/blackbaud/skyux-core/pull/35) | ||
# 3.2.0 (2018-10-29) | ||
@@ -2,0 +6,0 @@ |
import { NgModule } from '@angular/core'; | ||
import { CurrencyPipe, DecimalPipe } from '@angular/common'; | ||
import { SkyCoreResourcesModule } from '../shared'; | ||
import { SkyNumericPipe } from './numeric.pipe'; | ||
@@ -21,2 +22,5 @@ import { SkyNumericService } from './numeric.service'; | ||
], | ||
imports: [ | ||
SkyCoreResourcesModule | ||
], | ||
exports: [ | ||
@@ -23,0 +27,0 @@ SkyNumericPipe |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"SkyNumericModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./numeric.pipe","name":"SkyNumericPipe"}],"providers":[{"__symbolic":"reference","module":"./numeric.service","name":"SkyNumericService"},{"__symbolic":"reference","module":"@angular/common","name":"CurrencyPipe"},{"__symbolic":"reference","module":"@angular/common","name":"DecimalPipe"}],"exports":[{"__symbolic":"reference","module":"./numeric.pipe","name":"SkyNumericPipe"}]}]}]}}},{"__symbolic":"module","version":1,"metadata":{"SkyNumericModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./numeric.pipe","name":"SkyNumericPipe"}],"providers":[{"__symbolic":"reference","module":"./numeric.service","name":"SkyNumericService"},{"__symbolic":"reference","module":"@angular/common","name":"CurrencyPipe"},{"__symbolic":"reference","module":"@angular/common","name":"DecimalPipe"}],"exports":[{"__symbolic":"reference","module":"./numeric.pipe","name":"SkyNumericPipe"}]}]}]}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"SkyNumericModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./numeric.pipe","name":"SkyNumericPipe"}],"providers":[{"__symbolic":"reference","module":"./numeric.service","name":"SkyNumericService"},{"__symbolic":"reference","module":"@angular/common","name":"CurrencyPipe"},{"__symbolic":"reference","module":"@angular/common","name":"DecimalPipe"}],"imports":[{"__symbolic":"reference","module":"../shared","name":"SkyCoreResourcesModule"}],"exports":[{"__symbolic":"reference","module":"./numeric.pipe","name":"SkyNumericPipe"}]}]}]}}},{"__symbolic":"module","version":1,"metadata":{"SkyNumericModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","module":"./numeric.pipe","name":"SkyNumericPipe"}],"providers":[{"__symbolic":"reference","module":"./numeric.service","name":"SkyNumericService"},{"__symbolic":"reference","module":"@angular/common","name":"CurrencyPipe"},{"__symbolic":"reference","module":"@angular/common","name":"DecimalPipe"}],"imports":[{"__symbolic":"reference","module":"../shared","name":"SkyCoreResourcesModule"}],"exports":[{"__symbolic":"reference","module":"./numeric.pipe","name":"SkyNumericPipe"}]}]}]}}}] |
import { CurrencyPipe, DecimalPipe } from '@angular/common'; | ||
import { SkyLibResourcesService } from '@skyux/i18n'; | ||
import { NumericOptions } from './numeric.options'; | ||
@@ -6,6 +7,6 @@ export declare class SkyNumericService { | ||
private decimalPipe; | ||
private resourcesService; | ||
shortSymbol: string; | ||
private symbols; | ||
private symbolIndex; | ||
constructor(currencyPipe: CurrencyPipe, decimalPipe: DecimalPipe); | ||
constructor(currencyPipe: CurrencyPipe, decimalPipe: DecimalPipe, resourcesService: SkyLibResourcesService); | ||
/** | ||
@@ -30,10 +31,3 @@ * Shortens with or without symbol (K/M/B/T) depending on value of number. | ||
private replaceShortenSymbol(value); | ||
/** | ||
* This method is a stand-in for the old SkyResources service from skyux2. | ||
* TODO: We should consider using Builder's resources service instead, but it will | ||
* require a breaking change since the `formatNumber` method is currently synchronous, | ||
* and Builder's service is asynchronous. | ||
* @param key | ||
*/ | ||
private getSymbol(key); | ||
} |
// #region imports | ||
import { Injectable } from '@angular/core'; | ||
import { CurrencyPipe, DecimalPipe } from '@angular/common'; | ||
import { SkyLibResourcesService } from '@skyux/i18n'; | ||
// #endregion | ||
var SkyNumericService = (function () { | ||
function SkyNumericService(currencyPipe, decimalPipe) { | ||
function SkyNumericService(currencyPipe, decimalPipe, resourcesService) { | ||
this.currencyPipe = currencyPipe; | ||
this.decimalPipe = decimalPipe; | ||
// TODO: The following require statement is not recommended, but was done | ||
// to avoid a breaking change (SkyResources is synchronous, but SkyAppResources is asynchronous). | ||
// We should switch to using SkyAppResources in the next major release. | ||
this.symbols = require('!json-loader!.skypageslocales/resources_en_US.json'); | ||
this.resourcesService = resourcesService; | ||
this.symbolIndex = [ | ||
@@ -116,11 +114,5 @@ { value: 1E12, label: this.getSymbol('skyux_numeric_trillions_symbol') }, | ||
}; | ||
/** | ||
* This method is a stand-in for the old SkyResources service from skyux2. | ||
* TODO: We should consider using Builder's resources service instead, but it will | ||
* require a breaking change since the `formatNumber` method is currently synchronous, | ||
* and Builder's service is asynchronous. | ||
* @param key | ||
*/ | ||
SkyNumericService.prototype.getSymbol = function (key) { | ||
return this.symbols[key].message; | ||
// TODO: Need to implement the async `getString` method in a breaking change. | ||
return this.resourcesService.getStringForLocale({ locale: 'en_US' }, key); | ||
}; | ||
@@ -137,3 +129,4 @@ return SkyNumericService; | ||
{ type: DecimalPipe, }, | ||
{ type: SkyLibResourcesService, }, | ||
]; }; | ||
//# sourceMappingURL=numeric.service.js.map |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"SkyNumericService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common","name":"CurrencyPipe"},{"__symbolic":"reference","module":"@angular/common","name":"DecimalPipe"}]}],"formatNumber":[{"__symbolic":"method"}],"storeShortenSymbol":[{"__symbolic":"method"}],"replaceShortenSymbol":[{"__symbolic":"method"}],"getSymbol":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"SkyNumericService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common","name":"CurrencyPipe"},{"__symbolic":"reference","module":"@angular/common","name":"DecimalPipe"}]}],"formatNumber":[{"__symbolic":"method"}],"storeShortenSymbol":[{"__symbolic":"method"}],"replaceShortenSymbol":[{"__symbolic":"method"}],"getSymbol":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"SkyNumericService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common","name":"CurrencyPipe"},{"__symbolic":"reference","module":"@angular/common","name":"DecimalPipe"},{"__symbolic":"reference","module":"@skyux/i18n","name":"SkyLibResourcesService"}]}],"formatNumber":[{"__symbolic":"method"}],"storeShortenSymbol":[{"__symbolic":"method"}],"replaceShortenSymbol":[{"__symbolic":"method"}],"getSymbol":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"SkyNumericService":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable"}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/common","name":"CurrencyPipe"},{"__symbolic":"reference","module":"@angular/common","name":"DecimalPipe"},{"__symbolic":"reference","module":"@skyux/i18n","name":"SkyLibResourcesService"}]}],"formatNumber":[{"__symbolic":"method"}],"storeShortenSymbol":[{"__symbolic":"method"}],"replaceShortenSymbol":[{"__symbolic":"method"}],"getSymbol":[{"__symbolic":"method"}]}}}}] |
{ | ||
"name": "@skyux/core", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"description": "SKY UX Core", | ||
@@ -28,3 +28,3 @@ "main": "bundles/bundle.umd.js", | ||
"@angular/core": "^4.3.6", | ||
"rxjs": "^5.4.3" | ||
"@skyux/i18n": "^3.2.0" | ||
}, | ||
@@ -31,0 +31,0 @@ "dependencies": {}, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84939
125
819