{"version":3,"sources":["../../src/app/components/inputmask/inputmask.ts"],"names":["INPUTMASK_VALUE_ACCESSOR","provide","NG_VALUE_ACCESSOR","useExisting","forwardRef","InputMask","multi","el","cd","this","type","slotChar","autoClear","characterPattern","onComplete","EventEmitter","onFocus","onBlur","onInput","onModelChange","onModelTouched","prototype","ngOnInit","ua","DomHandler","getUserAgent","androidChrome","test","initMask","Object","defineProperty","_mask","val","writeValue","value","tests","partialPosition","mask","length","len","firstNonMaskPos","defs","9","a","*","maskTokens","split","i","c","push","RegExp","lastRequiredNonMaskPos","buffer","getPlaceholder","defaultBuffer","join","inputViewChild","nativeElement","undefined","checkVal","focusText","updateFilledState","registerOnChange","fn","registerOnTouched","setDisabledState","disabled","markForCheck","caret","first","last","range","begin","end","offsetParent","ownerDocument","activeElement","setSelectionRange","selectionStart","selectionEnd","document","createRange","duplicate","moveStart","text","collapse","moveEnd","select","isCompleted","charAt","seekNext","pos","seekPrev","shiftL","j","writeBuffer","Math","max","shiftR","t","handleAndroidInput","e","_this","curVal","oldVal","setTimeout","updateModel","emit","onInputBlur","focused","event","createEvent","initEvent","dispatchEvent","onKeyDown","readonly","k","which","keyCode","iPhone","clearBuffer","preventDefault","onKeyPress","p","next","completed","ctrlKey","altKey","metaKey","String","fromCharCode","start","allow","lastMatch","substring","onInputFocus","clearTimeout","caretTimeoutId","replace","onInputChange","handleInputChange","getUnmaskedValue","unmaskedBuffer","updatedValue","unmask","target","filled","focus","ngOnDestroy","Component","args","selector","template","host","[class.p-inputwrapper-filled]","[class.p-inputwrapper-focus]","providers","changeDetection","ChangeDetectionStrategy","OnPush","encapsulation","ViewEncapsulation","None","ElementRef","ChangeDetectorRef","Input","ViewChild","static","Output","NgModule","imports","CommonModule","InputTextModule","exports","declarations"],"mappings":"+kBAiCaA,EAAgC,CAC3CC,QAASC,EAAAA,kBACTC,YAAaC,EAAAA,YAAW,WAAM,OAAAC,KAC9BC,OAAO,gBA6GL,SAAAD,EAAmBE,EAAwBC,GAAxBC,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AAc,CAACzK","sourcesContent":["/*\n Port of jQuery MaskedInput by DigitalBush as a Native Angular2 Component in Typescript without jQuery\n https://github.com/digitalBush/jquery.maskedinput/\n\n Copyright (c) 2007-2014 Josh Bush (digitalbush.com)\n\n Permission is hereby granted, free of charge, to any person\n obtaining a copy of this software and associated documentation\n files (the \"Software\"), to deal in the Software without\n restriction, including without limitation the rights to use,\n copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the\n Software is furnished to do so, subject to the following\n conditions:\n\n The above copyright notice and this permission notice shall be\n included in all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n OTHER DEALINGS IN THE SOFTWARE.\n*/\nimport {NgModule,Component,ElementRef,OnInit,OnDestroy,Input,forwardRef,Output,EventEmitter,ViewChild,ChangeDetectionStrategy, ViewEncapsulation, ChangeDetectorRef} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {DomHandler} from 'primeng/dom';\nimport {InputTextModule} from 'primeng/inputtext';\nimport {NG_VALUE_ACCESSOR, ControlValueAccessor} from '@angular/forms';\n\nexport const INPUTMASK_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => InputMask),\n multi: true\n};\n\n@Component({\n selector: 'p-inputMask',\n template: ``,\n host: {\n '[class.p-inputwrapper-filled]': 'filled',\n '[class.p-inputwrapper-focus]': 'focused'\n },\n providers: [INPUTMASK_VALUE_ACCESSOR],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None\n})\nexport class InputMask implements OnInit,OnDestroy,ControlValueAccessor {\n\n @Input() type: string = 'text';\n\n @Input() slotChar: string = '_';\n\n @Input() autoClear: boolean = true;\n\n @Input() style: any;\n\n @Input() inputId: string;\n\n @Input() styleClass: string;\n\n @Input() placeholder: string;\n\n @Input() size: number;\n\n @Input() maxlength: number;\n\n @Input() tabindex: string;\n\n @Input() title: string;\n\n @Input() ariaLabel: string;\n\n @Input() ariaRequired: boolean;\n\n @Input() disabled: boolean;\n\n @Input() readonly: boolean;\n\n @Input() unmask: boolean;\n\n @Input() name: string;\n\n @Input() required: boolean;\n\n @Input() characterPattern: string = '[A-Za-z]';\n\n @Input() autoFocus: boolean;\n\n @Input() autocomplete: string;\n\n @ViewChild('input', { static: true }) inputViewChild: ElementRef;\n\n @Output() onComplete: EventEmitter = new EventEmitter();\n\n @Output() onFocus: EventEmitter = new EventEmitter();\n\n @Output() onBlur: EventEmitter = new EventEmitter();\n\n @Output() onInput: EventEmitter = new EventEmitter();\n\n value: any;\n\n _mask: string;\n\n onModelChange: Function = () => {};\n\n onModelTouched: Function = () => {};\n\n input: HTMLInputElement;\n\n filled: boolean;\n\n defs: any;\n\n tests: any[];\n\n partialPosition: any;\n\n firstNonMaskPos: number;\n\n lastRequiredNonMaskPos: any;\n\n len: number;\n\n oldVal: string;\n\n buffer: any;\n\n defaultBuffer: string;\n\n focusText: string;\n\n caretTimeoutId: any;\n\n androidChrome: boolean;\n\n focused: boolean;\n\n constructor(public el: ElementRef, private cd: ChangeDetectorRef) {}\n\n ngOnInit() {\n let ua = DomHandler.getUserAgent();\n this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);\n\n this.initMask();\n }\n\n @Input() get mask(): string {\n return this._mask;\n }\n\n set mask(val:string) {\n this._mask = val;\n\n this.initMask();\n this.writeValue('');\n this.onModelChange(this.value);\n }\n\n initMask() {\n this.tests = [];\n this.partialPosition = this.mask.length;\n this.len = this.mask.length;\n this.firstNonMaskPos = null;\n this.defs = {\n '9': '[0-9]',\n 'a': this.characterPattern,\n '*': `${this.characterPattern}|[0-9]`\n };\n\n let maskTokens = this.mask.split('');\n for(let i = 0; i < maskTokens.length; i++) {\n let c = maskTokens[i];\n if (c == '?') {\n\t\t\t\tthis.len--;\n\t\t\t\tthis.partialPosition = i;\n\t\t\t}\n else if (this.defs[c]) {\n\t\t\t\tthis.tests.push(new RegExp(this.defs[c]));\n\t\t\t\tif (this.firstNonMaskPos === null) {\n\t this.firstNonMaskPos = this.tests.length - 1;\n\t\t\t\t}\n if (i < this.partialPosition){\n this.lastRequiredNonMaskPos = this.tests.length - 1;\n }\n\t\t\t}\n else {\n\t\t\t\tthis.tests.push(null);\n\t\t\t}\n }\n\n this.buffer = [];\n for(let i = 0; i < maskTokens.length; i++) {\n let c = maskTokens[i];\n if (c != '?') {\n if (this.defs[c])\n this.buffer.push(this.getPlaceholder(i));\n else\n this.buffer.push(c);\n }\n }\n this.defaultBuffer = this.buffer.join('');\n }\n\n writeValue(value: any) : void {\n this.value = value;\n\n if (this.inputViewChild && this.inputViewChild.nativeElement) {\n if (this.value == undefined || this.value == null)\n this.inputViewChild.nativeElement.value = '';\n else\n this.inputViewChild.nativeElement.value = this.value;\n\n this.checkVal();\n this.focusText = this.inputViewChild.nativeElement.value;\n this.updateFilledState();\n }\n }\n\n registerOnChange(fn: Function): void {\n this.onModelChange = fn;\n }\n\n registerOnTouched(fn: Function): void {\n this.onModelTouched = fn;\n }\n\n setDisabledState(val: boolean): void {\n this.disabled = val;\n this.cd.markForCheck();\n }\n\n caret(first?: number, last?: number) {\n let range, begin, end;\n\n if (!this.inputViewChild.nativeElement.offsetParent||this.inputViewChild.nativeElement !== this.inputViewChild.nativeElement.ownerDocument.activeElement) {\n return;\n }\n\n if (typeof first == 'number') {\n begin = first;\n end = (typeof last === 'number') ? last : begin;\n if (this.inputViewChild.nativeElement.setSelectionRange) {\n this.inputViewChild.nativeElement.setSelectionRange(begin, end);\n }\n else if (this.inputViewChild.nativeElement['createTextRange']) {\n range = this.inputViewChild.nativeElement['createTextRange']();\n range.collapse(true);\n range.moveEnd('character', end);\n range.moveStart('character', begin);\n range.select();\n }\n }\n else {\n if (this.inputViewChild.nativeElement.setSelectionRange) {\n \t\t\tbegin = this.inputViewChild.nativeElement.selectionStart;\n \t\t\tend = this.inputViewChild.nativeElement.selectionEnd;\n \t\t}\n else if (document['selection'] && document['selection'].createRange) {\n \t\t\trange = document['selection'].createRange();\n \t\t\tbegin = 0 - range.duplicate().moveStart('character', -100000);\n \t\t\tend = begin + range.text.length;\n \t\t}\n\n \t\treturn {begin: begin, end: end};\n }\n }\n\n isCompleted(): boolean {\n let completed: boolean;\n for (let i = this.firstNonMaskPos; i <= this.lastRequiredNonMaskPos; i++) {\n if (this.tests[i] && this.buffer[i] === this.getPlaceholder(i)) {\n return false;\n }\n }\n\n return true;\n }\n\n getPlaceholder(i: number) {\n if (i < this.slotChar.length) {\n return this.slotChar.charAt(i);\n }\n return this.slotChar.charAt(0);\n }\n\n seekNext(pos) {\n while (++pos < this.len && !this.tests[pos]);\n return pos;\n }\n\n seekPrev(pos) {\n while (--pos >= 0 && !this.tests[pos]);\n return pos;\n }\n\n shiftL(begin:number,end:number) {\n let i, j;\n\n if (begin<0) {\n return;\n }\n\n for (i = begin, j = this.seekNext(end); i < this.len; i++) {\n if (this.tests[i]) {\n if (j < this.len && this.tests[i].test(this.buffer[j])) {\n this.buffer[i] = this.buffer[j];\n this.buffer[j] = this.getPlaceholder(j);\n } else {\n break;\n }\n\n j = this.seekNext(j);\n }\n }\n this.writeBuffer();\n this.caret(Math.max(this.firstNonMaskPos, begin));\n }\n\n shiftR(pos) {\n let i, c, j, t;\n\n for (i = pos, c = this.getPlaceholder(pos); i < this.len; i++) {\n if (this.tests[i]) {\n j = this.seekNext(i);\n t = this.buffer[i];\n this.buffer[i] = c;\n if (j < this.len && this.tests[j].test(t)) {\n c = t;\n } else {\n break;\n }\n }\n }\n }\n\n handleAndroidInput(e) {\n var curVal = this.inputViewChild.nativeElement.value;\n var pos = this.caret();\n if (this.oldVal && this.oldVal.length && this.oldVal.length > curVal.length ) {\n // a deletion or backspace happened\n this.checkVal(true);\n while (pos.begin > 0 && !this.tests[pos.begin-1])\n pos.begin--;\n if (pos.begin === 0)\n {\n while (pos.begin < this.firstNonMaskPos && !this.tests[pos.begin])\n pos.begin++;\n }\n\n setTimeout(() => {\n this.caret(pos.begin, pos.begin);\n this.updateModel(e);\n if (this.isCompleted()) {\n this.onComplete.emit();\n }\n }, 0);\n }\n else {\n this.checkVal(true);\n while (pos.begin < this.len && !this.tests[pos.begin])\n pos.begin++;\n\n setTimeout(() => {\n this.caret(pos.begin, pos.begin);\n this.updateModel(e);\n if (this.isCompleted()) {\n this.onComplete.emit();\n }\n }, 0);\n }\n }\n\n onInputBlur(e) {\n this.focused = false;\n this.onModelTouched();\n this.checkVal();\n this.updateFilledState();\n this.onBlur.emit(e);\n\n if (this.inputViewChild.nativeElement.value != this.focusText || this.inputViewChild.nativeElement.value != this.value) {\n this.updateModel(e);\n let event = document.createEvent('HTMLEvents');\n event.initEvent('change', true, false);\n this.inputViewChild.nativeElement.dispatchEvent(event);\n }\n }\n\n onKeyDown(e) {\n if (this.readonly) {\n return;\n }\n\n let k = e.which||e.keyCode,\n pos,\n begin,\n end;\n let iPhone = /iphone/i.test(DomHandler.getUserAgent());\n this.oldVal = this.inputViewChild.nativeElement.value;\n\n //backspace, delete, and escape get special treatment\n if (k === 8 || k === 46 || (iPhone && k === 127)) {\n pos = this.caret();\n begin = pos.begin;\n end = pos.end;\n\n if (end - begin === 0) {\n begin=k!==46?this.seekPrev(begin):(end=this.seekNext(begin-1));\n end=k===46?this.seekNext(end):end;\n }\n\n this.clearBuffer(begin, end);\n\t\t\tthis.shiftL(begin, end - 1);\n this.updateModel(e);\n this.onInput.emit(e);\n\n e.preventDefault();\n }\n else if ( k === 13 ) { // enter\n this.onInputBlur(e);\n this.updateModel(e);\n }\n else if (k === 27) { // escape\n this.inputViewChild.nativeElement.value = this.focusText;\n this.caret(0, this.checkVal());\n this.updateModel(e);\n\n e.preventDefault();\n }\n }\n\n onKeyPress(e) {\n if (this.readonly){\n return;\n }\n\n var k = e.which || e.keyCode,\n pos = this.caret(),\n p,\n c,\n next,\n completed;\n\n if (e.ctrlKey || e.altKey || e.metaKey || k < 32 || (k > 34 && k < 41)) {//Ignore\n return;\n } else if ( k && k !== 13 ) {\n if (pos.end - pos.begin !== 0){\n this.clearBuffer(pos.begin, pos.end);\n this.shiftL(pos.begin, pos.end-1);\n }\n\n p = this.seekNext(pos.begin - 1);\n if (p < this.len) {\n c = String.fromCharCode(k);\n if (this.tests[p].test(c)) {\n this.shiftR(p);\n\n this.buffer[p] = c;\n this.writeBuffer();\n next = this.seekNext(p);\n\n if (/android/i.test(DomHandler.getUserAgent())) {\n //Path for CSP Violation on FireFox OS 1.1\n let proxy = () => {\n this.caret(next);\n };\n\n setTimeout(proxy,0);\n }\n else {\n this.caret(next);\n }\n\n if (pos.begin <= this.lastRequiredNonMaskPos) {\n completed = this.isCompleted();\n }\n\n this.onInput.emit(e);\n }\n }\n e.preventDefault();\n }\n\n this.updateModel(e);\n\n this.updateFilledState();\n\n if (completed) {\n this.onComplete.emit();\n }\n }\n\n clearBuffer(start, end) {\n let i;\n for (i = start; i < end && i < this.len; i++) {\n if (this.tests[i]) {\n this.buffer[i] = this.getPlaceholder(i);\n }\n }\n }\n\n writeBuffer() {\n this.inputViewChild.nativeElement.value = this.buffer.join('');\n }\n\n checkVal(allow?: boolean) {\n //try to place characters where they belong\n let test = this.inputViewChild.nativeElement.value,\n lastMatch = -1,\n i,\n c,\n pos;\n\n for (i = 0, pos = 0; i < this.len; i++) {\n if (this.tests[i]) {\n this.buffer[i] = this.getPlaceholder(i);\n while (pos++ < test.length) {\n c = test.charAt(pos - 1);\n if (this.tests[i].test(c)) {\n this.buffer[i] = c;\n lastMatch = i;\n break;\n }\n }\n if (pos > test.length) {\n this.clearBuffer(i + 1, this.len);\n break;\n }\n } else {\n if (this.buffer[i] === test.charAt(pos)) {\n pos++;\n }\n if ( i < this.partialPosition){\n lastMatch = i;\n }\n }\n }\n if (allow) {\n this.writeBuffer();\n } else if (lastMatch + 1 < this.partialPosition) {\n if (this.autoClear || this.buffer.join('') === this.defaultBuffer) {\n // Invalid value. Remove it and replace it with the\n // mask, which is the default behavior.\n if (this.inputViewChild.nativeElement.value) this.inputViewChild.nativeElement.value = '';\n this.clearBuffer(0, this.len);\n } else {\n // Invalid value, but we opt to show the value to the\n // user and allow them to correct their mistake.\n this.writeBuffer();\n }\n } else {\n this.writeBuffer();\n this.inputViewChild.nativeElement.value = this.inputViewChild.nativeElement.value.substring(0, lastMatch + 1);\n }\n return (this.partialPosition ? i : this.firstNonMaskPos);\n }\n\n onInputFocus(event) {\n if (this.readonly){\n return;\n }\n\n this.focused = true;\n\n clearTimeout(this.caretTimeoutId);\n let pos;\n\n this.focusText = this.inputViewChild.nativeElement.value;\n\n pos = this.checkVal();\n\n this.caretTimeoutId = setTimeout(() => {\n if (this.inputViewChild.nativeElement !== this.inputViewChild.nativeElement.ownerDocument.activeElement){\n return;\n }\n this.writeBuffer();\n if (pos == this.mask.replace(\"?\",\"\").length) {\n this.caret(0, pos);\n } else {\n this.caret(pos);\n }\n }, 10);\n\n this.onFocus.emit(event);\n }\n\n onInputChange(event) {\n if (this.androidChrome)\n this.handleAndroidInput(event);\n else\n this.handleInputChange(event);\n\n this.onInput.emit(event);\n }\n\n handleInputChange(event) {\n if (this.readonly){\n return;\n }\n\n setTimeout(() => {\n var pos = this.checkVal(true);\n this.caret(pos);\n this.updateModel(event);\n if (this.isCompleted()) {\n this.onComplete.emit();\n }\n }, 0);\n }\n\n getUnmaskedValue() {\n let unmaskedBuffer = [];\n for(let i = 0; i < this.buffer.length; i++) {\n let c = this.buffer[i];\n if (this.tests[i] && c != this.getPlaceholder(i)) {\n unmaskedBuffer.push(c);\n }\n }\n\n return unmaskedBuffer.join('');\n }\n\n updateModel(e) {\n const updatedValue = this.unmask ? this.getUnmaskedValue() : e.target.value;\n if (updatedValue !== null || updatedValue !== undefined) {\n this.value = updatedValue;\n this.onModelChange(this.value);\n }\n }\n\n updateFilledState() {\n this.filled = this.inputViewChild.nativeElement && this.inputViewChild.nativeElement.value != '';\n }\n\n focus() {\n this.inputViewChild.nativeElement.focus();\n }\n\n ngOnDestroy() {\n\n }\n}\n\n@NgModule({\n imports: [CommonModule,InputTextModule],\n exports: [InputMask],\n declarations: [InputMask]\n})\nexport class InputMaskModule { }\n"]}