@syncfusion/ej2-lists 25.2.3 → 26.1.35

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.
Files changed (105) hide show
  1. package/.eslintrc.json +3 -2
  2. package/dist/ej2-lists.min.js +2 -2
  3. package/dist/ej2-lists.umd.min.js +2 -2
  4. package/dist/ej2-lists.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-lists.es2015.js +255 -279
  6. package/dist/es6/ej2-lists.es2015.js.map +1 -1
  7. package/dist/es6/ej2-lists.es5.js +241 -265
  8. package/dist/es6/ej2-lists.es5.js.map +1 -1
  9. package/dist/global/ej2-lists.min.js +2 -2
  10. package/dist/global/ej2-lists.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +10 -10
  13. package/src/common/list-base.d.ts +61 -30
  14. package/src/common/list-base.js +167 -94
  15. package/src/list-view/list-view.d.ts +7 -9
  16. package/src/list-view/list-view.js +42 -75
  17. package/src/list-view/virtualization.d.ts +0 -1
  18. package/src/list-view/virtualization.js +10 -66
  19. package/src/sortable/sortable.d.ts +5 -0
  20. package/src/sortable/sortable.js +14 -7
  21. package/styles/bootstrap-dark.css +100 -122
  22. package/styles/bootstrap-dark.scss +8 -2
  23. package/styles/bootstrap.css +100 -122
  24. package/styles/bootstrap.scss +8 -2
  25. package/styles/bootstrap4.css +139 -161
  26. package/styles/bootstrap4.scss +8 -2
  27. package/styles/bootstrap5-dark.css +101 -125
  28. package/styles/bootstrap5-dark.scss +8 -2
  29. package/styles/bootstrap5.css +101 -125
  30. package/styles/bootstrap5.scss +8 -2
  31. package/styles/fabric-dark.css +100 -122
  32. package/styles/fabric-dark.scss +8 -2
  33. package/styles/fabric.css +100 -122
  34. package/styles/fabric.scss +8 -2
  35. package/styles/fluent-dark.css +143 -165
  36. package/styles/fluent-dark.scss +8 -2
  37. package/styles/fluent.css +143 -165
  38. package/styles/fluent.scss +8 -2
  39. package/styles/fluent2.css +1485 -0
  40. package/styles/fluent2.scss +8 -0
  41. package/styles/highcontrast-light.css +100 -122
  42. package/styles/highcontrast-light.scss +8 -2
  43. package/styles/highcontrast.css +100 -122
  44. package/styles/highcontrast.scss +8 -2
  45. package/styles/list-view/_bootstrap4-definition.scss +5 -0
  46. package/styles/list-view/_bootstrap5.3-definition.scss +132 -0
  47. package/styles/list-view/_fluent2-definition.scss +132 -0
  48. package/styles/list-view/_layout.scss +377 -393
  49. package/styles/list-view/_material3-definition.scss +0 -7
  50. package/styles/list-view/_theme.scss +84 -95
  51. package/styles/list-view/bootstrap-dark.css +97 -121
  52. package/styles/list-view/bootstrap.css +97 -121
  53. package/styles/list-view/bootstrap4.css +136 -160
  54. package/styles/list-view/bootstrap5-dark.css +98 -124
  55. package/styles/list-view/bootstrap5.css +98 -124
  56. package/styles/list-view/fabric-dark.css +97 -121
  57. package/styles/list-view/fabric.css +97 -121
  58. package/styles/list-view/fluent-dark.css +140 -164
  59. package/styles/list-view/fluent.css +140 -164
  60. package/styles/list-view/fluent2.css +1455 -0
  61. package/styles/list-view/fluent2.scss +5 -0
  62. package/styles/list-view/highcontrast-light.css +97 -121
  63. package/styles/list-view/highcontrast.css +97 -121
  64. package/styles/list-view/icons/_bootstrap5.3.scss +8 -0
  65. package/styles/list-view/icons/_fluent2.scss +10 -0
  66. package/styles/list-view/material-dark.css +97 -121
  67. package/styles/list-view/material.css +97 -121
  68. package/styles/list-view/material3-dark.css +112 -136
  69. package/styles/list-view/material3.css +112 -136
  70. package/styles/list-view/tailwind-dark.css +207 -235
  71. package/styles/list-view/tailwind.css +207 -235
  72. package/styles/material-dark.css +100 -122
  73. package/styles/material-dark.scss +8 -2
  74. package/styles/material.css +100 -122
  75. package/styles/material.scss +8 -2
  76. package/styles/material3-dark.css +115 -137
  77. package/styles/material3-dark.scss +8 -2
  78. package/styles/material3.css +115 -137
  79. package/styles/material3.scss +8 -2
  80. package/styles/sortable/_bootstrap5.3-definition.scss +1 -0
  81. package/styles/sortable/_fluent2-definition.scss +1 -0
  82. package/styles/sortable/bootstrap-dark.css +3 -1
  83. package/styles/sortable/bootstrap.css +3 -1
  84. package/styles/sortable/bootstrap4.css +3 -1
  85. package/styles/sortable/bootstrap5-dark.css +3 -1
  86. package/styles/sortable/bootstrap5.css +3 -1
  87. package/styles/sortable/fabric-dark.css +3 -1
  88. package/styles/sortable/fabric.css +3 -1
  89. package/styles/sortable/fluent-dark.css +3 -1
  90. package/styles/sortable/fluent.css +3 -1
  91. package/styles/sortable/fluent2.css +1063 -0
  92. package/styles/sortable/fluent2.scss +3 -0
  93. package/styles/sortable/highcontrast-light.css +3 -1
  94. package/styles/sortable/highcontrast.css +3 -1
  95. package/styles/sortable/material-dark.css +3 -1
  96. package/styles/sortable/material.css +3 -1
  97. package/styles/sortable/material3-dark.css +4 -2
  98. package/styles/sortable/material3.css +4 -2
  99. package/styles/sortable/tailwind-dark.css +3 -1
  100. package/styles/sortable/tailwind.css +3 -1
  101. package/styles/tailwind-dark.css +210 -236
  102. package/styles/tailwind-dark.scss +8 -2
  103. package/styles/tailwind.css +210 -236
  104. package/styles/tailwind.scss +8 -2
  105. package/CHANGELOG.md +0 -544
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-lists.umd.min.js
3
- * version : 25.2.3
3
+ * version : 26.1.35
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !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.ej={},e.ej2Base,e.ej2Data,e.ej2Buttons)}(this,function(e,t,i,s){"use strict";function n(e,i){var s={};if(t.isNullOrUndefined(e)||"string"==typeof e||"number"==typeof e||!t.isNullOrUndefined(e.isHeader))return e;for(var n=0,l=Object.keys(i);n<l.length;n++){var r=i[""+l[n]],a=t.isNullOrUndefined(r)||"string"!=typeof r?void 0:t.getValue(r,e);t.isNullOrUndefined(a)||(s[""+r]=a)}return s}function l(e){if(e)try{return"function"!=typeof e&&document.querySelector(e)?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}}function r(e,i,s,n){var l=[];if(i||(i=e),s&&s.length?s.forEach(function(t){l.push(e.children[t])}):l=[].slice.call(e.children),t.isNullOrUndefined(n))l.forEach(function(e){i.appendChild(e)});else{var r=i.children[n];l.forEach(function(e){i.insertBefore(e,r)})}}e.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"},function(s){function r(e,t,i,s,n){return S(e,a(e,t,i,s,n),null,s)}function a(i,s,n,l,r){var a=[],o=t.extend({},L,l);e.cssClass=y(o.moduleName);for(var c=I(),h=0;h<s.length;h++)if(!t.isNullOrUndefined(s[h])){var d=void 0;if(o.itemCreating&&"function"==typeof o.itemCreating){var u={dataSource:s,curData:s[h],text:s[h],options:o};o.itemCreating(u)}if(d=n?v(i,s[h],void 0,null,null,[],null,c,h,l):w(i,s[h],void 0,null,null,l,r),o.itemCreated&&"function"==typeof o.itemCreated){u={dataSource:s,curData:s[h],text:s[h],item:d,options:o};o.itemCreated(u)}a.push(d)}return a}function o(i,l,r,a,o,h){var d=t.extend({},L,r);e.cssClass=y(d.moduleName);var u,p=!h||"listview"!==h.getModuleName()&&"multiselect"!==h.getModuleName()?t.extend({},s.defaultMappedFields,d.fields):d.fields,g=t.extend({},x,d.ariaAttributes),b=[];a&&(g.level=a);var S,C,V=[];l&&l.length&&!t.isNullOrUndefined(m(l).item)&&!m(l).item.hasOwnProperty(p.id)&&(u=I());for(var E=0;E<l.length;E++){var O=n(l[E],p);if(!t.isNullOrUndefined(l[E])){if(d.itemCreating&&"function"==typeof d.itemCreating){var k={dataSource:l,curData:l[E],text:O[p.text],options:d,fields:p};d.itemCreating(k)}var D=l[E];d.itemCreating&&"function"==typeof d.itemCreating&&(O=n(l[E],p)),O.hasOwnProperty(p.id)&&!t.isNullOrUndefined(O[p.id])&&(u=O[p.id]);var H=[];if(d.showCheckBox&&(d.itemNavigable&&(O[p.url]||O[p.urlAttributes])?b.push(i("input",{className:e.cssClass.check,attrs:{type:"checkbox"}})):H.push(i("input",{className:e.cssClass.check,attrs:{type:"checkbox"}}))),!0===o)d.showIcon&&O.hasOwnProperty(p.iconCss)&&!t.isNullOrUndefined(O[p.iconCss])&&H.push(i("span",{className:e.cssClass.icon+" "+O[p.iconCss]})),C=(S=v(i,D,O,p,d.itemClass,H,!(!D.hasOwnProperty("isHeader")||!D.isHeader),u,E,r)).querySelector("."+e.cssClass.anchorWrap),d.itemNavigable&&b.length&&t.prepend(b,S.firstElementChild);else{if((S=w(i,D,O,p,d.itemClass,r,h)).classList.add(e.cssClass.level+"-"+g.level),S.setAttribute("aria-level",g.level.toString()),"presentation"!==g.groupItemRole&&"presentation"!==g.itemRole||S.removeAttribute("aria-level"),C=S.querySelector("."+e.cssClass.anchorWrap),O.hasOwnProperty(p.tooltip)){var N=O[p.tooltip];if(r&&r.enableHtmlSanitizer)N=t.SanitizeHtmlHelper.sanitize(N);else{var B=i("span",{innerHTML:N});N=B.innerText,B=null}S.setAttribute("title",N)}if(O.hasOwnProperty(p.htmlAttributes)&&O[p.htmlAttributes]){var T=O[p.htmlAttributes];"class"in T&&"string"==typeof T.class&&""===T.class.trim()&&delete T.class,f(S,T)}if(O.hasOwnProperty(p.enabled)&&!1===O[p.enabled]&&S.classList.add(e.cssClass.disabled),O.hasOwnProperty(p.isVisible)&&!1===O[p.isVisible]&&(S.style.display="none"),O.hasOwnProperty(p.imageUrl)&&!t.isNullOrUndefined(O[p.imageUrl])&&!d.template){var U={src:O[p.imageUrl]};t.merge(U,O[p.imageAttributes]);var A=i("img",{className:e.cssClass.image,attrs:U});C?C.insertAdjacentElement("afterbegin",A):t.prepend([A],S.firstElementChild)}if(d.showIcon&&O.hasOwnProperty(p.iconCss)&&!t.isNullOrUndefined(O[p.iconCss])&&!d.template){var F=i("div",{className:e.cssClass.icon+" "+O[p.iconCss]});C?C.insertAdjacentElement("afterbegin",F):t.prepend([F],S.firstElementChild)}H.length&&t.prepend(H,S.firstElementChild),d.itemNavigable&&b.length&&t.prepend(b,S.firstElementChild),function(i,s,n,l,r,a,o){var h=s[n.child]||[],d=s[n.hasChildren];if(h.length&&(d=!0,a.classList.add(e.cssClass.hasChild),r.processSubChild)){var u=c(i,h,r,++o);a.appendChild(u)}if(r.expandCollapse&&d&&!r.template){a.firstElementChild.classList.add(e.cssClass.iconWrapper);var p="Left"===r.expandIconPosition?t.prepend:t.append;p([i("div",{className:"e-icons "+r.expandIconClass})],a.querySelector("."+e.cssClass.textContent))}}(i,O,p,0,d,S,g.level)}if(C&&t.addClass([S],[e.cssClass.navigable]),d.itemCreated&&"function"==typeof d.itemCreated){k={dataSource:l,curData:l[E],text:O[p.text],item:S,options:d,fields:p};d.itemCreated(k)}b=[],V.push(S)}}return V}function c(e,i,s,n,l,r){var a=t.extend({},L,s);return S(e,o(e,i,s,n,l,r),a.listClass,s)}function h(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function d(e,t,s){if(void 0===s&&(s=new i.Query),"Ascending"===e)s.sortBy(t,"ascending",!0);else if("Descending"===e)s.sortBy(t,"descending",!0);else for(var n=0;n<s.queries.length;n++)"onSortBy"===s.queries[n].fn&&s.queries.splice(n,1);return s}function u(e,t){return new i.DataManager(e).executeLocal(t)}function p(e,i){var n=t.extend({},L,i),l=t.extend({},s.defaultMappedFields,n.fields),r=e.cloneNode(!0),a=[];r.classList.add("json-parent");var o=r.querySelectorAll(".json-parent>li");r.classList.remove("json-parent");for(var c=0;c<o.length;c++){for(var h=o[c],d=h.querySelector("a"),u=h.querySelector("ul"),m={},f=d?d.childNodes:h.childNodes,v=Object.keys(f),y=0;y<f.length;y++)f[Number(v[y])].hasChildNodes()||(m[l.text]=f[Number(v[y])].textContent);var b=g(h);b.id?(m[l.id]=b.id,delete b.id):m[l.id]=I(),Object.keys(b).length&&(m[l.htmlAttributes]=b),d&&(b=g(d),Object.keys(b).length&&(m[l.urlAttributes]=b)),u&&(m[l.child]=p(u,i)),a.push(m)}return a}function m(e){for(var i={typeof:null,item:null},s=0;s<e.length;s++)if(!t.isNullOrUndefined(e[s]))return i={typeof:typeof e[s],item:e[s]};return i}function f(e,i){var s={};t.merge(s,i),s.class&&(t.addClass([e],s.class.split(" ")),delete s.class),t.attributes(e,s)}function g(e){for(var t={},i=e.attributes,s=0;s<i.length;s++)t[i[s].nodeName]=i[s].nodeValue;return t}function I(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function v(i,s,n,l,r,a,o,c,h,d){var u,p=t.extend({},L,d),m=t.extend({},x,p.ariaAttributes),g=s,I=s;"string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s&&(u=s,g="boolean"==typeof n[l.text]||"number"==typeof n[l.text]?n[l.text]:n[l.text]||"",I=n[l.value]);var v;v=t.isNullOrUndefined(u)||t.isNullOrUndefined(n[l.id])||""===n[l.id]?c+"-"+h:c;var y=i("li",{className:(!0===o?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(r)?"":r),id:v,attrs:""!==m.groupItemRole&&""!==m.itemRole?{role:!0===o?m.groupItemRole:m.itemRole}:{}});return u&&n.hasOwnProperty(l.enabled)&&"false"===n[l.enabled].toString()&&y.classList.add(e.cssClass.disabled),o?y.innerText=g:(y.setAttribute("data-value",t.isNullOrUndefined(I)?"null":I),y.setAttribute("role","option"),u&&n.hasOwnProperty(l.htmlAttributes)&&n[l.htmlAttributes]&&f(y,n[l.htmlAttributes]),a.length&&!p.itemNavigable&&t.append(a,y),u&&(n[l.url]||n[l.urlAttributes]&&n[l.urlAttributes].href)?y.appendChild(b(i,u,l,g,a,p.itemNavigable)):(a.length&&p.itemNavigable&&t.append(a,y),y.appendChild(document.createTextNode(g)))),y}function y(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 b(i,s,l,r,a,o){var c=n(s,l),h={href:c[l.url]};c.hasOwnProperty(l.urlAttributes)&&c[l.urlAttributes]&&(t.merge(h,c[l.urlAttributes]),h.href=c[l.url]?c[l.url]:c[l.urlAttributes].href);var d;if(o){d=i("a",{className:e.cssClass.text+" "+e.cssClass.url});var u=i("div",{className:e.cssClass.anchorWrap});a&&a.length&&t.append(a,u),u.appendChild(document.createTextNode(r)),t.append([u],d)}else d=i("a",{className:e.cssClass.text+" "+e.cssClass.url,innerHTML:r});return f(d,h),d}function w(i,s,n,r,a,o,c){var h,d,u,p=t.extend({},L,o),m=t.extend({},x,p.ariaAttributes),f=s;"string"!=typeof s&&"number"!=typeof s&&(u=s,f=n[r.text]||"",h=t.isNullOrUndefined(n._id)?n[r.id]:n._id,d=!(!s.hasOwnProperty("isHeader")||!s.isHeader)),o&&o.enableHtmlSanitizer&&(f=f);var g=i("li",{className:(!0===d?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(a)?"":a),attrs:""!==m.groupItemRole&&""!==m.itemRole?{role:!0===d?m.groupItemRole:m.itemRole}:{}});if(!0==!t.isNullOrUndefined(h)?g.setAttribute("data-uid",h):g.setAttribute("data-uid",I()),d&&o&&o.groupTemplate){var v=l(o.groupTemplate);if(c&&"listview"!==c.getModuleName()){(y=v(s,c,"groupTemplate",p.groupTemplateID,!!p.isStringTemplate,null,g))&&t.append(y,g)}else t.append(v(s,c,"groupTemplate",p.groupTemplateID,!!p.isStringTemplate),g)}else if(!d&&o&&o.template){v=l(o.template);if(c&&"listview"!==c.getModuleName()){var y;(y=v(s,c,"template",p.templateID,!!p.isStringTemplate,null,g))&&t.append(y,g)}else t.append(v(s,c,"template",p.templateID,!!p.isStringTemplate),g)}else{var w=i("div",{className:e.cssClass.textContent,attrs:""!==m.wrapperRole?{role:m.wrapperRole}:{}});if(u&&(n[r.url]||n[r.urlAttributes]&&n[r.urlAttributes].href))w.appendChild(b(i,u,r,f,null,p.itemNavigable));else{var S=i("span",{className:e.cssClass.text,attrs:""!==m.itemText?{role:m.itemText}:{}});o&&o.enableHtmlSanitizer?S.innerText=t.SanitizeHtmlHelper.sanitize(f):S.innerHTML=f,w.appendChild(S)}g.appendChild(w)}return g}function S(i,s,n,l){var r=t.extend({},L,l),a=t.extend({},x,r.ariaAttributes);e.cssClass=y(r.moduleName);var o=i("ul",{className:e.cssClass.ul+" "+(t.isNullOrUndefined(n)?"":n),attrs:""!==a.listRole?{role:a.listRole}:{}});return t.append(s,o),o}s.defaultMappedFields={id:"id",text:"text",url:"url",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",selected:"selected",iconCss:"iconCss",child:"child",isVisible:"isVisible",hasChildren:"hasChildren",tooltip:"tooltip",htmlAttributes:"htmlAttributes",urlAttributes:"urlAttributes",imageAttributes:"imageAttributes",imageUrl:"imageUrl",groupBy:null,sortBy:null};var x={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},L={showCheckBox:!1,showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:s.defaultMappedFields,ariaAttributes:x,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,headerTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right",itemNavigable:!1};s.createList=function(e,i,s,n,l){var a=t.extend({},L,s),o=t.extend({},x,a.ariaAttributes),h=m(i).typeof;return"string"===h||"number"===h?r(e,i,n,s,l):c(e,i,s,o.level,n,l)},s.createListFromArray=r,s.createListItemFromArray=a,s.createListItemFromJson=o,s.createListFromJson=c,s.getSiblingLI=function(i,s,n){if(e.cssClass=y(L.moduleName),i&&i.length){var l,r,a=Array.prototype.slice.call(i);for(l=a[(r=s?h(s,a):!0===n?a.length:-1)+(!0===n?-1:1)];l&&(!t.isVisible(l)||l.classList.contains(e.cssClass.disabled));)l=a[r+=!0===n?-1:1];return l}},s.indexOf=h,s.groupDataSource=function(e,n,l){void 0===l&&(l="None");var r=t.extend({},s.defaultMappedFields,n),a=(new i.Query).group(r.groupBy),o=u(e,a=d(l,"key",a));e=[];for(var c=0;c<o.length;c++){var h=o[c].items,p={};p[r.text]=o[c].key,p.isHeader=!0;var m=r.text;"id"===m&&(p[m="text"]=o[c].key),p._id="group-list-item-"+(o[c].key?o[c].key.toString().trim():"undefined"),p.items=h,e.push(p);for(var f=0;f<h.length;f++)e.push(h[f])}return e},s.addSorting=d,s.getDataSource=u,s.createJsonFromElement=p,s.renderContentTemplate=function(i,r,a,o,c,h){e.cssClass=y(L.moduleName);for(var d,u=i("ul",{className:e.cssClass.ul,attrs:{role:"presentation"}}),p=t.extend({},L,c),m=t.extend({},s.defaultMappedFields,o),f=l(r),g=[],v=I(),b=0;b<a.length;b++){var w=n(a[b],m),S=a[b],x=S.isHeader;if(d="string"==typeof a[b]||"number"==typeof a[b]?S:w[m.value],p.itemCreating&&"function"==typeof p.itemCreating){var C={dataSource:a,curData:S,text:d,options:p,fields:m};p.itemCreating(C)}p.itemCreating&&"function"==typeof p.itemCreating&&(w=n(a[b],m),d="string"==typeof a[b]||"number"==typeof a[b]?S:w[m.value]);var V=i("li",{id:v+"-"+b,className:x?e.cssClass.group:e.cssClass.li,attrs:{role:"presentation"}});if(x)"string"==typeof a[b]||"number"==typeof a[b]?V.innerText=S:V.innerText=w[m.text];else{var E=x?p.groupTemplateID:p.templateID;if(x)h&&"listview"!==h.getModuleName()?(O=f(S,h,"headerTemplate",E,!!p.isStringTemplate,null,V))&&t.append(O,V):t.append(f(S,h,"headerTemplate",E,!!p.isStringTemplate),V);else if(h&&"listview"!==h.getModuleName()){var O;(O=f(S,h,"template",E,!!p.isStringTemplate,null,V))&&t.append(O,V)}else t.append(f(S,h,"template",E,!!p.isStringTemplate),V);V.setAttribute("data-value",t.isNullOrUndefined(d)?"null":d),V.setAttribute("role","option")}p.itemCreated&&"function"==typeof p.itemCreated&&(C={dataSource:a,curData:S,text:d,item:V,options:p,fields:m},p.itemCreated(C)),g.push(V)}return t.append(g,u),u},s.renderGroupTemplate=function(e,i,n,r,a,o){for(var c=l(e),h=t.extend({},s.defaultMappedFields,n),d=t.extend({},L,a),u=h.groupBy,p=0,m=r;p<m.length;p++){var f=m[p],g={};if(g[""+u]=f.textContent,f.innerHTML="",o&&"listview"!==o.getModuleName()){var I=c(g,o,"groupTemplate",d.groupTemplateID,!!d.isStringTemplate,null,f);I&&t.append(I,f)}else t.append(c(g,o,"groupTemplate",d.groupTemplateID,!!d.isStringTemplate),f)}return r},s.generateId=I,s.generateUL=S,s.generateIcon=function(i,s,n,l){var r=t.extend({},L,l);return e.cssClass=y(r.moduleName),("Left"===r.expandIconPosition?t.prepend:t.append)([i("div",{className:"e-icons "+r.expandIconClass+" "+(t.isNullOrUndefined(n)?"":n)})],s.querySelector("."+e.cssClass.textContent)),s}}(e.ListBase||(e.ListBase={}));var a=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),o=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},c={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},h={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},d={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"},u="GroupTemplate",p=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return a(i,e),o([t.Property("id")],i.prototype,"id",void 0),o([t.Property("text")],i.prototype,"text",void 0),o([t.Property("isChecked")],i.prototype,"isChecked",void 0),o([t.Property("isVisible")],i.prototype,"isVisible",void 0),o([t.Property("enabled")],i.prototype,"enabled",void 0),o([t.Property("iconCss")],i.prototype,"iconCss",void 0),o([t.Property("child")],i.prototype,"child",void 0),o([t.Property("tooltip")],i.prototype,"tooltip",void 0),o([t.Property("groupBy")],i.prototype,"groupBy",void 0),o([t.Property("text")],i.prototype,"sortBy",void 0),o([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),o([t.Property("tableName")],i.prototype,"tableName",void 0),i}(t.ChildProperty),m=function(l){function r(e,t){var i=l.call(this,e,t)||this;return i.previousSelectedItems=[],i.hiddenItems=[],i.enabledItems=[],i.disabledItems=[],i}return a(r,l),r.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"htmlAttributes":this.setHTMLAttribute();break;case"cssClass":this.setCSSClass(i.cssClass);break;case"enable":this.setEnable();break;case"width":case"height":this.setSize();break;case"enableRtl":this.setEnableRTL();break;case"fields":this.listBaseOption.fields=this.fields.properties,this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1,"header");break;case"query":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.reRender();break;case"showHeader":this.header(this.headerTitle,!1,"header");break;case"enableVirtualization":t.isNullOrUndefined(this.contentContainer)||t.detach(this.contentContainer),this.refresh();break;case"showCheckBox":case"checkBoxPosition":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.setCheckbox();break;case"dataSource":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())}}},r.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&t.attributes(this.element,this.htmlAttributes)},r.prototype.setCSSClass=function(e){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ").filter(function(e){return e})),e&&t.removeClass([this.element],e.split(" ").filter(function(e){return e}))},r.prototype.setSize=function(){this.element.style.height=t.formatUnit(this.height),this.element.style.width=t.formatUnit(this.width),this.isWindow=!this.element.clientHeight},r.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},r.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},r.prototype.enableElement=function(e,t){t?e.classList.remove(d.disable):e.classList.add(d.disable)},r.prototype.header=function(e,i,s){if(void 0===this.headerEle&&this.showHeader){this.headerEle=this.createElement("div",{className:d.header});var n=this.createElement("span",{className:d.headerText});this.enableHtmlSanitizer?(this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),n.innerText=this.headerTitle):n.innerHTML=this.headerTitle;var l=this.createElement("div",{className:d.text,innerHTML:n.outerHTML}),r=this.createElement("div",{className:d.icon+" "+d.backIcon+" "+d.backButton,attrs:{style:"display:none;"}});if(this.headerEle.appendChild(r),this.headerEle.appendChild(l),this.headerTemplate){var a=t.compile(this.headerTemplate),o=this.createElement("div",{className:d.headerTemplateText}),c=a({},this,s,this.LISTVIEW_HEADERTEMPLATE_ID,null,null,this.headerEle);c&&t.append(c,o),t.append([o],this.headerEle),this.isReact&&this.renderReactTemplates()}this.headerTemplate&&this.headerTitle&&l.classList.add("header"),this.element.classList.add("e-has-header"),t.prepend([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";l=this.headerEle.querySelector("."+d.headerText),r=this.headerEle.querySelector("."+d.backIcon);this.enableHtmlSanitizer&&(e=t.SanitizeHtmlHelper.sanitize(e)),l.innerHTML=e,this.headerTemplate&&i&&(l.parentElement.classList.remove("header"),this.headerEle.querySelector("."+d.headerTemplateText).classList.add("nested-header")),this.headerTemplate&&!i&&(l.parentElement.classList.add("header"),this.headerEle.querySelector("."+d.headerTemplateText).classList.remove("nested-header"),this.headerEle.querySelector("."+d.headerTemplateText).classList.add("header")),r.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},r.prototype.switchView=function(e,i,s){var n=this;if(e&&i){var l=e.style.position,r="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var a=void 0,o=this.animation.duration;if(this.animation.effect)a=this.enableRtl?h[this.animation.effect]:c[this.animation.effect];else{a=c.SlideLeft,s=this.enableRtl,o=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===s?a[0]:a[1],duration:0===o&&"Enable"===t.animationMode?400:o,timingFunction:this.animation.easing,end:function(t){e.style.display="none",n.element.style.overflow=r,e.style.position=l,e.classList.remove("e-view")}}),i.style.display="",this.aniObj.animate(i,{name:!0===s?a[2]:a[3],duration:0===o&&"Enable"===t.animationMode?400:o,timingFunction:this.animation.easing,end:function(){n.trigger("actionComplete")}}),this.curUL=i}},r.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){t.compile(this.template)}this.listBaseOption={template:this.template,headerTemplate:this.headerTemplate,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",ariaAttributes:{itemRole:"listitem",listRole:"list",itemText:"",groupItemRole:"presentation",wrapperRole:"presentation"},fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon,itemCreated:this.renderCheckbox.bind(this),templateID:this.element.id+"Template",groupTemplateID:""+this.element.id+u,enableHtmlSanitizer:this.enableHtmlSanitizer},this.initialization()},r.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+"Template",this.LISTVIEW_GROUPTEMPLATE_ID=""+this.element.id+u,this.LISTVIEW_HEADERTEMPLATE_ID=this.element.id+"HeaderTemplate",this.aniObj=new t.Animation(this.animateOptions),this.removeElement(this.curUL),this.removeElement(this.ulElement),this.removeElement(this.headerEle),this.removeElement(this.contentContainer),this.curUL=this.ulElement=this.liCollection=this.headerEle=this.contentContainer=void 0},r.prototype.renderCheckbox=function(e){var i=this;if(e.item.classList.contains(d.hasChild)&&(this.isNestedList=!0),this.showCheckBox&&e.item.classList.contains(d.listItem)){var l,r=void 0;(r=s.createCheckBox(this.createElement,!1,{checked:!1,enableRtl:this.enableRtl,cssClass:d.listviewCheckbox})).setAttribute("role","checkbox");var a=r.querySelector("."+d.checkboxIcon);if(e.item.classList.add(d.itemCheckList),e.item.firstElementChild.classList.add(d.checkbox),"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0])if(l=n(e.curData,this.listBaseOption.fields),this.enablePersistence&&!t.isNullOrUndefined(this.selectedId)){-1!==this.selectedId.findIndex(function(e){return e===l[i.listBaseOption.fields.id].toString()})&&this.checkInternally(e,r)}else l[this.listBaseOption.fields.isChecked]&&this.checkInternally(e,r);else"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]||-1===this.selectedData.indexOf(e.text)||this.checkInternally(e,r);r.setAttribute("aria-checked",a.classList.contains(d.checked)?"true":"false"),r.setAttribute("aria-label",e.text),"Left"===this.checkBoxPosition?(r.classList.add(d.checkboxLeft),e.item.firstElementChild.classList.add(d.checkboxLeft),e.item.firstElementChild.insertBefore(r,e.item.firstElementChild.childNodes[0])):(r.classList.add(d.checkboxRight),e.item.firstElementChild.classList.add(d.checkboxRight),e.item.firstElementChild.appendChild(r)),this.currentLiElements.push(e.item),"Left"===this.checkBoxPosition?this.virtualCheckBox=e.item.firstElementChild.children[0]:this.virtualCheckBox=e.item.firstElementChild.lastElementChild}},r.prototype.checkInternally=function(e,t){e.item.classList.add(d.selected),t.querySelector("."+d.checkboxIcon).classList.add(d.checked),t.setAttribute("aria-checked","true")},r.prototype.checkItem=function(e){this.toggleCheckBase(e,!0)},r.prototype.toggleCheckBase=function(e,i){if(this.showCheckBox){var s=e;if(e instanceof Object&&e.constructor!==HTMLLIElement&&(s=this.getLiFromObjOrElement(e)),!t.isNullOrUndefined(s)){var n=s.querySelector("."+d.checkboxIcon);!0===i?s.classList.add(d.selected):s.classList.remove(d.selected),!0===i?n.classList.add(d.checked):n.classList.remove(d.checked),n.parentElement.setAttribute("aria-checked",i?"true":"false")}this.setSelectedItemData(s),this.updateSelectedId()}},r.prototype.uncheckItem=function(e){this.toggleCheckBase(e,!1)},r.prototype.checkAllItems=function(){this.toggleAllCheckBase(!0)},r.prototype.uncheckAllItems=function(){this.toggleAllCheckBase(!1)},r.prototype.toggleAllCheckBase=function(e){if(this.showCheckBox){for(var t=0;t<this.liCollection.length;t++){var i=this.liCollection[t].querySelector("."+d.checkboxIcon);i&&(e?i.classList.contains(d.checked)||this.checkItem(this.liCollection[t]):i.classList.contains(d.checked)&&this.uncheckItem(this.liCollection[t]))}this.enableVirtualization&&this.virtualizationModule.checkedItem(e),this.updateSelectedId()}},r.prototype.setCheckbox=function(){if(this.showCheckBox)for(var e=Array.prototype.slice.call(this.element.querySelectorAll("."+d.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("."+d.checkboxWrapper)&&this.removeElement(s.querySelector("."+d.checkboxWrapper)),this.renderCheckbox(t),t.item.classList.contains(d.selected)&&this.checkInternally(t,t.item.querySelector("."+d.checkboxWrapper))}else{for(e=Array.prototype.slice.call(this.element.querySelectorAll("."+d.itemCheckList)),i=0;i<e.length;i++){(s=e[i]).classList.remove(d.selected),s.firstElementChild.classList.remove(d.checkbox),this.removeElement(s.querySelector("."+d.checkboxWrapper))}this.selectedItems&&this.selectedItems.item.classList.add(d.selected)}},r.prototype.refreshItemHeight=function(){this.virtualizationModule&&this.virtualizationModule.refreshItemHeight()},r.prototype.clickHandler=function(e){if(!Array.isArray(this.dataSource)||0!==this.dataSource.length){var i=e.target;this.targetElement=i;var s,n=i.classList;if(n.contains(d.backIcon)||n.contains(d.headerText))this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back();else{var l=t.closest(i.parentNode,"."+d.listItem);if(null===l&&(l=i),this.removeFocus(),this.enable&&this.showCheckBox&&this.isValidLI(l))if(e.target.classList.contains(d.checkboxIcon)){if(l.classList.add(d.focused),t.isNullOrUndefined(l.querySelector("."+d.checked))){var r={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:l};this.checkInternally(r,r.item.querySelector("."+d.checkboxWrapper))}else this.uncheckItem(l),l.classList.add(d.focused);if(this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(l,e),e){var a=this.selectEventData(l,e),o=l.querySelector("."+d.checkboxIcon);t.merge(a,{isChecked:o.classList.contains(d.checked)}),this.trigger("select",a)}}else l.classList.contains(d.hasChild)?(this.removeHover(),this.removeSelect(),this.removeSelect(l),this.setSelectLI(l,e),l.classList.remove(d.selected)):(this.setCheckboxLI(l,e),"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName||(i.classList.add("e-focused"),this.targetElement=i));else this.setSelectLI(l,e),"INPUT"!==i.nodeName&&"TEXTAREA"!==i.nodeName||(i.classList.add("e-focused"),this.targetElement=i);s=t.closest(e.target,"li"),t.isNullOrUndefined(s)||s.classList.contains("e-has-child")&&!e.target.parentElement.classList.contains("e-listview-checkbox")&&s.classList.add(d.disable)}this.updateSelectedId()}},r.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},r.prototype.hoverHandler=function(e){var i=t.closest(e.target.parentNode,"."+d.listItem);this.setHoverLI(i)},r.prototype.leaveHandler=function(e){this.removeHover()},r.prototype.homeKeyHandler=function(e,t){if(e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL){var i=this.curUL.querySelectorAll("."+d.listItem),s=this.curUL.querySelector("."+d.focused)||this.curUL.querySelector("."+d.selected);s&&(s.classList.remove(d.focused),this.showCheckBox||s.classList.remove(d.selected));var n=t?i.length-1:0;i[n].classList.contains(d.hasChild)||this.showCheckBox?i[n].classList.add(d.focused):this.setSelectLI(i[n],e),i[n]?this.element.setAttribute("aria-activedescendant",i[n].id.toString()):this.element.removeAttribute("aria-activedescendant")}},r.prototype.onArrowKeyDown=function(i,s){var n,l;return!t.isNullOrUndefined(this.curUL.querySelector("."+d.hasChild))||this.showCheckBox?(l=this.curUL.querySelector("."+d.focused)||this.curUL.querySelector("."+d.selected),n=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+d.listItem),l,s),t.isNullOrUndefined(n)||(l&&(l.classList.remove(d.focused),this.showCheckBox||l.classList.remove(d.selected)),n.classList.contains(d.hasChild)||this.showCheckBox?n.classList.add(d.focused):this.setSelectLI(n,i))):(l=this.curUL.querySelector("."+d.selected),n=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+d.listItem),l,s),this.setSelectLI(n,i)),n?this.element.setAttribute("aria-activedescendant",n.id.toString()):this.element.removeAttribute("aria-activedescendant"),n},r.prototype.arrowKeyHandler=function(e,t){var i=this;if(e.preventDefault(),Object.keys(this.dataSource).length&&this.curUL){var s=this.onArrowKeyDown(e,t),n=this.element.getBoundingClientRect().top,l=this.element.getBoundingClientRect().height,r=this.curUL.querySelector("."+d.listItem).getBoundingClientRect(),a=void 0,o=void 0;if(this.fields.groupBy&&(o=this.curUL.querySelector("."+d.groupListItem).getBoundingClientRect()),s){var c=s.getBoundingClientRect().top,h=s.getBoundingClientRect().height;if(t)(a=this.isWindow?c:c-n)<0&&(!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop+a);else{var u=this.isWindow?window.innerHeight:l;(a=this.isWindow?c+h:c-n+h)>u&&(!0===this.isWindow?window.scroll(0,pageYOffset+(a-u)):this.element.scrollTop=this.element.scrollTop+(a-u))}}else if(this.enableVirtualization&&t&&this.virtualizationModule.uiFirstIndex)this.onUIScrolled=function(){i.onArrowKeyDown(e,t),i.onUIScrolled=void 0},a=this.virtualizationModule.listItemHeight,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=this.element.scrollTop-a;else if(t)if(this.showHeader&&this.headerEle){var p=o?o.top:r.top,m=this.headerEle.getBoundingClientRect();a=m.top<0?m.height-p:0,!0===this.isWindow?window.scroll(0,pageYOffset-a):this.element.scrollTop=0}else this.fields.groupBy&&(a=this.isWindow?o.top<0?o.top:0:n-r.top+o.height,!0===this.isWindow?window.scroll(0,pageYOffset+a):this.element.scrollTop=this.element.scrollTop-a)}},r.prototype.enterKeyHandler=function(e){if(Object.keys(this.dataSource).length&&this.curUL){var i=!t.isNullOrUndefined(this.curUL.querySelector("."+d.hasChild)),s=this.curUL.querySelector("."+d.focused);i&&s&&(s.classList.remove(d.focused),this.showCheckBox&&(this.removeSelect(),this.removeSelect(s),this.removeHover()),this.setSelectLI(s,e))}},r.prototype.spaceKeyHandler=function(e){if(this.enable&&this.showCheckBox&&Object.keys(this.dataSource).length&&this.curUL){e.preventDefault();var i=this.curUL.querySelector("."+d.focused),s=void 0,n=void 0;if(!t.isNullOrUndefined(i)&&t.isNullOrUndefined(i.querySelector("."+d.checked))){var l={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:i};s=l.item.querySelector("."+d.checkboxWrapper),this.checkInternally(l,s),n=s.querySelector("."+d.checkboxIcon+"."+d.icon)}else this.uncheckItem(i);var r=this.selectEventData(i,e);t.merge(r,{isChecked:!!n&&n.classList.contains(d.checked)}),this.trigger("select",r),this.updateSelectedId()}},r.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:!t.isNullOrUndefined(this.targetElement)&&this.targetElement.classList.contains("e-focused")||this.spaceKeyHandler(e)}},r.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&e.velocity>.5&&"touchend"===e.originalEvent.type&&(this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.uncheckAllItems(),this.back())},r.prototype.focusout=function(){if(Object.keys(this.dataSource).length&&this.curUL){var e=this.curUL.querySelector("."+d.focused);e&&(e.classList.remove(d.focused),this.showCheckBox||t.isNullOrUndefined(this.selectedLI)||this.selectedLI.classList.add(d.selected))}},r.prototype.wireEvents=function(){t.EventHandler.add(this.element,"keydown",this.keyActionHandler,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"mouseout",this.leaveHandler,this),t.EventHandler.add(this.element,"focusout",this.focusout,this),this.touchModule=new t.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)}),t.isNullOrUndefined(this.scroll)||t.EventHandler.add(this.element,"scroll",this.onListScroll,this)},r.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"keydown",this.keyActionHandler),t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),t.EventHandler.remove(this.element,"focusout",this.focusout),t.isNullOrUndefined(this.scroll)||t.EventHandler.remove(this.element,"scroll",this.onListScroll),this.touchModule.destroy(),this.touchModule=null},r.prototype.removeFocus=function(){for(var e=0,t=this.element.querySelectorAll("."+d.focused);e<t.length;e++){t[e].classList.remove(d.focused)}},r.prototype.removeHover=function(){var e=this.element.querySelector("."+d.hover);e&&e.classList.remove(d.hover)},r.prototype.removeSelect=function(e){if(t.isNullOrUndefined(e))for(var i=0,s=this.element.querySelectorAll("."+d.selected);i<s.length;i++){var n=s[i];this.showCheckBox&&n.querySelector("."+d.checked)||n.classList.remove(d.selected)}else e.classList.remove(d.selected)},r.prototype.isValidLI=function(e){return e&&e.classList.contains(d.listItem)&&!e.classList.contains(d.groupListItem)&&!e.classList.contains(d.disable)},r.prototype.setCheckboxLI=function(e,i){if(this.isValidLI(e)&&this.enable&&this.showCheckBox){this.curUL.querySelector("."+d.focused)&&this.curUL.querySelector("."+d.focused).classList.remove(d.focused);var s=e.querySelector("textarea")||e.querySelector("input");e.classList.add(d.focused),t.isNullOrUndefined(i)||i.target===s&&s.classList.add("e-focused");var n=e.querySelector("."+d.checkboxWrapper),l=n.querySelector("."+d.checkboxIcon+"."+d.icon);this.removeHover(),l.classList.contains(d.checked)?(l.classList.remove(d.checked),e.classList.remove(d.selected)):(l.classList.add(d.checked),e.classList.add(d.selected)),n.setAttribute("aria-checked",l.classList.contains(d.checked)?"true":"false");var r=this.selectEventData(e,i);t.merge(r,{isChecked:l.classList.contains(d.checked)}),this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(e,i),this.trigger("select",r),this.setSelectedItemData(e),this.renderSubList(e)}},r.prototype.selectEventData=function(e,i){var s,l=this.getItemData(e),r=n(l,this.listBaseOption.fields);s=!t.isNullOrUndefined(l)&&"string"==typeof this.dataSource[0]||"number"==typeof this.dataSource[0]?{item:e,text:e&&e.innerText.trim(),data:this.dataSource}:{item:e,text:r&&r[this.listBaseOption.fields.text],data:l};var a={};return t.merge(a,s),i&&t.merge(a,{isInteracted:!0,event:i,cancel:!1,index:this.curUL&&Array.prototype.indexOf.call(this.curUL.children,e)}),a},r.prototype.setSelectedItemData=function(e){var i=this.getItemData(e),s=n(i,this.listBaseOption.fields);t.isNullOrUndefined(i)||"string"!=typeof this.dataSource[0]&&"number"!=typeof this.dataSource[0]?this.selectedItems={item:e,text:s&&s[this.listBaseOption.fields.text],data:i}:this.selectedItems={item:e,text:e&&e.innerText.trim(),data:this.dataSource}},r.prototype.setSelectLI=function(e,t){var i=this;if(this.isValidLI(e)&&!e.classList.contains(d.selected)&&this.enable){this.showCheckBox||this.removeSelect(),e.classList.add(d.selected),this.removeHover(),this.setSelectedItemData(e),this.enableVirtualization&&this.virtualizationModule.setSelectLI(e,t);var s=this.selectEventData(e,t);this.trigger("select",s,function(t){t.cancel||(i.selectedLI=e,i.renderSubList(e))})}},r.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(d.hover)&&this.enable){var i=this.element.querySelectorAll("."+d.hover);i&&i.length&&t.removeClass(i,d.hover),e.classList.contains(d.selected)&&!this.showCheckBox||e.classList.add(d.hover)}},r.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var l=s[i],r={};r[this.fields.id]=l,this.curDSJSON=this.findItemFromDS(t,r);var a=n(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?a[this.fields.child]:t}return t}return this.localData},r.prototype.getItemData=function(e){var s,n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource,l=this.getElementUID(e);return s=t.isNullOrUndefined(this.element.querySelector("."+d.hasChild))&&this.fields.groupBy?this.curViewDS:n,this.findItemFromDS(s,l)},r.prototype.findItemFromDS=function(e,i,s){var l,r=this;return e&&e.length&&i?e.some(function(a){var o=n(a,r.listBaseOption.fields);if(!i[r.fields.id]&&!i[r.fields.text]||i[r.fields.id]&&(!t.isNullOrUndefined(o[r.fields.id])&&o[r.fields.id].toString())!==i[r.fields.id].toString()||i[r.fields.text]&&o[r.fields.text]!==i[r.fields.text])if("object"!=typeof a&&-1!==e.indexOf(a))l=s?e:a;else if(!t.isNullOrUndefined(i[r.fields.id])&&t.isNullOrUndefined(o[r.fields.id])){var c=r.element.querySelector('[data-uid="'+i[r.fields.id]+'"]');c&&c.innerText.trim()===o[r.fields.text]&&(l=a)}else o.hasOwnProperty(r.fields.child)&&o[r.fields.child].length&&(l=r.findItemFromDS(o[r.fields.child],i,s));else l=s?e:a;return!!l}):l=e,l},r.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var n=0,l=Object.keys(this.fields.properties);n<l.length;n++){var r=l[n];"tableName"!==r&&this.fields[""+r]&&this.fields[""+r]!==e.ListBase.defaultMappedFields[""+r]&&-1===t.indexOf(this.fields[""+r])&&t.push(this.fields[""+r])}s.select(t),this.fields.properties.hasOwnProperty("tableName")&&s.from(this.fields.tableName)}return s},r.prototype.setViewDataSource=function(i){void 0===i&&(i=this.localData);var s=t.isNullOrUndefined(this.fields.sortBy)?this.fields.text:this.fields.sortBy,n=e.ListBase.addSorting(this.sortOrder,s);i&&this.fields.groupBy?"None"!==this.sortOrder?this.curViewDS=e.ListBase.groupDataSource(e.ListBase.getDataSource(i,n),this.listBaseOption.fields,this.sortOrder):this.curViewDS=e.ListBase.groupDataSource(i,this.listBaseOption.fields,this.sortOrder):i&&"None"!==this.sortOrder?this.curViewDS=e.ListBase.getDataSource(i,n):this.curViewDS=i},r.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},r.prototype.renderRemoteLists=function(e,t){this.isDestroyed||(this.localData=e.result,t.removeElement(t.contentContainer),this.renderList(),this.trigger("actionComplete",e))},r.prototype.triggerActionFailure=function(e){this.isDestroyed||this.trigger("actionFailure",e)},r.prototype.setLocalData=function(){var s=this;this.trigger("actionBegin");var n=this;if(this.dataSource instanceof i.DataManager)this.dataSource.ready?this.dataSource.ready.then(function(e){s.isOffline=s.dataSource.dataSource.offline,s.dataSource instanceof i.DataManager&&s.isOffline&&s.renderRemoteLists(e,n)}).catch(function(e){s.triggerActionFailure(e)}):this.dataSource.executeQuery(this.getQuery()).then(function(e){s.renderRemoteLists(e,n)}).catch(function(e){s.triggerActionFailure(e)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var l=this.element.querySelector("ul");l&&(t.remove(l),this.setProperties({dataSource:e.ListBase.createJsonFromElement(l)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},r.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()},r.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},r.prototype.setAttributes=function(e){for(var t=0;t<e.length;t++){var i=e[t];i.classList.contains("e-list-item")&&(i.setAttribute("id",this.element.id+"_"+i.getAttribute("data-uid")),i.setAttribute("tabindex","-1"))}},r.prototype.createList=function(){this.currentLiElements=[],this.isNestedList=!1,this.ulElement=this.curUL=e.ListBase.createList(this.createElement,this.curViewDS,this.listBaseOption,null,this),this.liCollection=this.curUL.querySelectorAll("."+d.listItem),this.setAttributes(this.liCollection)},r.prototype.exceptionEvent=function(e){this.trigger("actionFailure",e)},r.prototype.UpdateCurrentUL=function(){this.ulElement=this.curUL=this.element.querySelector("."+d.parentItem),this.curUL&&(this.liCollection=this.curUL.querySelectorAll("."+d.listItem))},r.prototype.renderSubList=function(i){this.liElement=i;var s=i.getAttribute("data-uid");if(i.classList.contains(d.hasChild)&&s){var l=t.closest(i.parentNode,"."+d.parentItem),r=this.element.querySelector("[pid='"+s+"']");if(this.curDSLevel.push(s),this.setViewDataSource(this.getSubDS()),!r){var a=this.curViewDS;r=e.ListBase.createListFromJson(this.createElement,a,this.listBaseOption,this.curDSLevel.length,null,this),this.isReact&&this.renderReactTemplates();var o=r.querySelectorAll("."+d.listItem);this.setAttributes(o),r.setAttribute("pID",s),r.style.display="none",this.renderIntoDom(r)}if(this.switchView(l,r),this.liCollection=this.curUL.querySelectorAll("."+d.listItem),this.selectedItems){var c=n(this.selectedItems.data,this.listBaseOption.fields);this.header(c[this.listBaseOption.fields.text],!0,"header")}this.selectedLI=void 0}},r.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},r.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:d.container}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement),this.isReact&&this.renderReactTemplates())},r.prototype.getElementUID=function(e){var t={};return e instanceof Element?t[this.fields.id]=e.getAttribute("data-uid"):t=e,t},r.prototype.render=function(){this.element.classList.add(d.root),t.attributes(this.element,{tabindex:"0"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.rippleFn=t.rippleEffect(this.element,{selector:"."+d.listItem}),this.renderComplete(),this.previousScrollTop=this.element.scrollTop},r.prototype.destroy=function(){this.isReact&&this.clearTemplate(),this.unWireEvents();var e=[d.root,d.disable,"e-rtl","e-has-header","e-lib"].concat(this.cssClass.split(" ").filter(function(e){return e}));t.removeClass([this.element],e),this.element.removeAttribute("role"),this.element.removeAttribute("tabindex"),this.curUL=this.ulElement=this.liCollection=this.headerEle=void 0,this.element.innerHTML="",this.contentContainer=null,this.selectedItems=null,this.selectedLI=null,this.liElement=null,this.targetElement=null,this.currentLiElements=null,this.virtualCheckBox=null,l.prototype.destroy.call(this)},r.prototype.back=function(){var e=this.curDSLevel[this.curDSLevel.length-1];if(void 0!==e&&!this.isInAnimation()){this.curDSLevel.pop(),this.setViewDataSource(this.getSubDS());var i=this.element.querySelector("[data-uid='"+e+"']"),s=this.curUL;i?i=i.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),i=this.curUL);var l=n(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(s,i,!0),this.removeFocus();var r=this.element.querySelector("[data-uid='"+e+"']");r.classList.remove(d.disable),r.classList.add(d.focused),this.showCheckBox&&r.querySelector("."+d.checkboxIcon).classList.contains(d.checked)||r.classList.remove(d.selected),this.liCollection=this.curUL.querySelectorAll("."+d.listItem),this.enableHtmlSanitizer&&this.setProperties({headerTitle:t.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),this.header(this.curDSLevel.length?l:this.headerTitle,!!this.curDSLevel.length,"header")}},r.prototype.selectItem=function(e){this.enableVirtualization?this.virtualizationModule.selectItem(e):this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):!0===t.isNullOrUndefined(e)?this.removeSelect():this.setSelectLI(this.getLiFromObjOrElement(e))},r.prototype.unselectItem=function(e){if(t.isNullOrUndefined(e))this.removeSelect();else{var i=this.getLiFromObjOrElement(e);t.isNullOrUndefined(i)||this.removeSelect(i)}},r.prototype.getLiFromObjOrElement=function(e){var s,l=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(!t.isNullOrUndefined(e))if("string"==typeof l[0]||"number"==typeof l[0])if(e instanceof Element){for(var r=e.getAttribute("data-uid").toString(),a=0;a<this.liCollection.length;a++)if(this.liCollection[a].getAttribute("data-uid").toString()===r){s=this.liCollection[a];break}}else Array.prototype.some.call(this.curUL.querySelectorAll("."+d.listItem),function(t){return t.innerText.trim()===e.toString()&&(s=t,!0)});else{var o=this.getItemData(e),c=n(o,this.listBaseOption.fields);if(o&&(s=this.element.querySelector('[data-uid="'+c[this.fields.id]+'"]'),!this.enableVirtualization&&t.isNullOrUndefined(s))){var h=this.element.querySelectorAll("."+d.listItem);for(a=0;a<h.length;a++)h[a].innerText.trim()===c[this.fields.text]&&(s=h[a])}}return s},r.prototype.selectMultipleItems=function(e){if(!t.isNullOrUndefined(e))for(var i=0;i<e.length;i++)t.isNullOrUndefined(e[i])||this.selectItem(e[i])},r.prototype.getParentId=function(){var e=[];if(this.isNestedList)for(var t=this.curDSLevel.length-1;t>=0;t--)e.push(this.curDSLevel[t]);return e},r.prototype.updateSelectedId=function(){this.selectedId=[];for(var e=this.curUL.getElementsByClassName(d.selected),i=0;i<e.length;i++){var s=this.getItemData(e[i]);!t.isNullOrUndefined(s)&&s[this.listBaseOption.fields.id]&&this.selectedId.push(s[this.listBaseOption.fields.id])}},r.prototype.getSelectedItems=function(){var e,s=!1;this.selectedId=[];var l=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;if(this.enableVirtualization&&!s)e=this.virtualizationModule.getSelectedItems(),s=!0;else if(this.showCheckBox&&!s){var r=this.curUL.getElementsByClassName(d.selected),a=[],o=[];this.selectedId=[];for(var c=[],h=0;h<r.length;h++)if("string"==typeof l[0]||"number"==typeof l[0])a.push(r[h].innerText.trim());else{var u=this.getItemData(r[h]),p=n(u,this.listBaseOption.fields);this.isNestedList?c.push({data:u,parentId:this.getParentId()}):o.push(u),p?(a.push(p[this.listBaseOption.fields.text]),this.selectedId.push(p[this.listBaseOption.fields.id])):(a.push(void 0),this.selectedId.push(void 0))}"string"!=typeof l[0]&&"number"!=typeof l[0]||s||(e={item:r,data:l,text:a},s=!0),this.isNestedList&&!s?(e={item:r,data:c,text:a},s=!0):s||(e={item:r,data:o,text:a},s=!0)}else if(!s){var m=this.element.getElementsByClassName(d.selected)[0];p=n(this.getItemData(m),this.listBaseOption.fields);"string"!=typeof l[0]&&"number"!=typeof l[0]||s?s||(t.isNullOrUndefined(p)||t.isNullOrUndefined(m)?(e=void 0,s=!0):(this.selectedId.push(p[this.listBaseOption.fields.id]),e={text:p[this.listBaseOption.fields.text],item:m,data:this.getItemData(m)},s=!0)):(e=t.isNullOrUndefined(m)?void 0:{item:m,data:l,text:m.innerText.trim()},s=!0)}return e},r.prototype.findItem=function(e){return this.getItemData(e)},r.prototype.enableItem=function(e){this.setItemState(e,!0),this.enableVirtualization&&this.virtualizationModule.enableItem(e)},r.prototype.disableItem=function(e){this.setItemState(e,!1),this.enableVirtualization&&this.virtualizationModule.disableItem(e)},r.prototype.setItemState=function(e,t){var i=this.getItemData(e),s=n(i,this.listBaseOption.fields);if(i){var l=this.element.querySelector('[data-uid="'+s[this.fields.id]+'"]');t?(l&&l.classList.remove(d.disable),delete i[this.fields.enabled]):t||(l&&l.classList.add(d.disable),i[this.fields.enabled]=!1)}},r.prototype.showItem=function(e){this.showHideItem(e,!1,""),this.enableVirtualization&&this.virtualizationModule.showItem(e)},r.prototype.hideItem=function(e){this.showHideItem(e,!0,"none"),this.enableVirtualization&&this.virtualizationModule.hideItem(e)},r.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e),l=n(s,this.listBaseOption.fields);if(s){var r=this.element.querySelector('[data-uid="'+l[this.fields.id]+'"]');r&&(r.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},r.prototype.addItem=function(e,t,s){void 0===t&&(t=void 0);var n=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.addItemInternally(e,t,n,s)},r.prototype.addItemInternally=function(e,t,i,s){if(e instanceof Array)if(this.enableVirtualization)this.virtualizationModule.addItem(e,t,i,s);else{var l=this.findItemFromDS(i,t),r=void 0;if(l){(r=n(l,this.listBaseOption.fields)[this.fields.child])||(r=[]),r=r.concat(e)}if(l instanceof Array){for(var a=0;a<e.length;a++){i=this.addItemAtIndex(s,i,e[a]),this.setViewDataSource(i);var o=this.contentContainer?this.contentContainer.children[0]:null;this.contentContainer&&o?this.addItemIntoDom(e[a],o,this.curViewDS):this.reRender()}this.liCollection=this.curUL.querySelectorAll("."+d.listItem)}else l&&(l[this.fields.child]=r,this.addItemInNestedList(l,e))}},r.prototype.addItemAtIndex=function(e,i,s){return!t.isNullOrUndefined(e)&&e>=0&&e<i.length&&t.isNullOrUndefined(this.listBaseOption.fields.groupBy)?i.splice(e,0,s):i.push(s),i},r.prototype.addItemInNestedList=function(i,s){var n=i[this.fields.id],l=i[this.fields.child],r=this.element.querySelector("[pid='"+n+"']"),a=this.element.querySelector("[data-uid='"+n+"']"),o=r||(a?t.closest(a,"ul"):null),c=r?l:[i];if(!!a&&!a.classList.contains(d.hasChild)){var h=e.ListBase.createListItemFromJson(this.createElement,c,this.listBaseOption,null,null,this);this.setAttributes(h),o.insertBefore(h[0],a),t.detach(a)}if(r&&s)for(var u=0;u<s.length;u++)c.push(s[u]),this.addItemIntoDom(s[u],o,c)},r.prototype.addItemIntoDom=function(e,t,i){var s=i.indexOf(e);this.addListItem(e,s,t,i);var n=i[s-1];n&&n.isHeader&&1===n.items.length&&this.addListItem(n,s-1,t,i)},r.prototype.addListItem=function(t,i,s,n){var l=this.getLiFromObjOrElement(n[i+1])||this.getLiFromObjOrElement(n[i+2])||null,r=e.ListBase.createListItemFromJson(this.createElement,[t],this.listBaseOption,null,null,this);if(this.setAttributes(r),this.template&&this.isReact&&this.renderReactTemplates(),this.fields.groupBy&&n[i+1]&&n[i+1].isHeader){var a=this.getLiFromObjOrElement(n[i-1]);a&&(l=a.nextElementSibling)}s.insertBefore(r[0],l)},r.prototype.removeItem=function(e){var t=this.dataSource instanceof i.DataManager?this.localData:this.dataSource;this.enableVirtualization?this.virtualizationModule.removeItem(e):this.removeItemFromList(e,t)},r.prototype.removeItemFromList=function(i,s){var n,l=this,r=this.curViewDS,a=i instanceof Element?this.getElementUID(i):i;if(n=this.findItemFromDS(s,a,!0)){var o;o=this.findItemFromDS(n,a);var c=r.indexOf(o),h=this.getLiFromObjOrElement(i),u=void 0;this.validateNestedView(h),this.fields.groupBy&&this.curViewDS[c-1]&&r[c-1].isHeader&&1===r[c-1].items.length&&h&&h.previousElementSibling.classList.contains(d.groupListItem)&&(t.isNullOrUndefined(h.nextElementSibling)||h.nextElementSibling&&h.nextElementSibling.classList.contains(d.groupListItem))&&(u=h.previousElementSibling),h&&t.detach(h),u&&t.detach(u);var p=n.length-1<=0?this.findParent(this.localData,this.fields.id,function(e){return e===o[l.fields.id]},null):null,m=n.indexOf(o);if(n.splice(m,1),this.setViewDataSource(s),p&&p.parent&&Array.isArray(p.parent[this.fields.child])&&p.parent[this.fields.child].length<=0){var f=this.getLiFromObjOrElement(p.parent);if(f){var g=e.ListBase.createListItemFromJson(this.createElement,[p.parent],this.listBaseOption,null,null,this);this.setAttributes(g),f.parentElement.insertBefore(g[0],f),f.parentElement.removeChild(f)}}n.length<=0&&this.back(),this.liCollection=Array.prototype.slice.call(this.element.querySelectorAll("."+d.listItem))}},r.prototype.validateNestedView=function(e){var t=e?e.getAttribute("data-uid").toString().toLowerCase():null;if(t&&this.curDSLevel&&this.curDSLevel.length>0)for(;this.curDSLevel.some(function(e){return e.toString().toLowerCase()===t});)this.back()},r.prototype.removeMultipleItems=function(e){if(e.length)for(var t=0;t<e.length;t++)this.removeItem(e[t])},r.prototype.findParent=function(e,i,s,n){if(e.hasOwnProperty(i)&&!0===s(e[i]))return t.extend({},e);for(var l=0;l<Object.keys(e).length;l++)if(e[Object.keys(e)[l]]&&"object"==typeof e[Object.keys(e)[l]]){var r=this.findParent(e[Object.keys(e)[l]],i,s,e);if(null!=r)return r.parent||(r.parent=n),r}return null},r.prototype.getModuleName=function(){return"listview"},r.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"virtualization",name:"Virtualization"}),e},r.prototype.onListScroll=function(e){var t={originalEvent:e,scrollDirection:"Bottom",distanceY:this.element.scrollHeight-this.element.scrollTop},i=this.element.scrollTop;i>this.previousScrollTop?(t.scrollDirection="Bottom",t.distanceY=this.element.scrollHeight-this.element.clientHeight-this.element.scrollTop,this.trigger("scroll",t)):this.previousScrollTop>i&&(t.scrollDirection="Top",t.distanceY=this.element.scrollTop,this.trigger("scroll",t)),this.previousScrollTop=i},r.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition","selectedId"])},o([t.Property("")],r.prototype,"cssClass",void 0),o([t.Property(!1)],r.prototype,"enableVirtualization",void 0),o([t.Property({})],r.prototype,"htmlAttributes",void 0),o([t.Property(!0)],r.prototype,"enable",void 0),o([t.Property([])],r.prototype,"dataSource",void 0),o([t.Property()],r.prototype,"query",void 0),o([t.Complex(e.ListBase.defaultMappedFields,p)],r.prototype,"fields",void 0),o([t.Property({effect:"SlideLeft",duration:400,easing:"ease"})],r.prototype,"animation",void 0),o([t.Property("None")],r.prototype,"sortOrder",void 0),o([t.Property(!1)],r.prototype,"showIcon",void 0),o([t.Property(!1)],r.prototype,"showCheckBox",void 0),o([t.Property("Left")],r.prototype,"checkBoxPosition",void 0),o([t.Property("")],r.prototype,"headerTitle",void 0),o([t.Property(!1)],r.prototype,"showHeader",void 0),o([t.Property(!0)],r.prototype,"enableHtmlSanitizer",void 0),o([t.Property("")],r.prototype,"height",void 0),o([t.Property("")],r.prototype,"width",void 0),o([t.Property(null)],r.prototype,"template",void 0),o([t.Property(null)],r.prototype,"headerTemplate",void 0),o([t.Property(null)],r.prototype,"groupTemplate",void 0),o([t.Event()],r.prototype,"select",void 0),o([t.Event()],r.prototype,"actionBegin",void 0),o([t.Event()],r.prototype,"actionComplete",void 0),o([t.Event()],r.prototype,"actionFailure",void 0),o([t.Event()],r.prototype,"scroll",void 0),r=o([t.NotifyPropertyChanges],r)}(t.Component),f=function(){function s(e){this.elementDifference=0,this.listViewInstance=e}return s.prototype.isNgTemplate=function(){return!t.isNullOrUndefined(this.listViewInstance.templateRef)&&"string"!=typeof this.listViewInstance.templateRef},s.prototype.isVueFunctionTemplate=function(){return this.listViewInstance.isVue&&"function"==typeof this.listViewInstance.template},s.prototype.uiVirtualization=function(){this.wireScrollEvent(!1);var i=this.listViewInstance.curViewDS,s=i.slice(0,1);this.listViewInstance.ulElement=this.listViewInstance.curUL=e.ListBase.createList(this.listViewInstance.createElement,s,this.listViewInstance.listBaseOption,null,this.listViewInstance),this.listViewInstance.contentContainer=this.listViewInstance.createElement("div",{className:d.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.domItemCount=this.ValidateItemCount(Object.keys(this.listViewInstance.curViewDS).length),this.uiFirstIndex=0,this.uiLastIndex=this.domItemCount-1;var n=i.slice(1,this.domItemCount),l=e.ListBase.createListItemFromJson(this.listViewInstance.createElement,n,this.listViewInstance.listBaseOption,null,null,this.listViewInstance);t.append(l,this.listViewInstance.ulElement),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li"),this.topElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.topElement,this.listViewInstance.ulElement.firstElementChild),this.bottomElement=this.listViewInstance.createElement("div"),this.listViewInstance.ulElement.insertBefore(this.bottomElement,null),this.totalHeight=Object.keys(i).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.topElement.style.height="0px",this.bottomElement.style.height=this.totalHeight+"px",this.topElementHeight=0,this.bottomElementHeight=this.totalHeight,this.listDiff=0,this.uiIndicesInitialization()},s.prototype.wireScrollEvent=function(e){e?!0===this.listViewInstance.isWindow?(window.removeEventListener("scroll",this.onVirtualScroll),window.removeEventListener("scroll",this.updateUl)):(t.EventHandler.remove(this.listViewInstance.element,"scroll",this.onVirtualUiScroll),t.EventHandler.remove(this.listViewInstance.element,"scroll",this.updateUlContainer)):this.listViewInstance.isWindow?(this.onVirtualScroll=this.onVirtualUiScroll.bind(this),window.addEventListener("scroll",this.onVirtualScroll)):t.EventHandler.add(this.listViewInstance.element,"scroll",this.onVirtualUiScroll,this)},s.prototype.updateUlContainer=function(e){var i,s=this.listViewInstance.ulElement.querySelector("."+d.virtualElementContainer);t.isNullOrUndefined(this.listViewInstance.liElementHeight)&&this.listViewInstance.updateLiElementHeight(),((i=this.listViewInstance.isWindow?Math.round(e.target.documentElement.scrollTop/this.listViewInstance.liElementHeight)-2:Math.round(e.target.scrollTop/this.listViewInstance.liElementHeight)-2)-1)*this.listViewInstance.liElementHeight<0?s.style.top="0px":s.style.top=i*this.listViewInstance.liElementHeight+"px"},s.prototype.ValidateItemCount=function(e){var i,s=parseFloat(t.formatUnit(this.listViewInstance.height));return(i=this.listViewInstance.isWindow?Math.round(window.innerHeight/this.listItemHeight*3):"string"==typeof this.listViewInstance.height&&-1!==this.listViewInstance.height.indexOf("%")?Math.round(this.listViewInstance.element.getBoundingClientRect().height/this.listItemHeight*1.5):Math.round(s/this.listItemHeight*1.5))>e&&(i=e),i},s.prototype.uiIndicesInitialization=function(){this.uiIndices={activeIndices:[],disabledItemIndices:[],hiddenItemIndices:[]};for(var e=this.listViewInstance.curViewDS,i=0;i<e.length;i++)this.listViewInstance.showCheckBox&&e[i][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(i),t.isNullOrUndefined(e[i][this.listViewInstance.fields.enabled])||e[i][this.listViewInstance.fields.enabled]||this.uiIndices.disabledItemIndices.push(i);if(this.isNgTemplate())for(var s=this.listViewInstance.element.querySelectorAll("."+d.listItem),n=0;n<s.length;n++)s[n].context=this.listViewInstance.viewContainerRef.get(n).context},s.prototype.refreshItemHeight=function(){if(this.listViewInstance.curViewDS.length){var e=this.listViewInstance.curViewDS;this.listItemHeight=this.topElement.nextSibling.getBoundingClientRect().height,this.totalHeight=Object.keys(e).length*this.listItemHeight-this.domItemCount*this.listItemHeight,this.bottomElementHeight=this.totalHeight,this.bottomElement.style.height=this.totalHeight+"px"}},s.prototype.getscrollerHeight=function(e){return this.listViewInstance.isWindow?pageYOffset-e<=0?0:pageYOffset-e:this.listViewInstance.element.scrollTop-e<=0?0:this.listViewInstance.element.scrollTop-e},s.prototype.onVirtualUiScroll=function(e){var i,s,n=this.listViewInstance.curViewDS;this.listItemHeight=t.select(".e-list-item",this.listViewInstance.element).getBoundingClientRect().height,this.totalHeight=Object.keys(n).length*this.listItemHeight-this.domItemCount*this.listItemHeight,s=this.listViewInstance.isWindow?this.listViewInstance.ulElement.getBoundingClientRect().top-document.documentElement.getBoundingClientRect().top:this.listViewInstance.headerEle?this.listViewInstance.headerEle.getBoundingClientRect().height:0,this.scrollPosition=t.isNullOrUndefined(this.scrollPosition)?0:this.scrollPosition;var l=this.getscrollerHeight(s);if(this.topElementHeight=this.listItemHeight*Math.floor(l/this.listItemHeight),this.bottomElementHeight=this.totalHeight-this.topElementHeight,i=l<=this.totalHeight?[this.topElementHeight,this.bottomElementHeight]:[this.totalHeight,0],this.topElementHeight=i[0],this.bottomElementHeight=i[1],this.topElementHeight!==parseFloat(this.topElement.style.height))if(this.topElement.style.height=this.topElementHeight+"px",this.bottomElement.style.height=this.bottomElementHeight+"px",l>this.scrollPosition){(r=Math.round(this.topElementHeight/this.listItemHeight-this.listDiff))>this.expectedDomItemCount+5?this.onLongScroll(r,!0):this.onNormalScroll(r,!0)}else{var r;(r=Math.round(this.listDiff-this.topElementHeight/this.listItemHeight))>this.expectedDomItemCount+5?this.onLongScroll(r,!1):this.onNormalScroll(r,!1)}this.listDiff=Math.round(this.topElementHeight/this.listItemHeight),"function"==typeof this.listViewInstance.onUIScrolled&&this.listViewInstance.onUIScrolled(),this.scrollPosition=l},s.prototype.onLongScroll=function(e,t){for(var i=t?this.uiFirstIndex+e:this.uiFirstIndex-e,s=this.listViewInstance.ulElement.querySelectorAll("li"),n=0;n<s.length;n++)this.updateUI(s[n],i),i++;this.uiLastIndex=t?this.uiLastIndex+e:this.uiLastIndex-e,this.uiFirstIndex=t?this.uiFirstIndex+e:this.uiFirstIndex-e},s.prototype.onNormalScroll=function(e,t){if(t)for(var i=0;i<e;i++){var s=++this.uiLastIndex;this.updateUI(this.topElement.nextElementSibling,s,this.bottomElement),this.uiFirstIndex++}else for(i=0;i<e;i++){s=--this.uiFirstIndex;var n=this.topElement.nextSibling;this.updateUI(this.bottomElement.previousElementSibling,s,n),this.uiLastIndex--}},s.prototype.updateUiContent=function(i,s){var n=this.listViewInstance.curViewDS;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]?(i.dataset.uid=e.ListBase.generateId(),i.getElementsByClassName(d.listItemText)[0].innerHTML=this.listViewInstance.curViewDS[s].toString()):(i.dataset.uid=n[s][this.listViewInstance.fields.id]?n[s][this.listViewInstance.fields.id]:e.ListBase.generateId(),i.getElementsByClassName(d.listItemText)[0].innerHTML=n[s][this.listViewInstance.fields.text]),this.listViewInstance.showIcon&&(i.querySelector("."+d.listIcon)&&t.detach(i.querySelector("."+d.listIcon)),this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss])){var l=i.querySelector("."+d.textContent),r=this.listViewInstance.curViewDS[s][this.listViewInstance.fields.iconCss].toString(),a=this.listViewInstance.createElement("div",{className:d.listIcon+" "+r});l.insertBefore(a,i.querySelector("."+d.listItemText))}if(this.listViewInstance.showCheckBox&&this.listViewInstance.fields.groupBy){this.checkListWrapper||(this.checkListWrapper=this.listViewInstance.curUL.querySelector("."+d.checkboxWrapper).cloneNode(!0));l=i.querySelector("."+d.textContent);this.listViewInstance.curViewDS[s].isHeader?i.querySelector("."+d.checkboxWrapper)&&(i.classList.remove(d.checklist),l.classList.remove(d.checkbox),t.detach(i.querySelector("."+d.checkboxWrapper))):i.querySelector("."+d.checkboxWrapper)||(i.classList.add(d.checklist),l.classList.add(d.checkbox),"Left"===this.listViewInstance.checkBoxPosition?l.classList.add("e-checkbox-left"):l.classList.add("e-checkbox-right"),l.append(this.checkListWrapper.cloneNode(!0)))}},s.prototype.changeElementAttributes=function(e,i){if(e.classList.remove(d.disable),this.uiIndices.disabledItemIndices.length&&-1!==this.uiIndices.disabledItemIndices.indexOf(i)&&e.classList.add(d.disable),e.style.display="",this.uiIndices.hiddenItemIndices.length&&-1!==this.uiIndices.hiddenItemIndices.indexOf(i)&&(e.style.display="none"),this.listViewInstance.showCheckBox){var s=e.querySelector("."+d.checkboxWrapper);e.classList.remove(d.selected),e.classList.remove(d.focused),s&&(s.removeAttribute("aria-checked"),s.firstElementChild.classList.remove(d.checked)),this.uiIndices.activeIndices.length&&-1!==this.uiIndices.activeIndices.indexOf(i)&&!this.listViewInstance.curUL.querySelector(d.selected)&&(e.classList.add(d.selected),s.firstElementChild.classList.add(d.checked),s.setAttribute("aria-checked","true"),this.activeIndex===i&&e.classList.add(d.focused))}else e.classList.remove(d.selected),e.removeAttribute("aria-selected"),t.isNullOrUndefined(this.activeIndex)||this.activeIndex!==i||this.listViewInstance.curUL.querySelector(d.selected)||(e.classList.add(d.selected),e.setAttribute("aria-selected","true"));this.listViewInstance.fields.groupBy&&(this.listViewInstance.curViewDS[i].isHeader?e.classList.contains(d.listItem)&&(e.classList.remove(d.listItem),e.setAttribute("role","group"),e.classList.add(d.groupListItem)):e.classList.contains(d.groupListItem)&&(e.classList.remove(d.groupListItem),e.setAttribute("role","listitem"),e.classList.add(d.listItem)))},s.prototype.findDSAndIndexFromId=function(e,i){var s=this,n={};return i=this.listViewInstance.getElementUID(i),t.isNullOrUndefined(i)||e.some(function(e,t){return!!(i[s.listViewInstance.fields.id]&&i[s.listViewInstance.fields.id]===(e[s.listViewInstance.fields.id]&&e[s.listViewInstance.fields.id])||i===e)&&(n.index=t,n.data=e,!0)}),n},s.prototype.getSelectedItems=function(){var e=this;if(!t.isNullOrUndefined(this.activeIndex)||this.listViewInstance.showCheckBox&&this.uiIndices.activeIndices.length){var s=[],n=[];if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0]){var l=this.listViewInstance.curViewDS;if(this.listViewInstance.showCheckBox){for(var r=this.uiIndices.activeIndices,a=0;a<r.length;a++)s.push(l[r[a]]);return{text:s,data:s,index:this.uiIndices.activeIndices.map(function(t){return e.listViewInstance.dataSource.indexOf(l[t])})}}return{text:l[this.activeIndex],data:l[this.activeIndex],index:this.listViewInstance.dataSource.indexOf(l[this.activeIndex])}}var o=this.listViewInstance.curViewDS,c=this.listViewInstance.fields.text;if(this.listViewInstance.showCheckBox){var h=this.uiIndices.activeIndices;for(a=0;a<h.length;a++)n.push(o[h[a]][""+c]),s.push(o[h[a]]);var d=this.listViewInstance.dataSource instanceof i.DataManager?o:this.listViewInstance.dataSource;return{text:n,data:s,index:this.uiIndices.activeIndices.map(function(e){return d.indexOf(o[e])})}}var u=this.listViewInstance.dataSource instanceof i.DataManager?o:this.listViewInstance.dataSource;return{text:o[this.activeIndex][this.listViewInstance.fields.text],data:o[this.activeIndex],index:u.indexOf(o[this.activeIndex])}}},s.prototype.selectItem=function(e){var i=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);if(Object.keys(i).length){var s=this.activeIndex===i.index,n=void 0;if(this.activeIndex=i.index,this.listViewInstance.showCheckBox&&(-1===this.uiIndices.activeIndices.indexOf(i.index)?(n=!0,this.uiIndices.activeIndices.push(i.index)):(n=!1,this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(i.index),1)),this.listViewInstance.curUL.querySelector("."+d.focused)&&this.listViewInstance.curUL.querySelector("."+d.focused).classList.remove(d.focused)),this.listViewInstance.getLiFromObjOrElement(e))this.listViewInstance.showCheckBox?this.listViewInstance.setCheckboxLI(this.listViewInstance.getLiFromObjOrElement(e)):this.listViewInstance.setSelectLI(this.listViewInstance.getLiFromObjOrElement(e));else{var l=void 0;if("string"==typeof this.listViewInstance.dataSource[0]||"number"==typeof this.listViewInstance.dataSource[0])l={text:this.listViewInstance.curViewDS[this.activeIndex],data:this.listViewInstance.curViewDS[this.activeIndex],index:this.activeIndex};else{var r=this.listViewInstance.curViewDS;l={text:r[this.activeIndex][this.listViewInstance.fields.text],data:r[this.activeIndex],index:this.activeIndex}}this.listViewInstance.showCheckBox?(l.isChecked=n,this.listViewInstance.trigger("select",l)):s||(this.listViewInstance.removeSelect(),this.listViewInstance.trigger("select",l))}}else t.isNullOrUndefined(e)&&!this.listViewInstance.showCheckBox&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0)},s.prototype.enableItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(t.index),1)},s.prototype.disableItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&-1===this.uiIndices.disabledItemIndices.indexOf(t.index)&&this.uiIndices.disabledItemIndices.push(t.index)},s.prototype.showItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(t.index),1)},s.prototype.hideItem=function(e){var t=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(t).length&&-1===this.uiIndices.hiddenItemIndices.indexOf(t.index)&&this.uiIndices.hiddenItemIndices.push(t.index)},s.prototype.removeItem=function(e){var t,s=this.listViewInstance.curViewDS,n=this.findDSAndIndexFromId(s,e);Object.keys(n).length&&(t=n.data,s[n.index-1]&&s[n.index-1].isHeader&&1===s[n.index-1].items.length?(this.removeUiItem(n.index-1),this.removeUiItem(n.index-1)):this.removeUiItem(n.index));var l=this.listViewInstance.dataSource instanceof i.DataManager?this.listViewInstance.localData:this.listViewInstance.dataSource,r=l.indexOf(t);-1!==r&&(l.splice(r,1),this.listViewInstance.setViewDataSource(l)),this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")},s.prototype.setCheckboxLI=function(e,t){var i=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex;this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex,e.classList.contains(d.selected)?-1===this.uiIndices.activeIndices.indexOf(i)&&this.uiIndices.activeIndices.push(i):this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(i),1)},s.prototype.setSelectLI=function(e,t){this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex},s.prototype.checkedItem=function(e){if(e){this.uiIndices.activeIndices=[],this.activeIndex=void 0;for(var t=this.listViewInstance.curViewDS,i=0;i<t.length;i++)t[i].isHeader||this.uiIndices.activeIndices.push(i)}else this.activeIndex=void 0,this.uiIndices.activeIndices=[]},s.prototype.addUiItem=function(e){var t=this.listViewInstance.curViewDS;if(this.changeUiIndices(e,!0),this.activeIndex&&this.activeIndex>=e&&this.activeIndex++,this.listViewInstance.showCheckBox&&t[e][this.listViewInstance.fields.isChecked]&&this.uiIndices.activeIndices.push(e),parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)||(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px"),parseFloat(this.bottomElement.style.height)){var i=this.listViewInstance.curUL.lastElementChild.previousSibling;(s=this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]))&&(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)+this.listItemHeight+"px",this.updateUI(i,e,s))}else{i=this.listViewInstance.curUL.firstElementChild.nextSibling;var s=void 0;s=Object.keys(this.listViewInstance.curViewDS).length-1===e?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(t[e+1])||this.listViewInstance.getLiFromObjOrElement(t[e+2]),this.topElement.style.height=parseFloat(this.topElement.style.height)+this.listItemHeight+"px",this.uiFirstIndex++,this.uiLastIndex++,s&&(this.updateUI(i,e,s),!0===this.listViewInstance.isWindow?window.scrollTo(0,pageYOffset+this.listItemHeight):this.listViewInstance.element.scrollTop+=this.listItemHeight)}this.totalHeight+=this.listItemHeight,this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.removeUiItem=function(e){this.totalHeight-=this.listItemHeight;var i=this.listViewInstance.curViewDS[e],s=this.listViewInstance.getLiFromObjOrElement(i);if(this.listViewInstance.curViewDS.splice(e,1),this.activeIndex&&this.activeIndex>=e&&this.activeIndex--,s)if(this.domItemCount>Object.keys(this.listViewInstance.curViewDS).length)t.detach(s),this.domItemCount--,this.uiLastIndex--,this.totalHeight=0;else{if(s.classList.contains(d.disable)&&(s.classList.remove(d.disable),this.uiIndices.disabledItemIndices.splice(this.uiIndices.disabledItemIndices.indexOf(e),1)),"none"===s.style.display&&(s.style.display="",this.uiIndices.hiddenItemIndices.splice(this.uiIndices.hiddenItemIndices.indexOf(e),1)),this.listViewInstance.showCheckBox&&s.classList.contains(d.selected)){this.listViewInstance.removeSelect(),this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(e),1);var n=s.querySelector("."+d.checkboxWrapper);n.removeAttribute("aria-checked"),n.firstElementChild.classList.remove(d.checked),s.classList.contains(d.focused)&&(s.classList.remove(d.focused),this.activeIndex=void 0)}else s.classList.contains(d.selected)&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0);parseFloat(this.bottomElement.style.height)||parseFloat(this.topElement.style.height)?parseFloat(this.bottomElement.style.height)?(this.bottomElement.style.height=parseFloat(this.bottomElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiLastIndex,this.bottomElement)):(this.topElement.style.height=parseFloat(this.topElement.style.height)-this.listItemHeight+"px",this.updateUI(s,this.uiFirstIndex-1,this.topElement.nextSibling),this.uiLastIndex--,this.uiFirstIndex--):this.updateUI(s,this.uiLastIndex,this.bottomElement)}this.changeUiIndices(e,!1),this.listDiff=Math.round(parseFloat(this.topElement.style.height)/this.listItemHeight)},s.prototype.changeUiIndices=function(e,t){for(var i=Object.keys(this.uiIndices),s=0;s<i.length;s++)this.uiIndices[i[s]]=this.uiIndices[i[s]].map(function(i){return i>=e?t?++i:--i:i})},s.prototype.addItem=function(e,t,i,s){for(var n=0;n<e.length;n++){var l=e[n];if(i=this.listViewInstance.addItemAtIndex(s,i,l),this.listViewInstance.setViewDataSource(i),this.domItemCount)if(this.domItemCount<this.expectedDomItemCount){if(this.listViewInstance.findItemFromDS(i,t)instanceof Array){if(this.listViewInstance.ulElement){var r=this.listViewInstance.curViewDS.indexOf(l);this.createAndInjectNewItem(l,r);(o=this.listViewInstance.curViewDS[r-1])&&o.isHeader&&1===o.items.length&&(--r,this.createAndInjectNewItem(o,r))}this.listViewInstance.liCollection=this.listViewInstance.curUL.querySelectorAll("li")}}else{var a=this.listViewInstance.curViewDS.indexOf(l);this.addUiItem(a);var o;(o=this.listViewInstance.curViewDS[a-1])&&o.isHeader&&1===o.items.length&&this.addUiItem(a-1)}else!this.listViewInstance.template&&!this.listViewInstance.groupTemplate||this.isNgTemplate()||(this.listViewInstance.listBaseOption.template=null,this.listViewInstance.listBaseOption.groupTemplate=null,this.listViewInstance.listBaseOption.itemCreated=this.createUIItem.bind(this)),this.uiVirtualization()}},s.prototype.createAndInjectNewItem=function(t,i){var s,n=e.ListBase.createListItemFromJson(this.listViewInstance.createElement,[t],this.listViewInstance.listBaseOption,null,null,this.listViewInstance);if(s=Object.keys(this.listViewInstance.curViewDS).length-1===i?this.listViewInstance.curUL.lastElementChild:this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+1])||this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i+2]),this.listViewInstance.fields.groupBy&&this.listViewInstance.curViewDS[i+1]&&this.listViewInstance.curViewDS[i+1].isHeader){var l=this.listViewInstance.getLiFromObjOrElement(this.listViewInstance.curViewDS[i-1]);l&&(s=l.nextElementSibling)}this.listViewInstance.ulElement.insertBefore(n[0],s),this.domItemCount++,this.bottomElementHeight<=0&&this.uiLastIndex++,this.refreshItemHeight()},s.prototype.createUIItem=function(e){if(!e.item.classList.contains("e-list-group-item")&&(this.templateData=e.curData.isHeader?e.curData.items[0]:e.curData,this.listViewInstance.showCheckBox&&(this.listViewInstance.renderCheckbox(e),!t.isNullOrUndefined(this.listViewInstance.virtualCheckBox)&&!t.isNullOrUndefined(this.listViewInstance.virtualCheckBox.outerHTML)))){var i=document.createElement("div"),s='<div class="e-text-content" role="presentation"> <span class="e-list-text"> ${'+this.listViewInstance.fields.text+"} </span></div>",n=t.compile(this.listViewInstance.template||s,this.listViewInstance)(this.templateData,this.listViewInstance);if(this.listViewInstance.template&&this.listViewInstance.isReact&&this.listViewInstance.renderReactTemplates(),[].slice.call(n).forEach(function(e){i.appendChild(e)}),i.children&&i.children[0]){for(i.children[0].classList.add("e-checkbox"),"Left"===this.listViewInstance.checkBoxPosition?i.children[0].classList.add("e-checkbox-left"):i.children[0].classList.add("e-checkbox-right"),"Left"===this.listViewInstance.checkBoxPosition?i.children[0].insertBefore(this.listViewInstance.virtualCheckBox,i.childNodes[0].children[0]):i.children[0].appendChild(this.listViewInstance.virtualCheckBox);e.item.lastChild;)e.item.removeChild(e.item.lastChild);[].slice.call(i.children).forEach(function(t){e.item.appendChild(t)})}}},s.prototype.reRenderUiVirtualization=function(){this.wireScrollEvent(!0),this.listViewInstance.contentContainer&&t.detach(this.listViewInstance.contentContainer),this.listViewInstance.preRender(),this.domItemCount=0,this.listViewInstance.header(),this.listViewInstance.setLocalData()},s.prototype.updateUI=function(t,i,s){var n=this.isNgTemplate()?this.onNgChange:this.onChange;if(this.listViewInstance.template||this.listViewInstance.groupTemplate){var l=this.listViewInstance.curViewDS[i];t.dataset.uid=l[this.listViewInstance.fields.id]?l[this.listViewInstance.fields.id]:e.ListBase.generateId(),n(l,t,this)}else this.updateUiContent(t,i);this.changeElementAttributes(t,i),s&&this.listViewInstance.ulElement.insertBefore(t,s)},s.prototype.onChange=function(t,i,s){var n=e.ListBase.createListItemFromJson(s.listViewInstance.createElement,[t],s.listViewInstance.listBaseOption,null,null,s.listViewInstance);for(s.listViewInstance.isReact&&s.listViewInstance.renderReactTemplates();i.lastChild;)i.removeChild(i.lastChild);[].slice.call(n[0].children).forEach(function(e){i.appendChild(e)})},s.prototype.onNgChange=function(e,i,s){for(var n=t.compile(s.listViewInstance.template)(e);i.lastChild;)i.removeChild(i.lastChild);i.appendChild(n[0])},s.prototype.getModuleName=function(){return"virtualization"},s.prototype.destroy=function(){this.wireScrollEvent(!0),this.topElement=null,this.bottomElement=null},s}(),g=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),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;a>=0;a--)(n=e[a])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},v=function(e){function i(i,s){var n=e.call(this,s,i)||this;return n.getHelper=function(e){var i=n.getSortableElement(e.sender.target);if(!n.isValidTarget(i,n))return!1;var s;return n.helper?s=n.helper({sender:i,element:e.element}):((s=i.cloneNode(!0)).style.width=i.offsetWidth+"px",s.style.height=i.offsetHeight+"px"),t.addClass([s],["e-sortableclone"]),document.body.appendChild(s),s},n.onDrag=function(e){if(e.target){n.trigger("drag",{event:e.event,element:n.element,target:e.target});var i=n.getSortableInstance(e.target),s=n.getSortableElement(e.target,i);if(!(n.isValidTarget(s,i)||e.target&&"string"==typeof e.target.className&&e.target.className.indexOf("e-list-group-item")>-1)||n.curTarget===s&&t.isNullOrUndefined(i.placeHolder)||i.placeHolderElement&&i.placeHolderElement===e.target)n.curTarget!==n.target&&n.scope&&n.curTarget!==s&&!t.isNullOrUndefined(i.placeHolder)&&(t.remove(n.getSortableInstance(n.curTarget).placeHolderElement),n.curTarget=n.target);else{if(e.target.classList.contains("e-list-group-item")&&(s=e.target),n.curTarget=s,n.target===s)return;var l=n.getIndex(i.placeHolderElement,i),r=n.getPlaceHolder(s,i),a=void 0;if(r){l=t.isNullOrUndefined(l)?n.getIndex(n.target):l,a=n.getIndex(s,i,e.event);var o=n.isPlaceHolderPresent(i);if(o&&l===a)return;o&&t.remove(i.placeHolderElement),i.placeHolderElement=r,e.target&&"string"==typeof e.target.className&&e.target.className.indexOf("e-list-group-item")>-1?i.element.insertBefore(i.placeHolderElement,i.element.children[a]):i.element!==n.element&&a===i.element.childElementCount?i.element.appendChild(i.placeHolderElement):i.element.insertBefore(i.placeHolderElement,i.element.children[a]),n.refreshDisabled(l,a,i)}else{l=t.isNullOrUndefined(l)?n.getIndex(n.target):n.getIndex(s,i)<l||!l?l:l-1,a=n.getIndex(s,i);var c=i.element!==n.element?a:l<a?a+1:a;n.updateItemClass(i),i.element.insertBefore(n.target,i.element.children[c]),n.refreshDisabled(l,a,i),n.curTarget=n.target,n.trigger("drop",{droppedElement:n.target,element:i.element,previousIndex:l,currentIndex:a,target:e.target,helper:document.getElementsByClassName("e-sortableclone")[0],event:e.event,scope:n.scope})}}if(i=n.getSortableInstance(n.curTarget),t.isNullOrUndefined(s)&&e.target!==i.placeHolderElement)n.isPlaceHolderPresent(i)&&n.removePlaceHolder(i);else{var h;[].slice.call(document.getElementsByClassName("e-sortable-placeholder")).forEach(function(e){(h=n.getSortableInstance(e)).element&&h!==i&&n.removePlaceHolder(h)})}}},n.onDragStart=function(e){n.target=n.getSortableElement(e.target);var i=!1;n.target.classList.add("e-grabbed"),n.curTarget=n.target,e.helper=document.getElementsByClassName("e-sortableclone")[0];var s={cancel:!1,element:n.element,target:n.target};n.trigger("beforeDragStart",s,function(t){t.cancel&&(i=t.cancel,n.onDragStop(e))}),i||(t.isBlazor?n.trigger("dragStart",{event:e.event,element:n.element,target:n.target,bindEvents:e.bindEvents,dragElement:e.dragElement}):n.trigger("dragStart",{event:e.event,element:n.element,target:n.target}))},n.onDragStop=function(e){var i,s,l,r=n.getSortableInstance(n.curTarget);i=n.getIndex(n.target);var a=n.isPlaceHolderPresent(r);if(a){var o=n.getIndex(r.placeHolderElement,r),c={previousIndex:i,currentIndex:o,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1,handled:!1};n.trigger("beforeDrop",c,function(s){if(!s.cancel){if(l=s.handled,n.updateItemClass(r),s.handled){var a=n.target.cloneNode(!0);n.target.classList.remove("e-grabbed"),n.target=a}r.element.insertBefore(n.target,r.placeHolderElement);var o=n.getIndex(n.target,r);i=n===r&&i-o>1?i-1:i,n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:o,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope,handled:l})}t.remove(r.placeHolderElement)})}if(r=n.getSortableInstance(e.target),s=r.element.childElementCount,i=n.getIndex(n.target),r.element===e.target||!a&&n.curTarget===n.target){var h={previousIndex:i,currentIndex:n.curTarget===n.target?i:s,target:e.target,droppedElement:n.target,helper:e.helper,cancel:!1};n.trigger("beforeDrop",h,function(t){(r.element===e.target||"string"==typeof e.target.className&&e.target.className.indexOf("e-list-nrt")>-1||"string"==typeof e.target.className&&e.target.className.indexOf("e-list-nr-template")>-1||e.target.closest(".e-list-nr-template"))&&!t.cancel&&(n.updateItemClass(r),r.element.appendChild(n.target),n.trigger("drop",{event:e.event,element:r.element,previousIndex:i,currentIndex:s,target:e.target,helper:e.helper,droppedElement:n.target,scopeName:n.scope}))})}n.target.classList.remove("e-grabbed"),n.target=null,n.curTarget=null,t.remove(e.helper),t.getComponent(n.element,"draggable").intDestroy(e.event)},n.bind(),n}g(i,e),s=i,i.prototype.bind=function(){this.element.id||(this.element.id=t.getUniqueID("sortable")),this.itemClass||(this.itemClass="e-sort-item",this.dataBind()),this.initializeDraggable()},i.prototype.initializeDraggable=function(){new t.Draggable(this.element,{helper:this.getHelper,dragStart:this.onDragStart,drag:this.onDrag,dragStop:this.onDragStop,dragTarget:"."+this.itemClass,enableTapHold:!0,tapHoldThreshold:200,queryPositionInfo:this.queryPositionInfo,distance:1}),this.wireEvents()},i.prototype.wireEvents=function(){var e=this.element;t.EventHandler.add(e,"keydown",this.keyDownHandler,this)},i.prototype.unwireEvents=function(){var e=this.element;t.EventHandler.remove(e,"keydown",this.keyDownHandler)},i.prototype.keyDownHandler=function(e){if(27===e.keyCode){var i=t.getComponent(this.element,"draggable");i&&i.intDestroy(null);var s=document.getElementsByClassName("e-sortableclone")[0];s&&s.remove();var n=document.getElementsByClassName("e-sortable-placeholder")[0];n&&n.remove()}},i.prototype.getPlaceHolder=function(e,t){if(t.placeHolder){var i=t.placeHolder({element:t.element,grabbedElement:this.target,target:e});return i.classList.add("e-sortable-placeholder"),i}return null},i.prototype.isValidTarget=function(e,i){return e&&t.compareElementParent(e,i.element)&&e.classList.contains(i.itemClass)&&!e.classList.contains("e-disabled")},i.prototype.removePlaceHolder=function(e){t.remove(e.placeHolderElement),e.placeHolderElement=null},i.prototype.updateItemClass=function(e){this!==e&&(this.target.classList.remove(this.itemClass),this.target.classList.add(e.itemClass))},i.prototype.getSortableInstance=function(e){if(e=t.closest(e,".e-"+this.getModuleName())){var i=t.getComponent(e,s);return i.scope&&this.scope&&i.scope===this.scope?i:this}return this},i.prototype.refreshDisabled=function(e,t,i){if(i===this)for(var s=void 0,n=e<t,l=void 0,r=n?e:t,a=n?t:e;r<=a;)(s=this.element.children[r]).classList.contains("e-disabled")?(l=this.getIndex(s),this.element.insertBefore(s,this.element.children[n?l+2:l-1]),r=n?l+2:l+1):r++},i.prototype.getIndex=function(e,i,s){void 0===i&&(i=this);var n,l;return[].slice.call(i.element.children).forEach(function(i,r){if(i.classList.contains("e-sortable-placeholder")&&(l=!0),i!==e);else if(n=r,!t.isNullOrUndefined(s)){l&&(n-=1);var a=e.getBoundingClientRect(),o=a.bottom-(a.bottom-a.top)/2,c=s.changedTouches?s.changedTouches[0].clientY:s.clientY;n=c<=o?n:n+1}}),n},i.prototype.getSortableElement=function(e,i){return void 0===i&&(i=this),t.closest(e,"."+i.itemClass)},i.prototype.queryPositionInfo=function(e){return e.left=pageXOffset?parseFloat(e.left)-pageXOffset+"px":e.left,e.top=pageYOffset?parseFloat(e.top)-pageYOffset+"px":e.top,e},i.prototype.isPlaceHolderPresent=function(e){return e.placeHolderElement&&!!t.closest(e.placeHolderElement,"#"+e.element.id)},i.prototype.moveTo=function(e,t,i){r(this.element,e,t,i)},i.prototype.destroy=function(){this.unwireEvents(),"e-sort-item"===this.itemClass&&(this.itemClass=null,this.dataBind()),t.getComponent(this.element,t.Draggable).destroy(),e.prototype.destroy.call(this)},i.prototype.getModuleName=function(){return"sortable"},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"itemClass":[].slice.call(this.element.children).forEach(function(i){i.classList.contains(t.itemClass)&&i.classList.remove(t.itemClass),e.itemClass&&i.classList.add(e.itemClass)})}}};var s;return I([t.Property(!1)],i.prototype,"enableAnimation",void 0),I([t.Property(null)],i.prototype,"itemClass",void 0),I([t.Property(null)],i.prototype,"scope",void 0),I([t.Property()],i.prototype,"helper",void 0),I([t.Property()],i.prototype,"placeHolder",void 0),I([t.Event()],i.prototype,"drag",void 0),I([t.Event()],i.prototype,"beforeDragStart",void 0),I([t.Event()],i.prototype,"dragStart",void 0),I([t.Event()],i.prototype,"beforeDrop",void 0),I([t.Event()],i.prototype,"drop",void 0),i=s=I([t.NotifyPropertyChanges],i)}(t.Base);e.classNames=d,e.FieldSettings=p,e.ListView=m,e.Virtualization=f,e.getFieldValues=n,e.Sortable=v,e.moveTo=r,Object.defineProperty(e,"__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(L,C,d,A){"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=C.extend({},T,s),c=(L.cssClass=H(o.moduleName),k()),h=0;h<t.length;h++)C.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?D(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=C.extend({},T,i),c=(L.cssClass=H(o.moduleName),!l||"listview"!==l.getModuleName()&&"multiselect"!==l.getModuleName()?C.extend({},N.defaultMappedFields,o.fields):o.fields),h=C.extend({},B,o.ariaAttributes),d=[],u=(s&&(h.level=s),[]);t&&t.length&&!C.isNullOrUndefined(E(t).item)&&!Object.prototype.hasOwnProperty.call(E(t).item,c.id)&&(r=k());for(var p=0;p<t.length;p++){var m,f,g,I,y,v,b,S,w,x=U(t[p],c);C.isNullOrUndefined(t[p])||(o.itemCreating&&"function"==typeof o.itemCreating&&(w={dataSource:t,curData:t[p],text:x[c.text],options:o,fields:c},o.itemCreating(w)),f=t[p],o.itemCreating&&"function"==typeof o.itemCreating&&(x=U(t[p],c)),Object.prototype.hasOwnProperty.call(x,c.id)&&!C.isNullOrUndefined(x[c.id])&&(r=x[c.id]),S=[],o.showCheckBox&&(o.itemNavigable&&(x[c.url]||x[c.urlAttributes])?d:S).push(e("input",{className:L.cssClass.check,attrs:{type:"checkbox"}})),!0===n?(o.showIcon&&Object.prototype.hasOwnProperty.call(x,c.iconCss)&&!C.isNullOrUndefined(x[c.iconCss])&&S.push(e("span",{className:L.cssClass.icon+" "+x[c.iconCss]})),a=(m=D(e,f,x,c,o.itemClass,S,!(!Object.prototype.hasOwnProperty.call(f,"isHeader")||!f.isHeader),r,p,i)).querySelector("."+L.cssClass.anchorWrap),o.itemNavigable&&d.length&&C.prepend(d,m.firstElementChild)):((m=P(e,f,x,c,o.itemClass,i,l)).classList.add(L.cssClass.level+"-"+h.level),m.setAttribute("aria-level",h.level.toString()),"presentation"!==h.groupItemRole&&"presentation"!==h.itemRole||m.removeAttribute("aria-level"),a=m.querySelector("."+L.cssClass.anchorWrap),Object.prototype.hasOwnProperty.call(x,c.tooltip)&&(f=x[c.tooltip],i&&i.enableHtmlSanitizer?f=C.SanitizeHtmlHelper.sanitize(f):(f=e("span",{innerHTML:f}).innerText,0),m.setAttribute("title",f)),Object.prototype.hasOwnProperty.call(x,c.htmlAttributes)&&x[c.htmlAttributes]&&("class"in(f=x[c.htmlAttributes])&&"string"==typeof f.class&&""===f.class.trim()&&delete f.class,O(m,f)),Object.prototype.hasOwnProperty.call(x,c.enabled)&&!1===x[c.enabled]&&m.classList.add(L.cssClass.disabled),Object.prototype.hasOwnProperty.call(x,c.isVisible)&&!1===x[c.isVisible]&&(m.style.display="none"),!Object.prototype.hasOwnProperty.call(x,c.imageUrl)||C.isNullOrUndefined(x[c.imageUrl])||o.template||(f={src:x[c.imageUrl],alt:C.isNullOrUndefined(x.name)?"Displaying Image":"Displaying "+x.name+" Image"},C.merge(f,x[c.imageAttributes]),f=e("img",{className:L.cssClass.image,attrs:f}),a?a.insertAdjacentElement("afterbegin",f):C.prepend([f],m.firstElementChild)),o.showIcon&&Object.prototype.hasOwnProperty.call(x,c.iconCss)&&!C.isNullOrUndefined(x[c.iconCss])&&!o.template&&(f=e("div",{className:L.cssClass.icon+" "+x[c.iconCss]}),a?a.insertAdjacentElement("afterbegin",f):C.prepend([f],m.firstElementChild)),S.length&&C.prepend(S,m.firstElementChild),o.itemNavigable&&d.length&&C.prepend(d,m.firstElementChild),b=v=y=I=g=S=f=void 0,f=e,S=x,g=c,I=o,y=m,v=h.level,b=S[g.child]||[],S=S[g.hasChildren],b.length&&(S=!0,y.classList.add(L.cssClass.hasChild),I.processSubChild)&&(g=V(f,b,I,++v),y.appendChild(g)),I.expandCollapse&&S&&!I.template&&(y.firstElementChild.classList.add(L.cssClass.iconWrapper),("Left"===I.expandIconPosition?C.prepend:C.append)([f("div",{className:"e-icons "+I.expandIconClass})],y.querySelector("."+L.cssClass.textContent)))),a&&C.addClass([m],[L.cssClass.navigable]),o.itemCreated&&"function"==typeof o.itemCreated&&(w={dataSource:t,curData:t[p],text:x[c.text],item:m,options:o,fields:c},o.itemCreated(w)),d=[],u.push(m))}return u}function V(e,t,i,s,n,l){var r=C.extend({},T,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 E(e){for(var t={typeof:null,item:null},i=0;i<e.length;i++)if(!C.isNullOrUndefined(e[i]))return{typeof:typeof e[i],item:e[i]};return t}function O(e,t){var i={};C.merge(i,t),i.class&&(C.addClass([e],i.class.split(" ")),delete i.class),C.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 k(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function D(e,t,i,s,n,l,r,a,o,c){var h,c=C.extend({},T,c),d=C.extend({},B,c.ariaAttributes),u=t,p=t,o=("string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t&&(h=t,u="boolean"==typeof i[s.text]||"number"==typeof i[s.text]?i[s.text]:i[s.text]||"",p=i[s.value]),t=C.isNullOrUndefined(h)||C.isNullOrUndefined(i[s.id])||""===i[s.id]?a+"-"+o:a,e("li",{className:(!0===r?L.cssClass.group:L.cssClass.li)+" "+(C.isNullOrUndefined(n)?"":n),id:t,attrs:""!==d.groupItemRole&&""!==d.itemRole?{role:!0===r?d.groupItemRole:d.itemRole}:{}}));return h&&Object.prototype.hasOwnProperty.call(i,s.enabled)&&"false"===i[s.enabled].toString()&&o.classList.add(L.cssClass.disabled),r?o.innerText=u:(o.setAttribute("data-value",C.isNullOrUndefined(p)?"null":p),o.setAttribute("role","option"),h&&Object.prototype.hasOwnProperty.call(i,s.htmlAttributes)&&i[s.htmlAttributes]&&O(o,i[s.htmlAttributes]),l.length&&!c.itemNavigable&&C.append(l,o),h&&(i[s.url]||i[s.urlAttributes]&&i[s.urlAttributes].href)?o.appendChild(F(e,h,s,u,l,c.itemNavigable)):(l.length&&c.itemNavigable&&C.append(l,o),o.appendChild(document.createTextNode(u)))),o}function H(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=U(t,i),a={href:t[i.url]};return Object.prototype.hasOwnProperty.call(t,i.urlAttributes)&&t[i.urlAttributes]&&(C.merge(a,t[i.urlAttributes]),a.href=t[i.url]||t[i.urlAttributes].href),l?(r=e("a",{className:L.cssClass.text+" "+L.cssClass.url}),t=e("div",{className:L.cssClass.anchorWrap}),n&&n.length&&C.append(n,t),t.appendChild(document.createTextNode(s)),C.append([t],r)):r=e("a",{className:L.cssClass.text+" "+L.cssClass.url,innerHTML:s}),O(r,a),r}function P(e,t,i,s,n,l,r){var a,o,c,h,d,u=C.extend({},T,l),p=C.extend({},B,u.ariaAttributes),m=t,n=("string"!=typeof t&&"number"!=typeof t&&(a=t,m=i[s.text]||"",h=C.isNullOrUndefined(i._id)?i[s.id]:i._id,d=!(!Object.prototype.hasOwnProperty.call(t,"isHeader")||!t.isHeader)),l&&l.enableHtmlSanitizer,e("li",{className:(!0===d?L.cssClass.group:L.cssClass.li)+" "+(C.isNullOrUndefined(n)?"":n),attrs:""!==p.groupItemRole&&""!==p.itemRole?{role:!0===d?p.groupItemRole:p.itemRole}:{}}));return!0==!C.isNullOrUndefined(h)?n.setAttribute("data-uid",h):n.setAttribute("data-uid",k()),d&&l&&l.groupTemplate?(o=v(l.groupTemplate),r&&"listview"!==r.getModuleName()?(c=o(t,r,"groupTemplate",u.groupTemplateID,!!u.isStringTemplate,null,n))&&C.append(c,n):C.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))&&C.append(c,n):C.append(o(t,r,"template",u.templateID,!!u.isStringTemplate),n)):(h=e("div",{className:L.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:L.cssClass.text,attrs:""!==p.itemText?{role:p.itemText}:{}}),l&&l.enableHtmlSanitizer?d.innerText=C.SanitizeHtmlHelper.sanitize(m):d.innerHTML=m,h.appendChild(d)),n.appendChild(h)),n}function u(e,t,i,s){var s=C.extend({},T,s),n=C.extend({},B,s.ariaAttributes),s=(L.cssClass=H(s.moduleName),e("ul",{className:L.cssClass.ul+" "+(C.isNullOrUndefined(i)?"":i),attrs:""!==n.listRole?{role:n.listRole}:{}}));return C.append(t,s),s}var N,B,T;function U(e,t){var i={};if(C.isNullOrUndefined(e)||"string"==typeof e||"number"==typeof e||!C.isNullOrUndefined(e.isHeader))return e;for(var s=0,n=Object.keys(t);s<n.length;s++){var l=t[""+n[s]],r=C.isNullOrUndefined(l)||"string"!=typeof l?void 0:C.getValue(l,e);C.isNullOrUndefined(r)||(i[""+l]=r)}return i}function v(t){if(t)try{return"function"!=typeof t&&document.querySelector(t)?C.compile(document.querySelector(t).innerHTML.trim()):C.compile(t)}catch(e){return C.compile(t)}}L.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"},(N=L.ListBase||(L.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},T={showCheckBox:!(B={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"}),showIcon:!1,enableHtmlSanitizer:!1,expandCollapse:!1,fields:N.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},N.createList=function(e,t,i,s,n){var l=C.extend({},T,i),l=C.extend({},B,l.ariaAttributes),r=E(t).typeof;return"string"===r||"number"===r?a(e,t,s,i,n):V(e,t,i,l.level,s,n)},N.createListFromArray=a,N.createListItemFromArray=l,N.createListItemFromJson=o,N.createListFromJson=V,N.getSiblingLI=function(e,t,i){if(L.cssClass=H(T.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&&(!C.isVisible(l)||l.classList.contains(L.cssClass.disabled));)l=s[n+=!0===i?-1:1];return l}},N.indexOf=r,N.groupDataSource=function(e,t,i){void 0===i&&(i="None");var s=C.extend({},N.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},N.addSorting=c,N.getDataSource=h,N.createJsonFromElement=function e(t,i){var s=C.extend({},T,i),n=C.extend({},N.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]=k(),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},N.renderContentTemplate=function(e,t,i,s,n,l){L.cssClass=H(T.moduleName);for(var r=e("ul",{className:L.cssClass.ul,attrs:{role:"presentation"}}),a=C.extend({},T,n),o=C.extend({},N.defaultMappedFields,s),c=v(t),h=[],d=k(),u=0;u<i.length;u++){var p,m=U(i[u],o),f=i[u],g=f.isHeader,I="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:I,options:a,fields:o}),a.itemCreating&&"function"==typeof a.itemCreating&&(m=U(i[u],o),I="string"==typeof i[u]||"number"==typeof i[u]?f:m[o.value]),e("li",{id:d+"-"+u,className:g?L.cssClass.group:L.cssClass.li,attrs:{role:"presentation"}}));g?"string"==typeof i[u]||"number"==typeof i[u]?y.innerText=f:y.innerText=m[o.text]:(m=g?a.groupTemplateID:a.templateID,g?l&&"listview"!==l.getModuleName()?(p=c(f,l,"headerTemplate",m,!!a.isStringTemplate,null,y))&&C.append(p,y):C.append(c(f,l,"headerTemplate",m,!!a.isStringTemplate),y):l&&"listview"!==l.getModuleName()?(p=c(f,l,"template",m,!!a.isStringTemplate,null,y))&&C.append(p,y):C.append(c(f,l,"template",m,!!a.isStringTemplate),y),y.setAttribute("data-value",C.isNullOrUndefined(I)?"null":I),y.setAttribute("role","option")),a.itemCreated&&"function"==typeof a.itemCreated&&a.itemCreated({dataSource:i,curData:f,text:I,item:y,options:a,fields:o}),h.push(y)}return C.append(h,r),r},N.renderGroupTemplate=function(e,t,i,s,n,l){for(var r=v(e),e=C.extend({},N.defaultMappedFields,i),a=C.extend({},T,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))&&C.append(d,u):C.append(r(p,l,"groupTemplate",a.groupTemplateID,!!a.isStringTemplate),u)}return s},N.generateId=k,N.generateUL=u,N.generateIcon=function(e,t,i,s){return s=C.extend({},T,s),L.cssClass=H(s.moduleName),("Left"===s.expandIconPosition?C.prepend:C.append)([e("div",{className:"e-icons "+s.expandIconClass+" "+(C.isNullOrUndefined(i)?"":i)})],t.querySelector("."+L.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",R="GroupTemplate",z=(e=C.ChildProperty,t(n,e),i([C.Property("id")],n.prototype,"id",void 0),i([C.Property("text")],n.prototype,"text",void 0),i([C.Property("isChecked")],n.prototype,"isChecked",void 0),i([C.Property("isVisible")],n.prototype,"isVisible",void 0),i([C.Property("enabled")],n.prototype,"enabled",void 0),i([C.Property("iconCss")],n.prototype,"iconCss",void 0),i([C.Property("child")],n.prototype,"child",void 0),i([C.Property("tooltip")],n.prototype,"tooltip",void 0),i([C.Property("groupBy")],n.prototype,"groupBy",void 0),i([C.Property("text")],n.prototype,"sortBy",void 0),i([C.Property("htmlAttributes")],n.prototype,"htmlAttributes",void 0),i([C.Property("tableName")],n.prototype,"tableName",void 0),n);function n(){return null!==e&&e.apply(this,arguments)||this}m=C.Component,t(g,m),g.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":C.isNullOrUndefined(this.contentContainer)||C.detach(this.contentContainer),this.refresh();break;case"showCheckBox":case"checkBoxPosition":this.enableVirtualization?this.virtualizationModule.reRenderUiVirtualization():this.setCheckbox();break;case"dataSource":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())}},g.prototype.setHTMLAttribute=function(){!C.isNullOrUndefined(this.htmlAttributes)&&Object.keys(this.htmlAttributes).length&&C.attributes(this.element,this.htmlAttributes)},g.prototype.setCSSClass=function(e){this.cssClass&&C.addClass([this.element],this.cssClass.split(" ").filter(function(e){return e})),e&&C.removeClass([this.element],e.split(" ").filter(function(e){return e}))},g.prototype.setSize=function(){this.element.style.height=C.formatUnit(this.height),this.element.style.width=C.formatUnit(this.width),this.isWindow=!this.element.clientHeight},g.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},g.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},g.prototype.enableElement=function(e,t){t?e.classList.remove(p.disable):e.classList.add(p.disable)},g.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:C.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=C.compile(this.headerTemplate),s=this.createElement("div",{className:p.headerTemplateText}),(n=n({},this,i,this.LISTVIEW_HEADERTEMPLATE_ID,null,null,this.headerEle))&&C.append(n,s),C.append([s],this.headerEle),this.isReact)&&this.renderReactTemplates(),this.headerTemplate&&this.headerTitle&&l.classList.add("header"),this.element.classList.add("e-has-header"),C.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=C.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")},g.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"===C.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"===C.animationMode?400:l,timingFunction:this.animation.easing,end:function(){a.trigger("actionComplete")}}),this.curUL=t)},g.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){C.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+R,enableHtmlSanitizer:this.enableHtmlSanitizer},this.initialization()},g.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+R,this.LISTVIEW_HEADERTEMPLATE_ID=this.element.id+"HeaderTemplate",this.aniObj=new C.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},g.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=A.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=U(e.curData,this.listBaseOption.fields),this.enablePersistence&&!C.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)},g.prototype.checkInternally=function(e,t){e.item.classList.add(p.selected),t.querySelector("."+p.checkboxIcon).classList.add(p.checked),t.setAttribute("aria-checked","true")},g.prototype.checkItem=function(e){this.toggleCheckBase(e,!0)},g.prototype.toggleCheckBase=function(e,t){var i;this.showCheckBox&&((i=e)instanceof Object&&e.constructor!==HTMLLIElement&&(i=this.getLiFromObjOrElement(e)),C.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())},g.prototype.uncheckItem=function(e){this.toggleCheckBase(e,!1)},g.prototype.checkAllItems=function(){this.toggleAllCheckBase(!0)},g.prototype.uncheckAllItems=function(){this.toggleAllCheckBase(!1)},g.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()}},g.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)}},g.prototype.refreshItemHeight=function(){this.virtualizationModule&&this.virtualizationModule.refreshItemHeight()},g.prototype.clickHandler=function(e){var t,i,s,n;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=C.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),C.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),C.merge(s,{isChecked:n.classList.contains(p.checked)}),this.trigger("select",s))):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=C.closest(e.target,"li"),C.isNullOrUndefined(n)||n.classList.contains("e-has-child")&&!e.target.parentElement.classList.contains("e-listview-checkbox")&&n.classList.add(p.disable)),this.updateSelectedId())},g.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},g.prototype.hoverHandler=function(e){e=C.closest(e.target.parentNode,"."+p.listItem);this.setHoverLI(e)},g.prototype.leaveHandler=function(){this.removeHover()},g.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"))},g.prototype.onArrowKeyDown=function(e,t){var i,s;return!C.isNullOrUndefined(this.curUL.querySelector("."+p.hasChild))||this.showCheckBox?(s=this.curUL.querySelector("."+p.focused)||this.curUL.querySelector("."+p.selected),i=L.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+p.listItem),s,t),C.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=L.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},g.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)))},g.prototype.enterKeyHandler=function(e){var t,i;Object.keys(this.dataSource).length&&this.curUL&&(t=!C.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))},g.prototype.spaceKeyHandler=function(e){var t,i,s,n;this.enable&&this.showCheckBox&&Object.keys(this.dataSource).length&&this.curUL&&(e.preventDefault(),t=this.curUL.querySelector("."+p.focused),i=s=void 0,!C.isNullOrUndefined(t)&&C.isNullOrUndefined(t.querySelector("."+p.checked))?(s=(n={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:t}).item.querySelector("."+p.checkboxWrapper),this.checkInternally(n,s),i=s.querySelector("."+p.checkboxIcon+"."+p.icon)):this.uncheckItem(t),n=this.selectEventData(t,e),C.merge(n,{isChecked:!!i&&i.classList.contains(p.checked)}),this.trigger("select",n),this.updateSelectedId())},g.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:!C.isNullOrUndefined(this.targetElement)&&this.targetElement.classList.contains("e-focused")||this.spaceKeyHandler(e)}},g.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())},g.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||C.isNullOrUndefined(this.selectedLI)||this.selectedLI.classList.add(p.selected))},g.prototype.wireEvents=function(){C.EventHandler.add(this.element,"keydown",this.keyActionHandler,this),C.EventHandler.add(this.element,"click",this.clickHandler,this),C.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),C.EventHandler.add(this.element,"mouseout",this.leaveHandler,this),C.EventHandler.add(this.element,"focusout",this.focusout,this),this.touchModule=new C.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)}),C.isNullOrUndefined(this.scroll)||C.EventHandler.add(this.element,"scroll",this.onListScroll,this)},g.prototype.unWireEvents=function(){C.EventHandler.remove(this.element,"keydown",this.keyActionHandler),C.EventHandler.remove(this.element,"click",this.clickHandler),C.EventHandler.remove(this.element,"mouseover",this.hoverHandler),C.EventHandler.remove(this.element,"mouseout",this.leaveHandler),C.EventHandler.remove(this.element,"mouseover",this.hoverHandler),C.EventHandler.remove(this.element,"mouseout",this.leaveHandler),C.EventHandler.remove(this.element,"focusout",this.focusout),C.isNullOrUndefined(this.scroll)||C.EventHandler.remove(this.element,"scroll",this.onListScroll),this.touchModule&&this.touchModule.destroy(),this.touchModule=null},g.prototype.removeFocus=function(){for(var e=0,t=this.element.querySelectorAll("."+p.focused);e<t.length;e++)t[e].classList.remove(p.focused)},g.prototype.removeHover=function(){var e=this.element.querySelector("."+p.hover);e&&e.classList.remove(p.hover)},g.prototype.removeSelect=function(e){if(C.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)},g.prototype.isValidLI=function(e){return e&&e.classList.contains(p.listItem)&&!e.classList.contains(p.groupListItem)&&!e.classList.contains(p.disable)},g.prototype.setCheckboxLI=function(e,t){var i,s;this.isValidLI(e)&&this.enable&&this.showCheckBox&&(this.curUL.querySelector("."+p.focused)&&this.curUL.querySelector("."+p.focused).classList.remove(p.focused),s=e.querySelector("textarea")||e.querySelector("input"),e.classList.add(p.focused),C.isNullOrUndefined(t)||t.target===s&&s.classList.add("e-focused"),i=(s=e.querySelector("."+p.checkboxWrapper)).querySelector("."+p.checkboxIcon+"."+p.icon),this.removeHover(),i.classList.contains(p.checked)?(i.classList.remove(p.checked),e.classList.remove(p.selected)):(i.classList.add(p.checked),e.classList.add(p.selected)),s.setAttribute("aria-checked",i.classList.contains(p.checked)?"true":"false"),s=this.selectEventData(e,t),C.merge(s,{isChecked:i.classList.contains(p.checked)}),this.enableVirtualization&&this.virtualizationModule.setCheckboxLI(e,t),this.trigger("select",s),this.setSelectedItemData(e),this.renderSubList(e))},g.prototype.selectEventData=function(e,t){var i=this.getItemData(e),s=U(i,this.listBaseOption.fields),s=!C.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 C.merge(i,s),t&&C.merge(i,{isInteracted:!0,event:t,cancel:!1,index:this.curUL&&Array.prototype.indexOf.call(this.curUL.children,e)}),i},g.prototype.setSelectedItemData=function(e){var t=this.getItemData(e),i=U(t,this.listBaseOption.fields);C.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}},g.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||(i.selectedLI=t,i.renderSubList(t))}))},g.prototype.setHoverLI=function(e){var t;this.isValidLI(e)&&!e.classList.contains(p.hover)&&this.enable&&((t=this.element.querySelectorAll("."+p.hover))&&t.length&&C.removeClass(t,p.hover),e.classList.contains(p.selected)&&!this.showCheckBox||e.classList.add(p.hover))},g.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),U(this.curDSJSON,this.listBaseOption.fields)),t=this.curDSJSON?n[this.fields.child]:t;return t}return this.localData},g.prototype.getItemData=function(e){var t=this.dataSource instanceof d.DataManager?this.localData:this.dataSource,e=this.getElementUID(e),t=C.isNullOrUndefined(this.element.querySelector("."+p.hasChild))&&this.fields.groupBy?this.curViewDS:t;return this.findItemFromDS(t,e)},g.prototype.findItemFromDS=function(s,n,l){var r,a=this;return s&&s.length&&n?s.some(function(e){var t,i=U(e,a.listBaseOption.fields);return!(!n[a.fields.id]&&!n[a.fields.text]||n[a.fields.id]&&(!C.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:!C.isNullOrUndefined(n[a.fields.id])&&C.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},g.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]!==L.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},g.prototype.setViewDataSource=function(e){void 0===e&&(e=this.localData);var t=C.isNullOrUndefined(this.fields.sortBy)?this.fields.text:this.fields.sortBy,t=L.ListBase.addSorting(this.sortOrder,t);e&&this.fields.groupBy?"None"!==this.sortOrder?this.curViewDS=L.ListBase.groupDataSource(L.ListBase.getDataSource(e,t),this.listBaseOption.fields,this.sortOrder):this.curViewDS=L.ListBase.groupDataSource(e,this.listBaseOption.fields,this.sortOrder):e&&"None"!==this.sortOrder?this.curViewDS=L.ListBase.getDataSource(e,t):this.curViewDS=e},g.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},g.prototype.renderRemoteLists=function(e,t){this.isDestroyed||(this.localData=e.result,t.removeElement(t.contentContainer),this.renderList(),this.trigger("actionComplete",e))},g.prototype.triggerActionFailure=function(e){this.isDestroyed||this.trigger("actionFailure",e)},g.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"))&&(C.remove(e),this.setProperties({dataSource:L.ListBase.createJsonFromElement(e)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))},g.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()},g.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},g.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"))}},g.prototype.createList=function(){this.currentLiElements=[],this.isNestedList=!1,this.ulElement=this.curUL=L.ListBase.createList(this.createElement,this.curViewDS,this.listBaseOption,null,this),this.liCollection=this.curUL.querySelectorAll("."+p.listItem),this.setAttributes(this.liCollection)},g.prototype.renderSubList=function(e){var t,i,s=(this.liElement=e).getAttribute("data-uid");e.classList.contains(p.hasChild)&&s&&(e=C.closest(e.parentNode,"."+p.parentItem),t=this.element.querySelector("[pid='"+s+"']"),this.curDSLevel.push(s),this.setViewDataSource(this.getSubDS()),t||(i=this.curViewDS,t=L.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=U(this.selectedItems.data,this.listBaseOption.fields),this.header(i[this.listBaseOption.fields.text],!0,"header")),this.selectedLI=void 0)},g.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},g.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())},g.prototype.getElementUID=function(e){var t={};return e instanceof Element?t[this.fields.id]=e.getAttribute("data-uid"):t=e,t},g.prototype.render=function(){this.element.classList.add(p.root),C.attributes(this.element,{tabindex:"0"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.rippleFn=C.rippleEffect(this.element,{selector:"."+p.listItem}),this.renderComplete(),this.previousScrollTop=this.element.scrollTop},g.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}):[]);C.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)},g.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()),e=this.element.querySelector("[data-uid='"+s+"']"),i=this.curUL,e=e?e.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),this.curUL),t=U(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:C.SanitizeHtmlHelper.sanitize(this.headerTitle)},!0),this.header(this.curDSLevel.length?t:this.headerTitle,!!this.curDSLevel.length,"header"))},g.prototype.selectItem=function(e){this.enableVirtualization?this.virtualizationModule.selectItem(e):this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):!0===C.isNullOrUndefined(e)?this.removeSelect():this.setSelectLI(this.getLiFromObjOrElement(e))},g.prototype.unselectItem=function(e){C.isNullOrUndefined(e)?this.removeSelect():(e=this.getLiFromObjOrElement(e),C.isNullOrUndefined(e)||this.removeSelect(e))},g.prototype.getLiFromObjOrElement=function(t){var i,e=this.dataSource instanceof d.DataManager?this.localData:this.dataSource;if(!C.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=U(e,this.listBaseOption.fields);if(e&&(i=this.element.querySelector('[data-uid="'+l[this.fields.id]+'"]'),!this.enableVirtualization)&&C.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},g.prototype.selectMultipleItems=function(e){if(!C.isNullOrUndefined(e))for(var t=0;t<e.length;t++)C.isNullOrUndefined(e[parseInt(t.toString(),10)])||this.selectItem(e[parseInt(t.toString(),10)])},g.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},g.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)]);!C.isNullOrUndefined(i)&&i[this.listBaseOption.fields.id]&&this.selectedId.push(i[this.listBaseOption.fields.id])}},g.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=U(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=U(this.getItemData(t),this.listBaseOption.fields),i="string"!=typeof s[0]&&"number"!=typeof s[0]||i?i||(C.isNullOrUndefined(l)||C.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=C.isNullOrUndefined(t)?void 0:{item:t,data:s,text:t.innerText.trim()},!0));return e},g.prototype.findItem=function(e){return this.getItemData(e)},g.prototype.enableItem=function(e){this.setItemState(e,!0),this.enableVirtualization&&this.virtualizationModule.enableItem(e)},g.prototype.disableItem=function(e){this.setItemState(e,!1),this.enableVirtualization&&this.virtualizationModule.disableItem(e)},g.prototype.setItemState=function(e,t){var e=this.getItemData(e),i=U(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))},g.prototype.showItem=function(e){this.showHideItem(e,!1,""),this.enableVirtualization&&this.virtualizationModule.showItem(e)},g.prototype.hideItem=function(e){this.showHideItem(e,!0,"none"),this.enableVirtualization&&this.virtualizationModule.hideItem(e)},g.prototype.showHideItem=function(e,t,i){var e=this.getItemData(e),s=U(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])},g.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)},g.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=U(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))}},g.prototype.addItemAtIndex=function(e,t,i){return!C.isNullOrUndefined(e)&&0<=e&&e<t.length&&C.isNullOrUndefined(this.listBaseOption.fields.groupBy)?t.splice(e,0,i):t.push(i),t},g.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?C.closest(i,"ul"):null),r=n?s:[e];if(!!i&&!i.classList.contains(p.hasChild)&&(s=L.ListBase.createListItemFromJson(this.createElement,r,this.listBaseOption,null,null,this),this.setAttributes(s),l.insertBefore(s[0],i),C.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)},g.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)},g.prototype.addListItem=function(e,t,i,s){var n=this.getLiFromObjOrElement(s[t+1])||this.getLiFromObjOrElement(s[t+2])||null,e=L.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)},g.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)},g.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)&&(C.isNullOrUndefined(e.nextElementSibling)||e.nextElementSibling&&e.nextElementSibling.classList.contains(p.groupListItem))&&(s=e.previousElementSibling),e&&C.detach(e),s&&C.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=L.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)))},g.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()},g.prototype.removeMultipleItems=function(e){if(e.length)for(var t=0;t<e.length;t++)this.removeItem(e[parseInt(t.toString(),10)])},g.prototype.findParent=function(e,t,i,s){if(Object.prototype.hasOwnProperty.call(e,t)&&!0===i(e[t]))return C.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},g.prototype.getModuleName=function(){return"listview"},g.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"virtualization",name:"Virtualization"}),e},g.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},g.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition","selectedId"])},i([C.Property("")],g.prototype,"cssClass",void 0),i([C.Property(!1)],g.prototype,"enableVirtualization",void 0),i([C.Property({})],g.prototype,"htmlAttributes",void 0),i([C.Property(!0)],g.prototype,"enable",void 0),i([C.Property([])],g.prototype,"dataSource",void 0),i([C.Property()],g.prototype,"query",void 0),i([C.Complex(L.ListBase.defaultMappedFields,z)],g.prototype,"fields",void 0),i([C.Property({effect:"SlideLeft",duration:400,easing:"ease"})],g.prototype,"animation",void 0),i([C.Property("None")],g.prototype,"sortOrder",void 0),i([C.Property(!1)],g.prototype,"showIcon",void 0),i([C.Property(!1)],g.prototype,"showCheckBox",void 0),i([C.Property("Left")],g.prototype,"checkBoxPosition",void 0),i([C.Property("")],g.prototype,"headerTitle",void 0),i([C.Property(!1)],g.prototype,"showHeader",void 0),i([C.Property(!0)],g.prototype,"enableHtmlSanitizer",void 0),i([C.Property("")],g.prototype,"height",void 0),i([C.Property("")],g.prototype,"width",void 0),i([C.Property(null)],g.prototype,"template",void 0),i([C.Property(null)],g.prototype,"headerTemplate",void 0),i([C.Property(null)],g.prototype,"groupTemplate",void 0),i([C.Event()],g.prototype,"select",void 0),i([C.Event()],g.prototype,"actionBegin",void 0),i([C.Event()],g.prototype,"actionComplete",void 0),i([C.Event()],g.prototype,"actionFailure",void 0),i([C.Event()],g.prototype,"scroll",void 0);var m,t=i([C.NotifyPropertyChanges],g);function g(e,t){e=m.call(this,e,t)||this;return e.previousSelectedItems=[],e.hiddenItems=[],e.enabledItems=[],e.disabledItems=[],e}I.prototype.isNgTemplate=function(){return!C.isNullOrUndefined(this.listViewInstance.templateRef)&&"string"!=typeof this.listViewInstance.templateRef},I.prototype.isVueFunctionTemplate=function(){return this.listViewInstance.isVue&&"function"==typeof this.listViewInstance.template},I.prototype.uiVirtualization=function(){this.wireScrollEvent(!1);var e=this.listViewInstance.curViewDS,t=e.slice(0,1),t=(this.listViewInstance.ulElement=this.listViewInstance.curUL=L.ListBase.createList(this.listViewInstance.createElement,t,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.domItemCount=this.ValidateItemCount(Object.keys(this.listViewInstance.curViewDS).length),this.uiFirstIndex=0,this.uiLastIndex=this.domItemCount-1,e.slice(1,this.domItemCount)),t=L.ListBase.createListItemFromJson(this.listViewInstance.createElement,t,this.listViewInstance.listBaseOption,null,null,this.listViewInstance);C.append(t,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="0px",this.bottomElement.style.height=this.totalHeight+"px",this.topElementHeight=0,this.bottomElementHeight=this.totalHeight,this.listDiff=0,this.uiIndicesInitialization()},I.prototype.wireScrollEvent=function(e){e?!0===this.listViewInstance.isWindow?(window.removeEventListener("scroll",this.onVirtualScroll),window.removeEventListener("scroll",this.updateUl)):C.EventHandler.remove(this.listViewInstance.element,"scroll",this.onVirtualUiScroll):this.listViewInstance.isWindow?(this.onVirtualScroll=this.onVirtualUiScroll.bind(this),window.addEventListener("scroll",this.onVirtualScroll)):C.EventHandler.add(this.listViewInstance.element,"scroll",this.onVirtualUiScroll,this)},I.prototype.ValidateItemCount=function(e){var t=parseFloat(C.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},I.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),C.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},I.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")},I.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},I.prototype.onVirtualUiScroll=function(){var e,t,i=this.listViewInstance.curViewDS,i=(this.listItemHeight=C.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=C.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},I.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},I.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--}},I.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=L.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]:L.ListBase.generateId(),e.getElementsByClassName(p.listItemText)[0].innerHTML=s[parseInt(t.toString(),10)][this.listViewInstance.fields.text]),this.listViewInstance.showIcon&&(e.querySelector("."+p.listIcon)&&C.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),C.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))))},I.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"),C.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)))},I.prototype.findDSAndIndexFromId=function(e,i){var s=this,n={};return i=this.listViewInstance.getElementUID(i),C.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},I.prototype.getSelectedItems=function(){var t=this;if(!C.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])}}},I.prototype.selectItem=function(e){var t,i,s,n=this.findDSAndIndexFromId(this.listViewInstance.curViewDS,e);Object.keys(n).length?(t=this.activeIndex===n.index,i=void 0,this.activeIndex=n.index,this.listViewInstance.showCheckBox&&(-1===this.uiIndices.activeIndices.indexOf(n.index)?(i=!0,this.uiIndices.activeIndices.push(n.index)):(i=!1,this.uiIndices.activeIndices.splice(this.uiIndices.activeIndices.indexOf(n.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=void 0,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?(n.isChecked=i,this.listViewInstance.trigger("select",n)):t||(this.listViewInstance.removeSelect(),this.listViewInstance.trigger("select",n)))):C.isNullOrUndefined(e)&&!this.listViewInstance.showCheckBox&&(this.listViewInstance.removeSelect(),this.activeIndex=void 0)},I.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)},I.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)},I.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)},I.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)},I.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")},I.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)},I.prototype.setSelectLI=function(e,t){this.activeIndex=Array.prototype.indexOf.call(this.listViewInstance.curUL.querySelectorAll("li"),e)+this.uiFirstIndex},I.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=[]},I.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)},I.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?(C.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)},I.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})},I.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())}},I.prototype.createAndInjectNewItem=function(e,t){var e=L.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()},I.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),!C.isNullOrUndefined(this.listViewInstance.virtualCheckBox))&&!C.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=C.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)})}}},I.prototype.reRenderUiVirtualization=function(){this.wireScrollEvent(!0),this.listViewInstance.contentContainer&&C.detach(this.listViewInstance.contentContainer),this.listViewInstance.preRender(),this.domItemCount=0,this.listViewInstance.header(),this.listViewInstance.setLocalData()},I.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]||L.ListBase.generateId(),n(s,e,this)):this.updateUiContent(e,t),this.changeElementAttributes(e,t),i&&this.listViewInstance.ulElement.insertBefore(e,i)},I.prototype.onChange=function(e,t,i){e=L.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)})},I.prototype.onNgChange=function(e,t,i){for(i=C.compile(i.listViewInstance.template)(e);t.lastChild;)t.removeChild(t.lastChild);t.appendChild(i[0])},I.prototype.getModuleName=function(){return"virtualization"},I.prototype.destroy=function(){this.wireScrollEvent(!0),this.topElement=null,this.bottomElement=null};i=I;function I(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=C.Base,W(x,b),(S=x).prototype.bind=function(){this.element.id||(this.element.id=C.getUniqueID("sortable")),this.itemClass||(this.itemClass="e-sort-item",this.dataBind()),this.initializeDraggable()},x.prototype.initializeDraggable=function(){new C.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;C.EventHandler.add(e,"keydown",this.keyDownHandler,this)},x.prototype.unwireEvents=function(){var e=this.element;C.EventHandler.remove(e,"keydown",this.keyDownHandler)},x.prototype.keyDownHandler=function(e){27===e.keyCode&&((e=C.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&&C.compareElementParent(e,t.element)&&e.classList.contains(t.itemClass)&&!e.classList.contains("e-disabled")},x.prototype.removePlaceHolder=function(e){C.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=C.closest(e,".e-"+this.getModuleName()))&&(e=C.getComponent(e,S)).scope&&this.scope&&e.scope===this.scope?e:this},x.prototype.refreshDisabled=function(e,t,i){if(i===this)for(var s,n=void 0,l=e<t,r=l?e:t,a=l?t:e;r<=a;)(n=this.element.children[r]).classList.contains("e-disabled")?(s=this.getIndex(n),this.element.insertBefore(n,this.element.children[l?s+2:s-1]),r=l?s+2:s+1):r++},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,C.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 C.closest(e,"."+(t=void 0===t?this:t).itemClass)},x.prototype.queryPositionInfo=function(e){return e.left=pageXOffset?parseFloat(e.left)-pageXOffset+"px":e.left,e.top=pageYOffset?parseFloat(e.top)-pageYOffset+"px":e.top,e},x.prototype.isPlaceHolderPresent=function(e){return e.placeHolderElement&&!!C.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()),C.getComponent(this.element,C.Draggable).destroy(),b.prototype.destroy.call(this)},x.prototype.getModuleName=function(){return"sortable"},w([C.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([C.Property(null)],x.prototype,"itemClass",void 0),w([C.Property(null)],x.prototype,"scope",void 0),w([C.Property()],x.prototype,"helper",void 0),w([C.Property()],x.prototype,"placeHolder",void 0),w([C.Event()],x.prototype,"drag",void 0),w([C.Event()],x.prototype,"beforeDragStart",void 0),w([C.Event()],x.prototype,"dragStart",void 0),w([C.Event()],x.prototype,"beforeDrop",void 0),w([C.Event()],x.prototype,"drop",void 0),S=w([C.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"),C.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&&C.isNullOrUndefined(i.placeHolder)||i.placeHolderElement&&i.placeHolderElement===e.target)o.curTarget!==o.target&&o.scope&&o.curTarget!==s&&!C.isNullOrUndefined(i.placeHolder)&&(C.remove(o.getSortableInstance(o.curTarget).placeHolderElement),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=C.isNullOrUndefined(n)?o.getIndex(o.target):n,r=o.getIndex(s,i,e.event),a=o.isPlaceHolderPresent(i);if(a&&n===r)return;a&&C.remove(i.placeHolderElement),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]),o.refreshDisabled(n,r,i)}else{n=C.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.refreshDisabled(n,r,i),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),C.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||(C.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,e,n=o.getSortableInstance(o.curTarget),l=o.getIndex(o.target),r=o.isPlaceHolderPresent(n);r&&(e=o.getIndex(n.placeHolderElement,n),e={previousIndex:l,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(n),e.handled&&(e=o.target.cloneNode(!0),o.target.classList.remove("e-grabbed"),o.target=e),n.element.insertBefore(o.target,n.placeHolderElement),e=o.getIndex(o.target,n),l=o===n&&1<l-e?l-1:l,o.trigger("drop",{event:t.event,element:n.element,previousIndex:l,currentIndex:e,target:t.target,helper:t.helper,droppedElement:o.target,scopeName:o.scope,handled:s})),C.remove(n.placeHolderElement)})),n=o.getSortableInstance(t.target),i=n.element.childElementCount,l=o.getIndex(o.target),n.element.querySelector(".e-list-nrt")&&(i-=1),o.curTarget===o.target&&t.target===o.curTarget&&(i=l),n.element!==t.target&&(r||o.curTarget!==o.target)||(e={previousIndex:l,currentIndex:i,target:t.target,droppedElement:o.target,helper:t.helper,cancel:!1},o.trigger("beforeDrop",e,function(e){(n.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(n),n.element.appendChild(o.target),o.trigger("drop",{event:t.event,element:n.element,previousIndex:l,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,C.remove(t.helper),C.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),C.isNullOrUndefined(s)?l.forEach(function(e){i.appendChild(e)}):(n=i.children[s],l.forEach(function(e){i.insertBefore(e,n)}))}L.FieldSettings=z,L.ListView=t,L.Sortable=W,L.Virtualization=i,L.classNames=p,L.getFieldValues=U,L.moveTo=_,Object.defineProperty(L,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-lists.umd.min.js.map