@syncfusion/ej2-lists 31.1.17 → 31.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ej2-lists.min.js +3 -3
- package/dist/ej2-lists.umd.min.js +3 -3
- package/dist/ej2-lists.umd.min.js.map +1 -1
- package/dist/es6/ej2-lists.es2015.js +3 -1
- package/dist/es6/ej2-lists.es2015.js.map +1 -1
- package/dist/es6/ej2-lists.es5.js +3 -1
- package/dist/es6/ej2-lists.es5.js.map +1 -1
- package/dist/global/ej2-lists.min.js +3 -3
- package/dist/global/ej2-lists.min.js.map +1 -1
- package/dist/global/index.d.ts +2 -2
- package/package.json +12 -56
- package/src/common/list-base.js +3 -1
- package/dist/ts/common/index.d.ts +0 -4
- package/dist/ts/common/index.ts +0 -4
- package/dist/ts/common/list-base.d.ts +0 -415
- package/dist/ts/common/list-base.ts +0 -1362
- package/dist/ts/component.d.ts +0 -4
- package/dist/ts/component.ts +0 -4
- package/dist/ts/index.d.ts +0 -6
- package/dist/ts/index.ts +0 -6
- package/dist/ts/list-view/index.d.ts +0 -6
- package/dist/ts/list-view/index.ts +0 -6
- package/dist/ts/list-view/list-view-model.d.ts +0 -324
- package/dist/ts/list-view/list-view.d.ts +0 -845
- package/dist/ts/list-view/list-view.ts +0 -2740
- package/dist/ts/list-view/virtualization.d.ts +0 -97
- package/dist/ts/list-view/virtualization.ts +0 -947
- package/dist/ts/sortable/index.d.ts +0 -5
- package/dist/ts/sortable/index.ts +0 -5
- package/dist/ts/sortable/sortable-model.d.ts +0 -80
- package/dist/ts/sortable/sortable.d.ts +0 -146
- package/dist/ts/sortable/sortable.ts +0 -483
package/dist/ej2-lists.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-lists.min.js
|
|
3
|
-
* version : 31.
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 -
|
|
3
|
+
* version : 31.2.2
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionButtons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionData","SyncfusionButtons"],t):"object"==typeof exports?exports.SyncfusionLists=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionButtons")):e.SyncfusionLists=t(e.SyncfusionBase,e.SyncfusionData,e.SyncfusionButtons)}(self,(e,t,i)=>(()=>{"use strict";var s={766:t=>{t.exports=e},741:e=>{e.exports=i},74:e=>{e.exports=t}},n={};function l(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return s[e](i,i.exports,l),i.exports}l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{l.r(r),l.d(r,{FieldSettings:()=>g,ListBase:()=>e,ListView:()=>v,Sortable:()=>w,Virtualization:()=>y,classNames:()=>m,cssClass:()=>n,getFieldValues:()=>a,moveTo:()=>x});var e,t=l(766),i=l(74),s=l(741),n={li:"e-list-item",ul:"e-list-parent e-ul",group:"e-list-group-item",icon:"e-list-icon",text:"e-list-text",check:"e-list-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-list-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-list-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"};function a(e,i){var s={};if((0,t.isNullOrUndefined)(e)||"string"==typeof e||"number"==typeof e||!(0,t.isNullOrUndefined)(e.isHeader))return e;for(var n=0,l=Object.keys(i);n<l.length;n++){var r=i[""+l[n]],a=(0,t.isNullOrUndefined)(r)||"string"!=typeof r?void 0:(0,t.getValue)(r,e);(0,t.isNullOrUndefined)(a)||(s[""+r]=a)}return s}function o(e){if(e)try{return"function"!=typeof e&&document.querySelector(e)?(0,t.compile)(document.querySelector(e).innerHTML.trim()):(0,t.compile)(e)}catch(i){return(0,t.compile)(e)}}!function(e){e.defaultMappedFields={id:"id",text:"text",url:"url",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",selected:"selected",iconCss:"iconCss",child:"child",isVisible:"isVisible",hasChildren:"hasChildren",tooltip:"tooltip",htmlAttributes:"htmlAttributes",urlAttributes:"urlAttributes",imageAttributes:"imageAttributes",imageUrl:"imageUrl",groupBy:null,sortBy:null};var s={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},l={showCheckBox:!1,showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:e.defaultMappedFields,ariaAttributes:s,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,headerTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right",itemNavigable:!1};function r(e,t,i,s,n){return L(e,c(e,t,i,s,n),null,s)}function c(e,i,s,r,a){var o=[],c=(0,t.extend)({},l,r);n=S(c.moduleName);for(var h=v(),d=0;d<i.length;d++)if(!(0,t.isNullOrUndefined)(i[d])){var u=void 0;if(c.itemCreating&&"function"==typeof c.itemCreating){var p={dataSource:i,curData:i[d],text:i[d],options:c};c.itemCreating(p)}if(u=s?b(e,i[d],void 0,null,null,[],null,h,d,r):x(e,i[d],void 0,null,null,r,a),c.itemCreated&&"function"==typeof c.itemCreated){p={dataSource:i,curData:i[d],text:i[d],item:u,options:c};c.itemCreated(p)}o.push(u)}return o}function h(i,r,o,c,h,d){var u=(0,t.extend)({},l,o);n=S(u.moduleName);var p,m=!d||"listview"!==d.getModuleName()&&"multiselect"!==d.getModuleName()?(0,t.extend)({},e.defaultMappedFields,u.fields):u.fields,g=(0,t.extend)({},s,u.ariaAttributes),w=[];c&&(g.level=c);var L,C,V=[];r&&r.length&&!(0,t.isNullOrUndefined)(f(r).item)&&!Object.prototype.hasOwnProperty.call(f(r).item,m.id)&&(p=v());for(var E=0;E<r.length;E++){var O=a(r[E],m);if(!(0,t.isNullOrUndefined)(r[E])){if(u.itemCreating&&"function"==typeof u.itemCreating){var k={dataSource:r,curData:r[E],text:O[m.text],options:u,fields:m};u.itemCreating(k)}var D=r[E];u.itemCreating&&"function"==typeof u.itemCreating&&(O=a(r[E],m)),Object.prototype.hasOwnProperty.call(O,m.id)&&!(0,t.isNullOrUndefined)(O[m.id])&&(p=O[m.id]);var H=[];if(u.showCheckBox&&(u.itemNavigable&&(O[m.url]||O[m.urlAttributes])?w.push(i("input",{className:n.check,attrs:{type:"checkbox"}})):H.push(i("input",{className:n.check,attrs:{type:"checkbox"}}))),!0===h){if(u.showIcon&&Object.prototype.hasOwnProperty.call(O,m.iconCss)&&!(0,t.isNullOrUndefined)(O[m.iconCss])&&H.push(i("span",{className:n.icon+" "+O[m.iconCss]})),C=(L=b(i,D,O,m,u.itemClass,H,!(!Object.prototype.hasOwnProperty.call(D,"isHeader")||!D.isHeader),p,E,o)).querySelector("."+n.anchorWrap),Object.prototype.hasOwnProperty.call(O,m.tooltip)){var N=O[m.tooltip];if(o&&o.enableHtmlSanitizer)N=t.SanitizeHtmlHelper.sanitize(N);else N=i("span",{innerHTML:N}).innerText;L.setAttribute("title",N)}u.itemNavigable&&w.length&&(0,t.prepend)(w,L.firstElementChild)}else{if((L=x(i,D,O,m,u.itemClass,o,d)).classList.add(n.level+"-"+g.level),L.setAttribute("aria-level",g.level.toString()),"presentation"!==g.groupItemRole&&"presentation"!==g.itemRole||L.removeAttribute("aria-level"),C=L.querySelector("."+n.anchorWrap),Object.prototype.hasOwnProperty.call(O,m.tooltip)){N=O[m.tooltip];if(o&&o.enableHtmlSanitizer)N=t.SanitizeHtmlHelper.sanitize(N);else N=i("span",{innerHTML:N}).innerText;L.setAttribute("title",N)}if(Object.prototype.hasOwnProperty.call(O,m.htmlAttributes)&&O[m.htmlAttributes]){var T=O[m.htmlAttributes];"class"in T&&"string"==typeof T.class&&""===T.class.trim()&&delete T.class,I(L,T)}if(Object.prototype.hasOwnProperty.call(O,m.enabled)&&!1===O[m.enabled]&&L.classList.add(n.disabled),Object.prototype.hasOwnProperty.call(O,m.isVisible)&&!1===O[m.isVisible]&&(L.style.display="none"),Object.prototype.hasOwnProperty.call(O,m.imageUrl)&&!(0,t.isNullOrUndefined)(O[m.imageUrl])&&!u.template){var U={src:O[m.imageUrl],alt:(0,t.isNullOrUndefined)(O.name)?"Displaying Image":"Displaying "+O.name+" Image"};(0,t.merge)(U,O[m.imageAttributes]);var B=i("img",{className:n.image,attrs:U});C?C.insertAdjacentElement("afterbegin",B):(0,t.prepend)([B],L.firstElementChild)}if(u.showIcon&&Object.prototype.hasOwnProperty.call(O,m.iconCss)&&!(0,t.isNullOrUndefined)(O[m.iconCss])&&!u.template){var A=i("div",{className:n.icon+" "+O[m.iconCss]});C?C.insertAdjacentElement("afterbegin",A):(0,t.prepend)([A],L.firstElementChild)}H.length&&(0,t.prepend)(H,L.firstElementChild),u.itemNavigable&&w.length&&(0,t.prepend)(w,L.firstElementChild),y(i,O,m,r,u,L,g.level)}if(C&&(0,t.addClass)([L],[n.navigable]),u.itemCreated&&"function"==typeof u.itemCreated){k={dataSource:r,curData:r[E],text:O[m.text],item:L,options:u,fields:m};u.itemCreated(k)}w=[],V.push(L)}}return V}function d(e,i,s,n,r,a){var o=(0,t.extend)({},l,s);return L(e,h(e,i,s,n,r,a),o.listClass,s)}function u(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function p(e,t,s){if(void 0===s&&(s=new i.Query),"Ascending"===e)s.sortBy(t,"ascending",!0);else if("Descending"===e)s.sortBy(t,"descending",!0);else for(var n=0;n<s.queries.length;n++)"onSortBy"===s.queries[n].fn&&s.queries.splice(n,1);return s}function m(e,t){return new i.DataManager(e).executeLocal(t)}function f(e){for(var i={typeof:null,item:null},s=0;s<e.length;s++)if(!(0,t.isNullOrUndefined)(e[s]))return{typeof:typeof e[s],item:e[s]};return i}function I(e,i){var s={};(0,t.merge)(s,i),s.class&&((0,t.addClass)([e],s.class.split(" ")),delete s.class),(0,t.attributes)(e,s)}function g(e){for(var t={},i=e.attributes,s=0;s<i.length;s++)t[i[s].nodeName]=i[s].nodeValue;return t}function v(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function y(e,i,s,l,r,a,o){var c=i[s.child]||[],h=i[s.hasChildren];if(c.length&&(h=!0,a.classList.add(n.hasChild),r.processSubChild)){var u=d(e,c,r,++o);a.appendChild(u)}r.expandCollapse&&h&&!r.template&&(a.firstElementChild.classList.add(n.iconWrapper),("Left"===r.expandIconPosition?t.prepend:t.append)([e("div",{className:"e-icons "+r.expandIconClass})],a.querySelector("."+n.textContent)))}function b(e,i,r,a,o,c,h,d,u,p){var m,f,g=(0,t.extend)({},l,p),v=(0,t.extend)({},s,g.ariaAttributes),y=i,b=i;"string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i&&(m=i,y="boolean"==typeof r[a.text]||"number"==typeof r[a.text]?r[a.text]:r[a.text]||"",b=r[a.value]),f=(0,t.isNullOrUndefined)(m)||(0,t.isNullOrUndefined)(r[a.id])||""===r[a.id]?d+"-"+u:d;var S=e("li",{className:(!0===h?n.group:n.li)+" "+((0,t.isNullOrUndefined)(o)?"":o),id:f,attrs:""!==v.groupItemRole&&""!==v.itemRole?{role:!0===h?v.groupItemRole:v.itemRole}:{}});return m&&Object.prototype.hasOwnProperty.call(r,a.enabled)&&"false"===r[a.enabled].toString()&&S.classList.add(n.disabled),p&&p.enableHtmlSanitizer&&(y=t.SanitizeHtmlHelper.sanitize(y)),h?S.innerText=y:(S.setAttribute("data-value",(0,t.isNullOrUndefined)(b)?"null":b),S.setAttribute("role","option"),m&&Object.prototype.hasOwnProperty.call(r,a.htmlAttributes)&&r[a.htmlAttributes]&&I(S,r[a.htmlAttributes]),c.length&&!g.itemNavigable&&(0,t.append)(c,S),m&&(r[a.url]||r[a.urlAttributes]&&r[a.urlAttributes].href)?S.appendChild(w(e,m,a,y,c,g.itemNavigable)):(c.length&&g.itemNavigable&&(0,t.append)(c,S),S.appendChild(document.createTextNode(y)))),S}function S(e){return{li:"e-"+e+"-item",ul:"e-"+e+"-parent e-ul",group:"e-"+e+"-group-item",icon:"e-"+e+"-icon",text:"e-"+e+"-text",check:"e-"+e+"-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-"+e+"-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-"+e+"-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"}}function w(e,i,s,l,r,o){var c,h=a(i,s),d={href:h[s.url]};if(Object.prototype.hasOwnProperty.call(h,s.urlAttributes)&&h[s.urlAttributes]&&((0,t.merge)(d,h[s.urlAttributes]),d.href=h[s.url]?h[s.url]:h[s.urlAttributes].href),o){c=e("a",{className:n.text+" "+n.url});var u=e("div",{className:n.anchorWrap});r&&r.length&&(0,t.append)(r,u),u.appendChild(document.createTextNode(l)),(0,t.append)([u],c)}else c=e("a",{className:n.text+" "+n.url,innerHTML:l});return I(c,d),c}function x(e,i,r,a,c,h,d){var u,p,m,f=(0,t.extend)({},l,h),I=(0,t.extend)({},s,f.ariaAttributes),g=i;"string"!=typeof i&&"number"!=typeof i&&(m=i,g=r[a.text]||"",u=(0,t.isNullOrUndefined)(r._id)?r[a.id]:r._id,p=!(!Object.prototype.hasOwnProperty.call(i,"isHeader")||!i.isHeader)),h&&h.enableHtmlSanitizer&&(g=t.SanitizeHtmlHelper.sanitize(g));var y=e("li",{className:(!0===p?n.group:n.li)+" "+((0,t.isNullOrUndefined)(c)?"":c),attrs:""!==I.groupItemRole&&""!==I.itemRole?{role:!0===p?I.groupItemRole:I.itemRole}:{}});if(!0==!(0,t.isNullOrUndefined)(u)?y.setAttribute("data-uid",u):y.setAttribute("data-uid",v()),p&&h&&h.groupTemplate){var b=o(h.groupTemplate);if(d&&"listview"!==d.getModuleName())(S=b(i,d,"groupTemplate",f.groupTemplateID,!!f.isStringTemplate,null,y))&&(0,t.append)(S,y);else(0,t.append)(b(i,d,"groupTemplate",f.groupTemplateID,!!f.isStringTemplate),y)}else if(!p&&h&&h.template){var S;b=o(h.template);if(d&&"listview"!==d.getModuleName())(S=b(i,d,"template",f.templateID,!!f.isStringTemplate,null,y))&&(0,t.append)(S,y);else(0,t.append)(b(i,d,"template",f.templateID,!!f.isStringTemplate),y)}else{var x=e("div",{className:n.textContent,attrs:""!==I.wrapperRole?{role:I.wrapperRole}:{}});if(m&&(r[a.url]||r[a.urlAttributes]&&r[a.urlAttributes].href))x.appendChild(w(e,m,a,g,null,f.itemNavigable));else{var L=e("span",{className:n.text,attrs:""!==I.itemText?{role:I.itemText}:{}});h&&h.enableHtmlSanitizer?L.innerText=g:L.innerHTML=g,x.appendChild(L)}y.appendChild(x)}return y}function L(e,i,r,a){var o=(0,t.extend)({},l,a),c=(0,t.extend)({},s,o.ariaAttributes),h=e("ul",{className:(n=S(o.moduleName)).ul+" "+((0,t.isNullOrUndefined)(r)?"":r),attrs:""!==c.listRole?{role:c.listRole}:{}});return(0,t.append)(i,h),h}e.createList=function(e,i,n,a,o){var c=(0,t.extend)({},l,n),h=(0,t.extend)({},s,c.ariaAttributes),u=f(i).typeof;return"string"===u||"number"===u?r(e,i,a,n,o):d(e,i,n,h.level,a,o)},e.createListFromArray=r,e.createListItemFromArray=c,e.createListItemFromJson=h,e.createListFromJson=d,e.getSiblingLI=function(e,i,s){if(n=S(l.moduleName),e&&e.length){var r,a,o=Array.prototype.slice.call(e);for(r=o[(a=i?u(i,o):!0===s?o.length:-1)+(!0===s?-1:1)];r&&(!(0,t.isVisible)(r)||r.classList.contains(n.disabled));)r=o[a+=!0===s?-1:1];return r}},e.indexOf=u,e.groupDataSource=function(s,n,l){void 0===l&&(l="None");var r=(0,t.extend)({},e.defaultMappedFields,n),a=(new i.Query).group(r.groupBy),o=m(s,a=p(l,"key",a));s=[];for(var c=0;c<o.length;c++){var h=o[c].items,d={};d[r.text]=o[c].key,d.isHeader=!0;var u=r.text;"id"===u&&(d[""+(u="text")]=o[c].key),d._id="group-list-item-"+(o[c].key?o[c].key.toString().trim():"undefined"),d.items=h,s.push(d);for(var f=0;f<h.length;f++)s.push(h[f])}return s},e.addSorting=p,e.getDataSource=m,e.createJsonFromElement=function i(s,n){var r=(0,t.extend)({},l,n),a=(0,t.extend)({},e.defaultMappedFields,r.fields),o=s.cloneNode(!0),c=[];o.classList.add("json-parent");var h=o.querySelectorAll(".json-parent>li");o.classList.remove("json-parent");for(var d=0;d<h.length;d++){for(var u=h[d],p=u.querySelector("a"),m=u.querySelector("ul"),f={},I=p?p.childNodes:u.childNodes,y=Object.keys(I),b=0;b<I.length;b++)I[Number(y[b])].hasChildNodes()||(f[a.text]=I[Number(y[b])].textContent);var S=g(u);S.id?(f[a.id]=S.id,delete S.id):f[a.id]=v(),Object.keys(S).length&&(f[a.htmlAttributes]=S),p&&(S=g(p),Object.keys(S).length&&(f[a.urlAttributes]=S)),m&&(f[a.child]=i(m,n)),c.push(f)}return c},e.renderContentTemplate=function(i,s,r,c,h,d){for(var u,p=i("ul",{className:(n=S(l.moduleName)).ul,attrs:{role:"presentation"}}),m=(0,t.extend)({},l,h),f=(0,t.extend)({},e.defaultMappedFields,c),I=o(s),g=[],y=v(),b=0;b<r.length;b++){var w=a(r[b],f),x=r[b],L=x.isHeader;if(u="string"==typeof r[b]||"number"==typeof r[b]?x:w[f.value],m.itemCreating&&"function"==typeof m.itemCreating){var C={dataSource:r,curData:x,text:u,options:m,fields:f};m.itemCreating(C)}m.itemCreating&&"function"==typeof m.itemCreating&&(w=a(r[b],f),u="string"==typeof r[b]||"number"==typeof r[b]?x:w[f.value]);var V=i("li",{id:y+"-"+b,className:L?n.group:n.li,attrs:{role:"presentation"}});if(L)"string"==typeof r[b]||"number"==typeof r[b]?V.innerText=x:V.innerText=w[f.text];else{var E,O=L?m.groupTemplateID:m.templateID;if(L)if(d&&"listview"!==d.getModuleName())(E=I(x,d,"headerTemplate",O,!!m.isStringTemplate,null,V))&&(0,t.append)(E,V);else(0,t.append)(I(x,d,"headerTemplate",O,!!m.isStringTemplate),V);else if(d&&"listview"!==d.getModuleName())(E=I(x,d,"template",O,!!m.isStringTemplate,null,V))&&(0,t.append)(E,V);else(0,t.append)(I(x,d,"template",O,!!m.isStringTemplate),V);V.setAttribute("data-value",(0,t.isNullOrUndefined)(u)?"null":u),V.setAttribute("role","option")}if(m.itemCreated&&"function"==typeof m.itemCreated){C={dataSource:r,curData:x,text:u,item:V,options:m,fields:f};m.itemCreated(C)}g.push(V)}return(0,t.append)(g,p),p},e.renderGroupTemplate=function(i,s,n,r,a,c){for(var h=o(i),d=(0,t.extend)({},e.defaultMappedFields,n),u=(0,t.extend)({},l,a),p=d.groupBy,m=0,f=r;m<f.length;m++){var I=f[m],g={};if(g[""+p]=I.textContent,I.innerHTML="",c&&"listview"!==c.getModuleName()){var v=h(g,c,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate,null,I);v&&(0,t.append)(v,I)}else(0,t.append)(h(g,c,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate),I)}return r},e.generateId=v,e.generateUL=L,e.generateIcon=function(e,i,s,r){var a=(0,t.extend)({},l,r);return n=S(a.moduleName),("Left"===a.expandIconPosition?t.prepend:t.append)([e("div",{className:"e-icons "+a.expandIconClass+" "+((0,t.isNullOrUndefined)(s)?"":s)})],i.querySelector("."+n.textContent)),i}}(e||(e={}));var c,h=(c=function(e,t){return c=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])},c(e,t)},function(e,t){function i(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),d=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},u={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},p={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},m={root:"e-listview",hover:"e-hover",selected:"e-active",focused:"e-focused",parentItem:"e-list-parent",listItem:"e-list-item",listIcon:"e-list-icon",textContent:"e-text-content",listItemText:"e-list-text",groupListItem:"e-list-group-item",hasChild:"e-has-child",view:"e-view",header:"e-list-header",headerText:"e-headertext",headerTemplateText:"e-headertemplate-text",text:"e-text",disable:"e-disabled",container:"e-list-container",icon:"e-icons",backIcon:"e-icon-back",backButton:"e-back-button",checkboxWrapper:"e-checkbox-wrapper",checkbox:"e-checkbox",checked:"e-check",checklist:"e-checklist",checkboxIcon:"e-frame",checkboxRight:"e-checkbox-right",checkboxLeft:"e-checkbox-left",listviewCheckbox:"e-listview-checkbox",itemCheckList:"e-checklist",virtualElementContainer:"e-list-virtualcontainer",listTemplate:"e-listview-template"},f="Template",I="GroupTemplate",g=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return h(i,e),d([(0,t.Property)("id")],i.prototype,"id",void 0),d([(0,t.Property)("text")],i.prototype,"text",void 0),d([(0,t.Property)("isChecked")],i.prototype,"isChecked",void 0),d([(0,t.Property)("isVisible")],i.prototype,"isVisible",void 0),d([(0,t.Property)("enabled")],i.prototype,"enabled",void 0),d([(0,t.Property)("iconCss")],i.prototype,"iconCss",void 0),d([(0,t.Property)("child")],i.prototype,"child",void 0),d([(0,t.Property)("tooltip")],i.prototype,"tooltip",void 0),d([(0,t.Property)("groupBy")],i.prototype,"groupBy",void 0),d([(0,t.Property)("text")],i.prototype,"sortBy",void 0),d([(0,t.Property)("htmlAttributes")],i.prototype,"htmlAttributes",void 0),d([(0,t.Property)("tableName")],i.prototype,"tableName",void 0),i}(t.ChildProperty),v=function(n){function l(e,t){var i=n.call(this,e,t)||this;return i.previousSelectedItems=[],i.hiddenItems=[],i.enabledItems=[],i.disabledItems=[],i}return h(l,n),l.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"htmlAttributes":this.setHTMLAttribute();break;case"cssClass":this.setCSSClass(i.cssClass);break;case"enable":this.setEnable();break;case"width":case"height":this.setSize();break;case"enableRtl":this.setEnableRTL();break;case"fields":this.listBaseOption.fields=this.fields.properties,this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1,"header");break;case"query":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"showHeader":this.header(this.headerTitle,!1,"header");break;case"enableVirtualization":(0,t.isNullOrUndefined)(this.contentContainer)||(0,t.detach)(this.contentContainer),this.refresh();break;case"showCheckBox":case"checkBoxPosition":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.setCheckbox();break;case"dataSource":this.previousScrollTop=this.element.scrollTop,this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"sortOrder":case"template":this.enableVirtualization||this.refresh();break;case"showIcon":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():(this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList())}}},l.prototype.setHTMLAttribute=function(){!(0,t.isNullOrUndefined)(this.htmlAttributes)&&Object.keys(this.htmlAttributes).length&&(0,t.attributes)(this.element,this.htmlAttributes)},l.prototype.setCSSClass=function(e){this.cssClass&&(0,t.addClass)([this.element],this.cssClass.split(" ").filter(function(e){return e})),e&&(0,t.removeClass)([this.element],e.split(" ").filter(function(e){return e}))},l.prototype.setSize=function(){this.element.style.height=(0,t.formatUnit)(this.height),this.element.style.width=(0,t.formatUnit)(this.width),this.isWindow=!this.element.clientHeight},l.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},l.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},l.prototype.enableElement=function(e,t){t?e.classList.remove(m.disable):e.classList.add(m.disable)},l.prototype.header=function(e,i,s){if(void 0===this.headerEle&&this.showHeader){this.headerEle=this.createElement("div",{className:m.header});var n=this.createElement("span",{className:m.headerText});this.enableHtmlSanitizer?(this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),n.innerText=this.headerTitle):n.innerHTML=this.headerTitle;var l=this.createElement("div",{className:m.text,innerHTML:n.outerHTML}),r=this.createElement("div",{className:m.icon+" "+m.backIcon+" "+m.backButton,attrs:{style:"display:none;"}});if(this.headerEle.appendChild(r),this.headerEle.appendChild(l),this.headerTemplate){var a=(0,t.compile)(this.headerTemplate),o=this.createElement("div",{className:m.headerTemplateText}),c=a({},this,s,this.LISTVIEW_HEADERTEMPLATE_ID,null,null,this.headerEle);c&&(0,t.append)(c,o),(0,t.append)([o],this.headerEle),this.isReact&&this.renderReactTemplates()}this.headerTemplate&&this.headerTitle&&l.classList.add("header"),this.element.classList.add("e-has-header"),(0,t.prepend)([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";l=this.headerEle.querySelector("."+m.headerText),r=this.headerEle.querySelector("."+m.backIcon);this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(e)),l.innerHTML=e,this.headerTemplate&&i&&(l.parentElement.classList.remove("header"),this.headerEle.querySelector("."+m.headerTemplateText).classList.add("nested-header")),this.headerTemplate&&!i&&(l.parentElement.classList.add("header"),this.headerEle.querySelector("."+m.headerTemplateText).classList.remove("nested-header"),this.headerEle.querySelector("."+m.headerTemplateText).classList.add("header")),r.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},l.prototype.switchView=function(e,i,s){var n=this;if(e&&i){var l=e.style.position,r="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var a=void 0,o=this.animation.duration;if(this.animation.effect)a=this.enableRtl?p[this.animation.effect]:u[this.animation.effect];else{a=u.SlideLeft,s=this.enableRtl,o=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===s?a[0]:a[1],duration:0===o&&"Enable"===t.animationMode?400:o,timingFunction:this.animation.easing,end:function(){e.style.display="none",n.element.style.overflow=r,e.style.position=l,e.classList.remove("e-view")}}),i.style.display="",this.aniObj.animate(i,{name:!0===s?a[2]:a[3],duration:0===o&&"Enable"===t.animationMode?400:o,timingFunction:this.animation.easing,end:function(){n.trigger("actionComplete")}}),this.curUL=i}},l.prototype.preRender=function(){if(this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&this.setProperties({template:document.querySelector(this.template).innerHTML.trim()},!0)}catch(e){(0,t.compile)(this.template)}this.listBaseOption={template:this.template,headerTemplate:this.headerTemplate,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",ariaAttributes:{itemRole:"listitem",listRole:"list",itemText:"",groupItemRole:"presentation",wrapperRole:"presentation"},fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon,itemCreated:this.renderCheckbox.bind(this),templateID:""+this.element.id+f,groupTemplateID:""+this.element.id+I,enableHtmlSanitizer:this.enableHtmlSanitizer},this.initialization()},l.prototype.initialization=function(){this.curDSLevel=[],this.animateOptions={},this.curViewDS=[],this.currentLiElements=[],this.isNestedList=!1,this.selectedData=[],this.selectedId=this.enablePersistence?this.selectedId:[],this.LISTVIEW_TEMPLATE_ID=""+this.element.id+f,this.LISTVIEW_GROUPTEMPLATE_ID=""+this.element.id+I,this.LISTVIEW_HEADERTEMPLATE_ID=this.element.id+"HeaderTemplate",this.aniObj=new t.Animation(this.animateOptions),this.removeElement(this.curUL),this.removeElement(this.ulElement),this.removeElement(this.headerEle),this.removeElement(this.contentContainer),this.curUL=this.ulElement=this.liCollection=this.headerEle=this.contentContainer=void 0},l.prototype.renderCheckbox=function(e){var i=this;if(e.item.classList.contains(m.hasChild)&&(this.isNestedList=!0),this.showCheckBox&&e.item.classList.contains(m.listItem)){var n,l=(0,s.createCheckBox)(this.createElement,!1,{checked:!1,enableRtl:this.enableRtl,cssClass:m.listviewCheckbox});l.setAttribute("role","checkbox");var r=l.querySelector("."+m.checkboxIcon);if(e.item.classList.add(m.itemCheckList),e.item.firstElementChild.classList.add(m.checkbox),this.template&&this.element?(0,t.addClass)([this.element],m.listTemplate):null===this.template&&this.element&&this.element.classList&&this.element.classList.contains("e-listview-template")&&(0,t.removeClass)([this.element],m.listTemplate),"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0])if(n=a(e.curData,this.listBaseOption.fields),this.enablePersistence&&!(0,t.isNullOrUndefined)(this.selectedId))-1!==this.selectedId.findIndex(function(e){return e===n[i.listBaseOption.fields.id].toString()})&&this.checkInternally(e,l);else n[this.listBaseOption.fields.isChecked]&&this.checkInternally(e,l);else"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]||-1===this.selectedData.indexOf(e.text)||this.checkInternally(e,l);l.setAttribute("aria-checked",r.classList.contains(m.checked)?"true":"false"),l.setAttribute("aria-label",e.text),"Left"===this.checkBoxPosition?(l.classList.add(m.checkboxLeft),e.item.firstElementChild.classList.add(m.checkboxLeft),e.item.firstElementChild.insertBefore(l,e.item.firstElementChild.childNodes[0])):(l.classList.add(m.checkboxRight),e.item.firstElementChild.classList.add(m.checkboxRight),e.item.firstElementChild.appendChild(l)),this.currentLiElements.push(e.item),"Left"===this.checkBoxPosition?this.virtualCheckBox=e.item.firstElementChild.children[0]:this.virtualCheckBox=e.item.firstElementChild.lastElementChild}},l.prototype.checkInternally=function(e,t){e.item.classList.add(m.selected),t.querySelector("."+m.checkboxIcon).classList.add(m.checked),t.setAttribute("aria-checked","true")},l.prototype.checkItem=function(e){this.toggleCheckBase(e,!0)},l.prototype.toggleCheckBase=function(e,i){if(this.showCheckBox){var s=e;if(e instanceof Object&&e.constructor!==HTMLLIElement&&(s=this.getLiFromObjOrElement(e)),!(0,t.isNullOrUndefined)(s)){var n=s.querySelector("."+m.checkboxIcon);!0===i?s.classList.add(m.selected):s.classList.remove(m.selected),!0===i?n.classList.add(m.checked):n.classList.remove(m.checked),n.parentElement.setAttribute("aria-checked",i?"true":"false")}this.setSelectedItemData(s),this.updateSelectedId()}},l.prototype.uncheckItem=function(e){this.toggleCheckBase(e,!1)},l.prototype.checkAllItems=function(){this.toggleAllCheckBase(!0)},l.prototype.uncheckAllItems=function(){this.toggleAllCheckBase(!1)},l.prototype.toggleAllCheckBase=function(e){if(this.showCheckBox){for(var t=0;t<this.liCollection.length;t++){var i=this.liCollection[t].querySelector("."+m.checkboxIcon);i&&(e?i.classList.contains(m.checked)||this.checkItem(this.liCollection[t]):i.classList.contains(m.checked)&&this.uncheckItem(this.liCollection[t]))}this.enableVirtualization&&this.virtualizationModule.checkedItem(e),this.updateSelectedId()}},l.prototype.setCheckbox=function(){if(this.showCheckBox)for(var e=Array.prototype.slice.call(this.element.querySelectorAll("."+m.listItem)),t={item:void 0,curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:""},i=0;i<e.length;i++){var s=e[i];t.item=s,t.curData=this.getItemData(s),s.querySelector("."+m.checkboxWrapper)&&this.removeElement(s.querySelector("."+m.checkboxWrapper)),this.renderCheckbox(t),t.item.classList.contains(m.selected)&&this.checkInternally(t,t.item.querySelector("."+m.checkboxWrapper))}else{for(e=Array.prototype.slice.call(this.element.querySelectorAll("."+m.itemCheckList)),i=0;i<e.length;i++){(s=e[i]).classList.remove(m.selected),s.firstElementChild.classList.remove(m.checkbox),this.removeElement(s.querySelector("."+m.checkboxWrapper))}this.selectedItems&&this.selectedItems.item.classList.add(m.selected)}},l.prototype.refreshItemHeight=function(){this.virtualizationModule&&this.virtualizationModule.refreshItemHeight()},l.prototype.handleCheckboxState=function(e,i,s,n,l,r,a,o){this.trigger("select",r,function(c){c.cancel&&((a?n:!n)?(i.classList.add(m.checked),e.classList.add(m.selected)):(i.classList.remove(m.checked),e.classList.remove(m.selected)),s.setAttribute("aria-checked",a?n?"true":"false":n?"false":"true"),(0,t.merge)(r,{isChecked:i.classList.contains(m.checked)}),l&&(e.classList.remove(m.focused),o&&o.classList.remove("e-focused")))})},l.prototype.clickHandler=function(e){if(!Array.isArray(this.dataSource)||0!==this.dataSource.length){var i=e.target;this.targetElement=i;var s,n=i.classList;if(n.contains(m.backIcon)||n.contains(m.headerText))this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();else{var l=(0,t.closest)(i.parentNode,"."+m.listItem);if(null===l&&(l=i),this.removeFocus(),this.enable&&this.showCheckBox&&this.isValidLI(l))if(e.target.classList.contains(m.checkboxIcon)){if(l.classList.add(m.focused),(0,t.isNullOrUndefined)(l.querySelector("."+m.checked))){var r={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:l};this.checkInternally(r,r.item.querySelector("."+m.checkboxWrapper))}else this.uncheckItem(l),l.classList.add(m.focused);if(this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(l,e),e){var a=this.selectEventData(l,e),o=l.querySelector("."+m.checkboxIcon);(0,t.merge)(a,{isChecked:o.classList.contains(m.checked)});var c=l.querySelector("."+m.checkboxWrapper),h=o.classList.contains(m.checked),d=l.classList.contains(m.focused);this.handleCheckboxState(l,o,c,h,d,a,!1)}}else l.classList.contains(m.hasChild)?(this.removeHover(),this.removeSelect(),this.removeSelect(l),this.setSelectLI(l,e),l.classList.remove(m.selected)):(this.setCheckboxLI(l,e),"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName||(i.classList.add("e-focused"),this.targetElement=i));else this.setSelectLI(l,e),"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName||(i.classList.add("e-focused"),this.targetElement=i);s=(0,t.closest)(e.target,"li"),(0,t.isNullOrUndefined)(s)||s.classList.contains("e-has-child")&&!e.target.parentElement.classList.contains("e-listview-checkbox")&&s.classList.add(m.disable)}this.updateSelectedId()}},l.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},l.prototype.hoverHandler=function(e){var i=(0,t.closest)(e.target.parentNode,"."+m.listItem);this.setHoverLI(i)},l.prototype.leaveHandler=function(){this.removeHover()},l.prototype.homeKeyHandler=function(e,t){if(e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL){var i=this.curUL.querySelectorAll("."+m.listItem),s=this.curUL.querySelector("."+m.focused)||this.curUL.querySelector("."+m.selected);s&&(s.classList.remove(m.focused),this.showCheckBox||s.classList.remove(m.selected));var n=t?i.length-1:0;i[n].classList.contains(m.hasChild)||this.showCheckBox?i[n].classList.add(m.focused):this.setSelectLI(i[n],e),i[n]?this.element.setAttribute("aria-activedescendant",i[n].id.toString()):this.element.removeAttribute("aria-activedescendant")}},l.prototype.onArrowKeyDown=function(i,s){var n,l;return!(0,t.isNullOrUndefined)(this.curUL.querySelector("."+m.hasChild))||this.showCheckBox?(l=this.curUL.querySelector("."+m.focused)||this.curUL.querySelector("."+m.selected),n=e.getSiblingLI(this.curUL.querySelectorAll("."+m.listItem),l,s),(0,t.isNullOrUndefined)(n)||(l&&(l.classList.remove(m.focused),this.showCheckBox||l.classList.remove(m.selected)),n.classList.contains(m.hasChild)||this.showCheckBox?n.classList.add(m.focused):this.setSelectLI(n,i))):(l=this.curUL.querySelector("."+m.selected),n=e.getSiblingLI(this.curUL.querySelectorAll("."+m.listItem),l,s),this.setSelectLI(n,i)),n?this.element.setAttribute("aria-activedescendant",n.id.toString()):this.element.removeAttribute("aria-activedescendant"),n},l.prototype.arrowKeyHandler=function(e,t){var i=this;if(e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL){var s=this.onArrowKeyDown(e,t),n=this.element.getBoundingClientRect().top,l=this.element.getBoundingClientRect().height,r=this.curUL.querySelector("."+m.listItem).getBoundingClientRect(),a=void 0,o=void 0;if(this.fields.groupBy&&(o=this.curUL.querySelector("."+m.groupListItem).getBoundingClientRect()),s){var c=s.getBoundingClientRect().top,h=s.getBoundingClientRect().height;if(t)(a=this.isWindow?c:c-n)<0&&(!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop+a);else{var d=this.isWindow?window.innerHeight:l;(a=this.isWindow?c+h:c-n+h)>d&&(!0===this.isWindow?window.scroll(0,pageYOffset+(a-d)):this.element.scrollTop=this.element.scrollTop+(a-d))}}else if(this.enableVirtualization&&t&&this.virtualizationModule.uiFirstIndex)this.onUIScrolled=function(){i.onArrowKeyDown(e,t),i.onUIScrolled=void 0},a=this.virtualizationModule.listItemHeight,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=this.element.scrollTop-a;else if(t)if(this.showHeader&&this.headerEle){var u=o?o.top:r.top,p=this.headerEle.getBoundingClientRect();a=p.top<0?p.height-u:0,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=0}else this.fields.groupBy&&(a=this.isWindow?o.top<0?o.top:0:n-r.top+o.height,!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop-a)}},l.prototype.enterKeyHandler=function(e){if(Object.keys(this.dataSource).length&&this.curUL){var i=!(0,t.isNullOrUndefined)(this.curUL.querySelector("."+m.hasChild)),s=this.curUL.querySelector("."+m.focused);i&&s&&(s.classList.remove(m.focused),this.showCheckBox&&(this.removeSelect(),this.removeSelect(s),this.removeHover()),this.setSelectLI(s,e))}},l.prototype.spaceKeyHandler=function(e){if(this.enable&&this.showCheckBox&&Object.keys(this.dataSource).length&&this.curUL){e.preventDefault();var i=this.curUL.querySelector("."+m.focused),s=void 0,n=void 0;if(!(0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(i.querySelector("."+m.checked))){var l={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:i};s=l.item.querySelector("."+m.checkboxWrapper),this.checkInternally(l,s),n=s.querySelector("."+m.checkboxIcon+"."+m.icon)}else this.uncheckItem(i);var r=this.selectEventData(i,e);if((0,t.merge)(r,{isChecked:!!n&&n.classList.contains(m.checked)}),!(0,t.isNullOrUndefined)(i)){var a=i.querySelector("."+m.checkboxWrapper),o=i.querySelector("."+m.checkboxIcon),c=o.classList.contains(m.checked),h=i.classList.contains(m.focused);this.handleCheckboxState(i,o,a,c,h,r,!1)}this.updateSelectedId()}},l.prototype.keyActionHandler=function(e){switch(e.keyCode){case 36:this.homeKeyHandler(e);break;case 35:this.homeKeyHandler(e,!0);break;case 40:this.arrowKeyHandler(e);break;case 38:this.arrowKeyHandler(e,!0);break;case 13:this.enterKeyHandler(e);break;case 8:this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();break;case 32:!(0,t.isNullOrUndefined)(this.targetElement)&&this.targetElement.classList.contains("e-focused")||this.spaceKeyHandler(e)}},l.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&e.velocity>.5&&"touchend"===e.originalEvent.type&&(this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back())},l.prototype.focusout=function(){if(Object.keys(this.dataSource).length&&this.curUL){var e=this.curUL.querySelector("."+m.focused);e&&(e.classList.remove(m.focused),this.showCheckBox||(0,t.isNullOrUndefined)(this.selectedLI)||this.selectedLI.classList.add(m.selected))}},l.prototype.wireEvents=function(){t.EventHandler.add(this.element,"keydown",this.keyActionHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"mouseout",this.leaveHandler,this),t.EventHandler.add(this.element,"focusout",this.focusout,this),this.touchModule=new t.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)}),(0,t.isNullOrUndefined)(this.scroll)||t.EventHandler.add(this.element,"scroll",this.onListScroll,this)},l.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"keydown",this.keyActionHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),t.EventHandler.remove(this.element,"focusout",this.focusout),(0,t.isNullOrUndefined)(this.scroll)||t.EventHandler.remove(this.element,"scroll",this.onListScroll),this.touchModule&&this.touchModule.destroy(),this.touchModule=null},l.prototype.removeFocus=function(){for(var e=0,t=this.element.querySelectorAll("."+m.focused);e<t.length;e++){t[e].classList.remove(m.focused)}},l.prototype.removeHover=function(){var e=this.element.querySelector("."+m.hover);e&&e.classList.remove(m.hover)},l.prototype.removeSelect=function(e){if((0,t.isNullOrUndefined)(e))for(var i=0,s=this.element.querySelectorAll("."+m.selected);i<s.length;i++){var n=s[i];this.showCheckBox&&n.querySelector("."+m.checked)||n.classList.remove(m.selected)}else e.classList.remove(m.selected)},l.prototype.isValidLI=function(e){return e&&e.classList.contains(m.listItem)&&!e.classList.contains(m.groupListItem)&&!e.classList.contains(m.disable)},l.prototype.setCheckboxLI=function(e,i){if(this.isValidLI(e)&&this.enable&&this.showCheckBox){this.curUL.querySelector("."+m.focused)&&this.curUL.querySelector("."+m.focused).classList.remove(m.focused);var s=e.querySelector("textarea")||e.querySelector("input");e.classList.add(m.focused),(0,t.isNullOrUndefined)(i)||i.target===s&&s.classList.add("e-focused");var n=e.querySelector("."+m.checkboxWrapper),l=n.querySelector("."+m.checkboxIcon+"."+m.icon);this.removeHover();var r=l.classList.contains(m.checked),a=e.classList.contains(m.focused);r?(l.classList.remove(m.checked),e.classList.remove(m.selected)):(l.classList.add(m.checked),e.classList.add(m.selected)),n.setAttribute("aria-checked",l.classList.contains(m.checked)?"true":"false");var o=this.selectEventData(e,i);(0,t.merge)(o,{isChecked:l.classList.contains(m.checked)}),this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(e,i),this.handleCheckboxState(e,l,n,r,a,o,!0,s),this.setSelectedItemData(e),this.renderSubList(e)}},l.prototype.selectEventData=function(e,i){var s,n=this.getItemData(e),l=a(n,this.listBaseOption.fields);s=!(0,t.isNullOrUndefined)(n)&&"string"==typeof this.dataSource[0]||"number"==typeof this.dataSource[0]?{item:e,text:e&&e.innerText.trim(),data:this.dataSource}:{item:e,text:l&&l[this.listBaseOption.fields.text],data:n};var r={};return(0,t.merge)(r,s),i&&(0,t.merge)(r,{isInteracted:!0,event:i,cancel:!1,index:this.curUL&&Array.prototype.indexOf.call(this.curUL.children,e)}),r},l.prototype.setSelectedItemData=function(e){var i=this.getItemData(e),s=a(i,this.listBaseOption.fields);(0,t.isNullOrUndefined)(i)||"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?this.selectedItems={item:e,text:s&&s[this.listBaseOption.fields.text],data:i}:this.selectedItems={item:e,text:e&&e.innerText.trim(),data:this.dataSource}},l.prototype.setSelectLI=function(e,t){var i=this;if(this.isValidLI(e)&&!e.classList.contains(m.selected)&&this.enable){this.showCheckBox||this.removeSelect(),e.classList.add(m.selected),this.removeHover(),this.setSelectedItemData(e),this.enableVirtualization&&this.virtualizationModule.setSelectLI(e,t);var s=this.selectEventData(e,t);this.trigger("select",s,function(t){t.cancel?(e.classList.remove(m.selected),i.selectedLI=e):(i.selectedLI=e,i.renderSubList(e))})}},l.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(m.hover)&&this.enable){var i=this.element.querySelectorAll("."+m.hover);i&&i.length&&(0,t.removeClass)(i,m.hover),e.classList.contains(m.selected)&&!this.showCheckBox||e.classList.add(m.hover)}},l.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var n=s[i],l={};l[this.fields.id]=n,this.curDSJSON=this.findItemFromDS(t,l);var r=a(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?r[this.fields.child]:t}return t}return this.localData},l.prototype.getItemData=function(e){var s,n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource,l=this.getElementUID(e);return s=(0,t.isNullOrUndefined)(this.element.querySelector("."+m.hasChild))&&this.fields.groupBy?this.curViewDS:n,this.findItemFromDS(s,l)},l.prototype.findItemFromDS=function(e,i,s){var n,l=this;return e&&e.length&&i?e.some(function(r){var o=a(r,l.listBaseOption.fields);if(!i[l.fields.id]&&!i[l.fields.text]||i[l.fields.id]&&(!(0,t.isNullOrUndefined)(o[l.fields.id])&&o[l.fields.id].toString())!==i[l.fields.id].toString()||i[l.fields.text]&&o[l.fields.text]!==i[l.fields.text])if("object"!=typeof r&&-1!==e.indexOf(r))n=s?e:r;else if(!(0,t.isNullOrUndefined)(i[l.fields.id])&&(0,t.isNullOrUndefined)(o[l.fields.id])){var c=l.element.querySelector('[data-uid="'+i[l.fields.id]+'"]');c&&c.innerText.trim()===o[l.fields.text]&&(n=r)}else Object.prototype.hasOwnProperty.call(o,l.fields.child)&&o[l.fields.child].length&&(n=l.findItemFromDS(o[l.fields.child],i,s));else n=s?e:r;return!!n}):n=e,n},l.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var n=0,l=Object.keys(this.fields.properties);n<l.length;n++){var r=l[n];"tableName"!==r&&this.fields[""+r]&&this.fields[""+r]!==e.defaultMappedFields[""+r]&&-1===t.indexOf(this.fields[""+r])&&t.push(this.fields[""+r])}s.select(t),Object.prototype.hasOwnProperty.call(this.fields.properties,"tableName")&&s.from(this.fields.tableName)}return s},l.prototype.setViewDataSource=function(i){void 0===i&&(i=this.localData);var s=(0,t.isNullOrUndefined)(this.fields.sortBy)?this.fields.text:this.fields.sortBy,n=e.addSorting(this.sortOrder,s);i&&this.fields.groupBy?"None"!==this.sortOrder?this.curViewDS=e.groupDataSource(e.getDataSource(i,n),this.listBaseOption.fields,this.sortOrder):this.curViewDS=e.groupDataSource(i,this.listBaseOption.fields,this.sortOrder):i&&"None"!==this.sortOrder?this.curViewDS=e.getDataSource(i,n):this.curViewDS=i},l.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},l.prototype.renderRemoteLists=function(e,t){this.isDestroyed||(this.localData=e.result,t.removeElement(t.contentContainer),this.renderList(),this.trigger("actionComplete",e))},l.prototype.triggerActionFailure=function(e){this.isDestroyed||this.trigger("actionFailure",e)},l.prototype.setLocalData=function(){var s=this;if(this.trigger("actionBegin"),this.dataSource instanceof i.DataManager)this.dataSource.ready?this.dataSource.ready.then(function(e){s.isOffline=s.dataSource.dataSource.offline,s.dataSource instanceof i.DataManager&&s.isOffline&&s.renderRemoteLists(e,s)}).catch(function(e){s.triggerActionFailure(e)}):this.dataSource.executeQuery(this.getQuery()).then(function(e){s.renderRemoteLists(e,s)}).catch(function(e){s.triggerActionFailure(e)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var n=this.element.querySelector("ul");n&&((0,t.remove)(n),this.setProperties({dataSource:e.createJsonFromElement(n)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},l.prototype.reRender=function(){this.removeElement(this.headerEle),this.removeElement(this.ulElement),this.removeElement(this.contentContainer),this.isReact&&this.clearTemplate(),-1===Object.keys(window).indexOf("ejsInterop")&&(this.element.innerHTML=""),this.headerEle=this.ulElement=this.liCollection=void 0,this.header(),this.setLocalData()},l.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},l.prototype.setAttributes=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.classList.contains("e-list-item")&&(i.setAttribute("id",this.element.id+"_"+i.getAttribute("data-uid")),i.setAttribute("tabindex","-1"))}},l.prototype.createList=function(){this.currentLiElements=[],this.isNestedList=!1,this.ulElement=this.curUL=e.createList(this.createElement,this.curViewDS,this.listBaseOption,null,this),this.liCollection=this.curUL.querySelectorAll("."+m.listItem),this.setAttributes(this.liCollection)},l.prototype.renderSubList=function(i){this.liElement=i;var s=i.getAttribute("data-uid");if(i.classList.contains(m.hasChild)&&s){var n=(0,t.closest)(i.parentNode,"."+m.parentItem),l=this.element.querySelector("[pid='"+s+"']");if(this.curDSLevel.push(s),this.setViewDataSource(this.getSubDS()),this.enableVirtualization&&this.virtualizationModule.updateDOMItemCount(),!l){var r=this.curViewDS;l=e.createListFromJson(this.createElement,r,this.listBaseOption,this.curDSLevel.length,null,this),this.isReact&&this.renderReactTemplates();var o=l.querySelectorAll("."+m.listItem);this.setAttributes(o),l.setAttribute("pID",s),l.style.display="none",this.renderIntoDom(l)}if(this.switchView(n,l),this.liCollection=this.curUL.querySelectorAll("."+m.listItem),this.selectedItems){var c=a(this.selectedItems.data,this.listBaseOption.fields);this.header(c[this.listBaseOption.fields.text],!0,"header")}this.selectedLI=void 0}},l.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},l.prototype.renderList=function(e){this.setViewDataSource(e),this.enableVirtualization?(Object.keys(this.dataSource).length&&(!this.template&&!this.groupTemplate||this.virtualizationModule.isNgTemplate()||(this.listBaseOption.itemCreated=this.virtualizationModule.createUIItem.bind(this.virtualizationModule))),this.virtualizationModule.uiVirtualization()):(this.createList(),this.contentContainer=this.createElement("div",{className:m.container}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement),this.isReact&&this.renderReactTemplates())},l.prototype.getElementUID=function(e){var t={};return e instanceof Element?t[this.fields.id]=e.getAttribute("data-uid"):t=e,t},l.prototype.render=function(){this.element.classList.add(m.root),(0,t.attributes)(this.element,{tabindex:"0"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.rippleFn=(0,t.rippleEffect)(this.element,{selector:"."+m.listItem}),this.renderComplete(),this.previousScrollTop=this.element.scrollTop},l.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.unWireEvents();var e=[m.root,m.disable,"e-rtl","e-has-header","e-lib"].concat(this.cssClass?this.cssClass.split(" ").filter(function(e){return e}):[]);(0,t.removeClass)([this.element],e),this.element.removeAttribute("role"),this.element.removeAttribute("tabindex"),this.curUL=this.ulElement=this.liCollection=this.headerEle=void 0,this.element.innerHTML="",this.contentContainer=null,this.selectedItems=null,this.selectedLI=null,this.liElement=null,this.targetElement=null,this.currentLiElements=null,this.virtualCheckBox=null,n.prototype.destroy.call(this)},l.prototype.back=function(){var e=this.curDSLevel[this.curDSLevel.length-1];if(void 0!==e&&!this.isInAnimation()){this.curDSLevel.pop(),this.setViewDataSource(this.getSubDS()),this.enableVirtualization&&this.virtualizationModule.updateDOMItemCount();var i=this.element.querySelector("[data-uid='"+e+"']"),s=this.curUL;i?i=i.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),i=this.curUL);var n=a(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(s,i,!0),this.removeFocus();var l=this.element.querySelector("[data-uid='"+e+"']");l.classList.remove(m.disable),l.classList.add(m.focused),this.showCheckBox&&l.querySelector("."+m.checkboxIcon).classList.contains(m.checked)||l.classList.remove(m.selected),this.liCollection=this.curUL.querySelectorAll("."+m.listItem),this.enableHtmlSanitizer&&this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),this.header(this.curDSLevel.length?n:this.headerTitle,!!this.curDSLevel.length,"header")}},l.prototype.selectItem=function(e){this.enableVirtualization?this.virtualizationModule.selectItem(e):this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):!0===(0,t.isNullOrUndefined)(e)?this.removeSelect():this.setSelectLI(this.getLiFromObjOrElement(e))},l.prototype.unselectItem=function(e){if((0,t.isNullOrUndefined)(e))this.removeSelect();else{var i=this.getLiFromObjOrElement(e);(0,t.isNullOrUndefined)(i)||this.removeSelect(i)}},l.prototype.getLiFromObjOrElement=function(e){var s,n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(!(0,t.isNullOrUndefined)(e))if("string"==typeof n[0]||"number"==typeof n[0])if(e instanceof Element){for(var l=e.getAttribute("data-uid").toString(),r=0;r<this.liCollection.length;r++)if(this.liCollection[parseInt(r.toString(),10)].getAttribute("data-uid").toString()===l){s=this.liCollection[parseInt(r.toString(),10)];break}}else Array.prototype.some.call(this.curUL.querySelectorAll("."+m.listItem),function(t){return t.innerText.trim()===e.toString()&&(s=t,!0)});else{var o=this.getItemData(e),c=a(o,this.listBaseOption.fields);if(o&&(s=this.element.querySelector('[data-uid="'+c[this.fields.id]+'"]'),!this.enableVirtualization&&(0,t.isNullOrUndefined)(s))){var h=this.element.querySelectorAll("."+m.listItem);for(r=0;r<h.length;r++)h[parseInt(r.toString(),10)].innerText.trim()===c[this.fields.text]&&(s=h[parseInt(r.toString(),10)])}}return s},l.prototype.selectMultipleItems=function(e){if(!(0,t.isNullOrUndefined)(e))for(var i=0;i<e.length;i++)(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)])||this.selectItem(e[parseInt(i.toString(),10)])},l.prototype.getParentId=function(){var e=[];if(this.isNestedList)for(var t=this.curDSLevel.length-1;t>=0;t--)e.push(this.curDSLevel[parseInt(t.toString(),10)]);return e},l.prototype.updateSelectedId=function(){this.selectedId=[];for(var e=this.curUL.getElementsByClassName(m.selected),i=0;i<e.length;i++){var s=this.getItemData(e[parseInt(i.toString(),10)]);!(0,t.isNullOrUndefined)(s)&&s[this.listBaseOption.fields.id]&&this.selectedId.push(s[this.listBaseOption.fields.id])}},l.prototype.getSelectedItems=function(){var e,s=!1;this.selectedId=[];var n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(this.enableVirtualization&&!s)e=this.virtualizationModule.getSelectedItems(),s=!0;else if(this.showCheckBox&&!s){var l=this.curUL.getElementsByClassName(m.selected),r=[],o=[];this.selectedId=[];for(var c=[],h=0;h<l.length;h++)if("string"==typeof n[0]||"number"==typeof n[0])r.push(l[parseInt(h.toString(),10)].innerText.trim());else{var d=this.getItemData(l[parseInt(h.toString(),10)]),u=a(d,this.listBaseOption.fields);this.isNestedList?c.push({data:d,parentId:this.getParentId()}):o.push(d),u?(r.push(u[this.listBaseOption.fields.text]),this.selectedId.push(u[this.listBaseOption.fields.id])):(r.push(void 0),this.selectedId.push(void 0))}"string"!=typeof n[0]&&"number"!=typeof n[0]||s||(e={item:l,data:n,text:r},s=!0),this.isNestedList&&!s?(e={item:l,data:c,text:r},s=!0):s||(e={item:l,data:o,text:r},s=!0)}else if(!s){var p=this.element.getElementsByClassName(m.selected)[0];u=a(this.getItemData(p),this.listBaseOption.fields);"string"!=typeof n[0]&&"number"!=typeof n[0]||s?s||((0,t.isNullOrUndefined)(u)||(0,t.isNullOrUndefined)(p)?(e=void 0,s=!0):(this.selectedId.push(u[this.listBaseOption.fields.id]),e={text:u[this.listBaseOption.fields.text],item:p,data:this.getItemData(p)},s=!0)):(e=(0,t.isNullOrUndefined)(p)?void 0:{item:p,data:n,text:p.innerText.trim()},s=!0)}return e},l.prototype.findItem=function(e){return this.getItemData(e)},l.prototype.enableItem=function(e){this.setItemState(e,!0),this.enableVirtualization&&this.virtualizationModule.enableItem(e)},l.prototype.disableItem=function(e){this.setItemState(e,!1),this.enableVirtualization&&this.virtualizationModule.disableItem(e)},l.prototype.setItemState=function(e,t){var i=this.getItemData(e),s=a(i,this.listBaseOption.fields);if(i){var n=this.element.querySelector('[data-uid="'+s[this.fields.id]+'"]');t?(n&&n.classList.remove(m.disable),delete i[this.fields.enabled]):t||(n&&n.classList.add(m.disable),i[this.fields.enabled]=!1)}},l.prototype.showItem=function(e){this.showHideItem(e,!1,""),this.enableVirtualization&&this.virtualizationModule.showItem(e)},l.prototype.hideItem=function(e){this.showHideItem(e,!0,"none"),this.enableVirtualization&&this.virtualizationModule.hideItem(e)},l.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e),n=a(s,this.listBaseOption.fields);if(s){var l=this.element.querySelector('[data-uid="'+n[this.fields.id]+'"]');l&&(l.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},l.prototype.addItem=function(e,t,s){void 0===t&&(t=void 0);var n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.addItemInternally(e,t,n,s)},l.prototype.addItemInternally=function(e,t,i,s){if(e instanceof Array)if(this.enableVirtualization)this.virtualizationModule.addItem(e,t,i,s);else{var n=this.findItemFromDS(i,t),l=void 0;if(n)(l=a(n,this.listBaseOption.fields)[this.fields.child])||(l=[]),l=l.concat(e);if(n instanceof Array){for(var r=0;r<e.length;r++){i=this.addItemAtIndex(s,i,e[parseInt(r.toString(),10)]),this.setViewDataSource(i);var o=this.contentContainer?this.contentContainer.children[0]:null;this.contentContainer&&o?this.addItemIntoDom(e[parseInt(r.toString(),10)],o,this.curViewDS):this.reRender()}this.liCollection=this.curUL.querySelectorAll("."+m.listItem)}else n&&(n[this.fields.child]=l,this.addItemInNestedList(n,e))}},l.prototype.addItemAtIndex=function(e,i,s){return!(0,t.isNullOrUndefined)(e)&&e>=0&&e<i.length&&(0,t.isNullOrUndefined)(this.listBaseOption.fields.groupBy)?i.splice(e,0,s):i.push(s),i},l.prototype.addItemInNestedList=function(i,s){var n=i[this.fields.id],l=i[this.fields.child],r=this.element.querySelector("[pid='"+n+"']"),a=this.element.querySelector("[data-uid='"+n+"']"),o=r||(a?(0,t.closest)(a,"ul"):null),c=r?l:[i];if(!!a&&!a.classList.contains(m.hasChild)){var h=e.createListItemFromJson(this.createElement,c,this.listBaseOption,null,null,this);this.setAttributes(h),o.insertBefore(h[0],a),(0,t.detach)(a)}if(r&&s)for(var d=0;d<s.length;d++)c.push(s[parseInt(d.toString(),10)]),this.addItemIntoDom(s[parseInt(d.toString(),10)],o,c)},l.prototype.addItemIntoDom=function(e,t,i){var s=i.indexOf(e);this.addListItem(e,s,t,i);var n=i[s-1];n&&n.isHeader&&1===n.items.length&&this.addListItem(n,s-1,t,i)},l.prototype.addListItem=function(t,i,s,n){var l=this.getLiFromObjOrElement(n[i+1])||this.getLiFromObjOrElement(n[i+2])||null,r=e.createListItemFromJson(this.createElement,[t],this.listBaseOption,null,null,this);if(this.setAttributes(r),this.template&&this.isReact&&this.renderReactTemplates(),this.fields.groupBy&&n[i+1]&&n[i+1].isHeader){var a=this.getLiFromObjOrElement(n[i-1]);a&&(l=a.nextElementSibling)}s.insertBefore(r[0],l)},l.prototype.removeItem=function(e){var t=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.enableVirtualization?this.virtualizationModule.removeItem(e):this.removeItemFromList(e,t)},l.prototype.removeItemFromList=function(i,s){var n=this,l=this.curViewDS,r=i instanceof Element?this.getElementUID(i):i,a=this.findItemFromDS(s,r,!0);if(a){var o=this.findItemFromDS(a,r),c=l.indexOf(o),h=this.getLiFromObjOrElement(i),d=void 0;this.validateNestedView(h),this.fields.groupBy&&this.curViewDS[c-1]&&l[c-1].isHeader&&1===l[c-1].items.length&&h&&h.previousElementSibling.classList.contains(m.groupListItem)&&((0,t.isNullOrUndefined)(h.nextElementSibling)||h.nextElementSibling&&h.nextElementSibling.classList.contains(m.groupListItem))&&(d=h.previousElementSibling),h&&(0,t.detach)(h),d&&(0,t.detach)(d);var u=a.length-1<=0?this.findParent(this.localData,this.fields.id,function(e){return e===o[n.fields.id]},null):null,p=a.indexOf(o);if(a.splice(p,1),this.setViewDataSource(s),u&&u.parent&&Array.isArray(u.parent[this.fields.child])&&u.parent[this.fields.child].length<=0){var f=this.getLiFromObjOrElement(u.parent);if(f){var I=e.createListItemFromJson(this.createElement,[u.parent],this.listBaseOption,null,null,this);this.setAttributes(I),f.parentElement.insertBefore(I[0],f),f.parentElement.removeChild(f)}}a.length<=0&&this.back(),this.liCollection=Array.prototype.slice.call(this.element.querySelectorAll("."+m.listItem))}},l.prototype.validateNestedView=function(e){var t=e?e.getAttribute("data-uid").toString().toLowerCase():null;if(t&&this.curDSLevel&&this.curDSLevel.length>0)for(;this.curDSLevel.some(function(e){return e.toString().toLowerCase()===t});)this.back()},l.prototype.removeMultipleItems=function(e){if(e.length)for(var t=0;t<e.length;t++)this.removeItem(e[parseInt(t.toString(),10)])},l.prototype.findParent=function(e,i,s,n){if(Object.prototype.hasOwnProperty.call(e,i)&&!0===s(e[i]))return(0,t.extend)({},e);for(var l=0;l<Object.keys(e).length;l++)if(e[Object.keys(e)[parseInt(l.toString(),10)]]&&"object"==typeof e[Object.keys(e)[parseInt(l.toString(),10)]]){var r=this.findParent(e[Object.keys(e)[parseInt(l.toString(),10)]],i,s,e);if(null!=r)return r.parent||(r.parent=n),r}return null},l.prototype.getModuleName=function(){return"listview"},l.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"virtualization",name:"Virtualization"}),e},l.prototype.onListScroll=function(e){var t={originalEvent:e,scrollDirection:"Bottom",distanceY:this.element.scrollHeight-this.element.scrollTop},i=this.element.scrollTop;i>this.previousScrollTop?(t.scrollDirection="Bottom",t.distanceY=this.element.scrollHeight-this.element.clientHeight-this.element.scrollTop,this.trigger("scroll",t)):this.previousScrollTop>i&&(t.scrollDirection="Top",t.distanceY=this.element.scrollTop,this.trigger("scroll",t)),this.previousScrollTop=i},l.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition","selectedId"])},d([(0,t.Property)("")],l.prototype,"cssClass",void 0),d([(0,t.Property)(!1)],l.prototype,"enableVirtualization",void 0),d([(0,t.Property)({})],l.prototype,"htmlAttributes",void 0),d([(0,t.Property)(!0)],l.prototype,"enable",void 0),d([(0,t.Property)([])],l.prototype,"dataSource",void 0),d([(0,t.Property)()],l.prototype,"query",void 0),d([(0,t.Complex)(e.defaultMappedFields,g)],l.prototype,"fields",void 0),d([(0,t.Property)({effect:"SlideLeft",duration:400,easing:"ease"})],l.prototype,"animation",void 0),d([(0,t.Property)("None")],l.prototype,"sortOrder",void 0),d([(0,t.Property)(!1)],l.prototype,"showIcon",void 0),d([(0,t.Property)(!1)],l.prototype,"showCheckBox",void 0),d([(0,t.Property)("Left")],l.prototype,"checkBoxPosition",void 0),d([(0,t.Property)("")],l.prototype,"headerTitle",void 0),d([(0,t.Property)(!1)],l.prototype,"showHeader",void 0),d([(0,t.Property)(!0)],l.prototype,"enableHtmlSanitizer",void 0),d([(0,t.Property)("")],l.prototype,"height",void 0),d([(0,t.Property)("")],l.prototype,"width",void 0),d([(0,t.Property)(null)],l.prototype,"template",void 0),d([(0,t.Property)(null)],l.prototype,"headerTemplate",void 0),d([(0,t.Property)(null)],l.prototype,"groupTemplate",void 0),d([(0,t.Event)()],l.prototype,"select",void 0),d([(0,t.Event)()],l.prototype,"actionBegin",void 0),d([(0,t.Event)()],l.prototype,"actionComplete",void 0),d([(0,t.Event)()],l.prototype,"actionFailure",void 0),d([(0,t.Event)()],l.prototype,"scroll",void 0),l=d([t.NotifyPropertyChanges],l)}(t.Component),y=function(){function s(e){this.elementDifference=0,this.listViewInstance=e}return s.prototype.isNgTemplate=function(){return!(0,t.isNullOrUndefined)(this.listViewInstance.templateRef)&&"string"!=typeof this.listViewInstance.templateRef},s.prototype.isVueFunctionTemplate=function(){return this.listViewInstance.isVue&&"function"==typeof this.listViewInstance.template},s.prototype.uiVirtualization=function(){this.wireScrollEvent(!1);var i=this.listViewInstance.curViewDS,s=this.listViewInstance.isRendered,n=s&&!(0,t.isNullOrUndefined)(this.uiFirstIndex)&&this.uiLastIndex<=Object.keys(i).length?this.uiFirstIndex:0,l=i.slice(n,n+1);this.listViewInstance.ulElement=this.listViewInstance.curUL=e.createList(this.listViewInstance.createElement,l,this.listViewInstance.listBaseOption,null,this.listViewInstance),this.listViewInstance.contentContainer=this.listViewInstance.createElement("div",{className:m.container}),this.listViewInstance.element.appendChild(this.listViewInstance.contentContainer),this.listViewInstance.contentContainer.appendChild(this.listViewInstance.ulElement),this.listItemHeight=this.listViewInstance.ulElement.firstElementChild.getBoundingClientRect().height,this.expectedDomItemCount=this.ValidateItemCount(1e4),this.updateDOMItemCount();var r=s&&!(0,t.isNullOrUndefined)(this.uiLastIndex)&&0!==this.listDiff?this.uiLastIndex:this.domItemCount-1;this.uiFirstIndex=n,this.uiLastIndex=r;var a=i.slice(n+1,r+1),o=e.createListItemFromJson(this.listViewInstance.createElement,a,this.listViewInstance.listBaseOption,null,null,this.listViewInstance);(0,t.append)(o,this.listViewInstance.ulElement),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li"),this.topElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.topElement,this.listViewInstance.ulElement.firstElementChild),this.bottomElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.bottomElement,null),this.totalHeight=Object.keys(i).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.topElement.style.height=s?this.topElementHeight+"px":"0px",this.bottomElement.style.height=s?this.totalHeight-this.topElementHeight+"px":this.totalHeight+"px",this.topElementHeight=s?this.topElementHeight:0,this.bottomElementHeight=s?this.totalHeight-this.topElementHeight:this.totalHeight,this.listDiff=s&&Object.keys(i).length!==this.domItemCount?this.listDiff:0,s&&(this.listViewInstance.element.scrollTop=this.listViewInstance.previousScrollTop),this.uiIndicesInitialization()},s.prototype.wireScrollEvent=function(e){e?!0===this.listViewInstance.isWindow?(window.removeEventListener("scroll",this.onVirtualScroll),window.removeEventListener("scroll",this.updateUl)):t.EventHandler.remove(this.listViewInstance.element,"scroll",this.onVirtualUiScroll):this.listViewInstance.isWindow?(this.onVirtualScroll=this.onVirtualUiScroll.bind(this),window.addEventListener("scroll",this.onVirtualScroll)):t.EventHandler.add(this.listViewInstance.element,"scroll",this.onVirtualUiScroll,this)},s.prototype.ValidateItemCount=function(e){var i,s=parseFloat((0,t.formatUnit)(this.listViewInstance.height));return(i=this.listViewInstance.isWindow?Math.round(window.innerHeight/this.listItemHeight*3):"string"==typeof this.listViewInstance.height&&-1!==this.listViewInstance.height.indexOf("%")?Math.round(this.listViewInstance.element.getBoundingClientRect().height/this.listItemHeight*1.5):Math.round(s/this.listItemHeight*1.5))>e&&(i=e),i},s.prototype.updateDOMItemCount=function(){this.domItemCount=this.ValidateItemCount(Object.keys(this.listViewInstance.curViewDS).length)},s.prototype.uiIndicesInitialization=function(){this.uiIndices={activeIndices:[],disabledItemIndices:[],hiddenItemIndices:[]};for(var e=this.listViewInstance.curViewDS,i=0;i<e.length;i++)this.listViewInstance.showCheckBox&&e[i][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(i),(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][this.listViewInstance.fields.enabled])||e[i][this.listViewInstance.fields.enabled]||this.uiIndices.disabledItemIndices.push(i);if(this.isNgTemplate())for(var s=this.listViewInstance.element.querySelectorAll("."+m.listItem),n=0;n<s.length;n++)s[n].context=this.listViewInstance.viewContainerRef.get(n).context},s.prototype.refreshItemHeight=function(){if(this.listViewInstance.curViewDS.length){var e=this.listViewInstance.curViewDS;this.listItemHeight=this.topElement.nextSibling.getBoundingClientRect().height,this.totalHeight=Object.keys(e).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.bottomElementHeight=this.totalHeight,this.bottomElement.style.height=this.totalHeight+"px"}},s.prototype.getscrollerHeight=function(e){return this.listViewInstance.isWindow?pageYOffset-e<=0?0:pageYOffset-e:this.listViewInstance.element.scrollTop-e<=0?0:this.listViewInstance.element.scrollTop-e},s.prototype.onVirtualUiScroll=function(){var e,i,s=this.listViewInstance.curViewDS;this.listItemHeight=(0,t.select)(".e-list-item",this.listViewInstance.element).getBoundingClientRect().height,this.totalHeight=Object.keys(s).length*this.listItemHeight-this.domItemCount*this.listItemHeight,i=this.listViewInstance.isWindow?this.listViewInstance.ulElement.getBoundingClientRect().top-document.documentElement.getBoundingClientRect().top:this.listViewInstance.headerEle?this.listViewInstance.headerEle.getBoundingClientRect().height:0,this.scrollPosition=(0,t.isNullOrUndefined)(this.scrollPosition)?0:this.scrollPosition;var n,l=this.getscrollerHeight(i);(this.topElementHeight=this.listItemHeight*Math.floor(l/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,e=l<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=e[0],this.bottomElementHeight=e[1],this.topElementHeight!==parseFloat(this.topElement.style.height))&&(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",l>this.scrollPosition?(n=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff))>this.expectedDomItemCount+5?this.onLongScroll(n,!0):this.onNormalScroll(n,!0):(n=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight))>this.expectedDomItemCount+5?this.onLongScroll(n,!1):this.onNormalScroll(n,!1));this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),"function"==typeof this.listViewInstance.onUIScrolled&&this.listViewInstance.onUIScrolled(),this.scrollPosition=l},s.prototype.onLongScroll=function(e,t){for(var i=t?this.uiFirstIndex+e:this.uiFirstIndex-e,s=this.listViewInstance.ulElement.querySelectorAll("li"),n=0;n<s.length;n++)this.updateUI(s[n],i),i++;this.uiLastIndex=t?this.uiLastIndex+e:this.uiLastIndex-e,this.uiFirstIndex=t?this.uiFirstIndex+e:this.uiFirstIndex-e},s.prototype.onNormalScroll=function(e,t){if(t)for(var i=0;i<e;i++){var s=++this.uiLastIndex;this.updateUI(this.topElement.nextElementSibling,s,this.bottomElement),this.uiFirstIndex++}else for(i=0;i<e;i++){s=--this.uiFirstIndex;var n=this.topElement.nextSibling;this.updateUI(this.bottomElement.previousElementSibling,s,n),this.uiLastIndex--}},s.prototype.updateUiContent=function(i,s){var n=this.listViewInstance.curViewDS;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]?(i.dataset.uid=e.generateId(),i.getElementsByClassName(m.listItemText)[0].innerHTML=this.listViewInstance.curViewDS[s].toString()):(i.dataset.uid=n[parseInt(s.toString(),10)][this.listViewInstance.fields.id]?n[parseInt(s.toString(),10)][this.listViewInstance.fields.id]:e.generateId(),i.getElementsByClassName(m.listItemText)[0].innerHTML=n[parseInt(s.toString(),10)][this.listViewInstance.fields.text]),this.listViewInstance.showIcon&&(i.querySelector("."+m.listIcon)&&(0,t.detach)(i.querySelector("."+m.listIcon)),this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss])){var l=i.querySelector("."+m.textContent),r=this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss].toString(),a=this.listViewInstance.createElement("div",{className:m.listIcon+" "+r});l.insertBefore(a,i.querySelector("."+m.listItemText))}if(this.listViewInstance.showCheckBox&&this.listViewInstance.fields.groupBy){this.checkListWrapper||(this.checkListWrapper=this.listViewInstance.curUL.querySelector("."+m.checkboxWrapper).cloneNode(!0));l=i.querySelector("."+m.textContent);this.listViewInstance.curViewDS[s].isHeader?i.querySelector("."+m.checkboxWrapper)&&(i.classList.remove(m.checklist),l.classList.remove(m.checkbox),(0,t.detach)(i.querySelector("."+m.checkboxWrapper))):i.querySelector("."+m.checkboxWrapper)||(i.classList.add(m.checklist),l.classList.add(m.checkbox),"Left"===this.listViewInstance.checkBoxPosition?l.classList.add("e-checkbox-left"):l.classList.add("e-checkbox-right"),l.append(this.checkListWrapper.cloneNode(!0)))}},s.prototype.changeElementAttributes=function(e,i){if(e.classList.remove(m.disable),this.uiIndices.disabledItemIndices.length&&-1!==this.uiIndices.disabledItemIndices.indexOf(i)&&e.classList.add(m.disable),e.style.display="",this.uiIndices.hiddenItemIndices.length&&-1!==this.uiIndices.hiddenItemIndices.indexOf(i)&&(e.style.display="none"),this.listViewInstance.showCheckBox){var s=e.querySelector("."+m.checkboxWrapper);e.classList.remove(m.selected),e.classList.remove(m.focused),s&&(s.removeAttribute("aria-checked"),s.firstElementChild.classList.remove(m.checked)),this.uiIndices.activeIndices.length&&-1!==this.uiIndices.activeIndices.indexOf(i)&&!this.listViewInstance.curUL.querySelector(m.selected)&&(e.classList.add(m.selected),s.firstElementChild.classList.add(m.checked),s.setAttribute("aria-checked","true"),this.activeIndex===i&&e.classList.add(m.focused))}else e.classList.remove(m.selected),e.removeAttribute("aria-selected"),(0,t.isNullOrUndefined)(this.activeIndex)||this.activeIndex!==i||this.listViewInstance.curUL.querySelector(m.selected)||(e.classList.add(m.selected),e.setAttribute("aria-selected","true"));this.listViewInstance.fields.groupBy&&(this.listViewInstance.curViewDS[i].isHeader?e.classList.contains(m.listItem)&&(e.classList.remove(m.listItem),e.setAttribute("role","group"),e.classList.add(m.groupListItem)):e.classList.contains(m.groupListItem)&&(e.classList.remove(m.groupListItem),e.setAttribute("role","listitem"),e.classList.add(m.listItem)))},s.prototype.findDSAndIndexFromId=function(e,i){var s=this,n={};return i=this.listViewInstance.getElementUID(i),(0,t.isNullOrUndefined)(i)||e.some(function(e,t){return!!(i[s.listViewInstance.fields.id]&&i[s.listViewInstance.fields.id]===(e[s.listViewInstance.fields.id]&&e[s.listViewInstance.fields.id])||i===e)&&(n.index=t,n.data=e,!0)}),n},s.prototype.getSelectedItems=function(){var e=this;if(!(0,t.isNullOrUndefined)(this.activeIndex)||this.listViewInstance.showCheckBox&&this.uiIndices.activeIndices.length){var s=[],n=[];if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]){var l=this.listViewInstance.curViewDS;if(this.listViewInstance.showCheckBox){for(var r=this.uiIndices.activeIndices,a=0;a<r.length;a++)s.push(l[r[a]]);return{text:s,data:s,index:this.uiIndices.activeIndices.map(function(t){return e.listViewInstance.dataSource.indexOf(l[t])})}}return{text:l[this.activeIndex],data:l[this.activeIndex],index:this.listViewInstance.dataSource.indexOf(l[this.activeIndex])}}var o=this.listViewInstance.curViewDS,c=this.listViewInstance.fields.text;if(this.listViewInstance.showCheckBox){var h=this.uiIndices.activeIndices;for(a=0;a<h.length;a++)n.push(o[h[a]][""+c]),s.push(o[h[parseInt(a.toString(),10)]]);var d=this.listViewInstance.dataSource instanceof i.DataManager?o:this.listViewInstance.dataSource;return{text:n,data:s,index:this.uiIndices.activeIndices.map(function(e){return d.indexOf(o[e])})}}var u=this.listViewInstance.dataSource instanceof i.DataManager?o:this.listViewInstance.dataSource;return{text:o[this.activeIndex][this.listViewInstance.fields.text],data:o[this.activeIndex],index:u.indexOf(o[this.activeIndex])}}},s.prototype.selectItem=function(e){var i=this,s=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(Object.keys(s).length){var n,l=this.activeIndex===s.index;if(this.activeIndex=s.index,this.listViewInstance.showCheckBox&&(-1===this.uiIndices.activeIndices.indexOf(s.index)?(n=!0,this.uiIndices.activeIndices.push(s.index)):(n=!1,this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(s.index),1)),this.listViewInstance.curUL.querySelector("."+m.focused)&&this.listViewInstance.curUL.querySelector("."+m.focused).classList.remove(m.focused)),this.listViewInstance.getLiFromObjOrElement(e))this.listViewInstance.showCheckBox?this.listViewInstance.setCheckboxLI(this.listViewInstance.getLiFromObjOrElement(e)):this.listViewInstance.setSelectLI(this.listViewInstance.getLiFromObjOrElement(e));else{var r;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0])r={text:this.listViewInstance.curViewDS[this.activeIndex],data:this.listViewInstance.curViewDS[this.activeIndex],index:this.activeIndex};else{var a=this.listViewInstance.curViewDS;r={text:a[this.activeIndex][this.listViewInstance.fields.text],data:a[this.activeIndex],index:this.activeIndex}}this.listViewInstance.showCheckBox?this.listViewInstance.trigger("select",r,function(e){e.cancel&&(n?(r.isChecked=!n,i.uiIndices.activeIndices.splice(i.uiIndices.activeIndices.indexOf(s.index),1)):(r.isChecked=n,i.uiIndices.activeIndices.push(s.index)))}):l||(this.listViewInstance.removeSelect(),this.listViewInstance.trigger("select",r,function(e){e.cancel&&(i.activeIndex=void 0)}))}}else(0,t.isNullOrUndefined)(e)&&!this.listViewInstance.showCheckBox&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0)},s.prototype.enableItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(t.index),1)},s.prototype.disableItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&-1===this.uiIndices.disabledItemIndices.indexOf(t.index)&&this.uiIndices.disabledItemIndices.push(t.index)},s.prototype.showItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(t.index),1)},s.prototype.hideItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&-1===this.uiIndices.hiddenItemIndices.indexOf(t.index)&&this.uiIndices.hiddenItemIndices.push(t.index)},s.prototype.removeItem=function(e){var t,s=this.listViewInstance.curViewDS,n=this.findDSAndIndexFromId(s,e);Object.keys(n).length&&(t=n.data,s[n.index-1]&&s[n.index-1].isHeader&&1===s[n.index-1].items.length?(this.removeUiItem(n.index-1),this.removeUiItem(n.index-1)):this.removeUiItem(n.index));var l=this.listViewInstance.dataSource instanceof i.DataManager?this.listViewInstance.localData:this.listViewInstance.dataSource,r=l.indexOf(t);-1!==r&&(l.splice(r,1),this.listViewInstance.setViewDataSource(l)),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")},s.prototype.setCheckboxLI=function(e,t){var i=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex;this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex,e.classList.contains(m.selected)?-1===this.uiIndices.activeIndices.indexOf(i)&&this.uiIndices.activeIndices.push(i):this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(i),1)},s.prototype.setSelectLI=function(e,t){this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex},s.prototype.checkedItem=function(e){if(e){this.uiIndices.activeIndices=[],this.activeIndex=void 0;for(var t=this.listViewInstance.curViewDS,i=0;i<t.length;i++)t[i].isHeader||this.uiIndices.activeIndices.push(i)}else this.activeIndex=void 0,this.uiIndices.activeIndices=[]},s.prototype.addUiItem=function(e){var t=this.listViewInstance.curViewDS;if(this.changeUiIndices(e,!0),this.activeIndex&&this.activeIndex>=e&&this.activeIndex++,this.listViewInstance.showCheckBox&&t[e][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(e),parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)||(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px"),parseFloat(this.bottomElement.style.height)){var i=this.listViewInstance.curUL.lastElementChild.previousSibling;(s=this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]))&&(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px",this.updateUI(i,e,s))}else{i=this.listViewInstance.curUL.firstElementChild.nextSibling;var s=void 0;s=Object.keys(this.listViewInstance.curViewDS).length-1===e?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]),this.topElement.style.height=parseFloat(this.topElement.style.height)+this.listItemHeight+"px",this.uiFirstIndex++,this.uiLastIndex++,s&&(this.updateUI(i,e,s),!0===this.listViewInstance.isWindow?window.scrollTo(0,pageYOffset+this.listItemHeight):this.listViewInstance.element.scrollTop+=this.listItemHeight)}this.totalHeight+=this.listItemHeight,this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.removeUiItem=function(e){this.totalHeight-=this.listItemHeight;var i=this.listViewInstance.curViewDS[e],s=this.listViewInstance.getLiFromObjOrElement(i);if(this.listViewInstance.curViewDS.splice(e,1),this.activeIndex&&this.activeIndex>=e&&this.activeIndex--,s)if(this.domItemCount>Object.keys(this.listViewInstance.curViewDS).length)(0,t.detach)(s),this.domItemCount--,this.uiLastIndex--,this.totalHeight=0;else{if(s.classList.contains(m.disable)&&(s.classList.remove(m.disable),this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(e),1)),"none"===s.style.display&&(s.style.display="",this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(e),1)),this.listViewInstance.showCheckBox&&s.classList.contains(m.selected)){this.listViewInstance.removeSelect(),this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(e),1);var n=s.querySelector("."+m.checkboxWrapper);n.removeAttribute("aria-checked"),n.firstElementChild.classList.remove(m.checked),s.classList.contains(m.focused)&&(s.classList.remove(m.focused),this.activeIndex=void 0)}else s.classList.contains(m.selected)&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0);parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)?parseFloat(this.bottomElement.style.height)?(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiLastIndex,this.bottomElement)):(this.topElement.style.height=parseFloat(this.topElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiFirstIndex-1,this.topElement.nextSibling),this.uiLastIndex--,this.uiFirstIndex--):this.updateUI(s,this.uiLastIndex,this.bottomElement)}this.changeUiIndices(e,!1),this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.changeUiIndices=function(e,t){for(var i=Object.keys(this.uiIndices),s=0;s<i.length;s++)this.uiIndices[i[s]]=this.uiIndices[i[s]].map(function(i){return i>=e?t?++i:--i:i})},s.prototype.addItem=function(e,t,i,s){for(var n=0;n<e.length;n++){var l=e[n];if(i=this.listViewInstance.addItemAtIndex(s,i,l),this.listViewInstance.setViewDataSource(i),this.domItemCount)if(this.domItemCount<this.expectedDomItemCount){if(this.listViewInstance.findItemFromDS(i,t)instanceof Array){if(this.listViewInstance.ulElement){var r=this.listViewInstance.curViewDS.indexOf(l);this.createAndInjectNewItem(l,r),(a=this.listViewInstance.curViewDS[r-1])&&a.isHeader&&1===a.items.length&&(--r,this.createAndInjectNewItem(a,r))}this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")}}else{var a,o=this.listViewInstance.curViewDS.indexOf(l);this.addUiItem(o),(a=this.listViewInstance.curViewDS[o-1])&&a.isHeader&&1===a.items.length&&this.addUiItem(o-1)}else!this.listViewInstance.template&&!this.listViewInstance.groupTemplate||this.isNgTemplate()||(this.listViewInstance.listBaseOption.template=null,this.listViewInstance.listBaseOption.groupTemplate=null,this.listViewInstance.listBaseOption.itemCreated=this.createUIItem.bind(this)),this.uiVirtualization()}},s.prototype.createAndInjectNewItem=function(t,i){var s,n=e.createListItemFromJson(this.listViewInstance.createElement,[t],this.listViewInstance.listBaseOption,null,null,this.listViewInstance);if(s=Object.keys(this.listViewInstance.curViewDS).length-1===i?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+1])||this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+2]),this.listViewInstance.fields.groupBy&&this.listViewInstance.curViewDS[i+1]&&this.listViewInstance.curViewDS[i+1].isHeader){var l=this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i-1]);l&&(s=l.nextElementSibling)}this.listViewInstance.ulElement.insertBefore(n[0],s),this.domItemCount++,this.bottomElementHeight<=0&&this.uiLastIndex++,this.refreshItemHeight()},s.prototype.createUIItem=function(e){if(!e.item.classList.contains("e-list-group-item")&&(this.templateData=e.curData.isHeader?e.curData.items[0]:e.curData,this.listViewInstance.showCheckBox&&(this.listViewInstance.renderCheckbox(e),!(0,t.isNullOrUndefined)(this.listViewInstance.virtualCheckBox)&&!(0,t.isNullOrUndefined)(this.listViewInstance.virtualCheckBox.outerHTML)))){var i=document.createElement("div"),s='<div class="e-text-content" role="presentation"> <span class="e-list-text"> ${'+this.listViewInstance.fields.text+"} </span></div>",n=(0,t.compile)(this.listViewInstance.template||s,this.listViewInstance)(this.templateData,this.listViewInstance);if(this.listViewInstance.template&&this.listViewInstance.isReact&&this.listViewInstance.renderReactTemplates(),[].slice.call(n).forEach(function(e){i.appendChild(e)}),i.children&&i.children[0]){for(i.children[0].classList.add("e-checkbox"),"Left"===this.listViewInstance.checkBoxPosition?i.children[0].classList.add("e-checkbox-left"):i.children[0].classList.add("e-checkbox-right"),"Left"===this.listViewInstance.checkBoxPosition?i.children[0].insertBefore(this.listViewInstance.virtualCheckBox,i.childNodes[0].children[0]):i.children[0].appendChild(this.listViewInstance.virtualCheckBox);e.item.lastChild;)e.item.removeChild(e.item.lastChild);[].slice.call(i.children).forEach(function(t){e.item.appendChild(t)})}}},s.prototype.reRenderUiVirtualization=function(){this.wireScrollEvent(!0),this.listViewInstance.contentContainer&&(0,t.detach)(this.listViewInstance.contentContainer),this.listViewInstance.preRender(),this.domItemCount=0,this.listViewInstance.header(),this.listViewInstance.setLocalData()},s.prototype.updateUI=function(t,i,s){var n=this.isNgTemplate()?this.onNgChange:this.onChange;if(this.listViewInstance.template||this.listViewInstance.groupTemplate){var l=this.listViewInstance.curViewDS[i];t.dataset.uid=l[this.listViewInstance.fields.id]?l[this.listViewInstance.fields.id]:e.generateId(),n(l,t,this)}else this.updateUiContent(t,i);this.changeElementAttributes(t,i),s&&this.listViewInstance.ulElement.insertBefore(t,s)},s.prototype.onChange=function(t,i,s){var n=e.createListItemFromJson(s.listViewInstance.createElement,[t],s.listViewInstance.listBaseOption,null,null,s.listViewInstance);for(s.listViewInstance.isReact&&s.listViewInstance.renderReactTemplates();i.lastChild;)i.removeChild(i.lastChild);[].slice.call(n[0].children).forEach(function(e){i.appendChild(e)})},s.prototype.onNgChange=function(e,i,s){for(var n=(0,t.compile)(s.listViewInstance.template)(e);i.lastChild;)i.removeChild(i.lastChild);i.appendChild(n[0])},s.prototype.getModuleName=function(){return"virtualization"},s.prototype.destroy=function(){this.wireScrollEvent(!0),this.topElement=null,this.bottomElement=null},s}(),b=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),S=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},w=function(e){function i(i,s){var n=e.call(this,s,i)||this;return n.getHelper=function(e){var i,s=n.getSortableElement(e.sender.target);return!!n.isValidTarget(s,n)&&(n.helper?i=n.helper({sender:s,element:e.element}):((i=s.cloneNode(!0)).style.width=s.offsetWidth+"px",i.style.height=s.offsetHeight+"px"),(0,t.addClass)([i],["e-sortableclone"]),document.body.appendChild(i),i)},n.onDrag=function(e){if(e.target){n.trigger("drag",{event:e.event,element:n.element,target:e.target});var i,s=n.getSortableInstance(e.target),l=n.getSortableElement(e.target,s);if(!(n.isValidTarget(l,s)||e.target&&"string"==typeof e.target.className&&e.target.className.indexOf("e-list-group-item")>-1)||n.curTarget===l&&(0,t.isNullOrUndefined)(s.placeHolder)||s.placeHolderElement&&s.placeHolderElement===e.target)n.curTarget!==n.target&&n.scope&&n.curTarget!==l&&!(0,t.isNullOrUndefined)(s.placeHolder)&&(n.removePlaceHolder(n.getSortableInstance(n.curTarget)),n.curTarget=n.target);else{if(e.target.classList.contains("e-list-group-item")&&(l=e.target),n.curTarget=l,n.target===l)return;var r=n.getIndex(s.placeHolderElement,s),a=n.getPlaceHolder(l,s),o=void 0;if(a){r=(0,t.isNullOrUndefined)(r)?n.getIndex(n.target):r,o=n.getIndex(l,s,e.event);var c=n.isPlaceHolderPresent(s);if(c&&r===o)return;c&&n.removePlaceHolder(s),s.placeHolderElement=a,e.target&&"string"==typeof e.target.className&&e.target.className.indexOf("e-list-group-item")>-1?s.element.insertBefore(s.placeHolderElement,s.element.children[o]):s.element!==n.element&&o===s.element.childElementCount?s.element.appendChild(s.placeHolderElement):s.element.insertBefore(s.placeHolderElement,s.element.children[o])}else{r=(0,t.isNullOrUndefined)(r)?n.getIndex(n.target):n.getIndex(l,s)<r||!r?r:r-1,o=n.getIndex(l,s);var h=s.element!==n.element?o:r<o?o+1:o;n.updateItemClass(s),s.element.insertBefore(n.target,s.element.children[h]),n.curTarget=n.target,n.trigger("drop",{droppedElement:n.target,element:s.element,previousIndex:r,currentIndex:o,target:e.target,helper:document.getElementsByClassName("e-sortableclone")[0],event:e.event,scope:n.scope})}}if(s=n.getSortableInstance(n.curTarget),(0,t.isNullOrUndefined)(l)&&e.target!==s.placeHolderElement)n.isPlaceHolderPresent(s)&&n.removePlaceHolder(s);else[].slice.call(document.getElementsByClassName("e-sortable-placeholder")).forEach(function(e){(i=n.getSortableInstance(e)).element&&i!==s&&n.removePlaceHolder(i)})}},n.onDragStart=function(e){if(n.target=n.getSortableElement(e.target),(0,t.isNullOrUndefined)(n.target)&&(0,t.closest)(n.element,".e-listbox-container")&&t.Browser.isDevice)return(0,t.detach)(e.dragElement),void(0,t.getComponent)(n.element,"draggable").intDestroy(e.event);var i=!1;n.target.classList.add("e-grabbed"),n.curTarget=n.target,e.helper=document.getElementsByClassName("e-sortableclone")[0];var s={cancel:!1,element:n.element,target:n.target};n.trigger("beforeDragStart",s,function(t){t.cancel&&(i=t.cancel,n.onDragStop(e))}),i||(t.isBlazor?n.trigger("dragStart",{event:e.event,element:n.element,target:n.target,bindEvents:e.bindEvents,dragElement:e.dragElement}):n.trigger("dragStart",{event:e.event,element:n.element,target:n.target}))},n.onDragStop=function(e){var i,s,l,r=n.getSortableInstance(n.curTarget);i=n.getIndex(n.target);var a=n.isPlaceHolderPresent(r);if(a){var o=n.getIndex(r.placeHolderElement,r),c={previousIndex:i=n===r&&i-o>=1?i-1:i,currentIndex:o,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1,handled:!1};n.trigger("beforeDrop",c,function(t){if(!t.cancel){if(l=t.handled,n.updateItemClass(r),t.handled){var s=n.target.cloneNode(!0);n.target.classList.remove("e-grabbed"),n.target=s}r.element.insertBefore(n.target,r.placeHolderElement);var a=n.getIndex(n.target,r);t.currentIndex>t.previousIndex&&(i=n===r&&i-a>=1?i-1:i),n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:a,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope,handled:l})}n.removePlaceHolder(r)})}if(r=n.getSortableInstance(e.target),s=r.element.childElementCount,i=n.getIndex(n.target),r.element.querySelector(".e-list-nrt")&&(s-=1),n.curTarget===n.target&&e.target===n.curTarget&&(s=i),r.element===e.target||!a&&n.curTarget===n.target){var h={previousIndex:i,currentIndex:s,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1};n.trigger("beforeDrop",h,function(t){(r.element===e.target||"string"==typeof e.target.className&&e.target.className.indexOf("e-list-nrt")>-1||"string"==typeof e.target.className&&e.target.className.indexOf("e-list-nr-template")>-1||e.target.closest(".e-list-nr-template"))&&!t.cancel&&(n.updateItemClass(r),r.element.appendChild(n.target),n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:s,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope}))})}n.target.classList.remove("e-grabbed"),n.target=null,n.curTarget=null,(0,t.remove)(e.helper),(0,t.getComponent)(n.element,"draggable").intDestroy(e.event)},n.bind(),n}var s;return b(i,e),s=i,i.prototype.bind=function(){this.element.id||(this.element.id=(0,t.getUniqueID)("sortable")),this.itemClass||(this.itemClass="e-sort-item",this.dataBind()),this.initializeDraggable()},i.prototype.initializeDraggable=function(){new t.Draggable(this.element,{helper:this.getHelper,dragStart:this.onDragStart,drag:this.onDrag,dragStop:this.onDragStop,dragTarget:"."+this.itemClass,enableTapHold:!0,tapHoldThreshold:200,queryPositionInfo:this.queryPositionInfo,distance:1}),this.wireEvents()},i.prototype.wireEvents=function(){var e=this.element;t.EventHandler.add(e,"keydown",this.keyDownHandler,this)},i.prototype.unwireEvents=function(){var e=this.element;t.EventHandler.remove(e,"keydown",this.keyDownHandler)},i.prototype.keyDownHandler=function(e){if(27===e.keyCode){var i=(0,t.getComponent)(this.element,"draggable");i&&i.intDestroy(null);var s=document.getElementsByClassName("e-sortableclone")[0];s&&s.remove();var n=document.getElementsByClassName("e-sortable-placeholder")[0];n&&n.remove()}},i.prototype.getPlaceHolder=function(e,t){if(t.placeHolder){var i=t.placeHolder({element:t.element,grabbedElement:this.target,target:e});return i.classList.add("e-sortable-placeholder"),i}return null},i.prototype.isValidTarget=function(e,i){return e&&(0,t.compareElementParent)(e,i.element)&&e.classList.contains(i.itemClass)&&!e.classList.contains("e-disabled")},i.prototype.removePlaceHolder=function(e){(0,t.remove)(e.placeHolderElement),e.placeHolderElement=null},i.prototype.updateItemClass=function(e){this!==e&&(this.target.classList.remove(this.itemClass),this.target.classList.add(e.itemClass))},i.prototype.getSortableInstance=function(e){if(e=(0,t.closest)(e,".e-"+this.getModuleName())){var i=(0,t.getComponent)(e,s);return i.scope&&this.scope&&i.scope===this.scope?i:this}return this},i.prototype.getIndex=function(e,i,s){var n,l;return void 0===i&&(i=this),[].slice.call(i.element.children).forEach(function(i,r){if(i.classList.contains("e-sortable-placeholder")&&(l=!0),i!==e);else if(n=r,!(0,t.isNullOrUndefined)(s)){l&&(n-=1);var a=e.getBoundingClientRect(),o=a.bottom-(a.bottom-a.top)/2,c=s.changedTouches?s.changedTouches[0].clientY:s.clientY;n=c<=o?n:n+1}}),n},i.prototype.getSortableElement=function(e,i){return void 0===i&&(i=this),(0,t.closest)(e,"."+i.itemClass)},i.prototype.queryPositionInfo=function(e){return e.left=scrollX?parseFloat(e.left)-scrollX+"px":e.left,e.top=scrollY?parseFloat(e.top)-scrollY+"px":e.top,e},i.prototype.isPlaceHolderPresent=function(e){return e.placeHolderElement&&!!(0,t.closest)(e.placeHolderElement,"#"+e.element.id)},i.prototype.moveTo=function(e,t,i){x(this.element,e,t,i)},i.prototype.destroy=function(){this.unwireEvents(),"e-sort-item"===this.itemClass&&(this.itemClass=null,this.dataBind()),(0,t.getComponent)(this.element,t.Draggable).destroy(),e.prototype.destroy.call(this)},i.prototype.getModuleName=function(){return"sortable"},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){if("itemClass"===s[i])[].slice.call(this.element.children).forEach(function(i){i.classList.contains(t.itemClass)&&i.classList.remove(t.itemClass),e.itemClass&&i.classList.add(e.itemClass)})}},S([(0,t.Property)(!1)],i.prototype,"enableAnimation",void 0),S([(0,t.Property)(null)],i.prototype,"itemClass",void 0),S([(0,t.Property)(null)],i.prototype,"scope",void 0),S([(0,t.Property)()],i.prototype,"helper",void 0),S([(0,t.Property)()],i.prototype,"placeHolder",void 0),S([(0,t.Event)()],i.prototype,"drag",void 0),S([(0,t.Event)()],i.prototype,"beforeDragStart",void 0),S([(0,t.Event)()],i.prototype,"dragStart",void 0),S([(0,t.Event)()],i.prototype,"beforeDrop",void 0),S([(0,t.Event)()],i.prototype,"drop",void 0),i=s=S([t.NotifyPropertyChanges],i)}(t.Base);function x(e,i,s,n){var l=[];if(i||(i=e),s&&s.length?s.forEach(function(t){l.push(e.children[t])}):l=[].slice.call(e.children),(0,t.isNullOrUndefined)(n))l.forEach(function(e){i.appendChild(e)});else{var r=i.children[n];l.forEach(function(e){i.insertBefore(e,r)})}}})(),r})());
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionButtons")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionData","SyncfusionButtons"],t):"object"==typeof exports?exports.SyncfusionLists=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionButtons")):e.SyncfusionLists=t(e.SyncfusionBase,e.SyncfusionData,e.SyncfusionButtons)}(self,(e,t,i)=>(()=>{"use strict";var s={766:t=>{t.exports=e},741:e=>{e.exports=i},74:e=>{e.exports=t}},n={};function l(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return s[e](i,i.exports,l),i.exports}l.d=(e,t)=>{for(var i in t)l.o(t,i)&&!l.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},l.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),l.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{l.r(r),l.d(r,{FieldSettings:()=>g,ListBase:()=>e,ListView:()=>v,Sortable:()=>w,Virtualization:()=>y,classNames:()=>m,cssClass:()=>n,getFieldValues:()=>a,moveTo:()=>x});var e,t=l(766),i=l(74),s=l(741),n={li:"e-list-item",ul:"e-list-parent e-ul",group:"e-list-group-item",icon:"e-list-icon",text:"e-list-text",check:"e-list-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-list-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-list-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"};function a(e,i){var s={};if((0,t.isNullOrUndefined)(e)||"string"==typeof e||"number"==typeof e||!(0,t.isNullOrUndefined)(e.isHeader))return e;for(var n=0,l=Object.keys(i);n<l.length;n++){var r=i[""+l[n]],a=(0,t.isNullOrUndefined)(r)||"string"!=typeof r?void 0:(0,t.getValue)(r,e);(0,t.isNullOrUndefined)(a)||(s[""+r]=a)}return s}function o(e){if(e)try{return"function"!=typeof e&&document.querySelector(e)?(0,t.compile)(document.querySelector(e).innerHTML.trim()):(0,t.compile)(e)}catch(i){return(0,t.compile)(e)}}!function(e){e.defaultMappedFields={id:"id",text:"text",url:"url",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",selected:"selected",iconCss:"iconCss",child:"child",isVisible:"isVisible",hasChildren:"hasChildren",tooltip:"tooltip",htmlAttributes:"htmlAttributes",urlAttributes:"urlAttributes",imageAttributes:"imageAttributes",imageUrl:"imageUrl",groupBy:null,sortBy:null};var s={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},l={showCheckBox:!1,showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:e.defaultMappedFields,ariaAttributes:s,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,headerTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right",itemNavigable:!1};function r(e,t,i,s,n){return L(e,c(e,t,i,s,n),null,s)}function c(e,i,s,r,a){var o=[],c=(0,t.extend)({},l,r);n=S(c.moduleName);for(var h=v(),d=0;d<i.length;d++)if(!(0,t.isNullOrUndefined)(i[d])){var u=void 0;if(c.itemCreating&&"function"==typeof c.itemCreating){var p={dataSource:i,curData:i[d],text:i[d],options:c};c.itemCreating(p)}if(u=s?b(e,i[d],void 0,null,null,[],null,h,d,r):x(e,i[d],void 0,null,null,r,a),c.itemCreated&&"function"==typeof c.itemCreated){p={dataSource:i,curData:i[d],text:i[d],item:u,options:c};c.itemCreated(p)}o.push(u)}return o}function h(i,r,o,c,h,d){var u=(0,t.extend)({},l,o);n=S(u.moduleName);var p,m=!d||"listview"!==d.getModuleName()&&"multiselect"!==d.getModuleName()?(0,t.extend)({},e.defaultMappedFields,u.fields):u.fields,g=(0,t.extend)({},s,u.ariaAttributes),w=[];c&&(g.level=c);var L,C,V=[];r&&r.length&&!(0,t.isNullOrUndefined)(f(r).item)&&!Object.prototype.hasOwnProperty.call(f(r).item,m.id)&&(p=v());for(var E=0;E<r.length;E++){var O=a(r[E],m);if(!(0,t.isNullOrUndefined)(r[E])){if(u.itemCreating&&"function"==typeof u.itemCreating){var k={dataSource:r,curData:r[E],text:O[m.text],options:u,fields:m};u.itemCreating(k)}var D=r[E];u.itemCreating&&"function"==typeof u.itemCreating&&(O=a(r[E],m)),Object.prototype.hasOwnProperty.call(O,m.id)&&!(0,t.isNullOrUndefined)(O[m.id])&&(p=O[m.id]);var H=[];if(u.showCheckBox&&(u.itemNavigable&&(O[m.url]||O[m.urlAttributes])?w.push(i("input",{className:n.check,attrs:{type:"checkbox"}})):H.push(i("input",{className:n.check,attrs:{type:"checkbox"}}))),!0===h){if(u.showIcon&&Object.prototype.hasOwnProperty.call(O,m.iconCss)&&!(0,t.isNullOrUndefined)(O[m.iconCss])&&H.push(i("span",{className:n.icon+" "+O[m.iconCss]})),C=(L=b(i,D,O,m,u.itemClass,H,!(!Object.prototype.hasOwnProperty.call(D,"isHeader")||!D.isHeader),p,E,o)).querySelector("."+n.anchorWrap),Object.prototype.hasOwnProperty.call(O,m.tooltip)){var N=O[m.tooltip];if(o&&o.enableHtmlSanitizer)N=t.SanitizeHtmlHelper.sanitize(N);else N=i("span",{innerHTML:N}).innerText;L.setAttribute("title",N)}u.itemNavigable&&w.length&&(0,t.prepend)(w,L.firstElementChild)}else{if((L=x(i,D,O,m,u.itemClass,o,d)).classList.add(n.level+"-"+g.level),L.setAttribute("aria-level",g.level.toString()),"presentation"!==g.groupItemRole&&"presentation"!==g.itemRole||L.removeAttribute("aria-level"),C=L.querySelector("."+n.anchorWrap),Object.prototype.hasOwnProperty.call(O,m.tooltip)){N=O[m.tooltip];if(o&&o.enableHtmlSanitizer)N=t.SanitizeHtmlHelper.sanitize(N);else N=i("span",{innerHTML:N}).innerText;L.setAttribute("title",N)}if(Object.prototype.hasOwnProperty.call(O,m.htmlAttributes)&&O[m.htmlAttributes]){var T=O[m.htmlAttributes];"class"in T&&"string"==typeof T.class&&""===T.class.trim()&&delete T.class,I(L,T)}if(Object.prototype.hasOwnProperty.call(O,m.enabled)&&!1===O[m.enabled]&&L.classList.add(n.disabled),Object.prototype.hasOwnProperty.call(O,m.isVisible)&&!1===O[m.isVisible]&&(L.style.display="none"),Object.prototype.hasOwnProperty.call(O,m.imageUrl)&&!(0,t.isNullOrUndefined)(O[m.imageUrl])&&!u.template){var U={src:O[m.imageUrl],alt:(0,t.isNullOrUndefined)(O.name)?"Displaying Image":"Displaying "+O.name+" Image"};(0,t.merge)(U,O[m.imageAttributes]);var B=i("img",{className:n.image,attrs:U});C?C.insertAdjacentElement("afterbegin",B):(0,t.prepend)([B],L.firstElementChild)}if(u.showIcon&&Object.prototype.hasOwnProperty.call(O,m.iconCss)&&!(0,t.isNullOrUndefined)(O[m.iconCss])&&!u.template){var A=i("div",{className:n.icon+" "+O[m.iconCss]});C?C.insertAdjacentElement("afterbegin",A):(0,t.prepend)([A],L.firstElementChild)}H.length&&(0,t.prepend)(H,L.firstElementChild),u.itemNavigable&&w.length&&(0,t.prepend)(w,L.firstElementChild),y(i,O,m,r,u,L,g.level)}if(C&&(0,t.addClass)([L],[n.navigable]),u.itemCreated&&"function"==typeof u.itemCreated){k={dataSource:r,curData:r[E],text:O[m.text],item:L,options:u,fields:m};u.itemCreated(k)}w=[],V.push(L)}}return V}function d(e,i,s,n,r,a){var o=(0,t.extend)({},l,s);return L(e,h(e,i,s,n,r,a),o.listClass,s)}function u(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function p(e,t,s){if(void 0===s&&(s=new i.Query),"Ascending"===e)s.sortBy(t,"ascending",!0);else if("Descending"===e)s.sortBy(t,"descending",!0);else for(var n=0;n<s.queries.length;n++)"onSortBy"===s.queries[n].fn&&s.queries.splice(n,1);return s}function m(e,t){return new i.DataManager(e).executeLocal(t)}function f(e){for(var i={typeof:null,item:null},s=0;s<e.length;s++)if(!(0,t.isNullOrUndefined)(e[s]))return{typeof:typeof e[s],item:e[s]};return i}function I(e,i){var s={};(0,t.merge)(s,i),s.class&&((0,t.addClass)([e],s.class.split(" ")),delete s.class),(0,t.attributes)(e,s)}function g(e){for(var t={},i=e.attributes,s=0;s<i.length;s++)t[i[s].nodeName]=i[s].nodeValue;return t}function v(){var e=new Uint32Array(1);return window.crypto.getRandomValues(e),Math.floor(65536*(1+e[0]/4294967296)).toString(16).substring(1)}function y(e,i,s,l,r,a,o){var c=i[s.child]||[],h=i[s.hasChildren];if(c.length&&(h=!0,a.classList.add(n.hasChild),r.processSubChild)){var u=d(e,c,r,++o);a.appendChild(u)}r.expandCollapse&&h&&!r.template&&(a.firstElementChild.classList.add(n.iconWrapper),("Left"===r.expandIconPosition?t.prepend:t.append)([e("div",{className:"e-icons "+r.expandIconClass})],a.querySelector("."+n.textContent)))}function b(e,i,r,a,o,c,h,d,u,p){var m,f,g=(0,t.extend)({},l,p),v=(0,t.extend)({},s,g.ariaAttributes),y=i,b=i;"string"!=typeof i&&"number"!=typeof i&&"boolean"!=typeof i&&(m=i,y="boolean"==typeof r[a.text]||"number"==typeof r[a.text]?r[a.text]:r[a.text]||"",b=r[a.value]),f=(0,t.isNullOrUndefined)(m)||(0,t.isNullOrUndefined)(r[a.id])||""===r[a.id]?d+"-"+u:d;var S=e("li",{className:(!0===h?n.group:n.li)+" "+((0,t.isNullOrUndefined)(o)?"":o),id:f,attrs:""!==v.groupItemRole&&""!==v.itemRole?{role:!0===h?v.groupItemRole:v.itemRole}:{}});return m&&Object.prototype.hasOwnProperty.call(r,a.enabled)&&"false"===r[a.enabled].toString()&&S.classList.add(n.disabled),p&&p.enableHtmlSanitizer&&(y=t.SanitizeHtmlHelper.sanitize(y)),h?S.innerText=y:(S.setAttribute("data-value",(0,t.isNullOrUndefined)(b)?"null":b),S.setAttribute("role","option"),m&&Object.prototype.hasOwnProperty.call(r,a.htmlAttributes)&&r[a.htmlAttributes]&&I(S,r[a.htmlAttributes]),c.length&&!g.itemNavigable&&(0,t.append)(c,S),m&&(r[a.url]||r[a.urlAttributes]&&r[a.urlAttributes].href)?S.appendChild(w(e,m,a,y,c,g.itemNavigable)):(c.length&&g.itemNavigable&&(0,t.append)(c,S),S.appendChild(document.createTextNode(y)))),S}function S(e){return{li:"e-"+e+"-item",ul:"e-"+e+"-parent e-ul",group:"e-"+e+"-group-item",icon:"e-"+e+"-icon",text:"e-"+e+"-text",check:"e-"+e+"-check",checked:"e-checked",selected:"e-selected",expanded:"e-expanded",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",url:"e-"+e+"-url",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-"+e+"-img",iconWrapper:"e-icon-wrapper",anchorWrap:"e-anchor-wrap",navigable:"e-navigable"}}function w(e,i,s,l,r,o){var c,h=a(i,s),d={href:h[s.url]};if(Object.prototype.hasOwnProperty.call(h,s.urlAttributes)&&h[s.urlAttributes]&&((0,t.merge)(d,h[s.urlAttributes]),d.href=h[s.url]?h[s.url]:h[s.urlAttributes].href),o){c=e("a",{className:n.text+" "+n.url});var u=e("div",{className:n.anchorWrap});r&&r.length&&(0,t.append)(r,u),u.appendChild(document.createTextNode(l)),(0,t.append)([u],c)}else c=e("a",{className:n.text+" "+n.url,innerHTML:l});return I(c,d),c}function x(e,i,r,a,c,h,d){var u,p,m,f=(0,t.extend)({},l,h),I=(0,t.extend)({},s,f.ariaAttributes),g=i;"string"!=typeof i&&"number"!=typeof i&&(m=i,g=r[a.text]||"",u=(0,t.isNullOrUndefined)(r._id)?r[a.id]:r._id,p=!(!Object.prototype.hasOwnProperty.call(i,"isHeader")||!i.isHeader)),h&&h.enableHtmlSanitizer&&(g=t.SanitizeHtmlHelper.sanitize(g));var y=e("li",{className:(!0===p?n.group:n.li)+" "+((0,t.isNullOrUndefined)(c)?"":c),attrs:""!==I.groupItemRole&&""!==I.itemRole?{role:!0===p?I.groupItemRole:I.itemRole}:{}});if(!0==!(0,t.isNullOrUndefined)(u)?y.setAttribute("data-uid",u):y.setAttribute("data-uid",v()),p&&h&&h.groupTemplate){var b=o(h.groupTemplate);if(d&&"listview"!==d.getModuleName())(S=b(i,d,"groupTemplate",f.groupTemplateID,!!f.isStringTemplate,null,y))&&(0,t.append)(S,y);else(0,t.append)(b(i,d,"groupTemplate",f.groupTemplateID,!!f.isStringTemplate),y)}else if(!p&&h&&h.template){var S;b=o(h.template);if(d&&"listview"!==d.getModuleName())(S=b(i,d,"template",f.templateID,!!f.isStringTemplate,null,y))&&(0,t.append)(S,y);else(0,t.append)(b(i,d,"template",f.templateID,!!f.isStringTemplate),y)}else{var x=e("div",{className:n.textContent,attrs:""!==I.wrapperRole?{role:I.wrapperRole}:{}});if(m&&(r[a.url]||r[a.urlAttributes]&&r[a.urlAttributes].href))x.appendChild(w(e,m,a,g,null,f.itemNavigable));else{var L=e("span",{className:n.text,attrs:""!==I.itemText?{role:I.itemText}:{}});h&&h.enableHtmlSanitizer?L.innerText=g:L.innerHTML=g,x.appendChild(L)}y.appendChild(x)}return y}function L(e,i,r,a){var o=(0,t.extend)({},l,a),c=(0,t.extend)({},s,o.ariaAttributes),h=e("ul",{className:(n=S(o.moduleName)).ul+" "+((0,t.isNullOrUndefined)(r)?"":r),attrs:""!==c.listRole?{role:c.listRole}:{}});return(0,t.append)(i,h),h}e.createList=function(e,i,n,a,o){var c=(0,t.extend)({},l,n),h=(0,t.extend)({},s,c.ariaAttributes),u=f(i).typeof;return"string"===u||"number"===u?r(e,i,a,n,o):d(e,i,n,h.level,a,o)},e.createListFromArray=r,e.createListItemFromArray=c,e.createListItemFromJson=h,e.createListFromJson=d,e.getSiblingLI=function(e,i,s){if(n=S(l.moduleName),e&&e.length){var r,a,o=Array.prototype.slice.call(e);for(r=o[(a=i?u(i,o):!0===s?o.length:-1)+(!0===s?-1:1)];r&&(!(0,t.isVisible)(r)||r.classList.contains(n.disabled));)r=o[a+=!0===s?-1:1];return r}},e.indexOf=u,e.groupDataSource=function(s,n,l){void 0===l&&(l="None");var r=(0,t.extend)({},e.defaultMappedFields,n),a=(new i.Query).group(r.groupBy),o=m(s,a=p(l,"key",a));s=[];for(var c=0;c<o.length;c++){var h=o[c].items,d={};d[r.text]=o[c].key,d.isHeader=!0;var u=r.text;"id"===u&&(d[""+(u="text")]=o[c].key),d._id="group-list-item-"+(o[c].key?o[c].key.toString().trim():"undefined"),d.items=h,s.push(d);for(var f=0;f<h.length;f++)s.push(h[f])}return s},e.addSorting=p,e.getDataSource=m,e.createJsonFromElement=function i(s,n){var r=(0,t.extend)({},l,n),a=(0,t.extend)({},e.defaultMappedFields,r.fields),o=s.cloneNode(!0),c=[];o.classList.add("json-parent");var h=o.querySelectorAll(".json-parent>li");o.classList.remove("json-parent");for(var d=0;d<h.length;d++){for(var u=h[d],p=u.querySelector("a"),m=u.querySelector("ul"),f={},I=p?p.childNodes:u.childNodes,y=Object.keys(I),b=0;b<I.length;b++)I[Number(y[b])].hasChildNodes()||(f[a.text]=I[Number(y[b])].textContent);var S=g(u);S.id?(f[a.id]=S.id,delete S.id):f[a.id]=v(),Object.keys(S).length&&(f[a.htmlAttributes]=S),p&&(S=g(p),Object.keys(S).length&&(f[a.urlAttributes]=S)),m&&(f[a.child]=i(m,n)),c.push(f)}return c},e.renderContentTemplate=function(i,s,r,c,h,d){for(var u,p=i("ul",{className:(n=S(l.moduleName)).ul,attrs:{role:"presentation"}}),m=(0,t.extend)({},l,h),f=(0,t.extend)({},e.defaultMappedFields,c),I=o(s),g=[],y=v(),b=0;b<r.length;b++){var w=a(r[b],f),x=r[b],L=x.isHeader;if(u="string"==typeof r[b]||"number"==typeof r[b]?x:w[f.value],m.itemCreating&&"function"==typeof m.itemCreating){var C={dataSource:r,curData:x,text:u,options:m,fields:f};m.itemCreating(C)}m.itemCreating&&"function"==typeof m.itemCreating&&(w=a(r[b],f),u="string"==typeof r[b]||"number"==typeof r[b]?x:w[f.value]);var V=i("li",{id:y+"-"+b,className:L?n.group:n.li,attrs:{role:"presentation"}});if(L)"string"==typeof r[b]||"number"==typeof r[b]?V.innerText=x:V.innerText=w[f.text];else{var E,O=L?m.groupTemplateID:m.templateID;if(L)if(d&&"listview"!==d.getModuleName())(E=I(x,d,"headerTemplate",O,!!m.isStringTemplate,null,V))&&(0,t.append)(E,V);else(0,t.append)(I(x,d,"headerTemplate",O,!!m.isStringTemplate),V);else if(d&&"listview"!==d.getModuleName())(E=I(x,d,"template",O,!!m.isStringTemplate,null,V))&&(0,t.append)(E,V);else(0,t.append)(I(x,d,"template",O,!!m.isStringTemplate),V);V.setAttribute("data-value",(0,t.isNullOrUndefined)(u)?"null":u),V.setAttribute("role","option")}if(m.itemCreated&&"function"==typeof m.itemCreated){C={dataSource:r,curData:x,text:u,item:V,options:m,fields:f};m.itemCreated(C)}g.push(V)}return(0,t.append)(g,p),p},e.renderGroupTemplate=function(i,s,n,r,a,c){for(var h=o(i),d=(0,t.extend)({},e.defaultMappedFields,n),u=(0,t.extend)({},l,a),p=d.groupBy,m=0,f=r;m<f.length;m++){var I=f[m],g={};if(g[""+p]=I.textContent,I.innerHTML="",c&&"listview"!==c.getModuleName()){var v=h(g,c,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate,null,I);v&&(0,t.append)(v,I)}else(0,t.append)(h(g,c,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate),I)}return r},e.generateId=v,e.generateUL=L,e.generateIcon=function(e,i,s,r){var a=(0,t.extend)({},l,r);return n=S(a.moduleName),("Left"===a.expandIconPosition?t.prepend:t.append)([e("div",{className:"e-icons "+a.expandIconClass+" "+((0,t.isNullOrUndefined)(s)?"":s)})],i.querySelector("."+n.textContent)),i}}(e||(e={}));var c,h=(c=function(e,t){return c=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])},c(e,t)},function(e,t){function i(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),d=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},u={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},p={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},m={root:"e-listview",hover:"e-hover",selected:"e-active",focused:"e-focused",parentItem:"e-list-parent",listItem:"e-list-item",listIcon:"e-list-icon",textContent:"e-text-content",listItemText:"e-list-text",groupListItem:"e-list-group-item",hasChild:"e-has-child",view:"e-view",header:"e-list-header",headerText:"e-headertext",headerTemplateText:"e-headertemplate-text",text:"e-text",disable:"e-disabled",container:"e-list-container",icon:"e-icons",backIcon:"e-icon-back",backButton:"e-back-button",checkboxWrapper:"e-checkbox-wrapper",checkbox:"e-checkbox",checked:"e-check",checklist:"e-checklist",checkboxIcon:"e-frame",checkboxRight:"e-checkbox-right",checkboxLeft:"e-checkbox-left",listviewCheckbox:"e-listview-checkbox",itemCheckList:"e-checklist",virtualElementContainer:"e-list-virtualcontainer",listTemplate:"e-listview-template"},f="Template",I="GroupTemplate",g=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return h(i,e),d([(0,t.Property)("id")],i.prototype,"id",void 0),d([(0,t.Property)("text")],i.prototype,"text",void 0),d([(0,t.Property)("isChecked")],i.prototype,"isChecked",void 0),d([(0,t.Property)("isVisible")],i.prototype,"isVisible",void 0),d([(0,t.Property)("enabled")],i.prototype,"enabled",void 0),d([(0,t.Property)("iconCss")],i.prototype,"iconCss",void 0),d([(0,t.Property)("child")],i.prototype,"child",void 0),d([(0,t.Property)("tooltip")],i.prototype,"tooltip",void 0),d([(0,t.Property)("groupBy")],i.prototype,"groupBy",void 0),d([(0,t.Property)("text")],i.prototype,"sortBy",void 0),d([(0,t.Property)("htmlAttributes")],i.prototype,"htmlAttributes",void 0),d([(0,t.Property)("tableName")],i.prototype,"tableName",void 0),i}(t.ChildProperty),v=function(n){function l(e,t){var i=n.call(this,e,t)||this;return i.previousSelectedItems=[],i.hiddenItems=[],i.enabledItems=[],i.disabledItems=[],i}return h(l,n),l.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"htmlAttributes":this.setHTMLAttribute();break;case"cssClass":this.setCSSClass(i.cssClass);break;case"enable":this.setEnable();break;case"width":case"height":this.setSize();break;case"enableRtl":this.setEnableRTL();break;case"fields":this.listBaseOption.fields=this.fields.properties,this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1,"header");break;case"query":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"showHeader":this.header(this.headerTitle,!1,"header");break;case"enableVirtualization":(0,t.isNullOrUndefined)(this.contentContainer)||(0,t.detach)(this.contentContainer),this.refresh();break;case"showCheckBox":case"checkBoxPosition":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.setCheckbox();break;case"dataSource":this.previousScrollTop=this.element.scrollTop,this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"sortOrder":case"template":this.enableVirtualization||this.refresh();break;case"showIcon":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():(this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList())}}},l.prototype.setHTMLAttribute=function(){!(0,t.isNullOrUndefined)(this.htmlAttributes)&&Object.keys(this.htmlAttributes).length&&(0,t.attributes)(this.element,this.htmlAttributes)},l.prototype.setCSSClass=function(e){this.cssClass&&(0,t.addClass)([this.element],this.cssClass.split(" ").filter(function(e){return e})),e&&(0,t.removeClass)([this.element],e.split(" ").filter(function(e){return e}))},l.prototype.setSize=function(){this.element.style.height=(0,t.formatUnit)(this.height),this.element.style.width=(0,t.formatUnit)(this.width),this.isWindow=!this.element.clientHeight},l.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},l.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},l.prototype.enableElement=function(e,t){t?e.classList.remove(m.disable):e.classList.add(m.disable)},l.prototype.header=function(e,i,s){if(void 0===this.headerEle&&this.showHeader){this.headerEle=this.createElement("div",{className:m.header});var n=this.createElement("span",{className:m.headerText});this.enableHtmlSanitizer?(this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),n.innerText=this.headerTitle):n.innerHTML=this.headerTitle;var l=this.createElement("div",{className:m.text,innerHTML:n.outerHTML}),r=this.createElement("div",{className:m.icon+" "+m.backIcon+" "+m.backButton,attrs:{style:"display:none;"}});if(this.headerEle.appendChild(r),this.headerEle.appendChild(l),this.headerTemplate){var a=(0,t.compile)(this.headerTemplate),o=this.createElement("div",{className:m.headerTemplateText}),c=a({},this,s,this.LISTVIEW_HEADERTEMPLATE_ID,null,null,this.headerEle);c&&(0,t.append)(c,o),(0,t.append)([o],this.headerEle),this.isReact&&this.renderReactTemplates()}this.headerTemplate&&this.headerTitle&&l.classList.add("header"),this.element.classList.add("e-has-header"),(0,t.prepend)([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";l=this.headerEle.querySelector("."+m.headerText),r=this.headerEle.querySelector("."+m.backIcon);this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(e)),l.innerHTML=e,this.headerTemplate&&i&&(l.parentElement.classList.remove("header"),this.headerEle.querySelector("."+m.headerTemplateText).classList.add("nested-header")),this.headerTemplate&&!i&&(l.parentElement.classList.add("header"),this.headerEle.querySelector("."+m.headerTemplateText).classList.remove("nested-header"),this.headerEle.querySelector("."+m.headerTemplateText).classList.add("header")),r.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},l.prototype.switchView=function(e,i,s){var n=this;if(e&&i){var l=e.style.position,r="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var a=void 0,o=this.animation.duration;if(this.animation.effect)a=this.enableRtl?p[this.animation.effect]:u[this.animation.effect];else{a=u.SlideLeft,s=this.enableRtl,o=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===s?a[0]:a[1],duration:0===o&&"Enable"===t.animationMode?400:o,timingFunction:this.animation.easing,end:function(){e.style.display="none",n.element.style.overflow=r,e.style.position=l,e.classList.remove("e-view")}}),i.style.display="",this.aniObj.animate(i,{name:!0===s?a[2]:a[3],duration:0===o&&"Enable"===t.animationMode?400:o,timingFunction:this.animation.easing,end:function(){n.trigger("actionComplete")}}),this.curUL=i}},l.prototype.preRender=function(){if(this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&this.setProperties({template:document.querySelector(this.template).innerHTML.trim()},!0)}catch(e){(0,t.compile)(this.template)}this.listBaseOption={template:this.template,headerTemplate:this.headerTemplate,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",ariaAttributes:{itemRole:"listitem",listRole:"list",itemText:"",groupItemRole:"presentation",wrapperRole:"presentation"},fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon,itemCreated:this.renderCheckbox.bind(this),templateID:""+this.element.id+f,groupTemplateID:""+this.element.id+I,enableHtmlSanitizer:this.enableHtmlSanitizer},this.initialization()},l.prototype.initialization=function(){this.curDSLevel=[],this.animateOptions={},this.curViewDS=[],this.currentLiElements=[],this.isNestedList=!1,this.selectedData=[],this.selectedId=this.enablePersistence?this.selectedId:[],this.LISTVIEW_TEMPLATE_ID=""+this.element.id+f,this.LISTVIEW_GROUPTEMPLATE_ID=""+this.element.id+I,this.LISTVIEW_HEADERTEMPLATE_ID=this.element.id+"HeaderTemplate",this.aniObj=new t.Animation(this.animateOptions),this.removeElement(this.curUL),this.removeElement(this.ulElement),this.removeElement(this.headerEle),this.removeElement(this.contentContainer),this.curUL=this.ulElement=this.liCollection=this.headerEle=this.contentContainer=void 0},l.prototype.renderCheckbox=function(e){var i=this;if(e.item.classList.contains(m.hasChild)&&(this.isNestedList=!0),this.showCheckBox&&e.item.classList.contains(m.listItem)){var n,l=(0,s.createCheckBox)(this.createElement,!1,{checked:!1,enableRtl:this.enableRtl,cssClass:m.listviewCheckbox});l.setAttribute("role","checkbox");var r=l.querySelector("."+m.checkboxIcon);if(e.item.classList.add(m.itemCheckList),e.item.firstElementChild.classList.add(m.checkbox),this.template&&this.element?(0,t.addClass)([this.element],m.listTemplate):null===this.template&&this.element&&this.element.classList&&this.element.classList.contains("e-listview-template")&&(0,t.removeClass)([this.element],m.listTemplate),"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0])if(n=a(e.curData,this.listBaseOption.fields),this.enablePersistence&&!(0,t.isNullOrUndefined)(this.selectedId))-1!==this.selectedId.findIndex(function(e){return e===n[i.listBaseOption.fields.id].toString()})&&this.checkInternally(e,l);else n[this.listBaseOption.fields.isChecked]&&this.checkInternally(e,l);else"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]||-1===this.selectedData.indexOf(e.text)||this.checkInternally(e,l);l.setAttribute("aria-checked",r.classList.contains(m.checked)?"true":"false"),l.setAttribute("aria-label",e.text),"Left"===this.checkBoxPosition?(l.classList.add(m.checkboxLeft),e.item.firstElementChild.classList.add(m.checkboxLeft),e.item.firstElementChild.insertBefore(l,e.item.firstElementChild.childNodes[0])):(l.classList.add(m.checkboxRight),e.item.firstElementChild.classList.add(m.checkboxRight),e.item.firstElementChild.appendChild(l)),this.currentLiElements.push(e.item),"Left"===this.checkBoxPosition?this.virtualCheckBox=e.item.firstElementChild.children[0]:this.virtualCheckBox=e.item.firstElementChild.lastElementChild}},l.prototype.checkInternally=function(e,t){e.item.classList.add(m.selected),t.querySelector("."+m.checkboxIcon).classList.add(m.checked),t.setAttribute("aria-checked","true")},l.prototype.checkItem=function(e){this.toggleCheckBase(e,!0)},l.prototype.toggleCheckBase=function(e,i){if(this.showCheckBox){var s=e;if(e instanceof Object&&e.constructor!==HTMLLIElement&&(s=this.getLiFromObjOrElement(e)),!(0,t.isNullOrUndefined)(s)){var n=s.querySelector("."+m.checkboxIcon);!0===i?s.classList.add(m.selected):s.classList.remove(m.selected),!0===i?n.classList.add(m.checked):n.classList.remove(m.checked),n.parentElement.setAttribute("aria-checked",i?"true":"false")}this.setSelectedItemData(s),this.updateSelectedId()}},l.prototype.uncheckItem=function(e){this.toggleCheckBase(e,!1)},l.prototype.checkAllItems=function(){this.toggleAllCheckBase(!0)},l.prototype.uncheckAllItems=function(){this.toggleAllCheckBase(!1)},l.prototype.toggleAllCheckBase=function(e){if(this.showCheckBox){for(var t=0;t<this.liCollection.length;t++){var i=this.liCollection[t].querySelector("."+m.checkboxIcon);i&&(e?i.classList.contains(m.checked)||this.checkItem(this.liCollection[t]):i.classList.contains(m.checked)&&this.uncheckItem(this.liCollection[t]))}this.enableVirtualization&&this.virtualizationModule.checkedItem(e),this.updateSelectedId()}},l.prototype.setCheckbox=function(){if(this.showCheckBox)for(var e=Array.prototype.slice.call(this.element.querySelectorAll("."+m.listItem)),t={item:void 0,curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:""},i=0;i<e.length;i++){var s=e[i];t.item=s,t.curData=this.getItemData(s),s.querySelector("."+m.checkboxWrapper)&&this.removeElement(s.querySelector("."+m.checkboxWrapper)),this.renderCheckbox(t),t.item.classList.contains(m.selected)&&this.checkInternally(t,t.item.querySelector("."+m.checkboxWrapper))}else{for(e=Array.prototype.slice.call(this.element.querySelectorAll("."+m.itemCheckList)),i=0;i<e.length;i++){(s=e[i]).classList.remove(m.selected),s.firstElementChild.classList.remove(m.checkbox),this.removeElement(s.querySelector("."+m.checkboxWrapper))}this.selectedItems&&this.selectedItems.item.classList.add(m.selected)}},l.prototype.refreshItemHeight=function(){this.virtualizationModule&&this.virtualizationModule.refreshItemHeight()},l.prototype.handleCheckboxState=function(e,i,s,n,l,r,a,o){this.trigger("select",r,function(c){c.cancel&&((a?n:!n)?(i.classList.add(m.checked),e.classList.add(m.selected)):(i.classList.remove(m.checked),e.classList.remove(m.selected)),s.setAttribute("aria-checked",a?n?"true":"false":n?"false":"true"),(0,t.merge)(r,{isChecked:i.classList.contains(m.checked)}),l&&(e.classList.remove(m.focused),o&&o.classList.remove("e-focused")))})},l.prototype.clickHandler=function(e){if(!Array.isArray(this.dataSource)||0!==this.dataSource.length){var i=e.target;this.targetElement=i;var s,n=i.classList;if(n.contains(m.backIcon)||n.contains(m.headerText))this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();else{var l=(0,t.closest)(i.parentNode,"."+m.listItem);if(null===l&&(l=i),this.removeFocus(),this.enable&&this.showCheckBox&&this.isValidLI(l))if(e.target.classList.contains(m.checkboxIcon)){if(l.classList.add(m.focused),(0,t.isNullOrUndefined)(l.querySelector("."+m.checked))){var r={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:l};this.checkInternally(r,r.item.querySelector("."+m.checkboxWrapper))}else this.uncheckItem(l),l.classList.add(m.focused);if(this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(l,e),e){var a=this.selectEventData(l,e),o=l.querySelector("."+m.checkboxIcon);(0,t.merge)(a,{isChecked:o.classList.contains(m.checked)});var c=l.querySelector("."+m.checkboxWrapper),h=o.classList.contains(m.checked),d=l.classList.contains(m.focused);this.handleCheckboxState(l,o,c,h,d,a,!1)}}else l.classList.contains(m.hasChild)?(this.removeHover(),this.removeSelect(),this.removeSelect(l),this.setSelectLI(l,e),l.classList.remove(m.selected)):(this.setCheckboxLI(l,e),"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName||(i.classList.add("e-focused"),this.targetElement=i));else this.setSelectLI(l,e),"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName||(i.classList.add("e-focused"),this.targetElement=i);s=(0,t.closest)(e.target,"li"),(0,t.isNullOrUndefined)(s)||s.classList.contains("e-has-child")&&!e.target.parentElement.classList.contains("e-listview-checkbox")&&s.classList.add(m.disable)}this.updateSelectedId()}},l.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},l.prototype.hoverHandler=function(e){var i=(0,t.closest)(e.target.parentNode,"."+m.listItem);this.setHoverLI(i)},l.prototype.leaveHandler=function(){this.removeHover()},l.prototype.homeKeyHandler=function(e,t){if(e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL){var i=this.curUL.querySelectorAll("."+m.listItem),s=this.curUL.querySelector("."+m.focused)||this.curUL.querySelector("."+m.selected);s&&(s.classList.remove(m.focused),this.showCheckBox||s.classList.remove(m.selected));var n=t?i.length-1:0;i[n].classList.contains(m.hasChild)||this.showCheckBox?i[n].classList.add(m.focused):this.setSelectLI(i[n],e),i[n]?this.element.setAttribute("aria-activedescendant",i[n].id.toString()):this.element.removeAttribute("aria-activedescendant")}},l.prototype.onArrowKeyDown=function(i,s){var n,l;return!(0,t.isNullOrUndefined)(this.curUL.querySelector("."+m.hasChild))||this.showCheckBox?(l=this.curUL.querySelector("."+m.focused)||this.curUL.querySelector("."+m.selected),n=e.getSiblingLI(this.curUL.querySelectorAll("."+m.listItem),l,s),(0,t.isNullOrUndefined)(n)||(l&&(l.classList.remove(m.focused),this.showCheckBox||l.classList.remove(m.selected)),n.classList.contains(m.hasChild)||this.showCheckBox?n.classList.add(m.focused):this.setSelectLI(n,i))):(l=this.curUL.querySelector("."+m.selected),n=e.getSiblingLI(this.curUL.querySelectorAll("."+m.listItem),l,s),this.setSelectLI(n,i)),n?this.element.setAttribute("aria-activedescendant",n.id.toString()):this.element.removeAttribute("aria-activedescendant"),n},l.prototype.arrowKeyHandler=function(e,t){var i=this;if(e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL){var s=this.onArrowKeyDown(e,t),n=this.element.getBoundingClientRect().top,l=this.element.getBoundingClientRect().height,r=this.curUL.querySelector("."+m.listItem).getBoundingClientRect(),a=void 0,o=void 0;if(this.fields.groupBy&&(o=this.curUL.querySelector("."+m.groupListItem).getBoundingClientRect()),s){var c=s.getBoundingClientRect().top,h=s.getBoundingClientRect().height;if(t)(a=this.isWindow?c:c-n)<0&&(!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop+a);else{var d=this.isWindow?window.innerHeight:l;(a=this.isWindow?c+h:c-n+h)>d&&(!0===this.isWindow?window.scroll(0,pageYOffset+(a-d)):this.element.scrollTop=this.element.scrollTop+(a-d))}}else if(this.enableVirtualization&&t&&this.virtualizationModule.uiFirstIndex)this.onUIScrolled=function(){i.onArrowKeyDown(e,t),i.onUIScrolled=void 0},a=this.virtualizationModule.listItemHeight,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=this.element.scrollTop-a;else if(t)if(this.showHeader&&this.headerEle){var u=o?o.top:r.top,p=this.headerEle.getBoundingClientRect();a=p.top<0?p.height-u:0,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=0}else this.fields.groupBy&&(a=this.isWindow?o.top<0?o.top:0:n-r.top+o.height,!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop-a)}},l.prototype.enterKeyHandler=function(e){if(Object.keys(this.dataSource).length&&this.curUL){var i=!(0,t.isNullOrUndefined)(this.curUL.querySelector("."+m.hasChild)),s=this.curUL.querySelector("."+m.focused);i&&s&&(s.classList.remove(m.focused),this.showCheckBox&&(this.removeSelect(),this.removeSelect(s),this.removeHover()),this.setSelectLI(s,e))}},l.prototype.spaceKeyHandler=function(e){if(this.enable&&this.showCheckBox&&Object.keys(this.dataSource).length&&this.curUL){e.preventDefault();var i=this.curUL.querySelector("."+m.focused),s=void 0,n=void 0;if(!(0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(i.querySelector("."+m.checked))){var l={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:i};s=l.item.querySelector("."+m.checkboxWrapper),this.checkInternally(l,s),n=s.querySelector("."+m.checkboxIcon+"."+m.icon)}else this.uncheckItem(i);var r=this.selectEventData(i,e);if((0,t.merge)(r,{isChecked:!!n&&n.classList.contains(m.checked)}),!(0,t.isNullOrUndefined)(i)){var a=i.querySelector("."+m.checkboxWrapper),o=i.querySelector("."+m.checkboxIcon),c=o.classList.contains(m.checked),h=i.classList.contains(m.focused);this.handleCheckboxState(i,o,a,c,h,r,!1)}this.updateSelectedId()}},l.prototype.keyActionHandler=function(e){switch(e.keyCode){case 36:this.homeKeyHandler(e);break;case 35:this.homeKeyHandler(e,!0);break;case 40:this.arrowKeyHandler(e);break;case 38:this.arrowKeyHandler(e,!0);break;case 13:this.enterKeyHandler(e);break;case 8:this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();break;case 32:!(0,t.isNullOrUndefined)(this.targetElement)&&this.targetElement.classList.contains("e-focused")||this.spaceKeyHandler(e)}},l.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&e.velocity>.5&&"touchend"===e.originalEvent.type&&(this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back())},l.prototype.focusout=function(){if(Object.keys(this.dataSource).length&&this.curUL){var e=this.curUL.querySelector("."+m.focused);e&&(e.classList.remove(m.focused),this.showCheckBox||(0,t.isNullOrUndefined)(this.selectedLI)||this.selectedLI.classList.add(m.selected))}},l.prototype.wireEvents=function(){t.EventHandler.add(this.element,"keydown",this.keyActionHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"mouseout",this.leaveHandler,this),t.EventHandler.add(this.element,"focusout",this.focusout,this),this.touchModule=new t.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)}),(0,t.isNullOrUndefined)(this.scroll)||t.EventHandler.add(this.element,"scroll",this.onListScroll,this)},l.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"keydown",this.keyActionHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),t.EventHandler.remove(this.element,"focusout",this.focusout),(0,t.isNullOrUndefined)(this.scroll)||t.EventHandler.remove(this.element,"scroll",this.onListScroll),this.touchModule&&this.touchModule.destroy(),this.touchModule=null},l.prototype.removeFocus=function(){for(var e=0,t=this.element.querySelectorAll("."+m.focused);e<t.length;e++){t[e].classList.remove(m.focused)}},l.prototype.removeHover=function(){var e=this.element.querySelector("."+m.hover);e&&e.classList.remove(m.hover)},l.prototype.removeSelect=function(e){if((0,t.isNullOrUndefined)(e))for(var i=0,s=this.element.querySelectorAll("."+m.selected);i<s.length;i++){var n=s[i];this.showCheckBox&&n.querySelector("."+m.checked)||n.classList.remove(m.selected)}else e.classList.remove(m.selected)},l.prototype.isValidLI=function(e){return e&&e.classList.contains(m.listItem)&&!e.classList.contains(m.groupListItem)&&!e.classList.contains(m.disable)},l.prototype.setCheckboxLI=function(e,i){if(this.isValidLI(e)&&this.enable&&this.showCheckBox){this.curUL.querySelector("."+m.focused)&&this.curUL.querySelector("."+m.focused).classList.remove(m.focused);var s=e.querySelector("textarea")||e.querySelector("input");e.classList.add(m.focused),(0,t.isNullOrUndefined)(i)||i.target===s&&s.classList.add("e-focused");var n=e.querySelector("."+m.checkboxWrapper),l=n.querySelector("."+m.checkboxIcon+"."+m.icon);this.removeHover();var r=l.classList.contains(m.checked),a=e.classList.contains(m.focused);r?(l.classList.remove(m.checked),e.classList.remove(m.selected)):(l.classList.add(m.checked),e.classList.add(m.selected)),n.setAttribute("aria-checked",l.classList.contains(m.checked)?"true":"false");var o=this.selectEventData(e,i);(0,t.merge)(o,{isChecked:l.classList.contains(m.checked)}),this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(e,i),this.handleCheckboxState(e,l,n,r,a,o,!0,s),this.setSelectedItemData(e),this.renderSubList(e)}},l.prototype.selectEventData=function(e,i){var s,n=this.getItemData(e),l=a(n,this.listBaseOption.fields);s=!(0,t.isNullOrUndefined)(n)&&"string"==typeof this.dataSource[0]||"number"==typeof this.dataSource[0]?{item:e,text:e&&e.innerText.trim(),data:this.dataSource}:{item:e,text:l&&l[this.listBaseOption.fields.text],data:n};var r={};return(0,t.merge)(r,s),i&&(0,t.merge)(r,{isInteracted:!0,event:i,cancel:!1,index:this.curUL&&Array.prototype.indexOf.call(this.curUL.children,e)}),r},l.prototype.setSelectedItemData=function(e){var i=this.getItemData(e),s=a(i,this.listBaseOption.fields);(0,t.isNullOrUndefined)(i)||"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?this.selectedItems={item:e,text:s&&s[this.listBaseOption.fields.text],data:i}:this.selectedItems={item:e,text:e&&e.innerText.trim(),data:this.dataSource}},l.prototype.setSelectLI=function(e,t){var i=this;if(this.isValidLI(e)&&!e.classList.contains(m.selected)&&this.enable){this.showCheckBox||this.removeSelect(),e.classList.add(m.selected),this.removeHover(),this.setSelectedItemData(e),this.enableVirtualization&&this.virtualizationModule.setSelectLI(e,t);var s=this.selectEventData(e,t);this.trigger("select",s,function(t){t.cancel?(e.classList.remove(m.selected),i.selectedLI=e):(i.selectedLI=e,i.renderSubList(e))})}},l.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(m.hover)&&this.enable){var i=this.element.querySelectorAll("."+m.hover);i&&i.length&&(0,t.removeClass)(i,m.hover),e.classList.contains(m.selected)&&!this.showCheckBox||e.classList.add(m.hover)}},l.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var n=s[i],l={};l[this.fields.id]=n,this.curDSJSON=this.findItemFromDS(t,l);var r=a(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?r[this.fields.child]:t}return t}return this.localData},l.prototype.getItemData=function(e){var s,n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource,l=this.getElementUID(e);return s=(0,t.isNullOrUndefined)(this.element.querySelector("."+m.hasChild))&&this.fields.groupBy?this.curViewDS:n,this.findItemFromDS(s,l)},l.prototype.findItemFromDS=function(e,i,s){var n,l=this;return e&&e.length&&i?e.some(function(r){var o=a(r,l.listBaseOption.fields);if(!i[l.fields.id]&&!i[l.fields.text]||i[l.fields.id]&&(!(0,t.isNullOrUndefined)(o[l.fields.id])&&o[l.fields.id].toString())!==i[l.fields.id].toString()||i[l.fields.text]&&o[l.fields.text]!==i[l.fields.text])if("object"!=typeof r&&-1!==e.indexOf(r))n=s?e:r;else if(!(0,t.isNullOrUndefined)(i[l.fields.id])&&(0,t.isNullOrUndefined)(o[l.fields.id])){var c=l.element.querySelector('[data-uid="'+i[l.fields.id]+'"]');c&&c.innerText.trim()===o[l.fields.text]&&(n=r)}else Object.prototype.hasOwnProperty.call(o,l.fields.child)&&o[l.fields.child].length&&(n=l.findItemFromDS(o[l.fields.child],i,s));else n=s?e:r;return!!n}):n=e,n},l.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var n=0,l=Object.keys(this.fields.properties);n<l.length;n++){var r=l[n];"tableName"!==r&&this.fields[""+r]&&this.fields[""+r]!==e.defaultMappedFields[""+r]&&-1===t.indexOf(this.fields[""+r])&&t.push(this.fields[""+r])}s.select(t),Object.prototype.hasOwnProperty.call(this.fields.properties,"tableName")&&s.from(this.fields.tableName)}return s},l.prototype.setViewDataSource=function(i){void 0===i&&(i=this.localData);var s=(0,t.isNullOrUndefined)(this.fields.sortBy)?this.fields.text:this.fields.sortBy,n=e.addSorting(this.sortOrder,s);i&&this.fields.groupBy?"None"!==this.sortOrder?this.curViewDS=e.groupDataSource(e.getDataSource(i,n),this.listBaseOption.fields,this.sortOrder):this.curViewDS=e.groupDataSource(i,this.listBaseOption.fields,this.sortOrder):i&&"None"!==this.sortOrder?this.curViewDS=e.getDataSource(i,n):this.curViewDS=i},l.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},l.prototype.renderRemoteLists=function(e,t){this.isDestroyed||(this.localData=e.result,t.removeElement(t.contentContainer),this.renderList(),this.trigger("actionComplete",e))},l.prototype.triggerActionFailure=function(e){this.isDestroyed||this.trigger("actionFailure",e)},l.prototype.setLocalData=function(){var s=this;if(this.trigger("actionBegin"),this.dataSource instanceof i.DataManager)this.dataSource.ready?this.dataSource.ready.then(function(e){s.isOffline=s.dataSource.dataSource.offline,s.dataSource instanceof i.DataManager&&s.isOffline&&s.renderRemoteLists(e,s)}).catch(function(e){s.triggerActionFailure(e)}):this.dataSource.executeQuery(this.getQuery()).then(function(e){s.renderRemoteLists(e,s)}).catch(function(e){s.triggerActionFailure(e)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var n=this.element.querySelector("ul");n&&((0,t.remove)(n),this.setProperties({dataSource:e.createJsonFromElement(n)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},l.prototype.reRender=function(){this.removeElement(this.headerEle),this.removeElement(this.ulElement),this.removeElement(this.contentContainer),this.isReact&&this.clearTemplate(),-1===Object.keys(window).indexOf("ejsInterop")&&(this.element.innerHTML=""),this.headerEle=this.ulElement=this.liCollection=void 0,this.header(),this.setLocalData()},l.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},l.prototype.setAttributes=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.classList.contains("e-list-item")&&(i.setAttribute("id",this.element.id+"_"+i.getAttribute("data-uid")),i.setAttribute("tabindex","-1"))}},l.prototype.createList=function(){this.currentLiElements=[],this.isNestedList=!1,this.ulElement=this.curUL=e.createList(this.createElement,this.curViewDS,this.listBaseOption,null,this),this.liCollection=this.curUL.querySelectorAll("."+m.listItem),this.setAttributes(this.liCollection)},l.prototype.renderSubList=function(i){this.liElement=i;var s=i.getAttribute("data-uid");if(i.classList.contains(m.hasChild)&&s){var n=(0,t.closest)(i.parentNode,"."+m.parentItem),l=this.element.querySelector("[pid='"+s+"']");if(this.curDSLevel.push(s),this.setViewDataSource(this.getSubDS()),this.enableVirtualization&&this.virtualizationModule.updateDOMItemCount(),!l){var r=this.curViewDS;l=e.createListFromJson(this.createElement,r,this.listBaseOption,this.curDSLevel.length,null,this),this.isReact&&this.renderReactTemplates();var o=l.querySelectorAll("."+m.listItem);this.setAttributes(o),l.setAttribute("pID",s),l.style.display="none",this.renderIntoDom(l)}if(this.switchView(n,l),this.liCollection=this.curUL.querySelectorAll("."+m.listItem),this.selectedItems){var c=a(this.selectedItems.data,this.listBaseOption.fields);this.header(c[this.listBaseOption.fields.text],!0,"header")}this.selectedLI=void 0}},l.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},l.prototype.renderList=function(e){this.setViewDataSource(e),this.enableVirtualization?(Object.keys(this.dataSource).length&&(!this.template&&!this.groupTemplate||this.virtualizationModule.isNgTemplate()||(this.listBaseOption.itemCreated=this.virtualizationModule.createUIItem.bind(this.virtualizationModule))),this.virtualizationModule.uiVirtualization()):(this.createList(),this.contentContainer=this.createElement("div",{className:m.container}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement),this.isReact&&this.renderReactTemplates())},l.prototype.getElementUID=function(e){var t={};return e instanceof Element?t[this.fields.id]=e.getAttribute("data-uid"):t=e,t},l.prototype.render=function(){this.element.classList.add(m.root),(0,t.attributes)(this.element,{tabindex:"0"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.rippleFn=(0,t.rippleEffect)(this.element,{selector:"."+m.listItem}),this.renderComplete(),this.previousScrollTop=this.element.scrollTop},l.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.unWireEvents();var e=[m.root,m.disable,"e-rtl","e-has-header","e-lib"].concat(this.cssClass?this.cssClass.split(" ").filter(function(e){return e}):[]);(0,t.removeClass)([this.element],e),this.element.removeAttribute("role"),this.element.removeAttribute("tabindex"),this.curUL=this.ulElement=this.liCollection=this.headerEle=void 0,this.element.innerHTML="",this.contentContainer=null,this.selectedItems=null,this.selectedLI=null,this.liElement=null,this.targetElement=null,this.currentLiElements=null,this.virtualCheckBox=null,n.prototype.destroy.call(this)},l.prototype.back=function(){var e=this.curDSLevel[this.curDSLevel.length-1];if(void 0!==e&&!this.isInAnimation()){this.curDSLevel.pop(),this.setViewDataSource(this.getSubDS()),this.enableVirtualization&&this.virtualizationModule.updateDOMItemCount();var i=this.element.querySelector("[data-uid='"+e+"']"),s=this.curUL;i?i=i.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),i=this.curUL);var n=a(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(s,i,!0),this.removeFocus();var l=this.element.querySelector("[data-uid='"+e+"']");l.classList.remove(m.disable),l.classList.add(m.focused),this.showCheckBox&&l.querySelector("."+m.checkboxIcon).classList.contains(m.checked)||l.classList.remove(m.selected),this.liCollection=this.curUL.querySelectorAll("."+m.listItem),this.enableHtmlSanitizer&&this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),this.header(this.curDSLevel.length?n:this.headerTitle,!!this.curDSLevel.length,"header")}},l.prototype.selectItem=function(e){this.enableVirtualization?this.virtualizationModule.selectItem(e):this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):!0===(0,t.isNullOrUndefined)(e)?this.removeSelect():this.setSelectLI(this.getLiFromObjOrElement(e))},l.prototype.unselectItem=function(e){if((0,t.isNullOrUndefined)(e))this.removeSelect();else{var i=this.getLiFromObjOrElement(e);(0,t.isNullOrUndefined)(i)||this.removeSelect(i)}},l.prototype.getLiFromObjOrElement=function(e){var s,n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(!(0,t.isNullOrUndefined)(e))if("string"==typeof n[0]||"number"==typeof n[0])if(e instanceof Element){for(var l=e.getAttribute("data-uid").toString(),r=0;r<this.liCollection.length;r++)if(this.liCollection[parseInt(r.toString(),10)].getAttribute("data-uid").toString()===l){s=this.liCollection[parseInt(r.toString(),10)];break}}else Array.prototype.some.call(this.curUL.querySelectorAll("."+m.listItem),function(t){return t.innerText.trim()===e.toString()&&(s=t,!0)});else{var o=this.getItemData(e),c=a(o,this.listBaseOption.fields);if(o&&(s=this.element.querySelector('[data-uid="'+c[this.fields.id]+'"]'),!this.enableVirtualization&&(0,t.isNullOrUndefined)(s))){var h=this.element.querySelectorAll("."+m.listItem);for(r=0;r<h.length;r++)h[parseInt(r.toString(),10)].innerText.trim()===c[this.fields.text]&&(s=h[parseInt(r.toString(),10)])}}return s},l.prototype.selectMultipleItems=function(e){if(!(0,t.isNullOrUndefined)(e))for(var i=0;i<e.length;i++)(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)])||this.selectItem(e[parseInt(i.toString(),10)])},l.prototype.getParentId=function(){var e=[];if(this.isNestedList)for(var t=this.curDSLevel.length-1;t>=0;t--)e.push(this.curDSLevel[parseInt(t.toString(),10)]);return e},l.prototype.updateSelectedId=function(){this.selectedId=[];for(var e=this.curUL.getElementsByClassName(m.selected),i=0;i<e.length;i++){var s=this.getItemData(e[parseInt(i.toString(),10)]);!(0,t.isNullOrUndefined)(s)&&s[this.listBaseOption.fields.id]&&this.selectedId.push(s[this.listBaseOption.fields.id])}},l.prototype.getSelectedItems=function(){var e,s=!1;this.selectedId=[];var n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(this.enableVirtualization&&!s)e=this.virtualizationModule.getSelectedItems(),s=!0;else if(this.showCheckBox&&!s){var l=this.curUL.getElementsByClassName(m.selected),r=[],o=[];this.selectedId=[];for(var c=[],h=0;h<l.length;h++)if("string"==typeof n[0]||"number"==typeof n[0])r.push(l[parseInt(h.toString(),10)].innerText.trim());else{var d=this.getItemData(l[parseInt(h.toString(),10)]),u=a(d,this.listBaseOption.fields);this.isNestedList?c.push({data:d,parentId:this.getParentId()}):o.push(d),u?(r.push(u[this.listBaseOption.fields.text]),this.selectedId.push(u[this.listBaseOption.fields.id])):(r.push(void 0),this.selectedId.push(void 0))}"string"!=typeof n[0]&&"number"!=typeof n[0]||s||(e={item:l,data:n,text:r},s=!0),this.isNestedList&&!s?(e={item:l,data:c,text:r},s=!0):s||(e={item:l,data:o,text:r},s=!0)}else if(!s){var p=this.element.getElementsByClassName(m.selected)[0];u=a(this.getItemData(p),this.listBaseOption.fields);"string"!=typeof n[0]&&"number"!=typeof n[0]||s?s||((0,t.isNullOrUndefined)(u)||(0,t.isNullOrUndefined)(p)?(e=void 0,s=!0):(this.selectedId.push(u[this.listBaseOption.fields.id]),e={text:u[this.listBaseOption.fields.text],item:p,data:this.getItemData(p)},s=!0)):(e=(0,t.isNullOrUndefined)(p)?void 0:{item:p,data:n,text:p.innerText.trim()},s=!0)}return e},l.prototype.findItem=function(e){return this.getItemData(e)},l.prototype.enableItem=function(e){this.setItemState(e,!0),this.enableVirtualization&&this.virtualizationModule.enableItem(e)},l.prototype.disableItem=function(e){this.setItemState(e,!1),this.enableVirtualization&&this.virtualizationModule.disableItem(e)},l.prototype.setItemState=function(e,t){var i=this.getItemData(e),s=a(i,this.listBaseOption.fields);if(i){var n=this.element.querySelector('[data-uid="'+s[this.fields.id]+'"]');t?(n&&n.classList.remove(m.disable),delete i[this.fields.enabled]):t||(n&&n.classList.add(m.disable),i[this.fields.enabled]=!1)}},l.prototype.showItem=function(e){this.showHideItem(e,!1,""),this.enableVirtualization&&this.virtualizationModule.showItem(e)},l.prototype.hideItem=function(e){this.showHideItem(e,!0,"none"),this.enableVirtualization&&this.virtualizationModule.hideItem(e)},l.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e),n=a(s,this.listBaseOption.fields);if(s){var l=this.element.querySelector('[data-uid="'+n[this.fields.id]+'"]');l&&(l.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},l.prototype.addItem=function(e,t,s){void 0===t&&(t=void 0);var n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.addItemInternally(e,t,n,s)},l.prototype.addItemInternally=function(e,t,i,s){if(e instanceof Array)if(this.enableVirtualization)this.virtualizationModule.addItem(e,t,i,s);else{var n=this.findItemFromDS(i,t),l=void 0;if(n)(l=a(n,this.listBaseOption.fields)[this.fields.child])||(l=[]),l=l.concat(e);if(n instanceof Array){for(var r=0;r<e.length;r++){i=this.addItemAtIndex(s,i,e[parseInt(r.toString(),10)]),this.setViewDataSource(i);var o=this.contentContainer?this.contentContainer.children[0]:null;this.contentContainer&&o?this.addItemIntoDom(e[parseInt(r.toString(),10)],o,this.curViewDS):this.reRender()}this.liCollection=this.curUL.querySelectorAll("."+m.listItem)}else n&&(n[this.fields.child]=l,this.addItemInNestedList(n,e))}},l.prototype.addItemAtIndex=function(e,i,s){return!(0,t.isNullOrUndefined)(e)&&e>=0&&e<i.length&&(0,t.isNullOrUndefined)(this.listBaseOption.fields.groupBy)?i.splice(e,0,s):i.push(s),i},l.prototype.addItemInNestedList=function(i,s){var n=i[this.fields.id],l=i[this.fields.child],r=this.element.querySelector("[pid='"+n+"']"),a=this.element.querySelector("[data-uid='"+n+"']"),o=r||(a?(0,t.closest)(a,"ul"):null),c=r?l:[i];if(!!a&&!a.classList.contains(m.hasChild)){var h=e.createListItemFromJson(this.createElement,c,this.listBaseOption,null,null,this);this.setAttributes(h),o.insertBefore(h[0],a),(0,t.detach)(a)}if(r&&s)for(var d=0;d<s.length;d++)c.push(s[parseInt(d.toString(),10)]),this.addItemIntoDom(s[parseInt(d.toString(),10)],o,c)},l.prototype.addItemIntoDom=function(e,t,i){var s=i.indexOf(e);this.addListItem(e,s,t,i);var n=i[s-1];n&&n.isHeader&&1===n.items.length&&this.addListItem(n,s-1,t,i)},l.prototype.addListItem=function(t,i,s,n){var l=this.getLiFromObjOrElement(n[i+1])||this.getLiFromObjOrElement(n[i+2])||null,r=e.createListItemFromJson(this.createElement,[t],this.listBaseOption,null,null,this);if(this.setAttributes(r),this.template&&this.isReact&&this.renderReactTemplates(),this.fields.groupBy&&n[i+1]&&n[i+1].isHeader){var a=this.getLiFromObjOrElement(n[i-1]);a&&(l=a.nextElementSibling)}s.insertBefore(r[0],l)},l.prototype.removeItem=function(e){var t=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.enableVirtualization?this.virtualizationModule.removeItem(e):this.removeItemFromList(e,t)},l.prototype.removeItemFromList=function(i,s){var n=this,l=this.curViewDS,r=i instanceof Element?this.getElementUID(i):i,a=this.findItemFromDS(s,r,!0);if(a){var o=this.findItemFromDS(a,r),c=l.indexOf(o),h=this.getLiFromObjOrElement(i),d=void 0;this.validateNestedView(h),this.fields.groupBy&&this.curViewDS[c-1]&&l[c-1].isHeader&&1===l[c-1].items.length&&h&&h.previousElementSibling.classList.contains(m.groupListItem)&&((0,t.isNullOrUndefined)(h.nextElementSibling)||h.nextElementSibling&&h.nextElementSibling.classList.contains(m.groupListItem))&&(d=h.previousElementSibling),h&&(0,t.detach)(h),d&&(0,t.detach)(d);var u=a.length-1<=0?this.findParent(this.localData,this.fields.id,function(e){return e===o[n.fields.id]},null):null,p=a.indexOf(o);if(a.splice(p,1),this.setViewDataSource(s),u&&u.parent&&Array.isArray(u.parent[this.fields.child])&&u.parent[this.fields.child].length<=0){var f=this.getLiFromObjOrElement(u.parent);if(f){var I=e.createListItemFromJson(this.createElement,[u.parent],this.listBaseOption,null,null,this);this.setAttributes(I),f.parentElement.insertBefore(I[0],f),f.parentElement.removeChild(f)}}a.length<=0&&this.back(),this.liCollection=Array.prototype.slice.call(this.element.querySelectorAll("."+m.listItem))}},l.prototype.validateNestedView=function(e){var t=e?e.getAttribute("data-uid").toString().toLowerCase():null;if(t&&this.curDSLevel&&this.curDSLevel.length>0)for(;this.curDSLevel.some(function(e){return e.toString().toLowerCase()===t});)this.back()},l.prototype.removeMultipleItems=function(e){if(e.length)for(var t=0;t<e.length;t++)this.removeItem(e[parseInt(t.toString(),10)])},l.prototype.findParent=function(e,i,s,n){if(Object.prototype.hasOwnProperty.call(e,i)&&!0===s(e[i]))return(0,t.extend)({},e);for(var l=0;l<Object.keys(e).length;l++)if(e[Object.keys(e)[parseInt(l.toString(),10)]]&&"object"==typeof e[Object.keys(e)[parseInt(l.toString(),10)]]){var r=this.findParent(e[Object.keys(e)[parseInt(l.toString(),10)]],i,s,e);if(null!=r)return r.parent||(r.parent=n),r}return null},l.prototype.getModuleName=function(){return"listview"},l.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"virtualization",name:"Virtualization"}),e},l.prototype.onListScroll=function(e){var t={originalEvent:e,scrollDirection:"Bottom",distanceY:this.element.scrollHeight-this.element.scrollTop},i=this.element.scrollTop;i>this.previousScrollTop?(t.scrollDirection="Bottom",t.distanceY=this.element.scrollHeight-this.element.clientHeight-this.element.scrollTop,this.trigger("scroll",t)):this.previousScrollTop>i&&(t.scrollDirection="Top",t.distanceY=this.element.scrollTop,this.trigger("scroll",t)),this.previousScrollTop=i},l.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition","selectedId"])},d([(0,t.Property)("")],l.prototype,"cssClass",void 0),d([(0,t.Property)(!1)],l.prototype,"enableVirtualization",void 0),d([(0,t.Property)({})],l.prototype,"htmlAttributes",void 0),d([(0,t.Property)(!0)],l.prototype,"enable",void 0),d([(0,t.Property)([])],l.prototype,"dataSource",void 0),d([(0,t.Property)()],l.prototype,"query",void 0),d([(0,t.Complex)(e.defaultMappedFields,g)],l.prototype,"fields",void 0),d([(0,t.Property)({effect:"SlideLeft",duration:400,easing:"ease"})],l.prototype,"animation",void 0),d([(0,t.Property)("None")],l.prototype,"sortOrder",void 0),d([(0,t.Property)(!1)],l.prototype,"showIcon",void 0),d([(0,t.Property)(!1)],l.prototype,"showCheckBox",void 0),d([(0,t.Property)("Left")],l.prototype,"checkBoxPosition",void 0),d([(0,t.Property)("")],l.prototype,"headerTitle",void 0),d([(0,t.Property)(!1)],l.prototype,"showHeader",void 0),d([(0,t.Property)(!0)],l.prototype,"enableHtmlSanitizer",void 0),d([(0,t.Property)("")],l.prototype,"height",void 0),d([(0,t.Property)("")],l.prototype,"width",void 0),d([(0,t.Property)(null)],l.prototype,"template",void 0),d([(0,t.Property)(null)],l.prototype,"headerTemplate",void 0),d([(0,t.Property)(null)],l.prototype,"groupTemplate",void 0),d([(0,t.Event)()],l.prototype,"select",void 0),d([(0,t.Event)()],l.prototype,"actionBegin",void 0),d([(0,t.Event)()],l.prototype,"actionComplete",void 0),d([(0,t.Event)()],l.prototype,"actionFailure",void 0),d([(0,t.Event)()],l.prototype,"scroll",void 0),l=d([t.NotifyPropertyChanges],l)}(t.Component),y=function(){function s(e){this.elementDifference=0,this.listViewInstance=e}return s.prototype.isNgTemplate=function(){return!(0,t.isNullOrUndefined)(this.listViewInstance.templateRef)&&"string"!=typeof this.listViewInstance.templateRef},s.prototype.isVueFunctionTemplate=function(){return this.listViewInstance.isVue&&"function"==typeof this.listViewInstance.template},s.prototype.uiVirtualization=function(){this.wireScrollEvent(!1);var i=this.listViewInstance.curViewDS,s=this.listViewInstance.isRendered,n=s&&!(0,t.isNullOrUndefined)(this.uiFirstIndex)&&this.uiLastIndex<=Object.keys(i).length?this.uiFirstIndex:0,l=i.slice(n,n+1);this.listViewInstance.ulElement=this.listViewInstance.curUL=e.createList(this.listViewInstance.createElement,l,this.listViewInstance.listBaseOption,null,this.listViewInstance),this.listViewInstance.contentContainer=this.listViewInstance.createElement("div",{className:m.container}),this.listViewInstance.element.appendChild(this.listViewInstance.contentContainer),this.listViewInstance.contentContainer.appendChild(this.listViewInstance.ulElement),this.listItemHeight=this.listViewInstance.ulElement.firstElementChild.getBoundingClientRect().height,this.expectedDomItemCount=this.ValidateItemCount(1e4),this.updateDOMItemCount();var r=s&&!(0,t.isNullOrUndefined)(this.uiLastIndex)&&0!==this.listDiff?this.uiLastIndex:this.domItemCount-1;this.uiFirstIndex=n,this.uiLastIndex=r;var a=i.slice(n+1,r+1),o=e.createListItemFromJson(this.listViewInstance.createElement,a,this.listViewInstance.listBaseOption,null,null,this.listViewInstance);(0,t.append)(o,this.listViewInstance.ulElement),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li"),this.topElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.topElement,this.listViewInstance.ulElement.firstElementChild),this.bottomElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.bottomElement,null),this.totalHeight=Object.keys(i).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.topElement.style.height=s?this.topElementHeight+"px":"0px",this.bottomElement.style.height=s?this.totalHeight-this.topElementHeight+"px":this.totalHeight+"px",this.topElementHeight=s?this.topElementHeight:0,this.bottomElementHeight=s?this.totalHeight-this.topElementHeight:this.totalHeight,this.listDiff=s&&Object.keys(i).length!==this.domItemCount?this.listDiff:0,s&&(this.listViewInstance.element.scrollTop=this.listViewInstance.previousScrollTop),this.uiIndicesInitialization()},s.prototype.wireScrollEvent=function(e){e?!0===this.listViewInstance.isWindow?(window.removeEventListener("scroll",this.onVirtualScroll),window.removeEventListener("scroll",this.updateUl)):t.EventHandler.remove(this.listViewInstance.element,"scroll",this.onVirtualUiScroll):this.listViewInstance.isWindow?(this.onVirtualScroll=this.onVirtualUiScroll.bind(this),window.addEventListener("scroll",this.onVirtualScroll)):t.EventHandler.add(this.listViewInstance.element,"scroll",this.onVirtualUiScroll,this)},s.prototype.ValidateItemCount=function(e){var i,s=parseFloat((0,t.formatUnit)(this.listViewInstance.height));return(i=this.listViewInstance.isWindow?Math.round(window.innerHeight/this.listItemHeight*3):"string"==typeof this.listViewInstance.height&&-1!==this.listViewInstance.height.indexOf("%")?Math.round(this.listViewInstance.element.getBoundingClientRect().height/this.listItemHeight*1.5):Math.round(s/this.listItemHeight*1.5))>e&&(i=e),i},s.prototype.updateDOMItemCount=function(){this.domItemCount=this.ValidateItemCount(Object.keys(this.listViewInstance.curViewDS).length)},s.prototype.uiIndicesInitialization=function(){this.uiIndices={activeIndices:[],disabledItemIndices:[],hiddenItemIndices:[]};for(var e=this.listViewInstance.curViewDS,i=0;i<e.length;i++)this.listViewInstance.showCheckBox&&e[i][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(i),(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][this.listViewInstance.fields.enabled])||e[i][this.listViewInstance.fields.enabled]||this.uiIndices.disabledItemIndices.push(i);if(this.isNgTemplate())for(var s=this.listViewInstance.element.querySelectorAll("."+m.listItem),n=0;n<s.length;n++)s[n].context=this.listViewInstance.viewContainerRef.get(n).context},s.prototype.refreshItemHeight=function(){if(this.listViewInstance.curViewDS.length){var e=this.listViewInstance.curViewDS;this.listItemHeight=this.topElement.nextSibling.getBoundingClientRect().height,this.totalHeight=Object.keys(e).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.bottomElementHeight=this.totalHeight,this.bottomElement.style.height=this.totalHeight+"px"}},s.prototype.getscrollerHeight=function(e){return this.listViewInstance.isWindow?pageYOffset-e<=0?0:pageYOffset-e:this.listViewInstance.element.scrollTop-e<=0?0:this.listViewInstance.element.scrollTop-e},s.prototype.onVirtualUiScroll=function(){var e,i,s=this.listViewInstance.curViewDS;this.listItemHeight=(0,t.select)(".e-list-item",this.listViewInstance.element).getBoundingClientRect().height,this.totalHeight=Object.keys(s).length*this.listItemHeight-this.domItemCount*this.listItemHeight,i=this.listViewInstance.isWindow?this.listViewInstance.ulElement.getBoundingClientRect().top-document.documentElement.getBoundingClientRect().top:this.listViewInstance.headerEle?this.listViewInstance.headerEle.getBoundingClientRect().height:0,this.scrollPosition=(0,t.isNullOrUndefined)(this.scrollPosition)?0:this.scrollPosition;var n,l=this.getscrollerHeight(i);(this.topElementHeight=this.listItemHeight*Math.floor(l/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,e=l<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=e[0],this.bottomElementHeight=e[1],this.topElementHeight!==parseFloat(this.topElement.style.height))&&(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",l>this.scrollPosition?(n=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff))>this.expectedDomItemCount+5?this.onLongScroll(n,!0):this.onNormalScroll(n,!0):(n=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight))>this.expectedDomItemCount+5?this.onLongScroll(n,!1):this.onNormalScroll(n,!1));this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),"function"==typeof this.listViewInstance.onUIScrolled&&this.listViewInstance.onUIScrolled(),this.scrollPosition=l},s.prototype.onLongScroll=function(e,t){for(var i=t?this.uiFirstIndex+e:this.uiFirstIndex-e,s=this.listViewInstance.ulElement.querySelectorAll("li"),n=0;n<s.length;n++)this.updateUI(s[n],i),i++;this.uiLastIndex=t?this.uiLastIndex+e:this.uiLastIndex-e,this.uiFirstIndex=t?this.uiFirstIndex+e:this.uiFirstIndex-e},s.prototype.onNormalScroll=function(e,t){if(t)for(var i=0;i<e;i++){var s=++this.uiLastIndex;this.updateUI(this.topElement.nextElementSibling,s,this.bottomElement),this.uiFirstIndex++}else for(i=0;i<e;i++){s=--this.uiFirstIndex;var n=this.topElement.nextSibling;this.updateUI(this.bottomElement.previousElementSibling,s,n),this.uiLastIndex--}},s.prototype.updateUiContent=function(i,s){var n=this.listViewInstance.curViewDS;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]?(i.dataset.uid=e.generateId(),i.getElementsByClassName(m.listItemText)[0].innerHTML=this.listViewInstance.curViewDS[s].toString()):(i.dataset.uid=n[parseInt(s.toString(),10)][this.listViewInstance.fields.id]?n[parseInt(s.toString(),10)][this.listViewInstance.fields.id]:e.generateId(),i.getElementsByClassName(m.listItemText)[0].innerHTML=n[parseInt(s.toString(),10)][this.listViewInstance.fields.text]),this.listViewInstance.showIcon&&(i.querySelector("."+m.listIcon)&&(0,t.detach)(i.querySelector("."+m.listIcon)),this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss])){var l=i.querySelector("."+m.textContent),r=this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss].toString(),a=this.listViewInstance.createElement("div",{className:m.listIcon+" "+r});l.insertBefore(a,i.querySelector("."+m.listItemText))}if(this.listViewInstance.showCheckBox&&this.listViewInstance.fields.groupBy){this.checkListWrapper||(this.checkListWrapper=this.listViewInstance.curUL.querySelector("."+m.checkboxWrapper).cloneNode(!0));l=i.querySelector("."+m.textContent);this.listViewInstance.curViewDS[s].isHeader?i.querySelector("."+m.checkboxWrapper)&&(i.classList.remove(m.checklist),l.classList.remove(m.checkbox),(0,t.detach)(i.querySelector("."+m.checkboxWrapper))):i.querySelector("."+m.checkboxWrapper)||(i.classList.add(m.checklist),l.classList.add(m.checkbox),"Left"===this.listViewInstance.checkBoxPosition?l.classList.add("e-checkbox-left"):l.classList.add("e-checkbox-right"),l.append(this.checkListWrapper.cloneNode(!0)))}},s.prototype.changeElementAttributes=function(e,i){if(e.classList.remove(m.disable),this.uiIndices.disabledItemIndices.length&&-1!==this.uiIndices.disabledItemIndices.indexOf(i)&&e.classList.add(m.disable),e.style.display="",this.uiIndices.hiddenItemIndices.length&&-1!==this.uiIndices.hiddenItemIndices.indexOf(i)&&(e.style.display="none"),this.listViewInstance.showCheckBox){var s=e.querySelector("."+m.checkboxWrapper);e.classList.remove(m.selected),e.classList.remove(m.focused),s&&(s.removeAttribute("aria-checked"),s.firstElementChild.classList.remove(m.checked)),this.uiIndices.activeIndices.length&&-1!==this.uiIndices.activeIndices.indexOf(i)&&!this.listViewInstance.curUL.querySelector(m.selected)&&(e.classList.add(m.selected),s.firstElementChild.classList.add(m.checked),s.setAttribute("aria-checked","true"),this.activeIndex===i&&e.classList.add(m.focused))}else e.classList.remove(m.selected),e.removeAttribute("aria-selected"),(0,t.isNullOrUndefined)(this.activeIndex)||this.activeIndex!==i||this.listViewInstance.curUL.querySelector(m.selected)||(e.classList.add(m.selected),e.setAttribute("aria-selected","true"));this.listViewInstance.fields.groupBy&&(this.listViewInstance.curViewDS[i].isHeader?e.classList.contains(m.listItem)&&(e.classList.remove(m.listItem),e.setAttribute("role","group"),e.classList.add(m.groupListItem)):e.classList.contains(m.groupListItem)&&(e.classList.remove(m.groupListItem),e.setAttribute("role","listitem"),e.classList.add(m.listItem)))},s.prototype.findDSAndIndexFromId=function(e,i){var s=this,n={};return i=this.listViewInstance.getElementUID(i),(0,t.isNullOrUndefined)(i)||e.some(function(e,t){return!!(i[s.listViewInstance.fields.id]&&i[s.listViewInstance.fields.id]===(e[s.listViewInstance.fields.id]&&e[s.listViewInstance.fields.id])||i===e)&&(n.index=t,n.data=e,!0)}),n},s.prototype.getSelectedItems=function(){var e=this;if(!(0,t.isNullOrUndefined)(this.activeIndex)||this.listViewInstance.showCheckBox&&this.uiIndices.activeIndices.length){var s=[],n=[];if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]){var l=this.listViewInstance.curViewDS;if(this.listViewInstance.showCheckBox){for(var r=this.uiIndices.activeIndices,a=0;a<r.length;a++)s.push(l[r[a]]);return{text:s,data:s,index:this.uiIndices.activeIndices.map(function(t){return e.listViewInstance.dataSource.indexOf(l[t])})}}return{text:l[this.activeIndex],data:l[this.activeIndex],index:this.listViewInstance.dataSource.indexOf(l[this.activeIndex])}}var o=this.listViewInstance.curViewDS,c=this.listViewInstance.fields.text;if(this.listViewInstance.showCheckBox){var h=this.uiIndices.activeIndices;for(a=0;a<h.length;a++)n.push(o[h[a]][""+c]),s.push(o[h[parseInt(a.toString(),10)]]);var d=this.listViewInstance.dataSource instanceof i.DataManager?o:this.listViewInstance.dataSource;return{text:n,data:s,index:this.uiIndices.activeIndices.map(function(e){return d.indexOf(o[e])})}}var u=this.listViewInstance.dataSource instanceof i.DataManager?o:this.listViewInstance.dataSource;return{text:o[this.activeIndex][this.listViewInstance.fields.text],data:o[this.activeIndex],index:u.indexOf(o[this.activeIndex])}}},s.prototype.selectItem=function(e){var i=this,s=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(Object.keys(s).length){var n,l=this.activeIndex===s.index;if(this.activeIndex=s.index,this.listViewInstance.showCheckBox&&(-1===this.uiIndices.activeIndices.indexOf(s.index)?(n=!0,this.uiIndices.activeIndices.push(s.index)):(n=!1,this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(s.index),1)),this.listViewInstance.curUL.querySelector("."+m.focused)&&this.listViewInstance.curUL.querySelector("."+m.focused).classList.remove(m.focused)),this.listViewInstance.getLiFromObjOrElement(e))this.listViewInstance.showCheckBox?this.listViewInstance.setCheckboxLI(this.listViewInstance.getLiFromObjOrElement(e)):this.listViewInstance.setSelectLI(this.listViewInstance.getLiFromObjOrElement(e));else{var r;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0])r={text:this.listViewInstance.curViewDS[this.activeIndex],data:this.listViewInstance.curViewDS[this.activeIndex],index:this.activeIndex};else{var a=this.listViewInstance.curViewDS;r={text:a[this.activeIndex][this.listViewInstance.fields.text],data:a[this.activeIndex],index:this.activeIndex}}this.listViewInstance.showCheckBox?this.listViewInstance.trigger("select",r,function(e){e.cancel&&(n?(r.isChecked=!n,i.uiIndices.activeIndices.splice(i.uiIndices.activeIndices.indexOf(s.index),1)):(r.isChecked=n,i.uiIndices.activeIndices.push(s.index)))}):l||(this.listViewInstance.removeSelect(),this.listViewInstance.trigger("select",r,function(e){e.cancel&&(i.activeIndex=void 0)}))}}else(0,t.isNullOrUndefined)(e)&&!this.listViewInstance.showCheckBox&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0)},s.prototype.enableItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(t.index),1)},s.prototype.disableItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&-1===this.uiIndices.disabledItemIndices.indexOf(t.index)&&this.uiIndices.disabledItemIndices.push(t.index)},s.prototype.showItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(t.index),1)},s.prototype.hideItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&-1===this.uiIndices.hiddenItemIndices.indexOf(t.index)&&this.uiIndices.hiddenItemIndices.push(t.index)},s.prototype.removeItem=function(e){var t,s=this.listViewInstance.curViewDS,n=this.findDSAndIndexFromId(s,e);Object.keys(n).length&&(t=n.data,s[n.index-1]&&s[n.index-1].isHeader&&1===s[n.index-1].items.length?(this.removeUiItem(n.index-1),this.removeUiItem(n.index-1)):this.removeUiItem(n.index));var l=this.listViewInstance.dataSource instanceof i.DataManager?this.listViewInstance.localData:this.listViewInstance.dataSource,r=l.indexOf(t);-1!==r&&(l.splice(r,1),this.listViewInstance.setViewDataSource(l)),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")},s.prototype.setCheckboxLI=function(e,t){var i=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex;this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex,e.classList.contains(m.selected)?-1===this.uiIndices.activeIndices.indexOf(i)&&this.uiIndices.activeIndices.push(i):this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(i),1)},s.prototype.setSelectLI=function(e,t){this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex},s.prototype.checkedItem=function(e){if(e){this.uiIndices.activeIndices=[],this.activeIndex=void 0;for(var t=this.listViewInstance.curViewDS,i=0;i<t.length;i++)t[i].isHeader||this.uiIndices.activeIndices.push(i)}else this.activeIndex=void 0,this.uiIndices.activeIndices=[]},s.prototype.addUiItem=function(e){var t=this.listViewInstance.curViewDS;if(this.changeUiIndices(e,!0),this.activeIndex&&this.activeIndex>=e&&this.activeIndex++,this.listViewInstance.showCheckBox&&t[e][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(e),parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)||(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px"),parseFloat(this.bottomElement.style.height)){var i=this.listViewInstance.curUL.lastElementChild.previousSibling;(s=this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]))&&(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px",this.updateUI(i,e,s))}else{i=this.listViewInstance.curUL.firstElementChild.nextSibling;var s=void 0;s=Object.keys(this.listViewInstance.curViewDS).length-1===e?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]),this.topElement.style.height=parseFloat(this.topElement.style.height)+this.listItemHeight+"px",this.uiFirstIndex++,this.uiLastIndex++,s&&(this.updateUI(i,e,s),!0===this.listViewInstance.isWindow?window.scrollTo(0,pageYOffset+this.listItemHeight):this.listViewInstance.element.scrollTop+=this.listItemHeight)}this.totalHeight+=this.listItemHeight,this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.removeUiItem=function(e){this.totalHeight-=this.listItemHeight;var i=this.listViewInstance.curViewDS[e],s=this.listViewInstance.getLiFromObjOrElement(i);if(this.listViewInstance.curViewDS.splice(e,1),this.activeIndex&&this.activeIndex>=e&&this.activeIndex--,s)if(this.domItemCount>Object.keys(this.listViewInstance.curViewDS).length)(0,t.detach)(s),this.domItemCount--,this.uiLastIndex--,this.totalHeight=0;else{if(s.classList.contains(m.disable)&&(s.classList.remove(m.disable),this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(e),1)),"none"===s.style.display&&(s.style.display="",this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(e),1)),this.listViewInstance.showCheckBox&&s.classList.contains(m.selected)){this.listViewInstance.removeSelect(),this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(e),1);var n=s.querySelector("."+m.checkboxWrapper);n.removeAttribute("aria-checked"),n.firstElementChild.classList.remove(m.checked),s.classList.contains(m.focused)&&(s.classList.remove(m.focused),this.activeIndex=void 0)}else s.classList.contains(m.selected)&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0);parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)?parseFloat(this.bottomElement.style.height)?(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiLastIndex,this.bottomElement)):(this.topElement.style.height=parseFloat(this.topElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiFirstIndex-1,this.topElement.nextSibling),this.uiLastIndex--,this.uiFirstIndex--):this.updateUI(s,this.uiLastIndex,this.bottomElement)}this.changeUiIndices(e,!1),this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.changeUiIndices=function(e,t){for(var i=Object.keys(this.uiIndices),s=0;s<i.length;s++)this.uiIndices[i[s]]=this.uiIndices[i[s]].map(function(i){return i>=e?t?++i:--i:i})},s.prototype.addItem=function(e,t,i,s){for(var n=0;n<e.length;n++){var l=e[n];if(i=this.listViewInstance.addItemAtIndex(s,i,l),this.listViewInstance.setViewDataSource(i),this.domItemCount)if(this.domItemCount<this.expectedDomItemCount){if(this.listViewInstance.findItemFromDS(i,t)instanceof Array){if(this.listViewInstance.ulElement){var r=this.listViewInstance.curViewDS.indexOf(l);this.createAndInjectNewItem(l,r),(a=this.listViewInstance.curViewDS[r-1])&&a.isHeader&&1===a.items.length&&(--r,this.createAndInjectNewItem(a,r))}this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")}}else{var a,o=this.listViewInstance.curViewDS.indexOf(l);this.addUiItem(o),(a=this.listViewInstance.curViewDS[o-1])&&a.isHeader&&1===a.items.length&&this.addUiItem(o-1)}else!this.listViewInstance.template&&!this.listViewInstance.groupTemplate||this.isNgTemplate()||(this.listViewInstance.listBaseOption.template=null,this.listViewInstance.listBaseOption.groupTemplate=null,this.listViewInstance.listBaseOption.itemCreated=this.createUIItem.bind(this)),this.uiVirtualization()}},s.prototype.createAndInjectNewItem=function(t,i){var s,n=e.createListItemFromJson(this.listViewInstance.createElement,[t],this.listViewInstance.listBaseOption,null,null,this.listViewInstance);if(s=Object.keys(this.listViewInstance.curViewDS).length-1===i?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+1])||this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+2]),this.listViewInstance.fields.groupBy&&this.listViewInstance.curViewDS[i+1]&&this.listViewInstance.curViewDS[i+1].isHeader){var l=this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i-1]);l&&(s=l.nextElementSibling)}this.listViewInstance.ulElement.insertBefore(n[0],s),this.domItemCount++,this.bottomElementHeight<=0&&this.uiLastIndex++,this.refreshItemHeight()},s.prototype.createUIItem=function(e){if(!e.item.classList.contains("e-list-group-item")&&(this.templateData=e.curData.isHeader?e.curData.items[0]:e.curData,this.listViewInstance.showCheckBox&&(this.listViewInstance.renderCheckbox(e),!(0,t.isNullOrUndefined)(this.listViewInstance.virtualCheckBox)&&!(0,t.isNullOrUndefined)(this.listViewInstance.virtualCheckBox.outerHTML)))){var i=document.createElement("div"),s='<div class="e-text-content" role="presentation"> <span class="e-list-text"> ${'+this.listViewInstance.fields.text+"} </span></div>",n=(0,t.compile)(this.listViewInstance.template||s,this.listViewInstance)(this.templateData,this.listViewInstance);if(this.listViewInstance.template&&this.listViewInstance.isReact&&this.listViewInstance.renderReactTemplates(),[].slice.call(n).forEach(function(e){i.appendChild(e)}),i.children&&i.children[0]){for(i.children[0].classList.add("e-checkbox"),"Left"===this.listViewInstance.checkBoxPosition?i.children[0].classList.add("e-checkbox-left"):i.children[0].classList.add("e-checkbox-right"),"Left"===this.listViewInstance.checkBoxPosition?i.children[0].insertBefore(this.listViewInstance.virtualCheckBox,i.childNodes[0].children[0]):i.children[0].appendChild(this.listViewInstance.virtualCheckBox);e.item.lastChild;)e.item.removeChild(e.item.lastChild);[].slice.call(i.children).forEach(function(t){e.item.appendChild(t)})}}},s.prototype.reRenderUiVirtualization=function(){this.wireScrollEvent(!0),this.listViewInstance.contentContainer&&(0,t.detach)(this.listViewInstance.contentContainer),this.listViewInstance.preRender(),this.domItemCount=0,this.listViewInstance.header(),this.listViewInstance.setLocalData()},s.prototype.updateUI=function(t,i,s){var n=this.isNgTemplate()?this.onNgChange:this.onChange;if(this.listViewInstance.template||this.listViewInstance.groupTemplate){var l=this.listViewInstance.curViewDS[i];t.dataset.uid=l[this.listViewInstance.fields.id]?l[this.listViewInstance.fields.id]:e.generateId(),n(l,t,this)}else this.updateUiContent(t,i);this.changeElementAttributes(t,i),s&&this.listViewInstance.ulElement.insertBefore(t,s)},s.prototype.onChange=function(t,i,s){var n=e.createListItemFromJson(s.listViewInstance.createElement,[t],s.listViewInstance.listBaseOption,null,null,s.listViewInstance);for(s.listViewInstance.isReact&&s.listViewInstance.renderReactTemplates();i.lastChild;)i.removeChild(i.lastChild);[].slice.call(n[0].children).forEach(function(e){i.appendChild(e)})},s.prototype.onNgChange=function(e,i,s){for(var n=(0,t.compile)(s.listViewInstance.template)(e);i.lastChild;)i.removeChild(i.lastChild);i.appendChild(n[0])},s.prototype.getModuleName=function(){return"virtualization"},s.prototype.destroy=function(){this.wireScrollEvent(!0),this.topElement=null,this.bottomElement=null},s}(),b=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),S=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},w=function(e){function i(i,s){var n=e.call(this,s,i)||this;return n.getHelper=function(e){var i,s=n.getSortableElement(e.sender.target);return!!n.isValidTarget(s,n)&&(n.helper?i=n.helper({sender:s,element:e.element}):((i=s.cloneNode(!0)).style.width=s.offsetWidth+"px",i.style.height=s.offsetHeight+"px"),(0,t.addClass)([i],["e-sortableclone"]),document.body.appendChild(i),i)},n.onDrag=function(e){if(e.target){n.trigger("drag",{event:e.event,element:n.element,target:e.target});var i,s=n.getSortableInstance(e.target),l=n.getSortableElement(e.target,s);if(!(n.isValidTarget(l,s)||e.target&&"string"==typeof e.target.className&&e.target.className.indexOf("e-list-group-item")>-1)||n.curTarget===l&&(0,t.isNullOrUndefined)(s.placeHolder)||s.placeHolderElement&&s.placeHolderElement===e.target)n.curTarget!==n.target&&n.scope&&n.curTarget!==l&&!(0,t.isNullOrUndefined)(s.placeHolder)&&(n.removePlaceHolder(n.getSortableInstance(n.curTarget)),n.curTarget=n.target);else{if(e.target.classList.contains("e-list-group-item")&&(l=e.target),n.curTarget=l,n.target===l)return;var r=n.getIndex(s.placeHolderElement,s),a=n.getPlaceHolder(l,s),o=void 0;if(a){r=(0,t.isNullOrUndefined)(r)?n.getIndex(n.target):r,o=n.getIndex(l,s,e.event);var c=n.isPlaceHolderPresent(s);if(c&&r===o)return;c&&n.removePlaceHolder(s),s.placeHolderElement=a,e.target&&"string"==typeof e.target.className&&e.target.className.indexOf("e-list-group-item")>-1?s.element.insertBefore(s.placeHolderElement,s.element.children[o]):s.element!==n.element&&o===s.element.childElementCount?s.element.appendChild(s.placeHolderElement):s.element.insertBefore(s.placeHolderElement,s.element.children[o])}else{r=(0,t.isNullOrUndefined)(r)?n.getIndex(n.target):n.getIndex(l,s)<r||!r?r:r-1,o=n.getIndex(l,s);var h=s.element!==n.element?o:r<o?o+1:o;n.updateItemClass(s),s.element.insertBefore(n.target,s.element.children[h]),n.curTarget=n.target,n.trigger("drop",{droppedElement:n.target,element:s.element,previousIndex:r,currentIndex:o,target:e.target,helper:document.getElementsByClassName("e-sortableclone")[0],event:e.event,scope:n.scope})}}if(s=n.getSortableInstance(n.curTarget),(0,t.isNullOrUndefined)(l)&&e.target!==s.placeHolderElement)n.isPlaceHolderPresent(s)&&n.removePlaceHolder(s);else[].slice.call(document.getElementsByClassName("e-sortable-placeholder")).forEach(function(e){(i=n.getSortableInstance(e)).element&&i!==s&&n.removePlaceHolder(i)})}},n.onDragStart=function(e){if(n.target=n.getSortableElement(e.target),(0,t.isNullOrUndefined)(n.target)&&(0,t.closest)(n.element,".e-listbox-container")&&t.Browser.isDevice)return(0,t.detach)(e.dragElement),void(0,t.getComponent)(n.element,"draggable").intDestroy(e.event);var i=!1;n.target.classList.add("e-grabbed"),n.curTarget=n.target,e.helper=document.getElementsByClassName("e-sortableclone")[0];var s={cancel:!1,element:n.element,target:n.target};n.trigger("beforeDragStart",s,function(t){t.cancel&&(i=t.cancel,n.onDragStop(e))}),i||(t.isBlazor?n.trigger("dragStart",{event:e.event,element:n.element,target:n.target,bindEvents:e.bindEvents,dragElement:e.dragElement}):n.trigger("dragStart",{event:e.event,element:n.element,target:n.target}))},n.onDragStop=function(e){var i,s,l,r=n.getSortableInstance(n.curTarget);i=n.getIndex(n.target);var a=n.isPlaceHolderPresent(r);if(a){var o=n.getIndex(r.placeHolderElement,r),c={previousIndex:i=n===r&&i-o>=1?i-1:i,currentIndex:o,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1,handled:!1};n.trigger("beforeDrop",c,function(t){if(!t.cancel){if(l=t.handled,n.updateItemClass(r),t.handled){var s=n.target.cloneNode(!0);n.target.classList.remove("e-grabbed"),n.target=s}r.element.insertBefore(n.target,r.placeHolderElement);var a=n.getIndex(n.target,r);t.currentIndex>t.previousIndex&&(i=n===r&&i-a>=1?i-1:i),n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:a,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope,handled:l})}n.removePlaceHolder(r)})}if(r=n.getSortableInstance(e.target),s=r.element.childElementCount,i=n.getIndex(n.target),r.element.querySelector(".e-list-nrt")&&(s-=1),n.curTarget===n.target&&e.target===n.curTarget&&(s=i),r.element===e.target||!a&&n.curTarget===n.target){var h={previousIndex:i,currentIndex:s,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1};n.trigger("beforeDrop",h,function(t){(r.element===e.target||"string"==typeof e.target.className&&e.target.className.indexOf("e-list-nrt")>-1||"string"==typeof e.target.className&&e.target.className.indexOf("e-list-nr-template")>-1||e.target.closest(".e-list-nr-template"))&&!t.cancel&&(n.updateItemClass(r),r.element.appendChild(n.target),n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:s,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope}))})}n.target.classList.remove("e-grabbed"),n.target=null,n.curTarget=null,(0,t.remove)(e.helper),(0,t.getComponent)(n.element,"draggable").intDestroy(e.event)},n.bind(),n}var s;return b(i,e),s=i,i.prototype.bind=function(){this.element.id||(this.element.id=(0,t.getUniqueID)("sortable")),this.itemClass||(this.itemClass="e-sort-item",this.dataBind()),this.initializeDraggable()},i.prototype.initializeDraggable=function(){new t.Draggable(this.element,{helper:this.getHelper,dragStart:this.onDragStart,drag:this.onDrag,dragStop:this.onDragStop,dragTarget:"."+this.itemClass,enableTapHold:!0,tapHoldThreshold:200,queryPositionInfo:this.queryPositionInfo,distance:1}),this.wireEvents()},i.prototype.wireEvents=function(){var e=this.element;t.EventHandler.add(e,"keydown",this.keyDownHandler,this)},i.prototype.unwireEvents=function(){var e=this.element;t.EventHandler.remove(e,"keydown",this.keyDownHandler)},i.prototype.keyDownHandler=function(e){if(27===e.keyCode){var i=(0,t.getComponent)(this.element,"draggable");i&&i.intDestroy(null);var s=document.getElementsByClassName("e-sortableclone")[0];s&&s.remove();var n=document.getElementsByClassName("e-sortable-placeholder")[0];n&&n.remove()}},i.prototype.getPlaceHolder=function(e,t){if(t.placeHolder){var i=t.placeHolder({element:t.element,grabbedElement:this.target,target:e});return i.classList.add("e-sortable-placeholder"),i}return null},i.prototype.isValidTarget=function(e,i){return e&&(0,t.compareElementParent)(e,i.element)&&e.classList.contains(i.itemClass)&&!e.classList.contains("e-disabled")},i.prototype.removePlaceHolder=function(e){(0,t.remove)(e.placeHolderElement),e.placeHolderElement=null},i.prototype.updateItemClass=function(e){this!==e&&(this.target.classList.remove(this.itemClass),this.target.classList.add(e.itemClass))},i.prototype.getSortableInstance=function(e){if(e=(0,t.closest)(e,".e-"+this.getModuleName())){var i=(0,t.getComponent)(e,s);return i.scope&&this.scope&&i.scope===this.scope?i:this}return this},i.prototype.getIndex=function(e,i,s){var n,l;return void 0===i&&(i=this),[].slice.call(i.element.children).forEach(function(i,r){if(i.classList.contains("e-sortable-placeholder")&&(l=!0),i!==e);else if(n=r,!(0,t.isNullOrUndefined)(s)){l&&(n-=1);var a=e.getBoundingClientRect(),o=a.bottom-(a.bottom-a.top)/2,c=s.changedTouches?s.changedTouches[0].clientY:s.clientY;n=c<=o?n:n+1}}),n},i.prototype.getSortableElement=function(e,i){return void 0===i&&(i=this),(0,t.closest)(e,"."+i.itemClass)},i.prototype.queryPositionInfo=function(e){return e.left=scrollX?parseFloat(e.left)-scrollX+"px":e.left,e.top=scrollY?parseFloat(e.top)-scrollY+"px":e.top,e},i.prototype.isPlaceHolderPresent=function(e){return e.placeHolderElement&&!!(0,t.closest)(e.placeHolderElement,"#"+e.element.id)},i.prototype.moveTo=function(e,t,i){x(this.element,e,t,i)},i.prototype.destroy=function(){this.unwireEvents(),"e-sort-item"===this.itemClass&&(this.itemClass=null,this.dataBind()),(0,t.getComponent)(this.element,t.Draggable).destroy(),e.prototype.destroy.call(this)},i.prototype.getModuleName=function(){return"sortable"},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){if("itemClass"===s[i])[].slice.call(this.element.children).forEach(function(i){i.classList.contains(t.itemClass)&&i.classList.remove(t.itemClass),e.itemClass&&i.classList.add(e.itemClass)})}},S([(0,t.Property)(!1)],i.prototype,"enableAnimation",void 0),S([(0,t.Property)(null)],i.prototype,"itemClass",void 0),S([(0,t.Property)(null)],i.prototype,"scope",void 0),S([(0,t.Property)()],i.prototype,"helper",void 0),S([(0,t.Property)()],i.prototype,"placeHolder",void 0),S([(0,t.Event)()],i.prototype,"drag",void 0),S([(0,t.Event)()],i.prototype,"beforeDragStart",void 0),S([(0,t.Event)()],i.prototype,"dragStart",void 0),S([(0,t.Event)()],i.prototype,"beforeDrop",void 0),S([(0,t.Event)()],i.prototype,"drop",void 0),i=s=S([t.NotifyPropertyChanges],i)}(t.Base);function x(e,i,s,n){var l=[];if(i||(i=e),s&&s.length?s.forEach(function(t){l.push(e.children[t])}):l=[].slice.call(e.children),(0,t.isNullOrUndefined)(n))l.forEach(function(e){i.appendChild(e)});else{var r=i.children[n];l.forEach(function(e){i.insertBefore(e,r)})}}})(),r})());
|