UNPKG

@syncfusion/ej2-treegrid

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