Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-lists

Package Overview
Dependencies
Maintainers
3
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-lists - npm Package Compare versions

Comparing version 15.4.24 to 15.4.26

8

CHANGELOG.md

@@ -5,2 +5,10 @@ # Changelog

### ListView
#### Bug Fixes
- Tab key is not focusing `ListView` properly issue has been fixed.
## 15.4.24-preview (2018-01-10)
### Common

@@ -7,0 +15,0 @@

4

dist/ej2-lists.umd.min.js
/*!
* filename: ej2-lists.umd.min.js
* version : 15.4.24
* version : 15.4.26
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved.

@@ -11,3 +11,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")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data"],t):t(e.ej={},e.ej2Base,e.ej2Data)}(this,function(e,t,i){"use strict";function s(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 n=0,o=Object.keys(i);n<o.length;n++){var l=o[n];if(!t.isNullOrUndefined(i[l])&&"string"==typeof i[l]){var a=i[l].split("."),d=a.length>1?a[0]:i[l];t.isNullOrUndefined(e[d])||(s=t.getValue(i[l],e),t.isNullOrUndefined(s)||(r[i[l]]=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(r){function n(e,t,i){return C(o(e,t,i),null,i)}function o(i,s,r){var n=[],o=t.extend({},O,r);e.cssClass=g(o.moduleName);for(var l=y(),a=0;a<i.length;a++)if(!t.isNullOrUndefined(i[a])){var d=void 0;if(o.itemCreating&&"function"==typeof o.itemCreating){var c={dataSource:i,curData:i[a],text:i[a],options:o};o.itemCreating(c)}if(d=s?v(i[a],null,null,[],null,l,a,r):S(i[a],null,null,r),o.itemCreated&&"function"==typeof o.itemCreated){c={dataSource:i,curData:i[a],text:i[a],item:d,options:o};o.itemCreated(c)}n.push(d)}return n}function l(i,n,o,l){var d=t.extend({},O,n);e.cssClass=g(d.moduleName);var c,h=t.extend({},r.defaultMappedFields,d.fields),u=t.extend({},L,d.ariaAttributes);o&&(u.level=o);var f,b=[];Object.keys(i).length&&!p(i).item.hasOwnProperty(h.id)&&(c=y());for(var C=0;C<i.length;C++){var I=s(i[C],h);if(!t.isNullOrUndefined(i[C])){if(d.itemCreating&&"function"==typeof d.itemCreating){var w={dataSource:i,curData:i[C],text:I[h.text],options:d,fields:h};d.itemCreating(w)}var x=i[C];Object.keys(i).length&&I.hasOwnProperty(h.id)&&!t.isNullOrUndefined(I[h.id])&&(c=I.id);var D=[];if(d.showCheckBox&&D.push(t.createElement("input",{className:e.cssClass.check,attrs:{type:"checkbox"}})),!0===l)d.showIcon&&I.hasOwnProperty(h.iconCss)&&(t.isNullOrUndefined(I[h.iconCss])||D.push(t.createElement("span",{className:e.cssClass.icon+" "+I[h.iconCss]}))),f=v(x,h,d.itemClass,D,!(!x.hasOwnProperty("isHeader")||!x.isHeader),c,C,n);else{if((f=S(x,h,d.itemClass,n)).classList.add(e.cssClass.level+"-"+u.level),f.setAttribute("aria-level",u.level.toString()),I.hasOwnProperty(h.tooltip)&&f.setAttribute("title",I[h.tooltip]),I.hasOwnProperty(h.htmlAttributes)&&I[h.htmlAttributes]&&m(f,I[h.htmlAttributes]),I.hasOwnProperty(h.enabled)&&!1===I[h.enabled]&&f.classList.add(e.cssClass.disabled),I.hasOwnProperty(h.isVisible)&&!1===I[h.isVisible]&&(f.style.display="none"),I.hasOwnProperty(h.imageUrl)&&!t.isNullOrUndefined(I[h.imageUrl])){var N={src:I[h.imageUrl]};I.hasOwnProperty(h.imageUrl)&&t.merge(N,I[h.imageAttributes]),t.prepend([t.createElement("img",{className:e.cssClass.image,attrs:N})],f.firstElementChild)}d.showIcon&&I.hasOwnProperty(h.iconCss)&&!d.template&&(t.isNullOrUndefined(I[h.iconCss])||t.prepend([t.createElement("div",{className:e.cssClass.icon+" "+I[h.iconCss]})],f.firstElementChild)),D.length&&t.prepend(D,f.firstElementChild),function(i,r,n,o,l,d){var c=s(i,r),h=c[r.child]||[],u=c[r.hasChildren];if(h.length&&(u=!0,l.classList.add(e.cssClass.hasChild),o.processSubChild)){var p=a(h,o,++d);l.appendChild(p)}if(o.expandCollapse&&u&&!o.template){l.firstElementChild.classList.contains(e.cssClass.textContent)&&l.firstElementChild.classList.add(e.cssClass.iconWrapper);var m="left"===o.expandIconPosition?t.prepend:t.append;m([t.createElement("div",{className:"e-icons "+o.expandIconClass})],l.querySelector("."+e.cssClass.textContent))}}(x,h,0,d,f,u.level)}if(d.itemCreated&&"function"==typeof d.itemCreated){w={dataSource:i,curData:i[C],text:I[h.text],item:f,options:d,fields:h};d.itemCreated(w)}b.push(f)}}return b}function a(e,i,s,r){var n=t.extend({},O,i);return C(l(e,i,s,r),n.listClass,i)}function d(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function c(e,t,s){return void 0===s&&(s=new i.Query),"Ascending"===e?s.sortBy(t,"ascending",!0):"Descending"===e&&s.sortBy(t,"descending",!0),s}function h(e,t){return new i.DataManager(e).executeLocal(t)}function u(e,i){var s=t.extend({},O,i),n=t.extend({},r.defaultMappedFields,s.fields),o=e.cloneNode(!0),l=[];o.classList.add("json-parent");var a=o.querySelectorAll(".json-parent>li");o.classList.remove("json-parent");for(var d=0;d<a.length;d++){for(var c=a[d],h=c.querySelector("a"),p=c.querySelector("ul"),m={},v=h?h.childNodes:c.childNodes,g=Object.keys(v),b=0;b<v.length;b++)v[Number(g[b])].hasChildNodes()||(m[n.text]=v[Number(g[b])].textContent);m[n.id]=y();var S=f(c);Object.keys(S).length&&(m[n.htmlAttributes]=S),h&&(S=f(h),Object.keys(S).length&&(m[n.urlAttributes]=S)),p&&(m[n.child]=u(p,i)),l.push(m)}return l}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,r,n,o,l,a,d,c){var h,u=t.extend({},O,c),p=t.extend({},L,u.ariaAttributes),f=i,y=i,v=s(i,r);"string"!=typeof i&&"number"!=typeof i&&(h=i,f=v[r.text]||"",y=v[r.value]);var g;g=t.isNullOrUndefined(h)||t.isNullOrUndefined(v[r.id])||""===v[r.id]?a+"-"+d:a;var S=t.createElement("li",{className:(!0===l?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(n)?"":n),id:g,attrs:""!==p.groupItemRole&&""!==p.itemRole?{role:!0===l?p.groupItemRole:p.itemRole}:{}});return h&&v.hasOwnProperty(r.enabled)&&"false"===v[r.enabled].toString()&&S.classList.add(e.cssClass.disabled),l?S.innerText=f:(t.isNullOrUndefined(y)||S.setAttribute("data-value",y),S.setAttribute("role","option"),h&&v.hasOwnProperty(r.htmlAttributes)&&v[r.htmlAttributes]&&m(S,v[r.htmlAttributes]),o.length&&t.append(o,S),h&&v.hasOwnProperty(r.url)&&v[r.url]?S.appendChild(b(h,r,f)):S.appendChild(document.createTextNode(f))),S}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 b(i,r,n){var o=s(i,r),l={href:o[r.url]};o.hasOwnProperty(r.urlAttributes)&&o[r.urlAttributes]&&t.merge(l,o[r.urlAttributes]);var a=t.createElement("a",{className:e.cssClass.text+" "+e.cssClass.url,innerHTML:n});return m(a,l),a}function S(i,r,n,o){var l,a,d,c,h=t.extend({},O,o),u=t.extend({},L,h.ariaAttributes),p=i;"string"!=typeof i&&(d=i,p=(c=s(i,r))[r.text]||"",l=c[r.id],a=!(!i.hasOwnProperty("isHeader")||!i.isHeader));var m=t.createElement("li",{className:(!0===a?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(n)?"":n),attrs:""!==u.groupItemRole&&""!==u.itemRole?{role:!0===a?u.groupItemRole:u.itemRole}:{}});if(t.isNullOrUndefined(l)?m.setAttribute("data-uid",y()):m.setAttribute("data-uid",l),a&&o&&o.groupTemplate){var f=t.compile(o.groupTemplate);t.append(f(i),m)}else if(!a&&o&&o.template){f=t.compile(o.template);t.append(f(i),m)}else{var v=t.createElement("div",{className:e.cssClass.textContent,attrs:""!==u.wrapperRole?{role:u.wrapperRole}:{}});d&&c.hasOwnProperty(r.url)&&c[r.url]?v.appendChild(b(d,r,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 n=t.extend({},O,r),o=t.extend({},L,n.ariaAttributes);e.cssClass=g(n.moduleName);var l=t.createElement("ul",{className:e.cssClass.ul+" "+(t.isNullOrUndefined(s)?"":s),attrs:""!==o.listRole?{role:o.listRole}:{}});return t.append(i,l),l}r.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 L={level:1,listRole:"presentation",itemRole:"presentation",groupItemRole:"group",itemText:"list-item",wrapperRole:"presentation"},O={showCheckBox:!1,showIcon:!1,expandCollapse:!1,fields:r.defaultMappedFields,ariaAttributes:L,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"right"};r.createList=function(e,i,s){var r=t.extend({},O,i),o=t.extend({},L,r.ariaAttributes),l=p(e).typeof;return"string"===l||"number"===l?n(e,s,i):a(e,i,o.level,s)},r.createListFromArray=n,r.createListItemFromArray=o,r.createListItemFromJson=l,r.createListFromJson=a,r.getSiblingLI=function(i,s,r){if(e.cssClass=g(O.moduleName),i&&i.length){var n,o,l=Array.prototype.slice.call(i);for(n=l[(o=s?d(s,l):!0===r?l.length:-1)+(!0===r?-1:1)];n&&(!t.isVisible(n)||n.classList.contains(e.cssClass.disabled));)n=l[o+=!0===r?-1:1];return n}},r.indexOf=d,r.groupDataSource=function(e,t,s){void 0===s&&(s="None");var r=(new i.Query).group(t.groupBy),n=h(e,r=c(s,"key",r));e=[];for(var o=0;o<n.length;o++){var l=n[o].items,a={};a[t.text]=n[o].key,a.isHeader=!0,a.items=l,e.push(a);for(var d=0;d<l.length;d++)e.push(l[d])}return e},r.addSorting=c,r.getDataSource=h,r.createJsonFromElement=u,r.renderContentTemplate=function(i,r,n){e.cssClass=g(O.moduleName);for(var o=t.createElement("ul",{className:e.cssClass.ul,attrs:{role:"presentation"}}),l=t.compile(i),a=[],d=y(),c=0;c<r.length;c++){var h=s(r[c],n),u=r[c],p=u.isHeader,m=t.createElement("li",{id:d+"-"+c,className:p?e.cssClass.group:e.cssClass.li,attrs:{role:"presentation"}});if(p)m.innerText=h[n.text];else{var f="string"==typeof u||"number"==typeof u?u:h[n.value];t.append(l(u),m),m.setAttribute("data-value",f),m.setAttribute("role","option")}a.push(m)}return t.append(a,o),o},r.renderGroupTemplate=function(e,i,s,r){for(var n=t.compile(e),o=s.groupBy,l={},a=0,d=r;a<d.length;a++){var c=d[a];l[o]=c.textContent,c.innerHTML="",t.append(n(l),c)}return r},r.generateUL=C,r.generateIcon=function(i,s,r){var n=t.extend({},O,r);return t.extend({},L,n.ariaAttributes),e.cssClass=g(n.moduleName),("left"===n.expandIconPosition?t.prepend:t.append)([t.createElement("div",{className:"e-icons "+n.expandIconClass+" "+(t.isNullOrUndefined(s)?"":s)})],i.querySelector("."+e.cssClass.textContent)),i}}(e.ListBase||(e.ListBase={}));var r=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,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},o={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"]},a="e-listview",d="e-hover",c="e-active",h="e-list-parent",u="e-list-item",p="e-list-group-item",m="e-has-child",f="e-list-header",y="e-headertext",v="e-text",g="e-disabled",b="e-content",S="e-icons",C="e-icon-back",L=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r(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),O=function(O){function I(e,i){var s=O.call(this,e,i)||this;return s.curDSLevel=[],s.curViewDS=[],s.keyConfigs={moveDown:"downarrow",moveUp:"uparrow",select:"enter",back:"backspace"},s.animateOptions={},s.aniObj=new t.Animation(s.animateOptions),s}return r(I,O),I.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"htmlAttributes":this.setHTMLAttribute();break;case"cssClass":this.setCSSClass(t.cssClass);break;case"enable":this.setEnable();break;case"width":case"height":this.setSize();break;case"enableRtl":this.setEnableRTL();break;case"fields":this.listBaseOption.fields=this.fields.properties,this.reRender();break;case"headerTitle":this.curDSLevel.length||this.header(this.headerTitle,!1);break;case"showHeader":this.header(this.headerTitle,!1);break;case"dataSource":this.reRender();break;case"sortOrder":case"showIcon":this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList()}}},I.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&t.attributes(this.element,this.htmlAttributes)},I.prototype.setCSSClass=function(e){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),e&&t.removeClass([this.element],e.split(" "))},I.prototype.setSize=function(){this.element.style.height=t.formatUnit(this.height),this.element.style.width=t.formatUnit(this.width)},I.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},I.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},I.prototype.enableElement=function(e,t){t?e.classList.remove(g):e.classList.add(g)},I.prototype.header=function(e,i){if(void 0===this.headerEle&&this.showHeader){this.headerEle=t.createElement("div",{className:f});var s=t.createElement("span",{className:y,innerHTML:this.headerTitle}),r=t.createElement("div",{className:v,innerHTML:s.outerHTML}),n=t.createElement("div",{className:S+" "+C+" e-but-back",attrs:{style:"display:none;"}});this.headerEle.appendChild(n),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("."+y),n=this.headerEle.querySelector("."+C);r.innerHTML=e,n.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},I.prototype.switchView=function(e,t,i){var s=this;if(e&&t){var r=e.style.position,n="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var a=void 0,d=this.animation.duration;if(this.animation.effect)a=this.enableRtl?l[this.animation.effect]:o[this.animation.effect];else{a=o.SlideLeft,i=this.enableRtl,d=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?a[0]:a[1],duration:d,timingFunction:this.animation.easing,end:function(t){e.style.display="none",s.element.style.overflow=n,e.style.position=r,e.classList.remove("e-view")}}),t.style.display="",this.aniObj.animate(t,{name:!0===i?a[2]:a[3],duration:d,timingFunction:this.animation.easing,end:function(){s.trigger("actionComplete")}}),this.curUL=t}},I.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}},I.prototype.clickHandler=function(e){var i=e.target,s=i.classList;if(s.contains(C)||s.contains(y))this.back();else{var r=t.closest(i.parentNode,"."+u);null===r&&(r=i),this.setSelectLI(r,e)}},I.prototype.hoverHandler=function(e){var i=t.closest(e.target.parentNode,"."+u);this.setHoverLI(i)},I.prototype.leaveHandler=function(e){this.removeHover()},I.prototype.keyActionHandler=function(e){switch(e.preventDefault(),e.action){case"moveDown":this.hoverSiblingLI();break;case"moveUp":this.hoverSiblingLI(!0);break;case"select":this.setSelectLI(this.curUL.querySelector("."+d),e);break;case"back":this.back()}},I.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&this.back()},I.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),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)})},I.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()},I.prototype.removeHover=function(){var e=this.element.querySelector("."+d);e&&e.classList.remove(d)},I.prototype.removeSelect=function(){for(var e=0,t=this.element.querySelectorAll("."+c);e<t.length;e++){var i=t[e];i.removeAttribute("aria-selected"),""!==i.className&&i.classList.remove(c),this.selectedItems=void 0}},I.prototype.isValidLI=function(e){return e&&e.classList.contains(u)&&!e.classList.contains(p)&&!e.classList.contains(g)},I.prototype.setSelectLI=function(e,i){if(this.isValidLI(e)&&!e.classList.contains(c)&&this.enable){this.removeSelect(),e.classList.add(c),e.setAttribute("aria-selected","true"),this.removeHover();var r=this.getItemData(e),n=s(r,this.listBaseOption.fields);t.isNullOrUndefined(r)&&"string"==typeof this.dataSource[0]?this.selectedItems={item:e,text:e.innerText.trim(),data:this.dataSource}:this.selectedItems={item:e,text:n[this.listBaseOption.fields.text],data:r};var o={};t.merge(o,this.selectedItems),i&&t.merge(o,{isInteracted:!0,event:i}),this.trigger("select",o),this.selectedLI=e,this.renderSubList(e)}},I.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(c)||e.classList.add(d)}},I.prototype.hoverSiblingLI=function(t){var i,s=this.curUL.querySelector("."+d);if(s||(s=this.curUL.querySelector("."+c)),s)i=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+u),s,t);else if(t){var r=this.curUL.querySelectorAll("."+u);i=r[r.length-1]}else i=this.curUL.querySelector("."+u);this.setHoverLI(i)},I.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,r=e;i<r.length;i++){var n=r[i];this.curDSJSON=this.findItemFromDS(t,{id:n});var o=s(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?o[this.fields.child]:t}return t}return this.localData},I.prototype.getItemData=function(e){var t=this.getElementUID(e),i=this.dataSource;return this.findItemFromDS(i,t)},I.prototype.findItemFromDS=function(e,i,r){var n,o=this;return e&&e.length&&i?e.some(function(l){var a=s(l,o.listBaseOption.fields);if(!i.id&&!i.text||i.id&&a[o.fields.id]!==i.id||i.text&&a[o.fields.text]!==i.text)if(!t.isNullOrUndefined(i.id)&&t.isNullOrUndefined(a[o.fields.id])){o.element.querySelector('[data-uid="'+i.id+'"]').innerText.trim()===a[o.fields.text]&&(n=l)}else a.hasOwnProperty(o.fields.child)&&a[o.fields.child].length&&(n=o.findItemFromDS(a[o.fields.child],i,r));else n=r?e:l;return!!n}):n=e,n},I.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var r=0,n=Object.keys(this.fields.properties);r<n.length;r++){var o=n[r];"tableName"!==o&&this.fields[o]&&this.fields[o]!==e.ListBase.defaultMappedFields[o]&&-1===t.indexOf(this.fields[o])&&t.push(this.fields[o])}s.select(t),this.fields.properties.hasOwnProperty("tableName")&&s.from(this.fields.tableName)}return s},I.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},I.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},I.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}))}},I.prototype.reRender=function(){this.element.innerHTML="",this.curUL=this.headerEle=void 0,this.setLocalData(),this.header()},I.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},I.prototype.createList=function(){this.ulElement=this.curUL=e.ListBase.createList(this.curViewDS,this.listBaseOption),this.liCollection=this.curUL.querySelectorAll("."+u)},I.prototype.renderSubList=function(i){var r=i.getAttribute("data-uid");if(i.classList.contains(m)&&r){var n=t.closest(i.parentNode,"."+h),o=this.element.querySelector("[pid='"+r+"']");this.curDSLevel.push(r),this.setViewDataSource(this.getSubDS()),o||((o=e.ListBase.createListFromJson(this.curViewDS,this.listBaseOption,this.curDSLevel.length)).setAttribute("pID",r),o.style.display="none",this.renderIntoDom(o)),this.switchView(n,o),this.liCollection=this.curUL.querySelectorAll("."+u);var l=s(this.selectedItems.data,this.listBaseOption.fields);this.header(l[this.listBaseOption.fields.text],!0),this.selectedLI=void 0}},I.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},I.prototype.renderList=function(){this.setViewDataSource(),this.createList(),this.contentContainer=t.createElement("div",{className:b}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement)},I.prototype.getElementUID=function(e){var t={};return e instanceof Element?t.id=e.getAttribute("data-uid"):t=e,t},I.prototype.render=function(){this.element.classList.add(a),t.attributes(this.element,{role:"list"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.rippleFn=t.rippleEffect(this.element,{selector:"."+u})},I.prototype.destroy=function(){this.unWireEvents();var e=[a,this.cssClass,g,"e-rtl","e-has-header"];t.removeClass([this.element],e),this.rippleFn(),O.prototype.destroy.call(this)},I.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 r=s(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(i,t,!0),this.removeSelect(),this.liCollection=this.curUL.querySelectorAll("."+u),this.header(this.curDSLevel.length?r:this.headerTitle,!!this.curDSLevel.length)}},I.prototype.selectItem=function(e){if(!t.isNullOrUndefined(e)){var i=this.getItemData(e),r=s(i,this.listBaseOption.fields);if(i){var n=this.element.querySelector('[data-uid="'+r[this.fields.id]+'"]');if(t.isNullOrUndefined(n))for(var o=this.element.querySelectorAll("."+u),l=0;l<o.length;l++)o[l].innerText.trim()===i.text&&(n=o[l]);this.setSelectLI(n)}}},I.prototype.getSelectedItem=function(){return this.selectedItems},I.prototype.findItem=function(e){return this.findItemFromDS(this.dataSource,e)},I.prototype.enableItem=function(e){this.setItemState(e,!0)},I.prototype.disableItem=function(e){this.setItemState(e,!1)},I.prototype.setItemState=function(e,t){var i=this.getItemData(e),r=s(i,this.listBaseOption.fields);if(i){var n=this.element.querySelector('[data-uid="'+r[this.fields.id]+'"]');t?(n&&n.classList.remove(g),delete i[this.fields.enabled]):t||(n&&n.classList.add(g),i[this.fields.enabled]=!1)}},I.prototype.showItem=function(e){this.showHideItem(e,!1,"")},I.prototype.hideItem=function(e){this.showHideItem(e,!0,"none")},I.prototype.showHideItem=function(e,t,i){var r=this.getItemData(e),n=s(r,this.listBaseOption.fields);if(r){var o=this.element.querySelector('[data-uid="'+n[this.fields.id]+'"]');o&&(o.style.display=i),t?r[this.fields.isVisible]=!1:delete r[this.fields.isVisible]}},I.prototype.addItem=function(e,t){var i=this.findItemFromDS(this.dataSource,t),r=s(i,this.listBaseOption.fields)[this.fields.child];r||(r=[]),r=r.concat(e),i instanceof Array?(this.dataSource=this.localData=i.concat(e),this.setViewDataSource()):i[this.fields.child]=r,this.resetCurrentList()},I.prototype.removeItem=function(e){var i=this,r=this.getElementUID(e),n=this.findItemFromDS(this.dataSource,r,!0);if(n&&e){var o,l;n.some(function(e,t,n){var a=s(e,i.listBaseOption.fields);return!(!r.id&&!r.text||r.id&&a[i.fields.id]!==r.id||r.text&&a[i.fields.text]!==r.text)&&(o=n,l=t,!0)}),t.isNullOrUndefined(this.selectedItems)||this.selectedItems.data!==o[l]||(this.selectedItems=void 0),o.splice(l,1),this.curViewDS=o,this.resetCurrentList(),this.selectItem(this.selectedItems)}},I.prototype.getModuleName=function(){return"listview"},I.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width"])},n([t.Property()],I.prototype,"cssClass",void 0),n([t.Property({})],I.prototype,"htmlAttributes",void 0),n([t.Property(!0)],I.prototype,"enable",void 0),n([t.Property([])],I.prototype,"dataSource",void 0),n([t.Property()],I.prototype,"query",void 0),n([t.Complex(e.ListBase.defaultMappedFields,L)],I.prototype,"fields",void 0),n([t.Property({effect:"SlideLeft",duration:400,easing:"ease"})],I.prototype,"animation",void 0),n([t.Property("None")],I.prototype,"sortOrder",void 0),n([t.Property(!1)],I.prototype,"showIcon",void 0),n([t.Property("")],I.prototype,"headerTitle",void 0),n([t.Property(!1)],I.prototype,"showHeader",void 0),n([t.Property("")],I.prototype,"height",void 0),n([t.Property("")],I.prototype,"width",void 0),n([t.Property(null)],I.prototype,"template",void 0),n([t.Property(null)],I.prototype,"groupTemplate",void 0),n([t.Event()],I.prototype,"select",void 0),n([t.Event()],I.prototype,"actionBegin",void 0),n([t.Event()],I.prototype,"actionComplete",void 0),n([t.Event()],I.prototype,"actionFailure",void 0),I=n([t.NotifyPropertyChanges],I)}(t.Component);e.FieldSettings=L,e.ListView=O,e.getFieldValues=s,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")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data"],t):t(e.ej={},e.ej2Base,e.ej2Data)}(this,function(e,t,i){"use strict";function s(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 n=0,l=Object.keys(i);n<l.length;n++){var o=l[n];if(!t.isNullOrUndefined(i[o])&&"string"==typeof i[o]){var a=i[o].split("."),d=a.length>1?a[0]:i[o];t.isNullOrUndefined(e[d])||(s=t.getValue(i[o],e),t.isNullOrUndefined(s)||(r[i[o]]=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(r){function n(e,t,i){return L(l(e,t,i),null,i)}function l(i,s,r){var n=[],l=t.extend({},O,r);e.cssClass=g(l.moduleName);for(var o=y(),a=0;a<i.length;a++)if(!t.isNullOrUndefined(i[a])){var d=void 0;if(l.itemCreating&&"function"==typeof l.itemCreating){var c={dataSource:i,curData:i[a],text:i[a],options:l};l.itemCreating(c)}if(d=s?v(i[a],null,null,[],null,o,a,r):S(i[a],null,null,r),l.itemCreated&&"function"==typeof l.itemCreated){c={dataSource:i,curData:i[a],text:i[a],item:d,options:l};l.itemCreated(c)}n.push(d)}return n}function o(i,n,l,o){var d=t.extend({},O,n);e.cssClass=g(d.moduleName);var c,h=t.extend({},r.defaultMappedFields,d.fields),u=t.extend({},C,d.ariaAttributes);l&&(u.level=l);var f,b=[];Object.keys(i).length&&!p(i).item.hasOwnProperty(h.id)&&(c=y());for(var L=0;L<i.length;L++){var I=s(i[L],h);if(!t.isNullOrUndefined(i[L])){if(d.itemCreating&&"function"==typeof d.itemCreating){var w={dataSource:i,curData:i[L],text:I[h.text],options:d,fields:h};d.itemCreating(w)}var x=i[L];Object.keys(i).length&&I.hasOwnProperty(h.id)&&!t.isNullOrUndefined(I[h.id])&&(c=I.id);var D=[];if(d.showCheckBox&&D.push(t.createElement("input",{className:e.cssClass.check,attrs:{type:"checkbox"}})),!0===o)d.showIcon&&I.hasOwnProperty(h.iconCss)&&(t.isNullOrUndefined(I[h.iconCss])||D.push(t.createElement("span",{className:e.cssClass.icon+" "+I[h.iconCss]}))),f=v(x,h,d.itemClass,D,!(!x.hasOwnProperty("isHeader")||!x.isHeader),c,L,n);else{if((f=S(x,h,d.itemClass,n)).classList.add(e.cssClass.level+"-"+u.level),f.setAttribute("aria-level",u.level.toString()),I.hasOwnProperty(h.tooltip)&&f.setAttribute("title",I[h.tooltip]),I.hasOwnProperty(h.htmlAttributes)&&I[h.htmlAttributes]&&m(f,I[h.htmlAttributes]),I.hasOwnProperty(h.enabled)&&!1===I[h.enabled]&&f.classList.add(e.cssClass.disabled),I.hasOwnProperty(h.isVisible)&&!1===I[h.isVisible]&&(f.style.display="none"),I.hasOwnProperty(h.imageUrl)&&!t.isNullOrUndefined(I[h.imageUrl])){var N={src:I[h.imageUrl]};I.hasOwnProperty(h.imageUrl)&&t.merge(N,I[h.imageAttributes]),t.prepend([t.createElement("img",{className:e.cssClass.image,attrs:N})],f.firstElementChild)}d.showIcon&&I.hasOwnProperty(h.iconCss)&&!d.template&&(t.isNullOrUndefined(I[h.iconCss])||t.prepend([t.createElement("div",{className:e.cssClass.icon+" "+I[h.iconCss]})],f.firstElementChild)),D.length&&t.prepend(D,f.firstElementChild),function(i,r,n,l,o,d){var c=s(i,r),h=c[r.child]||[],u=c[r.hasChildren];if(h.length&&(u=!0,o.classList.add(e.cssClass.hasChild),l.processSubChild)){var p=a(h,l,++d);o.appendChild(p)}if(l.expandCollapse&&u&&!l.template){o.firstElementChild.classList.contains(e.cssClass.textContent)&&o.firstElementChild.classList.add(e.cssClass.iconWrapper);var m="left"===l.expandIconPosition?t.prepend:t.append;m([t.createElement("div",{className:"e-icons "+l.expandIconClass})],o.querySelector("."+e.cssClass.textContent))}}(x,h,0,d,f,u.level)}if(d.itemCreated&&"function"==typeof d.itemCreated){w={dataSource:i,curData:i[L],text:I[h.text],item:f,options:d,fields:h};d.itemCreated(w)}b.push(f)}}return b}function a(e,i,s,r){var n=t.extend({},O,i);return L(o(e,i,s,r),n.listClass,i)}function d(e,t){if(t&&e){return Array.prototype.slice.call(t).indexOf(e)}}function c(e,t,s){return void 0===s&&(s=new i.Query),"Ascending"===e?s.sortBy(t,"ascending",!0):"Descending"===e&&s.sortBy(t,"descending",!0),s}function h(e,t){return new i.DataManager(e).executeLocal(t)}function u(e,i){var s=t.extend({},O,i),n=t.extend({},r.defaultMappedFields,s.fields),l=e.cloneNode(!0),o=[];l.classList.add("json-parent");var a=l.querySelectorAll(".json-parent>li");l.classList.remove("json-parent");for(var d=0;d<a.length;d++){for(var c=a[d],h=c.querySelector("a"),p=c.querySelector("ul"),m={},v=h?h.childNodes:c.childNodes,g=Object.keys(v),b=0;b<v.length;b++)v[Number(g[b])].hasChildNodes()||(m[n.text]=v[Number(g[b])].textContent);m[n.id]=y();var S=f(c);Object.keys(S).length&&(m[n.htmlAttributes]=S),h&&(S=f(h),Object.keys(S).length&&(m[n.urlAttributes]=S)),p&&(m[n.child]=u(p,i)),o.push(m)}return o}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,r,n,l,o,a,d,c){var h,u=t.extend({},O,c),p=t.extend({},C,u.ariaAttributes),f=i,y=i,v=s(i,r);"string"!=typeof i&&"number"!=typeof i&&(h=i,f=v[r.text]||"",y=v[r.value]);var g;g=t.isNullOrUndefined(h)||t.isNullOrUndefined(v[r.id])||""===v[r.id]?a+"-"+d:a;var S=t.createElement("li",{className:(!0===o?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(n)?"":n),id:g,attrs:""!==p.groupItemRole&&""!==p.itemRole?{role:!0===o?p.groupItemRole:p.itemRole}:{}});return h&&v.hasOwnProperty(r.enabled)&&"false"===v[r.enabled].toString()&&S.classList.add(e.cssClass.disabled),o?S.innerText=f:(t.isNullOrUndefined(y)||S.setAttribute("data-value",y),S.setAttribute("role","option"),h&&v.hasOwnProperty(r.htmlAttributes)&&v[r.htmlAttributes]&&m(S,v[r.htmlAttributes]),l.length&&t.append(l,S),h&&v.hasOwnProperty(r.url)&&v[r.url]?S.appendChild(b(h,r,f)):S.appendChild(document.createTextNode(f))),S}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 b(i,r,n){var l=s(i,r),o={href:l[r.url]};l.hasOwnProperty(r.urlAttributes)&&l[r.urlAttributes]&&t.merge(o,l[r.urlAttributes]);var a=t.createElement("a",{className:e.cssClass.text+" "+e.cssClass.url,innerHTML:n});return m(a,o),a}function S(i,r,n,l){var o,a,d,c,h=t.extend({},O,l),u=t.extend({},C,h.ariaAttributes),p=i;"string"!=typeof i&&(d=i,p=(c=s(i,r))[r.text]||"",o=c[r.id],a=!(!i.hasOwnProperty("isHeader")||!i.isHeader));var m=t.createElement("li",{className:(!0===a?e.cssClass.group:e.cssClass.li)+" "+(t.isNullOrUndefined(n)?"":n),attrs:""!==u.groupItemRole&&""!==u.itemRole?{role:!0===a?u.groupItemRole:u.itemRole}:{}});if(t.isNullOrUndefined(o)?m.setAttribute("data-uid",y()):m.setAttribute("data-uid",o),a&&l&&l.groupTemplate){var f=t.compile(l.groupTemplate);t.append(f(i),m)}else if(!a&&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}:{}});d&&c.hasOwnProperty(r.url)&&c[r.url]?v.appendChild(b(d,r,p)):v.appendChild(t.createElement("span",{className:e.cssClass.text,innerHTML:p,attrs:""!==u.itemText?{role:u.itemText}:{}})),m.appendChild(v)}return m}function L(i,s,r){var n=t.extend({},O,r),l=t.extend({},C,n.ariaAttributes);e.cssClass=g(n.moduleName);var o=t.createElement("ul",{className:e.cssClass.ul+" "+(t.isNullOrUndefined(s)?"":s),attrs:""!==l.listRole?{role:l.listRole}:{}});return t.append(i,o),o}r.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"},O={showCheckBox:!1,showIcon:!1,expandCollapse:!1,fields:r.defaultMappedFields,ariaAttributes:C,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null,expandIconClass:"e-icon-collapsible",moduleName:"list",expandIconPosition:"right"};r.createList=function(e,i,s){var r=t.extend({},O,i),l=t.extend({},C,r.ariaAttributes),o=p(e).typeof;return"string"===o||"number"===o?n(e,s,i):a(e,i,l.level,s)},r.createListFromArray=n,r.createListItemFromArray=l,r.createListItemFromJson=o,r.createListFromJson=a,r.getSiblingLI=function(i,s,r){if(e.cssClass=g(O.moduleName),i&&i.length){var n,l,o=Array.prototype.slice.call(i);for(n=o[(l=s?d(s,o):!0===r?o.length:-1)+(!0===r?-1:1)];n&&(!t.isVisible(n)||n.classList.contains(e.cssClass.disabled));)n=o[l+=!0===r?-1:1];return n}},r.indexOf=d,r.groupDataSource=function(e,t,s){void 0===s&&(s="None");var r=(new i.Query).group(t.groupBy),n=h(e,r=c(s,"key",r));e=[];for(var l=0;l<n.length;l++){var o=n[l].items,a={};a[t.text]=n[l].key,a.isHeader=!0,a.items=o,e.push(a);for(var d=0;d<o.length;d++)e.push(o[d])}return e},r.addSorting=c,r.getDataSource=h,r.createJsonFromElement=u,r.renderContentTemplate=function(i,r,n){e.cssClass=g(O.moduleName);for(var l=t.createElement("ul",{className:e.cssClass.ul,attrs:{role:"presentation"}}),o=t.compile(i),a=[],d=y(),c=0;c<r.length;c++){var h=s(r[c],n),u=r[c],p=u.isHeader,m=t.createElement("li",{id:d+"-"+c,className:p?e.cssClass.group:e.cssClass.li,attrs:{role:"presentation"}});if(p)m.innerText=h[n.text];else{var f="string"==typeof u||"number"==typeof u?u:h[n.value];t.append(o(u),m),m.setAttribute("data-value",f),m.setAttribute("role","option")}a.push(m)}return t.append(a,l),l},r.renderGroupTemplate=function(e,i,s,r){for(var n=t.compile(e),l=s.groupBy,o={},a=0,d=r;a<d.length;a++){var c=d[a];o[l]=c.textContent,c.innerHTML="",t.append(n(o),c)}return r},r.generateUL=L,r.generateIcon=function(i,s,r){var n=t.extend({},O,r);return t.extend({},C,n.ariaAttributes),e.cssClass=g(n.moduleName),("left"===n.expandIconPosition?t.prepend:t.append)([t.createElement("div",{className:"e-icons "+n.expandIconClass+" "+(t.isNullOrUndefined(s)?"":s)})],i.querySelector("."+e.cssClass.textContent)),i}}(e.ListBase||(e.ListBase={}));var r=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,n=arguments.length,l=n<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 o=e.length-1;o>=0;o--)(r=e[o])&&(l=(n<3?r(l):n>3?r(t,i,l):r(t,i))||l);return n>3&&l&&Object.defineProperty(t,i,l),l},l={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},o={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},a="e-listview",d="e-hover",c="e-active",h="e-focused",u="e-list-parent",p="e-list-item",m="e-list-group-item",f="e-has-child",y="e-list-header",v="e-headertext",g="e-text",b="e-disabled",S="e-content",L="e-icons",C="e-icon-back",O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return r(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),I=function(I){function w(e,i){var s=I.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"},s.animateOptions={},s.aniObj=new t.Animation(s.animateOptions),s}return r(w,I),w.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"dataSource":this.reRender();break;case"sortOrder":case"showIcon":this.listBaseOption.showIcon=this.showIcon,this.curViewDS=this.getSubDS(),this.resetCurrentList()}}},w.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&t.attributes(this.element,this.htmlAttributes)},w.prototype.setCSSClass=function(e){this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),e&&t.removeClass([this.element],e.split(" "))},w.prototype.setSize=function(){this.element.style.height=t.formatUnit(this.height),this.element.style.width=t.formatUnit(this.width)},w.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},w.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},w.prototype.enableElement=function(e,t){t?e.classList.remove(b):e.classList.add(b)},w.prototype.header=function(e,i){if(void 0===this.headerEle&&this.showHeader){this.headerEle=t.createElement("div",{className:y});var s=t.createElement("span",{className:v,innerHTML:this.headerTitle}),r=t.createElement("div",{className:g,innerHTML:s.outerHTML}),n=t.createElement("div",{className:L+" "+C+" e-but-back",attrs:{style:"display:none;"}});this.headerEle.appendChild(n),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("."+v),n=this.headerEle.querySelector("."+C);r.innerHTML=e,n.style.display=!0===i?"":"none"}else this.headerEle.style.display="none"},w.prototype.switchView=function(e,t,i){var s=this;if(e&&t){var r=e.style.position,n="hidden"!==this.element.style.overflow?this.element.style.overflow:"";e.style.position="absolute",e.classList.add("e-view");var a=void 0,d=this.animation.duration;if(this.animation.effect)a=this.enableRtl?o[this.animation.effect]:l[this.animation.effect];else{a=l.SlideLeft,i=this.enableRtl,d=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?a[0]:a[1],duration:d,timingFunction:this.animation.easing,end:function(t){e.style.display="none",s.element.style.overflow=n,e.style.position=r,e.classList.remove("e-view")}}),t.style.display="",this.aniObj.animate(t,{name:!0===i?a[2]:a[3],duration:d,timingFunction:this.animation.easing,end:function(){s.trigger("actionComplete")}}),this.curUL=t}},w.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}},w.prototype.clickHandler=function(e){var i=e.target,s=i.classList;if(s.contains(C)||s.contains(v))this.back();else{var r=t.closest(i.parentNode,"."+p);null===r&&(r=i),this.setSelectLI(r,e)}},w.prototype.hoverHandler=function(e){var i=t.closest(e.target.parentNode,"."+p);this.setHoverLI(i)},w.prototype.leaveHandler=function(e){this.removeHover()},w.prototype.homeKeyHandler=function(e,t){var i=this.curUL.querySelectorAll("."+p),s=this.curUL.querySelector("."+h)||this.curUL.querySelector("."+c);s&&(s.classList.remove(h),s.classList.remove(c));var r=t?i.length-1:0;i[r].classList.contains(f)?i[r].classList.add(h):this.setSelectLI(i[r],e)},w.prototype.arrowKeyHandler=function(i,s){var r,n;!t.isNullOrUndefined(this.curUL.querySelector("."+f))?(n=this.curUL.querySelector("."+h)||this.curUL.querySelector("."+c),r=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+p),n,s),t.isNullOrUndefined(r)||(n&&(n.classList.remove(h),n.classList.remove(c)),r.classList.contains(f)?r.classList.add(h):this.setSelectLI(r,i))):(n=this.curUL.querySelector("."+c),r=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+p),n,s),this.setSelectLI(r,i))},w.prototype.enterKeyHandler=function(e){var i=!t.isNullOrUndefined(this.curUL.querySelector("."+f)),s=this.curUL.querySelector("."+h);i&&s&&(s.classList.remove(h),this.setSelectLI(s,e))},w.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)}},w.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&this.back()},w.prototype.focusout=function(){var e=this.curUL.querySelector("."+h),t=this.curUL.querySelector("[aria-selected = true]");e&&(e.classList.remove(h),t&&t.classList.add(c))},w.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)})},w.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()},w.prototype.tabFocus=function(e){if(!this.curUL.querySelector("."+c)&&this.curUL){var i=this.curUL.querySelector("."+p);if(i.classList.contains(f)){var s=this.curUL.querySelector("."+h);t.isNullOrUndefined(s)&&i.classList.add(h)}else this.setSelectLI(i,e)}},w.prototype.removeHover=function(){var e=this.element.querySelector("."+d);e&&e.classList.remove(d)},w.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(c),this.selectedItems=void 0}},w.prototype.isValidLI=function(e){return e&&e.classList.contains(p)&&!e.classList.contains(m)&&!e.classList.contains(b)},w.prototype.setSelectLI=function(e,i){if(this.isValidLI(e)&&!e.classList.contains(c)&&this.enable){this.removeSelect(),e.classList.add(c),e.setAttribute("aria-selected","true");var r=this.getItemData(e),n=s(r,this.listBaseOption.fields);t.isNullOrUndefined(r)&&"string"==typeof this.dataSource[0]?this.selectedItems={item:e,text:e.innerText.trim(),data:this.dataSource}:this.selectedItems={item:e,text:n[this.listBaseOption.fields.text],data:r};var l={};t.merge(l,this.selectedItems),i&&t.merge(l,{isInteracted:!0,event:i}),this.trigger("select",l),this.selectedLI=e,this.renderSubList(e)}},w.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(c)||e.classList.add(d)}},w.prototype.hoverSiblingLI=function(t){var i,s=this.curUL.querySelector("."+d);if(s||(s=this.curUL.querySelector("."+c)),s)i=e.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+p),s,t);else if(t){var r=this.curUL.querySelectorAll("."+p);i=r[r.length-1]}else i=this.curUL.querySelector("."+p);this.setHoverLI(i)},w.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,r=e;i<r.length;i++){var n=r[i];this.curDSJSON=this.findItemFromDS(t,{id:n});var l=s(this.curDSJSON,this.listBaseOption.fields);t=this.curDSJSON?l[this.fields.child]:t}return t}return this.localData},w.prototype.getItemData=function(e){var t=this.getElementUID(e),i=this.dataSource;return this.findItemFromDS(i,t)},w.prototype.findItemFromDS=function(e,i,r){var n,l=this;return e&&e.length&&i?e.some(function(o){var a=s(o,l.listBaseOption.fields);if(!i.id&&!i.text||i.id&&a[l.fields.id]!==i.id||i.text&&a[l.fields.text]!==i.text)if(!t.isNullOrUndefined(i.id)&&t.isNullOrUndefined(a[l.fields.id])){l.element.querySelector('[data-uid="'+i.id+'"]').innerText.trim()===a[l.fields.text]&&(n=o)}else a.hasOwnProperty(l.fields.child)&&a[l.fields.child].length&&(n=l.findItemFromDS(a[l.fields.child],i,r));else n=r?e:o;return!!n}):n=e,n},w.prototype.getQuery=function(){var t=[],s=this.query?this.query:new i.Query;if(!this.query){for(var r=0,n=Object.keys(this.fields.properties);r<n.length;r++){var l=n[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},w.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},w.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},w.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}))}},w.prototype.reRender=function(){this.element.innerHTML="",this.curUL=this.headerEle=void 0,this.setLocalData(),this.header()},w.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},w.prototype.createList=function(){this.ulElement=this.curUL=e.ListBase.createList(this.curViewDS,this.listBaseOption),this.liCollection=this.curUL.querySelectorAll("."+p)},w.prototype.renderSubList=function(i){var r=i.getAttribute("data-uid");if(i.classList.contains(f)&&r){var n=t.closest(i.parentNode,"."+u),l=this.element.querySelector("[pid='"+r+"']");this.curDSLevel.push(r),this.setViewDataSource(this.getSubDS()),l||((l=e.ListBase.createListFromJson(this.curViewDS,this.listBaseOption,this.curDSLevel.length)).setAttribute("pID",r),l.style.display="none",this.renderIntoDom(l)),this.switchView(n,l),this.liCollection=this.curUL.querySelectorAll("."+p);var o=s(this.selectedItems.data,this.listBaseOption.fields);this.header(o[this.listBaseOption.fields.text],!0),this.selectedLI=void 0}},w.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},w.prototype.renderList=function(){this.setViewDataSource(),this.createList(),this.contentContainer=t.createElement("div",{className:S}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement)},w.prototype.getElementUID=function(e){var t={};return e instanceof Element?t.id=e.getAttribute("data-uid"):t=e,t},w.prototype.render=function(){this.element.classList.add(a),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:"."+p})},w.prototype.destroy=function(){this.unWireEvents();var e=[a,this.cssClass,b,"e-rtl","e-has-header"];t.removeClass([this.element],e),this.rippleFn(),I.prototype.destroy.call(this)},w.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 r=s(this.curDSJSON,this.listBaseOption.fields)[this.fields.text];this.switchView(i,t,!0),this.removeSelect(),this.liCollection=this.curUL.querySelectorAll("."+p),this.header(this.curDSLevel.length?r:this.headerTitle,!!this.curDSLevel.length)}},w.prototype.selectItem=function(e){if(!t.isNullOrUndefined(e)){var i=this.getItemData(e),r=s(i,this.listBaseOption.fields);if(i){var n=this.element.querySelector('[data-uid="'+r[this.fields.id]+'"]');if(t.isNullOrUndefined(n))for(var l=this.element.querySelectorAll("."+p),o=0;o<l.length;o++)l[o].innerText.trim()===i.text&&(n=l[o]);this.setSelectLI(n)}}},w.prototype.getSelectedItem=function(){return this.selectedItems},w.prototype.findItem=function(e){return this.findItemFromDS(this.dataSource,e)},w.prototype.enableItem=function(e){this.setItemState(e,!0)},w.prototype.disableItem=function(e){this.setItemState(e,!1)},w.prototype.setItemState=function(e,t){var i=this.getItemData(e),r=s(i,this.listBaseOption.fields);if(i){var n=this.element.querySelector('[data-uid="'+r[this.fields.id]+'"]');t?(n&&n.classList.remove(b),delete i[this.fields.enabled]):t||(n&&n.classList.add(b),i[this.fields.enabled]=!1)}},w.prototype.showItem=function(e){this.showHideItem(e,!1,"")},w.prototype.hideItem=function(e){this.showHideItem(e,!0,"none")},w.prototype.showHideItem=function(e,t,i){var r=this.getItemData(e),n=s(r,this.listBaseOption.fields);if(r){var l=this.element.querySelector('[data-uid="'+n[this.fields.id]+'"]');l&&(l.style.display=i),t?r[this.fields.isVisible]=!1:delete r[this.fields.isVisible]}},w.prototype.addItem=function(e,t){var i=this.findItemFromDS(this.dataSource,t),r=s(i,this.listBaseOption.fields)[this.fields.child];r||(r=[]),r=r.concat(e),i instanceof Array?(this.dataSource=this.localData=i.concat(e),this.setViewDataSource()):i[this.fields.child]=r,this.resetCurrentList()},w.prototype.removeItem=function(e){var i=this,r=this.getElementUID(e),n=this.findItemFromDS(this.dataSource,r,!0);if(n&&e){var l,o;n.some(function(e,t,n){var a=s(e,i.listBaseOption.fields);return!(!r.id&&!r.text||r.id&&a[i.fields.id]!==r.id||r.text&&a[i.fields.text]!==r.text)&&(l=n,o=t,!0)}),t.isNullOrUndefined(this.selectedItems)||this.selectedItems.data!==l[o]||(this.selectedItems=void 0),l.splice(o,1),this.curViewDS=l,this.resetCurrentList(),this.selectItem(this.selectedItems)}},w.prototype.getModuleName=function(){return"listview"},w.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width"])},n([t.Property()],w.prototype,"cssClass",void 0),n([t.Property({})],w.prototype,"htmlAttributes",void 0),n([t.Property(!0)],w.prototype,"enable",void 0),n([t.Property([])],w.prototype,"dataSource",void 0),n([t.Property()],w.prototype,"query",void 0),n([t.Complex(e.ListBase.defaultMappedFields,O)],w.prototype,"fields",void 0),n([t.Property({effect:"SlideLeft",duration:400,easing:"ease"})],w.prototype,"animation",void 0),n([t.Property("None")],w.prototype,"sortOrder",void 0),n([t.Property(!1)],w.prototype,"showIcon",void 0),n([t.Property("")],w.prototype,"headerTitle",void 0),n([t.Property(!1)],w.prototype,"showHeader",void 0),n([t.Property("")],w.prototype,"height",void 0),n([t.Property("")],w.prototype,"width",void 0),n([t.Property(null)],w.prototype,"template",void 0),n([t.Property(null)],w.prototype,"groupTemplate",void 0),n([t.Event()],w.prototype,"select",void 0),n([t.Event()],w.prototype,"actionBegin",void 0),n([t.Event()],w.prototype,"actionComplete",void 0),n([t.Event()],w.prototype,"actionFailure",void 0),w=n([t.NotifyPropertyChanges],w)}(t.Component);e.FieldSettings=O,e.ListView=I,e.getFieldValues=s,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=ej2-lists.umd.min.js.map
/*!
* filename: index.d.ts
* version : 15.4.23
* version : 15.4.24
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved.

@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license.

{
"name": "@syncfusion/ej2-lists",
"version": "15.4.24",
"version": "15.4.26",
"description": "Essential JS 2 List Components",

@@ -5,0 +5,0 @@ "author": "Syncfusion Inc.",

@@ -241,6 +241,11 @@ import { Component, BaseEventArgs } from '@syncfusion/ej2-base';

private leaveHandler(e);
private homeKeyHandler(e, end?);
private arrowKeyHandler(e, prev?);
private enterKeyHandler(e);
private keyActionHandler(e);
private swipeActionHandler(e);
private focusout();
private wireEvents();
private unWireEvents();
private tabFocus(e);
private removeHover();

@@ -247,0 +252,0 @@ private removeSelect();

@@ -38,2 +38,3 @@ var __extends = (this && this.__extends) || (function () {

selected: 'e-active',
focused: 'e-focused',
parentItem: 'e-list-parent',

@@ -106,4 +107,7 @@ listItem: 'e-list-item',

moveUp: 'uparrow',
back: 'backspace',
home: 'home',
select: 'enter',
back: 'backspace'
end: 'end',
tab: 'tab'
};

@@ -305,13 +309,69 @@ _this.animateOptions = {};

;
ListView.prototype.homeKeyHandler = function (e, end) {
var li = this.curUL.querySelectorAll('.' + classNames.listItem);
var focusedElement = this.curUL.querySelector('.' + classNames.focused) ||
this.curUL.querySelector('.' + classNames.selected);
if (focusedElement) {
focusedElement.classList.remove(classNames.focused);
focusedElement.classList.remove(classNames.selected);
}
var index = !end ? 0 : li.length - 1;
if (li[index].classList.contains(classNames.hasChild)) {
li[index].classList.add(classNames.focused);
}
else {
this.setSelectLI(li[index], e);
}
};
ListView.prototype.arrowKeyHandler = function (e, prev) {
var siblingLI;
var li;
var hasChild = !ej2_base_1.isNullOrUndefined(this.curUL.querySelector('.' + classNames.hasChild)) ? true : false;
if (hasChild) {
li = this.curUL.querySelector('.' + classNames.focused) || this.curUL.querySelector('.' + classNames.selected);
siblingLI = list_base_1.ListBase.getSiblingLI(this.curUL.querySelectorAll('.' + classNames.listItem), li, prev);
if (!ej2_base_1.isNullOrUndefined(siblingLI)) {
if (li) {
li.classList.remove(classNames.focused);
li.classList.remove(classNames.selected);
}
if (siblingLI.classList.contains(classNames.hasChild)) {
siblingLI.classList.add(classNames.focused);
}
else {
this.setSelectLI(siblingLI, e);
}
}
}
else {
li = this.curUL.querySelector('.' + classNames.selected);
siblingLI = list_base_1.ListBase.getSiblingLI(this.curUL.querySelectorAll('.' + classNames.listItem), li, prev);
this.setSelectLI(siblingLI, e);
}
};
ListView.prototype.enterKeyHandler = function (e) {
var hasChild = !ej2_base_1.isNullOrUndefined(this.curUL.querySelector('.' + classNames.hasChild)) ? true : false;
var li = this.curUL.querySelector('.' + classNames.focused);
if (hasChild && li) {
li.classList.remove(classNames.focused);
this.setSelectLI(li, e);
}
};
ListView.prototype.keyActionHandler = function (e) {
e.preventDefault();
switch (e.action) {
case 'home':
this.homeKeyHandler(e);
break;
case 'end':
this.homeKeyHandler(e, true);
break;
case 'moveDown':
this.hoverSiblingLI();
this.arrowKeyHandler(e);
break;
case 'moveUp':
this.hoverSiblingLI(true);
this.arrowKeyHandler(e, true);
break;
case 'select':
this.setSelectLI(this.curUL.querySelector('.' + classNames.hover), e);
this.enterKeyHandler(e);
break;

@@ -321,2 +381,5 @@ case 'back':

break;
case 'tab':
this.tabFocus(e);
break;
}

@@ -329,2 +392,12 @@ };

};
ListView.prototype.focusout = function () {
var focusedElement = this.curUL.querySelector('.' + classNames.focused);
var activeElement = this.curUL.querySelector('[aria-selected = true]');
if (focusedElement) {
focusedElement.classList.remove(classNames.focused);
if (activeElement) {
activeElement.classList.add(classNames.selected);
}
}
};
ListView.prototype.wireEvents = function () {

@@ -334,2 +407,3 @@ ej2_base_3.EventHandler.add(this.element, 'click', this.clickHandler, this);

ej2_base_3.EventHandler.add(this.element, 'mouseout', this.leaveHandler, this);
ej2_base_3.EventHandler.add(this.element, 'focusout', this.focusout, this);
this.keyboardModule = new ej2_base_4.KeyboardEvents(this.element, {

@@ -348,2 +422,17 @@ keyAction: this.keyActionHandler.bind(this),

};
ListView.prototype.tabFocus = function (e) {
var selectedList = this.curUL.querySelector('.' + classNames.selected);
if (!selectedList && this.curUL) {
var li = this.curUL.querySelector('.' + classNames.listItem);
if (li.classList.contains(classNames.hasChild)) {
var focusedElement = this.curUL.querySelector('.' + classNames.focused);
if (ej2_base_1.isNullOrUndefined(focusedElement)) {
li.classList.add(classNames.focused);
}
}
else {
this.setSelectLI(li, e);
}
}
};
ListView.prototype.removeHover = function () {

@@ -356,3 +445,3 @@ var hoverLI = this.element.querySelector('.' + classNames.hover);

ListView.prototype.removeSelect = function () {
var selectedLI = this.element.querySelectorAll('.' + classNames.selected);
var selectedLI = this.element.querySelectorAll('[aria-selected = true]');
for (var _i = 0, selectedLI_1 = selectedLI; _i < selectedLI_1.length; _i++) {

@@ -379,3 +468,2 @@ var ele = selectedLI_1[_i];

li.setAttribute('aria-selected', 'true');
this.removeHover();
var data = this.getItemData(li);

@@ -613,3 +701,3 @@ var fieldData = list_base_1.getFieldValues(data, this.listBaseOption.fields);

this.element.classList.add(classNames.root);
ej2_base_2.attributes(this.element, { role: 'list' });
ej2_base_2.attributes(this.element, { role: 'list', tabindex: '0' });
this.setCSSClass();

@@ -616,0 +704,0 @@ this.setEnableRTL();

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc