@syncfusion/ej2-treegrid
Version:
Essential JS 2 TreeGrid Component
10 lines • 346 kB
JavaScript
/*!
* filename: ej2-treegrid.umd.min.js
* version : 30.1.38
* 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&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-popups")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-grids","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-popups"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Grids,e.ej2Buttons,e.ej2Data,e.ej2Popups)}(this,function(r,C,w,T,b,V){"use strict";B=function(e,t){return(B=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var B,z=function(e,t){function i(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},L=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;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},F=(j.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)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)},j);function j(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={},C.merge(this,e)}z(H,_=F),L([C.Property(null)],H.prototype,"columns",void 0);var _,L=H;function H(){return null!==_&&_.apply(this,arguments)||this}z(Q,G=L);var G,z=Q;function Q(){return null!==G&&G.apply(this,arguments)||this}K=function(e,t){return(K=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var K,W,Y=function(e,t){function i(){this.constructor=e}K(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},J=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;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},Y=(W=C.ChildProperty,Y(X,W),J([C.Property("Spinner")],X.prototype,"indicatorType",void 0),X);function X(){return null!==W&&W.apply(this,arguments)||this}$=function(e,t){return($=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var $,Z,J=function(e,t){function i(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=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;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},ee=(Z=C.ChildProperty,J(t,Z),e([C.Property()],t.prototype,"field",void 0),e([C.Property()],t.prototype,"operator",void 0),e([C.Property()],t.prototype,"value",void 0),e([C.Property()],t.prototype,"matchCase",void 0),e([C.Property()],t.prototype,"ignoreAccent",void 0),e([C.Property()],t.prototype,"predicate",void 0),e([C.Property({})],t.prototype,"actualFilterValue",void 0),e([C.Property({})],t.prototype,"actualOperator",void 0),e([C.Property()],t.prototype,"type",void 0),e([C.Property()],t.prototype,"ejpredicate",void 0),e([C.Property()],t.prototype,"uid",void 0),e([C.Property()],t.prototype,"isForeignKey",void 0),t);function t(){return null!==Z&&Z.apply(this,arguments)||this}te=C.ChildProperty,J(i,te),e([C.Collection([],ee)],i.prototype,"columns",void 0),e([C.Property("FilterBar")],i.prototype,"type",void 0),e([C.Property()],i.prototype,"mode",void 0),e([C.Property(!0)],i.prototype,"showFilterBarStatus",void 0),e([C.Property(1500)],i.prototype,"immediateModeDelay",void 0),e([C.Property()],i.prototype,"operators",void 0),e([C.Property(!1)],i.prototype,"ignoreAccent",void 0),e([C.Property("Parent")],i.prototype,"hierarchyMode",void 0);var te,J=i;function i(){return null!==te&&te.apply(this,arguments)||this}ie=function(e,t){return(ie=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ie,re,e=function(e,t){function i(){this.constructor=e}ie(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},ne=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;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},e=(re=C.ChildProperty,e(oe,re),ne([C.Property("Both")],oe.prototype,"wrapMode",void 0),oe);function oe(){return null!==re&&re.apply(this,arguments)||this}var ae,se,ne=function(e,t){function i(){this.constructor=e}ae(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},de="https://ej2.syncfusion.com/documentation/treegrid",le="https://ej2.syncfusion.com/documentation",pe=!(ae=function(e,t){return(ae=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)}),he=(se=w.Logger,ne(ce,se),ce.prototype.getModuleName=function(){return"logger"},ce.prototype.log=function(e,t){for(var i=e=e instanceof Array?e:[e],r=0;r<i.length;r++){var n,o=w.detailLists[i[parseInt(r.toString(),10)]],a=o.check(t,this.parent);a.success&&(a=(a=o.generateMessage(t,this.parent,a.options)).replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),pe&&"primary_column_missing"===i[parseInt(r.toString(),10)]&&(a=a.replace("Editing","Row DragAndDrop"),pe=!1),n=a.indexOf("https"),n=a.substring(n),"module_missing"===i[parseInt(r.toString(),10)]?a=a.replace(n,de+"/modules"):"primary_column_missing"===i[parseInt(r.toString(),10)]||"selection_key_missing"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===i[parseInt(r.toString(),10)]?a=a.replace(n,de+"/edit"):"virtual_height"===i[parseInt(r.toString(),10)]?a=a.replace(n,de+"/virtual"):"check_datasource_columns"===i[parseInt(r.toString(),10)]?a=a.replace(n,de+"/columns"):"locale_missing"===i[parseInt(r.toString(),10)]&&(a=a.replace(n,de+"/global-local/#localization")),"datasource_syntax_mismatch"===i[parseInt(r.toString(),10)]&&(C.isNullOrUndefined(this.treeGridObj)||C.isNullOrUndefined(this.treeGridObj.dataStateChange))||console[o.logType](a))}},ce.prototype.treeLog=function(e,t,i){this.treeGridObj=i;var r=e=e instanceof Array?e:[e];i.allowRowDragAndDrop&&!i.columns.filter(function(e){return e.isPrimaryKey}).length&&(pe=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=fe[r[parseInt(n.toString(),10)]],a=o.check(t,i);a.success&&(a=o.generateMessage(t,i,a.options),console[o.logType](a))}},ce);function ce(e){return w.Grid.Inject(w.Logger),se.call(this,e)||this}var ue,ge,fe={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,t){var i={success:!1};return i=C.isNullOrUndefined(t.idMapping)&&C.isNullOrUndefined(t.childMapping)&&C.isNullOrUndefined(t.parentIdMapping)||!C.isNullOrUndefined(t.idMapping)&&C.isNullOrUndefined(t.parentIdMapping)||C.isNullOrUndefined(t.idMapping)&&!C.isNullOrUndefined(t.parentIdMapping)?{success:!0}:i},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"+le+"/api/treegrid#childmapping\n"+le+"/api/treegrid#idmapping\n"+le+"/api/treegrid#$parentidmapping"}}},me="load",ye="rowDataBound",Se="dataBound",we="queryCellInfo",Ie="beforeDataBound",Re="actionBegin",ve="dataStateChange",xe="actionComplete",Ce="rowSelecting",be="rowSelected",De="checkboxChange",Me="rowDeselected",Oe="toolbarClick",Pe="beforeExcelExport",Ae="beforePdfExport",Ee="resizeStop",Ne="expanded",Ue="expanding",ke="collapsed",qe="collapsing",Te="remoteExpand",Ve="localPagedExpandCollapse",Be="pagingActions",ze="printGrid-Init",Le="contextMenuOpen",Fe="contextMenuClick",je="beforeCopy",_e="beforePaste",He="crudAction",Ge="beginEdit",Qe="beginAdd",Ke="recordDoubleClick",We="cellSave",Ye="cellSaved",Je="cellEdit",Xe="batchDelete",$e="batchCancel",Ze="batchAdd",et="beforeBatchDelete",tt="beforeBatchAdd",it="beforeBatchSave",rt="batchSave",nt="key-pressed",ot="double-tap",at="virtual-action-args",st="destroy",dt="data-listener",lt="index-modifier",pt="edit-form",ht="before-batch-cancel",ct="detailDataBound",ut="rowDrag",gt="rowDragStartHelper",ft="rowDrop",mt="rowDragStart",yt="rows-add",St="rows-remove",wt="row-draging",It="row-dropped",Rt="auto-col",vt="rowDeselecting",xt="e-movablecontent",Ct="e-frozencontent",bt="aria-rowindex",Dt="actionFailure",ne=(ue=function(e,t){return(ue=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)},function(e,t){function i(){this.constructor=e}ue(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Mt=(ge=w.Clipboard,ne(Ot,ge),Ot.prototype.setCopyData=function(e){var t="copyContent",i="getCopyData",r=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this[t]="";var n=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var o=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),a=0;a<o.length;a++){0<a&&(this.treeCopyContent+="\n");var s,d,l=o[parseInt(a.toString(),10)];n[l].classList.contains("e-summaryrow")||(s=[].slice.call(n[l].querySelectorAll(".e-rowcell")),d=this.treeGridParent.getSelectedRecords()[parseInt(a.toString(),10)].uniqueID,-1===this.copiedUniqueIdCollection.indexOf(d)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(r,l,n,e,a),this[i](s,!1,"\t",e),this.treeCopyContent+=this[t],this.copiedUniqueIdCollection.push(d),this[t]="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(r,o[parseInt(a.toString(),10)],n,e)))}e&&(p=this.treeGridParent.getVisibleColumns().map(function(e){return e.headerText}),this[i](p,!1,"\t",e),this.treeCopyContent=this[t]+"\n"+this.treeCopyContent);var p={data:this.treeCopyContent,cancel:!1};this.treeGridParent.trigger(je,p),p.cancel||(this.clipBoardTextArea.value=this[t]=p.data,C.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 ge.prototype.setCopyData.call(this,e)}},Ot.prototype.parentContentData=function(e,t,i,r,n){var o="copyContent",a="parentItem",s="uniqueID";if(!C.isNullOrUndefined(e[parseInt(t.toString(),10)][a]))for(var d=e[parseInt(t.toString(),10)][a].level,l=0;l<d+1;l++)for(var p=0;p<e.length;p++)if(!C.isNullOrUndefined(e[parseInt(t.toString(),10)][a])&&e[parseInt(p.toString(),10)][s]===e[parseInt(t.toString(),10)][a][s]){t=p;var h=[].slice.call(i[parseInt(t.toString(),10)].querySelectorAll(".e-rowcell")),c=e[parseInt(p.toString(),10)][s];if(-1===this.copiedUniqueIdCollection.indexOf(c)){this.getCopyData(h,!1,"\t",r),this.treeCopyContent=0<n?this.treeCopyContent+this[o]+"\n":this[o]+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(c),this[o]="";break}}},Ot.prototype.copy=function(e){ge.prototype.copy.call(this,e)},Ot.prototype.paste=function(e,t,i){ge.prototype.paste.call(this,e,t,i)},Ot.prototype.getModuleName=function(){return"clipboard"},Ot.prototype.destroy=function(){ge.prototype.destroy.call(this)},Ot.prototype.childContentData=function(e,t,i,r){var n="copyContent",o="uniqueID";if(e[parseInt(t.toString(),10)].hasChildRecords)for(var a=e[parseInt(t.toString(),10)].childRecords,s=0;s<a.length;s++)for(var d,l,p=0;p<e.length;p++)if(!C.isNullOrUndefined(a[parseInt(s.toString(),10)][o])&&e[parseInt(p.toString(),10)][o]===a[parseInt(s.toString(),10)][o]){C.isNullOrUndefined(i[parseInt(p.toString(),10)])||i[parseInt(p.toString(),10)].classList.contains("e-summaryrow")||(d=[].slice.call(i[parseInt(p.toString(),10)].querySelectorAll(".e-rowcell")),l=e[parseInt(p.toString(),10)][o],-1===this.copiedUniqueIdCollection.indexOf(l)&&(this.getCopyData(d,!1,"\t",r),this.treeCopyContent+="\n"+this[n],this[n]="",this.copiedUniqueIdCollection.push(l),this.childContentData(e,p,i,r)));break}},Ot);function Ot(e,t){var i=ge.call(this,e.grid,t)||this;return i.treeCopyContent="",i.copiedUniqueIdCollection=[],i.treeGridParent=e,i.serviceLocator=t,i}function S(e){return e.dataSource instanceof b.DataManager&&((e=e.dataSource.adaptor)instanceof b.ODataAdaptor||e instanceof b.WebApiAdaptor||e instanceof b.WebMethodAdaptor||e instanceof b.CacheAdaptor||e instanceof b.UrlAdaptor)}function I(e){return!!(e.dataSource&&"result"in e.dataSource)}function Pt(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function At(e){return!((C.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 Et(e){for(var t=[],i=0,r=Object.keys(e).length;i<r;i++)w.getObject("hasChildRecords",e[parseInt(i.toString(),10)])&&t.push(e[parseInt(i.toString(),10)]);return t}function y(e,t,i){var r,t=C.isNullOrUndefined(t.parentItem)?null:x(e,t.parentItem.uniqueID);return null==t||(!e.initialRender||C.isNullOrUndefined(t[e.expandStateMapping])||t[e.expandStateMapping]?!1!==t.expanded&&(!t.parentItem||((r=x(e,t.parentItem.uniqueID))&&e.initialRender&&!C.isNullOrUndefined(r[e.expandStateMapping])&&!r[e.expandStateMapping]?r.expanded=!1:(!r||!1!==r.expanded)&&(!r||y(e,r)))):t.expanded=!1)}function R(e){var t=[];if(C.isNullOrUndefined(e)||!e.hasChildRecords&&!C.isNullOrUndefined(e.childRecords)&&!e.childRecords.length)return[];if(!C.isNullOrUndefined(e.childRecords))for(var i=e.childRecords.filter(function(e){return!e.isSummaryRow}),r=0,n=Object.keys(i).length;r<n;r++)t.push(i[parseInt(r.toString(),10)]),(i[parseInt(r.toString(),10)].hasChildRecords||!C.isNullOrUndefined(i[parseInt(r.toString(),10)].childRecords)&&i[parseInt(r.toString(),10)].childRecords.length)&&(t=t.concat(R(i[parseInt(r.toString(),10)])));return t}function v(e){return!S(e)||(e=e.dataSource,!C.isNullOrUndefined(e.ready))}function D(e){for(var t=[],i=0;e&&i<e.length;i++){for(var r=Object.keys(e[parseInt(i.toString(),10)]),n={},o=0;o<r.length;o++)n[r[parseInt(o.toString(),10)]]=e[parseInt(i.toString(),10)][r[parseInt(o.toString(),10)]];t.push(n)}return t}function Nt(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 x(e,t,i){return(i?e.uniqueIDFilterCollection:e.uniqueIDCollection)[""+t]}function Ut(e){e=window.getComputedStyle(e);return"none"===e.display||"hidden"===e.visibility}n.prototype.getModuleName=function(){return"selection"},n.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)},n.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))},n.prototype.destroy=function(){this.removeEventListener()},n.prototype.checkboxSelection=function(e){var t,i,e=w.getObject("target",e),r=w.parentsUntil(e,"e-checkbox-wrapper");r&&0<r.querySelectorAll(".e-treecheckselect").length?(t=r.querySelector('input[type="checkbox"]'),(i=[]).push(e.closest("tr").rowIndex),this.selectCheckboxes(i),this.triggerChkChangeEvent(t,t.nextElementSibling.classList.contains("e-check"),e.closest("tr"))):r&&0<r.querySelectorAll(".e-treeselectall").length&&this.parent.autoCheckHierarchy&&(i=!r.querySelector(".e-frame").classList.contains("e-check")&&!r.querySelector(".e-frame").classList.contains("e-stop"),this.headerSelection(i),t=r.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(t,i,e.closest("tr"))),!C.isNullOrUndefined(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&0<this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length&&S(this.parent)&&0<this.parent.parentQuery.length&&((r=this.parent.query.queries).push.apply(r,this.parent.parentQuery),this.parent.parentQuery=[])},n.prototype.triggerChkChangeEvent=function(e,t,i){var r=this.parent.getCurrentViewRecords()[i.rowIndex],t={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():r};this.parent.trigger(De,t)},n.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},n.prototype.headerCheckbox=function(){var e,t,i;this.columnIndex=this.getCheckboxcolumnIndex(),-1<this.columnIndex&&0===this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length?(e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex],i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}}),(t=T.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),t.insertBefore(i.cloneNode(),t.firstChild),C.isNullOrUndefined(e)||e.insertBefore(t,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()):-1<this.columnIndex&&0<this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length&&(i=(t=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0]).querySelector(".e-frame").classList.contains("e-check"),this.parent.autoCheckHierarchy)&&i&&this.headerSelection(i)},n.prototype.renderColumnCheckbox=function(e){var t=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),i=e.data,e=(e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox"),!C.isNullOrUndefined(i.checkboxState)&&"uncheck"!==i.checkboxState),e=T.createCheckBox(this.parent.createElement,!1,{checked:e,label:" "});return e.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(e.querySelector(".e-frame").style.width="18px"),"indeterminate"===i.checkboxState&&(i=e.querySelectorAll(".e-frame")[0],C.removeClass([i],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-stop")),e.insertBefore(t.cloneNode(),e.firstChild),e},n.prototype.columnCheckbox=function(e){var t,i,r=this.renderColumnCheckbox(e),n=e.cell.querySelector(".e-treecolumn-container");C.isNullOrUndefined(n)?(t=this.parent.createElement("span",{className:"e-treecheckbox"}),i=e.cell.innerHTML,e.cell.innerHTML="",t.innerHTML=i,(i=this.parent.createElement("div",{className:"e-treecheckbox-container"})).appendChild(r),i.appendChild(t),e.cell.appendChild(i)):e.cell.querySelector(".e-hierarchycheckbox")||n.insertBefore(r,n.querySelectorAll(".e-treecell")[0])},n.prototype.selectCheckboxes=function(e){C.isNullOrUndefined(e)&&this.parent.trigger(Dt,{error:"The provided value for the rowIndexes is undefined. Please ensure the rowIndexes contains number."});for(var t=0;t<e.length;t++){for(var i=this.parent.getCurrentViewRecords()[e[parseInt(t.toString(),10)]],r=x(this.parent,i.uniqueID),n="uncheck"===(i=r).checkboxState?"check":"uncheck",o=(i.checkboxState=n,Object.keys(i)),a=0;a<o.length;a++)Object.prototype.hasOwnProperty.call(r,o[parseInt(a.toString(),10)])&&(r[o[parseInt(a.toString(),10)]]=i[o[parseInt(a.toString(),10)]]);this.traverSelection(i,n,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},n.prototype.traverSelection=function(e,t,i){if(this.updateSelectedItems(e,t),!i&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy)for(var r=e.childRecords,n=(r=!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.parent.autoCheckHierarchy?this.getFilteredChildRecords(r):r).length,o=0;o<n;o++)r[parseInt(o.toString(),10)].isSummaryRow||(r[parseInt(o.toString(),10)].hasChildRecords?this.traverSelection(r[parseInt(o.toString(),10)],t,!0):this.updateSelectedItems(r[parseInt(o.toString(),10)],t))},n.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return-1<t.parent.filterModule.filteredResult.indexOf(e)})},n.prototype.updateParentSelection=function(e){var t,i=[],e=x(this.parent,e.uniqueID),r=(e&&e.childRecords&&(i=e.childRecords),t=(i=!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.parent.autoCheckHierarchy?this.getFilteredChildRecords(i):i)&&i.length,0),n=0;if(!C.isNullOrUndefined(e)){for(var o=0;o<i.length;o++){var a=x(this.parent,i[parseInt(o.toString(),10)].uniqueID);C.isNullOrUndefined(a)||("indeterminate"===a.checkboxState?r++:"check"===a.checkboxState&&n++)}0<r||0<n&&n!==t?e.checkboxState="indeterminate":(0!==n||e.hasFilteredChildRecords&&!C.isNullOrUndefined(e.hasFilteredChildRecords)||C.isNullOrUndefined(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==e.checkboxState)&&(0===n&&0===r||0===n&&e.hasFilteredChildRecords&&!C.isNullOrUndefined(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===e.checkboxState)?e.checkboxState="uncheck":e.checkboxState="check",this.updateSelectedItems(e,e.checkboxState),e.parentItem&&this.updateParentSelection(e.parentItem)}},n.prototype.headerSelection=function(e){var t,i=this,r=!1;if(!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&(o=this.parent.filterModule.filteredResult,0===this.filteredList.length&&(this.filteredList=o),this.parent.grid.searchSettings.key.length?this.searchingRecords=o:r=this.filteredList!==o&&(this.filteredList=o,!0)),0<this.filteredList.length&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length)&&!C.isNullOrUndefined(e)&&(this.filteredList=this.searchingRecords),t=!C.isNullOrUndefined(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&0<this.parent.filterSettings.columns.length||!C.isNullOrUndefined(this.parent.filterModule)&&0<this.filteredList.length?this.filteredList:this.parent.flatData,t=S(this.parent)?this.parent.getCurrentViewRecords():t,!C.isNullOrUndefined(e))for(var n=0;n<t.length;n++)e?"check"===t[parseInt(n.toString(),10)].checkboxState||r||(t[parseInt(n.toString(),10)].checkboxState="check",this.updateSelectedItems(t[parseInt(n.toString(),10)],t[parseInt(n.toString(),10)].checkboxState)):-1<this.selectedItems.indexOf(t[parseInt(n.toString(),10)])&&(t[parseInt(n.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(t[parseInt(n.toString(),10)],t[parseInt(n.toString(),10)].checkboxState),this.parent.autoCheckHierarchy)&&this.updateParentSelection(t[parseInt(n.toString(),10)]);!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],t.filter(function(e){e.checkboxState="uncheck",i.updateSelectedItems(e,e.checkboxState)}));var o=this.selectedItems.length,a=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];0<o&&0<t.length?o===t.length||e?(C.removeClass([a],["e-stop"]),a.classList.add("e-check")):(C.removeClass([a],["e-check"]),a.classList.add("e-stop")):C.removeClass([a],["e-check","e-stop"])},n.prototype.updateSelectedItems=function(t,e){var i,r=this.parent.grid.currentViewData.filter(function(e){return e.uniqueID===t.uniqueID}),r=this.parent.grid.currentViewData.indexOf(r[0]),n=x(this.parent,t.uniqueID),o=this.parent.getRows()[parseInt(r.toString(),10)],n=(-1<r&&(i=void 0,(this.parent.frozenRows||this.parent.getFrozenColumns())&&(i=this.parent.getDataRows()[parseInt(r.toString(),10)]),i=(o.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?o:i).querySelectorAll(".e-hierarchycheckbox .e-frame")[0],C.isNullOrUndefined(i)||C.removeClass([i],["e-check","e-stop","e-uncheck"])),"check"===((n=C.isNullOrUndefined(n=n)?t:n).checkboxState=e)&&C.isNullOrUndefined(t.isSummaryRow)?(-1!==r&&-1===this.selectedIndexes.indexOf(r)&&this.selectedIndexes.push(r),-1===this.selectedItems.indexOf(n)&&-1!==r&&!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.selectedItems.push(n),-1===this.selectedItems.indexOf(n)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&this.selectedItems.push(n),-1!==this.selectedItems.indexOf(n)||C.isNullOrUndefined(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(n),-1===this.selectedItems.indexOf(n)&&C.isNullOrUndefined(this.parent.filterModule)&&this.selectedItems.push(n)):"uncheck"!==e&&"indeterminate"!==e||!C.isNullOrUndefined(t.isSummaryRow)||(-1!==(n=this.selectedItems.indexOf(n))&&this.selectedItems.splice(n,1),-1!==this.selectedIndexes.indexOf(r)&&(n=this.selectedIndexes.indexOf(r),this.selectedIndexes.splice(n,1))),"indeterminate"===e?"e-stop":"e-"+e);-1<r&&(C.isNullOrUndefined(i)||(i.classList.add(n),o.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===e?"true":"uncheck"===e?"false":"mixed")))},n.prototype.updateGridActions=function(e){var r=this,t=e.requestType;if(Pt(this.parent))if(this.parent.autoCheckHierarchy)if("sorting"===t||"paging"===t){var i,n=this.parent.grid.getRows(),o=(i=this.parent.getCurrentViewRecords()).length;this.selectedIndexes=[];for(var a=0;a<o;a++)n[parseInt(a.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(a.toString(),10)],i[parseInt(a.toString(),10)].checkboxState)}else if("delete"===t||"add"===e.action){var s=[];"delete"===t?s=e.data:s.push(e.data);for(var d,a=0;a<s.length;a++)"delete"===t&&(d=this.parent.flatData.indexOf(s[parseInt(a.toString(),10)]),d=this.selectedIndexes.indexOf(d),this.selectedIndexes.splice(d,1),this.updateSelectedItems(s[parseInt(a.toString(),10)],"uncheck")),C.isNullOrUndefined(s[parseInt(a.toString(),10)].parentItem)||this.updateParentSelection(s[parseInt(a.toString(),10)].parentItem)}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":"filtering"!==t&&"searching"!==t&&("refresh"!==t||S(this.parent))||(this.selectedItems=[],this.selectedIndexes=[],(i=!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length?this.parent.filterModule.filteredResult:this.parent.flatData).forEach(function(e){if(r.parent.enableVirtualization){e.hasChildRecords&&0<e.childRecords.length?r.updateParentSelection(e):r.updateSelectedItems(e,e.checkboxState);for(var t=R(e),t=r.getFilteredChildRecords(t),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].hasChildRecords?r.updateParentSelection(t[parseInt(i.toString(),10)]):t[parseInt(i.toString(),10)].hasChildRecords||C.isNullOrUndefined(t[parseInt(i.toString(),10)])||r.updateSelectedItems(t[parseInt(i.toString(),10)],t[parseInt(i.toString(),10)].checkboxState)}else e.hasChildRecords?r.updateParentSelection(e):r.updateSelectedItems(e,e.checkboxState)}),this.headerSelection());else"filtering"!==t&&"searching"!==t&&"refresh"!==t||S(this.parent)||(this.selectedItems=[],this.selectedIndexes=[])},n.prototype.getCheckedrecords=function(){return this.selectedItems},n.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes};var kt=n;function n(e){this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}Tt.prototype.getModuleName=function(){return"print"},Tt.prototype.addEventListener=function(){this.parent.grid.on(ze,this.printTreeGrid,this)},Tt.prototype.removeEventListener=function(){this.parent.grid.off(ze,this.printTreeGrid)},Tt.prototype.printTreeGrid=function(e){var t=w.getObject("printgrid",e),e=w.getObject("element",e);t.addEventListener(we,this.parent.grid.queryCellInfo),t.addEventListener(ye,this.parent.grid.rowDataBound),t.addEventListener(Ie,this.parent.grid.beforeDataBound),C.addClass([e],"e-treegrid")},Tt.prototype.print=function(){this.parent.grid.print()},Tt.prototype.destroy=function(){this.removeEventListener()};var qt=Tt;function Tt(e){this.parent=e,w.Grid.Inject(w.Print),this.addEventListener()}Vt=function(e,t){return(Vt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Vt,Bt,ne=function(e,t){function i(){this.constructor=e}Vt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},zt=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;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},ne=(Bt=C.ChildProperty,ne(Lt,Bt),zt([C.Property()],Lt.prototype,"fields",void 0),zt([C.Property(!1)],Lt.prototype,"ignoreCase",void 0),zt([C.Property("contains")],Lt.prototype,"operator",void 0),zt([C.Property()],Lt.prototype,"key",void 0),zt([C.Property()],Lt.prototype,"hierarchyMode",void 0),Lt);function Lt(){return null!==Bt&&Bt.apply(this,arguments)||this}Ft=function(e,t){return(Ft=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ft,jt,zt=function(e,t){function i(){this.constructor=e}Ft(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},o=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;0<=s;s--)(n=e[s])&&(a=(o<3?n(a):3<o?n(t,i,a):n(t,i))||a);return 3<o&&a&&Object.defineProperty(t,i,a),a},zt=(jt=C.ChildProperty,zt(_t,jt),o([C.Property("Row")],_t.prototype,"mode",void 0),o([C.Property("Flow")],_t.prototype,"cellSelectionMode",void 0),o([C.Property("Single")],_t.prototype,"type",void 0),o([C.Property(!1)],_t.prototype,"persistSelection",void 0),o([C.Property("Default")],_t.prototype,"checkboxMode",void 0),o([C.Property(!1)],_t.prototype,"checkboxOnly",void 0),o([C.Property(!0)],_t.prototype,"enableToggle",void 0),_t);function _t(){return null!==jt&&jt.apply(this,arguments)||this}Gt.prototype.RowModifier=function(t){var i,r,e,n;t.data&&(e=(i=t.data).parentItem,C.isNullOrUndefined(i.parentItem)||At(this.parent)||this.parent.allowPaging&&"Root"!==this.parent.pageSettings.pageSizeMode&&(!S(this.parent)||v(this.parent))||(!this.parent.initialRender||(C.isNullOrUndefined(e[this.parent.expandStateMapping])||e[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll)&&y(this.parent,t.data,this.parent.grid.getCurrentViewRecords())||C.isNullOrUndefined(t.row)||(this.parent.toggleRowVisibility(t.row,"e-childrow-hidden"),e=this.parent.grid.getRowsObject(),this.parent.grid.isFrozenGrid())||C.isNullOrUndefined(t.row.getAttribute("data-uid"))||(e.filter(function(e){return e.uid===t.row.getAttribute("data-uid")})[0].visible=!1),S(this.parent)&&!v(this.parent)&&(r=this.parent,0<(e=this.parent.getCurrentViewRecords().filter(function(e){return C.getValue(r.idMapping,e)===C.getValue(r.parentIdMapping,i)})).length)&&!e[0].isSummaryRow&&!C.isNullOrUndefined(t.row)&&(e=e[0].expanded?"e-childrow-visible":"e-childrow-hidden",this.parent.toggleRowVisibility(t.row,e)),w.getObject("isSummaryRow",t.data)&&C.addClass([t.row],"e-summaryrow"),C.isNullOrUndefined(t.row)||(t.row.querySelector(".e-treegridexpand")?t.row.setAttribute("aria-expanded","true"):t.row.querySelector(".e-treegridcollapse")&&t.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&(C.isNullOrUndefined(i.parentItem)||this.parent.toggleRowVisibility(t.row,"e-childrow-hidden"))),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!==t.data.uniqueID||C.isNullOrUndefined(t.row)||t.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(t.row,!0)),this.parent.isReact?(n=this).parent.renderReactTemplates(function(){n.parent.trigger(ye,t)}):this.parent.trigger(ye,t))},Gt.prototype.cellRender=function(e){if(e.data){var t=this.parent.grid,i=e.data,r=C.isNullOrUndefined(i.filterLevel)?i.level:i.filterLevel,n=0,o=this.parent.getColumnByUid(e.column.uid),a=i.isSummaryRow,s=this.parent.getFrozenColumns(),d=(C.isNullOrUndefined(i.parentItem)?i:i.parentItem).index,l=this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):t.getColumnIndexByUid(e.column.uid);if(l!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!C.isNullOrUndefined(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var p=C.createElement("div",{className:"e-treecolumn-container"}),h=C.createElement("span",{className:"e-icons e-none"});h.style.width="10px",h.style.display="inline-block";for(var c=0;c<r;c++)n+=10,p.appendChild(h.cloneNode());var u,g,l=C.isNullOrUndefined(i.hasFilteredChildRecords)?i.hasChildRecords:i.hasFilteredChildRecords;(l=l&&!C.isNullOrUndefined(i.childRecords)?this.parent.isFromGantt&&this.parent.loadChildOnDemand?i.hasChildRecords:!(0===i.childRecords.length):l)?(C.addClass([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",i.expanded?"true":"false"),l=C.createElement("span",{className:"e-icons"}),g=void 0,this.parent.initialRender?g=i.expanded&&(C.isNullOrUndefined(i[this.parent.expandStateMapping])||i[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll:(g=!(!i.expanded||!y(this.parent,i,this.parent.grid.getCurrentViewRecords())),"Cell"!==this.parent.editSettings.mode||S(this.parent)||(u=this.parent.flatData.find(function(e){return e.uniqueID===i.uniqueID}),C.isNullOrUndefined(u))||(g=(i.expanded!==u.expanded?u:i).expanded)),C.addClass([l],g?"e-treegridexpand":"e-treegridcollapse"),n+=18,p.appendChild(l),h.style.width="4px",n+=7,p.appendChild(h.cloneNode())):!r&&i.level||(n+=20,p.appendChild(h.cloneNode()),p.appendChild(h.cloneNode())),u=C.createElement("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(u.style.width="Calc(100% - "+n+"px)"),C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level),this.updateTreeCell(e,u),p.appendChild(u),e.cell.appendChild(p)}0<t.getFrozenLeftColumnsCount()||0<t.getFrozenRightColumnsCount()?(g=t.getFrozenRightColumns(),l=t.getFrozenLeftColumns(),m=t.getMovableColumns(),(0<g.length&&g[0].field===e.column.field||0<l.length&&l[0].field===e.column.field||0<m.length&&m[0].field===e.column.field)&&C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level)):(s>this.parent.treeColumnIndex&&0<s&&t.getColumnIndexByUid(e.column.uid)===s||s<this.parent.treeColumnIndex&&0<s&&(t.getColumnIndexByUid(e.column.uid)===s||t.getColumnIndexByUid(e.column.uid)===s-1)||s===this.parent.treeColumnIndex&&0<s&&t.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1)&&C.addClass([e.cell],"e-gridrowindex"+d+"level"+i.level),!C.isNullOrUndefined(o)&&o.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)&&(g=e.cell.querySelectorAll(".e-frame")[0],n=n+parseInt(g.style.width,16)+10,(u=t.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+n+"px)"),a&&(C.addClass([e.cell],"e-summarycell"),l=w.getObject(e.column.field,e.data),l=C.isNullOrUndefined(l)?null:l,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=l:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=l),this.parent.args=e;var f,m=C.getValue("columnModel",this.parent)[this.parent.treeColumnIndex];C.isNullOrUndefined(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template?this.parent.trigger(we,e):this.parent.isReact&&m.field!==e.column.field&&(f=this).parent.renderReactTemplates(function(){f.parent.trigger(we,e)})}},Gt.prototype.updateTreeCell=function(e,t){var i=C.getValue("columnModel",this.parent)[this.parent.treeColumnIndex],r="templateFn",n=e.column.index,n=(C.isNullOrUndefined(i.field)&&e.cell.setAttribute("aria-colindex",n+1+""),i.field!==e.column.field||C.isNullOrUndefined(i.template)||(e.column.template=i.template,e.column[r]=w.templateCompiler(e.column.template),e.cell.classList.add("e-templatecell")),(null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell"):e.cell).innerHTML);if("object"==typeof e.column.template&&this.templateResult)w.appendChildren(t,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var o=e.cell.children.length,a=this.parent.element.id+e.column.uid;if(i.field!==e.column.field||C.isNullOrUndefined(i.template))for(;0<o;o=e.cell.children.length)t.appendChild(e.cell.children[parseInt(0..toString(),10)]);else{var s,i="portals";this.parent.isReact&&"string"!=typeof e.column.template?(e.column[r](e.data,this.parent,"columnTemplate",a,null,null,t),C.isNullOrUndefined(this.parent.grid[i])&&(this.parent.grid[i]=this.parent[i]),this.parent.notify("renderReactTemplate",this.parent[i]),(s=this).parent.renderReactTemplates(function(){s.parent.trigger(we,e)})):(i=e.column[r](w.extend({index:""},e.data),this.parent,"template",a,this.parent.isStringTemplate),w.appendChildren(t,i)),delete e.column.template,delete e.column[r],e.cell.innerHTML=""}}else t.innerHTML=n,e.cell.innerHTML=""},Gt.prototype.refreshReactColumnTemplateByUid=function(d){var l=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var e=l.parent.grid.getRowsObject(),t=l.parent.getDataRows(),i=l.parent.grid.getIndentCount(),r=l.parent.grid.getNormalizedColumnIndex(d);if(0!==t.length)for(var n,o,a,s=0;s<e.length;s++)e[parseInt(s.toString(),10)].isDataRow&&!C.isNullOrUndefined(e[parseInt(s.toString(),10)].index)&&(n=e[parseInt(s.toString(),10)].cells[parseInt(r.toString(),10)],a=new w.CellRenderer(l.parent.grid,l.parent.grid.serviceLocator),o=t.length>=e.length?l.parent.getCellFromIndex(e[parseInt(s.toString(),10)].index,r-i):t[e[parseInt(s.toString(),10)].index].querySelector(".e-templatecell"),a.refreshTD(o,n,e[parseInt(s.toString(),10)].data,{index:e[parseInt(s.toString(),10)].index}),a=l.parent.getRows()[parseInt(s.toString(),10)].cells[parseInt(r.toString(),10)],l.cellRender({data:e[parseInt(s.toString(),10)].data,cell:a,column:n.column}))})},Gt.prototype.columnTemplateResult=function(e){this.templateResult=e.template},Gt.prototype.reactTemplateRender=function(e,t){var i="portals";this.parent[i]=e,this.parent.notify("renderReactTemplate",this.parent[i]),this.parent.renderReactTemplates(t)},Gt.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)};var Ht=Gt;function Gt(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}a.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(Te,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},a.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Te,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))},a.prototype.destroy=function(){this.removeEventListener()},a.prototype.isRemote=function(){return this.parent.dataSource instanceof b.DataManager},a.prototype.convertToFlatData=function(e){var t,i,r=this;this.parent.flatData=C.isNullOrUndefined(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof b.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],S(this.parent)&&!v(this.parent)&&e instanceof b.DataManager&&!(e instanceof Array)?(t=this.parent.dataSource,this.parent.parentIdMapping&&(this.parent.query=C.isNullOrUndefined(this.parent.query)?new b.Query:this.parent.query,this.parent.parentIdMapping&&(i=this.parent.query.params.filter(function(e){return"IdMapping"===e.key}),this.parent.initialRender)&&!i.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping)),this.parent.hasChildMapping||((i=this.parent.query.clone()).queries=[],(i=i.select([this.parent.parentIdMapping])).isCountRequired=!0,t.executeQuery(i).then(function(e){r.parentItems=b.DataUtil.distinct(e.result,r.parent.parentIdMapping,!1),0===(e.result?0:1)&&(C.setValue("grid.contentModule.isLoaded",!0,r.parent),C.isNullOrUndefined(r.zerothLevelData)||(C.setValue("cancel",!1,r.zerothLevelData),C.getValue("grid.renderModule",r.parent).dataManagerSuccess(r.zerothLevelData),r.zerothLevelData=null),r.parent.grid.hideSpinner())})))):e instanceof Array&&this.convertJSONData(e)},a.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var t=Object.keys(e),i=0;i<t.length;i++){var r=e[parseInt(i.toString(),10)];this.hierarchyData.push(C.extend({},r)),C.isNullOrUndefined(r[this.parent.idMapping])||this.taskIds.push(r[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){for(var n=[],o=new b.DataManager(this.hierarchyData).executeLocal((new b.Query).group(this.parent.parentIdMapping)),i=0;i<o.length;i++){var a,s=o[parseInt(i.toString(),10)],d=this.taskIds.indexOf(s.key);!C.isNullOrUndefined(s.key)&&-1<d?(a=s.items,this.hierarchyData[parseInt(d.toString(),10)][this.parent.childMapping]=a):n.push.apply(n,s.items)}this.hierarchyData=this.selfReferenceUpdate(n)}var l;Object.keys(this.hierarchyData).length?this.createRecords(this.hierarchyData):(l=!(this.parent.dataSource instanceof b.DataManager)&&this.parent.isGantt,this.parent.flatData=l?this.parent.dataSource:[]),this.storedIndex=-1},a.prototype.selfReferenceUpdate=function(e){for(var t=[];0<this.hierarchyData.length&&0<e.length;){var i=e.indexOf(this.hierarchyData[0]);-1===i?this.hierarchyData.shift():(t.push(this.hierarchyData.shift()),e.splice(i,1))}return t},a.prototype.updateParentRemoteData=function(o){var a=this,e="actionArgs",s=(S(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===o[e].requestType&&this.parent.hideSpinner(),o.result);if(S(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===o[e].requestType||"clearFilter"===o[e].action||""===o[e].searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||!this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand)for(var d=this,t=0;t<s.length;t++)!function(t){var i,r,n,e;I(d.parent)&&s[parseInt(t.toString(),10)].hasChildRecords&&d.parent.initialRender&&(s[parseInt(t.toString(),10)].expanded=!1),S(d.parent)&&d.parent.enableVirtualization&&(i=[],r=d.parent,s.filter(function(e){e[""+r.parentIdMapping]===s[parseInt(t.toString(),10)][""+r.idMapping]&&i.push(e)}),i.length?s[parseInt(t.toString(),10)].expanded=!0:s[parseInt(t.toString(),10)].hasChildRecords&&(s[parseInt(t.toString(),10)].expanded=!1)),C.isNullOrUndefined(s[parseInt(t.toString(),10)].index)&&(s[parseInt(t.toString(),10)].taskData=C.extend({},s[parseInt(t.toString(),10)]),s[parseInt(t.toString(),10)].uniqueID=w.getUid(d.parent.element.id+"_data_"),C.setValue("uniqueIDCollection."+s[parseInt(t.toString(),10)].uniqueID,s[parseInt(t.toString(),10)],d.parent),S(d.parent)&&d.parent.enableVirtualization&&s[parseInt(t.toString(),10)][""+d.parent.parentIdMapping]&&(C.isNullOrUndefined(s[parseInt(t.toString(),10)].level)||0===s[parseInt(t.toString(),10)].level)?(n=s[parseInt(t.toString(),10)][""+d.parent.parentIdMapping],(e=s.find(function(e){return e[""+a.parent.idMapping]===n}))?s[parseInt(t.toString(),10)].level=e.level+1:(e=o.actual.flatData.find(function(e){return e[""+a.parent.idMapping]===n}),C.isNullOrUndefined(e[""+d.parent.parentIdMapping])?s[parseInt(t.toString(),10)].level=1:s[parseInt(t.toString(),10)].level=e.level+1)):s[parseInt(t.toString(),10)].level=0,s[parseInt(t.toString(),10)].index=Math.ceil(1e3*Math.random()),!s[parseInt(t.toString(),10)][d.parent.hasChildMapping]&&-1===d.parentItems.indexOf(s[parseInt(t.toString(),10)][d.parent.idMapping])||(s[parseInt(t.toString(),10)].hasChildRecords=!0),s[parseInt(t.toString(),10)].checkboxState="uncheck")}(t);else C.isNullOrUndefined(s)||!this.parent.loadChildOnDemand&&I(this.parent)&&!C.isNullOrUndefined(this.parent.dataResults.expandRecord)||S(this.parent)&&!this.parent.loadChildOnDemand&&o[e].isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(s);else this.zerothLevelData=o,C.setValue("cancel",!0,o);S(this.parent)&&!this.parent.loadChildOnDemand&&o[e].isExpandCollapse&&this.parent.enableVirtualization||S(this.parent)&&this.parent.enableVirtualization&&this.parent.loadChildOnDemand?o.result=s:o.result=this.parent.loadChildOnDemand?s:this.parent.flatData,S(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(e=o.query.queries.filter(function(e){return"onAggregates"===e.fn}),o.result=this.parent.summaryModule.calculateSummaryValue(e,this.parent.flatData,!0)),this.parent.notify("updateResults",o)},a.prototype.collectExpandingRecs=function(e,t){var i,r=this.parent.getRows();if(this.parent.rowTemplate&&(i=this.parent.getContentTable().rows,r=[].slice.call(i)),0<e.rows.length){t||(e.record.expanded=!0);for(var n=0;n<e.rows.length;n++){this.parent.toggleRowVisibility(e.rows[parseInt(n.toString(),10)],"e-childrow-visible"),this.parent.loadChildOnDemand||(a=e.rows[parseInt(n.toString(),10)].getElementsByClassName("e-treegridcollapse")[0],o=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(n.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(n.toString(),10)].getAttribute("data-Uid")).data,!C.isNullOrUndefined(a)&&o.expanded&&(C.addClass([a],"e-treegridexpand"),C.removeClass([a],"e-treegridcollapse")),a=[],(a=r.filter(function(e){return e.querySelector(".e-gridrowindex"+o.index+"level"+(o.level+1))})).length&&o.expanded&&this.collectExpandingRecs({record:o,rows:a,parentRow:e.parentRow},!0));var o,a=e.rows[parseInt(n.toString(),10)].querySelector(".e-detailrowcollapse");C.isNullOrUndefined(a)||this.parent.grid.detailRowModule.expand(a)}this.parent.grid.pageSettings.totalRecordsCount+=e.rows.length}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},a.prototype.fetchRemoteChildData=function(g){var e,f=this,m={row:g.p