@syncfusion/ej2-lists
Advanced tools
Comparing version 1.0.14 to 1.0.18
/*! | ||
* filename: ej2-lists.umd.min.js | ||
* version : 1.0.14 | ||
* version : 1.0.18 | ||
* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. | ||
@@ -11,2 +11,2 @@ * Use of this code is subject to the terms of our license. | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"));else if("function"==typeof define&&define.amd)define(["@syncfusion/ej2-base","@syncfusion/ej2-data"],t);else{var i="object"==typeof exports?t(require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data")):t(e["@syncfusion/ej2-base"],e["@syncfusion/ej2-data"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(this,function(e,t){return function(e){function t(s){if(i[s])return i[s].exports;var r=i[s]={exports:{},id:s,loaded:!1};return e[s].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){var s,r;s=[i,t,i(1),i(6)],void 0!==(r=function(e,t,i,s){"use strict";function r(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}Object.defineProperty(t,"__esModule",{value:!0}),r(i),r(s)}.apply(t,s))&&(e.exports=r)},function(e,t,i){var s,r;s=[i,t,i(2)],void 0!==(r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}(i)}.apply(t,s))&&(e.exports=r)},function(e,t,i){var s,r,o=this&&this.__extends||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=this&&this.__decorate||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};s=[i,t,i(3),i(3),i(3),i(3),i(3),i(4),i(5)],void 0!==(r=function(e,t,i,s,r,a,l,c,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},p={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},u={root:"e-listview",hover:"e-hover",selected:"e-active",parentItem:"e-list-parent",listItem:"e-list-item",listItemText:"e-list-text",grpListItem:"e-list-group-item",hasChild:"e-has-child",view:"e-view",header:"e-header",headerText:"e-headertext",text:"e-text",disable:"e-disabled",content:"e-content",icon:"e-icons",backIcon:"e-icon-back"},m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(a.ChildProperty);n([r.Property("id")],m.prototype,"id",void 0),n([r.Property("text")],m.prototype,"text",void 0),n([r.Property("isChecked")],m.prototype,"isChecked",void 0),n([r.Property("isVisible")],m.prototype,"isVisible",void 0),n([r.Property("enabled")],m.prototype,"enabled",void 0),n([r.Property("iconCss")],m.prototype,"iconCss",void 0),n([r.Property("child")],m.prototype,"child",void 0),n([r.Property("tooltip")],m.prototype,"tooltip",void 0),n([r.Property("groupBy")],m.prototype,"groupBy",void 0),n([r.Property("text")],m.prototype,"sortBy",void 0),n([r.Property("htmlAttributes")],m.prototype,"htmlAttributes",void 0),n([r.Property("tableName")],m.prototype,"tableName",void 0),t.FieldSettings=m;var f=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.curDSLevel=[],s.curViewDS=[],s.keyConfigs={moveDown:"downarrow",moveUp:"uparrow",select:"enter",back:"backspace"},s.animateOptions={},s.aniObj=new l.Animation(s.animateOptions),s}return o(t,e),t.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()}}},t.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&s.attributes(this.element,this.htmlAttributes)},t.prototype.setCSSClass=function(e){this.cssClass&&s.addClass([this.element],this.cssClass.split(" ")),e&&s.removeClass([this.element],e.split(" "))},t.prototype.setSize=function(){this.element.style.height=i.formatUnit(this.height),this.element.style.width=i.formatUnit(this.width)},t.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},t.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},t.prototype.enableElement=function(e,t){t?e.classList.remove(u.disable):e.classList.add(u.disable)},t.prototype.header=function(e,t){if(void 0===this.headerEle&&this.showHeader){this.headerEle=s.createElement("div",{className:u.header});var i=s.createElement("span",{className:u.headerText,innerHTML:this.headerTitle}),r=s.createElement("div",{className:u.text,innerHTML:i.outerHTML}),o=s.createElement("div",{className:u.icon+" "+u.backIcon+" e-but-back",attrs:{style:"display:none;"}});this.headerEle.appendChild(o),this.headerEle.appendChild(r),this.element.classList.add("e-has-header"),s.prepend([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";var r=this.headerEle.querySelector("."+u.headerText),o=this.headerEle.querySelector("."+u.backIcon);r.innerHTML=e,o.style.display=!0===t?"":"none"}else this.headerEle.style.display="none"},t.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,a=this.animation.duration;if(this.animation.effect)n=this.enableRtl?p[this.animation.effect]:h[this.animation.effect];else{n=this.enableRtl?p.SlideLeft:h.SlideRight,a=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?n[0]:n[1],duration:a,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:a,timingFunction:this.animation.easing,end:function(){s.trigger("actionComplete")}}),this.curUL=t}},t.prototype.preRender=function(){this.listBaseOption={template:this.template,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon}},t.prototype.clickHandler=function(e){var t=e.target,i=t.classList;if(i.contains(u.backIcon)||i.contains(u.headerText))this.back();else{var r=s.closest(t.parentNode,"."+u.listItem);null===r&&(r=t),this.setSelectLI(r,e)}},t.prototype.hoverHandler=function(e){var t=s.closest(e.target.parentNode,"."+u.listItem);this.setHoverLI(t)},t.prototype.leaveHandler=function(e){this.removeHover()},t.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("."+u.hover),e);break;case"back":this.back()}},t.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&this.back()},t.prototype.wireEvents=function(){r.EventHandler.add(this.element,"click",this.clickHandler,this),r.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),r.EventHandler.add(this.element,"mouseout",this.leaveHandler,this),this.keyboardModule=new a.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),this.touchModule=new l.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)})},t.prototype.unWireEvents=function(){r.EventHandler.remove(this.element,"click",this.clickHandler),r.EventHandler.remove(this.element,"mouseover",this.hoverHandler),r.EventHandler.remove(this.element,"mouseout",this.leaveHandler),this.keyboardModule.destroy(),this.touchModule.destroy()},t.prototype.removeHover=function(){var e=this.element.querySelector("."+u.hover);e&&e.classList.remove(u.hover)},t.prototype.removeSelect=function(){for(var e=this.element.querySelectorAll("."+u.selected),t=0,i=e;t<i.length;t++){var s=i[t];s.removeAttribute("aria-selected"),""!==s.className&&s.classList.remove(u.selected)}},t.prototype.isValidLI=function(e){return e&&e.classList.contains(u.listItem)&&!e.classList.contains(u.grpListItem)&&!e.classList.contains(u.disable)},t.prototype.setSelectLI=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(u.selected)&&this.enable){this.removeSelect(),e.classList.add(u.selected),e.setAttribute("aria-selected","true"),this.removeHover();var s=this.getItemData(e);this.selectedItems={item:e,text:s[this.listBaseOption.fields.text],data:s};var r={};i.merge(r,this.selectedItems),t&&i.merge(r,{isInteracted:!0,event:t}),this.trigger("select",r),this.selectedLI=e,this.renderSubList(e)}},t.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(u.hover)&&this.enable){var t=this.element.querySelectorAll("."+u.hover);t&&t.length&&s.removeClass(t,u.hover),e.classList.contains(u.selected)||e.classList.add(u.hover)}},t.prototype.hoverSiblingLI=function(e){var t,i=this.curUL.querySelector("."+u.hover);if(i||(i=this.curUL.querySelector("."+u.selected)),i)t=d.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+u.listItem),i,e);else if(e){var s=this.curUL.querySelectorAll("."+u.listItem);t=s[s.length-1]}else t=this.curUL.querySelector("."+u.listItem);this.setHoverLI(t)},t.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var r=s[i];this.curDSJSON=this.findItemFromDS(t,{id:r}),t=this.curDSJSON?this.curDSJSON[this.fields.child]:t}return t}return this.localData},t.prototype.getItemData=function(e){var t=this.getElementUID(e),i=this.dataSource;return this.findItemFromDS(i,t)},t.prototype.findItemFromDS=function(e,t,i){var s,r=this;return e&&e.length&&t?e.some(function(o){return!t.id&&!t.text||t.id&&o[r.fields.id]!==t.id||t.text&&o[r.fields.text]!==t.text?o.hasOwnProperty(r.fields.child)&&o[r.fields.child].length&&(s=r.findItemFromDS(o[r.fields.child],t,i)):s=i?e:o,!!s}):s=e,s},t.prototype.getQuery=function(){var e=[],t=this.query?this.query:new c.Query;if(!this.query){for(var i=0,s=Object.keys(this.fields.properties);i<s.length;i++){var r=s[i];"tableName"!==r&&this.fields[r]&&this.fields[r]!==d.ListBase.defaultMappedFields[r]&&-1===e.indexOf(this.fields[r])&&e.push(this.fields[r])}t.select(e),this.fields.properties.hasOwnProperty("tableName")&&t.from(this.fields.tableName)}return t},t.prototype.setViewDataSource=function(e){void 0===e&&(e=this.localData),e&&this.fields.groupBy?this.curViewDS=d.ListBase.groupDataSource(e,this.fields,this.sortOrder):e&&"None"!==this.sortOrder?this.curViewDS=d.ListBase.getDataSource(e,d.ListBase.addSorting(this.sortOrder,this.fields.sortBy)):this.curViewDS=e},t.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},t.prototype.setLocalData=function(){var e=this;if(this.trigger("actionBegin"),this.dataSource instanceof c.DataManager)this.dataSource.executeQuery(this.getQuery()).then(function(t){e.isDestroyed||(e.localData=t.result,e.renderList(),e.trigger("actionComplete",t))}).catch(function(t){e.isDestroyed||e.trigger("actionFailure",t)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var t=this.element.querySelector("ul");t&&(s.remove(t),this.setProperties({dataSource:d.ListBase.createJsonFromElement(t)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},t.prototype.reRender=function(){this.element.innerHTML="",this.curUL=this.headerEle=void 0,this.setLocalData(),this.header(),this.contentContainer=s.createElement("div",{className:u.content}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement)},t.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},t.prototype.createList=function(){this.ulElement=this.curUL=d.ListBase.createList(this.curViewDS,this.listBaseOption),this.liCollection=this.curUL.querySelectorAll("."+u.listItem)},t.prototype.renderSubList=function(e){var t=e.getAttribute("uid");if(e.classList.contains(u.hasChild)&&t){var i=s.closest(e.parentNode,"."+u.parentItem),r=this.element.querySelector("[pid='"+t+"']");this.curDSLevel.push(t),this.setViewDataSource(this.getSubDS()),r||(r=d.ListBase.createListFromJson(this.curViewDS,this.listBaseOption,this.curDSLevel.length),r.setAttribute("pID",t),r.style.display="none",this.renderIntoDom(r)),this.switchView(i,r),this.liCollection=this.curUL.querySelectorAll("."+u.listItem),this.header(this.selectedItems.data[this.listBaseOption.fields.text],!0),this.selectedLI=void 0}},t.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},t.prototype.renderList=function(){this.setViewDataSource(),this.createList(),this.contentContainer=s.createElement("div",{className:u.content}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement)},t.prototype.getElementUID=function(e){var t={};return e instanceof Element?t.id=e.getAttribute("uid"):t=e,t},t.prototype.render=function(){this.element.classList.add(u.root),s.attributes(this.element,{role:"list"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.rippleFn=l.ripple(this.element,".e-list-item")},t.prototype.destroy=function(){this.unWireEvents();var t=[u.root,this.cssClass,u.disable,"e-rtl","e-has-header"];s.removeClass([this.element],t),this.rippleFn(),e.prototype.destroy.call(this)},t.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("[uid='"+e+"']"),i=this.curUL;t?t=t.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),t=this.curUL);var s=this.curDSJSON[this.fields.text];this.switchView(i,t,!0),this.removeSelect(),this.liCollection=this.curUL.querySelectorAll("."+u.listItem),this.header(this.curDSLevel.length?s:this.headerTitle,!!this.curDSLevel.length)}},t.prototype.selectItem=function(e){var t=this.getItemData(e);if(t){var i=this.element.querySelector('[uid="'+t[this.fields.id]+'"]');i&&this.setSelectLI(i)}},t.prototype.getSelectedItem=function(){return this.selectedItems},t.prototype.findItem=function(e){return this.findItemFromDS(this.dataSource,e)},t.prototype.enableItem=function(e){var t=this.getItemData(e);if(t){var i=this.element.querySelector('[uid="'+t[this.fields.id]+'"]');i&&i.classList.remove(u.disable),delete t[this.fields.enabled]}},t.prototype.disableItem=function(e){var t=this.getItemData(e);if(t){var i=this.element.querySelector('[uid="'+t[this.fields.id]+'"]');i&&i.classList.add(u.disable),t[this.fields.enabled]=!1}},t.prototype.showItem=function(e){this.showHideItem(e,!1,"")},t.prototype.hideItem=function(e){this.showHideItem(e,!0,"none")},t.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e);if(s){var r=this.element.querySelector('[uid="'+s[this.fields.id]+'"]');r&&(r.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},t.prototype.addItem=function(e,t){var i=this.findItemFromDS(this.dataSource,t),s=i[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()},t.prototype.removeItem=function(e){var t=this,i=this.getElementUID(e),s=this.findItemFromDS(this.dataSource,i,!0);if(s&&e){var r,o;s.some(function(e,s,n){return!(!i.id&&!i.text||i.id&&e[t.fields.id]!==i.id||i.text&&e[t.fields.text]!==i.text)&&(r=n,o=s,!0)}),r.splice(o,1),this.resetCurrentList()}},t.prototype.getModuleName=function(){return"listview"},t.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width"])},t}(r.Component);n([r.Property()],f.prototype,"cssClass",void 0),n([r.Property({})],f.prototype,"htmlAttributes",void 0),n([r.Property(!0)],f.prototype,"enable",void 0),n([r.Property([])],f.prototype,"dataSource",void 0),n([r.Property()],f.prototype,"query",void 0),n([r.Complex(d.ListBase.defaultMappedFields,m)],f.prototype,"fields",void 0),n([r.Property({effect:"SlideLeft",duration:400,easing:"ease"})],f.prototype,"animation",void 0),n([r.Property("None")],f.prototype,"sortOrder",void 0),n([r.Property(!1)],f.prototype,"showIcon",void 0),n([r.Property("")],f.prototype,"headerTitle",void 0),n([r.Property(!1)],f.prototype,"showHeader",void 0),n([r.Property("")],f.prototype,"height",void 0),n([r.Property("")],f.prototype,"width",void 0),n([r.Property(null)],f.prototype,"template",void 0),n([r.Property(null)],f.prototype,"groupTemplate",void 0),n([r.Event()],f.prototype,"select",void 0),n([r.Event()],f.prototype,"actionBegin",void 0),n([r.Event()],f.prototype,"actionComplete",void 0),n([r.Event()],f.prototype,"actionFailure",void 0),f=n([a.NotifyPropertyChanges],f),t.ListView=f,t.listViewBuilder=r.CreateBuilder(f)}.apply(t,s))&&(e.exports=r)},function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t,i){var s,r;s=[i,t,i(3),i(3),i(3),i(4)],void 0!==(r=function(e,t,i,s,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-list-img"};!function(e){function n(e,t,i){return"string"==typeof e[0]||"number"==typeof e[0]?a(e,i):l(e,t,0,i)}function a(e,t){for(var i=[],s=t?g:S,r=v(),o=0;o<e.length;o++){var n=s(e[o],t?e[o]:null,null,null,null,r,o);i.push(n)}return L(i)}function l(r,o,n,a){void 0===n&&(n=0);for(var l,c=i.extend({},C,o),d=i.extend({},e.defaultMappedFields,c.fields),h=[],p=v(),u=0;u<r.length;u++){var m=r[u],f=[];if(c.showCheckBox&&f.push(s.createElement("div",{className:t.cssClass.check})),!0===a)c.showIcon&&f.push(s.createElement("span",{className:t.cssClass.icon+" "+m[d.iconCss]})),l=g(m[d.text],m[d.value],c.itemClass,f,!(!m.hasOwnProperty("isHeader")||!m.isHeader),p,u);else{if(l=S(m,d,c.itemClass,f,o),l.classList.add(t.cssClass.level+"-"+n),l.setAttribute("aria-level",n+""),d.tooltip&&l.setAttribute("title",m[d.tooltip]),m.hasOwnProperty(d.htmlAttributes)&&m[d.htmlAttributes]&&s.attributes(l,m[d.htmlAttributes]),m.hasOwnProperty(d.enabled)&&!1===m[d.enabled]&&l.classList.add(t.cssClass.disabled),m.hasOwnProperty(d.isVisible)&&!1===m[d.isVisible]&&(l.style.display="none"),b(m,d,r,c,l,n),m.hasOwnProperty(d.imageUrl)){var y={src:m[d.imageUrl]};m.hasOwnProperty(d.imageUrl)&&i.merge(y,m[d.imageAttributes]),s.prepend([s.createElement("img",{className:t.cssClass.image,attrs:y})],l.firstElementChild)}c.showIcon&&!c.template&&s.prepend([s.createElement("div",{className:t.cssClass.icon+" "+m[d.iconCss]})],l.firstElementChild)}h.push(l)}return L(h,c.listClass)}function c(e,i,r){if(e&&e.length){var o,n,a=Array.prototype.slice.call(e);for(n=i?d(i,a):!0===r?a.length:-1,o=a[n+(!0===r?-1:1)];o&&(!s.isVisible(o)||o.classList.contains(t.cssClass.disabled));)n+=!0===r?-1:1,o=a[n];return o}}function d(e,t){if(t&&e){var i=t;return i=Array.prototype.slice.call(t),i.indexOf(e)}}function h(e,t,i){void 0===i&&(i="None");var s=(new o.Query).group(t.groupBy);s=p(i,"key",s);var r=u(e,s);e=[];for(var n=0;n<r.length;n++){var a=r[n].items,l={};l[t.text]=r[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}function p(e,t,i){return void 0===i&&(i=new o.Query),"Ascending"===e?i.sortBy(t,"ascending",!0):"Descending"===e&&i.sortBy(t,"descending",!0),i}function u(e,t){return new o.DataManager(e).executeLocal(t)}function m(e,t){var s=i.extend({},C,t),r=s.fields,o=e.cloneNode(!0),n=[];o.classList.add("json-parent");var a=o.querySelectorAll(".json-parent>li");o.classList.remove("json-parent");for(var l=0;l<a.length;l++){var c=a[l],d=c.querySelector("ul"),h={};h[r.text]=c.firstChild.textContent,h[r.id]=v(),d&&(h[r.child]=m(d,t)),n.push(h)}return n}function f(e,i,o){for(var n=s.createElement("ul",{className:t.cssClass.ul,attrs:{role:"presentation"}}),a=r.compile(e),l=[],c=v(),d=0;d<i.length;d++){var h=i[d],p=h.isHeader,u=s.createElement("li",{id:c+"-"+d,className:p?t.cssClass.group:t.cssClass.li,attrs:{role:"presentation"}});if(p)u.innerText=h[o.text];else{s.append(a(h),u);var m=h[o.value];u.setAttribute("data-value",m),u.setAttribute("role","option")}l.push(u)}return s.append(l,n),n}function y(e,t,i,o){for(var n=r.compile(e),a=i.groupBy,l={},c=0,d=o;c<d.length;c++){var h=d[c];l[a]=h.textContent,h.innerHTML="",s.append(n(l),h)}return o}function v(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function b(e,r,o,n,a,c){var d=e[r.child],h=e[r.hasChildren];if(!i.isUndefined(d)&&(h=!0,a.classList.add(t.cssClass.hasChild),n.processSubChild)){var p=l(d,n,++c);a.appendChild(p)}n.expandCollapse&&h&&!n.template&&s.prepend([s.createElement("div",{className:"e-icons "+t.cssClass.collapsible})],a.querySelector("."+t.cssClass.textContent))}function g(e,r,o,n,a,l,c){var d=s.createElement("li",{className:(!0===a?t.cssClass.group:t.cssClass.li)+" "+(i.isUndefined(o)?"":o),attrs:{role:!0===a?"group":"presentation"},id:l+"-"+c});return a?d.innerText=e:(d.setAttribute("data-value",r),d.setAttribute("role","option"),n&&s.append(n,d),d.appendChild(document.createTextNode(e))),d}function S(e,o,n,a,l){var c,d,h=e;"string"!=typeof e&&(h=e[o.text],c=e[o.id],d=!(!e.hasOwnProperty("isHeader")||!e.isHeader));var p=s.createElement("li",{className:(!0===d?t.cssClass.group:t.cssClass.li)+" "+n,attrs:{role:!0===d?"group":"presentation"}});if(c&&p.setAttribute("uID",c),d&&l&&l.groupTemplate){var u=r.compile(l.groupTemplate);s.append(u(e),p)}else if(!d&&l&&l.template){var u=r.compile(l.template);s.append(u(e),p)}else{var m=s.createElement("div",{className:t.cssClass.textContent});i.isNullOrUndefined(a)||s.append(a,p),m.appendChild(s.createElement("span",{className:t.cssClass.text,innerHTML:h,attrs:{role:"list-item"}})),p.appendChild(m)}return p}function L(e,i){var r=s.createElement("ul",{className:t.cssClass.ul+" "+i,attrs:{role:"presentation"}});return s.append(e,r),r}e.defaultMappedFields={id:"id",text:"text",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",iconCss:"icon",child:"child",isVisible:"isVisible",hasChildren:null,tooltip:null,htmlAttributes:null,imageAttributes:null,imageUrl:"imageUrl",groupBy:null};var C={showCheckBox:!1,showIcon:!1,expandCollapse:!1,fields:e.defaultMappedFields,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null};e.createList=n,e.createListFromArray=a,e.createListFromJson=l,e.getSiblingLI=c,e.indexOf=d,e.groupDataSource=h,e.addSorting=p,e.getDataSource=u,e.createJsonFromElement=m,e.renderContentTemplate=f,e.renderGroupTemplate=y}(t.ListBase||(t.ListBase={}))}.apply(t,s))&&(e.exports=r)},function(e,t,i){var s,r;s=[i,t,i(5)],void 0!==(r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}(i)}.apply(t,s))&&(e.exports=r)}])}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"));else if("function"==typeof define&&define.amd)define(["@syncfusion/ej2-base","@syncfusion/ej2-data"],t);else{var i="object"==typeof exports?t(require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data")):t(e["@syncfusion/ej2-base"],e["@syncfusion/ej2-data"]);for(var s in i)("object"==typeof exports?exports:e)[s]=i[s]}}(this,function(e,t){return function(e){function t(s){if(i[s])return i[s].exports;var r=i[s]={exports:{},id:s,loaded:!1};return e[s].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){var s,r;s=[i,t,i(1),i(6)],void 0!==(r=function(e,t,i,s){"use strict";function r(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}Object.defineProperty(t,"__esModule",{value:!0}),r(i),r(s)}.apply(t,s))&&(e.exports=r)},function(e,t,i){var s,r;s=[i,t,i(2)],void 0!==(r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}(i)}.apply(t,s))&&(e.exports=r)},function(e,t,i){var s,r,o=this&&this.__extends||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=this&&this.__decorate||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};s=[i,t,i(3),i(3),i(3),i(3),i(3),i(4),i(5)],void 0!==(r=function(e,t,i,s,r,a,l,c,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h={None:[],SlideLeft:["SlideRightOut","SlideLeftOut","SlideLeftIn","SlideRightIn"],SlideDown:["SlideTopOut","SlideBottomOut","SlideBottomIn","SlideTopIn"],Zoom:["FadeOut","FadeZoomOut","FadeZoomIn","FadeIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},p={None:[],SlideLeft:["SlideLeftOut","SlideRightOut","SlideRightIn","SlideLeftIn"],SlideDown:["SlideBottomOut","SlideTopOut","SlideTopIn","SlideBottomIn"],Zoom:["FadeZoomOut","FadeOut","FadeIn","FadeZoomIn"],Fade:["FadeOut","FadeOut","FadeIn","FadeIn"]},u={root:"e-listview",hover:"e-hover",selected:"e-active",parentItem:"e-list-parent",listItem:"e-list-item",listItemText:"e-list-text",grpListItem:"e-list-group-item",hasChild:"e-has-child",view:"e-view",header:"e-header",headerText:"e-headertext",text:"e-text",disable:"e-disabled",content:"e-content",icon:"e-icons",backIcon:"e-icon-back"},m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(a.ChildProperty);n([r.Property("id")],m.prototype,"id",void 0),n([r.Property("text")],m.prototype,"text",void 0),n([r.Property("isChecked")],m.prototype,"isChecked",void 0),n([r.Property("isVisible")],m.prototype,"isVisible",void 0),n([r.Property("enabled")],m.prototype,"enabled",void 0),n([r.Property("iconCss")],m.prototype,"iconCss",void 0),n([r.Property("child")],m.prototype,"child",void 0),n([r.Property("tooltip")],m.prototype,"tooltip",void 0),n([r.Property("groupBy")],m.prototype,"groupBy",void 0),n([r.Property("text")],m.prototype,"sortBy",void 0),n([r.Property("htmlAttributes")],m.prototype,"htmlAttributes",void 0),n([r.Property("tableName")],m.prototype,"tableName",void 0),t.FieldSettings=m;var f=function(e){function t(t,i){var s=e.call(this,t,i)||this;return s.curDSLevel=[],s.curViewDS=[],s.keyConfigs={moveDown:"downarrow",moveUp:"uparrow",select:"enter",back:"backspace"},s.animateOptions={},s.aniObj=new l.Animation(s.animateOptions),s}return o(t,e),t.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()}}},t.prototype.setHTMLAttribute=function(){Object.keys(this.htmlAttributes).length&&s.attributes(this.element,this.htmlAttributes)},t.prototype.setCSSClass=function(e){this.cssClass&&s.addClass([this.element],this.cssClass.split(" ")),e&&s.removeClass([this.element],e.split(" "))},t.prototype.setSize=function(){this.element.style.height=i.formatUnit(this.height),this.element.style.width=i.formatUnit(this.width)},t.prototype.setEnable=function(){this.enableElement(this.element,this.enable)},t.prototype.setEnableRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},t.prototype.enableElement=function(e,t){t?e.classList.remove(u.disable):e.classList.add(u.disable)},t.prototype.header=function(e,t){if(void 0===this.headerEle&&this.showHeader){this.headerEle=s.createElement("div",{className:u.header});var i=s.createElement("span",{className:u.headerText,innerHTML:this.headerTitle}),r=s.createElement("div",{className:u.text,innerHTML:i.outerHTML}),o=s.createElement("div",{className:u.icon+" "+u.backIcon+" e-but-back",attrs:{style:"display:none;"}});this.headerEle.appendChild(o),this.headerEle.appendChild(r),this.element.classList.add("e-has-header"),s.prepend([this.headerEle],this.element)}else if(this.headerEle)if(this.showHeader){this.headerEle.style.display="";var r=this.headerEle.querySelector("."+u.headerText),o=this.headerEle.querySelector("."+u.backIcon);r.innerHTML=e,o.style.display=!0===t?"":"none"}else this.headerEle.style.display="none"},t.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,a=this.animation.duration;if(this.animation.effect)n=this.enableRtl?p[this.animation.effect]:h[this.animation.effect];else{n=this.enableRtl?p.SlideLeft:h.SlideRight,a=0}this.element.style.overflow="hidden",this.aniObj.animate(e,{name:!0===i?n[0]:n[1],duration:a,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:a,timingFunction:this.animation.easing,end:function(){s.trigger("actionComplete")}}),this.curUL=t}},t.prototype.preRender=function(){this.listBaseOption={template:this.template,groupTemplate:this.groupTemplate,expandCollapse:!0,listClass:"",fields:this.fields.properties,sortOrder:this.sortOrder,showIcon:this.showIcon}},t.prototype.clickHandler=function(e){var t=e.target,i=t.classList;if(i.contains(u.backIcon)||i.contains(u.headerText))this.back();else{var r=s.closest(t.parentNode,"."+u.listItem);null===r&&(r=t),this.setSelectLI(r,e)}},t.prototype.hoverHandler=function(e){var t=s.closest(e.target.parentNode,"."+u.listItem);this.setHoverLI(t)},t.prototype.leaveHandler=function(e){this.removeHover()},t.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("."+u.hover),e);break;case"back":this.back()}},t.prototype.swipeActionHandler=function(e){"Right"===e.swipeDirection&&this.back()},t.prototype.wireEvents=function(){r.EventHandler.add(this.element,"click",this.clickHandler,this),r.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),r.EventHandler.add(this.element,"mouseout",this.leaveHandler,this),this.keyboardModule=new a.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),this.touchModule=new l.Touch(this.element,{swipe:this.swipeActionHandler.bind(this)})},t.prototype.unWireEvents=function(){r.EventHandler.remove(this.element,"click",this.clickHandler),r.EventHandler.remove(this.element,"mouseover",this.hoverHandler),r.EventHandler.remove(this.element,"mouseout",this.leaveHandler),this.keyboardModule.destroy(),this.touchModule.destroy()},t.prototype.removeHover=function(){var e=this.element.querySelector("."+u.hover);e&&e.classList.remove(u.hover)},t.prototype.removeSelect=function(){for(var e=this.element.querySelectorAll("."+u.selected),t=0,i=e;t<i.length;t++){var s=i[t];s.removeAttribute("aria-selected"),""!==s.className&&s.classList.remove(u.selected)}},t.prototype.isValidLI=function(e){return e&&e.classList.contains(u.listItem)&&!e.classList.contains(u.grpListItem)&&!e.classList.contains(u.disable)},t.prototype.setSelectLI=function(e,t){if(this.isValidLI(e)&&!e.classList.contains(u.selected)&&this.enable){this.removeSelect(),e.classList.add(u.selected),e.setAttribute("aria-selected","true"),this.removeHover();var s=this.getItemData(e);i.isNullOrUndefined(s)&&"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:s};var r={};i.merge(r,this.selectedItems),t&&i.merge(r,{isInteracted:!0,event:t}),this.trigger("select",r),this.selectedLI=e,this.renderSubList(e)}},t.prototype.setHoverLI=function(e){if(this.isValidLI(e)&&!e.classList.contains(u.hover)&&this.enable){var t=this.element.querySelectorAll("."+u.hover);t&&t.length&&s.removeClass(t,u.hover),e.classList.contains(u.selected)||e.classList.add(u.hover)}},t.prototype.hoverSiblingLI=function(e){var t,i=this.curUL.querySelector("."+u.hover);if(i||(i=this.curUL.querySelector("."+u.selected)),i)t=d.ListBase.getSiblingLI(this.curUL.querySelectorAll("."+u.listItem),i,e);else if(e){var s=this.curUL.querySelectorAll("."+u.listItem);t=s[s.length-1]}else t=this.curUL.querySelector("."+u.listItem);this.setHoverLI(t)},t.prototype.getSubDS=function(){var e=this.curDSLevel;if(e.length){for(var t=this.localData,i=0,s=e;i<s.length;i++){var r=s[i];this.curDSJSON=this.findItemFromDS(t,{id:r}),t=this.curDSJSON?this.curDSJSON[this.fields.child]:t}return t}return this.localData},t.prototype.getItemData=function(e){var t=this.getElementUID(e),i=this.dataSource;return this.findItemFromDS(i,t)},t.prototype.findItemFromDS=function(e,t,i){var s,r=this;return e&&e.length&&t?e.some(function(o){return!t.id&&!t.text||t.id&&o[r.fields.id]!==t.id||t.text&&o[r.fields.text]!==t.text?o.hasOwnProperty(r.fields.child)&&o[r.fields.child].length&&(s=r.findItemFromDS(o[r.fields.child],t,i)):s=i?e:o,!!s}):s=e,s},t.prototype.getQuery=function(){var e=[],t=this.query?this.query:new c.Query;if(!this.query){for(var i=0,s=Object.keys(this.fields.properties);i<s.length;i++){var r=s[i];"tableName"!==r&&this.fields[r]&&this.fields[r]!==d.ListBase.defaultMappedFields[r]&&-1===e.indexOf(this.fields[r])&&e.push(this.fields[r])}t.select(e),this.fields.properties.hasOwnProperty("tableName")&&t.from(this.fields.tableName)}return t},t.prototype.setViewDataSource=function(e){void 0===e&&(e=this.localData),e&&this.fields.groupBy?this.curViewDS=d.ListBase.groupDataSource(e,this.fields,this.sortOrder):e&&"None"!==this.sortOrder?this.curViewDS=d.ListBase.getDataSource(e,d.ListBase.addSorting(this.sortOrder,this.fields.sortBy)):this.curViewDS=e},t.prototype.isInAnimation=function(){return this.curUL.classList.contains(".e-animate")},t.prototype.setLocalData=function(){var e=this;if(this.trigger("actionBegin"),this.dataSource instanceof c.DataManager)this.dataSource.executeQuery(this.getQuery()).then(function(t){e.isDestroyed||(e.localData=t.result,e.renderList(),e.trigger("actionComplete",t))}).catch(function(t){e.isDestroyed||e.trigger("actionFailure",t)});else if(this.dataSource&&this.dataSource.length)this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData});else{var t=this.element.querySelector("ul");t&&(s.remove(t),this.setProperties({dataSource:d.ListBase.createJsonFromElement(t)},!0),this.localData=this.dataSource,this.renderList(),this.trigger("actionComplete",{data:this.localData}))}},t.prototype.reRender=function(){this.element.innerHTML="",this.curUL=this.headerEle=void 0,this.setLocalData(),this.header(),this.contentContainer=s.createElement("div",{className:u.content}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement)},t.prototype.resetCurrentList=function(){this.setViewDataSource(this.curViewDS),this.contentContainer.innerHTML="",this.createList(),this.renderIntoDom(this.curUL)},t.prototype.createList=function(){this.ulElement=this.curUL=d.ListBase.createList(this.curViewDS,this.listBaseOption),this.liCollection=this.curUL.querySelectorAll("."+u.listItem)},t.prototype.renderSubList=function(e){var t=e.getAttribute("uid");if(e.classList.contains(u.hasChild)&&t){var i=s.closest(e.parentNode,"."+u.parentItem),r=this.element.querySelector("[pid='"+t+"']");this.curDSLevel.push(t),this.setViewDataSource(this.getSubDS()),r||(r=d.ListBase.createListFromJson(this.curViewDS,this.listBaseOption,this.curDSLevel.length),r.setAttribute("pID",t),r.style.display="none",this.renderIntoDom(r)),this.switchView(i,r),this.liCollection=this.curUL.querySelectorAll("."+u.listItem),this.header(this.selectedItems.data[this.listBaseOption.fields.text],!0),this.selectedLI=void 0}},t.prototype.renderIntoDom=function(e){this.contentContainer.appendChild(e)},t.prototype.renderList=function(){this.setViewDataSource(),this.createList(),this.contentContainer=s.createElement("div",{className:u.content}),this.element.appendChild(this.contentContainer),this.renderIntoDom(this.ulElement)},t.prototype.getElementUID=function(e){var t={};return e instanceof Element?t.id=e.getAttribute("uid"):t=e,t},t.prototype.render=function(){this.element.classList.add(u.root),s.attributes(this.element,{role:"list"}),this.setCSSClass(),this.setEnableRTL(),this.setEnable(),this.setSize(),this.wireEvents(),this.header(),this.setLocalData(),this.setHTMLAttribute(),this.rippleFn=l.rippleEffect(this.element,{selector:"."+u.listItem})},t.prototype.destroy=function(){this.unWireEvents();var t=[u.root,this.cssClass,u.disable,"e-rtl","e-has-header"];s.removeClass([this.element],t),this.rippleFn(),e.prototype.destroy.call(this)},t.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("[uid='"+e+"']"),i=this.curUL;t?t=t.parentElement:(this.createList(),this.renderIntoDom(this.ulElement),t=this.curUL);var s=this.curDSJSON[this.fields.text];this.switchView(i,t,!0),this.removeSelect(),this.liCollection=this.curUL.querySelectorAll("."+u.listItem),this.header(this.curDSLevel.length?s:this.headerTitle,!!this.curDSLevel.length)}},t.prototype.selectItem=function(e){var t=this.getItemData(e);if(t){var i=this.element.querySelector('[uid="'+t[this.fields.id]+'"]');i&&this.setSelectLI(i)}},t.prototype.getSelectedItem=function(){return this.selectedItems},t.prototype.findItem=function(e){return this.findItemFromDS(this.dataSource,e)},t.prototype.enableItem=function(e){var t=this.getItemData(e);if(t){var i=this.element.querySelector('[uid="'+t[this.fields.id]+'"]');i&&i.classList.remove(u.disable),delete t[this.fields.enabled]}},t.prototype.disableItem=function(e){var t=this.getItemData(e);if(t){var i=this.element.querySelector('[uid="'+t[this.fields.id]+'"]');i&&i.classList.add(u.disable),t[this.fields.enabled]=!1}},t.prototype.showItem=function(e){this.showHideItem(e,!1,"")},t.prototype.hideItem=function(e){this.showHideItem(e,!0,"none")},t.prototype.showHideItem=function(e,t,i){var s=this.getItemData(e);if(s){var r=this.element.querySelector('[uid="'+s[this.fields.id]+'"]');r&&(r.style.display=i),t?s[this.fields.isVisible]=!1:delete s[this.fields.isVisible]}},t.prototype.addItem=function(e,t){var i=this.findItemFromDS(this.dataSource,t),s=i[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()},t.prototype.removeItem=function(e){var t=this,i=this.getElementUID(e),s=this.findItemFromDS(this.dataSource,i,!0);if(s&&e){var r,o;s.some(function(e,s,n){return!(!i.id&&!i.text||i.id&&e[t.fields.id]!==i.id||i.text&&e[t.fields.text]!==i.text)&&(r=n,o=s,!0)}),r.splice(o,1),this.resetCurrentList()}},t.prototype.getModuleName=function(){return"listview"},t.prototype.getPersistData=function(){return this.addOnPersist(["cssClass","enableRtl","htmlAttributes","enable","fields","animation","headerTitle","sortOrder","showIcon","height","width"])},t}(r.Component);n([r.Property()],f.prototype,"cssClass",void 0),n([r.Property({})],f.prototype,"htmlAttributes",void 0),n([r.Property(!0)],f.prototype,"enable",void 0),n([r.Property([])],f.prototype,"dataSource",void 0),n([r.Property()],f.prototype,"query",void 0),n([r.Complex(d.ListBase.defaultMappedFields,m)],f.prototype,"fields",void 0),n([r.Property({effect:"SlideLeft",duration:400,easing:"ease"})],f.prototype,"animation",void 0),n([r.Property("None")],f.prototype,"sortOrder",void 0),n([r.Property(!1)],f.prototype,"showIcon",void 0),n([r.Property("")],f.prototype,"headerTitle",void 0),n([r.Property(!1)],f.prototype,"showHeader",void 0),n([r.Property("")],f.prototype,"height",void 0),n([r.Property("")],f.prototype,"width",void 0),n([r.Property(null)],f.prototype,"template",void 0),n([r.Property(null)],f.prototype,"groupTemplate",void 0),n([r.Event()],f.prototype,"select",void 0),n([r.Event()],f.prototype,"actionBegin",void 0),n([r.Event()],f.prototype,"actionComplete",void 0),n([r.Event()],f.prototype,"actionFailure",void 0),f=n([a.NotifyPropertyChanges],f),t.ListView=f,t.listViewBuilder=r.CreateBuilder(f)}.apply(t,s))&&(e.exports=r)},function(t,i){t.exports=e},function(e,i){e.exports=t},function(e,t,i){var s,r;s=[i,t,i(3),i(3),i(3),i(4)],void 0!==(r=function(e,t,i,s,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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",textContent:"e-text-content",hasChild:"e-has-child",level:"e-level",collapsible:"e-icon-collapsible",disabled:"e-disabled",image:"e-list-img"};!function(e){function n(e,t,i){return"string"==typeof e[0]||"number"==typeof e[0]?a(e,i):l(e,t,0,i)}function a(e,t){for(var i=[],s=t?g:S,r=v(),o=0;o<e.length;o++){var n=s(e[o],t?e[o]:null,null,null,null,r,o);i.push(n)}return L(i)}function l(r,o,n,a){void 0===n&&(n=0);for(var l,c=i.extend({},C,o),d=i.extend({},e.defaultMappedFields,c.fields),h=[],p=v(),u=0;u<r.length;u++){var m=r[u],f=[];if(c.showCheckBox&&f.push(s.createElement("div",{className:t.cssClass.check})),!0===a)c.showIcon&&f.push(s.createElement("span",{className:t.cssClass.icon+" "+m[d.iconCss]})),l=g(m[d.text],m[d.value],c.itemClass,f,!(!m.hasOwnProperty("isHeader")||!m.isHeader),p,u);else{if(l=S(m,d,c.itemClass,f,o),l.classList.add(t.cssClass.level+"-"+n),l.setAttribute("aria-level",n+""),d.tooltip&&l.setAttribute("title",m[d.tooltip]),m.hasOwnProperty(d.htmlAttributes)&&m[d.htmlAttributes]&&s.attributes(l,m[d.htmlAttributes]),m.hasOwnProperty(d.enabled)&&!1===m[d.enabled]&&l.classList.add(t.cssClass.disabled),m.hasOwnProperty(d.isVisible)&&!1===m[d.isVisible]&&(l.style.display="none"),b(m,d,r,c,l,n),m.hasOwnProperty(d.imageUrl)){var y={src:m[d.imageUrl]};m.hasOwnProperty(d.imageUrl)&&i.merge(y,m[d.imageAttributes]),s.prepend([s.createElement("img",{className:t.cssClass.image,attrs:y})],l.firstElementChild)}c.showIcon&&!c.template&&s.prepend([s.createElement("div",{className:t.cssClass.icon+" "+m[d.iconCss]})],l.firstElementChild)}h.push(l)}return L(h,c.listClass)}function c(e,i,r){if(e&&e.length){var o,n,a=Array.prototype.slice.call(e);for(n=i?d(i,a):!0===r?a.length:-1,o=a[n+(!0===r?-1:1)];o&&(!s.isVisible(o)||o.classList.contains(t.cssClass.disabled));)n+=!0===r?-1:1,o=a[n];return o}}function d(e,t){if(t&&e){var i=t;return i=Array.prototype.slice.call(t),i.indexOf(e)}}function h(e,t,i){void 0===i&&(i="None");var s=(new o.Query).group(t.groupBy);s=p(i,"key",s);var r=u(e,s);e=[];for(var n=0;n<r.length;n++){var a=r[n].items,l={};l[t.text]=r[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}function p(e,t,i){return void 0===i&&(i=new o.Query),"Ascending"===e?i.sortBy(t,"ascending",!0):"Descending"===e&&i.sortBy(t,"descending",!0),i}function u(e,t){return new o.DataManager(e).executeLocal(t)}function m(e,t){var s=i.extend({},C,t),r=s.fields,o=e.cloneNode(!0),n=[];o.classList.add("json-parent");var a=o.querySelectorAll(".json-parent>li");o.classList.remove("json-parent");for(var l=0;l<a.length;l++){var c=a[l],d=c.querySelector("ul"),h={};h[r.text]=c.firstChild.textContent,h[r.id]=v(),d&&(h[r.child]=m(d,t)),n.push(h)}return n}function f(e,i,o){for(var n=s.createElement("ul",{className:t.cssClass.ul,attrs:{role:"presentation"}}),a=r.compile(e),l=[],c=v(),d=0;d<i.length;d++){var h=i[d],p=h.isHeader,u=s.createElement("li",{id:c+"-"+d,className:p?t.cssClass.group:t.cssClass.li,attrs:{role:"presentation"}});if(p)u.innerText=h[o.text];else{s.append(a(h),u);var m=h[o.value];u.setAttribute("data-value",m),u.setAttribute("role","option")}l.push(u)}return s.append(l,n),n}function y(e,t,i,o){for(var n=r.compile(e),a=i.groupBy,l={},c=0,d=o;c<d.length;c++){var h=d[c];l[a]=h.textContent,h.innerHTML="",s.append(n(l),h)}return o}function v(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function b(e,r,o,n,a,c){var d=e[r.child],h=e[r.hasChildren];if(!i.isUndefined(d)&&(h=!0,a.classList.add(t.cssClass.hasChild),n.processSubChild)){var p=l(d,n,++c);a.appendChild(p)}n.expandCollapse&&h&&!n.template&&s.prepend([s.createElement("div",{className:"e-icons "+t.cssClass.collapsible})],a.querySelector("."+t.cssClass.textContent))}function g(e,r,o,n,a,l,c){var d=s.createElement("li",{className:(!0===a?t.cssClass.group:t.cssClass.li)+" "+(i.isUndefined(o)?"":o),attrs:{role:!0===a?"group":"presentation"},id:l+"-"+c});return a?d.innerText=e:(d.setAttribute("data-value",r),d.setAttribute("role","option"),n&&s.append(n,d),d.appendChild(document.createTextNode(e))),d}function S(e,o,n,a,l){var c,d,h=e;"string"!=typeof e&&(h=e[o.text],c=e[o.id],d=!(!e.hasOwnProperty("isHeader")||!e.isHeader));var p=s.createElement("li",{className:(!0===d?t.cssClass.group:t.cssClass.li)+" "+(i.isNullOrUndefined(n)?"":n),attrs:{role:!0===d?"group":"presentation"}});if(c&&p.setAttribute("uID",c),d&&l&&l.groupTemplate){var u=r.compile(l.groupTemplate);s.append(u(e),p)}else if(!d&&l&&l.template){var u=r.compile(l.template);s.append(u(e),p)}else{var m=s.createElement("div",{className:t.cssClass.textContent});i.isNullOrUndefined(a)||s.append(a,p),m.appendChild(s.createElement("span",{className:t.cssClass.text,innerHTML:h,attrs:{role:"list-item"}})),p.appendChild(m)}return p}function L(e,r){var o=s.createElement("ul",{className:t.cssClass.ul+" "+(i.isNullOrUndefined(r)?"":r),attrs:{role:"presentation"}});return s.append(e,o),o}e.defaultMappedFields={id:"id",text:"text",value:"value",isChecked:"isChecked",enabled:"enabled",expanded:"expanded",iconCss:"icon",child:"child",isVisible:"isVisible",hasChildren:null,tooltip:null,htmlAttributes:null,imageAttributes:null,imageUrl:"imageUrl",groupBy:null};var C={showCheckBox:!1,showIcon:!1,expandCollapse:!1,fields:e.defaultMappedFields,listClass:"",itemClass:"",processSubChild:!1,sortOrder:"None",template:null,groupTemplate:null};e.createList=n,e.createListFromArray=a,e.createListFromJson=l,e.getSiblingLI=c,e.indexOf=d,e.groupDataSource=h,e.addSorting=p,e.getDataSource=u,e.createJsonFromElement=m,e.renderContentTemplate=f,e.renderGroupTemplate=y}(t.ListBase||(t.ListBase={}))}.apply(t,s))&&(e.exports=r)},function(e,t,i){var s,r;s=[i,t,i(5)],void 0!==(r=function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var i in e)t.hasOwnProperty(i)||(t[i]=e[i])}(i)}.apply(t,s))&&(e.exports=r)}])}); |
@@ -304,3 +304,3 @@ import { extend, merge, isUndefined, isNullOrUndefined } from '@syncfusion/ej2-base'; | ||
var li = createElement('li', { | ||
className: (grpLI === true ? cssClass.group : cssClass.li) + ' ' + className, | ||
className: (grpLI === true ? cssClass.group : cssClass.li) + ' ' + (isNullOrUndefined(className) ? '' : className), | ||
attrs: { role: (grpLI === true ? 'group' : 'presentation') } | ||
@@ -330,3 +330,4 @@ }); | ||
function generateUL(innerEle, className) { | ||
var element = createElement('ul', { className: cssClass.ul + ' ' + className, attrs: { role: 'presentation' } }); | ||
var element = createElement('ul', { className: cssClass.ul + ' ' + | ||
(isNullOrUndefined(className) ? '' : className), attrs: { role: 'presentation' } }); | ||
append(innerEle, element); | ||
@@ -333,0 +334,0 @@ return element; |
@@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
import { merge, formatUnit } from '@syncfusion/ej2-base'; | ||
import { merge, formatUnit, isNullOrUndefined } from '@syncfusion/ej2-base'; | ||
import { attributes, addClass, removeClass, createElement, prepend, closest, remove } from '@syncfusion/ej2-base'; | ||
import { Component, EventHandler, Property, Complex, Event, CreateBuilder } from '@syncfusion/ej2-base'; | ||
import { NotifyPropertyChanges, ChildProperty, KeyboardEvents } from '@syncfusion/ej2-base'; | ||
import { Animation, ripple, Touch } from '@syncfusion/ej2-base'; | ||
import { Animation, rippleEffect, Touch } from '@syncfusion/ej2-base'; | ||
import { DataManager, Query } from '@syncfusion/ej2-data'; | ||
@@ -374,7 +374,16 @@ import { ListBase } from '../common/list-base'; | ||
var data = this.getItemData(li); | ||
this.selectedItems = { | ||
item: li, | ||
text: data[this.listBaseOption.fields.text], | ||
data: data | ||
}; | ||
if (isNullOrUndefined(data) && typeof this.dataSource[0] === 'string') { | ||
this.selectedItems = { | ||
item: li, | ||
text: li.innerText.trim(), | ||
data: this.dataSource | ||
}; | ||
} | ||
else { | ||
this.selectedItems = { | ||
item: li, | ||
text: data[this.listBaseOption.fields.text], | ||
data: data | ||
}; | ||
} | ||
var eventArgs = {}; | ||
@@ -598,3 +607,5 @@ merge(eventArgs, this.selectedItems); | ||
this.setHTMLAttribute(); | ||
this.rippleFn = ripple(this.element, '.e-list-item'); | ||
this.rippleFn = rippleEffect(this.element, { | ||
selector: '.' + classNames.listItem | ||
}); | ||
}; | ||
@@ -601,0 +612,0 @@ ListView.prototype.destroy = function () { |
{ | ||
"name": "@syncfusion/ej2-lists", | ||
"version": "1.0.14", | ||
"version": "1.0.18", | ||
"description": "Essential JS 2 List Components", | ||
@@ -9,3 +9,3 @@ "author": "Syncfusion Inc.", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "^1.0.14", | ||
"@syncfusion/ej2-base": "^1.0.18", | ||
"@syncfusion/ej2-data": "^1.0.14" | ||
@@ -12,0 +12,0 @@ }, |
@@ -303,3 +303,3 @@ define(["require", "exports", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-base", "@syncfusion/ej2-data"], function (require, exports, ej2_base_1, ej2_base_2, ej2_base_3, ej2_data_1) { | ||
var li = ej2_base_2.createElement('li', { | ||
className: (grpLI === true ? exports.cssClass.group : exports.cssClass.li) + ' ' + className, | ||
className: (grpLI === true ? exports.cssClass.group : exports.cssClass.li) + ' ' + (ej2_base_1.isNullOrUndefined(className) ? '' : className), | ||
attrs: { role: (grpLI === true ? 'group' : 'presentation') } | ||
@@ -329,3 +329,4 @@ }); | ||
function generateUL(innerEle, className) { | ||
var element = ej2_base_2.createElement('ul', { className: exports.cssClass.ul + ' ' + className, attrs: { role: 'presentation' } }); | ||
var element = ej2_base_2.createElement('ul', { className: exports.cssClass.ul + ' ' + | ||
(ej2_base_1.isNullOrUndefined(className) ? '' : className), attrs: { role: 'presentation' } }); | ||
ej2_base_2.append(innerEle, element); | ||
@@ -332,0 +333,0 @@ return element; |
@@ -75,3 +75,3 @@ import{ListView} from "./list-view"; | ||
/** | ||
* Overrides the global culture and localization value for this component. Default Global culture is 'en-US' | ||
* Overrides the global culture and localization value for this component. Default global culture is 'en-US'. | ||
*/ | ||
@@ -78,0 +78,0 @@ locale(value:string): BuilderProperties; |
@@ -1,2 +0,2 @@ | ||
import { merge, formatUnit } from '@syncfusion/ej2-base';import { attributes, addClass, removeClass, createElement, prepend, closest, remove } from '@syncfusion/ej2-base';import { Component, EventHandler, BaseEventArgs, Property, Complex, Event, CreateBuilder } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty, KeyboardEvents } from '@syncfusion/ej2-base';import { KeyboardEventArgs, EmitType } from '@syncfusion/ej2-base';import { Animation, AnimationOptions, Effect, ripple, Touch, SwipeEventArgs } from '@syncfusion/ej2-base';import { DataManager, Query } from '@syncfusion/ej2-data';import { ListBase, ListBaseOptions, SortOrder } from '../common/list-base';import { ListViewHelper } from './list-view-builder'; | ||
import { merge, formatUnit, isNullOrUndefined } from '@syncfusion/ej2-base';import { attributes, addClass, removeClass, createElement, prepend, closest, remove } from '@syncfusion/ej2-base';import { Component, EventHandler, BaseEventArgs, Property, Complex, Event, CreateBuilder } from '@syncfusion/ej2-base';import { NotifyPropertyChanges, INotifyPropertyChanged, ChildProperty, KeyboardEvents } from '@syncfusion/ej2-base';import { KeyboardEventArgs, EmitType } from '@syncfusion/ej2-base';import { Animation, AnimationOptions, Effect, rippleEffect, Touch, SwipeEventArgs } from '@syncfusion/ej2-base';import { DataManager, Query } from '@syncfusion/ej2-data';import { ListBase, ListBaseOptions, SortOrder } from '../common/list-base';import { ListViewHelper } from './list-view-builder'; | ||
import {AnimationSettings,SelectEventArgs} from "./list-view"; | ||
@@ -99,3 +99,3 @@ import {ComponentModel} from '@syncfusion/ej2-base'; | ||
*/ | ||
dataSource?: { [key: string]: Object }[] | DataManager; | ||
dataSource?: { [key: string]: Object }[] | string[] | DataManager; | ||
@@ -102,0 +102,0 @@ /** |
@@ -149,3 +149,3 @@ import { Component, BaseEventArgs } from '@syncfusion/ej2-base'; | ||
[key: string]: Object; | ||
}[] | DataManager; | ||
}[] | string[] | DataManager; | ||
/** | ||
@@ -347,3 +347,3 @@ * Specifies the query that need to process remote dataSource. | ||
[key: string]: Object; | ||
}; | ||
} | any; | ||
} | ||
@@ -350,0 +350,0 @@ export interface SelectEventArgs extends BaseEventArgs, SelectedItem { |
@@ -369,7 +369,16 @@ var __extends = (this && this.__extends) || (function () { | ||
var data = this.getItemData(li); | ||
this.selectedItems = { | ||
item: li, | ||
text: data[this.listBaseOption.fields.text], | ||
data: data | ||
}; | ||
if (ej2_base_1.isNullOrUndefined(data) && typeof this.dataSource[0] === 'string') { | ||
this.selectedItems = { | ||
item: li, | ||
text: li.innerText.trim(), | ||
data: this.dataSource | ||
}; | ||
} | ||
else { | ||
this.selectedItems = { | ||
item: li, | ||
text: data[this.listBaseOption.fields.text], | ||
data: data | ||
}; | ||
} | ||
var eventArgs = {}; | ||
@@ -593,3 +602,5 @@ ej2_base_1.merge(eventArgs, this.selectedItems); | ||
this.setHTMLAttribute(); | ||
this.rippleFn = ej2_base_5.ripple(this.element, '.e-list-item'); | ||
this.rippleFn = ej2_base_5.rippleEffect(this.element, { | ||
selector: '.' + classNames.listItem | ||
}); | ||
}; | ||
@@ -596,0 +607,0 @@ ListView.prototype.destroy = function () { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
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
2934416
31157
Updated@syncfusion/ej2-base@^1.0.18