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