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 426 kB
/*! * filename: ej2-inputs.umd.min.js * version : 29.1.38 * Copyright Syncfusion Inc. 2001 - 2024. 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"),require("@syncfusion/ej2-buttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-popups","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons"],e):e((t=t||self).ej={},t.ej2Base,t.ej2Popups,t.ej2Splitbuttons,t.ej2Buttons)}(this,function(o,E,h,R,V){"use strict";var n,F,p={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"},M=["title","style","class"],D="e-input-focus";function z(i){W(i.floatLabelType,i.element);function t(){var t,e;((e=$((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.add("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function e(){var t,e;((e=$((t=i).element)).classList.contains("e-input-group")||e.classList.contains("e-outline")||e.classList.contains("e-filled"))&&e.classList.remove("e-input-focus"),"Never"!==t.floatLabelType&&setTimeout(function(){n.calculateWidth(t.element,e)},80)}function s(){W(i.floatLabelType,i.element)}i.element.addEventListener("focus",t),i.element.addEventListener("blur",e),i.element.addEventListener("input",s),i.element.__eventHandlers.inputFocusHandler={focusHandler:t},i.element.__eventHandlers.inputBlurHandler={blurHandler:e},i.element.__eventHandlers.inputHandler={inputHandler:s}}function W(t,e){var i=e.value,e=e.parentElement,s=e&&e.parentElement;""===i||E.isNullOrUndefined(i)?"Always"!==t&&(e&&e.classList.contains("e-input-group")?e.classList.remove("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.remove("e-valid-input")):e&&e.classList.contains("e-input-group")?e.classList.add("e-valid-input"):s&&s.classList.contains("e-input-group")&&s.classList.add("e-valid-input")}function q(){var t=$(this).getElementsByClassName("e-float-text")[0];E.isNullOrUndefined(t)||(E.addClass([t],p.LABELTOP),t.classList.contains(p.LABELBOTTOM)&&E.removeClass([t],p.LABELBOTTOM))}function j(){var t=$(this);(t.getElementsByTagName("textarea")[0]?""===t.getElementsByTagName("textarea")[0].value:""===t.getElementsByTagName("input")[0].value)&&(t=t.getElementsByClassName("e-float-text")[0],E.isNullOrUndefined(t)||(t.classList.contains(p.LABELTOP)&&E.removeClass([t],p.LABELTOP),E.addClass([t],p.LABELBOTTOM)))}function _(t){t.addEventListener("focus",q),t.addEventListener("blur",j)}function X(t){E.isNullOrUndefined(t)||(t.removeEventListener("focus",q),t.removeEventListener("blur",j))}function K(t,e,i){var s,i=E.isNullOrUndefined(i)?E.createElement:i,n=("Auto"===t.floatLabelType&&_(t.element),E.isNullOrUndefined(e.container)?(e.container=et(t,p.FLOATINPUT,p.FLOATCUSTOMTAG,"div",i),e.container.classList.add(p.INPUTGROUP),t.element.parentNode&&t.element.parentNode.insertBefore(e.container,t.element)):(E.isNullOrUndefined(t.customTag)||e.container.classList.add(p.FLOATCUSTOMTAG),e.container.classList.add(p.FLOATINPUT)),i("span",{className:p.FLOATLINE})),i=i("label",{className:p.FLOATTEXT});E.isNullOrUndefined(t.element.id)||""===t.element.id||(i.id="label_"+t.element.id.replace(/ /g,"_"),E.attributes(t.element,{"aria-labelledby":i.id})),E.isNullOrUndefined(t.element.placeholder)||""===t.element.placeholder||(i.innerText=it(t.element.placeholder),t.element.removeAttribute("placeholder")),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.placeholder)||""===t.properties.placeholder||(i.innerText=it(t.properties.placeholder)),i.innerText||e.container.classList.add(p.NOFLOATLABEL),(e.container.classList.contains("e-float-icon-left")?((s=e.container.querySelector(".e-input-in-wrap")).appendChild(t.element),s.appendChild(n),s):(e.container.appendChild(t.element),e.container.appendChild(n),e.container)).appendChild(i),J(t.element.value,i),"Always"===t.floatLabelType&&(i.classList.contains(p.LABELBOTTOM)&&E.removeClass([i],p.LABELBOTTOM),E.addClass([i],p.LABELTOP)),"Auto"===t.floatLabelType?(s=function(){tt(t.element,t.floatLabelType)},t.element.addEventListener("input",n=function(){tt(t.element,t.floatLabelType)}),t.element.addEventListener("blur",s),t.element.__eventHandlers.floatInputHandler={inputFloatHandler:n},t.element.__eventHandlers.floatBlurHandler={blurFloatHandler:s}):Y(t),E.isNullOrUndefined(t.element.getAttribute("id"))||i.setAttribute("for",t.element.getAttribute("id"))}function Y(t){var e,i;E.isNullOrUndefined(t.element)||E.isNullOrUndefined(t.element.__eventHandlers)||E.isNullOrUndefined(t.element.__eventHandlers.floatInputHandler)||E.isNullOrUndefined(t.element.__eventHandlers.floatBlurHandler)||(e=t.element.__eventHandlers.floatInputHandler.inputFloatHandler,i=t.element.__eventHandlers.floatBlurHandler.blurFloatHandler,t.element.removeEventListener("input",e),t.element.removeEventListener("blur",i),delete t.element.__eventHandlers.floatInputHandler,delete t.element.__eventHandlers.floatBlurHandler)}function Z(t,e){"Always"===t&&e.classList.contains("e-outline")&&e.classList.add("e-valid-input")}function G(t,e,i){E.isNullOrUndefined(e)||(t&&!i?E.removeClass([e],p.CLEARICONHIDE):E.addClass([e],p.CLEARICONHIDE))}function J(t,e,i){void 0===i&&(i=null),t?(E.addClass([e],p.LABELTOP),e.classList.contains(p.LABELBOTTOM)&&E.removeClass([e],p.LABELBOTTOM)):null!=i&&i===document.activeElement||(e.classList.contains(p.LABELTOP)&&E.removeClass([e],p.LABELTOP),E.addClass([e],p.LABELBOTTOM))}function $(t){t=E.isNullOrUndefined(t.parentNode)?t:t.parentNode;return t=t&&t.classList.contains("e-input-in-wrap")?t.parentNode:t}function Q(s,n,t){function e(){G(s.value,n)}function i(){G(s.value,n,s.readOnly)}function a(){var t,e;t=s,e=n,setTimeout(function(){E.isNullOrUndefined(e)||(E.addClass([e],p.CLEARICONHIDE),e=!E.isNullOrUndefined(t)&&t.classList.contains("e-combobox")?null:e)},200)}var r;void 0!==F&&!F||(n.addEventListener("click",r=function(t){var e,i;t=t,i=n,(e=s).classList.contains(p.DISABLE)||e.readOnly||(t.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",E.addClass([i],p.CLEARICONHIDE))}),s.__eventHandlers.clearClickHandler={clickHandlerEvent:r});s.addEventListener("input",e),s.addEventListener("focus",i),s.addEventListener("blur",a),s.__eventHandlers.clearInputHandler={inputHandlerEvent:e},s.__eventHandlers.clearFocusHandler={focusHandlerEvent:i},s.__eventHandlers.clearBlurHandler={blurHandlerEvent:a}}function tt(t,e){$(t).classList.contains(p.FLOATINPUT)&&"Auto"===e&&(e=$(t).getElementsByClassName("e-float-text")[0],J(t.value,e,t))}function et(t,e,i,s,n){var a,n=E.isNullOrUndefined(n)?E.createElement:n;return E.isNullOrUndefined(t.customTag)?a=n(s,{className:e}):(a=n(t.customTag,{className:e})).classList.add(i),a.classList.add("e-control-wrapper"),a}function it(t){var e,i="";return E.isNullOrUndefined(t)||""===t||((e=document.createElement("span")).innerHTML='<input placeholder="'+t+'"/>',i=e.children[0].placeholder),i}function st(t,e,i){E.isNullOrUndefined(i)||""===i||E.removeClass(e,i.split(" ")),E.isNullOrUndefined(t)||""===t||E.addClass(e,t.split(" "))}function nt(t,e,i){("multiselect"===i||function(t){if(!t)return;var e=t;for(;e&&e!==document.body;){if("none"===window.getComputedStyle(e).display)return;e=e.parentElement}return 1}(t))&&(i="multiselect"===i?t:t.clientWidth-parseInt(getComputedStyle(t,null).getPropertyValue("padding-left"),10),!E.isNullOrUndefined(e))&&!E.isNullOrUndefined(e.getElementsByClassName("e-float-text-content")[0])&&(e.getElementsByClassName("e-float-text-content")[0].classList.contains("e-float-text-overflow")&&e.getElementsByClassName("e-float-text-content")[0].classList.remove("e-float-text-overflow"),i<e.getElementsByClassName("e-float-text-content")[0].clientWidth||i===e.getElementsByClassName("e-float-text-content")[0].clientWidth)&&e.getElementsByClassName("e-float-text-content")[0].classList.add("e-float-text-overflow")}function at(t,e){t=it(t);var i,s=$(e);s.classList.contains(p.FLOATINPUT)?E.isNullOrUndefined(t)||""===t?(s.classList.add(p.NOFLOATLABEL),(i=s.getElementsByClassName("e-float-text-content")[0])?i.children[0].textContent="":s.getElementsByClassName(p.FLOATTEXT)[0].textContent=""):((i=s.getElementsByClassName("e-float-text-content")[0])&&i.children[0]?i.children[0].textContent=t:s.getElementsByClassName(p.FLOATTEXT)[0].textContent=t,s.classList.remove(p.NOFLOATLABEL),e.removeAttribute("placeholder")):E.isNullOrUndefined(t)||""===t?e.removeAttribute("placeholder"):E.attributes(e,{placeholder:t})}function rt(t,e,i){t?E.attributes(e,{readonly:""}):e.removeAttribute("readonly"),E.isNullOrUndefined(i)||tt(e,i)}function lt(t,e){t?E.addClass(e,p.RTL):E.removeClass(e,p.RTL)}function ot(t,e,i,s){var n={disabled:"","aria-disabled":"true"},a=!E.isNullOrUndefined(s);t?(e.classList.remove(p.DISABLE),pt(n,e),a&&E.removeClass([s],p.DISABLE)):(e.classList.add(p.DISABLE),ut(n,e),a&&E.addClass([s],p.DISABLE)),E.isNullOrUndefined(i)||tt(e,i)}function ht(t,e,i,s,n){var a,n=E.isNullOrUndefined(n)?E.createElement:n;t?i.clearButton=(t=e,e=i,s=s,n=n,n=(E.isNullOrUndefined(n)?E.createElement:n)("span",{className:p.CLEARICON}),a=e.container,E.isNullOrUndefined(s)?(e.container.classList.contains(p.FLOATINPUT)?e.container.querySelector("."+p.FLOATTEXT):t).insertAdjacentElement("afterend",n):a.appendChild(n),E.addClass([n],p.CLEARICONHIDE),Q(t,n),n.setAttribute("aria-label","close"),n):(E.remove(i.clearButton),i.clearButton=null)}function pt(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=$(e);"disabled"===n&&e.classList.remove(p.DISABLE),"disabled"===n&&a.classList.contains(p.INPUTGROUP)&&a.classList.remove(p.DISABLE),"placeholder"===n&&a.classList.contains(p.FLOATINPUT)?a.getElementsByClassName(p.FLOATTEXT)[0].textContent="":e.removeAttribute(n)}}function ut(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i],a=$(e);"disabled"===n&&e.classList.add(p.DISABLE),"disabled"===n&&a.classList.contains(p.INPUTGROUP)&&a.classList.add(p.DISABLE),"placeholder"===n&&a.classList.contains(p.FLOATINPUT)?a.getElementsByClassName(p.FLOATTEXT)[0].textContent=t[""+n]:e.setAttribute(n,t[""+n])}}function dt(t,e){t.classList.contains("e-outline")&&t.getElementsByClassName("e-float-text")[0]&&((e=e("span",{className:p.FLOATTEXTCONTENT})).innerHTML=t.getElementsByClassName("e-float-text")[0].innerHTML,t.getElementsByClassName("e-float-text")[0].innerHTML="",t.getElementsByClassName("e-float-text")[0].appendChild(e))}function ct(t,e,i){var s=[],n=(s.push(i),E.isNullOrUndefined(i)?e.querySelectorAll(".e-input-group-icon"):s);if(t&&0<n.length)for(var a=0;a<n.length;a++)n[parseInt(a.toString(),10)].addEventListener("mousedown",mt,!1),n[parseInt(a.toString(),10)].addEventListener("mouseup",vt,!1);else if(0<n.length)for(a=0;a<n.length;a++)n[parseInt(a.toString(),10)].removeEventListener("mousedown",mt,this),n[parseInt(a.toString(),10)].removeEventListener("mouseup",vt,this)}function mt(){for(var t,e,i=this.parentElement;!i.classList.contains("e-input-group");)i=i.parentElement;e=this,(t=i).classList.contains("e-disabled")||t.querySelector("input").readOnly||e.classList.add("e-input-btn-ripple")}function vt(){var t=this;setTimeout(function(){t.classList.remove("e-input-btn-ripple")},500)}function ft(t,e){e=e("span",{className:t});return e.classList.add("e-input-group-icon"),e}function gt(t,e,i,s){var s=E.isNullOrUndefined(s)?E.createElement:s,t=ft(t,s),n=(e.classList.add("e-float-icon-left"),e.querySelector(".e-input-in-wrap"));if(E.isNullOrUndefined(n)){n=s("span",{className:"e-input-in-wrap"}),i.parentNode.insertBefore(n,i);var a=e.querySelectorAll(i.tagName+" ~ *");n.appendChild(i);for(var r=0;r<a.length;r++){var l=a[parseInt(r.toString(),10)],o=n.parentElement;l.classList.contains("e-float-line")&&(o&&o.classList.contains("e-filled")||!o)||n.appendChild(l)}}return n.parentNode.insertBefore(t,n),ct(!0,e,t),t}function yt(t,e,i){t=ft(t,E.isNullOrUndefined(i)?E.createElement:i);return(e.classList.contains("e-float-icon-left")?e.querySelector(".e-input-in-wrap"):e).appendChild(t),ct(!0,e,t),t}function bt(t,e){"hidden"===e.type?t.classList.add("e-hidden"):t.classList.contains("e-hidden")&&t.classList.remove("e-hidden")}function Ct(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()}n=o.Input||(o.Input={}),F=!0,n.createInput=function(t,e){t.element.__eventHandlers={};var i=E.isNullOrUndefined(e)?E.createElement:e,s={container:null,buttons:[],clearButton:null};if(t.floatLabelType,F=t.bindClearAction,E.isNullOrUndefined(t.floatLabelType)||"Never"===t.floatLabelType?(s.container=et(t,p.INPUTGROUP,p.INPUTCUSTOMTAG,"span",i),t.element.parentNode.insertBefore(s.container,t.element),E.addClass([t.element],p.INPUT),s.container.appendChild(t.element)):K(t,s,i),z(t),E.isNullOrUndefined(t.properties)||E.isNullOrUndefined(t.properties.showClearButton)||!t.properties.showClearButton||(ht(t.properties.showClearButton,t.element,s,!0,i),s.clearButton.setAttribute("role","button"),s.container.classList.contains(p.FLOATINPUT)&&E.addClass([s.container],p.INPUTGROUP)),!E.isNullOrUndefined(t.buttons))for(var n=0;n<t.buttons.length;n++)s.buttons.push(yt(t.buttons[n],s.container,i));return E.isNullOrUndefined(t.element)||"TEXTAREA"!==t.element.tagName||E.addClass([s.container],p.TEXTAREA),bt(s.container,t.element),dt((s=function(t,e){if(!E.isNullOrUndefined(t.properties))for(var i=0,s=Object.keys(t.properties);i<s.length;i++)switch(s[i]){case"cssClass":st(t.properties.cssClass,[e.container]),Z(t.floatLabelType,e.container);break;case"enabled":ot(t.properties.enabled,t.element,t.floatLabelType,e.container);break;case"enableRtl":lt(t.properties.enableRtl,[e.container]);break;case"placeholder":at(t.properties.placeholder,t.element);break;case"readonly":rt(t.properties.readonly,t.element)}return e}(t,s)).container,i),s},n.bindInitialEvent=z,n.wireFloatingEvents=_,n.wireClearBtnEvents=Q,n.destroy=function(t,e){var i,s,n,a,r;void 0===e&&(e=null),i=t,E.isNullOrUndefined(i.element)||E.isNullOrUndefined(i.element.__eventHandlers)||E.isNullOrUndefined(i.element.__eventHandlers.inputFocusHandler)||E.isNullOrUndefined(i.element.__eventHandlers.inputBlurHandler)||E.isNullOrUndefined(i.element.__eventHandlers.inputHandler)||(s=i.element.__eventHandlers.inputFocusHandler.focusHandler,n=i.element.__eventHandlers.inputBlurHandler.blurHandler,r=i.element.__eventHandlers.inputHandler.inputHandler,i.element.removeEventListener("focus",s),i.element.removeEventListener("blur",n),i.element.removeEventListener("input",r),delete i.element.__eventHandlers.inputFocusHandler,delete i.element.__eventHandlers.inputBlurHandler,delete i.element.__eventHandlers.inputHandler),"Auto"===t.floatLabelType&&Y(t),t.properties.showClearButton&&(s=t.element,n=e,E.isNullOrUndefined(s)||E.isNullOrUndefined(s.__eventHandlers)||(E.isNullOrUndefined(s.__eventHandlers.clearClickHandler)||(a=s.__eventHandlers.clearClickHandler.clickHandlerEvent,void 0!==F&&!F||E.isNullOrUndefined(n)||n.removeEventListener("click",a),delete s.__eventHandlers.clearClickHandler),E.isNullOrUndefined(s.__eventHandlers.clearInputHandler))||E.isNullOrUndefined(s.__eventHandlers.clearFocusHandler)||E.isNullOrUndefined(s.__eventHandlers.clearBlurHandler)||(n=s.__eventHandlers.clearInputHandler.inputHandlerEvent,a=s.__eventHandlers.clearFocusHandler.focusHandlerEvent,r=s.__eventHandlers.clearBlurHandler.blurHandlerEvent,s.removeEventListener("input",n),s.removeEventListener("focus",a),s.removeEventListener("blur",r),delete s.__eventHandlers.clearInputHandler,delete s.__eventHandlers.clearFocusHandler,delete s.__eventHandlers.clearBlurHandler)),E.isNullOrUndefined(t.buttons)||ct(!1,null,t.buttons),X(t.element),E.isNullOrUndefined(t.element)||(delete t.element.__eventHandlers,t.element.classList.contains(p.INPUT)&&t.element.classList.remove(p.INPUT))},n.setValue=function(t,e,i,s){e.value=t,"Never"!==i&&nt(e,e.parentElement),E.isNullOrUndefined(i)||"Auto"!==i||tt(e,i),!E.isNullOrUndefined(s)&&s&&(t=$(e),E.isNullOrUndefined(t)||(s=t.getElementsByClassName(p.CLEARICON)[0],E.isNullOrUndefined(s))||(e.value&&!E.isNullOrUndefined(t)&&t.classList.contains("e-input-focus")?E.removeClass([s],p.CLEARICONHIDE):E.addClass([s],p.CLEARICONHIDE))),W(i,e)},n.setCssClass=st,n.calculateWidth=nt,n.setWidth=function(t,e){"number"==typeof t?e.style.width=E.formatUnit(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:E.formatUnit(t)),nt(e.firstChild,e)},n.setPlaceholder=at,n.setReadonly=rt,n.setEnableRtl=lt,n.setEnabled=ot,n.setClearButton=ht,n.removeAttributes=pt,n.addAttributes=ut,n.removeFloating=function(t){var e,i,s,t=t.container;!E.isNullOrUndefined(t)&&t.classList.contains(p.FLOATINPUT)&&(e=t.querySelector("textarea")?t.querySelector("textarea"):t.querySelector("input"),i=t.querySelector("."+p.FLOATTEXT).textContent,s=null!==t.querySelector(".e-clear-icon"),E.detach(t.querySelector("."+p.FLOATLINE)),E.detach(t.querySelector("."+p.FLOATTEXT)),E.classList(t,[p.INPUTGROUP],[p.FLOATINPUT]),X(e),E.attributes(e,{placeholder:i}),e.classList.add(p.INPUT),s||"INPUT"!==e.tagName||e.removeAttribute("required"))},n.addFloating=function(t,e,i,s){var n,a,s=E.isNullOrUndefined(s)?E.createElement:s,r=E.closest(t,"."+p.INPUTGROUP),l=r.tagName,l={element:t,floatLabelType:e,customTag:"DIV"!==l&&"SPAN"!==l?l:null,properties:{placeholder:i}};"Never"!==e?(i=r.querySelector(".e-clear-icon"),n={container:r},t.classList.remove(p.INPUT),K(l,n,s),dt(n.container,s),nt(l.element,n.container),s=r.classList.contains("e-float-icon-left"),E.isNullOrUndefined(i)&&(i=(s?r.querySelector(".e-input-in-wrap"):r).querySelector(".e-input-group-icon")),E.isNullOrUndefined(i)?s&&(i=r.querySelector(".e-input-group-icon")):(n=r.querySelector("."+p.FLOATLINE),a=r.querySelector("."+p.FLOATTEXT),(s=s?r.querySelector(".e-input-in-wrap"):r).insertBefore(t,i),s.insertBefore(n,i),s.insertBefore(a,i))):Y(l),Z(e,t.parentElement)},n.createSpanElement=dt,n.setRipple=function(t,e){for(var i=0;i<e.length;i++)ct(t,e[parseInt(i.toString(),10)].container)},n.addIcon=function(t,e,i,s,n){if(e="string"==typeof e?e.split(","):e,"append"===t.toLowerCase())for(var a=0,r=e;a<r.length;a++)yt(r[a],i,n);else for(var l=0,o=e;l<o.length;l++)gt(o[l],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")},n.prependSpan=gt,n.appendSpan=yt,n.validateInputType=bt,n.updateHTMLAttributesToElement=function(t,e){if(!E.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];M.indexOf(n)<0&&e.setAttribute(n,t[""+n])}},n.updateCssClass=function(t,e,i){st(Ct(t),[i],Ct(e))},n.getInputValidClassList=Ct,n.updateHTMLAttributesToWrapper=function(t,e){if(!E.isNullOrUndefined(t))for(var i=0,s=Object.keys(t);i<s.length;i++){var n,a=s[i];-1<M.indexOf(a)&&("class"===a?""!==(n=this.getInputValidClassList(t[""+a]))&&E.addClass([e],n.split(" ")):"style"===a?(n=e.getAttribute(a),n=E.isNullOrUndefined(n)?t[""+a]:n+t[""+a],e.setAttribute(a,n)):e.setAttribute(a,t[""+a]))}},n.isBlank=function(t){return!t||/^\s*$/.test(t)};Et=function(t,e){return(Et=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])}))(t,e)};var Et,St,xt=function(t,e){function i(){this.constructor=t}Et(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},t=function(t,e,i,s){var n,a=arguments.length,r=a<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var l=t.length-1;0<=l;l--)(n=t[l])&&(r=(a<3?n(r):3<a?n(e,i,r):n(e,i))||r);return 3<a&&r&&Object.defineProperty(e,i,r),r},Pt="e-input-group-icon",Tt="e-spin-up",kt="e-error",Ot="increment",wt="decrement",Lt=new RegExp("^(-)?(\\d*)$"),At="e-input-focus",Nt=["title","style","class"],Ht=0,Bt=(St=E.Component,xt(e,St),e.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 e=this.createElement("input"),i=0;i<this.element.attributes.length;i++){var s=this.element.attributes[i].nodeName;"id"!==s&&"class"!==s?(e.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),e.innerHTML=this.element.innerHTML):"class"===s&&e.setAttribute(s,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(e),this.element=e,E.setValue("ej2_instances",t,this.element)}E.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off"});t={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:this.placeholder};this.l10n=new E.L10n("numerictextbox",t,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()},e.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"),this.element.hasAttribute("aria-labelledby")||this.element.hasAttribute("placeholder")||this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label","numerictextbox"),!E.isNullOrUndefined(E.closest(this.element,"fieldset"))&&E.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.renderComplete())},e.prototype.checkAttributes=function(t){for(var e=0,i=t?E.isNullOrUndefined(this.htmlAttributes)?[]:Object.keys(this.htmlAttributes):["value","min","max","step","disabled","readonly","style","name","placeholder"];e<i.length;e++){var s,n,a,r=i[e];if(!E.isNullOrUndefined(this.element.getAttribute(r)))switch(r){case"disabled":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.enabled||t)&&(s="disabled"!==this.element.getAttribute(r)&&""!==this.element.getAttribute(r)&&"true"!==this.element.getAttribute(r),this.setProperties({enabled:s},!t));break;case"readonly":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.readonly||t)&&(s="readonly"===this.element.getAttribute(r)||""===this.element.getAttribute(r)||"true"===this.element.getAttribute(r),this.setProperties({readonly:s},!t));break;case"placeholder":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.placeholder||t)&&this.setProperties({placeholder:this.element.placeholder},!t);break;case"value":(E.isNullOrUndefined(this.numericOptions)||void 0===this.numericOptions.value||t)&&(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r)),this.setProperties(E.setValue(r,n,{}),!t));break;case"min":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.min&&!t||null===(n=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r)))||isNaN(n)||this.setProperties(E.setValue(r,n,{}),!t);break;case"max":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.max&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r)))||isNaN(a)||this.setProperties(E.setValue(r,a,{}),!t);break;case"step":!E.isNullOrUndefined(this.numericOptions)&&void 0!==this.numericOptions.step&&!t||null===(a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r)))||isNaN(a)||this.setProperties(E.setValue(r,a,{}),!t);break;case"style":this.inputStyle=this.element.getAttribute(r);break;case"name":this.inputName=this.element.getAttribute(r);break;default:var l=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(r));(null===l||isNaN(l))&&"value"!==r||this.setProperties(E.setValue(r,l,{}),!0)}}},e.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},e.prototype.initCultureFunc=function(){this.instance=new E.Internationalization(this.locale)},e.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))},e.prototype.createWrapper=function(){var t=this.cssClass,t=(E.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.getNumericValidClassList(this.cssClass)),o.Input.createInput({element:this.element,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:t,enableRtl:this.enableRtl,showClearButton:this.showClearButton,enabled:this.enabled}},this.createElement));this.inputWrapper=t,this.container=t.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","aria-label":"hidden",class:"e-numeric-hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),this.isAngular&&"EJS-NUMERICTEXTBOX"===this.angularTagName&&0<this.cloneElement.id.length?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})},e.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])}},e.prototype.updateHTMLAttrToElement=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];Nt.indexOf(i)<0&&this.element.setAttribute(i,this.htmlAttributes[""+i])}},e.prototype.updateCssClass=function(t,e){o.Input.setCssClass(this.getNumericValidClassList(t),[this.container],this.getNumericValidClassList(e))},e.prototype.getNumericValidClassList=function(t){var e=t;return e=E.isNullOrUndefined(t)||""===t?e:t.replace(/\s+/g," ").trim()},e.prototype.updateHTMLAttrToWrapper=function(){if(!E.isNullOrUndefined(this.htmlAttributes))for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];-1<Nt.indexOf(s)&&("class"===s?""!==(i=this.getNumericValidClassList(this.htmlAttributes[""+s]))&&E.addClass([this.container],i.split(" ")):"style"===s?(i=this.container.getAttribute(s),i=E.isNullOrUndefined(i)?this.htmlAttributes[""+s]:i+this.htmlAttributes[""+s],this.container.setAttribute(s,i)):this.container.setAttribute(s,this.htmlAttributes[""+s]))}},e.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)))},e.prototype.spinBtnCreation=function(){this.spinDown=o.Input.appendSpan(Pt+" e-spin-down",this.container,this.createElement),E.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle")}),this.spinUp=o.Input.appendSpan(Pt+" "+Tt,this.container,this.createElement),E.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},e.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()})},e.prototype.formattedValue=function(t,e){return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(e)},e.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},e.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)},e.prototype.checkErrorClass=function(){this.isValidState?E.removeClass([this.container],kt):E.addClass([this.container],kt),E.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},e.prototype.bindClearEvent=function(){this.showClearButton&&E.EventHandler.add(this.inputWrapper.clearButton,"mousedown touchstart",this.resetHandler,this)},e.prototype.resetHandler=function(t){t.preventDefault(),this.inputWrapper.clearButton.classList.contains("e-clear-icon-hide")&&!this.inputWrapper.container.classList.contains("e-static-clear")||this.clear(t),this.isInteract=!0,this.raiseChangeEvent(t)},e.prototype.clear=function(t){var e,i;this.setProperties({value:null},!0),this.setElementValue(""),this.hiddenInput.value="",E.closest(this.element,"form")&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.resetFormHandler=function(){"EJS-NUMERICTEXTBOX"===this.element.tagName?this.updateValue(null):this.updateValue(this.inputEleValue)},e.prototype.setSpinButton=function(){E.isNullOrUndefined(this.spinDown)||E.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),E.isNullOrUndefined(this.spinUp)||E.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")})},e.prototype.wireEvents=function(){E.EventHandler.add(this.element,"focus",this.focusHandler,this),E.EventHandler.add(this.element,"blur",this.focusOutHandler,this),E.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),E.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),E.EventHandler.add(this.element,"input",this.inputHandler,this),E.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),E.EventHandler.add(this.element,"change",this.changeHandler,this),E.EventHandler.add(this.element,"paste",this.pasteHandler,this),this.enabled&&(this.bindClearEvent(),this.formEle)&&E.EventHandler.add(this.formEle,"reset",this.resetFormHandler,this)},e.prototype.wireSpinBtnEvents=function(){E.EventHandler.add(this.spinUp,E.Browser.touchStartEvent,this.mouseDownOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchStartEvent,this.mouseDownOnSpinner,this),E.EventHandler.add(this.spinUp,E.Browser.touchEndEvent,this.mouseUpOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchEndEvent,this.mouseUpOnSpinner,this),E.EventHandler.add(this.spinUp,E.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),E.EventHandler.add(this.spinDown,E.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},e.prototype.unwireEvents=function(){E.EventHandler.remove(this.element,"focus",this.focusHandler),E.EventHandler.remove(this.element,"blur",this.focusOutHandler),E.EventHandler.remove(this.element,"keyup",this.keyUpHandler),E.EventHandler.remove(this.element,"input",this.inputHandler),E.EventHandler.remove(this.element,"keydown",this.keyDownHandler),E.EventHandler.remove(this.element,"keypress",this.keyPressHandler),E.EventHandler.remove(this.element,"change",this.changeHandler),E.EventHandler.remove(this.element,"paste",this.pasteHandler),this.formEle&&E.EventHandler.remove(this.formEle,"reset",this.resetFormHandler)},e.prototype.unwireSpinBtnEvents=function(){E.EventHandler.remove(this.spinUp,E.Browser.touchStartEvent,this.mouseDownOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchStartEvent,this.mouseDownOnSpinner),E.EventHandler.remove(this.spinUp,E.Browser.touchEndEvent,this.mouseUpOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchEndEvent,this.mouseUpOnSpinner),E.EventHandler.remove(this.spinUp,E.Browser.touchMoveEvent,this.touchMoveOnSpinner),E.EventHandler.remove(this.spinDown,E.Browser.touchMoveEvent,this.touchMoveOnSpinner)},e.prototype.changeHandler=function(t){t.stopPropagation(),this.element.value.length||this.setProperties({value:null},!0);var e=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(e,t)},e.prototype.raiseChangeEvent=function(t){var e;this.inputValue=E.isNullOrUndefined(this.inputValue)||isNaN(this.inputValue)?null:this.inputValue,this.prevValue===this.value&&this.prevValue===this.inputValue||(e={},this.changeEventArgs={value:this.value,previousValue:this.prevValue,isInteracted:this.isInteract,isInteraction:this.isInteract,event:t},t&&(this.changeEventArgs.event=t),void 0===this.changeEventArgs.event&&(this.changeEventArgs.isInteracted=!1,this.changeEventArgs.isInteraction=!1),E.merge(e,this.changeEventArgs),this.prevValue=this.value,this.isInteract=!1,this.elementPrevValue=this.element.value,this.preventChange=!1,this.trigger("change",e))},e.prototype.pasteHandler=function(){var t,e=this;this.enabled&&!this.readonly&&(t=this.element.value,setTimeout(function(){e.numericRegex().test(e.element.value)||e.setElementValue(t)}))},e.prototype.preventHandler=function(){var a=this,r=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);setTimeout(function(){var t,e,i,s,n;0<a.element.selectionStart&&(t=a.element.selectionStart,e=a.element.selectionStart-1,i=a.element.value.split(""),s=E.getNumericObject(a.locale),n=(s=E.getValue("decimal",s)).charCodeAt(0)," "===a.element.value[e]&&0<a.element.selectionStart&&!r?(E.isNullOrUndefined(a.prevVal)?a.element.value=a.element.value.trim():0!=e?a.element.value=a.prevVal:0==e&&(a.element.value=a.element.value.trim()),a.element.setSelectionRange(e,e)):isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&45!==a.element.value[a.element.selectionStart-1].charCodeAt(0)?(i.indexOf(a.element.value[a.element.selectionStart-1])!==i.lastIndexOf(a.element.value[a.element.selectionStart-1])&&a.element.value[a.element.selectionStart-1].charCodeAt(0)===n||a.element.value[a.element.selectionStart-1].charCodeAt(0)!==n)&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length),a.element.setSelectionRange(e,e),isNaN(parseFloat(a.element.value[a.element.selectionStart-1])))&&0<a.element.selectionStart&&a.element.value.length&&a.preventHandler():isNaN(parseFloat(a.element.value[a.element.selectionStart-2]))&&1<a.element.selectionStart&&45!==a.element.value[a.element.selectionStart-2].charCodeAt(0)&&(i.indexOf(a.element.value[a.element.selectionStart-2])!==i.lastIndexOf(a.element.value[a.element.selectionStart-2])&&a.element.value[a.element.selectionStart-2].charCodeAt(0)===n||a.element.value[a.element.selectionStart-2].charCodeAt(0)!==n)&&(a.element.setSelectionRange(e,e),a.nextEle=a.element.value[a.element.selectionStart],a.cursorPosChanged=!0,a.preventHandler()),!0===a.cursorPosChanged&&a.element.value[a.element.selectionStart]===a.nextEle&&isNaN(parseFloat(a.element.value[a.element.selectionStart-1]))&&(a.element.setSelectionRange(a.element.selectionStart+1,a.element.selectionStart+1),a.cursorPosChanged=!1,a.nextEle=null),""===a.element.value.trim()&&a.element.setSelectionRange(0,0),0<a.element.selectionStart&&(45===a.element.value[a.element.selectionStart-1].charCodeAt(0)&&1<a.element.selectionStart&&(E.isNullOrUndefined(a.prevVal)||(a.element.value=a.prevVal),a.element.setSelectionRange(a.element.selectionStart,a.element.selectionStart)),a.element.value[a.element.selectionStart-1]===s)&&0===a.decimals&&a.validateDecimalOnType&&(a.element.value=a.element.value.substring(0,e)+a.element.value.substring(t,a.element.value.length)),a.prevVal=a.element.value)})},e.prototype.keyUpHandler=function(){var t,e;this.enabled&&!this.readonly&&(!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)||!E.Browser.isDevice||this.preventHandler(),t=null===(t=this.instance.getNumberParser({format:"n"})(this.element.value))||isNaN(t)?null:t,this.hiddenInput.value=t||0===t?t.toString():null,E.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(e=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),t.dispatchEvent(e))},e.prototype.inputHandler=function(t){var e,i;this.enabled&&!this.readonly&&(e=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),(-1<navigator.userAgent.toLowerCase().indexOf("firefox")||e)&&E.Browser.isDevice&&this.preventHandler(),this.isAngular&&this.element.value!==E.getValue("decimal",E.getNumericObject(this.locale))&&this.element.value!==E.getValue("minusSign",E.getNumericObject(this.locale))&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),e=isNaN(e)?null:e,this.localChange({value:e}),this.preventChange=!0),this.isVue)&&(e=this.instance.getNumberParser({format:"n"})(this.element.value),i=this.instance.getNumberParser({format:"n"})(this.elementPrevValue),t={event:t,value:null===(e=!new RegExp("[^0-9]+$").test(this.element.value)&&(-1===this.elementPrevValue.indexOf(".")&&-1===this.elementPrevValue.indexOf("-")||"0"!==this.element.value[this.element.value.length-1])?e:this.value)||isNaN(e)?null:e,previousValue:null===i||isNaN(i)?null:i},this.preventChange=!0,this.elementPrevValue=this.element.value,this.trigger("input",t))},e.prototype.keyDownHandler=function(t){if(!this.readonly)switch(t.keyCode){case 38:t.preventDefault(),this.action(Ot,t);break;case 40:t.preventDefault(),this.action(wt,t)}},e.prototype.performAction=function(t,e,i){null!==t&&!isNaN(t)||(t=0);i=this.correctRounding(t,e,i===Ot?t+e:t-e);return this.strictMode?this.trimValue(i):i},e.prototype.correctRounding=function(t,e,i){var s=new RegExp("[,.](.*)"),n=s.test(t.toString()),a=s.test(e.toString());return n||a?(n=n?s.exec(t.toString())[0].length:0,t=a?s.exec(e.toString())[0].length:0,a=Math.max(n,t),this.roundValue(i,a)):i},e.prototype.roundValue=function(t,e){e=e||0;e=Math.pow(10,e);return t*=e,Math.round(t)/e},e.prototype.updateValue=function(t,e){e&&(this.isInteract=!0),null===t||isNaN(t)||this.decimals&&(t=this.roundNumber(t,this.decimals)),this.inputValue=t,this.changeValue(null===t||isNaN(t)?null:this.strictMode?this.trimValue(t):t),this.isDynamicChange||this.raiseChangeEvent(e)},e.prototype.updateCurrency=function(t,e){E.setValue(t,e,this.cultureInfo),this.updateValue(this.value)},e.prototype.changeValue=function(t){var e;t||0===t?(e=this.getNumberOfDecimals(t),this.setProperties({value:this.roundNumber(t,e)},!0)):this.setProperties({value:t=null},!0),this.modifyText(),this.strictMode||this.validateState()},e.prototype.modifyText=function(){var t,e;this.value||0===this.value?(t=this.formatNumber(),e=this.isFocused?t:this.instance.getNumberFormat(this.cultureInfo)(this.value),this.setElementValue(e),E.attributes(this.element,{"aria-valuenow":t}),E.isNullOrUndefined(this.hiddenInput)||(this.hiddenInput.value=this.value.toString(),null!==this.value&&this.serverDecimalSeparator&&(this.hiddenInput.value=this.hiddenInput.value.replace(".",this.serverDecimalSeparator)))):(this.setElementValue(""),this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null)},e.prototype.setElementValue=function(t,e){o.Input.setValue(t,e||this.element,this.floatLabelType,this.showClearButton)},e.prototype.validateState=function(){this.isValidState=!0,!this.value&&0!==this.value||(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},e.prototype.getNumberOfDecimals=function(t){var e=new RegExp("[eE][-+]?([0-9]+)"),i=t.toString(),t=(e.test(i)&&(e=e.exec(i),E.isNullOrUndefined(e)||(i=t.toFixed(Math.min(parseInt(e[1],10),20)))),i.split(".")[1]),e=t&&t.length?t.length:0;return e=null!==this.decimals?e<this.decimals?e:this.decimals:e},e.prototype.formatNumber=function(){var t=this.getNumberOfDecimals(this.value);return this.instance.getNumberFormat({maximumFractionDigits:t,minimumFractionDigits:t,useGrouping:!1})(this.value)},e.prototype.trimValue=function(t){return t>this.max?this.max:t<this.min?this.min:t},e.prototype.roundNumber=function(t,e){var e=e||0,i=t.toString().split("e"),i=(t=Math.round(Number(i[0]+"e"+(i[1]?Number(i[1])+e:e)))).toString().split("e");return t=Number(i[0]+"e"+(i[1]?Number(i[1])-e:-e)),Number(t.toFixed(e))},e.prototype.cancelEvent=function(t){return t.preventDefault(),!1},e.prototype.keyPressHandler=function(t){if(!this.enabled||this.readonly)return!0;if(!E.Browser.isDevice&&"11.0"===E.Browser.info.version&&13===t.keyCode)return e=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(e,t),!0;if(0===t.which||t.metaKey||t.ctrlKey||8===t.keyCode||13===t.keyCode)return!0;var e=String.fromCharCode(t.which),i=E.getValue("decimal",E.getNumericObject(this.locale)),s="NumpadDecimal"===t.code&&e!==i;s&&(e=i);i=(i=this.element.value).substring(0,this.element.selectionStart)+e+i.substring(this.element.selectionEnd);return this.numericRegex().test(i)?(s&&(e=this.element.selectionStart+1,this.element.value=i,this.element.setSelectionRange(e,e),t.preventDefault(),t.stopPropagation()),!0):(t.preventDefault(),t.stopPropagation(),!1)},e.prototype.numericRegex=function(){var t=E.getNumericObject(this.locale),t=E.getValue("decimal",t),e="*";return"."===t&&(t="\\"+t),0===this.decimals&&this.validateDecimalOnType?Lt:(this.decimals&&this.validateDecimalOnType&&(e="{0,"+this.decimals+"}"),new RegExp("^\\s*(-)?(((\\d+("+t+"\\d"+e+")?)|("+t+"\\d"+e+")))?$"))},e.prototype.mouseWheel=function(t){var e;t.preventDefault(),t.wheelDelta?e=t.wheelDelta/120:t.detail&&(e=-t.detail/3),0<e?this.action(Ot,t):e<0&&this.action(wt,t),this.cancelEvent(t)},e.prototype.focusHandler=function(t){var e,i=this;clearTimeout(Ht),this.focusEventArgs={event:t,value:this.value,container:this.container},this.trigger("focus",this.focusEventArgs),!this.enabled||this.readonly||(this.isFocused=!0,this.prevValue=this.value,!this.value&&0!==this.value||(e=this.formatNumber(),this.setElementValue(e),this.isPrevFocused)||(E.Browser.isDevice||"11.0"!==E.Browser.info.version?(t=E.Browser.isDevice&&E.Browser.isIos?600:0,Ht=setTimeout(function(){i.element.setSelectionRange(0,e.length)},t)):this.element.setSelectionRange(0,e.length)),E.Browser.isDevice)||E.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)},e.prototype.focusOutHandler=function(t){var e,i,s,n=this;this.blurEventArgs={event:t,value:this.value,container:this.container},this.trigger("blur",this.blurEventArgs),this.enabled&&!this.readonly&&(this.isPrevFocused?(t.preventDefault(),E.Browser.isDevice&&(e=this.element.value,this.element.focus(),this.isPrevFocused=!1,i=this.element,setTimeout(function(){n.setElementValue(e,i)},200))):(this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0),t=this.instance.getNumberParser({format:"n"})(this.element.value),this.updateValue(t),E.Browser.isDevice||E.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)),E.closest(this.element,"form"))&&(t=this.element.nextElementSibling,(s=document.createEvent("FocusEvent")).initEvent("focusout",!1,!0),t.dispatchEvent(s))},e.prototype.mouseDownOnSpinner=function(t){var e,i,s=this;this.isFocused&&(this.isPrevFocused=!0,t.preventDefault()),this.getElementData(t)&&(this.getElementData(t),e=t.currentTarget,i=e.classList.contains(Tt)?Ot:wt,E.EventHandler.add(e,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){s.isCalled=!0,s.action(i,t)},150),E.EventHandler.add(document,"mouseup",this.mouseUpClick,this))},e.prototype.touchMoveOnSpinner=function(t){var e;("touchmove"===t.type?(e=t.touches).length&&document.elementFromPoint(e[0].pageX,e[0].pageY):document.elementFromPoint(t.clientX,t.clientY)).classList.contains(Pt)||clearInterval(this.timeOut)},e.prototype.mouseUpOnSpinner=function(t){var e,i;this.prevValue=this.value,this.isPrevFocused&&(this.element.focus(),E.Browser.isDevice||(this.isPrevFocused=!1)),E.Browser.isDevice||t.preventDefault(),this.getElementData(t)&&(i=(e=t.currentTarget).classList.contains(Tt)?Ot:wt,E.EventHandler.remove(e,"mouseleave",this.mouseUpClick),this.isCalled||this.action(i,t),this.isCalled=!1,E.EventHandler.remove(document,"mouseup",this.mouseUpClick),E.closest(this.element,"form"))&&(e=this.element.nextElementSibling,(i=document.createEvent("KeyboardEvent")).initEvent("keyup",!1,!0),e.dispatchEvent(i))},e.prototype.getElementData=function(t){return!(t.which&&3===t.which||t.button&&2===t.button||!this.enabled||this.readonly||(clearInterval(this.timeOut),0))},e.prototype.floatLabelTypeUpdate=function(){o.Input.removeFloating(this.inputWrapper);var t=this.hiddenInput;this.hiddenInput.remove(),o.Input.addFloating(this.element,this.floatLabelType,this.placeholder,this.createElement),this.container.insertBefore(t,this.container.childNodes[1])},e.prototype.mouseUpClick=function(t){t.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,this.spinUp&&E.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),this.spinDown&&E.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},e.prototype.increment=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,Ot)),this.raiseChangeEvent()},e.prototype.decrement=function(t){void 0===t&&(t=this.step),this.isInteract=!1,this.changeValue(this.performAction(this.value,t,wt)),this.raiseChangeEvent()},e.prototype.destroy=function(){this.unwireEvents(),this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),E.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),E.detach(this.spinUp),E.detach(this.spinDown));for(var t=["aria-labelledby","role","autocomplete","aria-readonly","aria-disabled","autocapitalize","spellcheck","aria-autocomplete","tabindex","aria-valuemin","aria-valuemax","aria-valuenow","aria-invalid"],e=0;e<t.length;e++)this.element.removeAttribute(t[e]);this.element.classList.remove("e-input"),this.container.insertAdjacentElement("afterend",this.element),E.detach(this.container),this.spinUp=null,this.spinDown=null,this.container=null,this.hiddenInput=null,this.changeEventArgs=null,this.blurEventArgs=null,this.focusEventArgs=null,this.inputWrapper=null,o.Input.destroy({element:this.element,floatLabelType:this.floatLabelType,properties:this.properties},this.clearButton),St.prototype.destroy.call(this)},e.prototype.getText=function(){return this.element.value},e.prototype.focusIn=function(){document.activeElement!==this.element&&this.enabled&&(this.element.focus(),E.addClass([this.container],[At]))},e.prototype.focusOut=function(){document.activeElement===this.element&&this.enabled&&(this.element.blur(),E.removeClass([this.container],[At]))},e.prototype.getPersistData=function(){return this.addOnPersist(["value"])},e.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++){var n=s[i];switch(n){case"width":this.setElementWidth(t.width),o.Input.calculateWidth(this.element,this.container);break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass);break;case"enabled":o.Input.setEnabled(t.enabled,this.element),this.bindClearEvent();break;case"enableRtl":o.Input.setEnableRtl(t.enableRtl,[this.container]);break;case"readonly":o.Input.setReadonly(t.rea