@syncfusion/ej2-inputs
Advanced tools
Comparing version 1.0.11 to 1.0.14
/*! | ||
* filename: ej2-inputs.umd.min.js | ||
* version : 1.0.10 | ||
* version : 1.0.14 | ||
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. | ||
@@ -11,2 +11,2 @@ * Use of this code is subject to the terms of our license. | ||
!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.isPrevFocused=!1,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"),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.isPrevFocused||this.element.setSelectionRange(0,t.length)}n.Browser.isDevice||n.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},t.prototype.focusOut=function(e){if(this.isPrevFocused){if(e.preventDefault(),n.Browser.isDevice){var t=this.element.value;this.element.focus(),this.isPrevFocused=!1;var i=this.element;setTimeout(function(){i.value=t},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var r=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(r),n.Browser.isDevice||n.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}},t.prototype.mouseDownOnSpinner=function(e){var t=this;if(this.isFocused&&(this.isPrevFocused=!0),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(this.isPrevFocused&&(this.element.focus(),n.Browser.isDevice||(this.isPrevFocused=!1)),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(!1)],h.prototype,"enablePersistence",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 v(e,t){return void 0===t&&(t=document),t.querySelector(e)}function m(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(L(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 L(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=v,t.selectAll=m,t.closest=f,t.siblings=y,t.getAttributeOrDefault=b,t.setStyleAttribute=g,t.classList=E,t.matches=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});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"+T(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+"_"+A++}function v(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 m(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 L(e,t){var n="string"==typeof e?document.querySelector(e):e;if(n[N])for(var i=0,r=n[N];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[N]?n[N].push(t):n[N]=[t]}function T(e){for(var t="",n=0;n<5;n++)t+=(n?",":"")+e[n];return t}Object.defineProperty(t,"__esModule",{value:!0});var N="ej2_instances",A=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=v,t.queryParams=m,t.isObjectArray=f,t.compareElementParent=y,t.throwError=b,t.print=g,t.formatUnit=E,t.getInstance=L,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",CLEARICON:"e-clear-icon",CLEARICONHIDE:"e-clear-icon-hide",LABELTOP:"e-label-top",LABELBOTTOM:"e-label-bottom",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(e){function t(e){var t={container:null,buttons:[],clearButton:null};if(i.isNullOrUndefined(e.floatLabelType)||"Never"===e.floatLabelType?(t.container=f(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)):u(e,t),e.element.addEventListener("focus",function(){var e=p(this);e.classList.contains("e-input-group")&&e.classList.add("e-input-focus")}),e.element.addEventListener("blur",function(){var e=p(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||(t.clearButton=v(e.element,t.container),t.container.classList.contains(r.FLOATINPUT)&&n.addClass([t.container],r.INPUTGROUP)),!i.isNullOrUndefined(e.buttons))for(var s=0;s<e.buttons.length;s++)t.buttons.push(P(e.buttons[s],t.container));return t=c(e,t),C=t,t}function s(){var e=p(this).getElementsByClassName("e-float-text")[0];n.addClass([e],r.LABELTOP),e.classList.contains(r.LABELBOTTOM)&&n.removeClass([e],r.LABELBOTTOM)}function a(){var e=p(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)}}function o(e){e.addEventListener("focus",s),e.addEventListener("blur",a)}function l(e){e.removeEventListener("focus",s),e.removeEventListener("blur",a)}function u(e,t){var s,a;"Auto"===e.floatLabelType&&o(e.element),i.isNullOrUndefined(t.container)?(t.container=f(e,r.FLOATINPUT,r.FLOATCUSTOMTAG,"div"),e.element.parentNode.insertBefore(t.container,e.element)):(i.isNullOrUndefined(e.customTag)||t.container.classList.add(r.FLOATCUSTOMTAG),t.container.classList.add(r.FLOATINPUT)),n.attributes(e.element,{required:""}),s=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),a.innerHTML||t.container.classList.add(r.NOFLOATLABEL),t.container.appendChild(e.element),t.container.appendChild(s),t.container.appendChild(a),h(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){h(e.element.value,a)}),e.element.addEventListener("blur",function(t){h(e.element.value,a)}))}function c(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":y(e.properties.cssClass,[t.container]);break;case"enabled":L(e.properties.enabled,e.element);break;case"enableRtl":E(e.properties.enableRtl,[t.container]);break;case"placeholder":b(e.properties.placeholder,e.element);break;case"readonly":g(e.properties.readonly,e.element)}}return t}function d(e,t){e?n.removeClass([t],r.CLEARICONHIDE):n.addClass([t],r.CLEARICONHIDE)}function h(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 p(e){return e.parentNode}function v(e,t){var s=n.createElement("span",{className:r.CLEARICON});return t.appendChild(s),!i.isNullOrUndefined(C.container)&&C.container.classList.contains(r.FLOATINPUT)&&n.addClass([C.container],r.INPUTGROUP),d(e.value,s),m(e,s),s}function m(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){d(e.value,t)}),e.addEventListener("focus",function(n){d(e.value,t)}),e.addEventListener("blur",function(n){d(e.value,t)})}function f(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 y(e,t,r){i.isNullOrUndefined(r)||""===r||n.removeClass(t,r),i.isNullOrUndefined(e)||""===e||n.addClass(t,e)}function b(e,t){var s;s=p(t),s.classList.contains(r.FLOATINPUT)?i.isNullOrUndefined(e)||""===e?(s.classList.add(r.NOFLOATLABEL),s.getElementsByClassName(r.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName(r.FLOATTEXT)[0].textContent=e,s.classList.remove(r.NOFLOATLABEL)):i.isNullOrUndefined(e)||""===e?(t.removeAttribute("placeholder"),t.removeAttribute("aria-placeholder")):n.attributes(t,{placeholder:e,"aria-placeholder":e})}function g(e,t){e?n.attributes(t,{readonly:""}):t.removeAttribute("readonly")}function E(e,t){e?n.addClass(t,r.RTL):n.removeClass(t,r.RTL)}function L(e,t){var n={disabled:"disabled","aria-disabled":"true"};e?(t.classList.remove(r.DISABLE),O(n,t)):(t.classList.add(r.DISABLE),T(n,t))}function O(e,t){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n],a=void 0;a=p(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 T(e,t){for(var n=0,i=Object.keys(e);n<i.length;n++){var s=i[n],a=void 0;a=p(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 N(e){var t=e.container;if(!i.isNullOrUndefined(t)&&t.classList.contains(r.FLOATINPUT)){var s=t.querySelector("input");n.detach(t.querySelector("."+r.FLOATLINE)),n.detach(t.querySelector("."+r.FLOATTEXT)),n.classList(t,[r.INPUTGROUP],[r.FLOATINPUT]),l(s),s.classList.add(r.INPUT),s.removeAttribute("required")}}function A(e,t,s){var a={element:e,floatLabelType:t,properties:{placeholder:s}},o=n.closest(e,"."+r.INPUTGROUP),l=o.querySelector(".e-input-group-icon");if(u(a,{container:o}),i.isNullOrUndefined(l)&&(l=o.querySelector(".e-input-group-btn")),i.isNullOrUndefined(l)&&(l=o.querySelector(".e-clear-icon")),i.isNullOrUndefined(l))o.classList.remove(r.INPUTGROUP);else{var c=o.querySelector("."+r.FLOATLINE),d=o.querySelector("."+r.FLOATTEXT);o.insertBefore(e,l),o.insertBefore(c,l),o.insertBefore(d,l)}}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}var C={container:null,buttons:[],clearButton:null};e.createInput=t,e.setCssClass=y,e.setPlaceholder=b,e.setReadonly=g,e.setEnableRtl=E,e.setEnabled=L,e.removeAttributes=O,e.addAttributes=T,e.removeFloating=N,e.addFloating=A,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)}])}); | ||
!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 s=n[i]={exports:{},id:i,loaded:!1};return e[i].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var i,s;i=[n,t,n(1),n(5)],void 0!==(s=function(e,t,n,i){"use strict";function s(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),s(n),s(i)}.apply(t,i))&&(e.exports=s)},function(e,t,n){var i,s;i=[n,t,n(2)],void 0!==(s=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=s)},function(e,t,n){var i,s,r=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 s,r=arguments.length,a=r<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--)(s=e[o])&&(a=(r<3?s(a):r>3?s(t,n,a):s(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a};i=[n,t,n(3),n(3),n(3),n(3),n(3),n(4)],void 0!==(s=function(e,t,n,i,s,o,l,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var c="e-input-group-icon",h=new RegExp("/^(-)?(d*)$/"),d=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.isPrevFocused=!1,i.decimalSeparator=".",i.intRegExp=new RegExp("/^(-)?(d*)$/"),i.isCalled=!1,i}return r(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=s.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)}s.attributes(this.element,{role:"spinbutton",tabindex:"0",autocomplete:"off","aria-live":"assertive"});var r={incrementTitle:"Increment value",decrementTitle:"Decrement value",placeholder:""};this.l10n=new n.L10n("numerictextbox",r,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)||s.setStyleAttribute(this.container,{width:o.formatUnit(this.width)}),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 s="disabled"!==this.element.getAttribute(i)&&"true"!==this.element.getAttribute(i);this.setProperties({enabled:s},!0);break;case"readonly":var r="readonly"===this.element.getAttribute(i)||"true"===this.element.getAttribute(i);this.setProperties({readonly:r},!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,s.addClass([this.container],"e-numeric"),this.readonly&&s.attributes(this.element,{"aria-readonly":"true"}),this.hiddenInput=s.createElement("input",{attrs:{type:"hidden"}}),this.inputName=null!==this.inputName?this.inputName:this.element.id,this.element.removeAttribute("name"),s.attributes(this.hiddenInput,{name:this.inputName}),this.container.insertBefore(this.hiddenInput,this.element),null!==this.inputStyle&&s.attributes(this.container,{style:this.inputStyle})},t.prototype.spinBtnCreation=function(){this.spinDown=u.Input.appendSpan(c+" e-spin-down",this.container),s.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),s.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),s.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?s.removeClass([this.container],"e-error"):s.addClass([this.container],"e-error"),s.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("[,.](.*)"),s=(e.toString(),t.toString(),i.test(e.toString())),r=i.test(t.toString());if(s||r){var a=s?i.exec(e.toString())[0].length:0,o=r?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),s.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,s=n.toString().split("e");n=Math.round(Number(s[0]+"e"+(s[1]?Number(s[1])+i:i)));var r=n.toString().split("e");return n=Number(r[0]+"e"+(r[1]?Number(r[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?h:(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,s.removeClass([this.container],"e-error"),this.prevValue=this.value,this.value||0===this.value){var t=this.formatNumber();this.element.value=t,this.isPrevFocused||this.element.setSelectionRange(0,t.length)}n.Browser.isDevice||n.EventHandler.add(this.element,"mousewheel DOMMouseScroll",this.mouseWheel,this)}},t.prototype.focusOut=function(e){if(this.isPrevFocused){if(e.preventDefault(),n.Browser.isDevice){var t=this.element.value;this.element.focus(),this.isPrevFocused=!1;var i=this.element;setTimeout(function(){i.value=t},200)}}else{this.isFocused=!1,this.element.value.length||this.setProperties({value:null},!0);var s=this.instance.getNumberParser({format:"n"})(this.element.value);this.updateValue(s),n.Browser.isDevice||n.EventHandler.remove(this.element,"mousewheel DOMMouseScroll",this.mouseWheel)}},t.prototype.mouseDownOnSpinner=function(e){var t=this;if(this.isFocused&&(this.isPrevFocused=!0,e.preventDefault()),this.getElementData(e)){var i=(this.getElementData(e),e.currentTarget),s=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(s)},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(this.isPrevFocused&&(this.element.focus(),n.Browser.isDevice||(this.isPrevFocused=!1)),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(),s.detach(this.hiddenInput),this.showSpinButton&&(this.unwireSpinBtnEvents(),s.detach(this.spinUp),s.detach(this.spinDown)),this.container.parentElement.appendChild(this.cloneElement),s.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 r=i[n];switch(r){case"width":s.setStyleAttribute(this.container,{width:o.formatUnit(e.width)});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?s.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():(s.detach(this.spinUp),s.detach(this.spinDown));break;case"value":this.updateValue(e.value);break;case"min":case"max":o.setValue(r,o.getValue(r,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(r,o.getValue(r,e),this.cultureInfo),this.updateValue(this.value);break;case"format":o.setValue(r,o.getValue(r,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("")],d.prototype,"cssClass",void 0),a([n.Property(null)],d.prototype,"value",void 0),a([n.Property(-Number.MAX_VALUE)],d.prototype,"min",void 0),a([n.Property(Number.MAX_VALUE)],d.prototype,"max",void 0),a([n.Property(1)],d.prototype,"step",void 0),a([n.Property(null)],d.prototype,"width",void 0),a([n.Property(null)],d.prototype,"placeholder",void 0),a([n.Property(!0)],d.prototype,"showSpinButton",void 0),a([n.Property(!1)],d.prototype,"readonly",void 0),a([n.Property(!0)],d.prototype,"enabled",void 0),a([n.Property(!1)],d.prototype,"enableRtl",void 0),a([n.Property(!1)],d.prototype,"enablePersistence",void 0),a([n.Property("n2")],d.prototype,"format",void 0),a([n.Property(null)],d.prototype,"decimals",void 0),a([n.Property(null)],d.prototype,"currency",void 0),a([n.Property(!0)],d.prototype,"strictMode",void 0),a([n.Property(!1)],d.prototype,"validateDecimalOnType",void 0),a([n.Property("Auto")],d.prototype,"floatLabelType",void 0),a([n.Event()],d.prototype,"created",void 0),a([n.Event()],d.prototype,"destroyed",void 0),a([n.Event()],d.prototype,"change",void 0),d=a([i.NotifyPropertyChanges],d),t.NumericTextBox=d,t.numerictextboxHelper=n.CreateBuilder(d)}.apply(t,i))&&(e.exports=s)},function(t,n){t.exports=e},function(e,t,n){var i,s;i=[n,t,n(3)],void 0!==(s=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={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",NOFLOATLABEL:"e-no-float-label",INPUTCUSTOMTAG:"e-input-custom-tag",FLOATCUSTOMTAG:"e-float-custom-tag"};!function(e){function t(e){var t={container:null,buttons:[],clearButton:null};if(n.isNullOrUndefined(e.floatLabelType)||"Never"===e.floatLabelType?(t.container=f(e,i.INPUTGROUP,i.INPUTCUSTOMTAG,"span"),e.element.parentNode.insertBefore(t.container,e.element),n.addClass([e.element],i.INPUT),t.container.appendChild(e.element)):l(e,t),e.element.addEventListener("focus",function(){var e=d(this);e.classList.contains("e-input-group")&&e.classList.add("e-input-focus")}),e.element.addEventListener("blur",function(){var e=d(this);e.classList.contains("e-input-group")&&e.classList.remove("e-input-focus")}),n.isNullOrUndefined(e.properties)||n.isNullOrUndefined(e.properties.showClearButton)||!e.properties.showClearButton||(t.clearButton=p(e.element,t.container),t.container.classList.contains(i.FLOATINPUT)&&n.addClass([t.container],i.INPUTGROUP)),!n.isNullOrUndefined(e.buttons))for(var s=0;s<e.buttons.length;s++)t.buttons.push(A(e.buttons[s],t.container));return t=u(e,t),P=t,t}function s(){var e=d(this).getElementsByClassName("e-float-text")[0];n.addClass([e],i.LABELTOP),e.classList.contains(i.LABELBOTTOM)&&n.removeClass([e],i.LABELBOTTOM)}function r(){var e=d(this);if(""===e.getElementsByTagName("input")[0].value){var t=e.getElementsByClassName("e-float-text")[0];t.classList.contains(i.LABELTOP)&&n.removeClass([t],i.LABELTOP),n.addClass([t],i.LABELBOTTOM)}}function a(e){e.addEventListener("focus",s),e.addEventListener("blur",r)}function o(e){e.removeEventListener("focus",s),e.removeEventListener("blur",r)}function l(e,t){var s,r;"Auto"===e.floatLabelType&&a(e.element),n.isNullOrUndefined(t.container)?(t.container=f(e,i.FLOATINPUT,i.FLOATCUSTOMTAG,"div"),e.element.parentNode.insertBefore(t.container,e.element)):(n.isNullOrUndefined(e.customTag)||t.container.classList.add(i.FLOATCUSTOMTAG),t.container.classList.add(i.FLOATINPUT)),n.attributes(e.element,{required:"true"}),s=n.createElement("span",{className:i.FLOATLINE}),r=n.createElement("label",{className:i.FLOATTEXT}),n.isNullOrUndefined(e.element.id)||""===e.element.id||(r.id="label_"+e.element.id.replace(/ /g,"_"),n.attributes(e.element,{"aria-labelledby":r.id})),n.isNullOrUndefined(e.element.placeholder)||""===e.element.placeholder||(r.innerHTML=e.element.placeholder,e.element.removeAttribute("placeholder")),n.isNullOrUndefined(e.properties)||n.isNullOrUndefined(e.properties.placeholder)||""===e.properties.placeholder||(r.innerHTML=e.properties.placeholder),r.innerHTML||t.container.classList.add(i.NOFLOATLABEL),t.container.appendChild(e.element),t.container.appendChild(s),t.container.appendChild(r),h(e.element.value,r),"Always"===e.floatLabelType&&(r.classList.contains(i.LABELBOTTOM)&&n.removeClass([r],i.LABELBOTTOM),n.addClass([r],i.LABELTOP)),"Auto"===e.floatLabelType&&(e.element.addEventListener("input",function(t){h(e.element.value,r)}),e.element.addEventListener("blur",function(t){h(e.element.value,r)}))}function u(e,t){if(!n.isNullOrUndefined(e.properties))for(var i=0,s=Object.keys(e.properties);i<s.length;i++){var r=s[i];switch(r){case"cssClass":y(e.properties.cssClass,[t.container]);break;case"enabled":O(e.properties.enabled,e.element);break;case"enableRtl":L(e.properties.enableRtl,[t.container]);break;case"placeholder":b(e.properties.placeholder,e.element);break;case"readonly":E(e.properties.readonly,e.element)}}return t}function c(e,t){e?n.removeClass([t],i.CLEARICONHIDE):n.addClass([t],i.CLEARICONHIDE)}function h(e,t){e?(n.addClass([t],i.LABELTOP),t.classList.contains(i.LABELBOTTOM)&&n.removeClass([t],i.LABELBOTTOM)):(t.classList.contains(i.LABELTOP)&&n.removeClass([t],i.LABELTOP),n.addClass([t],i.LABELBOTTOM))}function d(e){return e.parentNode}function p(e,t){n.attributes(e,{required:""});var s=n.createElement("span",{className:i.CLEARICON});return t.appendChild(s),!n.isNullOrUndefined(P.container)&&P.container.classList.contains(i.FLOATINPUT)&&n.addClass([P.container],i.INPUTGROUP),n.addClass([s],i.CLEARICONHIDE),m(e,s),s}function m(e,t){t.addEventListener("click",function(s){e.classList.contains(i.DISABLE)||e.readOnly||(s.preventDefault(),e!==document.activeElement&&e.focus(),e.value="",n.addClass([t],i.CLEARICONHIDE))}),e.addEventListener("input",function(n){c(e.value,t)}),e.addEventListener("focus",function(n){c(e.value,t)}),e.addEventListener("blur",function(e){setTimeout(function(){n.addClass([t],i.CLEARICONHIDE)},200)})}function v(e,t){if(d(e).classList.contains(i.FLOATINPUT)&&"Auto"===t){var n=d(e).getElementsByClassName("e-float-text")[0];h(e.value,n)}}function f(e,t,i,s){var r;return n.isNullOrUndefined(e.customTag)?r=n.createElement(s,{className:t}):(r=n.createElement(e.customTag,{className:t}),r.classList.add(i)),r}function y(e,t,i){n.isNullOrUndefined(i)||""===i||n.removeClass(t,i),n.isNullOrUndefined(e)||""===e||n.addClass(t,e)}function b(e,t){var s;s=d(t),s.classList.contains(i.FLOATINPUT)?n.isNullOrUndefined(e)||""===e?(s.classList.add(i.NOFLOATLABEL),s.getElementsByClassName(i.FLOATTEXT)[0].textContent=""):(s.getElementsByClassName(i.FLOATTEXT)[0].textContent=e,s.classList.remove(i.NOFLOATLABEL)):n.isNullOrUndefined(e)||""===e?(t.removeAttribute("placeholder"),t.removeAttribute("aria-placeholder")):n.attributes(t,{placeholder:e,"aria-placeholder":e})}function E(e,t,i){e?n.attributes(t,{readonly:""}):t.removeAttribute("readonly"),n.isNullOrUndefined(i)||v(t,i)}function L(e,t){e?n.addClass(t,i.RTL):n.removeClass(t,i.RTL)}function O(e,t,s){var r={disabled:"disabled","aria-disabled":"true"};e?(t.classList.remove(i.DISABLE),T(r,t)):(t.classList.add(i.DISABLE),g(r,t)),n.isNullOrUndefined(s)||v(t,s)}function T(e,t){for(var n=0,s=Object.keys(e);n<s.length;n++){var r=s[n],a=void 0;a=d(t),"disabled"===r&&t.classList.remove(i.DISABLE),"disabled"===r&&a.classList.contains(i.INPUTGROUP)&&a.classList.remove(i.DISABLE),"placeholder"===r&&a.classList.contains(i.FLOATINPUT)?a.getElementsByClassName(i.FLOATTEXT)[0].textContent="":t.removeAttribute(r)}}function g(e,t){for(var n=0,s=Object.keys(e);n<s.length;n++){var r=s[n],a=void 0;a=d(t),"disabled"===r&&t.classList.add(i.DISABLE),"disabled"===r&&a.classList.contains(i.INPUTGROUP)&&a.classList.add(i.DISABLE),"placeholder"===r&&a.classList.contains(i.FLOATINPUT)?a.getElementsByClassName(i.FLOATTEXT)[0].textContent=e[r]:t.setAttribute(r,e[r])}}function N(e){var t=e.container;if(!n.isNullOrUndefined(t)&&t.classList.contains(i.FLOATINPUT)){var s=t.querySelector("input"),r=t.querySelector("."+i.FLOATTEXT).textContent,a=null!==t.querySelector(".e-clear-icon");n.detach(t.querySelector("."+i.FLOATLINE)),n.detach(t.querySelector("."+i.FLOATTEXT)),n.classList(t,[i.INPUTGROUP],[i.FLOATINPUT]),o(s),n.attributes(s,{placeholder:r}),s.classList.add(i.INPUT),a||s.removeAttribute("required")}}function C(e,t,s){var r=n.closest(e,"."+i.INPUTGROUP);if("Never"!==t){var a={element:e,floatLabelType:t,properties:{placeholder:s}},o=r.querySelector(".e-clear-icon"),u={container:r};if(e.classList.remove(i.INPUT),l(a,u),n.isNullOrUndefined(o)&&(o=r.querySelector(".e-input-group-icon")),n.isNullOrUndefined(o))r.classList.remove(i.INPUTGROUP);else{var c=r.querySelector("."+i.FLOATLINE),h=r.querySelector("."+i.FLOATTEXT);r.insertBefore(e,o),r.insertBefore(c,o),r.insertBefore(h,o)}}}function A(e,t){var s=n.createElement("span",{className:e});return t.appendChild(s),t.classList.contains(i.INPUTGROUP)||t.classList.add(i.INPUTGROUP),s.addEventListener("mousedown",function(){t.classList.contains("e-disabled")||t.querySelector("input").readOnly||this.classList.add("e-input-btn-ripple")}),s.addEventListener("mouseup",function(){var e=this;setTimeout(function(){e.classList.remove("e-input-btn-ripple")},500)}),s}var P={container:null,buttons:[],clearButton:null};e.createInput=t,e.setCssClass=y,e.setPlaceholder=b,e.setReadonly=E,e.setEnableRtl=L,e.setEnabled=O,e.removeAttributes=T,e.addAttributes=g,e.removeFloating=N,e.addFloating=C,e.appendSpan=A}(t.Input||(t.Input={}))}.apply(t,i))&&(e.exports=s)},function(e,t,n){var i,s;i=[n,t,n(4)],void 0!==(s=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=s)}])}); |
@@ -1,2 +0,2 @@ | ||
export * from './numerictextbox'; | ||
export * from './input'; | ||
export * from './numerictextbox/index'; | ||
export * from './input/index'; |
@@ -1,3 +0,2 @@ | ||
import { createElement, attributes, addClass, removeClass, detach, classList, closest } from '@syncfusion/ej2-base/dom'; | ||
import { isNullOrUndefined } from '@syncfusion/ej2-base/util'; | ||
import { createElement, attributes, addClass, removeClass, detach, classList, closest, isNullOrUndefined } from '@syncfusion/ej2-base'; | ||
var CLASSNAMES = { | ||
@@ -107,3 +106,3 @@ RTL: 'e-rtl', | ||
} | ||
attributes(args.element, { 'required': '' }); | ||
attributes(args.element, { 'required': 'true' }); | ||
floatLinelement = createElement('span', { className: CLASSNAMES.FLOATLINE }); | ||
@@ -197,2 +196,3 @@ floatLabelElement = createElement('label', { className: CLASSNAMES.FLOATTEXT }); | ||
function createClearButton(element, container) { | ||
attributes(element, { 'required': '' }); | ||
var button = createElement('span', { className: CLASSNAMES.CLEARICON }); | ||
@@ -204,3 +204,3 @@ container.appendChild(button); | ||
} | ||
updateIconState(element.value, button); | ||
addClass([button], CLASSNAMES.CLEARICONHIDE); | ||
wireClearBtnEvents(element, button); | ||
@@ -227,5 +227,12 @@ return button; | ||
element.addEventListener('blur', function (event) { | ||
updateIconState(element.value, button); | ||
setTimeout(function () { addClass([button], CLASSNAMES.CLEARICONHIDE); }, 200); | ||
}); | ||
} | ||
function validateLabel(element, floatLabelType) { | ||
var parent = getParentNode(element); | ||
if (parent.classList.contains(CLASSNAMES.FLOATINPUT) && floatLabelType === 'Auto') { | ||
var label = getParentNode(element).getElementsByClassName('e-float-text')[0]; | ||
updateLabelState(element.value, label); | ||
} | ||
} | ||
function createInputContainer(args, className, tagClass, tag) { | ||
@@ -275,3 +282,3 @@ var container; | ||
Input.setPlaceholder = setPlaceholder; | ||
function setReadonly(isReadonly, element) { | ||
function setReadonly(isReadonly, element, floatLabelType) { | ||
if (isReadonly) { | ||
@@ -283,2 +290,5 @@ attributes(element, { readonly: '' }); | ||
} | ||
if (!isNullOrUndefined(floatLabelType)) { | ||
validateLabel(element, floatLabelType); | ||
} | ||
} | ||
@@ -295,3 +305,3 @@ Input.setReadonly = setReadonly; | ||
Input.setEnableRtl = setEnableRtl; | ||
function setEnabled(isEnable, element) { | ||
function setEnabled(isEnable, element, floatLabelType) { | ||
var disabledAttrs = { 'disabled': 'disabled', 'aria-disabled': 'true' }; | ||
@@ -306,2 +316,5 @@ if (isEnable) { | ||
} | ||
if (!isNullOrUndefined(floatLabelType)) { | ||
validateLabel(element, floatLabelType); | ||
} | ||
} | ||
@@ -353,2 +366,4 @@ Input.setEnabled = setEnabled; | ||
var inputEle = container.querySelector('input'); | ||
var placeholder = container.querySelector('.' + CLASSNAMES.FLOATTEXT).textContent; | ||
var clearButton = container.querySelector('.e-clear-icon') !== null; | ||
detach(container.querySelector('.' + CLASSNAMES.FLOATLINE)); | ||
@@ -358,4 +373,7 @@ detach(container.querySelector('.' + CLASSNAMES.FLOATTEXT)); | ||
unwireFloatingEvents(inputEle); | ||
attributes(inputEle, { 'placeholder': placeholder }); | ||
inputEle.classList.add(CLASSNAMES.INPUT); | ||
inputEle.removeAttribute('required'); | ||
if (!clearButton) { | ||
inputEle.removeAttribute('required'); | ||
} | ||
} | ||
@@ -365,23 +383,23 @@ } | ||
function addFloating(input, type, placeholder) { | ||
var args = { element: input, floatLabelType: type, properties: { placeholder: placeholder } }; | ||
var container = closest(input, '.' + CLASSNAMES.INPUTGROUP); | ||
var iconEle = container.querySelector('.e-input-group-icon'); | ||
var inputObj = { container: container }; | ||
createFloatingInput(args, inputObj); | ||
if (isNullOrUndefined(iconEle)) { | ||
iconEle = container.querySelector('.e-input-group-btn'); | ||
if (type !== 'Never') { | ||
var args = { element: input, floatLabelType: type, properties: { placeholder: placeholder } }; | ||
var iconEle = container.querySelector('.e-clear-icon'); | ||
var inputObj = { container: container }; | ||
input.classList.remove(CLASSNAMES.INPUT); | ||
createFloatingInput(args, inputObj); | ||
if (isNullOrUndefined(iconEle)) { | ||
iconEle = container.querySelector('.e-input-group-icon'); | ||
} | ||
if (isNullOrUndefined(iconEle)) { | ||
container.classList.remove(CLASSNAMES.INPUTGROUP); | ||
} | ||
else { | ||
var floatLine = container.querySelector('.' + CLASSNAMES.FLOATLINE); | ||
var floatText = container.querySelector('.' + CLASSNAMES.FLOATTEXT); | ||
container.insertBefore(input, iconEle); | ||
container.insertBefore(floatLine, iconEle); | ||
container.insertBefore(floatText, iconEle); | ||
} | ||
} | ||
if (isNullOrUndefined(iconEle)) { | ||
iconEle = container.querySelector('.e-clear-icon'); | ||
} | ||
if (isNullOrUndefined(iconEle)) { | ||
container.classList.remove(CLASSNAMES.INPUTGROUP); | ||
} | ||
else { | ||
var floatLine = container.querySelector('.' + CLASSNAMES.FLOATLINE); | ||
var floatText = container.querySelector('.' + CLASSNAMES.FLOATTEXT); | ||
container.insertBefore(input, iconEle); | ||
container.insertBefore(floatLine, iconEle); | ||
container.insertBefore(floatText, iconEle); | ||
} | ||
} | ||
@@ -396,3 +414,5 @@ Input.addFloating = addFloating; | ||
button.addEventListener('mousedown', function () { | ||
this.classList.add('e-input-btn-ripple'); | ||
if (!container.classList.contains('e-disabled') && !container.querySelector('input').readOnly) { | ||
this.classList.add('e-input-btn-ripple'); | ||
} | ||
}); | ||
@@ -399,0 +419,0 @@ button.addEventListener('mouseup', function () { |
@@ -19,4 +19,4 @@ var __extends = (this && this.__extends) || (function () { | ||
import { NotifyPropertyChanges } from '@syncfusion/ej2-base'; | ||
import { createElement, attributes, addClass, removeClass, setStyleAttribute, detach } from '@syncfusion/ej2-base/dom'; | ||
import { isNullOrUndefined, getValue, formatUnit, setValue, merge } from '@syncfusion/ej2-base/util'; | ||
import { createElement, attributes, addClass, removeClass, setStyleAttribute, detach } from '@syncfusion/ej2-base'; | ||
import { isNullOrUndefined, getValue, formatUnit, setValue, merge } from '@syncfusion/ej2-base'; | ||
import { Internationalization, getNumericObject } from '@syncfusion/ej2-base'; | ||
@@ -86,5 +86,2 @@ import { Input } from '../input/input'; | ||
} | ||
if (!isNullOrUndefined(this.height)) { | ||
setStyleAttribute(this.container, { 'height': formatUnit(this.height) }); | ||
} | ||
this.changeValue(this.value); | ||
@@ -519,2 +516,3 @@ this.wireEvents(); | ||
this.isPrevFocused = true; | ||
event.preventDefault(); | ||
} | ||
@@ -609,5 +607,2 @@ if (!this.getElementData(event)) { | ||
break; | ||
case 'height': | ||
setStyleAttribute(this.container, { 'height': formatUnit(newProp.height) }); | ||
break; | ||
case 'cssClass': | ||
@@ -708,5 +703,2 @@ Input.setCssClass(newProp.cssClass, [this.container], oldProp.cssClass); | ||
Property(null) | ||
], NumericTextBox.prototype, "height", void 0); | ||
__decorate([ | ||
Property(null) | ||
], NumericTextBox.prototype, "placeholder", void 0); | ||
@@ -713,0 +705,0 @@ __decorate([ |
/** | ||
* input | ||
*/ | ||
export * from './src/input'; | ||
export * from './src/input/index'; |
@@ -1,2 +0,2 @@ | ||
define(["require", "exports", "./src/input"], function (require, exports, input_1) { | ||
define(["require", "exports", "./src/input/index"], function (require, exports, index_1) { | ||
"use strict"; | ||
@@ -7,3 +7,3 @@ function __export(m) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(input_1); | ||
__export(index_1); | ||
}); |
/** | ||
* numerictextbox | ||
*/ | ||
export * from './src/numerictextbox'; | ||
export * from './src/numerictextbox/index'; |
@@ -1,2 +0,2 @@ | ||
define(["require", "exports", "./src/numerictextbox"], function (require, exports, numerictextbox_1) { | ||
define(["require", "exports", "./src/numerictextbox/index"], function (require, exports, index_1) { | ||
"use strict"; | ||
@@ -7,3 +7,3 @@ function __export(m) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(numerictextbox_1); | ||
__export(index_1); | ||
}); |
{ | ||
"name": "@syncfusion/ej2-inputs", | ||
"version": "1.0.11", | ||
"description": "Essential JS 2 TextBoxes", | ||
"version": "1.0.14", | ||
"description": "Essential JS 2 Input Components", | ||
"author": "Syncfusion Inc.", | ||
@@ -9,3 +9,3 @@ "license": "SEE LICENSE IN license", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "^1.0.11" | ||
"@syncfusion/ej2-base": "^1.0.14" | ||
}, | ||
@@ -12,0 +12,0 @@ "devDependencies": { |
/** | ||
* NumericTextBox all modules | ||
*/ | ||
export * from './numerictextbox'; | ||
export * from './input'; | ||
export * from './numerictextbox/index'; | ||
export * from './input/index'; |
@@ -1,2 +0,2 @@ | ||
define(["require", "exports", "./numerictextbox", "./input"], function (require, exports, numerictextbox_1, input_1) { | ||
define(["require", "exports", "./numerictextbox/index", "./input/index"], function (require, exports, index_1, index_2) { | ||
"use strict"; | ||
@@ -7,4 +7,4 @@ function __export(m) { | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(numerictextbox_1); | ||
__export(input_1); | ||
__export(index_1); | ||
__export(index_2); | ||
}); |
@@ -46,3 +46,3 @@ /** | ||
*/ | ||
function setReadonly(isReadonly: boolean, element: HTMLInputElement): void; | ||
function setReadonly(isReadonly: boolean, element: HTMLInputElement, floatLabelType?: string): void; | ||
/** | ||
@@ -69,3 +69,3 @@ * Displays the element direction from right to left when its enabled. | ||
*/ | ||
function setEnabled(isEnable: boolean, element: HTMLInputElement): void; | ||
function setEnabled(isEnable: boolean, element: HTMLInputElement, floatLabelType?: string): void; | ||
/** | ||
@@ -72,0 +72,0 @@ * Removing the multiple attributes from the given element such as "disabled","id" , etc. |
@@ -1,2 +0,2 @@ | ||
define(["require", "exports", "@syncfusion/ej2-base/dom", "@syncfusion/ej2-base/util"], function (require, exports, dom_1, util_1) { | ||
define(["require", "exports", "@syncfusion/ej2-base"], function (require, exports, ej2_base_1) { | ||
"use strict"; | ||
@@ -29,6 +29,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
var inputObject = { container: null, buttons: [], clearButton: null }; | ||
if (util_1.isNullOrUndefined(args.floatLabelType) || args.floatLabelType === 'Never') { | ||
if (ej2_base_1.isNullOrUndefined(args.floatLabelType) || args.floatLabelType === 'Never') { | ||
inputObject.container = createInputContainer(args, CLASSNAMES.INPUTGROUP, CLASSNAMES.INPUTCUSTOMTAG, 'span'); | ||
args.element.parentNode.insertBefore(inputObject.container, args.element); | ||
dom_1.addClass([args.element], CLASSNAMES.INPUT); | ||
ej2_base_1.addClass([args.element], CLASSNAMES.INPUT); | ||
inputObject.container.appendChild(args.element); | ||
@@ -51,9 +51,9 @@ } | ||
}); | ||
if (!util_1.isNullOrUndefined(args.properties) && !util_1.isNullOrUndefined(args.properties.showClearButton) && args.properties.showClearButton) { | ||
if (!ej2_base_1.isNullOrUndefined(args.properties) && !ej2_base_1.isNullOrUndefined(args.properties.showClearButton) && args.properties.showClearButton) { | ||
inputObject.clearButton = createClearButton(args.element, inputObject.container); | ||
if (inputObject.container.classList.contains(CLASSNAMES.FLOATINPUT)) { | ||
dom_1.addClass([inputObject.container], CLASSNAMES.INPUTGROUP); | ||
ej2_base_1.addClass([inputObject.container], CLASSNAMES.INPUTGROUP); | ||
} | ||
} | ||
if (!util_1.isNullOrUndefined(args.buttons)) { | ||
if (!ej2_base_1.isNullOrUndefined(args.buttons)) { | ||
for (var i = 0; i < args.buttons.length; i++) { | ||
@@ -70,5 +70,5 @@ inputObject.buttons.push(appendSpan(args.buttons[i], inputObject.container)); | ||
var label = getParentNode(this).getElementsByClassName('e-float-text')[0]; | ||
dom_1.addClass([label], CLASSNAMES.LABELTOP); | ||
ej2_base_1.addClass([label], CLASSNAMES.LABELTOP); | ||
if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) { | ||
dom_1.removeClass([label], CLASSNAMES.LABELBOTTOM); | ||
ej2_base_1.removeClass([label], CLASSNAMES.LABELBOTTOM); | ||
} | ||
@@ -81,5 +81,5 @@ } | ||
if (label.classList.contains(CLASSNAMES.LABELTOP)) { | ||
dom_1.removeClass([label], CLASSNAMES.LABELTOP); | ||
ej2_base_1.removeClass([label], CLASSNAMES.LABELTOP); | ||
} | ||
dom_1.addClass([label], CLASSNAMES.LABELBOTTOM); | ||
ej2_base_1.addClass([label], CLASSNAMES.LABELBOTTOM); | ||
} | ||
@@ -102,3 +102,3 @@ } | ||
} | ||
if (util_1.isNullOrUndefined(inputObject.container)) { | ||
if (ej2_base_1.isNullOrUndefined(inputObject.container)) { | ||
inputObject.container = createInputContainer(args, CLASSNAMES.FLOATINPUT, CLASSNAMES.FLOATCUSTOMTAG, 'div'); | ||
@@ -108,3 +108,3 @@ args.element.parentNode.insertBefore(inputObject.container, args.element); | ||
else { | ||
if (!util_1.isNullOrUndefined(args.customTag)) { | ||
if (!ej2_base_1.isNullOrUndefined(args.customTag)) { | ||
inputObject.container.classList.add(CLASSNAMES.FLOATCUSTOMTAG); | ||
@@ -114,14 +114,14 @@ } | ||
} | ||
dom_1.attributes(args.element, { 'required': '' }); | ||
floatLinelement = dom_1.createElement('span', { className: CLASSNAMES.FLOATLINE }); | ||
floatLabelElement = dom_1.createElement('label', { className: CLASSNAMES.FLOATTEXT }); | ||
if (!util_1.isNullOrUndefined(args.element.id) && args.element.id !== '') { | ||
ej2_base_1.attributes(args.element, { 'required': 'true' }); | ||
floatLinelement = ej2_base_1.createElement('span', { className: CLASSNAMES.FLOATLINE }); | ||
floatLabelElement = ej2_base_1.createElement('label', { className: CLASSNAMES.FLOATTEXT }); | ||
if (!ej2_base_1.isNullOrUndefined(args.element.id) && args.element.id !== '') { | ||
floatLabelElement.id = 'label_' + args.element.id.replace(/ /g, '_'); | ||
dom_1.attributes(args.element, { 'aria-labelledby': floatLabelElement.id }); | ||
ej2_base_1.attributes(args.element, { 'aria-labelledby': floatLabelElement.id }); | ||
} | ||
if (!util_1.isNullOrUndefined(args.element.placeholder) && args.element.placeholder !== '') { | ||
if (!ej2_base_1.isNullOrUndefined(args.element.placeholder) && args.element.placeholder !== '') { | ||
floatLabelElement.innerHTML = args.element.placeholder; | ||
args.element.removeAttribute('placeholder'); | ||
} | ||
if (!util_1.isNullOrUndefined(args.properties) && !util_1.isNullOrUndefined(args.properties.placeholder) && | ||
if (!ej2_base_1.isNullOrUndefined(args.properties) && !ej2_base_1.isNullOrUndefined(args.properties.placeholder) && | ||
args.properties.placeholder !== '') { | ||
@@ -139,5 +139,5 @@ floatLabelElement.innerHTML = args.properties.placeholder; | ||
if (floatLabelElement.classList.contains(CLASSNAMES.LABELBOTTOM)) { | ||
dom_1.removeClass([floatLabelElement], CLASSNAMES.LABELBOTTOM); | ||
ej2_base_1.removeClass([floatLabelElement], CLASSNAMES.LABELBOTTOM); | ||
} | ||
dom_1.addClass([floatLabelElement], CLASSNAMES.LABELTOP); | ||
ej2_base_1.addClass([floatLabelElement], CLASSNAMES.LABELTOP); | ||
} | ||
@@ -154,3 +154,3 @@ if (args.floatLabelType === 'Auto') { | ||
function setPropertyValue(args, inputObject) { | ||
if (!util_1.isNullOrUndefined(args.properties)) { | ||
if (!ej2_base_1.isNullOrUndefined(args.properties)) { | ||
for (var _i = 0, _a = Object.keys(args.properties); _i < _a.length; _i++) { | ||
@@ -181,6 +181,6 @@ var prop = _a[_i]; | ||
if (value) { | ||
dom_1.removeClass([button], CLASSNAMES.CLEARICONHIDE); | ||
ej2_base_1.removeClass([button], CLASSNAMES.CLEARICONHIDE); | ||
} | ||
else { | ||
dom_1.addClass([button], CLASSNAMES.CLEARICONHIDE); | ||
ej2_base_1.addClass([button], CLASSNAMES.CLEARICONHIDE); | ||
} | ||
@@ -190,5 +190,5 @@ } | ||
if (value) { | ||
dom_1.addClass([label], CLASSNAMES.LABELTOP); | ||
ej2_base_1.addClass([label], CLASSNAMES.LABELTOP); | ||
if (label.classList.contains(CLASSNAMES.LABELBOTTOM)) { | ||
dom_1.removeClass([label], CLASSNAMES.LABELBOTTOM); | ||
ej2_base_1.removeClass([label], CLASSNAMES.LABELBOTTOM); | ||
} | ||
@@ -198,5 +198,5 @@ } | ||
if (label.classList.contains(CLASSNAMES.LABELTOP)) { | ||
dom_1.removeClass([label], CLASSNAMES.LABELTOP); | ||
ej2_base_1.removeClass([label], CLASSNAMES.LABELTOP); | ||
} | ||
dom_1.addClass([label], CLASSNAMES.LABELBOTTOM); | ||
ej2_base_1.addClass([label], CLASSNAMES.LABELBOTTOM); | ||
} | ||
@@ -209,9 +209,10 @@ } | ||
function createClearButton(element, container) { | ||
var button = dom_1.createElement('span', { className: CLASSNAMES.CLEARICON }); | ||
ej2_base_1.attributes(element, { 'required': '' }); | ||
var button = ej2_base_1.createElement('span', { className: CLASSNAMES.CLEARICON }); | ||
container.appendChild(button); | ||
if (!util_1.isNullOrUndefined(privateInputObj.container) && | ||
if (!ej2_base_1.isNullOrUndefined(privateInputObj.container) && | ||
privateInputObj.container.classList.contains(CLASSNAMES.FLOATINPUT)) { | ||
dom_1.addClass([privateInputObj.container], CLASSNAMES.INPUTGROUP); | ||
ej2_base_1.addClass([privateInputObj.container], CLASSNAMES.INPUTGROUP); | ||
} | ||
updateIconState(element.value, button); | ||
ej2_base_1.addClass([button], CLASSNAMES.CLEARICONHIDE); | ||
wireClearBtnEvents(element, button); | ||
@@ -228,3 +229,3 @@ return button; | ||
element.value = ''; | ||
dom_1.addClass([button], CLASSNAMES.CLEARICONHIDE); | ||
ej2_base_1.addClass([button], CLASSNAMES.CLEARICONHIDE); | ||
} | ||
@@ -239,13 +240,20 @@ }); | ||
element.addEventListener('blur', function (event) { | ||
updateIconState(element.value, button); | ||
setTimeout(function () { ej2_base_1.addClass([button], CLASSNAMES.CLEARICONHIDE); }, 200); | ||
}); | ||
} | ||
function validateLabel(element, floatLabelType) { | ||
var parent = getParentNode(element); | ||
if (parent.classList.contains(CLASSNAMES.FLOATINPUT) && floatLabelType === 'Auto') { | ||
var label = getParentNode(element).getElementsByClassName('e-float-text')[0]; | ||
updateLabelState(element.value, label); | ||
} | ||
} | ||
function createInputContainer(args, className, tagClass, tag) { | ||
var container; | ||
if (!util_1.isNullOrUndefined(args.customTag)) { | ||
container = dom_1.createElement(args.customTag, { className: className }); | ||
if (!ej2_base_1.isNullOrUndefined(args.customTag)) { | ||
container = ej2_base_1.createElement(args.customTag, { className: className }); | ||
container.classList.add(tagClass); | ||
} | ||
else { | ||
container = dom_1.createElement(tag, { className: className }); | ||
container = ej2_base_1.createElement(tag, { className: className }); | ||
} | ||
@@ -255,7 +263,7 @@ return container; | ||
function setCssClass(cssClass, elements, oldClass) { | ||
if (!util_1.isNullOrUndefined(oldClass) && oldClass !== '') { | ||
dom_1.removeClass(elements, oldClass); | ||
if (!ej2_base_1.isNullOrUndefined(oldClass) && oldClass !== '') { | ||
ej2_base_1.removeClass(elements, oldClass); | ||
} | ||
if (!util_1.isNullOrUndefined(cssClass) && cssClass !== '') { | ||
dom_1.addClass(elements, cssClass); | ||
if (!ej2_base_1.isNullOrUndefined(cssClass) && cssClass !== '') { | ||
ej2_base_1.addClass(elements, cssClass); | ||
} | ||
@@ -268,3 +276,3 @@ } | ||
if (parentElement.classList.contains(CLASSNAMES.FLOATINPUT)) { | ||
if (!util_1.isNullOrUndefined(placeholder) && placeholder !== '') { | ||
if (!ej2_base_1.isNullOrUndefined(placeholder) && placeholder !== '') { | ||
parentElement.getElementsByClassName(CLASSNAMES.FLOATTEXT)[0].textContent = placeholder; | ||
@@ -279,4 +287,4 @@ parentElement.classList.remove(CLASSNAMES.NOFLOATLABEL); | ||
else { | ||
if (!util_1.isNullOrUndefined(placeholder) && placeholder !== '') { | ||
dom_1.attributes(element, { 'placeholder': placeholder, 'aria-placeholder': placeholder }); | ||
if (!ej2_base_1.isNullOrUndefined(placeholder) && placeholder !== '') { | ||
ej2_base_1.attributes(element, { 'placeholder': placeholder, 'aria-placeholder': placeholder }); | ||
} | ||
@@ -290,5 +298,5 @@ else { | ||
Input.setPlaceholder = setPlaceholder; | ||
function setReadonly(isReadonly, element) { | ||
function setReadonly(isReadonly, element, floatLabelType) { | ||
if (isReadonly) { | ||
dom_1.attributes(element, { readonly: '' }); | ||
ej2_base_1.attributes(element, { readonly: '' }); | ||
} | ||
@@ -298,2 +306,5 @@ else { | ||
} | ||
if (!ej2_base_1.isNullOrUndefined(floatLabelType)) { | ||
validateLabel(element, floatLabelType); | ||
} | ||
} | ||
@@ -303,10 +314,10 @@ Input.setReadonly = setReadonly; | ||
if (isRtl) { | ||
dom_1.addClass(elements, CLASSNAMES.RTL); | ||
ej2_base_1.addClass(elements, CLASSNAMES.RTL); | ||
} | ||
else { | ||
dom_1.removeClass(elements, CLASSNAMES.RTL); | ||
ej2_base_1.removeClass(elements, CLASSNAMES.RTL); | ||
} | ||
} | ||
Input.setEnableRtl = setEnableRtl; | ||
function setEnabled(isEnable, element) { | ||
function setEnabled(isEnable, element, floatLabelType) { | ||
var disabledAttrs = { 'disabled': 'disabled', 'aria-disabled': 'true' }; | ||
@@ -321,2 +332,5 @@ if (isEnable) { | ||
} | ||
if (!ej2_base_1.isNullOrUndefined(floatLabelType)) { | ||
validateLabel(element, floatLabelType); | ||
} | ||
} | ||
@@ -366,10 +380,15 @@ Input.setEnabled = setEnabled; | ||
var container = input.container; | ||
if (!util_1.isNullOrUndefined(container) && container.classList.contains(CLASSNAMES.FLOATINPUT)) { | ||
if (!ej2_base_1.isNullOrUndefined(container) && container.classList.contains(CLASSNAMES.FLOATINPUT)) { | ||
var inputEle = container.querySelector('input'); | ||
dom_1.detach(container.querySelector('.' + CLASSNAMES.FLOATLINE)); | ||
dom_1.detach(container.querySelector('.' + CLASSNAMES.FLOATTEXT)); | ||
dom_1.classList(container, [CLASSNAMES.INPUTGROUP], [CLASSNAMES.FLOATINPUT]); | ||
var placeholder = container.querySelector('.' + CLASSNAMES.FLOATTEXT).textContent; | ||
var clearButton = container.querySelector('.e-clear-icon') !== null; | ||
ej2_base_1.detach(container.querySelector('.' + CLASSNAMES.FLOATLINE)); | ||
ej2_base_1.detach(container.querySelector('.' + CLASSNAMES.FLOATTEXT)); | ||
ej2_base_1.classList(container, [CLASSNAMES.INPUTGROUP], [CLASSNAMES.FLOATINPUT]); | ||
unwireFloatingEvents(inputEle); | ||
ej2_base_1.attributes(inputEle, { 'placeholder': placeholder }); | ||
inputEle.classList.add(CLASSNAMES.INPUT); | ||
inputEle.removeAttribute('required'); | ||
if (!clearButton) { | ||
inputEle.removeAttribute('required'); | ||
} | ||
} | ||
@@ -379,27 +398,27 @@ } | ||
function addFloating(input, type, placeholder) { | ||
var args = { element: input, floatLabelType: type, properties: { placeholder: placeholder } }; | ||
var container = dom_1.closest(input, '.' + CLASSNAMES.INPUTGROUP); | ||
var iconEle = container.querySelector('.e-input-group-icon'); | ||
var inputObj = { container: container }; | ||
createFloatingInput(args, inputObj); | ||
if (util_1.isNullOrUndefined(iconEle)) { | ||
iconEle = container.querySelector('.e-input-group-btn'); | ||
var container = ej2_base_1.closest(input, '.' + CLASSNAMES.INPUTGROUP); | ||
if (type !== 'Never') { | ||
var args = { element: input, floatLabelType: type, properties: { placeholder: placeholder } }; | ||
var iconEle = container.querySelector('.e-clear-icon'); | ||
var inputObj = { container: container }; | ||
input.classList.remove(CLASSNAMES.INPUT); | ||
createFloatingInput(args, inputObj); | ||
if (ej2_base_1.isNullOrUndefined(iconEle)) { | ||
iconEle = container.querySelector('.e-input-group-icon'); | ||
} | ||
if (ej2_base_1.isNullOrUndefined(iconEle)) { | ||
container.classList.remove(CLASSNAMES.INPUTGROUP); | ||
} | ||
else { | ||
var floatLine = container.querySelector('.' + CLASSNAMES.FLOATLINE); | ||
var floatText = container.querySelector('.' + CLASSNAMES.FLOATTEXT); | ||
container.insertBefore(input, iconEle); | ||
container.insertBefore(floatLine, iconEle); | ||
container.insertBefore(floatText, iconEle); | ||
} | ||
} | ||
if (util_1.isNullOrUndefined(iconEle)) { | ||
iconEle = container.querySelector('.e-clear-icon'); | ||
} | ||
if (util_1.isNullOrUndefined(iconEle)) { | ||
container.classList.remove(CLASSNAMES.INPUTGROUP); | ||
} | ||
else { | ||
var floatLine = container.querySelector('.' + CLASSNAMES.FLOATLINE); | ||
var floatText = container.querySelector('.' + CLASSNAMES.FLOATTEXT); | ||
container.insertBefore(input, iconEle); | ||
container.insertBefore(floatLine, iconEle); | ||
container.insertBefore(floatText, iconEle); | ||
} | ||
} | ||
Input.addFloating = addFloating; | ||
function appendSpan(iconClass, container) { | ||
var button = dom_1.createElement('span', { className: iconClass }); | ||
var button = ej2_base_1.createElement('span', { className: iconClass }); | ||
container.appendChild(button); | ||
@@ -410,3 +429,5 @@ if (!container.classList.contains(CLASSNAMES.INPUTGROUP)) { | ||
button.addEventListener('mousedown', function () { | ||
this.classList.add('e-input-btn-ripple'); | ||
if (!container.classList.contains('e-disabled') && !container.querySelector('input').readOnly) { | ||
this.classList.add('e-input-btn-ripple'); | ||
} | ||
}); | ||
@@ -413,0 +434,0 @@ button.addEventListener('mouseup', function () { |
@@ -66,6 +66,2 @@ import{NumericTextBox} from "./numerictextbox"; | ||
format(value:string): BuilderProperties; | ||
/** | ||
* Specifies the height of the NumericTextBox. | ||
*/ | ||
height(value:number|string): BuilderProperties; | ||
isDestroyed(value:boolean): BuilderProperties; | ||
@@ -72,0 +68,0 @@ /** |
@@ -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, 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 { 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';import { isNullOrUndefined, getValue, formatUnit, setValue, merge } from '@syncfusion/ej2-base';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,67 +11,163 @@ import {ComponentModel} from '@syncfusion/ej2-base'; | ||
/** | ||
* Gets or Sets the CSS classes to root element of the NumericTextBox which helps to customize the * complete UI styles. * @default null */ cssClass?: string; | ||
* Gets or Sets the CSS classes to root element of the NumericTextBox which helps to customize the | ||
* complete UI styles. | ||
* @default null | ||
*/ | ||
cssClass?: string; | ||
/** | ||
* Sets the value of the NumericTextBox. * @default null */ value?: number; | ||
* Sets the value of the NumericTextBox. | ||
* @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 NumericTextBox. * @default 1 */ step?: number; | ||
* Specifies the incremental or decremental step size for the NumericTextBox. | ||
* @default 1 | ||
*/ | ||
step?: number; | ||
/** | ||
* Specifies the width of the NumericTextBox. * @default null */ width?: number | string; | ||
* Specifies the width of the NumericTextBox. | ||
* @default null | ||
*/ | ||
width?: number | string; | ||
/** | ||
* Specifies the height of the NumericTextBox. * @default null */ height?: number | string; | ||
* Gets or sets the string shown as a hint/placeholder when the NumericTextBox is empty. | ||
* It acts as a label and floats above the NumericTextBox based on the | ||
* <b><a href="http://ej2.syncfusion.com/documentation/numerictextbox | ||
* /api-numericTextBox.html#floatlabeltype-string" target="_blank">floatLabelType.</a></b> | ||
* @default null | ||
*/ | ||
placeholder?: string; | ||
/** | ||
* Gets or sets the string shown as a hint/placeholder when the NumericTextBox is empty. * It acts as a label and floats above the NumericTextBox based on the * <b><a href="http://ej2.syncfusion.com/documentation/numerictextbox * /api-numericTextBox.html#floatlabeltype-string" target="_blank">floatLabelType.</a></b> * @default null */ placeholder?: string; | ||
* Specifies whether the up and down spin buttons should be displayed in NumericTextBox. | ||
* @default true | ||
*/ | ||
showSpinButton?: boolean; | ||
/** | ||
* Specifies whether the up and down spin buttons should be displayed in NumericTextBox. * @default true */ showSpinButton?: boolean; | ||
* Sets a value that enables or disables the readonly state on the NumericTextBox. If it is true, | ||
* NumericTextBox will not allow your input. | ||
* @default false | ||
*/ | ||
readonly?: boolean; | ||
/** | ||
* Sets a value that enables or disables the readonly state on the NumericTextBox. If it is true, * NumericTextBox will not allow your input. * @default false */ readonly?: boolean; | ||
* Sets a value that enables or disables the NumericTextBox control. | ||
* @default true | ||
*/ | ||
enabled?: boolean; | ||
/** | ||
* Sets a value that enables or disables the NumericTextBox control. * @default true */ enabled?: boolean; | ||
* Sets a value that enables or disables the RTL mode on the NumericTextBox. If it is true, | ||
* NumericTextBox will display the content in the right to left direction. | ||
* @default false | ||
*/ | ||
enableRtl?: boolean; | ||
/** | ||
* Sets a value that enables or disables the RTL mode on the NumericTextBox. If it is true, * NumericTextBox will display the content in the right to left direction. * @default false */ enableRtl?: boolean; | ||
* Sets a value that enables or disables the persisting state of the NumericTextBox after reloading the page. | ||
* @default false | ||
*/ | ||
enablePersistence?: boolean; | ||
/** | ||
* Sets a value that enables or disables the persisting state of the NumericTextBox after reloading the page. * @default false */ enablePersistence?: boolean; | ||
* Specifies the number format that indicates the display format for the value of the NumericTextBox. | ||
* @default 'n2' | ||
*/ | ||
format?: string; | ||
/** | ||
* Specifies the number format that indicates the display format for the value of the NumericTextBox. * @default 'n2' */ format?: string; | ||
* Specifies the number precision applied to the textbox value when the NumericTextBox is focused. | ||
* @default null | ||
*/ | ||
decimals?: number; | ||
/** | ||
* Specifies the number precision applied to the textbox value when the NumericTextBox 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 NumericTextBox control allows the value for the specified range. | ||
* * If it is true, the input value will be restricted between the min and max range. | ||
* The typed value gets modified to fit the range on focused out state. | ||
* ```html | ||
* <input type='text' id="numeric"/> | ||
* ``` | ||
* ```typescript | ||
* <script> | ||
* var numericObj = new NumericTextBox({ min: 10, max: 20, value: 15 }); | ||
* numericObj.appendTo("#numeric"); | ||
* </script> | ||
* ``` | ||
* * Else, it allows any value even out of range value, | ||
* At that time of wrong value entered, the error class will be added to the component to highlight the error. | ||
* ```html | ||
* <input type='text' id="numeric"/> | ||
* ``` | ||
* ```typescript | ||
* <script> | ||
* var numericObj = new NumericTextBox({ strictMode: false, min: 10, max: 20, value: 15 }); | ||
* numericObj.appendTo("#numeric"); | ||
* </script> | ||
* ``` | ||
* @default true | ||
*/ | ||
strictMode?: boolean; | ||
/** | ||
* Specifies a value that indicates whether the NumericTextBox control allows the value for the specified range. * * If it is true, the input value will be restricted between the min and max range. * The typed value gets modified to fit the range on focused out state. * ```html * <input type='text' id="numeric"/> * ``` * ```typescript * <script> * var numericObj = new NumericTextBox({ min: 10, max: 20, value: 15 }); * numericObj.appendTo("#numeric"); * </script> * ``` * * Else, it allows any value even out of range value, * At that time of wrong value entered, the error class will be added to the component to highlight the error. * ```html * <input type='text' id="numeric"/> * ``` * ```typescript * <script> * var numericObj = new NumericTextBox({ strictMode: false, min: 10, max: 20, value: 15 }); * numericObj.appendTo("#numeric"); * </script> * ``` * @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; | ||
* Sets the type of floating label which enables or disables the floating label in the NumericTextBox. | ||
* The <b><a href="http://ej2.syncfusion.com/documentation/numerictextbox/ | ||
* api-numericTextBox.html#placeholder-string" target="_blank">placeholder</a></b> value acts as a label | ||
* and floats above the NumericTextBox based on the below values. | ||
* Possible values are: | ||
* * Never - Never floats the label in the NumericTextBox when the placeholder is available. | ||
* * Always - The floating label always floats above the NumericTextBox. | ||
* * Auto - The floating label floats above the NumericTextBox after focusing it or when enters the value in it. | ||
* @default Auto | ||
*/ | ||
floatLabelType?: FloatLabelType; | ||
/** | ||
* Sets the type of floating label which enables or disables the floating label in the NumericTextBox. * The <b><a href="http://ej2.syncfusion.com/documentation/numerictextbox/ * api-numericTextBox.html#placeholder-string" target="_blank">placeholder</a></b> value acts as a label * and floats above the NumericTextBox based on the below values. * Possible values are: * * Never - Never floats the label in the NumericTextBox when the placeholder is available. * * Always - The floating label always floats above the NumericTextBox. * * Auto - The floating label floats above the NumericTextBox after focusing it or when enters the value in it. * @default Auto */ floatLabelType?: FloatLabelType; | ||
* Triggers when the NumericTextBox component is created. | ||
* @event | ||
*/ | ||
created?: EmitType<Object>; | ||
/** | ||
* Triggers when the NumericTextBox component is created. * @event */ created?: EmitType<Object>; | ||
* Triggers when the NumericTextBox component is destroyed. | ||
* @event | ||
*/ | ||
destroyed?: EmitType<Object>; | ||
/** | ||
* Triggers when the NumericTextBox component is destroyed. * @event */ destroyed?: EmitType<Object>; | ||
* Triggers when the value of the NumericTextBox changes. | ||
* @event | ||
*/ | ||
change?: EmitType<ChangeEventArgs>; | ||
/** | ||
* Triggers when the value of the NumericTextBox changes. * @event */ change?: EmitType<ChangeEventArgs>; | ||
} |
@@ -71,7 +71,2 @@ import { Component, EmitType } from '@syncfusion/ej2-base'; | ||
/** | ||
* Specifies the height of the NumericTextBox. | ||
* @default null | ||
*/ | ||
height: number | string; | ||
/** | ||
* Gets or sets the string shown as a hint/placeholder when the NumericTextBox is empty. | ||
@@ -78,0 +73,0 @@ * It acts as a label and floats above the NumericTextBox based on the |
@@ -17,3 +17,3 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base/dom", "@syncfusion/ej2-base/util", "@syncfusion/ej2-base", "../input/input"], function (require, exports, ej2_base_1, ej2_base_2, dom_1, util_1, ej2_base_3, input_1) { | ||
define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "../input/input"], function (require, exports, ej2_base_1, ej2_base_2, ej2_base_3, ej2_base_4, ej2_base_5, input_1) { | ||
"use strict"; | ||
@@ -41,3 +41,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
NumericTextBox.prototype.preRender = function () { | ||
var ejInstance = util_1.getValue('ej2_instances', this.element); | ||
var ejInstance = ej2_base_4.getValue('ej2_instances', this.element); | ||
this.cloneElement = this.element.cloneNode(true); | ||
@@ -47,3 +47,3 @@ this.angularTagName = null; | ||
this.angularTagName = this.element.tagName; | ||
var input = dom_1.createElement('input'); | ||
var input = ej2_base_3.createElement('input'); | ||
var index = 0; | ||
@@ -57,5 +57,5 @@ for (index; index < this.element.attributes.length; index++) { | ||
this.element = input; | ||
util_1.setValue('ej2_instances', ejInstance, this.element); | ||
ej2_base_4.setValue('ej2_instances', ejInstance, this.element); | ||
} | ||
dom_1.attributes(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off', 'aria-live': 'assertive' }); | ||
ej2_base_3.attributes(this.element, { 'role': 'spinbutton', 'tabindex': '0', 'autocomplete': 'off', 'aria-live': 'assertive' }); | ||
var localeText = { incrementTitle: 'Increment value', decrementTitle: 'Decrement value', placeholder: '' }; | ||
@@ -83,8 +83,5 @@ this.l10n = new ej2_base_1.L10n('numerictextbox', localeText, this.locale); | ||
} | ||
if (!util_1.isNullOrUndefined(this.width)) { | ||
dom_1.setStyleAttribute(this.container, { 'width': util_1.formatUnit(this.width) }); | ||
if (!ej2_base_4.isNullOrUndefined(this.width)) { | ||
ej2_base_3.setStyleAttribute(this.container, { 'width': ej2_base_4.formatUnit(this.width) }); | ||
} | ||
if (!util_1.isNullOrUndefined(this.height)) { | ||
dom_1.setStyleAttribute(this.container, { 'height': util_1.formatUnit(this.height) }); | ||
} | ||
this.changeValue(this.value); | ||
@@ -103,3 +100,3 @@ this.wireEvents(); | ||
var prop = attributes_1[_i]; | ||
if (!util_1.isNullOrUndefined(this.element.getAttribute(prop))) { | ||
if (!ej2_base_4.isNullOrUndefined(this.element.getAttribute(prop))) { | ||
switch (prop) { | ||
@@ -125,3 +122,3 @@ case 'disabled': | ||
if ((value !== null && !isNaN(value)) || (prop === 'value')) { | ||
this.setProperties(util_1.setValue(prop, value, {}), true); | ||
this.setProperties(ej2_base_4.setValue(prop, value, {}), true); | ||
} | ||
@@ -137,8 +134,8 @@ break; | ||
NumericTextBox.prototype.initCultureFunc = function () { | ||
this.instance = new ej2_base_3.Internationalization(this.locale); | ||
this.instance = new ej2_base_5.Internationalization(this.locale); | ||
}; | ||
NumericTextBox.prototype.initCultureInfo = function () { | ||
this.cultureInfo.format = this.format; | ||
if (util_1.getValue('currency', this) !== null) { | ||
util_1.setValue('currency', this.currency, this.cultureInfo); | ||
if (ej2_base_4.getValue('currency', this) !== null) { | ||
ej2_base_4.setValue('currency', this.currency, this.cultureInfo); | ||
} | ||
@@ -160,13 +157,13 @@ }; | ||
this.container = inputObj.container; | ||
dom_1.addClass([this.container], ROOT); | ||
ej2_base_3.addClass([this.container], ROOT); | ||
if (this.readonly) { | ||
dom_1.attributes(this.element, { 'aria-readonly': 'true' }); | ||
ej2_base_3.attributes(this.element, { 'aria-readonly': 'true' }); | ||
} | ||
this.hiddenInput = (dom_1.createElement('input', { attrs: { type: 'hidden' } })); | ||
this.hiddenInput = (ej2_base_3.createElement('input', { attrs: { type: 'hidden' } })); | ||
this.inputName = this.inputName !== null ? this.inputName : this.element.id; | ||
this.element.removeAttribute('name'); | ||
dom_1.attributes(this.hiddenInput, { 'name': this.inputName }); | ||
ej2_base_3.attributes(this.hiddenInput, { 'name': this.inputName }); | ||
this.container.insertBefore(this.hiddenInput, this.element); | ||
if (this.inputStyle !== null) { | ||
dom_1.attributes(this.container, { 'style': this.inputStyle }); | ||
ej2_base_3.attributes(this.container, { 'style': this.inputStyle }); | ||
} | ||
@@ -176,3 +173,3 @@ }; | ||
this.spinDown = input_1.Input.appendSpan(SPINICON + ' ' + SPINDOWN, this.container); | ||
dom_1.attributes(this.spinDown, { | ||
ej2_base_3.attributes(this.spinDown, { | ||
'title': this.l10n.getConstant('decrementTitle'), | ||
@@ -182,3 +179,3 @@ 'aria-label': this.l10n.getConstant('decrementTitle') | ||
this.spinUp = input_1.Input.appendSpan(SPINICON + ' ' + SPINUP, this.container); | ||
dom_1.attributes(this.spinUp, { | ||
ej2_base_3.attributes(this.spinUp, { | ||
'title': this.l10n.getConstant('incrementTitle'), | ||
@@ -205,3 +202,3 @@ 'aria-label': this.l10n.getConstant('incrementTitle') | ||
this.setProperties({ min: this.min > this.max ? this.max : this.min }, true); | ||
dom_1.attributes(this.element, { 'aria-valuemin': this.min.toString(), 'aria-valuemax': this.max.toString() }); | ||
ej2_base_3.attributes(this.element, { 'aria-valuemin': this.min.toString(), 'aria-valuemax': this.max.toString() }); | ||
}; | ||
@@ -226,8 +223,8 @@ NumericTextBox.prototype.formattedValue = function (decimals, value) { | ||
if (this.isValidState) { | ||
dom_1.removeClass([this.container], ERROR); | ||
ej2_base_3.removeClass([this.container], ERROR); | ||
} | ||
else { | ||
dom_1.addClass([this.container], ERROR); | ||
ej2_base_3.addClass([this.container], ERROR); | ||
} | ||
dom_1.attributes(this.element, { 'aria-invalid': this.isValidState ? 'false' : 'true' }); | ||
ej2_base_3.attributes(this.element, { 'aria-invalid': this.isValidState ? 'false' : 'true' }); | ||
}; | ||
@@ -280,3 +277,3 @@ NumericTextBox.prototype.wireEvents = function () { | ||
} | ||
util_1.merge(eventArgs, this.changeEventArgs); | ||
ej2_base_4.merge(eventArgs, this.changeEventArgs); | ||
this.prevValue = this.value; | ||
@@ -372,3 +369,3 @@ this.trigger('change', eventArgs); | ||
this.element.value = this.isFocused ? value : this.instance.getNumberFormat(this.cultureInfo)(this.value); | ||
dom_1.attributes(this.element, { 'aria-valuenow': value }); | ||
ej2_base_3.attributes(this.element, { 'aria-valuenow': value }); | ||
this.hiddenInput.value = value; | ||
@@ -446,4 +443,4 @@ } | ||
NumericTextBox.prototype.numericRegex = function () { | ||
var numericObject = ej2_base_3.getNumericObject(this.locale); | ||
var decimalSeparator = util_1.getValue('decimal', numericObject); | ||
var numericObject = ej2_base_5.getNumericObject(this.locale); | ||
var decimalSeparator = ej2_base_4.getValue('decimal', numericObject); | ||
var fractionRule = '*'; | ||
@@ -486,3 +483,3 @@ if (decimalSeparator === DECIMALSEPARATOR) { | ||
this.isFocused = true; | ||
dom_1.removeClass([this.container], ERROR); | ||
ej2_base_3.removeClass([this.container], ERROR); | ||
this.prevValue = this.value; | ||
@@ -531,2 +528,3 @@ if ((this.value || this.value === 0)) { | ||
this.isPrevFocused = true; | ||
event.preventDefault(); | ||
} | ||
@@ -596,10 +594,10 @@ if (!this.getElementData(event)) { | ||
this.unwireEvents(); | ||
dom_1.detach(this.hiddenInput); | ||
ej2_base_3.detach(this.hiddenInput); | ||
if (this.showSpinButton) { | ||
this.unwireSpinBtnEvents(); | ||
dom_1.detach(this.spinUp); | ||
dom_1.detach(this.spinDown); | ||
ej2_base_3.detach(this.spinUp); | ||
ej2_base_3.detach(this.spinDown); | ||
} | ||
this.container.parentElement.appendChild(this.cloneElement); | ||
dom_1.detach(this.container); | ||
ej2_base_3.detach(this.container); | ||
_super.prototype.destroy.call(this); | ||
@@ -620,7 +618,4 @@ }; | ||
case 'width': | ||
dom_1.setStyleAttribute(this.container, { 'width': util_1.formatUnit(newProp.width) }); | ||
ej2_base_3.setStyleAttribute(this.container, { 'width': ej2_base_4.formatUnit(newProp.width) }); | ||
break; | ||
case 'height': | ||
dom_1.setStyleAttribute(this.container, { 'height': util_1.formatUnit(newProp.height) }); | ||
break; | ||
case 'cssClass': | ||
@@ -638,3 +633,3 @@ input_1.Input.setCssClass(newProp.cssClass, [this.container], oldProp.cssClass); | ||
if (this.readonly) { | ||
dom_1.attributes(this.element, { 'aria-readonly': 'true' }); | ||
ej2_base_3.attributes(this.element, { 'aria-readonly': 'true' }); | ||
} | ||
@@ -657,4 +652,4 @@ else { | ||
else { | ||
dom_1.detach(this.spinUp); | ||
dom_1.detach(this.spinDown); | ||
ej2_base_3.detach(this.spinUp); | ||
ej2_base_3.detach(this.spinDown); | ||
} | ||
@@ -667,3 +662,3 @@ break; | ||
case 'max': | ||
util_1.setValue(prop, util_1.getValue(prop, newProp), this); | ||
ej2_base_4.setValue(prop, ej2_base_4.getValue(prop, newProp), this); | ||
this.validateMinMax(); | ||
@@ -685,7 +680,7 @@ this.updateValue(this.value); | ||
case 'currency': | ||
util_1.setValue(prop, util_1.getValue(prop, newProp), this.cultureInfo); | ||
ej2_base_4.setValue(prop, ej2_base_4.getValue(prop, newProp), this.cultureInfo); | ||
this.updateValue(this.value); | ||
break; | ||
case 'format': | ||
util_1.setValue(prop, util_1.getValue(prop, newProp), this); | ||
ej2_base_4.setValue(prop, ej2_base_4.getValue(prop, newProp), this); | ||
this.initCultureInfo(); | ||
@@ -725,5 +720,2 @@ this.updateValue(this.value); | ||
ej2_base_1.Property(null) | ||
], NumericTextBox.prototype, "height", void 0); | ||
__decorate([ | ||
ej2_base_1.Property(null) | ||
], NumericTextBox.prototype, "placeholder", void 0); | ||
@@ -730,0 +722,0 @@ __decorate([ |
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 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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2881619
59
35557
Updated@syncfusion/ej2-base@^1.0.14