UNPKG

@syncfusion/ej2-treegrid

Version:
1 lines 360 kB
!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,B){"use strict";V=function(e,t){return(V=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 V,z=function(e,t){function i(){this.constructor=e}V(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={},this.enableRowSpan=!0,this.enableColumnSpan=!0,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(ie,te),e([C.Collection([],ee)],ie.prototype,"columns",void 0),e([C.Property("FilterBar")],ie.prototype,"type",void 0),e([C.Property()],ie.prototype,"mode",void 0),e([C.Property(!0)],ie.prototype,"showFilterBarStatus",void 0),e([C.Property(1500)],ie.prototype,"immediateModeDelay",void 0),e([C.Property()],ie.prototype,"operators",void 0),e([C.Property(!1)],ie.prototype,"ignoreAccent",void 0),e([C.Property("Parent")],ie.prototype,"hierarchyMode",void 0);var te,J=ie;function ie(){return null!==te&&te.apply(this,arguments)||this}re=function(e,t){return(re=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 re,ne,e=function(e,t){function i(){this.constructor=e}re(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},oe=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=(ne=C.ChildProperty,e(ae,ne),oe([C.Property("Both")],ae.prototype,"wrapMode",void 0),ae);function ae(){return null!==ne&&ne.apply(this,arguments)||this}var se,de,oe=function(e,t){function i(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},le="https://ej2.syncfusion.com/documentation/treegrid",pe="https://ej2.syncfusion.com/documentation",he=!(se=function(e,t){return(se=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)}),ce=(de=w.Logger,oe(ue,de),ue.prototype.getModuleName=function(){return"logger"},ue.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",""),he&&"primary_column_missing"===i[parseInt(r.toString(),10)]&&(a=a.replace("Editing","Row DragAndDrop"),he=!1),n=a.indexOf("https"),n=a.substring(n),"module_missing"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/modules"):"primary_column_missing"===i[parseInt(r.toString(),10)]||"selection_key_missing"===i[parseInt(r.toString(),10)]?a=a.replace(n,pe+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/edit"):"virtual_height"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/virtual"):"check_datasource_columns"===i[parseInt(r.toString(),10)]?a=a.replace(n,le+"/columns"):"locale_missing"===i[parseInt(r.toString(),10)]&&(a=a.replace(n,le+"/global-local/#localization")),"datasource_syntax_mismatch"===i[parseInt(r.toString(),10)]&&(C.isNullOrUndefined(this.treeGridObj)||C.isNullOrUndefined(this.treeGridObj.dataStateChange))||console[o.logType](a))}},ue.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&&(he=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=me[r[parseInt(n.toString(),10)]],a=o.check(t,i);a.success&&(a=o.generateMessage(t,i,a.options),console[o.logType](a))}},ue);function ue(e){return w.Grid.Inject(w.Logger),de.call(this,e)||this}var ge,fe,me={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"+pe+"/api/treegrid#childmapping\n"+pe+"/api/treegrid#idmapping\n"+pe+"/api/treegrid#$parentidmapping"}}},ye="load",Se="rowDataBound",we="dataBound",Ie="queryCellInfo",Re="beforeDataBound",ve="actionBegin",xe="dataStateChange",Ce="actionComplete",be="rowSelecting",De="rowSelected",Me="checkboxChange",Oe="rowDeselected",Pe="toolbarClick",Ae="beforeExcelExport",Ee="beforePdfExport",Ne="resizeStop",Ue="expanded",ke="expanding",qe="collapsed",Te="collapsing",Be="remoteExpand",Ve="localPagedExpandCollapse",ze="pagingActions",Le="printGrid-Init",Fe="contextMenuOpen",je="contextMenuClick",_e="beforeCopy",He="beforePaste",Ge="crudAction",Qe="beginEdit",Ke="beginAdd",We="recordDoubleClick",Ye="cellSave",Je="cellSaved",Xe="cellEdit",$e="batchDelete",Ze="batchCancel",et="batchAdd",tt="beforeBatchDelete",it="beforeBatchAdd",rt="beforeBatchSave",nt="batchSave",ot="key-pressed",at="double-tap",st="virtual-action-args",dt="destroy",lt="data-listener",pt="index-modifier",ht="edit-form",ct="before-batch-cancel",ut="detailDataBound",gt="rowDrag",ft="rowDragStartHelper",mt="rowDrop",yt="rowDragStart",St="rows-add",wt="rows-remove",It="row-draging",Rt="row-dropped",vt="auto-col",xt="rowDeselecting",Ct="e-movablecontent",bt="e-frozencontent",Dt="aria-rowindex",Mt="actionFailure",oe=(ge=function(e,t){return(ge=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}ge(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Ot=(fe=w.Clipboard,oe(Pt,fe),Pt.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(_e,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 fe.prototype.setCopyData.call(this,e)}},Pt.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}}},Pt.prototype.copy=function(e){fe.prototype.copy.call(this,e)},Pt.prototype.paste=function(e,t,i){fe.prototype.paste.call(this,e,t,i)},Pt.prototype.getModuleName=function(){return"clipboard"},Pt.prototype.destroy=function(){fe.prototype.destroy.call(this)},Pt.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}},Pt);function Pt(e,t){var i=fe.call(this,e.grid,t)||this;return i.treeCopyContent="",i.copiedUniqueIdCollection=[],i.treeGridParent=e,i.serviceLocator=t,i}function I(e){var t;return e.treeGrid&&e.treeGrid.isGantt?!!e.taskFields.hasChildMapping&&e.dataSource instanceof b.DataManager&&((t=e.dataSource.adaptor)instanceof b.ODataAdaptor||t instanceof b.WebApiAdaptor||t instanceof b.WebMethodAdaptor||t instanceof b.CacheAdaptor||t instanceof b.UrlAdaptor):e.dataSource instanceof b.DataManager&&((t=e.dataSource.adaptor)instanceof b.ODataAdaptor||t instanceof b.WebApiAdaptor||t instanceof b.WebMethodAdaptor||t instanceof b.CacheAdaptor||t instanceof b.UrlAdaptor)}function R(e){return!!(e.dataSource&&"result"in e.dataSource)}function At(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function Et(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 Nt(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:M(e,t.parentItem.uniqueID);return null==t||(!e.initialRender||C.isNullOrUndefined(t[e.expandStateMapping])||t[e.expandStateMapping]?!1!==t.expanded&&(!t.parentItem||((r=M(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 v(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(v(i[parseInt(r.toString(),10)])));return t}function x(e){return!I(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 Ut(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 M(e,t,i){return(i?e.uniqueIDFilterCollection:e.uniqueIDCollection)[""+t]}function kt(e){e=window.getComputedStyle(e);return"none"===e.display||"hidden"===e.visibility}i.prototype.getModuleName=function(){return"selection"},i.prototype.buildVisibleUidMap=function(){this.visibleUidIndex={};var e=this.parent.grid.currentViewData;if(e)for(var t=0,i=e.length;t<i;t++){var r=e[parseInt(t.toString(),10)];r&&r.uniqueID&&(this.visibleUidIndex[r.uniqueID]=t)}},i.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)},i.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))},i.prototype.destroy=function(){this.resetSelectionCaches(),this.removeEventListener()},i.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=[],this.parent.frozenRows?i.push(parseInt(e.closest("tr").getAttribute("aria-rowindex"),10)-1):i.push(e.closest("tr").rowIndex),this.selectCheckboxes(i),i=t.nextElementSibling.classList.contains("e-check"),this.triggerChkChangeEvent(t,i,e.closest("tr"))):r&&0<r.querySelectorAll(".e-treeselectall").length&&this.parent.autoCheckHierarchy&&(i=!(i=r.querySelector(".e-frame")).classList.contains("e-check")&&!i.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&&I(this.parent)&&0<this.parent.parentQuery.length&&((r=this.parent.query.queries).push.apply(r,this.parent.parentQuery),this.parent.parentQuery=[])},i.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(Me,t)},i.prototype.getCheckboxcolumnIndex=function(){if(-2===this.checkboxColIndexCache){for(var e,t=-1,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,r=0;r<i.length;r++)if(i[parseInt(r.toString(),10)].showCheckbox){e=i[parseInt(r.toString(),10)].uid;break}for(var n=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv"),o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].getAttribute("data-mappinguid")===e){t=o;break}this.checkboxColIndexCache=C.isNullOrUndefined(t)?-1:t}return this.checkboxColIndexCache},i.prototype.headerCheckbox=function(){var e,t,i;this.buildVisibleUidMap(),this.totalSelectableCount=this.countSelectableRecords(this.resolveHeaderSelectionList(!0)),this.columnIndex=this.getCheckboxcolumnIndex(),-1<this.columnIndex&&((e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex])&&0===e.querySelectorAll(".e-treeselectall").length?(t=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}}),(i=T.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),i.insertBefore(t.cloneNode(),i.firstChild),C.isNullOrUndefined(e)||e.insertBefore(i,e.firstChild),this.headerCheckboxFrameEl=i.querySelector(".e-frame"),this.parent.autoCheckHierarchy&&this.headerSelection()):e&&0<e.querySelectorAll(".e-treeselectall").length&&(this.headerCheckboxFrameEl=e.querySelector(".e-frame"),this.parent.autoCheckHierarchy)&&this.headerSelection())},i.prototype.renderColumnCheckbox=function(e){var t,i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),r=e.data,e=(e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox"),"check"===r.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"===r.checkboxState?(t=e.querySelectorAll(".e-frame")[0],C.removeClass([t],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-stop")):"uncheck"===r.checkboxState?(t=e.querySelectorAll(".e-frame")[0],C.removeClass([t],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-uncheck")):"check"===r.checkboxState&&(t=e.querySelectorAll(".e-frame")[0],C.removeClass([t],["e-check","e-stop","e-uncheck"]),e.querySelector(".e-frame").classList.add("e-check")),e.insertBefore(i.cloneNode(),e.firstChild),e},i.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])},i.prototype.selectCheckboxes=function(e){for(var t=0;t<e.length;t++){var i=this.parent.getCurrentViewRecords()[e[parseInt(t.toString(),10)]],i=M(this.parent,i.uniqueID),r="check"===i.checkboxState?"uncheck":"check";i.checkboxState=r,this.traverSelection(i,r,!1)}},i.prototype.traverSelection=function(e,t,i){var r=e.checkboxState,n=(i||this.buildVisibleUidMap(),Array.isArray(e.childRecords)?e.childRecords:[]);if(n&&0!==n.length||!this.parent.autoCheckHierarchy||(n=this.getChildrenFromFlat(e)),this.parent.filterModule&&0<this.parent.filterModule.filteredResult.length&&n&&n.length&&(n=this.getFilteredChildRecords(n)),this.parent.autoCheckHierarchy&&n&&0!==n.length){for(var o=0,a=0,s=0,d=0;d<n.length;d++){var l=n[parseInt(d.toString(),10)];l&&!l.isSummaryRow&&(o++,this.updateSelectedItems(l,t,!0),l.hasChildRecords&&this.traverSelection(l,t,!0),"check"===l.checkboxState?a++:"indeterminate"===l.checkboxState&&s++)}e.uniqueID&&(this.parentSelectionCounters[e.uniqueID]={total:o,checked:a,indeterminate:s});var p=this.parentSelectionCounters[e.uniqueID],h=this.deriveParentState(e,p);"check"===t&&0<p.total&&p.checked===p.total&&0===p.indeterminate&&(h="check"),this.updateSelectedItems(e,h),!i&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem,r,h),i||(p=this.resolveHeaderSelectionList(),this.updateSelectedCollectionsAfterBulk(p,""),this.refreshVisibleCheckboxes(),this.updateHeaderCheckboxState())}else this.updateSelectedItems(e,t),i||(e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),""),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState())},i.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return-1<t.parent.filterModule.filteredResult.indexOf(e)})},i.prototype.getChildrenFromFlat=function(e){var t=this.parent.flatData;if(!t||!e)return[];for(var i=e.uniqueID,r=[],n=0;n<t.length;n++){var o,a=t[parseInt(n.toString(),10)];a&&!a.isSummaryRow&&((o=a.parentItem)&&o.uniqueID===i)&&r.push(a)}return r},i.prototype.updateParentSelection=function(e,t,i){var r,e=M(this.parent,e.uniqueID);e&&(r=this.buildSelectionSummary(e),t&&this.applySummaryDelta(r,t,-1),i&&this.applySummaryDelta(r,i,1),e.uniqueID&&(this.parentSelectionCounters[e.uniqueID]=r),t=this.deriveParentState(e,r),e.checkboxState!==t)&&(i=e.checkboxState,e.checkboxState=t,this.updateSelectedItems(e,t),e.parentItem)&&this.updateParentSelection(e.parentItem,i,t)},i.prototype.buildSelectionSummary=function(e,t){var i={total:0,checked:0,indeterminate:0},r=[],r=e&&Array.isArray(e.childRecords)&&e.childRecords.length?e.childRecords:this.getChildrenFromFlat(e);!t&&this.parent.filterModule&&0<this.parent.filterModule.filteredResult.length&&(r=this.getFilteredChildRecords(r));for(var n=0;n<r.length;n++){var o=r[parseInt(n.toString(),10)];o&&!o.isSummaryRow&&(i.total++,"check"===o.checkboxState?i.checked++:"indeterminate"===o.checkboxState&&i.indeterminate++)}return i},i.prototype.applySummaryDelta=function(e,t,i){"check"===t?e.checked=Math.max(0,e.checked+i):"indeterminate"===t&&(e.indeterminate=Math.max(0,e.indeterminate+i))},i.prototype.deriveParentState=function(e,t){var i=t.total,r=t.checked;return 0<t.indeterminate||0<r&&r!==i?"indeterminate":r===i&&0<i?"check":"uncheck"},i.prototype.headerSelection=function(e){!C.isNullOrUndefined(this.parent.filterModule)&&0<this.parent.filterModule.filteredResult.length&&(t=this.parent.filterModule.filteredResult,0===this.filteredList.length&&(this.filteredList=t),this.parent.grid.searchSettings.key.length?this.searchingRecords=t:this.filteredList===t||this.parent.grid.searchSettings.key.length||(this.filteredList=t,this.searchingRecords=[])),0<this.searchingRecords.length&&!C.isNullOrUndefined(e)?this.filteredList=this.searchingRecords:0<this.filteredList.length&&!this.parent.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length&&(this.filteredList=[]);var t=this.resolveHeaderSelectionList(!0);C.isNullOrUndefined(e)?this.totalSelectableCount=this.countSelectableRecords(t):(this.resetSelectionCaches(),this.headerSelectionState=e=e?"check":"uncheck",this.processHeaderSelection(t,e),this.finalizeParentsAfterBulk(t),this.updateSelectedCollectionsAfterBulk(t,""),this.refreshVisibleCheckboxes()),this.updateHeaderCheckboxState()},i.prototype.finalizeParentsAfterBulk=function(e){for(var t=e,i=0;i<t.length;i++){var r,n,o=t[parseInt(i.toString(),10)];o&&o.hasChildRecords&&(r=this.buildSelectionSummary(o,!0),this.parentSelectionCounters[o.uniqueID]=r,n=this.deriveParentState(o,r),"check"===this.headerSelectionState&&0<r.total&&r.checked===r.total&&0===r.indeterminate?n="check":"uncheck"===this.headerSelectionState&&(n="uncheck"),o.checkboxState!==n)&&this.updateSelectedItems(o,n)}},i.prototype.processHeaderSelection=function(e,t){for(var i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)];r&&r.checkboxState!==t&&(r.checkboxState=t,this.updateSelectedItems(r,t,!0))}},i.prototype.updateSelectedCollectionsAfterBulk=function(e,t){for(var i=!!(this.parent.filterModule&&this.parent.filterModule.filteredResult&&this.parent.filterModule.filteredResult.length),r=!!(this.parent.grid&&this.parent.grid.searchSettings&&this.parent.grid.searchSettings.key&&this.parent.grid.searchSettings.key.length),n=i||r||"refresh"===t||"searching"===t,i=n?e:this.selectedItems.slice(),o=[],a=new Map,s=[],d=0,l=i;d<l.length;d++)(f=l[d]).hasChildRecords&&n&&0===f.level&&this.updateParentSelection(f),f.uniqueID&&"check"===f.checkboxState&&(o.push(f),a.set(f.uniqueID,!0));if(!n){r=this.parent.flatData;if(r)for(var p=0,h=r;p<h.length;p++){var c=h[p];c&&!c.isSummaryRow&&c.uniqueID&&"check"===c.checkboxState&&!a.has(c.uniqueID)&&(o.push(c),a.set(c.uniqueID,!0))}}this.selectedItems=o,this.selectedUidMap=a,this.buildVisibleUidMap();for(var u=0,g=this.selectedItems;u<g.length;u++){var f=g[u],m=this.visibleUidIndex[f.uniqueID];void 0!==m&&s.push(m)}this.selectedIndexes=s,this.checkedItemCount=this.selectedItems.length,this.totalSelectableCount=this.countSelectableRecords(e)},i.prototype.refreshVisibleCheckboxes=function(){this.buildVisibleUidMap();for(var e=this.parent.getCurrentViewRecords(),t=this.parent.uniqueIDCollection,i=0;e&&i<e.length;i++){var r,n,o=e[parseInt(i.toString(),10)];o&&(r=o.uniqueID,r=(r=t&&null!=r?t[String(r)]:o)&&r.checkboxState?r.checkboxState:"uncheck",n=null,n=!(n=(o=o.uid)?this.parent.grid.getRowElementByUID(o):n)&&(n=(o=this.parent.getRows())&&o[parseInt(i.toString(),10)],this.parent.frozenRows||this.parent.getFrozenColumns())&&!n?(o=this.parent.getDataRows())&&o[parseInt(i.toString(),10)]:n)&&(o=n.querySelector(".e-hierarchycheckbox .e-frame"))&&(C.removeClass([o],["e-check","e-stop","e-uncheck"]),o.classList.add("indeterminate"===r?"e-stop":"e-"+r),o=n.querySelector(".e-treecheckselect"))&&o.setAttribute("aria-checked","check"===r?"true":"uncheck"===r?"false":"mixed")}},i.prototype.resetSelectionCaches=function(){this.parentSelectionCounters={},this.selectedUidMap=new Map,this.selectedItems=[],this.selectedIndexes=[],this.totalSelectableCount=0,this.headerSelectionState="uncheck",this.checkedItemCount=0},i.prototype.countSelectableRecords=function(e){var t=0;if(e)for(var i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)];r&&!r.isSummaryRow&&t++}return t},i.prototype.resolveHeaderSelectionList=function(e){var t,i;return I(this.parent)?this.parent.getCurrentViewRecords():(t=!!(this.parent.filterModule&&this.parent.filterModule.filteredResult&&this.parent.filterModule.filteredResult.length),i=!!(this.parent.grid&&this.parent.grid.searchSettings&&this.parent.grid.searchSettings.key&&this.parent.grid.searchSettings.key.length),t?this.filteredList&&this.filteredList.length?this.filteredList:this.parent.filterModule.filteredResult:i&&this.searchingRecords&&this.searchingRecords.length?this.searchingRecords:this.parent.flatData)},i.prototype.updateHeaderCheckboxState=function(){var e=this.headerCheckboxFrameEl;if(e){for(var t=this.resolveHeaderSelectionList(!0),i=(this.totalSelectableCount=this.countSelectableRecords(t),0),r=0,n=t;r<n.length;r++){var o=n[r];o&&!o.isSummaryRow&&"check"===o.checkboxState&&i++}C.removeClass([e],["e-check","e-stop","e-uncheck"]),0===this.totalSelectableCount||0===i?e.classList.add("e-uncheck"):i===this.totalSelectableCount?e.classList.add("e-check"):e.classList.add("e-stop")}},i.prototype.updateSelectedItems=function(e,t,i){this.buildVisibleUidMap();var r=e.uniqueID,n=this.parent.uniqueIDCollection,n=n&&null!=r&&n[String(r)]?n[String(r)]:e,o=!0===e.isSummaryRow,a=n.checkboxState,s=this.visibleUidIndex[String(r)];n.checkboxState=t,i||(o||a===t||("check"===t?(this.checkedItemCount++,this.selectedUidMap.has(String(r))||(n.uniqueID&&this.selectedUidMap.set(String(n.uniqueID),!0),this.selectedItems.push(n),void 0!==s&&-1===this.selectedIndexes.indexOf(s)&&this.selectedIndexes.push(s))):"check"!==a&&"indeterminate"!==a||(0<this.checkedItemCount&&this.checkedItemCount--,n&&n.uniqueID&&this.selectedUidMap.has(String(n.uniqueID))&&(this.selectedUidMap.delete(String(n.uniqueID)),-1!==(i=this.selectedItems.indexOf(n))&&this.selectedItems.splice(i,1),void 0!==s)&&-1<(o=this.selectedIndexes.indexOf(s))&&this.selectedIndexes.splice(o,1))),a=null,(a=(n=e.uid)?this.parent.grid.getRowElementByUID(n):a)||-1<(i=void 0!==s?s:"number"==typeof this.visibleUidIndex[String(r)]?this.visibleUidIndex[String(r)]:-1)&&((a=this.parent.getRows()[parseInt(i.toString(),10)])||!this.parent.frozenRows&&!this.parent.getFrozenColumns()||(a=this.parent.getDataRows()[parseInt(i.toString(),10)])),a&&((o=a.querySelector(".e-hierarchycheckbox .e-frame"))&&(C.removeClass([o],["e-check","e-stop","e-uncheck"]),o.classList.add("indeterminate"===t?"e-stop":"e-"+t)),e=a.querySelector(".e-treecheckselect"))&&e.setAttribute("aria-checked","check"===t?"true":"uncheck"===t?"false":"mixed"))},i.prototype.updateGridActions=function(e){var t=e.requestType;if(At(this.parent))if(this.parent.autoCheckHierarchy)if("sorting"===t||"paging"===t)this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),""),this.refreshVisibleCheckboxes(),this.updateHeaderCheckboxState();else if("delete"===t||"add"===e.action){var i=[];"delete"===t?i=e.data:i.push(e.data);for(var r=0;r<i.length;r++)"delete"===t&&this.updateSelectedItems(i[parseInt(r.toString(),10)],"uncheck",!1),C.isNullOrUndefined(i[parseInt(r.toString(),10)].parentItem)||this.updateParentSelection(i[parseInt(r.toString(),10)].parentItem);this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(!0),""),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState()}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":"filtering"!==t&&"searching"!==t&&"refresh"!==t||(this.updateSelectedCollectionsAfterBulk(this.resolveHeaderSelectionList(),t),this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState());else"filtering"!==t&&"searching"!==t&&"refresh"!==t&&"sorting"!==t&&"paging"!==t&&"expanding"!==t&&"expand"!==t&&"collapsing"!==t&&"collapse"!==t||I(this.parent)||(this.selectedItems=[],this.selectedUidMap=new Map,this.selectedIndexes=[],this.refreshVisibleCheckboxes(),this.parent.autoCheckHierarchy&&this.updateHeaderCheckboxState())},i.prototype.getCheckedrecords=function(){return this.selectedItems},i.prototype.getCheckedRowIndexes=function(){this.buildVisibleUidMap();for(var e=[],t=0,i=this.selectedItems;t<i.length;t++){var r=i[t].uniqueID;void 0!==r&&void 0!==this.visibleUidIndex[r]&&e.push(this.visibleUidIndex[r])}return e};var qt=i;function i(e){this.headerCheckboxFrameEl=null,this.checkboxColIndexCache=-2,this.parentSelectionCounters={},this.selectedUidMap=new Map,this.totalSelectableCount=0,this.headerSelectionState="uncheck",this.checkedItemCount=0,this.visibleUidIndex={},this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}Bt.prototype.getModuleName=function(){return"print"},Bt.prototype.addEventListener=function(){this.parent.grid.on(Le,this.printTreeGrid,this)},Bt.prototype.removeEventListener=function(){this.parent.grid.off(Le,this.printTreeGrid)},Bt.prototype.printTreeGrid=function(e){var t=w.getObject("printgrid",e),e=w.getObject("element",e);t.addEventListener(Ie,this.parent.grid.queryCellInfo),t.addEventListener(Se,this.parent.grid.rowDataBound),t.addEventListener(Re,this.parent.grid.beforeDataBound),C.addClass([e],"e-treegrid")},Bt.prototype.print=function(){this.parent.grid.print()},Bt.prototype.destroy=function(){this.removeEventListener()};var Tt=Bt;function Bt(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,zt,oe=function(e,t){function i(){this.constructor=e}Vt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Lt=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},oe=(zt=C.ChildProperty,oe(Ft,zt),Lt([C.Property()],Ft.prototype,"fields",void 0),Lt([C.Property(!1)],Ft.prototype,"ignoreCase",void 0),Lt([C.Property("contains")],Ft.prototype,"operator",void 0),Lt([C.Property()],Ft.prototype,"key",void 0),Lt([C.Property()],Ft.prototype,"hierarchyMode",void 0),Ft);function Ft(){return null!==zt&&zt.apply(this,arguments)||this}jt=function(e,t){return(jt=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 jt,_t,Lt=function(e,t){function i(){this.constructor=e}jt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=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},Lt=(_t=C.ChildProperty,Lt(Ht,_t),n([C.Property("Row")],Ht.prototype,"mode",void 0),n([C.Property("Flow")],Ht.prototype,"cellSelectionMode",void 0),n([C.Property("Single")],Ht.prototype,"type",void 0),n([C.Property(!1)],Ht.prototype,"persistSelection",void 0),n([C.Property("Default")],Ht.prototype,"checkboxMode",void 0),n([C.Property(!1)],Ht.prototype,"checkboxOnly",void 0),n([C.Property(!0)],Ht.prototype,"enableToggle",void 0),Ht);function Ht(){return null!==_t&&_t.apply(this,arguments)||this}Qt.prototype.RowModifier=function(t){var i,r,e,n;t.data&&(e=(i=t.data).parentItem,C.isNullOrUndefined(i.parentItem)||Et(this.parent)||this.parent.allowPaging&&"Root"!==this.parent.pageSettings.pageSizeMode&&(!I(this.parent)||x(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),I(this.parent)&&!x(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(Se,t)}):this.parent.trigger(Se,t))},Qt.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||I(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(Ie,e):this.parent.isReact&&m.field!==e.column.field&&(f=this).parent.renderReactTemplates(function(){f.parent.trigger(Ie,e)})}},Qt.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(Ie,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=""},Qt.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}))})},Qt.prototype.columnTemplateResult=function(e){this.templateResult=e.template},Qt.prototype.reactTemplateRender=function(e,t){var i="portals";this.parent[i]=e,this.parent.notify("renderReactTemplate",this.parent[i]),this.parent.renderReactTemplates(t)},Qt.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)};var Gt=Qt;function Qt(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}o.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(Be,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},o.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Be,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))},o.prototype.destroy=function(){this.removeEventListener(),this.hierarchyData=null},o.prototype.isRemote=function(){return this.parent.dataSource instanceof b.DataManager},o.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=[],I(this.parent)&&!x(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)},o.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},o.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},o.prototype.updateParentRemoteData=function(o){var a=this,e="actionArgs",s=(I(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===o[e].requestType&&this.parent.hideSpinner(),o.result);if(I(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;R(d.parent)&&s[parseInt(t.toString(),10)].hasChildRecords&&d.parent.initialRender&&(s[parseInt(t.toString(),10)].expanded=!1),I(d.parent)&&d.parent.enableVirtualization&&(i=[],r=d.parent,s.filter(fun