@syncfusion/ej2-dropdowns
Version:
Essential JS 2 DropDown Components
10 lines • 601 kB
JavaScript
/*!
* filename: ej2-dropdowns.umd.min.js
* version : 32.1.21
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-notifications"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-navigations")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-lists","@syncfusion/ej2-notifications","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-navigations"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Data,e.ej2Lists,e.ej2Notifications,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Navigations)}(this,function(e,P,m,H,V,o,h,U,F){"use strict";var v="",W="",q="",g=[],M="";function j(e,t,i,s,l,n,a,o,r){var h;if(n&&""!==v?v===W&&(q=String.fromCharCode(e)):""!==q?(v=q+String.fromCharCode(e),q=""):v+=String.fromCharCode(e),o?(setTimeout(function(){q=""},700),setTimeout(function(){v=""},3e3)):setTimeout(function(){v=""},1e3),v=s?v.toLowerCase():v,M!==l||W!==v||r){var u=t,p=v.length,d=void 0,c=i=i?i+1:0;for(g=[];d=u[h=-1===(c=c===u.length?-1:c)?0:c],(s?d.innerText.toLowerCase():d.innerText).substr(0,p)===v&&g.push(u[h]),++c!==i;);if(W=v,M=l,o){for(var m=!1,f=0;f<g.length;f++)if(a&&g[f].textContent.toLowerCase()===a.toLowerCase()){h=f,m=!0;break}return a&&m&&(h+=1),g[h]||g[0]}return g[0]}for(var c=0;c<g.length;c++){if(g[c].classList.contains("e-active")){h=c;break}if(a&&g[c].textContent.toLowerCase()===a.toLowerCase()){h=c;break}}return h+=1,o?g[h]&&g.length-1!==h?g[h]:g[g.length]:g[h]||g[0]}function d(e,a,o,r,h,u,p,d){var t=a,c=(r=null==r||r,{item:null,index:null});if(e&&e.length&&a)for(var m=e.length,f=R(f=r?e.toLocaleLowerCase():e),i=0,s=t;i<s.length;i++){var l=function(e,t){var i,s,l,t=t[e],n=(a&&h&&(s=t,l=u.text.split("."),h.filter(function(t){Array.prototype.slice.call(l).forEach(function(e){("object"===p&&!t.isHeader&&-1!==s.textContent.toString().indexOf(t[e])&&null!=t[u.value]&&s.getAttribute("data-value")===t[u.value].toString()||"string"===p&&-1!==s.textContent.toString().indexOf(t))&&(i="object"===p?t[e]:t)})})),(h&&i?r?i.toString().toLocaleLowerCase():i:r?t.textContent.toLocaleLowerCase():t.textContent).replace(/^\s+|\s+$/g,""));if(d&&n&&f&&(n=n.normalize("NFD").replace(/[\u0300-\u036f]/g,""),f=f.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),"Equal"===o&&n===f||"StartsWith"===o&&n.substr(0,m)===f||"EndsWith"===o&&n.substr(n.length-f.length)===f||"Contains"===o&&new RegExp(f,"g").test(n))return{value:{item:c.item=t,index:c.index=e}}}(i,s);if("object"==typeof l)return l.value}return c}function R(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z(e){M===e&&(v=W=M="",g=[])}function K(e,t,i,s){/<[^>]*>/g.test(e.innerText)&&""!==t&&(e.innerText=e.innerText.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})),""!==t&&(i=i?"gim":"gm",t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),function e(t,i){for(var s=0;t.childNodes&&s<t.childNodes.length;s++){if(3===t.childNodes[s].nodeType&&""!==t.childNodes[s].textContent.trim()){var l=t.childNodes[s].nodeValue.trim().replace(i,'<span class="e-highlight">$1</span>');t.childNodes[s].nodeValue="",t.innerHTML=t.innerHTML.trim()+l;break}e(t.childNodes[s],i)}}(e,new RegExp("StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")",i)))}function G(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;0<=i;i--){var s=t[i].parentNode,l=document.createTextNode(t[i].textContent);s.replaceChild(l,t[i])}}var _=function(){return(_=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)},Q=function(n,a,o,r){return new(o=o||Promise)(function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function s(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){t.done?e(t.value):new o(function(e){e(t.value)}).then(i,s)}l((r=r.apply(n,a||[])).next())})},J=function(s,l){var n,a,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(o=2&t[0]?a.return:t[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,t[1])).done)return o;switch(a=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return r.label++,{value:t[1],done:!1};case 5:r.label++,a=t[1],t=[0];continue;case 7:t=r.ops.pop(),r.trys.pop();continue;default:if(!(o=0<(o=r.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){r=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))r.label=t[1];else if(6===t[0]&&r.label<o[1])r.label=o[1],o=t;else{if(!(o&&r.label<o[2])){o[2]&&r.ops.pop(),r.trys.pop();continue}r.label=o[2],r.ops.push(t)}}t=l.call(s,r)}catch(e){t=[6,e],a=0}finally{n=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},X=(t.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("observe",this.observe,this),this.parent.on("setGeneratedData",this.setGeneratedData,this),this.parent.on("dataProcessAsync",this.dataProcessAsync,this),this.parent.on("setCurrentViewDataAsync",this.setCurrentViewDataAsync,this),this.parent.on("bindScrollEvent",this.bindScrollEvent,this))},t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("observe",this.observe),this.parent.off("setGeneratedData",this.setGeneratedData),this.parent.off("dataProcessAsync",this.dataProcessAsync),this.parent.off("setCurrentViewDataAsync",this.setCurrentViewDataAsync),this.parent.off("bindScrollEvent",this.bindScrollEvent))},t.prototype.bindScrollEvent=function(e){var t=this;this.component=e.component,this.observe(function(e){return t.scrollListener(e)})},t.prototype.observe=function(e){this.containerElementRect=this.parent.popupContentElement.getBoundingClientRect(),P.EventHandler.add(this.parent.popupContentElement,"wheel mousedown",this.popupScrollHandler,this),this.touchModule=new P.Touch(this.parent.popupContentElement,{scroll:this.popupScrollHandler.bind(this)}),P.EventHandler.add(this.parent.popupContentElement,"scroll",this.virtualScrollHandler(e),this)},t.prototype.getModuleName=function(){return"VirtualScroll"},t.prototype.popupScrollHandler=function(){this.parent.isMouseScrollAction=!0,this.parent.isPreventScrollAction=!1},t.prototype.getPageQuery=function(e,t,i){return e=0===i||this.parent.allowFiltering||"autocomplete"===this.component?e:e.skip(t)},t.prototype.setGeneratedData=function(e,t){for(var i,s=0,l=this.parent.listData.length+this.parent.virtualItemStartIndex,n=this.parent.virtualItemStartIndex;n<l;n++)this.parent.generatedDataObject[n]||null!==t&&0<this.parent.listData.slice(s,s+1).length&&0<(i=this.parent.listData.slice(s,s+1)).length&&(this.parent.generatedDataObject[n]=i),s++},t.prototype.generateAndExecuteQueryAsync=function(e,t,i,s){void 0===t&&(t=0),void 0===i&&(i=0);var l=this.parent.dataSource,s=((s=void 0===s?!1:s)||(e=P.isNullOrUndefined(this.parent.query)?this.getPageQuery(e,t,i):(s=this.removeSkipAndTakeEvents(this.parent.query.clone()),this.getPageQuery(s,t,i))),this.parent.isCustomFilter);"combobox"===this.component&&(t=0,this.parent.dataSource instanceof m.DataManager?t=this.parent.remoteDataCount:this.parent.dataSource&&0<this.parent.dataSource.length&&(t=this.parent.dataSource.length),0<t)&&(this.parent.isCustomFilter=t===this.parent.totalItemCount&&this.parent.queryString!==this.parent.typedString||this.parent.isCustomFilter),this.parent.resetList(l,this.parent.fields,e),this.parent.isCustomFilter=s},t.prototype.removeSkipAndTakeEvents=function(e){return e.queries=e.queries.filter(function(e){return"onSkip"!==e.fn&&"onTake"!==e.fn}),e},t.prototype.setCurrentViewDataAsync=function(e){var t=[],i=!1,s=!0,l=(P.isNullOrUndefined(this.component)&&(this.component=e.component),this.parent.viewPortInfo.endIndex);if("multiselect"===this.component&&"CheckBox"===this.parent.mode&&this.parent.value&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.enableSelectionOrder&&""===this.parent.targetElement().trim()&&(this.parent.viewPortInfo.startIndex<this.parent.value.length?(l=this.parent.viewPortInfo.endIndex-this.parent.value.length,0===this.parent.viewPortInfo.startIndex?((a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount?((e=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(e),u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof m.DataManager&&this.parent.appendUncheckList,s=!1):(e=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(e),s=!1):0!==this.parent.viewPortInfo.startIndex&&(this.parent.dataSource instanceof m.DataManager&&(this.parent.setCurrentView=!1),this.parent.updateVirtualReOrderList(!0),(a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),s=!1),0!==this.parent.viewPortInfo.startIndex&&this.parent.viewPortInfo.startIndex-this.parent.value.length!==this.parent.itemCount&&this.parent.viewPortInfo.startIndex+this.parent.itemCount>this.parent.value.length&&(u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,(a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof m.DataManager&&this.parent.appendUncheckList)):(e=this.parent.list.querySelectorAll(".e-reorder")[0],this.parent.list.querySelector(".e-virtual-ddl-content")&&e&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(e),u=this.parent.getForQuery(this.parent.value).clone(),e=0<=this.parent.viewPortInfo.startIndex-this.parent.value.length?this.parent.viewPortInfo.startIndex-this.parent.value.length:0,u=u.skip(e),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1),this.parent.totalItemsCount()),s){"multiselect"===this.component&&2*this.parent.itemCount>this.parent.totalItemCount&&(this.parent.viewPortInfo.endIndex=l=this.parent.totalItemCount,this.parent.isVirtualTrackHeight=!0);for(var n=this.parent.viewPortInfo.startIndex;n<l;n++){var a,o=n,r=("multiselect"===this.component&&"CheckBox"===this.parent.mode&&(a=this.parent.list.querySelector(".e-list-parent.e-reorder"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),this.parent.generatedDataObject[o]);if("multiselect"===this.component&&this.parent.hideSelectedItem){if(r){var h=P.getValue(this.parent.fields.value,r[0]);if(this.parent.value&&null!==h&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.value.indexOf(h)<0){var u=this.parent.getForQuery(this.parent.value).clone();u=this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.isPreventScrollAction=!0,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),i=!0;break}(null===this.parent.value||this.parent.value&&0===this.parent.value.length)&&t.push(r[0])}o===l-1&&t.length!==this.parent.itemCount&&this.parent.hideSelectedItem&&(u=this.parent.value&&0<this.parent.value.length?this.parent.getForQuery(this.parent.value).clone():new m.Query,u=this.parent.value&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),i=!0)}else r&&t.push(r[0]);this.parent.setCurrentView=!1}}!i&&s&&("multiselect"===this.component&&this.parent.allowCustomValue&&0===this.parent.viewPortInfo.startIndex&&this.parent.virtualCustomData&&t.splice(0,0,this.parent.virtualCustomData),"multiselect"===this.component&&this.parent.allowCustomValue&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount&&this.parent.virtualCustomSelectData&&0<this.parent.virtualCustomSelectData.length&&(t=t.concat(this.parent.virtualCustomSelectData)),this.parent.renderItems(t,this.parent.fields,"multiselect"===this.component&&"CheckBox"===this.parent.mode),this.parent.updateSelectionList()),"multiselect"===this.component&&(this.parent.updatevirtualizationList(),this.parent.checkMaxSelection()),this.parent.getSkeletonCount(),this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof m.DataManager)||this.parent.dataSource instanceof m.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;var e=this.parent.list.getElementsByClassName("e-virtual-ddl")[0],s="multiselect"!==this.component||"multiselect"===this.component&&!(this.parent.dataSource instanceof m.DataManager)||this.parent.dataSource instanceof m.DataManager&&!i,e=(e&&s?e.style=this.parent.GetVirtualTrackHeight():!e&&0<this.parent.skeletonCount&&this.parent.popupWrapper&&(e=this.parent.createElement("div",{id:this.parent.element.id+"_popup",className:"e-virtual-ddl",styles:this.parent.GetVirtualTrackHeight()}),this.parent.popupWrapper.querySelector(".e-dropdownbase").appendChild(e)),"multiselect"===this.component&&("multiselect"!==this.component||this.parent.dataSource instanceof m.DataManager)&&(!(this.parent.dataSource instanceof m.DataManager)||i&&0!==this.parent.viewPortInfo.startIndex)||this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item"),this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0]);e&&s&&(e.style=this.parent.getTransformValues()),this.parent.fields.groupBy&&this.parent.scrollStop(),40===this.parent.keyCode&&this.parent.isScrollChanged&&this.parent.hideSelectedItem&&!P.isNullOrUndefined(this.parent.currentFocuedListElement)&&(s=this.parent.getElementByValue(this.parent.currentFocuedListElement.getAttribute("data-value")),this.parent.addListFocus(s),this.parent.isScrollChanged=!1)},t.prototype.generateQueryAndSetQueryIndexAsync=function(e,t){var i=!1,s=0,l=0,n=this.parent.viewPortInfo.endIndex;if(!t&&0!==n)for(var a=this.parent.viewPortInfo.startIndex;a<=n;a++)a in this.parent.generatedDataObject||(i?l=a===n?a:a+1:(i=!0,s=l=a));!i||this.parent.totalItemCount===s&&this.parent.totalItemCount===l||(this.parent.virtualItemStartIndex=s,this.parent.virtualItemEndIndex=l,this.parent.setCurrentView=!0,this.generateAndExecuteQueryAsync(e,s,l),"multiselect"===this.component&&this.parent.hideSelectedItem&&this.parent.value&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.totalItemsCount(),"multiselect"===this.component&&this.parent.virtualItemStartIndex===this.parent.virtualItemEndIndex&&(this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex)),this.parent.dataSource instanceof m.DataManager&&(!(this.parent.dataSource instanceof m.DataManager)||this.parent.isRequesting)||this.setCurrentViewDataAsync()},t.prototype.dataProcessAsync=function(e){this.parent.selectedValueInfo=null,this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex,this.generateQueryAndSetQueryIndexAsync(new m.Query,e)},t.prototype.virtualScrollRefreshAsync=function(){return Q(this,void 0,void 0,function(){return J(this,function(e){switch(e.label){case 0:return this.parent.isCustomFilter=!(this.parent.isTyped||"combobox"===this.component&&this.parent.allowFiltering&&this.parent.queryString!==this.parent.typedString||!P.isNullOrUndefined(this.parent.filterInput)&&!P.isNullOrUndefined(this.parent.filterInput.value)&&""!==this.parent.filterInput.value&&"combobox"!==this.component)&&!("autocomplete"===this.component&&null!=this.parent.value)||this.parent.isCustomFilter,!this.parent.allowFiltering&&"autocomplete"!==this.component||(P.isNullOrUndefined(this.parent.typedString)||"combobox"===this.component&&!P.isNullOrUndefined(this.parent.typedString)&&this.parent.allowFiltering?(this.parent.getSkeletonCount(!0),"combobox"===this.component&&(this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof m.DataManager)||this.parent.dataSource instanceof m.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount)):(this.parent.viewPortInfo.endIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.endIndex=this.parent.dataCount),this.parent.viewPortInfo.startIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.startIndex=this.parent.dataCount-this.parent.itemCount))),[4,this.dataProcessAsync()];case 1:return e.sent(),null==this.parent.keyboardEvent||this.parent.dataSource instanceof m.DataManager&&(!(this.parent.dataSource instanceof m.DataManager)||this.parent.isRequesting)||this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent,this.parent.pageCount),this.parent.customFilterQuery||(this.parent.isCustomFilter=!1),[2]}})})},t.prototype.scrollListener=function(e){var t,i,s=this;this.parent.isPreventScrollAction||this.parent.isVirtualTrackHeight||(this.parent.preventSetCurrentData=!1,t=e.sentinel,i=this.parent.previousStartIndex,this.parent.viewPortInfo=this.getInfoFromView(e.direction,t,e.offset,!1),this.parent.isUpwardScrolling=!1,this.parent.previousStartIndex===i||this.parent.isKeyBoardAction?this.parent.isScrollActionTriggered&&(this.parent.isPreventKeyAction=!1,this.parent.isScrollActionTriggered=!1,this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.parent.getTransformValues()):(this.parent.isScrollActionTriggered=!1,this.parent.currentPageNumber=this.parent.viewPortInfo.currentPageNumber,this.parent.virtualListInfo=_({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout(function(){s.parent.pageCount=s.parent.getPageCount(),s.parent.isRequesting=!1,s.virtualScrollRefreshAsync().then(function(){s.parent.popupObj&&(s.parent.list=s.parent.popupObj.element.querySelector(".e-content")||P.select(".e-content"),s.parent.updateSelectionList(),s.parent.liCollections=s.parent.getItems()),s.parent.isKeyBoardAction=!1,s.parent.isVirtualScrolling=!1,s.parent.isPreventKeyAction=!1})},5)),this.parent.previousInfo=this.parent.viewPortInfo)},t.prototype.getInfoFromView=function(e,t,i,s){var l,n,e={direction:e,sentinelInfo:t,offsets:i,startIndex:this.parent.previousStartIndex,endIndex:this.parent.previousEndIndex},t=this.parent.popupContentElement?this.parent.popupContentElement.getBoundingClientRect().height:0,a=this.parent.listItemHeight,i=i.top/a,t=t/a,o=i+t,r=this.parent.virtualItemCount/4,h=this.parent.totalItemCount;return"down"===e.direction?(n=Math.round(o)-Math.round(r),(P.isNullOrUndefined(e.startIndex)||o>e.startIndex+Math.round(this.parent.virtualItemCount/2+r)&&e.endIndex!==h)&&(e.startIndex=0<=n?Math.round(n):0,e.startIndex=e.startIndex>i?Math.floor(i):e.startIndex,l=e.startIndex+this.parent.virtualItemCount,e.startIndex=l<o?Math.ceil(o)-this.parent.virtualItemCount:e.startIndex,e.endIndex=l<h?l:h,e.startIndex=h<=l?0<e.endIndex-this.parent.virtualItemCount?e.endIndex-this.parent.virtualItemCount:0:e.startIndex,e.currentPageNumber=Math.ceil(e.endIndex/this.parent.virtualItemCount))):"up"===e.direction&&(e.startIndex&&e.endIndex||Math.ceil(i)>this.parent.previousStartIndex)&&(i<Math.round((e.startIndex*a+r*a)/a)||Math.ceil(i)>this.parent.previousStartIndex)&&(l=Math.round(i+(t<r?r:t+t/4)),e.endIndex=l<h?l:h,n=e.endIndex-this.parent.virtualItemCount,e.startIndex=0<n?n:0,e.endIndex=n<0?this.parent.virtualItemCount:e.endIndex,e.currentPageNumber=Math.ceil(e.startIndex/this.parent.virtualItemCount)),s?this.parent.scrollPreStartIndex=e.startIndex:(this.parent.previousStartIndex=e.startIndex,this.parent.startIndex=e.startIndex,this.parent.previousEndIndex=e.endIndex),e},t.prototype.virtualScrollHandler=function(e){var a=this,t="chrome"===P.Browser.info.name?200:100,o=0,r=P.debounce(e,t),h=P.debounce(e,50);return function(e){var t=e.target.scrollTop,e=e.target.scrollLeft,i=o<t&&!a.parent.isUpwardScrolling?"down":"up",s=(o=t,a.sentinelInfo[i]),l=a.parent.scrollPreStartIndex,n={top:t,left:e},n=(a.parent.list&&0<a.parent.list.querySelectorAll(".e-virtual-list").length&&(a.getInfoFromView(i,s,n,!0),a.parent.scrollPreStartIndex===l||a.parent.isPreventScrollAction||(a.parent.isScrollActionTriggered=!0,a.parent.list.querySelector(".e-virtual-ddl-content").style.transform="translate(0px,"+t+"px)")),r);(n="X"===s.axis?h:n)({direction:i,sentinel:s,offset:{top:t,left:e},focusElement:document.activeElement})}},t.prototype.destroy=function(){this.removeEventListener()},t);function t(e){var s=this;this.sentinelInfo={up:{check:function(e,t){e=e.top-s.containerElementRect.top;return t.entered=0<=e,0<=e+s.parent.listItemHeight*s.parent.virtualItemCount/2},axis:"Y"},down:{check:function(e,t){var i=e.bottom;return t.entered=e.bottom<=s.containerElementRect.bottom,i-s.parent.listItemHeight*s.parent.virtualItemCount/2<=s.parent.listItemHeight*s.parent.virtualItemCount/2},axis:"Y"}},this.parent=e,this.removeEventListener(),this.addEventListener()}Y=function(e,t){return(Y=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])}))(e,t)};var Y,$,Z=function(e,t){function i(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},ee=($=P.ChildProperty,Z(te,$),i([P.Property()],te.prototype,"text",void 0),i([P.Property()],te.prototype,"value",void 0),i([P.Property()],te.prototype,"iconCss",void 0),i([P.Property()],te.prototype,"groupBy",void 0),i([P.Property()],te.prototype,"htmlAttributes",void 0),i([P.Property()],te.prototype,"disabled",void 0),te);function te(){return null!==$&&$.apply(this,arguments)||this}var ie,y={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group",virtualList:"e-list-item e-virtual-list"},Z=(ie=P.Component,Z(s,ie),s.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object,t=(s[e]=t[e],l[e]=i[e],new Object);return t.newProperty=s,t.oldProperty=l,t},s.prototype.getValueByText=function(e,t,i){var s=null;return s=P.isNullOrUndefined(this.listData)?s:t?this.checkValueCase(e,!0,i):this.checkValueCase(e,!1,i)},s.prototype.checkValueCase=function(i,e,t,s){var l=this,n=s?i:null;if(!P.isNullOrUndefined(this.listData)){var a,o=this.listData,r=this.fields,h=this.typeOfData(o).typeof;if("string"===h||"number"===h||"boolean"===h)for(var u=0,p=o;u<p.length;u++){var d=p[u];P.isNullOrUndefined(d)||(t?e&&!this.checkIgnoreCase(String(d),i)||(n=this.checkingAccent(String(d),i,e)):e?this.checkIgnoreCase(String(d),i)&&(n=this.getItemValue(String(d),i,e)):this.checkNonIgnoreCase(String(d),i)&&(n=this.getItemValue(String(d),i,e,s)))}else e?o.filter(function(e){var t=P.getValue(r.value,e);!P.isNullOrUndefined(t)&&l.checkIgnoreCase(P.getValue(r.text,e).toString(),i)&&(n=P.getValue(r.value,e))}):s?(a=null,a=n,o.filter(function(e){var t=P.getValue(r.value,e);P.isNullOrUndefined(t)||P.isNullOrUndefined(n)||t.toString()!==a.toString()||(n=P.getValue(r.text,e))})):o.filter(function(e){l.checkNonIgnoreCase(P.getValue(r.text,e),i)&&(n=P.getValue(r.value,e))})}return n},s.prototype.checkingAccent=function(e,t,i){var s=m.DataUtil.ignoreDiacritics(String(e)),l=m.DataUtil.ignoreDiacritics(t.toString()),n=null;return i?this.checkIgnoreCase(s,l)&&(n=this.getItemValue(String(e),t,i)):this.checkNonIgnoreCase(String(e),t)&&(n=this.getItemValue(String(e),t,i)),n},s.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},s.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},s.prototype.getItemValue=function(e,t,i,s){var l=this.listData,l=this.typeOfData(l).typeof;return s?e.toString():i?"string"===l?String(e):this.getFormattedValue(String(e)):"string"===l?t:this.getFormattedValue(t)},s.prototype.templateCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!P.selectAll(e,document).length}catch(e){t=!1}return t},s.prototype.l10nUpdate=function(e){var t="listbox"===this.getModuleName()?this.ulElement:this.list;if(!P.isNullOrUndefined(this.noRecordsTemplate)&&"No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=void 0,l=e?this.actionFailureTemplateId:this.noRecordsTemplateId,n=(t.innerHTML="",this.templateCompiler(i)),s="function"!=typeof i&&n?P.compile(P.select(i,document).innerHTML.trim()):P.compile(i),a=e?"actionFailureTemplate":"noRecordsTemplate",o=void 0;if((o=this.isReact&&"function"==typeof i?s({},this,a,l,this.isStringTemplate,null):s({},this,a,l,this.isStringTemplate,null,t))&&0<o.length)for(var r=0;r<o.length;r++)"listbox"===this.getModuleName()&&"noRecordsTemplate"==a?"#text"===o[r].nodeName?((h=this.createElement("li")).textContent=o[r].textContent,h.classList.add("e-list-nrt"),h.setAttribute("role","option"),t.appendChild(h)):(o[r].classList.add("e-list-nr-template"),t.appendChild(o[r])):(o[r]instanceof HTMLElement||o[r]instanceof Text&&""!==o[r].textContent)&&t.appendChild(o[r]);this.renderReactTemplates()}else{var h,n=new P.L10n(this.getLocaleName(),{},this.locale),i=(""!==n.getConstant("actionFailureTemplate")||""!==n.getConstant("noRecordsTemplate")?this.l10n=n:this.l10n=new P.L10n("listbox"===this.getModuleName()?"listbox":"mention"===this.getModuleName()?"mention":"dropdowns",{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},this.locale),e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate"));"listbox"===this.getModuleName()?((h=this.createElement("li")).textContent=i,t.appendChild(h),h.classList.add("e-list-nrt"),h.setAttribute("role","option")):P.isNullOrUndefined(t)||(t.innerHTML=i)}},s.prototype.checkAndResetCache=function(){this.isVirtualizationEnabled&&(this.generatedDataObject={},this.virtualItemStartIndex=this.virtualItemEndIndex=0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.selectedValueInfo=null)},s.prototype.updateIncrementalInfo=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.isIncrementalRequest=!0,this.resetList(this.dataSource,this.fields,this.query),this.isIncrementalRequest=!1},s.prototype.updateIncrementalView=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")},s.prototype.updateVirtualItemIndex=function(){this.virtualItemStartIndex=this.viewPortInfo.startIndex,this.virtualItemEndIndex=this.viewPortInfo.endIndex,this.virtualListInfo=this.viewPortInfo},s.prototype.getFilteringSkeletonCount=function(){var e=this.skeletonCount,t=(this.getSkeletonCount(!0),this.skeletonCount=this.dataCount<2*this.itemCount&&(!(this.dataSource instanceof m.DataManager)||this.dataSource instanceof m.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,!0);"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof m.DataManager&&!(this.dataSource instanceof m.DataManager&&this.totalItemCount<=this.itemCount)||(this.skeletonCount=0,t=!1),this.list.classList.contains(y.noData)||(e!==this.skeletonCount&&t?this.UpdateSkeleton(!0,Math.abs(e-this.skeletonCount)):this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),0<this.list.getElementsByClassName("e-virtual-ddl").length?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&this.list.querySelector(".e-dropdownbase")&&(t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.list.querySelector(".e-dropdownbase").appendChild(t)),0<this.list.getElementsByClassName("e-virtual-ddl-content").length&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},s.prototype.getSkeletonCount=function(e){this.virtualListHeight=null!=this.listContainerHeight?parseInt(this.listContainerHeight,10):this.virtualListHeight;var t=0<this.virtualListHeight&&0<this.listItemHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0;this.skeletonCount=4*t<this.itemCount?this.itemCount:4*t,this.itemCount=e?this.itemCount:this.skeletonCount,this.virtualItemCount=this.itemCount,this.skeletonCount=Math.floor(this.skeletonCount/2)},s.prototype.GetVirtualTrackHeight=function(){var e=this.totalItemCount===this.viewPortInfo.endIndex?this.totalItemCount*this.listItemHeight-this.itemCount*this.listItemHeight:this.totalItemCount*this.listItemHeight,e="height: "+((this.isVirtualTrackHeight?0:e)-this.itemCount*this.listItemHeight)+"px;";return"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||0!==this.skeletonCount?e:"height: 0px;"},s.prototype.getTransformValues=function(){var e=this.viewPortInfo.startIndex*this.listItemHeight;return e-=this.skeletonCount*this.listItemHeight,"transform: translate(0px, "+(e=0===this.viewPortInfo.startIndex&&this.listData&&0===this.listData.length||0===this.skeletonCount?0:e)+"px);"},s.prototype.UpdateSkeleton=function(e,t){var i=this.list.querySelector(".e-virtual-ddl-content"),s=this.list.querySelector(".e-virtual-list");if(i&&(!s||e)&&this.isVirtualizationEnabled){for(var l=e?t:this.skeletonCount,n=0;n<l;n++){var a=this.createElement("li",{className:y.virtualList,styles:"overflow: inherit"});this.isVirtualizationEnabled&&this.itemTemplate&&(a.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px"),(o=new V.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"})).appendTo(this.createElement("div")),a.appendChild(o.element),i.firstChild&&i.firstChild.insertBefore(a,i.firstChild.children[0])}if("multiselect"===this.getModuleName()&&!this.isVirtualReorder&&!i.firstChild.classList.contains("e-reorder")){for(n=0;n<l&&this.totalItemCount!==this.viewPortInfo.endIndex;n++){var o,a=this.createElement("li",{className:y.virtualList+" e-virtual-list-end",styles:"overflow: inherit"});this.isVirtualizationEnabled&&this.itemTemplate&&(a.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px"),(o=new V.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text-end"})).appendTo(this.createElement("div")),a.appendChild(o.element),i.firstChild&&i.firstChild.appendChild(a)}this.totalItemCount===this.viewPortInfo.endIndex&&i.querySelectorAll(".e-virtual-list-end").forEach(function(e){return e.remove()})}}},s.prototype.getLocaleName=function(){return"drop-down-base"},s.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},s.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var t=void 0,t=this.properties.allowCustomValue&&this.properties.value&&this.properties.value instanceof Array&&0<this.properties.value.length?this.typeOfData(this.properties.value):this.typeOfData(this.listData);if(!P.isNullOrUndefined(t.item)&&"number"==typeof P.getValue(this.fields.value||"value",t.item)||"number"===t.typeof)return parseFloat(e);if(!P.isNullOrUndefined(t.item)&&"boolean"==typeof P.getValue(this.fields.value||"value",t.item)||"boolean"===t.typeof)return"true"===e||""+e=="true"}return e},s.prototype.setEnableRtl=function(){P.isNullOrUndefined(this.enableRtlElements)||(this.list&&this.enableRtlElements.push(this.list),this.enableRtl?P.addClass(this.enableRtlElements,y.rtl):P.removeClass(this.enableRtlElements,y.rtl))},s.prototype.initialize=function(e){var t;this.bindEvent=!0,this.preventPopupOpen=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName?(t=H.ListBase.createJsonFromElement(this.element),this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(t,this.fields)):"SELECT"===this.element.tagName?(this.dataSource instanceof Array?0<this.dataSource.length:!P.isNullOrUndefined(this.dataSource))?this.isDynamicDataChange&&this.setListData(this.dataSource,this.fields,this.query):this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query,e)},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.updateDataAttribute=function(e){for(var t=["class","style","id","type","aria-expanded","aria-autocomplete","aria-readonly"],i={},s=0;s<this.element.attributes.length;s++)-1!==t.indexOf(this.element.attributes[s].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[s].name||(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));P.extend(i,e,i),this.setProperties({htmlAttributes:i},!0)},s.prototype.renderItemsBySelect=function(){var e=this.element,t=e.querySelectorAll("select>optgroup"),i="multiselect"===this.getModuleName()&&this.isGroupChecking&&0<t.length,s=i?{value:"value",text:"text",groupBy:"categeory"}:{value:"value",text:"text"},l=[],n=e.querySelectorAll("select>option");if(this.getJSONfromOption(l,n,s),t.length){for(var a=0;a<t.length;a++){var o=t[a],r={},h=(r[s.text]=o.label,r.isHeader=!0,o.querySelectorAll("option"));i?this.getJSONfromOption(l,h,s,o.label):(l.push(r),this.getJSONfromOption(l,h,s))}e.querySelectorAll("select>option")}this.updateFields(s.text,s.value,(i?s:this.fields).groupBy,this.fields.htmlAttributes,this.fields.iconCss,this.fields.disabled),this.resetList(l,s)},s.prototype.updateFields=function(e,t,i,s,l,n){e={fields:{text:e,value:t,groupBy:P.isNullOrUndefined(i)?this.fields&&this.fields.groupBy:i,htmlAttributes:P.isNullOrUndefined(s)?this.fields&&this.fields.htmlAttributes:s,iconCss:P.isNullOrUndefined(l)?this.fields&&this.fields.iconCss:l,disabled:P.isNullOrUndefined(n)?this.fields&&this.fields.disabled:n}};this.setProperties(e,!0)},s.prototype.getJSONfromOption=function(e,t,i,s){void 0===s&&(s=null);for(var l=0,n=t;l<n.length;l++){var a=n[l],o={};o[i.text]=a.text,o[i.value]=P.isNullOrUndefined(a.getAttribute(i.value))?a.value:a.getAttribute(i.value),P.isNullOrUndefined(s)||(o[i.groupBy]=s),e.push(o)}},s.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.displayTemplateId=this.element.id+"DisplayTemplate",this.spinnerTemplateId=this.element.id+"SpinnerTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},s.prototype.setListData=function(h,u,e,p){var d,c=this,e=(u=u||this.fields,{cancel:!(this.isActive=!0),data:h,query:e});this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",e,function(e){if(!e.cancel)if(c.isRequesting=!0,c.showSpinner(),h instanceof m.DataManager){var l,n=!(c.isRequested=!0);c.isDataFetched?c.emptyDataRequest(u):(l=c.getQuery(e.query),e.data.executeQuery(l).then(function(e){c.isPreventChange=!(!c.isAngular||!c.preventChange)||c.isPreventChange;var t=!0;if(!c.virtualSelectAll){for(var i=l.clone(),s=0;s<i.queries.length;s++)"onWhere"===i.queries[s].fn&&(n=!0);if(c.isVirtualizationEnabled&&0!==e.count&&e.count<2*c.itemCount){if(i)for(s=0;s<i.queries.length;s++){if("multiselect"===c.getModuleName()&&c.isCheckBoxSelection&&i.queries[s].e&&("notequal"===i.queries[s].e.operator||"equal"===i.queries[s].e.operator||"or"===i.queries[s].e.condition||"and"===i.queries[s].e.condition)&&!c.isCustomFiltering){t=!1;break}"onTake"===i.queries[s].fn&&(i.queries[s].e.nos=e.count),"multiselect"!==c.getModuleName()||"or"!==i.queries[s].e.condition&&"equal"!==i.queries[s].e.operator||c.isCustomFiltering||(t=!1)}}else if(c.isVirtualTrackHeight=!1,i)for(s=0;s<i.queries.length;s++)"multiselect"===c.getModuleName()&&(i.queries[s].e&&"or"===i.queries[s].e.condition||i.queries[s].e&&"equal"===i.queries[s].e.operator)&&(t=!1)}t&&(c.dataCount=c.totalItemCount=e.count),c.trigger("actionComplete",e,function(e){var t;e.cancel||(c.isRequesting=!1,c.isCustomFiltering=!1,t=e.result,c.isIncrementalRequest?d=c.renderItems(t,u):((!c.isVirtualizationEnabled&&0===t.length||c.isVirtualizationEnabled&&0===t.length&&!n)&&(c.isDataFetched=!0),n||(c.remoteDataCount=e.count),c.dataCount=c.virtualSelectAll?c.dataCount:e.count,c.totalItemCount=c.virtualSelectAll?c.totalItemCount:e.count,d=c.renderItems(t,u),c.appendUncheckList=!1,c.isUpdateGroupTemplate=!1,c.onActionComplete(d,t,e),c.groupTemplate&&(c.isAngular&&"multiselect"===c.getModuleName()&&c.updateGroupHeaderItems(d),c.renderGroupTemplate(d)),c.isUpdateGroupTemplate=!0,c.isRequested=!1,c.bindChildItems(t,d,u,e),c.getInitialData?(c.getInitialData=!1,c.preventPopupOpen=!1):(t=!1,c.isVirtualizationEnabled&&c.setCurrentView&&(t=!0,c.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),null!=c.keyboardEvent&&c.handleVirtualKeyboardActions(c.keyboardEvent,c.pageCount),e="multiselect"!==c.getModuleName()||"multiselect"===c.getModuleName()&&(!(c.dataSource instanceof m.DataManager)||c.dataSource instanceof m.DataManager&&!t),c.isVirtualizationEnabled&&e&&(c.getFilteringSkeletonCount(),c.updatePopupPosition()),c.virtualSelectAll&&c.virtualSelectAllData&&(c.virtualSelectionAll(c.virtualSelectAllState,c.liCollections,c.CurrentEvent),c.virtualSelectAllState=!1,c.CurrentEvent=null,c.virtualSelectAll=!1))))})}).catch(function(e){c.isRequested=!1,c.isRequesting=!1,c.onActionFailure(e),c.hideSpinner()}))}else{var t=!(c.isRequesting=!1),i=void 0,s=(c.isVirtualizationEnabled&&!c.virtualGroupDataSource&&c.fields.groupBy&&(r=new m.DataManager(c.dataSource).executeLocal((new m.Query).group(c.fields.groupBy)),c.virtualGroupDataSource=r.records),c.isVirtualizationEnabled&&c.virtualGroupDataSource&&!c.isCustomDataUpdated?new m.DataManager(c.virtualGroupDataSource):new m.DataManager(e.data)),i=c.getQuery(e.query).executeLocal(s);if(!c.virtualSelectAll){var a=c.getQuery(e.query);if(c.isVirtualizationEnabled&&0!==i.count&&i.count<2*c.itemCount&&!c.appendUncheckList){if(a){for(var o=0;o<a.queries.length;o++){if("multiselect"===c.getModuleName()&&c.isCheckBoxSelection&&a.queries[o].e&&("notequal"===a.queries[o].e.operator||"equal"===a.queries[o].e.operator||"or"===a.queries[o].e.condition||"and"===a.queries[o].e.condition)&&!c.isCustomFiltering&&c.totalItemCount>2*c.itemCount){t=!1;break}"onTake"===a.queries[o].fn&&(a.queries[o].e.nos=i.count,i=a.executeLocal(s)),"multiselect"!==c.getModuleName()||"or"!==a.queries[o].e.condition&&"equal"!==a.queries[o].e.operator||c.isCustomFiltering||(t=!1)}t&&(i=a.executeLocal(s),c.isVirtualTrackHeight=!(c.dataSource instanceof m.DataManager||c.isCustomDataUpdated))}}else if(c.isVirtualTrackHeight=!1,a)for(o=0;o<a.queries.length;o++)"multiselect"===c.getModuleName()&&(a.queries[o].e&&"or"===a.queries[o].e.condition||a.queries[o].e&&"equal"===a.queries[o].e.operator)&&(t=!1)}!t||c.dataSource instanceof m.DataManager||c.isCustomDataUpdated||c.virtualSelectAll||(c.dataCount=c.totalItemCount=c.virtualSelectAll?i.length:i.count);var r={cancel:!1,result:i=c.isVirtualizationEnabled?i.result:i};c.isPreventChange=!(!c.isAngular||!c.preventChange)||c.isPreventChange,c.trigger("actionComplete",r,function(e){c.isCustomFiltering=!1,c.isIncrementalRequest?d=c.renderItems(e.result,u):e.cancel||(d=c.renderItems(e.result,u),c.isUpdateGroupTemplate=!1,c.onActionComplete(d,e.result,p),c.groupTemplate&&(c.isAngular&&"multiselect"===c.getModuleName()&&c.updateGroupHeaderItems(d),c.renderGroupTemplate(d)),c.isUpdateGroupTemplate=!0,c.bindChildItems(e.result,d,u),c.getInitialData?(c.getInitialData=!1,c.preventPopupOpen=!1):setTimeout(function(){"multiselect"===c.getModuleName()&&null!=c.itemTemplate&&0<d.childElementCount&&(0<d.children[0].childElementCount||c.fields.groupBy&&d.children[1]&&0<d.children[1].childElementCount)&&c.updateDataList()}))})}})},s.prototype.updateGroupHeaderItems=function(e){for(var t=e.querySelectorAll("."+y.group),i=[],s=0;s<t.length;s++)i.push(t[s].cloneNode?t[s].cloneNode(!0):t[s]);this.isFilterAction?this.fiteredGroupHeaderItems=i:this.groupHeaderItems=i},s.prototype.setCustomListData=function(e,t,i,s){var l,n=this;if(t=t||this.fields,this.isActive=!0,this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,!this.isRequesting){this.isRequesting=!0,this.showSpinner();var a,o=!(this.isRequesting=!1),r=void 0,h=(this.isVirtualizationEnabled&&!this.virtualGroupDataSource&&this.fields.groupBy&&(a=new m.DataManager(this.dataSource).executeLocal((new m.Query).group(this.fields.groupBy)),this.virtualGroupDataSource=a.records),this.isVirtualizationEnabled&&this.virtualGroupDataSource&&!this.isCustomDataUpdated?new m.DataManager(this.virtualGroupDataSource):new m.DataManager(e)),r=this.getQuery(i).executeLocal(h);if(!this.virtualSelectAll){var u=this.getQuery(i);if(this.isVirtualizationEnabled&&0!==r.count&&r.count<2*this.itemCount&&!this.appendUncheckList){if(u){for(var p=0;p<u.queries.length;p++)"onTake"===u.queries[p].fn&&(u.queries[p].e.nos=r.count,r=u.executeLocal(h)),"multiselect"!==this.getModuleName()||"or"!==u.queries[p].e.condition&&"equal"!==u.queries[p].e.operator||this.isCustomFiltering||(o=!1);o&&(r=u.executeLocal(h),this.isVirtualTrackHeight=!(this.dataSource instanceof m.DataManager||this.isCustomDataUpdated))}}else if(this.isVirtualTrackHeight=!1,u)for(p=0;p<u.queries.length;p++)"multiselect"===this.getModuleName()&&(u.queries[p].e&&"or"===u.queries[p].e.condition||u.queries[p].e&&"equal"===u.queries[p].e.operator)&&(o=!1)}!o||this.dataSource instanceof m.DataManager||this.isCustomDataUpdated||this.virtualSelectAll||(this.dataCount=this.totalItemCount=this.virtualSelectAll?r.length:r.count),r=this.isVirtualizationEnabled?r.result:r,this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isCustomFiltering=!1,this.isIncrementalRequest?l=this.renderItems(r,t):(l=this.renderItems(r,t),this.onActionComplete(l,r,s),this.groupTemplate&&this.renderGroupTemplate(l),this.bindChildItems(r,l,t),setTimeout(function(){"multiselect"===n.getModuleName()&&null!=n.itemTemplate&&0<l.childElementCount&&(0<l.children[0].childElementCount||n.fields.groupBy&&l.children[1]&&0<l.children[1].childElementCount)&&n.updateDataList()}))}},s.prototype.handleVirtualKeyboardActions=function(e,t){},s.prototype.updatePopupState=function(){},s.prototype.updatePopupPosition=function(){},s.prototype.virtualSelectionAll=function(e,t,i){},s.prototype.updateRemoteData=function(){this.setListData(this.dataSource,this.fields,this.query)},s.prototype.bindChildItems=function(t,i,s,l){var n=this;100<=t.length&&"autocomplete"===this.getModuleName()?setTimeout(function(){var e=n.remainingItems(n.sortedData,s);P.append(e,i),n.liCollections=n.list.querySelectorAll("."+y.li),n.updateListValues(),n.raiseDataBound(t,l)},0):this.raiseDataBound(t,l)},s.prototype.isObjectInArray=function(i,e){return e.some(function(t){return Object.keys(i).every(function(e){return Object.prototype.hasOwnProperty.call(t,e)&&t[e]===i[e]})})},s.prototype.updateListValues=function(){},s.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var n=[].slice.call(e.querySelectorAll(t)),a=0;a<n.length;a++)if(n[a].getAttribute(i)===s+""){l=n[a];break}return l},s.prototype.raiseDataBound=function(e,t){this.hideSpinner(),this.trigger("dataBound",{items:e,e:t})},s.prototype.remainingItems=function(e,t){var i,e=new m.DataManager(e).executeLocal((new m.Query).skip(100));return this.itemTemplate?(i=this.templateListItem(e,t),[].slice.call(i.childNodes)):"string"===(i=this.typeOfData(e).typeof)||"number"===i||"boolean"===i?H.ListBase.createListItemFromArray(this.createElement,e,!0,this.listOption(e,t),this):H.ListBase.createListItemFromJson(this.createElement,e,this.listOption(e,t),1,!0,this)},s.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.isRequesting=!1,this.hideSpinner()},s.prototype.showSpinner=function(){},s.prototype.hideSpinner=function(){},s.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),P.isNullOrUndefined(this.list)||P.addClass([this.list],y.noData)},s.prototype.onActionComplete=function(e,t,i){var s,l,n,a=this;if(this.listData=t,!this.isVirtualizationEnabled||this.isCustomDataUpdated||this.virtualSelectAll||this.notify("setGeneratedData",{module:"VirtualScroll"}),"listbox"!==this.getModuleName()&&e.setAttribute("tabindex","0"),this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.isVirtualizationEnabled||(this.fixedHeaderElement=P.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement:null),"multiselect"===this.getModuleName()&&this.properties.allowCustomValue&&this.fields.groupBy)for(var o=0;o<e.childElementCount;o++)e.children[o].classList.contains("e-list-group-item")&&(P.isNullOrUndefined(e.children[o].innerHTML)||""===e.children[o].innerHTML)&&P.addClass([e.children[o]],"e-hide-group-header"),e.children[0].classList.contains("e-hide-group-header")&&P.setStyleAttribute(e.children[1],{zIndex:11});if("multiselect"===this.getModuleName()&&this.isAngular&&this.ngEle&&(s=this.list)&&(l=s.offsetHeight+"px",s.style.height=l),!P.isNullOrUndefined(this.list)&&!this.isVirtualizationEnabled){if(this.list.innerHTML="",this.isUpdateGroupTemplate&&this.isAngular&&this.groupTemplate&&"multiselect"===this.getModuleName()){var r=e.querySelectorAll("."+y.group);if(0<r.length&&0<this.groupHeaderItems.length){for(var h={},o=0;o<this.groupHeaderItems.length;o++)h[this.groupHeaderItems[o].id]=this.groupHeaderItems[o].innerHTML;for(o=0;o<r.length;o++)Object.prototype.hasOwnProperty.call(h,r[o].id)&&(r[o].innerHTML=h[r[o].id])}this.renderGroupTemplate(e)}this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,t,this.bindEvent)}"multiselect"===this.getModuleName()&&this.isAngular&&this.ngEle&&(n=this.list)&&setTimeout(function(){n.style.height="",a.refreshPopup()},0)},s.prototype.postRender=function(e,t,i){if(this.fields.disabled)for(var s,l=e.querySelectorAll("."+y.li),n="None"!==this.sortOrder?P.isNullOrUndefined(this.fields.groupBy)?this.sortedData:this.sortedData.filter(function(e){return!("isHeader"in e)||!0!==e.isHeader}):this.listData,a=0;a<l.length;a++)n[a]&&JSON.parse(JSON.stringify(n[a]))[this.fields.disabled]&&(P.isNullOrUndefined(this.fields.groupBy)?this.disableListItem(l[a]):(s=n[a],s=P.getValue(this.fields.value||"value",s),s=e.querySelector('li[data-value="'+s+'"]'),P.isNullOrUndefined(s)||this.disableListItem(s)));var o=this.fields.disabled?e.querySelector("."+y.li+":not(.e-disabled"):e.querySelector("."+y.li),r=e.querySelector("."+y.selected);o&&!r&&(o=this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex&&(r=this.ulElement.querySelectorAll("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&0<r.length?r[2]:o)&&o.classList.add(y.focus),t.length<=0?(this.l10nUpdate(),P.addClass([e],y.noData)):e.classList.remove(y.noData)},s.prototype.getQuery=function(e){return e||this.query||new m.Query},s.prototype.performFiltering=function(e){},s.prototype.debouncedFiltering=function(e,t){var