Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-buttons

Package Overview
Dependencies
Maintainers
3
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-buttons - npm Package Compare versions

Comparing version 17.1.38 to 17.1.40

6

CHANGELOG.md

@@ -5,2 +5,8 @@ # Changelog

### RadioButton
#### New Features
- Provided `getSelectedValue` method to find the value of selected radio button in a group.
## 17.1.1-beta (2019-01-29)

@@ -7,0 +13,0 @@

4

dist/ej2-buttons.umd.min.js
/*!
* filename: ej2-buttons.umd.min.js
* version : 17.1.38
* version : 17.1.40
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved.

@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license.

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base"],t):t(e.ej={},e.ej2Base)}(this,function(e,t){"use strict";function s(e,s,i,n,r,a){var o=n;if(n.tagName===s){var l=t.getValue("ej2_instances",n);o=e("input",{attrs:{type:i}});for(var c=["change","cssClass","label","labelPosition","id"],h=0,p=n.attributes.length;h<p;h++)-1===c.indexOf(n.attributes[h].nodeName)&&o.setAttribute(n.attributes[h].nodeName,n.attributes[h].nodeValue);t.attributes(n,{class:r,role:a,"aria-checked":"false"}),n.appendChild(o),t.setValue("ej2_instances",l,o),t.deleteObject(n,"ej2_instances")}return o}function i(e){for(var t,s=e.childNodes,i=0;i<s.length;i++)if(3===(t=s[i]).nodeType)return t;return null}function n(e,s,i){"INPUT"===i?(s.parentNode.insertBefore(e.element,s),t.detach(s),e.element.checked=!1,["name","value","disabled"].forEach(function(t){e.element.removeAttribute(t)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="")}function r(e,i,n,r,a){r=s(e.createElement,i,"checkbox",r,n,a),e.element=r,"checkbox"!==e.element.getAttribute("type")&&e.element.setAttribute("type","checkbox"),e.element.id||(e.element.id=t.getUniqueID("e-"+a))}function a(e,t){if(t){var s=document.createEvent("MouseEvents");s.initEvent(e.type,!1,!0),t.dispatchEvent(s)}}function o(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var l=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),c=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},h="e-rtl",p="e-btn",d="e-primary",u="e-icon-btn",m=function(e){function s(t,s){return e.call(this,t,s)||this}return l(s,e),s.prototype.preRender=function(){},s.prototype.render=function(){this.initialize()},s.prototype.initialize=function(){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.isPrimary&&this.element.classList.add(d),this.content&&(this.element.innerHTML=this.content),this.setIconCss(),this.enableRtl&&this.element.classList.add(h),this.disabled?this.controlStatus(this.disabled):this.wireEvents(),this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+p})},s.prototype.controlStatus=function(e){this.element.disabled=e},s.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(u);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},s.prototype.wireEvents=function(){this.isToggle&&t.EventHandler.add(this.element,"click",this.btnClickHandler,this)},s.prototype.unWireEvents=function(){this.isToggle&&t.EventHandler.remove(this.element,"click",this.btnClickHandler)},s.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},s.prototype.destroy=function(){var s,i=[d,h,u,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn"];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),e.prototype.destroy.call(this),t.removeClass([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.innerHTML=this.element.innerHTML.replace(this.content,"")),(s=this.element.querySelector("span.e-btn-icon"))&&t.detach(s),this.unWireEvents(),this.removeRippleEffect()},s.prototype.getModuleName=function(){return"btn"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.Inject=function(){},s.prototype.onPropertyChanged=function(e,s){for(var n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"isPrimary":e.isPrimary?this.element.classList.add(d):this.element.classList.remove(d);break;case"disabled":this.controlStatus(e.disabled),this.unWireEvents();break;case"iconCss":var a=this.element.querySelector("span.e-btn-icon");a?e.iconCss?(a.className="e-btn-icon "+e.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?a.classList.add("e-icon-left"):a.classList.add("e-icon-right"))):t.detach(a):this.setIconCss();break;case"iconPosition":t.removeClass([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(a=this.element.querySelector("span.e-btn-icon"))&&t.detach(a),this.setIconCss();break;case"cssClass":s.cssClass&&t.removeClass([this.element],s.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?this.element.classList.add(h):this.element.classList.remove(h);break;case"content":i(this.element)||this.element.classList.remove(u),this.element.innerHTML=e.content,this.setIconCss();break;case"isToggle":e.isToggle?t.EventHandler.add(this.element,"click",this.btnClickHandler,this):(t.EventHandler.remove(this.element,"click",this.btnClickHandler),t.removeClass([this.element],["e-active"]))}}},c([t.Property("Left")],s.prototype,"iconPosition",void 0),c([t.Property("")],s.prototype,"iconCss",void 0),c([t.Property(!1)],s.prototype,"disabled",void 0),c([t.Property(!1)],s.prototype,"isPrimary",void 0),c([t.Property("")],s.prototype,"cssClass",void 0),c([t.Property("")],s.prototype,"content",void 0),c([t.Property(!1)],s.prototype,"isToggle",void 0),c([t.Property()],s.prototype,"locale",void 0),c([t.Event()],s.prototype,"created",void 0),s=c([t.NotifyPropertyChanges],s)}(t.Component),f=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),v=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},y="e-checkbox-disabled",b="e-frame",g="e-ripple-container",C="e-ripple-check",E="e-ripple-stop",k="e-checkbox-wrapper",H=function(e){function i(t,s){var i=e.call(this,t,s)||this;return i.isFocused=!1,i.isMouseClick=!1,i}return f(i,e),i.prototype.changeState=function(e){var s,i,n=this.getWrapper().getElementsByClassName(b)[0];t.isRippleEnabled&&(i=this.getWrapper().getElementsByClassName(g)[0]),"check"===e?(n.classList.remove("e-stop"),n.classList.add("e-check"),i&&(i.classList.remove(E),i.classList.add(C)),s="true",this.element.checked=!0):"uncheck"===e?(t.removeClass([n],["e-check","e-stop"]),i&&t.removeClass([i],[C,E]),s="false",this.element.checked=!1):(n.classList.remove("e-check"),n.classList.add("e-stop"),i&&(i.classList.remove(C),i.classList.add(E)),s="mixed",this.element.indeterminate=!0),this.getWrapper().setAttribute("aria-checked",s)},i.prototype.clickHandler=function(e){this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck"),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck"),this.checked=!1):(this.changeState("check"),this.checked=!0);var t={checked:this.element.checked,event:e};this.trigger("change",t)},i.prototype.destroy=function(){var s=this,i=this.getWrapper();e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode.insertBefore(this.element,i),t.detach(i),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){s.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus"),this.isFocused=!1},i.prototype.getModuleName=function(){return"checkbox"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},i.prototype.getWrapper=function(){return this.element.parentElement.parentElement},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState("check"),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},i.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains(k)||(e=this.createElement("div",{className:k,attrs:{role:"checkbox","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}}),i=this.createElement("span",{className:"e-icons "+b});if(this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),e.appendChild(s),s.appendChild(this.element),o(this,s),s.appendChild(i),t.isRippleEnabled){var n=this.createElement("span",{className:g});"Before"===this.labelPosition?s.appendChild(n):s.insertBefore(n,i),t.rippleEffect(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},i.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},i.prototype.labelMouseHandler=function(e){this.isMouseClick=!0;a(e,this.getWrapper().getElementsByClassName(g)[0])},i.prototype.onPropertyChanged=function(e,s){for(var i=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(e.checked?"check":"uncheck");break;case"indeterminate":e.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,i.classList.remove(y),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":var a=i.getElementsByClassName("e-label")[0],o=i.getElementsByTagName("label")[0];t.detach(a),"After"===e.labelPosition?o.appendChild(a):o.insertBefore(a,i.getElementsByClassName(b)[0]);break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.element.setAttribute("value",e.value)}}},i.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=s(this.createElement,"EJS-CHECKBOX","checkbox",e,k,"checkbox"),this.element=e,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents()},i.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(y),e.setAttribute("aria-disabled","true")},i.prototype.setText=function(e){var t=this.getWrapper().getElementsByClassName("e-label")[0];if(t)t.textContent=e;else{t=this.createElement("span",{className:"e-label",innerHTML:e});var s=this.getWrapper().getElementsByTagName("label")[0];"Before"===this.labelPosition?s.insertBefore(t,this.getWrapper().getElementsByClassName(b)[0]):s.appendChild(t)}},i.prototype.changeHandler=function(e){e.stopPropagation()},i.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,t.attributes(this.element,{checked:this.initialCheckedValue.toString()})},i.prototype.unWireEvents=function(){var e=this.getWrapper();t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var s=e.getElementsByTagName("label")[0];t.EventHandler.remove(s,"mousedown",this.labelMouseHandler),t.EventHandler.remove(s,"mouseup",this.labelMouseHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.remove(this.element,"change",this.changeHandler)},i.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var s=e.getElementsByTagName("label")[0];t.EventHandler.add(s,"mousedown",this.labelMouseHandler,this),t.EventHandler.add(s,"mouseup",this.labelMouseHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.add(this.element,"change",this.changeHandler,this)},v([t.Event()],i.prototype,"change",void 0),v([t.Event()],i.prototype,"created",void 0),v([t.Property(!1)],i.prototype,"checked",void 0),v([t.Property("")],i.prototype,"cssClass",void 0),v([t.Property(!1)],i.prototype,"disabled",void 0),v([t.Property(!1)],i.prototype,"indeterminate",void 0),v([t.Property("")],i.prototype,"label",void 0),v([t.Property("After")],i.prototype,"labelPosition",void 0),v([t.Property("")],i.prototype,"name",void 0),v([t.Property("")],i.prototype,"value",void 0),i=v([t.NotifyPropertyChanges],i)}(t.Component),P=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),L=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},x="e-label",w="e-ripple-container",N="e-radio-wrapper",S=function(e){function i(t,s){var i=e.call(this,t,s)||this;return i.isKeyPressed=!1,i}P(i,e),n=i,i.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t={value:this.value,event:e};this.trigger("change",t),"EJS-RADIOBUTTON"===this.tagName&&e.stopPropagation()},i.prototype.updateChange=function(e){for(var s,i,r=this.element.getAttribute("name"),a=document.querySelectorAll('input.e-radio[name="'+r+'"]'),o=0;o<a.length;o++)(s=a[o])!==this.element&&((i=t.getInstance(s,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},i.prototype.destroy=function(){var s=this,i=this.element.parentElement;e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode.insertBefore(this.element,i),t.detach(i),this.element.checked=!1,["name","value","disabled"].forEach(function(e){s.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")},i.prototype.focusHandler=function(){this.isKeyPressed&&this.getLabel().classList.add("e-focus")},i.prototype.focusOutHandler=function(){this.getLabel().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"radio"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getLabel=function(){return this.element.nextElementSibling},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},i.prototype.initWrapper=function(){var e,s=this.element.parentElement;s.classList.contains(N)||(s=this.createElement("div",{className:N}),this.element.parentNode.insertBefore(s,this.element));var i=this.createElement("label",{attrs:{for:this.element.id}});s.appendChild(this.element),s.appendChild(i),t.isRippleEnabled&&(e=this.createElement("span",{className:w}),i.appendChild(e),t.rippleEffect(e,{duration:400,isCenterRipple:!0})),this.enableRtl&&i.classList.add("e-rtl"),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),this.label&&this.setText(this.label)},i.prototype.keyDownHandler=function(){this.isKeyPressed=!0},i.prototype.labelRippleHandler=function(e){a(e,this.getLabel().getElementsByClassName(w)[0])},i.prototype.mouseDownHandler=function(){this.isKeyPressed=!1},i.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&t.attributes(this.element,{checked:"true"})},i.prototype.onPropertyChanged=function(e,s){for(var i=this.getLabel(),n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"checked":e.checked&&this.updateChange(e.checked),this.element.checked=e.checked;break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":"Before"===e.labelPosition?i.classList.add("e-right"):i.classList.remove("e-right");break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.element.setAttribute("value",e.value)}}},i.prototype.preRender=function(){var e=this.element;if(this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=s(this.createElement,"EJS-RADIOBUTTON","radio",e,N,"radio"),this.element=e,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var i=this.element.getAttribute("formcontrolname");i&&(this.setProperties({name:i},!0),this.element.setAttribute("name",i))}},i.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents()},i.prototype.setDisabled=function(){this.element.disabled=!0},i.prototype.setText=function(e){var t=this.getLabel(),s=t.getElementsByClassName(x)[0];s?s.textContent=e:(s=this.createElement("span",{className:x,innerHTML:e}),t.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},i.prototype.unWireEvents=function(){var e=this.getLabel();t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(document,"keydown",this.keyDownHandler),t.EventHandler.remove(e,"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var s=e.getElementsByClassName(x)[0];s&&(t.EventHandler.remove(s,"mousedown",this.labelRippleHandler),t.EventHandler.remove(s,"mouseup",this.labelRippleHandler)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},i.prototype.wireEvents=function(){var e=this.getLabel();t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(document,"keydown",this.keyDownHandler,this),t.EventHandler.add(e,"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var s=e.getElementsByClassName(x)[0];s&&(t.EventHandler.add(s,"mousedown",this.labelRippleHandler,this),t.EventHandler.add(s,"mouseup",this.labelRippleHandler,this)),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)};var n;return L([t.Event()],i.prototype,"change",void 0),L([t.Event()],i.prototype,"created",void 0),L([t.Property(!1)],i.prototype,"checked",void 0),L([t.Property("")],i.prototype,"cssClass",void 0),L([t.Property(!1)],i.prototype,"disabled",void 0),L([t.Property("")],i.prototype,"label",void 0),L([t.Property("After")],i.prototype,"labelPosition",void 0),L([t.Property("")],i.prototype,"name",void 0),L([t.Property("")],i.prototype,"value",void 0),i=n=L([t.NotifyPropertyChanges],i)}(t.Component),O=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),A=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},T="e-switch-disabled",R="e-ripple-container",I="e-ripple-check",W="e-switch-wrapper",j="e-switch-active",M=function(e){function s(t,s){var i=e.call(this,t,s)||this;return i.isKeyPressed=!1,i.isDrag=!1,i}return O(s,e),s.prototype.changeState=function(e){var s,i,n=this.getWrapper(),r=n.querySelector(".e-switch-inner"),a=n.querySelector(".e-switch-handle");t.isRippleEnabled&&(i=n.getElementsByClassName(R)[0]),e?(t.addClass([r,a],j),s="true",this.element.checked=!0,this.checked=!0,i&&t.addClass([i],[I])):(t.removeClass([r,a],j),s="false",this.element.checked=!1,this.checked=!1,i&&t.removeClass([i],[I])),n.setAttribute("aria-checked",s)},s.prototype.clickHandler=function(e){this.isDrag=!1,this.focusOutHandler(),this.changeState(!this.checked),this.element.focus();var t={checked:this.element.checked,event:e};this.trigger("change",t)},s.prototype.destroy=function(){e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),n(this,this.getWrapper(),this.tagName)},s.prototype.focusHandler=function(){this.isKeyPressed&&this.getWrapper().classList.add("e-focus")},s.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},s.prototype.getModuleName=function(){return"switch"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element.parentElement},s.prototype.initialize=function(){t.isNullOrUndefined(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},s.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains(W)||(e=this.createElement("div",{className:W,attrs:{role:"switch","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var s=this.createElement("span",{className:"e-switch-inner"}),i=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),r=this.createElement("span",{className:"e-switch-handle"});if(e.appendChild(this.element),o(this,e),s.appendChild(i),s.appendChild(n),e.appendChild(s),e.appendChild(r),t.isRippleEnabled){var a=this.createElement("span",{className:R});r.appendChild(a),t.rippleEffect(a,{duration:400,isCenterRipple:!0})}this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" "))},s.prototype.onPropertyChanged=function(e,s){for(var i=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"checked":this.changeState(e.checked);break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,i.classList.remove(T),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"value":this.element.setAttribute("value",e.value);break;case"name":this.element.setAttribute("name",e.name);break;case"onLabel":case"offLabel":this.setLabel(e.onLabel,e.offLabel);break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "))}}},s.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH",W,e,this.getModuleName())},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents()},s.prototype.rippleHandler=function(e){a(e,this.getWrapper().getElementsByClassName(R)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isKeyPressed=!1)},s.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(R)[0];if(t){var s=document.createEvent("MouseEvents");s.initEvent(e,!1,!0),t.dispatchEvent(s)}},s.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(T),e.setAttribute("aria-disabled","true")},s.prototype.setLabel=function(e,t){var s=this.getWrapper();e&&(s.querySelector(".e-switch-on").textContent=e),t&&(s.querySelector(".e-switch-off").textContent=t)},s.prototype.switchFocusHandler=function(){this.isKeyPressed=!0},s.prototype.switchMouseUp=function(e){var t=e.target;this.getWrapper().getElementsByClassName(R)[0];"touchmove"===e.type&&e.preventDefault(),"touchstart"===e.type&&(this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&t.className.indexOf("e-switch")<0||"touchend"===e.type)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault())},s.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,t.attributes(this.element,{checked:this.initialSwitchCheckedValue.toString()})},s.prototype.toggle=function(){this.clickHandler()},s.prototype.wireEvents=function(){var e=this.getWrapper();e.querySelector(".e-switch-handle");this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyDownHandler=this.switchFocusHandler.bind(this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(document,"mouseup",this.delegateMouseUpHandler,this),t.EventHandler.add(document,"keydown",this.delegateKeyDownHandler,this),t.EventHandler.add(e,"mousedown mouseup",this.rippleHandler,this),t.EventHandler.add(e,"touchstart touchmove touchend",this.switchMouseUp,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.unWireEvents=function(){var e=this.getWrapper();e.querySelector(".e-switch-handle");t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(document,"mouseup",this.delegateMouseUpHandler),t.EventHandler.remove(document,"keydown",this.delegateKeyDownHandler),t.EventHandler.remove(e,"mousedown mouseup",this.rippleHandler),t.EventHandler.remove(e,"touchstart touchmove touchend",this.switchMouseUp),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},A([t.Event()],s.prototype,"change",void 0),A([t.Event()],s.prototype,"created",void 0),A([t.Property(!1)],s.prototype,"checked",void 0),A([t.Property("")],s.prototype,"cssClass",void 0),A([t.Property(!1)],s.prototype,"disabled",void 0),A([t.Property("")],s.prototype,"name",void 0),A([t.Property("")],s.prototype,"onLabel",void 0),A([t.Property("")],s.prototype,"offLabel",void 0),A([t.Property("")],s.prototype,"value",void 0),s=A([t.NotifyPropertyChanges],s)}(t.Component),D=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),B=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},_={chipSet:"e-chip-set",chip:"e-chip",avatar:"e-chip-avatar",text:"e-chip-text",icon:"e-chip-icon",delete:"e-chip-delete",deleteIcon:"e-dlt-btn",multiSelection:"e-multi-selection",singleSelection:"e-selection",active:"e-active",chipWrapper:"e-chip-avatar-wrap",iconWrapper:"e-chip-icon-wrap",focused:"e-focused",disabled:"e-disabled",rtl:"e-rtl"},U=function(e){function s(t,s){return e.call(this,t,s)||this}return D(s,e),s.prototype.preRender=function(){},s.prototype.render=function(){this.type=this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",this.setAttributes(),this.createChip(),this.setRtl(),this.wireEvent(!1),this.select(this.selectedChips),this.rippleFunctin=t.rippleEffect(this.element,{selector:".e-chip"})},s.prototype.createChip=function(){this.innerText=this.element.innerText.trim(),this.element.innerHTML="",this.chipCreation("chip"===this.type?[this.innerText?this.innerText:this.text]:this.chips)},s.prototype.setAttributes=function(){"chip"===this.type?(this.element.tabIndex=0,this.element.setAttribute("role","option")):(this.element.classList.add(_.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(_.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(_.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},s.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](_.rtl)},s.prototype.chipCreation=function(e){for(var s=[],i=0;i<e.length;i++){var n=this.getFieldValues(e[i]),r=this.elementCreation(n),a=(_.chip+" "+(n.enabled?" ":_.disabled)+" "+(n.avatarIconCss||n.avatarText?_.chipWrapper:n.leadingIconCss?_.iconWrapper:" ")+" "+n.cssClass).split(" ").filter(function(e){return e});if("chip"===this.type)s=r,t.addClass([this.element],a),this.element.setAttribute("aria-label",n.text);else{var o=this.createElement("DIV",{className:a.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":n.text,"aria-selected":"false"}});t.append(r,o),s.push(o)}}t.append(s,this.element)},s.prototype.getFieldValues=function(e){var s="false"!==this.enabled.toString();return{text:"object"==typeof e?e.text?e.text.toString():this.text.toString():"chip"===this.type?this.innerText?this.innerText:this.text.toString():e.toString(),cssClass:"object"==typeof e&&e.cssClass?e.cssClass.toString():this.cssClass.toString(),leadingIconCss:"object"==typeof e&&e.leadingIconCss?e.leadingIconCss.toString():this.leadingIconCss.toString(),avatarIconCss:"object"==typeof e&&e.avatarIconCss?e.avatarIconCss.toString():this.avatarIconCss.toString(),avatarText:"object"==typeof e&&e.avatarText?e.avatarText.toString():this.avatarText.toString(),trailingIconCss:"object"==typeof e&&e.trailingIconCss?e.trailingIconCss.toString():this.trailingIconCss.toString(),enabled:"object"==typeof e?t.isNullOrUndefined(e.enabled)?s:"false"!==e.enabled.toString():s}},s.prototype.elementCreation=function(e){var t=[];if(e.avatarText||e.avatarIconCss){var s=(_.avatar+" "+e.avatarIconCss).trim(),i=this.createElement("span",{className:s});i.innerText=e.avatarText,t.push(i)}else if(e.leadingIconCss){s=(_.icon+" "+e.leadingIconCss).trim();var n=this.createElement("span",{className:s});t.push(n)}var r=this.createElement("span",{className:_.text});if(r.innerText=e.text,t.push(r),e.trailingIconCss||"chip"!==this.type&&this.enableDelete){s=(_.delete+" "+(e.trailingIconCss?e.trailingIconCss:_.deleteIcon)).trim();var a=this.createElement("span",{className:s});t.push(a)}return t},s.prototype.find=function(e){var t,s=e instanceof HTMLElement?e:this.element.querySelectorAll("."+_.chip)[e];return s&&"chip"!==this.type&&((t={text:void 0,index:void 0,element:void 0,data:void 0}).index=Array.prototype.slice.call(this.element.querySelectorAll("."+_.chip)).indexOf(s),t.text="object"==typeof this.chips[t.index]?this.chips[t.index].text?this.chips[t.index].text.toString():"":this.chips[t.index].toString(),t.data=this.chips[t.index],t.element=s),t},s.prototype.add=function(e){var t;if("chip"!==this.type){var s=e instanceof Array?e:[e];(t=this.chips).push.apply(t,s),this.chipCreation(s)}},s.prototype.select=function(e){if("chip"!==this.type&&"None"!==this.selection)for(var t=e instanceof Array?e:[e],s=0;s<t.length;s++){var i=t[s]instanceof HTMLElement?t[s]:this.element.querySelectorAll("."+_.chip)[t[s]];i instanceof HTMLElement&&this.selectionHandler(i)}},s.prototype.remove=function(e){var t=this;if("chip"!==this.type){var s=e instanceof Array?e:[e],i=[],n=this.element.querySelectorAll("."+_.chip);s.forEach(function(e){var t=e instanceof HTMLElement?e:n[e];t instanceof HTMLElement&&i.push(t)}),i.forEach(function(e){var s=t.element.querySelectorAll("."+_.chip),i=Array.prototype.slice.call(s).indexOf(e);t.deleteHandler(e,i)})}},s.prototype.getSelectedChips=function(){var e,s=this;if("chip"!==this.type&&"None"!==this.selection){var i={texts:[],Indexes:[],data:[],elements:[]};this.element.querySelectorAll("."+_.active).forEach(function(e){i.elements.push(e);var t=Array.prototype.slice.call(s.element.querySelectorAll("."+_.chip)).indexOf(e);i.Indexes.push(t),i.data.push(s.chips[t]);var n="object"==typeof s.chips[t]?s.chips[t].text.toString():s.chips[t].toString();i.texts.push(n)});var n={text:i.texts[0],index:i.Indexes[0],data:i.data[0],element:i.elements[0]};e=t.isNullOrUndefined(n.index)?void 0:"Multiple"===this.selection?i:n}return e},s.prototype.wireEvent=function(e){e?(t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keydown",this.keyHandler),t.EventHandler.remove(this.element,"keyup",this.keyHandler)):(t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyHandler,this),t.EventHandler.add(this.element,"keyup",this.keyHandler,this))},s.prototype.keyHandler=function(e){e.target.classList.contains(_.chip)&&("keydown"===e.type?13===e.keyCode?this.clickHandler(e):46===e.keyCode&&this.enableDelete&&this.clickHandler(e,!0):9===e.keyCode&&this.focusInHandler(e.target))},s.prototype.focusInHandler=function(e){e.classList.contains(_.focused)||e.classList.add(_.focused)},s.prototype.focusOutHandler=function(e){var s=t.closest(e.target,"."+_.chip),i="chip"===this.type?this.element.classList.contains(_.focused)?this.element:null:this.element.querySelector("."+_.focused);s&&i&&i.classList.remove(_.focused)},s.prototype.clickHandler=function(e,s){void 0===s&&(s=!1);var i=t.closest(e.target,"."+_.chip);if(i)if("chip"!==this.type){var n=this.find(i);n.event=e;if((e.target.classList.contains(_.delete)?e.target:s?i.querySelector("."+_.delete):void 0)&&this.enableDelete){n.cancel=!1;var r=n;this.trigger("delete",r),r.cancel||this.deleteHandler(n.element,n.index)}else if("None"!==this.selection){this.selectionHandler(i),n.selected=i.classList.contains(_.active);var a=n;this.trigger("click",a)}else{this.focusInHandler(i);var o=n;this.trigger("click",o)}}else{this.focusInHandler(i);o={text:this.innerText?this.innerText:this.text,element:i,data:this.text,event:e};this.trigger("click",o)}},s.prototype.selectionHandler=function(e){if("Single"===this.selection){var t=this.element.querySelector("."+_.active);t&&t!==e&&(t.classList.remove(_.active),e.setAttribute("aria-selected","false"))}e.classList.contains(_.active)?(e.classList.remove(_.active),e.setAttribute("aria-selected","false")):(e.classList.add(_.active),e.setAttribute("aria-selected","true"))},s.prototype.deleteHandler=function(e,s){this.chips.splice(s,1),t.detach(e)},s.prototype.destroy=function(){e.prototype.destroy.call(this),t.removeClass([this.element],[_.chipSet,_.chip,_.rtl,_.multiSelection,_.singleSelection,_.disabled,_.chipWrapper,_.iconWrapper,_.active,_.focused].concat(this.cssClass.toString().split(" ").filter(function(e){return e}))),this.removeMultipleAttributes(["tabindex","role","aria-label","aria-multiselectable"],this.element),this.wireEvent(!0),this.rippleFunctin(),this.element.innerHTML="",this.element.innerText=this.innerText},s.prototype.removeMultipleAttributes=function(e,t){e.forEach(function(e){t.removeAttribute(e)})},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.getModuleName=function(){return"chip-list"},s.prototype.onPropertyChanged=function(e,s){for(var i=0,n=Object.keys(e);i<n.length;i++){switch(n[i]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"selection":case"enableDelete":case"enabled":this.refresh();break;case"cssClass":"chip"===this.type?(t.removeClass([this.element],s.cssClass.toString().split(" ").filter(function(e){return e})),t.addClass([this.element],e.cssClass.toString().split(" ").filter(function(e){return e}))):this.refresh();break;case"selectedChips":this.select(e.selectedChips);break;case"enableRtl":this.setRtl()}}},B([t.Property([])],s.prototype,"chips",void 0),B([t.Property("")],s.prototype,"text",void 0),B([t.Property("")],s.prototype,"avatarText",void 0),B([t.Property("")],s.prototype,"avatarIconCss",void 0),B([t.Property("")],s.prototype,"leadingIconCss",void 0),B([t.Property("")],s.prototype,"trailingIconCss",void 0),B([t.Property("")],s.prototype,"cssClass",void 0),B([t.Property(!0)],s.prototype,"enabled",void 0),B([t.Property([])],s.prototype,"selectedChips",void 0),B([t.Property("None")],s.prototype,"selection",void 0),B([t.Property(!1)],s.prototype,"enableDelete",void 0),B([t.Event()],s.prototype,"created",void 0),B([t.Event()],s.prototype,"click",void 0),B([t.Event()],s.prototype,"delete",void 0),s=B([t.NotifyPropertyChanges],s)}(t.Component),q=function(){return function(){}}();e.wrapperInitialize=s,e.getTextNode=i,e.destroy=n,e.preRender=r,e.createCheckBox=function(e,s,i){void 0===s&&(s=!1),void 0===i&&(i={});var n=e("div",{className:"e-checkbox-wrapper e-css"});if(i.cssClass&&t.addClass([n],i.cssClass.split(" ")),i.enableRtl&&n.classList.add("e-rtl"),s){var r=e("span",{className:"e-ripple-container"});t.rippleEffect(r,{isCenterRipple:!0,duration:400}),n.appendChild(r)}var a=e("span",{className:"e-frame e-icons"});if(i.checked&&a.classList.add("e-check"),n.appendChild(a),i.label){var o=e("span",{className:"e-label",innerHTML:i.label});n.appendChild(o)}return n},e.rippleMouseHandler=a,e.setHiddenInput=o,e.Button=m,e.CheckBox=H,e.RadioButton=S,e.Switch=M,e.classNames=_,e.ChipList=U,e.Chip=q,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base"],t):t(e.ej={},e.ej2Base)}(this,function(e,t){"use strict";function s(e,s,i,n,r,a){var o=n;if(n.tagName===s){var l=t.getValue("ej2_instances",n);o=e("input",{attrs:{type:i}});for(var c=["change","cssClass","label","labelPosition","id"],h=0,p=n.attributes.length;h<p;h++)-1===c.indexOf(n.attributes[h].nodeName)&&o.setAttribute(n.attributes[h].nodeName,n.attributes[h].nodeValue);t.attributes(n,{class:r,role:a,"aria-checked":"false"}),n.appendChild(o),t.setValue("ej2_instances",l,o),t.deleteObject(n,"ej2_instances")}return o}function i(e){for(var t,s=e.childNodes,i=0;i<s.length;i++)if(3===(t=s[i]).nodeType)return t;return null}function n(e,s,i){"INPUT"===i?(s.parentNode.insertBefore(e.element,s),t.detach(s),e.element.checked=!1,["name","value","disabled"].forEach(function(t){e.element.removeAttribute(t)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="")}function r(e,i,n,r,a){r=s(e.createElement,i,"checkbox",r,n,a),e.element=r,"checkbox"!==e.element.getAttribute("type")&&e.element.setAttribute("type","checkbox"),e.element.id||(e.element.id=t.getUniqueID("e-"+a))}function a(e,t){if(t){var s=document.createEvent("MouseEvents");s.initEvent(e.type,!1,!0),t.dispatchEvent(s)}}function o(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var l=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),c=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},h="e-rtl",p="e-btn",d="e-primary",u="e-icon-btn",m=function(e){function s(t,s){return e.call(this,t,s)||this}return l(s,e),s.prototype.preRender=function(){},s.prototype.render=function(){this.initialize()},s.prototype.initialize=function(){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.isPrimary&&this.element.classList.add(d),this.content&&(this.element.innerHTML=this.content),this.setIconCss(),this.enableRtl&&this.element.classList.add(h),this.disabled?this.controlStatus(this.disabled):this.wireEvents(),this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+p})},s.prototype.controlStatus=function(e){this.element.disabled=e},s.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(u);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},s.prototype.wireEvents=function(){this.isToggle&&t.EventHandler.add(this.element,"click",this.btnClickHandler,this)},s.prototype.unWireEvents=function(){this.isToggle&&t.EventHandler.remove(this.element,"click",this.btnClickHandler)},s.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},s.prototype.destroy=function(){var s,i=[d,h,u,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn"];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),e.prototype.destroy.call(this),t.removeClass([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.innerHTML=this.element.innerHTML.replace(this.content,"")),(s=this.element.querySelector("span.e-btn-icon"))&&t.detach(s),this.unWireEvents(),this.removeRippleEffect()},s.prototype.getModuleName=function(){return"btn"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.Inject=function(){},s.prototype.onPropertyChanged=function(e,s){for(var n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"isPrimary":e.isPrimary?this.element.classList.add(d):this.element.classList.remove(d);break;case"disabled":this.controlStatus(e.disabled),this.unWireEvents();break;case"iconCss":var a=this.element.querySelector("span.e-btn-icon");a?e.iconCss?(a.className="e-btn-icon "+e.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?a.classList.add("e-icon-left"):a.classList.add("e-icon-right"))):t.detach(a):this.setIconCss();break;case"iconPosition":t.removeClass([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(a=this.element.querySelector("span.e-btn-icon"))&&t.detach(a),this.setIconCss();break;case"cssClass":s.cssClass&&t.removeClass([this.element],s.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?this.element.classList.add(h):this.element.classList.remove(h);break;case"content":i(this.element)||this.element.classList.remove(u),this.element.innerHTML=e.content,this.setIconCss();break;case"isToggle":e.isToggle?t.EventHandler.add(this.element,"click",this.btnClickHandler,this):(t.EventHandler.remove(this.element,"click",this.btnClickHandler),t.removeClass([this.element],["e-active"]))}}},c([t.Property("Left")],s.prototype,"iconPosition",void 0),c([t.Property("")],s.prototype,"iconCss",void 0),c([t.Property(!1)],s.prototype,"disabled",void 0),c([t.Property(!1)],s.prototype,"isPrimary",void 0),c([t.Property("")],s.prototype,"cssClass",void 0),c([t.Property("")],s.prototype,"content",void 0),c([t.Property(!1)],s.prototype,"isToggle",void 0),c([t.Property()],s.prototype,"locale",void 0),c([t.Event()],s.prototype,"created",void 0),s=c([t.NotifyPropertyChanges],s)}(t.Component),f=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),v=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},y="e-checkbox-disabled",b="e-frame",g="e-ripple-container",C="e-ripple-check",E="e-ripple-stop",k="e-checkbox-wrapper",H=function(e){function i(t,s){var i=e.call(this,t,s)||this;return i.isFocused=!1,i.isMouseClick=!1,i}return f(i,e),i.prototype.changeState=function(e){var s,i,n=this.getWrapper().getElementsByClassName(b)[0];t.isRippleEnabled&&(i=this.getWrapper().getElementsByClassName(g)[0]),"check"===e?(n.classList.remove("e-stop"),n.classList.add("e-check"),i&&(i.classList.remove(E),i.classList.add(C)),s="true",this.element.checked=!0):"uncheck"===e?(t.removeClass([n],["e-check","e-stop"]),i&&t.removeClass([i],[C,E]),s="false",this.element.checked=!1):(n.classList.remove("e-check"),n.classList.add("e-stop"),i&&(i.classList.remove(C),i.classList.add(E)),s="mixed",this.element.indeterminate=!0),this.getWrapper().setAttribute("aria-checked",s)},i.prototype.clickHandler=function(e){this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck"),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck"),this.checked=!1):(this.changeState("check"),this.checked=!0);var t={checked:this.element.checked,event:e};this.trigger("change",t)},i.prototype.destroy=function(){var s=this,i=this.getWrapper();e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode.insertBefore(this.element,i),t.detach(i),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){s.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus"),this.isFocused=!1},i.prototype.getModuleName=function(){return"checkbox"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},i.prototype.getWrapper=function(){return this.element.parentElement.parentElement},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState("check"),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},i.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains(k)||(e=this.createElement("div",{className:k,attrs:{role:"checkbox","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}}),i=this.createElement("span",{className:"e-icons "+b});if(this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),e.appendChild(s),s.appendChild(this.element),o(this,s),s.appendChild(i),t.isRippleEnabled){var n=this.createElement("span",{className:g});"Before"===this.labelPosition?s.appendChild(n):s.insertBefore(n,i),t.rippleEffect(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},i.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},i.prototype.labelMouseHandler=function(e){this.isMouseClick=!0;a(e,this.getWrapper().getElementsByClassName(g)[0])},i.prototype.onPropertyChanged=function(e,s){for(var i=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(e.checked?"check":"uncheck");break;case"indeterminate":e.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,i.classList.remove(y),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":var a=i.getElementsByClassName("e-label")[0],o=i.getElementsByTagName("label")[0];t.detach(a),"After"===e.labelPosition?o.appendChild(a):o.insertBefore(a,i.getElementsByClassName(b)[0]);break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.element.setAttribute("value",e.value)}}},i.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=s(this.createElement,"EJS-CHECKBOX","checkbox",e,k,"checkbox"),this.element=e,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents()},i.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(y),e.setAttribute("aria-disabled","true")},i.prototype.setText=function(e){var t=this.getWrapper().getElementsByClassName("e-label")[0];if(t)t.textContent=e;else{t=this.createElement("span",{className:"e-label",innerHTML:e});var s=this.getWrapper().getElementsByTagName("label")[0];"Before"===this.labelPosition?s.insertBefore(t,this.getWrapper().getElementsByClassName(b)[0]):s.appendChild(t)}},i.prototype.changeHandler=function(e){e.stopPropagation()},i.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,t.attributes(this.element,{checked:this.initialCheckedValue.toString()})},i.prototype.unWireEvents=function(){var e=this.getWrapper();t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var s=e.getElementsByTagName("label")[0];t.EventHandler.remove(s,"mousedown",this.labelMouseHandler),t.EventHandler.remove(s,"mouseup",this.labelMouseHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.remove(this.element,"change",this.changeHandler)},i.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var s=e.getElementsByTagName("label")[0];t.EventHandler.add(s,"mousedown",this.labelMouseHandler,this),t.EventHandler.add(s,"mouseup",this.labelMouseHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.add(this.element,"change",this.changeHandler,this)},v([t.Event()],i.prototype,"change",void 0),v([t.Event()],i.prototype,"created",void 0),v([t.Property(!1)],i.prototype,"checked",void 0),v([t.Property("")],i.prototype,"cssClass",void 0),v([t.Property(!1)],i.prototype,"disabled",void 0),v([t.Property(!1)],i.prototype,"indeterminate",void 0),v([t.Property("")],i.prototype,"label",void 0),v([t.Property("After")],i.prototype,"labelPosition",void 0),v([t.Property("")],i.prototype,"name",void 0),v([t.Property("")],i.prototype,"value",void 0),i=v([t.NotifyPropertyChanges],i)}(t.Component),P=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),L=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},x="e-label",w="e-ripple-container",N="e-radio-wrapper",S=function(e){function i(t,s){var i=e.call(this,t,s)||this;return i.isKeyPressed=!1,i}P(i,e),n=i,i.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t={value:this.value,event:e};this.trigger("change",t),"EJS-RADIOBUTTON"===this.tagName&&e.stopPropagation()},i.prototype.updateChange=function(e){for(var s,i,r=this.getRadioGroup(),a=0;a<r.length;a++)(s=r[a])!==this.element&&((i=t.getInstance(s,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},i.prototype.destroy=function(){var s=this,i=this.element.parentElement;e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode.insertBefore(this.element,i),t.detach(i),this.element.checked=!1,["name","value","disabled"].forEach(function(e){s.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")},i.prototype.focusHandler=function(){this.isKeyPressed&&this.getLabel().classList.add("e-focus")},i.prototype.focusOutHandler=function(){this.getLabel().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"radio"},i.prototype.getSelectedValue=function(){for(var e,t=this.getRadioGroup(),s=0,i=t.length;s<i;s++)if((e=t[s]).checked)return e.value;return""},i.prototype.getRadioGroup=function(){return document.querySelectorAll('input.e-radio[name="'+this.element.getAttribute("name")+'"]')},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getLabel=function(){return this.element.nextElementSibling},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},i.prototype.initWrapper=function(){var e,s=this.element.parentElement;s.classList.contains(N)||(s=this.createElement("div",{className:N}),this.element.parentNode.insertBefore(s,this.element));var i=this.createElement("label",{attrs:{for:this.element.id}});s.appendChild(this.element),s.appendChild(i),t.isRippleEnabled&&(e=this.createElement("span",{className:w}),i.appendChild(e),t.rippleEffect(e,{duration:400,isCenterRipple:!0})),this.enableRtl&&i.classList.add("e-rtl"),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),this.label&&this.setText(this.label)},i.prototype.keyDownHandler=function(){this.isKeyPressed=!0},i.prototype.labelRippleHandler=function(e){a(e,this.getLabel().getElementsByClassName(w)[0])},i.prototype.mouseDownHandler=function(){this.isKeyPressed=!1},i.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&t.attributes(this.element,{checked:"true"})},i.prototype.onPropertyChanged=function(e,s){for(var i=this.getLabel(),n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"checked":e.checked&&this.updateChange(e.checked),this.element.checked=e.checked;break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":"Before"===e.labelPosition?i.classList.add("e-right"):i.classList.remove("e-right");break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.element.setAttribute("value",e.value)}}},i.prototype.preRender=function(){var e=this.element;if(this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=s(this.createElement,"EJS-RADIOBUTTON","radio",e,N,"radio"),this.element=e,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var i=this.element.getAttribute("formcontrolname");i&&(this.setProperties({name:i},!0),this.element.setAttribute("name",i))}},i.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents()},i.prototype.setDisabled=function(){this.element.disabled=!0},i.prototype.setText=function(e){var t=this.getLabel(),s=t.getElementsByClassName(x)[0];s?s.textContent=e:(s=this.createElement("span",{className:x,innerHTML:e}),t.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},i.prototype.unWireEvents=function(){var e=this.getLabel();t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(document,"keydown",this.keyDownHandler),t.EventHandler.remove(e,"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var s=e.getElementsByClassName(x)[0];s&&(t.EventHandler.remove(s,"mousedown",this.labelRippleHandler),t.EventHandler.remove(s,"mouseup",this.labelRippleHandler)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},i.prototype.wireEvents=function(){var e=this.getLabel();t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(document,"keydown",this.keyDownHandler,this),t.EventHandler.add(e,"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var s=e.getElementsByClassName(x)[0];s&&(t.EventHandler.add(s,"mousedown",this.labelRippleHandler,this),t.EventHandler.add(s,"mouseup",this.labelRippleHandler,this)),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)};var n;return L([t.Event()],i.prototype,"change",void 0),L([t.Event()],i.prototype,"created",void 0),L([t.Property(!1)],i.prototype,"checked",void 0),L([t.Property("")],i.prototype,"cssClass",void 0),L([t.Property(!1)],i.prototype,"disabled",void 0),L([t.Property("")],i.prototype,"label",void 0),L([t.Property("After")],i.prototype,"labelPosition",void 0),L([t.Property("")],i.prototype,"name",void 0),L([t.Property("")],i.prototype,"value",void 0),i=n=L([t.NotifyPropertyChanges],i)}(t.Component),O=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),A=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},T="e-switch-disabled",R="e-ripple-container",I="e-ripple-check",W="e-switch-wrapper",j="e-switch-active",M=function(e){function s(t,s){var i=e.call(this,t,s)||this;return i.isKeyPressed=!1,i.isDrag=!1,i}return O(s,e),s.prototype.changeState=function(e){var s,i,n=this.getWrapper(),r=n.querySelector(".e-switch-inner"),a=n.querySelector(".e-switch-handle");t.isRippleEnabled&&(i=n.getElementsByClassName(R)[0]),e?(t.addClass([r,a],j),s="true",this.element.checked=!0,this.checked=!0,i&&t.addClass([i],[I])):(t.removeClass([r,a],j),s="false",this.element.checked=!1,this.checked=!1,i&&t.removeClass([i],[I])),n.setAttribute("aria-checked",s)},s.prototype.clickHandler=function(e){this.isDrag=!1,this.focusOutHandler(),this.changeState(!this.checked),this.element.focus();var t={checked:this.element.checked,event:e};this.trigger("change",t)},s.prototype.destroy=function(){e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),n(this,this.getWrapper(),this.tagName)},s.prototype.focusHandler=function(){this.isKeyPressed&&this.getWrapper().classList.add("e-focus")},s.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},s.prototype.getModuleName=function(){return"switch"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element.parentElement},s.prototype.initialize=function(){t.isNullOrUndefined(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},s.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains(W)||(e=this.createElement("div",{className:W,attrs:{role:"switch","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var s=this.createElement("span",{className:"e-switch-inner"}),i=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),r=this.createElement("span",{className:"e-switch-handle"});if(e.appendChild(this.element),o(this,e),s.appendChild(i),s.appendChild(n),e.appendChild(s),e.appendChild(r),t.isRippleEnabled){var a=this.createElement("span",{className:R});r.appendChild(a),t.rippleEffect(a,{duration:400,isCenterRipple:!0})}this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" "))},s.prototype.onPropertyChanged=function(e,s){for(var i=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++){switch(r[n]){case"checked":this.changeState(e.checked);break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,i.classList.remove(T),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"value":this.element.setAttribute("value",e.value);break;case"name":this.element.setAttribute("name",e.name);break;case"onLabel":case"offLabel":this.setLabel(e.onLabel,e.offLabel);break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "))}}},s.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH",W,e,this.getModuleName())},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents()},s.prototype.rippleHandler=function(e){a(e,this.getWrapper().getElementsByClassName(R)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isKeyPressed=!1)},s.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(R)[0];if(t){var s=document.createEvent("MouseEvents");s.initEvent(e,!1,!0),t.dispatchEvent(s)}},s.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add(T),e.setAttribute("aria-disabled","true")},s.prototype.setLabel=function(e,t){var s=this.getWrapper();e&&(s.querySelector(".e-switch-on").textContent=e),t&&(s.querySelector(".e-switch-off").textContent=t)},s.prototype.switchFocusHandler=function(){this.isKeyPressed=!0},s.prototype.switchMouseUp=function(e){var t=e.target;this.getWrapper().getElementsByClassName(R)[0];"touchmove"===e.type&&e.preventDefault(),"touchstart"===e.type&&(this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&t.className.indexOf("e-switch")<0||"touchend"===e.type)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault())},s.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,t.attributes(this.element,{checked:this.initialSwitchCheckedValue.toString()})},s.prototype.toggle=function(){this.clickHandler()},s.prototype.wireEvents=function(){var e=this.getWrapper();e.querySelector(".e-switch-handle");this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyDownHandler=this.switchFocusHandler.bind(this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(document,"mouseup",this.delegateMouseUpHandler,this),t.EventHandler.add(document,"keydown",this.delegateKeyDownHandler,this),t.EventHandler.add(e,"mousedown mouseup",this.rippleHandler,this),t.EventHandler.add(e,"touchstart touchmove touchend",this.switchMouseUp,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.unWireEvents=function(){var e=this.getWrapper();e.querySelector(".e-switch-handle");t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(document,"mouseup",this.delegateMouseUpHandler),t.EventHandler.remove(document,"keydown",this.delegateKeyDownHandler),t.EventHandler.remove(e,"mousedown mouseup",this.rippleHandler),t.EventHandler.remove(e,"touchstart touchmove touchend",this.switchMouseUp),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},A([t.Event()],s.prototype,"change",void 0),A([t.Event()],s.prototype,"created",void 0),A([t.Property(!1)],s.prototype,"checked",void 0),A([t.Property("")],s.prototype,"cssClass",void 0),A([t.Property(!1)],s.prototype,"disabled",void 0),A([t.Property("")],s.prototype,"name",void 0),A([t.Property("")],s.prototype,"onLabel",void 0),A([t.Property("")],s.prototype,"offLabel",void 0),A([t.Property("")],s.prototype,"value",void 0),s=A([t.NotifyPropertyChanges],s)}(t.Component),D=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),B=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},_={chipSet:"e-chip-set",chip:"e-chip",avatar:"e-chip-avatar",text:"e-chip-text",icon:"e-chip-icon",delete:"e-chip-delete",deleteIcon:"e-dlt-btn",multiSelection:"e-multi-selection",singleSelection:"e-selection",active:"e-active",chipWrapper:"e-chip-avatar-wrap",iconWrapper:"e-chip-icon-wrap",focused:"e-focused",disabled:"e-disabled",rtl:"e-rtl"},U=function(e){function s(t,s){return e.call(this,t,s)||this}return D(s,e),s.prototype.preRender=function(){},s.prototype.render=function(){this.type=this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",this.setAttributes(),this.createChip(),this.setRtl(),this.wireEvent(!1),this.select(this.selectedChips),this.rippleFunctin=t.rippleEffect(this.element,{selector:".e-chip"})},s.prototype.createChip=function(){this.innerText=this.element.innerText.trim(),this.element.innerHTML="",this.chipCreation("chip"===this.type?[this.innerText?this.innerText:this.text]:this.chips)},s.prototype.setAttributes=function(){"chip"===this.type?(this.element.tabIndex=0,this.element.setAttribute("role","option")):(this.element.classList.add(_.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(_.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(_.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},s.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](_.rtl)},s.prototype.chipCreation=function(e){for(var s=[],i=0;i<e.length;i++){var n=this.getFieldValues(e[i]),r=this.elementCreation(n),a=(_.chip+" "+(n.enabled?" ":_.disabled)+" "+(n.avatarIconCss||n.avatarText?_.chipWrapper:n.leadingIconCss?_.iconWrapper:" ")+" "+n.cssClass).split(" ").filter(function(e){return e});if("chip"===this.type)s=r,t.addClass([this.element],a),this.element.setAttribute("aria-label",n.text);else{var o=this.createElement("DIV",{className:a.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":n.text,"aria-selected":"false"}});t.append(r,o),s.push(o)}}t.append(s,this.element)},s.prototype.getFieldValues=function(e){var s="false"!==this.enabled.toString();return{text:"object"==typeof e?e.text?e.text.toString():this.text.toString():"chip"===this.type?this.innerText?this.innerText:this.text.toString():e.toString(),cssClass:"object"==typeof e&&e.cssClass?e.cssClass.toString():this.cssClass.toString(),leadingIconCss:"object"==typeof e&&e.leadingIconCss?e.leadingIconCss.toString():this.leadingIconCss.toString(),avatarIconCss:"object"==typeof e&&e.avatarIconCss?e.avatarIconCss.toString():this.avatarIconCss.toString(),avatarText:"object"==typeof e&&e.avatarText?e.avatarText.toString():this.avatarText.toString(),trailingIconCss:"object"==typeof e&&e.trailingIconCss?e.trailingIconCss.toString():this.trailingIconCss.toString(),enabled:"object"==typeof e?t.isNullOrUndefined(e.enabled)?s:"false"!==e.enabled.toString():s}},s.prototype.elementCreation=function(e){var t=[];if(e.avatarText||e.avatarIconCss){var s=(_.avatar+" "+e.avatarIconCss).trim(),i=this.createElement("span",{className:s});i.innerText=e.avatarText,t.push(i)}else if(e.leadingIconCss){s=(_.icon+" "+e.leadingIconCss).trim();var n=this.createElement("span",{className:s});t.push(n)}var r=this.createElement("span",{className:_.text});if(r.innerText=e.text,t.push(r),e.trailingIconCss||"chip"!==this.type&&this.enableDelete){s=(_.delete+" "+(e.trailingIconCss?e.trailingIconCss:_.deleteIcon)).trim();var a=this.createElement("span",{className:s});t.push(a)}return t},s.prototype.find=function(e){var t,s=e instanceof HTMLElement?e:this.element.querySelectorAll("."+_.chip)[e];return s&&"chip"!==this.type&&((t={text:void 0,index:void 0,element:void 0,data:void 0}).index=Array.prototype.slice.call(this.element.querySelectorAll("."+_.chip)).indexOf(s),t.text="object"==typeof this.chips[t.index]?this.chips[t.index].text?this.chips[t.index].text.toString():"":this.chips[t.index].toString(),t.data=this.chips[t.index],t.element=s),t},s.prototype.add=function(e){var t;if("chip"!==this.type){var s=e instanceof Array?e:[e];(t=this.chips).push.apply(t,s),this.chipCreation(s)}},s.prototype.select=function(e){if("chip"!==this.type&&"None"!==this.selection)for(var t=e instanceof Array?e:[e],s=0;s<t.length;s++){var i=t[s]instanceof HTMLElement?t[s]:this.element.querySelectorAll("."+_.chip)[t[s]];i instanceof HTMLElement&&this.selectionHandler(i)}},s.prototype.remove=function(e){var t=this;if("chip"!==this.type){var s=e instanceof Array?e:[e],i=[],n=this.element.querySelectorAll("."+_.chip);s.forEach(function(e){var t=e instanceof HTMLElement?e:n[e];t instanceof HTMLElement&&i.push(t)}),i.forEach(function(e){var s=t.element.querySelectorAll("."+_.chip),i=Array.prototype.slice.call(s).indexOf(e);t.deleteHandler(e,i)})}},s.prototype.getSelectedChips=function(){var e,s=this;if("chip"!==this.type&&"None"!==this.selection){var i={texts:[],Indexes:[],data:[],elements:[]};this.element.querySelectorAll("."+_.active).forEach(function(e){i.elements.push(e);var t=Array.prototype.slice.call(s.element.querySelectorAll("."+_.chip)).indexOf(e);i.Indexes.push(t),i.data.push(s.chips[t]);var n="object"==typeof s.chips[t]?s.chips[t].text.toString():s.chips[t].toString();i.texts.push(n)});var n={text:i.texts[0],index:i.Indexes[0],data:i.data[0],element:i.elements[0]};e=t.isNullOrUndefined(n.index)?void 0:"Multiple"===this.selection?i:n}return e},s.prototype.wireEvent=function(e){e?(t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keydown",this.keyHandler),t.EventHandler.remove(this.element,"keyup",this.keyHandler)):(t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyHandler,this),t.EventHandler.add(this.element,"keyup",this.keyHandler,this))},s.prototype.keyHandler=function(e){e.target.classList.contains(_.chip)&&("keydown"===e.type?13===e.keyCode?this.clickHandler(e):46===e.keyCode&&this.enableDelete&&this.clickHandler(e,!0):9===e.keyCode&&this.focusInHandler(e.target))},s.prototype.focusInHandler=function(e){e.classList.contains(_.focused)||e.classList.add(_.focused)},s.prototype.focusOutHandler=function(e){var s=t.closest(e.target,"."+_.chip),i="chip"===this.type?this.element.classList.contains(_.focused)?this.element:null:this.element.querySelector("."+_.focused);s&&i&&i.classList.remove(_.focused)},s.prototype.clickHandler=function(e,s){void 0===s&&(s=!1);var i=t.closest(e.target,"."+_.chip);if(i)if("chip"!==this.type){var n=this.find(i);n.event=e;if((e.target.classList.contains(_.delete)?e.target:s?i.querySelector("."+_.delete):void 0)&&this.enableDelete){n.cancel=!1;var r=n;this.trigger("delete",r),r.cancel||this.deleteHandler(n.element,n.index)}else if("None"!==this.selection){this.selectionHandler(i),n.selected=i.classList.contains(_.active);var a=n;this.trigger("click",a)}else{this.focusInHandler(i);var o=n;this.trigger("click",o)}}else{this.focusInHandler(i);o={text:this.innerText?this.innerText:this.text,element:i,data:this.text,event:e};this.trigger("click",o)}},s.prototype.selectionHandler=function(e){if("Single"===this.selection){var t=this.element.querySelector("."+_.active);t&&t!==e&&(t.classList.remove(_.active),e.setAttribute("aria-selected","false"))}e.classList.contains(_.active)?(e.classList.remove(_.active),e.setAttribute("aria-selected","false")):(e.classList.add(_.active),e.setAttribute("aria-selected","true"))},s.prototype.deleteHandler=function(e,s){this.chips.splice(s,1),t.detach(e)},s.prototype.destroy=function(){e.prototype.destroy.call(this),t.removeClass([this.element],[_.chipSet,_.chip,_.rtl,_.multiSelection,_.singleSelection,_.disabled,_.chipWrapper,_.iconWrapper,_.active,_.focused].concat(this.cssClass.toString().split(" ").filter(function(e){return e}))),this.removeMultipleAttributes(["tabindex","role","aria-label","aria-multiselectable"],this.element),this.wireEvent(!0),this.rippleFunctin(),this.element.innerHTML="",this.element.innerText=this.innerText},s.prototype.removeMultipleAttributes=function(e,t){e.forEach(function(e){t.removeAttribute(e)})},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.getModuleName=function(){return"chip-list"},s.prototype.onPropertyChanged=function(e,s){for(var i=0,n=Object.keys(e);i<n.length;i++){switch(n[i]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"selection":case"enableDelete":case"enabled":this.refresh();break;case"cssClass":"chip"===this.type?(t.removeClass([this.element],s.cssClass.toString().split(" ").filter(function(e){return e})),t.addClass([this.element],e.cssClass.toString().split(" ").filter(function(e){return e}))):this.refresh();break;case"selectedChips":this.select(e.selectedChips);break;case"enableRtl":this.setRtl()}}},B([t.Property([])],s.prototype,"chips",void 0),B([t.Property("")],s.prototype,"text",void 0),B([t.Property("")],s.prototype,"avatarText",void 0),B([t.Property("")],s.prototype,"avatarIconCss",void 0),B([t.Property("")],s.prototype,"leadingIconCss",void 0),B([t.Property("")],s.prototype,"trailingIconCss",void 0),B([t.Property("")],s.prototype,"cssClass",void 0),B([t.Property(!0)],s.prototype,"enabled",void 0),B([t.Property([])],s.prototype,"selectedChips",void 0),B([t.Property("None")],s.prototype,"selection",void 0),B([t.Property(!1)],s.prototype,"enableDelete",void 0),B([t.Event()],s.prototype,"created",void 0),B([t.Event()],s.prototype,"click",void 0),B([t.Event()],s.prototype,"delete",void 0),s=B([t.NotifyPropertyChanges],s)}(t.Component),q=function(){return function(){}}();e.wrapperInitialize=s,e.getTextNode=i,e.destroy=n,e.preRender=r,e.createCheckBox=function(e,s,i){void 0===s&&(s=!1),void 0===i&&(i={});var n=e("div",{className:"e-checkbox-wrapper e-css"});if(i.cssClass&&t.addClass([n],i.cssClass.split(" ")),i.enableRtl&&n.classList.add("e-rtl"),s){var r=e("span",{className:"e-ripple-container"});t.rippleEffect(r,{isCenterRipple:!0,duration:400}),n.appendChild(r)}var a=e("span",{className:"e-frame e-icons"});if(i.checked&&a.classList.add("e-check"),n.appendChild(a),i.label){var o=e("span",{className:"e-label",innerHTML:i.label});n.appendChild(o)}return n},e.rippleMouseHandler=a,e.setHiddenInput=o,e.Button=m,e.CheckBox=H,e.RadioButton=S,e.Switch=M,e.classNames=_,e.ChipList=U,e.Chip=q,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-buttons.umd.min.js.map
/*!
* filename: ej2-buttons.min.js
* version : 17.1.38
* version : 17.1.40
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved.

@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license.

*/
this.ej=this.ej||{},this.ej.buttons=function(e,t){"use strict";function s(e,s,i,n,r,a){var o=n;if(n.tagName===s){var l=t.getValue("ej2_instances",n);o=e("input",{attrs:{type:i}});for(var c=["change","cssClass","label","labelPosition","id"],h=0,p=n.attributes.length;h<p;h++)-1===c.indexOf(n.attributes[h].nodeName)&&o.setAttribute(n.attributes[h].nodeName,n.attributes[h].nodeValue);t.attributes(n,{class:r,role:a,"aria-checked":"false"}),n.appendChild(o),t.setValue("ej2_instances",l,o),t.deleteObject(n,"ej2_instances")}return o}function i(e){for(var t,s=e.childNodes,i=0;i<s.length;i++)if(3===(t=s[i]).nodeType)return t;return null}function n(e,s,i){"INPUT"===i?(s.parentNode.insertBefore(e.element,s),t.detach(s),e.element.checked=!1,["name","value","disabled"].forEach(function(t){e.element.removeAttribute(t)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="")}function r(e,i,n,r,a){r=s(e.createElement,i,"checkbox",r,n,a),e.element=r,"checkbox"!==e.element.getAttribute("type")&&e.element.setAttribute("type","checkbox"),e.element.id||(e.element.id=t.getUniqueID("e-"+a))}function a(e,s,i){void 0===s&&(s=!1),void 0===i&&(i={});var n=e("div",{className:"e-checkbox-wrapper e-css"});if(i.cssClass&&t.addClass([n],i.cssClass.split(" ")),i.enableRtl&&n.classList.add("e-rtl"),s){var r=e("span",{className:"e-ripple-container"});t.rippleEffect(r,{isCenterRipple:!0,duration:400}),n.appendChild(r)}var a=e("span",{className:"e-frame e-icons"});if(i.checked&&a.classList.add("e-check"),n.appendChild(a),i.label){var o=e("span",{className:"e-label",innerHTML:i.label});n.appendChild(o)}return n}function o(e,t){if(t){var s=document.createEvent("MouseEvents");s.initEvent(e.type,!1,!0),t.dispatchEvent(s)}}function l(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var c=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),h=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},p={RTL:"e-rtl",BUTTON:"e-btn",PRIMARY:"e-primary",ICONBTN:"e-icon-btn"},d=function(e){function s(t,s){return e.call(this,t,s)||this}return c(s,e),s.prototype.preRender=function(){},s.prototype.render=function(){this.initialize()},s.prototype.initialize=function(){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.isPrimary&&this.element.classList.add(p.PRIMARY),this.content&&(this.element.innerHTML=this.content),this.setIconCss(),this.enableRtl&&this.element.classList.add(p.RTL),this.disabled?this.controlStatus(this.disabled):this.wireEvents(),this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+p.BUTTON})},s.prototype.controlStatus=function(e){this.element.disabled=e},s.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(p.ICONBTN);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},s.prototype.wireEvents=function(){this.isToggle&&t.EventHandler.add(this.element,"click",this.btnClickHandler,this)},s.prototype.unWireEvents=function(){this.isToggle&&t.EventHandler.remove(this.element,"click",this.btnClickHandler)},s.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},s.prototype.destroy=function(){var s,i=[p.PRIMARY,p.RTL,p.ICONBTN,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn"];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),e.prototype.destroy.call(this),t.removeClass([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.innerHTML=this.element.innerHTML.replace(this.content,"")),(s=this.element.querySelector("span.e-btn-icon"))&&t.detach(s),this.unWireEvents(),this.removeRippleEffect()},s.prototype.getModuleName=function(){return"btn"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.Inject=function(){},s.prototype.onPropertyChanged=function(e,s){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"isPrimary":e.isPrimary?this.element.classList.add(p.PRIMARY):this.element.classList.remove(p.PRIMARY);break;case"disabled":this.controlStatus(e.disabled),this.unWireEvents();break;case"iconCss":var a=this.element.querySelector("span.e-btn-icon");a?e.iconCss?(a.className="e-btn-icon "+e.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?a.classList.add("e-icon-left"):a.classList.add("e-icon-right"))):t.detach(a):this.setIconCss();break;case"iconPosition":t.removeClass([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(a=this.element.querySelector("span.e-btn-icon"))&&t.detach(a),this.setIconCss();break;case"cssClass":s.cssClass&&t.removeClass([this.element],s.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?this.element.classList.add(p.RTL):this.element.classList.remove(p.RTL);break;case"content":i(this.element)||this.element.classList.remove(p.ICONBTN),this.element.innerHTML=e.content,this.setIconCss();break;case"isToggle":e.isToggle?t.EventHandler.add(this.element,"click",this.btnClickHandler,this):(t.EventHandler.remove(this.element,"click",this.btnClickHandler),t.removeClass([this.element],["e-active"]))}},h([t.Property("Left")],s.prototype,"iconPosition",void 0),h([t.Property("")],s.prototype,"iconCss",void 0),h([t.Property(!1)],s.prototype,"disabled",void 0),h([t.Property(!1)],s.prototype,"isPrimary",void 0),h([t.Property("")],s.prototype,"cssClass",void 0),h([t.Property("")],s.prototype,"content",void 0),h([t.Property(!1)],s.prototype,"isToggle",void 0),h([t.Property()],s.prototype,"locale",void 0),h([t.Event()],s.prototype,"created",void 0),s=h([t.NotifyPropertyChanges],s)}(t.Component),u=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),m=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},f="e-ripple-container",v="e-checkbox-wrapper",y=function(e){function i(t,s){var i=e.call(this,t,s)||this;return i.isFocused=!1,i.isMouseClick=!1,i}return u(i,e),i.prototype.changeState=function(e){var s,i,n=this.getWrapper().getElementsByClassName("e-frame")[0];t.isRippleEnabled&&(i=this.getWrapper().getElementsByClassName(f)[0]),"check"===e?(n.classList.remove("e-stop"),n.classList.add("e-check"),i&&(i.classList.remove("e-ripple-stop"),i.classList.add("e-ripple-check")),s="true",this.element.checked=!0):"uncheck"===e?(t.removeClass([n],["e-check","e-stop"]),i&&t.removeClass([i],["e-ripple-check","e-ripple-stop"]),s="false",this.element.checked=!1):(n.classList.remove("e-check"),n.classList.add("e-stop"),i&&(i.classList.remove("e-ripple-check"),i.classList.add("e-ripple-stop")),s="mixed",this.element.indeterminate=!0),this.getWrapper().setAttribute("aria-checked",s)},i.prototype.clickHandler=function(e){this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck"),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck"),this.checked=!1):(this.changeState("check"),this.checked=!0);var t={checked:this.element.checked,event:e};this.trigger("change",t)},i.prototype.destroy=function(){var s=this,i=this.getWrapper();e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode.insertBefore(this.element,i),t.detach(i),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){s.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus"),this.isFocused=!1},i.prototype.getModuleName=function(){return"checkbox"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},i.prototype.getWrapper=function(){return this.element.parentElement.parentElement},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState("check"),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},i.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains(v)||(e=this.createElement("div",{className:v,attrs:{role:"checkbox","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}}),i=this.createElement("span",{className:"e-icons e-frame"});if(this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),e.appendChild(s),s.appendChild(this.element),l(this,s),s.appendChild(i),t.isRippleEnabled){var n=this.createElement("span",{className:f});"Before"===this.labelPosition?s.appendChild(n):s.insertBefore(n,i),t.rippleEffect(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},i.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},i.prototype.labelMouseHandler=function(e){this.isMouseClick=!0,o(e,this.getWrapper().getElementsByClassName(f)[0])},i.prototype.onPropertyChanged=function(e,s){for(var i=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(e.checked?"check":"uncheck");break;case"indeterminate":e.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,i.classList.remove("e-checkbox-disabled"),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":var a=i.getElementsByClassName("e-label")[0],o=i.getElementsByTagName("label")[0];t.detach(a),"After"===e.labelPosition?o.appendChild(a):o.insertBefore(a,i.getElementsByClassName("e-frame")[0]);break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.element.setAttribute("value",e.value)}},i.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=s(this.createElement,"EJS-CHECKBOX","checkbox",e,v,"checkbox"),this.element=e,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents()},i.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-checkbox-disabled"),e.setAttribute("aria-disabled","true")},i.prototype.setText=function(e){var t=this.getWrapper().getElementsByClassName("e-label")[0];if(t)t.textContent=e;else{t=this.createElement("span",{className:"e-label",innerHTML:e});var s=this.getWrapper().getElementsByTagName("label")[0];"Before"===this.labelPosition?s.insertBefore(t,this.getWrapper().getElementsByClassName("e-frame")[0]):s.appendChild(t)}},i.prototype.changeHandler=function(e){e.stopPropagation()},i.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,t.attributes(this.element,{checked:this.initialCheckedValue.toString()})},i.prototype.unWireEvents=function(){var e=this.getWrapper();t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var s=e.getElementsByTagName("label")[0];t.EventHandler.remove(s,"mousedown",this.labelMouseHandler),t.EventHandler.remove(s,"mouseup",this.labelMouseHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.remove(this.element,"change",this.changeHandler)},i.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var s=e.getElementsByTagName("label")[0];t.EventHandler.add(s,"mousedown",this.labelMouseHandler,this),t.EventHandler.add(s,"mouseup",this.labelMouseHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.add(this.element,"change",this.changeHandler,this)},m([t.Event()],i.prototype,"change",void 0),m([t.Event()],i.prototype,"created",void 0),m([t.Property(!1)],i.prototype,"checked",void 0),m([t.Property("")],i.prototype,"cssClass",void 0),m([t.Property(!1)],i.prototype,"disabled",void 0),m([t.Property(!1)],i.prototype,"indeterminate",void 0),m([t.Property("")],i.prototype,"label",void 0),m([t.Property("After")],i.prototype,"labelPosition",void 0),m([t.Property("")],i.prototype,"name",void 0),m([t.Property("")],i.prototype,"value",void 0),i=m([t.NotifyPropertyChanges],i)}(t.Component),b=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),g=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},C=function(e){function i(t,s){var i=e.call(this,t,s)||this;return i.isKeyPressed=!1,i}b(i,e),n=i,i.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t={value:this.value,event:e};this.trigger("change",t),"EJS-RADIOBUTTON"===this.tagName&&e.stopPropagation()},i.prototype.updateChange=function(e){for(var s,i,r=this.element.getAttribute("name"),a=document.querySelectorAll('input.e-radio[name="'+r+'"]'),o=0;o<a.length;o++)(s=a[o])!==this.element&&((i=t.getInstance(s,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},i.prototype.destroy=function(){var s=this,i=this.element.parentElement;e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode.insertBefore(this.element,i),t.detach(i),this.element.checked=!1,["name","value","disabled"].forEach(function(e){s.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")},i.prototype.focusHandler=function(){this.isKeyPressed&&this.getLabel().classList.add("e-focus")},i.prototype.focusOutHandler=function(){this.getLabel().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"radio"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getLabel=function(){return this.element.nextElementSibling},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},i.prototype.initWrapper=function(){var e,s=this.element.parentElement;s.classList.contains("e-radio-wrapper")||(s=this.createElement("div",{className:"e-radio-wrapper"}),this.element.parentNode.insertBefore(s,this.element));var i=this.createElement("label",{attrs:{for:this.element.id}});s.appendChild(this.element),s.appendChild(i),t.isRippleEnabled&&(e=this.createElement("span",{className:"e-ripple-container"}),i.appendChild(e),t.rippleEffect(e,{duration:400,isCenterRipple:!0})),this.enableRtl&&i.classList.add("e-rtl"),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),this.label&&this.setText(this.label)},i.prototype.keyDownHandler=function(){this.isKeyPressed=!0},i.prototype.labelRippleHandler=function(e){o(e,this.getLabel().getElementsByClassName("e-ripple-container")[0])},i.prototype.mouseDownHandler=function(){this.isKeyPressed=!1},i.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&t.attributes(this.element,{checked:"true"})},i.prototype.onPropertyChanged=function(e,s){for(var i=this.getLabel(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":e.checked&&this.updateChange(e.checked),this.element.checked=e.checked;break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":"Before"===e.labelPosition?i.classList.add("e-right"):i.classList.remove("e-right");break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.element.setAttribute("value",e.value)}},i.prototype.preRender=function(){var e=this.element;if(this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=s(this.createElement,"EJS-RADIOBUTTON","radio",e,"e-radio-wrapper","radio"),this.element=e,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var i=this.element.getAttribute("formcontrolname");i&&(this.setProperties({name:i},!0),this.element.setAttribute("name",i))}},i.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents()},i.prototype.setDisabled=function(){this.element.disabled=!0},i.prototype.setText=function(e){var t=this.getLabel(),s=t.getElementsByClassName("e-label")[0];s?s.textContent=e:(s=this.createElement("span",{className:"e-label",innerHTML:e}),t.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},i.prototype.unWireEvents=function(){var e=this.getLabel();t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(document,"keydown",this.keyDownHandler),t.EventHandler.remove(e,"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var s=e.getElementsByClassName("e-label")[0];s&&(t.EventHandler.remove(s,"mousedown",this.labelRippleHandler),t.EventHandler.remove(s,"mouseup",this.labelRippleHandler)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},i.prototype.wireEvents=function(){var e=this.getLabel();t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(document,"keydown",this.keyDownHandler,this),t.EventHandler.add(e,"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var s=e.getElementsByClassName("e-label")[0];s&&(t.EventHandler.add(s,"mousedown",this.labelRippleHandler,this),t.EventHandler.add(s,"mouseup",this.labelRippleHandler,this)),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)};var n;return g([t.Event()],i.prototype,"change",void 0),g([t.Event()],i.prototype,"created",void 0),g([t.Property(!1)],i.prototype,"checked",void 0),g([t.Property("")],i.prototype,"cssClass",void 0),g([t.Property(!1)],i.prototype,"disabled",void 0),g([t.Property("")],i.prototype,"label",void 0),g([t.Property("After")],i.prototype,"labelPosition",void 0),g([t.Property("")],i.prototype,"name",void 0),g([t.Property("")],i.prototype,"value",void 0),i=n=g([t.NotifyPropertyChanges],i)}(t.Component),E=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),k=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},H="e-ripple-container",P=function(e){function s(t,s){var i=e.call(this,t,s)||this;return i.isKeyPressed=!1,i.isDrag=!1,i}return E(s,e),s.prototype.changeState=function(e){var s,i,n=this.getWrapper(),r=n.querySelector(".e-switch-inner"),a=n.querySelector(".e-switch-handle");t.isRippleEnabled&&(i=n.getElementsByClassName(H)[0]),e?(t.addClass([r,a],"e-switch-active"),s="true",this.element.checked=!0,this.checked=!0,i&&t.addClass([i],["e-ripple-check"])):(t.removeClass([r,a],"e-switch-active"),s="false",this.element.checked=!1,this.checked=!1,i&&t.removeClass([i],["e-ripple-check"])),n.setAttribute("aria-checked",s)},s.prototype.clickHandler=function(e){this.isDrag=!1,this.focusOutHandler(),this.changeState(!this.checked),this.element.focus();var t={checked:this.element.checked,event:e};this.trigger("change",t)},s.prototype.destroy=function(){e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),n(this,this.getWrapper(),this.tagName)},s.prototype.focusHandler=function(){this.isKeyPressed&&this.getWrapper().classList.add("e-focus")},s.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},s.prototype.getModuleName=function(){return"switch"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element.parentElement},s.prototype.initialize=function(){t.isNullOrUndefined(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},s.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains("e-switch-wrapper")||(e=this.createElement("div",{className:"e-switch-wrapper",attrs:{role:"switch","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var s=this.createElement("span",{className:"e-switch-inner"}),i=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),r=this.createElement("span",{className:"e-switch-handle"});if(e.appendChild(this.element),l(this,e),s.appendChild(i),s.appendChild(n),e.appendChild(s),e.appendChild(r),t.isRippleEnabled){var a=this.createElement("span",{className:H});r.appendChild(a),t.rippleEffect(a,{duration:400,isCenterRipple:!0})}this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" "))},s.prototype.onPropertyChanged=function(e,s){for(var i=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":this.changeState(e.checked);break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,i.classList.remove("e-switch-disabled"),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"value":this.element.setAttribute("value",e.value);break;case"name":this.element.setAttribute("name",e.name);break;case"onLabel":case"offLabel":this.setLabel(e.onLabel,e.offLabel);break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "))}},s.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH","e-switch-wrapper",e,this.getModuleName())},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents()},s.prototype.rippleHandler=function(e){o(e,this.getWrapper().getElementsByClassName(H)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isKeyPressed=!1)},s.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(H)[0];if(t){var s=document.createEvent("MouseEvents");s.initEvent(e,!1,!0),t.dispatchEvent(s)}},s.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-switch-disabled"),e.setAttribute("aria-disabled","true")},s.prototype.setLabel=function(e,t){var s=this.getWrapper();e&&(s.querySelector(".e-switch-on").textContent=e),t&&(s.querySelector(".e-switch-off").textContent=t)},s.prototype.switchFocusHandler=function(){this.isKeyPressed=!0},s.prototype.switchMouseUp=function(e){var t=e.target;this.getWrapper().getElementsByClassName(H)[0];"touchmove"===e.type&&e.preventDefault(),"touchstart"===e.type&&(this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&t.className.indexOf("e-switch")<0||"touchend"===e.type)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault())},s.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,t.attributes(this.element,{checked:this.initialSwitchCheckedValue.toString()})},s.prototype.toggle=function(){this.clickHandler()},s.prototype.wireEvents=function(){var e=this.getWrapper();e.querySelector(".e-switch-handle");this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyDownHandler=this.switchFocusHandler.bind(this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(document,"mouseup",this.delegateMouseUpHandler,this),t.EventHandler.add(document,"keydown",this.delegateKeyDownHandler,this),t.EventHandler.add(e,"mousedown mouseup",this.rippleHandler,this),t.EventHandler.add(e,"touchstart touchmove touchend",this.switchMouseUp,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.unWireEvents=function(){var e=this.getWrapper();e.querySelector(".e-switch-handle");t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(document,"mouseup",this.delegateMouseUpHandler),t.EventHandler.remove(document,"keydown",this.delegateKeyDownHandler),t.EventHandler.remove(e,"mousedown mouseup",this.rippleHandler),t.EventHandler.remove(e,"touchstart touchmove touchend",this.switchMouseUp),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},k([t.Event()],s.prototype,"change",void 0),k([t.Event()],s.prototype,"created",void 0),k([t.Property(!1)],s.prototype,"checked",void 0),k([t.Property("")],s.prototype,"cssClass",void 0),k([t.Property(!1)],s.prototype,"disabled",void 0),k([t.Property("")],s.prototype,"name",void 0),k([t.Property("")],s.prototype,"onLabel",void 0),k([t.Property("")],s.prototype,"offLabel",void 0),k([t.Property("")],s.prototype,"value",void 0),s=k([t.NotifyPropertyChanges],s)}(t.Component),L=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),N=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},w={chipSet:"e-chip-set",chip:"e-chip",avatar:"e-chip-avatar",text:"e-chip-text",icon:"e-chip-icon",delete:"e-chip-delete",deleteIcon:"e-dlt-btn",multiSelection:"e-multi-selection",singleSelection:"e-selection",active:"e-active",chipWrapper:"e-chip-avatar-wrap",iconWrapper:"e-chip-icon-wrap",focused:"e-focused",disabled:"e-disabled",rtl:"e-rtl"},x=function(e){function s(t,s){return e.call(this,t,s)||this}return L(s,e),s.prototype.preRender=function(){},s.prototype.render=function(){this.type=this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",this.setAttributes(),this.createChip(),this.setRtl(),this.wireEvent(!1),this.select(this.selectedChips),this.rippleFunctin=t.rippleEffect(this.element,{selector:".e-chip"})},s.prototype.createChip=function(){this.innerText=this.element.innerText.trim(),this.element.innerHTML="",this.chipCreation("chip"===this.type?[this.innerText?this.innerText:this.text]:this.chips)},s.prototype.setAttributes=function(){"chip"===this.type?(this.element.tabIndex=0,this.element.setAttribute("role","option")):(this.element.classList.add(w.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(w.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(w.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},s.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](w.rtl)},s.prototype.chipCreation=function(e){for(var s=[],i=0;i<e.length;i++){var n=this.getFieldValues(e[i]),r=this.elementCreation(n),a=(w.chip+" "+(n.enabled?" ":w.disabled)+" "+(n.avatarIconCss||n.avatarText?w.chipWrapper:n.leadingIconCss?w.iconWrapper:" ")+" "+n.cssClass).split(" ").filter(function(e){return e});if("chip"===this.type)s=r,t.addClass([this.element],a),this.element.setAttribute("aria-label",n.text);else{var o=this.createElement("DIV",{className:a.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":n.text,"aria-selected":"false"}});t.append(r,o),s.push(o)}}t.append(s,this.element)},s.prototype.getFieldValues=function(e){var s="false"!==this.enabled.toString();return{text:"object"==typeof e?e.text?e.text.toString():this.text.toString():"chip"===this.type?this.innerText?this.innerText:this.text.toString():e.toString(),cssClass:"object"==typeof e&&e.cssClass?e.cssClass.toString():this.cssClass.toString(),leadingIconCss:"object"==typeof e&&e.leadingIconCss?e.leadingIconCss.toString():this.leadingIconCss.toString(),avatarIconCss:"object"==typeof e&&e.avatarIconCss?e.avatarIconCss.toString():this.avatarIconCss.toString(),avatarText:"object"==typeof e&&e.avatarText?e.avatarText.toString():this.avatarText.toString(),trailingIconCss:"object"==typeof e&&e.trailingIconCss?e.trailingIconCss.toString():this.trailingIconCss.toString(),enabled:"object"==typeof e?t.isNullOrUndefined(e.enabled)?s:"false"!==e.enabled.toString():s}},s.prototype.elementCreation=function(e){var t=[];if(e.avatarText||e.avatarIconCss){var s=(w.avatar+" "+e.avatarIconCss).trim(),i=this.createElement("span",{className:s});i.innerText=e.avatarText,t.push(i)}else if(e.leadingIconCss){var s=(w.icon+" "+e.leadingIconCss).trim(),n=this.createElement("span",{className:s});t.push(n)}var r=this.createElement("span",{className:w.text});if(r.innerText=e.text,t.push(r),e.trailingIconCss||"chip"!==this.type&&this.enableDelete){var s=(w.delete+" "+(e.trailingIconCss?e.trailingIconCss:w.deleteIcon)).trim(),a=this.createElement("span",{className:s});t.push(a)}return t},s.prototype.find=function(e){var t,s=e instanceof HTMLElement?e:this.element.querySelectorAll("."+w.chip)[e];return s&&"chip"!==this.type&&((t={text:void 0,index:void 0,element:void 0,data:void 0}).index=Array.prototype.slice.call(this.element.querySelectorAll("."+w.chip)).indexOf(s),t.text="object"==typeof this.chips[t.index]?this.chips[t.index].text?this.chips[t.index].text.toString():"":this.chips[t.index].toString(),t.data=this.chips[t.index],t.element=s),t},s.prototype.add=function(e){var t;if("chip"!==this.type){var s=e instanceof Array?e:[e];(t=this.chips).push.apply(t,s),this.chipCreation(s)}},s.prototype.select=function(e){if("chip"!==this.type&&"None"!==this.selection)for(var t=e instanceof Array?e:[e],s=0;s<t.length;s++){var i=t[s]instanceof HTMLElement?t[s]:this.element.querySelectorAll("."+w.chip)[t[s]];i instanceof HTMLElement&&this.selectionHandler(i)}},s.prototype.remove=function(e){var t=this;if("chip"!==this.type){var s=e instanceof Array?e:[e],i=[],n=this.element.querySelectorAll("."+w.chip);s.forEach(function(e){var t=e instanceof HTMLElement?e:n[e];t instanceof HTMLElement&&i.push(t)}),i.forEach(function(e){var s=t.element.querySelectorAll("."+w.chip),i=Array.prototype.slice.call(s).indexOf(e);t.deleteHandler(e,i)})}},s.prototype.getSelectedChips=function(){var e,s=this;if("chip"!==this.type&&"None"!==this.selection){var i={texts:[],Indexes:[],data:[],elements:[]};this.element.querySelectorAll("."+w.active).forEach(function(e){i.elements.push(e);var t=Array.prototype.slice.call(s.element.querySelectorAll("."+w.chip)).indexOf(e);i.Indexes.push(t),i.data.push(s.chips[t]);var n="object"==typeof s.chips[t]?s.chips[t].text.toString():s.chips[t].toString();i.texts.push(n)});var n={text:i.texts[0],index:i.Indexes[0],data:i.data[0],element:i.elements[0]};e=t.isNullOrUndefined(n.index)?void 0:"Multiple"===this.selection?i:n}return e},s.prototype.wireEvent=function(e){e?(t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keydown",this.keyHandler),t.EventHandler.remove(this.element,"keyup",this.keyHandler)):(t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyHandler,this),t.EventHandler.add(this.element,"keyup",this.keyHandler,this))},s.prototype.keyHandler=function(e){e.target.classList.contains(w.chip)&&("keydown"===e.type?13===e.keyCode?this.clickHandler(e):46===e.keyCode&&this.enableDelete&&this.clickHandler(e,!0):9===e.keyCode&&this.focusInHandler(e.target))},s.prototype.focusInHandler=function(e){e.classList.contains(w.focused)||e.classList.add(w.focused)},s.prototype.focusOutHandler=function(e){var s=t.closest(e.target,"."+w.chip),i="chip"===this.type?this.element.classList.contains(w.focused)?this.element:null:this.element.querySelector("."+w.focused);s&&i&&i.classList.remove(w.focused)},s.prototype.clickHandler=function(e,s){void 0===s&&(s=!1);var i=t.closest(e.target,"."+w.chip);if(i)if("chip"!==this.type){var n=this.find(i);if(n.event=e,(e.target.classList.contains(w.delete)?e.target:s?i.querySelector("."+w.delete):void 0)&&this.enableDelete){n.cancel=!1;var r=n;this.trigger("delete",r),r.cancel||this.deleteHandler(n.element,n.index)}else if("None"!==this.selection){this.selectionHandler(i),n.selected=i.classList.contains(w.active);var a=n;this.trigger("click",a)}else{this.focusInHandler(i);o=n;this.trigger("click",o)}}else{this.focusInHandler(i);var o={text:this.innerText?this.innerText:this.text,element:i,data:this.text,event:e};this.trigger("click",o)}},s.prototype.selectionHandler=function(e){if("Single"===this.selection){var t=this.element.querySelector("."+w.active);t&&t!==e&&(t.classList.remove(w.active),e.setAttribute("aria-selected","false"))}e.classList.contains(w.active)?(e.classList.remove(w.active),e.setAttribute("aria-selected","false")):(e.classList.add(w.active),e.setAttribute("aria-selected","true"))},s.prototype.deleteHandler=function(e,s){this.chips.splice(s,1),t.detach(e)},s.prototype.destroy=function(){e.prototype.destroy.call(this),t.removeClass([this.element],[w.chipSet,w.chip,w.rtl,w.multiSelection,w.singleSelection,w.disabled,w.chipWrapper,w.iconWrapper,w.active,w.focused].concat(this.cssClass.toString().split(" ").filter(function(e){return e}))),this.removeMultipleAttributes(["tabindex","role","aria-label","aria-multiselectable"],this.element),this.wireEvent(!0),this.rippleFunctin(),this.element.innerHTML="",this.element.innerText=this.innerText},s.prototype.removeMultipleAttributes=function(e,t){e.forEach(function(e){t.removeAttribute(e)})},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.getModuleName=function(){return"chip-list"},s.prototype.onPropertyChanged=function(e,s){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"selection":case"enableDelete":case"enabled":this.refresh();break;case"cssClass":"chip"===this.type?(t.removeClass([this.element],s.cssClass.toString().split(" ").filter(function(e){return e})),t.addClass([this.element],e.cssClass.toString().split(" ").filter(function(e){return e}))):this.refresh();break;case"selectedChips":this.select(e.selectedChips);break;case"enableRtl":this.setRtl()}},N([t.Property([])],s.prototype,"chips",void 0),N([t.Property("")],s.prototype,"text",void 0),N([t.Property("")],s.prototype,"avatarText",void 0),N([t.Property("")],s.prototype,"avatarIconCss",void 0),N([t.Property("")],s.prototype,"leadingIconCss",void 0),N([t.Property("")],s.prototype,"trailingIconCss",void 0),N([t.Property("")],s.prototype,"cssClass",void 0),N([t.Property(!0)],s.prototype,"enabled",void 0),N([t.Property([])],s.prototype,"selectedChips",void 0),N([t.Property("None")],s.prototype,"selection",void 0),N([t.Property(!1)],s.prototype,"enableDelete",void 0),N([t.Event()],s.prototype,"created",void 0),N([t.Event()],s.prototype,"click",void 0),N([t.Event()],s.prototype,"delete",void 0),s=N([t.NotifyPropertyChanges],s)}(t.Component),S=function(){function e(){}return e}();return e.wrapperInitialize=s,e.getTextNode=i,e.destroy=n,e.preRender=r,e.createCheckBox=a,e.rippleMouseHandler=o,e.setHiddenInput=l,e.Button=d,e.CheckBox=y,e.RadioButton=C,e.Switch=P,e.classNames=w,e.ChipList=x,e.Chip=S,e}({},ej.base),this.ejs=ej;
this.ej=this.ej||{},this.ej.buttons=function(e,t){"use strict";function s(e,s,i,n,r,a){var o=n;if(n.tagName===s){var l=t.getValue("ej2_instances",n);o=e("input",{attrs:{type:i}});for(var c=["change","cssClass","label","labelPosition","id"],h=0,p=n.attributes.length;h<p;h++)-1===c.indexOf(n.attributes[h].nodeName)&&o.setAttribute(n.attributes[h].nodeName,n.attributes[h].nodeValue);t.attributes(n,{class:r,role:a,"aria-checked":"false"}),n.appendChild(o),t.setValue("ej2_instances",l,o),t.deleteObject(n,"ej2_instances")}return o}function i(e){for(var t,s=e.childNodes,i=0;i<s.length;i++)if(3===(t=s[i]).nodeType)return t;return null}function n(e,s,i){"INPUT"===i?(s.parentNode.insertBefore(e.element,s),t.detach(s),e.element.checked=!1,["name","value","disabled"].forEach(function(t){e.element.removeAttribute(t)})):(["role","aria-checked","class"].forEach(function(e){s.removeAttribute(e)}),s.innerHTML="")}function r(e,i,n,r,a){r=s(e.createElement,i,"checkbox",r,n,a),e.element=r,"checkbox"!==e.element.getAttribute("type")&&e.element.setAttribute("type","checkbox"),e.element.id||(e.element.id=t.getUniqueID("e-"+a))}function a(e,s,i){void 0===s&&(s=!1),void 0===i&&(i={});var n=e("div",{className:"e-checkbox-wrapper e-css"});if(i.cssClass&&t.addClass([n],i.cssClass.split(" ")),i.enableRtl&&n.classList.add("e-rtl"),s){var r=e("span",{className:"e-ripple-container"});t.rippleEffect(r,{isCenterRipple:!0,duration:400}),n.appendChild(r)}var a=e("span",{className:"e-frame e-icons"});if(i.checked&&a.classList.add("e-check"),n.appendChild(a),i.label){var o=e("span",{className:"e-label",innerHTML:i.label});n.appendChild(o)}return n}function o(e,t){if(t){var s=document.createEvent("MouseEvents");s.initEvent(e.type,!1,!0),t.dispatchEvent(s)}}function l(e,t){e.element.getAttribute("ejs-for")&&t.appendChild(e.createElement("input",{attrs:{name:e.name||e.element.name,value:"false",type:"hidden"}}))}var c=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),h=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},p={RTL:"e-rtl",BUTTON:"e-btn",PRIMARY:"e-primary",ICONBTN:"e-icon-btn"},d=function(e){function s(t,s){return e.call(this,t,s)||this}return c(s,e),s.prototype.preRender=function(){},s.prototype.render=function(){this.initialize()},s.prototype.initialize=function(){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.isPrimary&&this.element.classList.add(p.PRIMARY),this.content&&(this.element.innerHTML=this.content),this.setIconCss(),this.enableRtl&&this.element.classList.add(p.RTL),this.disabled?this.controlStatus(this.disabled):this.wireEvents(),this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+p.BUTTON})},s.prototype.controlStatus=function(e){this.element.disabled=e},s.prototype.setIconCss=function(){if(this.iconCss){var e=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(e.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add(p.ICONBTN);var t=this.element.childNodes[0];!t||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?this.element.appendChild(e):this.element.insertBefore(e,t)}},s.prototype.wireEvents=function(){this.isToggle&&t.EventHandler.add(this.element,"click",this.btnClickHandler,this)},s.prototype.unWireEvents=function(){this.isToggle&&t.EventHandler.remove(this.element,"click",this.btnClickHandler)},s.prototype.btnClickHandler=function(){this.element.classList.contains("e-active")?this.element.classList.remove("e-active"):this.element.classList.add("e-active")},s.prototype.destroy=function(){var s,i=[p.PRIMARY,p.RTL,p.ICONBTN,"e-success","e-info","e-danger","e-warning","e-flat","e-outline","e-small","e-bigger","e-active","e-round","e-top-icon-btn","e-bottom-icon-btn"];this.cssClass&&(i=i.concat(this.cssClass.split(" "))),e.prototype.destroy.call(this),t.removeClass([this.element],i),this.element.getAttribute("class")||this.element.removeAttribute("class"),this.disabled&&this.element.removeAttribute("disabled"),this.content&&(this.element.innerHTML=this.element.innerHTML.replace(this.content,"")),(s=this.element.querySelector("span.e-btn-icon"))&&t.detach(s),this.unWireEvents(),this.removeRippleEffect()},s.prototype.getModuleName=function(){return"btn"},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.Inject=function(){},s.prototype.onPropertyChanged=function(e,s){for(var n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"isPrimary":e.isPrimary?this.element.classList.add(p.PRIMARY):this.element.classList.remove(p.PRIMARY);break;case"disabled":this.controlStatus(e.disabled),this.unWireEvents();break;case"iconCss":var a=this.element.querySelector("span.e-btn-icon");a?e.iconCss?(a.className="e-btn-icon "+e.iconCss,this.element.textContent.trim()&&("Left"===this.iconPosition?a.classList.add("e-icon-left"):a.classList.add("e-icon-right"))):t.detach(a):this.setIconCss();break;case"iconPosition":t.removeClass([this.element],["e-top-icon-btn","e-bottom-icon-btn"]),(a=this.element.querySelector("span.e-btn-icon"))&&t.detach(a),this.setIconCss();break;case"cssClass":s.cssClass&&t.removeClass([this.element],s.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?this.element.classList.add(p.RTL):this.element.classList.remove(p.RTL);break;case"content":i(this.element)||this.element.classList.remove(p.ICONBTN),this.element.innerHTML=e.content,this.setIconCss();break;case"isToggle":e.isToggle?t.EventHandler.add(this.element,"click",this.btnClickHandler,this):(t.EventHandler.remove(this.element,"click",this.btnClickHandler),t.removeClass([this.element],["e-active"]))}},h([t.Property("Left")],s.prototype,"iconPosition",void 0),h([t.Property("")],s.prototype,"iconCss",void 0),h([t.Property(!1)],s.prototype,"disabled",void 0),h([t.Property(!1)],s.prototype,"isPrimary",void 0),h([t.Property("")],s.prototype,"cssClass",void 0),h([t.Property("")],s.prototype,"content",void 0),h([t.Property(!1)],s.prototype,"isToggle",void 0),h([t.Property()],s.prototype,"locale",void 0),h([t.Event()],s.prototype,"created",void 0),s=h([t.NotifyPropertyChanges],s)}(t.Component),u=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),m=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},f="e-ripple-container",v="e-checkbox-wrapper",y=function(e){function i(t,s){var i=e.call(this,t,s)||this;return i.isFocused=!1,i.isMouseClick=!1,i}return u(i,e),i.prototype.changeState=function(e){var s,i,n=this.getWrapper().getElementsByClassName("e-frame")[0];t.isRippleEnabled&&(i=this.getWrapper().getElementsByClassName(f)[0]),"check"===e?(n.classList.remove("e-stop"),n.classList.add("e-check"),i&&(i.classList.remove("e-ripple-stop"),i.classList.add("e-ripple-check")),s="true",this.element.checked=!0):"uncheck"===e?(t.removeClass([n],["e-check","e-stop"]),i&&t.removeClass([i],["e-ripple-check","e-ripple-stop"]),s="false",this.element.checked=!1):(n.classList.remove("e-check"),n.classList.add("e-stop"),i&&(i.classList.remove("e-ripple-check"),i.classList.add("e-ripple-stop")),s="mixed",this.element.indeterminate=!0),this.getWrapper().setAttribute("aria-checked",s)},i.prototype.clickHandler=function(e){this.isMouseClick&&(this.focusOutHandler(),this.isMouseClick=!1),this.indeterminate?(this.changeState(this.checked?"check":"uncheck"),this.indeterminate=!1,this.element.indeterminate=!1):this.checked?(this.changeState("uncheck"),this.checked=!1):(this.changeState("check"),this.checked=!0);var t={checked:this.element.checked,event:e};this.trigger("change",t)},i.prototype.destroy=function(){var s=this,i=this.getWrapper();e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode.insertBefore(this.element,i),t.detach(i),this.element.checked=!1,this.indeterminate&&(this.element.indeterminate=!1),["name","value","disabled"].forEach(function(e){s.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")},i.prototype.focusHandler=function(){this.isFocused=!0},i.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus"),this.isFocused=!1},i.prototype.getModuleName=function(){return"checkbox"},i.prototype.getPersistData=function(){return this.addOnPersist(["checked","indeterminate"])},i.prototype.getWrapper=function(){return this.element.parentElement.parentElement},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState("check"),this.indeterminate&&this.changeState(),this.disabled&&this.setDisabled()},i.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains(v)||(e=this.createElement("div",{className:v,attrs:{role:"checkbox","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var s=this.createElement("label",{attrs:{for:this.element.id}}),i=this.createElement("span",{className:"e-icons e-frame"});if(this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),e.appendChild(s),s.appendChild(this.element),l(this,s),s.appendChild(i),t.isRippleEnabled){var n=this.createElement("span",{className:f});"Before"===this.labelPosition?s.appendChild(n):s.insertBefore(n,i),t.rippleEffect(n,{duration:400,isCenterRipple:!0})}this.label&&this.setText(this.label)},i.prototype.keyUpHandler=function(){this.isFocused&&this.getWrapper().classList.add("e-focus")},i.prototype.labelMouseHandler=function(e){this.isMouseClick=!0,o(e,this.getWrapper().getElementsByClassName(f)[0])},i.prototype.onPropertyChanged=function(e,s){for(var i=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":this.indeterminate=!1,this.element.indeterminate=!1,this.changeState(e.checked?"check":"uncheck");break;case"indeterminate":e.indeterminate?this.changeState():(this.element.indeterminate=!1,this.changeState(this.checked?"check":"uncheck"));break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,i.classList.remove("e-checkbox-disabled"),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":var a=i.getElementsByClassName("e-label")[0],o=i.getElementsByTagName("label")[0];t.detach(a),"After"===e.labelPosition?o.appendChild(a):o.insertBefore(a,i.getElementsByClassName("e-frame")[0]);break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.element.setAttribute("value",e.value)}},i.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=s(this.createElement,"EJS-CHECKBOX","checkbox",e,v,"checkbox"),this.element=e,"checkbox"!==this.element.getAttribute("type")&&this.element.setAttribute("type","checkbox"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},i.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents()},i.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-checkbox-disabled"),e.setAttribute("aria-disabled","true")},i.prototype.setText=function(e){var t=this.getWrapper().getElementsByClassName("e-label")[0];if(t)t.textContent=e;else{t=this.createElement("span",{className:"e-label",innerHTML:e});var s=this.getWrapper().getElementsByTagName("label")[0];"Before"===this.labelPosition?s.insertBefore(t,this.getWrapper().getElementsByClassName("e-frame")[0]):s.appendChild(t)}},i.prototype.changeHandler=function(e){e.stopPropagation()},i.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,t.attributes(this.element,{checked:this.initialCheckedValue.toString()})},i.prototype.unWireEvents=function(){var e=this.getWrapper();t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var s=e.getElementsByTagName("label")[0];t.EventHandler.remove(s,"mousedown",this.labelMouseHandler),t.EventHandler.remove(s,"mouseup",this.labelMouseHandler),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.remove(this.element,"change",this.changeHandler)},i.prototype.wireEvents=function(){var e=this.getWrapper();t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var s=e.getElementsByTagName("label")[0];t.EventHandler.add(s,"mousedown",this.labelMouseHandler,this),t.EventHandler.add(s,"mouseup",this.labelMouseHandler,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this),"EJS-CHECKBOX"===this.tagName&&t.EventHandler.add(this.element,"change",this.changeHandler,this)},m([t.Event()],i.prototype,"change",void 0),m([t.Event()],i.prototype,"created",void 0),m([t.Property(!1)],i.prototype,"checked",void 0),m([t.Property("")],i.prototype,"cssClass",void 0),m([t.Property(!1)],i.prototype,"disabled",void 0),m([t.Property(!1)],i.prototype,"indeterminate",void 0),m([t.Property("")],i.prototype,"label",void 0),m([t.Property("After")],i.prototype,"labelPosition",void 0),m([t.Property("")],i.prototype,"name",void 0),m([t.Property("")],i.prototype,"value",void 0),i=m([t.NotifyPropertyChanges],i)}(t.Component),b=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),g=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},C=function(e){function i(t,s){var i=e.call(this,t,s)||this;return i.isKeyPressed=!1,i}b(i,e),n=i,i.prototype.changeHandler=function(e){this.checked=!0,this.dataBind();var t={value:this.value,event:e};this.trigger("change",t),"EJS-RADIOBUTTON"===this.tagName&&e.stopPropagation()},i.prototype.updateChange=function(e){for(var s,i,r=this.getRadioGroup(),a=0;a<r.length;a++)(s=r[a])!==this.element&&((i=t.getInstance(s,n)).checked=!1,"EJS-RADIOBUTTON"===this.tagName&&(i.angularValue=this.value))},i.prototype.destroy=function(){var s=this,i=this.element.parentElement;e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),"INPUT"===this.tagName?(i.parentNode.insertBefore(this.element,i),t.detach(i),this.element.checked=!1,["name","value","disabled"].forEach(function(e){s.element.removeAttribute(e)})):(["role","aria-checked","class"].forEach(function(e){i.removeAttribute(e)}),i.innerHTML="")},i.prototype.focusHandler=function(){this.isKeyPressed&&this.getLabel().classList.add("e-focus")},i.prototype.focusOutHandler=function(){this.getLabel().classList.remove("e-focus")},i.prototype.getModuleName=function(){return"radio"},i.prototype.getSelectedValue=function(){for(var e,t=this.getRadioGroup(),s=0,i=t.length;s<i;s++)if((e=t[s]).checked)return e.value;return""},i.prototype.getRadioGroup=function(){return document.querySelectorAll('input.e-radio[name="'+this.element.getAttribute("name")+'"]')},i.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},i.prototype.getLabel=function(){return this.element.nextElementSibling},i.prototype.initialize=function(){t.isNullOrUndefined(this.initialCheckedValue)&&(this.initialCheckedValue=this.checked),this.initWrapper(),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&(this.element.checked=!0),this.disabled&&this.setDisabled()},i.prototype.initWrapper=function(){var e,s=this.element.parentElement;s.classList.contains("e-radio-wrapper")||(s=this.createElement("div",{className:"e-radio-wrapper"}),this.element.parentNode.insertBefore(s,this.element));var i=this.createElement("label",{attrs:{for:this.element.id}});s.appendChild(this.element),s.appendChild(i),t.isRippleEnabled&&(e=this.createElement("span",{className:"e-ripple-container"}),i.appendChild(e),t.rippleEffect(e,{duration:400,isCenterRipple:!0})),this.enableRtl&&i.classList.add("e-rtl"),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),this.label&&this.setText(this.label)},i.prototype.keyDownHandler=function(){this.isKeyPressed=!0},i.prototype.labelRippleHandler=function(e){o(e,this.getLabel().getElementsByClassName("e-ripple-container")[0])},i.prototype.mouseDownHandler=function(){this.isKeyPressed=!1},i.prototype.formResetHandler=function(){this.checked=this.initialCheckedValue,this.initialCheckedValue&&t.attributes(this.element,{checked:"true"})},i.prototype.onPropertyChanged=function(e,s){for(var i=this.getLabel(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":e.checked&&this.updateChange(e.checked),this.element.checked=e.checked;break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,this.wireEvents());break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"label":this.setText(e.label);break;case"labelPosition":"Before"===e.labelPosition?i.classList.add("e-right"):i.classList.remove("e-right");break;case"name":this.element.setAttribute("name",e.name);break;case"value":this.element.setAttribute("value",e.value)}},i.prototype.preRender=function(){var e=this.element;if(this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,e=s(this.createElement,"EJS-RADIOBUTTON","radio",e,"e-radio-wrapper","radio"),this.element=e,"radio"!==this.element.getAttribute("type")&&this.element.setAttribute("type","radio"),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),"EJS-RADIOBUTTON"===this.tagName){var i=this.element.getAttribute("formcontrolname");i&&(this.setProperties({name:i},!0),this.element.setAttribute("name",i))}},i.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents()},i.prototype.setDisabled=function(){this.element.disabled=!0},i.prototype.setText=function(e){var t=this.getLabel(),s=t.getElementsByClassName("e-label")[0];s?s.textContent=e:(s=this.createElement("span",{className:"e-label",innerHTML:e}),t.appendChild(s)),"Before"===this.labelPosition?this.getLabel().classList.add("e-right"):this.getLabel().classList.remove("e-right")},i.prototype.unWireEvents=function(){var e=this.getLabel();t.EventHandler.remove(this.element,"change",this.changeHandler),t.EventHandler.remove(document,"keydown",this.keyDownHandler),t.EventHandler.remove(e,"mousedown",this.mouseDownHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler);var s=e.getElementsByClassName("e-label")[0];s&&(t.EventHandler.remove(s,"mousedown",this.labelRippleHandler),t.EventHandler.remove(s,"mouseup",this.labelRippleHandler)),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},i.prototype.wireEvents=function(){var e=this.getLabel();t.EventHandler.add(this.element,"change",this.changeHandler,this),t.EventHandler.add(document,"keydown",this.keyDownHandler,this),t.EventHandler.add(e,"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this);var s=e.getElementsByClassName("e-label")[0];s&&(t.EventHandler.add(s,"mousedown",this.labelRippleHandler,this),t.EventHandler.add(s,"mouseup",this.labelRippleHandler,this)),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)};var n;return g([t.Event()],i.prototype,"change",void 0),g([t.Event()],i.prototype,"created",void 0),g([t.Property(!1)],i.prototype,"checked",void 0),g([t.Property("")],i.prototype,"cssClass",void 0),g([t.Property(!1)],i.prototype,"disabled",void 0),g([t.Property("")],i.prototype,"label",void 0),g([t.Property("After")],i.prototype,"labelPosition",void 0),g([t.Property("")],i.prototype,"name",void 0),g([t.Property("")],i.prototype,"value",void 0),i=n=g([t.NotifyPropertyChanges],i)}(t.Component),E=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),k=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},H="e-ripple-container",P=function(e){function s(t,s){var i=e.call(this,t,s)||this;return i.isKeyPressed=!1,i.isDrag=!1,i}return E(s,e),s.prototype.changeState=function(e){var s,i,n=this.getWrapper(),r=n.querySelector(".e-switch-inner"),a=n.querySelector(".e-switch-handle");t.isRippleEnabled&&(i=n.getElementsByClassName(H)[0]),e?(t.addClass([r,a],"e-switch-active"),s="true",this.element.checked=!0,this.checked=!0,i&&t.addClass([i],["e-ripple-check"])):(t.removeClass([r,a],"e-switch-active"),s="false",this.element.checked=!1,this.checked=!1,i&&t.removeClass([i],["e-ripple-check"])),n.setAttribute("aria-checked",s)},s.prototype.clickHandler=function(e){this.isDrag=!1,this.focusOutHandler(),this.changeState(!this.checked),this.element.focus();var t={checked:this.element.checked,event:e};this.trigger("change",t)},s.prototype.destroy=function(){e.prototype.destroy.call(this),this.disabled||this.unWireEvents(),n(this,this.getWrapper(),this.tagName)},s.prototype.focusHandler=function(){this.isKeyPressed&&this.getWrapper().classList.add("e-focus")},s.prototype.focusOutHandler=function(){this.getWrapper().classList.remove("e-focus")},s.prototype.getModuleName=function(){return"switch"},s.prototype.getPersistData=function(){return this.addOnPersist(["checked"])},s.prototype.getWrapper=function(){return this.element.parentElement},s.prototype.initialize=function(){t.isNullOrUndefined(this.initialSwitchCheckedValue)&&(this.initialSwitchCheckedValue=this.checked),this.name&&this.element.setAttribute("name",this.name),this.value&&this.element.setAttribute("value",this.value),this.checked&&this.changeState(!0),this.disabled&&this.setDisabled(),(this.onLabel||this.offLabel)&&this.setLabel(this.onLabel,this.offLabel)},s.prototype.initWrapper=function(){var e=this.element.parentElement;e.classList.contains("e-switch-wrapper")||(e=this.createElement("div",{className:"e-switch-wrapper",attrs:{role:"switch","aria-checked":"false"}}),this.element.parentNode.insertBefore(e,this.element));var s=this.createElement("span",{className:"e-switch-inner"}),i=this.createElement("span",{className:"e-switch-on"}),n=this.createElement("span",{className:"e-switch-off"}),r=this.createElement("span",{className:"e-switch-handle"});if(e.appendChild(this.element),l(this,e),s.appendChild(i),s.appendChild(n),e.appendChild(s),e.appendChild(r),t.isRippleEnabled){var a=this.createElement("span",{className:H});r.appendChild(a),t.rippleEffect(a,{duration:400,isCenterRipple:!0})}this.enableRtl&&e.classList.add("e-rtl"),this.cssClass&&t.addClass([e],this.cssClass.split(" "))},s.prototype.onPropertyChanged=function(e,s){for(var i=this.getWrapper(),n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"checked":this.changeState(e.checked);break;case"disabled":e.disabled?(this.setDisabled(),this.unWireEvents()):(this.element.disabled=!1,i.classList.remove("e-switch-disabled"),i.setAttribute("aria-disabled","false"),this.wireEvents());break;case"value":this.element.setAttribute("value",e.value);break;case"name":this.element.setAttribute("name",e.name);break;case"onLabel":case"offLabel":this.setLabel(e.onLabel,e.offLabel);break;case"enableRtl":e.enableRtl?i.classList.add("e-rtl"):i.classList.remove("e-rtl");break;case"cssClass":s.cssClass&&t.removeClass([i],s.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "))}},s.prototype.preRender=function(){var e=this.element;this.formElement=t.closest(this.element,"form"),this.tagName=this.element.tagName,r(this,"EJS-SWITCH","e-switch-wrapper",e,this.getModuleName())},s.prototype.render=function(){this.initWrapper(),this.initialize(),this.disabled||this.wireEvents()},s.prototype.rippleHandler=function(e){o(e,this.getWrapper().getElementsByClassName(H)[0]),"mousedown"===e.type&&e.currentTarget.classList.contains("e-switch-wrapper")&&1===e.which&&(this.isDrag=!0,this.isKeyPressed=!1)},s.prototype.rippleTouchHandler=function(e){var t=this.getWrapper().getElementsByClassName(H)[0];if(t){var s=document.createEvent("MouseEvents");s.initEvent(e,!1,!0),t.dispatchEvent(s)}},s.prototype.setDisabled=function(){var e=this.getWrapper();this.element.disabled=!0,e.classList.add("e-switch-disabled"),e.setAttribute("aria-disabled","true")},s.prototype.setLabel=function(e,t){var s=this.getWrapper();e&&(s.querySelector(".e-switch-on").textContent=e),t&&(s.querySelector(".e-switch-off").textContent=t)},s.prototype.switchFocusHandler=function(){this.isKeyPressed=!0},s.prototype.switchMouseUp=function(e){var t=e.target;this.getWrapper().getElementsByClassName(H)[0];"touchmove"===e.type&&e.preventDefault(),"touchstart"===e.type&&(this.isDrag=!0,this.rippleTouchHandler("mousedown")),this.isDrag&&("mouseup"===e.type&&t.className.indexOf("e-switch")<0||"touchend"===e.type)&&(this.clickHandler(e),this.rippleTouchHandler("mouseup"),e.preventDefault())},s.prototype.formResetHandler=function(){this.checked=this.initialSwitchCheckedValue,t.attributes(this.element,{checked:this.initialSwitchCheckedValue.toString()})},s.prototype.toggle=function(){this.clickHandler()},s.prototype.wireEvents=function(){var e=this.getWrapper();e.querySelector(".e-switch-handle");this.delegateMouseUpHandler=this.switchMouseUp.bind(this),this.delegateKeyDownHandler=this.switchFocusHandler.bind(this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focus",this.focusHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(document,"mouseup",this.delegateMouseUpHandler,this),t.EventHandler.add(document,"keydown",this.delegateKeyDownHandler,this),t.EventHandler.add(e,"mousedown mouseup",this.rippleHandler,this),t.EventHandler.add(e,"touchstart touchmove touchend",this.switchMouseUp,this),this.formElement&&t.EventHandler.add(this.formElement,"reset",this.formResetHandler,this)},s.prototype.unWireEvents=function(){var e=this.getWrapper();e.querySelector(".e-switch-handle");t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(this.element,"focus",this.focusHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(document,"mouseup",this.delegateMouseUpHandler),t.EventHandler.remove(document,"keydown",this.delegateKeyDownHandler),t.EventHandler.remove(e,"mousedown mouseup",this.rippleHandler),t.EventHandler.remove(e,"touchstart touchmove touchend",this.switchMouseUp),this.formElement&&t.EventHandler.remove(this.formElement,"reset",this.formResetHandler)},k([t.Event()],s.prototype,"change",void 0),k([t.Event()],s.prototype,"created",void 0),k([t.Property(!1)],s.prototype,"checked",void 0),k([t.Property("")],s.prototype,"cssClass",void 0),k([t.Property(!1)],s.prototype,"disabled",void 0),k([t.Property("")],s.prototype,"name",void 0),k([t.Property("")],s.prototype,"onLabel",void 0),k([t.Property("")],s.prototype,"offLabel",void 0),k([t.Property("")],s.prototype,"value",void 0),s=k([t.NotifyPropertyChanges],s)}(t.Component),L=function(){var e=function(t,s){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])})(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),N=function(e,t,s,i){var n,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,i);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(a=(r<3?n(a):r>3?n(t,s,a):n(t,s))||a);return r>3&&a&&Object.defineProperty(t,s,a),a},w={chipSet:"e-chip-set",chip:"e-chip",avatar:"e-chip-avatar",text:"e-chip-text",icon:"e-chip-icon",delete:"e-chip-delete",deleteIcon:"e-dlt-btn",multiSelection:"e-multi-selection",singleSelection:"e-selection",active:"e-active",chipWrapper:"e-chip-avatar-wrap",iconWrapper:"e-chip-icon-wrap",focused:"e-focused",disabled:"e-disabled",rtl:"e-rtl"},x=function(e){function s(t,s){return e.call(this,t,s)||this}return L(s,e),s.prototype.preRender=function(){},s.prototype.render=function(){this.type=this.chips.length?"chipset":this.text||this.element.innerText?"chip":"chipset",this.setAttributes(),this.createChip(),this.setRtl(),this.wireEvent(!1),this.select(this.selectedChips),this.rippleFunctin=t.rippleEffect(this.element,{selector:".e-chip"})},s.prototype.createChip=function(){this.innerText=this.element.innerText.trim(),this.element.innerHTML="",this.chipCreation("chip"===this.type?[this.innerText?this.innerText:this.text]:this.chips)},s.prototype.setAttributes=function(){"chip"===this.type?(this.element.tabIndex=0,this.element.setAttribute("role","option")):(this.element.classList.add(w.chipSet),this.element.setAttribute("role","listbox"),"Multiple"===this.selection?(this.element.classList.add(w.multiSelection),this.element.setAttribute("aria-multiselectable","true")):"Single"===this.selection?(this.element.classList.add(w.singleSelection),this.element.setAttribute("aria-multiselectable","false")):this.element.setAttribute("aria-multiselectable","false"))},s.prototype.setRtl=function(){this.element.classList[this.enableRtl?"add":"remove"](w.rtl)},s.prototype.chipCreation=function(e){for(var s=[],i=0;i<e.length;i++){var n=this.getFieldValues(e[i]),r=this.elementCreation(n),a=(w.chip+" "+(n.enabled?" ":w.disabled)+" "+(n.avatarIconCss||n.avatarText?w.chipWrapper:n.leadingIconCss?w.iconWrapper:" ")+" "+n.cssClass).split(" ").filter(function(e){return e});if("chip"===this.type)s=r,t.addClass([this.element],a),this.element.setAttribute("aria-label",n.text);else{var o=this.createElement("DIV",{className:a.join(" "),attrs:{tabIndex:"0",role:"option","aria-label":n.text,"aria-selected":"false"}});t.append(r,o),s.push(o)}}t.append(s,this.element)},s.prototype.getFieldValues=function(e){var s="false"!==this.enabled.toString();return{text:"object"==typeof e?e.text?e.text.toString():this.text.toString():"chip"===this.type?this.innerText?this.innerText:this.text.toString():e.toString(),cssClass:"object"==typeof e&&e.cssClass?e.cssClass.toString():this.cssClass.toString(),leadingIconCss:"object"==typeof e&&e.leadingIconCss?e.leadingIconCss.toString():this.leadingIconCss.toString(),avatarIconCss:"object"==typeof e&&e.avatarIconCss?e.avatarIconCss.toString():this.avatarIconCss.toString(),avatarText:"object"==typeof e&&e.avatarText?e.avatarText.toString():this.avatarText.toString(),trailingIconCss:"object"==typeof e&&e.trailingIconCss?e.trailingIconCss.toString():this.trailingIconCss.toString(),enabled:"object"==typeof e?t.isNullOrUndefined(e.enabled)?s:"false"!==e.enabled.toString():s}},s.prototype.elementCreation=function(e){var t=[];if(e.avatarText||e.avatarIconCss){var s=(w.avatar+" "+e.avatarIconCss).trim(),i=this.createElement("span",{className:s});i.innerText=e.avatarText,t.push(i)}else if(e.leadingIconCss){var s=(w.icon+" "+e.leadingIconCss).trim(),n=this.createElement("span",{className:s});t.push(n)}var r=this.createElement("span",{className:w.text});if(r.innerText=e.text,t.push(r),e.trailingIconCss||"chip"!==this.type&&this.enableDelete){var s=(w.delete+" "+(e.trailingIconCss?e.trailingIconCss:w.deleteIcon)).trim(),a=this.createElement("span",{className:s});t.push(a)}return t},s.prototype.find=function(e){var t,s=e instanceof HTMLElement?e:this.element.querySelectorAll("."+w.chip)[e];return s&&"chip"!==this.type&&((t={text:void 0,index:void 0,element:void 0,data:void 0}).index=Array.prototype.slice.call(this.element.querySelectorAll("."+w.chip)).indexOf(s),t.text="object"==typeof this.chips[t.index]?this.chips[t.index].text?this.chips[t.index].text.toString():"":this.chips[t.index].toString(),t.data=this.chips[t.index],t.element=s),t},s.prototype.add=function(e){var t;if("chip"!==this.type){var s=e instanceof Array?e:[e];(t=this.chips).push.apply(t,s),this.chipCreation(s)}},s.prototype.select=function(e){if("chip"!==this.type&&"None"!==this.selection)for(var t=e instanceof Array?e:[e],s=0;s<t.length;s++){var i=t[s]instanceof HTMLElement?t[s]:this.element.querySelectorAll("."+w.chip)[t[s]];i instanceof HTMLElement&&this.selectionHandler(i)}},s.prototype.remove=function(e){var t=this;if("chip"!==this.type){var s=e instanceof Array?e:[e],i=[],n=this.element.querySelectorAll("."+w.chip);s.forEach(function(e){var t=e instanceof HTMLElement?e:n[e];t instanceof HTMLElement&&i.push(t)}),i.forEach(function(e){var s=t.element.querySelectorAll("."+w.chip),i=Array.prototype.slice.call(s).indexOf(e);t.deleteHandler(e,i)})}},s.prototype.getSelectedChips=function(){var e,s=this;if("chip"!==this.type&&"None"!==this.selection){var i={texts:[],Indexes:[],data:[],elements:[]};this.element.querySelectorAll("."+w.active).forEach(function(e){i.elements.push(e);var t=Array.prototype.slice.call(s.element.querySelectorAll("."+w.chip)).indexOf(e);i.Indexes.push(t),i.data.push(s.chips[t]);var n="object"==typeof s.chips[t]?s.chips[t].text.toString():s.chips[t].toString();i.texts.push(n)});var n={text:i.texts[0],index:i.Indexes[0],data:i.data[0],element:i.elements[0]};e=t.isNullOrUndefined(n.index)?void 0:"Multiple"===this.selection?i:n}return e},s.prototype.wireEvent=function(e){e?(t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"focusout",this.focusOutHandler),t.EventHandler.remove(this.element,"keydown",this.keyHandler),t.EventHandler.remove(this.element,"keyup",this.keyHandler)):(t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),t.EventHandler.add(this.element,"keydown",this.keyHandler,this),t.EventHandler.add(this.element,"keyup",this.keyHandler,this))},s.prototype.keyHandler=function(e){e.target.classList.contains(w.chip)&&("keydown"===e.type?13===e.keyCode?this.clickHandler(e):46===e.keyCode&&this.enableDelete&&this.clickHandler(e,!0):9===e.keyCode&&this.focusInHandler(e.target))},s.prototype.focusInHandler=function(e){e.classList.contains(w.focused)||e.classList.add(w.focused)},s.prototype.focusOutHandler=function(e){var s=t.closest(e.target,"."+w.chip),i="chip"===this.type?this.element.classList.contains(w.focused)?this.element:null:this.element.querySelector("."+w.focused);s&&i&&i.classList.remove(w.focused)},s.prototype.clickHandler=function(e,s){void 0===s&&(s=!1);var i=t.closest(e.target,"."+w.chip);if(i)if("chip"!==this.type){var n=this.find(i);if(n.event=e,(e.target.classList.contains(w.delete)?e.target:s?i.querySelector("."+w.delete):void 0)&&this.enableDelete){n.cancel=!1;var r=n;this.trigger("delete",r),r.cancel||this.deleteHandler(n.element,n.index)}else if("None"!==this.selection){this.selectionHandler(i),n.selected=i.classList.contains(w.active);var a=n;this.trigger("click",a)}else{this.focusInHandler(i);o=n;this.trigger("click",o)}}else{this.focusInHandler(i);var o={text:this.innerText?this.innerText:this.text,element:i,data:this.text,event:e};this.trigger("click",o)}},s.prototype.selectionHandler=function(e){if("Single"===this.selection){var t=this.element.querySelector("."+w.active);t&&t!==e&&(t.classList.remove(w.active),e.setAttribute("aria-selected","false"))}e.classList.contains(w.active)?(e.classList.remove(w.active),e.setAttribute("aria-selected","false")):(e.classList.add(w.active),e.setAttribute("aria-selected","true"))},s.prototype.deleteHandler=function(e,s){this.chips.splice(s,1),t.detach(e)},s.prototype.destroy=function(){e.prototype.destroy.call(this),t.removeClass([this.element],[w.chipSet,w.chip,w.rtl,w.multiSelection,w.singleSelection,w.disabled,w.chipWrapper,w.iconWrapper,w.active,w.focused].concat(this.cssClass.toString().split(" ").filter(function(e){return e}))),this.removeMultipleAttributes(["tabindex","role","aria-label","aria-multiselectable"],this.element),this.wireEvent(!0),this.rippleFunctin(),this.element.innerHTML="",this.element.innerText=this.innerText},s.prototype.removeMultipleAttributes=function(e,t){e.forEach(function(e){t.removeAttribute(e)})},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.getModuleName=function(){return"chip-list"},s.prototype.onPropertyChanged=function(e,s){for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"chips":case"text":case"avatarText":case"avatarIconCss":case"leadingIconCss":case"trailingIconCss":case"selection":case"enableDelete":case"enabled":this.refresh();break;case"cssClass":"chip"===this.type?(t.removeClass([this.element],s.cssClass.toString().split(" ").filter(function(e){return e})),t.addClass([this.element],e.cssClass.toString().split(" ").filter(function(e){return e}))):this.refresh();break;case"selectedChips":this.select(e.selectedChips);break;case"enableRtl":this.setRtl()}},N([t.Property([])],s.prototype,"chips",void 0),N([t.Property("")],s.prototype,"text",void 0),N([t.Property("")],s.prototype,"avatarText",void 0),N([t.Property("")],s.prototype,"avatarIconCss",void 0),N([t.Property("")],s.prototype,"leadingIconCss",void 0),N([t.Property("")],s.prototype,"trailingIconCss",void 0),N([t.Property("")],s.prototype,"cssClass",void 0),N([t.Property(!0)],s.prototype,"enabled",void 0),N([t.Property([])],s.prototype,"selectedChips",void 0),N([t.Property("None")],s.prototype,"selection",void 0),N([t.Property(!1)],s.prototype,"enableDelete",void 0),N([t.Event()],s.prototype,"created",void 0),N([t.Event()],s.prototype,"click",void 0),N([t.Event()],s.prototype,"delete",void 0),s=N([t.NotifyPropertyChanges],s)}(t.Component),S=function(){function e(){}return e}();return e.wrapperInitialize=s,e.getTextNode=i,e.destroy=n,e.preRender=r,e.createCheckBox=a,e.rippleMouseHandler=o,e.setHiddenInput=l,e.Button=d,e.CheckBox=y,e.RadioButton=C,e.Switch=P,e.classNames=w,e.ChipList=x,e.Chip=S,e}({},ej.base),this.ejs=ej;
//# sourceMappingURL=ej2-buttons.min.js.map
/*!
* filename: index.d.ts
* version : 17.1.38
* version : 17.1.40
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved.

@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license.

{
"name": "@syncfusion/ej2-buttons",
"version": "17.1.38",
"version": "17.1.40",
"description": "A package of feature-rich Essential JS 2 components such as Button, CheckBox, RadioButton and Switch.",

@@ -5,0 +5,0 @@ "author": "Syncfusion Inc.",

@@ -91,2 +91,9 @@ import { Component, INotifyPropertyChanged } from '@syncfusion/ej2-base';

/**
* To get the value of selected radio button in a group.
* @method getSelectedValue
* @return {string}
*/
getSelectedValue(): string;
private getRadioGroup;
/**
* Gets the properties to be maintained in the persistence state.

@@ -93,0 +100,0 @@ * @private

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

var instance;
var name = this.element.getAttribute('name');
var radioGrp = document.querySelectorAll('input.e-radio[name="' + name + '"]');
var radioGrp = this.getRadioGroup();
for (var i = 0; i < radioGrp.length; i++) {

@@ -115,2 +114,21 @@ input = radioGrp[i];

/**
* To get the value of selected radio button in a group.
* @method getSelectedValue
* @return {string}
*/
RadioButton.prototype.getSelectedValue = function () {
var input;
var radioGrp = this.getRadioGroup();
for (var i = 0, len = radioGrp.length; i < len; i++) {
input = radioGrp[i];
if (input.checked) {
return input.value;
}
}
return '';
};
RadioButton.prototype.getRadioGroup = function () {
return document.querySelectorAll('input.e-radio[name="' + this.element.getAttribute('name') + '"]');
};
/**
* Gets the properties to be maintained in the persistence state.

@@ -117,0 +135,0 @@ * @private

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 too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc