Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-inputs

Package Overview
Dependencies
Maintainers
2
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-inputs - npm Package Compare versions

Comparing version 1.0.8 to 1.0.10

dist/global/numerictextbox.js

12

dist/ej2-inputs.umd.min.js

@@ -1,1 +0,11 @@

!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@syncfusion/ej2-base"));else if("function"==typeof define&&define.amd)define(["@syncfusion/ej2-base"],t);else{var n=t("object"==typeof exports?require("@syncfusion/ej2-base"):e["@syncfusion/ej2-base"]);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(this,function(e){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var i,r;i=[n,t,n(1),n(10)],void 0!==(r=function(e,t,n,i){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n),r(i)}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(2)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n)}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r,s=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),a=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};i=[n,t,n(3),n(3),n(4),n(8),n(3),n(9)],void 0!==(r=function(e,t,n,i,r,o,l,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c=new RegExp("/^(-)?(d*)$/"),h=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.decimalSeparator=".",i.intRegExp=new RegExp("/^(-)?(d*)$/"),i.isCalled=!1,i}return s(t,e),t.prototype.preRender=function(){var e=o.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),this.angularTagName=null,"EJ-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var t=r.createElement("input"),i=0;for(i;i<this.element.attributes.length;i++)t.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),t.innerHTML=this.element.innerHTML;this.element.parentNode.appendChild(t),this.element.parentNode.removeChild(this.element),this.element=t,o.setValue("ej2_instances",e,this.element)}r.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off","aria-live":"assertive"});var s={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:""};this.l10n=new n.L10n("numerictextbox",s,this.locale),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.checkAttributes(),this.prevValue=this.value,this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},t.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),this.setDimension(),this.changeValue(this.value),this.wireEvents(),null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0))},t.prototype.checkAttributes=function(){for(var e=["value","min","max","step","disabled","readonly","style","name"],t=0,n=e;t<n.length;t++){var i=n[t];if(!o.isNullOrUndefined(this.element.getAttribute(i)))switch(i){case"disabled":var r="disabled"!==this.element.getAttribute(i)&&"true"!==this.element.getAttribute(i);this.setProperties({enabled:r},!0);break;case"readonly":var s="readonly"===this.element.getAttribute(i)||"true"===this.element.getAttribute(i);this.setProperties({readonly:s},!0);break;case"style":this.inputStyle=this.element.getAttribute(i);break;case"name":this.inputName=this.element.getAttribute(i);break;default:var a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(i));(null!==a&&!isNaN(a)||"value"===i)&&this.setProperties(o.setValue(i,a,{}),!0)}}},t.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},t.prototype.initCultureFunc=function(){this.instance=new l.Internationalization(this.locale)},t.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==o.getValue("currency",this)&&o.setValue("currency",this.currency,this.cultureInfo)},t.prototype.createWrapper=function(){var e=u.Input.createInput({element:this.element,customTag:this.angularTagName,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:this.cssClass,enableRtl:this.enableRtl,enabled:this.enabled}});this.container=e.container,r.addClass([this.container],"e-numeric"),this.readonly&&r.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=r.createElement("input",{attrs:{type:"hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),o.isUndefined(this.inputName)||r.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.element),null!==this.inputStyle&&r.attributes(this.container,{style:this.inputStyle})},t.prototype.spinBtnCreation=function(){this.spinDown=u.Input.appendSpan("e-input-group-icon e-spin-down",this.container),r.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),this.spinUp=u.Input.appendSpan("e-input-group-icon e-spin-up",this.container),r.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},t.prototype.setDimension=function(){this.setWidth(this.width),this.setHeight(this.height)},t.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),r.attributes(this.element,{"aria-valuemin":this.min.toString(),"aria-valuemax":this.max.toString()})},t.prototype.formattedValue=function(e,t){return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},t.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},t.prototype.action=function(e){var t=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(t,this.step,e)),this.raiseChangeEvent()},t.prototype.checkErrorClass=function(){this.isValidState?r.removeClass([this.container],"e-error"):r.addClass([this.container],"e-error"),r.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},t.prototype.setWidth=function(e){var t=null!=e?e:this.container.offsetWidth;r.setStyleAttribute(this.container,{width:t})},t.prototype.setHeight=function(e){var t=null!=e?e:this.container.offsetHeight;r.setStyleAttribute(this.container,{height:t})},t.prototype.wireEvents=function(){n.EventHandler.add(this.element,"focus",this.focusIn,this),n.EventHandler.add(this.element,"blur",this.focusOut,this),n.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),n.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),n.EventHandler.add(this.element,"change",this.changeHandler,this),n.EventHandler.add(this.element,"paste",this.pasteHandler,this)},t.prototype.wireSpinBtnEvents=function(){n.EventHandler.add(this.spinUp,n.Browser.touchStartEvent,this.mouseDownOnSpinner,this),n.EventHandler.add(this.spinDown,n.Browser.touchStartEvent,this.mouseDownOnSpinner,this),n.EventHandler.add(this.spinUp,n.Browser.touchEndEvent,this.mouseUpOnSpinner,this),n.EventHandler.add(this.spinDown,n.Browser.touchEndEvent,this.mouseUpOnSpinner,this)},t.prototype.unwireEvents=function(){n.EventHandler.remove(this.element,"focus",this.focusIn),n.EventHandler.remove(this.element,"blur",this.focusOut),n.EventHandler.remove(this.element,"keydown",this.keyDownHandler),n.EventHandler.remove(this.element,"keypress",this.keyPressHandler),n.EventHandler.remove(this.element,"change",this.changeHandler),n.EventHandler.remove(this.element,"paste",this.pasteHandler)},t.prototype.unwireSpinBtnEvents=function(){n.EventHandler.remove(this.spinUp,n.Browser.touchStartEvent,this.mouseDownOnSpinner),n.EventHandler.remove(this.spinDown,n.Browser.touchStartEvent,this.mouseDownOnSpinner),n.EventHandler.remove(this.spinUp,n.Browser.touchEndEvent,this.mouseUpOnSpinner),n.EventHandler.remove(this.spinDown,n.Browser.touchEndEvent,this.mouseUpOnSpinner)},t.prototype.changeHandler=function(e){this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t,e)},t.prototype.raiseChangeEvent=function(e){if(this.prevValue!==this.value){var t={};this.changeEventArgs={value:this.value,previousValue:this.prevValue},e&&(this.changeEventArgs.event=e),o.merge(t,this.changeEventArgs),this.prevValue=this.value,this.trigger("change",t)}},t.prototype.pasteHandler=function(){var e=this,t=this.element.value;setTimeout(function(){e.numericRegex().test(e.element.value)||(e.element.value=t)})},t.prototype.keyDownHandler=function(e){switch(e.keyCode){case 38:e.preventDefault(),this.action("increment");break;case 40:e.preventDefault(),this.action("decrement")}},t.prototype.performAction=function(e,t,n){(null===e||isNaN(e))&&(e=0);var i="increment"===n?e+t:e-t;return i=this.correctRounding(e,t,i),this.strictMode?this.trimValue(i):i},t.prototype.correctRounding=function(e,t,n){var i=new RegExp("[,.](.*)"),r=(e.toString(),t.toString(),i.test(e.toString())),s=i.test(t.toString());if(r||s){var a=r?i.exec(e.toString())[0].length:0,o=s?i.exec(t.toString())[0].length:0,l=Math.max(a,o);return e=this.roundValue(n,l)}return n},t.prototype.roundValue=function(e,t){t=t||0;var n=Math.pow(10,t);return e*=n,e=Math.round(e)/n},t.prototype.updateValue=function(e,t){null===e||isNaN(e)||this.decimals&&(e=this.roundNumber(e,this.decimals)),this.changeValue(null===e||isNaN(e)?null:this.strictMode?this.trimValue(e):e),this.raiseChangeEvent(t)},t.prototype.changeValue=function(e){if(e||0===e){var t=void 0,n=e.toString().split(".")[1];t=n&&n.length?n.length:0,null!==this.decimals&&(t=t<this.decimals?t:this.decimals),this.setProperties({value:this.roundNumber(e,t)},!0)}else e=null,this.setProperties({value:e},!0);this.modifyText(),this.strictMode||this.validateState()},t.prototype.modifyText=function(){if(this.value||0===this.value){var e=this.formatNumber();this.element.value=this.isFocused?e:this.instance.getNumberFormat(this.cultureInfo)(this.value),r.attributes(this.element,{"aria-valuenow":e}),this.hiddenInput.value=e}else this.element.value="",this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null},t.prototype.validateState=function(){this.isValidState=!0,(this.value||0===this.value)&&(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},t.prototype.formatNumber=function(){var e,t=this.value,n=t.toString().split(".")[1];return e=n&&n.length?n.length:0,null!==this.decimals&&(e=e<this.decimals?e:this.decimals),this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(this.value)},t.prototype.trimValue=function(e){return e>this.max?this.max:e<this.min?this.min:e},t.prototype.roundNumber=function(e,t){var n=e,i=t||0,r=n.toString().split("e");n=Math.round(Number(r[0]+"e"+(r[1]?Number(r[1])+i:i)));var s=n.toString().split("e");return n=Number(s[0]+"e"+(s[1]?Number(s[1])-i:-i)),Number(n.toFixed(i))},t.prototype.cancelEvent=function(e){return e.preventDefault(),!1},t.prototype.keyPressHandler=function(e){if(0===e.which||e.metaKey||e.ctrlKey||8===e.keyCode||13===e.keyCode)return!0;var t=String.fromCharCode(e.which),n=this.element.value;return n=n.substring(0,this.element.selectionStart)+t+n.substring(this.element.selectionEnd),!!this.numericRegex().test(n)||(e.preventDefault(),e.stopPropagation(),!1)},t.prototype.numericRegex=function(){var e=l.getNumericObject(this.locale),t=o.getValue("decimal",e),n="*";return"."===t&&(t="\\"+t),0===this.decimals?c:(this.decimals&&this.validateDecimalOnType&&(n="{0,"+this.decimals+"}"),new RegExp("^(-)?(((\\d+("+t+"\\d"+n+")?)|("+t+"\\d"+n+")))?$"))},t.prototype.mouseWheel=function(e){e.preventDefault();var t,n=e;n.wheelDelta?t=n.wheelDelta/120:n.detail&&(t=-n.detail/3),t>0?this.action("increment"):t<0&&this.action("decrement"),this.cancelEvent(e)},t.prototype.focusIn=function(e){if(this.enabled&&!this.readonly){if(this.isFocused=!0,r.removeClass([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var t=this.formatNumber();this.element.value=t,this.element.setSelectionRange(t.length,t.length)}n.Browser.isDevice||n.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},t.prototype.focusOut=function(e){this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t),n.Browser.isDevice||n.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)},t.prototype.mouseDownOnSpinner=function(e){var t=this;if(this.getElementData(e)){var i=(this.getElementData(e),e.currentTarget),r=i.classList.contains("e-spin-up")?"increment":"decrement";n.EventHandler.add(i,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){t.isCalled=!0,t.action(r)},150),n.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},t.prototype.mouseUpOnSpinner=function(e){if(n.Browser.isDevice||e.preventDefault(),this.getElementData(e)){var t=e.currentTarget,i=t.classList.contains("e-spin-up")?"increment":"decrement";n.EventHandler.remove(t,"mouseleave",this.mouseUpClick),this.isCalled||this.action(i),this.isCalled=!1,n.EventHandler.remove(document,"mouseup",this.mouseUpClick)}},t.prototype.getElementData=function(e){return!(e.which&&3===e.which||e.button&&2===e.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},t.prototype.mouseUpClick=function(e){e.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,n.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),n.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},t.prototype.increment=function(e){void 0===e&&(e=this.step),this.changeValue(this.performAction(this.value,e,"increment"))},t.prototype.decrement=function(e){void 0===e&&(e=this.step),this.changeValue(this.performAction(this.value,e,"decrement"))},t.prototype.destroy=function(){this.unwireEvents(),r.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),r.detach(this.spinUp),r.detach(this.spinDown)),this.container.parentElement.appendChild(this.cloneElement),r.detach(this.container),e.prototype.destroy.call(this)},t.prototype.getText=function(){return this.element.value},t.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},t.prototype.onPropertyChanged=function(e,t){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n];switch(s){case"width":r.setStyleAttribute(this.container,{width:e.width});break;case"height":r.setStyleAttribute(this.container,{height:e.height});break;case"cssClass":u.Input.setCssClass(e.cssClass,[this.container],t.cssClass);break;case"enabled":u.Input.setEnabled(e.enabled,this.element);break;case"enableRtl":u.Input.setEnableRtl(e.enableRtl,[this.container]);break;case"readonly":u.Input.setReadonly(e.readonly,this.element),this.readonly?r.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"placeholder":u.Input.setPlaceholder(e.placeholder,this.element);break;case"step":this.step=e.step,this.validateStep();break;case"showSpinButton":e.showSpinButton?this.spinBtnCreation():(r.detach(this.spinUp),r.detach(this.spinDown));break;case"value":this.updateValue(e.value);break;case"min":case"max":o.setValue(s,o.getValue(s,e),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=e.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.updatePlaceholder(),u.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":o.setValue(s,o.getValue(s,e),this.cultureInfo),this.updateValue(this.value);break;case"format":o.setValue(s,o.getValue(s,e),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=e.decimals,this.updateValue(this.value)}}},t.prototype.getModuleName=function(){return"numerictextbox"},t}(n.Component);a([n.Property("")],h.prototype,"cssClass",void 0),a([n.Property(null)],h.prototype,"value",void 0),a([n.Property(-Number.MAX_VALUE)],h.prototype,"min",void 0),a([n.Property(Number.MAX_VALUE)],h.prototype,"max",void 0),a([n.Property(1)],h.prototype,"step",void 0),a([n.Property(null)],h.prototype,"width",void 0),a([n.Property(null)],h.prototype,"height",void 0),a([n.Property(null)],h.prototype,"placeholder",void 0),a([n.Property(!0)],h.prototype,"showSpinButton",void 0),a([n.Property(!1)],h.prototype,"readonly",void 0),a([n.Property(!0)],h.prototype,"enabled",void 0),a([n.Property(!1)],h.prototype,"enableRtl",void 0),a([n.Property("n2")],h.prototype,"format",void 0),a([n.Property(null)],h.prototype,"decimals",void 0),a([n.Property(null)],h.prototype,"currency",void 0),a([n.Property(!0)],h.prototype,"strictMode",void 0),a([n.Property(!1)],h.prototype,"validateDecimalOnType",void 0),a([n.Event()],h.prototype,"created",void 0),a([n.Event()],h.prototype,"destroyed",void 0),a([n.Event()],h.prototype,"change",void 0),h=a([i.NotifyPropertyChanges],h),t.NumericTextBox=h,t.numerictextboxHelper=n.CreateBuilder(h)}.apply(t,i))&&(e.exports=r)},function(t,n){t.exports=e},function(e,t,n){var i,r;i=[n,t,n(5)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n)}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(6),n(7)],void 0!==(r=function(e,t,n,i){"use strict";function r(e,t){var n=document.createElement(e);return void 0===t?n:(n.innerHTML=t.innerHTML?t.innerHTML:"",void 0!==t.className&&(n.className=t.className),void 0!==t.id&&(n.id=t.id),void 0!==t.styles&&n.setAttribute("style",t.styles),void 0!==t.attrs&&p(n,t.attrs),n)}function s(e,t){for(var n=o(t),i=0,r=e;i<r.length;i++)for(var s=r[i],a=0,l=n;a<l.length;a++){var u=l[a];s.classList.contains(u)||s.classList.add(u)}return e}function a(e,t){for(var n=o(t),i=0,r=e;i<r.length;i++){var s=r[i];if(""!==s.className)for(var a=0,l=n;a<l.length;a++){var u=l[a];s.classList.remove(u)}}return e}function o(e){var t=[];return"string"==typeof e?t.push(e):t=e,t}function l(e){var t=e;return""===t.style.visibility&&t.offsetWidth>0}function u(e,t){for(var n=document.createDocumentFragment(),i=0,r=e;i<r.length;i++){var s=r[i];n.appendChild(s)}return t.insertBefore(n,t.firstElementChild),e}function c(e,t){for(var n=document.createDocumentFragment(),i=0,r=e;i<r.length;i++){var s=r[i];n.appendChild(s)}return t.appendChild(n),e}function h(e){return e.parentNode.removeChild(e)}function d(e){var t=e.parentNode;n.EventHandler.clearEvents(e),t.removeChild(e)}function p(e,t){for(var n=Object.keys(t),i=e,r=0,s=n;r<s.length;r++){var a=s[r];i.setAttribute(a,t[a])}return i}function m(e,t){return void 0===t&&(t=document),t.querySelector(e)}function v(e,t){return void 0===t&&(t=document),t.querySelectorAll(e)}function f(e,t){var n=e;if("function"==typeof n.closest)return n.closest(t);for(;n&&1===n.nodeType;){if(N(n,t))return n;n=n.parentNode}return null}function y(e){for(var t=[],n=Array.prototype.slice.call(e.parentNode.childNodes),i=0,r=n;i<r.length;i++){var s=r[i];s.nodeType===Node.ELEMENT_NODE&&e!==s&&t.push(s)}return t}function b(e,t,n){var r=e.getAttribute(t);return i.isNullOrUndefined(r)&&(e.setAttribute(t,n.toString()),r=n),r}function g(e,t){void 0!==t&&Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function E(e,t,n){s([e],t),a([e],n)}function N(e,t){var n=e.matches||e.msMatchesSelector||e.webkitMatchesSelector;return n?n.call(e,t):-1!==[].indexOf.call(document.querySelectorAll(t),e)}Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=r,t.addClass=s,t.removeClass=a,t.isVisible=l,t.prepend=u,t.append=c,t.detach=h,t.remove=d,t.attributes=p,t.select=m,t.selectAll=v,t.closest=f,t.siblings=y,t.getAttributeOrDefault=b,t.setStyleAttribute=g,t.classList=E,t.matches=N}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(7)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.addOrGetEventData=function(e){return"__eventList"in e?e.__eventList.events:(e.__eventList={},e.__eventList.events=[])},e.add=function(t,i,r,s,a){var o,l=e.addOrGetEventData(t);o=a?n.debounce(r,a):r,s&&(o=o.bind(s));for(var u=i.split(" "),c=0;c<u.length;c++)l.push({name:u[c],listener:r,debounce:o}),t.addEventListener(u[c],o)},e.remove=function(t,n,i){for(var r=e.addOrGetEventData(t),s=n.split(" "),a=0;a<s.length;a++)!function(e){var n,a=-1;r&&0!==r.length&&r.some(function(t,r){return t.name===s[e]&&t.listener.toString()===i.toString()&&(a=r,n=t.debounce,!0)}),-1!==a&&r.splice(a,1),t.removeEventListener(s[e],n)}(a)},e.clearEvents=function(t){var i,r;i=e.addOrGetEventData(t),r=n.extend([],r,i);for(var s=0;s<r.length;s++)t.removeEventListener(r[s].name,r[s].debounce),i.shift()},e.trigger=function(t,n,i){for(var r=e.addOrGetEventData(t),s=0,a=r;s<a.length;s++){var o=a[s];o.name===n&&o.debounce.call(this,i)}},e}();t.EventHandler=i}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t],void 0!==(r=function(e,t){"use strict";function n(e,t){var n=t;return n.unshift(void 0),new(Function.prototype.bind.apply(e,n))}function i(e){var t,n=new Uint16Array(5);(window.msCrypto||window.crypto).getRandomValues(n);var i="ej2"+w(n),r=function(n){n.source===window&&"string"==typeof n.data&&n.data.length<=32&&n.data===i&&(e(),t())};return window.addEventListener("message",r,!1),window.postMessage(i,"*"),t=function(){window.removeEventListener("message",r)}}function r(e,t){for(var n=t,i=e.split("."),r=0;r<i.length&&!d(n);r++)n=n[i[r]];return n}function s(e,t,n){var i,r,s=e.split("."),a=n||{},o=a,l=s.length;for(i=0;i<l;i++)r=s[i],i+1===l?o[r]=void 0===t?{}:t:h(o[r])&&(o[r]={}),o=o[r];return a}function a(e,t){delete e[t]}function o(e){var t={};return!h(e)&&e.constructor===t.constructor}function l(e,t){return e[t]}function u(e,t){if(!h(t))for(var n=e,i=t,r=Object.keys(t),s=0,a=r;s<a.length;s++){var o=a[s];n[o]=i[o]}}function c(e,t,n,i){var r=e||{},s=arguments.length;i&&(s-=1);for(var a=arguments,l=1;l<s;l++)!function(e){if(!a[e])return"continue";var t=a[e];Object.keys(t).forEach(function(e){var n,s=r[e],a=t[e];i&&o(a)?(n=o(s)?s:{},r[e]=c({},n,a,!0)):r[e]=a})}(l);return r}function h(e){return void 0===e||null===e}function d(e){return void 0===e}function p(e){return e+"_"+C++}function m(e,t){var n,i=this;return function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];var a=r[0],o=function(){return n=null,e.call(i,a)};clearTimeout(n),n=setTimeout(o,t)}}function v(e){for(var t=[],n=Object.keys(e),i=0,r=n;i<r.length;i++){var s=r[i];t.push(encodeURIComponent(s)+"="+encodeURIComponent(""+e[s]))}return t.join("&")}function f(e){var t=Object.prototype.toString;return"[object Array]"===t.call(e)&&"[object Object]"===t.call(e[0])}function y(e,t){var n=e;return n===t||!(n===document||!n)&&y(n.parentNode,t)}function b(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}}function g(e,t){var n=document.createElement("div"),i=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style")),r="";h(t)&&(t=window.open("","print","height=452,width=1024,tabbar=no")),n.appendChild(e.cloneNode(!0));for(var s=0,a=i.length;s<a;s++)r+=i[s].outerHTML;t.document.write("<!DOCTYPE html> <html><head>"+r+"</head><body>"+n.innerHTML+"<script> (function() { window.ready = true; })(); <\/script></body></html>"),t.document.close(),t.focus();var o=setInterval(function(){t.ready&&(t.print(),t.close(),clearInterval(o))},500);return t}function E(e){var t=e+"";return"auto"===t||-1!==t.indexOf("%")||-1!==t.indexOf("px")?t:t+"px"}function N(e,t){var n="string"==typeof e?document.querySelector(e):e;if(n[P])for(var i=0,r=n[P];i<r.length;i++){var s=r[i];if(s instanceof t)return s}return null}function O(e,t){var n="string"==typeof e?document.querySelector(e):e;n[P]?n[P].push(t):n[P]=[t]}function w(e){for(var t="",n=0;n<5;n++)t+=(n?",":"")+e[n];return t}Object.defineProperty(t,"__esModule",{value:!0});var P="ej2_instances",C=0;t.createInstance=n,t.setImmediate=i,t.getValue=r,t.setValue=s,t.deleteObject=a,t.isObject=o,t.getEnumValue=l,t.merge=u,t.extend=c,t.isNullOrUndefined=h,t.isUndefined=d,t.getUniqueID=p,t.debounce=m,t.queryParams=v,t.isObjectArray=f,t.compareElementParent=y,t.throwError=b,t.print=g,t.formatUnit=E,t.getInstance=N,t.addInstance=O}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(7)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n)}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(4),n(8)],void 0!==(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(e){function t(e){var t={container:null,buttons:[]};if(i.isNullOrUndefined(e.isFloat)||!e.isFloat)t.container=s(e,r.INPUTGROUP,r.INPUTCUSTOMTAG,"span"),e.element.addEventListener("focus",function(){var e=this.parentNode;e.classList.contains("e-input-group")&&e.classList.add("e-input-focus")}),e.element.addEventListener("blur",function(){var e=this.parentNode;e.classList.contains("e-input-group")&&e.classList.remove("e-input-focus")}),e.element.parentNode.insertBefore(t.container,e.element),n.addClass([e.element],r.INPUT),t.container.appendChild(e.element);else{var h=void 0,d=void 0;if(e.element.addEventListener("focus",function(){this.parentNode.getElementsByClassName("e-float-text")[0].classList.add("e-label-top")}),e.element.addEventListener("blur",function(){var e=this.parentNode;""===e.getElementsByTagName("input")[0].value&&e.getElementsByClassName("e-float-text")[0].classList.remove("e-label-top")}),t.container=s(e,r.FLOATINPUT,r.FLOATCUSTOMTAG,"div"),e.element.parentNode.insertBefore(t.container,e.element),n.attributes(e.element,{required:"true"}),h=n.createElement("span",{className:r.FLOATLINE}),d=n.createElement("label",{className:r.FLOATTEXT}),!i.isNullOrUndefined(e.element.id)&&""!==e.element.id){var m=void 0;m="label_"+e.element.id,d.id=m.replace(/ /g,"_"),n.attributes(e.element,{"aria-labelledby":d.id})}i.isNullOrUndefined(e.element.placeholder)||""===e.element.placeholder||(d.innerHTML=e.element.placeholder,e.element.removeAttribute("placeholder")),i.isNullOrUndefined(e.properties)||i.isNullOrUndefined(e.properties.placeholder)||""===e.properties.placeholder||(d.innerHTML=e.properties.placeholder),t.container.appendChild(e.element),t.container.appendChild(h),t.container.appendChild(d)}if(!i.isNullOrUndefined(e.buttons))for(var v=0;v<e.buttons.length;v++)t.buttons.push(p(e.buttons[v],t.container));if(!i.isNullOrUndefined(e.properties))for(var f=0,y=Object.keys(e.properties);f<y.length;f++){var b=y[f];switch(b){case"cssClass":a(e.properties.cssClass,[t.container]);break;case"enabled":c(e.properties.enabled,e.element);break;case"enableRtl":u(e.properties.enableRtl,[t.container]);break;case"placeholder":o(e.properties.placeholder,e.element);break;case"readonly":l(e.properties.readonly,e.element)}}return t}function s(e,t,r,s){var a;return i.isNullOrUndefined(e.customTag)?a=n.createElement(s,{className:t}):(a=n.createElement(e.customTag,{className:t}),a.classList.add(r)),a}function a(e,t,r){i.isNullOrUndefined(r)||""===r||n.removeClass(t,r),i.isNullOrUndefined(e)||""===e||n.addClass(t,e)}function o(e,t){var s;s=t.parentNode,s.classList.contains(r.FLOATINPUT)?i.isNullOrUndefined(e)||""===e||(s.getElementsByClassName(r.FLOATTEXT)[0].textContent=e):i.isNullOrUndefined(e)||""===e?(t.removeAttribute("placeholder"),t.removeAttribute("aria-placeholder")):n.attributes(t,{placeholder:e,"aria-placeholder":e})}function l(e,t){e?n.attributes(t,{readonly:""}):t.removeAttribute("readonly")}function u(e,t){e?n.addClass(t,r.RTL):n.removeClass(t,r.RTL)}function c(e,t){var n={disabled:"disabled","aria-disabled":"true"};e?(t.classList.remove(r.DISABLE),h(n,t)):(t.classList.add(r.DISABLE),d(n,t))}function h(e,t){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n],a=void 0;a=t.parentNode,"disabled"===s&&t.classList.remove(r.DISABLE),"disabled"===s&&a.classList.contains(r.INPUTGROUP)&&a.classList.remove(r.DISABLE),"placeholder"===s&&a.classList.contains(r.FLOATINPUT)?a.getElementsByClassName(r.FLOATTEXT)[0].textContent="":t.removeAttribute(s)}}function d(e,t){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n],a=void 0;a=t.parentNode,"disabled"===s&&t.classList.add(r.DISABLE),"disabled"===s&&a.classList.contains(r.INPUTGROUP)&&a.classList.add(r.DISABLE),"placeholder"===s&&a.classList.contains(r.FLOATINPUT)?a.getElementsByClassName(r.FLOATTEXT)[0].textContent=e[s]:t.setAttribute(s,e[s])}}function p(e,t){var i=n.createElement("span",{className:e});return t.appendChild(i),t.classList.contains(r.INPUTGROUP)||t.classList.add(r.INPUTGROUP),i.addEventListener("mousedown",function(){this.classList.add("e-input-btn-ripple")}),i.addEventListener("mouseup",function(){var e=this;setTimeout(function(){e.classList.remove("e-input-btn-ripple")},500)}),i}e.createInput=t,e.setCssClass=a,e.setPlaceholder=o,e.setReadonly=l,e.setEnableRtl=u,e.setEnabled=c,e.removeAttributes=h,e.addAttributes=d,e.appendSpan=p}(t.Input||(t.Input={}))}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(9)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n)}.apply(t,i))&&(e.exports=r)}])});
/*!
* filename: ej2-inputs.umd.min.js
* version : 1.0.10
* Copyright Syncfusion Inc. 2001 - 2017. 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(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@syncfusion/ej2-base"));else if("function"==typeof define&&define.amd)define(["@syncfusion/ej2-base"],t);else{var n=t("object"==typeof exports?require("@syncfusion/ej2-base"):e["@syncfusion/ej2-base"]);for(var i in n)("object"==typeof exports?exports:e)[i]=n[i]}}(this,function(e){return function(e){function t(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return e[i].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var i,r;i=[n,t,n(1),n(10)],void 0!==(r=function(e,t,n,i){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n),r(i)}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(2)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n)}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r,s=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),a=this&&this.__decorate||function(e,t,n,i){var r,s=arguments.length,a=s<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(a=(s<3?r(a):s>3?r(t,n,a):r(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a};i=[n,t,n(3),n(3),n(4),n(8),n(3),n(9)],void 0!==(r=function(e,t,n,i,r,o,l,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c="e-input-group-icon",d=new RegExp("/^(-)?(d*)$/"),h=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.decimalSeparator=".",i.intRegExp=new RegExp("/^(-)?(d*)$/"),i.isCalled=!1,i}return s(t,e),t.prototype.preRender=function(){var e=o.getValue("ej2_instances",this.element);if(this.cloneElement=this.element.cloneNode(!0),this.angularTagName=null,"EJ-NUMERICTEXTBOX"===this.element.tagName){this.angularTagName=this.element.tagName;var t=r.createElement("input"),i=0;for(i;i<this.element.attributes.length;i++)t.setAttribute(this.element.attributes[i].nodeName,this.element.attributes[i].nodeValue),t.innerHTML=this.element.innerHTML;this.element.parentNode.appendChild(t),this.element.parentNode.removeChild(this.element),this.element=t,o.setValue("ej2_instances",e,this.element)}r.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off","aria-live":"assertive"});var s={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:""};this.l10n=new n.L10n("numerictextbox",s,this.locale),this.isValidState=!0,this.inputStyle=null,this.inputName=null,this.cultureInfo={},this.initCultureInfo(),this.initCultureFunc(),this.checkAttributes(),this.prevValue=this.value,this.validateMinMax(),this.validateStep(),null===this.placeholder&&this.updatePlaceholder()},t.prototype.render=function(){"input"===this.element.tagName.toLowerCase()&&(this.createWrapper(),this.showSpinButton&&this.spinBtnCreation(),o.isNullOrUndefined(this.width)||r.setStyleAttribute(this.container,{width:o.formatUnit(this.width)}),o.isNullOrUndefined(this.height)||r.setStyleAttribute(this.container,{height:o.formatUnit(this.height)}),this.changeValue(this.value),this.wireEvents(),null===this.value||isNaN(this.value)||this.decimals&&this.setProperties({value:this.roundNumber(this.value,this.decimals)},!0))},t.prototype.checkAttributes=function(){for(var e=["value","min","max","step","disabled","readonly","style","name"],t=0,n=e;t<n.length;t++){var i=n[t];if(!o.isNullOrUndefined(this.element.getAttribute(i)))switch(i){case"disabled":var r="disabled"!==this.element.getAttribute(i)&&"true"!==this.element.getAttribute(i);this.setProperties({enabled:r},!0);break;case"readonly":var s="readonly"===this.element.getAttribute(i)||"true"===this.element.getAttribute(i);this.setProperties({readonly:s},!0);break;case"style":this.inputStyle=this.element.getAttribute(i);break;case"name":this.inputName=this.element.getAttribute(i);break;default:var a=this.instance.getNumberParser({format:"n"})(this.element.getAttribute(i));(null!==a&&!isNaN(a)||"value"===i)&&this.setProperties(o.setValue(i,a,{}),!0)}}},t.prototype.updatePlaceholder=function(){this.setProperties({placeholder:this.l10n.getConstant("placeholder")},!0)},t.prototype.initCultureFunc=function(){this.instance=new l.Internationalization(this.locale)},t.prototype.initCultureInfo=function(){this.cultureInfo.format=this.format,null!==o.getValue("currency",this)&&o.setValue("currency",this.currency,this.cultureInfo)},t.prototype.createWrapper=function(){var e=u.Input.createInput({element:this.element,customTag:this.angularTagName,floatLabelType:this.floatLabelType,properties:{readonly:this.readonly,placeholder:this.placeholder,cssClass:this.cssClass,enableRtl:this.enableRtl,enabled:this.enabled}});this.container=e.container,r.addClass([this.container],"e-numeric"),this.readonly&&r.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=r.createElement("input",{attrs:{type:"hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),o.isUndefined(this.inputName)||r.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.element),null!==this.inputStyle&&r.attributes(this.container,{style:this.inputStyle})},t.prototype.spinBtnCreation=function(){this.spinDown=u.Input.appendSpan(c+" e-spin-down",this.container),r.attributes(this.spinDown,{title:this.l10n.getConstant("decrementTitle"),"aria-label":this.l10n.getConstant("decrementTitle")}),this.spinUp=u.Input.appendSpan(c+" e-spin-up",this.container),r.attributes(this.spinUp,{title:this.l10n.getConstant("incrementTitle"),"aria-label":this.l10n.getConstant("incrementTitle")}),this.wireSpinBtnEvents()},t.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),r.attributes(this.element,{"aria-valuemin":this.min.toString(),"aria-valuemax":this.max.toString()})},t.prototype.formattedValue=function(e,t){return this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(t)},t.prototype.validateStep=function(){null!==this.decimals&&this.setProperties({step:this.instance.getNumberParser({format:"n"})(this.formattedValue(this.decimals,this.step))},!0)},t.prototype.action=function(e){var t=this.isFocused?this.instance.getNumberParser({format:"n"})(this.element.value):this.value;this.changeValue(this.performAction(t,this.step,e)),this.raiseChangeEvent()},t.prototype.checkErrorClass=function(){this.isValidState?r.removeClass([this.container],"e-error"):r.addClass([this.container],"e-error"),r.attributes(this.element,{"aria-invalid":this.isValidState?"false":"true"})},t.prototype.wireEvents=function(){n.EventHandler.add(this.element,"focus",this.focusIn,this),n.EventHandler.add(this.element,"blur",this.focusOut,this),n.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),n.EventHandler.add(this.element,"keypress",this.keyPressHandler,this),n.EventHandler.add(this.element,"change",this.changeHandler,this),n.EventHandler.add(this.element,"paste",this.pasteHandler,this)},t.prototype.wireSpinBtnEvents=function(){n.EventHandler.add(this.spinUp,n.Browser.touchStartEvent,this.mouseDownOnSpinner,this),n.EventHandler.add(this.spinDown,n.Browser.touchStartEvent,this.mouseDownOnSpinner,this),n.EventHandler.add(this.spinUp,n.Browser.touchEndEvent,this.mouseUpOnSpinner,this),n.EventHandler.add(this.spinDown,n.Browser.touchEndEvent,this.mouseUpOnSpinner,this),n.EventHandler.add(this.spinUp,n.Browser.touchMoveEvent,this.touchMoveOnSpinner,this),n.EventHandler.add(this.spinDown,n.Browser.touchMoveEvent,this.touchMoveOnSpinner,this)},t.prototype.unwireEvents=function(){n.EventHandler.remove(this.element,"focus",this.focusIn),n.EventHandler.remove(this.element,"blur",this.focusOut),n.EventHandler.remove(this.element,"keydown",this.keyDownHandler),n.EventHandler.remove(this.element,"keypress",this.keyPressHandler),n.EventHandler.remove(this.element,"change",this.changeHandler),n.EventHandler.remove(this.element,"paste",this.pasteHandler)},t.prototype.unwireSpinBtnEvents=function(){n.EventHandler.remove(this.spinUp,n.Browser.touchStartEvent,this.mouseDownOnSpinner),n.EventHandler.remove(this.spinDown,n.Browser.touchStartEvent,this.mouseDownOnSpinner),n.EventHandler.remove(this.spinUp,n.Browser.touchEndEvent,this.mouseUpOnSpinner),n.EventHandler.remove(this.spinDown,n.Browser.touchEndEvent,this.mouseUpOnSpinner),n.EventHandler.remove(this.spinUp,n.Browser.touchMoveEvent,this.touchMoveOnSpinner),n.EventHandler.remove(this.spinDown,n.Browser.touchMoveEvent,this.touchMoveOnSpinner)},t.prototype.changeHandler=function(e){this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t,e)},t.prototype.raiseChangeEvent=function(e){if(this.prevValue!==this.value){var t={};this.changeEventArgs={value:this.value,previousValue:this.prevValue},e&&(this.changeEventArgs.event=e),o.merge(t,this.changeEventArgs),this.prevValue=this.value,this.trigger("change",t)}},t.prototype.pasteHandler=function(){var e=this,t=this.element.value;setTimeout(function(){e.numericRegex().test(e.element.value)||(e.element.value=t)})},t.prototype.keyDownHandler=function(e){switch(e.keyCode){case 38:e.preventDefault(),this.action("increment");break;case 40:e.preventDefault(),this.action("decrement")}},t.prototype.performAction=function(e,t,n){(null===e||isNaN(e))&&(e=0);var i="increment"===n?e+t:e-t;return i=this.correctRounding(e,t,i),this.strictMode?this.trimValue(i):i},t.prototype.correctRounding=function(e,t,n){var i=new RegExp("[,.](.*)"),r=(e.toString(),t.toString(),i.test(e.toString())),s=i.test(t.toString());if(r||s){var a=r?i.exec(e.toString())[0].length:0,o=s?i.exec(t.toString())[0].length:0,l=Math.max(a,o);return e=this.roundValue(n,l)}return n},t.prototype.roundValue=function(e,t){t=t||0;var n=Math.pow(10,t);return e*=n,e=Math.round(e)/n},t.prototype.updateValue=function(e,t){null===e||isNaN(e)||this.decimals&&(e=this.roundNumber(e,this.decimals)),this.changeValue(null===e||isNaN(e)?null:this.strictMode?this.trimValue(e):e),this.raiseChangeEvent(t)},t.prototype.changeValue=function(e){if(e||0===e){var t=void 0,n=e.toString().split(".")[1];t=n&&n.length?n.length:0,null!==this.decimals&&(t=t<this.decimals?t:this.decimals),this.setProperties({value:this.roundNumber(e,t)},!0)}else e=null,this.setProperties({value:e},!0);this.modifyText(),this.strictMode||this.validateState()},t.prototype.modifyText=function(){if(this.value||0===this.value){var e=this.formatNumber();this.element.value=this.isFocused?e:this.instance.getNumberFormat(this.cultureInfo)(this.value),r.attributes(this.element,{"aria-valuenow":e}),this.hiddenInput.value=e}else this.element.value="",this.element.removeAttribute("aria-valuenow"),this.hiddenInput.value=null},t.prototype.validateState=function(){this.isValidState=!0,(this.value||0===this.value)&&(this.isValidState=!(this.value>this.max||this.value<this.min)),this.checkErrorClass()},t.prototype.formatNumber=function(){var e,t=this.value,n=t.toString().split(".")[1];return e=n&&n.length?n.length:0,null!==this.decimals&&(e=e<this.decimals?e:this.decimals),this.instance.getNumberFormat({maximumFractionDigits:e,minimumFractionDigits:e,useGrouping:!1})(this.value)},t.prototype.trimValue=function(e){return e>this.max?this.max:e<this.min?this.min:e},t.prototype.roundNumber=function(e,t){var n=e,i=t||0,r=n.toString().split("e");n=Math.round(Number(r[0]+"e"+(r[1]?Number(r[1])+i:i)));var s=n.toString().split("e");return n=Number(s[0]+"e"+(s[1]?Number(s[1])-i:-i)),Number(n.toFixed(i))},t.prototype.cancelEvent=function(e){return e.preventDefault(),!1},t.prototype.keyPressHandler=function(e){if(0===e.which||e.metaKey||e.ctrlKey||8===e.keyCode||13===e.keyCode)return!0;var t=String.fromCharCode(e.which),n=this.element.value;return n=n.substring(0,this.element.selectionStart)+t+n.substring(this.element.selectionEnd),!!this.numericRegex().test(n)||(e.preventDefault(),e.stopPropagation(),!1)},t.prototype.numericRegex=function(){var e=l.getNumericObject(this.locale),t=o.getValue("decimal",e),n="*";return"."===t&&(t="\\"+t),0===this.decimals?d:(this.decimals&&this.validateDecimalOnType&&(n="{0,"+this.decimals+"}"),new RegExp("^(-)?(((\\d+("+t+"\\d"+n+")?)|("+t+"\\d"+n+")))?$"))},t.prototype.mouseWheel=function(e){e.preventDefault();var t,n=e;n.wheelDelta?t=n.wheelDelta/120:n.detail&&(t=-n.detail/3),t>0?this.action("increment"):t<0&&this.action("decrement"),this.cancelEvent(e)},t.prototype.focusIn=function(e){if(this.enabled&&!this.readonly){if(this.isFocused=!0,r.removeClass([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var t=this.formatNumber();this.element.value=t,this.element.setSelectionRange(t.length,t.length)}n.Browser.isDevice||n.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},t.prototype.focusOut=function(e){this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var t=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(t),n.Browser.isDevice||n.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)},t.prototype.mouseDownOnSpinner=function(e){var t=this;if(this.getElementData(e)){var i=(this.getElementData(e),e.currentTarget),r=i.classList.contains("e-spin-up")?"increment":"decrement";n.EventHandler.add(i,"mouseleave",this.mouseUpClick,this),this.timeOut=setInterval(function(){t.isCalled=!0,t.action(r)},150),n.EventHandler.add(document,"mouseup",this.mouseUpClick,this)}},t.prototype.touchMoveOnSpinner=function(e){document.elementFromPoint(e.clientX,e.clientY).classList.contains(c)||clearInterval(this.timeOut)},t.prototype.mouseUpOnSpinner=function(e){if(n.Browser.isDevice||e.preventDefault(),this.getElementData(e)){var t=e.currentTarget,i=t.classList.contains("e-spin-up")?"increment":"decrement";n.EventHandler.remove(t,"mouseleave",this.mouseUpClick),this.isCalled||this.action(i),this.isCalled=!1,n.EventHandler.remove(document,"mouseup",this.mouseUpClick)}},t.prototype.getElementData=function(e){return!(e.which&&3===e.which||e.button&&2===e.button||!this.enabled||this.readonly)&&(clearInterval(this.timeOut),!0)},t.prototype.mouseUpClick=function(e){e.stopPropagation(),clearInterval(this.timeOut),this.isCalled=!1,n.EventHandler.remove(this.spinUp,"mouseleave",this.mouseUpClick),n.EventHandler.remove(this.spinDown,"mouseleave",this.mouseUpClick)},t.prototype.increment=function(e){void 0===e&&(e=this.step),this.changeValue(this.performAction(this.value,e,"increment"))},t.prototype.decrement=function(e){void 0===e&&(e=this.step),this.changeValue(this.performAction(this.value,e,"decrement"))},t.prototype.destroy=function(){this.unwireEvents(),r.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),r.detach(this.spinUp),r.detach(this.spinDown)),this.container.parentElement.appendChild(this.cloneElement),r.detach(this.container),e.prototype.destroy.call(this)},t.prototype.getText=function(){return this.element.value},t.prototype.getPersistData=function(){var e=["value"];return this.addOnPersist(e)},t.prototype.onPropertyChanged=function(e,t){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n];switch(s){case"width":r.setStyleAttribute(this.container,{width:o.formatUnit(e.width)});break;case"height":r.setStyleAttribute(this.container,{height:o.formatUnit(e.height)});break;case"cssClass":u.Input.setCssClass(e.cssClass,[this.container],t.cssClass);break;case"enabled":u.Input.setEnabled(e.enabled,this.element);break;case"enableRtl":u.Input.setEnableRtl(e.enableRtl,[this.container]);break;case"readonly":u.Input.setReadonly(e.readonly,this.element),this.readonly?r.attributes(this.element,{"aria-readonly":"true"}):this.element.removeAttribute("aria-readonly");break;case"placeholder":u.Input.setPlaceholder(e.placeholder,this.element);break;case"step":this.step=e.step,this.validateStep();break;case"showSpinButton":e.showSpinButton?this.spinBtnCreation():(r.detach(this.spinUp),r.detach(this.spinDown));break;case"value":this.updateValue(e.value);break;case"min":case"max":o.setValue(s,o.getValue(s,e),this),this.validateMinMax(),this.updateValue(this.value);break;case"strictMode":this.strictMode=e.strictMode,this.updateValue(this.value),this.validateState();break;case"locale":this.initCultureFunc(),this.l10n.setLocale(this.locale),this.updatePlaceholder(),u.Input.setPlaceholder(this.placeholder,this.element),this.updateValue(this.value);break;case"currency":o.setValue(s,o.getValue(s,e),this.cultureInfo),this.updateValue(this.value);break;case"format":o.setValue(s,o.getValue(s,e),this),this.initCultureInfo(),this.updateValue(this.value);break;case"decimals":this.decimals=e.decimals,this.updateValue(this.value)}}},t.prototype.getModuleName=function(){return"numerictextbox"},t}(n.Component);a([n.Property("")],h.prototype,"cssClass",void 0),a([n.Property(null)],h.prototype,"value",void 0),a([n.Property(-Number.MAX_VALUE)],h.prototype,"min",void 0),a([n.Property(Number.MAX_VALUE)],h.prototype,"max",void 0),a([n.Property(1)],h.prototype,"step",void 0),a([n.Property(null)],h.prototype,"width",void 0),a([n.Property(null)],h.prototype,"height",void 0),a([n.Property(null)],h.prototype,"placeholder",void 0),a([n.Property(!0)],h.prototype,"showSpinButton",void 0),a([n.Property(!1)],h.prototype,"readonly",void 0),a([n.Property(!0)],h.prototype,"enabled",void 0),a([n.Property(!1)],h.prototype,"enableRtl",void 0),a([n.Property("n2")],h.prototype,"format",void 0),a([n.Property(null)],h.prototype,"decimals",void 0),a([n.Property(null)],h.prototype,"currency",void 0),a([n.Property(!0)],h.prototype,"strictMode",void 0),a([n.Property(!1)],h.prototype,"validateDecimalOnType",void 0),a([n.Property("Auto")],h.prototype,"floatLabelType",void 0),a([n.Event()],h.prototype,"created",void 0),a([n.Event()],h.prototype,"destroyed",void 0),a([n.Event()],h.prototype,"change",void 0),h=a([i.NotifyPropertyChanges],h),t.NumericTextBox=h,t.numerictextboxHelper=n.CreateBuilder(h)}.apply(t,i))&&(e.exports=r)},function(t,n){t.exports=e},function(e,t,n){var i,r;i=[n,t,n(5)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n)}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(6),n(7)],void 0!==(r=function(e,t,n,i){"use strict";function r(e,t){var n=document.createElement(e);return void 0===t?n:(n.innerHTML=t.innerHTML?t.innerHTML:"",void 0!==t.className&&(n.className=t.className),void 0!==t.id&&(n.id=t.id),void 0!==t.styles&&n.setAttribute("style",t.styles),void 0!==t.attrs&&p(n,t.attrs),n)}function s(e,t){for(var n=o(t),i=0,r=e;i<r.length;i++)for(var s=r[i],a=0,l=n;a<l.length;a++){var u=l[a];s.classList.contains(u)||s.classList.add(u)}return e}function a(e,t){for(var n=o(t),i=0,r=e;i<r.length;i++){var s=r[i];if(""!==s.className)for(var a=0,l=n;a<l.length;a++){var u=l[a];s.classList.remove(u)}}return e}function o(e){var t=[];return"string"==typeof e?t.push(e):t=e,t}function l(e){var t=e;return""===t.style.visibility&&t.offsetWidth>0}function u(e,t){for(var n=document.createDocumentFragment(),i=0,r=e;i<r.length;i++){var s=r[i];n.appendChild(s)}return t.insertBefore(n,t.firstElementChild),e}function c(e,t){for(var n=document.createDocumentFragment(),i=0,r=e;i<r.length;i++){var s=r[i];n.appendChild(s)}return t.appendChild(n),e}function d(e){return e.parentNode.removeChild(e)}function h(e){var t=e.parentNode;n.EventHandler.clearEvents(e),t.removeChild(e)}function p(e,t){for(var n=Object.keys(t),i=e,r=0,s=n;r<s.length;r++){var a=s[r];i.setAttribute(a,t[a])}return i}function m(e,t){return void 0===t&&(t=document),t.querySelector(e)}function v(e,t){return void 0===t&&(t=document),t.querySelectorAll(e)}function f(e,t){var n=e;if("function"==typeof n.closest)return n.closest(t);for(;n&&1===n.nodeType;){if(O(n,t))return n;n=n.parentNode}return null}function y(e){for(var t=[],n=Array.prototype.slice.call(e.parentNode.childNodes),i=0,r=n;i<r.length;i++){var s=r[i];s.nodeType===Node.ELEMENT_NODE&&e!==s&&t.push(s)}return t}function b(e,t,n){var r=e.getAttribute(t);return i.isNullOrUndefined(r)&&(e.setAttribute(t,n.toString()),r=n),r}function g(e,t){void 0!==t&&Object.keys(t).forEach(function(n){e.style[n]=t[n]})}function E(e,t,n){s([e],t),a([e],n)}function O(e,t){var n=e.matches||e.msMatchesSelector||e.webkitMatchesSelector;return n?n.call(e,t):-1!==[].indexOf.call(document.querySelectorAll(t),e)}Object.defineProperty(t,"__esModule",{value:!0}),t.createElement=r,t.addClass=s,t.removeClass=a,t.isVisible=l,t.prepend=u,t.append=c,t.detach=d,t.remove=h,t.attributes=p,t.select=m,t.selectAll=v,t.closest=f,t.siblings=y,t.getAttributeOrDefault=b,t.setStyleAttribute=g,t.classList=E,t.matches=O}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(7)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.addOrGetEventData=function(e){return"__eventList"in e?e.__eventList.events:(e.__eventList={},e.__eventList.events=[])},e.add=function(t,i,r,s,a){var o,l=e.addOrGetEventData(t);o=a?n.debounce(r,a):r,s&&(o=o.bind(s));for(var u=i.split(" "),c=0;c<u.length;c++)l.push({name:u[c],listener:r,debounce:o}),t.addEventListener(u[c],o)},e.remove=function(t,n,i){for(var r=e.addOrGetEventData(t),s=n.split(" "),a=0;a<s.length;a++)!function(e){var n,a=-1;r&&0!==r.length&&r.some(function(t,r){return t.name===s[e]&&t.listener.toString()===i.toString()&&(a=r,n=t.debounce,!0)}),-1!==a&&r.splice(a,1),t.removeEventListener(s[e],n)}(a)},e.clearEvents=function(t){var i,r;i=e.addOrGetEventData(t),r=n.extend([],r,i);for(var s=0;s<r.length;s++)t.removeEventListener(r[s].name,r[s].debounce),i.shift()},e.trigger=function(t,n,i){for(var r=e.addOrGetEventData(t),s=0,a=r;s<a.length;s++){var o=a[s];o.name===n&&o.debounce.call(this,i)}},e}();t.EventHandler=i}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t],void 0!==(r=function(e,t){"use strict";function n(e,t){var n=t;return n.unshift(void 0),new(Function.prototype.bind.apply(e,n))}function i(e){var t,n=new Uint16Array(5);(window.msCrypto||window.crypto).getRandomValues(n);var i="ej2"+N(n),r=function(n){n.source===window&&"string"==typeof n.data&&n.data.length<=32&&n.data===i&&(e(),t())};return window.addEventListener("message",r,!1),window.postMessage(i,"*"),t=function(){window.removeEventListener("message",r)}}function r(e,t){for(var n=t,i=e.split("."),r=0;r<i.length&&!h(n);r++)n=n[i[r]];return n}function s(e,t,n){var i,r,s=e.split("."),a=n||{},o=a,l=s.length;for(i=0;i<l;i++)r=s[i],i+1===l?o[r]=void 0===t?{}:t:d(o[r])&&(o[r]={}),o=o[r];return a}function a(e,t){delete e[t]}function o(e){var t={};return!d(e)&&e.constructor===t.constructor}function l(e,t){return e[t]}function u(e,t){if(!d(t))for(var n=e,i=t,r=Object.keys(t),s=0,a=r;s<a.length;s++){var o=a[s];n[o]=i[o]}}function c(e,t,n,i){var r=e||{},s=arguments.length;i&&(s-=1);for(var a=arguments,l=1;l<s;l++)!function(e){if(!a[e])return"continue";var t=a[e];Object.keys(t).forEach(function(e){var n,s=r[e],a=t[e];i&&o(a)?(n=o(s)?s:{},r[e]=c({},n,a,!0)):r[e]=a})}(l);return r}function d(e){return void 0===e||null===e}function h(e){return void 0===e}function p(e){return e+"_"+C++}function m(e,t){var n,i=this;return function(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];var a=r[0],o=function(){return n=null,e.call(i,a)};clearTimeout(n),n=setTimeout(o,t)}}function v(e){for(var t=[],n=Object.keys(e),i=0,r=n;i<r.length;i++){var s=r[i];t.push(encodeURIComponent(s)+"="+encodeURIComponent(""+e[s]))}return t.join("&")}function f(e){var t=Object.prototype.toString;return"[object Array]"===t.call(e)&&"[object Object]"===t.call(e[0])}function y(e,t){var n=e;return n===t||!(n===document||!n)&&y(n.parentNode,t)}function b(e){try{throw new Error(e)}catch(e){throw e.message+"\n"+e.stack}}function g(e,t){var n=document.createElement("div"),i=[].slice.call(document.getElementsByTagName("head")[0].querySelectorAll("link, style")),r="";d(t)&&(t=window.open("","print","height=452,width=1024,tabbar=no")),n.appendChild(e.cloneNode(!0));for(var s=0,a=i.length;s<a;s++)r+=i[s].outerHTML;t.document.write("<!DOCTYPE html> <html><head>"+r+"</head><body>"+n.innerHTML+"<script> (function() { window.ready = true; })(); <\/script></body></html>"),t.document.close(),t.focus();var o=setInterval(function(){t.ready&&(t.print(),t.close(),clearInterval(o))},500);return t}function E(e){var t=e+"";return"auto"===t||-1!==t.indexOf("%")||-1!==t.indexOf("px")?t:t+"px"}function O(e,t){var n="string"==typeof e?document.querySelector(e):e;if(n[T])for(var i=0,r=n[T];i<r.length;i++){var s=r[i];if(s instanceof t)return s}return null}function L(e,t){var n="string"==typeof e?document.querySelector(e):e;n[T]?n[T].push(t):n[T]=[t]}function N(e){for(var t="",n=0;n<5;n++)t+=(n?",":"")+e[n];return t}Object.defineProperty(t,"__esModule",{value:!0});var T="ej2_instances",C=0;t.createInstance=n,t.setImmediate=i,t.getValue=r,t.setValue=s,t.deleteObject=a,t.isObject=o,t.getEnumValue=l,t.merge=u,t.extend=c,t.isNullOrUndefined=d,t.isUndefined=h,t.getUniqueID=p,t.debounce=m,t.queryParams=v,t.isObjectArray=f,t.compareElementParent=y,t.throwError=b,t.print=g,t.formatUnit=E,t.getInstance=O,t.addInstance=L}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(7)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n)}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(4),n(8)],void 0!==(r=function(e,t,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={RTL:"e-rtl",DISABLE:"e-disabled",INPUT:"e-input",INPUTGROUP:"e-input-group",FLOATINPUT:"e-float-input",FLOATLINE:"e-float-line",FLOATTEXT:"e-float-text",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(e){function t(e){var t={container:null,buttons:[],clearButton:null};if(i.isNullOrUndefined(e.floatLabelType)||"Never"===e.floatLabelType)t.container=d(e,r.INPUTGROUP,r.INPUTCUSTOMTAG,"span"),e.element.parentNode.insertBefore(t.container,e.element),n.addClass([e.element],r.INPUT),t.container.appendChild(e.element);else{var a,c=void 0;"Auto"===e.floatLabelType&&(e.element.addEventListener("focus",function(){var e=l(this).getElementsByClassName("e-float-text")[0];n.addClass([e],r.LABELTOP),e.classList.contains(r.LABELBOTTOM)&&n.removeClass([e],r.LABELBOTTOM)}),e.element.addEventListener("blur",function(){var e=l(this);if(""===e.getElementsByTagName("input")[0].value){var t=e.getElementsByClassName("e-float-text")[0];t.classList.contains(r.LABELTOP)&&n.removeClass([t],r.LABELTOP),n.addClass([t],r.LABELBOTTOM)}})),t.container=d(e,r.FLOATINPUT,r.FLOATCUSTOMTAG,"div"),e.element.parentNode.insertBefore(t.container,e.element),n.attributes(e.element,{required:"true"}),c=n.createElement("span",{className:r.FLOATLINE}),a=n.createElement("label",{className:r.FLOATTEXT}),i.isNullOrUndefined(e.element.id)||""===e.element.id||(a.id="label_"+e.element.id.replace(/ /g,"_"),n.attributes(e.element,{"aria-labelledby":a.id})),i.isNullOrUndefined(e.element.placeholder)||""===e.element.placeholder||(a.innerHTML=e.element.placeholder,e.element.removeAttribute("placeholder")),i.isNullOrUndefined(e.properties)||i.isNullOrUndefined(e.properties.placeholder)||""===e.properties.placeholder||(a.innerHTML=e.properties.placeholder),t.container.appendChild(e.element),t.container.appendChild(c),t.container.appendChild(a),o(e.element.value,a),"Always"===e.floatLabelType&&(a.classList.contains(r.LABELBOTTOM)&&n.removeClass([a],r.LABELBOTTOM),n.addClass([a],r.LABELTOP)),"Auto"===e.floatLabelType&&(e.element.addEventListener("input",function(t){o(e.element.value,a)}),e.element.addEventListener("blur",function(t){o(e.element.value,a)}))}if(e.element.addEventListener("focus",function(){var e=l(this);e.classList.contains("e-input-group")&&e.classList.add("e-input-focus")}),e.element.addEventListener("blur",function(){var e=l(this);e.classList.contains("e-input-group")&&e.classList.remove("e-input-focus")}),i.isNullOrUndefined(e.properties)||i.isNullOrUndefined(e.properties.showClearButton)||!e.properties.showClearButton||(u(e.element,t.container),t.container.classList.contains(r.FLOATINPUT)&&n.addClass([t.container],r.INPUTGROUP)),!i.isNullOrUndefined(e.buttons))for(var h=0;h<e.buttons.length;h++)t.buttons.push(g(e.buttons[h],t.container));return t=s(e,t),E=t,t}function s(e,t){if(!i.isNullOrUndefined(e.properties))for(var n=0,r=Object.keys(e.properties);n<r.length;n++){var s=r[n];switch(s){case"cssClass":h(e.properties.cssClass,[t.container]);break;case"enabled":f(e.properties.enabled,e.element);break;case"enableRtl":v(e.properties.enableRtl,[t.container]);break;case"placeholder":p(e.properties.placeholder,e.element);break;case"readonly":m(e.properties.readonly,e.element)}}return t}function a(e,t){e?n.removeClass([t],r.CLEARICONHIDE):n.addClass([t],r.CLEARICONHIDE)}function o(e,t){e?(n.addClass([t],r.LABELTOP),t.classList.contains(r.LABELBOTTOM)&&n.removeClass([t],r.LABELBOTTOM)):(t.classList.contains(r.LABELTOP)&&n.removeClass([t],r.LABELTOP),n.addClass([t],r.LABELBOTTOM))}function l(e){return e.parentNode}function u(e,t){var s=n.createElement("span",{className:r.CLEARICON});t.appendChild(s),!i.isNullOrUndefined(E.container)&&E.container.classList.contains(r.FLOATINPUT)&&n.addClass([E.container],r.INPUTGROUP),a(e.value,s),c(e,s)}function c(e,t){t.addEventListener("click",function(i){e.classList.contains(r.DISABLE)||e.readOnly||(i.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",n.addClass([t],r.CLEARICONHIDE))}),e.addEventListener("input",function(n){a(e.value,t)}),e.addEventListener("focus",function(n){a(e.value,t)}),e.addEventListener("blur",function(n){a(e.value,t)})}function d(e,t,r,s){var a;return i.isNullOrUndefined(e.customTag)?a=n.createElement(s,{className:t}):(a=n.createElement(e.customTag,{className:t}),a.classList.add(r)),a}function h(e,t,r){i.isNullOrUndefined(r)||""===r||n.removeClass(t,r),i.isNullOrUndefined(e)||""===e||n.addClass(t,e)}function p(e,t){var s;s=l(t),s.classList.contains(r.FLOATINPUT)?i.isNullOrUndefined(e)||""===e||(s.getElementsByClassName(r.FLOATTEXT)[0].textContent=e):i.isNullOrUndefined(e)||""===e?(t.removeAttribute("placeholder"),t.removeAttribute("aria-placeholder")):n.attributes(t,{placeholder:e,"aria-placeholder":e})}function m(e,t){e?n.attributes(t,{readonly:""}):t.removeAttribute("readonly")}function v(e,t){e?n.addClass(t,r.RTL):n.removeClass(t,r.RTL)}function f(e,t){var n={disabled:"disabled","aria-disabled":"true"};e?(t.classList.remove(r.DISABLE),y(n,t)):(t.classList.add(r.DISABLE),b(n,t))}function y(e,t){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n],a=void 0;a=l(t),"disabled"===s&&t.classList.remove(r.DISABLE),"disabled"===s&&a.classList.contains(r.INPUTGROUP)&&a.classList.remove(r.DISABLE),"placeholder"===s&&a.classList.contains(r.FLOATINPUT)?a.getElementsByClassName(r.FLOATTEXT)[0].textContent="":t.removeAttribute(s)}}function b(e,t){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n],a=void 0;a=l(t),"disabled"===s&&t.classList.add(r.DISABLE),"disabled"===s&&a.classList.contains(r.INPUTGROUP)&&a.classList.add(r.DISABLE),"placeholder"===s&&a.classList.contains(r.FLOATINPUT)?a.getElementsByClassName(r.FLOATTEXT)[0].textContent=e[s]:t.setAttribute(s,e[s])}}function g(e,t){var i=n.createElement("span",{className:e});return t.appendChild(i),t.classList.contains(r.INPUTGROUP)||t.classList.add(r.INPUTGROUP),i.addEventListener("mousedown",function(){this.classList.add("e-input-btn-ripple")}),i.addEventListener("mouseup",function(){var e=this;setTimeout(function(){e.classList.remove("e-input-btn-ripple")},500)}),i}var E={container:null,buttons:[],clearButton:null};e.createInput=t,e.setCssClass=h,e.setPlaceholder=p,e.setReadonly=m,e.setEnableRtl=v,e.setEnabled=f,e.removeAttributes=y,e.addAttributes=b,e.appendSpan=g}(t.Input||(t.Input={}))}.apply(t,i))&&(e.exports=r)},function(e,t,n){var i,r;i=[n,t,n(9)],void 0!==(r=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n)}.apply(t,i))&&(e.exports=r)}])});

176

dist/es6/input/input.js

@@ -11,2 +11,6 @@ import { createElement, attributes, addClass, removeClass } from '@syncfusion/ej2-base/dom';

FLOATTEXT: 'e-float-text',
CLEARICON: 'e-clear-icon',
CLEARICONHIDE: 'e-clear-icon-hide',
LABELTOP: 'e-label-top',
LABELBOTTOM: 'e-label-bottom',
INPUTCUSTOMTAG: 'e-input-custom-tag',

@@ -17,21 +21,11 @@ FLOATCUSTOMTAG: 'e-float-custom-tag'

(function (Input) {
var privateInputObj = {
container: null,
buttons: [],
clearButton: null
};
function createInput(args) {
var inputObject = {
container: null,
buttons: []
};
if (isNullOrUndefined(args.isFloat) || !args.isFloat) {
var inputObject = { container: null, buttons: [], clearButton: null };
if (isNullOrUndefined(args.floatLabelType) || args.floatLabelType === 'Never') {
inputObject.container = createInputContainer(args, CLASSNAMES.INPUTGROUP, CLASSNAMES.INPUTCUSTOMTAG, 'span');
args.element.addEventListener('focus', function () {
var parent = (this.parentNode);
if (parent.classList.contains('e-input-group')) {
parent.classList.add('e-input-focus');
}
});
args.element.addEventListener('blur', function () {
var parent = (this.parentNode);
if (parent.classList.contains('e-input-group')) {
parent.classList.remove('e-input-focus');
}
});
args.element.parentNode.insertBefore(inputObject.container, args.element);

@@ -44,13 +38,22 @@ addClass([args.element], CLASSNAMES.INPUT);

var floatLinelement = void 0;
var floatLabelElement = void 0;
args.element.addEventListener('focus', function () {
var parent = (this.parentNode);
parent.getElementsByClassName('e-float-text')[0].classList.add('e-label-top');
});
args.element.addEventListener('blur', function () {
var parent = (this.parentNode);
if (parent.getElementsByTagName('input')[0].value === '') {
parent.getElementsByClassName('e-float-text')[0].classList.remove('e-label-top');
}
});
var floatLabelElement_1;
if (args.floatLabelType === 'Auto') {
args.element.addEventListener('focus', function () {
var label = getParentNode(this).getElementsByClassName('e-float-text')[0];
addClass([label], CLASSNAMES.LABELTOP);
if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) {
removeClass([label], CLASSNAMES.LABELBOTTOM);
}
});
args.element.addEventListener('blur', function () {
var parent = getParentNode(this);
if (parent.getElementsByTagName('input')[0].value === '') {
var label = parent.getElementsByClassName('e-float-text')[0];
if (label.classList.contains(CLASSNAMES.LABELTOP)) {
removeClass([label], CLASSNAMES.LABELTOP);
}
addClass([label], CLASSNAMES.LABELBOTTOM);
}
});
}
inputObject.container = createInputContainer(args, CLASSNAMES.FLOATINPUT, CLASSNAMES.FLOATCUSTOMTAG, 'div');

@@ -60,11 +63,9 @@ args.element.parentNode.insertBefore(inputObject.container, args.element);

floatLinelement = createElement('span', { className: CLASSNAMES.FLOATLINE });
floatLabelElement = createElement('label', { className: CLASSNAMES.FLOATTEXT });
floatLabelElement_1 = createElement('label', { className: CLASSNAMES.FLOATTEXT });
if (!isNullOrUndefined(args.element.id) && args.element.id !== '') {
var labelId = void 0;
labelId = 'label_' + args.element.id;
floatLabelElement.id = labelId.replace(/ /g, '_');
attributes(args.element, { 'aria-labelledby': floatLabelElement.id });
floatLabelElement_1.id = 'label_' + args.element.id.replace(/ /g, '_');
attributes(args.element, { 'aria-labelledby': floatLabelElement_1.id });
}
if (!isNullOrUndefined(args.element.placeholder) && args.element.placeholder !== '') {
floatLabelElement.innerHTML = args.element.placeholder;
floatLabelElement_1.innerHTML = args.element.placeholder;
args.element.removeAttribute('placeholder');

@@ -74,8 +75,41 @@ }

args.properties.placeholder !== '') {
floatLabelElement.innerHTML = args.properties.placeholder;
floatLabelElement_1.innerHTML = args.properties.placeholder;
}
inputObject.container.appendChild(args.element);
inputObject.container.appendChild(floatLinelement);
inputObject.container.appendChild(floatLabelElement);
inputObject.container.appendChild(floatLabelElement_1);
updateLabelState(args.element.value, floatLabelElement_1);
if (args.floatLabelType === 'Always') {
if (floatLabelElement_1.classList.contains(CLASSNAMES.LABELBOTTOM)) {
removeClass([floatLabelElement_1], CLASSNAMES.LABELBOTTOM);
}
addClass([floatLabelElement_1], CLASSNAMES.LABELTOP);
}
if (args.floatLabelType === 'Auto') {
args.element.addEventListener('input', function (event) {
updateLabelState(args.element.value, floatLabelElement_1);
});
args.element.addEventListener('blur', function (event) {
updateLabelState(args.element.value, floatLabelElement_1);
});
}
}
args.element.addEventListener('focus', function () {
var parent = getParentNode(this);
if (parent.classList.contains('e-input-group')) {
parent.classList.add('e-input-focus');
}
});
args.element.addEventListener('blur', function () {
var parent = getParentNode(this);
if (parent.classList.contains('e-input-group')) {
parent.classList.remove('e-input-focus');
}
});
if (!isNullOrUndefined(args.properties) && !isNullOrUndefined(args.properties.showClearButton) && args.properties.showClearButton) {
createClearButton(args.element, inputObject.container);
if (inputObject.container.classList.contains(CLASSNAMES.FLOATINPUT)) {
addClass([inputObject.container], CLASSNAMES.INPUTGROUP);
}
}
if (!isNullOrUndefined(args.buttons)) {

@@ -86,2 +120,8 @@ for (var i = 0; i < args.buttons.length; i++) {

}
inputObject = setPropertyValue(args, inputObject);
privateInputObj = inputObject;
return inputObject;
}
Input.createInput = createInput;
function setPropertyValue(args, inputObject) {
if (!isNullOrUndefined(args.properties)) {

@@ -111,3 +151,59 @@ for (var _i = 0, _a = Object.keys(args.properties); _i < _a.length; _i++) {

}
Input.createInput = createInput;
function updateIconState(value, button) {
if (value) {
removeClass([button], CLASSNAMES.CLEARICONHIDE);
}
else {
addClass([button], CLASSNAMES.CLEARICONHIDE);
}
}
function updateLabelState(value, label) {
if (value) {
addClass([label], CLASSNAMES.LABELTOP);
if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) {
removeClass([label], CLASSNAMES.LABELBOTTOM);
}
}
else {
if (label.classList.contains(CLASSNAMES.LABELTOP)) {
removeClass([label], CLASSNAMES.LABELTOP);
}
addClass([label], CLASSNAMES.LABELBOTTOM);
}
}
function getParentNode(element) {
var parentNode = element.parentNode;
return parentNode;
}
function createClearButton(element, container) {
var button = createElement('span', { className: CLASSNAMES.CLEARICON });
container.appendChild(button);
if (!isNullOrUndefined(privateInputObj.container) &&
privateInputObj.container.classList.contains(CLASSNAMES.FLOATINPUT)) {
addClass([privateInputObj.container], CLASSNAMES.INPUTGROUP);
}
updateIconState(element.value, button);
wireClearBtnEvents(element, button);
}
function wireClearBtnEvents(element, button) {
button.addEventListener('click', function (event) {
if (!(element.classList.contains(CLASSNAMES.DISABLE) || element.readOnly)) {
event.preventDefault();
if (element !== document.activeElement) {
element.focus();
}
element.value = '';
addClass([button], CLASSNAMES.CLEARICONHIDE);
}
});
element.addEventListener('input', function (event) {
updateIconState(element.value, button);
});
element.addEventListener('focus', function (event) {
updateIconState(element.value, button);
});
element.addEventListener('blur', function (event) {
updateIconState(element.value, button);
});
}
function createInputContainer(args, className, tagClass, tag) {

@@ -135,3 +231,3 @@ var container;

var parentElement;
parentElement = element.parentNode;
parentElement = getParentNode(element);
if (parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {

@@ -187,3 +283,3 @@ if (!isNullOrUndefined(placeholder) && placeholder !== '') {

var parentElement = void 0;
parentElement = element.parentNode;
parentElement = getParentNode(element);
if (key === 'disabled') {

@@ -208,3 +304,3 @@ element.classList.remove(CLASSNAMES.DISABLE);

var parentElement = void 0;
parentElement = element.parentNode;
parentElement = getParentNode(element);
if (key === 'disabled') {

@@ -211,0 +307,0 @@ element.classList.add(CLASSNAMES.DISABLE);

@@ -20,3 +20,3 @@ var __extends = (this && this.__extends) || (function () {

import { createElement, attributes, addClass, removeClass, setStyleAttribute, detach } from '@syncfusion/ej2-base/dom';
import { isNullOrUndefined, isUndefined, getValue, setValue, merge } from '@syncfusion/ej2-base/util';
import { isNullOrUndefined, isUndefined, getValue, formatUnit, setValue, merge } from '@syncfusion/ej2-base/util';
import { Internationalization, getNumericObject } from '@syncfusion/ej2-base';

@@ -82,3 +82,8 @@ import { Input } from '../input/input';

}
this.setDimension();
if (!isNullOrUndefined(this.width)) {
setStyleAttribute(this.container, { 'width': formatUnit(this.width) });
}
if (!isNullOrUndefined(this.height)) {
setStyleAttribute(this.container, { 'height': formatUnit(this.height) });
}
this.changeValue(this.value);

@@ -141,2 +146,3 @@ this.wireEvents();

customTag: this.angularTagName,
floatLabelType: this.floatLabelType,
properties: {

@@ -175,6 +181,2 @@ readonly: this.readonly,

};
NumericTextBox.prototype.setDimension = function () {
this.setWidth(this.width);
this.setHeight(this.height);
};
NumericTextBox.prototype.validateMinMax = function () {

@@ -223,10 +225,2 @@ if (!(typeof (this.min) === 'number' && !isNaN(this.min))) {

};
NumericTextBox.prototype.setWidth = function (width) {
var newWidth = width != null ? width : this.container.offsetWidth;
setStyleAttribute(this.container, { 'width': newWidth });
};
NumericTextBox.prototype.setHeight = function (height) {
var newHeight = height != null ? height : this.container.offsetHeight;
setStyleAttribute(this.container, { 'height': newHeight });
};
NumericTextBox.prototype.wireEvents = function () {

@@ -245,2 +239,4 @@ EventHandler.add(this.element, 'focus', this.focusIn, this);

EventHandler.add(this.spinDown, Browser.touchEndEvent, this.mouseUpOnSpinner, this);
EventHandler.add(this.spinUp, Browser.touchMoveEvent, this.touchMoveOnSpinner, this);
EventHandler.add(this.spinDown, Browser.touchMoveEvent, this.touchMoveOnSpinner, this);
};

@@ -260,2 +256,4 @@ NumericTextBox.prototype.unwireEvents = function () {

EventHandler.remove(this.spinDown, Browser.touchEndEvent, this.mouseUpOnSpinner);
EventHandler.remove(this.spinUp, Browser.touchMoveEvent, this.touchMoveOnSpinner);
EventHandler.remove(this.spinDown, Browser.touchMoveEvent, this.touchMoveOnSpinner);
};

@@ -515,2 +513,8 @@ NumericTextBox.prototype.changeHandler = function (event) {

};
NumericTextBox.prototype.touchMoveOnSpinner = function (event) {
var target = document.elementFromPoint(event.clientX, event.clientY);
if (!(target.classList.contains(SPINICON))) {
clearInterval(this.timeOut);
}
};
NumericTextBox.prototype.mouseUpOnSpinner = function (event) {

@@ -580,6 +584,6 @@ if (!Browser.isDevice) {

case 'width':
setStyleAttribute(this.container, { 'width': newProp.width });
setStyleAttribute(this.container, { 'width': formatUnit(newProp.width) });
break;
case 'height':
setStyleAttribute(this.container, { 'height': newProp.height });
setStyleAttribute(this.container, { 'height': formatUnit(newProp.height) });
break;

@@ -713,2 +717,5 @@ case 'cssClass':

__decorate([
Property('Auto')
], NumericTextBox.prototype, "floatLabelType", void 0);
__decorate([
Event()

@@ -715,0 +722,0 @@ ], NumericTextBox.prototype, "created", void 0);

@@ -13,41 +13,13 @@ {

},
"D:\\release\\packages\\node_modules\\@syncfusion\\ej2"
],
[
{
"raw": "@syncfusion/ej2-inputs",
"scope": "@syncfusion",
"escapedName": "@syncfusion%2fej2-inputs",
"name": "@syncfusion/ej2-inputs",
"rawSpec": "",
"spec": "latest",
"type": "tag"
},
"D:\\dev\\typescript\\temp\\npmjsSync"
],
[
{
"raw": "@syncfusion/ej2-inputs@^1.0.0",
"scope": "@syncfusion",
"escapedName": "@syncfusion%2fej2-inputs",
"name": "@syncfusion/ej2-inputs",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"type": "range"
},
"C:\\Users\\ajithr\\Desktop\\npm\\node_modules\\@syncfusion\\ej2"
"C:\\Users\\ajithr\\Desktop\\ej2-release\\node_modules\\@syncfusion\\ej2"
]
],
"_from": "@syncfusion/ej2-inputs@^1.0.0",
"_id": "@syncfusion/ej2-inputs@1.0.5",
"_from": "@syncfusion/ej2-inputs@*",
"_id": "@syncfusion/ej2-inputs@1.0.10",
"_inCache": true,
"_location": "/@syncfusion/ej2-inputs",
"_nodeVersion": "6.10.2",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/ej2-inputs-1.0.5.tgz_1494508058668_0.2852849105838686"
},
"_nodeVersion": "6.11.0",
"_npmUser": {
"name": "ajithr11",
"email": "ajithr@syncfusion.com"
"name": "ej2",
"email": "pipeline@syncfusion.com"
},

@@ -57,8 +29,8 @@ "_npmVersion": "3.10.10",

"_requested": {
"raw": "@syncfusion/ej2-inputs@^1.0.0",
"raw": "@syncfusion/ej2-inputs@*",
"scope": "@syncfusion",
"escapedName": "@syncfusion%2fej2-inputs",
"name": "@syncfusion/ej2-inputs",
"rawSpec": "^1.0.0",
"spec": ">=1.0.0 <2.0.0",
"rawSpec": "*",
"spec": "*",
"type": "range"

@@ -68,10 +40,9 @@ },

"/@syncfusion/ej2",
"/@syncfusion/ej2-calendars",
"/@syncfusion/ej2-ng-inputs"
],
"_resolved": "https://registry.npmjs.org/@syncfusion/ej2-inputs/-/ej2-inputs-1.0.5.tgz",
"_shasum": "ee546987806f8534661348f8e4f1d4f35df2bab7",
"_resolved": "http://syncdeskn6525:8081/repository/ej2-production/@syncfusion/ej2-inputs/-/ej2-inputs-1.0.10.tgz",
"_shasum": "cb28ee246883845af6913a5ed93f61fdbdf95b0f",
"_shrinkwrap": null,
"_spec": "@syncfusion/ej2-inputs@^1.0.0",
"_where": "C:\\Users\\ajithr\\Desktop\\npm\\node_modules\\@syncfusion\\ej2",
"_spec": "@syncfusion/ej2-inputs@*",
"_where": "C:\\Users\\ajithr\\Desktop\\ej2-release\\node_modules\\@syncfusion\\ej2",
"author": {

@@ -83,16 +54,8 @@ "name": "Syncfusion Inc."

},
"config": {
"ghooks": {
"pre-commit": "gulp pre-commit",
"pre-push": "gulp pre-push",
"commit-msg": "gulp commit-msg"
}
},
"dependencies": {
"@syncfusion/ej2-base": "^1.0.0"
"@syncfusion/ej2-base": "^1.0.10"
},
"description": "Syncfusion TypeScript TextBoxes",
"description": "Essential JS 2 TextBoxes",
"devDependencies": {
"@types/chai": "^3.4.28",
"@types/es6-promise": "0.0.28",
"@types/jasmine": "^2.2.29",

@@ -102,8 +65,7 @@ "@types/jasmine-ajax": "^3.1.27",

},
"directories": {},
"dist": {
"shasum": "ee546987806f8534661348f8e4f1d4f35df2bab7",
"tarball": "https://registry.npmjs.org/@syncfusion/ej2-inputs/-/ej2-inputs-1.0.5.tgz"
"shasum": "cb28ee246883845af6913a5ed93f61fdbdf95b0f",
"tarball": "http://syncdeskn6525:8081/repository/ej2-production/@syncfusion/ej2-inputs/-/ej2-inputs-1.0.10.tgz"
},
"gitHead": "e6de16e54d55f9c720e777cda45b7485d49db0b1",
"gitHead": "9119135359ab2cfe5f25fc18be4cd52fdc86a094",
"homepage": "https://github.com/syncfusion/ej2-inputs#readme",

@@ -115,6 +77,20 @@ "keywords": [

"input",
"input box",
"textbox",
"form control",
"textbox html",
"text area",
"essential js 2 textbox",
"floating input",
"floating label",
"ej2-numeric",
"numeric",
"numerictext",
"numerictextbox"
"spinner",
"numeric textbox",
"percent textbox",
"currency textbox",
"spin buttons",
"numeric updown",
"number formatting",
"number input"
],

@@ -124,8 +100,4 @@ "license": "SEE LICENSE IN license",

{
"name": "ajithr11",
"email": "ajithr@syncfusion.com"
},
{
"name": "syncfusionorg",
"email": "npmjs@syncfusion.com"
"name": "ej2",
"email": "pipeline@syncfusion.com"
}

@@ -136,3 +108,4 @@ ],

"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"readme": "A package of Essential JS 2 Input textbox components. It comes with full support and is available under commercial and community licenses – please visit www.syncfusion.com to get started.\n\n## Resources\n* [NumericTextBoxes Demos](http://ej2.syncfusion.com/demos/#/numerictextbox/default.html)\n* [TextBox Demos](http://ej2.syncfusion.com/demos/#/textboxes/default.html)\n\n# 1.0.10\n## Numeric TextBox\n### New Features\n-\tProvided floating label support for Numeric TextBox.\n\n### Bug Fixes\n- Fixed-Numeric value get incremented when tap on the spinner and swipe the document.\n\n## TextBox\n### New Features\n* Provided floating label support for textarea element.\n* Provided option to show/hide clear button to reset the value in input element.\n* Added option to float label always, float label on focus, and disable floating support in the input element.\n",
"readmeFilename": "ReadMe.md",
"repository": {

@@ -147,3 +120,3 @@ "type": "git",

},
"version": "1.0.8"
}
"version": "1.0.10"
}
/**
* Defines floating label type of the input and decides how the label should float on the input.
*/
export declare type FloatLabelType = 'Never' | 'Always' | 'Auto';
/**
* Base for Input creation through util methods.

@@ -8,3 +12,3 @@ */

