New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-currency

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-currency - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

4

bundles/ngx-currency.umd.js
/**
* ngx-currency - A very simple currency mask directive that allows using a number attribute with the ngModel.
* @version v2.0.1
* @version v2.0.2
* @author Neri Bez Fontana

@@ -8,3 +8,3 @@ * @link https://github.com/nbfontana/ngx-currency#readme

*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/forms","@angular/common"],t):"object"==typeof exports?exports.ngxBr=t(require("@angular/core"),require("@angular/forms"),require("@angular/common")):e.ngxBr=t(e.ng.core,e.ng.forms,e.ng.common)}(window,(function(e,t,n){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,i){t(n,i,e)}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=n(2),a=n(3),l=n(5);t.CURRENCYMASKDIRECTIVE_VALUE_ACCESSOR={provide:u.NG_VALUE_ACCESSOR,useExisting:s.forwardRef((function(){return p})),multi:!0};var p=function(){function e(e,t,n){this.currencyMaskConfig=e,this.elementRef=t,this.keyValueDiffers=n,this.options={},this.optionsTemplate={align:"right",allowNegative:!0,allowZero:!0,decimal:".",precision:2,prefix:"$ ",suffix:"",thousands:",",nullable:!1},e&&(this.optionsTemplate=e),this.keyValueDiffer=n.find({}).create()}return e.prototype.ngAfterViewInit=function(){this.elementRef.nativeElement.style.textAlign=this.options?this.options.align:this.optionsTemplate.align},e.prototype.ngDoCheck=function(){this.keyValueDiffer.diff(this.options)&&(this.elementRef.nativeElement.style.textAlign=this.options.align?this.options.align:this.optionsTemplate.align,this.inputHandler.updateOptions(Object.assign({},this.optionsTemplate,this.options)))},e.prototype.ngOnInit=function(){this.inputHandler=new l.InputHandler(this.elementRef.nativeElement,Object.assign({},this.optionsTemplate,this.options))},e.prototype.handleBlur=function(e){this.inputHandler.getOnModelTouched().apply(e)},e.prototype.handleCut=function(e){this.isChromeAndroid()||this.inputHandler.handleCut(e)},e.prototype.handleInput=function(e){this.isChromeAndroid()&&this.inputHandler.handleInput(e)},e.prototype.handleKeydown=function(e){this.isChromeAndroid()||this.inputHandler.handleKeydown(e)},e.prototype.handleKeypress=function(e){this.isChromeAndroid()||this.inputHandler.handleKeypress(e)},e.prototype.handlePaste=function(e){this.isChromeAndroid()||this.inputHandler.handlePaste(e)},e.prototype.isChromeAndroid=function(){return/chrome/i.test(navigator.userAgent)&&/android/i.test(navigator.userAgent)},e.prototype.registerOnChange=function(e){this.inputHandler.setOnModelChange(e)},e.prototype.registerOnTouched=function(e){this.inputHandler.setOnModelTouched(e)},e.prototype.setDisabledState=function(e){this.elementRef.nativeElement.disabled=e},e.prototype.writeValue=function(e){this.inputHandler.setValue(e)},i([s.Input(),r("design:type",Object)],e.prototype,"options",void 0),i([s.HostListener("blur",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleBlur",null),i([s.HostListener("cut",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleCut",null),i([s.HostListener("input",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleInput",null),i([s.HostListener("keydown",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleKeydown",null),i([s.HostListener("keypress",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleKeypress",null),i([s.HostListener("paste",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handlePaste",null),e=i([s.Directive({selector:"[currencyMask]",providers:[t.CURRENCYMASKDIRECTIVE_VALUE_ACCESSOR]}),o(0,s.Optional()),o(0,s.Inject(a.CURRENCY_MASK_CONFIG)),r("design:paramtypes",[Object,s.ElementRef,s.KeyValueDiffers])],e)}();t.CurrencyMaskDirective=p},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.CURRENCY_MASK_CONFIG=new i.InjectionToken("currency.mask.config")},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(1)),i(n(8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),r=function(){function e(e,t){this.inputService=new i.InputService(e,t)}return e.prototype.handleCut=function(e){var t=this;setTimeout((function(){t.inputService.updateFieldValue(),t.setValue(t.inputService.value),t.onModelChange(t.inputService.value)}),0)},e.prototype.handleInput=function(e){var t=this.inputService.rawValue.charCodeAt(this.inputService.rawValue.length-1),n=this.inputService.rawValue.length,i=this.inputService.inputSelection.selectionEnd,r=this.inputService.storedRawValue.length;if(this.inputService.rawValue=this.inputService.storedRawValue,n==i&&1==Math.abs(n-r)){if(n<r&&this.inputService.removeNumber(8),n>r)switch(t){case 43:this.inputService.changeToPositive();break;case 45:this.inputService.changeToNegative();break;default:if(!this.inputService.canInputMoreNumbers)return;this.inputService.addNumber(t)}this.setCursorPosition(e),this.onModelChange(this.inputService.value)}else this.setCursorPosition(e)},e.prototype.handleKeydown=function(e){var t=e.which||e.charCode||e.keyCode;if(8==t||46==t||63272==t){e.preventDefault();var n=Math.abs(this.inputService.inputSelection.selectionEnd-this.inputService.inputSelection.selectionStart);0==n&&(this.inputService.removeNumber(t),this.onModelChange(this.inputService.value)),n>=this.inputService.rawValue.length-this.inputService.prefixLength()&&this.clearValue()}},e.prototype.clearValue=function(){this.setValue(this.inputService.isNullable()?null:0),this.onModelChange(this.inputService.value)},e.prototype.handleKeypress=function(e){var t=e.which||e.charCode||e.keyCode;if(97!==t||!e.ctrlKey){switch(t){case void 0:case 9:case 13:case 37:case 39:return;case 43:this.inputService.changeToPositive();break;case 45:this.inputService.changeToNegative();break;default:if(this.inputService.canInputMoreNumbers)Math.abs(this.inputService.inputSelection.selectionEnd-this.inputService.inputSelection.selectionStart)==this.inputService.rawValue.length&&this.setValue(0),this.inputService.addNumber(t)}e.preventDefault(),this.onModelChange(this.inputService.value)}},e.prototype.handlePaste=function(e){var t=this;setTimeout((function(){t.inputService.updateFieldValue(),t.setValue(t.inputService.value),t.onModelChange(t.inputService.value)}),1)},e.prototype.updateOptions=function(e){this.inputService.updateOptions(e)},e.prototype.getOnModelChange=function(){return this.onModelChange},e.prototype.setOnModelChange=function(e){this.onModelChange=e},e.prototype.getOnModelTouched=function(){return this.onModelTouched},e.prototype.setOnModelTouched=function(e){this.onModelTouched=e},e.prototype.setValue=function(e){this.inputService.value=e},e.prototype.setCursorPosition=function(e){setTimeout((function(){e.target.setSelectionRange(e.target.value.length,e.target.value.length)}),0)},e}();t.InputHandler=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),r=function(){function e(e,t){this.htmlInputElement=e,this.options=t,this.PER_AR_NUMBER=new Map,this.inputManager=new i.InputManager(e),this.initialize()}return e.prototype.initialize=function(){this.PER_AR_NUMBER.set("۰","0"),this.PER_AR_NUMBER.set("۱","1"),this.PER_AR_NUMBER.set("۲","2"),this.PER_AR_NUMBER.set("۳","3"),this.PER_AR_NUMBER.set("۴","4"),this.PER_AR_NUMBER.set("۵","5"),this.PER_AR_NUMBER.set("۶","6"),this.PER_AR_NUMBER.set("۷","7"),this.PER_AR_NUMBER.set("۸","8"),this.PER_AR_NUMBER.set("۹","9"),this.PER_AR_NUMBER.set("٠","0"),this.PER_AR_NUMBER.set("١","1"),this.PER_AR_NUMBER.set("٢","2"),this.PER_AR_NUMBER.set("٣","3"),this.PER_AR_NUMBER.set("٤","4"),this.PER_AR_NUMBER.set("٥","5"),this.PER_AR_NUMBER.set("٦","6"),this.PER_AR_NUMBER.set("٧","7"),this.PER_AR_NUMBER.set("٨","8"),this.PER_AR_NUMBER.set("٩","9")},e.prototype.addNumber=function(e){this.rawValue||(this.rawValue=this.applyMask(!1,"0"));var t=String.fromCharCode(e),n=this.inputSelection.selectionStart,i=this.inputSelection.selectionEnd;this.rawValue=this.rawValue.substring(0,n)+t+this.rawValue.substring(i,this.rawValue.length),this.updateFieldValue(n+1)},e.prototype.applyMask=function(e,t){var n=this.options,i=n.allowNegative,r=n.decimal,o=n.precision,s=n.prefix,u=n.suffix,a=n.thousands,l=(n.nullable,(t=e?new Number(t).toFixed(o):t).replace(/[^0-9\u0660-\u0669\u06F0-\u06F9]/g,""));if(!l)return"";var p=l.slice(0,l.length-o).replace(/^\u0660*/g,"").replace(/^\u06F0*/g,"").replace(/^0*/g,"").replace(/\B(?=([0-9\u0660-\u0669\u06F0-\u06F9]{3})+(?![0-9\u0660-\u0669\u06F0-\u06F9]))/g,a);a&&p.startsWith(a)&&(p=p.substring(1)),""==p&&(p="0");var c=p,h=l.slice(l.length-o);o>0&&("0"==c&&h.length<o?c+=r+"0".repeat(o-1)+h:c+=r+h);var d=0==parseInt(p)&&(0==parseInt(h)||""==h);return(t.indexOf("-")>-1&&i&&!d?"-":"")+s+c+u},e.prototype.clearMask=function(e){if(this.isNullable()&&""===e)return null;var t=(e||"0").replace(this.options.prefix,"").replace(this.options.suffix,"");return this.options.thousands&&(t=t.replace(new RegExp("\\"+this.options.thousands,"g"),"")),this.options.decimal&&(t=t.replace(this.options.decimal,".")),this.PER_AR_NUMBER.forEach((function(e,n){var i=new RegExp(n,"g");t=t.replace(i,e)})),parseFloat(t)},e.prototype.changeToNegative=function(){this.options.allowNegative&&""!=this.rawValue&&"-"!=this.rawValue.charAt(0)&&0!=this.value&&(this.rawValue="-"+this.rawValue)},e.prototype.changeToPositive=function(){this.rawValue=this.rawValue.replace("-","")},e.prototype.removeNumber=function(e){if(this.isNullable()&&0==this.value)this.rawValue=null;else{var t=this.inputSelection.selectionEnd,n=this.inputSelection.selectionStart;n>this.rawValue.length-this.options.suffix.length&&(t=this.rawValue.length-this.options.suffix.length,n=this.rawValue.length-this.options.suffix.length);var i=this.rawValue.substr(n-1,1).match(/\d/)?0:-1;(8!=e||n-1!=0||this.rawValue.substr(n,1).match(/\d/))&&(46!=e&&63272!=e||0!==n||this.rawValue.substr(n+1,1).match(/\d/))||(i=1),t=46==e||63272==e?t+1:t,n=8==e?n-1:n,this.rawValue=this.rawValue.substring(0,n)+this.rawValue.substring(t,this.rawValue.length),this.updateFieldValue(n+i)}},e.prototype.updateFieldValue=function(e){var t=this.applyMask(!1,this.rawValue||"");e=null==e?this.rawValue.length:e,this.inputManager.updateValueAndCursor(t,this.rawValue.length,e)},e.prototype.updateOptions=function(e){var t=this.value;this.options=e,this.value=t},e.prototype.prefixLength=function(){return this.options.prefix.length},e.prototype.isNullable=function(){return this.options.nullable},Object.defineProperty(e.prototype,"canInputMoreNumbers",{get:function(){return this.inputManager.canInputMoreNumbers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSelection",{get:function(){return this.inputManager.inputSelection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.inputManager.rawValue},set:function(e){this.inputManager.rawValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storedRawValue",{get:function(){return this.inputManager.storedRawValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.clearMask(this.rawValue)},set:function(e){this.rawValue=this.applyMask(!0,""+e)},enumerable:!0,configurable:!0}),e}();t.InputService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.htmlInputElement=e}return e.prototype.setCursorAt=function(e){if(this.htmlInputElement.setSelectionRange)this.htmlInputElement.focus(),this.htmlInputElement.setSelectionRange(e,e);else if(this.htmlInputElement.createTextRange){var t=this.htmlInputElement.createTextRange();t.collapse(!0),t.moveEnd("character",e),t.moveStart("character",e),t.select()}},e.prototype.updateValueAndCursor=function(e,t,n){this.rawValue=e,n-=t-e.length,this.setCursorAt(n)},Object.defineProperty(e.prototype,"canInputMoreNumbers",{get:function(){var e=!(this.rawValue.length>=this.htmlInputElement.maxLength&&this.htmlInputElement.maxLength>=0),t=this.inputSelection.selectionStart,n=this.inputSelection.selectionEnd,i=!(t==n||!this.htmlInputElement.value.substring(t,n).match(/[^0-9\u0660-\u0669\u06F0-\u06F9]/)),r="0"==this.htmlInputElement.value.substring(0,1);return e||i||r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSelection",{get:function(){var e=0,t=0;if("number"==typeof this.htmlInputElement.selectionStart&&"number"==typeof this.htmlInputElement.selectionEnd)e=this.htmlInputElement.selectionStart,t=this.htmlInputElement.selectionEnd;else{var n=document.selection.createRange();if(n&&n.parentElement()==this.htmlInputElement){var i=this.htmlInputElement.value.length,r=this.htmlInputElement.value.replace(/\r\n/g,"\n"),o=this.htmlInputElement.createTextRange();o.moveToBookmark(n.getBookmark());var s=this.htmlInputElement.createTextRange();s.collapse(!1),o.compareEndPoints("StartToEnd",s)>-1?e=t=i:(e=-o.moveStart("character",-i),e+=r.slice(0,e).split("\n").length-1,o.compareEndPoints("EndToEnd",s)>-1?t=i:(t=-o.moveEnd("character",-i),t+=r.slice(0,t).split("\n").length-1))}}return{selectionStart:e,selectionEnd:t}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.htmlInputElement&&this.htmlInputElement.value},set:function(e){this._storedRawValue=e,this.htmlInputElement&&(this.htmlInputElement.value=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storedRawValue",{get:function(){return this._storedRawValue},enumerable:!0,configurable:!0}),e}();t.InputManager=i},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(9),s=n(2),u=n(1),a=n(3),l=function(){function e(){}var t;return t=e,e.forRoot=function(e){return{ngModule:t,providers:[{provide:a.CURRENCY_MASK_CONFIG,useValue:e}]}},e=t=i([r.NgModule({imports:[o.CommonModule,s.FormsModule],declarations:[u.CurrencyMaskDirective],exports:[u.CurrencyMaskDirective]})],e)}();t.NgxCurrencyModule=l},function(e,t){e.exports=n}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/forms","@angular/common"],t):"object"==typeof exports?exports.ngxBr=t(require("@angular/core"),require("@angular/forms"),require("@angular/common")):e.ngxBr=t(e.ng.core,e.ng.forms,e.ng.common)}(window,(function(e,t,n){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,i){t(n,i,e)}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=n(2),a=n(3),l=n(5);t.CURRENCYMASKDIRECTIVE_VALUE_ACCESSOR={provide:u.NG_VALUE_ACCESSOR,useExisting:s.forwardRef((function(){return p})),multi:!0};var p=function(){function e(e,t,n){this.currencyMaskConfig=e,this.elementRef=t,this.keyValueDiffers=n,this.options={},this.optionsTemplate={align:"right",allowNegative:!0,allowZero:!0,decimal:".",precision:2,prefix:"$ ",suffix:"",thousands:",",nullable:!1},e&&(this.optionsTemplate=e),this.keyValueDiffer=n.find({}).create()}return e.prototype.ngAfterViewInit=function(){this.elementRef.nativeElement.style.textAlign=this.options&&this.options.align?this.options.align:this.optionsTemplate.align},e.prototype.ngDoCheck=function(){this.keyValueDiffer.diff(this.options)&&(this.elementRef.nativeElement.style.textAlign=this.options.align?this.options.align:this.optionsTemplate.align,this.inputHandler.updateOptions(Object.assign({},this.optionsTemplate,this.options)))},e.prototype.ngOnInit=function(){this.inputHandler=new l.InputHandler(this.elementRef.nativeElement,Object.assign({},this.optionsTemplate,this.options))},e.prototype.handleBlur=function(e){this.inputHandler.getOnModelTouched().apply(e)},e.prototype.handleCut=function(e){this.isChromeAndroid()||this.inputHandler.handleCut(e)},e.prototype.handleInput=function(e){this.isChromeAndroid()&&this.inputHandler.handleInput(e)},e.prototype.handleKeydown=function(e){this.isChromeAndroid()||this.inputHandler.handleKeydown(e)},e.prototype.handleKeypress=function(e){this.isChromeAndroid()||this.inputHandler.handleKeypress(e)},e.prototype.handlePaste=function(e){this.isChromeAndroid()||this.inputHandler.handlePaste(e)},e.prototype.isChromeAndroid=function(){return/chrome/i.test(navigator.userAgent)&&/android/i.test(navigator.userAgent)},e.prototype.registerOnChange=function(e){this.inputHandler.setOnModelChange(e)},e.prototype.registerOnTouched=function(e){this.inputHandler.setOnModelTouched(e)},e.prototype.setDisabledState=function(e){this.elementRef.nativeElement.disabled=e},e.prototype.writeValue=function(e){this.inputHandler.setValue(e)},i([s.Input(),r("design:type",Object)],e.prototype,"options",void 0),i([s.HostListener("blur",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleBlur",null),i([s.HostListener("cut",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleCut",null),i([s.HostListener("input",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleInput",null),i([s.HostListener("keydown",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleKeydown",null),i([s.HostListener("keypress",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleKeypress",null),i([s.HostListener("paste",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handlePaste",null),e=i([s.Directive({selector:"[currencyMask]",providers:[t.CURRENCYMASKDIRECTIVE_VALUE_ACCESSOR]}),o(0,s.Optional()),o(0,s.Inject(a.CURRENCY_MASK_CONFIG)),r("design:paramtypes",[Object,s.ElementRef,s.KeyValueDiffers])],e)}();t.CurrencyMaskDirective=p},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.CURRENCY_MASK_CONFIG=new i.InjectionToken("currency.mask.config")},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(1)),i(n(8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),r=function(){function e(e,t){this.inputService=new i.InputService(e,t)}return e.prototype.handleCut=function(e){var t=this;setTimeout((function(){t.inputService.updateFieldValue(),t.setValue(t.inputService.value),t.onModelChange(t.inputService.value)}),0)},e.prototype.handleInput=function(e){var t=this.inputService.rawValue.charCodeAt(this.inputService.rawValue.length-1),n=this.inputService.rawValue.length,i=this.inputService.inputSelection.selectionEnd,r=this.inputService.storedRawValue.length;if(this.inputService.rawValue=this.inputService.storedRawValue,n==i&&1==Math.abs(n-r)){if(n<r&&this.inputService.removeNumber(8),n>r)switch(t){case 43:this.inputService.changeToPositive();break;case 45:this.inputService.changeToNegative();break;default:if(!this.inputService.canInputMoreNumbers)return;this.inputService.addNumber(t)}this.setCursorPosition(e),this.onModelChange(this.inputService.value)}else this.setCursorPosition(e)},e.prototype.handleKeydown=function(e){var t=e.which||e.charCode||e.keyCode;if(8==t||46==t||63272==t){e.preventDefault();var n=Math.abs(this.inputService.inputSelection.selectionEnd-this.inputService.inputSelection.selectionStart);0==n&&(this.inputService.removeNumber(t),this.onModelChange(this.inputService.value)),n>=this.inputService.rawValue.length-this.inputService.prefixLength()&&this.clearValue()}},e.prototype.clearValue=function(){this.setValue(this.inputService.isNullable()?null:0),this.onModelChange(this.inputService.value)},e.prototype.handleKeypress=function(e){var t=e.which||e.charCode||e.keyCode;if(97!==t||!e.ctrlKey){switch(t){case void 0:case 9:case 13:case 37:case 39:return;case 43:this.inputService.changeToPositive();break;case 45:this.inputService.changeToNegative();break;default:if(this.inputService.canInputMoreNumbers)Math.abs(this.inputService.inputSelection.selectionEnd-this.inputService.inputSelection.selectionStart)==this.inputService.rawValue.length&&this.setValue(0),this.inputService.addNumber(t)}e.preventDefault(),this.onModelChange(this.inputService.value)}},e.prototype.handlePaste=function(e){var t=this;setTimeout((function(){t.inputService.updateFieldValue(),t.setValue(t.inputService.value),t.onModelChange(t.inputService.value)}),1)},e.prototype.updateOptions=function(e){this.inputService.updateOptions(e)},e.prototype.getOnModelChange=function(){return this.onModelChange},e.prototype.setOnModelChange=function(e){this.onModelChange=e},e.prototype.getOnModelTouched=function(){return this.onModelTouched},e.prototype.setOnModelTouched=function(e){this.onModelTouched=e},e.prototype.setValue=function(e){this.inputService.value=e},e.prototype.setCursorPosition=function(e){setTimeout((function(){e.target.setSelectionRange(e.target.value.length,e.target.value.length)}),0)},e}();t.InputHandler=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),r=function(){function e(e,t){this.htmlInputElement=e,this.options=t,this.PER_AR_NUMBER=new Map,this.inputManager=new i.InputManager(e),this.initialize()}return e.prototype.initialize=function(){this.PER_AR_NUMBER.set("۰","0"),this.PER_AR_NUMBER.set("۱","1"),this.PER_AR_NUMBER.set("۲","2"),this.PER_AR_NUMBER.set("۳","3"),this.PER_AR_NUMBER.set("۴","4"),this.PER_AR_NUMBER.set("۵","5"),this.PER_AR_NUMBER.set("۶","6"),this.PER_AR_NUMBER.set("۷","7"),this.PER_AR_NUMBER.set("۸","8"),this.PER_AR_NUMBER.set("۹","9"),this.PER_AR_NUMBER.set("٠","0"),this.PER_AR_NUMBER.set("١","1"),this.PER_AR_NUMBER.set("٢","2"),this.PER_AR_NUMBER.set("٣","3"),this.PER_AR_NUMBER.set("٤","4"),this.PER_AR_NUMBER.set("٥","5"),this.PER_AR_NUMBER.set("٦","6"),this.PER_AR_NUMBER.set("٧","7"),this.PER_AR_NUMBER.set("٨","8"),this.PER_AR_NUMBER.set("٩","9")},e.prototype.addNumber=function(e){this.rawValue||(this.rawValue=this.applyMask(!1,"0"));var t=String.fromCharCode(e),n=this.inputSelection.selectionStart,i=this.inputSelection.selectionEnd;this.rawValue=this.rawValue.substring(0,n)+t+this.rawValue.substring(i,this.rawValue.length),this.updateFieldValue(n+1)},e.prototype.applyMask=function(e,t){var n=this.options,i=n.allowNegative,r=n.decimal,o=n.precision,s=n.prefix,u=n.suffix,a=n.thousands,l=(n.nullable,(t=e?new Number(t).toFixed(o):t).replace(/[^0-9\u0660-\u0669\u06F0-\u06F9]/g,""));if(!l)return"";var p=l.slice(0,l.length-o).replace(/^\u0660*/g,"").replace(/^\u06F0*/g,"").replace(/^0*/g,"").replace(/\B(?=([0-9\u0660-\u0669\u06F0-\u06F9]{3})+(?![0-9\u0660-\u0669\u06F0-\u06F9]))/g,a);a&&p.startsWith(a)&&(p=p.substring(1)),""==p&&(p="0");var c=p,h=l.slice(l.length-o);o>0&&("0"==c&&h.length<o?c+=r+"0".repeat(o-1)+h:c+=r+h);var d=0==parseInt(p)&&(0==parseInt(h)||""==h);return(t.indexOf("-")>-1&&i&&!d?"-":"")+s+c+u},e.prototype.clearMask=function(e){if(this.isNullable()&&""===e)return null;var t=(e||"0").replace(this.options.prefix,"").replace(this.options.suffix,"");return this.options.thousands&&(t=t.replace(new RegExp("\\"+this.options.thousands,"g"),"")),this.options.decimal&&(t=t.replace(this.options.decimal,".")),this.PER_AR_NUMBER.forEach((function(e,n){var i=new RegExp(n,"g");t=t.replace(i,e)})),parseFloat(t)},e.prototype.changeToNegative=function(){this.options.allowNegative&&""!=this.rawValue&&"-"!=this.rawValue.charAt(0)&&0!=this.value&&(this.rawValue="-"+this.rawValue)},e.prototype.changeToPositive=function(){this.rawValue=this.rawValue.replace("-","")},e.prototype.removeNumber=function(e){if(this.isNullable()&&0==this.value)this.rawValue=null;else{var t=this.inputSelection.selectionEnd,n=this.inputSelection.selectionStart;n>this.rawValue.length-this.options.suffix.length&&(t=this.rawValue.length-this.options.suffix.length,n=this.rawValue.length-this.options.suffix.length);var i=this.rawValue.substr(n-1,1).match(/\d/)?0:-1;(8!=e||n-1!=0||this.rawValue.substr(n,1).match(/\d/))&&(46!=e&&63272!=e||0!==n||this.rawValue.substr(n+1,1).match(/\d/))||(i=1),t=46==e||63272==e?t+1:t,n=8==e?n-1:n,this.rawValue=this.rawValue.substring(0,n)+this.rawValue.substring(t,this.rawValue.length),this.updateFieldValue(n+i)}},e.prototype.updateFieldValue=function(e){var t=this.applyMask(!1,this.rawValue||"");e=null==e?this.rawValue.length:e,this.inputManager.updateValueAndCursor(t,this.rawValue.length,e)},e.prototype.updateOptions=function(e){var t=this.value;this.options=e,this.value=t},e.prototype.prefixLength=function(){return this.options.prefix.length},e.prototype.isNullable=function(){return this.options.nullable},Object.defineProperty(e.prototype,"canInputMoreNumbers",{get:function(){return this.inputManager.canInputMoreNumbers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSelection",{get:function(){return this.inputManager.inputSelection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.inputManager.rawValue},set:function(e){this.inputManager.rawValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storedRawValue",{get:function(){return this.inputManager.storedRawValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.clearMask(this.rawValue)},set:function(e){this.rawValue=this.applyMask(!0,""+e)},enumerable:!0,configurable:!0}),e}();t.InputService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.htmlInputElement=e}return e.prototype.setCursorAt=function(e){if(this.htmlInputElement.setSelectionRange)this.htmlInputElement.focus(),this.htmlInputElement.setSelectionRange(e,e);else if(this.htmlInputElement.createTextRange){var t=this.htmlInputElement.createTextRange();t.collapse(!0),t.moveEnd("character",e),t.moveStart("character",e),t.select()}},e.prototype.updateValueAndCursor=function(e,t,n){this.rawValue=e,n-=t-e.length,this.setCursorAt(n)},Object.defineProperty(e.prototype,"canInputMoreNumbers",{get:function(){var e=!(this.rawValue.length>=this.htmlInputElement.maxLength&&this.htmlInputElement.maxLength>=0),t=this.inputSelection.selectionStart,n=this.inputSelection.selectionEnd,i=!(t==n||!this.htmlInputElement.value.substring(t,n).match(/[^0-9\u0660-\u0669\u06F0-\u06F9]/)),r="0"==this.htmlInputElement.value.substring(0,1);return e||i||r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSelection",{get:function(){var e=0,t=0;if("number"==typeof this.htmlInputElement.selectionStart&&"number"==typeof this.htmlInputElement.selectionEnd)e=this.htmlInputElement.selectionStart,t=this.htmlInputElement.selectionEnd;else{var n=document.selection.createRange();if(n&&n.parentElement()==this.htmlInputElement){var i=this.htmlInputElement.value.length,r=this.htmlInputElement.value.replace(/\r\n/g,"\n"),o=this.htmlInputElement.createTextRange();o.moveToBookmark(n.getBookmark());var s=this.htmlInputElement.createTextRange();s.collapse(!1),o.compareEndPoints("StartToEnd",s)>-1?e=t=i:(e=-o.moveStart("character",-i),e+=r.slice(0,e).split("\n").length-1,o.compareEndPoints("EndToEnd",s)>-1?t=i:(t=-o.moveEnd("character",-i),t+=r.slice(0,t).split("\n").length-1))}}return{selectionStart:e,selectionEnd:t}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.htmlInputElement&&this.htmlInputElement.value},set:function(e){this._storedRawValue=e,this.htmlInputElement&&(this.htmlInputElement.value=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storedRawValue",{get:function(){return this._storedRawValue},enumerable:!0,configurable:!0}),e}();t.InputManager=i},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(9),s=n(2),u=n(1),a=n(3),l=function(){function e(){}var t;return t=e,e.forRoot=function(e){return{ngModule:t,providers:[{provide:a.CURRENCY_MASK_CONFIG,useValue:e}]}},e=t=i([r.NgModule({imports:[o.CommonModule,s.FormsModule],declarations:[u.CurrencyMaskDirective],exports:[u.CurrencyMaskDirective]})],e)}();t.NgxCurrencyModule=l},function(e,t){e.exports=n}])}));
//# sourceMappingURL=ngx-currency.umd.js.map
/**
* ngx-currency - A very simple currency mask directive that allows using a number attribute with the ngModel.
* @version v2.0.1
* @version v2.0.2
* @author Neri Bez Fontana

@@ -8,3 +8,3 @@ * @link https://github.com/nbfontana/ngx-currency#readme

*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/forms","@angular/common"],t):"object"==typeof exports?exports.ngxBr=t(require("@angular/core"),require("@angular/forms"),require("@angular/common")):e.ngxBr=t(e.ng.core,e.ng.forms,e.ng.common)}(window,(function(e,t,n){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,i){t(n,i,e)}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=n(2),a=n(3),l=n(5);t.CURRENCYMASKDIRECTIVE_VALUE_ACCESSOR={provide:u.NG_VALUE_ACCESSOR,useExisting:s.forwardRef((function(){return p})),multi:!0};var p=function(){function e(e,t,n){this.currencyMaskConfig=e,this.elementRef=t,this.keyValueDiffers=n,this.options={},this.optionsTemplate={align:"right",allowNegative:!0,allowZero:!0,decimal:".",precision:2,prefix:"$ ",suffix:"",thousands:",",nullable:!1},e&&(this.optionsTemplate=e),this.keyValueDiffer=n.find({}).create()}return e.prototype.ngAfterViewInit=function(){this.elementRef.nativeElement.style.textAlign=this.options?this.options.align:this.optionsTemplate.align},e.prototype.ngDoCheck=function(){this.keyValueDiffer.diff(this.options)&&(this.elementRef.nativeElement.style.textAlign=this.options.align?this.options.align:this.optionsTemplate.align,this.inputHandler.updateOptions(Object.assign({},this.optionsTemplate,this.options)))},e.prototype.ngOnInit=function(){this.inputHandler=new l.InputHandler(this.elementRef.nativeElement,Object.assign({},this.optionsTemplate,this.options))},e.prototype.handleBlur=function(e){this.inputHandler.getOnModelTouched().apply(e)},e.prototype.handleCut=function(e){this.isChromeAndroid()||this.inputHandler.handleCut(e)},e.prototype.handleInput=function(e){this.isChromeAndroid()&&this.inputHandler.handleInput(e)},e.prototype.handleKeydown=function(e){this.isChromeAndroid()||this.inputHandler.handleKeydown(e)},e.prototype.handleKeypress=function(e){this.isChromeAndroid()||this.inputHandler.handleKeypress(e)},e.prototype.handlePaste=function(e){this.isChromeAndroid()||this.inputHandler.handlePaste(e)},e.prototype.isChromeAndroid=function(){return/chrome/i.test(navigator.userAgent)&&/android/i.test(navigator.userAgent)},e.prototype.registerOnChange=function(e){this.inputHandler.setOnModelChange(e)},e.prototype.registerOnTouched=function(e){this.inputHandler.setOnModelTouched(e)},e.prototype.setDisabledState=function(e){this.elementRef.nativeElement.disabled=e},e.prototype.writeValue=function(e){this.inputHandler.setValue(e)},i([s.Input(),r("design:type",Object)],e.prototype,"options",void 0),i([s.HostListener("blur",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleBlur",null),i([s.HostListener("cut",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleCut",null),i([s.HostListener("input",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleInput",null),i([s.HostListener("keydown",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleKeydown",null),i([s.HostListener("keypress",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleKeypress",null),i([s.HostListener("paste",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handlePaste",null),e=i([s.Directive({selector:"[currencyMask]",providers:[t.CURRENCYMASKDIRECTIVE_VALUE_ACCESSOR]}),o(0,s.Optional()),o(0,s.Inject(a.CURRENCY_MASK_CONFIG)),r("design:paramtypes",[Object,s.ElementRef,s.KeyValueDiffers])],e)}();t.CurrencyMaskDirective=p},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.CURRENCY_MASK_CONFIG=new i.InjectionToken("currency.mask.config")},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(1)),i(n(8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),r=function(){function e(e,t){this.inputService=new i.InputService(e,t)}return e.prototype.handleCut=function(e){var t=this;setTimeout((function(){t.inputService.updateFieldValue(),t.setValue(t.inputService.value),t.onModelChange(t.inputService.value)}),0)},e.prototype.handleInput=function(e){var t=this.inputService.rawValue.charCodeAt(this.inputService.rawValue.length-1),n=this.inputService.rawValue.length,i=this.inputService.inputSelection.selectionEnd,r=this.inputService.storedRawValue.length;if(this.inputService.rawValue=this.inputService.storedRawValue,n==i&&1==Math.abs(n-r)){if(n<r&&this.inputService.removeNumber(8),n>r)switch(t){case 43:this.inputService.changeToPositive();break;case 45:this.inputService.changeToNegative();break;default:if(!this.inputService.canInputMoreNumbers)return;this.inputService.addNumber(t)}this.setCursorPosition(e),this.onModelChange(this.inputService.value)}else this.setCursorPosition(e)},e.prototype.handleKeydown=function(e){var t=e.which||e.charCode||e.keyCode;if(8==t||46==t||63272==t){e.preventDefault();var n=Math.abs(this.inputService.inputSelection.selectionEnd-this.inputService.inputSelection.selectionStart);0==n&&(this.inputService.removeNumber(t),this.onModelChange(this.inputService.value)),n>=this.inputService.rawValue.length-this.inputService.prefixLength()&&this.clearValue()}},e.prototype.clearValue=function(){this.setValue(this.inputService.isNullable()?null:0),this.onModelChange(this.inputService.value)},e.prototype.handleKeypress=function(e){var t=e.which||e.charCode||e.keyCode;if(97!==t||!e.ctrlKey){switch(t){case void 0:case 9:case 13:case 37:case 39:return;case 43:this.inputService.changeToPositive();break;case 45:this.inputService.changeToNegative();break;default:if(this.inputService.canInputMoreNumbers)Math.abs(this.inputService.inputSelection.selectionEnd-this.inputService.inputSelection.selectionStart)==this.inputService.rawValue.length&&this.setValue(0),this.inputService.addNumber(t)}e.preventDefault(),this.onModelChange(this.inputService.value)}},e.prototype.handlePaste=function(e){var t=this;setTimeout((function(){t.inputService.updateFieldValue(),t.setValue(t.inputService.value),t.onModelChange(t.inputService.value)}),1)},e.prototype.updateOptions=function(e){this.inputService.updateOptions(e)},e.prototype.getOnModelChange=function(){return this.onModelChange},e.prototype.setOnModelChange=function(e){this.onModelChange=e},e.prototype.getOnModelTouched=function(){return this.onModelTouched},e.prototype.setOnModelTouched=function(e){this.onModelTouched=e},e.prototype.setValue=function(e){this.inputService.value=e},e.prototype.setCursorPosition=function(e){setTimeout((function(){e.target.setSelectionRange(e.target.value.length,e.target.value.length)}),0)},e}();t.InputHandler=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),r=function(){function e(e,t){this.htmlInputElement=e,this.options=t,this.PER_AR_NUMBER=new Map,this.inputManager=new i.InputManager(e),this.initialize()}return e.prototype.initialize=function(){this.PER_AR_NUMBER.set("۰","0"),this.PER_AR_NUMBER.set("۱","1"),this.PER_AR_NUMBER.set("۲","2"),this.PER_AR_NUMBER.set("۳","3"),this.PER_AR_NUMBER.set("۴","4"),this.PER_AR_NUMBER.set("۵","5"),this.PER_AR_NUMBER.set("۶","6"),this.PER_AR_NUMBER.set("۷","7"),this.PER_AR_NUMBER.set("۸","8"),this.PER_AR_NUMBER.set("۹","9"),this.PER_AR_NUMBER.set("٠","0"),this.PER_AR_NUMBER.set("١","1"),this.PER_AR_NUMBER.set("٢","2"),this.PER_AR_NUMBER.set("٣","3"),this.PER_AR_NUMBER.set("٤","4"),this.PER_AR_NUMBER.set("٥","5"),this.PER_AR_NUMBER.set("٦","6"),this.PER_AR_NUMBER.set("٧","7"),this.PER_AR_NUMBER.set("٨","8"),this.PER_AR_NUMBER.set("٩","9")},e.prototype.addNumber=function(e){this.rawValue||(this.rawValue=this.applyMask(!1,"0"));var t=String.fromCharCode(e),n=this.inputSelection.selectionStart,i=this.inputSelection.selectionEnd;this.rawValue=this.rawValue.substring(0,n)+t+this.rawValue.substring(i,this.rawValue.length),this.updateFieldValue(n+1)},e.prototype.applyMask=function(e,t){var n=this.options,i=n.allowNegative,r=n.decimal,o=n.precision,s=n.prefix,u=n.suffix,a=n.thousands,l=(n.nullable,(t=e?new Number(t).toFixed(o):t).replace(/[^0-9\u0660-\u0669\u06F0-\u06F9]/g,""));if(!l)return"";var p=l.slice(0,l.length-o).replace(/^\u0660*/g,"").replace(/^\u06F0*/g,"").replace(/^0*/g,"").replace(/\B(?=([0-9\u0660-\u0669\u06F0-\u06F9]{3})+(?![0-9\u0660-\u0669\u06F0-\u06F9]))/g,a);a&&p.startsWith(a)&&(p=p.substring(1)),""==p&&(p="0");var c=p,h=l.slice(l.length-o);o>0&&("0"==c&&h.length<o?c+=r+"0".repeat(o-1)+h:c+=r+h);var d=0==parseInt(p)&&(0==parseInt(h)||""==h);return(t.indexOf("-")>-1&&i&&!d?"-":"")+s+c+u},e.prototype.clearMask=function(e){if(this.isNullable()&&""===e)return null;var t=(e||"0").replace(this.options.prefix,"").replace(this.options.suffix,"");return this.options.thousands&&(t=t.replace(new RegExp("\\"+this.options.thousands,"g"),"")),this.options.decimal&&(t=t.replace(this.options.decimal,".")),this.PER_AR_NUMBER.forEach((function(e,n){var i=new RegExp(n,"g");t=t.replace(i,e)})),parseFloat(t)},e.prototype.changeToNegative=function(){this.options.allowNegative&&""!=this.rawValue&&"-"!=this.rawValue.charAt(0)&&0!=this.value&&(this.rawValue="-"+this.rawValue)},e.prototype.changeToPositive=function(){this.rawValue=this.rawValue.replace("-","")},e.prototype.removeNumber=function(e){if(this.isNullable()&&0==this.value)this.rawValue=null;else{var t=this.inputSelection.selectionEnd,n=this.inputSelection.selectionStart;n>this.rawValue.length-this.options.suffix.length&&(t=this.rawValue.length-this.options.suffix.length,n=this.rawValue.length-this.options.suffix.length);var i=this.rawValue.substr(n-1,1).match(/\d/)?0:-1;(8!=e||n-1!=0||this.rawValue.substr(n,1).match(/\d/))&&(46!=e&&63272!=e||0!==n||this.rawValue.substr(n+1,1).match(/\d/))||(i=1),t=46==e||63272==e?t+1:t,n=8==e?n-1:n,this.rawValue=this.rawValue.substring(0,n)+this.rawValue.substring(t,this.rawValue.length),this.updateFieldValue(n+i)}},e.prototype.updateFieldValue=function(e){var t=this.applyMask(!1,this.rawValue||"");e=null==e?this.rawValue.length:e,this.inputManager.updateValueAndCursor(t,this.rawValue.length,e)},e.prototype.updateOptions=function(e){var t=this.value;this.options=e,this.value=t},e.prototype.prefixLength=function(){return this.options.prefix.length},e.prototype.isNullable=function(){return this.options.nullable},Object.defineProperty(e.prototype,"canInputMoreNumbers",{get:function(){return this.inputManager.canInputMoreNumbers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSelection",{get:function(){return this.inputManager.inputSelection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.inputManager.rawValue},set:function(e){this.inputManager.rawValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storedRawValue",{get:function(){return this.inputManager.storedRawValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.clearMask(this.rawValue)},set:function(e){this.rawValue=this.applyMask(!0,""+e)},enumerable:!0,configurable:!0}),e}();t.InputService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.htmlInputElement=e}return e.prototype.setCursorAt=function(e){if(this.htmlInputElement.setSelectionRange)this.htmlInputElement.focus(),this.htmlInputElement.setSelectionRange(e,e);else if(this.htmlInputElement.createTextRange){var t=this.htmlInputElement.createTextRange();t.collapse(!0),t.moveEnd("character",e),t.moveStart("character",e),t.select()}},e.prototype.updateValueAndCursor=function(e,t,n){this.rawValue=e,n-=t-e.length,this.setCursorAt(n)},Object.defineProperty(e.prototype,"canInputMoreNumbers",{get:function(){var e=!(this.rawValue.length>=this.htmlInputElement.maxLength&&this.htmlInputElement.maxLength>=0),t=this.inputSelection.selectionStart,n=this.inputSelection.selectionEnd,i=!(t==n||!this.htmlInputElement.value.substring(t,n).match(/[^0-9\u0660-\u0669\u06F0-\u06F9]/)),r="0"==this.htmlInputElement.value.substring(0,1);return e||i||r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSelection",{get:function(){var e=0,t=0;if("number"==typeof this.htmlInputElement.selectionStart&&"number"==typeof this.htmlInputElement.selectionEnd)e=this.htmlInputElement.selectionStart,t=this.htmlInputElement.selectionEnd;else{var n=document.selection.createRange();if(n&&n.parentElement()==this.htmlInputElement){var i=this.htmlInputElement.value.length,r=this.htmlInputElement.value.replace(/\r\n/g,"\n"),o=this.htmlInputElement.createTextRange();o.moveToBookmark(n.getBookmark());var s=this.htmlInputElement.createTextRange();s.collapse(!1),o.compareEndPoints("StartToEnd",s)>-1?e=t=i:(e=-o.moveStart("character",-i),e+=r.slice(0,e).split("\n").length-1,o.compareEndPoints("EndToEnd",s)>-1?t=i:(t=-o.moveEnd("character",-i),t+=r.slice(0,t).split("\n").length-1))}}return{selectionStart:e,selectionEnd:t}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.htmlInputElement&&this.htmlInputElement.value},set:function(e){this._storedRawValue=e,this.htmlInputElement&&(this.htmlInputElement.value=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storedRawValue",{get:function(){return this._storedRawValue},enumerable:!0,configurable:!0}),e}();t.InputManager=i},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(9),s=n(2),u=n(1),a=n(3),l=function(){function e(){}var t;return t=e,e.forRoot=function(e){return{ngModule:t,providers:[{provide:a.CURRENCY_MASK_CONFIG,useValue:e}]}},e=t=i([r.NgModule({imports:[o.CommonModule,s.FormsModule],declarations:[u.CurrencyMaskDirective],exports:[u.CurrencyMaskDirective]})],e)}();t.NgxCurrencyModule=l},function(e,t){e.exports=n}])}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/forms","@angular/common"],t):"object"==typeof exports?exports.ngxBr=t(require("@angular/core"),require("@angular/forms"),require("@angular/common")):e.ngxBr=t(e.ng.core,e.ng.forms,e.ng.common)}(window,(function(e,t,n){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(t,n){t.exports=e},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s},r=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},o=this&&this.__param||function(e,t){return function(n,i){t(n,i,e)}};Object.defineProperty(t,"__esModule",{value:!0});var s=n(0),u=n(2),a=n(3),l=n(5);t.CURRENCYMASKDIRECTIVE_VALUE_ACCESSOR={provide:u.NG_VALUE_ACCESSOR,useExisting:s.forwardRef((function(){return p})),multi:!0};var p=function(){function e(e,t,n){this.currencyMaskConfig=e,this.elementRef=t,this.keyValueDiffers=n,this.options={},this.optionsTemplate={align:"right",allowNegative:!0,allowZero:!0,decimal:".",precision:2,prefix:"$ ",suffix:"",thousands:",",nullable:!1},e&&(this.optionsTemplate=e),this.keyValueDiffer=n.find({}).create()}return e.prototype.ngAfterViewInit=function(){this.elementRef.nativeElement.style.textAlign=this.options&&this.options.align?this.options.align:this.optionsTemplate.align},e.prototype.ngDoCheck=function(){this.keyValueDiffer.diff(this.options)&&(this.elementRef.nativeElement.style.textAlign=this.options.align?this.options.align:this.optionsTemplate.align,this.inputHandler.updateOptions(Object.assign({},this.optionsTemplate,this.options)))},e.prototype.ngOnInit=function(){this.inputHandler=new l.InputHandler(this.elementRef.nativeElement,Object.assign({},this.optionsTemplate,this.options))},e.prototype.handleBlur=function(e){this.inputHandler.getOnModelTouched().apply(e)},e.prototype.handleCut=function(e){this.isChromeAndroid()||this.inputHandler.handleCut(e)},e.prototype.handleInput=function(e){this.isChromeAndroid()&&this.inputHandler.handleInput(e)},e.prototype.handleKeydown=function(e){this.isChromeAndroid()||this.inputHandler.handleKeydown(e)},e.prototype.handleKeypress=function(e){this.isChromeAndroid()||this.inputHandler.handleKeypress(e)},e.prototype.handlePaste=function(e){this.isChromeAndroid()||this.inputHandler.handlePaste(e)},e.prototype.isChromeAndroid=function(){return/chrome/i.test(navigator.userAgent)&&/android/i.test(navigator.userAgent)},e.prototype.registerOnChange=function(e){this.inputHandler.setOnModelChange(e)},e.prototype.registerOnTouched=function(e){this.inputHandler.setOnModelTouched(e)},e.prototype.setDisabledState=function(e){this.elementRef.nativeElement.disabled=e},e.prototype.writeValue=function(e){this.inputHandler.setValue(e)},i([s.Input(),r("design:type",Object)],e.prototype,"options",void 0),i([s.HostListener("blur",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleBlur",null),i([s.HostListener("cut",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleCut",null),i([s.HostListener("input",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleInput",null),i([s.HostListener("keydown",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleKeydown",null),i([s.HostListener("keypress",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handleKeypress",null),i([s.HostListener("paste",["$event"]),r("design:type",Function),r("design:paramtypes",[Object]),r("design:returntype",void 0)],e.prototype,"handlePaste",null),e=i([s.Directive({selector:"[currencyMask]",providers:[t.CURRENCYMASKDIRECTIVE_VALUE_ACCESSOR]}),o(0,s.Optional()),o(0,s.Inject(a.CURRENCY_MASK_CONFIG)),r("design:paramtypes",[Object,s.ElementRef,s.KeyValueDiffers])],e)}();t.CurrencyMaskDirective=p},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.CURRENCY_MASK_CONFIG=new i.InjectionToken("currency.mask.config")},function(e,t,n){"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(1)),i(n(8))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),r=function(){function e(e,t){this.inputService=new i.InputService(e,t)}return e.prototype.handleCut=function(e){var t=this;setTimeout((function(){t.inputService.updateFieldValue(),t.setValue(t.inputService.value),t.onModelChange(t.inputService.value)}),0)},e.prototype.handleInput=function(e){var t=this.inputService.rawValue.charCodeAt(this.inputService.rawValue.length-1),n=this.inputService.rawValue.length,i=this.inputService.inputSelection.selectionEnd,r=this.inputService.storedRawValue.length;if(this.inputService.rawValue=this.inputService.storedRawValue,n==i&&1==Math.abs(n-r)){if(n<r&&this.inputService.removeNumber(8),n>r)switch(t){case 43:this.inputService.changeToPositive();break;case 45:this.inputService.changeToNegative();break;default:if(!this.inputService.canInputMoreNumbers)return;this.inputService.addNumber(t)}this.setCursorPosition(e),this.onModelChange(this.inputService.value)}else this.setCursorPosition(e)},e.prototype.handleKeydown=function(e){var t=e.which||e.charCode||e.keyCode;if(8==t||46==t||63272==t){e.preventDefault();var n=Math.abs(this.inputService.inputSelection.selectionEnd-this.inputService.inputSelection.selectionStart);0==n&&(this.inputService.removeNumber(t),this.onModelChange(this.inputService.value)),n>=this.inputService.rawValue.length-this.inputService.prefixLength()&&this.clearValue()}},e.prototype.clearValue=function(){this.setValue(this.inputService.isNullable()?null:0),this.onModelChange(this.inputService.value)},e.prototype.handleKeypress=function(e){var t=e.which||e.charCode||e.keyCode;if(97!==t||!e.ctrlKey){switch(t){case void 0:case 9:case 13:case 37:case 39:return;case 43:this.inputService.changeToPositive();break;case 45:this.inputService.changeToNegative();break;default:if(this.inputService.canInputMoreNumbers)Math.abs(this.inputService.inputSelection.selectionEnd-this.inputService.inputSelection.selectionStart)==this.inputService.rawValue.length&&this.setValue(0),this.inputService.addNumber(t)}e.preventDefault(),this.onModelChange(this.inputService.value)}},e.prototype.handlePaste=function(e){var t=this;setTimeout((function(){t.inputService.updateFieldValue(),t.setValue(t.inputService.value),t.onModelChange(t.inputService.value)}),1)},e.prototype.updateOptions=function(e){this.inputService.updateOptions(e)},e.prototype.getOnModelChange=function(){return this.onModelChange},e.prototype.setOnModelChange=function(e){this.onModelChange=e},e.prototype.getOnModelTouched=function(){return this.onModelTouched},e.prototype.setOnModelTouched=function(e){this.onModelTouched=e},e.prototype.setValue=function(e){this.inputService.value=e},e.prototype.setCursorPosition=function(e){setTimeout((function(){e.target.setSelectionRange(e.target.value.length,e.target.value.length)}),0)},e}();t.InputHandler=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),r=function(){function e(e,t){this.htmlInputElement=e,this.options=t,this.PER_AR_NUMBER=new Map,this.inputManager=new i.InputManager(e),this.initialize()}return e.prototype.initialize=function(){this.PER_AR_NUMBER.set("۰","0"),this.PER_AR_NUMBER.set("۱","1"),this.PER_AR_NUMBER.set("۲","2"),this.PER_AR_NUMBER.set("۳","3"),this.PER_AR_NUMBER.set("۴","4"),this.PER_AR_NUMBER.set("۵","5"),this.PER_AR_NUMBER.set("۶","6"),this.PER_AR_NUMBER.set("۷","7"),this.PER_AR_NUMBER.set("۸","8"),this.PER_AR_NUMBER.set("۹","9"),this.PER_AR_NUMBER.set("٠","0"),this.PER_AR_NUMBER.set("١","1"),this.PER_AR_NUMBER.set("٢","2"),this.PER_AR_NUMBER.set("٣","3"),this.PER_AR_NUMBER.set("٤","4"),this.PER_AR_NUMBER.set("٥","5"),this.PER_AR_NUMBER.set("٦","6"),this.PER_AR_NUMBER.set("٧","7"),this.PER_AR_NUMBER.set("٨","8"),this.PER_AR_NUMBER.set("٩","9")},e.prototype.addNumber=function(e){this.rawValue||(this.rawValue=this.applyMask(!1,"0"));var t=String.fromCharCode(e),n=this.inputSelection.selectionStart,i=this.inputSelection.selectionEnd;this.rawValue=this.rawValue.substring(0,n)+t+this.rawValue.substring(i,this.rawValue.length),this.updateFieldValue(n+1)},e.prototype.applyMask=function(e,t){var n=this.options,i=n.allowNegative,r=n.decimal,o=n.precision,s=n.prefix,u=n.suffix,a=n.thousands,l=(n.nullable,(t=e?new Number(t).toFixed(o):t).replace(/[^0-9\u0660-\u0669\u06F0-\u06F9]/g,""));if(!l)return"";var p=l.slice(0,l.length-o).replace(/^\u0660*/g,"").replace(/^\u06F0*/g,"").replace(/^0*/g,"").replace(/\B(?=([0-9\u0660-\u0669\u06F0-\u06F9]{3})+(?![0-9\u0660-\u0669\u06F0-\u06F9]))/g,a);a&&p.startsWith(a)&&(p=p.substring(1)),""==p&&(p="0");var c=p,h=l.slice(l.length-o);o>0&&("0"==c&&h.length<o?c+=r+"0".repeat(o-1)+h:c+=r+h);var d=0==parseInt(p)&&(0==parseInt(h)||""==h);return(t.indexOf("-")>-1&&i&&!d?"-":"")+s+c+u},e.prototype.clearMask=function(e){if(this.isNullable()&&""===e)return null;var t=(e||"0").replace(this.options.prefix,"").replace(this.options.suffix,"");return this.options.thousands&&(t=t.replace(new RegExp("\\"+this.options.thousands,"g"),"")),this.options.decimal&&(t=t.replace(this.options.decimal,".")),this.PER_AR_NUMBER.forEach((function(e,n){var i=new RegExp(n,"g");t=t.replace(i,e)})),parseFloat(t)},e.prototype.changeToNegative=function(){this.options.allowNegative&&""!=this.rawValue&&"-"!=this.rawValue.charAt(0)&&0!=this.value&&(this.rawValue="-"+this.rawValue)},e.prototype.changeToPositive=function(){this.rawValue=this.rawValue.replace("-","")},e.prototype.removeNumber=function(e){if(this.isNullable()&&0==this.value)this.rawValue=null;else{var t=this.inputSelection.selectionEnd,n=this.inputSelection.selectionStart;n>this.rawValue.length-this.options.suffix.length&&(t=this.rawValue.length-this.options.suffix.length,n=this.rawValue.length-this.options.suffix.length);var i=this.rawValue.substr(n-1,1).match(/\d/)?0:-1;(8!=e||n-1!=0||this.rawValue.substr(n,1).match(/\d/))&&(46!=e&&63272!=e||0!==n||this.rawValue.substr(n+1,1).match(/\d/))||(i=1),t=46==e||63272==e?t+1:t,n=8==e?n-1:n,this.rawValue=this.rawValue.substring(0,n)+this.rawValue.substring(t,this.rawValue.length),this.updateFieldValue(n+i)}},e.prototype.updateFieldValue=function(e){var t=this.applyMask(!1,this.rawValue||"");e=null==e?this.rawValue.length:e,this.inputManager.updateValueAndCursor(t,this.rawValue.length,e)},e.prototype.updateOptions=function(e){var t=this.value;this.options=e,this.value=t},e.prototype.prefixLength=function(){return this.options.prefix.length},e.prototype.isNullable=function(){return this.options.nullable},Object.defineProperty(e.prototype,"canInputMoreNumbers",{get:function(){return this.inputManager.canInputMoreNumbers},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSelection",{get:function(){return this.inputManager.inputSelection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.inputManager.rawValue},set:function(e){this.inputManager.rawValue=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storedRawValue",{get:function(){return this.inputManager.storedRawValue},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.clearMask(this.rawValue)},set:function(e){this.rawValue=this.applyMask(!0,""+e)},enumerable:!0,configurable:!0}),e}();t.InputService=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e){this.htmlInputElement=e}return e.prototype.setCursorAt=function(e){if(this.htmlInputElement.setSelectionRange)this.htmlInputElement.focus(),this.htmlInputElement.setSelectionRange(e,e);else if(this.htmlInputElement.createTextRange){var t=this.htmlInputElement.createTextRange();t.collapse(!0),t.moveEnd("character",e),t.moveStart("character",e),t.select()}},e.prototype.updateValueAndCursor=function(e,t,n){this.rawValue=e,n-=t-e.length,this.setCursorAt(n)},Object.defineProperty(e.prototype,"canInputMoreNumbers",{get:function(){var e=!(this.rawValue.length>=this.htmlInputElement.maxLength&&this.htmlInputElement.maxLength>=0),t=this.inputSelection.selectionStart,n=this.inputSelection.selectionEnd,i=!(t==n||!this.htmlInputElement.value.substring(t,n).match(/[^0-9\u0660-\u0669\u06F0-\u06F9]/)),r="0"==this.htmlInputElement.value.substring(0,1);return e||i||r},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputSelection",{get:function(){var e=0,t=0;if("number"==typeof this.htmlInputElement.selectionStart&&"number"==typeof this.htmlInputElement.selectionEnd)e=this.htmlInputElement.selectionStart,t=this.htmlInputElement.selectionEnd;else{var n=document.selection.createRange();if(n&&n.parentElement()==this.htmlInputElement){var i=this.htmlInputElement.value.length,r=this.htmlInputElement.value.replace(/\r\n/g,"\n"),o=this.htmlInputElement.createTextRange();o.moveToBookmark(n.getBookmark());var s=this.htmlInputElement.createTextRange();s.collapse(!1),o.compareEndPoints("StartToEnd",s)>-1?e=t=i:(e=-o.moveStart("character",-i),e+=r.slice(0,e).split("\n").length-1,o.compareEndPoints("EndToEnd",s)>-1?t=i:(t=-o.moveEnd("character",-i),t+=r.slice(0,t).split("\n").length-1))}}return{selectionStart:e,selectionEnd:t}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawValue",{get:function(){return this.htmlInputElement&&this.htmlInputElement.value},set:function(e){this._storedRawValue=e,this.htmlInputElement&&(this.htmlInputElement.value=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"storedRawValue",{get:function(){return this._storedRawValue},enumerable:!0,configurable:!0}),e}();t.InputManager=i},function(e,t,n){"use strict";var i=this&&this.__decorate||function(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var u=e.length-1;u>=0;u--)(r=e[u])&&(s=(o<3?r(s):o>3?r(t,n,s):r(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(9),s=n(2),u=n(1),a=n(3),l=function(){function e(){}var t;return t=e,e.forRoot=function(e){return{ngModule:t,providers:[{provide:a.CURRENCY_MASK_CONFIG,useValue:e}]}},e=t=i([r.NgModule({imports:[o.CommonModule,s.FormsModule],declarations:[u.CurrencyMaskDirective],exports:[u.CurrencyMaskDirective]})],e)}();t.NgxCurrencyModule=l},function(e,t){e.exports=n}])}));
//# sourceMappingURL=ngx-currency.umd.min.js.map

@@ -5,2 +5,11 @@ # Changelog

### [2.0.2](https://github.com/nbfontana/ngx-currency/compare/v2.0.1...v2.0.2) (2019-11-26)
### Bug Fixes
* ignored align in global config ([1af2dd1](https://github.com/nbfontana/ngx-currency/commit/1af2dd1))
### [2.0.1](https://github.com/nbfontana/ngx-currency/compare/v2.0.0...v2.0.1) (2019-11-23)

@@ -7,0 +16,0 @@

{
"name": "ngx-currency",
"version": "2.0.1",
"version": "2.0.2",
"description": "A very simple currency mask directive that allows using a number attribute with the ngModel.",

@@ -24,3 +24,3 @@ "main": "./bundles/ngx-currency.umd.js",

"prerelease": "npm test",
"release:git": "standard-version --first-release && git push --follow-tags origin master",
"release:git": "git add package.json && git commit -m \"chore: bump version number\" && standard-version --first-release && git push --follow-tags origin master",
"release:npm": "npm run build:dist && npm run copyfiles && npm publish dist",

@@ -27,0 +27,0 @@ "postrelease": "npm run build:clean && npm run gh-pages",

@@ -45,3 +45,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

CurrencyMaskDirective.prototype.ngAfterViewInit = function () {
this.elementRef.nativeElement.style.textAlign = this.options ? this.options.align : this.optionsTemplate.align;
this.elementRef.nativeElement.style.textAlign = this.options && this.options.align ? this.options.align : this.optionsTemplate.align;
};

@@ -48,0 +48,0 @@ CurrencyMaskDirective.prototype.ngDoCheck = function () {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc