@syncfusion/ej2-multicolumn-combobox 26.1.38 → 26.1.39

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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-multicolumn-combobox.min.js
3
- * version : 26.1.38
3
+ * version : 26.1.39
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
- this.ej=this.ej||{},this.ej.multicolumncombobox=function(t,e,i,r,o,n){"use strict";var s=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),a=function(t,e,i,r){var o,n=arguments.length,s=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,r);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,i,s):o(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},l="e-nodata",p=function(){function t(){}return t.prototype.InjectModules=function(){n.Grid.Inject(n.VirtualScroll,n.Group,n.Edit,n.Sort)},t}();!function(t){t.StartsWith="StartsWith",t.EndsWith="EndsWith",t.Contains="Contains"}(t.FilterType||(t.FilterType={})),function(t){t.None="None",t.Ascending="Ascending",t.Descending="Descending"}(t.SortOrder||(t.SortOrder={})),function(t){t.OneColumn="OneColumn",t.MultipleColumns="MultipleColumns"}(t.SortType||(t.SortType={}));var u=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),a([e.Property()],i.prototype,"text",void 0),a([e.Property()],i.prototype,"value",void 0),a([e.Property()],i.prototype,"groupBy",void 0),i}(e.ChildProperty),d=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),a([e.Property("")],i.prototype,"field",void 0),a([e.Property("")],i.prototype,"header",void 0),a([e.Property("")],i.prototype,"width",void 0),a([e.Property("")],i.prototype,"textAlign",void 0),a([e.Property(null)],i.prototype,"format",void 0),a([e.Property(!1)],i.prototype,"displayAsCheckBox",void 0),a([e.Property(null)],i.prototype,"template",void 0),a([e.Property(null)],i.prototype,"headerTemplate",void 0),a([e.Property(null)],i.prototype,"customAttributes",void 0),i}(e.ChildProperty),h=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),a([e.Property(!1)],i.prototype,"enableAltRow",void 0),a([e.Property(null)],i.prototype,"rowHeight",void 0),a([e.Property("Default")],i.prototype,"gridLines",void 0),i}(e.ChildProperty),c=function(c){function g(t,e){var i=c.call(this,t,e)||this;return i.gridInject=new p,i.gridInject.InjectModules(),i}return s(g,c),g.prototype.preRender=function(){this.element.id||(this.element.id=e.getUniqueID("e-"+this.getModuleName())),this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveUp:"uparrow"},this.matchedRowEle=this.matchedContent=null,this.persistData()},g.prototype.getDirective=function(){return"EJS-MULTICOLUMNCOMBOBOX"},g.prototype.getModuleName=function(){return"multicolumncombobox"},g.prototype.getPersistData=function(){return this.addOnPersist(["value"])},g.prototype.persistData=function(){if(this.enablePersistence){this.element.id=this.element.id+"_wrapper";var t=window.localStorage.getItem(this.getModuleName()+this.element.id);e.isNullOrUndefined(t)||""===t||this.setProperties(JSON.parse(t),!0)}},g.prototype.render=function(){this.renderGrid(),this.renderInput(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.appendChild(this.gridEle),this.setHTMLAttributes(),this.renderPopup(),this.wireEvents()},g.prototype.renderGrid=function(){var i=this,r=this.getGridColumns();this.gridObj=new n.Grid({dataSource:this.dataSource,columns:r,allowSorting:this.allowSorting,enableStickyHeader:!0,gridLines:this.gridSettings.gridLines,rowHeight:this.gridSettings.rowHeight,enableAltRow:this.gridSettings.enableAltRow,enableVirtualization:this.enableVirtualization,enableRtl:this.enableRtl,editSettings:{allowAdding:!1},query:this.query,height:this.popupHeight,allowMultiSorting:"multiplecolumns"===this.sortType.toString().toLowerCase()&&this.allowSorting,rowTemplate:this.itemTemplate,dataBound:function(){i.onDataBound()},actionFailure:function(t){i.onActionFailure(t)},actionBegin:function(t){i.trigger("actionBegin",t)},actionComplete:function(t){i.trigger("actionComplete",t),"sorting"===t.requestType&&i.updateRowSelection(t);var e=t.rows;i.isDataFiltered&&e.length>0&&""!==i.inputEle.value&&"sorting"!==t.requestType&&i.gridObj.getRows()[0].classList.add("e-row-focus"),i.popupObj.refreshPosition()},keyPressed:function(t){"Enter"===t.key&&(t.cancel=!0,i.isPopupOpen&&(i.selectedGridRow(i.gridObj.getRows()[i.gridObj.selectedRowIndex],t,!0),i.hidePopup(t),i.focusIn(t))),i.fields.groupBy&&(t.cancel=!0,i.gridKeyActionHandler(t,!0))}}),this.gridEle=this.createElement("div",{id:e.getUniqueID("grid"),className:"e-multicolumn-grid"}),this.updateGroupByField();var o=this.sortOrder.toString().toLowerCase();this.gridObj.columns[0].isPrimaryKey=!0,"none"!==o&&(this.gridObj.sortSettings={columns:[{field:this.fields.text,direction:"ascending"===o?t.SortOrder.Ascending:t.SortOrder.Descending}]}),this.gridObj.appendTo(this.gridEle)},g.prototype.isRowMatching=function(t,e,i){var r=Object.values(t).map(String);return r.includes(e)&&r.includes(i)},g.prototype.updateRowSelection=function(t){var e=this;t&&t.rows.forEach(function(t){var i=t.data,r=t.index;e.selectDataRow(i,r)})},g.prototype.selectDataRow=function(t,e){if(this.isRowMatching(t,this.value?this.value.toString():"",this.text?this.text.toString():"")){this.gridObj.selectRow(e);var i=this.isProtectedOnChange;return this.isProtectedOnChange=!0,this.index=e,void(this.isProtectedOnChange=i)}},g.prototype.findIndex=function(t,e){return t.findIndex(function(t){return Object.keys(e).every(function(i){return t[i]===e[i]})})},g.prototype.getGridColumns=function(){var t=this;return this.columns.map(function(e){return{field:e.field,headerText:e.header,width:e.width,textAlign:""===e.textAlign&&t.enableRtl?"Right":e.textAlign,format:e.format,displayAsCheckBox:e.displayAsCheckBox,template:e.template,headerTemplate:e.headerTemplate,customAttributes:e.customAttributes,type:e.displayAsCheckBox?"boolean":"string"}})},g.prototype.updateGroupByField=function(){if(""!==this.fields.groupBy&&!e.isNullOrUndefined(this.fields.groupBy)){"multiplecolumns"!==this.sortType.toString().toLowerCase()&&this.gridEle.classList.add("e-multicolumn-group");var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.gridObj.allowGrouping=!0,this.gridObj.groupSettings={showDropArea:!1,columns:[this.fields.groupBy],captionTemplate:this.groupTemplate&&""!==this.fields.groupBy&&!e.isNullOrUndefined(this.fields.groupBy)?this.groupTemplate:"${key}"},this.isVue&&(this.gridObj.isVue=this.isVue),this.isProtectedOnChange=t}},g.prototype.onDataBound=function(){var t=this.dataSource.length,i=this.popupDiv.querySelector(".e-multicolumn-grid");if(t<=0&&i)this.l10nUpdate(),this.popupDiv.removeChild(this.gridEle),e.addClass([this.popupDiv],[l]);else if(this.popupDiv.classList.contains(l)&&t>=1){e.removeClass([this.popupDiv],[l]);var r=this.popupDiv.querySelector(".e-no-records");r&&this.popupDiv.removeChild(r)}},g.prototype.onActionFailure=function(t){this.trigger("actionFailure",t),this.l10nUpdate(!0),e.addClass([this.popupDiv],[l])},g.prototype.renderInput=function(){"INPUT"===this.element.tagName?(this.inputEle=this.element,e.isNullOrUndefined(this.inputEle.getAttribute("role"))&&this.inputEle.setAttribute("role","combobox"),e.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text"),this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("aria-readOnly",this.readonly.toString()),this.inputEle.setAttribute("aria-disabled",this.disabled.toString()),this.inputEle.setAttribute("tabindex","0")):(this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=i.Input.createInput({element:this.inputEle,buttons:["e-input-group-icon e-multicolumn-list-icon e-icons"],floatLabelType:this.floatLabelType,properties:{enabled:!this.disabled,readonly:this.readonly,placeholder:this.placeholder,enableRtl:this.enableRtl,showClearButton:this.showClearButton,cssClass:this.cssClass}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.add("e-multicolumn-list"),this.inputWrapper.setAttribute("spellcheck","false"),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.setElementWidth(this.width),e.isNullOrUndefined(this.value)&&e.isNullOrUndefined(this.text)&&e.isNullOrUndefined(this.index)||this.initValue(null,null,!0)},g.prototype.setElementWidth=function(t){var i=this.inputWrapper;e.isNullOrUndefined(t)||("number"==typeof t?i.style.width=e.formatUnit(t):"string"==typeof t&&(i.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)))},g.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var r=e[t];"class"===r?this.inputWrapper.classList.add(this.htmlAttributes[""+r]):"disabled"===r?(this.setProperties({enabled:!1},!0),this.setEnable()):"readonly"===r?(this.setProperties({readonly:!0},!0),this.dataBind()):"style"===r?this.inputWrapper.setAttribute("style",this.htmlAttributes[""+r]):["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"].indexOf(r)>-1&&"placeholder"===r?i.Input.setPlaceholder(this.htmlAttributes[""+r],this.inputEle):this.inputEle.setAttribute(r,this.htmlAttributes[""+r])}},g.prototype.setEnable=function(){i.Input.setEnabled(!this.disabled,this.inputEle),this.disabled?(this.isPopupOpen&&this.hidePopup(),e.addClass([this.inputWrapper],"e-disabled"),this.inputWrapper&&this.inputWrapper.classList.contains("e-input-focus")&&e.removeClass([this.inputWrapper],["e-input-focus"]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true")):(e.removeClass([this.inputWrapper],"e-disabled"),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false"))},g.prototype.initValue=function(t,i,o){var n,s,a,l,p=this,u=this.gridObj.getSelectedRecords()[0],d=this.gridObj.getSelectedRows()[0],h=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=this.value?this.value.toString():this.value,this.isProtectedOnChange=h;var c=function(t){var e=p.updateCurrentValues(n,t);s=e.currentValue,a=e.currentText,l=e.currentIndex};if(!t&&(!e.isNullOrUndefined(this.value)||!e.isNullOrUndefined(this.text))||t&&void 0!==i){var g=t?i?this.value:this.text:e.isNullOrUndefined(this.value)?this.text:this.value;!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof r.DataManager?this.dataSource.executeQuery(new r.Query).then(function(r){var h=r.result,f=h.filter(function(r){return r[t?i?p.fields.value:p.fields.text:e.isNullOrUndefined(p.value)?p.fields.text:p.fields.value].toString()===g});f.length>0&&(n=f[0],c(h),p.updateChangeEvent(n,u,d,s,a,l,t,o),p.gridObj.selectRow(p.index))}):!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof Array&&(n=this.dataSource.filter(function(r){return r[t?i?p.fields.value:p.fields.text:e.isNullOrUndefined(p.value)?p.fields.text:p.fields.value].toString()===g})[0],c(this.dataSource))}else e.isNullOrUndefined(this.index)||(!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof r.DataManager?this.dataSource.executeQuery(new r.Query).then(function(e){var i=e.result;n=i[p.index],c(i),p.updateChangeEvent(n,u,d,s,a,l,t,o),p.gridObj.selectRow(p.index)}):!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof Array&&(n=this.dataSource[this.index],c(this.dataSource)));this.dataSource instanceof r.DataManager||this.updateChangeEvent(n,u,d,s,a,l,t,o)},g.prototype.updateChangeEvent=function(t,e,i,r,o,n,s,a){var l={value:t?t[this.fields.value].toString():null,itemData:{text:o,value:r},item:this.getDataByValue(this.value),previousItemData:e,previousItemElement:i,itemElement:this.inputWrapper,event:null,isInteracted:!s};this.updateValues(r,o,n,l,a)},g.prototype.updateCurrentValues=function(t,r){return e.isNullOrUndefined(t)?{currentValue:null,currentText:null,currentIndex:null}:(i.Input.setValue(t[this.fields.text].toString(),this.inputEle,this.floatLabelType,this.showClearButton),{currentValue:t[this.fields.value].toString(),currentText:t[this.fields.text].toString(),currentIndex:r.indexOf(t)})},g.prototype.renderPopup=function(){this.popupEle=this.createElement("div",{id:this.element.id+"_options",className:"e-multicolumn-list e-popup "+(null!==this.cssClass?this.cssClass:"")}),e.attributes(this.popupEle,{"aria-label":this.element.id,role:"dialog"}),document.body.appendChild(this.popupEle),this.createPopup(this.popupEle),e.prepend([this.popupDiv],this.popupEle),this.footerTemplate&&this.setFooterTemplate();var t=this.getSize(!1);if(this.popupEle.style.maxHeight=t,this.footerTemplate){this.footer=this.footer?this.footer:this.popupEle.querySelector(".e-popup-footer");var i=Math.round(this.footer.getBoundingClientRect().height);t=e.formatUnit(parseInt(t,10)-i+"px")}this.popupDiv.style.maxHeight=t,this.popupRowHeight=this.popupDiv.querySelector(".e-gridcontent tr").getBoundingClientRect().height,this.updateGridHeight(),this.popupObj.hide()},g.prototype.updateGridHeight=function(t,i,r){var o;if(t){var n=this.gridObj.getContent().querySelector(".e-content"),s=n.offsetHeight-n.clientHeight,a=r*this.popupRowHeight;""===this.fields.groupBy||e.isNullOrUndefined(this.fields.groupBy)||(a+=this.popupRowHeight),o=i&&a<this.prevGridHeight?a+s+"px":this.prevGridHeight+"px"}else this.prevGridHeight=this.popupDiv.getBoundingClientRect().height-this.popupDiv.querySelector(".e-gridheader").getBoundingClientRect().height,o=this.prevGridHeight+"px";var l=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.gridObj.height=o,this.isProtectedOnChange=l},g.prototype.createPopup=function(t){var i=this;this.popupObj=new o.Popup(t,{width:this.getSize(!0),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},targetExitViewport:function(){e.Browser.isDevice||i.hidePopup()}})},g.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),e.addClass([this.footer],"e-popup-footer"));var t=this.getTemplateFunction(this.footerTemplate)({count:this.dataSource.length},this,"footerTemplate",this.element.id+"footerTemplate",this.isStringTemplate,void 0,this.footer);t&&(t=Array.prototype.slice.call(t),e.append(t,this.footer)),e.append([this.footer],this.popupEle)},g.prototype.l10nUpdate=function(t){if(this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No records found"!==this.noRecordsTemplate||"Request Failed"!==this.actionFailureTemplate){var i=t?this.actionFailureTemplate:this.noRecordsTemplate,r=t?this.element.id+"_actionFailure":this.element.id+"_noRecords",o=t?"actionFailureTemplate":"noRecordsTemplate",n=this.getTemplateFunction(i)({},this,o,r,this.isStringTemplate,void 0,this.noRecord);n&&(n=Array.prototype.slice.call(n),e.append(n,this.noRecord))}else{var s={noRecordsTemplate:"No records found",actionFailureTemplate:"Request Failed"};this.l10n=new e.L10n("multicolumncombobox",s,this.locale),this.noRecord.innerHTML=t?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}e.addClass([this.noRecord],"e-no-records"),e.prepend([this.noRecord],this.popupDiv),this.popupObj.refreshPosition()},g.prototype.getTemplateFunction=function(t){if("string"==typeof t){var i="";try{var r=e.select(t);i=r?"SCRIPT"===r.tagName?r.innerHTML:r.outerHTML:t}catch(e){i=t}return e.compile(i)}return e.compile(t)},g.prototype.getSize=function(t){var i=t?this.popupWidth:this.popupHeight,r=e.formatUnit(i);return r.indexOf("%")>-1?r=((t?this.inputWrapper.offsetWidth:document.documentElement.clientHeight)*parseFloat(r)/100).toString()+"px":"string"==typeof i&&(r=i.match(/px|em/)?i:r),r},g.prototype.selectedGridRow=function(t,e,r){var o=this,n={isInteracted:!!e,item:this.gridObj.getSelectedRecords()[0],itemElement:t,itemData:this.gridObj.getSelectedRecords()[0],event:e,cancel:!1},s=this.gridObj.getSelectedRecords()[0],a=s?s[this.fields.text].toString():"",l=s?s[this.fields.value].toString():"",p={isInteracted:!!e,item:s,itemElement:t,itemData:{text:a,value:l},event:e,cancel:!1,value:l,previousItemData:{text:this.text,value:this.value},previousItemElement:this.previousItemElement};this.trigger("select",n,function(t){if(!t.cancel&&t.itemData){var n=t.itemData;(!r||r&&"Enter"===e.key)&&o.updateValues(n[o.fields.value],n[o.fields.text],o.gridObj.selectedRowIndex,p),i.Input.setValue(n[o.fields.text],o.inputEle,o.floatLabelType,o.showClearButton),(!r||r&&"Enter"===e.key)&&o.hidePopup(e)}})},g.prototype.updateValues=function(t,i,r,o,n){this.previousItemElement=o.itemElement;var s=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.text=i||this.text,this.value=t||this.value,this.index=e.isNullOrUndefined(r)?this.index:r,this.isProtectedOnChange=s,n||this.triggerChangeEvent(o)},g.prototype.triggerChangeEvent=function(t){this.trigger("change",t,function(t){t.cancel})},g.prototype.inputHandler=function(t){var e=this;if(this.showPopup(null,!0),this.allowFiltering){var i=t.target.value.toLowerCase(),r=!1,o={preventDefaultAction:!1,text:i,updateData:function(t,n,s){o.cancel||(r=!0,e.filterAction(t,i,n,s))},event:t,cancel:!1};this.trigger("filtering",o,function(t){t.cancel||t.preventDefaultAction||r||e.filterAction(e.dataSource,i,e.query,e.fields)})}this.updateInputValue(t.target.value)},g.prototype.updateInputValue=function(t){var e,i=this;if(this.dataSource instanceof r.DataManager){var o=new r.Query;this.dataSource.executeQuery(o).then(function(r){var o=r.result;e=o.filter(function(e){return e[i.fields.text].toString().toLowerCase().startsWith(t.toLowerCase())}),i.selectFilteredRows(e)})}else Array.isArray(this.dataSource)&&(e=this.dataSource.filter(function(e){return e[i.fields.text].toString().toLowerCase().startsWith(t.toLowerCase())}),this.selectFilteredRows(e))},g.prototype.selectFilteredRows=function(t){if(t.length>0?this.matchedContent=t[0]:this.matchedContent=null,this.matchedContent){var e=this.findIndex(this.gridObj.currentViewData,this.matchedContent);this.matchedRowEle=this.gridObj.getRowByIndex(e)}else this.matchedRowEle=null},g.prototype.filterAction=function(t,e,i,o){var n,s=this,a=this.filterType.toString().toLowerCase(),l=i||new r.Query;t instanceof r.DataManager?t.executeQuery(l).then(function(t){var i=t.result,r=i.length;n=i.filter(function(t){return s.filterData(t,a,e,o)}),s.updateGridDataSource(n,r)}):Array.isArray(t)&&(n=t.filter(function(t){return s.filterData(t,a,e,o)}),this.updateGridDataSource(n))},g.prototype.filterData=function(t,e,i,r){var o=t[r?r.text:this.fields.text].toString().toLowerCase();switch(e){case"startswith":return o.startsWith(i);case"endswith":return o.endsWith(i);case"contains":return o.includes(i);default:return!1}},g.prototype.updateGridDataSource=function(t,i){var o=!0;if(t.length>0){o=(this.dataSource instanceof r.DataManager?i:this.dataSource.length)!==t.length,e.removeClass([this.popupDiv],[l]);var n=this.popupDiv.querySelector(".e-no-records");n&&this.popupDiv.removeChild(n),this.gridObj.dataSource=t,this.isDataFiltered=!0}else this.l10nUpdate(),e.addClass([this.popupDiv],[l]);this.updateGridHeight(!0,o,t.length)},g.prototype.wireEvents=function(){var t=this.inputWrapper.querySelector(".e-input-group-icon"),i=this.inputWrapper.querySelector(".e-clear-icon");e.EventHandler.add(t,"mousedown",this.dropDownClick,this),e.EventHandler.add(document,"mousedown",this.onDocumentClick,this),e.EventHandler.add(this.gridEle,"click",this.onMouseClick,this),e.EventHandler.add(this.inputEle,"input",this.inputHandler,this),e.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),i&&e.EventHandler.add(i,"click",this.clearText,this),e.EventHandler.add(window,"resize",this.windowResize,this),this.keyboardModule=new e.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.keyboardModule=new e.KeyboardEvents(this.gridEle,{keyAction:this.gridKeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},g.prototype.unWireEvents=function(){var t=this.inputWrapper.querySelector(".e-input-group-icon"),i=this.inputWrapper.querySelector(".e-clear-icon");e.EventHandler.remove(t,"mousedown",this.dropDownClick),e.EventHandler.remove(document,"mousedown",this.onDocumentClick),e.EventHandler.remove(this.inputEle,"input",this.inputHandler),e.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),e.EventHandler.remove(window,"resize",this.windowResize),e.EventHandler.remove(this.gridEle,"click",this.onMouseClick),i&&e.EventHandler.remove(i,"click",this.clearText),this.keyboardModule&&this.keyboardModule.destroy()},g.prototype.dropDownClick=function(t){if(!this.disabled&&!this.readonly){var e=this.gridEle.querySelector(".e-row-focus");e&&e.classList.remove("e-row-focus"),this.isPopupOpen?this.hidePopup(t):this.showPopup(t)}},g.prototype.onMouseClick=function(t){var i=t.target,r=e.closest(i,".e-row"),o=this.gridObj.selectedRowIndex;r&&(o>=0?this.selectedGridRow(r,t):(this.gridObj.selectedRowIndex=this.gridObj.getRows().indexOf(r),this.gridObj.selectRow(this.gridObj.selectedRowIndex),this.hidePopup(t)))},g.prototype.onDocumentClick=function(t){if(this.disabled||this.readonly||!this.isPopupOpen)return void(t.target.closest(".e-multicolumn-list")||this.focusOut());var i=t.target;i.classList.contains("e-multicolumn-list-icon")||e.closest(i,".e-popup")?t.preventDefault():i.classList.contains("e-multicolumncombobox")||i.classList.contains("e-clear-icon")||this.updateValuesOnInput(t),e.closest(i,".e-multicolumn-list")||(this.inputWrapper.tabIndex=-1)},g.prototype.updateValuesOnInput=function(t,e,i){var r=this,o=t||e;if(this.hidePopup(o),this.matchedRowEle&&!i){s=this.isProtectedOnChange;this.isProtectedOnChange=!0,setTimeout(function(){r.inputEle.value=r.matchedContent[r.fields.text].toString(),r.value=r.matchedContent[r.fields.value].toString();var t=r.findIndex(r.gridObj.currentViewData,r.matchedContent);r.index=t,r.text=r.matchedContent[r.fields.text].toString(),r.gridObj.selectRow(t),r.selectedGridRow(r.gridObj.getRowByIndex(t),o),r.previousItemElement=r.gridObj.getSelectedRows()[0]},100),this.isProtectedOnChange=s}else if(this.isDataFiltered){this.inputEle.value="";var n={value:null,itemData:{text:null,value:null},item:null,previousItemData:{text:this.text,value:this.value},previousItemElement:this.previousItemElement,itemElement:null,event:o,isInteracted:!0,cancel:!1},s=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.text=this.value=this.index=null,this.gridObj.refreshColumns(),this.isProtectedOnChange=s,this.triggerChangeEvent(n),this.isDataFiltered=!1,this.matchedContent=this.matchedRowEle=null}},g.prototype.clearText=function(t){this.isDataFiltered=!0,this.updateValuesOnInput(t,null,!0)},g.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.getSize(!0)}),this.popupObj.refreshPosition())},g.prototype.setCssClass=function(t,i){var r=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];e.isNullOrUndefined(i)||""===i||e.removeClass(r,i.split(" ")),e.isNullOrUndefined(t)||""===t||e.addClass(r,t.split(" "))},g.prototype.keyActionHandler=function(t){switch(t.action){case"escape":case"altUp":case"shiftTab":case"tab":this.isPopupOpen&&this.hidePopup(t);break;case"altDown":this.isPopupOpen||(this.showPopup(t),this.updateSelectedItem(t,!1));break;case"moveDown":case"moveUp":this.updateSelectedItem(t);break;case"enter":this.updateValuesOnInput(null,t),this.focusIn(t);break;case"home":case"end":this.updateSelectedItem(t)}},g.prototype.gridKeyActionHandler=function(t,e){switch(e&&("ArrowDown"===t.key?t.action="moveDown":"ArrowUp"===t.key?t.action="moveUp":"End"===t.key?t.action="end":"Home"===t.key&&(t.action="home"),t.altKey&&"ArrowUp"===t.key&&(t.action="altUp")),t.action){case"escape":case"tab":case"shiftTab":case"altUp":this.isPopupOpen&&(t.preventDefault(),this.hidePopup(t));break;case"moveDown":case"moveUp":case"home":case"end":this.updateSelectedItem(t)}},g.prototype.updateSelectedItem=function(t,e){if(void 0===e&&(e=!0),this.isPopupOpen){var i=this.fields.groupBy?this.gridObj.selectedRowIndex?this.gridObj.selectedRowIndex:0:this.gridObj.selectedRowIndex;-1===i&&("moveDown"===t.action||"moveUp"===t.action)||"home"===t.action?i=0:i>=this.gridObj.getRows().length&&"moveDown"===t.action||"end"===t.action?i=this.gridObj.getRows().length-1:"moveDown"===t.action&&i>=0&&i<=this.gridObj.getRows().length&&this.fields.groupBy?i+=1:"moveUp"===t.action&&i>0&&this.fields.groupBy&&(i-=1),this.gridObj.selectRow(i),this.gridObj.selectedRowIndex=i;var r=this.gridEle.querySelector(".e-row-focus");r&&r.classList.remove("e-row-focus"),e&&this.selectedGridRow(this.gridObj.getRows()[i],t,!0)}},g.prototype.focusIn=function(t){if(!this.disabled&&!this.readonly){e.addClass([this.inputWrapper],["e-input-focus"]),this.inputWrapper.tabIndex=0,this.inputWrapper.focus();var r=this.inputWrapper.querySelector(".e-clear-icon");r&&(this.value&&""!==this.value.toString()||this.text&&""!==this.text)&&r.classList.remove("e-clear-icon-hide"),this.trigger("focus",t),"Never"!==this.floatLabelType&&i.Input.calculateWidth(this.inputEle,this.inputWrapper)}},g.prototype.focusOut=function(t){if(!this.disabled&&!this.readonly){this.hidePopup(t),e.removeClass([this.inputWrapper],["e-input-focus"]),this.inputWrapper.tabIndex=-1;var r=this.inputWrapper.querySelector(".e-clear-icon");r&&r.classList.add("e-clear-icon-hide"),"Never"!==this.floatLabelType&&i.Input.calculateWidth(this.inputEle,this.inputWrapper)}},g.prototype.showPopup=function(t,i){var r=this,o={name:"FadeIn",duration:100},n={popup:this.popupObj,event:t,cancel:!1,animation:o};this.trigger("open",n,function(o){o.cancel||r.isPopupOpen||(r.isPopupOpen=!0,r.popupObj.refreshPosition(),e.addClass([r.inputWrapper],["e-icon-anim"]),e.attributes(r.inputEle,{"aria-expanded":"true","aria-owns":r.element.id+"_popup","aria-controls":r.element.id}),i||((r.value||r.text||r.index)&&r.gridObj.currentViewData.forEach(function(t,e){r.selectDataRow(t,e)}),r.focusIn(t)),r.popupObj.show(new e.Animation(o.animation),r.popupEle))})},g.prototype.hidePopup=function(t){var i=this,r={name:"FadeOut",duration:100},o={popup:this.popupObj,event:t||null,cancel:!1,animation:r};this.trigger("close",o,function(r){if(!r.cancel&&(i.isPopupOpen=!1,e.removeClass([i.inputWrapper],["e-icon-anim"]),e.attributes(i.inputEle,{"aria-expanded":"false"}),i.popupObj.hide(new e.Animation(r.animation)),i.inputEle.value=i.text?i.text.toString():"",t)){var o=t.target;o.classList.contains("e-multicolumn-list-icon")||o.classList.contains("e-rowcell")?(i.value||i.gridObj.refreshColumns(),i.focusIn(t)):i.focusOut()}}),setTimeout(function(){i.gridObj&&(i.gridObj.dataSource=i.dataSource,i.updateGridHeight(!0,!1))},100)},g.prototype.addItems=function(t,e){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.gridObj.editSettings.allowAdding=!0,this.gridObj.dataBind(),this.isProtectedOnChange=i,this.gridObj.addRecord(t,e)},g.prototype.getItems=function(){return this.gridObj.getDataRows()},g.prototype.getDataByValue=function(t){var i=this;return!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof Array?this.dataSource.filter(function(e){return e[i.fields.value].toString()===t})[0]:(!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof r.DataManager&&this.dataSource.executeQuery(new r.Query).then(function(e){return e.result.filter(function(e){return e[i.fields.value].toString()===t})[0]}),null)},g.prototype.destroy=function(){if(this.unWireEvents(),this.gridObj&&(this.gridObj.destroy(),e.detach(this.gridObj.element)),this.popupObj&&(this.popupObj.destroy(),e.detach(this.popupObj.element)),this.inputEle){for(var t=["placeholder","aria-expanded","spellcheck","aria-label","role","tabindex","type","id","aria-owns","aria-controls"],r=0;r<t.length;r++)this.inputEle.removeAttribute(t[r]);this.inputEle.classList.remove("e-input"),i.Input.setValue("",this.inputEle,this.floatLabelType,this.showClearButton)}this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),this.inputObj&&(e.detach(this.inputObj.container),this.inputObj=null),i.Input.destroy({element:this.inputEle,floatLabelType:this.floatLabelType,properties:this.properties}),e.detach(this.inputWrapper),e.detach(this.popupDiv),this.inputEle=null,this.previousItemElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.popupObj=null,this.gridObj=null,this.gridEle=null,this.popupEle=null,this.footer=null,this.noRecord=null,c.prototype.destroy.call(this)},g.prototype.onPropertyChanged=function(e,r){for(var o=0,n=Object.keys(e);o<n.length;o++){var s=n[o],a=void 0;switch(s){case"width":case"popupWidth":"width"===s&&this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.getSize(!0));break;case"popupHeight":if(this.popupObj){var l=this.getSize(!1);this.popupObj.element.style.maxHeight=l,this.popupDiv.style.maxHeight=l,this.gridObj.height=l}break;case"placeholder":i.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"readonly":i.Input.setReadonly(this.readonly,this.inputEle);break;case"disabled":i.Input.setEnabled(!this.disabled,this.inputEle),this.setEnable();break;case"cssClass":this.setCssClass(e.cssClass,r.cssClass);break;case"floatLabelType":i.Input.removeFloating(this.inputObj),i.Input.addFloating(this.inputEle,this.floatLabelType,this.placeholder);break;case"showClearButton":i.Input.setClearButton(e.showClearButton,this.inputEle,this.inputObj);break;case"value":this.initValue(!0,!0);break;case"text":this.initValue(!0,!1);break;case"index":this.initValue();break;case"sortOrder":this.gridObj&&(this.gridObj.sortSettings.columns=[{field:this.fields.text,direction:e.sortOrder===t.SortOrder.Ascending?t.SortOrder.Ascending:t.SortOrder.Descending}]);break;case"htmlAttributes":this.setHTMLAttributes();break;case"noRecordsTemplate":this.l10nUpdate();break;case"actionFailureTemplate":this.l10nUpdate(!0);break;case"footerTemplate":this.setFooterTemplate();break;case"itemTemplate":this.gridObj&&(this.gridObj.rowTemplate=e.itemTemplate);break;case"groupTemplate":this.groupTemplate=e.groupTemplate,this.updateGroupByField();break;case"enableRtl":this.gridObj&&this.popupObj&&(this.gridObj.enableRtl=e.enableRtl,i.Input.setEnableRtl(e.enableRtl,[this.inputWrapper]),this.popupObj.enableRtl=e.enableRtl);break;case"dataSource":this.gridObj&&(this.gridObj.dataSource=e.dataSource);break;case"query":this.gridObj&&(this.gridObj.query=e.query);break;case"gridSettings":this.gridObj&&(this.gridObj.gridLines=e.gridSettings.gridLines,this.gridObj.rowHeight=e.gridSettings.rowHeight,this.gridObj.enableAltRow=e.gridSettings.enableAltRow);break;case"fields":this.fields=e.fields,this.updateGroupByField();break;case"filterType":this.filterType=e.filterType;break;case"enableVirtualization":this.gridObj&&(this.enableVirtualization=this.gridObj.enableVirtualization=e.enableVirtualization);break;case"sortType":this.sortType=e.sortType;break;case"allowFiltering":this.allowFiltering=e.allowFiltering;break;case"allowSorting":this.gridObj&&(this.allowSorting=this.gridObj.allowSorting=e.allowSorting);break;case"columns":this.gridObj&&(a=this.getGridColumns(),this.gridObj.columns=a)}}},a([e.Property([])],g.prototype,"dataSource",void 0),a([e.Property(null)],g.prototype,"text",void 0),a([e.Property(null)],g.prototype,"value",void 0),a([e.Property(null)],g.prototype,"index",void 0),a([e.Property("100%")],g.prototype,"width",void 0),a([e.Property("300px")],g.prototype,"popupHeight",void 0),a([e.Property("100%")],g.prototype,"popupWidth",void 0),a([e.Property(null)],g.prototype,"placeholder",void 0),a([e.Property(!0)],g.prototype,"allowFiltering",void 0),a([e.Property(!0)],g.prototype,"allowSorting",void 0),a([e.Property(!1)],g.prototype,"showClearButton",void 0),a([e.Property("")],g.prototype,"cssClass",void 0),a([e.Complex({text:null,value:null,groupBy:null},u)],g.prototype,"fields",void 0),a([e.Collection([],d)],g.prototype,"columns",void 0),a([e.Complex({},h)],g.prototype,"gridSettings",void 0),a([e.Property(t.FilterType.StartsWith)],g.prototype,"filterType",void 0),a([e.Property("Never")],g.prototype,"floatLabelType",void 0),a([e.Property(t.SortOrder.None)],g.prototype,"sortOrder",void 0),a([e.Property(t.SortType.OneColumn)],g.prototype,"sortType",void 0),a([e.Property(!1)],g.prototype,"enableVirtualization",void 0),a([e.Property(!1)],g.prototype,"disabled",void 0),a([e.Property(!1)],g.prototype,"readonly",void 0),a([e.Property(!1)],g.prototype,"enablePersistence",void 0),a([e.Property()],g.prototype,"query",void 0),a([e.Property(null)],g.prototype,"itemTemplate",void 0),a([e.Property(null)],g.prototype,"footerTemplate",void 0),a([e.Property(null)],g.prototype,"groupTemplate",void 0),a([e.Property("Request Failed")],g.prototype,"actionFailureTemplate",void 0),a([e.Property("No records found")],g.prototype,"noRecordsTemplate",void 0),a([e.Property({})],g.prototype,"htmlAttributes",void 0),a([e.Event()],g.prototype,"created",void 0),a([e.Event()],g.prototype,"open",void 0),a([e.Event()],g.prototype,"close",void 0),a([e.Event()],g.prototype,"actionFailure",void 0),a([e.Event()],g.prototype,"actionBegin",void 0),a([e.Event()],g.prototype,"actionComplete",void 0),a([e.Event()],g.prototype,"filtering",void 0),a([e.Event()],g.prototype,"select",void 0),a([e.Event()],g.prototype,"change",void 0),g=a([e.NotifyPropertyChanges],g)}(e.Component);return c.Inject(n.VirtualScroll,n.Sort,n.Edit,n.Group),Object.defineProperty(t,"Edit",{enumerable:!0,get:function(){return n.Edit}}),Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return n.Group}}),Object.defineProperty(t,"Sort",{enumerable:!0,get:function(){return n.Sort}}),Object.defineProperty(t,"VirtualScroll",{enumerable:!0,get:function(){return n.VirtualScroll}}),t.Column=d,t.FieldSettings=u,t.GridSettings=h,t.MultiColumnComboBox=c,t.MultiColumnGrid=p,t}({},ej.base,ej.inputs,ej.data,ej.popups,index),this.ejs=ej;
10
+ this.ej=this.ej||{},this.ej.multicolumncombobox=function(t,e,i,o,r,n){"use strict";var s=function(){var t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(e,i)};return function(e,i){function o(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),a=function(t,e,i,o){var r,n=arguments.length,s=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(s=(n<3?r(s):n>3?r(e,i,s):r(e,i))||s);return n>3&&s&&Object.defineProperty(e,i,s),s},l="e-nodata",p=function(){function t(){}return t.prototype.InjectModules=function(){n.Grid.Inject(n.VirtualScroll,n.Group,n.Edit,n.Sort)},t}();!function(t){t.StartsWith="StartsWith",t.EndsWith="EndsWith",t.Contains="Contains"}(t.FilterType||(t.FilterType={})),function(t){t.None="None",t.Ascending="Ascending",t.Descending="Descending"}(t.SortOrder||(t.SortOrder={})),function(t){t.OneColumn="OneColumn",t.MultipleColumns="MultipleColumns"}(t.SortType||(t.SortType={}));var u=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),a([e.Property()],i.prototype,"text",void 0),a([e.Property()],i.prototype,"value",void 0),a([e.Property()],i.prototype,"groupBy",void 0),i}(e.ChildProperty),d=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),a([e.Property("")],i.prototype,"field",void 0),a([e.Property("")],i.prototype,"header",void 0),a([e.Property("")],i.prototype,"width",void 0),a([e.Property("")],i.prototype,"textAlign",void 0),a([e.Property(null)],i.prototype,"format",void 0),a([e.Property(!1)],i.prototype,"displayAsCheckBox",void 0),a([e.Property(null)],i.prototype,"template",void 0),a([e.Property(null)],i.prototype,"headerTemplate",void 0),a([e.Property(null)],i.prototype,"customAttributes",void 0),i}(e.ChildProperty),h=function(t){function i(){return null!==t&&t.apply(this,arguments)||this}return s(i,t),a([e.Property(!1)],i.prototype,"enableAltRow",void 0),a([e.Property(null)],i.prototype,"rowHeight",void 0),a([e.Property("Default")],i.prototype,"gridLines",void 0),i}(e.ChildProperty),c=function(c){function g(t,e){var i=c.call(this,t,e)||this;return i.gridInject=new p,i.gridInject.InjectModules(),i}return s(g,c),g.prototype.preRender=function(){this.element.id||(this.element.id=e.getUniqueID("e-"+this.getModuleName())),this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",home:"home",moveDown:"downarrow",moveUp:"uparrow"},this.matchedRowEle=this.matchedContent=null,this.persistData()},g.prototype.getDirective=function(){return"EJS-MULTICOLUMNCOMBOBOX"},g.prototype.getModuleName=function(){return"multicolumncombobox"},g.prototype.getPersistData=function(){return this.addOnPersist(["value"])},g.prototype.persistData=function(){if(this.enablePersistence){this.element.id=this.element.id+"_wrapper";var t=window.localStorage.getItem(this.getModuleName()+this.element.id);e.isNullOrUndefined(t)||""===t||this.setProperties(JSON.parse(t),!0)}},g.prototype.render=function(){this.renderGrid(),this.renderInput(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.appendChild(this.gridEle),this.setHTMLAttributes(),this.renderPopup(),this.wireEvents()},g.prototype.renderGrid=function(){var i=this,o=this.getGridColumns();this.gridObj=new n.Grid({dataSource:this.dataSource,columns:o,allowSorting:this.allowSorting,enableStickyHeader:!0,gridLines:this.gridSettings.gridLines,rowHeight:this.gridSettings.rowHeight,enableAltRow:this.gridSettings.enableAltRow,enableVirtualization:this.enableVirtualization,enableRtl:this.enableRtl,editSettings:{allowAdding:!1},query:this.query,height:this.popupHeight,allowMultiSorting:"multiplecolumns"===this.sortType.toString().toLowerCase()&&this.allowSorting,rowTemplate:this.itemTemplate,dataBound:function(){i.onDataBound()},actionFailure:function(t){i.onActionFailure(t)},actionBegin:function(t){i.trigger("actionBegin",t)},actionComplete:function(t){i.trigger("actionComplete",t),"sorting"===t.requestType&&i.updateRowSelection(t);var e=t.rows;i.isDataFiltered&&e.length>0&&""!==i.inputEle.value&&"sorting"!==t.requestType&&i.gridObj.getRows()[0].classList.add("e-row-focus"),i.popupObj.refreshPosition()},keyPressed:function(t){"Enter"===t.key&&(t.cancel=!0,i.isPopupOpen&&(i.selectedGridRow(i.gridObj.getRows()[i.gridObj.selectedRowIndex],t,!0),i.hidePopup(t),i.focusIn(t))),i.fields.groupBy&&(t.cancel=!0,i.gridKeyActionHandler(t,!0))}}),this.gridEle=this.createElement("div",{id:e.getUniqueID("grid"),className:"e-multicolumn-grid"}),this.updateGroupByField();var r=this.sortOrder.toString().toLowerCase();this.gridObj.columns[0].isPrimaryKey=!0,"none"!==r&&(this.gridObj.sortSettings={columns:[{field:this.fields.text,direction:"ascending"===r?t.SortOrder.Ascending:t.SortOrder.Descending}]}),this.gridObj.appendTo(this.gridEle)},g.prototype.isRowMatching=function(t,e,i){var o=Object.values(t).map(String);return o.includes(e)&&o.includes(i)},g.prototype.updateRowSelection=function(t){var e=this;t&&t.rows.forEach(function(t){var i=t.data,o=t.index;e.selectDataRow(i,o)})},g.prototype.selectDataRow=function(t,e){if(this.isRowMatching(t,this.value?this.value.toString():"",this.text?this.text.toString():"")){this.gridObj.selectRow(e);var i=this.isProtectedOnChange;return this.isProtectedOnChange=!0,this.index=e,void(this.isProtectedOnChange=i)}},g.prototype.findIndex=function(t,e){return t.findIndex(function(t){return Object.keys(e).every(function(i){return t[i]===e[i]})})},g.prototype.getGridColumns=function(){var t=this;return this.columns.map(function(e){var i;return e.displayAsCheckBox&&!e.format&&(i="boolean"),{field:e.field,headerText:e.header,width:e.width,textAlign:""===e.textAlign&&t.enableRtl?"Right":e.textAlign,format:e.format,displayAsCheckBox:e.displayAsCheckBox,template:e.template,headerTemplate:e.headerTemplate,customAttributes:e.customAttributes,type:i}})},g.prototype.updateGroupByField=function(){if(""!==this.fields.groupBy&&!e.isNullOrUndefined(this.fields.groupBy)){"multiplecolumns"!==this.sortType.toString().toLowerCase()&&this.gridEle.classList.add("e-multicolumn-group");var t=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.gridObj.allowGrouping=!0,this.gridObj.groupSettings={showDropArea:!1,columns:[this.fields.groupBy],captionTemplate:this.groupTemplate&&""!==this.fields.groupBy&&!e.isNullOrUndefined(this.fields.groupBy)?this.groupTemplate:"${key}"},this.isVue&&(this.gridObj.isVue=this.isVue),this.isProtectedOnChange=t}},g.prototype.onDataBound=function(){var t=this.dataSource.length,i=this.popupDiv.querySelector(".e-multicolumn-grid");if(t<=0&&i)this.l10nUpdate(),this.popupDiv.removeChild(this.gridEle),e.addClass([this.popupDiv],[l]);else if(this.popupDiv.classList.contains(l)&&t>=1){e.removeClass([this.popupDiv],[l]);var o=this.popupDiv.querySelector(".e-no-records");o&&this.popupDiv.removeChild(o)}if(this.isInitialRender){var r=this.popupDiv.classList.contains(l)?this.popupDiv.getBoundingClientRect().height:this.popupDiv.querySelector(".e-gridcontent tr").getBoundingClientRect().height;this.popupRowHeight=r,this.popupObj.hide(),this.popupEle.style.visibility="unset",this.isInitialRender=!1}},g.prototype.onActionFailure=function(t){this.trigger("actionFailure",t),this.l10nUpdate(!0),e.addClass([this.popupDiv],[l])},g.prototype.renderInput=function(){"INPUT"===this.element.tagName?(this.inputEle=this.element,e.isNullOrUndefined(this.inputEle.getAttribute("role"))&&this.inputEle.setAttribute("role","combobox"),e.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text"),this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("aria-readOnly",this.readonly.toString()),this.inputEle.setAttribute("aria-disabled",this.disabled.toString()),this.inputEle.setAttribute("autocomplete","off"),this.inputEle.setAttribute("autocapitalize","off"),this.inputEle.setAttribute("spellcheck","false"),this.inputEle.setAttribute("tabindex","0")):(this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=i.Input.createInput({element:this.inputEle,buttons:["e-input-group-icon e-multicolumn-list-icon e-icons"],floatLabelType:this.floatLabelType,properties:{enabled:!this.disabled,readonly:this.readonly,placeholder:this.placeholder,enableRtl:this.enableRtl,showClearButton:this.showClearButton,cssClass:this.cssClass}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.add("e-multicolumn-list"),this.inputWrapper.setAttribute("spellcheck","false"),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.setElementWidth(this.width),e.isNullOrUndefined(this.value)&&e.isNullOrUndefined(this.text)&&e.isNullOrUndefined(this.index)||this.initValue(null,null,!0)},g.prototype.setElementWidth=function(t){var i=this.inputWrapper;e.isNullOrUndefined(t)||("number"==typeof t?i.style.width=e.formatUnit(t):"string"==typeof t&&(i.style.width=t.match(/px|%|em/)?t:e.formatUnit(t)))},g.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var o=e[t];"class"===o?this.inputWrapper.classList.add(this.htmlAttributes[""+o]):"disabled"===o?(this.setProperties({enabled:!1},!0),this.setEnable()):"readonly"===o?(this.setProperties({readonly:!0},!0),this.dataBind()):"style"===o?this.inputWrapper.setAttribute("style",this.htmlAttributes[""+o]):["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"].indexOf(o)>-1&&"placeholder"===o?i.Input.setPlaceholder(this.htmlAttributes[""+o],this.inputEle):this.inputEle.setAttribute(o,this.htmlAttributes[""+o])}},g.prototype.setEnable=function(){i.Input.setEnabled(!this.disabled,this.inputEle),this.disabled?(this.isPopupOpen&&this.hidePopup(),e.addClass([this.inputWrapper],"e-disabled"),this.inputWrapper&&this.inputWrapper.classList.contains("e-input-focus")&&e.removeClass([this.inputWrapper],["e-input-focus"]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true")):(e.removeClass([this.inputWrapper],"e-disabled"),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false"))},g.prototype.initValue=function(t,i,r){var n,s,a,l,p=this,u=this.gridObj.getSelectedRecords()[0],d=this.gridObj.getSelectedRows()[0],h=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.value=this.value?this.value.toString():this.value,this.isProtectedOnChange=h;var c=function(t){var e=p.updateCurrentValues(n,t);s=e.currentValue,a=e.currentText,l=e.currentIndex};if(!t&&(!e.isNullOrUndefined(this.value)||!e.isNullOrUndefined(this.text))||t&&void 0!==i){var g=t?i?this.value:this.text:e.isNullOrUndefined(this.value)?this.text:this.value;!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof o.DataManager?this.dataSource.executeQuery(new o.Query).then(function(o){var h=o.result,f=h.filter(function(o){return o[t?i?p.fields.value:p.fields.text:e.isNullOrUndefined(p.value)?p.fields.text:p.fields.value].toString()===g});f.length>0&&(n=f[0],c(h),p.updateChangeEvent(n,u,d,s,a,l,t,r),p.gridObj.selectRow(p.index))}):!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof Array&&(n=this.dataSource.filter(function(o){return o[t?i?p.fields.value:p.fields.text:e.isNullOrUndefined(p.value)?p.fields.text:p.fields.value].toString()===g})[0],c(this.dataSource))}else e.isNullOrUndefined(this.index)||(!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof o.DataManager?this.dataSource.executeQuery(new o.Query).then(function(e){var i=e.result;n=i[p.index],c(i),p.updateChangeEvent(n,u,d,s,a,l,t,r),p.gridObj.selectRow(p.index)}):!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof Array&&(n=this.dataSource[this.index],c(this.dataSource)));this.dataSource instanceof o.DataManager||this.updateChangeEvent(n,u,d,s,a,l,t,r)},g.prototype.updateChangeEvent=function(t,e,i,o,r,n,s,a){var l={value:t?t[this.fields.value].toString():null,itemData:{text:r,value:o},item:this.getDataByValue(this.value),previousItemData:e,previousItemElement:i,itemElement:this.inputWrapper,event:null,isInteracted:!s};this.updateValues(o,r,n,l,a)},g.prototype.updateCurrentValues=function(t,o){return e.isNullOrUndefined(t)?{currentValue:null,currentText:null,currentIndex:null}:(i.Input.setValue(t[this.fields.text].toString(),this.inputEle,this.floatLabelType,this.showClearButton),{currentValue:t[this.fields.value].toString(),currentText:t[this.fields.text].toString(),currentIndex:o.indexOf(t)})},g.prototype.renderPopup=function(){this.popupEle=this.createElement("div",{id:this.element.id+"_options",className:"e-multicolumn-list e-popup "+(null!==this.cssClass?this.cssClass:"")}),e.attributes(this.popupEle,{"aria-label":this.element.id,role:"dialog"}),document.body.appendChild(this.popupEle),this.createPopup(this.popupEle),e.prepend([this.popupDiv],this.popupEle),this.footerTemplate&&this.setFooterTemplate();var t=this.getSize(!1);if(this.popupEle.style.maxHeight=t,this.footerTemplate){this.footer=this.footer?this.footer:this.popupEle.querySelector(".e-popup-footer");var i=Math.round(this.footer.getBoundingClientRect().height);t=e.formatUnit(parseInt(t,10)-i+"px")}this.popupDiv.style.maxHeight=t,this.updateGridHeight(),this.popupEle.style.visibility="hidden",this.isInitialRender=!0},g.prototype.updateGridHeight=function(t,i,o){var r;if(t){var n=this.gridObj.getContent().querySelector(".e-content"),s=n.offsetHeight-n.clientHeight,a=o*this.popupRowHeight;""===this.fields.groupBy||e.isNullOrUndefined(this.fields.groupBy)||(a+=this.popupRowHeight),r=i&&a<this.prevGridHeight?a+s+"px":this.prevGridHeight+"px"}else this.prevGridHeight=this.popupDiv.getBoundingClientRect().height-this.popupDiv.querySelector(".e-gridheader").getBoundingClientRect().height,r=this.prevGridHeight+"px";var l=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.gridObj.height=r,this.isProtectedOnChange=l},g.prototype.createPopup=function(t){var i=this;this.popupObj=new r.Popup(t,{width:this.getSize(!0),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},targetExitViewport:function(){e.Browser.isDevice||i.hidePopup()},open:function(){i.inputEle.focus(),i.updateClearIconState()}})},g.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),e.addClass([this.footer],"e-popup-footer"));var t=this.getTemplateFunction(this.footerTemplate)({count:this.dataSource.length},this,"footerTemplate",this.element.id+"footerTemplate",this.isStringTemplate,void 0,this.footer);t&&(t=Array.prototype.slice.call(t),e.append(t,this.footer)),e.append([this.footer],this.popupEle)},g.prototype.l10nUpdate=function(t){if(this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No records found"!==this.noRecordsTemplate||"Request Failed"!==this.actionFailureTemplate){var i=t?this.actionFailureTemplate:this.noRecordsTemplate,o=t?this.element.id+"_actionFailure":this.element.id+"_noRecords",r=t?"actionFailureTemplate":"noRecordsTemplate",n=this.getTemplateFunction(i)({},this,r,o,this.isStringTemplate,void 0,this.noRecord);n&&(n=Array.prototype.slice.call(n),e.append(n,this.noRecord))}else{var s={noRecordsTemplate:"No records found",actionFailureTemplate:"Request Failed"};this.l10n=new e.L10n("multicolumncombobox",s,this.locale),this.noRecord.innerHTML=t?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")}e.addClass([this.noRecord],"e-no-records"),e.prepend([this.noRecord],this.popupDiv),this.popupObj.refreshPosition()},g.prototype.getTemplateFunction=function(t){if("string"==typeof t){var i="";try{var o=e.select(t);i=o?"SCRIPT"===o.tagName?o.innerHTML:o.outerHTML:t}catch(e){i=t}return e.compile(i)}return e.compile(t)},g.prototype.getSize=function(t){var i=t?this.popupWidth:this.popupHeight,o=e.formatUnit(i);return o.indexOf("%")>-1?o=((t?this.inputWrapper.offsetWidth:document.documentElement.clientHeight)*parseFloat(o)/100).toString()+"px":"string"==typeof i&&(o=i.match(/px|em/)?i:o),o},g.prototype.selectedGridRow=function(t,e,o){var r=this,n={isInteracted:!!e,item:this.gridObj.getSelectedRecords()[0],itemElement:t,itemData:this.gridObj.getSelectedRecords()[0],event:e,cancel:!1},s=this.gridObj.getSelectedRecords()[0],a=s?s[this.fields.text].toString():"",l=s?s[this.fields.value].toString():"",p={isInteracted:!!e,item:s,itemElement:t,itemData:{text:a,value:l},event:e,cancel:!1,value:l,previousItemData:{text:this.text,value:this.value},previousItemElement:this.previousItemElement};this.trigger("select",n,function(t){if(!t.cancel&&t.itemData){var n=t.itemData,s=e,a="Enter"===s.key||"Tab"===s.key||s.shiftKey&&"Tab"===s.key||s.altKey&&"ArrowUp"===s.key;(!o||o&&a)&&r.updateValues(n[r.fields.value],n[r.fields.text],r.gridObj.selectedRowIndex,p),i.Input.setValue(n[r.fields.text],r.inputEle,r.floatLabelType,r.showClearButton),(!o||o&&a)&&r.hidePopup(e)}})},g.prototype.updateValues=function(t,i,o,r,n){this.previousItemElement=r.itemElement;var s=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.text=i||this.text,this.value=t||this.value,this.index=e.isNullOrUndefined(o)?this.index:o,this.isProtectedOnChange=s,n||this.triggerChangeEvent(r)},g.prototype.triggerChangeEvent=function(t){this.trigger("change",t,function(t){t.cancel})},g.prototype.inputHandler=function(t){var e=this;if(this.showPopup(null,!0),this.updateClearIconState(),this.allowFiltering){var i=t.target.value.toLowerCase(),o=!1,r={preventDefaultAction:!1,text:i,updateData:function(t,n,s){r.cancel||(o=!0,e.filterAction(t,i,n,s))},event:t,cancel:!1};this.trigger("filtering",r,function(t){t.cancel||t.preventDefaultAction||o||e.filterAction(e.dataSource,i,e.query,e.fields)})}this.updateInputValue(t.target.value)},g.prototype.updateInputValue=function(t){var e,i=this;if(this.dataSource instanceof o.DataManager){var r=new o.Query;this.dataSource.executeQuery(r).then(function(o){var r=o.result;e=r.filter(function(e){return e[i.fields.text].toString().toLowerCase().startsWith(t.toLowerCase())}),i.selectFilteredRows(e)})}else Array.isArray(this.dataSource)&&(e=this.dataSource.filter(function(e){return e[i.fields.text].toString().toLowerCase().startsWith(t.toLowerCase())}),this.selectFilteredRows(e))},g.prototype.selectFilteredRows=function(t){if(t.length>0?this.matchedContent=t[0]:this.matchedContent=null,this.matchedContent){var e=this.findIndex(this.gridObj.currentViewData,this.matchedContent);this.matchedRowEle=this.gridObj.getRowByIndex(e)}else this.matchedRowEle=null},g.prototype.filterAction=function(t,e,i,r){var n,s=this,a=this.filterType.toString().toLowerCase(),l=i||new o.Query;t instanceof o.DataManager?t.executeQuery(l).then(function(t){var i=t.result,o=i.length;n=i.filter(function(t){return s.filterData(t,a,e,r)}),s.updateGridDataSource(n,o)}):Array.isArray(t)&&(n=t.filter(function(t){return s.filterData(t,a,e,r)}),this.updateGridDataSource(n))},g.prototype.filterData=function(t,e,i,o){var r=t[o?o.text:this.fields.text].toString().toLowerCase();switch(e){case"startswith":return r.startsWith(i);case"endswith":return r.endsWith(i);case"contains":return r.includes(i);default:return!1}},g.prototype.updateGridDataSource=function(t,i){var r=!0;if(t.length>0){r=(this.dataSource instanceof o.DataManager?i:this.dataSource.length)!==t.length,e.removeClass([this.popupDiv],[l]);var n=this.popupDiv.querySelector(".e-no-records");n&&this.popupDiv.removeChild(n),this.gridObj.dataSource=t,this.isDataFiltered=!0}else this.l10nUpdate(),e.addClass([this.popupDiv],[l]);this.updateGridHeight(!0,r,t.length)},g.prototype.wireEvents=function(){e.isNullOrUndefined(this.inputObj.buttons[0])||(e.EventHandler.add(this.inputObj.buttons[0],"mousedown",this.preventBlur,this),e.EventHandler.add(this.inputObj.buttons[0],"mousedown",this.dropDownClick,this)),e.EventHandler.add(document,"mousedown",this.onDocumentClick,this),e.EventHandler.add(this.gridEle,"click",this.onMouseClick,this),e.EventHandler.add(this.inputEle,"input",this.inputHandler,this),e.EventHandler.add(this.inputEle,"focus",this.focusIn,this),this.showClearButton&&e.EventHandler.add(this.inputObj.clearButton,"mousedown",this.clearText,this),e.EventHandler.add(window,"resize",this.windowResize,this),this.keyboardModule=new e.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.keyboardModule=new e.KeyboardEvents(this.gridEle,{keyAction:this.gridKeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},g.prototype.unWireEvents=function(){e.isNullOrUndefined(this.inputObj.buttons[0])||(e.EventHandler.remove(this.inputObj.buttons[0],"mousedown",this.preventBlur),e.EventHandler.remove(this.inputObj.buttons[0],"mousedown",this.dropDownClick)),e.EventHandler.remove(document,"mousedown",this.onDocumentClick),e.EventHandler.remove(this.inputEle,"input",this.inputHandler),e.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),e.EventHandler.remove(window,"resize",this.windowResize),e.EventHandler.remove(this.gridEle,"click",this.onMouseClick),this.showClearButton&&e.EventHandler.remove(this.inputObj.clearButton,"mousedown",this.clearText),this.keyboardModule&&this.keyboardModule.destroy()},g.prototype.preventBlur=function(t){t.preventDefault()},g.prototype.dropDownClick=function(t){if(!this.disabled&&!this.readonly){var e=this.gridEle.querySelector(".e-row-focus");e&&e.classList.remove("e-row-focus"),this.isPopupOpen?this.hidePopup(t):this.showPopup(t)}},g.prototype.onMouseClick=function(t){var i=t.target,o=e.closest(i,".e-row"),r=this.gridObj.selectedRowIndex;o&&(r>=0?this.selectedGridRow(o,t):(this.gridObj.selectedRowIndex=this.gridObj.getRows().indexOf(o),this.gridObj.selectRow(this.gridObj.selectedRowIndex),this.hidePopup(t)))},g.prototype.onDocumentClick=function(t){if(this.disabled||this.readonly||!this.isPopupOpen)return void(t.target.closest(".e-multicolumn-list")||this.focusOut());var i=t.target;i.classList.contains("e-multicolumn-list-icon")||e.closest(i,".e-popup")?t.preventDefault():i.classList.contains("e-multicolumncombobox")||i.classList.contains("e-clear-icon")||this.updateValuesOnInput(t)},g.prototype.updateValuesOnInput=function(t,e,i){var o=this,r=t||e;if(this.hidePopup(r),this.matchedRowEle&&!i){s=this.isProtectedOnChange;this.isProtectedOnChange=!0,setTimeout(function(){o.inputEle.value=o.matchedContent[o.fields.text].toString(),o.value=o.matchedContent[o.fields.value].toString();var t=o.findIndex(o.gridObj.currentViewData,o.matchedContent);o.index=t,o.text=o.matchedContent[o.fields.text].toString(),o.gridObj.selectRow(t),o.selectedGridRow(o.gridObj.getRowByIndex(t),r),o.previousItemElement=o.gridObj.getSelectedRows()[0]},100),this.isProtectedOnChange=s}else if(this.isDataFiltered){this.inputEle.value="";var n={value:null,itemData:{text:null,value:null},item:null,previousItemData:{text:this.text,value:this.value},previousItemElement:this.previousItemElement,itemElement:null,event:r,isInteracted:!0,cancel:!1},s=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.text=this.value=this.index=null,this.gridObj.refreshColumns(),this.isProtectedOnChange=s,this.triggerChangeEvent(n),this.isDataFiltered=!1,this.matchedContent=this.matchedRowEle=null}},g.prototype.clearText=function(t){this.isDataFiltered=!0,this.updateValuesOnInput(t,null,!0)},g.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.getSize(!0)}),this.popupObj.refreshPosition())},g.prototype.setCssClass=function(t,i){var o=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];e.isNullOrUndefined(i)||""===i||e.removeClass(o,i.split(" ")),e.isNullOrUndefined(t)||""===t||e.addClass(o,t.split(" "))},g.prototype.keyActionHandler=function(t){switch(t.action){case"escape":case"altUp":case"shiftTab":case"tab":this.isPopupOpen?this.hidePopup(t):this.focusOut();break;case"altDown":this.isPopupOpen||(this.showPopup(t),this.updateSelectedItem(t,!1));break;case"moveDown":case"moveUp":this.updateSelectedItem(t,!0,!0);break;case"enter":this.updateValuesOnInput(null,t),this.focusIn(t);break;case"home":case"end":this.updateSelectedItem(t)}},g.prototype.gridKeyActionHandler=function(t,e){switch(e&&("ArrowDown"===t.key?t.action="moveDown":"ArrowUp"===t.key?t.action="moveUp":"End"===t.key?t.action="end":"Home"===t.key?t.action="home":"Tab"===t.key?t.action="tab":"Escape"===t.key&&(t.action="escape"),t.shiftKey&&"Tab"===t.key&&(t.action="shiftTab"),t.altKey&&"ArrowUp"===t.key&&(t.action="altUp")),t.action){case"escape":case"tab":case"shiftTab":case"altUp":this.isPopupOpen&&(t.preventDefault(),"escape"!==t.action&&this.updateSelectedItem(t),this.hidePopup(t));break;case"moveDown":case"moveUp":case"home":case"end":this.updateSelectedItem(t)}},g.prototype.updateSelectedItem=function(t,e,i){if(void 0===e&&(e=!0),this.isPopupOpen){var o=this.fields.groupBy?this.gridObj.selectedRowIndex?this.gridObj.selectedRowIndex:0:this.gridObj.selectedRowIndex;-1===o&&("moveDown"===t.action||"moveUp"===t.action)||"home"===t.action?o=0:o>=this.gridObj.getRows().length&&"moveDown"===t.action||"end"===t.action?o=this.gridObj.getRows().length-1:"moveDown"===t.action&&o>=0&&o<=this.gridObj.getRows().length&&(this.fields.groupBy||i)?o+=1:("moveUp"===t.action&&o>0&&this.fields.groupBy||i)&&(o-=1),this.gridObj.selectRow(o),this.gridObj.selectedRowIndex=o;var r=this.gridEle.querySelector(".e-row-focus");r&&r.classList.remove("e-row-focus"),e&&this.selectedGridRow(this.gridObj.getRows()[o],t,!0)}},g.prototype.updateClearIconState=function(){var t=this.inputWrapper.querySelector(".e-clear-icon");t&&(t.style.display=""===this.inputEle.value?"none":"flex")},g.prototype.focusIn=function(t){this.disabled||this.readonly||(e.addClass([this.inputWrapper],["e-input-focus"]),this.inputEle.focus(),this.updateClearIconState(),this.trigger("focus",t),"Never"!==this.floatLabelType&&i.Input.calculateWidth(this.inputEle,this.inputWrapper))},g.prototype.focusOut=function(t){if(!this.disabled&&!this.readonly){this.isPopupOpen&&this.hidePopup(t),e.removeClass([this.inputWrapper],["e-input-focus"]);var o=this.inputWrapper.querySelector(".e-clear-icon");o&&(o.style.display="none"),"Never"!==this.floatLabelType&&i.Input.calculateWidth(this.inputEle,this.inputWrapper)}},g.prototype.showPopup=function(t,i){var o=this,r={name:"FadeIn",duration:100},n={popup:this.popupObj,event:t,cancel:!1,animation:r};this.trigger("open",n,function(r){if(!r.cancel&&!o.isPopupOpen){o.isPopupOpen=!0,o.popupObj.refreshPosition(),e.addClass([o.inputWrapper],["e-icon-anim"]),e.attributes(o.inputEle,{"aria-expanded":"true","aria-owns":o.element.id+"_popup","aria-controls":o.element.id}),i||((o.value||o.text||o.index)&&o.gridObj.currentViewData.forEach(function(t,e){o.selectDataRow(t,e)}),o.focusIn(t));var n=o.gridObj.getContent();if(n){var s=n.querySelector(".e-rowcell.e-active");s?o.inputEle.setAttribute("aria-activedescendant",s.parentElement.getAttribute("data-uid")):n.querySelector(".e-row")&&o.inputEle.setAttribute("aria-activedescendant",n.querySelector(".e-row").getAttribute("data-uid"))}o.popupObj.show(new e.Animation(r.animation),o.popupEle)}})},g.prototype.hidePopup=function(t){var i=this,o={name:"FadeOut",duration:100},r={popup:this.popupObj,event:t||null,cancel:!1,animation:o};this.trigger("close",r,function(o){if(!o.cancel){if(i.isPopupOpen=!1,e.removeClass([i.inputWrapper],["e-icon-anim"]),e.attributes(i.inputEle,{"aria-expanded":"false"}),i.popupObj.hide(new e.Animation(o.animation)),i.inputEle.value=i.text?i.text.toString():"",t){var r=t.target;r&&(r.classList.contains("e-multicolumn-list-icon")||r.classList.contains("e-rowcell"))?(i.value||i.gridObj.refreshColumns(),setTimeout(function(){i.focusIn(t)})):i.focusOut()}i.inputEle.removeAttribute("aria-owns"),i.inputEle.removeAttribute("aria-activedescendant")}}),setTimeout(function(){i.gridObj&&(i.gridObj.dataSource=i.dataSource,i.updateGridHeight(!0,!1))},100)},g.prototype.addItems=function(t,e){var i=this.isProtectedOnChange;this.isProtectedOnChange=!0,this.gridObj.editSettings.allowAdding=!0,this.gridObj.dataBind(),this.isProtectedOnChange=i,this.gridObj.addRecord(t,e)},g.prototype.getItems=function(){return this.gridObj.getDataRows()},g.prototype.getDataByValue=function(t){var i=this;return!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof Array?this.dataSource.filter(function(e){return e[i.fields.value].toString()===t})[0]:(!e.isNullOrUndefined(this.dataSource)&&this.dataSource instanceof o.DataManager&&this.dataSource.executeQuery(new o.Query).then(function(e){return e.result.filter(function(e){return e[i.fields.value].toString()===t})[0]}),null)},g.prototype.destroy=function(){if(this.unWireEvents(),this.gridObj&&(this.gridObj.destroy(),e.detach(this.gridObj.element)),this.inputEle){for(var t=["placeholder","aria-expanded","spellcheck","aria-label","role","type","aria-owns","aria-controls","aria-readonly","autocomplete","autocapitalize","spellcheck","aria-activedescendant"],o=0;o<t.length;o++)this.inputEle.removeAttribute(t[o]);this.inputEle.classList.remove("e-input"),i.Input.setValue("",this.inputEle,this.floatLabelType,this.showClearButton)}this.popupEle&&(this.popupEle.removeAttribute("aria-label"),this.popupEle.removeAttribute("role")),this.popupObj&&(this.popupObj.destroy(),e.detach(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),this.inputObj&&(e.detach(this.inputObj.container),this.inputObj=null),i.Input.destroy({element:this.inputEle,floatLabelType:this.floatLabelType,properties:this.properties}),e.detach(this.inputWrapper),e.detach(this.popupDiv),this.inputEle=null,this.previousItemElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.popupObj=null,this.gridObj=null,this.gridEle=null,this.popupEle=null,this.footer=null,this.noRecord=null,c.prototype.destroy.call(this)},g.prototype.onPropertyChanged=function(e,o){for(var r=0,n=Object.keys(e);r<n.length;r++){var s=n[r],a=void 0;switch(s){case"width":case"popupWidth":"width"===s&&this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.getSize(!0));break;case"popupHeight":if(this.popupObj){var l=this.getSize(!1);this.popupObj.element.style.maxHeight=l,this.popupDiv.style.maxHeight=l,this.gridObj.height=l}break;case"placeholder":i.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"readonly":i.Input.setReadonly(this.readonly,this.inputEle);break;case"disabled":i.Input.setEnabled(!this.disabled,this.inputEle),this.setEnable();break;case"cssClass":this.setCssClass(e.cssClass,o.cssClass);break;case"floatLabelType":i.Input.removeFloating(this.inputObj),i.Input.addFloating(this.inputEle,this.floatLabelType,this.placeholder);break;case"showClearButton":i.Input.setClearButton(e.showClearButton,this.inputEle,this.inputObj);break;case"value":this.initValue(!0,!0);break;case"text":this.initValue(!0,!1);break;case"index":this.initValue();break;case"sortOrder":this.gridObj&&(this.gridObj.sortSettings.columns=[{field:this.fields.text,direction:e.sortOrder===t.SortOrder.Ascending?t.SortOrder.Ascending:t.SortOrder.Descending}]);break;case"htmlAttributes":this.setHTMLAttributes();break;case"noRecordsTemplate":this.l10nUpdate();break;case"actionFailureTemplate":this.l10nUpdate(!0);break;case"footerTemplate":this.setFooterTemplate();break;case"itemTemplate":this.gridObj&&(this.gridObj.rowTemplate=e.itemTemplate);break;case"groupTemplate":this.groupTemplate=e.groupTemplate,this.updateGroupByField();break;case"enableRtl":this.gridObj&&this.popupObj&&(this.gridObj.enableRtl=e.enableRtl,i.Input.setEnableRtl(e.enableRtl,[this.inputWrapper]),this.popupObj.enableRtl=e.enableRtl);break;case"dataSource":this.gridObj&&(this.gridObj.dataSource=e.dataSource);break;case"query":this.gridObj&&(this.gridObj.query=e.query);break;case"gridSettings":this.gridObj&&(this.gridObj.gridLines=e.gridSettings.gridLines,this.gridObj.rowHeight=e.gridSettings.rowHeight,this.gridObj.enableAltRow=e.gridSettings.enableAltRow);break;case"fields":this.fields=e.fields,this.updateGroupByField();break;case"filterType":this.filterType=e.filterType;break;case"enableVirtualization":this.gridObj&&(this.enableVirtualization=this.gridObj.enableVirtualization=e.enableVirtualization);break;case"sortType":this.sortType=e.sortType;break;case"allowFiltering":this.allowFiltering=e.allowFiltering;break;case"allowSorting":this.gridObj&&(this.allowSorting=this.gridObj.allowSorting=e.allowSorting);break;case"columns":this.gridObj&&(a=this.getGridColumns(),this.gridObj.columns=a)}}},a([e.Property([])],g.prototype,"dataSource",void 0),a([e.Property(null)],g.prototype,"text",void 0),a([e.Property(null)],g.prototype,"value",void 0),a([e.Property(null)],g.prototype,"index",void 0),a([e.Property("100%")],g.prototype,"width",void 0),a([e.Property("300px")],g.prototype,"popupHeight",void 0),a([e.Property("100%")],g.prototype,"popupWidth",void 0),a([e.Property(null)],g.prototype,"placeholder",void 0),a([e.Property(!0)],g.prototype,"allowFiltering",void 0),a([e.Property(!0)],g.prototype,"allowSorting",void 0),a([e.Property(!1)],g.prototype,"showClearButton",void 0),a([e.Property("")],g.prototype,"cssClass",void 0),a([e.Complex({text:null,value:null,groupBy:null},u)],g.prototype,"fields",void 0),a([e.Collection([],d)],g.prototype,"columns",void 0),a([e.Complex({},h)],g.prototype,"gridSettings",void 0),a([e.Property(t.FilterType.StartsWith)],g.prototype,"filterType",void 0),a([e.Property("Never")],g.prototype,"floatLabelType",void 0),a([e.Property(t.SortOrder.None)],g.prototype,"sortOrder",void 0),a([e.Property(t.SortType.OneColumn)],g.prototype,"sortType",void 0),a([e.Property(!1)],g.prototype,"enableVirtualization",void 0),a([e.Property(!1)],g.prototype,"disabled",void 0),a([e.Property(!1)],g.prototype,"readonly",void 0),a([e.Property(!1)],g.prototype,"enablePersistence",void 0),a([e.Property()],g.prototype,"query",void 0),a([e.Property(null)],g.prototype,"itemTemplate",void 0),a([e.Property(null)],g.prototype,"footerTemplate",void 0),a([e.Property(null)],g.prototype,"groupTemplate",void 0),a([e.Property("Request Failed")],g.prototype,"actionFailureTemplate",void 0),a([e.Property("No records found")],g.prototype,"noRecordsTemplate",void 0),a([e.Property({})],g.prototype,"htmlAttributes",void 0),a([e.Event()],g.prototype,"created",void 0),a([e.Event()],g.prototype,"open",void 0),a([e.Event()],g.prototype,"close",void 0),a([e.Event()],g.prototype,"actionFailure",void 0),a([e.Event()],g.prototype,"actionBegin",void 0),a([e.Event()],g.prototype,"actionComplete",void 0),a([e.Event()],g.prototype,"filtering",void 0),a([e.Event()],g.prototype,"select",void 0),a([e.Event()],g.prototype,"change",void 0),g=a([e.NotifyPropertyChanges],g)}(e.Component);return c.Inject(n.VirtualScroll,n.Sort,n.Edit,n.Group),Object.defineProperty(t,"Edit",{enumerable:!0,get:function(){return n.Edit}}),Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return n.Group}}),Object.defineProperty(t,"Sort",{enumerable:!0,get:function(){return n.Sort}}),Object.defineProperty(t,"VirtualScroll",{enumerable:!0,get:function(){return n.VirtualScroll}}),t.Column=d,t.FieldSettings=u,t.GridSettings=h,t.MultiColumnComboBox=c,t.MultiColumnGrid=p,t}({},ej.base,ej.inputs,ej.data,ej.popups,index),this.ejs=ej;
11
11
  //# sourceMappingURL=ej2-multicolumn-combobox.min.js.map