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 354 kB
/*! * filename: ej2-inputs.umd.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. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-splitbuttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons"],e):e(t.ej={},t.ej2Base,t.ej2Popups,t.ej2Splitbuttons)}(this,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]+"["),p.call(this,s[n])}else{if((s=t[i].split("[")).length>1){var a=!1;for(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):p.call(this,s[n])}else p.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(){I.call(this,this.promptMask),V.call(this,this.value)}function l(){e.EventHandler.add(this.element,"keydown",k,this),e.EventHandler.add(this.element,"keypress",O,this),e.EventHandler.add(this.element,"keyup",N,this),e.EventHandler.add(this.element,"input",S,this),e.EventHandler.add(this.element,"focus",f,this),e.EventHandler.add(this.element,"blur",b,this),e.EventHandler.add(this.element,"paste",C,this),e.EventHandler.add(this.element,"cut",E,this),e.EventHandler.add(this.element,"drop",x,this),e.EventHandler.add(this.element,"mousedown",m,this),e.EventHandler.add(this.element,"mouseup",v,this),this.enabled&&(o.call(this),this.formElement&&e.EventHandler.add(this.formElement,"reset",d,this))}function r(){e.EventHandler.remove(this.element,"keydown",k),e.EventHandler.remove(this.element,"keypress",O),e.EventHandler.remove(this.element,"keyup",N),e.EventHandler.remove(this.element,"input",S),e.EventHandler.remove(this.element,"focus",f),e.EventHandler.remove(this.element,"blur",b),e.EventHandler.remove(this.element,"paste",C),e.EventHandler.remove(this.element,"cut",E),e.EventHandler.remove(this.element,"mousedown",m),e.EventHandler.remove(this.element,"mouseup",v),this.formElement&&e.EventHandler.remove(this.formElement,"reset",d)}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")||(function(t){var e=this.element.value;I.call(this,this.promptMask),this.redoCollec.unshift({value:this.promptMask,startIndex:this.element.selectionStart,endIndex:this.element.selectionEnd}),w.call(this,t,e),this.element.setSelectionRange(0,0)}.call(this,t),this.value="")}function d(){"EJS-MASKEDTEXTBOX"===this.element.tagName?I.call(this,this.promptMask):this.value=this.initInputValue}function u(t){return t.value}function c(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 p(t){for(var e=0;e<t.length;e++)this.hiddenMask+=t[e],"\\"!==t[e]&&this.customRegExpCollec.push(t[e])}function m(){this.isClicked=!0}function v(){this.isClicked=!1}function f(t){var i=this,s=this.element,n=0,a=c.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||g.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},g.call(i,o,s)},110);break}e.isNullOrUndefined(s.value.match(y(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},g.call(this,o,s)),this.isClicked=!1}}function g(t,e){this.trigger("focus",t,function(t){e.selectionStart=t.selectionStart,e.selectionEnd=t.selectionEnd})}function y(t){return e.isNullOrUndefined(t)?t:t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function b(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)){I.call(this,"");var i=this.element.parentNode.querySelector(".e-float-text");"Auto"===this.floatLabelType&&!e.isNullOrUndefined(i)&&i.classList.contains(it)&&e.removeClass([i],it)}}function C(t){var e=this;if(this.mask&&!this.readonly){var i=this.element.selectionStart,s=this.element.selectionEnd,n=this.element.value;I.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=c.call(e,e.element)),I.call(e,n),e.element.selectionStart=i,e.element.selectionEnd=s;var l=0;e.maskKeyPress=!0;do{H.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{H.call(e,a[r],!1,null),++r}while(r<a.length);e.maskKeyPress=!1}else w.call(e,t,n)},1)}}function E(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(){I.call(e,a),e.element.selectionStart=e.element.selectionEnd=s,e.element.value!==i&&w.call(e,t,null)},0)}}function x(t){t.preventDefault()}function S(t){if(!0!==e.Browser.isIE||""!==this.element.value||"Never"!==this.floatLabelType){if(e.extend(t,{ctrlKey:!1,keyCode:229}),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||L.call(this,t),this.element.value.length>this.promptMask.length){var i=this.element.selectionStart,s=this.element.value.length-this.promptMask.length,n=this.element.value.substring(i-s,i);this.maskKeyPress=!1;var a=0;do{H.call(this,n[a],t.ctrlKey,t),++a}while(a<n.length);this.element.value!==this.preEleVal&&w.call(this,t,null)}var l=c.call(this,this.element);this.prevValue=l,this.value=l,""===l&&(I.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(),L.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}),I.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}),I.call(this,i.value),this.element.selectionStart=i.startIndex,this.element.selectionEnd=i.endIndex,this.redoCollec.splice(0,1))}}}function T(){var t,e=this.element.selectionStart,i=this.element.selectionEnd;this.redoCollec.length>0?(t=this.redoCollec[0],I.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)):(I.call(this,this.promptMask),this.element.selectionStart=this.element.selectionEnd=e)}function P(t,e,i){return"input"===i.type&&(t=!1,e=this.element.value,I.call(this,this.promptMask),V.call(this,e)),t}function L(t){var i,s=!1,n=!1;this.element.value.length<this.promptMask.length&&(s=!0,i=this.element.value,s=P.call(this,s,i,t),T.call(this)),this.element.value.length>=this.promptMask.length&&"input"===t.type&&(s=P.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],u=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 c=!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&&(c=!0)):46===t.keyCode?++m:--m;for(var v=r;8===t.keyCode||s||c?v>m:v<m;8===t.keyCode||s||c?v--:v++)for(var f=r;8===t.keyCode||s||c?f>0:f<this.element.value.length;8===t.keyCode||s||c?f--:f++){var g=void 0;(8===t.keyCode||c)&&(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||c||++this.element.selectionStart;else{var b=this.element.value,C=this.promptChar,E=b.substring(0,g)+C+b.substring(r,b.length);I.call(this,E),t.preventDefault(),46!==t.keyCode||c||g++,this.element.selectionStart=this.element.selectionEnd=g,n=!0}if(r=this.element.selectionStart,!n&&8===t.keyCode||c||!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&&c&&n&&(this.element.selectionStart=this.element.selectionEnd=u),0===this.element.selectionStart&&this.element.selectionEnd===this.element.value.length&&(I.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&&w.call(this,t,i)}}function O(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&&(H.call(this,i,t.ctrlKey,t),t.preventDefault()):(this.isIosInvalid=!0,H.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&&w.call(this,t,e)}}function w(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=c.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=c.call(this,this.element)}function N(t){if(this.mask&&!this.readonly){var i=void 0;if(this.maskKeyPress||229!==t.keyCode)R.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&&B.call(this,t,r-1,this.element.selectionEnd-1,l,t.ctrlKey,!1):H.call(this,l,t.ctrlKey,t)}else s=this.promptMask,H.call(this,l,t.ctrlKey,t);this.maskKeyPress=!1,w.call(this,t,s)}}var d=c.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 w.call(this,t);if(0===this.element.selectionStart&&0===this.element.selectionEnd){var u=this.element;setTimeout(function(){u.setSelectionRange(0,0)},0)}}function A(t){this.maskKeyPress||function(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);I.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}.call(this,t)}function H(t,i,s){if(A.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,u=!1,c=0;c<t.length;c++){var p=t[c];if(l=this.element.selectionStart,this.maskKeyPress||r!==l||(l+=c),!this.maskKeyPress||l<this.promptMask.length){for(var m=l;m<this.promptMask.length;m++){n=this.escapeMaskValue[l],"\\"===this.hiddenMask[l]&&this.hiddenMask[l+1]===t&&(u=!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{var v=this.customCharacters[""+n].split(",");for(m=0;m<v.length;m++)if(p.match(new RegExp("["+v[m]+"]"))){o=!0;break}}if((!this.maskKeyPress||l<this.hiddenMask.length)&&o){if(0===c)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,I.call(this,a),this.undoCollec.push(this.redoCollec[0])):(this.undoCollec.push({value:this.promptMask,startIndex:l,endIndex:l}),a=this.promptMask,I.call(this,a)),this.element.selectionStart=f,this.element.selectionEnd=g}l=this.element.selectionStart,function(t,e,i,s,n){this.hiddenMask.length>this.promptMask.length&&(i=function(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}.call(this,i,this.element.value));if(!n){var a=this.element.value,l=a.substring(0,e)+i+a.substring(e+1,a.length);I.call(this,l),this.element.selectionStart=this.element.selectionEnd=e+1}}.call(this,s,l,p,a,u),d=!0,c===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,B.call(this,s,l,r,t,i,d);c!==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)||U.call(this)}}function B(t,i,s,n,a,l){if(!this.maskKeyPress){var r=this.element.value;i>=this.promptMask.length?I.call(this,r.substring(0,i)):(s===i?I.call(this,r.substring(0,i)+r.substring(i+1,r.length)):this.promptMask.length===this.element.value.length?I.call(this,r.substring(0,i)+r.substring(i,r.length)):I.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),U.call(this)}1!==n.length||a||e.isNullOrUndefined(t)||U.call(this)}function U(){var t=this,i=this.element.parentNode,s=200;i.classList.contains(Q)||i.classList.contains(tt)?e.addClass([i],$):e.addClass([this.element],$),!0===this.isIosInvalid&&(s=400),e.attributes(this.element,{"aria-invalid":"true"}),setTimeout(function(){t.maskKeyPress||R.call(t)},s)}function R(){var t=this.element.parentNode;e.isNullOrUndefined(t)||e.removeClass([t],$),e.removeClass([this.element],$),e.attributes(this.element,{"aria-invalid":"false"})}function V(t){if(this.mask&&void 0!==t&&(void 0===this.prevValue||this.prevValue!==t)){if(this.maskKeyPress=!0,I.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++)H.call(this,t[i],!1,null);var s=c.call(this,this.element);this.prevValue=s,this.value=s,w.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(it)&&!this.isFocus&&(e.removeClass([n],it),e.addClass([n],st),I.call(this,""))}(null===this.mask||""===this.mask&&void 0!==this.value)&&I.call(this,this.value)}function I(i,s){!this.isFocus&&"Auto"===this.floatLabelType&&this.placeholder&&e.isNullOrUndefined(this.value)&&(i="");var n=c.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 F(t){e.addClass([t.element],et);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:nt,customRegExpCollec:[],customCharacters:t.customCharacters,undoCollec:[],redoCollec:[],maskKeyPress:!1,prevValue:""};return n.call(i),i}function M(t){var i;return!e.isNullOrUndefined(t)&&t.element.classList.contains(et)&&(i=F(t)),i}var D={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(e){s(e.floatLabelType,e.element),e.element.addEventListener("focus",function(){var i=u(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=u(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(){s(B,e.element)})}function s(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 n(){var t=u(this).getElementsByClassName("e-float-text")[0];e.isNullOrUndefined(t)||(e.addClass([t],D.LABELTOP),t.classList.contains(D.LABELBOTTOM)&&e.removeClass([t],D.LABELBOTTOM))}function a(){var t=u(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(D.LABELTOP)&&e.removeClass([i],D.LABELTOP),e.addClass([i],D.LABELBOTTOM))}}function l(t){t.addEventListener("focus",n),t.addEventListener("blur",a)}function r(t,i,s){var n=e.isNullOrUndefined(s)?e.createElement:s;"Auto"===t.floatLabelType&&l(t.element),e.isNullOrUndefined(i.container)?(i.container=m(t,D.FLOATINPUT,D.FLOATCUSTOMTAG,"div",n),i.container.classList.add(D.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(i.container,t.element)):(e.isNullOrUndefined(t.customTag)||i.container.classList.add(D.FLOATCUSTOMTAG),i.container.classList.add(D.FLOATINPUT));var a=n("span",{className:D.FLOATLINE}),r=n("label",{className:D.FLOATTEXT});if(e.isNullOrUndefined(t.element.id)||""===t.element.id||(r.id="label_"+t.element.id.replace(/ /g,"_"),e.attributes(t.element,{"aria-labelledby":r.id})),e.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(r.innerText=v(t.element.placeholder),t.element.removeAttribute("placeholder")),e.isNullOrUndefined(t.properties)||e.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(r.innerText=v(t.properties.placeholder)),r.innerText||i.container.classList.add(D.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(r)}else i.container.appendChild(t.element),i.container.appendChild(a),i.container.appendChild(r);d(t.element.value,r),"Always"===t.floatLabelType&&(r.classList.contains(D.LABELBOTTOM)&&e.removeClass([r],D.LABELBOTTOM),e.addClass([r],D.LABELTOP)),"Auto"===t.floatLabelType&&(t.element.addEventListener("input",function(e){d(t.element.value,r,t.element)}),t.element.addEventListener("blur",function(e){d(t.element.value,r)})),e.isNullOrUndefined(t.element.getAttribute("id"))||r.setAttribute("for",t.element.getAttribute("id"))}function o(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function h(t,i,s){e.isNullOrUndefined(i)||(t&&!s?e.removeClass([i],D.CLEARICONHIDE):e.addClass([i],D.CLEARICONHIDE))}function d(t,i,s){if(void 0===s&&(s=null),t)e.addClass([i],D.LABELTOP),i.classList.contains(D.LABELBOTTOM)&&e.removeClass([i],D.LABELBOTTOM);else{(null==s||s!==document.activeElement)&&(i.classList.contains(D.LABELTOP)&&e.removeClass([i],D.LABELTOP),e.addClass([i],D.LABELBOTTOM))}}function u(t){var i=e.isNullOrUndefined(t.parentNode)?t:t.parentNode;return i&&i.classList.contains("e-input-in-wrap")&&(i=i.parentNode),i}function c(t,i,s){(void 0===U||U)&&i.addEventListener("click",function(s){t.classList.contains(D.DISABLE)||t.readOnly||(s.preventDefault(),t!==document.activeElement&&t.focus(),t.value="",e.addClass([i],D.CLEARICONHIDE))}),t.addEventListener("input",function(e){h(t.value,i)}),t.addEventListener("focus",function(e){h(t.value,i,t.readOnly)}),t.addEventListener("blur",function(s){setTimeout(function(){e.isNullOrUndefined(i)||(e.addClass([i],D.CLEARICONHIDE),i=!e.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:i)},200)})}function p(t,e){if(u(t).classList.contains(D.FLOATINPUT)&&"Auto"===e){var i=u(t).getElementsByClassName("e-float-text")[0];d(t.value,i,t)}}function m(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 v(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 f(t,i,s){e.isNullOrUndefined(s)||""===s||e.removeClass(i,s.split(" ")),e.isNullOrUndefined(t)||""===t||e.addClass(i,t.split(" "))}function g(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 y(t,i){t=v(t);var s=u(i);s.classList.contains(D.FLOATINPUT)?e.isNullOrUndefined(t)||""===t?(s.classList.add(D.NOFLOATLABEL),s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(D.FLOATTEXT)[0].children[0].textContent="":s.getElementsByClassName(D.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName("e-float-text-content")[0]?s.getElementsByClassName(D.FLOATTEXT)[0].children[0].textContent=t:s.getElementsByClassName(D.FLOATTEXT)[0].textContent=t,s.classList.remove(D.NOFLOATLABEL),i.removeAttribute("placeholder")):e.isNullOrUndefined(t)||""===t?i.removeAttribute("placeholder"):e.attributes(i,{placeholder:t})}function b(t,i,s){t?e.attributes(i,{readonly:""}):i.removeAttribute("readonly"),e.isNullOrUndefined(s)||p(i,s)}function C(t,i){t?e.addClass(i,D.RTL):e.removeClass(i,D.RTL)}function E(t,i,s,n){var a={disabled:"disabled","aria-disabled":"true"},l=!e.isNullOrUndefined(n);t?(i.classList.remove(D.DISABLE),S(a,i),l&&e.removeClass([n],D.DISABLE)):(i.classList.add(D.DISABLE),k(a,i),l&&e.addClass([n],D.DISABLE)),e.isNullOrUndefined(s)||p(i,s)}function x(t,i,s,n,a){var l=e.isNullOrUndefined(a)?e.createElement:a;t?s.clearButton=function(t,i,s,n){var a=(e.isNullOrUndefined(n)?e.createElement:n)("span",{className:D.CLEARICON}),l=i.container;e.isNullOrUndefined(s)?(i.container.classList.contains(D.FLOATINPUT)?i.container.querySelector("."+D.FLOATTEXT):t).insertAdjacentElement("afterend",a):l.appendChild(a);return e.addClass([a],D.CLEARICONHIDE),c(t,a),a.setAttribute("aria-label","close"),a}(i,s,n,l):(e.remove(s.clearButton),s.clearButton=null)}function S(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=u(e);"disabled"===n&&e.classList.remove(D.DISABLE),"disabled"===n&&a.classList.contains(D.INPUTGROUP)&&a.classList.remove(D.DISABLE),"placeholder"===n&&a.classList.contains(D.FLOATINPUT)?a.getElementsByClassName(D.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function k(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=u(e);"disabled"===n&&e.classList.add(D.DISABLE),"disabled"===n&&a.classList.contains(D.INPUTGROUP)&&a.classList.add(D.DISABLE),"placeholder"===n&&a.classList.contains(D.FLOATINPUT)?a.getElementsByClassName(D.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function T(t,e){if(t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]){var i=e("span",{className:D.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 P(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(var l=0;l<a.length;l++)a[parseInt(l.toString())].addEventListener("mousedown",L,!1),a[parseInt(l.toString())].addEventListener("mouseup",O,!1);else if(a.length>0)for(l=0;l<a.length;l++)a[parseInt(l.toString())].removeEventListener("mousedown",L,this),a[parseInt(l.toString())].removeEventListener("mouseup",O,this)}function L(){for(var t=this.parentElement;!t.classList.contains("e-input-group");)t=t.parentElement;!function(t,e){t.classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}(t,this)}function O(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function w(t,e){var i=e("span",{className:t});return i.classList.add("e-input-group-icon"),i}function N(t,i,s,n){var a=e.isNullOrUndefined(n)?e.createElement:n,l=w(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())],u=r.parentElement;d.classList.contains("e-float-line")&&(u&&u.classList.contains("e-filled")||!u)||r.appendChild(d)}}return r.parentNode.insertBefore(l,r),P(!0,i,l),l}function A(t,i,s){var n=w(t,e.isNullOrUndefined(s)?e.createElement:s);return(i.classList.contains("e-float-icon-left")?i.querySelector(".e-input-in-wrap"):i).appendChild(n),P(!0,i,n),n}function H(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}var B,U=!0;t.createInput=function(t,s){var n=e.isNullOrUndefined(s)?e.createElement:s,a={container:null,buttons:[],clearButton:null};if(B=t.floatLabelType,U=t.bindClearAction,e.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(a.container=m(t,D.INPUTGROUP,D.INPUTCUSTOMTAG,"span",n),t.element.parentNode.insertBefore(a.container,t.element),e.addClass([t.element],D.INPUT),a.container.appendChild(t.element)):r(t,a,n),i(t),e.isNullOrUndefined(t.properties)||e.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(x(t.properties.showClearButton,t.element,a,!0,n),a.clearButton.setAttribute("role","button"),a.container.classList.contains(D.FLOATINPUT)&&e.addClass([a.container],D.INPUTGROUP)),!e.isNullOrUndefined(t.buttons))for(var l=0;l<t.buttons.length;l++)a.buttons.push(A(t.buttons[l],a.container,n));return e.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||e.addClass([a.container],D.TEXTAREA),H(a.container,t.element),a=function(t,i){if(!e.isNullOrUndefined(t.properties))for(var s=0,n=Object.keys(t.properties);s<n.length;s++){var a=n[s];switch(a){case"cssClass":f(t.properties.cssClass,[i.container]),o(t.floatLabelType,i.container);break;case"enabled":E(t.properties.enabled,t.element,t.floatLabelType,i.container);break;case"enableRtl":C(t.properties.enableRtl,[i.container]);break;case"placeholder":y(t.properties.placeholder,t.element);break;case"readonly":b(t.properties.readonly,t.element)}}return i}(t,a),T(a.container,n),a},t.bindInitialEvent=i,t.wireFloatingEvents=l,t.wireClearBtnEvents=c,t.destroy=function(){},t.setValue=function(t,i,n,a){if(i.value=t,"Auto"===n&&""===t&&g(i,i.parentElement),e.isNullOrUndefined(n)||"Auto"!==n||p(i,n),!e.isNullOrUndefined(a)&&a){var l=u(i);if(!e.isNullOrUndefined(l)){var r=l.getElementsByClassName(D.CLEARICON)[0];e.isNullOrUndefined(r)||(i.value&&!e.isNullOrUndefined(l)&&l.classList.contains("e-input-focus")?e.removeClass([r],D.CLEARICONHIDE):e.addClass([r],D.CLEARICONHIDE))}}s(n,i)},t.setCssClass=f,t.calculateWidth=g,t.setWidth=function(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)),g(i.firstChild,i)},t.setPlaceholder=y,t.setReadonly=b,t.setEnableRtl=C,t.setEnabled=E,t.setClearButton=x,t.removeAttributes=S,t.addAttributes=k,t.removeFloating=function(t){var i=t.container;if(!e.isNullOrUndefined(i)&&i.classList.contains(D.FLOATINPUT)){var s=i.querySelector("textarea")?i.querySelector("textarea"):i.querySelector("input"),l=i.querySelector("."+D.FLOATTEXT).textContent,r=null!==i.querySelector(".e-clear-icon");e.detach(i.querySelector("."+D.FLOATLINE)),e.detach(i.querySelector("."+D.FLOATTEXT)),e.classList(i,[D.INPUTGROUP],[D.FLOATINPUT]),function(t){t.removeEventListener("focus",n),t.removeEventListener("blur",a)}(s),e.attributes(s,{placeholder:l}),s.classList.add(D.INPUT),r||"INPUT"!==s.tagName||s.removeAttribute("required")}},t.addFloating=function(t,i,s,n){var a=e.isNullOrUndefined(n)?e.createElement:n,l=e.closest(t,"."+D.INPUTGROUP);if(B=i,"Never"!==i){var h=l.tagName,d={element:t,floatLabelType:i,customTag:h="DIV"!==h&&"SPAN"!==h?h:null,properties:{placeholder:s}},u=l.querySelector(".e-clear-icon"),c={container:l};t.classList.remove(D.INPUT),r(d,c,a),T(c.container,a),g(d.element,c.container);var p=l.classList.contains("e-float-icon-left");if(e.isNullOrUndefined(u)&&(u=p?l.querySelector(".e-input-in-wrap").querySelector(".e-input-group-icon"):l.querySelector(".e-input-group-icon")),e.isNullOrUndefined(u))p&&(u=l.querySelector(".e-input-group-icon"));else{var m=l.querySelector("."+D.FLOATLINE),v=l.querySelector("."+D.FLOATTEXT),f=p?l.querySelector(".e-input-in-wrap"):l;f.insertBefore(t,u),f.insertBefore(m,u),f.insertBefore(v,u)}}o(i,t.parentElement)},t.createSpanElement=T,t.setRipple=function(t,e){for(var i=0;i<e.length;i++)P(t,e[parseInt(i.toString())].container)},t.addIcon=function(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++)A(r[l],i,n);else for(var o=0,h=a;o<h.length;o++)N(h[o],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")},t.prependSpan=N,t.appendSpan=A,t.validateInputType=H}(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)}}(),q=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},W="e-input-group-icon",j="e-spin-up",_="increment",X="decrement",K=new RegExp("^(-)?(\\d*)$"),Z="e-input-focus",Y=["title","style","class"],G=0,J=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;for(var i=this.createElement("input"),s=0;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 u=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(n));(null!==u&&!isNaN(u)||"value"===n)&&this.setProperties(e.setValue(n,u,{}),!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];Y.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(Y.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(W+" e-spin-down",this.container,this.createElement),e.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=t.Input.appendSpan(W+" "+j,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(th