@syncfusion/ej2-splitbuttons 20.2.45 → 20.3.52
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/CHANGELOG.md +1 -1
- package/dist/ej2-splitbuttons.min.js +10 -0
- package/dist/ej2-splitbuttons.umd.min.js +1 -1
- package/dist/global/ej2-splitbuttons.min.js +1 -1
- package/dist/global/index.d.ts +1 -1
- package/dist/ts/button-group/button-group.ts +84 -0
- package/dist/ts/common/common.ts +203 -0
- package/dist/ts/drop-down-button/drop-down-button.ts +831 -0
- package/dist/ts/progress-button/progress-button.ts +689 -0
- package/dist/ts/split-button/split-button.ts +501 -0
- package/package.json +10 -9
- package/src/drop-down-button/drop-down-button-model.d.ts +4 -4
- package/styles/bootstrap-dark.css +26 -5
- package/styles/bootstrap.css +21 -0
- package/styles/bootstrap4.css +22 -1
- package/styles/bootstrap5-dark.css +23 -0
- package/styles/bootstrap5.css +23 -0
- package/styles/button-group/_bootstrap-dark-definition.scss +2 -1
- package/styles/button-group/_fabric-dark-definition.scss +2 -1
- package/styles/button-group/_group-button-mixin.scss +3 -3
- package/styles/button-group/_highcontrast-light-definition.scss +3 -3
- package/styles/button-group/_layout.scss +1 -1
- package/styles/button-group/_material-dark-definition.scss +2 -1
- package/styles/button-group/_theme.scss +1 -1
- package/styles/button-group/bootstrap-dark.css +2 -0
- package/styles/button-group/bootstrap.css +2 -0
- package/styles/button-group/bootstrap4.css +2 -0
- package/styles/button-group/bootstrap5-dark.css +2 -0
- package/styles/button-group/bootstrap5.css +2 -0
- package/styles/button-group/fabric-dark.css +2 -0
- package/styles/button-group/fabric.css +2 -0
- package/styles/button-group/fluent-dark.css +2 -0
- package/styles/button-group/fluent.css +2 -0
- package/styles/button-group/highcontrast-light.css +2 -0
- package/styles/button-group/highcontrast.css +2 -0
- package/styles/button-group/material-dark.css +2 -0
- package/styles/button-group/material.css +2 -0
- package/styles/button-group/tailwind-dark.css +2 -0
- package/styles/button-group/tailwind.css +2 -0
- package/styles/drop-down-button/_all.scss +1 -1
- package/styles/drop-down-button/_bootstrap-dark-definition.scss +1 -0
- package/styles/drop-down-button/_bootstrap4-definition.scss +2 -2
- package/styles/drop-down-button/_bootstrap5-definition.scss +0 -1
- package/styles/drop-down-button/_fabric-dark-definition.scss +2 -1
- package/styles/drop-down-button/_fluent-definition.scss +1 -1
- package/styles/drop-down-button/_fusionnew-definition.scss +0 -1
- package/styles/drop-down-button/_highcontrast-definition.scss +0 -1
- package/styles/drop-down-button/_highcontrast-light-definition.scss +2 -1
- package/styles/drop-down-button/_layout.scss +3 -2
- package/styles/drop-down-button/_material-dark-definition.scss +2 -1
- package/styles/drop-down-button/_material3-definition.scss +0 -1
- package/styles/drop-down-button/_tailwind-definition.scss +0 -1
- package/styles/drop-down-button/_theme.scss +21 -0
- package/styles/drop-down-button/bootstrap-dark.css +18 -0
- package/styles/drop-down-button/bootstrap.css +18 -0
- package/styles/drop-down-button/bootstrap4.css +18 -0
- package/styles/drop-down-button/bootstrap5-dark.css +19 -0
- package/styles/drop-down-button/bootstrap5.css +19 -0
- package/styles/drop-down-button/fabric-dark.css +18 -0
- package/styles/drop-down-button/fabric.css +18 -0
- package/styles/drop-down-button/fluent-dark.css +19 -0
- package/styles/drop-down-button/fluent.css +19 -0
- package/styles/drop-down-button/highcontrast-light.css +18 -0
- package/styles/drop-down-button/highcontrast.css +18 -0
- package/styles/drop-down-button/material-dark.css +18 -0
- package/styles/drop-down-button/material.css +18 -0
- package/styles/drop-down-button/tailwind-dark.css +19 -0
- package/styles/drop-down-button/tailwind.css +19 -0
- package/styles/fabric-dark.css +21 -0
- package/styles/fabric.css +21 -0
- package/styles/fluent-dark.css +23 -0
- package/styles/fluent.css +23 -0
- package/styles/highcontrast-light.css +21 -0
- package/styles/highcontrast.css +23 -2
- package/styles/material-dark.css +21 -0
- package/styles/material.css +21 -0
- package/styles/progress-button/_bootstrap-dark-definition.scss +6 -5
- package/styles/progress-button/_bootstrap4-definition.scss +1 -1
- package/styles/progress-button/_fabric-dark-definition.scss +1 -0
- package/styles/progress-button/_highcontrast-definition.scss +1 -1
- package/styles/progress-button/_layout.scss +43 -42
- package/styles/progress-button/_material-dark-definition.scss +1 -0
- package/styles/progress-button/_theme.scss +23 -22
- package/styles/progress-button/bootstrap-dark.css +6 -5
- package/styles/progress-button/bootstrap.css +1 -0
- package/styles/progress-button/bootstrap4.css +2 -1
- package/styles/progress-button/bootstrap5-dark.css +1 -0
- package/styles/progress-button/bootstrap5.css +1 -0
- package/styles/progress-button/fabric-dark.css +1 -0
- package/styles/progress-button/fabric.css +1 -0
- package/styles/progress-button/fluent-dark.css +1 -0
- package/styles/progress-button/fluent.css +1 -0
- package/styles/progress-button/highcontrast-light.css +1 -0
- package/styles/progress-button/highcontrast.css +3 -2
- package/styles/progress-button/material-dark.css +1 -0
- package/styles/progress-button/material.css +1 -0
- package/styles/progress-button/tailwind-dark.css +1 -0
- package/styles/progress-button/tailwind.css +1 -0
- package/styles/split-button/_bootstrap-dark-definition.scss +2 -1
- package/styles/split-button/_bootstrap4-definition.scss +2 -1
- package/styles/split-button/_bootstrap5-definition.scss +0 -1
- package/styles/split-button/_fabric-dark-definition.scss +1 -0
- package/styles/split-button/_fluent-definition.scss +0 -1
- package/styles/split-button/_fusionnew-definition.scss +0 -1
- package/styles/split-button/_highcontrast-light-definition.scss +2 -2
- package/styles/split-button/_layout.scss +2 -1
- package/styles/split-button/_material-dark-definition.scss +2 -1
- package/styles/split-button/_material3-definition.scss +0 -1
- package/styles/split-button/_tailwind-definition.scss +0 -1
- package/styles/split-button/_theme.scss +1 -1
- package/styles/split-button/bootstrap5-dark.css +1 -0
- package/styles/split-button/bootstrap5.css +1 -0
- package/styles/split-button/fluent-dark.css +1 -0
- package/styles/split-button/fluent.css +1 -0
- package/styles/split-button/tailwind-dark.css +1 -0
- package/styles/split-button/tailwind.css +1 -0
- package/styles/tailwind-dark.css +23 -0
- package/styles/tailwind.css +23 -0
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* filename: ej2-splitbuttons.min.js
|
|
3
|
+
* version : 20.3.52
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
|
|
5
|
+
* Use of this code is subject to the terms of our license.
|
|
6
|
+
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
+
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
+
* applicable laws.
|
|
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)}(this,function(e,t,i){return function(e){function t(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,n){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=11)}([function(t,i){t.exports=e},function(e,t,i){"use strict";function n(e,t){for(var n=i.i(a.extend)({},e),s=0,o=Object.keys(n);s<o.length;s++){var r=o[s];t.indexOf(r)<0&&i.i(a.deleteObject)(n,r)}return n}function s(e,t){var n,s=40===t?0:e.childElementCount-1,r=s,p=e.querySelector(".e-selected");p&&p.classList.remove("e-selected");for(var l=0,c=e.children.length;l<c;l++)e.children[l].classList.contains("e-focused")&&(n=e.children[l],r=l,n.classList.remove("e-focused"),40===t?r++:r--,r===(40===t?e.childElementCount:-1)&&(r=s));n=e.children[r],-1!==(r=o(e,n,r,t))&&(i.i(a.addClass)([e.children[r]],"e-focused"),e.children[r].focus())}function o(e,t,i,n,s){if(void 0===s&&(s=0),(t.classList.contains("e-separator")||t.classList.contains("e-disabled"))&&(i===(40===n?e.childElementCount-1:0)?i=40===n?0:e.childElementCount-1:40===n?i++:i--),t=e.children[i],t.classList.contains("e-separator")||t.classList.contains("e-disabled")){if(++s===e.childElementCount)return i=-1;i=o(e,t,i,n,s)}return i}function r(e){var t=[].slice.call(e.getElementsByClassName("e-blank-icon"));if(t.length){var n=e.querySelector(".e-item:not(.e-blank-icon):not(.e-separator)");if(!i.i(a.isNullOrUndefined)(n)){n.classList.contains("e-url")&&(n=n.querySelector(".e-menu-url"));var s,o=n.querySelector(".e-menu-icon"),r=e.classList.contains("e-rtl");s=r?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"};var p=parseInt(getComputedStyle(o).fontSize,10)+parseInt(getComputedStyle(o)[s.margin],10)+parseInt(getComputedStyle(n).paddingLeft,10)+"px";t.forEach(function(e){e.classList.contains("e-url")?e.querySelector(".e-menu-url").style[s.padding]=p:e.style[s.padding]=p})}}}t.a=n,t.d=s,t.c=r,i.d(t,"b",function(){return c});var a=i(0),p=(i.n(a),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}()),l=this&&this.__decorate||function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return p(t,e),l([i.i(a.Property)("")],t.prototype,"iconCss",void 0),l([i.i(a.Property)("")],t.prototype,"id",void 0),l([i.i(a.Property)(!1)],t.prototype,"separator",void 0),l([i.i(a.Property)("")],t.prototype,"text",void 0),l([i.i(a.Property)("")],t.prototype,"url",void 0),l([i.i(a.Property)(!1)],t.prototype,"disabled",void 0),t}(a.ChildProperty)},function(e,i){e.exports=t},function(e,t,i){"use strict";i.d(t,"a",function(){return c});var n=i(0),s=(i.n(n),i(2)),o=(i.n(s),i(4)),r=(i.n(o),i(1)),a=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),p=this&&this.__decorate||function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},l={DISABLED:"e-disabled",FOCUS:"e-focused",ICON:"e-menu-icon",ITEM:"e-item",POPUP:"e-dropdown-popup",RTL:"e-rtl",SEPARATOR:"e-separator",VERTICAL:"e-vertical"},c=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.isPopupCreated=!0,n}return a(t,e),t.prototype.preRender=function(){},t.prototype.getPersistData=function(){return this.addOnPersist([])},t.prototype.toggle=function(){this.canOpen()?this.openPopUp():this.closePopup()},t.prototype.render=function(){this.initialize(),this.disabled||this.wireEvents(),this.renderComplete()},t.prototype.addItems=function(e,t){for(var i,n=this.items.length,s=0,o=this.items.length;s<o;s++)if(t===this.items[s].text){n=s;break}for(var a=e.length-1;a>=0;a--)i=new r.b(this,"items",e[a],!0),this.items.splice(n,0,i);this.canOpen()||this.createItems()},t.prototype.removeItems=function(e,t){for(var i=!1,n=0,s=e.length;n<s;n++)for(var o=0,r=this.items.length;o<r;o++)if(e[n]===(t?this.items[o].id:this.items[o].text)){this.items.splice(o,1),i=!0;break}i&&this.getULElement()&&this.createItems()},t.prototype.createPopup=function(){var e,t=this.createElement("div",{className:l.POPUP,id:this.element.id+"-popup"});document.body.appendChild(t),this.dropDown=new o.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}),"fixed"===this.dropDown.element.style.position&&this.dropDown.refreshPosition(this.element),this.dropDown.hide(),i.i(n.attributes)(this.element,(e={},e["aria-haspopup"]=this.items.length||this.target?"true":"false",e["aria-expanded"]="false",e["aria-owns"]=this.getPopUpElement().id,e.type="button",e["aria-label"]=this.element.textContent?this.element.textContent:"dropdownbutton",e)),this.cssClass&&i.i(n.addClass)([t],this.cssClass.split(" ")),this.isPopupCreated=!0},t.prototype.getTargetElement=function(){return"string"==typeof this.target?i.i(n.select)(this.target):this.target},t.prototype.createItems=function(e){var t,s,o,a,p=this.items,c=this.hasIcon(this.items,"iconCss"),d=this.getULElement();d?d.innerHTML="":d=this.createElement("ul",{attrs:{role:"menu",tabindex:"0"}});for(var h=0;h<p.length;h++){s=p[h];var u=s.text;o=this.createElement("li",{innerHTML:s.url?"":u,className:s.separator?l.ITEM+" "+l.SEPARATOR:l.ITEM,attrs:{role:"menuItem",tabindex:"-1","aria-label":u},id:s.id?s.id:i.i(n.getUniqueID)("e-"+this.getModuleName()+"-item")}),this.enableHtmlSanitizer?o.textContent=s.url?"":u:o.innerHTML=s.url?"":u,s.url&&(o.appendChild(this.createAnchor(s)),o.classList.add("e-url")),s.iconCss?(t=this.createElement("span",{className:l.ICON+" "+s.iconCss}),s.url?o.childNodes[0].appendChild(t):o.insertBefore(t,o.childNodes[0])):c&&!s.separator&&o.classList.add("e-blank-icon"),s.disabled&&o.classList.add("e-disabled"),a={item:s,element:o},this.trigger("beforeItemRender",a),d.appendChild(o)}e&&this.getPopUpElement().appendChild(d),c&&i.i(r.c)(this.getPopUpElement())},t.prototype.hasIcon=function(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i][t])return!0;return!1},t.prototype.createAnchor=function(e){var t=this.enableHtmlSanitizer?n.SanitizeHtmlHelper.sanitize(e.text):e.text;return this.createElement("a",{className:"e-menu-text e-menu-url",innerHTML:t,attrs:{href:e.url}})},t.prototype.initialize=function(){this.button=new s.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=i.i(n.getUniqueID)("e-"+this.getModuleName())),this.appendArrowSpan(),this.setActiveElem([this.element]),this.target&&!this.isColorPicker()||!this.createPopupOnClick?this.createPopup():this.isPopupCreated=!1},t.prototype.isColorPicker=function(){if(!this.element)return!1;var e=this.element.previousSibling;return!!(e&&e.classList&&e.classList.contains("e-split-colorpicker"))},t.prototype.appendArrowSpan=function(){this.element.appendChild(this.createElement("span",{className:"e-btn-icon e-icons e-icon-"+(this.cssClass.indexOf(l.VERTICAL)>-1?"bottom":"right")+" e-caret"}))},t.prototype.setActiveElem=function(e){this.activeElem=e},t.prototype.getModuleName=function(){return"dropdown-btn"},t.prototype.canOpen=function(){var e=!1;return this.isPopupCreated&&(e=this.getPopUpElement().classList.contains("e-popup-close")),e},t.prototype.destroy=function(){var t=this;if(e.prototype.destroy.call(this),"dropdown-btn"===this.getModuleName()){var s;this.element.querySelector("span.e-caret")&&i.i(n.detach)(this.element.querySelector("span.e-caret")),this.cssClass&&(s=this.cssClass.split(" ")),this.button.destroy(),s&&i.i(n.removeClass)([this.element],s),i.i(n.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()}},t.prototype.destroyPopup=function(){if(this.isPopupCreated){if(this.dropDown.destroy(),this.getPopUpElement()){var e=document.getElementById(this.getPopUpElement().id);e&&(i.i(n.removeClass)([e],["e-popup-open","e-popup-close"]),i.i(n.detach)(e))}n.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),n.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler),this.isPopupCreated&&(this.dropDown=void 0)}this.isPopupCreated=!1},t.prototype.getPopUpElement=function(){var e=null;return this.dropDown&&(e=this.dropDown.element),e},t.prototype.getULElement=function(){var e=null;return this.getPopUpElement()&&(e=this.getPopUpElement().children[0]),e},t.prototype.wireEvents=function(){this.delegateMousedownHandler=this.mousedownHandler.bind(this),this.createPopupOnClick||n.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),n.EventHandler.add(this.element,"click",this.clickHandler,this),n.EventHandler.add(this.element,"keydown",this.keyBoardHandler,this)},t.prototype.popupWireEvents=function(){var e=this.getPopUpElement();this.createPopupOnClick&&n.EventHandler.add(document,"mousedown touchstart",this.delegateMousedownHandler,this),e&&(n.EventHandler.add(e,"click",this.clickHandler,this),n.EventHandler.add(e,"keydown",this.keyBoardHandler,this),this.closeActionEvents&&n.EventHandler.add(e,this.closeActionEvents,this.focusoutHandler,this)),this.rippleFn=i.i(n.rippleEffect)(e,{selector:"."+l.ITEM})},t.prototype.popupUnWireEvents=function(){var e=this.getPopUpElement();this.createPopupOnClick&&n.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),e&&e.parentElement&&(n.EventHandler.remove(e,"click",this.clickHandler),n.EventHandler.remove(e,"keydown",this.keyBoardHandler),this.closeActionEvents&&n.EventHandler.remove(e,this.closeActionEvents,this.focusoutHandler))},t.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)}},t.prototype.upDownKeyHandler=function(e){(!this.target||38!==e.keyCode&&40!==e.keyCode)&&(e.preventDefault(),i.i(r.d)(this.getULElement(),e.keyCode))},t.prototype.keyEventHandler=function(e){(!this.target||13!==e.keyCode&&9!==e.keyCode)&&(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)))},t.prototype.getLI=function(e){return"LI"===e.tagName?e:i.i(n.closest)(e,"li")},t.prototype.mousedownHandler=function(e){var t=e.target;!this.dropDown||this.canOpen()||i.i(n.closest)(t,'[id="'+this.getPopUpElement().id+'"]')||i.i(n.closest)(t,'[id="'+this.element.id+'"]')||this.closePopup(e)},t.prototype.focusoutHandler=function(e){this.isPopupCreated&&!this.canOpen()&&this.closePopup(e)},t.prototype.clickHandler=function(e){var t=e.target;if(i.i(n.closest)(t,'[id="'+this.element.id+'"]'))!this.createPopupOnClick||this.target&&!this.isColorPicker()?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));else if(i.i(n.closest)(t,'[id="'+this.getPopUpElement().id+'"]')){var s=void 0,o=void 0,r=void 0,a=this.getLI(t);a&&(o=Array.prototype.indexOf.call(this.getULElement().children,a),r=this.items[o],r&&(s={element:a,item:r},this.trigger("select",s)),this.closePopup(e,this.activeElem[0]))}},t.prototype.openPopUp=function(e){var t=this;void 0===e&&(e=null);var s=this.getPopUpElement();if(this.target)if(this.activeElem.length>1){var o=i.i(n.getComponent)(this.activeElem[0],"split-btn");o.isReact&&s.childNodes.length<1&&(!0,o.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates())}else this.isReact&&s.childNodes.length<1&&(!0,this.appendReactElement(this.getTargetElement(),this.getPopUpElement()),this.renderReactTemplates());else this.createItems(!0);var r=this.getULElement();this.popupWireEvents();var a={element:r,items:this.items,event:e,cancel:!1};this.trigger("beforeOpen",a,function(e){if(!e.cancel){var s=t.getULElement();t.dropDown.show(null,t.element),i.i(n.addClass)([t.element],"e-active"),t.element.setAttribute("aria-expanded","true"),s&&s.focus();var o={element:s,items:t.items};t.trigger("open",o)}})},t.prototype.closePopup=function(e,t){var s=this;void 0===e&&(e=null);var o=this.getULElement(),r={element:o,items:this.items,event:e,cancel:!1},a=this.getPopUpElement();a&&n.EventHandler.remove(a,"keydown",this.keyBoardHandler),this.trigger("beforeClose",r,function(e){if(!e.cancel){s.popupUnWireEvents();var o=s.getULElement(),r=void 0;o&&(r=o.querySelector(".e-selected")),r&&r.classList.remove("e-selected"),s.dropDown.hide(),i.i(n.removeClass)(s.activeElem,"e-active"),s.element.setAttribute("aria-expanded","false"),t&&t.focus();var a={element:o,items:s.items};s.trigger("close",a),!s.target&&o&&i.i(n.detach)(o),s.target&&!s.isColorPicker()||s.createPopupOnClick&&s.destroyPopup(),s.target&&(s.isPopupCreated=!s.createPopupOnClick)}})},t.prototype.unWireEvents=function(){this.createPopupOnClick||n.EventHandler.remove(document,"mousedown touchstart",this.delegateMousedownHandler),n.EventHandler.remove(this.element,"click",this.clickHandler),n.EventHandler.remove(this.element,"keydown",this.keyBoardHandler),this.isPopupCreated&&(n.EventHandler.remove(this.getPopUpElement(),"click",this.clickHandler),n.EventHandler.remove(this.getPopUpElement(),"keydown",this.keyBoardHandler))},t.prototype.onPropertyChanged=function(e,t){var s=["content","cssClass","iconCss","iconPosition","disabled","enableRtl"];this.button.setProperties(i.i(r.a)(e,s));var o;this.isPopupCreated&&(o=this.getPopUpElement(),this.dropDown.setProperties(i.i(r.a)(e,["enableRtl"])));for(var a=0,p=Object.keys(e);a<p.length;a++){switch(p[a]){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(e.cssClass.indexOf(l.VERTICAL)>-1){var c=this.element.querySelector("span.e-caret");i.i(n.classList)(c,["e-icon-bottom"],["e-icon-right"])}this.isPopupCreated&&(t.cssClass&&i.i(n.removeClass)([o],t.cssClass.split(" ")),e.cssClass&&i.i(n.addClass)([o],e.cssClass.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()}}},t.prototype.focusIn=function(){this.element.focus()},p([i.i(n.Property)("")],t.prototype,"content",void 0),p([i.i(n.Property)("")],t.prototype,"cssClass",void 0),p([i.i(n.Property)(!1)],t.prototype,"disabled",void 0),p([i.i(n.Property)("")],t.prototype,"iconCss",void 0),p([i.i(n.Property)("Left")],t.prototype,"iconPosition",void 0),p([i.i(n.Property)(!1)],t.prototype,"enableHtmlSanitizer",void 0),p([i.i(n.Collection)([],r.b)],t.prototype,"items",void 0),p([i.i(n.Property)(!1)],t.prototype,"createPopupOnClick",void 0),p([i.i(n.Property)("")],t.prototype,"target",void 0),p([i.i(n.Property)("")],t.prototype,"closeActionEvents",void 0),p([i.i(n.Event)()],t.prototype,"beforeItemRender",void 0),p([i.i(n.Event)()],t.prototype,"beforeOpen",void 0),p([i.i(n.Event)()],t.prototype,"beforeClose",void 0),p([i.i(n.Event)()],t.prototype,"close",void 0),p([i.i(n.Event)()],t.prototype,"open",void 0),p([i.i(n.Event)()],t.prototype,"select",void 0),p([i.i(n.Event)()],t.prototype,"created",void 0),t=p([n.NotifyPropertyChanges],t)}(n.Component)},function(e,t){e.exports=i},function(e,t,i){"use strict";var n=i(10);i.d(t,"a",function(){return n.a})},function(e,t,i){"use strict";var n=i(1);i.d(t,"a",function(){return n.a}),i.d(t,"b",function(){return n.d}),i.d(t,"c",function(){return n.c}),i.d(t,"d",function(){return n.b})},function(e,t,i){"use strict";var n=i(3);i.d(t,"a",function(){return n.a})},function(e,t,i){"use strict";var n=i(12);i.d(t,"a",function(){return n.a}),i.d(t,"b",function(){return n.b}),i.d(t,"c",function(){return n.c})},function(e,t,i){"use strict";var n=i(13);i.d(t,"a",function(){return n.a}),i.d(t,"b",function(){return n.b})},function(e,t,i){"use strict";function n(e,t,n){void 0===t&&(t={});var r,a,p,l;i.i(s.isNullOrUndefined)(n)&&(n=s.createElement);var c=document.querySelector(e);i.i(s.addClass)([c],["e-btn-group","e-css"]),c.setAttribute("role","group");var d=c.children;t.buttons=t.buttons||[];for(var h=0,u=0;u<d.length;h++,u++)r=d[u],null!==(l=t.buttons[h])&&("BUTTON"===r.tagName?a=r:(a=n("label"),p=d[u+1],p?c.insertBefore(a,p):c.appendChild(a),r.id&&a.setAttribute("for",r.id),l&&l.disabled&&(r.disabled=!0),u++),t.cssClass&&l&&!l.cssClass&&(l.cssClass=t.cssClass),new o.Button(l||{},a));return c}t.a=n;var s=i(0),o=(i.n(s),i(2));i.n(o)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(6);i.d(t,"getModel",function(){return n.a}),i.d(t,"upDownKeyHandler",function(){return n.b}),i.d(t,"setBlankIconStyle",function(){return n.c}),i.d(t,"Item",function(){return n.d});var s=i(7);i.d(t,"DropDownButton",function(){return s.a});var o=i(9);i.d(t,"SplitButton",function(){return o.a}),i.d(t,"Deferred",function(){return o.b});var r=i(5);i.d(t,"createButtonGroup",function(){return r.a});var a=i(8);i.d(t,"SpinSettings",function(){return a.a}),i.d(t,"AnimationSettings",function(){return a.b}),i.d(t,"ProgressButton",function(){return a.c})},function(e,t,i){"use strict";i.d(t,"a",function(){return l}),i.d(t,"b",function(){return c}),i.d(t,"c",function(){return d});var n=i(2),s=(i.n(n),i(0)),o=(i.n(s),i(4)),r=(i.n(o),this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}()),a=this&&this.__decorate||function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},p="e-btn-content",l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),a([i.i(s.Property)(null)],t.prototype,"template",void 0),a([i.i(s.Property)(16)],t.prototype,"width",void 0),a([i.i(s.Property)("Left")],t.prototype,"position",void 0),t}(s.ChildProperty),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),a([i.i(s.Property)(400)],t.prototype,"duration",void 0),a([i.i(s.Property)("None")],t.prototype,"effect",void 0),a([i.i(s.Property)("ease")],t.prototype,"easing",void 0),t}(s.ChildProperty),d=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.step=1,n}return r(t,e),t.prototype.preRender=function(){e.prototype.preRender.call(this)},t.prototype.render=function(){e.prototype.render.call(this),this.init(),this.wireEvents(),this.setAria(),this.renderComplete()},t.prototype.start=function(e){this.isPaused=!1,this.startProgress(e||this.percent,this.progressTime)},t.prototype.stop=function(){this.isPaused=!0,cancelAnimationFrame(this.timerId)},t.prototype.progressComplete=function(){this.isPaused=!1,this.finishProgress()},t.prototype.getModuleName=function(){return"progress-btn"},t.prototype.destroy=function(){var t=this,n=["e-hide-spinner","e-progress-active","e-round-corner","e-"+e.prototype.getModuleName.call(this),"e-spin-"+this.spinSettings.position.toLowerCase()];e.prototype.destroy.call(this),this.unWireEvents(),this.element.innerHTML="",this.cssClass&&(n=n.concat(this.cssClass.split(" "))),i.i(s.removeClass)([this.element],n),(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")},t.prototype.init=function(){this.element.classList.add("e-"+e.prototype.getModuleName.call(this)),this.setContent(),this.createSpinner(),this.enableProgress&&this.createProgress()},t.prototype.createSpinner=function(){var e=this.createElement("span",{className:"e-spinner"});this.setSpinPosition(e),i.i(o.createSpinner)({target:e,width:this.spinSettings.width||16,template:this.spinSettings.template},this.createElement)},t.prototype.getSpinner=function(){return this.element.getElementsByClassName("e-spinner")[0]},t.prototype.getProgress=function(){return this.element.getElementsByClassName("e-progress")[0]},t.prototype.setSpinPosition=function(e){var t=this.spinSettings.position||"Left";"Left"===t||"Top"===t?this.element.insertBefore(e,this.element.getElementsByClassName(p)[0]):this.element.appendChild(e),this.element.classList.add("e-spin-"+t.toLowerCase())},t.prototype.createProgress=function(){this.element.appendChild(this.createElement("span",{className:"e-progress"}))},t.prototype.setContent=function(){var e;e=this.element.innerHTML,this.enableHtmlSanitizer&&(e=s.SanitizeHtmlHelper.sanitize(this.element.innerHTML)),this.element.innerHTML="",this.element.appendChild(this.createElement("span",{className:p,innerHTML:e}))},t.prototype.setContentIcon=function(e){var t=this.createElement("span",{className:p,innerHTML:e});if(this.iconCss){var i=this.createElement("span",{className:"e-btn-icon "+this.iconCss});this.element.textContent.trim()?(i.classList.add("e-icon-"+this.iconPosition.toLowerCase()),"Top"!==this.iconPosition&&"Bottom"!==this.iconPosition||this.element.classList.add("e-"+this.iconPosition.toLowerCase()+"-icon-btn")):this.element.classList.add("e-icon-btn");var n=t.childNodes[0];!n||"Left"!==this.iconPosition&&"Top"!==this.iconPosition?t.appendChild(i):t.insertBefore(i,n)}this.element.appendChild(t)},t.prototype.clickHandler=function(){this.element.classList.contains("e-progress-active")||this.startProgress()},t.prototype.startProgress=function(e,t){var n=this.element.classList,s=n.contains("e-vertical");n.add("e-progress-active"),n.contains("e-hide-spinner")||i.i(o.showSpinner)(this.element),this.startAnimate(Date.now(),t||0,t?Date.now()-1*this.duration/100:Date.now(),e||0,0,this.step,0,s),this.startContAnimate()},t.prototype.startAnimate=function(e,t,i,n,s,o,r,a){var p=this;try{var l=e-i,c=this.duration*o/100,d=l?l<c?l-c:l%c:0;this.progressTime=t=t+l-d,i=e-d,n+=(l-d)/this.duration*100,s=(t-r)%c==0||100===n?n:s;var h={percent:s,currentDuration:t,step:o};this.eIsVertical=a,0===n?this.trigger("begin",h,function(e){p.successCallback(e,n,s,t,r,d,i)}):100===n||t===this.duration?this.trigger("end",h,function(e){p.successCallback(e,n,s,t,r,d,i)}):this.trigger("progress",h,function(e){p.successCallback(e,n,s,t,r,d,i)})}catch(e){cancelAnimationFrame(this.timerId),this.trigger("fail",e)}},t.prototype.successCallback=function(e,t,i,n,s,o,r){var a=this,p=t,l=i,c=o,d=n,h=s,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().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().style[m?"height":"width"]="0%"),a.element.setAttribute("aria-valuenow","0"),a.hideSpin()},100))},t.prototype.startContAnimate=function(){var e=this,t=this.element.getElementsByClassName(p)[0];"None"!==this.animationSettings.effect?new s.Animation({}).animate(t,{duration: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()},t.prototype.finishProgress=function(){var e=this.element.classList,t=e.contains("e-vertical");e.add("e-progress-active");for(var i=this.percent;i<100;i++)i+=10,i>100&&(i=100),this.enableProgress&&(this.getProgress().style[t?"height":"width"]=this.percent<100?i+"%":"100%");this.element.setAttribute("aria-valuenow","0"),this.hideSpin();var n={step:this.step,currentDuration:this.progressTime,percent:100};clearTimeout(this.interval),this.trigger("end",n),this.progressTime=this.percent=0},t.prototype.setSpinnerSize=function(){var e=this.element.getElementsByClassName(p)[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")},t.prototype.hideSpin=function(){var e=this.element.getElementsByClassName(p)[0];if(this.element.classList.contains("e-hide-spinner")||i.i(o.hideSpinner)(this.element),this.element.classList.remove("e-progress-active"),"None"!==this.animationSettings.effect&&e.classList.remove("e-animate-end"),"Center"===this.spinSettings.position){var t=this.getSpinner();e.classList.remove("e-cont-animate"),t.style.width="auto",t.style.height="auto"}},t.prototype.setIconSpan=function(){var e=this.element.getElementsByClassName(p)[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])},t.prototype.setAria=function(){i.i(s.attributes)(this.element,{"aria-label":this.element.textContent+" progress","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":"0"})},t.prototype.wireEvents=function(){s.EventHandler.add(this.element,"click",this.clickHandler,this)},t.prototype.unWireEvents=function(){s.EventHandler.remove(this.element,"click",this.clickHandler)},t.prototype.onPropertyChanged=function(t,n){var r=this.element,a=!1;this.element.querySelector(".e-spinner-pane").classList.contains("e-spin-show")&&(a=!0),e.prototype.onPropertyChanged.call(this,t,n);for(var p=0,l=Object.keys(t);p<l.length;p++){switch(l[p]){case"content":this.setContent(),this.createSpinner(),a&&(i.i(o.showSpinner)(this.element),a=!1),this.enableProgress&&this.createProgress(),r.setAttribute("aria-label",r.textContent+" progress");break;case"iconCss":n.iconCss||this.setIconSpan();break;case"iconPosition":this.setIconSpan();break;case"enableProgress":t.enableProgress?this.createProgress():i.i(s.remove)(this.getProgress());break;case"spinSettings":t.spinSettings.position&&(r.classList.remove("e-spin-"+n.spinSettings.position.toLowerCase()),this.setSpinPosition(this.getSpinner())),(t.spinSettings.template||t.spinSettings.width)&&(r.removeChild(this.getSpinner()),this.createSpinner())}}},t.prototype.focusIn=function(){this.element.focus()},a([i.i(s.Property)(!1)],t.prototype,"enableProgress",void 0),a([i.i(s.Property)(2e3)],t.prototype,"duration",void 0),a([i.i(s.Property)("Left")],t.prototype,"iconPosition",void 0),a([i.i(s.Property)("")],t.prototype,"iconCss",void 0),a([i.i(s.Property)(!1)],t.prototype,"disabled",void 0),a([i.i(s.Property)(!1)],t.prototype,"isPrimary",void 0),a([i.i(s.Property)("")],t.prototype,"cssClass",void 0),a([i.i(s.Property)("")],t.prototype,"content",void 0),a([i.i(s.Property)(!1)],t.prototype,"isToggle",void 0),a([i.i(s.Property)(!1)],t.prototype,"enableHtmlSanitizer",void 0),a([i.i(s.Complex)({},l)],t.prototype,"spinSettings",void 0),a([i.i(s.Complex)({},c)],t.prototype,"animationSettings",void 0),a([i.i(s.Event)()],t.prototype,"created",void 0),a([i.i(s.Event)()],t.prototype,"begin",void 0),a([i.i(s.Event)()],t.prototype,"progress",void 0),a([i.i(s.Event)()],t.prototype,"end",void 0),a([i.i(s.Event)()],t.prototype,"fail",void 0),t=a([s.NotifyPropertyChanges],t)}(n.Button)},function(e,t,i){"use strict";i.d(t,"a",function(){return d}),i.d(t,"b",function(){return h});var n=i(0),s=(i.n(n),i(2)),o=(i.n(s),i(1)),r=i(3),a=this&&this.__extends||function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),p=this&&this.__decorate||function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},l="e-rtl",c="EJS-SPLITBUTTON",d=function(e){function t(t,i){return e.call(this,t,i)||this}return a(t,e),t.prototype.preRender=function(){var e=this.element;if(e.tagName===c){for(var t=i.i(n.getValue)("ej2_instances",e),s=this.createElement("button",{attrs:{type:"button"}}),o=this.createElement(c,{className:"e-"+this.getModuleName()+"-wrapper"}),r=0,a=e.attributes.length;r<a;r++)s.setAttribute(e.attributes[r].nodeName,e.attributes[r].nodeValue);e.parentNode.insertBefore(o,e),i.i(n.detach)(e),e=s,o.appendChild(e),i.i(n.setValue)("ej2_instances",t,e),this.wrapper=o,this.element=e}this.element.id||(this.element.id=i.i(n.getUniqueID)("e-"+this.getModuleName()))},t.prototype.render=function(){this.initWrapper(),this.createPrimaryButton(),this.renderControl()},t.prototype.renderControl=function(){this.createSecondaryButton(),this.setActiveElem([this.element,this.secondaryBtnObj.element]),this.setAria(),this.wireEvents(),this.renderComplete()},t.prototype.addItems=function(t,i){e.prototype.addItems.call(this,t,i),this.secondaryBtnObj.items=this.items},t.prototype.removeItems=function(t,i){e.prototype.removeItems.call(this,t,i),this.secondaryBtnObj.items=this.items},t.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(l),this.cssClass&&i.i(n.addClass)([this.wrapper],this.cssClass.split(" "))},t.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 s.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)},t.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 i={cssClass:this.cssClass,disabled:this.disabled,enableRtl:this.enableRtl,items:this.items,target:this.target,createPopupOnClick:this.createPopupOnClick};i.beforeItemRender=function(t){e.createPopupOnClick&&(e.secondaryBtnObj.dropDown.relateTo=e.wrapper,e.dropDown=e.secondaryBtnObj.dropDown),e.trigger("beforeItemRender",t)},i.open=function(t){e.trigger("open",t)},i.close=function(t){e.trigger("close",t)},i.select=function(t){e.trigger("select",t)},i.beforeOpen=function(t){var i=new h;return e.trigger("beforeOpen",t,function(e){i.resolve(e)}),i},i.beforeClose=function(t){var i=new h;return e.trigger("beforeClose",t,function(e){i.resolve(e)}),i},this.secondaryBtnObj=new r.a(i),this.secondaryBtnObj.createElement=this.createElement,this.secondaryBtnObj.appendTo(t),this.createPopupOnClick||(this.secondaryBtnObj.dropDown.relateTo=this.wrapper,this.dropDown=this.secondaryBtnObj.dropDown),this.secondaryBtnObj.activeElem=[this.element,this.secondaryBtnObj.element],this.secondaryBtnObj.element.querySelector(".e-btn-icon").classList.remove("e-icon-right")},t.prototype.setAria=function(){i.i(n.attributes)(this.element,{"aria-expanded":"false","aria-haspopup":"true","aria-label":this.element.textContent+" splitbutton","aria-owns":this.element.id+"_dropdownbtn-popup"})},t.prototype.getModuleName=function(){return"split-btn"},t.prototype.toggle=function(){this.secondaryBtnObj.toggle()},t.prototype.destroy=function(){var t=this,s=[l];if(this.cssClass&&(s=s.concat(this.cssClass.split(" "))),this.element){var o=document.getElementById(this.element.id);o&&o.parentElement===this.wrapper&&(this.wrapper.tagName===c?(this.wrapper.innerHTML="",i.i(n.removeClass)([this.wrapper],["e-rtl","e-"+this.getModuleName()+"-wrapper"]),i.i(n.removeClass)([this.wrapper],this.cssClass.split(" "))):(i.i(n.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),i.i(n.remove)(this.wrapper)),this.unWireEvents())}this.primaryBtnObj.destroy(),this.secondaryBtnObj.destroy(),e.prototype.destroy.call(this),this.element.getAttribute("class")||this.element.removeAttribute("class")},t.prototype.wireEvents=function(){n.EventHandler.add(this.element,"click",this.primaryBtnClickHandler,this),new n.KeyboardEvents(this.element,{keyAction:this.btnKeyBoardHandler.bind(this),keyConfigs:{altdownarrow:"alt+downarrow"}})},t.prototype.unWireEvents=function(){n.EventHandler.remove(this.element,"click",this.primaryBtnClickHandler),i.i(n.getInstance)(this.element,n.KeyboardEvents).destroy()},t.prototype.primaryBtnClickHandler=function(){this.trigger("click",{element:this.element})},t.prototype.btnKeyBoardHandler=function(e){switch(e.action){case"altdownarrow":this.clickHandler(e)}},t.prototype.onPropertyChanged=function(e,t){var s=["content","iconCss","iconPosition","cssClass","disabled","enableRtl"];this.primaryBtnObj.setProperties(i.i(o.a)(e,s)),s=["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(i.i(o.a)(e,s));for(var r=0,a=Object.keys(e);r<a.length;r++){switch(a[r]){case"cssClass":t.cssClass&&i.i(n.removeClass)([this.wrapper],t.cssClass.split(" ")),i.i(n.addClass)([this.wrapper],e.cssClass.split(" "));break;case"enableRtl":e.enableRtl?i.i(n.addClass)([this.wrapper],l):i.i(n.removeClass)([this.wrapper],l)}}},t.prototype.focusIn=function(){this.element.focus()},p([i.i(n.Property)("")],t.prototype,"content",void 0),p([i.i(n.Property)("")],t.prototype,"cssClass",void 0),p([i.i(n.Property)(!1)],t.prototype,"disabled",void 0),p([i.i(n.Property)("")],t.prototype,"iconCss",void 0),p([i.i(n.Property)("Left")],t.prototype,"iconPosition",void 0),p([i.i(n.Property)(!1)],t.prototype,"createPopupOnClick",void 0),p([i.i(n.Collection)([],o.b)],t.prototype,"items",void 0),p([i.i(n.Property)("")],t.prototype,"target",void 0),p([i.i(n.Event)()],t.prototype,"beforeItemRender",void 0),p([i.i(n.Event)()],t.prototype,"beforeOpen",void 0),p([i.i(n.Event)()],t.prototype,"beforeClose",void 0),p([i.i(n.Event)()],t.prototype,"click",void 0),p([i.i(n.Event)()],t.prototype,"close",void 0),p([i.i(n.Event)()],t.prototype,"open",void 0),p([i.i(n.Event)()],t.prototype,"select",void 0),p([i.i(n.Event)()],t.prototype,"created",void 0),t=p([n.NotifyPropertyChanges],t)}(r.a),h=function(){function e(){var e=this;this.promise=new Promise(function(t,i){e.resolve=t,e.reject=i}),this.catch=this.promise.catch.bind(this.promise),this.then=this.promise.then.bind(this.promise)}return e}()}])});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-splitbuttons.umd.min.js
|
|
3
|
-
* version : 20.
|
|
3
|
+
* version : 20.3.52
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-splitbuttons.min.js
|
|
3
|
-
* version : 20.
|
|
3
|
+
* version : 20.3.52
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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
|
package/dist/global/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: index.d.ts
|
|
3
|
-
* version : 20.
|
|
3
|
+
* version : 20.3.52
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2020. 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
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { addClass, createElement as internalCreateElement, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
|
+
import { ButtonModel, Button } from '@syncfusion/ej2-buttons';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Initialize ButtonGroup CSS component with specified properties.
|
|
6
|
+
* ```html
|
|
7
|
+
* <div id='buttongroup'>
|
|
8
|
+
* <button></button>
|
|
9
|
+
* <button></button>
|
|
10
|
+
* <button></button>
|
|
11
|
+
* </div>
|
|
12
|
+
* ```
|
|
13
|
+
* ```typescript
|
|
14
|
+
* createButtonGroup('#buttongroup', {
|
|
15
|
+
* cssClass: 'e-outline',
|
|
16
|
+
* buttons: [
|
|
17
|
+
* { content: 'Day' },
|
|
18
|
+
* { content: 'Week' },
|
|
19
|
+
* { content: 'Work Week'}
|
|
20
|
+
* ]
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param {string} selector
|
|
25
|
+
* @param {CreateButtonGroupModel} options
|
|
26
|
+
* @returns HTMLElement
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Creates button group.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} selector - Specifies the selector.
|
|
33
|
+
* @param {CreateButtonGroupModel} options - Specifies the button group model.
|
|
34
|
+
* @param {Function} createElement - Specifies the element.
|
|
35
|
+
* @returns {HTMLElement} - Button group element.
|
|
36
|
+
*/
|
|
37
|
+
export function createButtonGroup(selector: string, options: CreateButtonGroupModel = {}, createElement?: Function): HTMLElement {
|
|
38
|
+
let child: Element;
|
|
39
|
+
let btnElem: Element;
|
|
40
|
+
let nextChild: Element;
|
|
41
|
+
let btnModel: ButtonModel | null;
|
|
42
|
+
if (isNullOrUndefined(createElement)) {
|
|
43
|
+
createElement = internalCreateElement;
|
|
44
|
+
}
|
|
45
|
+
const wrapper: HTMLElement = document.querySelector(selector) as HTMLElement;
|
|
46
|
+
addClass([wrapper], ['e-btn-group', 'e-css']);
|
|
47
|
+
wrapper.setAttribute('role', 'group');
|
|
48
|
+
const childs: HTMLCollection = wrapper.children;
|
|
49
|
+
options.buttons = options.buttons || [] as ButtonModel[];
|
|
50
|
+
for (let i: number = 0, j: number = 0; j < childs.length; i++, j++) {
|
|
51
|
+
child = childs[j];
|
|
52
|
+
btnModel = options.buttons[i];
|
|
53
|
+
if (btnModel !== null) {
|
|
54
|
+
if (child.tagName === 'BUTTON') {
|
|
55
|
+
btnElem = child;
|
|
56
|
+
} else {
|
|
57
|
+
btnElem = createElement('label');
|
|
58
|
+
nextChild = childs[j + 1];
|
|
59
|
+
if (nextChild) {
|
|
60
|
+
wrapper.insertBefore(btnElem, nextChild);
|
|
61
|
+
} else {
|
|
62
|
+
wrapper.appendChild(btnElem);
|
|
63
|
+
}
|
|
64
|
+
if (child.id) {
|
|
65
|
+
btnElem.setAttribute('for', child.id);
|
|
66
|
+
}
|
|
67
|
+
if (btnModel && btnModel.disabled) {
|
|
68
|
+
(child as HTMLInputElement).disabled = true;
|
|
69
|
+
}
|
|
70
|
+
j++;
|
|
71
|
+
}
|
|
72
|
+
if (options.cssClass && btnModel && !btnModel.cssClass) {
|
|
73
|
+
btnModel.cssClass = options.cssClass;
|
|
74
|
+
}
|
|
75
|
+
new Button(btnModel || {}, btnElem as HTMLButtonElement);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return wrapper;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface CreateButtonGroupModel {
|
|
82
|
+
cssClass?: string;
|
|
83
|
+
buttons?: (ButtonModel | null)[];
|
|
84
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { ChildProperty, extend, deleteObject, Property, BaseEventArgs, addClass, isNullOrUndefined } from '@syncfusion/ej2-base';
|
|
2
|
+
import { ItemModel } from './common-model';
|
|
3
|
+
/**
|
|
4
|
+
* Defines the icon position of Split Button.
|
|
5
|
+
*/
|
|
6
|
+
export type SplitButtonIconPosition = 'Left' | 'Top';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {Object} props - Specifies the properties
|
|
10
|
+
* @param {string[]} model - Specifies the model
|
|
11
|
+
* @returns {Object} Component Model
|
|
12
|
+
*/
|
|
13
|
+
export function getModel(props: Object, model: string[]): Object {
|
|
14
|
+
|
|
15
|
+
const obj: Object = extend({}, props);
|
|
16
|
+
for (const prop of Object.keys(obj)) {
|
|
17
|
+
if ((model).indexOf(prop) < 0) {
|
|
18
|
+
deleteObject(obj, prop);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return obj as Object;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** @hidden
|
|
26
|
+
* @param {HTMLElement} ul - Specifies the UL element
|
|
27
|
+
* @param {number} keyCode - Specifies the keycode
|
|
28
|
+
* @returns {void}
|
|
29
|
+
*/
|
|
30
|
+
export function upDownKeyHandler(ul: HTMLElement, keyCode: number): void {
|
|
31
|
+
const defaultIdx: number = keyCode === 40 ? 0 : ul.childElementCount - 1;
|
|
32
|
+
let liIdx: number = defaultIdx;
|
|
33
|
+
let li: Element;
|
|
34
|
+
const selectedLi: Element = ul.querySelector('.e-selected');
|
|
35
|
+
if (selectedLi) { selectedLi.classList.remove('e-selected'); }
|
|
36
|
+
for (let i: number = 0, len: number = ul.children.length; i < len; i++) {
|
|
37
|
+
if (ul.children[i].classList.contains('e-focused')) {
|
|
38
|
+
li = ul.children[i];
|
|
39
|
+
liIdx = i;
|
|
40
|
+
li.classList.remove('e-focused');
|
|
41
|
+
if (keyCode === 40) {
|
|
42
|
+
liIdx++;
|
|
43
|
+
} else {
|
|
44
|
+
liIdx--;
|
|
45
|
+
}
|
|
46
|
+
if (liIdx === (keyCode === 40 ? ul.childElementCount : -1)) {
|
|
47
|
+
liIdx = defaultIdx;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
li = ul.children[liIdx];
|
|
52
|
+
liIdx = isValidLI(ul, li, liIdx, keyCode);
|
|
53
|
+
if (liIdx !== -1) {
|
|
54
|
+
addClass([ul.children[liIdx]], 'e-focused');
|
|
55
|
+
(ul.children[liIdx] as HTMLElement).focus();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Get Valid LI element
|
|
61
|
+
*
|
|
62
|
+
* @param {HTMLElement} ul - Specifies the UL element
|
|
63
|
+
* @param {Element} li - Specifies the LI element
|
|
64
|
+
* @param {number} index - Specifies the index
|
|
65
|
+
* @param {number} keyCode - Specifies the keycode
|
|
66
|
+
* @param {number} count - Specifies the count
|
|
67
|
+
* @returns {number} - Index
|
|
68
|
+
*/
|
|
69
|
+
function isValidLI(ul: HTMLElement, li: Element, index: number, keyCode: number, count: number = 0): number {
|
|
70
|
+
if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) {
|
|
71
|
+
if (index === (keyCode === 40 ? ul.childElementCount - 1 : 0)) {
|
|
72
|
+
index = keyCode === 40 ? 0 : ul.childElementCount - 1;
|
|
73
|
+
} else {
|
|
74
|
+
if (keyCode === 40) {
|
|
75
|
+
index++;
|
|
76
|
+
} else {
|
|
77
|
+
index--;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
li = ul.children[index];
|
|
82
|
+
if (li.classList.contains('e-separator') || li.classList.contains('e-disabled')) {
|
|
83
|
+
count++;
|
|
84
|
+
if (count === ul.childElementCount) {
|
|
85
|
+
return index = -1;
|
|
86
|
+
}
|
|
87
|
+
index = isValidLI(ul, li, index, keyCode, count);
|
|
88
|
+
}
|
|
89
|
+
return index;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** @hidden
|
|
93
|
+
* @param {HTMLElement} popup - Specifies the popup element.
|
|
94
|
+
* @returns {void}
|
|
95
|
+
*/
|
|
96
|
+
export function setBlankIconStyle(popup: HTMLElement): void {
|
|
97
|
+
const blankIconList: HTMLElement[] = [].slice.call(popup.getElementsByClassName('e-blank-icon'));
|
|
98
|
+
if (!blankIconList.length) { return; }
|
|
99
|
+
let iconLi: HTMLElement = popup.querySelector('.e-item:not(.e-blank-icon):not(.e-separator)') as HTMLElement;
|
|
100
|
+
if (isNullOrUndefined(iconLi)) {return; }
|
|
101
|
+
if (iconLi.classList.contains('e-url')) { iconLi = iconLi.querySelector('.e-menu-url'); }
|
|
102
|
+
const icon: HTMLElement = iconLi.querySelector('.e-menu-icon') as HTMLElement;
|
|
103
|
+
let cssProp: { padding: string, margin: string };
|
|
104
|
+
const enableRtl: boolean = popup.classList.contains('e-rtl');
|
|
105
|
+
if (enableRtl) {
|
|
106
|
+
cssProp = { padding: 'paddingRight', margin: 'marginLeft' };
|
|
107
|
+
} else {
|
|
108
|
+
cssProp = { padding: 'paddingLeft', margin: 'marginRight' };
|
|
109
|
+
}
|
|
110
|
+
/* eslint-disable */
|
|
111
|
+
let size: string = `${parseInt(getComputedStyle(icon).fontSize, 10) + parseInt(
|
|
112
|
+
(enableRtl ? (getComputedStyle(icon) as any)[cssProp.margin] : (getComputedStyle(icon) as any)[cssProp.margin]), 10)
|
|
113
|
+
+ parseInt(getComputedStyle(iconLi).paddingLeft, 10)}px`;
|
|
114
|
+
blankIconList.forEach((li: HTMLElement): void => {
|
|
115
|
+
if (li.classList.contains('e-url')) {
|
|
116
|
+
((li.querySelector('.e-menu-url') as HTMLElement).style as any)[cssProp.padding] = size;
|
|
117
|
+
} else {
|
|
118
|
+
(li.style as any)[cssProp.padding] = size;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
/* eslint-enable */
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Defines the items of Split Button/DropDownButton.
|
|
126
|
+
*/
|
|
127
|
+
export class Item extends ChildProperty<Item> {
|
|
128
|
+
/**
|
|
129
|
+
* Defines class/multiple classes separated by a space for the item that is used to include an icon.
|
|
130
|
+
* Action item can include font icon and sprite image.
|
|
131
|
+
*
|
|
132
|
+
* @default ''
|
|
133
|
+
*/
|
|
134
|
+
@Property('')
|
|
135
|
+
public iconCss: string;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Specifies the id for item.
|
|
139
|
+
*
|
|
140
|
+
* @default ''
|
|
141
|
+
*/
|
|
142
|
+
@Property('')
|
|
143
|
+
public id: string;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Specifies separator between the items. Separator are horizontal lines used to group action items.
|
|
147
|
+
*
|
|
148
|
+
* @default false
|
|
149
|
+
*/
|
|
150
|
+
@Property(false)
|
|
151
|
+
public separator: boolean;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Specifies text for item.
|
|
155
|
+
*
|
|
156
|
+
* @default ''
|
|
157
|
+
*/
|
|
158
|
+
@Property('')
|
|
159
|
+
public text: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Specifies url for item that creates the anchor link to navigate to the url provided.
|
|
163
|
+
*
|
|
164
|
+
* @default ''
|
|
165
|
+
*/
|
|
166
|
+
@Property('')
|
|
167
|
+
public url: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Used to enable or disable the item.
|
|
171
|
+
*
|
|
172
|
+
* @default false
|
|
173
|
+
*/
|
|
174
|
+
@Property(false)
|
|
175
|
+
public disabled: boolean;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Interface for before item render / select event.
|
|
180
|
+
*/
|
|
181
|
+
export interface MenuEventArgs extends BaseEventArgs {
|
|
182
|
+
element: HTMLElement;
|
|
183
|
+
item: ItemModel;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Interface for before open / close event.
|
|
188
|
+
*/
|
|
189
|
+
export interface BeforeOpenCloseMenuEventArgs extends BaseEventArgs {
|
|
190
|
+
element: HTMLElement;
|
|
191
|
+
items: ItemModel[];
|
|
192
|
+
event: Event;
|
|
193
|
+
cancel?: boolean;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Interface for open/close event.
|
|
198
|
+
*/
|
|
199
|
+
export interface OpenCloseMenuEventArgs extends BaseEventArgs {
|
|
200
|
+
element: HTMLElement;
|
|
201
|
+
items: ItemModel[];
|
|
202
|
+
parentItem?: ItemModel;
|
|
203
|
+
}
|