@syncfusion/ej2-lists
Advanced tools
Comparing version 16.1.35 to 16.1.37
@@ -5,2 +5,4 @@ # Changelog | ||
## 16.1.35 (2018-04-17) | ||
### ListView | ||
@@ -7,0 +9,0 @@ |
/*! | ||
* filename: ej2-lists.umd.min.js | ||
* version : 16.1.35 | ||
* version : 16.1.37 | ||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. | ||
@@ -10,3 +10,3 @@ * Use of this code is subject to the terms of our license. | ||
*/ | ||
!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 r(e,i){var s,r={};if(t.isNullOrUndefined(e))return e;if("string"==typeof e||"number"==typeof e)return e;if(t.isNullOrUndefined(e.isHeader))for(var o=0,n=Object.keys(i);o<n.length;o++){var a=n[o];if(!t.isNullOrUndefined(i[a])&&"string"==typeof i[a]){var l=i[a].split("."),c=l.length>1?l[0]:i[a];t.isNullOrUndefined(e[c])||(s=t.getValue(i[a],e),t.isNullOrUndefined(s)||(r[i[a]]=s))}}else!t.isNullOrUndefined(e.isHeader)&&e.isHeader&&(r=e);return 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"},function(s){function o(e,t,i){return C(n(e,t,i),null,i)}function n(i,s,r){var o=[],n=t.extend({},x,r);e.cssClass=g(n.moduleName);for(var a=y(),l=0;l<i.length;l++)if(!t.isNullOrUndefined(i[l])){var c=void 0;if(n.itemCreating&&"function"==typeof n.itemCreating){var d={dataSource:i,curData:i[l],text:i[l],options:n};n.itemCreating(d)}if(c=s?v(i[l],null,null,[],null,a,l,r):b(i[l],null,null,r),n.itemCreated&&"function"==typeof n.itemCreated){d={dataSource:i,curData:i[l],text:i[l],item:c,options:n};n.itemCreated(d)}o.push(c)}return o}function a(i,o,n,a){var c=t.extend({},x,o);e.cssClass=g(c.moduleName);var d,h=t.extend({},s.defaultMappedFields,c.fields),u=t.extend({},S,c.ariaAttributes);n&&(u.level=n);var f,L=[];Object.keys(i).length&&!p(i).item.hasOwnProperty(h.id)&&(d=y());for(var C=0;C<i.length;C++){var O=r(i[C],h);if(!t.isNullOrUndefined(i[C])){if(c.itemCreating&&"function"==typeof c.itemCreating){var I={dataSource:i,curData:i[C],text:O[h.text],options:c,fields:h};c.itemCreating(I)}var w=i[C];c.itemCreating&&"function"==typeof c.itemCreating&&(O=r(i[C],h)),Object.keys(i).length&&O.hasOwnProperty(h.id)&&!t.isNullOrUndefined(O[h.id])&&(d=O.id);var k=[];if(c.showCheckBox&&k.push(t.createElement("input",{className:e.cssClass.check,attrs:{type:"checkbox"}})),!0===a)c.showIcon&&O.hasOwnProperty(h.iconCss)&&(t.isNullOrUndefined(O[h.iconCss])||k.push(t.createElement("span",{className:e.cssClass.icon+" "+O[h.iconCss]}))),f=v(w,h,c.itemClass,k,!(!w.hasOwnProperty("isHeader")||!w.isHeader),d,C,o);else{if((f=b(w,h,c.itemClass,o)).classList.add(e.cssClass.level+"-"+u.level),f.setAttribute("aria-level",u.level.toString()),O.hasOwnProperty(h.tooltip)&&f.setAttribute("title",O[h.tooltip]),O.hasOwnProperty(h.htmlAttributes)&&O[h.htmlAttributes]&&m(f,O[h.htmlAttributes]),O.hasOwnProperty(h.enabled)&&!1===O[h.enabled]&&f.classList.add(e.cssClass.disabled),O.hasOwnProperty(h.isVisible)&&!1===O[h.isVisible]&&(f.style.display="none"),O.hasOwnProperty(h.imageUrl)&&!t.isNullOrUndefined(O[h.imageUrl])){var D={src:O[h.imageUrl]};O.hasOwnProperty(h.imageUrl)&&t.merge(D,O[h.imageAttributes]),t.prepend([t.createElement("img",{className:e.cssClass.image,attrs:D})],f.firstElementChild)}c.showIcon&&O.hasOwnProperty(h.iconCss)&&!c.template&&(t.isNullOrUndefined(O[h.iconCss])||t.prepend([t.createElement("div",{className:e.cssClass.icon+" "+O[h.iconCss]})],f.firstElementChild)),k.length&&t.prepend(k,f.firstElementChild),function(i,s,o,n,a,c){var d=r(i,s),h=d[s.child]||[],u=d[s.hasChildren];if(h.length&&(u=!0,a.classList.add(e.cssClass.hasChild),n.processSubChild)){var p=l(h,n,++c);a.appendChild(p)}if(n.expandCollapse&&u&&!n.template){a.firstElementChild.classList.contains(e.cssClass.textContent)&&a.firstElementChild.classList.add(e.cssClass.iconWrapper);var m="Left"===n.expandIconPosition?t.prepend:t.append;m([t.createElement("div",{className:"e-icons "+n.expandIconClass})],a.querySelector("."+e.cssClass.textContent))}}(w,h,0,c,f,u.level)}if(c.itemCreated&&"function"==typeof c.itemCreated){I={dataSource:i,curData:i[C],text:O[h.text],item:f,options:c,fields:h};c.itemCreated(I)}L.push(f)}}return L}function l(e,i,s,r){var o=t.extend({},x,i);return C(a(e,i,s,r),o.listClass,i)}function c(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 r=0;r<s.queries.length;r++)"onSortBy"===s.queries[r].fn&&s.queries.splice(r,1);return s}function h(e,t){return new i.DataManager(e).executeLocal(t)}function u(e,i){var r=t.extend({},x,i),o=t.extend({},s.defaultMappedFields,r.fields),n=e.cloneNode(!0),a=[];n.classList.add("json-parent");var l=n.querySelectorAll(".json-parent>li");n.classList.remove("json-parent");for(var c=0;c<l.length;c++){for(var d=l[c],h=d.querySelector("a"),p=d.querySelector("ul"),m={},v=h?h.childNodes:d.childNodes,g=Object.keys(v),L=0;L<v.length;L++)v[Number(g[L])].hasChildNodes()||(m[o.text]=v[Number(g[L])].textContent);m[o.id]=y();var b=f(d);Object.keys(b).length&&(m[o.htmlAttributes]=b),h&&(b=f(h),Object.keys(b).length&&(m[o.urlAttributes]=b)),p&&(m[o.child]=u(p,i)),a.push(m)}return a}function p(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 m(e,i){var s={};t.merge(s,i),s.class&&(t.addClass([e],s.class.split(" ")),delete s.class),t.attributes(e,s)}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 y(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function v(i,s,o,n,a,l,c,d){var h,u=t.extend({},x,d),p=t.extend({},S,u.ariaAttributes),f=i,y=i,v=r(i,s);"string"!=typeof i&&"number"!=typeof i&&(h=i,f="boolean"==typeof v[s.text]||"number"==typeof v[s.text]?v[s.text]:v[s.text]||"",y=v[s.value]);var g;g=t.isNullOrUndefined(h)||t.isNullOrUndefined(v[s.id])||""===v[s.id]?l+"-"+c:l;var b=t.createElement("li",{className:(!0===a?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(o)?"":o),id:g,attrs:""!==p.groupItemRole&&""!==p.itemRole?{role:!0===a?p.groupItemRole:p.itemRole}:{}});return h&&v.hasOwnProperty(s.enabled)&&"false"===v[s.enabled].toString()&&b.classList.add(e.cssClass.disabled),a?b.innerText=f:(t.isNullOrUndefined(y)||b.setAttribute("data-value",y),b.setAttribute("role","option"),h&&v.hasOwnProperty(s.htmlAttributes)&&v[s.htmlAttributes]&&m(b,v[s.htmlAttributes]),n.length&&t.append(n,b),h&&v.hasOwnProperty(s.url)&&v[s.url]?b.appendChild(L(h,s,f)):b.appendChild(document.createTextNode(f))),b}function g(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"}}function L(i,s,o){var n=r(i,s),a={href:n[s.url]};n.hasOwnProperty(s.urlAttributes)&&n[s.urlAttributes]&&t.merge(a,n[s.urlAttributes]);var l=t.createElement("a",{className:e.cssClass.text+" "+e.cssClass.url,innerHTML:o});return m(l,a),l}function b(i,s,o,n){var a,l,c,d,h=t.extend({},x,n),u=t.extend({},S,h.ariaAttributes),p=i;"string"!=typeof i&&(c=i,p=(d=r(i,s))[s.text]||"",a=d[s.id],l=!(!i.hasOwnProperty("isHeader")||!i.isHeader));var m=t.createElement("li",{className:(!0===l?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(o)?"":o),attrs:""!==u.groupItemRole&&""!==u.itemRole?{role:!0===l?u.groupItemRole:u.itemRole}:{}});if(t.isNullOrUndefined(a)?m.setAttribute("data-uid",y()):m.setAttribute("data-uid",a),l&&n&&n.groupTemplate){var f=t.compile(n.groupTemplate);t.append(f(i),m)}else if(!l&&n&&n.template){f=t.compile(n.template);t.append(f(i),m)}else{var v=t.createElement("div",{className:e.cssClass.textContent,attrs:""!==u.wrapperRole?{role:u.wrapperRole}:{}});c&&d.hasOwnProperty(s.url)&&d[s.url]?v.appendChild(L(c,s,p)):v.appendChild(t.createElement("span",{className:e.cssClass.text,innerHTML:p,attrs:""!==u.itemText?{role:u.itemText}:{}})),m.appendChild(v)}return m}function C(i,s,r){var o=t.extend({},x,r),n=t.extend({},S,o.ariaAttributes);e.cssClass=g(o.moduleName);var a=t.createElement("ul",{className:e.cssClass.ul+" "+(t.isNullOrUndefined(s)?"":s),attrs:""!==n.listRole?{role:n.listRole}:{}});return t.append(i,a),a}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};var S={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},x={showCheckBox:!1,showIcon:!1,expandCollapse:!1,fields:s.defaultMappedFields,ariaAttributes:S,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right"};s.createList=function(e,i,s){var r=t.extend({},x,i),n=t.extend({},S,r.ariaAttributes),a=p(e).typeof;return"string"===a||"number"===a?o(e,s,i):l(e,i,n.level,s)},s.createListFromArray=o,s.createListItemFromArray=n,s.createListItemFromJson=a,s.createListFromJson=l,s.getSiblingLI=function(i,s,r){if(e.cssClass=g(x.moduleName),i&&i.length){var o,n,a=Array.prototype.slice.call(i);for(o=a[(n=s?c(s,a):!0===r?a.length:-1)+(!0===r?-1:1)];o&&(!t.isVisible(o)||o.classList.contains(e.cssClass.disabled));)o=a[n+=!0===r?-1:1];return o}},s.indexOf=c,s.groupDataSource=function(e,t,s){void 0===s&&(s="None");var r=(new i.Query).group(t.groupBy),o=h(e,r=d(s,"key",r));e=[];for(var n=0;n<o.length;n++){var a=o[n].items,l={};l[t.text]=o[n].key,l.isHeader=!0,l.items=a,e.push(l);for(var c=0;c<a.length;c++)e.push(a[c])}return e},s.addSorting=d,s.getDataSource=h,s.createJsonFromElement=u,s.renderContentTemplate=function(i,s,o,n){e.cssClass=g(x.moduleName);for(var a=t.createElement("ul",{className:e.cssClass.ul,attrs:{role:"presentation"}}),l=t.extend({},x,n),c=t.compile(i),d=[],h=y(),u=0;u<s.length;u++){var p=r(s[u],o),m=s[u],f=m.isHeader,v="string"==typeof m||"number"==typeof m?m:p[o.value];if(l.itemCreating&&"function"==typeof l.itemCreating){var L={dataSource:s,curData:m,text:v,options:l,fields:o};l.itemCreating(L)}l.itemCreating&&"function"==typeof l.itemCreating&&(v=(p=r(s[u],o))[o.value]);var b=t.createElement("li",{id:h+"-"+u,className:f?e.cssClass.group:e.cssClass.li,attrs:{role:"presentation"}});f?b.innerText=p[o.text]:(t.append(c(m),b),b.setAttribute("data-value",v),b.setAttribute("role","option")),l.itemCreated&&"function"==typeof l.itemCreated&&(L={dataSource:s,curData:m,text:v,item:b,options:l,fields:o},l.itemCreated(L)),d.push(b)}return t.append(d,a),a},s.renderGroupTemplate=function(e,i,s,r){for(var o=t.compile(e),n=s.groupBy,a={},l=0,c=r;l<c.length;l++){var d=c[l];a[n]=d.textContent,d.innerHTML="",t.append(o(a),d)}return r},s.generateUL=C,s.generateIcon=function(i,s,r){var o=t.extend({},x,r);return t.extend({},S,o.ariaAttributes),e.cssClass=g(o.moduleName),("Left"===o.expandIconPosition?t.prepend:t.append)([t.createElement("div",{className:"e-icons "+o.expandIconClass+" "+(t.isNullOrUndefined(s)?"":s)})],i.querySelector("."+e.cssClass.textContent)),i}}(e.ListBase||(e.ListBase={}));var o=function(){var 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])};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)}}(),n=function(e,t,i,s){var r,o=arguments.length,n=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(n=(o<3?r(n):o>3?r(t,i,n):r(t,i))||n);return o>3&&n&&Object.defineProperty(t,i,n),n},a={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},l={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},c="e-listview",d="e-hover",h="e-active",u="e-focused",p="e-list-parent",m="e-list-item",f="e-list-group-item",y="e-has-child",v="e-list-header",g="e-headertext",L="e-text",b="e-disabled",C="e-content",S="e-icons",x="e-icon-back",O="e-checkbox-wrapper",I="e-checkbox",w="e-check",k="e-frame",D="e-checkbox-right",E="e-checkbox-left",N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return o(i,e),n([t.Property("id")],i.prototype,"id",void 0),n([t.Property("text")],i.prototype,"text",void 0),n([t.Property("isChecked")],i.prototype,"isChecked",void 0),n([t.Property("isVisible")],i.prototype,"isVisible",void 0),n([t.Property("enabled")],i.prototype,"enabled",void 0),n([t.Property("iconCss")],i.prototype,"iconCss",void 0),n([t.Property("child")],i.prototype,"child",void 0),n([t.Property("tooltip")],i.prototype,"tooltip",void 0),n([t.Property("groupBy")],i.prototype,"groupBy",void 0),n([t.Property("text")],i.prototype,"sortBy",void 0),n([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),n([t.Property("tableName")],i.prototype,"tableName",void 0),i}(t.ChildProperty),B=function(B){function U(e,i){var s=B.call(this,e,i)||this;return s.curDSLevel=[],s.curViewDS=[],s.keyConfigs={moveDown:"downarrow",moveUp:"uparrow",back:"backspace",home:"home",select:"enter",end:"end",tab:"tab",space:"space"},s.animateOptions={},s.isNestedList=!1,s.currentLiElements=[],s.resetList=!1,s.selectedData=[],s.selectedId=[],s.aniObj=new t.Animation(s.animateOptions),s}return o(U,B),U.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.reRender();break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1);break;case"showHeader":this.header(this.headerTitle,!1);break;case"showCheckBox":case"checkBoxPosition":this.setCheckbox();break;case"dataSource":this.reRender();break;case"sortOrder":case"showIcon":this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList()}}},U.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&t.attributes(this.element,this.htmlAttributes)},U.prototype.setCSSClass=function(e){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),e&&t.removeClass([this.element],e.split(" "))},U.prototype.setSize=function(){this.element.style.height=t.formatUnit(this.height),this.element.style.width=t.formatUnit(this.width)},U.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},U.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},U.prototype.enableElement=function(e,t){t?e.classList.remove(b):e.classList.add(b)},U.prototype.header=function(e,i){if(void 0===this.headerEle&&this.showHeader){this.headerEle=t.createElement("div",{className:v});var s=t.createElement("span",{className:g,innerHTML:this.headerTitle}),r=t.createElement("div",{className:L,innerHTML:s.outerHTML}),o=t.createElement("div",{className:S+" "+x+" e-but-back",attrs:{style:"display:none;"}});this.headerEle.appendChild(o),this.headerEle.appendChild(r),this.element.classList.add("e-has-header"),t.prepend([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";r=this.headerEle.querySelector("."+g),o=this.headerEle.querySelector("."+x);r.innerHTML=e,o.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},U.prototype.switchView=function(e,t,i){var s=this;if(e&&t){var r=e.style.position,o="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var n=void 0,c=this.animation.duration;if(this.animation.effect)n=this.enableRtl?l[this.animation.effect]:a[this.animation.effect];else{n=a.SlideLeft,i=this.enableRtl,c=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?n[0]:n[1],duration:c,timingFunction:this.animation.easing,end:function(t){e.style.display="none",s.element.style.overflow=o,e.style.position=r,e.classList.remove("e-view")}}),t.style.display="",this.aniObj.animate(t,{name:!0===i?n[2]:n[3],duration:c,timingFunction:this.animation.easing,end:function(){s.trigger("actionComplete")}}),this.curUL=t}},U.prototype.preRender=function(){this.listBaseOption={template:this.template,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",ariaAttributes:{itemRole:"listitem",listRole:"list",itemText:"",groupItemRole:"group",wrapperRole:"presentation"},fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon,itemCreated:this.renderCheckbox.bind(this)}},U.prototype.renderCheckbox=function(e){if(this.showCheckBox&&this.isValidLI(e.item)&&!this.isNestedList)if(e.item.classList.contains(y))this.checkboxRevert();else{var t=void 0,i=void 0;(t=s.createCheckBox(!1,{checked:!1,enableRtl:this.enableRtl})).setAttribute("role","checkbox");var o=t.querySelector("."+k);e.item.classList.add("e-checklist"),e.item.firstElementChild.classList.add(I),"string"!=typeof this.dataSource[0]?(i=r(e.curData,this.listBaseOption.fields),!this.resetList&&i[this.listBaseOption.fields.isChecked]?this.checkItem(e,t):-1!==this.selectedData.indexOf(i[this.listBaseOption.fields.text])&&-1!==this.selectedId.indexOf(i[this.listBaseOption.fields.id])&&this.checkItem(e,t)):"string"==typeof this.dataSource[0]&&-1!==this.selectedData.indexOf(e.text)&&this.checkItem(e,t),t.setAttribute("aria-checked",o.classList.contains(w)?"true":"false"),"Left"===this.checkBoxPosition?(t.classList.add(E),e.item.firstElementChild.insertBefore(t,e.item.firstElementChild.childNodes[0])):(t.classList.add(D),e.item.firstElementChild.appendChild(t)),this.currentLiElements.push(e.item)}},U.prototype.checkItem=function(e,t){e.item.classList.add(h),t.querySelector("."+k).classList.add(w),t.setAttribute("aria-checked","true")},U.prototype.checkboxRevert=function(){this.isNestedList=!0,this.setProperties({showCheckBox:!1},!0);for(var e=0;e<this.currentLiElements.length;e++)this.currentLiElements[e].querySelector("."+O)&&(this.currentLiElements[e].firstElementChild.classList.remove(I),this.removeElement(this.currentLiElements[e].firstElementChild.firstElementChild))},U.prototype.setCheckbox=function(){var e=this;if(this.showCheckBox&&!this.curUL.querySelector("."+y)){var t={item:void 0,curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:""};this.liCollection.forEach(function(i){t.item=i,t.curData=e.getItemData(i),i.querySelector("."+O)&&e.removeElement(i.querySelector("."+O)),e.renderCheckbox(t)})}else this.liCollection.forEach(function(t){t.firstElementChild.classList.remove(I),t.querySelector("."+O)&&e.removeElement(t.querySelector("."+O))})},U.prototype.clickHandler=function(e){var i=e.target,s=i.classList;if(s.contains(x)||s.contains(g))this.back();else{var r=t.closest(i.parentNode,"."+m);null===r&&(r=i),this.enable&&this.showCheckBox&&this.isValidLI(r)?this.setCheckboxLI(r,e):this.setSelectLI(r,e)}},U.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},U.prototype.hoverHandler=function(e){var i=t.closest(e.target.parentNode,"."+m);this.setHoverLI(i)},U.prototype.leaveHandler=function(e){this.removeHover()},U.prototype.homeKeyHandler=function(e,t){var i=this.curUL.querySelectorAll("."+m),s=this.curUL.querySelector("."+u)||this.curUL.querySelector("."+h);s&&(s.classList.remove(u),this.showCheckBox||s.classList.remove(h));var r=t?i.length-1:0;i[r].classList.contains(y)||this.showCheckBox?i[r].classList.add(u):this.setSelectLI(i[r],e)},U.prototype.arrowKeyHandler=function(i,s){var r,o;!t.isNullOrUndefined(this.curUL.querySelector("."+y))||this.showCheckBox?(o=this.curUL.querySelector("."+u)||this.curUL.querySelector("."+h),r=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+m),o,s),t.isNullOrUndefined(r)||(o&&(o.classList.remove(u),this.showCheckBox||o.classList.remove(h)),r.classList.contains(y)||this.showCheckBox?r.classList.add(u):this.setSelectLI(r,i))):(o=this.curUL.querySelector("."+h),r=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+m),o,s),this.setSelectLI(r,i))},U.prototype.enterKeyHandler=function(e){var i=!t.isNullOrUndefined(this.curUL.querySelector("."+y)),s=this.curUL.querySelector("."+u);i&&s&&(s.classList.remove(u),this.setSelectLI(s,e))},U.prototype.spaceKeyHandler=function(e){if(this.enable&&this.showCheckBox){var t=this.curUL.querySelector("."+u);this.setCheckboxLI(t,e)}},U.prototype.keyActionHandler=function(e){switch(e.preventDefault(),e.action){case"home":this.homeKeyHandler(e);break;case"end":this.homeKeyHandler(e,!0);break;case"moveDown":this.arrowKeyHandler(e);break;case"moveUp":this.arrowKeyHandler(e,!0);break;case"select":this.enterKeyHandler(e);break;case"back":this.back();break;case"tab":this.tabFocus(e);break;case"space":this.spaceKeyHandler(e)}},U.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&this.back()},U.prototype.focusout=function(){var e=this.curUL.querySelector("."+u),t=this.curUL.querySelector("[aria-selected = true]");e&&!this.showCheckBox&&(e.classList.remove(u),t&&t.classList.add(h))},U.prototype.wireEvents=function(){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.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),this.touchModule=new t.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)})},U.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),this.keyboardModule.destroy(),this.touchModule.destroy()},U.prototype.tabFocus=function(e){if(!this.curUL.querySelector("."+h)&&this.curUL||this.showCheckBox){var i=this.curUL.querySelector("."+m);if(i.classList.contains(y)||this.showCheckBox){var s=this.curUL.querySelector("."+u);t.isNullOrUndefined(s)&&i.classList.add(u)}else this.setSelectLI(i,e)}},U.prototype.removeHover=function(){var e=this.element.querySelector("."+d);e&&e.classList.remove(d)},U.prototype.removeSelect=function(){for(var e=0,t=this.element.querySelectorAll("[aria-selected = true]");e<t.length;e++){var i=t[e];i.removeAttribute("aria-selected"),""!==i.className&&i.classList.remove(h)}},U.prototype.isValidLI=function(e){return e&&e.classList.contains(m)&&!e.classList.contains(f)&&!e.classList.contains(b)},U.prototype.setCheckboxLI=function(e,i){if(this.isValidLI(e)&&this.enable&&this.showCheckBox){this.curUL.querySelector("."+u)&&this.curUL.querySelector("."+u).classList.remove(u),e.classList.add(u);var s=e.querySelector("."+O),r=s.querySelector("."+k+"."+S);if(this.removeHover(),r.classList.contains(w)?(r.classList.remove(w),e.classList.remove(h)):(r.classList.add(w),e.classList.add(h)),s.setAttribute("aria-checked",r.classList.contains(w)?"true":"false"),i){var o=this.selectEventData(e,i);t.merge(o,{isChecked:r.classList.contains(w)}),this.trigger("select",o)}}},U.prototype.selectEventData=function(e,i){var s,o=this.getItemData(e),n=r(o,this.listBaseOption.fields);s=t.isNullOrUndefined(o)&&"string"==typeof this.dataSource[0]?{item:e,text:e.innerText.trim(),data:this.dataSource}:{item:e,text:n[this.listBaseOption.fields.text],data:o};var a={};return t.merge(a,s),i&&t.merge(a,{isInteracted:!0,event:i,index:Array.prototype.indexOf.call(this.curUL.children,e)}),a},U.prototype.setSelectLI=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(h)&&this.enable){this.removeSelect(),e.classList.add(h),e.setAttribute("aria-selected","true"),this.removeHover();var i=this.selectEventData(e,t);this.trigger("select",i),this.selectedLI=e,this.renderSubList(e)}},U.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(d)&&this.enable){var i=this.element.querySelectorAll("."+d);i&&i.length&&t.removeClass(i,d),e.classList.contains(h)&&!this.showCheckBox||e.classList.add(d)}},U.prototype.hoverSiblingLI=function(t){var i,s=this.curUL.querySelector("."+d);if(s||(s=this.curUL.querySelector("."+h)),s)i=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+m),s,t);else if(t){var r=this.curUL.querySelectorAll("."+m);i=r[r.length-1]}else i=this.curUL.querySelector("."+m);this.setHoverLI(i)},U.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var o=s[i];this.curDSJSON=this.findItemFromDS(t,{id:o});var n=r(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?n[this.fields.child]:t}return t}return this.localData},U.prototype.getItemData=function(e){var t=this.getElementUID(e),i=this.dataSource;return this.findItemFromDS(i,t)},U.prototype.findItemFromDS=function(e,i,s){var o,n=this;return e&&e.length&&i?e.some(function(a){var l=r(a,n.listBaseOption.fields);if(!i.id&&!i.text||i.id&&l[n.fields.id]!==i.id||i.text&&l[n.fields.text]!==i.text)if(!t.isNullOrUndefined(i.id)&&t.isNullOrUndefined(l[n.fields.id])){n.element.querySelector('[data-uid="'+i.id+'"]').innerText.trim()===l[n.fields.text]&&(o=a)}else l.hasOwnProperty(n.fields.child)&&l[n.fields.child].length&&(o=n.findItemFromDS(l[n.fields.child],i,s));else o=s?e:a;return!!o}):o=e,o},U.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var r=0,o=Object.keys(this.fields.properties);r<o.length;r++){var n=o[r];"tableName"!==n&&this.fields[n]&&this.fields[n]!==e.ListBase.defaultMappedFields[n]&&-1===t.indexOf(this.fields[n])&&t.push(this.fields[n])}s.select(t),this.fields.properties.hasOwnProperty("tableName")&&s.from(this.fields.tableName)}return s},U.prototype.setViewDataSource=function(t){void 0===t&&(t=this.localData),t&&this.fields.groupBy?this.curViewDS=e.ListBase.groupDataSource(t,this.fields,this.sortOrder):t&&"None"!==this.sortOrder?this.curViewDS=e.ListBase.getDataSource(t,e.ListBase.addSorting(this.sortOrder,this.fields.sortBy)):this.curViewDS=t},U.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},U.prototype.setLocalData=function(){var s=this;if(this.trigger("actionBegin"),this.dataSource instanceof i.DataManager)this.dataSource.executeQuery(this.getQuery()).then(function(e){s.isDestroyed||(s.localData=e.result,s.renderList(),s.trigger("actionComplete",e))}).catch(function(e){s.isDestroyed||s.trigger("actionFailure",e)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var r=this.element.querySelector("ul");r&&(t.remove(r),this.setProperties({dataSource:e.ListBase.createJsonFromElement(r)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},U.prototype.reRender=function(){this.element.innerHTML="",this.curUL=this.headerEle=void 0,this.setLocalData(),this.header()},U.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},U.prototype.createList=function(){this.currentLiElements=[],this.ulElement=this.curUL=e.ListBase.createList(this.curViewDS,this.listBaseOption),this.liCollection=this.curUL.querySelectorAll("."+m)},U.prototype.renderSubList=function(i){var s=i.getAttribute("data-uid");if(i.classList.contains(y)&&s){var o=t.closest(i.parentNode,"."+p),n=this.element.querySelector("[pid='"+s+"']");this.curDSLevel.push(s),this.setViewDataSource(this.getSubDS()),n||((n=e.ListBase.createListFromJson(this.curViewDS,this.listBaseOption,this.curDSLevel.length)).setAttribute("pID",s),n.style.display="none",this.renderIntoDom(n)),this.switchView(o,n),this.liCollection=this.curUL.querySelectorAll("."+m);var a=r(this.getSelectedItems().data,this.listBaseOption.fields);this.header(a[this.listBaseOption.fields.text],!0),this.selectedLI=void 0}},U.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},U.prototype.renderList=function(){this.setViewDataSource(),this.createList(),this.contentContainer=t.createElement("div",{className:C}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement)},U.prototype.getElementUID=function(e){var t={};return e instanceof Element?t.id=e.getAttribute("data-uid"):t=e,t},U.prototype.render=function(){this.element.classList.add(c),t.attributes(this.element,{role:"list",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:"."+m})},U.prototype.destroy=function(){this.unWireEvents();var e=[c,this.cssClass,b,"e-rtl","e-has-header"];t.removeClass([this.element],e),this.rippleFn(),B.prototype.destroy.call(this)},U.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 t=this.element.querySelector("[data-uid='"+e+"']"),i=this.curUL;t?t=t.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),t=this.curUL);var s=r(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(i,t,!0),this.removeSelect(),this.liCollection=this.curUL.querySelectorAll("."+m),this.header(this.curDSLevel.length?s:this.headerTitle,!!this.curDSLevel.length)}},U.prototype.selectItem=function(e){t.isNullOrUndefined(e)||(this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):this.setSelectLI(this.getLiFromObjOrElement(e)))},U.prototype.getLiFromObjOrElement=function(e){var i;if(!t.isNullOrUndefined(e))if("string"==typeof this.dataSource[0]){for(var s=e.getAttribute("data-uid").toString(),o=0;o<this.liCollection.length;o++)if(this.liCollection[o].getAttribute("data-uid").toString()===s){i=this.liCollection[o];break}}else{var n=this.getItemData(e),a=r(n,this.listBaseOption.fields);if(n&&(i=this.element.querySelector('[data-uid="'+a[this.fields.id]+'"]'),t.isNullOrUndefined(i))){var l=this.element.querySelectorAll("."+m);for(o=0;o<l.length;o++)l[o].innerText.trim()===n.text&&(i=l[o])}}return i},U.prototype.selectMultipleItems=function(e){if(!t.isNullOrUndefined(e))for(var i=0;i<e.length;i++)t.isNullOrUndefined(e[i])||this.selectItem(e[i])},U.prototype.getSelectedItems=function(){if(this.selectedId=[],this.showCheckBox){var e=this.element.getElementsByClassName(h),i=[],s=[];this.selectedId=[];for(var o=0;o<e.length;o++)if("string"==typeof this.dataSource[0])i.push(e[o].innerText.trim());else{var n=r(this.getItemData(e[o]),this.listBaseOption.fields);i.push(n[this.listBaseOption.fields.text]),s.push(this.getItemData(e[o])),this.selectedId.push(n[this.listBaseOption.fields.id])}return"string"==typeof this.dataSource[0]?{item:e,data:this.dataSource,text:i}:{item:e,data:s,text:i}}var a=this.element.getElementsByClassName(h)[0];n=r(this.getItemData(a),this.listBaseOption.fields);return"string"==typeof this.dataSource[0]?t.isNullOrUndefined(a)?void 0:{item:a,data:this.dataSource,text:a.innerText.trim()}:t.isNullOrUndefined(n)||t.isNullOrUndefined(a)?void 0:(this.selectedId.push(n[this.listBaseOption.fields.id]),{text:n[this.listBaseOption.fields.text],item:a,data:this.getItemData(a)})},U.prototype.findItem=function(e){return this.getItemData(e)},U.prototype.enableItem=function(e){this.setItemState(e,!0)},U.prototype.disableItem=function(e){this.setItemState(e,!1)},U.prototype.setItemState=function(e,t){var i=this.getItemData(e),s=r(i,this.listBaseOption.fields);if(i){var o=this.element.querySelector('[data-uid="'+s[this.fields.id]+'"]');t?(o&&o.classList.remove(b),delete i[this.fields.enabled]):t||(o&&o.classList.add(b),i[this.fields.enabled]=!1)}},U.prototype.showItem=function(e){this.showHideItem(e,!1,"")},U.prototype.hideItem=function(e){this.showHideItem(e,!0,"none")},U.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e),o=r(s,this.listBaseOption.fields);if(s){var n=this.element.querySelector('[data-uid="'+o[this.fields.id]+'"]');n&&(n.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},U.prototype.addItem=function(e,t){var i=this.findItemFromDS(this.dataSource,t),s=r(i,this.listBaseOption.fields)[this.fields.child];s||(s=[]),s=s.concat(e),i instanceof Array?(this.dataSource=this.localData=i.concat(e),this.setViewDataSource()):i[this.fields.child]=s,this.resetCurrentList()},U.prototype.removeItem=function(e){this.removeItemFromList(e,!0)},U.prototype.removeItemFromList=function(e,i){var s=this,o=!1;if("string"==typeof this.dataSource[0]){if("object"==typeof e){var n=[],a=0;this.liCollection.forEach(function(t){t===e?(o=!0,s.removeElement(t),s.dataSource.splice(a,1),s.localData=s.dataSource):n.push(t),a++}),this.liCollection=n}else if("string"==typeof e){var l=[],c=0,d=[];this.liCollection.forEach(function(t){t.innerText.trim()===e?(o=!0,s.removeElement(t)):(l.push(t),d.push(s.dataSource[c])),c++}),this.localData=this.curViewDS=this.dataSource=d,this.liCollection=l}var u=this.getSelectedItems();if(this.selectedData=t.isNullOrUndefined(u)?void 0:u.text,void 0,i&&o){if(this.resetList=!0,this.resetCurrentList(),!this.showCheckBox&&this.selectedData&&this.selectedData.length){this.removeSelect();var p=this.dataSource.lastIndexOf(this.selectedData);this.liCollection[p].classList.add(h),this.liCollection[p].setAttribute("aria-selected","true")}this.resetList=!1}}else{t.isNullOrUndefined(this.getSelectedItems())?void 0:this.getSelectedItems().data;var m,f=this.getElementUID(e),y=this.findItemFromDS(this.dataSource,f,!0);if(y&&e){var v;y.some(function(e,t,i){var o=r(e,s.listBaseOption.fields);return!(!f.id&&!f.text||f.id&&o[s.fields.id]!==f.id||f.text&&o[s.fields.text]!==f.text)&&(m=i,v=t,!0)}),this.removeElement(this.getLiFromObjOrElement(m[v])),m.splice(v,1),this.curViewDS=m}u=this.getSelectedItems();this.selectedData=t.isNullOrUndefined(u)?void 0:u.text,i&&m&&(this.resetList=!0,this.resetCurrentList(),this.showCheckBox||t.isNullOrUndefined(u)||this.selectItem(u.item),this.resetList=!1)}},U.prototype.removeMultipleItems=function(e){if(e.length)for(var t=0;t<e.length;t++)t===e.length-1?this.removeItemFromList(e[t],!0):this.removeItemFromList(e[t],!1)},U.prototype.getModuleName=function(){return"listview"},U.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition"])},n([t.Property()],U.prototype,"cssClass",void 0),n([t.Property({})],U.prototype,"htmlAttributes",void 0),n([t.Property(!0)],U.prototype,"enable",void 0),n([t.Property([])],U.prototype,"dataSource",void 0),n([t.Property()],U.prototype,"query",void 0),n([t.Complex(e.ListBase.defaultMappedFields,N)],U.prototype,"fields",void 0),n([t.Property({effect:"SlideLeft",duration:400,easing:"ease"})],U.prototype,"animation",void 0),n([t.Property("None")],U.prototype,"sortOrder",void 0),n([t.Property(!1)],U.prototype,"showIcon",void 0),n([t.Property(!1)],U.prototype,"showCheckBox",void 0),n([t.Property("Left")],U.prototype,"checkBoxPosition",void 0),n([t.Property("")],U.prototype,"headerTitle",void 0),n([t.Property(!1)],U.prototype,"showHeader",void 0),n([t.Property("")],U.prototype,"height",void 0),n([t.Property("")],U.prototype,"width",void 0),n([t.Property(null)],U.prototype,"template",void 0),n([t.Property(null)],U.prototype,"groupTemplate",void 0),n([t.Event()],U.prototype,"select",void 0),n([t.Event()],U.prototype,"actionBegin",void 0),n([t.Event()],U.prototype,"actionComplete",void 0),n([t.Event()],U.prototype,"actionFailure",void 0),U=n([t.NotifyPropertyChanges],U)}(t.Component);e.FieldSettings=N,e.ListView=B,e.getFieldValues=r,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!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 r(e,i){var s,r={};if(t.isNullOrUndefined(e))return e;if("string"==typeof e||"number"==typeof e)return e;if(t.isNullOrUndefined(e.isHeader))for(var o=0,l=Object.keys(i);o<l.length;o++){var a=l[o];if(!t.isNullOrUndefined(i[a])&&"string"==typeof i[a]){var n=i[a].split("."),c=n.length>1?n[0]:i[a];t.isNullOrUndefined(e[c])||(s=t.getValue(i[a],e),t.isNullOrUndefined(s)||(r[i[a]]=s))}}else!t.isNullOrUndefined(e.isHeader)&&e.isHeader&&(r=e);return 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"},function(s){function o(e,t,i){return b(l(e,t,i),null,i)}function l(i,s,r){var o=[],l=t.extend({},x,r);e.cssClass=L(l.moduleName);for(var a=y(),n=0;n<i.length;n++)if(!t.isNullOrUndefined(i[n])){var c=void 0;if(l.itemCreating&&"function"==typeof l.itemCreating){var d={dataSource:i,curData:i[n],text:i[n],options:l};l.itemCreating(d)}if(c=s?v(i[n],null,null,[],null,a,n,r):S(i[n],null,null,r),l.itemCreated&&"function"==typeof l.itemCreated){d={dataSource:i,curData:i[n],text:i[n],item:c,options:l};l.itemCreated(d)}o.push(c)}return o}function a(i,o,l,a){var c=t.extend({},x,o);e.cssClass=L(c.moduleName);var d,h=t.extend({},s.defaultMappedFields,c.fields),u=t.extend({},C,c.ariaAttributes);l&&(u.level=l);var f,g=[];Object.keys(i).length&&!p(i).item.hasOwnProperty(h.id)&&(d=y());for(var b=0;b<i.length;b++){var O=r(i[b],h);if(!t.isNullOrUndefined(i[b])){if(c.itemCreating&&"function"==typeof c.itemCreating){var I={dataSource:i,curData:i[b],text:O[h.text],options:c,fields:h};c.itemCreating(I)}var k=i[b];c.itemCreating&&"function"==typeof c.itemCreating&&(O=r(i[b],h)),Object.keys(i).length&&O.hasOwnProperty(h.id)&&!t.isNullOrUndefined(O[h.id])&&(d=O.id);var w=[];if(c.showCheckBox&&w.push(t.createElement("input",{className:e.cssClass.check,attrs:{type:"checkbox"}})),!0===a)c.showIcon&&O.hasOwnProperty(h.iconCss)&&(t.isNullOrUndefined(O[h.iconCss])||w.push(t.createElement("span",{className:e.cssClass.icon+" "+O[h.iconCss]}))),f=v(k,h,c.itemClass,w,!(!k.hasOwnProperty("isHeader")||!k.isHeader),d,b,o);else{if((f=S(k,h,c.itemClass,o)).classList.add(e.cssClass.level+"-"+u.level),f.setAttribute("aria-level",u.level.toString()),O.hasOwnProperty(h.tooltip)&&f.setAttribute("title",O[h.tooltip]),O.hasOwnProperty(h.htmlAttributes)&&O[h.htmlAttributes]&&m(f,O[h.htmlAttributes]),O.hasOwnProperty(h.enabled)&&!1===O[h.enabled]&&f.classList.add(e.cssClass.disabled),O.hasOwnProperty(h.isVisible)&&!1===O[h.isVisible]&&(f.style.display="none"),O.hasOwnProperty(h.imageUrl)&&!t.isNullOrUndefined(O[h.imageUrl])){var D={src:O[h.imageUrl]};O.hasOwnProperty(h.imageUrl)&&t.merge(D,O[h.imageAttributes]),t.prepend([t.createElement("img",{className:e.cssClass.image,attrs:D})],f.firstElementChild)}c.showIcon&&O.hasOwnProperty(h.iconCss)&&!c.template&&(t.isNullOrUndefined(O[h.iconCss])||t.prepend([t.createElement("div",{className:e.cssClass.icon+" "+O[h.iconCss]})],f.firstElementChild)),w.length&&t.prepend(w,f.firstElementChild),function(i,s,o,l,a,c){var d=r(i,s),h=d[s.child]||[],u=d[s.hasChildren];if(h.length&&(u=!0,a.classList.add(e.cssClass.hasChild),l.processSubChild)){var p=n(h,l,++c);a.appendChild(p)}if(l.expandCollapse&&u&&!l.template){a.firstElementChild.classList.contains(e.cssClass.textContent)&&a.firstElementChild.classList.add(e.cssClass.iconWrapper);var m="Left"===l.expandIconPosition?t.prepend:t.append;m([t.createElement("div",{className:"e-icons "+l.expandIconClass})],a.querySelector("."+e.cssClass.textContent))}}(k,h,0,c,f,u.level)}if(c.itemCreated&&"function"==typeof c.itemCreated){I={dataSource:i,curData:i[b],text:O[h.text],item:f,options:c,fields:h};c.itemCreated(I)}g.push(f)}}return g}function n(e,i,s,r){var o=t.extend({},x,i);return b(a(e,i,s,r),o.listClass,i)}function c(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 r=0;r<s.queries.length;r++)"onSortBy"===s.queries[r].fn&&s.queries.splice(r,1);return s}function h(e,t){return new i.DataManager(e).executeLocal(t)}function u(e,i){var r=t.extend({},x,i),o=t.extend({},s.defaultMappedFields,r.fields),l=e.cloneNode(!0),a=[];l.classList.add("json-parent");var n=l.querySelectorAll(".json-parent>li");l.classList.remove("json-parent");for(var c=0;c<n.length;c++){for(var d=n[c],h=d.querySelector("a"),p=d.querySelector("ul"),m={},v=h?h.childNodes:d.childNodes,L=Object.keys(v),g=0;g<v.length;g++)v[Number(L[g])].hasChildNodes()||(m[o.text]=v[Number(L[g])].textContent);m[o.id]=y();var S=f(d);Object.keys(S).length&&(m[o.htmlAttributes]=S),h&&(S=f(h),Object.keys(S).length&&(m[o.urlAttributes]=S)),p&&(m[o.child]=u(p,i)),a.push(m)}return a}function p(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 m(e,i){var s={};t.merge(s,i),s.class&&(t.addClass([e],s.class.split(" ")),delete s.class),t.attributes(e,s)}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 y(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function v(i,s,o,l,a,n,c,d){var h,u=t.extend({},x,d),p=t.extend({},C,u.ariaAttributes),f=i,y=i,v=r(i,s);"string"!=typeof i&&"number"!=typeof i&&(h=i,f="boolean"==typeof v[s.text]||"number"==typeof v[s.text]?v[s.text]:v[s.text]||"",y=v[s.value]);var L;L=t.isNullOrUndefined(h)||t.isNullOrUndefined(v[s.id])||""===v[s.id]?n+"-"+c:n;var S=t.createElement("li",{className:(!0===a?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(o)?"":o),id:L,attrs:""!==p.groupItemRole&&""!==p.itemRole?{role:!0===a?p.groupItemRole:p.itemRole}:{}});return h&&v.hasOwnProperty(s.enabled)&&"false"===v[s.enabled].toString()&&S.classList.add(e.cssClass.disabled),a?S.innerText=f:(t.isNullOrUndefined(y)||S.setAttribute("data-value",y),S.setAttribute("role","option"),h&&v.hasOwnProperty(s.htmlAttributes)&&v[s.htmlAttributes]&&m(S,v[s.htmlAttributes]),l.length&&t.append(l,S),h&&v.hasOwnProperty(s.url)&&v[s.url]?S.appendChild(g(h,s,f)):S.appendChild(document.createTextNode(f))),S}function L(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"}}function g(i,s,o){var l=r(i,s),a={href:l[s.url]};l.hasOwnProperty(s.urlAttributes)&&l[s.urlAttributes]&&t.merge(a,l[s.urlAttributes]);var n=t.createElement("a",{className:e.cssClass.text+" "+e.cssClass.url,innerHTML:o});return m(n,a),n}function S(i,s,o,l){var a,n,c,d,h=t.extend({},x,l),u=t.extend({},C,h.ariaAttributes),p=i;"string"!=typeof i&&(c=i,p=(d=r(i,s))[s.text]||"",a=d[s.id],n=!(!i.hasOwnProperty("isHeader")||!i.isHeader));var m=t.createElement("li",{className:(!0===n?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(o)?"":o),attrs:""!==u.groupItemRole&&""!==u.itemRole?{role:!0===n?u.groupItemRole:u.itemRole}:{}});if(t.isNullOrUndefined(a)?m.setAttribute("data-uid",y()):m.setAttribute("data-uid",a),n&&l&&l.groupTemplate){var f=t.compile(l.groupTemplate);t.append(f(i),m)}else if(!n&&l&&l.template){f=t.compile(l.template);t.append(f(i),m)}else{var v=t.createElement("div",{className:e.cssClass.textContent,attrs:""!==u.wrapperRole?{role:u.wrapperRole}:{}});c&&d.hasOwnProperty(s.url)&&d[s.url]?v.appendChild(g(c,s,p)):v.appendChild(t.createElement("span",{className:e.cssClass.text,innerHTML:p,attrs:""!==u.itemText?{role:u.itemText}:{}})),m.appendChild(v)}return m}function b(i,s,r){var o=t.extend({},x,r),l=t.extend({},C,o.ariaAttributes);e.cssClass=L(o.moduleName);var a=t.createElement("ul",{className:e.cssClass.ul+" "+(t.isNullOrUndefined(s)?"":s),attrs:""!==l.listRole?{role:l.listRole}:{}});return t.append(i,a),a}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};var C={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},x={showCheckBox:!1,showIcon:!1,expandCollapse:!1,fields:s.defaultMappedFields,ariaAttributes:C,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"Right"};s.createList=function(e,i,s){var r=t.extend({},x,i),l=t.extend({},C,r.ariaAttributes),a=p(e).typeof;return"string"===a||"number"===a?o(e,s,i):n(e,i,l.level,s)},s.createListFromArray=o,s.createListItemFromArray=l,s.createListItemFromJson=a,s.createListFromJson=n,s.getSiblingLI=function(i,s,r){if(e.cssClass=L(x.moduleName),i&&i.length){var o,l,a=Array.prototype.slice.call(i);for(o=a[(l=s?c(s,a):!0===r?a.length:-1)+(!0===r?-1:1)];o&&(!t.isVisible(o)||o.classList.contains(e.cssClass.disabled));)o=a[l+=!0===r?-1:1];return o}},s.indexOf=c,s.groupDataSource=function(e,t,s){void 0===s&&(s="None");var r=(new i.Query).group(t.groupBy),o=h(e,r=d(s,"key",r));e=[];for(var l=0;l<o.length;l++){var a=o[l].items,n={};n[t.text]=o[l].key,n.isHeader=!0,n.items=a,e.push(n);for(var c=0;c<a.length;c++)e.push(a[c])}return e},s.addSorting=d,s.getDataSource=h,s.createJsonFromElement=u,s.renderContentTemplate=function(i,s,o,l){e.cssClass=L(x.moduleName);for(var a=t.createElement("ul",{className:e.cssClass.ul,attrs:{role:"presentation"}}),n=t.extend({},x,l),c=t.compile(i),d=[],h=y(),u=0;u<s.length;u++){var p=r(s[u],o),m=s[u],f=m.isHeader,v="string"==typeof m||"number"==typeof m?m:p[o.value];if(n.itemCreating&&"function"==typeof n.itemCreating){var g={dataSource:s,curData:m,text:v,options:n,fields:o};n.itemCreating(g)}n.itemCreating&&"function"==typeof n.itemCreating&&(v=(p=r(s[u],o))[o.value]);var S=t.createElement("li",{id:h+"-"+u,className:f?e.cssClass.group:e.cssClass.li,attrs:{role:"presentation"}});f?S.innerText=p[o.text]:(t.append(c(m),S),S.setAttribute("data-value",v),S.setAttribute("role","option")),n.itemCreated&&"function"==typeof n.itemCreated&&(g={dataSource:s,curData:m,text:v,item:S,options:n,fields:o},n.itemCreated(g)),d.push(S)}return t.append(d,a),a},s.renderGroupTemplate=function(e,i,s,r){for(var o=t.compile(e),l=s.groupBy,a={},n=0,c=r;n<c.length;n++){var d=c[n];a[l]=d.textContent,d.innerHTML="",t.append(o(a),d)}return r},s.generateUL=b,s.generateIcon=function(i,s,r){var o=t.extend({},x,r);return t.extend({},C,o.ariaAttributes),e.cssClass=L(o.moduleName),("Left"===o.expandIconPosition?t.prepend:t.append)([t.createElement("div",{className:"e-icons "+o.expandIconClass+" "+(t.isNullOrUndefined(s)?"":s)})],i.querySelector("."+e.cssClass.textContent)),i}}(e.ListBase||(e.ListBase={}));var o=function(){var 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])};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)}}(),l=function(e,t,i,s){var r,o=arguments.length,l=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(l=(o<3?r(l):o>3?r(t,i,l):r(t,i))||l);return o>3&&l&&Object.defineProperty(t,i,l),l},a={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},n={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},c="e-listview",d="e-hover",h="e-active",u="e-focused",p="e-list-parent",m="e-list-item",f="e-list-group-item",y="e-has-child",v="e-list-header",L="e-headertext",g="e-text",S="e-disabled",b="e-content",C="e-icons",x="e-icon-back",O="e-checkbox-wrapper",I="e-checkbox",k="e-check",w="e-frame",D="e-checkbox-right",N="e-checkbox-left",B="e-listview-checkbox",A="e-checklist",E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return o(i,e),l([t.Property("id")],i.prototype,"id",void 0),l([t.Property("text")],i.prototype,"text",void 0),l([t.Property("isChecked")],i.prototype,"isChecked",void 0),l([t.Property("isVisible")],i.prototype,"isVisible",void 0),l([t.Property("enabled")],i.prototype,"enabled",void 0),l([t.Property("iconCss")],i.prototype,"iconCss",void 0),l([t.Property("child")],i.prototype,"child",void 0),l([t.Property("tooltip")],i.prototype,"tooltip",void 0),l([t.Property("groupBy")],i.prototype,"groupBy",void 0),l([t.Property("text")],i.prototype,"sortBy",void 0),l([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),l([t.Property("tableName")],i.prototype,"tableName",void 0),i}(t.ChildProperty),U=function(U){function q(e,i){var s=U.call(this,e,i)||this;return s.curDSLevel=[],s.curViewDS=[],s.keyConfigs={moveDown:"downarrow",moveUp:"uparrow",back:"backspace",home:"home",select:"enter",end:"end",tab:"tab",space:"space"},s.animateOptions={},s.isNestedList=!1,s.currentLiElements=[],s.resetList=!1,s.selectedData=[],s.selectedId=[],s.aniObj=new t.Animation(s.animateOptions),s}return o(q,U),q.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.reRender();break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1);break;case"showHeader":this.header(this.headerTitle,!1);break;case"showCheckBox":case"checkBoxPosition":this.setCheckbox();break;case"dataSource":this.reRender();break;case"sortOrder":case"showIcon":this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList()}}},q.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&t.attributes(this.element,this.htmlAttributes)},q.prototype.setCSSClass=function(e){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),e&&t.removeClass([this.element],e.split(" "))},q.prototype.setSize=function(){this.element.style.height=t.formatUnit(this.height),this.element.style.width=t.formatUnit(this.width)},q.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},q.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},q.prototype.enableElement=function(e,t){t?e.classList.remove(S):e.classList.add(S)},q.prototype.header=function(e,i){if(void 0===this.headerEle&&this.showHeader){this.headerEle=t.createElement("div",{className:v});var s=t.createElement("span",{className:L,innerHTML:this.headerTitle}),r=t.createElement("div",{className:g,innerHTML:s.outerHTML}),o=t.createElement("div",{className:C+" "+x+" e-but-back",attrs:{style:"display:none;"}});this.headerEle.appendChild(o),this.headerEle.appendChild(r),this.element.classList.add("e-has-header"),t.prepend([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";r=this.headerEle.querySelector("."+L),o=this.headerEle.querySelector("."+x);r.innerHTML=e,o.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},q.prototype.switchView=function(e,t,i){var s=this;if(e&&t){var r=e.style.position,o="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var l=void 0,c=this.animation.duration;if(this.animation.effect)l=this.enableRtl?n[this.animation.effect]:a[this.animation.effect];else{l=a.SlideLeft,i=this.enableRtl,c=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?l[0]:l[1],duration:c,timingFunction:this.animation.easing,end:function(t){e.style.display="none",s.element.style.overflow=o,e.style.position=r,e.classList.remove("e-view")}}),t.style.display="",this.aniObj.animate(t,{name:!0===i?l[2]:l[3],duration:c,timingFunction:this.animation.easing,end:function(){s.trigger("actionComplete")}}),this.curUL=t}},q.prototype.preRender=function(){this.listBaseOption={template:this.template,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",ariaAttributes:{itemRole:"listitem",listRole:"list",itemText:"",groupItemRole:"group",wrapperRole:"presentation"},fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon,itemCreated:this.renderCheckbox.bind(this)}},q.prototype.renderCheckbox=function(e){if(e.item.classList.contains(y)&&(this.isNestedList=!0),this.showCheckBox&&this.isValidLI(e.item)){var t=void 0,i=void 0;(t=s.createCheckBox(!1,{checked:!1,enableRtl:this.enableRtl,cssClass:B})).setAttribute("role","checkbox");var o=t.querySelector("."+w);e.item.classList.add(A),e.item.firstElementChild.classList.add(I),"string"!=typeof this.dataSource[0]?(i=r(e.curData,this.listBaseOption.fields),!this.resetList&&i[this.listBaseOption.fields.isChecked]?this.checkInternally(e,t):-1!==this.selectedData.indexOf(i[this.listBaseOption.fields.text])&&-1!==this.selectedId.indexOf(i[this.listBaseOption.fields.id])&&this.checkInternally(e,t)):"string"==typeof this.dataSource[0]&&-1!==this.selectedData.indexOf(e.text)&&this.checkInternally(e,t),t.setAttribute("aria-checked",o.classList.contains(k)?"true":"false"),"Left"===this.checkBoxPosition?(t.classList.add(N),e.item.firstElementChild.classList.add(N),e.item.firstElementChild.insertBefore(t,e.item.firstElementChild.childNodes[0])):(t.classList.add(D),e.item.firstElementChild.classList.add(D),e.item.firstElementChild.appendChild(t)),this.currentLiElements.push(e.item)}},q.prototype.checkInternally=function(e,t){e.item.classList.add(h),e.item.setAttribute("aria-selected","true"),t.querySelector("."+w).classList.add(k),t.setAttribute("aria-checked","true")},q.prototype.checkItem=function(e){this.toggleCheckBase(e,!0)},q.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 r=s.querySelector("."+w);i?s.classList.add(h):s.classList.remove(h),s.setAttribute("aria-selected",i?"true":"false"),i?r.classList.add(k):r.classList.remove(k),r.parentElement.setAttribute("aria-checked",i?"true":"false")}this.setSelectedItemData(s)}},q.prototype.unCheckItem=function(e){this.toggleCheckBase(e,!1)},q.prototype.checkAllItem=function(){this.toggleAllCheckBase(!0)},q.prototype.unCheckAllItem=function(){this.toggleAllCheckBase(!1)},q.prototype.toggleAllCheckBase=function(e){if(this.showCheckBox)for(var t=0;t<this.liCollection.length;t++){var i=this.liCollection[t].querySelector("."+w);e?i.classList.contains(k)||this.checkItem(this.liCollection[t]):i.classList.contains(k)&&this.unCheckItem(this.liCollection[t])}},q.prototype.setCheckbox=function(){var e=this;if(this.showCheckBox){var t={item:void 0,curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:""};Array.prototype.slice.call(this.element.querySelectorAll("."+m)).forEach(function(i){t.item=i,t.curData=e.getItemData(i),i.querySelector("."+O)&&e.removeElement(i.querySelector("."+O)),e.renderCheckbox(t),t.item.classList.contains(h)&&e.checkInternally(t,t.item.querySelector("."+O))})}else{Array.prototype.slice.call(this.element.querySelectorAll("."+A)).forEach(function(t){t.classList.remove(h),t.firstElementChild.classList.remove(I),e.removeElement(t.querySelector("."+O))}),this.selectedItems&&this.selectedItems.item.classList.add(h)}},q.prototype.clickHandler=function(e){var i=e.target,s=i.classList;if(s.contains(x)||s.contains(L))this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.unCheckAllItem(),this.back();else{var r=t.closest(i.parentNode,"."+m);if(null===r&&(r=i),this.removeFocus(),this.enable&&this.showCheckBox&&this.isValidLI(r))if(e.target.classList.contains(w))if(r.classList.add(u),t.isNullOrUndefined(r.querySelector("."+k))){var o={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:r};this.checkInternally(o,o.item.querySelector("."+O))}else this.unCheckItem(r),r.classList.add(u);else r.classList.contains(y)?(this.removeHover(),this.removeSelect(),this.removeSelect(r),this.setSelectLI(r,e),r.classList.remove(h)):this.setCheckboxLI(r,e);else this.setSelectLI(r,e)}},q.prototype.removeElement=function(e){return e&&e.parentNode&&e.parentNode.removeChild(e)},q.prototype.hoverHandler=function(e){var i=t.closest(e.target.parentNode,"."+m);this.setHoverLI(i)},q.prototype.leaveHandler=function(e){this.removeHover()},q.prototype.homeKeyHandler=function(e,t){var i=this.curUL.querySelectorAll("."+m),s=this.curUL.querySelector("."+u)||this.curUL.querySelector("."+h);s&&(s.classList.remove(u),this.showCheckBox||s.classList.remove(h));var r=t?i.length-1:0;i[r].classList.contains(y)||this.showCheckBox?i[r].classList.add(u):this.setSelectLI(i[r],e)},q.prototype.arrowKeyHandler=function(i,s){var r,o;!t.isNullOrUndefined(this.curUL.querySelector("."+y))||this.showCheckBox?(o=this.curUL.querySelector("."+u)||this.curUL.querySelector("."+h),r=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+m),o,s),t.isNullOrUndefined(r)||(o&&(o.classList.remove(u),this.showCheckBox||o.classList.remove(h)),r.classList.contains(y)||this.showCheckBox?r.classList.add(u):this.setSelectLI(r,i))):(o=this.curUL.querySelector("."+h),r=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+m),o,s),this.setSelectLI(r,i))},q.prototype.enterKeyHandler=function(e){var i=!t.isNullOrUndefined(this.curUL.querySelector("."+y)),s=this.curUL.querySelector("."+u);i&&s&&(s.classList.remove(u),this.showCheckBox&&(this.removeSelect(),this.removeSelect(s),this.removeHover()),this.setSelectLI(s,e))},q.prototype.spaceKeyHandler=function(e){if(this.enable&&this.showCheckBox){var i=this.curUL.querySelector("."+u);if(!t.isNullOrUndefined(i)&&t.isNullOrUndefined(i.querySelector("."+k))){var s={curData:void 0,dataSource:void 0,fields:void 0,options:void 0,text:void 0,item:i};this.checkInternally(s,s.item.querySelector("."+O))}else this.unCheckItem(i)}},q.prototype.keyActionHandler=function(e){switch(e.preventDefault(),e.action){case"home":this.homeKeyHandler(e);break;case"end":this.homeKeyHandler(e,!0);break;case"moveDown":this.arrowKeyHandler(e);break;case"moveUp":this.arrowKeyHandler(e,!0);break;case"select":this.enterKeyHandler(e);break;case"back":this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.unCheckAllItem(),this.back();break;case"tab":this.tabFocus(e);break;case"space":this.spaceKeyHandler(e)}},q.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&(this.showCheckBox&&this.curDSLevel[this.curDSLevel.length-1]&&this.unCheckAllItem(),this.back())},q.prototype.focusout=function(){var e=this.curUL.querySelector("."+u),t=this.curUL.querySelector("[aria-selected = true]");e&&!this.showCheckBox&&(e.classList.remove(u),t&&t.classList.add(h))},q.prototype.wireEvents=function(){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.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),this.touchModule=new t.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)})},q.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"mouseout",this.leaveHandler),this.keyboardModule.destroy(),this.touchModule.destroy()},q.prototype.tabFocus=function(e){if(!this.curUL.querySelector("."+h)&&this.curUL||this.showCheckBox){var i=this.curUL.querySelector("."+m);if(i.classList.contains(y)||this.showCheckBox){var s=this.curUL.querySelector("."+u);t.isNullOrUndefined(s)&&i.classList.add(u)}else this.setSelectLI(i,e)}},q.prototype.removeFocus=function(){for(var e=0,t=this.element.querySelectorAll("."+u);e<t.length;e++){t[e].classList.remove(u)}},q.prototype.removeHover=function(){var e=this.element.querySelector("."+d);e&&e.classList.remove(d)},q.prototype.removeSelect=function(e){if(t.isNullOrUndefined(e))for(var i=0,s=this.element.querySelectorAll("."+h);i<s.length;i++){var r=s[i];this.showCheckBox&&r.querySelector("."+k)||(r.setAttribute("aria-selected","false"),r.classList.remove(h))}else e.classList.remove(h),e.setAttribute("aria-selected","false")},q.prototype.isValidLI=function(e){return e&&e.classList.contains(m)&&!e.classList.contains(f)&&!e.classList.contains(S)},q.prototype.setCheckboxLI=function(e,i){if(this.isValidLI(e)&&this.enable&&this.showCheckBox){this.curUL.querySelector("."+u)&&this.curUL.querySelector("."+u).classList.remove(u),e.classList.add(u);var s=e.querySelector("."+O),r=s.querySelector("."+w+"."+C);if(this.removeHover(),r.classList.contains(k)?(r.classList.remove(k),e.classList.remove(h),e.setAttribute("aria-selected","false")):(r.classList.add(k),e.classList.add(h),e.setAttribute("aria-selected","true")),s.setAttribute("aria-checked",r.classList.contains(k)?"true":"false"),i){var o=this.selectEventData(e,i);t.merge(o,{isChecked:r.classList.contains(k)}),this.trigger("select",o)}this.setSelectedItemData(e),this.renderSubList(e)}},q.prototype.selectEventData=function(e,i){var s,o=this.getItemData(e),l=r(o,this.listBaseOption.fields);s=t.isNullOrUndefined(o)&&"string"==typeof this.dataSource[0]?{item:e,text:e.innerText.trim(),data:this.dataSource}:{item:e,text:l[this.listBaseOption.fields.text],data:o};var a={};return t.merge(a,s),i&&t.merge(a,{isInteracted:!0,event:i,index:Array.prototype.indexOf.call(this.curUL.children,e)}),a},q.prototype.setSelectedItemData=function(e){var i=this.getItemData(e),s=r(i,this.listBaseOption.fields);t.isNullOrUndefined(i)&&"string"==typeof this.dataSource[0]?this.selectedItems={item:e,text:e.innerText.trim(),data:this.dataSource}:this.selectedItems={item:e,text:s[this.listBaseOption.fields.text],data:i}},q.prototype.setSelectLI=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(h)&&this.enable){this.showCheckBox||this.removeSelect(),e.classList.add(h),e.classList.add(u),e.setAttribute("aria-selected","true"),this.removeHover(),this.setSelectedItemData(e);var i=this.selectEventData(e,t);this.trigger("select",i),this.selectedLI=e,this.renderSubList(e)}},q.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(d)&&this.enable){var i=this.element.querySelectorAll("."+d);i&&i.length&&t.removeClass(i,d),e.classList.contains(h)&&!this.showCheckBox||e.classList.add(d)}},q.prototype.hoverSiblingLI=function(t){var i,s=this.curUL.querySelector("."+d);if(s||(s=this.curUL.querySelector("."+h)),s)i=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+m),s,t);else if(t){var r=this.curUL.querySelectorAll("."+m);i=r[r.length-1]}else i=this.curUL.querySelector("."+m);this.setHoverLI(i)},q.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var o=s[i];this.curDSJSON=this.findItemFromDS(t,{id:o});var l=r(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?l[this.fields.child]:t}return t}return this.localData},q.prototype.getItemData=function(e){var t=this.getElementUID(e),i=this.dataSource;return this.findItemFromDS(i,t)},q.prototype.findItemFromDS=function(e,i,s){var o,l=this;return e&&e.length&&i?e.some(function(a){var n=r(a,l.listBaseOption.fields);if(!i.id&&!i.text||i.id&&n[l.fields.id]!==i.id||i.text&&n[l.fields.text]!==i.text)if(!t.isNullOrUndefined(i.id)&&t.isNullOrUndefined(n[l.fields.id])){l.element.querySelector('[data-uid="'+i.id+'"]').innerText.trim()===n[l.fields.text]&&(o=a)}else n.hasOwnProperty(l.fields.child)&&n[l.fields.child].length&&(o=l.findItemFromDS(n[l.fields.child],i,s));else o=s?e:a;return!!o}):o=e,o},q.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var r=0,o=Object.keys(this.fields.properties);r<o.length;r++){var l=o[r];"tableName"!==l&&this.fields[l]&&this.fields[l]!==e.ListBase.defaultMappedFields[l]&&-1===t.indexOf(this.fields[l])&&t.push(this.fields[l])}s.select(t),this.fields.properties.hasOwnProperty("tableName")&&s.from(this.fields.tableName)}return s},q.prototype.setViewDataSource=function(t){void 0===t&&(t=this.localData),t&&this.fields.groupBy?this.curViewDS=e.ListBase.groupDataSource(t,this.fields,this.sortOrder):t&&"None"!==this.sortOrder?this.curViewDS=e.ListBase.getDataSource(t,e.ListBase.addSorting(this.sortOrder,this.fields.sortBy)):this.curViewDS=t},q.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},q.prototype.setLocalData=function(){var s=this;if(this.trigger("actionBegin"),this.dataSource instanceof i.DataManager)this.dataSource.executeQuery(this.getQuery()).then(function(e){s.isDestroyed||(s.localData=e.result,s.renderList(),s.trigger("actionComplete",e))}).catch(function(e){s.isDestroyed||s.trigger("actionFailure",e)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var r=this.element.querySelector("ul");r&&(t.remove(r),this.setProperties({dataSource:e.ListBase.createJsonFromElement(r)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},q.prototype.reRender=function(){this.element.innerHTML="",this.curUL=this.headerEle=void 0,this.setLocalData(),this.header()},q.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},q.prototype.createList=function(){this.currentLiElements=[],this.isNestedList=!1,this.ulElement=this.curUL=e.ListBase.createList(this.curViewDS,this.listBaseOption),this.liCollection=this.curUL.querySelectorAll("."+m)},q.prototype.renderSubList=function(i){var s=i.getAttribute("data-uid");if(i.classList.contains(y)&&s){var o=t.closest(i.parentNode,"."+p),l=this.element.querySelector("[pid='"+s+"']");this.curDSLevel.push(s),this.setViewDataSource(this.getSubDS()),l||((l=e.ListBase.createListFromJson(this.curViewDS,this.listBaseOption,this.curDSLevel.length)).setAttribute("pID",s),l.style.display="none",this.renderIntoDom(l)),this.switchView(o,l),this.liCollection=this.curUL.querySelectorAll("."+m);var a=r(this.selectedItems.data,this.listBaseOption.fields);this.header(a[this.listBaseOption.fields.text],!0),this.selectedLI=void 0}},q.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},q.prototype.renderList=function(){this.setViewDataSource(),this.createList(),this.contentContainer=t.createElement("div",{className:b}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement)},q.prototype.getElementUID=function(e){var t={};return e instanceof Element?t.id=e.getAttribute("data-uid"):t=e,t},q.prototype.render=function(){this.element.classList.add(c),t.attributes(this.element,{role:"list",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:"."+m})},q.prototype.destroy=function(){this.unWireEvents();var e=[c,this.cssClass,S,"e-rtl","e-has-header"];t.removeClass([this.element],e),this.rippleFn(),U.prototype.destroy.call(this)},q.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 t=this.element.querySelector("[data-uid='"+e+"']"),i=this.curUL;t?t=t.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),t=this.curUL);var s=r(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(i,t,!0),this.removeFocus();var o=this.element.querySelector("[data-uid='"+e+"']");o.classList.add(u),this.showCheckBox&&o.querySelector("."+w).classList.contains(k)?o.setAttribute("aria-selected","true"):(o.classList.remove(h),o.setAttribute("aria-selected","false")),this.liCollection=this.curUL.querySelectorAll("."+m),this.header(this.curDSLevel.length?s:this.headerTitle,!!this.curDSLevel.length)}},q.prototype.selectItem=function(e){t.isNullOrUndefined(e)||(this.showCheckBox?this.setCheckboxLI(this.getLiFromObjOrElement(e)):this.setSelectLI(this.getLiFromObjOrElement(e)))},q.prototype.getLiFromObjOrElement=function(e){var i;if(!t.isNullOrUndefined(e))if("string"==typeof this.dataSource[0]){if(e instanceof Object&&e.constructor===HTMLLIElement)for(var s=e.getAttribute("data-uid").toString(),o=0;o<this.liCollection.length;o++)if(this.liCollection[o].getAttribute("data-uid").toString()===s){i=this.liCollection[o];break}}else{var l=this.getItemData(e),a=r(l,this.listBaseOption.fields);if(l&&(i=this.element.querySelector('[data-uid="'+a[this.fields.id]+'"]'),t.isNullOrUndefined(i))){var n=this.element.querySelectorAll("."+m);for(o=0;o<n.length;o++)n[o].innerText.trim()===l.text&&(i=n[o])}}return i},q.prototype.selectMultipleItems=function(e){if(!t.isNullOrUndefined(e))for(var i=0;i<e.length;i++)t.isNullOrUndefined(e[i])||this.selectItem(e[i])},q.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},q.prototype.getSelectedItems=function(){if(this.selectedId=[],this.showCheckBox){var e=this.curUL.getElementsByClassName(h),i=[],s=[];this.selectedId=[];for(var o=[],l=0;l<e.length;l++)if("string"==typeof this.dataSource[0])i.push(e[l].innerText.trim());else{var a=this.getItemData(e[l]),n=r(a,this.listBaseOption.fields);this.isNestedList?o.push({data:a,parentId:this.getParentId()}):s.push(a),i.push(n[this.listBaseOption.fields.text]),this.selectedId.push(n[this.listBaseOption.fields.id])}return"string"==typeof this.dataSource[0]?{item:e,data:this.dataSource,text:i}:this.isNestedList?{item:e,data:o,text:i}:{item:e,data:s,text:i}}var c=this.element.getElementsByClassName(h)[0];n=r(this.getItemData(c),this.listBaseOption.fields);return"string"==typeof this.dataSource[0]?t.isNullOrUndefined(c)?void 0:{item:c,data:this.dataSource,text:c.innerText.trim()}:t.isNullOrUndefined(n)||t.isNullOrUndefined(c)?void 0:(this.selectedId.push(n[this.listBaseOption.fields.id]),{text:n[this.listBaseOption.fields.text],item:c,data:this.getItemData(c)})},q.prototype.findItem=function(e){return this.getItemData(e)},q.prototype.enableItem=function(e){this.setItemState(e,!0)},q.prototype.disableItem=function(e){this.setItemState(e,!1)},q.prototype.setItemState=function(e,t){var i=this.getItemData(e),s=r(i,this.listBaseOption.fields);if(i){var o=this.element.querySelector('[data-uid="'+s[this.fields.id]+'"]');t?(o&&o.classList.remove(S),delete i[this.fields.enabled]):t||(o&&o.classList.add(S),i[this.fields.enabled]=!1)}},q.prototype.showItem=function(e){this.showHideItem(e,!1,"")},q.prototype.hideItem=function(e){this.showHideItem(e,!0,"none")},q.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e),o=r(s,this.listBaseOption.fields);if(s){var l=this.element.querySelector('[data-uid="'+o[this.fields.id]+'"]');l&&(l.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},q.prototype.addItem=function(e,t){var i=this.findItemFromDS(this.dataSource,t),s=r(i,this.listBaseOption.fields)[this.fields.child];s||(s=[]),s=s.concat(e),i instanceof Array?(this.dataSource=this.localData=i.concat(e),this.setViewDataSource()):i[this.fields.child]=s,this.resetCurrentList()},q.prototype.removeItem=function(e){this.removeItemFromList(e,!0)},q.prototype.removeItemFromList=function(e,i){var s=this,o=!1;if("string"==typeof this.dataSource[0]){if("object"==typeof e){var l=[],a=0;this.liCollection.forEach(function(t){t===e?(o=!0,s.removeElement(t),s.dataSource.splice(a,1),s.localData=s.dataSource):l.push(t),a++}),this.liCollection=l}else if("string"==typeof e){var n=[],c=0,d=[];this.liCollection.forEach(function(t){t.innerText.trim()===e?(o=!0,s.removeElement(t)):(n.push(t),d.push(s.dataSource[c])),c++}),this.localData=this.curViewDS=this.dataSource=d,this.liCollection=n}var u=this.getSelectedItems();if(this.selectedData=t.isNullOrUndefined(u)?void 0:u.text,void 0,i&&o){if(this.resetList=!0,this.resetCurrentList(),!this.showCheckBox&&this.selectedData&&this.selectedData.length){this.removeSelect();var p=this.dataSource.lastIndexOf(this.selectedData);this.liCollection[p].classList.add(h),this.liCollection[p].setAttribute("aria-selected","true")}this.resetList=!1}}else{t.isNullOrUndefined(this.getSelectedItems())?void 0:this.getSelectedItems().data;var m,f=this.getElementUID(e),y=this.findItemFromDS(this.dataSource,f,!0);if(y&&e){var v;y.some(function(e,t,i){var o=r(e,s.listBaseOption.fields);return!(!f.id&&!f.text||f.id&&o[s.fields.id]!==f.id||f.text&&o[s.fields.text]!==f.text)&&(m=i,v=t,!0)}),this.removeElement(this.getLiFromObjOrElement(m[v])),m.splice(v,1),this.curViewDS=m}u=this.getSelectedItems();this.selectedData=t.isNullOrUndefined(u)?void 0:u.text,i&&m&&(this.resetList=!0,this.resetCurrentList(),this.showCheckBox||t.isNullOrUndefined(u)||this.selectItem(u.item),this.resetList=!1)}},q.prototype.removeMultipleItems=function(e){if(e.length)for(var t=0;t<e.length;t++)t===e.length-1?this.removeItemFromList(e[t],!0):this.removeItemFromList(e[t],!1)},q.prototype.getModuleName=function(){return"listview"},q.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width","showCheckBox","checkBoxPosition"])},l([t.Property()],q.prototype,"cssClass",void 0),l([t.Property({})],q.prototype,"htmlAttributes",void 0),l([t.Property(!0)],q.prototype,"enable",void 0),l([t.Property([])],q.prototype,"dataSource",void 0),l([t.Property()],q.prototype,"query",void 0),l([t.Complex(e.ListBase.defaultMappedFields,E)],q.prototype,"fields",void 0),l([t.Property({effect:"SlideLeft",duration:400,easing:"ease"})],q.prototype,"animation",void 0),l([t.Property("None")],q.prototype,"sortOrder",void 0),l([t.Property(!1)],q.prototype,"showIcon",void 0),l([t.Property(!1)],q.prototype,"showCheckBox",void 0),l([t.Property("Left")],q.prototype,"checkBoxPosition",void 0),l([t.Property("")],q.prototype,"headerTitle",void 0),l([t.Property(!1)],q.prototype,"showHeader",void 0),l([t.Property("")],q.prototype,"height",void 0),l([t.Property("")],q.prototype,"width",void 0),l([t.Property(null)],q.prototype,"template",void 0),l([t.Property(null)],q.prototype,"groupTemplate",void 0),l([t.Event()],q.prototype,"select",void 0),l([t.Event()],q.prototype,"actionBegin",void 0),l([t.Event()],q.prototype,"actionComplete",void 0),l([t.Event()],q.prototype,"actionFailure",void 0),q=l([t.NotifyPropertyChanges],q)}(t.Component);e.FieldSettings=E,e.ListView=U,e.getFieldValues=r,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ej2-lists.umd.min.js.map |
/*! | ||
* filename: index.d.ts | ||
* version : 16.1.35 | ||
* version : 16.1.37 | ||
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. | ||
@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license. |
{ | ||
"name": "@syncfusion/ej2-lists", | ||
"version": "16.1.35", | ||
"version": "16.1.37", | ||
"description": "Essential JS 2 List Components", | ||
@@ -11,5 +11,5 @@ "author": "Syncfusion Inc.", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~16.1.35", | ||
"@syncfusion/ej2-data": "~16.1.32", | ||
"@syncfusion/ej2-buttons": "~16.1.35" | ||
"@syncfusion/ej2-base": "~16.1.37", | ||
"@syncfusion/ej2-data": "~16.1.37", | ||
"@syncfusion/ej2-buttons": "~16.1.37" | ||
}, | ||
@@ -16,0 +16,0 @@ "devDependencies": { |
@@ -143,2 +143,3 @@ import { Component, BaseEventArgs } from '@syncfusion/ej2-base'; | ||
private selectedId; | ||
private selectedItems; | ||
private aniObj; | ||
@@ -283,4 +284,23 @@ /** | ||
private renderCheckbox(args); | ||
private checkItem(args, checkboxElement); | ||
private checkboxRevert(); | ||
private checkInternally(args, checkboxElement); | ||
/** | ||
* It is used to check the checkbox of an item. | ||
* @param {Fields | HTMLElement} item - It accepts Fields or HTML list element as an argument. | ||
*/ | ||
checkItem(item: Fields | HTMLElement): void; | ||
private toggleCheckBase(item, checked); | ||
/** | ||
* It is used to uncheck the checkbox of an item. | ||
* @param {Fields | HTMLElement} item - It accepts Fields or HTML list element as an argument. | ||
*/ | ||
unCheckItem(item: Fields | HTMLElement): void; | ||
/** | ||
* It is used to check all the items in ListView. | ||
*/ | ||
checkAllItem(): void; | ||
/** | ||
* It is used to un-check all the items in ListView. | ||
*/ | ||
unCheckAllItem(): void; | ||
private toggleAllCheckBase(checked); | ||
private setCheckbox(); | ||
@@ -301,7 +321,9 @@ private clickHandler(e); | ||
private tabFocus(e); | ||
private removeFocus(); | ||
private removeHover(); | ||
private removeSelect(); | ||
private removeSelect(li?); | ||
private isValidLI(li); | ||
private setCheckboxLI(li, e?); | ||
private selectEventData(li, e?); | ||
private setSelectedItemData(li); | ||
private setSelectLI(li, e?); | ||
@@ -343,2 +365,3 @@ private setHoverLI(li); | ||
selectMultipleItems(obj: Fields[] | HTMLElement[]): void; | ||
private getParentId(); | ||
/** | ||
@@ -349,3 +372,3 @@ * It is used to get the currently | ||
*/ | ||
getSelectedItems(): SelectedItem | SelectedCollection; | ||
getSelectedItems(): SelectedItem | SelectedCollection | NestedListData; | ||
/** | ||
@@ -439,2 +462,30 @@ * It is used to find out an item details from the current list. | ||
} | ||
export interface DataAndParent { | ||
/** | ||
* It denotes the Selected Item dataSource JSON object or object collection. | ||
*/ | ||
data: { | ||
[key: string]: Object; | ||
} | { | ||
[key: string]: Object; | ||
}[] | string[]; | ||
/** | ||
* It denotes the Selected Item's parent id; | ||
*/ | ||
parentId: string[]; | ||
} | ||
export interface NestedListData { | ||
/** | ||
* It denotes the Selected Item text data or collection. | ||
*/ | ||
text: string | string[]; | ||
/** | ||
* It denotes the Selected Item list element or element collection. | ||
*/ | ||
item: HTMLElement | Element[] | HTMLCollection; | ||
/** | ||
* It denotes the Selected Item dataSource JSON object with it's parent ID. | ||
*/ | ||
data: DataAndParent[]; | ||
} | ||
export interface SelectEventArgs extends BaseEventArgs, SelectedItem { | ||
@@ -441,0 +492,0 @@ /** |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3975225
22353