@syncfusion/ej2-splitbuttons
Advanced tools
Comparing version 18.1.52 to 18.2.44
/*! | ||
* filename: ej2-splitbuttons.umd.min.js | ||
* version : 18.1.52 | ||
* version : 18.2.44 | ||
* Copyright Syncfusion Inc. 2001 - 2020. 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"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-buttons","@syncfusion/ej2-popups"],t):t(e.ej={},e.ej2Base,e.ej2Buttons,e.ej2Popups)}(this,function(e,t,n,i){"use strict";function s(e,n){for(var i=t.extend({},e),s=0,o=Object.keys(i);s<o.length;s++){var r=o[s];n.indexOf(r)<0&&t.deleteObject(i,r)}return i}var o=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},a=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return o(n,e),r([t.Property("")],n.prototype,"iconCss",void 0),r([t.Property("")],n.prototype,"id",void 0),r([t.Property(!1)],n.prototype,"separator",void 0),r([t.Property("")],n.prototype,"text",void 0),r([t.Property("")],n.prototype,"url",void 0),n}(t.ChildProperty),p=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),l=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},c=new t.Observer,h="e-disabled",d="e-focused",m="e-menu-icon",u="e-item",y="e-dropdown-popup",f="e-separator",v="e-vertical",g=function(e){function o(t,n){return e.call(this,t,n)||this}return p(o,e),o.prototype.preRender=function(){},o.prototype.getPersistData=function(){return this.addOnPersist([])},o.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.closePopup()},o.prototype.render=function(){t.isBlazor()&&this.isServerRendered?(n.buttonObserver.on("component-rendered",this.buttonRendered,this,this.element.id),this.createPopup(),this.setActiveElem([this.element])):this.initialize(),this.disabled||this.wireEvents(),this.renderComplete(),t.isBlazor()&&this.isServerRendered&&c.notify("component-rendered",{id:this.element.id,instance:this})},o.prototype.buttonRendered=function(e){this.element.id===e.instance.element.id&&(this.button=e.instance,n.buttonObserver.off("component-rendered",this.buttonRendered,this.element.id))},o.prototype.addItems=function(e,t){for(var n,i=this.items.length,s=0,o=this.items.length;s<o;s++)if(t===this.items[s].text){i=s;break}for(var r=e.length-1;r>=0;r--)n=new a(this,"items",e[r],!0),this.items.splice(i,0,n);this.canOpen()||this.createItems()},o.prototype.removeItems=function(e){for(var t=0,n=e.length;t<n;t++)for(var i=0,s=this.items.length;i<s;i++)if(e[t]===this.items[i].text){this.items.splice(i,1);break}this.canOpen()||this.createItems()},o.prototype.createPopup=function(){var e,n=this.createElement("div",{className:y,id:this.element.id+"-popup"});document.body.appendChild(n),this.dropDown=new i.Popup(n,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),t.attributes(this.element,(e={},e["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e["aria-owns"]=this.getPopUpElement().id,e.type="button",e["aria-label"]=this.element.textContent+" dropdownbutton",e)),this.cssClass&&t.addClass([n],this.cssClass.split(" "))},o.prototype.getTargetElement=function(){return"string"==typeof this.target?t.select(this.target):this.target},o.prototype.createItems=function(e){var n,i,s,o,r=this.items,a=this.hasIcon(this.items,"iconCss"),p=this.getULElement();p?p.innerHTML="":p=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var l=0;l<r.length;l++){i=r[l];var c=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.text):i.text;s=this.createElement("li",{innerHTML:i.url?"":c,className:i.separator?u+" "+f:u,attrs:{role:"menuItem",tabindex:"-1"},id:i.id?i.id:t.getUniqueID("e-"+this.getModuleName()+"-item")}),i.url&&(s.appendChild(this.createAnchor(i)),s.classList.add("e-url")),i.iconCss?(n=this.createElement("span",{className:m+" "+i.iconCss}),i.url?s.childNodes[0].appendChild(n):s.insertBefore(n,s.childNodes[0])):a&&!i.separator&&s.classList.add("e-blank-icon"),o={item:i,element:s},this.trigger("beforeItemRender",o),p.appendChild(s)}if(e&&this.getPopUpElement().appendChild(p),a){var h,d=[].slice.call(this.getPopUpElement().getElementsByClassName("e-blank-icon")),y=this.getPopUpElement().querySelector(".e-item:not(.e-blank-icon)"),v=y.querySelector(".e-menu-icon");h=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var g=parseInt(getComputedStyle(v).fontSize,10)+parseInt((this.enableRtl,getComputedStyle(v)[h.margin]),10)+parseInt(getComputedStyle(y).paddingLeft,10)+"px";d.forEach(function(e){e.style[h.padding]=g})}},o.prototype.hasIcon=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n][t])return!0;return!1},o.prototype.createAnchor=function(e){var n=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:n,attrs:{href:e.url}})},o.prototype.initialize=function(){this.button=new n.Button({iconCss:this.iconCss,iconPosition:this.iconPosition,cssClass:this.cssClass,content:this.content,disabled:this.disabled,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence}),this.button.createElement=this.createElement,this.button.appendTo(this.element),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.appendArrowSpan(),this.createPopup(),this.setActiveElem([this.element])},o.prototype.appendArrowSpan=function(){this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(v)>-1?"bottom":"right")+" e-caret"}))},o.prototype.setActiveElem=function(e){this.activeElem=e},o.prototype.getModuleName=function(){return"dropdown-btn"},o.prototype.canOpen=function(){return this.getPopUpElement().classList.contains("e-popup-close")},o.prototype.destroy=function(){var n=this;if(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()){var i;this.element.querySelector("span.e-caret")&&t.detach(this.element.querySelector("span.e-caret")),this.cssClass&&(i=this.cssClass.split(" ")),this.button.destroy(),i&&t.removeClass([this.element],i),t.removeClass(this.activeElem,["e-active"]),(this.element.getAttribute("class")?["aria-haspopup","aria-expanded","aria-owns","type"]:["aria-haspopup","aria-expanded","aria-owns","type","class"]).forEach(function(e){n.element.removeAttribute(e)}),this.dropDown.destroy();var s=document.getElementById(this.getPopUpElement().id);s&&(t.removeClass([s],["e-popup-open","e-popup-close"]),t.detach(s)),this.disabled||this.unWireEvents()}},o.prototype.getPopUpElement=function(){return this.dropDown.element},o.prototype.getULElement=function(){return this.getPopUpElement().children[0]},o.prototype.wireEvents=function(){var e=this.getPopUpElement();this.delegateMousedownHandler=this.mousedownHandler.bind(this),t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this),t.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.rippleFn=t.rippleEffect(e,{selector:"."+u})},o.prototype.keyBoardHandler=function(e){if(e.target!==this.element||9!==e.keyCode&&(e.altKey||40!==e.keyCode)&&38!==e.keyCode)switch(e.keyCode){case 38:case 40:!e.altKey||38!==e.keyCode&&40!==e.keyCode?this.upDownKeyHandler(e):this.keyEventHandler(e);break;case 9:case 13:case 27:case 32:this.keyEventHandler(e)}},o.prototype.upDownKeyHandler=function(e){if(!this.target||38!==e.keyCode&&40!==e.keyCode){e.preventDefault();var n=this.getULElement(),i=40===e.keyCode?0:n.childElementCount-1,s=i,o=null;this.removeCustomSelection();for(var r=0,a=n.children.length;r<a;r++)n.children[r].classList.contains(d)&&(s=r,(o=n.children[r]).classList.remove(d),40===e.keyCode?s++:s--,s===(40===e.keyCode?n.childElementCount:-1)&&(s=i));o=n.children[s],-1!==(s=this.isValidLI(o,s,e.keyCode))&&(t.addClass([n.children[s]],d),n.children[s].focus())}},o.prototype.removeCustomSelection=function(){var e=this.getULElement().querySelector(".e-selected");e&&e.classList.remove("e-selected")},o.prototype.isValidLI=function(e,t,n,i){if(void 0===i&&(i=0),(e.classList.contains(f)||e.classList.contains(h))&&(t===(40===n?this.items.length-1:0)?t=40===n?0:this.items.length-1:40===n?t++:t--),(e=this.getULElement().children[t]).classList.contains(f)||e.classList.contains(h)){if(++i===this.items.length)return t=-1;t=this.isValidLI(e,t,n,i)}return t},o.prototype.keyEventHandler=function(e){(!this.target||13!==e.keyCode&&9!==e.keyCode)&&(9!==e.keyCode&&e.preventDefault(),27===e.keyCode||38===e.keyCode||9===e.keyCode?this.canOpen()||this.closePopup(e,this.element):this.clickHandler(e))},o.prototype.getLI=function(e){return"LI"===e.tagName?e:t.closest(e,"li")},o.prototype.mousedownHandler=function(e){var n=e.target;this.canOpen()||t.closest(n,"#"+this.getPopUpElement().id)||t.closest(n,"#"+this.element.id)||this.closePopup(e)},o.prototype.clickHandler=function(e){var n=e.target,i=this.canOpen();if(t.closest(n,"#"+this.element.id))i?this.openPopUp(e):this.closePopup(e,this.activeElem[0]);else if(t.closest(n,"#"+this.getPopUpElement().id)){var s=void 0,o=void 0,r=void 0,a=this.getLI(n);a&&(o=Array.prototype.indexOf.call(this.getULElement().children,a),(r=this.items[o])&&(s={element:a,item:r},this.trigger("select",s)),this.closePopup(e,this.activeElem[0]))}},o.prototype.openPopUp=function(e){var n=this;void 0===e&&(e=null),this.target||this.createItems(!0);var i={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",i,function(e){if(!e.cancel){var i=n.getULElement();n.dropDown.show(null,n.element),t.addClass([n.element],"e-active"),n.element.setAttribute("aria-expanded","true"),i.focus();var s={element:i,items:n.items};n.trigger("open",s)}})},o.prototype.closePopup=function(e,n){var i=this;void 0===e&&(e=null);var s={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeClose",s,function(e){if(!e.cancel){var s=i.getULElement();i.removeCustomSelection(),i.dropDown.hide(),t.removeClass(i.activeElem,"e-active"),i.element.setAttribute("aria-expanded","false"),n&&n.focus();var o={element:s,items:i.items};i.trigger("close",o),!i.target&&s&&t.detach(s)}})},o.prototype.unWireEvents=function(){t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.rippleFn()},o.prototype.onPropertyChanged=function(e,n){this.button.setProperties(s(e,["content","cssClass","iconCss","iconPosition","disabled","enableRtl"])),this.dropDown.setProperties(s(e,["enableRtl"]));for(var i=this.getPopUpElement(),o=0,r=Object.keys(e);o<r.length;o++){switch(r[o]){case"content":this.element.querySelector("span.e-caret")||this.appendArrowSpan();break;case"disabled":e.disabled?(this.unWireEvents(),this.canOpen()||this.closePopup()):this.wireEvents();break;case"cssClass":if(e.cssClass.indexOf(v)>-1){var a=this.element.querySelector("span.e-caret");t.classList(a,["e-icon-bottom"],["e-icon-right"])}n.cssClass&&t.removeClass([i],n.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.canOpen()||this.createItems()}}},o.prototype.focusIn=function(){this.element.focus()},l([t.Property("")],o.prototype,"content",void 0),l([t.Property("")],o.prototype,"cssClass",void 0),l([t.Property(!1)],o.prototype,"disabled",void 0),l([t.Property("")],o.prototype,"iconCss",void 0),l([t.Property("Left")],o.prototype,"iconPosition",void 0),l([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),l([t.Collection([],a)],o.prototype,"items",void 0),l([t.Property("")],o.prototype,"target",void 0),l([t.Event()],o.prototype,"beforeItemRender",void 0),l([t.Event()],o.prototype,"beforeOpen",void 0),l([t.Event()],o.prototype,"beforeClose",void 0),l([t.Event()],o.prototype,"close",void 0),l([t.Event()],o.prototype,"open",void 0),l([t.Event()],o.prototype,"select",void 0),l([t.Event()],o.prototype,"created",void 0),o=l([t.NotifyPropertyChanges],o)}(t.Component),b=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),C=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},P="EJS-SPLITBUTTON",w=function(e){function i(t,n){return e.call(this,t,n)||this}return b(i,e),i.prototype.preRender=function(){if(!t.isBlazor()||!this.isServerRendered){var e=this.element;if(e.tagName===P){for(var n=t.getValue("ej2_instances",e),i=this.createElement("button",{attrs:{type:"button"}}),s=this.createElement(P,{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,r=e.attributes.length;o<r;o++)i.setAttribute(e.attributes[o].nodeName,e.attributes[o].nodeValue);e.parentNode.insertBefore(s,e),t.detach(e),e=i,s.appendChild(e),t.setValue("ej2_instances",n,e),this.wrapper=s,this.element=e}this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))}},i.prototype.render=function(){t.isBlazor()&&this.isServerRendered?(n.buttonObserver.on("component-rendered",this.buttonInstance,this,this.element.id),c.on("component-rendered",this.dropDownButtonInstance,this,this.element.id)):(this.initWrapper(),this.createPrimaryButton(),this.renderControl())},i.prototype.buttonInstance=function(e){this.element.id===e.instance.element.id&&(this.primaryBtnObj=e.instance,n.buttonObserver.off("component-rendered",this.buttonInstance,this.element.id))},i.prototype.dropDownButtonInstance=function(e){e.instance.element.id.indexOf(this.element.id)>-1&&(this.secondaryBtnObj=e.instance,this.renderControl(),c.off("component-rendered",this.dropDownButtonInstance,this.element.id))},i.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},i.prototype.addItems=function(t,n){e.prototype.addItems.call(this,t,n),this.secondaryBtnObj.items=this.items},i.prototype.removeItems=function(t){e.prototype.removeItems.call(this,t),this.secondaryBtnObj.items=this.items},i.prototype.initWrapper=function(){this.wrapper||(this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.element.parentNode.insertBefore(this.wrapper,this.element)),this.element.classList.remove("e-"+this.getModuleName()),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.cssClass&&t.addClass([this.wrapper],this.cssClass.split(" "))},i.prototype.createPrimaryButton=function(){var e={cssClass:this.cssClass,enableRtl:this.enableRtl,iconCss:this.iconCss,iconPosition:this.iconPosition,content:this.content,disabled:this.disabled};this.primaryBtnObj=new n.Button(e),this.primaryBtnObj.createElement=this.createElement,this.primaryBtnObj.appendTo(this.element),this.element.classList.add("e-"+this.getModuleName()),this.element.type="button",this.wrapper.appendChild(this.element)},i.prototype.createSecondaryButton=function(){var e,n,i=this;t.isBlazor()&&this.isServerRendered?(this.wrapper=this.element.parentElement,e=this.secondaryBtnObj):(n=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"}),this.wrapper.appendChild(n),e={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target}),e.beforeItemRender=function(e){i.trigger("beforeItemRender",e)},e.open=function(e){i.trigger("open",e)},e.close=function(e){i.trigger("close",e)},e.select=function(e){i.trigger("select",e)},e.beforeOpen=function(e){var t=new E;return i.trigger("beforeOpen",e,function(e){t.resolve(e)}),t},e.beforeClose=function(e){var t=new E;return i.trigger("beforeClose",e,function(e){t.resolve(e)}),t},t.isBlazor()&&this.isServerRendered||(this.secondaryBtnObj=new g(e),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(n)),this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],t.EventHandler.remove(this.getPopUpElement(),"keydown",this.secondaryBtnObj.keyBoardHandler),this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right")},i.prototype.setAria=function(){t.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent+" splitbutton","aria-owns":this.secondaryBtnObj.dropDown.element.id})},i.prototype.getModuleName=function(){return"split-btn"},i.prototype.toggle=function(){this.secondaryBtnObj.toggle()},i.prototype.destroy=function(){var n=this;if(t.isBlazor()&&this.isServerRendered)t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler);else{var i=["e-rtl"],s=document.getElementById(this.element.id);this.cssClass&&(i=i.concat(this.cssClass.split(" "))),s&&s.parentElement===this.wrapper&&(this.wrapper.tagName===P?(this.wrapper.innerHTML="",t.removeClass([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),t.removeClass([this.wrapper],this.cssClass.split(" "))):(t.removeClass([this.element],i),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){n.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),t.remove(this.wrapper)),this.unWireEvents()),this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element.getAttribute("class")||this.element.removeAttribute("class")}},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),t.EventHandler.add(this.getPopUpElement(),"keydown",this.keyBoardHandler,this),new t.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow"}})},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),t.getInstance(this.element,t.KeyboardEvents).destroy()},i.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},i.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e)}},i.prototype.onPropertyChanged=function(e,n){var i=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(s(e,i)),i=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl"],Object.keys(e).indexOf("items")>-1&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(s(e,i));for(var o=0,r=Object.keys(e);o<r.length;o++){switch(r[o]){case"cssClass":n.cssClass&&t.removeClass([this.wrapper],n.cssClass.split(" ")),t.addClass([this.wrapper],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?t.addClass([this.wrapper],"e-rtl"):t.removeClass([this.wrapper],"e-rtl")}}},i.prototype.focusIn=function(){this.element.focus()},C([t.Property("")],i.prototype,"content",void 0),C([t.Property("")],i.prototype,"cssClass",void 0),C([t.Property(!1)],i.prototype,"disabled",void 0),C([t.Property("")],i.prototype,"iconCss",void 0),C([t.Property("Left")],i.prototype,"iconPosition",void 0),C([t.Collection([],a)],i.prototype,"items",void 0),C([t.Property("")],i.prototype,"target",void 0),C([t.Event()],i.prototype,"beforeItemRender",void 0),C([t.Event()],i.prototype,"beforeOpen",void 0),C([t.Event()],i.prototype,"beforeClose",void 0),C([t.Event()],i.prototype,"click",void 0),C([t.Event()],i.prototype,"close",void 0),C([t.Event()],i.prototype,"open",void 0),C([t.Event()],i.prototype,"select",void 0),C([t.Event()],i.prototype,"created",void 0),i=C([t.NotifyPropertyChanges],i)}(g),E=function(){return function(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)}}(),S=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),O=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},B="e-hide-spinner",k="e-progress-active",H="e-btn-content",L=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return S(n,e),O([t.Property(null)],n.prototype,"template",void 0),O([t.Property(16)],n.prototype,"width",void 0),O([t.Property("Left")],n.prototype,"position",void 0),n}(t.ChildProperty),j=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return S(n,e),O([t.Property(400)],n.prototype,"duration",void 0),O([t.Property("None")],n.prototype,"effect",void 0),O([t.Property("ease")],n.prototype,"easing",void 0),n}(t.ChildProperty),N=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.step=1,i}return S(n,e),n.prototype.preRender=function(){e.prototype.preRender.call(this)},n.prototype.render=function(){t.isBlazor()&&(this.isServerRendered=!1),e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},n.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},n.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},n.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},n.prototype.getModuleName=function(){return"progress-btn"},n.prototype.destroy=function(){var n=this,i=[B,k,"e-round-corner","e-"+e.prototype.getModuleName.call(this),"e-spin-"+this.spinSettings.position.toLowerCase()];e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(i=i.concat(this.cssClass.split(" "))),t.removeClass([this.element],i),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){n.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},n.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},n.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),i.createSpinner({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},n.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},n.prototype.getProgress=function(){return this.element.getElementsByClassName("e-progress")[0]},n.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(H)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},n.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:"e-progress"}))},n.prototype.setContent=function(){var e;t.isBlazor()?(e=this.content,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.content)),this.setContentIcon(e)):(e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:H,innerHTML:e})))},n.prototype.setContentIcon=function(e){var t=this.createElement("span",{className:H,innerHTML:e});if(this.iconCss){var n=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(n.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("e-icon-btn");var i=t.childNodes[0];!i||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?t.appendChild(n):t.insertBefore(n,i)}this.element.appendChild(t)},n.prototype.clickHandler=function(){this.element.classList.contains(k)||this.startProgress()},n.prototype.startProgress=function(e,t){var n=this.element.classList,s=n.contains("e-vertical");n.add(k),n.contains(B)||i.showSpinner(this.element),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,s),this.startContAnimate()},n.prototype.startAnimate=function(e,t,n,i,s,o,r,a){var p=this;try{var l=void 0,c=e-n,h=this.duration*o/100,d=c?c<h?c-h:c%h:0;this.progressTime=t=t+c-d,n=e-d,i+=(c-d)/this.duration*100,l={percent:s=(t-r)%h==0||100===i?i:s,currentDuration:t,step:o},this.eIsVertical=a,0===i?this.trigger("begin",l,function(e){p.successCallback(e,i,s,t,r,d,n)}):100===i||t===this.duration?this.trigger("end",l,function(e){p.successCallback(e,i,s,t,r,d,n)}):this.trigger("progress",l,function(e){p.successCallback(e,i,s,t,r,d,n)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},n.prototype.successCallback=function(e,t,n,i,s,o,r){var a=this,p=t,l=n,c=o,h=i,d=s,m=r,u=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(h-d)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&(a.getProgress().style[u?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())}),l=p,d=h),this.isPaused||(h<this.duration&&p<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),h,m,p,l,e.step,d,u)},this.duration/100-c):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&(a.getProgress().style[u?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},n.prototype.startContAnimate=function(){var e=this,n=this.element.getElementsByClassName(H)[0];"None"!==this.animationSettings.effect?new t.Animation({}).animate(n,{duration:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){n.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},n.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add(k);for(var n,i=this.percent;i<100;i++)(i+=10)>100&&(i=100),this.enableProgress&&(this.getProgress().style[t?"height":"width"]=this.percent<100?i+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin(),n={step:this.step,currentDuration:this.progressTime,percent:100},clearTimeout(this.interval),this.trigger("end",n),this.progressTime=this.percent=0},n.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(H)[0],t=this.getSpinner();t.style.width=Math.max(t.offsetWidth,e.offsetWidth)+"px",t.style.height=Math.max(t.offsetHeight,e.offsetHeight)+"px",e.classList.add("e-cont-animate")},n.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(H)[0];if(this.element.classList.contains(B)||i.hideSpinner(this.element),this.element.classList.remove(k),"None"!==this.animationSettings.effect&&e.classList.remove("e-animate-end"),"Center"===this.spinSettings.position){var t=this.getSpinner();e.classList.remove("e-cont-animate"),t.style.width="auto",t.style.height="auto"}},n.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(H)[0],t=this.element.getElementsByClassName("e-btn-icon")[0];!e.childNodes[0]||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?e.appendChild(t):e.insertBefore(t,e.childNodes[0])},n.prototype.setAria=function(){t.attributes(this.element,{"aria-label":this.element.textContent+" progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":"0"})},n.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler)},n.prototype.onPropertyChanged=function(n,i){var s=this.element;e.prototype.onPropertyChanged.call(this,n,i);for(var o=0,r=Object.keys(n);o<r.length;o++){switch(r[o]){case"content":if(t.isBlazor()){var a=this.element.querySelector(".e-btn-content");this.iconCss?"Left"===this.iconPosition||"Top"===this.iconPosition?a.childNodes[1].textContent=this.content:a.childNodes[0].textContent=this.content:a.textContent=this.content}else this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress();s.setAttribute("aria-label",s.textContent+" progress");break;case"iconCss":i.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":n.enableProgress?this.createProgress():t.remove(this.getProgress());break;case"spinSettings":n.spinSettings.position&&(s.classList.remove("e-spin-"+i.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(n.spinSettings.template||n.spinSettings.width)&&(s.removeChild(this.getSpinner()),this.createSpinner())}}},n.prototype.focusIn=function(){this.element.focus()},O([t.Property(!1)],n.prototype,"enableProgress",void 0),O([t.Property(2e3)],n.prototype,"duration",void 0),O([t.Property("Left")],n.prototype,"iconPosition",void 0),O([t.Property("")],n.prototype,"iconCss",void 0),O([t.Property(!1)],n.prototype,"disabled",void 0),O([t.Property(!1)],n.prototype,"isPrimary",void 0),O([t.Property("")],n.prototype,"cssClass",void 0),O([t.Property("")],n.prototype,"content",void 0),O([t.Property(!1)],n.prototype,"isToggle",void 0),O([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),O([t.Complex({},L)],n.prototype,"spinSettings",void 0),O([t.Complex({},j)],n.prototype,"animationSettings",void 0),O([t.Event()],n.prototype,"created",void 0),O([t.Event()],n.prototype,"begin",void 0),O([t.Event()],n.prototype,"progress",void 0),O([t.Event()],n.prototype,"end",void 0),O([t.Event()],n.prototype,"fail",void 0),n=O([t.NotifyPropertyChanges],n)}(n.Button);e.getModel=s,e.Item=a,e.dropDownButtonObserver=c,e.DropDownButton=g,e.SplitButton=w,e.Deferred=E,e.createButtonGroup=function(e,i,s){void 0===i&&(i={});var o,r,a,p;t.isNullOrUndefined(s)&&(s=t.createElement);var l=document.querySelector(e);t.addClass([l],["e-btn-group","e-css"]),l.setAttribute("role","group");var c=l.children;i.buttons=i.buttons||[];for(var h=0,d=0;d<c.length;h++,d++)o=c[d],null!==(p=i.buttons[h])&&("BUTTON"===o.tagName?r=o:(r=s("label"),(a=c[d+1])?l.insertBefore(r,a):l.appendChild(r),o.id&&r.setAttribute("for",o.id),p&&p.disabled&&(o.disabled=!0),d++),i.cssClass&&p&&!p.cssClass&&(p.cssClass=i.cssClass),new n.Button(p||{},r));return l},e.SpinSettings=L,e.AnimationSettings=j,e.ProgressButton=N,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-buttons","@syncfusion/ej2-popups"],t):t(e.ej={},e.ej2Base,e.ej2Buttons,e.ej2Popups)}(this,function(e,t,n,i){"use strict";function s(e,n){for(var i=t.extend({},e),s=0,o=Object.keys(i);s<o.length;s++){var r=o[s];n.indexOf(r)<0&&t.deleteObject(i,r)}return i}function o(e,n){var i=40===n?0:e.childElementCount-1,s=i,o=e.querySelector(".e-selected");o&&o.classList.remove("e-selected");for(var a=0,p=e.children.length;a<p;a++)e.children[a].classList.contains("e-focused")&&(s=a,e.children[a].classList.remove("e-focused"),40===n?s++:s--,s===(40===n?e.childElementCount:-1)&&(s=i));-1!==(s=r(e,e.children[s],s,n))&&(t.addClass([e.children[s]],"e-focused"),e.children[s].focus())}function r(e,t,n,i,s){if(void 0===s&&(s=0),(t.classList.contains("e-separator")||t.classList.contains("e-disabled"))&&(n===(40===i?e.childElementCount-1:0)?n=40===i?0:e.childElementCount-1:40===i?n++:n--),(t=e.children[n]).classList.contains("e-separator")||t.classList.contains("e-disabled")){if(++s===e.childElementCount)return n=-1;n=r(e,t,n,i,s)}return n}var a=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},l=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),p([t.Property("")],n.prototype,"iconCss",void 0),p([t.Property("")],n.prototype,"id",void 0),p([t.Property(!1)],n.prototype,"separator",void 0),p([t.Property("")],n.prototype,"text",void 0),p([t.Property("")],n.prototype,"url",void 0),n}(t.ChildProperty),c=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),h=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},d="e-menu-icon",u="e-item",m="e-dropdown-popup",y="e-separator",f="e-vertical",v=function(e){function r(t,n){return e.call(this,t,n)||this}return c(r,e),r.prototype.preRender=function(){},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.closePopup()},r.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},r.prototype.addItems=function(e,t){for(var n,i=this.items.length,s=0,o=this.items.length;s<o;s++)if(t===this.items[s].text){i=s;break}for(var r=e.length-1;r>=0;r--)n=new l(this,"items",e[r],!0),this.items.splice(i,0,n);this.canOpen()||this.createItems()},r.prototype.removeItems=function(e){for(var t=0,n=e.length;t<n;t++)for(var i=0,s=this.items.length;i<s;i++)if(e[t]===this.items[i].text){this.items.splice(i,1);break}this.canOpen()||this.createItems()},r.prototype.createPopup=function(){var e,n=this.createElement("div",{className:m,id:this.element.id+"-popup"});document.body.appendChild(n),this.dropDown=new i.Popup(n,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),t.attributes(this.element,(e={},e["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e["aria-owns"]=this.getPopUpElement().id,e.type="button",e["aria-label"]=this.element.textContent+" dropdownbutton",e)),this.cssClass&&t.addClass([n],this.cssClass.split(" "))},r.prototype.getTargetElement=function(){return"string"==typeof this.target?t.select(this.target):this.target},r.prototype.createItems=function(e){var n,i,s,o,r=this.items,a=this.hasIcon(this.items,"iconCss"),p=this.getULElement();p?p.innerHTML="":p=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var l=0;l<r.length;l++){i=r[l];var c=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.text):i.text;s=this.createElement("li",{innerHTML:i.url?"":c,className:i.separator?u+" "+y:u,attrs:{role:"menuItem",tabindex:"-1"},id:i.id?i.id:t.getUniqueID("e-"+this.getModuleName()+"-item")}),i.url&&(s.appendChild(this.createAnchor(i)),s.classList.add("e-url")),i.iconCss?(n=this.createElement("span",{className:d+" "+i.iconCss}),i.url?s.childNodes[0].appendChild(n):s.insertBefore(n,s.childNodes[0])):a&&!i.separator&&s.classList.add("e-blank-icon"),o={item:i,element:s},this.trigger("beforeItemRender",o),p.appendChild(s)}if(e&&this.getPopUpElement().appendChild(p),a){var h,m=[].slice.call(this.getPopUpElement().getElementsByClassName("e-blank-icon")),f=this.getPopUpElement().querySelector(".e-item:not(.e-blank-icon)"),v=f.querySelector(".e-menu-icon");h=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var g=parseInt(getComputedStyle(v).fontSize,10)+parseInt((this.enableRtl,getComputedStyle(v)[h.margin]),10)+parseInt(getComputedStyle(f).paddingLeft,10)+"px";m.forEach(function(e){e.style[h.padding]=g})}},r.prototype.hasIcon=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n][t])return!0;return!1},r.prototype.createAnchor=function(e){var n=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:n,attrs:{href:e.url}})},r.prototype.initialize=function(){this.button=new n.Button({iconCss:this.iconCss,iconPosition:this.iconPosition,cssClass:this.cssClass,content:this.content,disabled:this.disabled,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence}),this.button.createElement=this.createElement,this.button.appendTo(this.element),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.appendArrowSpan(),this.createPopup(),this.setActiveElem([this.element])},r.prototype.appendArrowSpan=function(){this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(f)>-1?"bottom":"right")+" e-caret"}))},r.prototype.setActiveElem=function(e){this.activeElem=e},r.prototype.getModuleName=function(){return"dropdown-btn"},r.prototype.canOpen=function(){return this.getPopUpElement().classList.contains("e-popup-close")},r.prototype.destroy=function(){var n=this;if(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()){var i;this.element.querySelector("span.e-caret")&&t.detach(this.element.querySelector("span.e-caret")),this.cssClass&&(i=this.cssClass.split(" ")),this.button.destroy(),i&&t.removeClass([this.element],i),t.removeClass(this.activeElem,["e-active"]),(this.element.getAttribute("class")?["aria-haspopup","aria-expanded","aria-owns","type"]:["aria-haspopup","aria-expanded","aria-owns","type","class"]).forEach(function(e){n.element.removeAttribute(e)}),this.dropDown.destroy();var s=document.getElementById(this.getPopUpElement().id);s&&(t.removeClass([s],["e-popup-open","e-popup-close"]),t.detach(s)),this.disabled||this.unWireEvents()}},r.prototype.getPopUpElement=function(){return this.dropDown.element},r.prototype.getULElement=function(){return this.getPopUpElement().children[0]},r.prototype.wireEvents=function(){var e=this.getPopUpElement();this.delegateMousedownHandler=this.mousedownHandler.bind(this),t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this),t.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.rippleFn=t.rippleEffect(e,{selector:"."+u})},r.prototype.keyBoardHandler=function(e){if(e.target!==this.element||9!==e.keyCode&&(e.altKey||40!==e.keyCode)&&38!==e.keyCode)switch(e.keyCode){case 38:case 40:!e.altKey||38!==e.keyCode&&40!==e.keyCode?this.upDownKeyHandler(e):this.keyEventHandler(e);break;case 9:case 13:case 27:case 32:this.keyEventHandler(e)}},r.prototype.upDownKeyHandler=function(e){(!this.target||38!==e.keyCode&&40!==e.keyCode)&&(e.preventDefault(),o(this.getULElement(),e.keyCode))},r.prototype.keyEventHandler=function(e){(!this.target||13!==e.keyCode&&9!==e.keyCode)&&(9!==e.keyCode&&e.preventDefault(),27===e.keyCode||38===e.keyCode||9===e.keyCode?this.canOpen()||this.closePopup(e,this.element):this.clickHandler(e))},r.prototype.getLI=function(e){return"LI"===e.tagName?e:t.closest(e,"li")},r.prototype.mousedownHandler=function(e){var n=e.target;this.canOpen()||t.closest(n,"#"+this.getPopUpElement().id)||t.closest(n,"#"+this.element.id)||this.closePopup(e)},r.prototype.clickHandler=function(e){var n=e.target,i=this.canOpen();if(t.closest(n,"#"+this.element.id))i?this.openPopUp(e):this.closePopup(e,this.activeElem[0]);else if(t.closest(n,"#"+this.getPopUpElement().id)){var s=void 0,o=void 0,r=void 0,a=this.getLI(n);a&&(o=Array.prototype.indexOf.call(this.getULElement().children,a),(r=this.items[o])&&(s={element:a,item:r},this.trigger("select",s)),this.closePopup(e,this.activeElem[0]))}},r.prototype.openPopUp=function(e){var n=this;void 0===e&&(e=null),this.target||this.createItems(!0);var i={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",i,function(e){if(!e.cancel){var i=n.getULElement();n.dropDown.show(null,n.element),t.addClass([n.element],"e-active"),n.element.setAttribute("aria-expanded","true"),i.focus();var s={element:i,items:n.items};n.trigger("open",s)}})},r.prototype.closePopup=function(e,n){var i=this;void 0===e&&(e=null);var s={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeClose",s,function(e){if(!e.cancel){var s=i.getULElement(),o=s.querySelector(".e-selected");o&&o.classList.remove("e-selected"),i.dropDown.hide(),t.removeClass(i.activeElem,"e-active"),i.element.setAttribute("aria-expanded","false"),n&&n.focus();var r={element:s,items:i.items};i.trigger("close",r),!i.target&&s&&t.detach(s)}})},r.prototype.unWireEvents=function(){t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.rippleFn()},r.prototype.onPropertyChanged=function(e,n){this.button.setProperties(s(e,["content","cssClass","iconCss","iconPosition","disabled","enableRtl"])),this.dropDown.setProperties(s(e,["enableRtl"]));for(var i=this.getPopUpElement(),o=0,r=Object.keys(e);o<r.length;o++){switch(r[o]){case"content":this.element.querySelector("span.e-caret")||this.appendArrowSpan();break;case"disabled":e.disabled?(this.unWireEvents(),this.canOpen()||this.closePopup()):this.wireEvents();break;case"cssClass":if(e.cssClass.indexOf(f)>-1){var a=this.element.querySelector("span.e-caret");t.classList(a,["e-icon-bottom"],["e-icon-right"])}n.cssClass&&t.removeClass([i],n.cssClass.split(" ")),e.cssClass&&t.addClass([i],e.cssClass.split(" "));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.canOpen()||this.createItems()}}},r.prototype.focusIn=function(){this.element.focus()},h([t.Property("")],r.prototype,"content",void 0),h([t.Property("")],r.prototype,"cssClass",void 0),h([t.Property(!1)],r.prototype,"disabled",void 0),h([t.Property("")],r.prototype,"iconCss",void 0),h([t.Property("Left")],r.prototype,"iconPosition",void 0),h([t.Property(!1)],r.prototype,"enableHtmlSanitizer",void 0),h([t.Collection([],l)],r.prototype,"items",void 0),h([t.Property("")],r.prototype,"target",void 0),h([t.Event()],r.prototype,"beforeItemRender",void 0),h([t.Event()],r.prototype,"beforeOpen",void 0),h([t.Event()],r.prototype,"beforeClose",void 0),h([t.Event()],r.prototype,"close",void 0),h([t.Event()],r.prototype,"open",void 0),h([t.Event()],r.prototype,"select",void 0),h([t.Event()],r.prototype,"created",void 0),r=h([t.NotifyPropertyChanges],r)}(t.Component),g=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),b=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},C="EJS-SPLITBUTTON",P=function(e){function i(t,n){return e.call(this,t,n)||this}return g(i,e),i.prototype.preRender=function(){var e=this.element;if(e.tagName===C){for(var n=t.getValue("ej2_instances",e),i=this.createElement("button",{attrs:{type:"button"}}),s=this.createElement(C,{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,r=e.attributes.length;o<r;o++)i.setAttribute(e.attributes[o].nodeName,e.attributes[o].nodeValue);e.parentNode.insertBefore(s,e),t.detach(e),e=i,s.appendChild(e),t.setValue("ej2_instances",n,e),this.wrapper=s,this.element=e}this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},i.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},i.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},i.prototype.addItems=function(t,n){e.prototype.addItems.call(this,t,n),this.secondaryBtnObj.items=this.items},i.prototype.removeItems=function(t){e.prototype.removeItems.call(this,t),this.secondaryBtnObj.items=this.items},i.prototype.initWrapper=function(){this.wrapper||(this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.element.parentNode.insertBefore(this.wrapper,this.element)),this.element.classList.remove("e-"+this.getModuleName()),this.enableRtl&&this.wrapper.classList.add("e-rtl"),this.cssClass&&t.addClass([this.wrapper],this.cssClass.split(" "))},i.prototype.createPrimaryButton=function(){var e={cssClass:this.cssClass,enableRtl:this.enableRtl,iconCss:this.iconCss,iconPosition:this.iconPosition,content:this.content,disabled:this.disabled};this.primaryBtnObj=new n.Button(e),this.primaryBtnObj.createElement=this.createElement,this.primaryBtnObj.appendTo(this.element),this.element.classList.add("e-"+this.getModuleName()),this.element.type="button",this.wrapper.appendChild(this.element)},i.prototype.createSecondaryButton=function(){var e,n,i=this;n=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"}),this.wrapper.appendChild(n),(e={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target}).beforeItemRender=function(e){i.trigger("beforeItemRender",e)},e.open=function(e){i.trigger("open",e)},e.close=function(e){i.trigger("close",e)},e.select=function(e){i.trigger("select",e)},e.beforeOpen=function(e){var t=new w;return i.trigger("beforeOpen",e,function(e){t.resolve(e)}),t},e.beforeClose=function(e){var t=new w;return i.trigger("beforeClose",e,function(e){t.resolve(e)}),t},this.secondaryBtnObj=new v(e),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(n),this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],t.EventHandler.remove(this.getPopUpElement(),"keydown",this.secondaryBtnObj.keyBoardHandler),this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right")},i.prototype.setAria=function(){t.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent+" splitbutton","aria-owns":this.secondaryBtnObj.dropDown.element.id})},i.prototype.getModuleName=function(){return"split-btn"},i.prototype.toggle=function(){this.secondaryBtnObj.toggle()},i.prototype.destroy=function(){var n=this,i=["e-rtl"],s=document.getElementById(this.element.id);this.cssClass&&(i=i.concat(this.cssClass.split(" "))),s&&s.parentElement===this.wrapper&&(this.wrapper.tagName===C?(this.wrapper.innerHTML="",t.removeClass([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),t.removeClass([this.wrapper],this.cssClass.split(" "))):(t.removeClass([this.element],i),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){n.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),t.remove(this.wrapper)),this.unWireEvents()),this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element.getAttribute("class")||this.element.removeAttribute("class")},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),t.EventHandler.add(this.getPopUpElement(),"keydown",this.keyBoardHandler,this),new t.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow"}})},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),t.getInstance(this.element,t.KeyboardEvents).destroy()},i.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},i.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e)}},i.prototype.onPropertyChanged=function(e,n){var i=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(s(e,i)),i=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl"],Object.keys(e).indexOf("items")>-1&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(s(e,i));for(var o=0,r=Object.keys(e);o<r.length;o++){switch(r[o]){case"cssClass":n.cssClass&&t.removeClass([this.wrapper],n.cssClass.split(" ")),t.addClass([this.wrapper],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?t.addClass([this.wrapper],"e-rtl"):t.removeClass([this.wrapper],"e-rtl")}}},i.prototype.focusIn=function(){this.element.focus()},b([t.Property("")],i.prototype,"content",void 0),b([t.Property("")],i.prototype,"cssClass",void 0),b([t.Property(!1)],i.prototype,"disabled",void 0),b([t.Property("")],i.prototype,"iconCss",void 0),b([t.Property("Left")],i.prototype,"iconPosition",void 0),b([t.Collection([],l)],i.prototype,"items",void 0),b([t.Property("")],i.prototype,"target",void 0),b([t.Event()],i.prototype,"beforeItemRender",void 0),b([t.Event()],i.prototype,"beforeOpen",void 0),b([t.Event()],i.prototype,"beforeClose",void 0),b([t.Event()],i.prototype,"click",void 0),b([t.Event()],i.prototype,"close",void 0),b([t.Event()],i.prototype,"open",void 0),b([t.Event()],i.prototype,"select",void 0),b([t.Event()],i.prototype,"created",void 0),i=b([t.NotifyPropertyChanges],i)}(v),w=function(){return function(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)}}(),E=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),S=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},O="e-hide-spinner",k="e-progress-active",B="e-btn-content",H=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return E(n,e),S([t.Property(null)],n.prototype,"template",void 0),S([t.Property(16)],n.prototype,"width",void 0),S([t.Property("Left")],n.prototype,"position",void 0),n}(t.ChildProperty),L=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return E(n,e),S([t.Property(400)],n.prototype,"duration",void 0),S([t.Property("None")],n.prototype,"effect",void 0),S([t.Property("ease")],n.prototype,"easing",void 0),n}(t.ChildProperty),j=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.step=1,i}return E(n,e),n.prototype.preRender=function(){e.prototype.preRender.call(this)},n.prototype.render=function(){t.isBlazor()&&(this.isServerRendered=!1),e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},n.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},n.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},n.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},n.prototype.getModuleName=function(){return"progress-btn"},n.prototype.destroy=function(){var n=this,i=[O,k,"e-round-corner","e-"+e.prototype.getModuleName.call(this),"e-spin-"+this.spinSettings.position.toLowerCase()];e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(i=i.concat(this.cssClass.split(" "))),t.removeClass([this.element],i),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){n.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},n.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},n.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),i.createSpinner({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},n.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},n.prototype.getProgress=function(){return this.element.getElementsByClassName("e-progress")[0]},n.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(B)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},n.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:"e-progress"}))},n.prototype.setContent=function(){var e;t.isBlazor()?(e=this.content,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.content)),this.setContentIcon(e)):(e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:B,innerHTML:e})))},n.prototype.setContentIcon=function(e){var t=this.createElement("span",{className:B,innerHTML:e});if(this.iconCss){var n=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(n.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("e-icon-btn");var i=t.childNodes[0];!i||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?t.appendChild(n):t.insertBefore(n,i)}this.element.appendChild(t)},n.prototype.clickHandler=function(){this.element.classList.contains(k)||this.startProgress()},n.prototype.startProgress=function(e,t){var n=this.element.classList,s=n.contains("e-vertical");n.add(k),n.contains(O)||i.showSpinner(this.element),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,s),this.startContAnimate()},n.prototype.startAnimate=function(e,t,n,i,s,o,r,a){var p=this;try{var l=void 0,c=e-n,h=this.duration*o/100,d=c?c<h?c-h:c%h:0;this.progressTime=t=t+c-d,n=e-d,i+=(c-d)/this.duration*100,l={percent:s=(t-r)%h==0||100===i?i:s,currentDuration:t,step:o},this.eIsVertical=a,0===i?this.trigger("begin",l,function(e){p.successCallback(e,i,s,t,r,d,n)}):100===i||t===this.duration?this.trigger("end",l,function(e){p.successCallback(e,i,s,t,r,d,n)}):this.trigger("progress",l,function(e){p.successCallback(e,i,s,t,r,d,n)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},n.prototype.successCallback=function(e,t,n,i,s,o,r){var a=this,p=t,l=n,c=o,h=i,d=s,u=r,m=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(h-d)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&(a.getProgress().style[m?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())}),l=p,d=h),this.isPaused||(h<this.duration&&p<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),h,u,p,l,e.step,d,m)},this.duration/100-c):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&(a.getProgress().style[m?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},n.prototype.startContAnimate=function(){var e=this,n=this.element.getElementsByClassName(B)[0];"None"!==this.animationSettings.effect?new t.Animation({}).animate(n,{duration:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){n.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},n.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add(k);for(var n,i=this.percent;i<100;i++)(i+=10)>100&&(i=100),this.enableProgress&&(this.getProgress().style[t?"height":"width"]=this.percent<100?i+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin(),n={step:this.step,currentDuration:this.progressTime,percent:100},clearTimeout(this.interval),this.trigger("end",n),this.progressTime=this.percent=0},n.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(B)[0],t=this.getSpinner();t.style.width=Math.max(t.offsetWidth,e.offsetWidth)+"px",t.style.height=Math.max(t.offsetHeight,e.offsetHeight)+"px",e.classList.add("e-cont-animate")},n.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(B)[0];if(this.element.classList.contains(O)||i.hideSpinner(this.element),this.element.classList.remove(k),"None"!==this.animationSettings.effect&&e.classList.remove("e-animate-end"),"Center"===this.spinSettings.position){var t=this.getSpinner();e.classList.remove("e-cont-animate"),t.style.width="auto",t.style.height="auto"}},n.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(B)[0],t=this.element.getElementsByClassName("e-btn-icon")[0];!e.childNodes[0]||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?e.appendChild(t):e.insertBefore(t,e.childNodes[0])},n.prototype.setAria=function(){t.attributes(this.element,{"aria-label":this.element.textContent+" progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":"0"})},n.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler)},n.prototype.onPropertyChanged=function(n,i){var s=this.element;e.prototype.onPropertyChanged.call(this,n,i);for(var o=0,r=Object.keys(n);o<r.length;o++){switch(r[o]){case"content":if(t.isBlazor()){var a=this.element.querySelector(".e-btn-content");this.iconCss?"Left"===this.iconPosition||"Top"===this.iconPosition?a.childNodes[1].textContent=this.content:a.childNodes[0].textContent=this.content:a.textContent=this.content}else this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress();s.setAttribute("aria-label",s.textContent+" progress");break;case"iconCss":i.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":n.enableProgress?this.createProgress():t.remove(this.getProgress());break;case"spinSettings":n.spinSettings.position&&(s.classList.remove("e-spin-"+i.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(n.spinSettings.template||n.spinSettings.width)&&(s.removeChild(this.getSpinner()),this.createSpinner())}}},n.prototype.focusIn=function(){this.element.focus()},S([t.Property(!1)],n.prototype,"enableProgress",void 0),S([t.Property(2e3)],n.prototype,"duration",void 0),S([t.Property("Left")],n.prototype,"iconPosition",void 0),S([t.Property("")],n.prototype,"iconCss",void 0),S([t.Property(!1)],n.prototype,"disabled",void 0),S([t.Property(!1)],n.prototype,"isPrimary",void 0),S([t.Property("")],n.prototype,"cssClass",void 0),S([t.Property("")],n.prototype,"content",void 0),S([t.Property(!1)],n.prototype,"isToggle",void 0),S([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),S([t.Complex({},H)],n.prototype,"spinSettings",void 0),S([t.Complex({},L)],n.prototype,"animationSettings",void 0),S([t.Event()],n.prototype,"created",void 0),S([t.Event()],n.prototype,"begin",void 0),S([t.Event()],n.prototype,"progress",void 0),S([t.Event()],n.prototype,"end",void 0),S([t.Event()],n.prototype,"fail",void 0),n=S([t.NotifyPropertyChanges],n)}(n.Button);e.getModel=s,e.upDownKeyHandler=o,e.Item=l,e.DropDownButton=v,e.SplitButton=P,e.Deferred=w,e.createButtonGroup=function(e,i,s){void 0===i&&(i={});var o,r,a,p;t.isNullOrUndefined(s)&&(s=t.createElement);var l=document.querySelector(e);t.addClass([l],["e-btn-group","e-css"]),l.setAttribute("role","group");var c=l.children;i.buttons=i.buttons||[];for(var h=0,d=0;d<c.length;h++,d++)o=c[d],null!==(p=i.buttons[h])&&("BUTTON"===o.tagName?r=o:(r=s("label"),(a=c[d+1])?l.insertBefore(r,a):l.appendChild(r),o.id&&r.setAttribute("for",o.id),p&&p.disabled&&(o.disabled=!0),d++),i.cssClass&&p&&!p.cssClass&&(p.cssClass=i.cssClass),new n.Button(p||{},r));return l},e.SpinSettings=H,e.AnimationSettings=L,e.ProgressButton=j,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ej2-splitbuttons.umd.min.js.map |
@@ -1,3 +0,3 @@ | ||
import { Animation, ChildProperty, Collection, Complex, Component, Event, EventHandler, KeyboardEvents, NotifyPropertyChanges, Observer, Property, SanitizeHtmlHelper, addClass, attributes, classList, closest, createElement, deleteObject, detach, extend, getInstance, getUniqueID, getValue, isBlazor, isNullOrUndefined, remove, removeClass, rippleEffect, select, setValue } from '@syncfusion/ej2-base'; | ||
import { Button, buttonObserver } from '@syncfusion/ej2-buttons'; | ||
import { Animation, ChildProperty, Collection, Complex, Component, Event, EventHandler, KeyboardEvents, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, attributes, classList, closest, createElement, deleteObject, detach, extend, getInstance, getUniqueID, getValue, isBlazor, isNullOrUndefined, remove, removeClass, rippleEffect, select, setValue } from '@syncfusion/ej2-base'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
import { Popup, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups'; | ||
@@ -24,2 +24,48 @@ | ||
} | ||
/** @hidden */ | ||
function upDownKeyHandler(ul, keyCode) { | ||
let defaultIdx = keyCode === 40 ? 0 : ul.childElementCount - 1; | ||
let liIdx = defaultIdx; | ||
let li; | ||
let selectedLi = ul.querySelector('.e-selected'); | ||
if (selectedLi) { | ||
selectedLi.classList.remove('e-selected'); | ||
} | ||
for (let i = 0, len = ul.children.length; i < len; i++) { | ||
if (ul.children[i].classList.contains('e-focused')) { | ||
li = ul.children[i]; | ||
liIdx = i; | ||
li.classList.remove('e-focused'); | ||
keyCode === 40 ? liIdx++ : liIdx--; | ||
if (liIdx === (keyCode === 40 ? ul.childElementCount : -1)) { | ||
liIdx = defaultIdx; | ||
} | ||
} | ||
} | ||
li = ul.children[liIdx]; | ||
liIdx = isValidLI(ul, li, liIdx, keyCode); | ||
if (liIdx !== -1) { | ||
addClass([ul.children[liIdx]], 'e-focused'); | ||
ul.children[liIdx].focus(); | ||
} | ||
} | ||
function isValidLI(ul, li, index, keyCode, count = 0) { | ||
if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) { | ||
if (index === (keyCode === 40 ? ul.childElementCount - 1 : 0)) { | ||
index = keyCode === 40 ? 0 : ul.childElementCount - 1; | ||
} | ||
else { | ||
keyCode === 40 ? index++ : index--; | ||
} | ||
} | ||
li = ul.children[index]; | ||
if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) { | ||
count++; | ||
if (count === ul.childElementCount) { | ||
return index = -1; | ||
} | ||
index = isValidLI(ul, li, index, keyCode, count); | ||
} | ||
return index; | ||
} | ||
/** | ||
@@ -56,3 +102,2 @@ * Defines the items of Split Button/DropDownButton. | ||
}; | ||
const dropDownButtonObserver = new Observer(); | ||
const classNames = { | ||
@@ -113,10 +158,3 @@ DISABLED: 'e-disabled', | ||
render() { | ||
if (isBlazor() && this.isServerRendered) { | ||
buttonObserver.on('component-rendered', this.buttonRendered, this, this.element.id); | ||
this.createPopup(); | ||
this.setActiveElem([this.element]); | ||
} | ||
else { | ||
this.initialize(); | ||
} | ||
this.initialize(); | ||
if (!this.disabled) { | ||
@@ -126,12 +164,3 @@ this.wireEvents(); | ||
this.renderComplete(); | ||
if (isBlazor() && this.isServerRendered) { | ||
dropDownButtonObserver.notify('component-rendered', { id: this.element.id, instance: this }); | ||
} | ||
} | ||
buttonRendered(args) { | ||
if (this.element.id === args.instance.element.id) { | ||
this.button = args.instance; | ||
buttonObserver.off('component-rendered', this.buttonRendered, this.element.id); | ||
} | ||
} | ||
/** | ||
@@ -401,50 +430,4 @@ * Adds a new item to the menu. By default, new item appends to the list as the last item, | ||
e.preventDefault(); | ||
let ul = this.getULElement(); | ||
let defaultIdx = e.keyCode === 40 ? 0 : ul.childElementCount - 1; | ||
let liIdx = defaultIdx; | ||
let li = null; | ||
this.removeCustomSelection(); | ||
for (let i = 0, len = ul.children.length; i < len; i++) { | ||
if (ul.children[i].classList.contains(classNames.FOCUS)) { | ||
li = ul.children[i]; | ||
liIdx = i; | ||
li.classList.remove(classNames.FOCUS); | ||
e.keyCode === 40 ? liIdx++ : liIdx--; | ||
if (liIdx === (e.keyCode === 40 ? ul.childElementCount : -1)) { | ||
liIdx = defaultIdx; | ||
} | ||
} | ||
} | ||
li = ul.children[liIdx]; | ||
liIdx = this.isValidLI(li, liIdx, e.keyCode); | ||
if (liIdx !== -1) { | ||
addClass([ul.children[liIdx]], classNames.FOCUS); | ||
ul.children[liIdx].focus(); | ||
} | ||
upDownKeyHandler(this.getULElement(), e.keyCode); | ||
} | ||
removeCustomSelection() { | ||
let selectedLi = this.getULElement().querySelector('.e-selected'); | ||
if (selectedLi) { | ||
selectedLi.classList.remove('e-selected'); | ||
} | ||
} | ||
isValidLI(li, index, keyCode, count = 0) { | ||
if (li.classList.contains(classNames.SEPARATOR) || li.classList.contains(classNames.DISABLED)) { | ||
if (index === (keyCode === 40 ? this.items.length - 1 : 0)) { | ||
index = keyCode === 40 ? 0 : this.items.length - 1; | ||
} | ||
else { | ||
keyCode === 40 ? index++ : index--; | ||
} | ||
} | ||
li = this.getULElement().children[index]; | ||
if (li.classList.contains(classNames.SEPARATOR) || li.classList.contains(classNames.DISABLED)) { | ||
count++; | ||
if (count === this.items.length) { | ||
return index = -1; | ||
} | ||
index = this.isValidLI(li, index, keyCode, count); | ||
} | ||
return index; | ||
} | ||
keyEventHandler(e) { | ||
@@ -528,3 +511,6 @@ if (this.target && (e.keyCode === 13 || e.keyCode === 9)) { | ||
let ul = this.getULElement(); | ||
this.removeCustomSelection(); | ||
let selectedLi = ul.querySelector('.e-selected'); | ||
if (selectedLi) { | ||
selectedLi.classList.remove('e-selected'); | ||
} | ||
this.dropDown.hide(); | ||
@@ -705,5 +691,2 @@ removeClass(this.activeElem, 'e-active'); | ||
preRender() { | ||
if (isBlazor() && this.isServerRendered) { | ||
return; | ||
} | ||
let ele = this.element; | ||
@@ -735,25 +718,6 @@ if (ele.tagName === TAGNAME) { | ||
render() { | ||
if (isBlazor() && this.isServerRendered) { | ||
buttonObserver.on('component-rendered', this.buttonInstance, this, this.element.id); | ||
dropDownButtonObserver.on('component-rendered', this.dropDownButtonInstance, this, this.element.id); | ||
} | ||
else { | ||
this.initWrapper(); | ||
this.createPrimaryButton(); | ||
this.renderControl(); | ||
} | ||
this.initWrapper(); | ||
this.createPrimaryButton(); | ||
this.renderControl(); | ||
} | ||
buttonInstance(args) { | ||
if (this.element.id === args.instance.element.id) { | ||
this.primaryBtnObj = args.instance; | ||
buttonObserver.off('component-rendered', this.buttonInstance, this.element.id); | ||
} | ||
} | ||
dropDownButtonInstance(args) { | ||
if (args.instance.element.id.indexOf(this.element.id) > -1) { | ||
this.secondaryBtnObj = args.instance; | ||
this.renderControl(); | ||
dropDownButtonObserver.off('component-rendered', this.dropDownButtonInstance, this.element.id); | ||
} | ||
} | ||
renderControl() { | ||
@@ -818,21 +782,15 @@ this.createSecondaryButton(); | ||
let btnElem; | ||
if (isBlazor() && this.isServerRendered) { | ||
this.wrapper = this.element.parentElement; | ||
dropDownBtnModel = this.secondaryBtnObj; | ||
} | ||
else { | ||
btnElem = this.createElement('button', { | ||
className: 'e-icon-btn', | ||
attrs: { 'tabindex': '-1' }, | ||
id: this.element.id + '_dropdownbtn' | ||
}); | ||
this.wrapper.appendChild(btnElem); | ||
dropDownBtnModel = { | ||
cssClass: this.cssClass, | ||
disabled: this.disabled, | ||
enableRtl: this.enableRtl, | ||
items: this.items, | ||
target: this.target, | ||
}; | ||
} | ||
btnElem = this.createElement('button', { | ||
className: 'e-icon-btn', | ||
attrs: { 'tabindex': '-1' }, | ||
id: this.element.id + '_dropdownbtn' | ||
}); | ||
this.wrapper.appendChild(btnElem); | ||
dropDownBtnModel = { | ||
cssClass: this.cssClass, | ||
disabled: this.disabled, | ||
enableRtl: this.enableRtl, | ||
items: this.items, | ||
target: this.target, | ||
}; | ||
dropDownBtnModel.beforeItemRender = (args) => { | ||
@@ -864,7 +822,5 @@ this.trigger('beforeItemRender', args); | ||
}; | ||
if (!(isBlazor() && this.isServerRendered)) { | ||
this.secondaryBtnObj = new DropDownButton(dropDownBtnModel); | ||
this.secondaryBtnObj.createElement = this.createElement; | ||
this.secondaryBtnObj.appendTo(btnElem); | ||
} | ||
this.secondaryBtnObj = new DropDownButton(dropDownBtnModel); | ||
this.secondaryBtnObj.createElement = this.createElement; | ||
this.secondaryBtnObj.appendTo(btnElem); | ||
this.secondaryBtnObj.dropDown.relateTo = this.wrapper; | ||
@@ -898,34 +854,29 @@ this.dropDown = this.secondaryBtnObj.dropDown; | ||
destroy() { | ||
if (!(isBlazor() && this.isServerRendered)) { | ||
let classList$$1 = [RTL]; | ||
let element = document.getElementById(this.element.id); | ||
if (this.cssClass) { | ||
classList$$1 = classList$$1.concat(this.cssClass.split(' ')); | ||
let classList$$1 = [RTL]; | ||
let element = document.getElementById(this.element.id); | ||
if (this.cssClass) { | ||
classList$$1 = classList$$1.concat(this.cssClass.split(' ')); | ||
} | ||
if (element && element.parentElement === this.wrapper) { | ||
if (this.wrapper.tagName === TAGNAME) { | ||
this.wrapper.innerHTML = ''; | ||
removeClass([this.wrapper], ['e-rtl', 'e-' + this.getModuleName() + '-wrapper']); | ||
removeClass([this.wrapper], this.cssClass.split(' ')); | ||
} | ||
if (element && element.parentElement === this.wrapper) { | ||
if (this.wrapper.tagName === TAGNAME) { | ||
this.wrapper.innerHTML = ''; | ||
removeClass([this.wrapper], ['e-rtl', 'e-' + this.getModuleName() + '-wrapper']); | ||
removeClass([this.wrapper], this.cssClass.split(' ')); | ||
} | ||
else { | ||
removeClass([this.element], classList$$1); | ||
['aria-label', 'aria-haspopup', 'aria-expanded', | ||
'aria-owns', 'type'].forEach((key) => { | ||
this.element.removeAttribute(key); | ||
}); | ||
this.wrapper.parentNode.insertBefore(this.element, this.wrapper); | ||
remove(this.wrapper); | ||
} | ||
this.unWireEvents(); | ||
else { | ||
removeClass([this.element], classList$$1); | ||
['aria-label', 'aria-haspopup', 'aria-expanded', | ||
'aria-owns', 'type'].forEach((key) => { | ||
this.element.removeAttribute(key); | ||
}); | ||
this.wrapper.parentNode.insertBefore(this.element, this.wrapper); | ||
remove(this.wrapper); | ||
} | ||
this.primaryBtnObj.destroy(); | ||
this.secondaryBtnObj.destroy(); | ||
super.destroy(); | ||
if (!this.element.getAttribute('class')) { | ||
this.element.removeAttribute('class'); | ||
} | ||
this.unWireEvents(); | ||
} | ||
else { | ||
EventHandler.remove(this.element, 'click', this.primaryBtnClickHandler); | ||
this.primaryBtnObj.destroy(); | ||
this.secondaryBtnObj.destroy(); | ||
super.destroy(); | ||
if (!this.element.getAttribute('class')) { | ||
this.element.removeAttribute('class'); | ||
} | ||
@@ -1676,3 +1627,3 @@ } | ||
export { getModel, Item, dropDownButtonObserver, DropDownButton, SplitButton, Deferred, createButtonGroup, SpinSettings, AnimationSettings, ProgressButton }; | ||
export { getModel, upDownKeyHandler, Item, DropDownButton, SplitButton, Deferred, createButtonGroup, SpinSettings, AnimationSettings, ProgressButton }; | ||
//# sourceMappingURL=ej2-splitbuttons.es2015.js.map |
/*! | ||
* filename: ej2-splitbuttons.min.js | ||
* version : 18.1.52 | ||
* version : 18.2.44 | ||
* Copyright Syncfusion Inc. 2001 - 2020. 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.splitbuttons=function(e,t,n,i){"use strict";function s(e,n){for(var i=t.extend({},e),s=0,o=Object.keys(i);s<o.length;s++){var r=o[s];n.indexOf(r)<0&&t.deleteObject(i,r)}return i}function o(e,i,s){void 0===i&&(i={});var o,r,a,p;t.isNullOrUndefined(s)&&(s=t.createElement);var l=document.querySelector(e);t.addClass([l],["e-btn-group","e-css"]),l.setAttribute("role","group");var c=l.children;i.buttons=i.buttons||[];for(var h=0,d=0;d<c.length;h++,d++)o=c[d],null!==(p=i.buttons[h])&&("BUTTON"===o.tagName?r=o:(r=s("label"),(a=c[d+1])?l.insertBefore(r,a):l.appendChild(r),o.id&&r.setAttribute("for",o.id),p&&p.disabled&&(o.disabled=!0),d++),i.cssClass&&p&&!p.cssClass&&(p.cssClass=i.cssClass),new n.Button(p||{},r));return l}var r=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),a=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},p=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),a([t.Property("")],n.prototype,"iconCss",void 0),a([t.Property("")],n.prototype,"id",void 0),a([t.Property(!1)],n.prototype,"separator",void 0),a([t.Property("")],n.prototype,"text",void 0),a([t.Property("")],n.prototype,"url",void 0),n}(t.ChildProperty),l=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),c=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},h=new t.Observer,d={DISABLED:"e-disabled",FOCUS:"e-focused",ICON:"e-menu-icon",ITEM:"e-item",POPUP:"e-dropdown-popup",RTL:"e-rtl",SEPARATOR:"e-separator",VERTICAL:"e-vertical"},m=function(e){function o(t,n){return e.call(this,t,n)||this}return l(o,e),o.prototype.preRender=function(){},o.prototype.getPersistData=function(){return this.addOnPersist([])},o.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.closePopup()},o.prototype.render=function(){t.isBlazor()&&this.isServerRendered?(n.buttonObserver.on("component-rendered",this.buttonRendered,this,this.element.id),this.createPopup(),this.setActiveElem([this.element])):this.initialize(),this.disabled||this.wireEvents(),this.renderComplete(),t.isBlazor()&&this.isServerRendered&&h.notify("component-rendered",{id:this.element.id,instance:this})},o.prototype.buttonRendered=function(e){this.element.id===e.instance.element.id&&(this.button=e.instance,n.buttonObserver.off("component-rendered",this.buttonRendered,this.element.id))},o.prototype.addItems=function(e,t){for(var n,i=this.items.length,s=0,o=this.items.length;s<o;s++)if(t===this.items[s].text){i=s;break}for(var r=e.length-1;r>=0;r--)n=new p(this,"items",e[r],!0),this.items.splice(i,0,n);this.canOpen()||this.createItems()},o.prototype.removeItems=function(e){for(var t=0,n=e.length;t<n;t++)for(var i=0,s=this.items.length;i<s;i++)if(e[t]===this.items[i].text){this.items.splice(i,1);break}this.canOpen()||this.createItems()},o.prototype.createPopup=function(){var e,n=this.createElement("div",{className:d.POPUP,id:this.element.id+"-popup"});document.body.appendChild(n),this.dropDown=new i.Popup(n,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),t.attributes(this.element,(e={},e["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e["aria-owns"]=this.getPopUpElement().id,e.type="button",e["aria-label"]=this.element.textContent+" dropdownbutton",e)),this.cssClass&&t.addClass([n],this.cssClass.split(" "))},o.prototype.getTargetElement=function(){return"string"==typeof this.target?t.select(this.target):this.target},o.prototype.createItems=function(e){var n,i,s,o,r=this.items,a=this.hasIcon(this.items,"iconCss"),p=this.getULElement();p?p.innerHTML="":p=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var l=0;l<r.length;l++){i=r[l];var c=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.text):i.text;s=this.createElement("li",{innerHTML:i.url?"":c,className:i.separator?d.ITEM+" "+d.SEPARATOR:d.ITEM,attrs:{role:"menuItem",tabindex:"-1"},id:i.id?i.id:t.getUniqueID("e-"+this.getModuleName()+"-item")}),i.url&&(s.appendChild(this.createAnchor(i)),s.classList.add("e-url")),i.iconCss?(n=this.createElement("span",{className:d.ICON+" "+i.iconCss}),i.url?s.childNodes[0].appendChild(n):s.insertBefore(n,s.childNodes[0])):a&&!i.separator&&s.classList.add("e-blank-icon"),o={item:i,element:s},this.trigger("beforeItemRender",o),p.appendChild(s)}if(e&&this.getPopUpElement().appendChild(p),a){var h,m=[].slice.call(this.getPopUpElement().getElementsByClassName("e-blank-icon")),u=this.getPopUpElement().querySelector(".e-item:not(.e-blank-icon)"),y=u.querySelector(".e-menu-icon");h=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var f=parseInt(getComputedStyle(y).fontSize,10)+parseInt((this.enableRtl,getComputedStyle(y)[h.margin]),10)+parseInt(getComputedStyle(u).paddingLeft,10)+"px";m.forEach(function(e){e.style[h.padding]=f})}},o.prototype.hasIcon=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n][t])return!0;return!1},o.prototype.createAnchor=function(e){var n=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:n,attrs:{href:e.url}})},o.prototype.initialize=function(){this.button=new n.Button({iconCss:this.iconCss,iconPosition:this.iconPosition,cssClass:this.cssClass,content:this.content,disabled:this.disabled,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence}),this.button.createElement=this.createElement,this.button.appendTo(this.element),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.appendArrowSpan(),this.createPopup(),this.setActiveElem([this.element])},o.prototype.appendArrowSpan=function(){this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(d.VERTICAL)>-1?"bottom":"right")+" e-caret"}))},o.prototype.setActiveElem=function(e){this.activeElem=e},o.prototype.getModuleName=function(){return"dropdown-btn"},o.prototype.canOpen=function(){return this.getPopUpElement().classList.contains("e-popup-close")},o.prototype.destroy=function(){var n=this;if(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()){var i;this.element.querySelector("span.e-caret")&&t.detach(this.element.querySelector("span.e-caret")),this.cssClass&&(i=this.cssClass.split(" ")),this.button.destroy(),i&&t.removeClass([this.element],i),t.removeClass(this.activeElem,["e-active"]),(this.element.getAttribute("class")?["aria-haspopup","aria-expanded","aria-owns","type"]:["aria-haspopup","aria-expanded","aria-owns","type","class"]).forEach(function(e){n.element.removeAttribute(e)}),this.dropDown.destroy();var s=document.getElementById(this.getPopUpElement().id);s&&(t.removeClass([s],["e-popup-open","e-popup-close"]),t.detach(s)),this.disabled||this.unWireEvents()}},o.prototype.getPopUpElement=function(){return this.dropDown.element},o.prototype.getULElement=function(){return this.getPopUpElement().children[0]},o.prototype.wireEvents=function(){var e=this.getPopUpElement();this.delegateMousedownHandler=this.mousedownHandler.bind(this),t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this),t.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.rippleFn=t.rippleEffect(e,{selector:"."+d.ITEM})},o.prototype.keyBoardHandler=function(e){if(e.target!==this.element||9!==e.keyCode&&(e.altKey||40!==e.keyCode)&&38!==e.keyCode)switch(e.keyCode){case 38:case 40:!e.altKey||38!==e.keyCode&&40!==e.keyCode?this.upDownKeyHandler(e):this.keyEventHandler(e);break;case 9:case 13:case 27:case 32:this.keyEventHandler(e)}},o.prototype.upDownKeyHandler=function(e){if(!this.target||38!==e.keyCode&&40!==e.keyCode){e.preventDefault();var n=this.getULElement(),i=40===e.keyCode?0:n.childElementCount-1,s=i,o=null;this.removeCustomSelection();for(var r=0,a=n.children.length;r<a;r++)n.children[r].classList.contains(d.FOCUS)&&(s=r,(o=n.children[r]).classList.remove(d.FOCUS),40===e.keyCode?s++:s--,s===(40===e.keyCode?n.childElementCount:-1)&&(s=i));o=n.children[s],-1!==(s=this.isValidLI(o,s,e.keyCode))&&(t.addClass([n.children[s]],d.FOCUS),n.children[s].focus())}},o.prototype.removeCustomSelection=function(){var e=this.getULElement().querySelector(".e-selected");e&&e.classList.remove("e-selected")},o.prototype.isValidLI=function(e,t,n,i){if(void 0===i&&(i=0),(e.classList.contains(d.SEPARATOR)||e.classList.contains(d.DISABLED))&&(t===(40===n?this.items.length-1:0)?t=40===n?0:this.items.length-1:40===n?t++:t--),(e=this.getULElement().children[t]).classList.contains(d.SEPARATOR)||e.classList.contains(d.DISABLED)){if(++i===this.items.length)return t=-1;t=this.isValidLI(e,t,n,i)}return t},o.prototype.keyEventHandler=function(e){(!this.target||13!==e.keyCode&&9!==e.keyCode)&&(9!==e.keyCode&&e.preventDefault(),27===e.keyCode||38===e.keyCode||9===e.keyCode?this.canOpen()||this.closePopup(e,this.element):this.clickHandler(e))},o.prototype.getLI=function(e){return"LI"===e.tagName?e:t.closest(e,"li")},o.prototype.mousedownHandler=function(e){var n=e.target;this.canOpen()||t.closest(n,"#"+this.getPopUpElement().id)||t.closest(n,"#"+this.element.id)||this.closePopup(e)},o.prototype.clickHandler=function(e){var n=e.target,i=this.canOpen();if(t.closest(n,"#"+this.element.id))i?this.openPopUp(e):this.closePopup(e,this.activeElem[0]);else if(t.closest(n,"#"+this.getPopUpElement().id)){var s=void 0,o=void 0,r=void 0,a=this.getLI(n);a&&(o=Array.prototype.indexOf.call(this.getULElement().children,a),(r=this.items[o])&&(s={element:a,item:r},this.trigger("select",s)),this.closePopup(e,this.activeElem[0]))}},o.prototype.openPopUp=function(e){var n=this;void 0===e&&(e=null),this.target||this.createItems(!0);var i={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",i,function(e){if(!e.cancel){var i=n.getULElement();n.dropDown.show(null,n.element),t.addClass([n.element],"e-active"),n.element.setAttribute("aria-expanded","true"),i.focus();var s={element:i,items:n.items};n.trigger("open",s)}})},o.prototype.closePopup=function(e,n){var i=this;void 0===e&&(e=null);var s={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeClose",s,function(e){if(!e.cancel){var s=i.getULElement();i.removeCustomSelection(),i.dropDown.hide(),t.removeClass(i.activeElem,"e-active"),i.element.setAttribute("aria-expanded","false"),n&&n.focus();var o={element:s,items:i.items};i.trigger("close",o),!i.target&&s&&t.detach(s)}})},o.prototype.unWireEvents=function(){t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.rippleFn()},o.prototype.onPropertyChanged=function(e,n){var i=["content","cssClass","iconCss","iconPosition","disabled","enableRtl"];this.button.setProperties(s(e,i)),this.dropDown.setProperties(s(e,["enableRtl"]));for(var o=this.getPopUpElement(),r=0,a=Object.keys(e);r<a.length;r++)switch(a[r]){case"content":this.element.querySelector("span.e-caret")||this.appendArrowSpan();break;case"disabled":e.disabled?(this.unWireEvents(),this.canOpen()||this.closePopup()):this.wireEvents();break;case"cssClass":if(e.cssClass.indexOf(d.VERTICAL)>-1){var p=this.element.querySelector("span.e-caret");t.classList(p,["e-icon-bottom"],["e-icon-right"])}n.cssClass&&t.removeClass([o],n.cssClass.split(" ")),e.cssClass&&t.addClass([o],e.cssClass.split(" "));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.canOpen()||this.createItems()}},o.prototype.focusIn=function(){this.element.focus()},c([t.Property("")],o.prototype,"content",void 0),c([t.Property("")],o.prototype,"cssClass",void 0),c([t.Property(!1)],o.prototype,"disabled",void 0),c([t.Property("")],o.prototype,"iconCss",void 0),c([t.Property("Left")],o.prototype,"iconPosition",void 0),c([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),c([t.Collection([],p)],o.prototype,"items",void 0),c([t.Property("")],o.prototype,"target",void 0),c([t.Event()],o.prototype,"beforeItemRender",void 0),c([t.Event()],o.prototype,"beforeOpen",void 0),c([t.Event()],o.prototype,"beforeClose",void 0),c([t.Event()],o.prototype,"close",void 0),c([t.Event()],o.prototype,"open",void 0),c([t.Event()],o.prototype,"select",void 0),c([t.Event()],o.prototype,"created",void 0),o=c([t.NotifyPropertyChanges],o)}(t.Component),u=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),y=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},f="e-rtl",v="EJS-SPLITBUTTON",g=function(e){function i(t,n){return e.call(this,t,n)||this}return u(i,e),i.prototype.preRender=function(){if(!t.isBlazor()||!this.isServerRendered){var e=this.element;if(e.tagName===v){for(var n=t.getValue("ej2_instances",e),i=this.createElement("button",{attrs:{type:"button"}}),s=this.createElement(v,{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,r=e.attributes.length;o<r;o++)i.setAttribute(e.attributes[o].nodeName,e.attributes[o].nodeValue);e.parentNode.insertBefore(s,e),t.detach(e),e=i,s.appendChild(e),t.setValue("ej2_instances",n,e),this.wrapper=s,this.element=e}this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))}},i.prototype.render=function(){t.isBlazor()&&this.isServerRendered?(n.buttonObserver.on("component-rendered",this.buttonInstance,this,this.element.id),h.on("component-rendered",this.dropDownButtonInstance,this,this.element.id)):(this.initWrapper(),this.createPrimaryButton(),this.renderControl())},i.prototype.buttonInstance=function(e){this.element.id===e.instance.element.id&&(this.primaryBtnObj=e.instance,n.buttonObserver.off("component-rendered",this.buttonInstance,this.element.id))},i.prototype.dropDownButtonInstance=function(e){e.instance.element.id.indexOf(this.element.id)>-1&&(this.secondaryBtnObj=e.instance,this.renderControl(),h.off("component-rendered",this.dropDownButtonInstance,this.element.id))},i.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},i.prototype.addItems=function(t,n){e.prototype.addItems.call(this,t,n),this.secondaryBtnObj.items=this.items},i.prototype.removeItems=function(t){e.prototype.removeItems.call(this,t),this.secondaryBtnObj.items=this.items},i.prototype.initWrapper=function(){this.wrapper||(this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.element.parentNode.insertBefore(this.wrapper,this.element)),this.element.classList.remove("e-"+this.getModuleName()),this.enableRtl&&this.wrapper.classList.add(f),this.cssClass&&t.addClass([this.wrapper],this.cssClass.split(" "))},i.prototype.createPrimaryButton=function(){var e={cssClass:this.cssClass,enableRtl:this.enableRtl,iconCss:this.iconCss,iconPosition:this.iconPosition,content:this.content,disabled:this.disabled};this.primaryBtnObj=new n.Button(e),this.primaryBtnObj.createElement=this.createElement,this.primaryBtnObj.appendTo(this.element),this.element.classList.add("e-"+this.getModuleName()),this.element.type="button",this.wrapper.appendChild(this.element)},i.prototype.createSecondaryButton=function(){var e,n,i=this;t.isBlazor()&&this.isServerRendered?(this.wrapper=this.element.parentElement,e=this.secondaryBtnObj):(n=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"}),this.wrapper.appendChild(n),e={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target}),e.beforeItemRender=function(e){i.trigger("beforeItemRender",e)},e.open=function(e){i.trigger("open",e)},e.close=function(e){i.trigger("close",e)},e.select=function(e){i.trigger("select",e)},e.beforeOpen=function(e){var t=new b;return i.trigger("beforeOpen",e,function(e){t.resolve(e)}),t},e.beforeClose=function(e){var t=new b;return i.trigger("beforeClose",e,function(e){t.resolve(e)}),t},t.isBlazor()&&this.isServerRendered||(this.secondaryBtnObj=new m(e),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(n)),this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],t.EventHandler.remove(this.getPopUpElement(),"keydown",this.secondaryBtnObj.keyBoardHandler),this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right")},i.prototype.setAria=function(){t.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent+" splitbutton","aria-owns":this.secondaryBtnObj.dropDown.element.id})},i.prototype.getModuleName=function(){return"split-btn"},i.prototype.toggle=function(){this.secondaryBtnObj.toggle()},i.prototype.destroy=function(){var n=this;if(t.isBlazor()&&this.isServerRendered)t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler);else{var i=[f],s=document.getElementById(this.element.id);this.cssClass&&(i=i.concat(this.cssClass.split(" "))),s&&s.parentElement===this.wrapper&&(this.wrapper.tagName===v?(this.wrapper.innerHTML="",t.removeClass([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),t.removeClass([this.wrapper],this.cssClass.split(" "))):(t.removeClass([this.element],i),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){n.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),t.remove(this.wrapper)),this.unWireEvents()),this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element.getAttribute("class")||this.element.removeAttribute("class")}},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),t.EventHandler.add(this.getPopUpElement(),"keydown",this.keyBoardHandler,this),new t.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow"}})},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),t.getInstance(this.element,t.KeyboardEvents).destroy()},i.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},i.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e)}},i.prototype.onPropertyChanged=function(e,n){var i=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(s(e,i)),i=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl"],Object.keys(e).indexOf("items")>-1&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(s(e,i));for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"cssClass":n.cssClass&&t.removeClass([this.wrapper],n.cssClass.split(" ")),t.addClass([this.wrapper],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?t.addClass([this.wrapper],f):t.removeClass([this.wrapper],f)}},i.prototype.focusIn=function(){this.element.focus()},y([t.Property("")],i.prototype,"content",void 0),y([t.Property("")],i.prototype,"cssClass",void 0),y([t.Property(!1)],i.prototype,"disabled",void 0),y([t.Property("")],i.prototype,"iconCss",void 0),y([t.Property("Left")],i.prototype,"iconPosition",void 0),y([t.Collection([],p)],i.prototype,"items",void 0),y([t.Property("")],i.prototype,"target",void 0),y([t.Event()],i.prototype,"beforeItemRender",void 0),y([t.Event()],i.prototype,"beforeOpen",void 0),y([t.Event()],i.prototype,"beforeClose",void 0),y([t.Event()],i.prototype,"click",void 0),y([t.Event()],i.prototype,"close",void 0),y([t.Event()],i.prototype,"open",void 0),y([t.Event()],i.prototype,"select",void 0),y([t.Event()],i.prototype,"created",void 0),i=y([t.NotifyPropertyChanges],i)}(m),b=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)}return e}(),C=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),P=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},E="e-btn-content",w=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return C(n,e),P([t.Property(null)],n.prototype,"template",void 0),P([t.Property(16)],n.prototype,"width",void 0),P([t.Property("Left")],n.prototype,"position",void 0),n}(t.ChildProperty),S=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return C(n,e),P([t.Property(400)],n.prototype,"duration",void 0),P([t.Property("None")],n.prototype,"effect",void 0),P([t.Property("ease")],n.prototype,"easing",void 0),n}(t.ChildProperty),O=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.step=1,i}return C(n,e),n.prototype.preRender=function(){e.prototype.preRender.call(this)},n.prototype.render=function(){t.isBlazor()&&(this.isServerRendered=!1),e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},n.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},n.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},n.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},n.prototype.getModuleName=function(){return"progress-btn"},n.prototype.destroy=function(){var n=this,i=["e-hide-spinner","e-progress-active","e-round-corner","e-"+e.prototype.getModuleName.call(this),"e-spin-"+this.spinSettings.position.toLowerCase()];e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(i=i.concat(this.cssClass.split(" "))),t.removeClass([this.element],i),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){n.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},n.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},n.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),i.createSpinner({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},n.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},n.prototype.getProgress=function(){return this.element.getElementsByClassName("e-progress")[0]},n.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(E)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},n.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:"e-progress"}))},n.prototype.setContent=function(){var e;t.isBlazor()?(e=this.content,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.content)),this.setContentIcon(e)):(e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:E,innerHTML:e})))},n.prototype.setContentIcon=function(e){var t=this.createElement("span",{className:E,innerHTML:e});if(this.iconCss){var n=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(n.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("e-icon-btn");var i=t.childNodes[0];!i||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?t.appendChild(n):t.insertBefore(n,i)}this.element.appendChild(t)},n.prototype.clickHandler=function(){this.element.classList.contains("e-progress-active")||this.startProgress()},n.prototype.startProgress=function(e,t){var n=this.element.classList,s=n.contains("e-vertical");n.add("e-progress-active"),n.contains("e-hide-spinner")||i.showSpinner(this.element),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,s),this.startContAnimate()},n.prototype.startAnimate=function(e,t,n,i,s,o,r,a){var p=this;try{var l=void 0,c=e-n,h=this.duration*o/100,d=c?c<h?c-h:c%h:0;this.progressTime=t=t+c-d,n=e-d,i+=(c-d)/this.duration*100,l={percent:s=(t-r)%h==0||100===i?i:s,currentDuration:t,step:o},this.eIsVertical=a,0===i?this.trigger("begin",l,function(e){p.successCallback(e,i,s,t,r,d,n)}):100===i||t===this.duration?this.trigger("end",l,function(e){p.successCallback(e,i,s,t,r,d,n)}):this.trigger("progress",l,function(e){p.successCallback(e,i,s,t,r,d,n)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},n.prototype.successCallback=function(e,t,n,i,s,o,r){var a=this,p=t,l=n,c=o,h=i,d=s,m=r,u=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(h-d)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&(a.getProgress().style[u?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())}),l=p,d=h),this.isPaused||(h<this.duration&&p<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),h,m,p,l,e.step,d,u)},this.duration/100-c):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&(a.getProgress().style[u?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},n.prototype.startContAnimate=function(){var e=this,n=this.element.getElementsByClassName(E)[0];"None"!==this.animationSettings.effect?new t.Animation({}).animate(n,{duration:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){n.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},n.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add("e-progress-active");for(var n,i=this.percent;i<100;i++)(i+=10)>100&&(i=100),this.enableProgress&&(this.getProgress().style[t?"height":"width"]=this.percent<100?i+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin(),n={step:this.step,currentDuration:this.progressTime,percent:100},clearTimeout(this.interval),this.trigger("end",n),this.progressTime=this.percent=0},n.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(E)[0],t=this.getSpinner();t.style.width=Math.max(t.offsetWidth,e.offsetWidth)+"px",t.style.height=Math.max(t.offsetHeight,e.offsetHeight)+"px",e.classList.add("e-cont-animate")},n.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(E)[0];if(this.element.classList.contains("e-hide-spinner")||i.hideSpinner(this.element),this.element.classList.remove("e-progress-active"),"None"!==this.animationSettings.effect&&e.classList.remove("e-animate-end"),"Center"===this.spinSettings.position){var t=this.getSpinner();e.classList.remove("e-cont-animate"),t.style.width="auto",t.style.height="auto"}},n.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(E)[0],t=this.element.getElementsByClassName("e-btn-icon")[0];!e.childNodes[0]||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?e.appendChild(t):e.insertBefore(t,e.childNodes[0])},n.prototype.setAria=function(){t.attributes(this.element,{"aria-label":this.element.textContent+" progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":"0"})},n.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler)},n.prototype.onPropertyChanged=function(n,i){var s=this.element;e.prototype.onPropertyChanged.call(this,n,i);for(var o=0,r=Object.keys(n);o<r.length;o++)switch(r[o]){case"content":if(t.isBlazor()){var a=this.element.querySelector(".e-btn-content");this.iconCss?"Left"===this.iconPosition||"Top"===this.iconPosition?a.childNodes[1].textContent=this.content:a.childNodes[0].textContent=this.content:a.textContent=this.content}else this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress();s.setAttribute("aria-label",s.textContent+" progress");break;case"iconCss":i.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":n.enableProgress?this.createProgress():t.remove(this.getProgress());break;case"spinSettings":n.spinSettings.position&&(s.classList.remove("e-spin-"+i.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(n.spinSettings.template||n.spinSettings.width)&&(s.removeChild(this.getSpinner()),this.createSpinner())}},n.prototype.focusIn=function(){this.element.focus()},P([t.Property(!1)],n.prototype,"enableProgress",void 0),P([t.Property(2e3)],n.prototype,"duration",void 0),P([t.Property("Left")],n.prototype,"iconPosition",void 0),P([t.Property("")],n.prototype,"iconCss",void 0),P([t.Property(!1)],n.prototype,"disabled",void 0),P([t.Property(!1)],n.prototype,"isPrimary",void 0),P([t.Property("")],n.prototype,"cssClass",void 0),P([t.Property("")],n.prototype,"content",void 0),P([t.Property(!1)],n.prototype,"isToggle",void 0),P([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),P([t.Complex({},w)],n.prototype,"spinSettings",void 0),P([t.Complex({},S)],n.prototype,"animationSettings",void 0),P([t.Event()],n.prototype,"created",void 0),P([t.Event()],n.prototype,"begin",void 0),P([t.Event()],n.prototype,"progress",void 0),P([t.Event()],n.prototype,"end",void 0),P([t.Event()],n.prototype,"fail",void 0),n=P([t.NotifyPropertyChanges],n)}(n.Button);return e.getModel=s,e.Item=p,e.dropDownButtonObserver=h,e.DropDownButton=m,e.SplitButton=g,e.Deferred=b,e.createButtonGroup=o,e.SpinSettings=w,e.AnimationSettings=S,e.ProgressButton=O,e}({},ej.base,ej.buttons,ej.popups),this.ejs=ej; | ||
this.ej=this.ej||{},this.ej.splitbuttons=function(e,t,n,i){"use strict";function s(e,n){for(var i=t.extend({},e),s=0,o=Object.keys(i);s<o.length;s++){var r=o[s];n.indexOf(r)<0&&t.deleteObject(i,r)}return i}function o(e,n){var i=40===n?0:e.childElementCount-1,s=i,o=e.querySelector(".e-selected");o&&o.classList.remove("e-selected");for(var a=0,p=e.children.length;a<p;a++)e.children[a].classList.contains("e-focused")&&(s=a,e.children[a].classList.remove("e-focused"),40===n?s++:s--,s===(40===n?e.childElementCount:-1)&&(s=i));-1!==(s=r(e,e.children[s],s,n))&&(t.addClass([e.children[s]],"e-focused"),e.children[s].focus())}function r(e,t,n,i,s){if(void 0===s&&(s=0),(t.classList.contains("e-separator")||t.classList.contains("e-disabled"))&&(n===(40===i?e.childElementCount-1:0)?n=40===i?0:e.childElementCount-1:40===i?n++:n--),(t=e.children[n]).classList.contains("e-separator")||t.classList.contains("e-disabled")){if(++s===e.childElementCount)return n=-1;n=r(e,t,n,i,s)}return n}function a(e,i,s){void 0===i&&(i={});var o,r,a,p;t.isNullOrUndefined(s)&&(s=t.createElement);var l=document.querySelector(e);t.addClass([l],["e-btn-group","e-css"]),l.setAttribute("role","group");var c=l.children;i.buttons=i.buttons||[];for(var h=0,d=0;d<c.length;h++,d++)o=c[d],null!==(p=i.buttons[h])&&("BUTTON"===o.tagName?r=o:(r=s("label"),(a=c[d+1])?l.insertBefore(r,a):l.appendChild(r),o.id&&r.setAttribute("for",o.id),p&&p.disabled&&(o.disabled=!0),d++),i.cssClass&&p&&!p.cssClass&&(p.cssClass=i.cssClass),new n.Button(p||{},r));return l}var p=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),l=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},c=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return p(n,e),l([t.Property("")],n.prototype,"iconCss",void 0),l([t.Property("")],n.prototype,"id",void 0),l([t.Property(!1)],n.prototype,"separator",void 0),l([t.Property("")],n.prototype,"text",void 0),l([t.Property("")],n.prototype,"url",void 0),n}(t.ChildProperty),h=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),d=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},m={DISABLED:"e-disabled",FOCUS:"e-focused",ICON:"e-menu-icon",ITEM:"e-item",POPUP:"e-dropdown-popup",RTL:"e-rtl",SEPARATOR:"e-separator",VERTICAL:"e-vertical"},u=function(e){function r(t,n){return e.call(this,t,n)||this}return h(r,e),r.prototype.preRender=function(){},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.closePopup()},r.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},r.prototype.addItems=function(e,t){for(var n,i=this.items.length,s=0,o=this.items.length;s<o;s++)if(t===this.items[s].text){i=s;break}for(var r=e.length-1;r>=0;r--)n=new c(this,"items",e[r],!0),this.items.splice(i,0,n);this.canOpen()||this.createItems()},r.prototype.removeItems=function(e){for(var t=0,n=e.length;t<n;t++)for(var i=0,s=this.items.length;i<s;i++)if(e[t]===this.items[i].text){this.items.splice(i,1);break}this.canOpen()||this.createItems()},r.prototype.createPopup=function(){var e,n=this.createElement("div",{className:m.POPUP,id:this.element.id+"-popup"});document.body.appendChild(n),this.dropDown=new i.Popup(n,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),t.attributes(this.element,(e={},e["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e["aria-owns"]=this.getPopUpElement().id,e.type="button",e["aria-label"]=this.element.textContent+" dropdownbutton",e)),this.cssClass&&t.addClass([n],this.cssClass.split(" "))},r.prototype.getTargetElement=function(){return"string"==typeof this.target?t.select(this.target):this.target},r.prototype.createItems=function(e){var n,i,s,o,r=this.items,a=this.hasIcon(this.items,"iconCss"),p=this.getULElement();p?p.innerHTML="":p=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var l=0;l<r.length;l++){i=r[l];var c=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.text):i.text;s=this.createElement("li",{innerHTML:i.url?"":c,className:i.separator?m.ITEM+" "+m.SEPARATOR:m.ITEM,attrs:{role:"menuItem",tabindex:"-1"},id:i.id?i.id:t.getUniqueID("e-"+this.getModuleName()+"-item")}),i.url&&(s.appendChild(this.createAnchor(i)),s.classList.add("e-url")),i.iconCss?(n=this.createElement("span",{className:m.ICON+" "+i.iconCss}),i.url?s.childNodes[0].appendChild(n):s.insertBefore(n,s.childNodes[0])):a&&!i.separator&&s.classList.add("e-blank-icon"),o={item:i,element:s},this.trigger("beforeItemRender",o),p.appendChild(s)}if(e&&this.getPopUpElement().appendChild(p),a){var h,d=[].slice.call(this.getPopUpElement().getElementsByClassName("e-blank-icon")),u=this.getPopUpElement().querySelector(".e-item:not(.e-blank-icon)"),y=u.querySelector(".e-menu-icon");h=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var f=parseInt(getComputedStyle(y).fontSize,10)+parseInt((this.enableRtl,getComputedStyle(y)[h.margin]),10)+parseInt(getComputedStyle(u).paddingLeft,10)+"px";d.forEach(function(e){e.style[h.padding]=f})}},r.prototype.hasIcon=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n][t])return!0;return!1},r.prototype.createAnchor=function(e){var n=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:n,attrs:{href:e.url}})},r.prototype.initialize=function(){this.button=new n.Button({iconCss:this.iconCss,iconPosition:this.iconPosition,cssClass:this.cssClass,content:this.content,disabled:this.disabled,enableRtl:this.enableRtl,enablePersistence:this.enablePersistence}),this.button.createElement=this.createElement,this.button.appendTo(this.element),this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName())),this.appendArrowSpan(),this.createPopup(),this.setActiveElem([this.element])},r.prototype.appendArrowSpan=function(){this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(m.VERTICAL)>-1?"bottom":"right")+" e-caret"}))},r.prototype.setActiveElem=function(e){this.activeElem=e},r.prototype.getModuleName=function(){return"dropdown-btn"},r.prototype.canOpen=function(){return this.getPopUpElement().classList.contains("e-popup-close")},r.prototype.destroy=function(){var n=this;if(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()){var i;this.element.querySelector("span.e-caret")&&t.detach(this.element.querySelector("span.e-caret")),this.cssClass&&(i=this.cssClass.split(" ")),this.button.destroy(),i&&t.removeClass([this.element],i),t.removeClass(this.activeElem,["e-active"]),(this.element.getAttribute("class")?["aria-haspopup","aria-expanded","aria-owns","type"]:["aria-haspopup","aria-expanded","aria-owns","type","class"]).forEach(function(e){n.element.removeAttribute(e)}),this.dropDown.destroy();var s=document.getElementById(this.getPopUpElement().id);s&&(t.removeClass([s],["e-popup-open","e-popup-close"]),t.detach(s)),this.disabled||this.unWireEvents()}},r.prototype.getPopUpElement=function(){return this.dropDown.element},r.prototype.getULElement=function(){return this.getPopUpElement().children[0]},r.prototype.wireEvents=function(){var e=this.getPopUpElement();this.delegateMousedownHandler=this.mousedownHandler.bind(this),t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this),t.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.rippleFn=t.rippleEffect(e,{selector:"."+m.ITEM})},r.prototype.keyBoardHandler=function(e){if(e.target!==this.element||9!==e.keyCode&&(e.altKey||40!==e.keyCode)&&38!==e.keyCode)switch(e.keyCode){case 38:case 40:!e.altKey||38!==e.keyCode&&40!==e.keyCode?this.upDownKeyHandler(e):this.keyEventHandler(e);break;case 9:case 13:case 27:case 32:this.keyEventHandler(e)}},r.prototype.upDownKeyHandler=function(e){(!this.target||38!==e.keyCode&&40!==e.keyCode)&&(e.preventDefault(),o(this.getULElement(),e.keyCode))},r.prototype.keyEventHandler=function(e){(!this.target||13!==e.keyCode&&9!==e.keyCode)&&(9!==e.keyCode&&e.preventDefault(),27===e.keyCode||38===e.keyCode||9===e.keyCode?this.canOpen()||this.closePopup(e,this.element):this.clickHandler(e))},r.prototype.getLI=function(e){return"LI"===e.tagName?e:t.closest(e,"li")},r.prototype.mousedownHandler=function(e){var n=e.target;this.canOpen()||t.closest(n,"#"+this.getPopUpElement().id)||t.closest(n,"#"+this.element.id)||this.closePopup(e)},r.prototype.clickHandler=function(e){var n=e.target,i=this.canOpen();if(t.closest(n,"#"+this.element.id))i?this.openPopUp(e):this.closePopup(e,this.activeElem[0]);else if(t.closest(n,"#"+this.getPopUpElement().id)){var s=void 0,o=void 0,r=void 0,a=this.getLI(n);a&&(o=Array.prototype.indexOf.call(this.getULElement().children,a),(r=this.items[o])&&(s={element:a,item:r},this.trigger("select",s)),this.closePopup(e,this.activeElem[0]))}},r.prototype.openPopUp=function(e){var n=this;void 0===e&&(e=null),this.target||this.createItems(!0);var i={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",i,function(e){if(!e.cancel){var i=n.getULElement();n.dropDown.show(null,n.element),t.addClass([n.element],"e-active"),n.element.setAttribute("aria-expanded","true"),i.focus();var s={element:i,items:n.items};n.trigger("open",s)}})},r.prototype.closePopup=function(e,n){var i=this;void 0===e&&(e=null);var s={element:this.getULElement(),items:this.items,event:e,cancel:!1};this.trigger("beforeClose",s,function(e){if(!e.cancel){var s=i.getULElement(),o=s.querySelector(".e-selected");o&&o.classList.remove("e-selected"),i.dropDown.hide(),t.removeClass(i.activeElem,"e-active"),i.element.setAttribute("aria-expanded","false"),n&&n.focus();var r={element:s,items:i.items};i.trigger("close",r),!i.target&&s&&t.detach(s)}})},r.prototype.unWireEvents=function(){t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.rippleFn()},r.prototype.onPropertyChanged=function(e,n){var i=["content","cssClass","iconCss","iconPosition","disabled","enableRtl"];this.button.setProperties(s(e,i)),this.dropDown.setProperties(s(e,["enableRtl"]));for(var o=this.getPopUpElement(),r=0,a=Object.keys(e);r<a.length;r++)switch(a[r]){case"content":this.element.querySelector("span.e-caret")||this.appendArrowSpan();break;case"disabled":e.disabled?(this.unWireEvents(),this.canOpen()||this.closePopup()):this.wireEvents();break;case"cssClass":if(e.cssClass.indexOf(m.VERTICAL)>-1){var p=this.element.querySelector("span.e-caret");t.classList(p,["e-icon-bottom"],["e-icon-right"])}n.cssClass&&t.removeClass([o],n.cssClass.split(" ")),e.cssClass&&t.addClass([o],e.cssClass.split(" "));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.canOpen()||this.createItems()}},r.prototype.focusIn=function(){this.element.focus()},d([t.Property("")],r.prototype,"content",void 0),d([t.Property("")],r.prototype,"cssClass",void 0),d([t.Property(!1)],r.prototype,"disabled",void 0),d([t.Property("")],r.prototype,"iconCss",void 0),d([t.Property("Left")],r.prototype,"iconPosition",void 0),d([t.Property(!1)],r.prototype,"enableHtmlSanitizer",void 0),d([t.Collection([],c)],r.prototype,"items",void 0),d([t.Property("")],r.prototype,"target",void 0),d([t.Event()],r.prototype,"beforeItemRender",void 0),d([t.Event()],r.prototype,"beforeOpen",void 0),d([t.Event()],r.prototype,"beforeClose",void 0),d([t.Event()],r.prototype,"close",void 0),d([t.Event()],r.prototype,"open",void 0),d([t.Event()],r.prototype,"select",void 0),d([t.Event()],r.prototype,"created",void 0),r=d([t.NotifyPropertyChanges],r)}(t.Component),y=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),f=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},v="e-rtl",g="EJS-SPLITBUTTON",b=function(e){function i(t,n){return e.call(this,t,n)||this}return y(i,e),i.prototype.preRender=function(){var e=this.element;if(e.tagName===g){for(var n=t.getValue("ej2_instances",e),i=this.createElement("button",{attrs:{type:"button"}}),s=this.createElement(g,{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,r=e.attributes.length;o<r;o++)i.setAttribute(e.attributes[o].nodeName,e.attributes[o].nodeValue);e.parentNode.insertBefore(s,e),t.detach(e),e=i,s.appendChild(e),t.setValue("ej2_instances",n,e),this.wrapper=s,this.element=e}this.element.id||(this.element.id=t.getUniqueID("e-"+this.getModuleName()))},i.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},i.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},i.prototype.addItems=function(t,n){e.prototype.addItems.call(this,t,n),this.secondaryBtnObj.items=this.items},i.prototype.removeItems=function(t){e.prototype.removeItems.call(this,t),this.secondaryBtnObj.items=this.items},i.prototype.initWrapper=function(){this.wrapper||(this.wrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.element.parentNode.insertBefore(this.wrapper,this.element)),this.element.classList.remove("e-"+this.getModuleName()),this.enableRtl&&this.wrapper.classList.add(v),this.cssClass&&t.addClass([this.wrapper],this.cssClass.split(" "))},i.prototype.createPrimaryButton=function(){var e={cssClass:this.cssClass,enableRtl:this.enableRtl,iconCss:this.iconCss,iconPosition:this.iconPosition,content:this.content,disabled:this.disabled};this.primaryBtnObj=new n.Button(e),this.primaryBtnObj.createElement=this.createElement,this.primaryBtnObj.appendTo(this.element),this.element.classList.add("e-"+this.getModuleName()),this.element.type="button",this.wrapper.appendChild(this.element)},i.prototype.createSecondaryButton=function(){var e,n,i=this;n=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"}),this.wrapper.appendChild(n),(e={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target}).beforeItemRender=function(e){i.trigger("beforeItemRender",e)},e.open=function(e){i.trigger("open",e)},e.close=function(e){i.trigger("close",e)},e.select=function(e){i.trigger("select",e)},e.beforeOpen=function(e){var t=new C;return i.trigger("beforeOpen",e,function(e){t.resolve(e)}),t},e.beforeClose=function(e){var t=new C;return i.trigger("beforeClose",e,function(e){t.resolve(e)}),t},this.secondaryBtnObj=new u(e),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(n),this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],t.EventHandler.remove(this.getPopUpElement(),"keydown",this.secondaryBtnObj.keyBoardHandler),this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right")},i.prototype.setAria=function(){t.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent+" splitbutton","aria-owns":this.secondaryBtnObj.dropDown.element.id})},i.prototype.getModuleName=function(){return"split-btn"},i.prototype.toggle=function(){this.secondaryBtnObj.toggle()},i.prototype.destroy=function(){var n=this,i=[v],s=document.getElementById(this.element.id);this.cssClass&&(i=i.concat(this.cssClass.split(" "))),s&&s.parentElement===this.wrapper&&(this.wrapper.tagName===g?(this.wrapper.innerHTML="",t.removeClass([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),t.removeClass([this.wrapper],this.cssClass.split(" "))):(t.removeClass([this.element],i),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){n.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),t.remove(this.wrapper)),this.unWireEvents()),this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element.getAttribute("class")||this.element.removeAttribute("class")},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),t.EventHandler.add(this.getPopUpElement(),"keydown",this.keyBoardHandler,this),new t.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow"}})},i.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),t.getInstance(this.element,t.KeyboardEvents).destroy()},i.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},i.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e)}},i.prototype.onPropertyChanged=function(e,n){var i=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(s(e,i)),i=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl"],Object.keys(e).indexOf("items")>-1&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(s(e,i));for(var o=0,r=Object.keys(e);o<r.length;o++)switch(r[o]){case"cssClass":n.cssClass&&t.removeClass([this.wrapper],n.cssClass.split(" ")),t.addClass([this.wrapper],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?t.addClass([this.wrapper],v):t.removeClass([this.wrapper],v)}},i.prototype.focusIn=function(){this.element.focus()},f([t.Property("")],i.prototype,"content",void 0),f([t.Property("")],i.prototype,"cssClass",void 0),f([t.Property(!1)],i.prototype,"disabled",void 0),f([t.Property("")],i.prototype,"iconCss",void 0),f([t.Property("Left")],i.prototype,"iconPosition",void 0),f([t.Collection([],c)],i.prototype,"items",void 0),f([t.Property("")],i.prototype,"target",void 0),f([t.Event()],i.prototype,"beforeItemRender",void 0),f([t.Event()],i.prototype,"beforeOpen",void 0),f([t.Event()],i.prototype,"beforeClose",void 0),f([t.Event()],i.prototype,"click",void 0),f([t.Event()],i.prototype,"close",void 0),f([t.Event()],i.prototype,"open",void 0),f([t.Event()],i.prototype,"select",void 0),f([t.Event()],i.prototype,"created",void 0),i=f([t.NotifyPropertyChanges],i)}(u),C=function(){function e(){var e=this;this.promise=new Promise(function(t,n){e.resolve=t,e.reject=n}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)}return e}(),P=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),E=function(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r},w="e-btn-content",O=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return P(n,e),E([t.Property(null)],n.prototype,"template",void 0),E([t.Property(16)],n.prototype,"width",void 0),E([t.Property("Left")],n.prototype,"position",void 0),n}(t.ChildProperty),S=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return P(n,e),E([t.Property(400)],n.prototype,"duration",void 0),E([t.Property("None")],n.prototype,"effect",void 0),E([t.Property("ease")],n.prototype,"easing",void 0),n}(t.ChildProperty),k=function(e){function n(t,n){var i=e.call(this,t,n)||this;return i.step=1,i}return P(n,e),n.prototype.preRender=function(){e.prototype.preRender.call(this)},n.prototype.render=function(){t.isBlazor()&&(this.isServerRendered=!1),e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},n.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},n.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},n.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},n.prototype.getModuleName=function(){return"progress-btn"},n.prototype.destroy=function(){var n=this,i=["e-hide-spinner","e-progress-active","e-round-corner","e-"+e.prototype.getModuleName.call(this),"e-spin-"+this.spinSettings.position.toLowerCase()];e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(i=i.concat(this.cssClass.split(" "))),t.removeClass([this.element],i),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){n.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},n.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},n.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),i.createSpinner({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},n.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},n.prototype.getProgress=function(){return this.element.getElementsByClassName("e-progress")[0]},n.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(w)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},n.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:"e-progress"}))},n.prototype.setContent=function(){var e;t.isBlazor()?(e=this.content,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.content)),this.setContentIcon(e)):(e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:w,innerHTML:e})))},n.prototype.setContentIcon=function(e){var t=this.createElement("span",{className:w,innerHTML:e});if(this.iconCss){var n=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(n.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("e-icon-btn");var i=t.childNodes[0];!i||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?t.appendChild(n):t.insertBefore(n,i)}this.element.appendChild(t)},n.prototype.clickHandler=function(){this.element.classList.contains("e-progress-active")||this.startProgress()},n.prototype.startProgress=function(e,t){var n=this.element.classList,s=n.contains("e-vertical");n.add("e-progress-active"),n.contains("e-hide-spinner")||i.showSpinner(this.element),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,s),this.startContAnimate()},n.prototype.startAnimate=function(e,t,n,i,s,o,r,a){var p=this;try{var l=void 0,c=e-n,h=this.duration*o/100,d=c?c<h?c-h:c%h:0;this.progressTime=t=t+c-d,n=e-d,i+=(c-d)/this.duration*100,l={percent:s=(t-r)%h==0||100===i?i:s,currentDuration:t,step:o},this.eIsVertical=a,0===i?this.trigger("begin",l,function(e){p.successCallback(e,i,s,t,r,d,n)}):100===i||t===this.duration?this.trigger("end",l,function(e){p.successCallback(e,i,s,t,r,d,n)}):this.trigger("progress",l,function(e){p.successCallback(e,i,s,t,r,d,n)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},n.prototype.successCallback=function(e,t,n,i,s,o,r){var a=this,p=t,l=n,c=o,h=i,d=s,m=r,u=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(h-d)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&(a.getProgress().style[u?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())}),l=p,d=h),this.isPaused||(h<this.duration&&p<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),h,m,p,l,e.step,d,u)},this.duration/100-c):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&(a.getProgress().style[u?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},n.prototype.startContAnimate=function(){var e=this,n=this.element.getElementsByClassName(w)[0];"None"!==this.animationSettings.effect?new t.Animation({}).animate(n,{duration:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){n.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},n.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add("e-progress-active");for(var n,i=this.percent;i<100;i++)(i+=10)>100&&(i=100),this.enableProgress&&(this.getProgress().style[t?"height":"width"]=this.percent<100?i+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin(),n={step:this.step,currentDuration:this.progressTime,percent:100},clearTimeout(this.interval),this.trigger("end",n),this.progressTime=this.percent=0},n.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(w)[0],t=this.getSpinner();t.style.width=Math.max(t.offsetWidth,e.offsetWidth)+"px",t.style.height=Math.max(t.offsetHeight,e.offsetHeight)+"px",e.classList.add("e-cont-animate")},n.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(w)[0];if(this.element.classList.contains("e-hide-spinner")||i.hideSpinner(this.element),this.element.classList.remove("e-progress-active"),"None"!==this.animationSettings.effect&&e.classList.remove("e-animate-end"),"Center"===this.spinSettings.position){var t=this.getSpinner();e.classList.remove("e-cont-animate"),t.style.width="auto",t.style.height="auto"}},n.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(w)[0],t=this.element.getElementsByClassName("e-btn-icon")[0];!e.childNodes[0]||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?e.appendChild(t):e.insertBefore(t,e.childNodes[0])},n.prototype.setAria=function(){t.attributes(this.element,{"aria-label":this.element.textContent+" progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":"0"})},n.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler)},n.prototype.onPropertyChanged=function(n,i){var s=this.element;e.prototype.onPropertyChanged.call(this,n,i);for(var o=0,r=Object.keys(n);o<r.length;o++)switch(r[o]){case"content":if(t.isBlazor()){var a=this.element.querySelector(".e-btn-content");this.iconCss?"Left"===this.iconPosition||"Top"===this.iconPosition?a.childNodes[1].textContent=this.content:a.childNodes[0].textContent=this.content:a.textContent=this.content}else this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress();s.setAttribute("aria-label",s.textContent+" progress");break;case"iconCss":i.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":n.enableProgress?this.createProgress():t.remove(this.getProgress());break;case"spinSettings":n.spinSettings.position&&(s.classList.remove("e-spin-"+i.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(n.spinSettings.template||n.spinSettings.width)&&(s.removeChild(this.getSpinner()),this.createSpinner())}},n.prototype.focusIn=function(){this.element.focus()},E([t.Property(!1)],n.prototype,"enableProgress",void 0),E([t.Property(2e3)],n.prototype,"duration",void 0),E([t.Property("Left")],n.prototype,"iconPosition",void 0),E([t.Property("")],n.prototype,"iconCss",void 0),E([t.Property(!1)],n.prototype,"disabled",void 0),E([t.Property(!1)],n.prototype,"isPrimary",void 0),E([t.Property("")],n.prototype,"cssClass",void 0),E([t.Property("")],n.prototype,"content",void 0),E([t.Property(!1)],n.prototype,"isToggle",void 0),E([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),E([t.Complex({},O)],n.prototype,"spinSettings",void 0),E([t.Complex({},S)],n.prototype,"animationSettings",void 0),E([t.Event()],n.prototype,"created",void 0),E([t.Event()],n.prototype,"begin",void 0),E([t.Event()],n.prototype,"progress",void 0),E([t.Event()],n.prototype,"end",void 0),E([t.Event()],n.prototype,"fail",void 0),n=E([t.NotifyPropertyChanges],n)}(n.Button);return e.getModel=s,e.upDownKeyHandler=o,e.Item=c,e.DropDownButton=u,e.SplitButton=b,e.Deferred=C,e.createButtonGroup=a,e.SpinSettings=O,e.AnimationSettings=S,e.ProgressButton=k,e}({},ej.base,ej.buttons,ej.popups),this.ejs=ej; | ||
//# sourceMappingURL=ej2-splitbuttons.min.js.map |
/*! | ||
* filename: index.d.ts | ||
* version : 18.1.52 | ||
* version : 18.2.44 | ||
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved. | ||
@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license. |
@@ -5,3 +5,3 @@ { | ||
"_inBundle": false, | ||
"_integrity": "sha512-RuqNZSRPJzIaquNkwN8/G2PqIk5pEgDki325zXbqzIi1wQu54Qzb9FYxckqhaq0/A5PmVhz2HhctNLcyWzGyYw==", | ||
"_integrity": "sha512-iTIUjz1IYyA62oKG46sn84YP5kUQIYzfRXSBHvzpPi59hBcRatwGN+kt08Gs4hgJHNB0gofYGiW8m+V8AWdX9Q==", | ||
"_location": "/@syncfusion/ej2-splitbuttons", | ||
@@ -35,4 +35,4 @@ "_phantomChildren": {}, | ||
], | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-splitbuttons/-/ej2-splitbuttons-18.1.43.tgz", | ||
"_shasum": "2e61a46291b44c73a101dc9efdc9411f405df8c2", | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-splitbuttons/-/ej2-splitbuttons-18.1.43.tgz", | ||
"_shasum": "4d7ec5ac823e9c64dfe26a7c3aca20b309f93d36", | ||
"_spec": "@syncfusion/ej2-splitbuttons@*", | ||
@@ -48,4 +48,4 @@ "_where": "/jenkins/workspace/automation_release_18.1.0.1-52JLNOGRCDHXRVQM3W564VPLFCPHWUYDYU3I3DVRABSR7F6AIFYQ/packages/included", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~18.1.52", | ||
"@syncfusion/ej2-popups": "~18.1.52" | ||
"@syncfusion/ej2-base": "~18.2.44", | ||
"@syncfusion/ej2-popups": "~18.2.44" | ||
}, | ||
@@ -93,4 +93,4 @@ "deprecated": false, | ||
"typings": "index.d.ts", | ||
"version": "18.1.52", | ||
"version": "18.2.44", | ||
"sideEffects": false | ||
} |
@@ -1,2 +0,2 @@ | ||
import { ChildProperty, extend, deleteObject, Property, BaseEventArgs } from '@syncfusion/ej2-base'; | ||
import { ChildProperty, extend, deleteObject, Property, BaseEventArgs, addClass } from '@syncfusion/ej2-base'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -12,2 +12,4 @@ import { ChildProperty, BaseEventArgs } from '@syncfusion/ej2-base'; | ||
export declare function getModel(props: Object, model: string[]): Object; | ||
/** @hidden */ | ||
export declare function upDownKeyHandler(ul: HTMLElement, keyCode: number): void; | ||
/** | ||
@@ -14,0 +16,0 @@ * Defines the items of Split Button/DropDownButton. |
@@ -20,3 +20,3 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
import { ChildProperty, extend, deleteObject, Property } from '@syncfusion/ej2-base'; | ||
import { ChildProperty, extend, deleteObject, Property, addClass } from '@syncfusion/ej2-base'; | ||
/** | ||
@@ -36,2 +36,49 @@ * @param props | ||
} | ||
/** @hidden */ | ||
export function upDownKeyHandler(ul, keyCode) { | ||
var defaultIdx = keyCode === 40 ? 0 : ul.childElementCount - 1; | ||
var liIdx = defaultIdx; | ||
var li; | ||
var selectedLi = ul.querySelector('.e-selected'); | ||
if (selectedLi) { | ||
selectedLi.classList.remove('e-selected'); | ||
} | ||
for (var i = 0, len = ul.children.length; i < len; i++) { | ||
if (ul.children[i].classList.contains('e-focused')) { | ||
li = ul.children[i]; | ||
liIdx = i; | ||
li.classList.remove('e-focused'); | ||
keyCode === 40 ? liIdx++ : liIdx--; | ||
if (liIdx === (keyCode === 40 ? ul.childElementCount : -1)) { | ||
liIdx = defaultIdx; | ||
} | ||
} | ||
} | ||
li = ul.children[liIdx]; | ||
liIdx = isValidLI(ul, li, liIdx, keyCode); | ||
if (liIdx !== -1) { | ||
addClass([ul.children[liIdx]], 'e-focused'); | ||
ul.children[liIdx].focus(); | ||
} | ||
} | ||
function isValidLI(ul, li, index, keyCode, count) { | ||
if (count === void 0) { count = 0; } | ||
if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) { | ||
if (index === (keyCode === 40 ? ul.childElementCount - 1 : 0)) { | ||
index = keyCode === 40 ? 0 : ul.childElementCount - 1; | ||
} | ||
else { | ||
keyCode === 40 ? index++ : index--; | ||
} | ||
} | ||
li = ul.children[index]; | ||
if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) { | ||
count++; | ||
if (count === ul.childElementCount) { | ||
return index = -1; | ||
} | ||
index = isValidLI(ul, li, index, keyCode, count); | ||
} | ||
return index; | ||
} | ||
/** | ||
@@ -38,0 +85,0 @@ * Defines the items of Split Button/DropDownButton. |
@@ -1,2 +0,2 @@ | ||
import { Collection, Event, NotifyPropertyChanges, detach, Property, EventHandler, EmitType } from '@syncfusion/ej2-base';import { addClass, INotifyPropertyChanged, getUniqueID, rippleEffect } from '@syncfusion/ej2-base';import { attributes, Component, closest, select, KeyboardEventArgs, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { classList, remove, removeClass, isBlazor, Observer } from '@syncfusion/ej2-base';import { Button, buttonObserver } from '@syncfusion/ej2-buttons';import { Popup } from '@syncfusion/ej2-popups';import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs } from './../common/common';import { getModel, SplitButtonIconPosition, Item } from './../common/common';import { ItemModel } from './../common/common-model'; | ||
import { Collection, Event, NotifyPropertyChanges, detach, Property, EventHandler, EmitType } from '@syncfusion/ej2-base';import { addClass, INotifyPropertyChanged, getUniqueID, rippleEffect } from '@syncfusion/ej2-base';import { attributes, Component, closest, select, KeyboardEventArgs, SanitizeHtmlHelper } from '@syncfusion/ej2-base';import { classList, remove, removeClass } from '@syncfusion/ej2-base';import { Button } from '@syncfusion/ej2-buttons';import { Popup } from '@syncfusion/ej2-popups';import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs, upDownKeyHandler } from './../common/common';import { getModel, SplitButtonIconPosition, Item } from './../common/common';import { ItemModel } from './../common/common-model'; | ||
import {ComponentModel} from '@syncfusion/ej2-base'; | ||
@@ -64,3 +64,2 @@ | ||
* @event | ||
* @blazorProperty 'OnItemRender' | ||
*/ | ||
@@ -72,3 +71,2 @@ beforeItemRender?: EmitType<MenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'OnOpen' | ||
*/ | ||
@@ -80,3 +78,2 @@ beforeOpen?: EmitType<BeforeOpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'OnClose' | ||
*/ | ||
@@ -88,3 +85,2 @@ beforeClose?: EmitType<BeforeOpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Closed' | ||
*/ | ||
@@ -96,3 +92,2 @@ close?: EmitType<OpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Opened' | ||
*/ | ||
@@ -104,3 +99,2 @@ open?: EmitType<OpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'ItemSelected' | ||
*/ | ||
@@ -112,3 +106,2 @@ select?: EmitType<MenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Created' | ||
*/ | ||
@@ -115,0 +108,0 @@ created?: EmitType<Event>; |
import { EmitType } from '@syncfusion/ej2-base'; | ||
import { INotifyPropertyChanged } from '@syncfusion/ej2-base'; | ||
import { Component, KeyboardEventArgs } from '@syncfusion/ej2-base'; | ||
import { Observer } from '@syncfusion/ej2-base'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
@@ -11,3 +10,2 @@ import { Popup } from '@syncfusion/ej2-popups'; | ||
import { DropDownButtonModel } from './drop-down-button-model'; | ||
export declare const dropDownButtonObserver: Observer; | ||
/** | ||
@@ -81,3 +79,2 @@ * DropDownButton component is used to toggle contextual overlays for displaying list of action items. | ||
* @event | ||
* @blazorProperty 'OnItemRender' | ||
*/ | ||
@@ -88,3 +85,2 @@ beforeItemRender: EmitType<MenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'OnOpen' | ||
*/ | ||
@@ -95,3 +91,2 @@ beforeOpen: EmitType<BeforeOpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'OnClose' | ||
*/ | ||
@@ -102,3 +97,2 @@ beforeClose: EmitType<BeforeOpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Closed' | ||
*/ | ||
@@ -109,3 +103,2 @@ close: EmitType<OpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Opened' | ||
*/ | ||
@@ -116,3 +109,2 @@ open: EmitType<OpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'ItemSelected' | ||
*/ | ||
@@ -123,3 +115,2 @@ select: EmitType<MenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Created' | ||
*/ | ||
@@ -150,3 +141,2 @@ created: EmitType<Event>; | ||
render(): void; | ||
private buttonRendered; | ||
/** | ||
@@ -192,4 +182,2 @@ * Adds a new item to the menu. By default, new item appends to the list as the last item, | ||
protected upDownKeyHandler(e: KeyboardEventArgs): void; | ||
private removeCustomSelection; | ||
private isValidLI; | ||
private keyEventHandler; | ||
@@ -196,0 +184,0 @@ private getLI; |
@@ -23,7 +23,7 @@ var __extends = (this && this.__extends) || (function () { | ||
import { attributes, Component, closest, select, SanitizeHtmlHelper } from '@syncfusion/ej2-base'; | ||
import { classList, removeClass, isBlazor, Observer } from '@syncfusion/ej2-base'; | ||
import { Button, buttonObserver } from '@syncfusion/ej2-buttons'; | ||
import { classList, removeClass } from '@syncfusion/ej2-base'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
import { Popup } from '@syncfusion/ej2-popups'; | ||
import { upDownKeyHandler } from './../common/common'; | ||
import { getModel, Item } from './../common/common'; | ||
export var dropDownButtonObserver = new Observer(); | ||
var classNames = { | ||
@@ -85,10 +85,3 @@ DISABLED: 'e-disabled', | ||
DropDownButton.prototype.render = function () { | ||
if (isBlazor() && this.isServerRendered) { | ||
buttonObserver.on('component-rendered', this.buttonRendered, this, this.element.id); | ||
this.createPopup(); | ||
this.setActiveElem([this.element]); | ||
} | ||
else { | ||
this.initialize(); | ||
} | ||
this.initialize(); | ||
if (!this.disabled) { | ||
@@ -98,12 +91,3 @@ this.wireEvents(); | ||
this.renderComplete(); | ||
if (isBlazor() && this.isServerRendered) { | ||
dropDownButtonObserver.notify('component-rendered', { id: this.element.id, instance: this }); | ||
} | ||
}; | ||
DropDownButton.prototype.buttonRendered = function (args) { | ||
if (this.element.id === args.instance.element.id) { | ||
this.button = args.instance; | ||
buttonObserver.off('component-rendered', this.buttonRendered, this.element.id); | ||
} | ||
}; | ||
/** | ||
@@ -377,51 +361,4 @@ * Adds a new item to the menu. By default, new item appends to the list as the last item, | ||
e.preventDefault(); | ||
var ul = this.getULElement(); | ||
var defaultIdx = e.keyCode === 40 ? 0 : ul.childElementCount - 1; | ||
var liIdx = defaultIdx; | ||
var li = null; | ||
this.removeCustomSelection(); | ||
for (var i = 0, len = ul.children.length; i < len; i++) { | ||
if (ul.children[i].classList.contains(classNames.FOCUS)) { | ||
li = ul.children[i]; | ||
liIdx = i; | ||
li.classList.remove(classNames.FOCUS); | ||
e.keyCode === 40 ? liIdx++ : liIdx--; | ||
if (liIdx === (e.keyCode === 40 ? ul.childElementCount : -1)) { | ||
liIdx = defaultIdx; | ||
} | ||
} | ||
} | ||
li = ul.children[liIdx]; | ||
liIdx = this.isValidLI(li, liIdx, e.keyCode); | ||
if (liIdx !== -1) { | ||
addClass([ul.children[liIdx]], classNames.FOCUS); | ||
ul.children[liIdx].focus(); | ||
} | ||
upDownKeyHandler(this.getULElement(), e.keyCode); | ||
}; | ||
DropDownButton.prototype.removeCustomSelection = function () { | ||
var selectedLi = this.getULElement().querySelector('.e-selected'); | ||
if (selectedLi) { | ||
selectedLi.classList.remove('e-selected'); | ||
} | ||
}; | ||
DropDownButton.prototype.isValidLI = function (li, index, keyCode, count) { | ||
if (count === void 0) { count = 0; } | ||
if (li.classList.contains(classNames.SEPARATOR) || li.classList.contains(classNames.DISABLED)) { | ||
if (index === (keyCode === 40 ? this.items.length - 1 : 0)) { | ||
index = keyCode === 40 ? 0 : this.items.length - 1; | ||
} | ||
else { | ||
keyCode === 40 ? index++ : index--; | ||
} | ||
} | ||
li = this.getULElement().children[index]; | ||
if (li.classList.contains(classNames.SEPARATOR) || li.classList.contains(classNames.DISABLED)) { | ||
count++; | ||
if (count === this.items.length) { | ||
return index = -1; | ||
} | ||
index = this.isValidLI(li, index, keyCode, count); | ||
} | ||
return index; | ||
}; | ||
DropDownButton.prototype.keyEventHandler = function (e) { | ||
@@ -509,3 +446,6 @@ if (this.target && (e.keyCode === 13 || e.keyCode === 9)) { | ||
var ul_2 = _this.getULElement(); | ||
_this.removeCustomSelection(); | ||
var selectedLi = ul_2.querySelector('.e-selected'); | ||
if (selectedLi) { | ||
selectedLi.classList.remove('e-selected'); | ||
} | ||
_this.dropDown.hide(); | ||
@@ -512,0 +452,0 @@ removeClass(_this.activeElem, 'e-active'); |
@@ -1,2 +0,2 @@ | ||
import { Event, EmitType, remove, addClass, removeClass, detach, getValue, setValue } from '@syncfusion/ej2-base';import { EventHandler, Collection, BaseEventArgs, NotifyPropertyChanges, INotifyPropertyChanged, Property } from '@syncfusion/ej2-base';import { attributes, getUniqueID, getInstance, KeyboardEvents, KeyboardEventArgs, isBlazor } from '@syncfusion/ej2-base';import { Button, ButtonModel, buttonObserver } from '@syncfusion/ej2-buttons';import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs } from './../common/common';import { getModel, SplitButtonIconPosition, Item } from './../common/common';import { DropDownButton, dropDownButtonObserver } from '../drop-down-button/drop-down-button';import { ItemModel } from './../common/common-model'; | ||
import { Event, EmitType, remove, addClass, removeClass, detach, getValue, setValue } from '@syncfusion/ej2-base';import { EventHandler, Collection, BaseEventArgs, NotifyPropertyChanges, INotifyPropertyChanged, Property } from '@syncfusion/ej2-base';import { attributes, getUniqueID, getInstance, KeyboardEvents, KeyboardEventArgs } from '@syncfusion/ej2-base';import { Button, ButtonModel } from '@syncfusion/ej2-buttons';import { MenuEventArgs, BeforeOpenCloseMenuEventArgs, OpenCloseMenuEventArgs } from './../common/common';import { getModel, SplitButtonIconPosition, Item } from './../common/common';import { DropDownButton } from '../drop-down-button/drop-down-button';import { ItemModel } from './../common/common-model'; | ||
import {ClickEventArgs} from "./split-button"; | ||
@@ -59,3 +59,2 @@ import {DropDownButtonModel} from "../drop-down-button/drop-down-button-model"; | ||
* @event | ||
* @blazorProperty 'OnItemRender' | ||
*/ | ||
@@ -67,3 +66,2 @@ beforeItemRender?: EmitType<MenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'OnOpen' | ||
*/ | ||
@@ -75,3 +73,2 @@ beforeOpen?: EmitType<BeforeOpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'OnClose' | ||
*/ | ||
@@ -83,3 +80,2 @@ beforeClose?: EmitType<BeforeOpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Clicked' | ||
*/ | ||
@@ -91,3 +87,2 @@ click?: EmitType<ClickEventArgs>; | ||
* @event | ||
* @blazorProperty 'Closed' | ||
*/ | ||
@@ -99,3 +94,2 @@ close?: EmitType<OpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Opened' | ||
*/ | ||
@@ -107,3 +101,2 @@ open?: EmitType<OpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'ItemSelected' | ||
*/ | ||
@@ -115,3 +108,2 @@ select?: EmitType<MenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Created' | ||
*/ | ||
@@ -118,0 +110,0 @@ created?: EmitType<Event>; |
@@ -69,3 +69,2 @@ /// <reference path="../drop-down-button/drop-down-button-model.d.ts" /> | ||
* @event | ||
* @blazorProperty 'OnItemRender' | ||
*/ | ||
@@ -76,3 +75,2 @@ beforeItemRender: EmitType<MenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'OnOpen' | ||
*/ | ||
@@ -83,3 +81,2 @@ beforeOpen: EmitType<BeforeOpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'OnClose' | ||
*/ | ||
@@ -90,3 +87,2 @@ beforeClose: EmitType<BeforeOpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Clicked' | ||
*/ | ||
@@ -97,3 +93,2 @@ click: EmitType<ClickEventArgs>; | ||
* @event | ||
* @blazorProperty 'Closed' | ||
*/ | ||
@@ -104,3 +99,2 @@ close: EmitType<OpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Opened' | ||
*/ | ||
@@ -111,3 +105,2 @@ open: EmitType<OpenCloseMenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'ItemSelected' | ||
*/ | ||
@@ -118,3 +111,2 @@ select: EmitType<MenuEventArgs>; | ||
* @event | ||
* @blazorProperty 'Created' | ||
*/ | ||
@@ -139,4 +131,2 @@ created: EmitType<Event>; | ||
render(): void; | ||
private buttonInstance; | ||
private dropDownButtonInstance; | ||
private renderControl; | ||
@@ -143,0 +133,0 @@ /** |
@@ -23,6 +23,6 @@ var __extends = (this && this.__extends) || (function () { | ||
import { EventHandler, Collection, NotifyPropertyChanges, Property } from '@syncfusion/ej2-base'; | ||
import { attributes, getUniqueID, getInstance, KeyboardEvents, isBlazor } from '@syncfusion/ej2-base'; | ||
import { Button, buttonObserver } from '@syncfusion/ej2-buttons'; | ||
import { attributes, getUniqueID, getInstance, KeyboardEvents } from '@syncfusion/ej2-base'; | ||
import { Button } from '@syncfusion/ej2-buttons'; | ||
import { getModel, Item } from './../common/common'; | ||
import { DropDownButton, dropDownButtonObserver } from '../drop-down-button/drop-down-button'; | ||
import { DropDownButton } from '../drop-down-button/drop-down-button'; | ||
var RTL = 'e-rtl'; | ||
@@ -59,5 +59,2 @@ var TAGNAME = 'EJS-SPLITBUTTON'; | ||
SplitButton.prototype.preRender = function () { | ||
if (isBlazor() && this.isServerRendered) { | ||
return; | ||
} | ||
var ele = this.element; | ||
@@ -89,25 +86,6 @@ if (ele.tagName === TAGNAME) { | ||
SplitButton.prototype.render = function () { | ||
if (isBlazor() && this.isServerRendered) { | ||
buttonObserver.on('component-rendered', this.buttonInstance, this, this.element.id); | ||
dropDownButtonObserver.on('component-rendered', this.dropDownButtonInstance, this, this.element.id); | ||
} | ||
else { | ||
this.initWrapper(); | ||
this.createPrimaryButton(); | ||
this.renderControl(); | ||
} | ||
this.initWrapper(); | ||
this.createPrimaryButton(); | ||
this.renderControl(); | ||
}; | ||
SplitButton.prototype.buttonInstance = function (args) { | ||
if (this.element.id === args.instance.element.id) { | ||
this.primaryBtnObj = args.instance; | ||
buttonObserver.off('component-rendered', this.buttonInstance, this.element.id); | ||
} | ||
}; | ||
SplitButton.prototype.dropDownButtonInstance = function (args) { | ||
if (args.instance.element.id.indexOf(this.element.id) > -1) { | ||
this.secondaryBtnObj = args.instance; | ||
this.renderControl(); | ||
dropDownButtonObserver.off('component-rendered', this.dropDownButtonInstance, this.element.id); | ||
} | ||
}; | ||
SplitButton.prototype.renderControl = function () { | ||
@@ -173,21 +151,15 @@ this.createSecondaryButton(); | ||
var btnElem; | ||
if (isBlazor() && this.isServerRendered) { | ||
this.wrapper = this.element.parentElement; | ||
dropDownBtnModel = this.secondaryBtnObj; | ||
} | ||
else { | ||
btnElem = this.createElement('button', { | ||
className: 'e-icon-btn', | ||
attrs: { 'tabindex': '-1' }, | ||
id: this.element.id + '_dropdownbtn' | ||
}); | ||
this.wrapper.appendChild(btnElem); | ||
dropDownBtnModel = { | ||
cssClass: this.cssClass, | ||
disabled: this.disabled, | ||
enableRtl: this.enableRtl, | ||
items: this.items, | ||
target: this.target, | ||
}; | ||
} | ||
btnElem = this.createElement('button', { | ||
className: 'e-icon-btn', | ||
attrs: { 'tabindex': '-1' }, | ||
id: this.element.id + '_dropdownbtn' | ||
}); | ||
this.wrapper.appendChild(btnElem); | ||
dropDownBtnModel = { | ||
cssClass: this.cssClass, | ||
disabled: this.disabled, | ||
enableRtl: this.enableRtl, | ||
items: this.items, | ||
target: this.target, | ||
}; | ||
dropDownBtnModel.beforeItemRender = function (args) { | ||
@@ -219,7 +191,5 @@ _this.trigger('beforeItemRender', args); | ||
}; | ||
if (!(isBlazor() && this.isServerRendered)) { | ||
this.secondaryBtnObj = new DropDownButton(dropDownBtnModel); | ||
this.secondaryBtnObj.createElement = this.createElement; | ||
this.secondaryBtnObj.appendTo(btnElem); | ||
} | ||
this.secondaryBtnObj = new DropDownButton(dropDownBtnModel); | ||
this.secondaryBtnObj.createElement = this.createElement; | ||
this.secondaryBtnObj.appendTo(btnElem); | ||
this.secondaryBtnObj.dropDown.relateTo = this.wrapper; | ||
@@ -254,34 +224,29 @@ this.dropDown = this.secondaryBtnObj.dropDown; | ||
var _this = this; | ||
if (!(isBlazor() && this.isServerRendered)) { | ||
var classList = [RTL]; | ||
var element = document.getElementById(this.element.id); | ||
if (this.cssClass) { | ||
classList = classList.concat(this.cssClass.split(' ')); | ||
var classList = [RTL]; | ||
var element = document.getElementById(this.element.id); | ||
if (this.cssClass) { | ||
classList = classList.concat(this.cssClass.split(' ')); | ||
} | ||
if (element && element.parentElement === this.wrapper) { | ||
if (this.wrapper.tagName === TAGNAME) { | ||
this.wrapper.innerHTML = ''; | ||
removeClass([this.wrapper], ['e-rtl', 'e-' + this.getModuleName() + '-wrapper']); | ||
removeClass([this.wrapper], this.cssClass.split(' ')); | ||
} | ||
if (element && element.parentElement === this.wrapper) { | ||
if (this.wrapper.tagName === TAGNAME) { | ||
this.wrapper.innerHTML = ''; | ||
removeClass([this.wrapper], ['e-rtl', 'e-' + this.getModuleName() + '-wrapper']); | ||
removeClass([this.wrapper], this.cssClass.split(' ')); | ||
} | ||
else { | ||
removeClass([this.element], classList); | ||
['aria-label', 'aria-haspopup', 'aria-expanded', | ||
'aria-owns', 'type'].forEach(function (key) { | ||
_this.element.removeAttribute(key); | ||
}); | ||
this.wrapper.parentNode.insertBefore(this.element, this.wrapper); | ||
remove(this.wrapper); | ||
} | ||
this.unWireEvents(); | ||
else { | ||
removeClass([this.element], classList); | ||
['aria-label', 'aria-haspopup', 'aria-expanded', | ||
'aria-owns', 'type'].forEach(function (key) { | ||
_this.element.removeAttribute(key); | ||
}); | ||
this.wrapper.parentNode.insertBefore(this.element, this.wrapper); | ||
remove(this.wrapper); | ||
} | ||
this.primaryBtnObj.destroy(); | ||
this.secondaryBtnObj.destroy(); | ||
_super.prototype.destroy.call(this); | ||
if (!this.element.getAttribute('class')) { | ||
this.element.removeAttribute('class'); | ||
} | ||
this.unWireEvents(); | ||
} | ||
else { | ||
EventHandler.remove(this.element, 'click', this.primaryBtnClickHandler); | ||
this.primaryBtnObj.destroy(); | ||
this.secondaryBtnObj.destroy(); | ||
_super.prototype.destroy.call(this); | ||
if (!this.element.getAttribute('class')) { | ||
this.element.removeAttribute('class'); | ||
} | ||
@@ -288,0 +253,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39410
2059387
+ Added@syncfusion/ej2-base@18.2.59(transitive)
+ Added@syncfusion/ej2-buttons@18.2.58(transitive)
+ Added@syncfusion/ej2-icons@18.2.54(transitive)
+ Added@syncfusion/ej2-popups@18.2.58(transitive)
- Removed@syncfusion/ej2-base@18.1.57(transitive)
- Removed@syncfusion/ej2-buttons@18.1.56(transitive)
- Removed@syncfusion/ej2-icons@18.1.52(transitive)
- Removed@syncfusion/ej2-popups@18.1.57(transitive)