* ```
* E.g : Input.createInput({ element: element, isFloat: true, properties: { placeholder: 'Search' } });
* E.g : Input.createInput({ element: element, floatLabelType : "Auto", properties: { placeholder: 'Search' } });
* ```

@@ -106,2 +110,3 @@ * @param args

buttons?: HTMLElement[];
clearButton?: HTMLElement;
}

@@ -135,7 +140,11 @@ /**

* ```
* E.g : Input.createInput({ element: element, isFloat: true });
* E.g : Input.createInput({ element: element, floatLabelType : "Always" });
* ```
* Sets to enable input with floating label feature.
* Specifies how the floating label works.
* Possible values are:
* * Never - Never float the label in the input when the placeholder is available.
* * Always - The floating label will always float above the input.
* * Auto - The floating label will float above the input after focusing or entering a value in the input.
*/
isFloat?: boolean;
floatLabelType?: FloatLabelType;
/**

@@ -153,2 +162,3 @@ * ```

enabled?: boolean;
showClearButton?: boolean;
};

@@ -171,3 +181,3 @@ }

*/
enabled: boolean;
enabled?: boolean;
/**

@@ -182,2 +192,14 @@ * Sets the readonly value to input.

/**
* Specifies whether to display the Clear button in the input.
*/
showClearButton?: boolean;
/**
* Specifies how the floating label works.
* Possible values are:
* * Never - Never float the label in the input when the placeholder is available.
* * Always - The floating label will always float above the input.
* * Auto - The floating label will float above the input after focusing or entering a value in the input.
*/
floatLabelType?: FloatLabelType;
/**
* Sets the change event mapping function to input.

@@ -184,0 +206,0 @@ */

