@syncfusion/ej2-dropdowns
Version:
Essential JS 2 DropDown Components
10 lines • 574 kB
JavaScript
/*!
* filename: ej2-dropdowns.umd.min.js
* version : 29.1.33
* Copyright Syncfusion Inc. 2001 - 2024. 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,c,U,V,o,h,H,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)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])&&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)&&(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 _(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 G=function(){return(G=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 c.DataManager?t=this.parent.dataSource.dataSource.json.length: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?(this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount?((a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),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 c.DataManager&&this.parent.appendUncheckList,s=!1):(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.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,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof c.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)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.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 c.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)),"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 c.DataManager)||this.parent.dataSource instanceof c.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;e=this.parent.list.getElementsByClassName("e-virtual-ddl")[0],e?e.style=this.parent.GetVirtualTrackHeight():!e&&0<this.parent.skeletonCount&&this.parent.popupWrapper&&(s=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(s)),this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item"),e=this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0];e&&(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 c.DataManager&&(!(this.parent.dataSource instanceof c.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 c.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 c.DataManager)||this.parent.dataSource instanceof c.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 c.DataManager&&(!(this.parent.dataSource instanceof c.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=G({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout(function(){s.parent.pageCount=s.parent.getPageCount(),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?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=c.DataUtil.ignoreDiacritics(String(e)),l=c.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 c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,!0);"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof c.DataManager&&!(this.dataSource instanceof c.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"}),o=(this.isVirtualizationEnabled&&this.itemTemplate&&(a.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px"),new V.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"}));o.appendTo(this.createElement("div")),a.appendChild(o.element),i.firstChild&&i.firstChild.insertBefore(a,i.firstChild.children[0])}},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("number"==typeof P.getValue(this.fields.value||"value",t.item)||"number"===t.typeof)return parseFloat(e);if("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=U.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.innerText,o[i.value]=P.isNullOrUndefined(a.getAttribute(i.value))?a.innerText: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(r,h,e,u){var p,d=this,e=(h=h||this.fields,{cancel:!(this.isActive=!0),data:r,query:e});this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",e,function(l){if(!l.cancel)if(d.isRequesting=!0,d.showSpinner(),r instanceof c.DataManager){var n=!(d.isRequested=!0);d.isDataFetched?d.emptyDataRequest(h):l.data.executeQuery(d.getQuery(l.query)).then(function(e){d.isPreventChange=!(!d.isAngular||!d.preventChange)||d.isPreventChange;var t=!0;if(!d.virtualSelectAll){for(var i=d.getQuery(l.query),s=0;s<i.queries.length;s++)"onWhere"===i.queries[s].fn&&(n=!0);if(d.isVirtualizationEnabled&&0!==e.count&&e.count<2*d.itemCount){if(i)for(s=0;s<i.queries.length;s++)"onTake"===i.queries[s].fn&&(i.queries[s].e.nos=e.count),"multiselect"!==d.getModuleName()||"or"!==i.queries[s].e.condition&&"equal"!==i.queries[s].e.operator||d.isCustomFiltering||(t=!1)}else if(d.isVirtualTrackHeight=!1,i)for(s=0;s<i.queries.length;s++)"multiselect"===d.getModuleName()&&(i.queries[s].e&&"or"===i.queries[s].e.condition||i.queries[s].e&&"equal"===i.queries[s].e.operator)&&(t=!1)}t&&(d.dataCount=d.totalItemCount=e.count),d.trigger("actionComplete",e,function(e){var t;e.cancel||(d.isRequesting=!1,d.isCustomFiltering=!1,t=e.result,d.isIncrementalRequest?p=d.renderItems(t,h):((!d.isVirtualizationEnabled&&0===t.length||d.isVirtualizationEnabled&&0===t.length&&!n)&&(d.isDataFetched=!0),n||(d.remoteDataCount=e.count),d.dataCount=d.virtualSelectAll?d.dataCount:e.count,d.totalItemCount=d.virtualSelectAll?d.totalItemCount:e.count,p=d.renderItems(t,h),d.appendUncheckList=!1,d.onActionComplete(p,t,e),d.groupTemplate&&d.renderGroupTemplate(p),d.isRequested=!1,d.bindChildItems(t,p,h,e),d.getInitialData?(d.getInitialData=!1,d.preventPopupOpen=!1):(d.isVirtualizationEnabled&&d.setCurrentView&&d.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),null!=d.keyboardEvent&&d.handleVirtualKeyboardActions(d.keyboardEvent,d.pageCount),d.isVirtualizationEnabled&&(d.getFilteringSkeletonCount(),d.updatePopupPosition()),d.virtualSelectAll&&d.virtualSelectAllData&&(d.virtualSelectionAll(d.virtualSelectAllState,d.liCollections,d.CurrentEvent),d.virtualSelectAllState=!1,d.CurrentEvent=null,d.virtualSelectAll=!1))))})}).catch(function(e){d.isRequested=!1,d.isRequesting=!1,d.onActionFailure(e),d.hideSpinner()})}else{var e=!(d.isRequesting=!1),t=void 0,i=(d.isVirtualizationEnabled&&!d.virtualGroupDataSource&&d.fields.groupBy&&(o=new c.DataManager(d.dataSource).executeLocal((new c.Query).group(d.fields.groupBy)),d.virtualGroupDataSource=o.records),d.isVirtualizationEnabled&&d.virtualGroupDataSource&&!d.isCustomDataUpdated?new c.DataManager(d.virtualGroupDataSource):new c.DataManager(l.data)),t=d.getQuery(l.query).executeLocal(i);if(!d.virtualSelectAll){var s=d.getQuery(l.query);if(d.isVirtualizationEnabled&&0!==t.count&&t.count<2*d.itemCount){if(s){for(var a=0;a<s.queries.length;a++)"onTake"===s.queries[a].fn&&(s.queries[a].e.nos=t.count,t=s.executeLocal(i)),"multiselect"!==d.getModuleName()||"or"!==s.queries[a].e.condition&&"equal"!==s.queries[a].e.operator||d.isCustomFiltering||(e=!1);e&&(t=s.executeLocal(i),d.isVirtualTrackHeight=!(d.dataSource instanceof c.DataManager||d.isCustomDataUpdated))}}else if(d.isVirtualTrackHeight=!1,s)for(a=0;a<s.queries.length;a++)"multiselect"===d.getModuleName()&&(s.queries[a].e&&"or"===s.queries[a].e.condition||s.queries[a].e&&"equal"===s.queries[a].e.operator)&&(e=!1)}!e||d.dataSource instanceof c.DataManager||d.isCustomDataUpdated||d.virtualSelectAll||(d.dataCount=d.totalItemCount=d.virtualSelectAll?t.length:t.count);var o={cancel:!1,result:t=d.isVirtualizationEnabled?t.result:t};d.isPreventChange=!(!d.isAngular||!d.preventChange)||d.isPreventChange,d.trigger("actionComplete",o,function(e){d.isCustomFiltering=!1,d.isIncrementalRequest?p=d.renderItems(e.result,h):e.cancel||(p=d.renderItems(e.result,h),d.onActionComplete(p,e.result,u),d.groupTemplate&&d.renderGroupTemplate(p),d.bindChildItems(e.result,p,h),d.getInitialData?(d.getInitialData=!1,d.preventPopupOpen=!1):setTimeout(function(){"multiselect"===d.getModuleName()&&null!=d.itemTemplate&&0<p.childElementCount&&(0<p.children[0].childElementCount||d.fields.groupBy&&p.children[1]&&0<p.children[1].childElementCount)&&d.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 c.DataManager(e).executeLocal((new c.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?U.ListBase.createListItemFromArray(this.createElement,e,!0,this.listOption(e,t),this):U.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){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 s=0;s<e.childElementCount;s++)e.children[s].classList.contains("e-list-group-item")&&(P.isNullOrUndefined(e.children[s].innerHTML)||""===e.children[s].innerHTML)&&P.addClass([e.children[s]],"e-hide-group-header"),e.children[0].classList.contains("e-hide-group-header")&&P.setStyleAttribute(e.children[1],{zIndex:11});P.isNullOrUndefined(this.list)||this.isVirtualizationEnabled||(this.list.innerHTML="",this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,t,this.bindEvent))},s.prototype.postRender=function(e,t,i){if(this.fields.disabled)for(var s,l=e.querySelectorAll("."+y.li),n=0;n<l.length;n++)JSON.parse(JSON.stringify(this.listData[n]))[this.fields.disabled]&&(P.isNullOrUndefined(this.fields.groupBy)?this.disableListItem(l[n]):(s=this.listData[n],s=P.getValue(this.fields.value||"value",s),s=e.querySelector('li[data-value="'+s+'"]'),P.isNullOrUndefined(s)||this.disableListItem(s)));var a=this.fields.disabled?e.querySelector("."+y.li+":not(.e-disabled"):e.querySelector("."+y.li),o=e.querySelector("."+y.selected);a&&!o&&(a=this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex&&(o=this.ulElement.querySelectorAll("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&0<o.length?o[2]:a)&&a.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 c.Query},s.prototype.updateVirtualizationProperties=function(e,t,i){this.isVirtualizationEnabled=!0,this.virtualizedItemsCount=e,this.isAllowFiltering=t,this.isCheckBoxSelection=i},s.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+y.group)){var t,i=this.dataSource,s={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},e=e.querySelectorAll("."+y.group),l=this.templateCompiler(this.groupTemplate);if(t="function"!=typeof this.groupTemplate&&l?(l=P.select(this.groupTemplate,document).innerHTML.trim(),U.ListBase.renderGroupTemplate(l,i,this.fields.properties,e,s,this)):U.ListBase.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,e,s,this),this.isGroupChecking)for(var n=0;n<t.length;n++)this.notify("addItem",{module:"CheckBoxSelection",item:t[n]});this.renderReactTemplates()}},s.prototype.createListItems=function(e,t){var i;return e?(t.groupBy||this.element.querySelector("optgroup")?(t.groupBy&&("None"!==this.sortOrder&&(e=this.getSortedDataSource(e)),e=this.element.querySelector("optgroup")&&this.isGroupChecking&&"multiselect"===this.getModuleName()?U.ListBase.groupDataSource(e,t,this.sortOrder):U.ListBase.groupDataSource(e,t.properties,this.sortOrder)),P.addClass([this.list],y.grouping)):"listbox"===this.getModuleName()&&("listbox"!==this.getModuleName()||this.preventDefActionFilter)||(e=this.getSortedDataSource(e)),t=this.listOption(e,t),i=100<e.length?new c.DataManager(e).executeLocal((new c.Query).take(100)):e,this.sortedData=e,U.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?i:e,t,!0,this)):null},s.prototype.listOption=function(e,t){var i=!P.isNullOrUndefined(t.iconCss),s=P.isNullOrUndefined(t.properties)?t:t.properties,s=null!==t.text||null!==t.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return P.extend({},s,t,!0)},s.prototype.setFloatingHeader=function(e){P.isNullOrUndefined(this.list)||this.list.classList.contains(y.noData)||(P.isNullOrUndefined(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:y.fixedHead}),P.isNullOrUndefined(this.list)||this.list.querySelector("li").classList.contains(y.group)||(this.fixedHeaderElement.style.display="none"),P.isNullOrUndefined(this.fixedHeaderElement)||P.isNullOrUndefined(this.list)||P.prepend([this.fixedHeaderElement],this.list),this.setFixedHeader()),P.isNullOrUndefined(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e))},s.prototype.scrollStop=function(e,t){for(var i=P.isNullOrUndefined(e)?this.list:e.target,e=getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),s=getComputedStyle(this.getValidLi(),null).getPropertyValue("margin-bottom"),s=parseInt(s,10),e="multiselect"===this.getModuleName()?parseFloat(e):parseInt(e,10),e=Math.round(i.scrollTop/(e+s)),l=this.list.querySelectorAll("li:not(.e-hide-listitem)"),n=this.list.querySelectorAll(".e-virtual-list").length,a=e;-1<a;a--){var o=this.isVirtualizationEnabled?a+n:a;if(this.isVirtualizationEnabled){if(this.fixedHeaderElement&&this.updateGroupHeader(o,l,i))break;!t||!P.isNullOrUndefined(l[o])&&l[o].classList.contains(y.selected)&&"autocomplete"!==this.getModuleName()||!P.isNullOrUndefined(l[o])&&l[o].classList.contains(y.focus)&&this.getModuleName()}else if(this.updateGroupHeader(o,l,i))break}},s.prototype.getPageCount=function(e){var t;return this.list?(t=this.list.classList.contains(y.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height"),t=Math.round(this.list.getBoundingClientRect().height/parseInt(t,10)),e?t:Math.round(t)):0},s.prototype.updateGroupHeader=function(e,t,i){return!P.isNullOrUndefined(t[e])&&t[e].classList.contains(y.group)?(this.updateGroupFixedHeader(t[e],i),!0):(this.fixedHeaderElement.style.display="none",!(this.fixedHeaderElement.style.top="none"))},s.prototype.updateGroupFixedHeader=function(e,t){this.fixedHeaderElement&&(P.isNullOrUndefined(e.innerHTML)||(this.fixedHeaderElement.innerHTML=e.innerHTML),this.fixedHeaderElement.style.position="fixed",this.fixedHeaderElement.style.top=this.list.parentElement.offsetTop+this.list.offsetTop-window.scrollY+"px",this.fixedHeaderElement.style.display="block")},s.prototype.getValidLi=function(){return this.isVirtualizationEnabled&&this.liCollections[0].classList.contains("e-virtual-list")?this.liCollections[this.skeletonCount]:this.liCollections[0]},s.prototype.renderItems=function(e,t,i){if(this.itemTemplate&&e){var s,l,n=e="multiselect"===this.getModuleName()&&this.virtualSelectAll?(this.virtualSelectAllData=e).slice(this.virtualItemStartIndex,this.virtualItemEndIndex):e,a=(n&&t.groupBy?("None"!==this.sortOrder&&(n=this.getSortedDataSource(n)),n=U.ListBase.groupDataSource(n,t.properties,this.sortOrder)):"listbox"===this.getModuleName()&&("listbox"!==this.getModuleName()||this.preventDefActionFilter)||(n=this.getSortedDataSource(n)),100<(this.sortedData=n).length?new c.DataManager(n).executeLocal((new c.Query).take(100)):n),a=this.templateListItem("autocomplete"===this.getModuleName()?a:n,t);if(this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+y.li),this.incrementalUlElement=a,this.incrementalListData=e,a;this.isVirtualizationEnabled&&(s=this.list.querySelector(".e-list-parent"),l=this.list.querySelector(".e-virtual-ddl-content"),e.length>=this.virtualizedItemsCount&&s&&l||s&&l&&this.isAllowFiltering||s&&l&&"autocomplete"===this.getModuleName()?("multiselect"===this.getModuleName()&&this.isCheckBoxSelection&&this.appendUncheckList&&this.list&&this.list.querySelector(".e-active")?(l.appendChild(a),i=!0):l.replaceChild(a,s),n=this.list.querySelectorAll(".e-reorder"),this.list.querySelector(".e-virtual-ddl-content")&&n&&0<n.length&&!i&&this.list.querySelector(".e-virtual-ddl-content").removeChild(n[0]),this.updateListElements(e)):l||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(e)))}else{if("multiselect"===this.getModuleName()&&this.virtualSelectAll&&(e=(this.virtualSelectAllData=e).slice(this.virtualItemStartIndex,this.virtualItemEndIndex)),a=this.createListIte