@syncfusion/ej2-splitbuttons 27.1.48 → 27.1.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-splitbuttons.min.js +2 -2
- package/dist/ej2-splitbuttons.umd.min.js +2 -2
- package/dist/ej2-splitbuttons.umd.min.js.map +1 -1
- package/dist/es6/ej2-splitbuttons.es2015.js +18 -3
- package/dist/es6/ej2-splitbuttons.es2015.js.map +1 -1
- package/dist/es6/ej2-splitbuttons.es5.js +18 -3
- package/dist/es6/ej2-splitbuttons.es5.js.map +1 -1
- package/dist/global/ej2-splitbuttons.min.js +2 -2
- package/dist/global/ej2-splitbuttons.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +7 -8
- package/src/drop-down-button/drop-down-button.js +17 -2
- package/styles/bootstrap-dark-lite.css +3 -0
- package/styles/bootstrap-dark.css +3 -0
- package/styles/bootstrap-lite.css +3 -0
- package/styles/bootstrap.css +3 -0
- package/styles/bootstrap4-lite.css +3 -0
- package/styles/bootstrap4.css +3 -0
- package/styles/bootstrap5-dark-lite.css +3 -0
- package/styles/bootstrap5-dark.css +3 -0
- package/styles/bootstrap5-lite.css +3 -0
- package/styles/bootstrap5.3-lite.css +3 -0
- package/styles/bootstrap5.3.css +3 -0
- package/styles/bootstrap5.css +3 -0
- package/styles/drop-down-button/_layout.scss +4 -0
- package/styles/drop-down-button/bootstrap-dark.css +3 -0
- package/styles/drop-down-button/bootstrap.css +3 -0
- package/styles/drop-down-button/bootstrap4.css +3 -0
- package/styles/drop-down-button/bootstrap5-dark.css +3 -0
- package/styles/drop-down-button/bootstrap5.3.css +3 -0
- package/styles/drop-down-button/bootstrap5.css +3 -0
- package/styles/drop-down-button/fabric-dark.css +3 -0
- package/styles/drop-down-button/fabric.css +3 -0
- package/styles/drop-down-button/fluent-dark.css +3 -0
- package/styles/drop-down-button/fluent.css +3 -0
- package/styles/drop-down-button/fluent2.css +3 -0
- package/styles/drop-down-button/highcontrast-light.css +3 -0
- package/styles/drop-down-button/highcontrast.css +3 -0
- package/styles/drop-down-button/material-dark.css +3 -0
- package/styles/drop-down-button/material.css +3 -0
- package/styles/drop-down-button/material3-dark.css +3 -0
- package/styles/drop-down-button/material3.css +3 -0
- package/styles/drop-down-button/tailwind-dark.css +3 -0
- package/styles/drop-down-button/tailwind.css +3 -0
- package/styles/fabric-dark-lite.css +3 -0
- package/styles/fabric-dark.css +3 -0
- package/styles/fabric-lite.css +3 -0
- package/styles/fabric.css +3 -0
- package/styles/fluent-dark-lite.css +3 -0
- package/styles/fluent-dark.css +3 -0
- package/styles/fluent-lite.css +3 -0
- package/styles/fluent.css +3 -0
- package/styles/fluent2-lite.css +3 -0
- package/styles/fluent2.css +3 -0
- package/styles/highcontrast-light-lite.css +3 -0
- package/styles/highcontrast-light.css +3 -0
- package/styles/highcontrast-lite.css +3 -0
- package/styles/highcontrast.css +3 -0
- package/styles/material-dark-lite.css +3 -0
- package/styles/material-dark.css +3 -0
- package/styles/material-lite.css +3 -0
- package/styles/material.css +3 -0
- package/styles/material3-dark-lite.css +3 -0
- package/styles/material3-dark.css +3 -0
- package/styles/material3-lite.css +3 -0
- package/styles/material3.css +3 -0
- package/styles/tailwind-dark-lite.css +3 -0
- package/styles/tailwind-dark.css +3 -0
- package/styles/tailwind-lite.css +3 -0
- package/styles/tailwind.css +3 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-splitbuttons.min.js
|
|
3
|
-
* version : 27.1.
|
|
3
|
+
* version : 27.1.56
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionButtons"),require("SyncfusionPopups")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionButtons","SyncfusionPopups"],t):"object"==typeof exports?exports.SyncfusionSplitbuttons=t(require("SyncfusionBase"),require("SyncfusionButtons"),require("SyncfusionPopups")):e.SyncfusionSplitbuttons=t(e.SyncfusionBase,e.SyncfusionButtons,e.SyncfusionPopups)}(self,((e,t,s)=>(()=>{"use strict";var i={766:t=>{t.exports=e},741:e=>{e.exports=t},197:e=>{e.exports=s}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return i[e](s,s.exports,o),s.exports}o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{AnimationSettings:()=>D,Deferred:()=>S,DropDownButton:()=>C,Item:()=>c,ProgressButton:()=>R,SpinSettings:()=>U,SplitButton:()=>O,createButtonGroup:()=>H,getModel:()=>n,setBlankIconStyle:()=>l,upDownKeyHandler:()=>a});var e,t=o(766),s=(e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},e(t,s)},function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}),i=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r};function n(e,s){for(var i=(0,t.extend)({},e),n=0,o=Object.keys(i);n<o.length;n++){var r=o[n];s.indexOf(r)<0&&(0,t.deleteObject)(i,r)}return i}function a(e,s){var i=40===s?0:e.childElementCount-1,n=i,o=e.querySelector(".e-selected");o&&o.classList.remove("e-selected");for(var r=0,a=e.children.length;r<a;r++)e.children[r].classList.contains("e-focused")&&(n=r,e.children[r].classList.remove("e-focused"),40===s?n++:n--,n===(40===s?e.childElementCount:-1)&&(n=i));-1!==(n=p(e,e.children[n],n,s))&&((0,t.addClass)([e.children[n]],"e-focused"),e.children[n].focus())}function p(e,t,s,i,n){if(void 0===n&&(n=0),(t.classList.contains("e-separator")||t.classList.contains("e-disabled"))&&(s===(40===i?e.childElementCount-1:0)?s=40===i?0:e.childElementCount-1:40===i?s++:s--),(t=e.children[s]).classList.contains("e-separator")||t.classList.contains("e-disabled")){if(++n===e.childElementCount)return-1;s=p(e,t,s,i,n)}return s}function l(e,s){var i=[].slice.call(e.getElementsByClassName("e-blank-icon"));s&&[].slice.call(e.getElementsByClassName("e-item")).forEach((function(e){(e.style.paddingLeft||e.style.paddingRight)&&e.removeAttribute("style")}));if(i.length){var n=e.querySelector(".e-item:not(.e-blank-icon):not(.e-separator)");if(!(0,t.isNullOrUndefined)(n)){n.classList.contains("e-url")&&(n=n.querySelector(".e-menu-url"));var o,r=n.querySelector(".e-menu-icon"),a=e.classList.contains("e-rtl");o=a?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var p=parseInt(getComputedStyle(r).fontSize,10)+parseInt(getComputedStyle(r)[o.margin],10)+parseInt(getComputedStyle(n).paddingLeft,10)+"px";i.forEach((function(e){e.classList.contains("e-url")?e.querySelector(".e-menu-url").style[o.padding]=p:e.style[o.padding]=p}))}}}var c=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),i([(0,t.Property)("")],n.prototype,"iconCss",void 0),i([(0,t.Property)("")],n.prototype,"id",void 0),i([(0,t.Property)(!1)],n.prototype,"separator",void 0),i([(0,t.Property)("")],n.prototype,"text",void 0),i([(0,t.Property)("")],n.prototype,"url",void 0),i([(0,t.Property)(!1)],n.prototype,"disabled",void 0),n}(t.ChildProperty),d=o(741),h=o(197),u=function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},e(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),m=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r},y="e-menu-icon",f="e-item",v="e-dropdown-popup",g="e-separator",b="e-vertical",C=function(e){function s(t,s){var i=e.call(this,t,s)||this;return i.isPopupCreated=!0,i}return u(s,e),s.prototype.preRender=function(){},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.createPopupOnClick&&!this.isPopupCreated?(this.createPopup(),this.openPopUp()):this.closePopup()},s.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},s.prototype.addItems=function(e,t){for(var s,i=this.items.length,n=0,o=this.items.length;n<o;n++)if(t===this.items[n].text){i=n;break}for(var r=e.length-1;r>=0;r--)s=new c(this,"items",e[r],!0),this.items.splice(i,0,s);this.canOpen()||this.createItems()},s.prototype.removeItems=function(e,t){for(var s=!1,i=0,n=e.length;i<n;i++)for(var o=0,r=this.items.length;o<r;o++)if(e[i]===(t?this.items[o].id:this.items[o].text)){this.items.splice(o,1),s=!0;break}s&&this.getULElement()&&this.createItems()},s.prototype.createPopup=function(){var e,s=this.createElement("div",{className:v,id:this.element.id+"-popup"});document.body.appendChild(s),this.dropDown=new h.Popup(s,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),this.dropDown.element.setAttribute("role","dialog"),this.dropDown.element.setAttribute("aria-label","dropdown menu"),(0,t.isNullOrUndefined)(this.popupContent)||(this.popupContent.style.display=""),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),(0,t.attributes)(this.element,((e={})["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e.type="button",e)),this.cssClass&&(0,t.addClass)([s],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPopupCreated=!0},s.prototype.getTargetElement=function(){return!this.createPopupOnClick||this.isColorPicker()||(0,t.isNullOrUndefined)(this.popupContent)?"string"==typeof this.target?(0,t.select)(this.target):this.target:this.popupContent},s.prototype.createItems=function(e){var s,i,n,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 c=0;c<r.length;c++){var d=(i=r[c]).text;n=this.createElement("li",{innerHTML:i.url?"":d,className:i.separator?f+" "+g:f,attrs:i.separator?{role:"separator",tabindex:"-1","aria-label":"separator","aria-hidden":"true"}:{role:"menuitem",tabindex:"-1","aria-label":d},id:i.id?i.id:(0,t.getUniqueID)("e-"+this.getModuleName()+"-item")}),this.enableHtmlSanitizer?n.textContent=i.url?"":d:n.innerHTML=i.url?"":d,i.url&&(n.appendChild(this.createAnchor(i)),n.classList.add("e-url")),i.iconCss?(s=this.createElement("span",{className:y+" "+i.iconCss}),i.url?n.childNodes[0].appendChild(s):n.insertBefore(s,n.childNodes[0])):a&&!i.separator&&n.classList.add("e-blank-icon");var h=i.disabled;i.disabled&&n.classList.add("e-disabled"),o={item:i,element:n},this.trigger("beforeItemRender",o),h!==o.item.disabled&&(o.item.disabled?n.classList.add("e-disabled"):n.classList.remove("e-disabled")),p.appendChild(n)}e&&this.getPopUpElement().appendChild(p),a&&l(this.getPopUpElement())},s.prototype.hasIcon=function(e,t){for(var s=0,i=e.length;s<i;s++)if(e[s][""+t])return!0;return!1},s.prototype.createAnchor=function(e){var s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:s,attrs:{href:e.url}})},s.prototype.initialize=function(){this.button=new d.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=(0,t.getUniqueID)("e-"+this.getModuleName())),this.appendArrowSpan(),this.setActiveElem([this.element]),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-label",this.element.textContent?this.element.textContent:"dropdownbutton"),this.target&&!this.isColorPicker()&&!this.createPopupOnClick||!this.createPopupOnClick?this.createPopup():(this.isPopupCreated=!1,this.target&&!this.isColorPicker()&&this.createPopupOnClick&&(this.popupContent=this.getTargetElement(),this.popupContent.style.display="none"))},s.prototype.isColorPicker=function(){if(!this.element)return!1;var e=this.element.previousSibling;return!!(e&&e.classList&&e.classList.contains("e-split-colorpicker"))},s.prototype.appendArrowSpan=function(){this.cssClass=(0,t.isNullOrUndefined)(this.cssClass)?"":this.cssClass,this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(b)>-1?"bottom":"right")+" e-caret"}))},s.prototype.setActiveElem=function(e){this.activeElem=e},s.prototype.getModuleName=function(){return"dropdown-btn"},s.prototype.canOpen=function(){var e=!1;return this.isPopupCreated&&(e=this.getPopUpElement().classList.contains("e-popup-close")),e},s.prototype.destroy=function(){var s,i=this;(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName())&&(this.element.querySelector("span.e-caret")&&(0,t.detach)(this.element.querySelector("span.e-caret")),this.cssClass&&(s=this.cssClass.split(" ")),this.button.destroy(),s&&(0,t.removeClass)([this.element],s),(0,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){i.element.removeAttribute(e)})),this.popupUnWireEvents(),this.destroyPopup(),this.isPopupCreated=!1,this.disabled||this.unWireEvents())},s.prototype.destroyPopup=function(){if(this.isPopupCreated){if(this.dropDown.destroy(),this.getPopUpElement()){var e=document.getElementById(this.getPopUpElement().id);e&&((0,t.removeClass)([e],["e-popup-open","e-popup-close"]),(0,t.detach)(e))}t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.isPopupCreated&&this.dropDown&&(this.dropDown.element=null,this.dropDown=void 0)}this.isPopupCreated=!1},s.prototype.getPopUpElement=function(){var e=null;if(!this.dropDown&&this.activeElem[0].classList.contains("e-split-btn")){var s=(0,t.getComponent)(this.activeElem[1],"dropdown-btn");s&&(this.dropDown=s.dropDown)}return this.dropDown&&(e=this.dropDown.element),e},s.prototype.getULElement=function(){var e=null;return this.getPopUpElement()&&(e=this.getPopUpElement().children[0]),e},s.prototype.wireEvents=function(){this.delegateMousedownHandler=this.mousedownHandler.bind(this),this.createPopupOnClick||t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this),t.EventHandler.add(window,"resize",this.windowResize,this)},s.prototype.windowResize=function(){!this.canOpen()&&this.dropDown&&this.dropDown.refreshPosition(this.element)},s.prototype.popupWireEvents=function(){this.delegateMousedownHandler||(this.delegateMousedownHandler=this.mousedownHandler.bind(this));var e=this.getPopUpElement();this.createPopupOnClick&&t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),e&&(t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.closeActionEvents&&t.EventHandler.add(e,this.closeActionEvents,this.focusoutHandler,this)),this.rippleFn=(0,t.rippleEffect)(e,{selector:"."+f})},s.prototype.popupUnWireEvents=function(){var e=this.getPopUpElement();this.createPopupOnClick&&t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),e&&e.parentElement&&(t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(e,"keydown",this.keyBoardHandler),this.closeActionEvents&&t.EventHandler.remove(e,this.closeActionEvents,this.focusoutHandler)),t.isRippleEnabled&&this.rippleFn&&this.rippleFn()},s.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)}},s.prototype.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},s.prototype.upDownKeyHandler=function(e){(!this.target||38!==e.keyCode&&40!==e.keyCode)&&(e.preventDefault(),a(this.getULElement(),e.keyCode))},s.prototype.keyEventHandler=function(e){if(!this.target||13!==e.keyCode&&9!==e.keyCode)return 13===e.keyCode&&this.activeElem[0].classList.contains("e-split-btn")?(this.triggerSelect(e),void this.activeElem[0].focus()):void(e.target&&e.target.className.indexOf("e-edit-template")>-1&&32===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)))},s.prototype.getLI=function(e){return"LI"===e.tagName?e:(0,t.closest)(e,"li")},s.prototype.mousedownHandler=function(e){var s=e.target;!this.dropDown||this.canOpen()||(0,t.closest)(s,'[id="'+this.getPopUpElement().id+'"]')||(0,t.closest)(s,'[id="'+this.element.id+'"]')||this.closePopup(e)},s.prototype.focusoutHandler=function(e){if(this.isPopupCreated&&!this.canOpen()){var t=e.relatedTarget||e.target;if(t&&t.className.indexOf("e-item")>-1){var s=this.getLI(t);if(s){var i=Array.prototype.indexOf.call(this.getULElement().children,s),n=this.items[i];if(n){var o={element:s,item:n,event:e};this.trigger("select",o)}}}this.closePopup(e)}},s.prototype.clickHandler=function(e){var s=e.target;(0,t.closest)(s,'[id="'+this.element.id+'"]')?!this.createPopupOnClick||this.target&&""!==this.target&&!this.isColorPicker()&&!this.createPopupOnClick?this.getPopUpElement().classList.contains("e-popup-close")?this.openPopUp(e):this.closePopup(e):this.isPopupCreated?this.closePopup(e,this.activeElem[0]):(this.createPopup(),this.openPopUp(e)):(0,t.closest)(s,'[id="'+this.getPopUpElement().id+'"]')&&this.getLI(e.target)&&(this.triggerSelect(e),this.closePopup(e,this.activeElem[0]))},s.prototype.triggerSelect=function(e){var t,s,i,n=this.getLI(e.target);n&&(s=Array.prototype.indexOf.call(this.getULElement().children,n),(i=this.items[s])&&(t={element:n,item:i,event:e},this.trigger("select",t)))},s.prototype.openPopUp=function(e){var s=this;void 0===e&&(e=null);var i=this.getPopUpElement();if(this.target)if(this.activeElem.length>1){var n=(0,t.getComponent)(this.activeElem[0],"split-btn");n.isReact&&i.childNodes.length<1&&(n.appendReactElement&&n.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates())}else this.isReact&&i.childNodes.length<1&&(this.appendReactElement&&this.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates());else this.createItems(!0);var o=this.getULElement();this.popupWireEvents();var r={element:o,items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",r,(function(e){if(!e.cancel){var i=s.getULElement();if(s.dropDown.show(null,s.element),(0,t.addClass)([s.element],"e-active"),s.element.setAttribute("aria-expanded","true"),s.element.setAttribute("aria-owns",s.getPopUpElement().id),i&&!s.isSafari()&&i.focus(),s.enableRtl&&"0px"!==i.parentElement.style.left){var n=void 0;n=s.element.parentElement&&s.element.parentElement.classList.contains("e-split-btn-wrapper")?s.element.parentElement.offsetWidth:s.element.offsetWidth;var o=i.parentElement.offsetWidth-n,r=parseFloat(i.parentElement.style.left)-o;r<0&&(r=0),i.parentElement.style.left=r+"px"}var a={element:i,items:s.items};s.trigger("open",a),i&&s.isSafari()&&i.focus()}}))},s.prototype.closePopup=function(e,s){var i=this;void 0===e&&(e=null);var n=this.getULElement(),o={element:n,items:this.items,event:e,cancel:!1};this.trigger("beforeClose",o,(function(e){if(e.cancel)n&&n.focus();else{var o=i.getPopUpElement();o&&t.EventHandler.remove(o,"keydown",i.keyBoardHandler),i.popupUnWireEvents();var r=i.getULElement(),a=void 0;r&&(a=r.querySelector(".e-selected")),a&&a.classList.remove("e-selected"),i.dropDown.hide(),(0,t.removeClass)(i.activeElem,"e-active"),i.element.setAttribute("aria-expanded","false"),i.element.removeAttribute("aria-owns"),s&&s.focus();var p={element:r,items:i.items};i.trigger("close",p),!i.target&&r&&(0,t.detach)(r),(!i.target||i.isColorPicker()||i.target&&!i.isColorPicker())&&i.createPopupOnClick&&i.destroyPopup()}}))},s.prototype.unWireEvents=function(){this.createPopupOnClick||t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),this.isPopupCreated&&(t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler)),t.EventHandler.remove(window,"resize",this.windowResize)},s.prototype.onPropertyChanged=function(e,s){var i;this.button.setProperties(n(e,["content","cssClass","iconCss","iconPosition","disabled","enableRtl"])),this.isPopupCreated&&(i=this.getPopUpElement(),this.dropDown.setProperties(n(e,["enableRtl"])));for(var 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.isPopupCreated&&!this.canOpen()&&this.closePopup()):this.wireEvents();break;case"cssClass":if(s.cssClass=(0,t.isNullOrUndefined)(s.cssClass)?"":s.cssClass,e.cssClass.indexOf(b)>-1||s.cssClass.indexOf(b)>-1){this.element.querySelector("span.e-caret")||this.appendArrowSpan();var a=this.element.querySelector("span.e-caret");e.cssClass.indexOf(b)>-1?(0,t.classList)(a,["e-icon-bottom"],["e-icon-right"]):(0,t.classList)(a,["e-icon-right"],["e-icon-bottom"])}this.isPopupCreated&&(s.cssClass&&(0,t.removeClass)([i],s.cssClass.split(" ")),e.cssClass&&(0,t.addClass)([i],e.cssClass.replace(/\s+/g," ").trim().split(" ")));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.isPopupCreated&&this.getULElement()&&this.createItems();break;case"createPopupOnClick":e.createPopupOnClick?this.destroyPopup():this.createPopup()}}},s.prototype.focusIn=function(){this.element.focus()},m([(0,t.Property)("")],s.prototype,"content",void 0),m([(0,t.Property)("")],s.prototype,"cssClass",void 0),m([(0,t.Property)(!1)],s.prototype,"disabled",void 0),m([(0,t.Property)("")],s.prototype,"iconCss",void 0),m([(0,t.Property)("Left")],s.prototype,"iconPosition",void 0),m([(0,t.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),m([(0,t.Collection)([],c)],s.prototype,"items",void 0),m([(0,t.Property)(!1)],s.prototype,"createPopupOnClick",void 0),m([(0,t.Property)("")],s.prototype,"target",void 0),m([(0,t.Property)("")],s.prototype,"closeActionEvents",void 0),m([(0,t.Event)()],s.prototype,"beforeItemRender",void 0),m([(0,t.Event)()],s.prototype,"beforeOpen",void 0),m([(0,t.Event)()],s.prototype,"beforeClose",void 0),m([(0,t.Event)()],s.prototype,"close",void 0),m([(0,t.Event)()],s.prototype,"open",void 0),m([(0,t.Event)()],s.prototype,"select",void 0),m([(0,t.Event)()],s.prototype,"created",void 0),s=m([t.NotifyPropertyChanges],s)}(t.Component),P=function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},e(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),E=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r},w="e-rtl",k="EJS-SPLITBUTTON",O=function(e){function s(t,s){return e.call(this,t,s)||this}return P(s,e),s.prototype.preRender=function(){var e=this.element;if(e.tagName===k){for(var s=(0,t.getValue)("ej2_instances",e),i=this.createElement("button",{attrs:{type:"button"}}),n=this.createElement(k,{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(n,e),(0,t.detach)(e),e=i,n.appendChild(e),(0,t.setValue)("ej2_instances",s,e),this.wrapper=n,this.element=e}this.element.id||(this.element.id=(0,t.getUniqueID)("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},s.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},s.prototype.addItems=function(t,s){e.prototype.addItems.call(this,t,s),this.secondaryBtnObj.items=this.items},s.prototype.removeItems=function(t,s){e.prototype.removeItems.call(this,t,s),this.secondaryBtnObj.items=this.items},s.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(w),this.cssClass&&(0,t.addClass)([this.wrapper],this.cssClass.replace(/\s+/g," ").trim().split(" "))},s.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 d.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)},s.prototype.createSecondaryButton=function(){var e=this,t=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"});this.wrapper.appendChild(t);var s={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target,createPopupOnClick:this.createPopupOnClick,beforeItemRender:function(t){e.createPopupOnClick&&(e.secondaryBtnObj.dropDown.relateTo=e.wrapper,e.dropDown=e.secondaryBtnObj.dropDown),e.trigger("beforeItemRender",t)},open:function(t){e.trigger("open",t)},close:function(t){e.trigger("close",t)},select:function(t){e.trigger("select",t)},beforeOpen:function(t){e.createPopupOnClick&&0===e.items.length&&(e.secondaryBtnObj.dropDown.relateTo=e.wrapper,e.dropDown=e.secondaryBtnObj.dropDown);var s=new S;return e.trigger("beforeOpen",t,(function(e){s.resolve(e)})),s},beforeClose:function(t){var s=new S;return e.trigger("beforeClose",t,(function(e){s.resolve(e)})),s}};this.secondaryBtnObj=new C(s),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(t),this.createPopupOnClick||(this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown),this.isPopupCreated=this.secondaryBtnObj.isPopupCreated,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right"),this.disabled&&this.wrapper.classList.add("e-splitbtn-disabled")},s.prototype.setAria=function(){(0,t.attributes)(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent?this.element.textContent+" splitbutton":"splitbutton","aria-owns":this.element.id+"_dropdownbtn-popup"})},s.prototype.getModuleName=function(){return"split-btn"},s.prototype.toggle=function(){this.secondaryBtnObj.toggle()},s.prototype.destroy=function(){var s=this,i=[w];if(this.cssClass&&(i=i.concat(this.cssClass.split(" "))),this.element){var n=document.getElementById(this.element.id);n&&n.parentElement===this.wrapper&&(this.wrapper.tagName===k?(this.wrapper.innerHTML="",(0,t.removeClass)([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),(0,t.removeClass)([this.wrapper],this.cssClass.split(" "))):((0,t.removeClass)([this.element],i),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach((function(e){s.element.removeAttribute(e)})),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),(0,t.remove)(this.wrapper)),this.unWireEvents())}this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element&&!this.element.getAttribute("class")&&this.element.removeAttribute("class"),this.refreshing&&this.isAngular&&(this.element=this.wrapper,["e-control","e-split-btn","e-lib"].forEach((function(e){s.element.classList.add(e)})),(0,t.setValue)("ej2_instances",[this],this.element)),this.wrapper=null},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),new t.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow",enter:"enter"}})},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),(0,t.getInstance)(this.element,t.KeyboardEvents).destroy()},s.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},s.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e);break;case"enter":this.clickHandler(e),this.getPopUpElement()&&!this.getPopUpElement().classList.contains("e-popup-close")?(this.element.classList.remove("e-active"),this.secondaryBtnObj.element.classList.add("e-active")):this.secondaryBtnObj.element.classList.remove("e-active")}},s.prototype.onPropertyChanged=function(e,s){var i=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(n(e,i)),i=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl","createPopupOnClick"],Object.keys(e).indexOf("items")>-1&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(n(e,i));for(var o=0,r=Object.keys(e);o<r.length;o++){switch(r[o]){case"cssClass":s.cssClass&&(0,t.removeClass)([this.wrapper],s.cssClass.split(" ")),(0,t.addClass)([this.wrapper],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?(0,t.addClass)([this.wrapper],w):(0,t.removeClass)([this.wrapper],w);break;case"disabled":e.disabled?(0,t.addClass)([this.wrapper],"e-splitbtn-disabled"):(0,t.removeClass)([this.wrapper],"e-splitbtn-disabled")}}},s.prototype.focusIn=function(){this.element.focus()},E([(0,t.Property)("")],s.prototype,"content",void 0),E([(0,t.Property)("")],s.prototype,"cssClass",void 0),E([(0,t.Property)(!1)],s.prototype,"disabled",void 0),E([(0,t.Property)("")],s.prototype,"iconCss",void 0),E([(0,t.Property)("Left")],s.prototype,"iconPosition",void 0),E([(0,t.Property)(!1)],s.prototype,"createPopupOnClick",void 0),E([(0,t.Collection)([],c)],s.prototype,"items",void 0),E([(0,t.Property)("")],s.prototype,"target",void 0),E([(0,t.Event)()],s.prototype,"beforeItemRender",void 0),E([(0,t.Event)()],s.prototype,"beforeOpen",void 0),E([(0,t.Event)()],s.prototype,"beforeClose",void 0),E([(0,t.Event)()],s.prototype,"click",void 0),E([(0,t.Event)()],s.prototype,"close",void 0),E([(0,t.Event)()],s.prototype,"open",void 0),E([(0,t.Event)()],s.prototype,"select",void 0),E([(0,t.Event)()],s.prototype,"created",void 0),s=E([t.NotifyPropertyChanges],s)}(C),S=function(){var e=this;this.promise=new Promise((function(t,s){e.resolve=t,e.reject=s})),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)};function H(e,s,i){var n,o,r,a;void 0===s&&(s={}),(0,t.isNullOrUndefined)(i)&&(i=t.createElement);var p=document.querySelector(e);(0,t.addClass)([p],["e-btn-group","e-css"]),p.setAttribute("role","group");var l=p.children;s.buttons=s.buttons||[];for(var c=0,h=0;h<l.length;c++,h++)n=l[h],null!==(a=s.buttons[c])&&("BUTTON"===n.tagName?o=n:(o=i("label"),(r=l[h+1])?p.insertBefore(o,r):p.appendChild(o),n.id&&o.setAttribute("for",n.id),a&&a.disabled&&(n.disabled=!0),h++),s.cssClass&&a&&!a.cssClass&&(a.cssClass=s.cssClass),new d.Button(a||{},o));return p}var L=function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},e(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),B=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r},j="e-hide-spinner",N="e-progress",A="e-progress-active",x="e-btn-content",U=function(e){function s(){return null!==e&&e.apply(this,arguments)||this}return L(s,e),B([(0,t.Property)(null)],s.prototype,"template",void 0),B([(0,t.Property)(16)],s.prototype,"width",void 0),B([(0,t.Property)("Left")],s.prototype,"position",void 0),s}(t.ChildProperty),D=function(e){function s(){return null!==e&&e.apply(this,arguments)||this}return L(s,e),B([(0,t.Property)(400)],s.prototype,"duration",void 0),B([(0,t.Property)("None")],s.prototype,"effect",void 0),B([(0,t.Property)("ease")],s.prototype,"easing",void 0),s}(t.ChildProperty),R=function(e){function s(t,s){var i=e.call(this,t,s)||this;return i.step=1,i}return L(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.render=function(){e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},s.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},s.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},s.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},s.prototype.getModuleName=function(){return"progress-btn"},s.prototype.destroy=function(){var s=this,i=[j,A,"e-round-corner","e-"+e.prototype.getModuleName.call(this)];this.spinSettings.position&&i.push("e-spin-"+this.spinSettings.position.toLowerCase()),e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(i=i.concat(this.cssClass.split(" "))),(0,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){s.element.removeAttribute(e)})),this.disabled&&this.element.removeAttribute("disabled")},s.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},s.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),(0,h.createSpinner)({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},s.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},s.prototype.getProgress=function(){return this.element.getElementsByClassName(N)[0]},s.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(x)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},s.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:N}))},s.prototype.setContent=function(){var e;e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:x,innerHTML:e}))},s.prototype.clickHandler=function(){this.element.classList.contains(A)||this.startProgress()},s.prototype.startProgress=function(e,t){var s=this.element.classList,i=s.contains("e-vertical");s.add(A),s.contains(j)||(0,h.showSpinner)(this.element.querySelector(".e-spinner")),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,i),this.startContAnimate()},s.prototype.startAnimate=function(e,t,s,i,n,o,r,a){var p=this;try{var l=e-s,c=this.duration*o/100,d=l?l<c?l-c:l%c:0;this.progressTime=t=t+l-d,s=e-d,i+=(l-d)/this.duration*100;var h={percent:n=(t-r)%c==0||100===i?i:n,currentDuration:t,step:o};this.eIsVertical=a,0===i?this.trigger("begin",h,(function(e){p.successCallback(e,i,n,t,r,d,s)})):100===i||t===this.duration?this.trigger("end",h,(function(e){p.successCallback(e,i,n,t,r,d,s)})):this.trigger("progress",h,(function(e){p.successCallback(e,i,n,t,r,d,s)}))}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},s.prototype.successCallback=function(e,t,s,i,n,o,r){var a=this,p=t,l=s,c=o,d=i,h=n,u=r,m=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(d-h)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame((function(){a.enableProgress&&a.getProgress()&&(a.getProgress().style[m?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())})),l=p,h=d),this.isPaused||(d<this.duration&&p<100?this.interval=window.setTimeout((function(){a.startAnimate(Date.now(),d,u,p,l,e.step,h,m)}),this.duration/100-c):this.interval=window.setTimeout((function(){a.progressTime=a.percent=0,a.enableProgress&&a.getProgress()&&(a.getProgress().style[m?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()}),100))},s.prototype.startContAnimate=function(){var e=this,s=this.element.getElementsByClassName(x)[0];"None"!==this.animationSettings.effect?new t.Animation({}).animate(s,{duration:0===this.animationSettings.duration&&"Enable"===t.animationMode?400:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){s.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},s.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add(A);for(var s=this.percent;s<100;s++)(s+=10)>100&&(s=100),this.enableProgress&&this.getProgress()&&(this.getProgress().style[t?"height":"width"]=this.percent<100?s+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin();var i={step:this.step,currentDuration:this.progressTime,percent:100};clearTimeout(this.interval),this.trigger("end",i),this.progressTime=this.percent=0},s.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(x)[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")},s.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(x)[0];if(this.element.classList.contains(j)||(0,h.hideSpinner)(this.element.querySelector(".e-spinner")),this.element.classList.remove(A),"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"}},s.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(x)[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])},s.prototype.setAria=function(){(0,t.attributes)(this.element,{"aria-label":this.element.textContent+" progress"})},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this)},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler)},s.prototype.onPropertyChanged=function(s,i){var n=this.element,o=!1;this.element.querySelector(".e-spinner-pane").classList.contains("e-spin-show")&&(o=!0),e.prototype.onPropertyChanged.call(this,s,i);for(var r=0,a=Object.keys(s);r<a.length;r++){switch(a[r]){case"content":this.setContent(),this.createSpinner(),o&&((0,h.showSpinner)(this.element.querySelector(".e-spinner")),o=!1),this.enableProgress&&this.createProgress(),n.setAttribute("aria-label",n.textContent+" progress");break;case"iconCss":i.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":s.enableProgress?this.createProgress():(0,t.remove)(this.getProgress());break;case"spinSettings":s.spinSettings.position&&(n.classList.remove("e-spin-"+i.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(s.spinSettings.template||s.spinSettings.width)&&(n.removeChild(this.getSpinner()),this.createSpinner())}}},s.prototype.focusIn=function(){this.element.focus()},B([(0,t.Property)(!1)],s.prototype,"enableProgress",void 0),B([(0,t.Property)(2e3)],s.prototype,"duration",void 0),B([(0,t.Property)("Left")],s.prototype,"iconPosition",void 0),B([(0,t.Property)("")],s.prototype,"iconCss",void 0),B([(0,t.Property)(!1)],s.prototype,"disabled",void 0),B([(0,t.Property)(!1)],s.prototype,"isPrimary",void 0),B([(0,t.Property)("")],s.prototype,"cssClass",void 0),B([(0,t.Property)("")],s.prototype,"content",void 0),B([(0,t.Property)(!1)],s.prototype,"isToggle",void 0),B([(0,t.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),B([(0,t.Complex)({},U)],s.prototype,"spinSettings",void 0),B([(0,t.Complex)({},D)],s.prototype,"animationSettings",void 0),B([(0,t.Event)()],s.prototype,"created",void 0),B([(0,t.Event)()],s.prototype,"begin",void 0),B([(0,t.Event)()],s.prototype,"progress",void 0),B([(0,t.Event)()],s.prototype,"end",void 0),B([(0,t.Event)()],s.prototype,"fail",void 0),s=B([t.NotifyPropertyChanges],s)}(d.Button)})(),r})()));
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionButtons"),require("SyncfusionPopups")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionButtons","SyncfusionPopups"],t):"object"==typeof exports?exports.SyncfusionSplitbuttons=t(require("SyncfusionBase"),require("SyncfusionButtons"),require("SyncfusionPopups")):e.SyncfusionSplitbuttons=t(e.SyncfusionBase,e.SyncfusionButtons,e.SyncfusionPopups)}(self,((e,t,s)=>(()=>{"use strict";var i={766:t=>{t.exports=e},741:e=>{e.exports=t},197:e=>{e.exports=s}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return i[e](s,s.exports,o),s.exports}o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{o.r(r),o.d(r,{AnimationSettings:()=>D,Deferred:()=>S,DropDownButton:()=>C,Item:()=>c,ProgressButton:()=>R,SpinSettings:()=>U,SplitButton:()=>O,createButtonGroup:()=>H,getModel:()=>n,setBlankIconStyle:()=>l,upDownKeyHandler:()=>a});var e,t=o(766),s=(e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},e(t,s)},function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}),i=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r};function n(e,s){for(var i=(0,t.extend)({},e),n=0,o=Object.keys(i);n<o.length;n++){var r=o[n];s.indexOf(r)<0&&(0,t.deleteObject)(i,r)}return i}function a(e,s){var i=40===s?0:e.childElementCount-1,n=i,o=e.querySelector(".e-selected");o&&o.classList.remove("e-selected");for(var r=0,a=e.children.length;r<a;r++)e.children[r].classList.contains("e-focused")&&(n=r,e.children[r].classList.remove("e-focused"),40===s?n++:n--,n===(40===s?e.childElementCount:-1)&&(n=i));-1!==(n=p(e,e.children[n],n,s))&&((0,t.addClass)([e.children[n]],"e-focused"),e.children[n].focus())}function p(e,t,s,i,n){if(void 0===n&&(n=0),(t.classList.contains("e-separator")||t.classList.contains("e-disabled"))&&(s===(40===i?e.childElementCount-1:0)?s=40===i?0:e.childElementCount-1:40===i?s++:s--),(t=e.children[s]).classList.contains("e-separator")||t.classList.contains("e-disabled")){if(++n===e.childElementCount)return-1;s=p(e,t,s,i,n)}return s}function l(e,s){var i=[].slice.call(e.getElementsByClassName("e-blank-icon"));s&&[].slice.call(e.getElementsByClassName("e-item")).forEach((function(e){(e.style.paddingLeft||e.style.paddingRight)&&e.removeAttribute("style")}));if(i.length){var n=e.querySelector(".e-item:not(.e-blank-icon):not(.e-separator)");if(!(0,t.isNullOrUndefined)(n)){n.classList.contains("e-url")&&(n=n.querySelector(".e-menu-url"));var o,r=n.querySelector(".e-menu-icon"),a=e.classList.contains("e-rtl");o=a?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var p=parseInt(getComputedStyle(r).fontSize,10)+parseInt(getComputedStyle(r)[o.margin],10)+parseInt(getComputedStyle(n).paddingLeft,10)+"px";i.forEach((function(e){e.classList.contains("e-url")?e.querySelector(".e-menu-url").style[o.padding]=p:e.style[o.padding]=p}))}}}var c=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),i([(0,t.Property)("")],n.prototype,"iconCss",void 0),i([(0,t.Property)("")],n.prototype,"id",void 0),i([(0,t.Property)(!1)],n.prototype,"separator",void 0),i([(0,t.Property)("")],n.prototype,"text",void 0),i([(0,t.Property)("")],n.prototype,"url",void 0),i([(0,t.Property)(!1)],n.prototype,"disabled",void 0),n}(t.ChildProperty),d=o(741),h=o(197),u=function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},e(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),m=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r},y="e-menu-icon",f="e-item",v="e-dropdown-popup",g="e-separator",b="e-vertical",C=function(e){function s(t,s){var i=e.call(this,t,s)||this;return i.isPopupCreated=!0,i}return u(s,e),s.prototype.preRender=function(){},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.createPopupOnClick&&!this.isPopupCreated?(this.createPopup(),this.openPopUp()):this.closePopup()},s.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},s.prototype.addItems=function(e,t){for(var s,i=this.items.length,n=0,o=this.items.length;n<o;n++)if(t===this.items[n].text){i=n;break}for(var r=e.length-1;r>=0;r--)s=new c(this,"items",e[r],!0),this.items.splice(i,0,s);this.canOpen()||this.createItems()},s.prototype.removeItems=function(e,t){for(var s=!1,i=0,n=e.length;i<n;i++)for(var o=0,r=this.items.length;o<r;o++)if(e[i]===(t?this.items[o].id:this.items[o].text)){this.items.splice(o,1),s=!0;break}s&&this.getULElement()&&this.createItems()},s.prototype.createPopup=function(){var e,s=this.createElement("div",{className:v,id:this.element.id+"-popup"});if(document.body.appendChild(s),this.dropDown=new h.Popup(s,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),this.dropDown.element.setAttribute("role","dialog"),this.dropDown.element.setAttribute("aria-label","dropdown menu"),(0,t.isNullOrUndefined)(this.popupContent)||(this.popupContent.style.display=""),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),(0,t.attributes)(this.element,((e={})["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e.type="button",e)),this.cssClass&&(0,t.addClass)([s],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPopupCreated=!0,this.createPopupOnClick){var i=(0,t.getComponent)(this.activeElem[0],"split-btn");i&&(i.isPopupCreated=!0)}},s.prototype.getTargetElement=function(){return!this.createPopupOnClick||this.isColorPicker()||(0,t.isNullOrUndefined)(this.popupContent)?"string"==typeof this.target?(0,t.select)(this.target):this.target:this.popupContent},s.prototype.createItems=function(e){var s,i,n,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 c=0;c<r.length;c++){var d=(i=r[c]).text;n=this.createElement("li",{innerHTML:i.url?"":d,className:i.separator?f+" "+g:f,attrs:i.separator?{role:"separator",tabindex:"-1","aria-label":"separator","aria-hidden":"true"}:{role:"menuitem",tabindex:"-1","aria-label":d},id:i.id?i.id:(0,t.getUniqueID)("e-"+this.getModuleName()+"-item")}),this.enableHtmlSanitizer?n.textContent=i.url?"":d:n.innerHTML=i.url?"":d,i.url&&(n.appendChild(this.createAnchor(i)),n.classList.add("e-url")),i.iconCss?(s=this.createElement("span",{className:y+" "+i.iconCss}),i.url?n.childNodes[0].appendChild(s):n.insertBefore(s,n.childNodes[0])):a&&!i.separator&&n.classList.add("e-blank-icon");var h=i.disabled;i.disabled&&n.classList.add("e-disabled"),o={item:i,element:n},this.trigger("beforeItemRender",o),h!==o.item.disabled&&(o.item.disabled?n.classList.add("e-disabled"):n.classList.remove("e-disabled")),p.appendChild(n)}e&&this.getPopUpElement().appendChild(p),a&&l(this.getPopUpElement())},s.prototype.hasIcon=function(e,t){for(var s=0,i=e.length;s<i;s++)if(e[s][""+t])return!0;return!1},s.prototype.createAnchor=function(e){var s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:s,attrs:{href:e.url}})},s.prototype.initialize=function(){this.button=new d.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=(0,t.getUniqueID)("e-"+this.getModuleName())),this.appendArrowSpan(),this.setActiveElem([this.element]),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-label",this.element.textContent?this.element.textContent:"dropdownbutton"),this.target&&!this.isColorPicker()&&!this.createPopupOnClick||!this.createPopupOnClick?this.createPopup():(this.isPopupCreated=!1,this.target&&!this.isColorPicker()&&this.createPopupOnClick&&(this.popupContent=this.getTargetElement(),this.popupContent.style.display="none"))},s.prototype.isColorPicker=function(){if(!this.element)return!1;var e=this.element.previousSibling;return!!(e&&e.classList&&e.classList.contains("e-split-colorpicker"))},s.prototype.appendArrowSpan=function(){this.cssClass=(0,t.isNullOrUndefined)(this.cssClass)?"":this.cssClass,this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(b)>-1?"bottom":"right")+" e-caret"}))},s.prototype.setActiveElem=function(e){this.activeElem=e},s.prototype.getModuleName=function(){return"dropdown-btn"},s.prototype.canOpen=function(){var e=!1;return this.isPopupCreated&&(e=this.getPopUpElement().classList.contains("e-popup-close")),e},s.prototype.destroy=function(){var s,i=this;(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName())&&(this.element.querySelector("span.e-caret")&&(0,t.detach)(this.element.querySelector("span.e-caret")),this.cssClass&&(s=this.cssClass.split(" ")),this.button.destroy(),s&&(0,t.removeClass)([this.element],s),(0,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){i.element.removeAttribute(e)})),this.popupUnWireEvents(),this.destroyPopup(),this.isPopupCreated=!1,this.disabled||this.unWireEvents())},s.prototype.destroyPopup=function(){if(this.isPopupCreated){if(this.dropDown.destroy(),this.getPopUpElement()){var e=document.getElementById(this.getPopUpElement().id);e&&((0,t.removeClass)([e],["e-popup-open","e-popup-close"]),(0,t.detach)(e))}t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.isPopupCreated&&this.dropDown&&(this.dropDown.element=null,this.dropDown=void 0)}this.isPopupCreated=!1;var s=(0,t.getComponent)(this.activeElem[0],"split-btn");if(this.createPopupOnClick&&s){var i=(0,t.getComponent)(this.activeElem[1],"dropdown-btn");i&&(i.isPopupCreated=!1)}},s.prototype.getPopUpElement=function(){var e=null;if(!this.dropDown&&this.activeElem[0].classList.contains("e-split-btn")){var s=(0,t.getComponent)(this.activeElem[1],"dropdown-btn");s&&(this.dropDown=s.dropDown)}return this.dropDown&&(e=this.dropDown.element),e},s.prototype.getULElement=function(){var e=null;return this.getPopUpElement()&&(e=this.getPopUpElement().children[0]),e},s.prototype.wireEvents=function(){this.delegateMousedownHandler=this.mousedownHandler.bind(this),this.createPopupOnClick||t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this),t.EventHandler.add(window,"resize",this.windowResize,this)},s.prototype.windowResize=function(){!this.canOpen()&&this.dropDown&&this.dropDown.refreshPosition(this.element)},s.prototype.popupWireEvents=function(){this.delegateMousedownHandler||(this.delegateMousedownHandler=this.mousedownHandler.bind(this));var e=this.getPopUpElement();this.createPopupOnClick&&t.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),e&&(t.EventHandler.add(e,"click",this.clickHandler,this),t.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.closeActionEvents&&t.EventHandler.add(e,this.closeActionEvents,this.focusoutHandler,this)),this.rippleFn=(0,t.rippleEffect)(e,{selector:"."+f})},s.prototype.popupUnWireEvents=function(){var e=this.getPopUpElement();this.createPopupOnClick&&t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),e&&e.parentElement&&(t.EventHandler.remove(e,"click",this.clickHandler),t.EventHandler.remove(e,"keydown",this.keyBoardHandler),this.closeActionEvents&&t.EventHandler.remove(e,this.closeActionEvents,this.focusoutHandler)),t.isRippleEnabled&&this.rippleFn&&this.rippleFn()},s.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)}},s.prototype.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},s.prototype.upDownKeyHandler=function(e){(!this.target||38!==e.keyCode&&40!==e.keyCode)&&(e.preventDefault(),a(this.getULElement(),e.keyCode))},s.prototype.keyEventHandler=function(e){if(!this.target||13!==e.keyCode&&9!==e.keyCode)return 13===e.keyCode&&this.activeElem[0].classList.contains("e-split-btn")?(this.triggerSelect(e),void this.activeElem[0].focus()):void(e.target&&e.target.className.indexOf("e-edit-template")>-1&&32===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)))},s.prototype.getLI=function(e){return"LI"===e.tagName?e:(0,t.closest)(e,"li")},s.prototype.mousedownHandler=function(e){var s=e.target;!this.dropDown||this.canOpen()||!this.getPopUpElement()||(0,t.closest)(s,'[id="'+this.getPopUpElement().id+'"]')||(0,t.closest)(s,'[id="'+this.element.id+'"]')||this.closePopup(e)},s.prototype.focusoutHandler=function(e){if(this.isPopupCreated&&!this.canOpen()){var t=e.relatedTarget||e.target;if(t&&t.className.indexOf("e-item")>-1){var s=this.getLI(t);if(s){var i=Array.prototype.indexOf.call(this.getULElement().children,s),n=this.items[i];if(n){var o={element:s,item:n,event:e};this.trigger("select",o)}}}this.closePopup(e)}},s.prototype.clickHandler=function(e){var s=e.target;(0,t.closest)(s,'[id="'+this.element.id+'"]')?!this.createPopupOnClick||this.target&&""!==this.target&&!this.isColorPicker()&&!this.createPopupOnClick?this.getPopUpElement().classList.contains("e-popup-close")?this.openPopUp(e):this.closePopup(e):this.isPopupCreated?this.closePopup(e,this.activeElem[0]):(this.createPopup(),this.openPopUp(e)):(0,t.closest)(s,'[id="'+this.getPopUpElement().id+'"]')&&this.getLI(e.target)&&(this.triggerSelect(e),this.closePopup(e,this.activeElem[0]))},s.prototype.triggerSelect=function(e){var t,s,i,n=this.getLI(e.target);n&&(s=Array.prototype.indexOf.call(this.getULElement().children,n),(i=this.items[s])&&(t={element:n,item:i,event:e},this.trigger("select",t)))},s.prototype.openPopUp=function(e){var s=this;void 0===e&&(e=null);var i=this.getPopUpElement();if(this.target)if(this.activeElem.length>1){var n=(0,t.getComponent)(this.activeElem[0],"split-btn");n.isReact&&i.childNodes.length<1&&(n.appendReactElement&&n.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates())}else this.isReact&&i.childNodes.length<1&&(this.appendReactElement&&this.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates());else this.createItems(!0);var o=this.getULElement();this.popupWireEvents();var r={element:o,items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",r,(function(e){if(!e.cancel){var i=s.getULElement();if(s.dropDown.show(null,s.element),(0,t.addClass)([s.element],"e-active"),s.element.setAttribute("aria-expanded","true"),s.element.setAttribute("aria-owns",s.getPopUpElement().id),i&&!s.isSafari()&&i.focus(),s.enableRtl&&"0px"!==i.parentElement.style.left){var n=void 0;n=s.element.parentElement&&s.element.parentElement.classList.contains("e-split-btn-wrapper")?s.element.parentElement.offsetWidth:s.element.offsetWidth;var o=i.parentElement.offsetWidth-n,r=parseFloat(i.parentElement.style.left)-o;r<0&&(r=0),i.parentElement.style.left=r+"px"}var a={element:i,items:s.items};s.trigger("open",a),i&&s.isSafari()&&i.focus()}}))},s.prototype.closePopup=function(e,s){var i=this;void 0===e&&(e=null);var n=this.getULElement(),o={element:n,items:this.items,event:e,cancel:!1};this.trigger("beforeClose",o,(function(e){if(e.cancel)n&&n.focus();else{var o=i.getPopUpElement();o&&t.EventHandler.remove(o,"keydown",i.keyBoardHandler),i.popupUnWireEvents();var r=i.getULElement(),a=void 0;r&&(a=r.querySelector(".e-selected")),a&&a.classList.remove("e-selected"),i.dropDown&&i.dropDown.hide(),(0,t.removeClass)(i.activeElem,"e-active"),i.element.setAttribute("aria-expanded","false"),i.element.removeAttribute("aria-owns"),s&&s.focus();var p={element:r,items:i.items};i.trigger("close",p),!i.target&&r&&(0,t.detach)(r),(!i.target||i.isColorPicker()||i.target&&!i.isColorPicker())&&i.createPopupOnClick&&i.destroyPopup()}}))},s.prototype.unWireEvents=function(){this.createPopupOnClick||t.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),this.isPopupCreated&&(t.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),t.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler)),t.EventHandler.remove(window,"resize",this.windowResize)},s.prototype.onPropertyChanged=function(e,s){var i;this.button.setProperties(n(e,["content","cssClass","iconCss","iconPosition","disabled","enableRtl"])),this.isPopupCreated&&(i=this.getPopUpElement(),this.dropDown.setProperties(n(e,["enableRtl"])));for(var 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.isPopupCreated&&!this.canOpen()&&this.closePopup()):this.wireEvents();break;case"cssClass":if(s.cssClass=(0,t.isNullOrUndefined)(s.cssClass)?"":s.cssClass,e.cssClass.indexOf(b)>-1||s.cssClass.indexOf(b)>-1){this.element.querySelector("span.e-caret")||this.appendArrowSpan();var a=this.element.querySelector("span.e-caret");e.cssClass.indexOf(b)>-1?(0,t.classList)(a,["e-icon-bottom"],["e-icon-right"]):(0,t.classList)(a,["e-icon-right"],["e-icon-bottom"])}this.isPopupCreated&&(s.cssClass&&(0,t.removeClass)([i],s.cssClass.split(" ")),e.cssClass&&(0,t.addClass)([i],e.cssClass.replace(/\s+/g," ").trim().split(" ")));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.isPopupCreated&&this.getULElement()&&this.createItems();break;case"createPopupOnClick":e.createPopupOnClick?this.destroyPopup():this.createPopup()}}},s.prototype.focusIn=function(){this.element.focus()},m([(0,t.Property)("")],s.prototype,"content",void 0),m([(0,t.Property)("")],s.prototype,"cssClass",void 0),m([(0,t.Property)(!1)],s.prototype,"disabled",void 0),m([(0,t.Property)("")],s.prototype,"iconCss",void 0),m([(0,t.Property)("Left")],s.prototype,"iconPosition",void 0),m([(0,t.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),m([(0,t.Collection)([],c)],s.prototype,"items",void 0),m([(0,t.Property)(!1)],s.prototype,"createPopupOnClick",void 0),m([(0,t.Property)("")],s.prototype,"target",void 0),m([(0,t.Property)("")],s.prototype,"closeActionEvents",void 0),m([(0,t.Event)()],s.prototype,"beforeItemRender",void 0),m([(0,t.Event)()],s.prototype,"beforeOpen",void 0),m([(0,t.Event)()],s.prototype,"beforeClose",void 0),m([(0,t.Event)()],s.prototype,"close",void 0),m([(0,t.Event)()],s.prototype,"open",void 0),m([(0,t.Event)()],s.prototype,"select",void 0),m([(0,t.Event)()],s.prototype,"created",void 0),s=m([t.NotifyPropertyChanges],s)}(t.Component),P=function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},e(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),E=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r},w="e-rtl",k="EJS-SPLITBUTTON",O=function(e){function s(t,s){return e.call(this,t,s)||this}return P(s,e),s.prototype.preRender=function(){var e=this.element;if(e.tagName===k){for(var s=(0,t.getValue)("ej2_instances",e),i=this.createElement("button",{attrs:{type:"button"}}),n=this.createElement(k,{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(n,e),(0,t.detach)(e),e=i,n.appendChild(e),(0,t.setValue)("ej2_instances",s,e),this.wrapper=n,this.element=e}this.element.id||(this.element.id=(0,t.getUniqueID)("e-"+this.getModuleName()))},s.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},s.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},s.prototype.addItems=function(t,s){e.prototype.addItems.call(this,t,s),this.secondaryBtnObj.items=this.items},s.prototype.removeItems=function(t,s){e.prototype.removeItems.call(this,t,s),this.secondaryBtnObj.items=this.items},s.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(w),this.cssClass&&(0,t.addClass)([this.wrapper],this.cssClass.replace(/\s+/g," ").trim().split(" "))},s.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 d.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)},s.prototype.createSecondaryButton=function(){var e=this,t=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"});this.wrapper.appendChild(t);var s={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target,createPopupOnClick:this.createPopupOnClick,beforeItemRender:function(t){e.createPopupOnClick&&(e.secondaryBtnObj.dropDown.relateTo=e.wrapper,e.dropDown=e.secondaryBtnObj.dropDown),e.trigger("beforeItemRender",t)},open:function(t){e.trigger("open",t)},close:function(t){e.trigger("close",t)},select:function(t){e.trigger("select",t)},beforeOpen:function(t){e.createPopupOnClick&&0===e.items.length&&(e.secondaryBtnObj.dropDown.relateTo=e.wrapper,e.dropDown=e.secondaryBtnObj.dropDown);var s=new S;return e.trigger("beforeOpen",t,(function(e){s.resolve(e)})),s},beforeClose:function(t){var s=new S;return e.trigger("beforeClose",t,(function(e){s.resolve(e)})),s}};this.secondaryBtnObj=new C(s),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(t),this.createPopupOnClick||(this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown),this.isPopupCreated=this.secondaryBtnObj.isPopupCreated,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right"),this.disabled&&this.wrapper.classList.add("e-splitbtn-disabled")},s.prototype.setAria=function(){(0,t.attributes)(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent?this.element.textContent+" splitbutton":"splitbutton","aria-owns":this.element.id+"_dropdownbtn-popup"})},s.prototype.getModuleName=function(){return"split-btn"},s.prototype.toggle=function(){this.secondaryBtnObj.toggle()},s.prototype.destroy=function(){var s=this,i=[w];if(this.cssClass&&(i=i.concat(this.cssClass.split(" "))),this.element){var n=document.getElementById(this.element.id);n&&n.parentElement===this.wrapper&&(this.wrapper.tagName===k?(this.wrapper.innerHTML="",(0,t.removeClass)([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),(0,t.removeClass)([this.wrapper],this.cssClass.split(" "))):((0,t.removeClass)([this.element],i),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach((function(e){s.element.removeAttribute(e)})),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),(0,t.remove)(this.wrapper)),this.unWireEvents())}this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element&&!this.element.getAttribute("class")&&this.element.removeAttribute("class"),this.refreshing&&this.isAngular&&(this.element=this.wrapper,["e-control","e-split-btn","e-lib"].forEach((function(e){s.element.classList.add(e)})),(0,t.setValue)("ej2_instances",[this],this.element)),this.wrapper=null},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),new t.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow",enter:"enter"}})},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),(0,t.getInstance)(this.element,t.KeyboardEvents).destroy()},s.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},s.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e);break;case"enter":this.clickHandler(e),this.getPopUpElement()&&!this.getPopUpElement().classList.contains("e-popup-close")?(this.element.classList.remove("e-active"),this.secondaryBtnObj.element.classList.add("e-active")):this.secondaryBtnObj.element.classList.remove("e-active")}},s.prototype.onPropertyChanged=function(e,s){var i=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(n(e,i)),i=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl","createPopupOnClick"],Object.keys(e).indexOf("items")>-1&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(n(e,i));for(var o=0,r=Object.keys(e);o<r.length;o++){switch(r[o]){case"cssClass":s.cssClass&&(0,t.removeClass)([this.wrapper],s.cssClass.split(" ")),(0,t.addClass)([this.wrapper],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?(0,t.addClass)([this.wrapper],w):(0,t.removeClass)([this.wrapper],w);break;case"disabled":e.disabled?(0,t.addClass)([this.wrapper],"e-splitbtn-disabled"):(0,t.removeClass)([this.wrapper],"e-splitbtn-disabled")}}},s.prototype.focusIn=function(){this.element.focus()},E([(0,t.Property)("")],s.prototype,"content",void 0),E([(0,t.Property)("")],s.prototype,"cssClass",void 0),E([(0,t.Property)(!1)],s.prototype,"disabled",void 0),E([(0,t.Property)("")],s.prototype,"iconCss",void 0),E([(0,t.Property)("Left")],s.prototype,"iconPosition",void 0),E([(0,t.Property)(!1)],s.prototype,"createPopupOnClick",void 0),E([(0,t.Collection)([],c)],s.prototype,"items",void 0),E([(0,t.Property)("")],s.prototype,"target",void 0),E([(0,t.Event)()],s.prototype,"beforeItemRender",void 0),E([(0,t.Event)()],s.prototype,"beforeOpen",void 0),E([(0,t.Event)()],s.prototype,"beforeClose",void 0),E([(0,t.Event)()],s.prototype,"click",void 0),E([(0,t.Event)()],s.prototype,"close",void 0),E([(0,t.Event)()],s.prototype,"open",void 0),E([(0,t.Event)()],s.prototype,"select",void 0),E([(0,t.Event)()],s.prototype,"created",void 0),s=E([t.NotifyPropertyChanges],s)}(C),S=function(){var e=this;this.promise=new Promise((function(t,s){e.resolve=t,e.reject=s})),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)};function H(e,s,i){var n,o,r,a;void 0===s&&(s={}),(0,t.isNullOrUndefined)(i)&&(i=t.createElement);var p=document.querySelector(e);(0,t.addClass)([p],["e-btn-group","e-css"]),p.setAttribute("role","group");var l=p.children;s.buttons=s.buttons||[];for(var c=0,h=0;h<l.length;c++,h++)n=l[h],null!==(a=s.buttons[c])&&("BUTTON"===n.tagName?o=n:(o=i("label"),(r=l[h+1])?p.insertBefore(o,r):p.appendChild(o),n.id&&o.setAttribute("for",n.id),a&&a.disabled&&(n.disabled=!0),h++),s.cssClass&&a&&!a.cssClass&&(a.cssClass=s.cssClass),new d.Button(a||{},o));return p}var L=function(){var e=function(t,s){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])},e(t,s)};return function(t,s){function i(){this.constructor=t}e(t,s),t.prototype=null===s?Object.create(s):(i.prototype=s.prototype,new i)}}(),B=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r},j="e-hide-spinner",N="e-progress",A="e-progress-active",x="e-btn-content",U=function(e){function s(){return null!==e&&e.apply(this,arguments)||this}return L(s,e),B([(0,t.Property)(null)],s.prototype,"template",void 0),B([(0,t.Property)(16)],s.prototype,"width",void 0),B([(0,t.Property)("Left")],s.prototype,"position",void 0),s}(t.ChildProperty),D=function(e){function s(){return null!==e&&e.apply(this,arguments)||this}return L(s,e),B([(0,t.Property)(400)],s.prototype,"duration",void 0),B([(0,t.Property)("None")],s.prototype,"effect",void 0),B([(0,t.Property)("ease")],s.prototype,"easing",void 0),s}(t.ChildProperty),R=function(e){function s(t,s){var i=e.call(this,t,s)||this;return i.step=1,i}return L(s,e),s.prototype.preRender=function(){e.prototype.preRender.call(this)},s.prototype.render=function(){e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},s.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},s.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},s.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},s.prototype.getModuleName=function(){return"progress-btn"},s.prototype.destroy=function(){var s=this,i=[j,A,"e-round-corner","e-"+e.prototype.getModuleName.call(this)];this.spinSettings.position&&i.push("e-spin-"+this.spinSettings.position.toLowerCase()),e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(i=i.concat(this.cssClass.split(" "))),(0,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){s.element.removeAttribute(e)})),this.disabled&&this.element.removeAttribute("disabled")},s.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},s.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),(0,h.createSpinner)({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},s.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},s.prototype.getProgress=function(){return this.element.getElementsByClassName(N)[0]},s.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(x)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},s.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:N}))},s.prototype.setContent=function(){var e;e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:x,innerHTML:e}))},s.prototype.clickHandler=function(){this.element.classList.contains(A)||this.startProgress()},s.prototype.startProgress=function(e,t){var s=this.element.classList,i=s.contains("e-vertical");s.add(A),s.contains(j)||(0,h.showSpinner)(this.element.querySelector(".e-spinner")),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,i),this.startContAnimate()},s.prototype.startAnimate=function(e,t,s,i,n,o,r,a){var p=this;try{var l=e-s,c=this.duration*o/100,d=l?l<c?l-c:l%c:0;this.progressTime=t=t+l-d,s=e-d,i+=(l-d)/this.duration*100;var h={percent:n=(t-r)%c==0||100===i?i:n,currentDuration:t,step:o};this.eIsVertical=a,0===i?this.trigger("begin",h,(function(e){p.successCallback(e,i,n,t,r,d,s)})):100===i||t===this.duration?this.trigger("end",h,(function(e){p.successCallback(e,i,n,t,r,d,s)})):this.trigger("progress",h,(function(e){p.successCallback(e,i,n,t,r,d,s)}))}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},s.prototype.successCallback=function(e,t,s,i,n,o,r){var a=this,p=t,l=s,c=o,d=i,h=n,u=r,m=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(d-h)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame((function(){a.enableProgress&&a.getProgress()&&(a.getProgress().style[m?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())})),l=p,h=d),this.isPaused||(d<this.duration&&p<100?this.interval=window.setTimeout((function(){a.startAnimate(Date.now(),d,u,p,l,e.step,h,m)}),this.duration/100-c):this.interval=window.setTimeout((function(){a.progressTime=a.percent=0,a.enableProgress&&a.getProgress()&&(a.getProgress().style[m?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()}),100))},s.prototype.startContAnimate=function(){var e=this,s=this.element.getElementsByClassName(x)[0];"None"!==this.animationSettings.effect?new t.Animation({}).animate(s,{duration:0===this.animationSettings.duration&&"Enable"===t.animationMode?400:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){s.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},s.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add(A);for(var s=this.percent;s<100;s++)(s+=10)>100&&(s=100),this.enableProgress&&this.getProgress()&&(this.getProgress().style[t?"height":"width"]=this.percent<100?s+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin();var i={step:this.step,currentDuration:this.progressTime,percent:100};clearTimeout(this.interval),this.trigger("end",i),this.progressTime=this.percent=0},s.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(x)[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")},s.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(x)[0];if(this.element.classList.contains(j)||(0,h.hideSpinner)(this.element.querySelector(".e-spinner")),this.element.classList.remove(A),"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"}},s.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(x)[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])},s.prototype.setAria=function(){(0,t.attributes)(this.element,{"aria-label":this.element.textContent+" progress"})},s.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this)},s.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler)},s.prototype.onPropertyChanged=function(s,i){var n=this.element,o=!1;this.element.querySelector(".e-spinner-pane").classList.contains("e-spin-show")&&(o=!0),e.prototype.onPropertyChanged.call(this,s,i);for(var r=0,a=Object.keys(s);r<a.length;r++){switch(a[r]){case"content":this.setContent(),this.createSpinner(),o&&((0,h.showSpinner)(this.element.querySelector(".e-spinner")),o=!1),this.enableProgress&&this.createProgress(),n.setAttribute("aria-label",n.textContent+" progress");break;case"iconCss":i.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":s.enableProgress?this.createProgress():(0,t.remove)(this.getProgress());break;case"spinSettings":s.spinSettings.position&&(n.classList.remove("e-spin-"+i.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(s.spinSettings.template||s.spinSettings.width)&&(n.removeChild(this.getSpinner()),this.createSpinner())}}},s.prototype.focusIn=function(){this.element.focus()},B([(0,t.Property)(!1)],s.prototype,"enableProgress",void 0),B([(0,t.Property)(2e3)],s.prototype,"duration",void 0),B([(0,t.Property)("Left")],s.prototype,"iconPosition",void 0),B([(0,t.Property)("")],s.prototype,"iconCss",void 0),B([(0,t.Property)(!1)],s.prototype,"disabled",void 0),B([(0,t.Property)(!1)],s.prototype,"isPrimary",void 0),B([(0,t.Property)("")],s.prototype,"cssClass",void 0),B([(0,t.Property)("")],s.prototype,"content",void 0),B([(0,t.Property)(!1)],s.prototype,"isToggle",void 0),B([(0,t.Property)(!0)],s.prototype,"enableHtmlSanitizer",void 0),B([(0,t.Complex)({},U)],s.prototype,"spinSettings",void 0),B([(0,t.Complex)({},D)],s.prototype,"animationSettings",void 0),B([(0,t.Event)()],s.prototype,"created",void 0),B([(0,t.Event)()],s.prototype,"begin",void 0),B([(0,t.Event)()],s.prototype,"progress",void 0),B([(0,t.Event)()],s.prototype,"end",void 0),B([(0,t.Event)()],s.prototype,"fail",void 0),s=B([t.NotifyPropertyChanges],s)}(d.Button)})(),r})()));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-splitbuttons.umd.min.js
|
|
3
|
-
* version : 27.1.
|
|
3
|
+
* version : 27.1.56
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!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=e||self).ej={},e.ej2Base,e.ej2Buttons,e.ej2Popups)}(this,function(e,h,d,r){"use strict";i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])}))(e,t)};var i,t=function(e,t){function s(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)},s=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(r=(o<3?n(r):3<o?n(t,s,r):n(t,s))||r);return 3<o&&r&&Object.defineProperty(t,s,r),r};function a(e,t){for(var s=h.extend({},e),i=0,n=Object.keys(s);i<n.length;i++){var o=n[i];t.indexOf(o)<0&&h.deleteObject(s,o)}return s}function n(e,t){var s=40===t?0:e.childElementCount-1,i=s,n=e.querySelector(".e-selected");n&&n.classList.remove("e-selected");for(var o=0,r=e.children.length;o<r;o++)e.children[o].classList.contains("e-focused")&&(i=o,e.children[o].classList.remove("e-focused"),40===t?i++:i--,i===(40===t?e.childElementCount:-1))&&(i=s);-1!==(i=function e(t,s,i,n,o){void 0===o&&(o=0);(s.classList.contains("e-separator")||s.classList.contains("e-disabled"))&&(i===(40===n?t.childElementCount-1:0)?i=40===n?0:t.childElementCount-1:40===n?i++:i--);s=t.children[i];if(s.classList.contains("e-separator")||s.classList.contains("e-disabled")){if(++o===t.childElementCount)return i=-1;i=e(t,s,i,n,o)}return i}(e,e.children[i],i,t))&&(h.addClass([e.children[i]],"e-focused"),e.children[i].focus())}function p(e,t){var s,i,n,o=[].slice.call(e.getElementsByClassName("e-blank-icon"));t&&[].slice.call(e.getElementsByClassName("e-item")).forEach(function(e){(e.style.paddingLeft||e.style.paddingRight)&&e.removeAttribute("style")}),o.length&&(t=e.querySelector(".e-item:not(.e-blank-icon):not(.e-separator)"),h.isNullOrUndefined(t)||(s=(t=t.classList.contains("e-url")?t.querySelector(".e-menu-url"):t).querySelector(".e-menu-icon"),e=e.classList.contains("e-rtl"),i=e?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},n=parseInt(getComputedStyle(s).fontSize,10)+parseInt(getComputedStyle(s)[i.margin],10)+parseInt(getComputedStyle(t).paddingLeft,10)+"px",o.forEach(function(e){e.classList.contains("e-url")?e.querySelector(".e-menu-url").style[i.padding]=n:e.style[i.padding]=n})))}o=h.ChildProperty,t(c,o),s([h.Property("")],c.prototype,"iconCss",void 0),s([h.Property("")],c.prototype,"id",void 0),s([h.Property(!1)],c.prototype,"separator",void 0),s([h.Property("")],c.prototype,"text",void 0),s([h.Property("")],c.prototype,"url",void 0),s([h.Property(!1)],c.prototype,"disabled",void 0);var o,l=c;function c(){return null!==o&&o.apply(this,arguments)||this}u=function(e,t){return(u=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])}))(e,t)};var u,m,t=function(e,t){function s(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)},s=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(r=(o<3?n(r):3<o?n(t,s,r):n(t,s))||r);return 3<o&&r&&Object.defineProperty(t,s,r),r},x="e-menu-icon",y="e-item",I="e-dropdown-popup",T="e-separator",f="e-vertical",g=(m=h.Component,t(v,m),v.prototype.preRender=function(){},v.prototype.getPersistData=function(){return this.addOnPersist([])},v.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.createPopupOnClick&&!this.isPopupCreated?(this.createPopup(),this.openPopUp()):this.closePopup()},v.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},v.prototype.addItems=function(e,t){for(var s,i=this.items.length,n=0,o=this.items.length;n<o;n++)if(t===this.items[n].text){i=n;break}for(var r=e.length-1;0<=r;r--)s=new l(this,"items",e[r],!0),this.items.splice(i,0,s);this.canOpen()||this.createItems()},v.prototype.removeItems=function(e,t){for(var s=!1,i=0,n=e.length;i<n;i++)for(var o=0,r=this.items.length;o<r;o++)if(e[i]===(t?this.items[o].id:this.items[o].text)){this.items.splice(o,1),s=!0;break}s&&this.getULElement()&&this.createItems()},v.prototype.createPopup=function(){var e,t=this.createElement("div",{className:I,id:this.element.id+"-popup"});document.body.appendChild(t),this.dropDown=new r.Popup(t,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),this.dropDown.element.setAttribute("role","dialog"),this.dropDown.element.setAttribute("aria-label","dropdown menu"),h.isNullOrUndefined(this.popupContent)||(this.popupContent.style.display=""),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),h.attributes(this.element,((e={})["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e.type="button",e)),this.cssClass&&h.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPopupCreated=!0},v.prototype.getTargetElement=function(){return!this.createPopupOnClick||this.isColorPicker()||h.isNullOrUndefined(this.popupContent)?"string"==typeof this.target?h.select(this.target):this.target:this.popupContent},v.prototype.createItems=function(e){var t=this.items,s=this.hasIcon(this.items,"iconCss"),i=this.getULElement();i?i.innerHTML="":i=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var n=0;n<t.length;n++){var o,r=(o=t[n]).text,a=this.createElement("li",{innerHTML:o.url?"":r,className:o.separator?y+" "+T:y,attrs:o.separator?{role:"separator",tabindex:"-1","aria-label":"separator","aria-hidden":"true"}:{role:"menuitem",tabindex:"-1","aria-label":r},id:o.id||h.getUniqueID("e-"+this.getModuleName()+"-item")}),r=(this.enableHtmlSanitizer?a.textContent=o.url?"":r:a.innerHTML=o.url?"":r,o.url&&(a.appendChild(this.createAnchor(o)),a.classList.add("e-url")),o.iconCss?(r=this.createElement("span",{className:x+" "+o.iconCss}),o.url?a.childNodes[0].appendChild(r):a.insertBefore(r,a.childNodes[0])):s&&!o.separator&&a.classList.add("e-blank-icon"),o.disabled);o.disabled&&a.classList.add("e-disabled"),this.trigger("beforeItemRender",o={item:o,element:a}),r!==o.item.disabled&&(o.item.disabled?a.classList.add("e-disabled"):a.classList.remove("e-disabled")),i.appendChild(a)}e&&this.getPopUpElement().appendChild(i),s&&p(this.getPopUpElement())},v.prototype.hasIcon=function(e,t){for(var s=0,i=e.length;s<i;s++)if(e[s][""+t])return!0;return!1},v.prototype.createAnchor=function(e){var t=this.enableHtmlSanitizer?h.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:t,attrs:{href:e.url}})},v.prototype.initialize=function(){this.button=new d.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=h.getUniqueID("e-"+this.getModuleName())),this.appendArrowSpan(),this.setActiveElem([this.element]),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-label",this.element.textContent||"dropdownbutton"),this.target&&!this.isColorPicker()&&!this.createPopupOnClick||!this.createPopupOnClick?this.createPopup():(this.isPopupCreated=!1,this.target&&!this.isColorPicker()&&this.createPopupOnClick&&(this.popupContent=this.getTargetElement(),this.popupContent.style.display="none"))},v.prototype.isColorPicker=function(){var e;return!!this.element&&!!((e=this.element.previousSibling)&&e.classList&&e.classList.contains("e-split-colorpicker"))},v.prototype.appendArrowSpan=function(){this.cssClass=h.isNullOrUndefined(this.cssClass)?"":this.cssClass,this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(-1<this.cssClass.indexOf(f)?"bottom":"right")+" e-caret"}))},v.prototype.setActiveElem=function(e){this.activeElem=e},v.prototype.getModuleName=function(){return"dropdown-btn"},v.prototype.canOpen=function(){var e=!1;return e=this.isPopupCreated?this.getPopUpElement().classList.contains("e-popup-close"):e},v.prototype.destroy=function(){var e,t=this;m.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()&&(this.element.querySelector("span.e-caret")&&h.detach(this.element.querySelector("span.e-caret")),this.cssClass&&(e=this.cssClass.split(" ")),this.button.destroy(),e&&h.removeClass([this.element],e),h.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){t.element.removeAttribute(e)}),this.popupUnWireEvents(),this.destroyPopup(),this.isPopupCreated=!1,this.disabled||this.unWireEvents())},v.prototype.destroyPopup=function(){var e;this.isPopupCreated&&(this.dropDown.destroy(),this.getPopUpElement()&&(e=document.getElementById(this.getPopUpElement().id))&&(h.removeClass([e],["e-popup-open","e-popup-close"]),h.detach(e)),h.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),h.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.isPopupCreated)&&this.dropDown&&(this.dropDown.element=null,this.dropDown=void 0),this.isPopupCreated=!1},v.prototype.getPopUpElement=function(){var e,t=null;return!this.dropDown&&this.activeElem[0].classList.contains("e-split-btn")&&(e=h.getComponent(this.activeElem[1],"dropdown-btn"))&&(this.dropDown=e.dropDown),t=this.dropDown?this.dropDown.element:t},v.prototype.getULElement=function(){var e=null;return e=this.getPopUpElement()?this.getPopUpElement().children[0]:e},v.prototype.wireEvents=function(){this.delegateMousedownHandler=this.mousedownHandler.bind(this),this.createPopupOnClick||h.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),h.EventHandler.add(this.element,"click",this.clickHandler,this),h.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this),h.EventHandler.add(window,"resize",this.windowResize,this)},v.prototype.windowResize=function(){!this.canOpen()&&this.dropDown&&this.dropDown.refreshPosition(this.element)},v.prototype.popupWireEvents=function(){this.delegateMousedownHandler||(this.delegateMousedownHandler=this.mousedownHandler.bind(this));var e=this.getPopUpElement();this.createPopupOnClick&&h.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),e&&(h.EventHandler.add(e,"click",this.clickHandler,this),h.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.closeActionEvents)&&h.EventHandler.add(e,this.closeActionEvents,this.focusoutHandler,this),this.rippleFn=h.rippleEffect(e,{selector:"."+y})},v.prototype.popupUnWireEvents=function(){var e=this.getPopUpElement();this.createPopupOnClick&&h.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),e&&e.parentElement&&(h.EventHandler.remove(e,"click",this.clickHandler),h.EventHandler.remove(e,"keydown",this.keyBoardHandler),this.closeActionEvents)&&h.EventHandler.remove(e,this.closeActionEvents,this.focusoutHandler),h.isRippleEnabled&&this.rippleFn&&this.rippleFn()},v.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)}},v.prototype.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},v.prototype.upDownKeyHandler=function(e){this.target&&(38===e.keyCode||40===e.keyCode)||(e.preventDefault(),n(this.getULElement(),e.keyCode))},v.prototype.keyEventHandler=function(e){this.target&&(13===e.keyCode||9===e.keyCode)||(13===e.keyCode&&this.activeElem[0].classList.contains("e-split-btn")?(this.triggerSelect(e),this.activeElem[0].focus()):e.target&&-1<e.target.className.indexOf("e-edit-template")&&32===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)))},v.prototype.getLI=function(e){return"LI"===e.tagName?e:h.closest(e,"li")},v.prototype.mousedownHandler=function(e){var t=e.target;!this.dropDown||this.canOpen()||h.closest(t,'[id="'+this.getPopUpElement().id+'"]')||h.closest(t,'[id="'+this.element.id+'"]')||this.closePopup(e)},v.prototype.focusoutHandler=function(e){var t,s;this.isPopupCreated&&!this.canOpen()&&((t=e.relatedTarget||e.target)&&-1<t.className.indexOf("e-item")&&(t=this.getLI(t))&&(s=Array.prototype.indexOf.call(this.getULElement().children,t),s=this.items[s])&&this.trigger("select",{element:t,item:s,event:e}),this.closePopup(e))},v.prototype.clickHandler=function(e){var t=e.target;h.closest(t,'[id="'+this.element.id+'"]')?!this.createPopupOnClick||this.target&&""!==this.target&&!this.isColorPicker()&&!this.createPopupOnClick?this.getPopUpElement().classList.contains("e-popup-close")?this.openPopUp(e):this.closePopup(e):this.isPopupCreated?this.closePopup(e,this.activeElem[0]):(this.createPopup(),this.openPopUp(e)):h.closest(t,'[id="'+this.getPopUpElement().id+'"]')&&this.getLI(e.target)&&(this.triggerSelect(e),this.closePopup(e,this.activeElem[0]))},v.prototype.triggerSelect=function(e){var t,s=this.getLI(e.target);s&&(t=Array.prototype.indexOf.call(this.getULElement().children,s),t=this.items[t])&&this.trigger("select",{element:s,item:t,event:e})},v.prototype.openPopUp=function(e){var s=this,t=(void 0===e&&(e=null),this.getPopUpElement()),i=(this.target?1<this.activeElem.length?(i=h.getComponent(this.activeElem[0],"split-btn")).isReact&&t.childNodes.length<1&&(i.appendReactElement&&i.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates()):this.isReact&&t.childNodes.length<1&&(this.appendReactElement&&this.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates()):this.createItems(!0),this.getULElement()),t=(this.popupWireEvents(),{element:i,items:this.items,event:e,cancel:!1});this.trigger("beforeOpen",t,function(e){var t;e.cancel||(e=s.getULElement(),s.dropDown.show(null,s.element),h.addClass([s.element],"e-active"),s.element.setAttribute("aria-expanded","true"),s.element.setAttribute("aria-owns",s.getPopUpElement().id),e&&!s.isSafari()&&e.focus(),s.enableRtl&&"0px"!==e.parentElement.style.left&&(t=void 0,t=(s.element.parentElement&&s.element.parentElement.classList.contains("e-split-btn-wrapper")?s.element.parentElement:s.element).offsetWidth,t=e.parentElement.offsetWidth-t,t=parseFloat(e.parentElement.style.left)-t,e.parentElement.style.left=(t=t<0?0:t)+"px"),t={element:e,items:s.items},s.trigger("open",t),e&&s.isSafari()&&e.focus())})},v.prototype.closePopup=function(e,s){var i=this,n=(void 0===e&&(e=null),this.getULElement()),e={element:n,items:this.items,event:e,cancel:!1};this.trigger("beforeClose",e,function(e){var t;e.cancel?n&&n.focus():((e=i.getPopUpElement())&&h.EventHandler.remove(e,"keydown",i.keyBoardHandler),i.popupUnWireEvents(),e=void 0,(e=(t=i.getULElement())?t.querySelector(".e-selected"):e)&&e.classList.remove("e-selected"),i.dropDown.hide(),h.removeClass(i.activeElem,"e-active"),i.element.setAttribute("aria-expanded","false"),i.element.removeAttribute("aria-owns"),s&&s.focus(),e={element:t,items:i.items},i.trigger("close",e),!i.target&&t&&h.detach(t),(!i.target||i.isColorPicker()||i.target&&!i.isColorPicker())&&i.createPopupOnClick&&i.destroyPopup())})},v.prototype.unWireEvents=function(){this.createPopupOnClick||h.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),h.EventHandler.remove(this.element,"click",this.clickHandler),h.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),this.isPopupCreated&&(h.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),h.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler)),h.EventHandler.remove(window,"resize",this.windowResize)},v.prototype.onPropertyChanged=function(e,t){var s;this.button.setProperties(a(e,["content","cssClass","iconCss","iconPosition","disabled","enableRtl"])),this.isPopupCreated&&(s=this.getPopUpElement(),this.dropDown.setProperties(a(e,["enableRtl"])));for(var i,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"content":this.element.querySelector("span.e-caret")||this.appendArrowSpan();break;case"disabled":e.disabled?(this.unWireEvents(),this.isPopupCreated&&!this.canOpen()&&this.closePopup()):this.wireEvents();break;case"cssClass":t.cssClass=h.isNullOrUndefined(t.cssClass)?"":t.cssClass,(-1<e.cssClass.indexOf(f)||-1<t.cssClass.indexOf(f))&&(this.element.querySelector("span.e-caret")||this.appendArrowSpan(),i=this.element.querySelector("span.e-caret"),-1<e.cssClass.indexOf(f)?h.classList(i,["e-icon-bottom"],["e-icon-right"]):h.classList(i,["e-icon-right"],["e-icon-bottom"])),this.isPopupCreated&&(t.cssClass&&h.removeClass([s],t.cssClass.split(" ")),e.cssClass)&&h.addClass([s],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.isPopupCreated&&this.getULElement()&&this.createItems();break;case"createPopupOnClick":e.createPopupOnClick?this.destroyPopup():this.createPopup()}},v.prototype.focusIn=function(){this.element.focus()},s([h.Property("")],v.prototype,"content",void 0),s([h.Property("")],v.prototype,"cssClass",void 0),s([h.Property(!1)],v.prototype,"disabled",void 0),s([h.Property("")],v.prototype,"iconCss",void 0),s([h.Property("Left")],v.prototype,"iconPosition",void 0),s([h.Property(!0)],v.prototype,"enableHtmlSanitizer",void 0),s([h.Collection([],l)],v.prototype,"items",void 0),s([h.Property(!1)],v.prototype,"createPopupOnClick",void 0),s([h.Property("")],v.prototype,"target",void 0),s([h.Property("")],v.prototype,"closeActionEvents",void 0),s([h.Event()],v.prototype,"beforeItemRender",void 0),s([h.Event()],v.prototype,"beforeOpen",void 0),s([h.Event()],v.prototype,"beforeClose",void 0),s([h.Event()],v.prototype,"close",void 0),s([h.Event()],v.prototype,"open",void 0),s([h.Event()],v.prototype,"select",void 0),s([h.Event()],v.prototype,"created",void 0),s([h.NotifyPropertyChanges],v));function v(e,t){e=m.call(this,e,t)||this;return e.isPopupCreated=!0,e}b=function(e,t){return(b=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])}))(e,t)};var b,C,t=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(r=(o<3?n(r):3<o?n(t,s,r):n(t,s))||r);return 3<o&&r&&Object.defineProperty(t,s,r),r},P="e-rtl",E="EJS-SPLITBUTTON",s=(function(e,t){function s(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}(w,C=g),w.prototype.preRender=function(){var e=this.element;if(e.tagName===E){for(var t=h.getValue("ej2_instances",e),s=this.createElement("button",{attrs:{type:"button"}}),i=this.createElement(E,{className:"e-"+this.getModuleName()+"-wrapper"}),n=0,o=e.attributes.length;n<o;n++)s.setAttribute(e.attributes[n].nodeName,e.attributes[n].nodeValue);e.parentNode.insertBefore(i,e),h.detach(e),i.appendChild(e=s),h.setValue("ej2_instances",t,e),this.wrapper=i,this.element=e}this.element.id||(this.element.id=h.getUniqueID("e-"+this.getModuleName()))},w.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},w.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},w.prototype.addItems=function(e,t){C.prototype.addItems.call(this,e,t),this.secondaryBtnObj.items=this.items},w.prototype.removeItems=function(e,t){C.prototype.removeItems.call(this,e,t),this.secondaryBtnObj.items=this.items},w.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(P),this.cssClass&&h.addClass([this.wrapper],this.cssClass.replace(/\s+/g," ").trim().split(" "))},w.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 d.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)},w.prototype.createSecondaryButton=function(){var s=this,e=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"}),t=(this.wrapper.appendChild(e),{cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target,createPopupOnClick:this.createPopupOnClick});t.beforeItemRender=function(e){s.createPopupOnClick&&(s.secondaryBtnObj.dropDown.relateTo=s.wrapper,s.dropDown=s.secondaryBtnObj.dropDown),s.trigger("beforeItemRender",e)},t.open=function(e){s.trigger("open",e)},t.close=function(e){s.trigger("close",e)},t.select=function(e){s.trigger("select",e)},t.beforeOpen=function(e){s.createPopupOnClick&&0===s.items.length&&(s.secondaryBtnObj.dropDown.relateTo=s.wrapper,s.dropDown=s.secondaryBtnObj.dropDown);var t=new k;return s.trigger("beforeOpen",e,function(e){t.resolve(e)}),t},t.beforeClose=function(e){var t=new k;return s.trigger("beforeClose",e,function(e){t.resolve(e)}),t},this.secondaryBtnObj=new g(t),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(e),this.createPopupOnClick||(this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown),this.isPopupCreated=this.secondaryBtnObj.isPopupCreated,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right"),this.disabled&&this.wrapper.classList.add("e-splitbtn-disabled")},w.prototype.setAria=function(){h.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent?this.element.textContent+" splitbutton":"splitbutton","aria-owns":this.element.id+"_dropdownbtn-popup"})},w.prototype.getModuleName=function(){return"split-btn"},w.prototype.toggle=function(){this.secondaryBtnObj.toggle()},w.prototype.destroy=function(){var e,t=this,s=[P];this.cssClass&&(s=s.concat(this.cssClass.split(" "))),this.element&&(e=document.getElementById(this.element.id))&&e.parentElement===this.wrapper&&(this.wrapper.tagName===E?(this.wrapper.innerHTML="",h.removeClass([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),h.removeClass([this.wrapper],this.cssClass.split(" "))):(h.removeClass([this.element],s),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){t.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),h.remove(this.wrapper)),this.unWireEvents()),this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),C.prototype.destroy.call(this),this.element&&!this.element.getAttribute("class")&&this.element.removeAttribute("class"),this.refreshing&&this.isAngular&&(this.element=this.wrapper,["e-control","e-split-btn","e-lib"].forEach(function(e){t.element.classList.add(e)}),h.setValue("ej2_instances",[this],this.element)),this.wrapper=null},w.prototype.wireEvents=function(){h.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),new h.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow",enter:"enter"}})},w.prototype.unWireEvents=function(){h.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),h.getInstance(this.element,h.KeyboardEvents).destroy()},w.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},w.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e);break;case"enter":this.clickHandler(e),this.getPopUpElement()&&!this.getPopUpElement().classList.contains("e-popup-close")?(this.element.classList.remove("e-active"),this.secondaryBtnObj.element.classList.add("e-active")):this.secondaryBtnObj.element.classList.remove("e-active")}},w.prototype.onPropertyChanged=function(e,t){var s;this.primaryBtnObj.setProperties(a(e,["content","iconCss","iconPosition","cssClass","disabled","enableRtl"])),s=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl","createPopupOnClick"],-1<Object.keys(e).indexOf("items")&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(a(e,s));for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"cssClass":t.cssClass&&h.removeClass([this.wrapper],t.cssClass.split(" ")),h.addClass([this.wrapper],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?h.addClass([this.wrapper],P):h.removeClass([this.wrapper],P);break;case"disabled":e.disabled?h.addClass([this.wrapper],"e-splitbtn-disabled"):h.removeClass([this.wrapper],"e-splitbtn-disabled")}},w.prototype.focusIn=function(){this.element.focus()},t([h.Property("")],w.prototype,"content",void 0),t([h.Property("")],w.prototype,"cssClass",void 0),t([h.Property(!1)],w.prototype,"disabled",void 0),t([h.Property("")],w.prototype,"iconCss",void 0),t([h.Property("Left")],w.prototype,"iconPosition",void 0),t([h.Property(!1)],w.prototype,"createPopupOnClick",void 0),t([h.Collection([],l)],w.prototype,"items",void 0),t([h.Property("")],w.prototype,"target",void 0),t([h.Event()],w.prototype,"beforeItemRender",void 0),t([h.Event()],w.prototype,"beforeOpen",void 0),t([h.Event()],w.prototype,"beforeClose",void 0),t([h.Event()],w.prototype,"click",void 0),t([h.Event()],w.prototype,"close",void 0),t([h.Event()],w.prototype,"open",void 0),t([h.Event()],w.prototype,"select",void 0),t([h.Event()],w.prototype,"created",void 0),t([h.NotifyPropertyChanges],w));function w(e,t){return C.call(this,e,t)||this}var k=function(){var s=this;this.promise=new Promise(function(e,t){s.resolve=e,s.reject=t}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)};O=function(e,t){return(O=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])}))(e,t)};var O,S,t=function(e,t){function s(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)},H=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(r=(o<3?n(r):3<o?n(t,s,r):n(t,s))||r);return 3<o&&r&&Object.defineProperty(t,s,r),r},L="e-hide-spinner",_="e-progress",B="e-progress-active",j="e-btn-content",M=(S=h.ChildProperty,t(N,S),H([h.Property(null)],N.prototype,"template",void 0),H([h.Property(16)],N.prototype,"width",void 0),H([h.Property("Left")],N.prototype,"position",void 0),N);function N(){return null!==S&&S.apply(this,arguments)||this}A=h.ChildProperty,t(U,A),H([h.Property(400)],U.prototype,"duration",void 0),H([h.Property("None")],U.prototype,"effect",void 0),H([h.Property("ease")],U.prototype,"easing",void 0);var A,q=U;function U(){return null!==A&&A.apply(this,arguments)||this}D=d.Button,t(R,D),R.prototype.preRender=function(){D.prototype.preRender.call(this)},R.prototype.render=function(){D.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},R.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},R.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},R.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},R.prototype.getModuleName=function(){return"progress-btn"},R.prototype.destroy=function(){var t=this,e=[L,B,"e-round-corner","e-"+D.prototype.getModuleName.call(this)];this.spinSettings.position&&e.push("e-spin-"+this.spinSettings.position.toLowerCase()),D.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(e=e.concat(this.cssClass.split(" "))),h.removeClass([this.element],e),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){t.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},R.prototype.init=function(){this.element.classList.add("e-"+D.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},R.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),r.createSpinner({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},R.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},R.prototype.getProgress=function(){return this.element.getElementsByClassName(_)[0]},R.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(j)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},R.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:_}))},R.prototype.setContent=function(){var e=this.element.innerHTML;this.enableHtmlSanitizer&&(e=h.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:j,innerHTML:e}))},R.prototype.clickHandler=function(){this.element.classList.contains(B)||this.startProgress()},R.prototype.startProgress=function(e,t){var s=this.element.classList,i=s.contains("e-vertical");s.add(B),s.contains(L)||r.showSpinner(this.element.querySelector(".e-spinner")),this.startAnimate(Date.now(),t||0,t?Date.now()-+this.duration/100:Date.now(),e||0,0,this.step,0,i),this.startContAnimate()},R.prototype.startAnimate=function(e,t,s,i,n,o,r,a){var p=this;try{var l=e-s,c=this.duration*o/100,h=l?l<c?l-c:l%c:0,d=(this.progressTime=t=t+l-h,s=e-h,i+=(l-h)/this.duration*100,{percent:n=(t-r)%c==0||100===i?i:n,currentDuration:t,step:o});this.eIsVertical=a,0===i?this.trigger("begin",d,function(e){p.successCallback(e,i,n,t,r,h,s)}):100===i||t===this.duration?this.trigger("end",d,function(e){p.successCallback(e,i,n,t,r,h,s)}):this.trigger("progress",d,function(e){p.successCallback(e,i,n,t,r,h,s)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},R.prototype.successCallback=function(e,t,s,i,n,o,r){var a=this,p=t,l=s,t=o,c=i,h=n,d=r,u=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(c-h)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&a.getProgress()&&(a.getProgress().style[u?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())}),l=p,h=c),this.isPaused||(c<this.duration&&p<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),c,d,p,l,e.step,h,u)},this.duration/100-t):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&a.getProgress()&&(a.getProgress().style[u?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},R.prototype.startContAnimate=function(){var e=this,t=this.element.getElementsByClassName(j)[0];"None"!==this.animationSettings.effect?new h.Animation({}).animate(t,{duration:0===this.animationSettings.duration&&"Enable"===h.animationMode?400:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){t.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},R.prototype.finishProgress=function(){for(var e=this.element.classList,t=e.contains("e-vertical"),s=(e.add(B),this.percent);s<100;s++)100<(s+=10)&&(s=100),this.enableProgress&&this.getProgress()&&(this.getProgress().style[t?"height":"width"]=this.percent<100?s+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin();e={step:this.step,currentDuration:this.progressTime,percent:100};clearTimeout(this.interval),this.trigger("end",e),this.progressTime=this.percent=0},R.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(j)[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")},R.prototype.hideSpin=function(){var e,t=this.element.getElementsByClassName(j)[0];this.element.classList.contains(L)||r.hideSpinner(this.element.querySelector(".e-spinner")),this.element.classList.remove(B),"None"!==this.animationSettings.effect&&t.classList.remove("e-animate-end"),"Center"===this.spinSettings.position&&(e=this.getSpinner(),t.classList.remove("e-cont-animate"),e.style.width="auto",e.style.height="auto")},R.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(j)[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])},R.prototype.setAria=function(){h.attributes(this.element,{"aria-label":this.element.textContent+" progress"})},R.prototype.wireEvents=function(){h.EventHandler.add(this.element,"click",this.clickHandler,this)},R.prototype.unWireEvents=function(){h.EventHandler.remove(this.element,"click",this.clickHandler)},R.prototype.onPropertyChanged=function(e,t){var s=this.element,i=!1;this.element.querySelector(".e-spinner-pane").classList.contains("e-spin-show")&&(i=!0),D.prototype.onPropertyChanged.call(this,e,t);for(var n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"content":this.setContent(),this.createSpinner(),i&&(r.showSpinner(this.element.querySelector(".e-spinner")),i=!1),this.enableProgress&&this.createProgress(),s.setAttribute("aria-label",s.textContent+" progress");break;case"iconCss":t.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":e.enableProgress?this.createProgress():h.remove(this.getProgress());break;case"spinSettings":e.spinSettings.position&&(s.classList.remove("e-spin-"+t.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(e.spinSettings.template||e.spinSettings.width)&&(s.removeChild(this.getSpinner()),this.createSpinner())}},H([h.Property(!(R.prototype.focusIn=function(){this.element.focus()}))],R.prototype,"enableProgress",void 0),H([h.Property(2e3)],R.prototype,"duration",void 0),H([h.Property("Left")],R.prototype,"iconPosition",void 0),H([h.Property("")],R.prototype,"iconCss",void 0),H([h.Property(!1)],R.prototype,"disabled",void 0),H([h.Property(!1)],R.prototype,"isPrimary",void 0),H([h.Property("")],R.prototype,"cssClass",void 0),H([h.Property("")],R.prototype,"content",void 0),H([h.Property(!1)],R.prototype,"isToggle",void 0),H([h.Property(!0)],R.prototype,"enableHtmlSanitizer",void 0),H([h.Complex({},M)],R.prototype,"spinSettings",void 0),H([h.Complex({},q)],R.prototype,"animationSettings",void 0),H([h.Event()],R.prototype,"created",void 0),H([h.Event()],R.prototype,"begin",void 0),H([h.Event()],R.prototype,"progress",void 0),H([h.Event()],R.prototype,"end",void 0),H([h.Event()],R.prototype,"fail",void 0);var D,t=H([h.NotifyPropertyChanges],R);function R(e,t){e=D.call(this,e,t)||this;return e.step=1,e}e.AnimationSettings=q,e.Deferred=k,e.DropDownButton=g,e.Item=l,e.ProgressButton=t,e.SpinSettings=M,e.SplitButton=s,e.createButtonGroup=function(e,t,s){void 0===t&&(t={}),h.isNullOrUndefined(s)&&(s=h.createElement);var i,n,o,r,a=document.querySelector(e),p=(h.addClass([a],["e-btn-group","e-css"]),a.setAttribute("role","group"),a.children);t.buttons=t.buttons||[];for(var l=0,c=0;c<p.length;l++,c++)i=p[c],null!==(r=t.buttons[l])&&("BUTTON"===i.tagName?n=i:(n=s("label"),(o=p[c+1])?a.insertBefore(n,o):a.appendChild(n),i.id&&n.setAttribute("for",i.id),r&&r.disabled&&(i.disabled=!0),c++),t.cssClass&&r&&!r.cssClass&&(r.cssClass=t.cssClass),new d.Button(r||{},n));return a},e.getModel=a,e.setBlankIconStyle=p,e.upDownKeyHandler=n,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
|
+
!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=e||self).ej={},e.ej2Base,e.ej2Buttons,e.ej2Popups)}(this,function(e,h,d,r){"use strict";i=function(e,t){return(i=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])}))(e,t)};var i,t=function(e,t){function s(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)},s=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(r=(o<3?n(r):3<o?n(t,s,r):n(t,s))||r);return 3<o&&r&&Object.defineProperty(t,s,r),r};function a(e,t){for(var s=h.extend({},e),i=0,n=Object.keys(s);i<n.length;i++){var o=n[i];t.indexOf(o)<0&&h.deleteObject(s,o)}return s}function n(e,t){var s=40===t?0:e.childElementCount-1,i=s,n=e.querySelector(".e-selected");n&&n.classList.remove("e-selected");for(var o=0,r=e.children.length;o<r;o++)e.children[o].classList.contains("e-focused")&&(i=o,e.children[o].classList.remove("e-focused"),40===t?i++:i--,i===(40===t?e.childElementCount:-1))&&(i=s);-1!==(i=function e(t,s,i,n,o){void 0===o&&(o=0);(s.classList.contains("e-separator")||s.classList.contains("e-disabled"))&&(i===(40===n?t.childElementCount-1:0)?i=40===n?0:t.childElementCount-1:40===n?i++:i--);s=t.children[i];if(s.classList.contains("e-separator")||s.classList.contains("e-disabled")){if(++o===t.childElementCount)return i=-1;i=e(t,s,i,n,o)}return i}(e,e.children[i],i,t))&&(h.addClass([e.children[i]],"e-focused"),e.children[i].focus())}function p(e,t){var s,i,n,o=[].slice.call(e.getElementsByClassName("e-blank-icon"));t&&[].slice.call(e.getElementsByClassName("e-item")).forEach(function(e){(e.style.paddingLeft||e.style.paddingRight)&&e.removeAttribute("style")}),o.length&&(t=e.querySelector(".e-item:not(.e-blank-icon):not(.e-separator)"),h.isNullOrUndefined(t)||(s=(t=t.classList.contains("e-url")?t.querySelector(".e-menu-url"):t).querySelector(".e-menu-icon"),e=e.classList.contains("e-rtl"),i=e?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},n=parseInt(getComputedStyle(s).fontSize,10)+parseInt(getComputedStyle(s)[i.margin],10)+parseInt(getComputedStyle(t).paddingLeft,10)+"px",o.forEach(function(e){e.classList.contains("e-url")?e.querySelector(".e-menu-url").style[i.padding]=n:e.style[i.padding]=n})))}o=h.ChildProperty,t(c,o),s([h.Property("")],c.prototype,"iconCss",void 0),s([h.Property("")],c.prototype,"id",void 0),s([h.Property(!1)],c.prototype,"separator",void 0),s([h.Property("")],c.prototype,"text",void 0),s([h.Property("")],c.prototype,"url",void 0),s([h.Property(!1)],c.prototype,"disabled",void 0);var o,l=c;function c(){return null!==o&&o.apply(this,arguments)||this}u=function(e,t){return(u=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])}))(e,t)};var u,m,t=function(e,t){function s(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)},s=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(r=(o<3?n(r):3<o?n(t,s,r):n(t,s))||r);return 3<o&&r&&Object.defineProperty(t,s,r),r},x="e-menu-icon",y="e-item",I="e-dropdown-popup",T="e-separator",f="e-vertical",g=(m=h.Component,t(v,m),v.prototype.preRender=function(){},v.prototype.getPersistData=function(){return this.addOnPersist([])},v.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.createPopupOnClick&&!this.isPopupCreated?(this.createPopup(),this.openPopUp()):this.closePopup()},v.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},v.prototype.addItems=function(e,t){for(var s,i=this.items.length,n=0,o=this.items.length;n<o;n++)if(t===this.items[n].text){i=n;break}for(var r=e.length-1;0<=r;r--)s=new l(this,"items",e[r],!0),this.items.splice(i,0,s);this.canOpen()||this.createItems()},v.prototype.removeItems=function(e,t){for(var s=!1,i=0,n=e.length;i<n;i++)for(var o=0,r=this.items.length;o<r;o++)if(e[i]===(t?this.items[o].id:this.items[o].text)){this.items.splice(o,1),s=!0;break}s&&this.getULElement()&&this.createItems()},v.prototype.createPopup=function(){var e,t=this.createElement("div",{className:I,id:this.element.id+"-popup"});document.body.appendChild(t),this.dropDown=new r.Popup(t,{relateTo:this.element,collision:{X:"fit",Y:"flip"},position:{X:"left",Y:"bottom"},targetType:"relative",content:this.target?this.getTargetElement():"",enableRtl:this.enableRtl}),this.dropDown.element.setAttribute("role","dialog"),this.dropDown.element.setAttribute("aria-label","dropdown menu"),h.isNullOrUndefined(this.popupContent)||(this.popupContent.style.display=""),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),h.attributes(this.element,((e={})["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e.type="button",e)),this.cssClass&&h.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.isPopupCreated=!0,this.createPopupOnClick&&(e=h.getComponent(this.activeElem[0],"split-btn"))&&(e.isPopupCreated=!0)},v.prototype.getTargetElement=function(){return!this.createPopupOnClick||this.isColorPicker()||h.isNullOrUndefined(this.popupContent)?"string"==typeof this.target?h.select(this.target):this.target:this.popupContent},v.prototype.createItems=function(e){var t=this.items,s=this.hasIcon(this.items,"iconCss"),i=this.getULElement();i?i.innerHTML="":i=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var n=0;n<t.length;n++){var o,r=(o=t[n]).text,a=this.createElement("li",{innerHTML:o.url?"":r,className:o.separator?y+" "+T:y,attrs:o.separator?{role:"separator",tabindex:"-1","aria-label":"separator","aria-hidden":"true"}:{role:"menuitem",tabindex:"-1","aria-label":r},id:o.id||h.getUniqueID("e-"+this.getModuleName()+"-item")}),r=(this.enableHtmlSanitizer?a.textContent=o.url?"":r:a.innerHTML=o.url?"":r,o.url&&(a.appendChild(this.createAnchor(o)),a.classList.add("e-url")),o.iconCss?(r=this.createElement("span",{className:x+" "+o.iconCss}),o.url?a.childNodes[0].appendChild(r):a.insertBefore(r,a.childNodes[0])):s&&!o.separator&&a.classList.add("e-blank-icon"),o.disabled);o.disabled&&a.classList.add("e-disabled"),this.trigger("beforeItemRender",o={item:o,element:a}),r!==o.item.disabled&&(o.item.disabled?a.classList.add("e-disabled"):a.classList.remove("e-disabled")),i.appendChild(a)}e&&this.getPopUpElement().appendChild(i),s&&p(this.getPopUpElement())},v.prototype.hasIcon=function(e,t){for(var s=0,i=e.length;s<i;s++)if(e[s][""+t])return!0;return!1},v.prototype.createAnchor=function(e){var t=this.enableHtmlSanitizer?h.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:t,attrs:{href:e.url}})},v.prototype.initialize=function(){this.button=new d.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=h.getUniqueID("e-"+this.getModuleName())),this.appendArrowSpan(),this.setActiveElem([this.element]),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-label",this.element.textContent||"dropdownbutton"),this.target&&!this.isColorPicker()&&!this.createPopupOnClick||!this.createPopupOnClick?this.createPopup():(this.isPopupCreated=!1,this.target&&!this.isColorPicker()&&this.createPopupOnClick&&(this.popupContent=this.getTargetElement(),this.popupContent.style.display="none"))},v.prototype.isColorPicker=function(){var e;return!!this.element&&!!((e=this.element.previousSibling)&&e.classList&&e.classList.contains("e-split-colorpicker"))},v.prototype.appendArrowSpan=function(){this.cssClass=h.isNullOrUndefined(this.cssClass)?"":this.cssClass,this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(-1<this.cssClass.indexOf(f)?"bottom":"right")+" e-caret"}))},v.prototype.setActiveElem=function(e){this.activeElem=e},v.prototype.getModuleName=function(){return"dropdown-btn"},v.prototype.canOpen=function(){var e=!1;return e=this.isPopupCreated?this.getPopUpElement().classList.contains("e-popup-close"):e},v.prototype.destroy=function(){var e,t=this;m.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()&&(this.element.querySelector("span.e-caret")&&h.detach(this.element.querySelector("span.e-caret")),this.cssClass&&(e=this.cssClass.split(" ")),this.button.destroy(),e&&h.removeClass([this.element],e),h.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){t.element.removeAttribute(e)}),this.popupUnWireEvents(),this.destroyPopup(),this.isPopupCreated=!1,this.disabled||this.unWireEvents())},v.prototype.destroyPopup=function(){this.isPopupCreated&&(this.dropDown.destroy(),this.getPopUpElement()&&(e=document.getElementById(this.getPopUpElement().id))&&(h.removeClass([e],["e-popup-open","e-popup-close"]),h.detach(e)),h.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),h.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.isPopupCreated)&&this.dropDown&&(this.dropDown.element=null,this.dropDown=void 0),this.isPopupCreated=!1;var e=h.getComponent(this.activeElem[0],"split-btn");this.createPopupOnClick&&e&&(e=h.getComponent(this.activeElem[1],"dropdown-btn"))&&(e.isPopupCreated=!1)},v.prototype.getPopUpElement=function(){var e,t=null;return!this.dropDown&&this.activeElem[0].classList.contains("e-split-btn")&&(e=h.getComponent(this.activeElem[1],"dropdown-btn"))&&(this.dropDown=e.dropDown),t=this.dropDown?this.dropDown.element:t},v.prototype.getULElement=function(){var e=null;return e=this.getPopUpElement()?this.getPopUpElement().children[0]:e},v.prototype.wireEvents=function(){this.delegateMousedownHandler=this.mousedownHandler.bind(this),this.createPopupOnClick||h.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),h.EventHandler.add(this.element,"click",this.clickHandler,this),h.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this),h.EventHandler.add(window,"resize",this.windowResize,this)},v.prototype.windowResize=function(){!this.canOpen()&&this.dropDown&&this.dropDown.refreshPosition(this.element)},v.prototype.popupWireEvents=function(){this.delegateMousedownHandler||(this.delegateMousedownHandler=this.mousedownHandler.bind(this));var e=this.getPopUpElement();this.createPopupOnClick&&h.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),e&&(h.EventHandler.add(e,"click",this.clickHandler,this),h.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.closeActionEvents)&&h.EventHandler.add(e,this.closeActionEvents,this.focusoutHandler,this),this.rippleFn=h.rippleEffect(e,{selector:"."+y})},v.prototype.popupUnWireEvents=function(){var e=this.getPopUpElement();this.createPopupOnClick&&h.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),e&&e.parentElement&&(h.EventHandler.remove(e,"click",this.clickHandler),h.EventHandler.remove(e,"keydown",this.keyBoardHandler),this.closeActionEvents)&&h.EventHandler.remove(e,this.closeActionEvents,this.focusoutHandler),h.isRippleEnabled&&this.rippleFn&&this.rippleFn()},v.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)}},v.prototype.isSafari=function(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},v.prototype.upDownKeyHandler=function(e){this.target&&(38===e.keyCode||40===e.keyCode)||(e.preventDefault(),n(this.getULElement(),e.keyCode))},v.prototype.keyEventHandler=function(e){this.target&&(13===e.keyCode||9===e.keyCode)||(13===e.keyCode&&this.activeElem[0].classList.contains("e-split-btn")?(this.triggerSelect(e),this.activeElem[0].focus()):e.target&&-1<e.target.className.indexOf("e-edit-template")&&32===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)))},v.prototype.getLI=function(e){return"LI"===e.tagName?e:h.closest(e,"li")},v.prototype.mousedownHandler=function(e){var t=e.target;!this.dropDown||this.canOpen()||!this.getPopUpElement()||h.closest(t,'[id="'+this.getPopUpElement().id+'"]')||h.closest(t,'[id="'+this.element.id+'"]')||this.closePopup(e)},v.prototype.focusoutHandler=function(e){var t,s;this.isPopupCreated&&!this.canOpen()&&((t=e.relatedTarget||e.target)&&-1<t.className.indexOf("e-item")&&(t=this.getLI(t))&&(s=Array.prototype.indexOf.call(this.getULElement().children,t),s=this.items[s])&&this.trigger("select",{element:t,item:s,event:e}),this.closePopup(e))},v.prototype.clickHandler=function(e){var t=e.target;h.closest(t,'[id="'+this.element.id+'"]')?!this.createPopupOnClick||this.target&&""!==this.target&&!this.isColorPicker()&&!this.createPopupOnClick?this.getPopUpElement().classList.contains("e-popup-close")?this.openPopUp(e):this.closePopup(e):this.isPopupCreated?this.closePopup(e,this.activeElem[0]):(this.createPopup(),this.openPopUp(e)):h.closest(t,'[id="'+this.getPopUpElement().id+'"]')&&this.getLI(e.target)&&(this.triggerSelect(e),this.closePopup(e,this.activeElem[0]))},v.prototype.triggerSelect=function(e){var t,s=this.getLI(e.target);s&&(t=Array.prototype.indexOf.call(this.getULElement().children,s),t=this.items[t])&&this.trigger("select",{element:s,item:t,event:e})},v.prototype.openPopUp=function(e){var s=this,t=(void 0===e&&(e=null),this.getPopUpElement()),i=(this.target?1<this.activeElem.length?(i=h.getComponent(this.activeElem[0],"split-btn")).isReact&&t.childNodes.length<1&&(i.appendReactElement&&i.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates()):this.isReact&&t.childNodes.length<1&&(this.appendReactElement&&this.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates()):this.createItems(!0),this.getULElement()),t=(this.popupWireEvents(),{element:i,items:this.items,event:e,cancel:!1});this.trigger("beforeOpen",t,function(e){var t;e.cancel||(e=s.getULElement(),s.dropDown.show(null,s.element),h.addClass([s.element],"e-active"),s.element.setAttribute("aria-expanded","true"),s.element.setAttribute("aria-owns",s.getPopUpElement().id),e&&!s.isSafari()&&e.focus(),s.enableRtl&&"0px"!==e.parentElement.style.left&&(t=void 0,t=(s.element.parentElement&&s.element.parentElement.classList.contains("e-split-btn-wrapper")?s.element.parentElement:s.element).offsetWidth,t=e.parentElement.offsetWidth-t,t=parseFloat(e.parentElement.style.left)-t,e.parentElement.style.left=(t=t<0?0:t)+"px"),t={element:e,items:s.items},s.trigger("open",t),e&&s.isSafari()&&e.focus())})},v.prototype.closePopup=function(e,s){var i=this,n=(void 0===e&&(e=null),this.getULElement()),e={element:n,items:this.items,event:e,cancel:!1};this.trigger("beforeClose",e,function(e){var t;e.cancel?n&&n.focus():((e=i.getPopUpElement())&&h.EventHandler.remove(e,"keydown",i.keyBoardHandler),i.popupUnWireEvents(),e=void 0,(e=(t=i.getULElement())?t.querySelector(".e-selected"):e)&&e.classList.remove("e-selected"),i.dropDown&&i.dropDown.hide(),h.removeClass(i.activeElem,"e-active"),i.element.setAttribute("aria-expanded","false"),i.element.removeAttribute("aria-owns"),s&&s.focus(),e={element:t,items:i.items},i.trigger("close",e),!i.target&&t&&h.detach(t),(!i.target||i.isColorPicker()||i.target&&!i.isColorPicker())&&i.createPopupOnClick&&i.destroyPopup())})},v.prototype.unWireEvents=function(){this.createPopupOnClick||h.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),h.EventHandler.remove(this.element,"click",this.clickHandler),h.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),this.isPopupCreated&&(h.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),h.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler)),h.EventHandler.remove(window,"resize",this.windowResize)},v.prototype.onPropertyChanged=function(e,t){var s;this.button.setProperties(a(e,["content","cssClass","iconCss","iconPosition","disabled","enableRtl"])),this.isPopupCreated&&(s=this.getPopUpElement(),this.dropDown.setProperties(a(e,["enableRtl"])));for(var i,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"content":this.element.querySelector("span.e-caret")||this.appendArrowSpan();break;case"disabled":e.disabled?(this.unWireEvents(),this.isPopupCreated&&!this.canOpen()&&this.closePopup()):this.wireEvents();break;case"cssClass":t.cssClass=h.isNullOrUndefined(t.cssClass)?"":t.cssClass,(-1<e.cssClass.indexOf(f)||-1<t.cssClass.indexOf(f))&&(this.element.querySelector("span.e-caret")||this.appendArrowSpan(),i=this.element.querySelector("span.e-caret"),-1<e.cssClass.indexOf(f)?h.classList(i,["e-icon-bottom"],["e-icon-right"]):h.classList(i,["e-icon-right"],["e-icon-bottom"])),this.isPopupCreated&&(t.cssClass&&h.removeClass([s],t.cssClass.split(" ")),e.cssClass)&&h.addClass([s],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"target":this.dropDown.content=this.getTargetElement(),this.dropDown.dataBind();break;case"items":this.isPopupCreated&&this.getULElement()&&this.createItems();break;case"createPopupOnClick":e.createPopupOnClick?this.destroyPopup():this.createPopup()}},v.prototype.focusIn=function(){this.element.focus()},s([h.Property("")],v.prototype,"content",void 0),s([h.Property("")],v.prototype,"cssClass",void 0),s([h.Property(!1)],v.prototype,"disabled",void 0),s([h.Property("")],v.prototype,"iconCss",void 0),s([h.Property("Left")],v.prototype,"iconPosition",void 0),s([h.Property(!0)],v.prototype,"enableHtmlSanitizer",void 0),s([h.Collection([],l)],v.prototype,"items",void 0),s([h.Property(!1)],v.prototype,"createPopupOnClick",void 0),s([h.Property("")],v.prototype,"target",void 0),s([h.Property("")],v.prototype,"closeActionEvents",void 0),s([h.Event()],v.prototype,"beforeItemRender",void 0),s([h.Event()],v.prototype,"beforeOpen",void 0),s([h.Event()],v.prototype,"beforeClose",void 0),s([h.Event()],v.prototype,"close",void 0),s([h.Event()],v.prototype,"open",void 0),s([h.Event()],v.prototype,"select",void 0),s([h.Event()],v.prototype,"created",void 0),s([h.NotifyPropertyChanges],v));function v(e,t){e=m.call(this,e,t)||this;return e.isPopupCreated=!0,e}b=function(e,t){return(b=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])}))(e,t)};var b,C,t=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(r=(o<3?n(r):3<o?n(t,s,r):n(t,s))||r);return 3<o&&r&&Object.defineProperty(t,s,r),r},P="e-rtl",E="EJS-SPLITBUTTON",s=(function(e,t){function s(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)}(w,C=g),w.prototype.preRender=function(){var e=this.element;if(e.tagName===E){for(var t=h.getValue("ej2_instances",e),s=this.createElement("button",{attrs:{type:"button"}}),i=this.createElement(E,{className:"e-"+this.getModuleName()+"-wrapper"}),n=0,o=e.attributes.length;n<o;n++)s.setAttribute(e.attributes[n].nodeName,e.attributes[n].nodeValue);e.parentNode.insertBefore(i,e),h.detach(e),i.appendChild(e=s),h.setValue("ej2_instances",t,e),this.wrapper=i,this.element=e}this.element.id||(this.element.id=h.getUniqueID("e-"+this.getModuleName()))},w.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},w.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},w.prototype.addItems=function(e,t){C.prototype.addItems.call(this,e,t),this.secondaryBtnObj.items=this.items},w.prototype.removeItems=function(e,t){C.prototype.removeItems.call(this,e,t),this.secondaryBtnObj.items=this.items},w.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(P),this.cssClass&&h.addClass([this.wrapper],this.cssClass.replace(/\s+/g," ").trim().split(" "))},w.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 d.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)},w.prototype.createSecondaryButton=function(){var s=this,e=this.createElement("button",{className:"e-icon-btn",attrs:{tabindex:"-1"},id:this.element.id+"_dropdownbtn"}),t=(this.wrapper.appendChild(e),{cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target,createPopupOnClick:this.createPopupOnClick});t.beforeItemRender=function(e){s.createPopupOnClick&&(s.secondaryBtnObj.dropDown.relateTo=s.wrapper,s.dropDown=s.secondaryBtnObj.dropDown),s.trigger("beforeItemRender",e)},t.open=function(e){s.trigger("open",e)},t.close=function(e){s.trigger("close",e)},t.select=function(e){s.trigger("select",e)},t.beforeOpen=function(e){s.createPopupOnClick&&0===s.items.length&&(s.secondaryBtnObj.dropDown.relateTo=s.wrapper,s.dropDown=s.secondaryBtnObj.dropDown);var t=new k;return s.trigger("beforeOpen",e,function(e){t.resolve(e)}),t},t.beforeClose=function(e){var t=new k;return s.trigger("beforeClose",e,function(e){t.resolve(e)}),t},this.secondaryBtnObj=new g(t),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(e),this.createPopupOnClick||(this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown),this.isPopupCreated=this.secondaryBtnObj.isPopupCreated,this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right"),this.disabled&&this.wrapper.classList.add("e-splitbtn-disabled")},w.prototype.setAria=function(){h.attributes(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent?this.element.textContent+" splitbutton":"splitbutton","aria-owns":this.element.id+"_dropdownbtn-popup"})},w.prototype.getModuleName=function(){return"split-btn"},w.prototype.toggle=function(){this.secondaryBtnObj.toggle()},w.prototype.destroy=function(){var e,t=this,s=[P];this.cssClass&&(s=s.concat(this.cssClass.split(" "))),this.element&&(e=document.getElementById(this.element.id))&&e.parentElement===this.wrapper&&(this.wrapper.tagName===E?(this.wrapper.innerHTML="",h.removeClass([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),h.removeClass([this.wrapper],this.cssClass.split(" "))):(h.removeClass([this.element],s),["aria-label","aria-haspopup","aria-expanded","aria-owns","type"].forEach(function(e){t.element.removeAttribute(e)}),this.wrapper.parentNode.insertBefore(this.element,this.wrapper),h.remove(this.wrapper)),this.unWireEvents()),this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),C.prototype.destroy.call(this),this.element&&!this.element.getAttribute("class")&&this.element.removeAttribute("class"),this.refreshing&&this.isAngular&&(this.element=this.wrapper,["e-control","e-split-btn","e-lib"].forEach(function(e){t.element.classList.add(e)}),h.setValue("ej2_instances",[this],this.element)),this.wrapper=null},w.prototype.wireEvents=function(){h.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),new h.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow",enter:"enter"}})},w.prototype.unWireEvents=function(){h.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),h.getInstance(this.element,h.KeyboardEvents).destroy()},w.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},w.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e);break;case"enter":this.clickHandler(e),this.getPopUpElement()&&!this.getPopUpElement().classList.contains("e-popup-close")?(this.element.classList.remove("e-active"),this.secondaryBtnObj.element.classList.add("e-active")):this.secondaryBtnObj.element.classList.remove("e-active")}},w.prototype.onPropertyChanged=function(e,t){var s;this.primaryBtnObj.setProperties(a(e,["content","iconCss","iconPosition","cssClass","disabled","enableRtl"])),s=["beforeOpen","beforeItemRender","select","open","close","cssClass","disabled","enableRtl","createPopupOnClick"],-1<Object.keys(e).indexOf("items")&&(this.secondaryBtnObj.items=e.items,this.secondaryBtnObj.dataBind()),this.secondaryBtnObj.setProperties(a(e,s));for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"cssClass":t.cssClass&&h.removeClass([this.wrapper],t.cssClass.split(" ")),h.addClass([this.wrapper],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?h.addClass([this.wrapper],P):h.removeClass([this.wrapper],P);break;case"disabled":e.disabled?h.addClass([this.wrapper],"e-splitbtn-disabled"):h.removeClass([this.wrapper],"e-splitbtn-disabled")}},w.prototype.focusIn=function(){this.element.focus()},t([h.Property("")],w.prototype,"content",void 0),t([h.Property("")],w.prototype,"cssClass",void 0),t([h.Property(!1)],w.prototype,"disabled",void 0),t([h.Property("")],w.prototype,"iconCss",void 0),t([h.Property("Left")],w.prototype,"iconPosition",void 0),t([h.Property(!1)],w.prototype,"createPopupOnClick",void 0),t([h.Collection([],l)],w.prototype,"items",void 0),t([h.Property("")],w.prototype,"target",void 0),t([h.Event()],w.prototype,"beforeItemRender",void 0),t([h.Event()],w.prototype,"beforeOpen",void 0),t([h.Event()],w.prototype,"beforeClose",void 0),t([h.Event()],w.prototype,"click",void 0),t([h.Event()],w.prototype,"close",void 0),t([h.Event()],w.prototype,"open",void 0),t([h.Event()],w.prototype,"select",void 0),t([h.Event()],w.prototype,"created",void 0),t([h.NotifyPropertyChanges],w));function w(e,t){return C.call(this,e,t)||this}var k=function(){var s=this;this.promise=new Promise(function(e,t){s.resolve=e,s.reject=t}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)};O=function(e,t){return(O=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var s in t)t.hasOwnProperty(s)&&(e[s]=t[s])}))(e,t)};var O,S,t=function(e,t){function s(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(s.prototype=t.prototype,new s)},H=function(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(r=(o<3?n(r):3<o?n(t,s,r):n(t,s))||r);return 3<o&&r&&Object.defineProperty(t,s,r),r},L="e-hide-spinner",_="e-progress",B="e-progress-active",j="e-btn-content",M=(S=h.ChildProperty,t(N,S),H([h.Property(null)],N.prototype,"template",void 0),H([h.Property(16)],N.prototype,"width",void 0),H([h.Property("Left")],N.prototype,"position",void 0),N);function N(){return null!==S&&S.apply(this,arguments)||this}A=h.ChildProperty,t(U,A),H([h.Property(400)],U.prototype,"duration",void 0),H([h.Property("None")],U.prototype,"effect",void 0),H([h.Property("ease")],U.prototype,"easing",void 0);var A,q=U;function U(){return null!==A&&A.apply(this,arguments)||this}D=d.Button,t(R,D),R.prototype.preRender=function(){D.prototype.preRender.call(this)},R.prototype.render=function(){D.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},R.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},R.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},R.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},R.prototype.getModuleName=function(){return"progress-btn"},R.prototype.destroy=function(){var t=this,e=[L,B,"e-round-corner","e-"+D.prototype.getModuleName.call(this)];this.spinSettings.position&&e.push("e-spin-"+this.spinSettings.position.toLowerCase()),D.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(e=e.concat(this.cssClass.split(" "))),h.removeClass([this.element],e),(this.element.getAttribute("class")?["aria-label","aria-valuemin","aria-valuemax","aria-valuenow"]:["aria-label","aria-valuemin","aria-valuemax","aria-valuenow","class"]).forEach(function(e){t.element.removeAttribute(e)}),this.disabled&&this.element.removeAttribute("disabled")},R.prototype.init=function(){this.element.classList.add("e-"+D.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},R.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),r.createSpinner({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},R.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},R.prototype.getProgress=function(){return this.element.getElementsByClassName(_)[0]},R.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(j)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},R.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:_}))},R.prototype.setContent=function(){var e=this.element.innerHTML;this.enableHtmlSanitizer&&(e=h.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:j,innerHTML:e}))},R.prototype.clickHandler=function(){this.element.classList.contains(B)||this.startProgress()},R.prototype.startProgress=function(e,t){var s=this.element.classList,i=s.contains("e-vertical");s.add(B),s.contains(L)||r.showSpinner(this.element.querySelector(".e-spinner")),this.startAnimate(Date.now(),t||0,t?Date.now()-+this.duration/100:Date.now(),e||0,0,this.step,0,i),this.startContAnimate()},R.prototype.startAnimate=function(e,t,s,i,n,o,r,a){var p=this;try{var l=e-s,c=this.duration*o/100,h=l?l<c?l-c:l%c:0,d=(this.progressTime=t=t+l-h,s=e-h,i+=(l-h)/this.duration*100,{percent:n=(t-r)%c==0||100===i?i:n,currentDuration:t,step:o});this.eIsVertical=a,0===i?this.trigger("begin",d,function(e){p.successCallback(e,i,n,t,r,h,s)}):100===i||t===this.duration?this.trigger("end",d,function(e){p.successCallback(e,i,n,t,r,h,s)}):this.trigger("progress",d,function(e){p.successCallback(e,i,n,t,r,h,s)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},R.prototype.successCallback=function(e,t,s,i,n,o,r){var a=this,p=t,l=s,t=o,c=i,h=n,d=r,u=this.eIsVertical;p!==e.percent&&e.percent!==l&&(p=e.percent),this.percent=p,this.step=e.step,(c-h)%(this.duration*e.step/100)!=0&&100!==p||(this.timerId=requestAnimationFrame(function(){a.enableProgress&&a.getProgress()&&(a.getProgress().style[u?"height":"width"]=p+"%"),a.element.setAttribute("aria-valuenow",p.toString())}),l=p,h=c),this.isPaused||(c<this.duration&&p<100?this.interval=window.setTimeout(function(){a.startAnimate(Date.now(),c,d,p,l,e.step,h,u)},this.duration/100-t):this.interval=window.setTimeout(function(){a.progressTime=a.percent=0,a.enableProgress&&a.getProgress()&&(a.getProgress().style[u?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},R.prototype.startContAnimate=function(){var e=this,t=this.element.getElementsByClassName(j)[0];"None"!==this.animationSettings.effect?new h.Animation({}).animate(t,{duration:0===this.animationSettings.duration&&"Enable"===h.animationMode?400:this.animationSettings.duration,name:"Progress"+this.animationSettings.effect,timingFunction:this.animationSettings.easing,begin:function(){"Center"===e.spinSettings.position&&e.setSpinnerSize()},end:function(){t.classList.add("e-animate-end")}}):"Center"===this.spinSettings.position&&this.setSpinnerSize()},R.prototype.finishProgress=function(){for(var e=this.element.classList,t=e.contains("e-vertical"),s=(e.add(B),this.percent);s<100;s++)100<(s+=10)&&(s=100),this.enableProgress&&this.getProgress()&&(this.getProgress().style[t?"height":"width"]=this.percent<100?s+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin();e={step:this.step,currentDuration:this.progressTime,percent:100};clearTimeout(this.interval),this.trigger("end",e),this.progressTime=this.percent=0},R.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(j)[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")},R.prototype.hideSpin=function(){var e,t=this.element.getElementsByClassName(j)[0];this.element.classList.contains(L)||r.hideSpinner(this.element.querySelector(".e-spinner")),this.element.classList.remove(B),"None"!==this.animationSettings.effect&&t.classList.remove("e-animate-end"),"Center"===this.spinSettings.position&&(e=this.getSpinner(),t.classList.remove("e-cont-animate"),e.style.width="auto",e.style.height="auto")},R.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(j)[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])},R.prototype.setAria=function(){h.attributes(this.element,{"aria-label":this.element.textContent+" progress"})},R.prototype.wireEvents=function(){h.EventHandler.add(this.element,"click",this.clickHandler,this)},R.prototype.unWireEvents=function(){h.EventHandler.remove(this.element,"click",this.clickHandler)},R.prototype.onPropertyChanged=function(e,t){var s=this.element,i=!1;this.element.querySelector(".e-spinner-pane").classList.contains("e-spin-show")&&(i=!0),D.prototype.onPropertyChanged.call(this,e,t);for(var n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"content":this.setContent(),this.createSpinner(),i&&(r.showSpinner(this.element.querySelector(".e-spinner")),i=!1),this.enableProgress&&this.createProgress(),s.setAttribute("aria-label",s.textContent+" progress");break;case"iconCss":t.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":e.enableProgress?this.createProgress():h.remove(this.getProgress());break;case"spinSettings":e.spinSettings.position&&(s.classList.remove("e-spin-"+t.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(e.spinSettings.template||e.spinSettings.width)&&(s.removeChild(this.getSpinner()),this.createSpinner())}},H([h.Property(!(R.prototype.focusIn=function(){this.element.focus()}))],R.prototype,"enableProgress",void 0),H([h.Property(2e3)],R.prototype,"duration",void 0),H([h.Property("Left")],R.prototype,"iconPosition",void 0),H([h.Property("")],R.prototype,"iconCss",void 0),H([h.Property(!1)],R.prototype,"disabled",void 0),H([h.Property(!1)],R.prototype,"isPrimary",void 0),H([h.Property("")],R.prototype,"cssClass",void 0),H([h.Property("")],R.prototype,"content",void 0),H([h.Property(!1)],R.prototype,"isToggle",void 0),H([h.Property(!0)],R.prototype,"enableHtmlSanitizer",void 0),H([h.Complex({},M)],R.prototype,"spinSettings",void 0),H([h.Complex({},q)],R.prototype,"animationSettings",void 0),H([h.Event()],R.prototype,"created",void 0),H([h.Event()],R.prototype,"begin",void 0),H([h.Event()],R.prototype,"progress",void 0),H([h.Event()],R.prototype,"end",void 0),H([h.Event()],R.prototype,"fail",void 0);var D,t=H([h.NotifyPropertyChanges],R);function R(e,t){e=D.call(this,e,t)||this;return e.step=1,e}e.AnimationSettings=q,e.Deferred=k,e.DropDownButton=g,e.Item=l,e.ProgressButton=t,e.SpinSettings=M,e.SplitButton=s,e.createButtonGroup=function(e,t,s){void 0===t&&(t={}),h.isNullOrUndefined(s)&&(s=h.createElement);var i,n,o,r,a=document.querySelector(e),p=(h.addClass([a],["e-btn-group","e-css"]),a.setAttribute("role","group"),a.children);t.buttons=t.buttons||[];for(var l=0,c=0;c<p.length;l++,c++)i=p[c],null!==(r=t.buttons[l])&&("BUTTON"===i.tagName?n=i:(n=s("label"),(o=p[c+1])?a.insertBefore(n,o):a.appendChild(n),i.id&&n.setAttribute("for",i.id),r&&r.disabled&&(i.disabled=!0),c++),t.cssClass&&r&&!r.cssClass&&(r.cssClass=t.cssClass),new d.Button(r||{},n));return a},e.getModel=a,e.setBlankIconStyle=p,e.upDownKeyHandler=n,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-splitbuttons.umd.min.js.map
|