UNPKG

@syncfusion/ej2-treegrid

Version:
10 lines 353 kB
/*! * filename: ej2-treegrid.min.js * version : 29.1.37 * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionGrids"),require("SyncfusionButtons"),require("SyncfusionData"),require("SyncfusionPopups")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionGrids","SyncfusionButtons","SyncfusionData","SyncfusionPopups"],t):"object"==typeof exports?exports.SyncfusionTreegrid=t(require("SyncfusionBase"),require("SyncfusionGrids"),require("SyncfusionButtons"),require("SyncfusionData"),require("SyncfusionPopups")):e.SyncfusionTreegrid=t(e.SyncfusionBase,e.SyncfusionGrids,e.SyncfusionButtons,e.SyncfusionData,e.SyncfusionPopups)}(self,((e,t,i,r,n)=>(()=>{"use strict";var o={766:t=>{t.exports=e},741:e=>{e.exports=i},74:e=>{e.exports=r},707:e=>{e.exports=t},197:e=>{e.exports=n}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return o[e](i,i.exports,s),i.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{s.r(d),s.d(d,{Aggregate:()=>si,AggregateColumn:()=>Et,AggregateRow:()=>At,Column:()=>n,ColumnChooser:()=>Ri,ColumnMenu:()=>li,CommandColumn:()=>ui,ContextMenu:()=>pi,ContextMenuItems:()=>ut,DataManipulation:()=>Ct,DetailRow:()=>gi,Edit:()=>ci,EditSettings:()=>qt,ExcelExport:()=>ri,Filter:()=>ii,FilterSettings:()=>m,Freeze:()=>Ii,InfiniteScroll:()=>xi,InfiniteScrollSettings:()=>Ht,LoadingIndicator:()=>c,Logger:()=>C,Page:()=>oi,PageSettings:()=>Mt,PdfExport:()=>ni,Predicate:()=>f,Render:()=>xt,Reorder:()=>Wt,Resize:()=>Yt,RowDD:()=>Jt,RowDropSettings:()=>Zt,SearchSettings:()=>St,Selection:()=>gt,SelectionSettings:()=>It,Sort:()=>di,SortDescriptor:()=>Vt,SortSettings:()=>Bt,StackedColumn:()=>a,Toolbar:()=>ai,ToolbarItem:()=>ct,TreeClipboard:()=>Xe,TreeGrid:()=>Kt,TreeGridColumn:()=>o,TreeVirtual:()=>wi,TreeVirtualRowModelGenerator:()=>ti,VirtualScroll:()=>vi,actionBegin:()=>A,actionComplete:()=>U,actionFailure:()=>Ye,ariaColIndex:()=>Ke,ariaRowIndex:()=>We,autoCol:()=>ke,batchAdd:()=>pe,batchCancel:()=>le,batchDelete:()=>de,batchEditFormRendered:()=>be,batchSave:()=>ge,beforeBatchAdd:()=>ce,beforeBatchCancel:()=>Ce,beforeBatchDelete:()=>he,beforeBatchSave:()=>ue,beforeCopy:()=>$,beforeDataBound:()=>E,beforeExcelExport:()=>L,beforePaste:()=>Z,beforePdfExport:()=>z,beforeStartEdit:()=>xe,beginAdd:()=>re,beginEdit:()=>ie,cellEdit:()=>se,cellSave:()=>oe,cellSaved:()=>ae,checkboxChange:()=>T,collapsed:()=>H,collapsing:()=>G,content:()=>je,contextMenuClick:()=>X,contextMenuOpen:()=>J,crudAction:()=>te,dataBound:()=>O,dataListener:()=>Ie,dataStateChange:()=>N,destroy:()=>we,detailDataBound:()=>De,doubleTap:()=>ye,expanded:()=>j,expanding:()=>_,extendArray:()=>dt,findChildrenRecords:()=>at,findParentRecords:()=>nt,frozenContent:()=>ze,frozenHeader:()=>Fe,frozenLeft:()=>Qe,frozenRight:()=>Ge,getExpandStatus:()=>ot,getParentData:()=>pt,getPlainData:()=>lt,headerContent:()=>Ve,indexModifier:()=>Re,isCheckboxcolumn:()=>it,isCountRequired:()=>tt,isFilterChildHierarchy:()=>rt,isHidden:()=>ht,isOffline:()=>st,isRemoteData:()=>et,keyPressed:()=>fe,leftRight:()=>He,load:()=>D,localPagedExpandCollapse:()=>K,movableContent:()=>Be,movableHeader:()=>Le,pagingActions:()=>W,printGridInit:()=>Y,queryCellInfo:()=>P,recordDoubleClick:()=>ne,remoteExpand:()=>Q,resizeStop:()=>F,rowDataBound:()=>M,rowDeselected:()=>V,rowDeselecting:()=>Te,rowDrag:()=>Me,rowDragStart:()=>Ee,rowDragStartHelper:()=>Oe,rowDrop:()=>Pe,rowDropped:()=>qe,rowSelected:()=>k,rowSelecting:()=>q,rowdraging:()=>Ue,rowsAdd:()=>Ae,rowsRemove:()=>Ne,savePreviousRowPosition:()=>ee,table:()=>_e,toolbarClick:()=>B,treeGridDetails:()=>b,updateData:()=>me,virtualActionArgs:()=>ve,virtualColumnIndex:()=>Se});var e,t=s(766),i=(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)},function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}),r=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},n=function(){function e(e){this.allowEditing=!0,this.edit={},this.disableHtmlEncode=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowFiltering=!0,this.allowSorting=!0,this.allowResizing=!0,this.filter={},(0,t.merge)(this,e)}return e.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)if(this[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]],this.parent&&this.parent.isReact&&"template"===t[parseInt(i.toString(),10)]){this.parent.clipboardModule.treeGridParent.renderModule.refreshReactColumnTemplateByUid(this.uid)}},e}(),o=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i(n,e),r([(0,t.Property)(null)],n.prototype,"columns",void 0),n}(n),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o),l=s(707),p=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),h=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},c=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return p(i,e),h([(0,t.Property)("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),u=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),g=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},f=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return u(i,e),g([(0,t.Property)()],i.prototype,"field",void 0),g([(0,t.Property)()],i.prototype,"operator",void 0),g([(0,t.Property)()],i.prototype,"value",void 0),g([(0,t.Property)()],i.prototype,"matchCase",void 0),g([(0,t.Property)()],i.prototype,"ignoreAccent",void 0),g([(0,t.Property)()],i.prototype,"predicate",void 0),g([(0,t.Property)({})],i.prototype,"actualFilterValue",void 0),g([(0,t.Property)({})],i.prototype,"actualOperator",void 0),g([(0,t.Property)()],i.prototype,"type",void 0),g([(0,t.Property)()],i.prototype,"ejpredicate",void 0),g([(0,t.Property)()],i.prototype,"uid",void 0),g([(0,t.Property)()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),m=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return u(i,e),g([(0,t.Collection)([],f)],i.prototype,"columns",void 0),g([(0,t.Property)("FilterBar")],i.prototype,"type",void 0),g([(0,t.Property)()],i.prototype,"mode",void 0),g([(0,t.Property)(!0)],i.prototype,"showFilterBarStatus",void 0),g([(0,t.Property)(1500)],i.prototype,"immediateModeDelay",void 0),g([(0,t.Property)()],i.prototype,"operators",void 0),g([(0,t.Property)(!1)],i.prototype,"ignoreAccent",void 0),g([(0,t.Property)("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),y=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),S=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},v=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return y(i,e),S([(0,t.Property)("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),w=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),I="https://ej2.syncfusion.com/documentation/treegrid",R="https://ej2.syncfusion.com/documentation",x=!1,C=function(e){function i(t){return l.Grid.Inject(l.Logger),e.call(this,t)||this}return w(i,e),i.prototype.getModuleName=function(){return"logger"},i.prototype.log=function(e,i){e instanceof Array||(e=[e]);for(var r=e,n=0;n<r.length;n++){var o=l.detailLists[r[parseInt(n.toString(),10)]],a=o.check(i,this.parent);if(a.success){var s=o.generateMessage(i,this.parent,a.options);s=s.replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),x&&"primary_column_missing"===r[parseInt(n.toString(),10)]&&(s=s.replace("Editing","Row DragAndDrop"),x=!1);var d=s.indexOf("https"),p=s.substring(d);"module_missing"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/modules"):"primary_column_missing"===r[parseInt(n.toString(),10)]||"selection_key_missing"===r[parseInt(n.toString(),10)]?s=s.replace(p,R+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/edit"):"virtual_height"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/virtual"):"check_datasource_columns"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/columns"):"locale_missing"===r[parseInt(n.toString(),10)]&&(s=s.replace(p,I+"/global-local/#localization")),"datasource_syntax_mismatch"===r[parseInt(n.toString(),10)]&&((0,t.isNullOrUndefined)(this.treeGridObj)||(0,t.isNullOrUndefined)(this.treeGridObj.dataStateChange))||console[o.logType](s)}}},i.prototype.treeLog=function(e,t,i){this.treeGridObj=i,e instanceof Array||(e=[e]);var r=e;i.allowRowDragAndDrop&&!i.columns.filter((function(e){return e.isPrimaryKey})).length&&(x=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=b[r[parseInt(n.toString(),10)]],a=o.check(t,i);if(a.success){var s=o.generateMessage(t,i,a.options);console[o.logType](s)}}},i}(l.Logger),b={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,i){var r={success:!1};return((0,t.isNullOrUndefined)(i.idMapping)&&(0,t.isNullOrUndefined)(i.childMapping)&&(0,t.isNullOrUndefined)(i.parentIdMapping)||!(0,t.isNullOrUndefined)(i.idMapping)&&(0,t.isNullOrUndefined)(i.parentIdMapping)||(0,t.isNullOrUndefined)(i.idMapping)&&!(0,t.isNullOrUndefined)(i.parentIdMapping))&&(r={success:!0}),r},generateMessage:function(){return"[EJ2TreeGrid.Error]: MAPPING FIELDS MISSING \nOne of the following fields is missing. It is required for the hierarchical relationship of records in TreeGrid:\n* childMapping\n* idMapping\n* parentIdMapping\nRefer to the following documentation links for more details.\n"+R+"/api/treegrid#childmapping\n"+R+"/api/treegrid#idmapping\n"+R+"/api/treegrid#$parentidmapping"}}},D="load",M="rowDataBound",O="dataBound",P="queryCellInfo",E="beforeDataBound",A="actionBegin",N="dataStateChange",U="actionComplete",q="rowSelecting",k="rowSelected",T="checkboxChange",V="rowDeselected",B="toolbarClick",L="beforeExcelExport",z="beforePdfExport",F="resizeStop",j="expanded",_="expanding",H="collapsed",G="collapsing",Q="remoteExpand",K="localPagedExpandCollapse",W="pagingActions",Y="printGrid-Init",J="contextMenuOpen",X="contextMenuClick",$="beforeCopy",Z="beforePaste",ee="savePreviousRowPosition",te="crudAction",ie="beginEdit",re="beginAdd",ne="recordDoubleClick",oe="cellSave",ae="cellSaved",se="cellEdit",de="batchDelete",le="batchCancel",pe="batchAdd",he="beforeBatchDelete",ce="beforeBatchAdd",ue="beforeBatchSave",ge="batchSave",fe="key-pressed",me="update-data",ye="double-tap",Se="virtualColumnIndex",ve="virtual-action-args",we="destroy",Ie="data-listener",Re="index-modifier",xe="edit-form",Ce="before-batch-cancel",be="batcheditform-rendered",De="detailDataBound",Me="rowDrag",Oe="rowDragStartHelper",Pe="rowDrop",Ee="rowDragStart",Ae="rows-add",Ne="rows-remove",Ue="row-draging",qe="row-dropped",ke="auto-col",Te="rowDeselecting",Ve="e-headercontent",Be="e-movablecontent",Le="e-movableheader",ze="e-frozencontent",Fe="e-frozenheader",je="e-content",_e="e-table",He="Left-Right",Ge="frozen-right",Qe="frozen-left",Ke="aria-colindex",We="aria-rowindex",Ye="actionFailure",Je=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xe=function(e){function i(t,i){var r=e.call(this,t.grid,i)||this;return r.treeCopyContent="",r.copiedUniqueIdCollection=[],r.treeGridParent=t,r.serviceLocator=i,r}return Je(i,e),i.prototype.setCopyData=function(i){var r="copyContent",n="getCopyData",o=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this[""+r]="";var a=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var s=this.treeGridParent.getSelectedRowIndexes().sort((function(e,t){return e-t})),d=0;d<s.length;d++)if(d>0&&(this.treeCopyContent+="\n"),!a[s[parseInt(d.toString(),10)]].classList.contains("e-summaryrow")){var l=[].slice.call(a[s[parseInt(d.toString(),10)]].querySelectorAll(".e-rowcell")),p=this.treeGridParent.getSelectedRecords()[parseInt(d.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(p)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(o,s[parseInt(d.toString(),10)],a,i,d),this[""+n](l,!1,"\t",i),this.treeCopyContent+=this[""+r],this.copiedUniqueIdCollection.push(p),this[""+r]="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(o,s[parseInt(d.toString(),10)],a,i))}if(i){var h=[];for(d=0;d<this.treeGridParent.getVisibleColumns().length;d++)h[parseInt(d.toString(),10)]=this.treeGridParent.getVisibleColumns()[parseInt(d.toString(),10)].headerText;this[""+n](h,!1,"\t",i),this.treeCopyContent=this[""+r]+"\n"+this.treeCopyContent}var c={data:this.treeCopyContent,cancel:!1};if(this.treeGridParent.trigger($,c),c.cancel)return;this.clipBoardTextArea.value=this[""+r]=c.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0,this.copiedUniqueIdCollection=[],this.treeCopyContent=""}else e.prototype.setCopyData.call(this,i)}},i.prototype.parentContentData=function(e,i,r,n,o){var a="copyContent",s="parentItem",d="uniqueID";if(!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][""+s]))for(var l=e[parseInt(i.toString(),10)][""+s].level,p=0;p<l+1;p++)for(var h=0;h<e.length;h++)if(!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][""+s])&&e[parseInt(h.toString(),10)][""+d]===e[parseInt(i.toString(),10)][""+s][""+d]){i=h;var c=[].slice.call(r[parseInt(i.toString(),10)].querySelectorAll(".e-rowcell")),u=e[parseInt(h.toString(),10)][""+d];if(-1===this.copiedUniqueIdCollection.indexOf(u)){this.getCopyData(c,!1,"\t",n),this.treeCopyContent=o>0?this.treeCopyContent+this[""+a]+"\n":this[""+a]+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(u),this[""+a]="";break}}},i.prototype.copy=function(t){e.prototype.copy.call(this,t)},i.prototype.paste=function(t,i,r){e.prototype.paste.call(this,t,i,r)},i.prototype.getModuleName=function(){return"clipboard"},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.childContentData=function(e,i,r,n){var o="copyContent",a="uniqueID";if(e[parseInt(i.toString(),10)].hasChildRecords)for(var s=e[parseInt(i.toString(),10)].childRecords,d=0;d<s.length;d++)for(var l=0;l<e.length;l++)if(!(0,t.isNullOrUndefined)(s[parseInt(d.toString(),10)][""+a])&&e[parseInt(l.toString(),10)][""+a]===s[parseInt(d.toString(),10)][""+a]){if(!(0,t.isNullOrUndefined)(r[parseInt(l.toString(),10)])&&!r[parseInt(l.toString(),10)].classList.contains("e-summaryrow")){var p=[].slice.call(r[parseInt(l.toString(),10)].querySelectorAll(".e-rowcell")),h=e[parseInt(l.toString(),10)][""+a];-1===this.copiedUniqueIdCollection.indexOf(h)&&(this.getCopyData(p,!1,"\t",n),this.treeCopyContent+="\n"+this[""+o],this[""+o]="",this.copiedUniqueIdCollection.push(h),this.childContentData(e,l,r,n))}break}},i}(l.Clipboard),$e=s(741),Ze=s(74);function et(e){if(e.dataSource instanceof Ze.DataManager){var t=e.dataSource.adaptor;return t instanceof Ze.ODataAdaptor||t instanceof Ze.WebApiAdaptor||t instanceof Ze.WebMethodAdaptor||t instanceof Ze.CacheAdaptor||t instanceof Ze.UrlAdaptor}return!1}function tt(e){return!(!e.dataSource||!("result"in e.dataSource))}function it(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function rt(e){return!(((0,t.isNullOrUndefined)(e.grid.searchSettings.key)||""===e.grid.searchSettings.key||"Child"!==e.searchSettings.hierarchyMode&&"None"!==e.searchSettings.hierarchyMode)&&(!e.allowFiltering||!e.grid.filterSettings.columns.length||"Child"!==e.filterSettings.hierarchyMode&&"None"!==e.filterSettings.hierarchyMode))}function nt(e){for(var t=[],i=0,r=Object.keys(e).length;i<r;i++){(0,l.getObject)("hasChildRecords",e[parseInt(i.toString(),10)])&&t.push(e[parseInt(i.toString(),10)])}return t}function ot(e,i,r){var n,o=(0,t.isNullOrUndefined)(i.parentItem)?null:pt(e,i.parentItem.uniqueID);return null==o||(!e.initialRender||(0,t.isNullOrUndefined)(o[e.expandStateMapping])||o[e.expandStateMapping]?!1!==o.expanded&&(!o.parentItem||((n=pt(e,o.parentItem.uniqueID))&&e.initialRender&&!(0,t.isNullOrUndefined)(n[e.expandStateMapping])&&!n[e.expandStateMapping]?(n.expanded=!1,!1):(!n||!1!==n.expanded)&&(!n||ot(e,n,r)))):(o.expanded=!1,!1))}function at(e){var i=[];if((0,t.isNullOrUndefined)(e)||!e.hasChildRecords&&!(0,t.isNullOrUndefined)(e.childRecords)&&!e.childRecords.length)return[];if(!(0,t.isNullOrUndefined)(e.childRecords))for(var r=e.childRecords.filter((function(e){return!e.isSummaryRow})),n=0,o=Object.keys(r).length;n<o;n++)i.push(r[parseInt(n.toString(),10)]),(r[parseInt(n.toString(),10)].hasChildRecords||!(0,t.isNullOrUndefined)(r[parseInt(n.toString(),10)].childRecords)&&r[parseInt(n.toString(),10)].childRecords.length)&&(i=i.concat(at(r[parseInt(n.toString(),10)])));return i}function st(e){if(et(e)){var i=e.dataSource;return!(0,t.isNullOrUndefined)(i.ready)}return!0}function dt(e){for(var t,i,r=[],n=0;e&&n<e.length;n++){i=Object.keys(e[parseInt(n.toString(),10)]),t={};for(var o=0;o<i.length;o++)t[i[parseInt(o.toString(),10)]]=e[parseInt(n.toString(),10)][i[parseInt(o.toString(),10)]];r.push(t)}return r}function lt(e){return delete e.hasChildRecords,delete e.childRecords,delete e.index,delete e.parentItem,delete e.level,delete e.taskData,delete e.uniqueID,e}function pt(e,t,i){if(i){return e.uniqueIDFilterCollection[""+t]}return e.uniqueIDCollection[""+t]}function ht(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}var ct,ut,gt=function(){function e(e){this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"selection"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.checkboxSelection=function(e){var i,r,n=(0,l.getObject)("target",e),o=(0,l.parentsUntil)(n,"e-checkbox-wrapper");if(o&&o.querySelectorAll(".e-treecheckselect").length>0){r=o.querySelector('input[type="checkbox"]');var a=[];a.push(n.closest("tr").rowIndex),this.selectCheckboxes(a),this.triggerChkChangeEvent(r,r.nextElementSibling.classList.contains("e-check"),n.closest("tr"))}else if(o&&o.querySelectorAll(".e-treeselectall").length>0&&this.parent.autoCheckHierarchy){var s=!o.querySelector(".e-frame").classList.contains("e-check")&&!o.querySelector(".e-frame").classList.contains("e-stop");this.headerSelection(s),r=o.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(r,s,n.closest("tr"))}!(0,t.isNullOrUndefined)(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&this.parent.columnModel.filter((function(e){return"checkbox"===e.type})).length>0&&et(this.parent)&&this.parent.parentQuery.length>0&&((i=this.parent.query.queries).push.apply(i,this.parent.parentQuery),this.parent.parentQuery=[])},e.prototype.triggerChkChangeEvent=function(e,t,i){var r=this.parent.getCurrentViewRecords()[i.rowIndex],n={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():r};this.parent.trigger(T,n)},e.prototype.getCheckboxcolumnIndex=function(){for(var e,t,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].showCheckbox&&(e=i[parseInt(r.toString(),10)].uid);for(var n=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv").length,o=0;o<n;o++){this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[parseInt(o.toString(),10)].getAttribute("e-mappinguid")===e&&(t=o)}return t},e.prototype.headerCheckbox=function(){if(this.columnIndex=this.getCheckboxcolumnIndex(),this.columnIndex>-1&&0===this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length){var e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex],i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}});(r=(0,$e.createCheckBox)(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),r.insertBefore(i.cloneNode(),r.firstChild),(0,t.isNullOrUndefined)(e)||e.insertBefore(r,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()}else if(this.columnIndex>-1&&this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length>0){var r,n=(r=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0]).querySelector(".e-frame").classList.contains("e-check");this.parent.autoCheckHierarchy&&n&&this.headerSelection(n)}},e.prototype.renderColumnCheckbox=function(e){var i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),r=e.data;e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox");var n=!(0,t.isNullOrUndefined)(r.checkboxState)&&"uncheck"!==r.checkboxState,o=(0,$e.createCheckBox)(this.parent.createElement,!1,{checked:n,label:" "});if(o.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(o.querySelector(".e-frame").style.width="18px"),"indeterminate"===r.checkboxState){var a=o.querySelectorAll(".e-frame")[0];(0,t.removeClass)([a],["e-check","e-stop","e-uncheck"]),o.querySelector(".e-frame").classList.add("e-stop")}return o.insertBefore(i.cloneNode(),o.firstChild),o},e.prototype.columnCheckbox=function(e){var i=this.renderColumnCheckbox(e),r=e.cell.querySelector(".e-treecolumn-container");if((0,t.isNullOrUndefined)(r)){var n=this.parent.createElement("span",{className:"e-treecheckbox"}),o=e.cell.innerHTML;e.cell.innerHTML="",n.innerHTML=o;var a=this.parent.createElement("div",{className:"e-treecheckbox-container"});a.appendChild(i),a.appendChild(n),e.cell.appendChild(a)}else e.cell.querySelector(".e-hierarchycheckbox")||r.insertBefore(i,r.querySelectorAll(".e-treecell")[0])},e.prototype.selectCheckboxes=function(e){if((0,t.isNullOrUndefined)(e)){this.parent.trigger(Ye,{error:"The provided value for the rowIndexes is undefined. Please ensure the rowIndexes contains number."})}for(var i=0;i<e.length;i++){var r=this.parent.getCurrentViewRecords()[e[parseInt(i.toString(),10)]],n=pt(this.parent,r.uniqueID),o="uncheck"===(r=n).checkboxState?"check":"uncheck";r.checkboxState=o;for(var a=Object.keys(r),s=0;s<a.length;s++)Object.prototype.hasOwnProperty.call(n,a[parseInt(s.toString(),10)])&&(n[a[parseInt(s.toString(),10)]]=r[a[parseInt(s.toString(),10)]]);this.traverSelection(r,o,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},e.prototype.traverSelection=function(e,i,r){var n=0;if(this.updateSelectedItems(e,i),!r&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy){var o=e.childRecords;!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(o=this.getFilteredChildRecords(o)),n=o.length;for(var a=0;a<n;a++)o[parseInt(a.toString(),10)].isSummaryRow||(o[parseInt(a.toString(),10)].hasChildRecords?this.traverSelection(o[parseInt(a.toString(),10)],i,!0):this.updateSelectedItems(o[parseInt(a.toString(),10)],i))}},e.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter((function(e){return t.parent.filterModule.filteredResult.indexOf(e)>-1}))},e.prototype.updateParentSelection=function(e){var i,r=[],n=pt(this.parent,e.uniqueID);n&&n.childRecords&&(r=n.childRecords),!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(r=this.getFilteredChildRecords(r)),i=r&&r.length;var o=0,a=0;if(!(0,t.isNullOrUndefined)(n)){for(var s=0;s<r.length;s++){var d=pt(this.parent,r[parseInt(s.toString(),10)].uniqueID);(0,t.isNullOrUndefined)(d)||("indeterminate"===d.checkboxState?o++:"check"===d.checkboxState&&a++)}o>0||a>0&&a!==i?n.checkboxState="indeterminate":(0!==a||n.hasFilteredChildRecords&&!(0,t.isNullOrUndefined)(n.hasFilteredChildRecords)||(0,t.isNullOrUndefined)(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==n.checkboxState)&&(0===a&&0===o||0===a&&n.hasFilteredChildRecords&&!(0,t.isNullOrUndefined)(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===n.checkboxState)?n.checkboxState="uncheck":n.checkboxState="check",this.updateSelectedItems(n,n.checkboxState),n.parentItem&&this.updateParentSelection(n.parentItem)}},e.prototype.headerSelection=function(e){var i,r,n=this,o=!1;if(!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0){var a=this.parent.filterModule.filteredResult;0===this.filteredList.length&&(this.filteredList=a),this.parent.grid.searchSettings.key.length?this.searchingRecords=a:this.filteredList!==a?(this.filteredList=a,o=!0):o=!1}if(this.filteredList.length>0&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length&&!(0,t.isNullOrUndefined)(e)&&(this.filteredList=this.searchingRecords)),r=!(0,t.isNullOrUndefined)(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&this.parent.filterSettings.columns.length>0||!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.filteredList.length>0?this.filteredList:this.parent.flatData,r=et(this.parent)?this.parent.getCurrentViewRecords():r,!(0,t.isNullOrUndefined)(e))for(var s=0;s<r.length;s++)if(e){if("check"===r[parseInt(s.toString(),10)].checkboxState)continue;if(o)continue;r[parseInt(s.toString(),10)].checkboxState="check",this.updateSelectedItems(r[parseInt(s.toString(),10)],r[parseInt(s.toString(),10)].checkboxState)}else this.selectedItems.indexOf(r[parseInt(s.toString(),10)])>-1&&(r[parseInt(s.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(r[parseInt(s.toString(),10)],r[parseInt(s.toString(),10)].checkboxState),this.parent.autoCheckHierarchy&&this.updateParentSelection(r[parseInt(s.toString(),10)]));!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],r.filter((function(e){e.checkboxState="uncheck",n.updateSelectedItems(e,e.checkboxState)}))),i=this.selectedItems.length;var d=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];i>0&&r.length>0?i===r.length||e?((0,t.removeClass)([d],["e-stop"]),d.classList.add("e-check")):((0,t.removeClass)([d],["e-check"]),d.classList.add("e-stop")):(0,t.removeClass)([d],["e-check","e-stop"])},e.prototype.updateSelectedItems=function(e,i){var r,n,o=this.parent.grid.currentViewData.filter((function(t){return t.uniqueID===e.uniqueID})),a=this.parent.grid.currentViewData.indexOf(o[0]),s=pt(this.parent,e.uniqueID),d=this.parent.getRows()[parseInt(a.toString(),10)];if(a>-1){var l=void 0;(this.parent.frozenRows||this.parent.getFrozenColumns())&&(l=this.parent.getDataRows()[parseInt(a.toString(),10)]),n=d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]:l.querySelectorAll(".e-hierarchycheckbox .e-frame")[0],(0,t.isNullOrUndefined)(n)||(0,t.removeClass)([n],["e-check","e-stop","e-uncheck"])}if(r=s,(0,t.isNullOrUndefined)(r)&&(r=e),r.checkboxState=i,"check"===i&&(0,t.isNullOrUndefined)(e.isSummaryRow))-1!==a&&-1===this.selectedIndexes.indexOf(a)&&this.selectedIndexes.push(a),-1===this.selectedItems.indexOf(r)&&-1!==a&&!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1!==this.selectedItems.indexOf(r)||(0,t.isNullOrUndefined)(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.selectedItems.push(r);else if(("uncheck"===i||"indeterminate"===i)&&(0,t.isNullOrUndefined)(e.isSummaryRow)){var p=this.selectedItems.indexOf(r);if(-1!==p&&this.selectedItems.splice(p,1),-1!==this.selectedIndexes.indexOf(a)){var h=this.selectedIndexes.indexOf(a);this.selectedIndexes.splice(h,1)}}var c="indeterminate"===i?"e-stop":"e-"+i;a>-1&&((0,t.isNullOrUndefined)(n)||(n.classList.add(c),d.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===i?"true":"uncheck"===i?"false":"mixed")))},e.prototype.updateGridActions=function(e){var i,r,n=this,o=e.requestType;if(it(this.parent)&&this.parent.autoCheckHierarchy)if("sorting"===o||"paging"===o){var a=this.parent.grid.getRows();r=(i=this.parent.getCurrentViewRecords()).length,this.selectedIndexes=[];for(var s=0;s<r;s++)a[parseInt(s.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(s.toString(),10)],i[parseInt(s.toString(),10)].checkboxState)}else if("delete"===o||"add"===e.action){var d=[];"delete"===o?d=e.data:d.push(e.data);for(s=0;s<d.length;s++){if("delete"===o){var l=this.parent.flatData.indexOf(d[parseInt(s.toString(),10)]),p=this.selectedIndexes.indexOf(l);this.selectedIndexes.splice(p,1),this.updateSelectedItems(d[parseInt(s.toString(),10)],"uncheck")}(0,t.isNullOrUndefined)(d[parseInt(s.toString(),10)].parentItem)||this.updateParentSelection(d[parseInt(s.toString(),10)].parentItem)}}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":("filtering"===o||"searching"===o||"refresh"===o&&!et(this.parent))&&(this.selectedItems=[],this.selectedIndexes=[],(i=!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0?this.parent.filterModule.filteredResult:this.parent.flatData).forEach((function(e){if(n.parent.enableVirtualization){e.hasChildRecords&&e.childRecords.length>0?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState);var i=at(e);i=n.getFilteredChildRecords(i);for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)].hasChildRecords?n.updateParentSelection(i[parseInt(r.toString(),10)]):i[parseInt(r.toString(),10)].hasChildRecords||(0,t.isNullOrUndefined)(i[parseInt(r.toString(),10)])||n.updateSelectedItems(i[parseInt(r.toString(),10)],i[parseInt(r.toString(),10)].checkboxState)}else e.hasChildRecords?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState)})),this.headerSelection())},e.prototype.getCheckedrecords=function(){return this.selectedItems},e.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes},e}(),ft=function(){function e(e){this.parent=e,l.Grid.Inject(l.Print),this.addEventListener()}return e.prototype.getModuleName=function(){return"print"},e.prototype.addEventListener=function(){this.parent.grid.on(Y,this.printTreeGrid,this)},e.prototype.removeEventListener=function(){this.parent.grid.off(Y,this.printTreeGrid)},e.prototype.printTreeGrid=function(e){var i=(0,l.getObject)("printgrid",e),r=(0,l.getObject)("element",e);i.addEventListener(P,this.parent.grid.queryCellInfo),i.addEventListener(M,this.parent.grid.rowDataBound),i.addEventListener(E,this.parent.grid.beforeDataBound),(0,t.addClass)([r],"e-treegrid")},e.prototype.print=function(){this.parent.grid.print()},e.prototype.destroy=function(){this.removeEventListener()},e}(),mt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),yt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},St=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return mt(i,e),yt([(0,t.Property)()],i.prototype,"fields",void 0),yt([(0,t.Property)(!1)],i.prototype,"ignoreCase",void 0),yt([(0,t.Property)("contains")],i.prototype,"operator",void 0),yt([(0,t.Property)()],i.prototype,"key",void 0),yt([(0,t.Property)()],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),vt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},It=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return vt(i,e),wt([(0,t.Property)("Row")],i.prototype,"mode",void 0),wt([(0,t.Property)("Flow")],i.prototype,"cellSelectionMode",void 0),wt([(0,t.Property)("Single")],i.prototype,"type",void 0),wt([(0,t.Property)(!1)],i.prototype,"persistSelection",void 0),wt([(0,t.Property)("Default")],i.prototype,"checkboxMode",void 0),wt([(0,t.Property)(!1)],i.prototype,"checkboxOnly",void 0),wt([(0,t.Property)(!0)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Rt=s(197),xt=function(){function e(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}return e.prototype.RowModifier=function(e){if(e.data){var i=e.data,r=i.parentItem;if(!(0,t.isNullOrUndefined)(i.parentItem)&&!rt(this.parent)&&(!this.parent.allowPaging||"Root"===this.parent.pageSettings.pageSizeMode||et(this.parent)&&!st(this.parent)))if((this.parent.initialRender&&(!((0,t.isNullOrUndefined)(r[this.parent.expandStateMapping])||r[this.parent.expandStateMapping])||this.parent.enableCollapseAll)||!ot(this.parent,e.data,this.parent.grid.getCurrentViewRecords()))&&!(0,t.isNullOrUndefined)(e.row)){this.parent.toggleRowVisibility(e.row,"e-childrow-hidden");var n=this.parent.grid.getRowsObject();this.parent.grid.isFrozenGrid()||(0,t.isNullOrUndefined)(e.row.getAttribute("data-uid"))||(n.filter((function(t){return t.uid===e.row.getAttribute("data-uid")}))[0].visible=!1)}if(et(this.parent)&&!st(this.parent)){var o=this.parent,a=this.parent.getCurrentViewRecords().filter((function(e){return(0,t.getValue)(o.idMapping,e)===(0,t.getValue)(o.parentIdMapping,i)}));if(a.length>0&&!a[0].isSummaryRow&&!(0,t.isNullOrUndefined)(e.row)){var s=a[0].expanded?"e-childrow-visible":"e-childrow-hidden";this.parent.toggleRowVisibility(e.row,s)}}(0,l.getObject)("isSummaryRow",e.data)&&(0,t.addClass)([e.row],"e-summaryrow"),(0,t.isNullOrUndefined)(e.row)||(e.row.querySelector(".e-treegridexpand")?e.row.setAttribute("aria-expanded","true"):e.row.querySelector(".e-treegridcollapse")&&e.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&((0,t.isNullOrUndefined)(i.parentItem)||this.parent.toggleRowVisibility(e.row,"e-childrow-hidden")));if(this.parent.rowDragAndDropModule&&this.parent.grid.rowDragAndDropModule&&(this.parent.grid.rowDragAndDropModule.dragStartData||this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.getContentTable().scrollHeight<=this.parent.getContent().clientHeight){this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length-1].uniqueID!==e.data.uniqueID||(0,t.isNullOrUndefined)(e.row)||e.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(e.row,!0)}if(this.parent.isReact){var d=this;d.parent.renderReactTemplates((function(){d.parent.trigger(M,e)}))}else this.parent.trigger(M,e)}},e.prototype.cellRender=function(e){if(e.data){var i,r,n=this.parent.grid,o=e.data,a=(0,t.isNullOrUndefined)(o.filterLevel)?o.level:o.filterLevel,s=0,d=this.parent.getColumnByUid(e.column.uid),p=o.isSummaryRow,h=this.parent.getFrozenColumns();i=(0,t.isNullOrUndefined)(o.parentItem)?o.index:o.parentItem.index;if((this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):n.getColumnIndexByUid(e.column.uid))!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!(0,t.isNullOrUndefined)(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var c=(0,t.createElement)("div",{className:"e-treecolumn-container"}),u=(0,t.createElement)("span",{className:"e-icons e-none"});u.style.width="10px",u.style.display="inline-block";for(var g=0;g<a;g++)s+=10,c.appendChild(u.cloneNode());var f=(0,t.isNullOrUndefined)(o.hasFilteredChildRecords)?o.hasChildRecords:o.hasFilteredChildRecords;if(f&&!(0,t.isNullOrUndefined)(o.childRecords)&&(f=this.parent.isFromGantt&&this.parent.loadChildOnDemand?o.hasChildRecords:!(0===o.childRecords.length)),f){(0,t.addClass)([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",o.expanded?"true":"false");var m=(0,t.createElement)("span",{className:"e-icons"}),y=void 0;if(this.parent.initialRender)y=o.expanded&&((0,t.isNullOrUndefined)(o[this.parent.expandStateMapping])||o[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll;else if(y=!(!o.expanded||!ot(this.parent,o,this.parent.grid.getCurrentViewRecords())),"Cell"===this.parent.editSettings.mode&&!et(this.parent)){var S=this.parent.flatData.find((function(e){return e.uniqueID===o.uniqueID}));(0,t.isNullOrUndefined)(S)||(y=o.expanded!==S.expanded?S.expanded:o.expanded)}(0,t.addClass)([m],y?"e-treegridexpand":"e-treegridcollapse"),s+=18,c.appendChild(m),u.style.width="4px",s+=7,c.appendChild(u.cloneNode())}else(a||!a&&!o.level)&&(s+=20,c.appendChild(u.cloneNode()),c.appendChild(u.cloneNode()));r=(0,t.createElement)("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(r.style.width="Calc(100% - "+s+"px)"),(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level),this.updateTreeCell(e,r),c.appendChild(r),e.cell.appendChild(c)}if(n.getFrozenLeftColumnsCount()>0||n.getFrozenRightColumnsCount()>0){var v=n.getFrozenRightColumns(),w=n.getFrozenLeftColumns(),I=n.getMovableColumns();(v.length>0&&v[0].field===e.column.field||w.length>0&&w[0].field===e.column.field||I.length>0&&I[0].field===e.column.field)&&(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level)}else(h>this.parent.treeColumnIndex&&h>0&&n.getColumnIndexByUid(e.column.uid)===h||h<this.parent.treeColumnIndex&&h>0&&(n.getColumnIndexByUid(e.column.uid)===h||n.getColumnIndexByUid(e.column.uid)===h-1)||h===this.parent.treeColumnIndex&&h>0&&n.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1)&&(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level);if(!(0,t.isNullOrUndefined)(d)&&d.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)){var R=e.cell.querySelectorAll(".e-frame")[0];s+=parseInt(R.style.width,16),s+=10,(r=n.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+s+"px)"}if(p){(0,t.addClass)([e.cell],"e-summarycell");var x=(0,l.getObject)(e.column.field,e.data);x=(0,t.isNullOrUndefined)(x)?null:x,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=x:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=x}this.parent.args=e;var C=(0,t.getValue)("columnModel",this.parent)[this.parent.treeColumnIndex];if((0,t.isNullOrUndefined)(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template)this.parent.trigger(P,e);else if(this.parent.isReact&&C.field!==e.column.field){var b=this;b.parent.renderReactTemplates((function(){b.parent.trigger(P,e)}))}}},e.prototype.updateTreeCell=function(e,i){var r=(0,t.getValue)("columnModel",this.parent)[this.parent.treeColumnIndex],n="templateFn",o=e.column.index;(0,t.isNullOrUndefined)(r.field)&&e.cell.setAttribute("aria-colindex",o+1+""),r.field!==e.column.field||(0,t.isNullOrUndefined)(r.template)||(e.column.template=r.template,e.column[""+n]=(0,l.templateCompiler)(e.column.template),e.cell.classList.add("e-templatecell"));var a=null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML:e.cell.innerHTML;if("object"==typeof e.column.template&&this.templateResult)(0,l.appendChildren)(i,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var s=e.cell.children.length,d=this.parent.element.id+e.column.uid;if(r.field!==e.column.field||(0,t.isNullOrUndefined)(r.template))for(;0<s;s=e.cell.children.length)i.appendChild(e.cell.children[parseInt((0).toString(),10)]);else{var p="portals";if(this.parent.isReact&&"string"!=typeof e.column.template){e.column[""+n](e.data,this.parent,"columnTemplate",d,null,null,i),(0,t.isNullOrUndefined)(this.parent.grid[""+p])&&(this.parent.grid[""+p]=this.parent[""+p]),this.parent.notify("renderReactTemplate",this.parent[""+p]);var h=this;h.parent.renderReactTemplates((function(){h.parent.trigger(P,e)}))}else{var c=e.column[""+n]((0,l.extend)({index:""},e.data),this.parent,"template",d,this.parent.isStringTemplate);(0,l.appendChildren)(i,c)}delete e.column.template,delete e.column[""+n],e.cell.innerHTML=""}}else i.innerHTML=a,e.cell.innerHTML=""},e.prototype.refreshReactColumnTemplateByUid=function(e){var i=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,(function(){var r=i.parent.grid.getRowsObject(),n=i.parent.getDataRows(),o=i.parent.grid.getIndentCount(),a=i.parent.grid.getNormalizedColumnIndex(e);if(0!==n.length)for(var s=0;s<r.length;s++)if(r[parseInt(s.toString(),10)].isDataRow&&!(0,t.isNullOrUndefined)(r[parseInt(s.toString(),10)].index)){var d=r[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)],p=new l.CellRenderer(i.parent.grid,i.parent.grid.serviceLocator),h=n.length>=r.length?i.parent.getCellFromIndex(r[parseInt(s.toString(),10)].index,a-o):n[r[parseInt(s.toString(),10)].index].querySelector(".e-templatecell");p.refreshTD(h,d,r[parseInt(s.toString(),10)].data,{index:r[parseInt(s.toString(),10)].index});var c=i.parent.getRows()[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)];i.cellRender({data:r[parseInt(s.toString(),10)].data,cell:c,column:d.column})}}))},e.prototype.columnTemplateResult=function(e){this.templateResult=e.template},e.prototype.reactTemplateRender=function(e,t){var i="portals";this.parent[""+i]=e,this.parent.notify("renderReactTemplate",this.parent[""+i]),this.parent.renderReactTemplates(t)},e.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)},e}(),Ct=function(){function e(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!(0,t.isNullOrUndefined)(this.parent.parentIdMapping)}return e.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on(Q,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Q,this.collectExpandingRecs),this.parent.off("updateRemoteLevel",this.updateParentRemoteData),this.parent.off("updateAction",this.updateData),this.parent.off("dataProcessor",this.dataProcessor),this.parent.grid.off("sorting-begin",this.beginSorting))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.isRemote=function(){return this.parent.dataSource instanceof Ze.DataManager},e.prototype.convertToFlatData=function(e){var i=this;if(this.parent.flatData=(0,t.isNullOrUndefined)(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof Ze.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],et(this.parent)&&!st(this.parent)&&e instanceof Ze.DataManager&&!(e instanceof Array)){var r=this.parent.dataSource;if(this.parent.parentIdMapping){if(this.parent.query=(0,t.isNullOrUndefined)(this.parent.query)?new Ze.Query:this.parent.query,this.parent.parentIdMapping){var n=this.parent.query.params.filter((function(e){return"IdMapping"===e.key}));this.parent.initialRender&&!n.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping))}if(!this.parent.hasChildMapping){var o=this.parent.query.clone();o.queries=[],(o=o.select([this.parent.parentIdMapping])).isCountRequired=!0,r.executeQuery(o).then((function(e){i.parentItems=Ze.DataUtil.distinct(e.result,i.parent.parentIdMapping,!1),0===(e.result?0:1)&&((0,t.setValue)("grid.contentModule.isLoaded",!0,i.parent),(0,t.isNullOrUndefined)(i.zerothLevelData)||((0,t.setValue)("cancel",!1,i.zerothLevelData),(0,t.getValue)("grid.renderModule",i.parent).dataManagerSuccess(i.zerothLevelData),i.zerothLevelData=null),i.parent.grid.hideSpinner())}))}}}else e instanceof Array&&this.convertJSONData(e)},e.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var i=Object.keys(e),r=0;r<i.length;r++){var n=e[parseInt(r.toString(),10)];this.hierarchyData.push((0,t.extend)({},n)),(0,t.isNullOrUndefined)(n[this.parent.idMapping])||this.taskIds.push(n[this.parent.idMapping])}els