@@ -12,2 +12,6 @@ define(["require", "exports", "@syncfusion/ej2-base/dom", "@syncfusion/ej2-base/util"], function (require, exports, dom_1, util_1) {

FLOATTEXT: 'e-float-text',
CLEARICON: 'e-clear-icon',
CLEARICONHIDE: 'e-clear-icon-hide',
LABELTOP: 'e-label-top',
LABELBOTTOM: 'e-label-bottom',
INPUTCUSTOMTAG: 'e-input-custom-tag',

@@ -18,21 +22,11 @@ FLOATCUSTOMTAG: 'e-float-custom-tag'

(function (Input) {
var privateInputObj = {
container: null,
buttons: [],
clearButton: null
};
function createInput(args) {
var inputObject = {
container: null,
buttons: []
};
if (util_1.isNullOrUndefined(args.isFloat) || !args.isFloat) {
var inputObject = { container: null, buttons: [], clearButton: null };
if (util_1.isNullOrUndefined(args.floatLabelType) || args.floatLabelType === 'Never') {
inputObject.container = createInputContainer(args, CLASSNAMES.INPUTGROUP, CLASSNAMES.INPUTCUSTOMTAG, 'span');
args.element.addEventListener('focus', function () {
var parent = (this.parentNode);
if (parent.classList.contains('e-input-group')) {
parent.classList.add('e-input-focus');
}
});
args.element.addEventListener('blur', function () {
var parent = (this.parentNode);
if (parent.classList.contains('e-input-group')) {
parent.classList.remove('e-input-focus');
}
});
args.element.parentNode.insertBefore(inputObject.container, args.element);

@@ -45,13 +39,22 @@ dom_1.addClass([args.element], CLASSNAMES.INPUT);

var floatLinelement = void 0;
var floatLabelElement = void 0;
args.element.addEventListener('focus', function () {
var parent = (this.parentNode);
parent.getElementsByClassName('e-float-text')[0].classList.add('e-label-top');
});
args.element.addEventListener('blur', function () {
var parent = (this.parentNode);
if (parent.getElementsByTagName('input')[0].value === '') {
parent.getElementsByClassName('e-float-text')[0].classList.remove('e-label-top');
}
});
var floatLabelElement_1;
if (args.floatLabelType === 'Auto') {
args.element.addEventListener('focus', function () {
var label = getParentNode(this).getElementsByClassName('e-float-text')[0];
dom_1.addClass([label], CLASSNAMES.LABELTOP);
if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) {
dom_1.removeClass([label], CLASSNAMES.LABELBOTTOM);
}
});
args.element.addEventListener('blur', function () {
var parent = getParentNode(this);
if (parent.getElementsByTagName('input')[0].value === '') {
var label = parent.getElementsByClassName('e-float-text')[0];
if (label.classList.contains(CLASSNAMES.LABELTOP)) {
dom_1.removeClass([label], CLASSNAMES.LABELTOP);
}
dom_1.addClass([label], CLASSNAMES.LABELBOTTOM);
}
});
}
inputObject.container = createInputContainer(args, CLASSNAMES.FLOATINPUT, CLASSNAMES.FLOATCUSTOMTAG, 'div');

@@ -61,11 +64,9 @@ args.element.parentNode.insertBefore(inputObject.container, args.element);

floatLinelement = dom_1.createElement('span', { className: CLASSNAMES.FLOATLINE });
floatLabelElement = dom_1.createElement('label', { className: CLASSNAMES.FLOATTEXT });
floatLabelElement_1 = dom_1.createElement('label', { className: CLASSNAMES.FLOATTEXT });
if (!util_1.isNullOrUndefined(args.element.id) && args.element.id !== '') {
var labelId = void 0;
labelId = 'label_' + args.element.id;
floatLabelElement.id = labelId.replace(/ /g, '_');
dom_1.attributes(args.element, { 'aria-labelledby': floatLabelElement.id });
floatLabelElement_1.id = 'label_' + args.element.id.replace(/ /g, '_');
dom_1.attributes(args.element, { 'aria-labelledby': floatLabelElement_1.id });
}
if (!util_1.isNullOrUndefined(args.element.placeholder) && args.element.placeholder !== '') {
floatLabelElement.innerHTML = args.element.placeholder;
floatLabelElement_1.innerHTML = args.element.placeholder;
args.element.removeAttribute('placeholder');

@@ -75,8 +76,41 @@ }

args.properties.placeholder !== '') {
floatLabelElement.innerHTML = args.properties.placeholder;
floatLabelElement_1.innerHTML = args.properties.placeholder;
}
inputObject.container.appendChild(args.element);
inputObject.container.appendChild(floatLinelement);
inputObject.container.appendChild(floatLabelElement);
inputObject.container.appendChild(floatLabelElement_1);
updateLabelState(args.element.value, floatLabelElement_1);
if (args.floatLabelType === 'Always') {
if (floatLabelElement_1.classList.contains(CLASSNAMES.LABELBOTTOM)) {
dom_1.removeClass([floatLabelElement_1], CLASSNAMES.LABELBOTTOM);
}
dom_1.addClass([floatLabelElement_1], CLASSNAMES.LABELTOP);
}
if (args.floatLabelType === 'Auto') {
args.element.addEventListener('input', function (event) {
updateLabelState(args.element.value, floatLabelElement_1);
});
args.element.addEventListener('blur', function (event) {
updateLabelState(args.element.value, floatLabelElement_1);
});
}
}
args.element.addEventListener('focus', function () {
var parent = getParentNode(this);
if (parent.classList.contains('e-input-group')) {
parent.classList.add('e-input-focus');
}
});
args.element.addEventListener('blur', function () {
var parent = getParentNode(this);
if (parent.classList.contains('e-input-group')) {
parent.classList.remove('e-input-focus');
}
});
if (!util_1.isNullOrUndefined(args.properties) && !util_1.isNullOrUndefined(args.properties.showClearButton) && args.properties.showClearButton) {
createClearButton(args.element, inputObject.container);
if (inputObject.container.classList.contains(CLASSNAMES.FLOATINPUT)) {
dom_1.addClass([inputObject.container], CLASSNAMES.INPUTGROUP);
}
}
if (!util_1.isNullOrUndefined(args.buttons)) {

@@ -87,2 +121,8 @@ for (var i = 0; i < args.buttons.length; i++) {

}
inputObject = setPropertyValue(args, inputObject);
privateInputObj = inputObject;
return inputObject;
}
Input.createInput = createInput;
function setPropertyValue(args, inputObject) {
if (!util_1.isNullOrUndefined(args.properties)) {

@@ -112,3 +152,59 @@ for (var _i = 0, _a = Object.keys(args.properties); _i < _a.length; _i++) {

}
Input.createInput = createInput;
function updateIconState(value, button) {
if (value) {
dom_1.removeClass([button], CLASSNAMES.CLEARICONHIDE);
}
else {
dom_1.addClass([button], CLASSNAMES.CLEARICONHIDE);
}
}
function updateLabelState(value, label) {
if (value) {
dom_1.addClass([label], CLASSNAMES.LABELTOP);
if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) {
dom_1.removeClass([label], CLASSNAMES.LABELBOTTOM);
}
}
else {
if (label.classList.contains(CLASSNAMES.LABELTOP)) {
dom_1.removeClass([label], CLASSNAMES.LABELTOP);
}
dom_1.addClass([label], CLASSNAMES.LABELBOTTOM);
}
}
function getParentNode(element) {
var parentNode = element.parentNode;
return parentNode;
}
function createClearButton(element, container) {
var button = dom_1.createElement('span', { className: CLASSNAMES.CLEARICON });
container.appendChild(button);
if (!util_1.isNullOrUndefined(privateInputObj.container) &&
privateInputObj.container.classList.contains(CLASSNAMES.FLOATINPUT)) {
dom_1.addClass([privateInputObj.container], CLASSNAMES.INPUTGROUP);
}
updateIconState(element.value, button);
wireClearBtnEvents(element, button);
}
function wireClearBtnEvents(element, button) {
button.addEventListener('click', function (event) {
if (!(element.classList.contains(CLASSNAMES.DISABLE) || element.readOnly)) {
event.preventDefault();
if (element !== document.activeElement) {
element.focus();
}
element.value = '';
dom_1.addClass([button], CLASSNAMES.CLEARICONHIDE);
}
});
element.addEventListener('input', function (event) {
updateIconState(element.value, button);
});
element.addEventListener('focus', function (event) {
updateIconState(element.value, button);
});
element.addEventListener('blur', function (event) {
updateIconState(element.value, button);
});
}
function createInputContainer(args, className, tagClass, tag) {

@@ -136,3 +232,3 @@ var container;

var parentElement;
parentElement = element.parentNode;
parentElement = getParentNode(element);
if (parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) {

@@ -188,3 +284,3 @@ if (!util_1.isNullOrUndefined(placeholder) && placeholder !== '') {

var parentElement = void 0;
parentElement = element.parentNode;
parentElement = getParentNode(element);
if (key === 'disabled') {

@@ -209,3 +305,3 @@ element.classList.remove(CLASSNAMES.DISABLE);

var parentElement = void 0;
parentElement = element.parentNode;
parentElement = getParentNode(element);
if (key === 'disabled') {

@@ -212,0 +308,0 @@ element.classList.add(CLASSNAMES.DISABLE);

import{NumericTextBox} from "./numerictextbox";
import{ FloatLabelType} from "../input/input";

@@ -49,2 +50,11 @@ export interface NumericTextBoxHelper {

/**
* Specifies a value that indicates floating label functionality.
Specifies how the floating label works.
Possible values are:
* Never - Never floats the label in the numeric textbox when the placeholder is available.
* Always - The floating label will always float above the numeric textbox.
* Auto - The floating label will float above the numeric textbox after focusing or entering a value in the numeric textbox.
*/
floatLabelType(value:FloatLabelType): BuilderProperties;
/**
* Specifies the number format that indicates the display format for the value of the numeric textbox.

@@ -59,3 +69,3 @@ */

/**
* Overrides the global culture and localization value for this component.
* Overrides the global culture and localization value for this component. Default Global culture is 'en-US'
*/

@@ -62,0 +72,0 @@ locale(value:string): BuilderProperties;

@@ -1,2 +0,2 @@

import { Component, EventHandler, Property, Event, Browser, CreateBuilder, L10n, EmitType } from '@syncfusion/ej2-base'; import { NotifyPropertyChanges, INotifyPropertyChanged, BaseEventArgs } from '@syncfusion/ej2-base'; import { createElement, attributes, addClass, removeClass, setStyleAttribute, detach } from '@syncfusion/ej2-base/dom'; import { isNullOrUndefined , isUndefined, getValue , setValue, merge} from '@syncfusion/ej2-base/util'; import { Internationalization , NumberFormatOptions, getNumericObject} from '@syncfusion/ej2-base'; import { NumericTextBoxHelper } from './numerictextbox-builder'; import { Input, InputObject } from '../input/input';
import { Component, EventHandler, Property, Event, Browser, CreateBuilder, L10n, EmitType } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, BaseEventArgs } from '@syncfusion/ej2-base';import { createElement, attributes, addClass, removeClass, setStyleAttribute, detach } from '@syncfusion/ej2-base/dom';import { isNullOrUndefined, isUndefined, getValue, formatUnit, setValue, merge} from '@syncfusion/ej2-base/util';import { Internationalization , NumberFormatOptions, getNumericObject} from '@syncfusion/ej2-base';import { NumericTextBoxHelper } from './numerictextbox-builder';import { Input, InputObject, FloatLabelType } from '../input/input';
import {ChangeEventArgs} from "./numerictextbox";

@@ -11,61 +11,64 @@ import {ComponentModel} from '@syncfusion/ej2-base';

/**
* Specifies the root CSS class name to be added in the text boxes which allow you to customize the appearance. * @default null */ cssClass?: string;
* Specifies the root CSS class name to be added in the text boxes which allow you to customize the appearance. * @default null */ cssClass?: string;
/**
* Specifies the value of the numeric textbox. * @default null */ value?: number;
* Specifies the value of the numeric textbox. * @default null */ value?: number;
/**
* Specifies a minimum value that is allowed a user can enter. * @default null */ min?: number;
* Specifies a minimum value that is allowed a user can enter. * @default null */ min?: number;
/**
* Specifies a maximum value that is allowed a user can enter. * @default null */ max?: number;
* Specifies a maximum value that is allowed a user can enter. * @default null */ max?: number;
/**
* Specifies the incremental or decremental step size for the numeric textbox. * @default 1 */ step?: number;
* Specifies the incremental or decremental step size for the numeric textbox. * @default 1 */ step?: number;
/**
* Specifies the width of the numeric textbox. * @default null */ width?: number | string;
* Specifies the width of the numeric textbox. * @default null */ width?: number | string;
/**
* Specifies the height of the numeric textbox. * @default null */ height?: number | string;
* Specifies the height of the numeric textbox. * @default null */ height?: number | string;
/**
* The hint displayed by the numeric textbox when it is empty. * @default null */ placeholder?: string;
* The hint displayed by the numeric textbox when it is empty. * @default null */ placeholder?: string;
/**
* Specifies whether the up and down spin buttons should be displayed in numeric textbox. * @default true */ showSpinButton?: boolean;
* Specifies whether the up and down spin buttons should be displayed in numeric textbox. * @default true */ showSpinButton?: boolean;
/**
* Toggles the readonly state of the numeric textbox. When the numeric is readonly, it does not allow user interactions. * @default false */ readonly?: boolean;
* Toggles the readonly state of the numeric textbox. When the numeric is readonly, it does not allow user interactions. * @default false */ readonly?: boolean;
/**
* Specifies a value that indicates whether the numeric textbox control is enabled or not. * @default true */ enabled?: boolean;
* Specifies a value that indicates whether the numeric textbox control is enabled or not. * @default true */ enabled?: boolean;
/**
* Specifies the right to left direction to numeric textbox. * @default false */ enableRtl?: boolean;
* Specifies the right to left direction to numeric textbox. * @default false */ enableRtl?: boolean;
/**
* Specifies the number format that indicates the display format for the value of the numeric textbox. * @default 'n2' */ format?: string;
* Specifies the number format that indicates the display format for the value of the numeric textbox. * @default 'n2' */ format?: string;
/**
* Specifies the number precision applied to the textbox value when the numeric textbox is focused. * @default null */ decimals?: number;
* Specifies the number precision applied to the textbox value when the numeric textbox is focused. * @default null */ decimals?: number;
/**
* Specifies the currency code to use in currency formatting. * Possible values are the ISO 4217 currency codes, such as 'USD' for the US dollar,'EUR' for the euro. * @default null */ currency?: string;
* Specifies the currency code to use in currency formatting. * Possible values are the ISO 4217 currency codes, such as 'USD' for the US dollar,'EUR' for the euro. * @default null */ currency?: string;
/**
* Specifies a value that indicates whether the numeric textbox control allows the value for the specified range. * If it is false, it allows the value outside of the range, but it highlights the textbox with error class. * Otherwise it is internally changed to the correct appropriate value. * @default true */ strictMode?: boolean;
* Specifies a value that indicates whether the numeric textbox control allows the value for the specified range. * If it is false, it allows the value outside of the range, but it highlights the textbox with error class. * Otherwise it is internally changed to the correct appropriate value. * @default true */ strictMode?: boolean;
/**
* Specifies whether the decimals length should be restricted during typing. * @default false */ validateDecimalOnType?: boolean;
* Specifies whether the decimals length should be restricted during typing. * @default false */ validateDecimalOnType?: boolean;
/**
* Specifies the callback function for create event and it triggers after the numeric textbox control is created successfully. * @event */ created?: EmitType<Object>;
* Specifies a value that indicates floating label functionality. * Specifies how the floating label works. * Possible values are: * * Never - Never floats the label in the numeric textbox when the placeholder is available. * * Always - The floating label will always float above the numeric textbox. * * Auto - The floating label will float above the numeric textbox after focusing or entering a value in the numeric textbox. */ floatLabelType?: FloatLabelType;
/**
* Specifies the callback function for destroy event and it triggers when the numeric textbox control is destroyed successfully. * @event */ destroyed?: EmitType<Object>;
* Specifies the callback function for create event and it triggers after the numeric textbox control is created successfully. * @event */ created?: EmitType<Object>;
/**
* Specifies the callback function for change event and it triggers after the textbox value is changed. * @event */ change?: EmitType<ChangeEventArgs>;
* Specifies the callback function for destroy event and it triggers when the numeric textbox control is destroyed successfully. * @event */ destroyed?: EmitType<Object>;
/**
* Specifies the callback function for change event and it triggers after the textbox value is changed. * @event */ change?: EmitType<ChangeEventArgs>;
}

@@ -5,2 +5,3 @@ import { Component, EmitType } from '@syncfusion/ej2-base';

import { NumericTextBoxHelper } from './numerictextbox-builder';
import { FloatLabelType } from '../input/input';
/**

@@ -125,2 +126,11 @@ * Represents the NumericTextBox component that allows the user to enter only numeric values.

/**
* Specifies a value that indicates floating label functionality.
* Specifies how the floating label works.
* Possible values are:
* * Never - Never floats the label in the numeric textbox when the placeholder is available.
* * Always - The floating label will always float above the numeric textbox.
* * Auto - The floating label will float above the numeric textbox after focusing or entering a value in the numeric textbox.
*/
floatLabelType: FloatLabelType;
/**
* Specifies the callback function for create event and it triggers after the numeric textbox control is created successfully.

@@ -153,3 +163,2 @@ * @event

private spinBtnCreation();
private setDimension();
private validateMinMax();

@@ -160,4 +169,2 @@ private formattedValue(decimals, value);

private checkErrorClass();
private setWidth(width);
private setHeight(height);
private wireEvents();

@@ -188,2 +195,3 @@ private wireSpinBtnEvents();

private mouseDownOnSpinner(event);
private touchMoveOnSpinner(event);
private mouseUpOnSpinner(event);

@@ -190,0 +198,0 @@ private getElementData(event);

@@ -78,3 +78,8 @@ var __extends = (this && this.__extends) || (function () {

}
this.setDimension();
if (!util_1.isNullOrUndefined(this.width)) {
dom_1.setStyleAttribute(this.container, { 'width': util_1.formatUnit(this.width) });
}
if (!util_1.isNullOrUndefined(this.height)) {
dom_1.setStyleAttribute(this.container, { 'height': util_1.formatUnit(this.height) });
}
this.changeValue(this.value);

@@ -137,2 +142,3 @@ this.wireEvents();

customTag: this.angularTagName,
floatLabelType: this.floatLabelType,
properties: {

@@ -171,6 +177,2 @@ readonly: this.readonly,

};
NumericTextBox.prototype.setDimension = function () {
this.setWidth(this.width);
this.setHeight(this.height);
};
NumericTextBox.prototype.validateMinMax = function () {

@@ -219,10 +221,2 @@ if (!(typeof (this.min) === 'number' && !isNaN(this.min))) {

};
NumericTextBox.prototype.setWidth = function (width) {
var newWidth = width != null ? width : this.container.offsetWidth;
dom_1.setStyleAttribute(this.container, { 'width': newWidth });
};
NumericTextBox.prototype.setHeight = function (height) {
var newHeight = height != null ? height : this.container.offsetHeight;
dom_1.setStyleAttribute(this.container, { 'height': newHeight });
};
NumericTextBox.prototype.wireEvents = function () {

@@ -241,2 +235,4 @@ ej2_base_1.EventHandler.add(this.element, 'focus', this.focusIn, this);

ej2_base_1.EventHandler.add(this.spinDown, ej2_base_1.Browser.touchEndEvent, this.mouseUpOnSpinner, this);
ej2_base_1.EventHandler.add(this.spinUp, ej2_base_1.Browser.touchMoveEvent, this.touchMoveOnSpinner, this);
ej2_base_1.EventHandler.add(this.spinDown, ej2_base_1.Browser.touchMoveEvent, this.touchMoveOnSpinner, this);
};

@@ -256,2 +252,4 @@ NumericTextBox.prototype.unwireEvents = function () {

ej2_base_1.EventHandler.remove(this.spinDown, ej2_base_1.Browser.touchEndEvent, this.mouseUpOnSpinner);
ej2_base_1.EventHandler.remove(this.spinUp, ej2_base_1.Browser.touchMoveEvent, this.touchMoveOnSpinner);
ej2_base_1.EventHandler.remove(this.spinDown, ej2_base_1.Browser.touchMoveEvent, this.touchMoveOnSpinner);
};

@@ -511,2 +509,8 @@ NumericTextBox.prototype.changeHandler = function (event) {

};
NumericTextBox.prototype.touchMoveOnSpinner = function (event) {
var target = document.elementFromPoint(event.clientX, event.clientY);
if (!(target.classList.contains(SPINICON))) {
clearInterval(this.timeOut);
}
};
NumericTextBox.prototype.mouseUpOnSpinner = function (event) {

@@ -576,6 +580,6 @@ if (!ej2_base_1.Browser.isDevice) {

case 'width':
dom_1.setStyleAttribute(this.container, { 'width': newProp.width });
dom_1.setStyleAttribute(this.container, { 'width': util_1.formatUnit(newProp.width) });
break;
case 'height':
dom_1.setStyleAttribute(this.container, { 'height': newProp.height });
dom_1.setStyleAttribute(this.container, { 'height': util_1.formatUnit(newProp.height) });
break;

@@ -709,2 +713,5 @@ case 'cssClass':

__decorate([
ej2_base_1.Property('Auto')
], NumericTextBox.prototype, "floatLabelType", void 0);
__decorate([
ej2_base_1.Event()

@@ -711,0 +718,0 @@ ], NumericTextBox.prototype, "created", void 0);

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc