UNPKG

@syncfusion/ej2-inputs

Version:

A package of Essential JS 2 input components such as Textbox, Color-picker, Masked-textbox, Numeric-textbox, Slider, Upload, and Form-validator that is used to get input from the users.

10 lines 358 kB
/*! * filename: ej2-inputs.min.js * version : 23.1.38 * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ this.ej=this.ej||{},this.ej.inputs=function(t,e,i,s){"use strict";function n(){if(e.attributes(this.element,{role:"textbox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-live":"assertive"}),this.mask){for(var t=this.mask.split("]"),i=0;i<t.length;i++)if("\\"===t[i][t[i].length-1]){t[i]=t[i]+"]";for(var s=t[i].split("["),n=0;n<s.length;n++)"\\"===s[n][s[n].length-1]&&(s[n]=s[n]+"["),m.call(this,s[n])}else if((s=t[i].split("[")).length>1)for(var a=!1,n=0;n<s.length;n++)"\\"===s[n]?(this.customRegExpCollec.push("["),this.hiddenMask+=s[n]+"["):""===s[n]?a=!0:""!==s[n]&&a||n===s.length-1?(this.customRegExpCollec.push("["+s[n]+"]"),this.hiddenMask+=this.promptChar,a=!1):m.call(this,s[n]);else m.call(this,s[0]);if(this.escapeMaskValue=this.hiddenMask,this.promptMask=this.hiddenMask.replace(/[09?LCAa#&]/g,this.promptChar),!e.isNullOrUndefined(this.customCharacters))for(i=0;i<this.promptMask.length;i++)e.isNullOrUndefined(this.customCharacters[this.promptMask[i]])||(this.promptMask=this.promptMask.replace(new RegExp(this.promptMask[i],"g"),this.promptChar));var l=0;if(this.hiddenMask.match(new RegExp(/\\/)))for(i=0;i<this.hiddenMask.length;i++){n=0;i>=1&&(n=i),n-=l=this.hiddenMask.length-this.promptMask.length,i>0&&"\\"!==this.hiddenMask[i-1]&&(">"===this.hiddenMask[i]||"<"===this.hiddenMask[i]||"|"===this.hiddenMask[i])&&(this.promptMask=this.promptMask.substring(0,n)+this.promptMask.substring(i+1-l,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue.substring(i+1-l,this.escapeMaskValue.length)),"\\"===this.hiddenMask[i]&&(this.promptMask=this.promptMask.substring(0,n)+this.hiddenMask[i+1]+this.promptMask.substring(i+2-l,this.promptMask.length),this.escapeMaskValue=this.escapeMaskValue.substring(0,n)+this.escapeMaskValue[i+1]+this.escapeMaskValue.substring(i+2-l,this.escapeMaskValue.length))}else this.promptMask=this.promptMask.replace(/[>|<]/g,""),this.escapeMaskValue=this.hiddenMask.replace(/[>|<]/g,"");e.attributes(this.element,{"aria-invalid":"false"})}}function a(){z.call(this,this.promptMask),D.call(this,this.value)}function l(){e.EventHandler.add(this.element,"keydown",k,this),e.EventHandler.add(this.element,"keypress",w,this),e.EventHandler.add(this.element,"keyup",N,this),e.EventHandler.add(this.element,"input",T,this),e.EventHandler.add(this.element,"focus",g,this),e.EventHandler.add(this.element,"blur",C,this),e.EventHandler.add(this.element,"paste",E,this),e.EventHandler.add(this.element,"cut",x,this),e.EventHandler.add(this.element,"drop",S,this),e.EventHandler.add(this.element,"mousedown",v,this),e.EventHandler.add(this.element,"mouseup",f,this),this.enabled&&(o.call(this),this.formElement&&e.EventHandler.add(this.formElement,"reset",c,this))}function r(){e.EventHandler.remove(this.element,"keydown",k),e.EventHandler.remove(this.element,"keypress",w),e.EventHandler.remove(this.element,"keyup",N),e.EventHandler.remove(this.element,"input",T),e.EventHandler.remove(this.element,"focus",g),e.EventHandler.remove(this.element,"blur",C),e.EventHandler.remove(this.element,"paste",E),e.EventHandler.remove(this.element,"cut",x),e.EventHandler.remove(this.element,"mousedown",v),e.EventHandler.remove(this.element,"mouseup",f),this.formElement&&e.EventHandler.remove(this.formElement,"reset",c)}function o(){this.showClearButton&&e.EventHandler.add(this.inputObj.clearButton,"mousedown touchstart",h,this)}function h(t){t.preventDefault(),this.inputObj.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputObj.container.classList.contains("e-static-clear")||(d.call(this,t),this.value="")}function d(t){var e=this.element.value;z.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),H.call(this,t,e),this.element.setSelectionRange(0,0)}function c(){"EJS-MASKEDTEXTBOX"===this.element.tagName?z.call(this,this.promptMask):this.value=this.initInputValue}function u(t){return t.value}function p(t,i){var s="",n=0,a=!1,l=e.isNullOrUndefined(i)?e.isNullOrUndefined(t)||e.isNullOrUndefined(this)?i:t.value:i;if(l!==this.promptMask)for(var r=0;r<this.customRegExpCollec.length;r++)a&&(a=!1),">"!==this.customRegExpCollec[n]&&"<"!==this.customRegExpCollec[n]&&"|"!==this.customRegExpCollec[n]&&"\\"!==this.customRegExpCollec[n]||(--r,a=!0),a||l[r]!==this.promptChar&&!e.isNullOrUndefined(this.customRegExpCollec[n])&&(this._callPasteHandler||!e.isNullOrUndefined(this.regExpCollec[this.customRegExpCollec[n]])||this.customRegExpCollec[n].length>2&&"["===this.customRegExpCollec[n][0]&&"]"===this.customRegExpCollec[n][this.customRegExpCollec[n].length-1]||!e.isNullOrUndefined(this.customCharacters)&&!e.isNullOrUndefined(this.customCharacters[this.customRegExpCollec[n]]))&&""!==l&&(s+=l[r]),++n;return(null===this.mask||""===this.mask&&void 0!==this.value)&&(s=l),s}function m(t){for(var e=0;e<t.length;e++)this.hiddenMask+=t[e],"\\"!==t[e]&&this.customRegExpCollec.push(t[e])}function v(){this.isClicked=!0}function f(){this.isClicked=!1}function g(t){var i=this,s=this.element,n=0,a=p.call(this,s),l=!1,r=!1,o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd};if(this.isClicked||y.call(this,o,s),this.mask&&(null!==a&&""!==a||"Always"===this.floatLabelType||null===this.placeholder||""===this.placeholder||(s.value=this.promptMask),setTimeout(function(){if(s.selectionStart===i.promptMask.length||s.value[s.selectionStart]===i.promptChar)l=!0;else for(var t=s.selectionStart;t<i.promptMask.length;t++){if(s.value[t]===i.promptChar){l=!0;break}if(s.value[t]!==i.promptMask[t]){l=!1;break}}}),setTimeout(function(){var t=s.selectionStart-1;if(t===i.promptMask.length-1||s.value[t]===i.promptChar)r=!0;else for(var e=t;e>=0;e--){if(s.value[e]===i.promptChar){r=!0;break}if(s.value[e]!==i.promptMask[e]){r=!1;break}}}),this.isClicked||"Always"!==this.floatLabelType&&(null===a||""===a)&&null!==this.placeholder&&""!==this.placeholder)){for(n=0;n<this.promptMask.length;n++)if(s.value[n]===this.promptChar){setTimeout(function(){(l||r)&&(s.selectionEnd=n,s.selectionStart=n),o={selectionStart:s.selectionStart,event:t,value:i.value,maskedValue:s.value,container:e.isNullOrUndefined(i.inputObj)?i.inputObj:i.inputObj.container,selectionEnd:s.selectionEnd},y.call(i,o,s)},110);break}e.isNullOrUndefined(s.value.match(b(this.promptChar)))&&(o={selectionStart:s.selectionStart,event:t,value:this.value,maskedValue:s.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container,selectionEnd:s.selectionEnd},y.call(this,o,s)),this.isClicked=!1}}function y(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function b(t){return e.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function C(t){if(this.blurEventArgs={event:t,value:this.value,maskedValue:this.element.value,container:e.isNullOrUndefined(this.inputObj)?this.inputObj:this.inputObj.container},this.trigger("blur",this.blurEventArgs),this.mask&&(this.isFocus=!1,this.placeholder&&this.element.value===this.promptMask&&"Always"!==this.floatLabelType)){z.call(this,"");var i=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!e.isNullOrUndefined(i)&&i.classList.contains(at)&&e.removeClass([i],at)}}function E(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;z.call(this,""),this._callPasteHandler=!0,setTimeout(function(){var a=e.element.value.replace(/ /g,"");e.redoCollec.length>0&&e.redoCollec[0].value===e.element.value&&(a=p.call(e,e.element)),z.call(e,n),e.element.selectionStart=i,e.element.selectionEnd=s;var l=0;e.maskKeyPress=!0;do{U.call(e,a[l],!1,null),++l}while(l<a.length);if(e.maskKeyPress=!1,e._callPasteHandler=!1,e.element.value===n){var r=0;e.maskKeyPress=!0;do{U.call(e,a[r],!1,null),++r}while(r<a.length);e.maskKeyPress=!1}else H.call(e,t,n)},1)}}function x(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.value,s=this.element.selectionStart,n=this.element.selectionEnd;this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd});var a=this.element.value.substring(0,s)+this.promptMask.substring(s,n)+this.element.value.substring(n);setTimeout(function(){z.call(e,a),e.element.selectionStart=e.element.selectionEnd=s,e.element.value!==i&&H.call(e,t,null)},0)}}function S(t){t.preventDefault()}function T(t){if(!0!==e.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){var i={ctrlKey:!1,keyCode:229};if(e.extend(t,i),this.mask){if(""===this.element.value&&this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this._callPasteHandler||O.call(this,t),this.element.value.length>this.promptMask.length){var s=this.element.selectionStart,n=this.element.value.length-this.promptMask.length,a=this.element.value.substring(s-n,s);this.maskKeyPress=!1;var l=0;do{U.call(this,a[l],t.ctrlKey,t),++l}while(l<a.length);this.element.value!==this.preEleVal&&H.call(this,t,null)}var r=p.call(this,this.element);this.prevValue=r,this.value=r,""===r&&(z.call(this,this.promptMask),this.element.setSelectionRange(0,0))}}}function k(t){if(this.mask&&!this.readonly){229!==t.keyCode&&(!t.ctrlKey||89!==t.keyCode&&90!==t.keyCode||t.preventDefault(),O.call(this,t));var e=this.element.value;if(t.ctrlKey&&(89===t.keyCode||90===t.keyCode)){var i=void 0;90===t.keyCode&&this.undoCollec.length>0&&e!==this.undoCollec[this.undoCollec.length-1].value?(i=this.undoCollec[this.undoCollec.length-1],this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),z.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.undoCollec.splice(this.undoCollec.length-1,1)):89===t.keyCode&&this.redoCollec.length>0&&e!==this.redoCollec[0].value&&(i=this.redoCollec[0],this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),z.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function P(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(t=this.redoCollec[0],z.call(this,t.value),t.startIndex-e==1?(this.element.selectionStart=t.startIndex,this.element.selectionEnd=t.endIndex):(this.element.selectionStart=e+1,this.element.selectionEnd=i+1)):(z.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function L(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,z.call(this,this.promptMask),D.call(this,e)),t}function O(t){var i,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,i=this.element.value,s=L.call(this,s,i,t),P.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(s=L.call(this,s,i,t));var a=this.element.selectionStart,l=this.element.selectionEnd,r=this.element.selectionStart,o=this.element.selectionEnd,h=this.hiddenMask.replace(/[>|\\<]/g,""),d=h[r-1],c=this.element.selectionEnd;if(s||8===t.keyCode||46===t.keyCode){this.undoCollec.push({value:this.element.value,startIndex:this.element.selectionStart,endIndex:o});var u=!1,p=this.element.value;if(r>0||(8===t.keyCode||46===t.keyCode)&&r<this.element.value.length&&this.element.selectionEnd-r!==this.element.value.length){var m=r;r!==o?(r=o,46===t.keyCode&&(u=!0)):46===t.keyCode?++m:--m;for(var v=r;8===t.keyCode||s||u?v>m:v<m;8===t.keyCode||s||u?v--:v++)for(var f=r;8===t.keyCode||s||u?f>0:f<this.element.value.length;8===t.keyCode||s||u?f--:f++){var g=void 0;(8===t.keyCode||u)&&(a!==l&&a!==r||a===l)||s?(d=h[f-1],g=r-1):(d=h[f],g=r,++r);var y=this.element.value[g];if(e.isNullOrUndefined(this.regExpCollec[""+d])&&!e.isNullOrUndefined(this.customCharacters)&&e.isNullOrUndefined(this.customCharacters[""+d])&&this.hiddenMask[g]!==this.promptChar&&"["!==this.customRegExpCollec[g][0]&&"]"!==this.customRegExpCollec[g][this.customRegExpCollec[g].length-1]||this.promptMask[g]!==this.promptChar&&e.isNullOrUndefined(this.customCharacters))this.element.selectionStart=this.element.selectionEnd=g,t.preventDefault(),46!==t.keyCode||u||++this.element.selectionStart;else{var b=this.element.value,C=this.promptChar,E=b.substring(0,g)+C+b.substring(r,b.length);z.call(this,E),t.preventDefault(),46!==t.keyCode||u||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(r=this.element.selectionStart,!n&&8===t.keyCode||u||!n&&46!==t.keyCode?g=r-1:(g=r,n=!1),y=this.element.value[g],a!==l&&this.element.selectionStart===a||this.promptMask[g]===this.promptChar||y!==this.promptMask[g]&&this.promptMask[g]!==this.promptChar&&!e.isNullOrUndefined(this.customCharacters))break}}46===t.keyCode&&u&&n&&(this.element.selectionStart=this.element.selectionEnd=c),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(z.call(this,this.promptMask),t.preventDefault(),this.element.selectionStart=this.element.selectionEnd=r),this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),this.element.value!==p&&H.call(this,t,i)}}function w(t){if(this.mask&&!this.readonly){var e=this.element.value;if(!t.ctrlKey&&!t.metaKey||(t.ctrlKey||t.metaKey)&&"KeyA"!==t.code&&"KeyY"!==t.code&&"KeyZ"!==t.code&&"KeyX"!==t.code&&"KeyC"!==t.code&&"KeyV"!==t.code){this.maskKeyPress=!0;var i=t.key;"Spacebar"===i&&(i=String.fromCharCode(t.keyCode)),i?i&&1===i.length&&(U.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,U.call(this,String.fromCharCode(t.keyCode),t.ctrlKey,t),t.preventDefault(),this.isIosInvalid=!1),32===t.keyCode&&" "===i&&" "===this.promptChar&&(this.element.selectionStart=this.element.selectionEnd=this.element.selectionStart-i.length)}this.element.value!==e&&H.call(this,t,e)}}function H(t,i){var s=this.isProtectedOnChange;if(!e.isNullOrUndefined(this.changeEventArgs)&&!this.isInitial){var n={};this.changeEventArgs={value:this.element.value,maskedValue:this.element.value,isInteraction:!1,isInteracted:!1},this.mask&&(this.changeEventArgs.value=p.call(this,this.element)),e.isNullOrUndefined(t)||(this.changeEventArgs.isInteracted=!0,this.changeEventArgs.isInteraction=!0,this.changeEventArgs.event=t),this.isProtectedOnChange=!0,this.value=this.changeEventArgs.value,this.isProtectedOnChange=s,e.merge(n,this.changeEventArgs),this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",n)}this.preEleVal=this.element.value,this.prevValue=p.call(this,this.element)}function N(t){if(this.mask&&!this.readonly){var i=void 0;if(this.maskKeyPress||229!==t.keyCode)F.call(this);else{var s=void 0;if(1===this.element.value.length&&(this.element.value=this.element.value+this.promptMask,this.element.setSelectionRange(1,1)),this.element.value.length>this.promptMask.length){var n=this.element.selectionStart,a=this.element.value.length-this.promptMask.length,l=this.element.value.substring(n-a,n);if(this.undoCollec.length>0){i=this.undoCollec[this.undoCollec.length-1];var r=this.element.selectionStart;s=i.value;var o=i.value.substring(r-a,r);i=this.redoCollec[0],l=l.trim();var h=e.Browser.isAndroid&&""===l;h||o===l||i.value.substring(r-a,r)===l?h&&V.call(this,t,r-1,this.element.selectionEnd-1,l,t.ctrlKey,!1):U.call(this,l,t.ctrlKey,t)}else s=this.promptMask,U.call(this,l,t.ctrlKey,t);this.maskKeyPress=!1,H.call(this,t,s)}}var d=p.call(this,this.element);(0!==this.element.selectionStart||this.promptMask!==this.element.value||""!==d||""===d&&this.value!==d)&&(this.prevValue=d,this.value=d)}else H.call(this,t);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var c=this.element;setTimeout(function(){c.setSelectionRange(0,0)},0)}}function A(t){if(t.length>1&&this.promptMask.length+t.length<this.element.value.length){var e=this.redoCollec[0].value.substring(0,this.redoCollec[0].startIndex)+t+this.redoCollec[0].value.substring(this.redoCollec[0].startIndex,this.redoCollec[0].value.length);z.call(this,e),this.element.selectionStart=this.element.selectionEnd=this.redoCollec[0].startIndex+t.length}this.element.selectionStart=this.element.selectionStart-t.length,this.element.selectionEnd=this.element.selectionEnd-t.length}function B(t){this.maskKeyPress||A.call(this,t)}function U(t,i,s){if(B.call(this,t),!e.isNullOrUndefined(this)&&!e.isNullOrUndefined(t))for(var n,a,l=this.element.selectionStart,r=l,o=!1,h=this.element.value,d=!1,c=!1,u=0;u<t.length;u++){var p=t[u];if(l=this.element.selectionStart,this.maskKeyPress||r!==l||(l+=u),!this.maskKeyPress||l<this.promptMask.length){for(v=l;v<this.promptMask.length;v++)n=this.escapeMaskValue[l],"\\"===this.hiddenMask[l]&&this.hiddenMask[l+1]===t&&(c=!0),(e.isNullOrUndefined(this.regExpCollec[""+n])&&(e.isNullOrUndefined(this.customCharacters)||!e.isNullOrUndefined(this.customCharacters)&&e.isNullOrUndefined(this.customCharacters[""+n]))&&this.hiddenMask[l]!==this.promptChar&&"["!==this.customRegExpCollec[l][0]&&"]"!==this.customRegExpCollec[l][this.customRegExpCollec[l].length-1]||this.promptMask[l]!==this.promptChar&&e.isNullOrUndefined(this.customCharacters)||this.promptChar===n&&this.escapeMaskValue===this.mask)&&(this.element.selectionStart=this.element.selectionEnd=l+1,l=this.element.selectionStart,n=this.hiddenMask[l]);if(e.isNullOrUndefined(this.customCharacters)||e.isNullOrUndefined(this.customCharacters[""+n]))!e.isNullOrUndefined(this.regExpCollec[""+n])&&p.match(new RegExp(this.regExpCollec[""+n]))&&this.promptMask[l]===this.promptChar?o=!0:this.promptMask[l]===this.promptChar&&"["===this.customRegExpCollec[l][0]&&"]"===this.customRegExpCollec[l][this.customRegExpCollec[l].length-1]&&p.match(new RegExp(this.customRegExpCollec[l]))&&(o=!0);else for(var m=this.customCharacters[""+n].split(","),v=0;v<m.length;v++)if(p.match(new RegExp("["+m[v]+"]"))){o=!0;break}if((!this.maskKeyPress||l<this.hiddenMask.length)&&o){if(0===u)if(this.maskKeyPress)this.undoCollec.push({value:h,startIndex:l,endIndex:l});else{var f=this.element.selectionStart,g=this.element.selectionEnd;this.redoCollec.length>0?(a=this.redoCollec[0].value,z.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:l,endIndex:l}),a=this.promptMask,z.call(this,a)),this.element.selectionStart=f,this.element.selectionEnd=g}l=this.element.selectionStart,R.call(this,s,l,p,a,c),d=!0,u===t.length-1&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),o=!1}else l=this.element.selectionStart,V.call(this,s,l,r,t,i,d);u!==t.length-1||o||(!e.Browser.isAndroid||e.Browser.isAndroid&&l<this.promptMask.length)&&this.redoCollec.unshift({value:this.element.value,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd})}else 1!==t.length||i||e.isNullOrUndefined(s)||I.call(this)}}function R(t,e,i,s,n){if(this.hiddenMask.length>this.promptMask.length&&(i=M.call(this,i,this.element.value)),!n){var a=this.element.value,l=a.substring(0,e)+i+a.substring(e+1,a.length);z.call(this,l),this.element.selectionStart=this.element.selectionEnd=e+1}}function V(t,i,s,n,a,l){if(!this.maskKeyPress){var r=this.element.value;i>=this.promptMask.length?z.call(this,r.substring(0,i)):(s===i?z.call(this,r.substring(0,i)+r.substring(i+1,r.length)):this.promptMask.length===this.element.value.length?z.call(this,r.substring(0,i)+r.substring(i,r.length)):z.call(this,r.substring(0,s)+r.substring(s+1,r.length)),this.element.selectionStart=this.element.selectionEnd=l||this.element.value[s]!==this.promptChar?i:s),I.call(this)}1!==n.length||a||e.isNullOrUndefined(t)||I.call(this)}function I(){var t=this,i=this.element.parentNode,s=200;i.classList.contains(it)||i.classList.contains(st)?e.addClass([i],et):e.addClass([this.element],et),!0===this.isIosInvalid&&(s=400),e.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||F.call(t)},s)}function F(){var t=this.element.parentNode;e.isNullOrUndefined(t)||e.removeClass([t],et),e.removeClass([this.element],et),e.attributes(this.element,{"aria-invalid":"false"})}function M(t,e){var i,s,n=e,a=0;for(s=0;s<this.hiddenMask.length;s++)if("\\"===this.hiddenMask[s]&&(i=n.substring(0,s)+"\\"+n.substring(s,n.length)),">"!==this.hiddenMask[s]&&"<"!==this.hiddenMask[s]&&"|"!==this.hiddenMask[s]||(this.hiddenMask[s]!==n[s]&&(i=n.substring(0,s)+this.hiddenMask[s]+n.substring(s,n.length)),++a),i){if(i[s]===this.promptChar&&s>this.element.selectionStart||this.element.value.indexOf(this.promptChar)<0&&this.element.selectionStart+a===s){a=0;break}n=i}for(;s>=0&&i;){if(0===s||"\\"!==i[s-1]){if(">"===i[s]){t=t.toUpperCase();break}if("<"===i[s]){t=t.toLowerCase();break}if("|"===i[s])break}--s}return t}function D(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,z.call(this,this.promptMask),""===t||null===t&&"Never"===this.floatLabelType&&this.placeholder||(this.element.selectionStart=0,this.element.selectionEnd=0),null!==t)for(var i=0;i<t.length;i++)U.call(this,t[i],!1,null);var s=p.call(this,this.element);this.prevValue=s,this.value=s,H.call(this,null,null),this.maskKeyPress=!1;var n=this.element.parentNode.querySelector(".e-float-text");this.element.value===this.promptMask&&"Auto"===this.floatLabelType&&this.placeholder&&!e.isNullOrUndefined(n)&&n.classList.contains(at)&&!this.isFocus&&(e.removeClass([n],at),e.addClass([n],lt),z.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&z.call(this,this.value)}function z(i,s){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&e.isNullOrUndefined(this.value)&&(i="");var n=p.call(this,s||this.element,i);null===n||""===n?(t.Input.setValue(i,s||this.element,this.floatLabelType,!1),this.showClearButton&&this.inputObj.clearButton.classList.add("e-clear-icon-hide")):t.Input.setValue(i,s||this.element,this.floatLabelType,this.showClearButton)}function q(t){var e=W(t);a.call(e);var i=p.call(this,this.element);this.prevValue=i,this.value=i,t.mask&&(r.call(e),l.call(e))}function W(t){e.addClass([t.element],nt);var i={element:t.element,mask:t.mask,promptMask:"",hiddenMask:"",escapeMaskValue:"",promptChar:t.promptChar?t.promptChar.length>1?t.promptChar=t.promptChar[0]:t.promptChar:"_",value:t.value?t.value:null,regExpCollec:rt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return n.call(i),i}function j(t){return p.call(X(t),t.element)}function _(t){return u.call(X(t),t.element)}function X(t){var i;return!e.isNullOrUndefined(t)&&t.element.classList.contains(nt)&&(i=W(t)),i}var K={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",TEXTAREA:"e-multi-line-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",FLOATTEXTCONTENT:"e-float-text-content",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(t){function i(t,i){var n=e.isNullOrUndefined(i)?e.createElement:i,a={container:null,buttons:[],clearButton:null};if(_=t.floatLabelType,X=t.bindClearAction,e.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(a.container=b(t,K.INPUTGROUP,K.INPUTCUSTOMTAG,"span",n),t.element.parentNode.insertBefore(a.container,t.element),e.addClass([t.element],K.INPUT),a.container.appendChild(t.element)):h(t,a,n),s(t),e.isNullOrUndefined(t.properties)||e.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(w(t.properties.showClearButton,t.element,a,!0,n),a.clearButton.setAttribute("role","button"),a.container.classList.contains(K.FLOATINPUT)&&e.addClass([a.container],K.INPUTGROUP)),!e.isNullOrUndefined(t.buttons))for(var l=0;l<t.buttons.length;l++)a.buttons.push(W(t.buttons[l],a.container,n));return e.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||e.addClass([a.container],K.TEXTAREA),j(a.container,t.element),a=c(t,a),U(a.container,n),a}function s(e){n(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var i=m(this);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.add("e-input-focus"),"Auto"===e.floatLabelType&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}),e.element.addEventListener("blur",function(){var i=m(this);(i.classList.contains("e-input-group")||i.classList.contains("e-outline")||i.classList.contains("e-filled"))&&i.classList.remove("e-input-focus"),"Auto"===e.floatLabelType&&""===e.element.value&&setTimeout(function(){t.calculateWidth(e.element,i)},80)}),e.element.addEventListener("input",function(){n(_,e.element)})}function n(t,i){var s=i.value,n=i.parentElement,a=n.parentElement;""===s||e.isNullOrUndefined(s)?"Always"!==t&&(n&&n.classList.contains("e-input-group")?n.classList.remove("e-valid-input"):a&&a.classList.contains("e-input-group")&&a.classList.remove("e-valid-input")):n&&n.classList.contains("e-input-group")?n.classList.add("e-valid-input"):a&&a.classList.contains("e-input-group")&&a.classList.add("e-valid-input")}function a(){var t=m(this).getElementsByClassName("e-float-text")[0];e.isNullOrUndefined(t)||(e.addClass([t],K.LABELTOP),t.classList.contains(K.LABELBOTTOM)&&e.removeClass([t],K.LABELBOTTOM))}function l(){var t=m(this);if(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value){var i=t.getElementsByClassName("e-float-text")[0];e.isNullOrUndefined(i)||(i.classList.contains(K.LABELTOP)&&e.removeClass([i],K.LABELTOP),e.addClass([i],K.LABELBOTTOM))}}function r(t){t.addEventListener("focus",a),t.addEventListener("blur",l)}function o(t){t.removeEventListener("focus",a),t.removeEventListener("blur",l)}function h(t,i,s){var n=e.isNullOrUndefined(s)?e.createElement:s;"Auto"===t.floatLabelType&&r(t.element),e.isNullOrUndefined(i.container)?(i.container=b(t,K.FLOATINPUT,K.FLOATCUSTOMTAG,"div",n),i.container.classList.add(K.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(i.container,t.element)):(e.isNullOrUndefined(t.customTag)||i.container.classList.add(K.FLOATCUSTOMTAG),i.container.classList.add(K.FLOATINPUT));var a=n("span",{className:K.FLOATLINE}),l=n("label",{className:K.FLOATTEXT});if(e.isNullOrUndefined(t.element.id)||""===t.element.id||(l.id="label_"+t.element.id.replace(/ /g,"_"),e.attributes(t.element,{"aria-labelledby":l.id})),e.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(l.innerText=C(t.element.placeholder),t.element.removeAttribute("placeholder")),e.isNullOrUndefined(t.properties)||e.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(l.innerText=C(t.properties.placeholder)),l.innerText||i.container.classList.add(K.NOFLOATLABEL),i.container.classList.contains("e-float-icon-left")){var o=i.container.querySelector(".e-input-in-wrap");o.appendChild(t.element),o.appendChild(a),o.appendChild(l)}else i.container.appendChild(t.element),i.container.appendChild(a),i.container.appendChild(l);p(t.element.value,l),"Always"===t.floatLabelType&&(l.classList.contains(K.LABELBOTTOM)&&e.removeClass([l],K.LABELBOTTOM),e.addClass([l],K.LABELTOP)),"Auto"===t.floatLabelType&&(t.element.addEventListener("input",function(e){p(t.element.value,l,t.element)}),t.element.addEventListener("blur",function(e){p(t.element.value,l)})),e.isNullOrUndefined(t.element.getAttribute("id"))||l.setAttribute("for",t.element.getAttribute("id"))}function d(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function c(t,i){if(!e.isNullOrUndefined(t.properties))for(var s=0,n=Object.keys(t.properties);s<n.length;s++)switch(n[s]){case"cssClass":x(t.properties.cssClass,[i.container]),d(t.floatLabelType,i.container);break;case"enabled":O(t.properties.enabled,t.element,t.floatLabelType,i.container);break;case"enableRtl":L(t.properties.enableRtl,[i.container]);break;case"placeholder":k(t.properties.placeholder,t.element);break;case"readonly":P(t.properties.readonly,t.element)}return i}function u(t,i,s){e.isNullOrUndefined(i)||(t&&!s?e.removeClass([i],K.CLEARICONHIDE):e.addClass([i],K.CLEARICONHIDE))}function p(t,i,s){void 0===s&&(s=null),t?(e.addClass([i],K.LABELTOP),i.classList.contains(K.LABELBOTTOM)&&e.removeClass([i],K.LABELBOTTOM)):(null==s||s!==document.activeElement)&&(i.classList.contains(K.LABELTOP)&&e.removeClass([i],K.LABELTOP),e.addClass([i],K.LABELBOTTOM))}function m(t){var i=e.isNullOrUndefined(t.parentNode)?t:t.parentNode;return i&&i.classList.contains("e-input-in-wrap")&&(i=i.parentNode),i}function v(t,i,s,n){var a=(e.isNullOrUndefined(n)?e.createElement:n)("span",{className:K.CLEARICON}),l=i.container;return e.isNullOrUndefined(s)?(i.container.classList.contains(K.FLOATINPUT)?i.container.querySelector("."+K.FLOATTEXT):t).insertAdjacentElement("afterend",a):l.appendChild(a),e.addClass([a],K.CLEARICONHIDE),f(t,a,l),a.setAttribute("aria-label","close"),a}function f(t,i,s){(void 0===X||X)&&i.addEventListener("click",function(s){t.classList.contains(K.DISABLE)||t.readOnly||(s.preventDefault(),t!==document.activeElement&&t.focus(),t.value="",e.addClass([i],K.CLEARICONHIDE))}),t.addEventListener("input",function(e){u(t.value,i)}),t.addEventListener("focus",function(e){u(t.value,i,t.readOnly)}),t.addEventListener("blur",function(s){setTimeout(function(){e.isNullOrUndefined(i)||(e.addClass([i],K.CLEARICONHIDE),i=!e.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:i)},200)})}function g(){}function y(t,e){if(m(t).classList.contains(K.FLOATINPUT)&&"Auto"===e){var i=m(t).getElementsByClassName("e-float-text")[0];p(t.value,i,t)}}function b(t,i,s,n,a){var l,r=e.isNullOrUndefined(a)?e.createElement:a;return e.isNullOrUndefined(t.customTag)?l=r(n,{className:i}):(l=r(t.customTag,{className:i})).classList.add(s),l.classList.add("e-control-wrapper"),l}function C(t){var i="";if(!e.isNullOrUndefined(t)&&""!==t){var s=document.createElement("span");s.innerHTML='<input placeholder="'+t+'"/>',i=s.children[0].placeholder}return i}function E(t,i,s,a){if(i.value=t,"Auto"===s&&""===t&&S(i,i.parentElement),e.isNullOrUndefined(s)||"Auto"!==s||y(i,s),!e.isNullOrUndefined(a)&&a){var l=m(i);if(!e.isNullOrUndefined(l)){var r=l.getElementsByClassName(K.CLEARICON)[0];e.isNullOrUndefined(r)||(i.value&&!e.isNullOrUndefined(l)&&l.classList.contains("e-input-focus")?e.removeClass([r],K.CLEARICONHIDE):e.addClass([r],K.CLEARICONHIDE))}}n(s,i)}function x(t,i,s){e.isNullOrUndefined(s)||""===s||e.removeClass(i,s.split(" ")),e.isNullOrUndefined(t)||""===t||e.addClass(i,t.split(" "))}function S(t,i,s){var n="multiselect"===s?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10);e.isNullOrUndefined(i.getElementsByClassName("e-float-text-content")[0])||(i.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&i.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),(n<i.getElementsByClassName("e-float-text-content")[0].clientWidth||n===i.getElementsByClassName("e-float-text-content")[0].clientWidth)&&i.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow"))}function T(t,i){"number"==typeof t?i.style.width=e.formatUnit(t):"string"==typeof t&&(i.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)),S(i.firstChild,i)}function k(t,i){t=C(t);var s=m(i);s.classList.contains(K.FLOATINPUT)?e.isNullOrUndefined(t)||""===t?(s.classList.add(K.NOFLOATLABEL),s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(K.FLOATTEXT)[0].children[0].textContent="":s.getElementsByClassName(K.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(K.FLOATTEXT)[0].children[0].textContent=t:s.getElementsByClassName(K.FLOATTEXT)[0].textContent=t,s.classList.remove(K.NOFLOATLABEL),i.removeAttribute("placeholder")):e.isNullOrUndefined(t)||""===t?i.removeAttribute("placeholder"):e.attributes(i,{placeholder:t})}function P(t,i,s){t?e.attributes(i,{readonly:""}):i.removeAttribute("readonly"),e.isNullOrUndefined(s)||y(i,s)}function L(t,i){t?e.addClass(i,K.RTL):e.removeClass(i,K.RTL)}function O(t,i,s,n){var a={disabled:"disabled","aria-disabled":"true"},l=!e.isNullOrUndefined(n);t?(i.classList.remove(K.DISABLE),H(a,i),l&&e.removeClass([n],K.DISABLE)):(i.classList.add(K.DISABLE),N(a,i),l&&e.addClass([n],K.DISABLE)),e.isNullOrUndefined(s)||y(i,s)}function w(t,i,s,n,a){var l=e.isNullOrUndefined(a)?e.createElement:a;t?s.clearButton=v(i,s,n,l):(e.remove(s.clearButton),s.clearButton=null)}function H(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=m(e);"disabled"===n&&e.classList.remove(K.DISABLE),"disabled"===n&&a.classList.contains(K.INPUTGROUP)&&a.classList.remove(K.DISABLE),"placeholder"===n&&a.classList.contains(K.FLOATINPUT)?a.getElementsByClassName(K.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function N(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=m(e);"disabled"===n&&e.classList.add(K.DISABLE),"disabled"===n&&a.classList.contains(K.INPUTGROUP)&&a.classList.add(K.DISABLE),"placeholder"===n&&a.classList.contains(K.FLOATINPUT)?a.getElementsByClassName(K.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function A(t){var i=t.container;if(!e.isNullOrUndefined(i)&&i.classList.contains(K.FLOATINPUT)){var s=i.querySelector("textarea")?i.querySelector("textarea"):i.querySelector("input"),n=i.querySelector("."+K.FLOATTEXT).textContent,a=null!==i.querySelector(".e-clear-icon");e.detach(i.querySelector("."+K.FLOATLINE)),e.detach(i.querySelector("."+K.FLOATTEXT)),e.classList(i,[K.INPUTGROUP],[K.FLOATINPUT]),o(s),e.attributes(s,{placeholder:n}),s.classList.add(K.INPUT),a||"INPUT"!==s.tagName||s.removeAttribute("required")}}function B(t,i,s,n){var a=e.isNullOrUndefined(n)?e.createElement:n,l=e.closest(t,"."+K.INPUTGROUP);if(_=i,"Never"!==i){var r=l.tagName,o={element:t,floatLabelType:i,customTag:r="DIV"!==r&&"SPAN"!==r?r:null,properties:{placeholder:s}},c=l.querySelector(".e-clear-icon"),u={container:l};t.classList.remove(K.INPUT),h(o,u,a),U(u.container,a),S(o.element,u.container);var p=l.classList.contains("e-float-icon-left");if(e.isNullOrUndefined(c)&&(c=p?l.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon"):l.querySelector(".e-input-group-icon")),e.isNullOrUndefined(c))p&&(c=l.querySelector(".e-input-group-icon"));else{var m=l.querySelector("."+K.FLOATLINE),v=l.querySelector("."+K.FLOATTEXT),f=p?l.querySelector(".e-input-in-wrap"):l;f.insertBefore(t,c),f.insertBefore(m,c),f.insertBefore(v,c)}}d(i,t.parentElement)}function U(t,e){if(t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]){var i=e("span",{className:K.FLOATTEXTCONTENT});i.innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(i)}}function R(t,e){for(var i=0;i<e.length;i++)V(t,e[parseInt(i.toString())].container)}function V(t,i,s){var n=[];n.push(s);var a=e.isNullOrUndefined(s)?i.querySelectorAll(".e-input-group-icon"):n;if(t&&a.length>0)for(l=0;l<a.length;l++)a[parseInt(l.toString())].addEventListener("mousedown",F,!1),a[parseInt(l.toString())].addEventListener("mouseup",M,!1);else if(a.length>0)for(var l=0;l<a.length;l++)a[parseInt(l.toString())].removeEventListener("mousedown",F,this),a[parseInt(l.toString())].removeEventListener("mouseup",M,this)}function I(t,e){t.classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function F(){for(var t=this,e=this.parentElement;!e.classList.contains("e-input-group");)e=e.parentElement;I(e,t)}function M(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function D(t,e){var i=e("span",{className:t});return i.classList.add("e-input-group-icon"),i}function z(t,e,i,s,n){var a="string"==typeof e?e.split(","):e;if("append"===t.toLowerCase())for(var l=0,r=a;l<r.length;l++)W(d=r[l],i,n);else for(var o=0,h=a;o<h.length;o++){var d=h[o];q(d,i,s,n)}i.getElementsByClassName("e-input-group-icon")[0]&&i.getElementsByClassName("e-float-text-overflow")[0]&&i.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon")}function q(t,i,s,n){var a=e.isNullOrUndefined(n)?e.createElement:n,l=D(t,a);i.classList.add("e-float-icon-left");var r=i.querySelector(".e-input-in-wrap");if(e.isNullOrUndefined(r)){r=a("span",{className:"e-input-in-wrap"}),s.parentNode.insertBefore(r,s);var o=i.querySelectorAll(s.tagName+" ~ *");r.appendChild(s);for(var h=0;h<o.length;h++){var d=o[parseInt(h.toString())],c=r.parentElement;d.classList.contains("e-float-line")&&(c&&c.classList.contains("e-filled")||!c)||r.appendChild(d)}}return r.parentNode.insertBefore(l,r),V(!0,i,l),l}function W(t,i,s){var n=D(t,e.isNullOrUndefined(s)?e.createElement:s);return(i.classList.contains("e-float-icon-left")?i.querySelector(".e-input-in-wrap"):i).appendChild(n),V(!0,i,n),n}function j(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}var _,X=!0;t.createInput=i,t.bindInitialEvent=s,t.wireFloatingEvents=r,t.wireClearBtnEvents=f,t.destroy=g,t.setValue=E,t.setCssClass=x,t.calculateWidth=S,t.setWidth=T,t.setPlaceholder=k,t.setReadonly=P,t.setEnableRtl=L,t.setEnabled=O,t.setClearButton=w,t.removeAttributes=H,t.addAttributes=N,t.removeFloating=A,t.addFloating=B,t.createSpanElement=U,t.setRipple=R,t.addIcon=z,t.prependSpan=q,t.appendSpan=W,t.validateInputType=j}(t.Input||(t.Input={}));var Z=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function s(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Y=function(t,e,i,s){var n,a=arguments.length,l=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,s);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(l=(a<3?n(l):a>3?n(e,i,l):n(e,i))||l);return a>3&&l&&Object.defineProperty(e,i,l),l},G="e-input-group-icon",J=new RegExp("^(-)?(\\d*)$"),$=["title","style","class"],Q=0,tt=function(i){function s(t,e){var s=i.call(this,t,e)||this;return s.isVue=!1,s.preventChange=!1,s.isAngular=!1,s.isDynamicChange=!1,s.numericOptions=t,s}return Z(s,i),s.prototype.preRender=function(){this.isPrevFocused=!1,this.decimalSeparator=".",this.intRegExp=new RegExp("/^(-)?(d*)$/"),this.isCalled=!1;var t=e.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),e.removeClass([this.cloneElement],["e-control","e-numerictextbox","e-lib"]),this.angularTagName=null,this.formEle=e.closest(this.element,"form"),"EJS-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var i=this.createElement("input"),s=0;for(s;s<this.element.attributes.length;s++){var n=this.element.attributes[s].nodeName;"id"!==n&&"class"!==n?(i.setAttribute(this.element.attributes[s].nodeName,this.element.attributes[s].nodeValue),i.innerHTML=this.element.innerHTML):"class"===n&&i.setAttribute(n,this.element.className.split(" ").filter(function(t){return 0!==t.indexOf("ng-")}).join(" "))}this.element.hasAttribute("name")&&this.element.removeAttribute("name"),this.element.classList.remove("e-control","e-numerictextbox"),this.element.appendChild(i),this.element=i,e.setValue("ej2_instances",t,this.element)}e.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});var a={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new e.L10n("numerictextbox",a,this.locale),""!==this.l10n.getConstant("placeholder")&&this.setProperties({placeholder:this.placeholder||this.l10n.getConstant("placeholder")},!0),this.element.hasAttribute("id")||this.element.setAttribute("id",e.getUniqueID("numerictextbox")),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.prevValue=this.value,this.updateHTMLAttrToElement(),this.checkAttributes(!1),this.formEle&&(this.inputEleValue=this.value),this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},s.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setElementWidth(this.width),this.container.classList.contains("e-input-group")||this.container.classList.add("e-input-group"),this.changeValue(null===this.value||isNaN(this.value)?null:this.strictMode?this.trimValue(this.value):this.value),this.wireEvents(),null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0),(this.element.getAttribute("value")||this.value)&&(this.element.setAttribute("value",this.element.value),this.hiddenInput.setAttribute("value",this.hiddenInput.value)),this.elementPrevValue=this.element.value,this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),!e.isNullOrUndefined(e.closest(this.element,"fieldset"))&&e.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},s.prototype.checkAttributes=function(t){for(var i=0,s=t?e.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];i<s.length;i++){var n=s[i];if(!e.isNullOrUndefined(this.element.getAttribute(n)))switch(n){case"disabled":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t){var a="disabled"!==this.element.getAttribute(n)&&""!==this.element.getAttribute(n)&&"true"!==this.element.getAttribute(n);this.setProperties({enabled:a},!t)}break;case"readonly":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t){var l="readonly"===this.element.getAttribute(n)||""===this.element.getAttribute(n)||"true"===this.element.getAttribute(n);this.setProperties({readonly:l},!t)}break;case"placeholder":(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||t){var r=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));this.setProperties(e.setValue(n,r,{}),!t)}break;case"min":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.min||t){var o=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===o||isNaN(o)||this.setProperties(e.setValue(n,o,{}),!t)}break;case"max":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.max||t){var h=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===h||isNaN(h)||this.setProperties(e.setValue(n,h,{}),!t)}break;case"step":if(e.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.step||t){var d=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));null===d||isNaN(d)||this.setProperties(e.setValue(n,d,{}),!t)}break;case"style":this.inputStyle=this.element.getAttribute(n);break;case"name":this.inputName=this.element.getAttribute(n);break;default:var c=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));(null!==c&&!isNaN(c)||"value"===n)&&this.setProperties(e.setValue(n,c,{}),!0)}}},s.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},s.prototype.initCultureFunc=function(){this.instance=new e.Internationalization(this.locale)},s.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==e.getValue("currency",this)&&(e.setValue("currency",this.currency,this.cultureInfo),this.setProperties({currencyCode:this.currency},!0))},s.prototype.createWrapper=function(){var i=this.cssClass;e.isNullOrUndefined(this.cssClass)||""===this.cssClass||(i=this.getNumericValidClassList(this.cssClass));var s=t.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:i,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement);this.inputWrapper=s,this.container=s.container,this.container.setAttribute("class","e-control-wrapper e-numeric "+this.container.getAttribute("class")),this.updateHTMLAttrToWrapper(),this.readonly&&e.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=this.createElement("input",{attrs:{type:"text",validateHidden:"true",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&this.cloneElement.id.length>0?e.attributes(this.hiddenInput,{name:this.cloneElement.id}):e.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.container.childNodes[1]),this.updateDataAttribute(!1),null!==this.inputStyle&&e.attributes(this.container,{style:this.inputStyle})},s.prototype.updateDataAttribute=function(t){var e={};if(t)e=this.htmlAttributes;else for(var i=0;i<this.element.attributes.length;i++)e[this.element.attributes[i].name]=this.element.getAttribute(this.element.attributes[i].name);for(var s=0,n=Object.keys(e);s<n.length;s++){var a=n[s];0===a.indexOf("data")&&this.hiddenInput.setAttribute(a,e[""+a])}},s.prototype.updateHTMLAttrToElement=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];$.indexOf(s)<0&&this.element.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.updateCssClass=function(e,i){t.Input.setCssClass(this.getNumericValidClassList(e),[this.container],this.getNumericValidClassList(i))},s.prototype.getNumericValidClassList=function(t){var i=t;return e.isNullOrUndefined(t)||""===t||(i=t.replace(/\s+/g," ").trim()),i},s.prototype.updateHTMLAttrToWrapper=function(){if(!e.isNullOrUndefined(this.htmlAttributes))for(var t=0,i=Object.keys(this.htmlAttributes);t<i.length;t++){var s=i[t];if($.indexOf(s)>-1)if("class"===s){var n=this.getNumericValidClassList(this.htmlAttributes[""+s]);""!==n&&e.addClass([this.container],n.split(" "))}else if("style"===s){var a=this.container.getAttribute(s);a=e.isNullOrUndefined(a)?this.htmlAttributes[""+s]:a+this.htmlAttributes[""+s],this.container.setAttribute(s,a)}else this.container.setAttribute(s,this.htmlAttributes[""+s])}},s.prototype.setElementWidth=function(t){e.isNullOrUndefined(t)||("number"==typeof t?this.container.style.width=e.formatUnit(t):"string"==typeof t&&(this.container.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)))},s.prototype.spinBtnCreation=function(){this.spinDown=t.Input.appendSpan(G+" e-spin-down",this.container,this.createElement),e.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=t.Input.appendSpan(G+" e-spin-up",this.container,this.createElement),e.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},s.prototype.validateMinMax=function(){("number"!=typeof this.min||isNaN(this.min))&&this.setProperties({min:-Number.MAX_VALUE},!0),("number"!=typeof this.max||isNaN(this.max))&&this.setProperties({max:Number.MAX_VALUE},!0),null!==this.decimals&&(this.min!==-Number.MAX_VALUE&&this.setProperties({min:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.min))},!0),this.max!==Number.MAX_VALUE&&this.setProperties({max:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.max))},!0)),this.setProperties({min:this.min>this.max?this.max:this.min},!0),this.min!==-Number.MAX_VALUE&&e.attributes(this.element,{"aria-valuemin":this.min.toString()}),this.max!==Number.MAX_VALUE&&e.attributes(this.element,{"aria-valuemax":this.max.toString()})},s.prototype.formattedValue=function(t,e){return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},s.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},s.prototype.action=function(t,e){this.isInteract=!0;var i=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(i,this.step,t)),this.raiseChangeEvent(e)},s.prototype.checkErrorClass=function(){this.isValidState?e.removeClass([this.container],"e-error"):e.addClass([this.container],"e-error"),e.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},s.prototype.bindClearEvent=function(){this.showClearButton&&e.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},s.prototype.resetHandler=function(t){t.preventDefault(),