@syncfusion/ej2-treegrid
Version:
Essential JS 2 TreeGrid Component
10 lines • 349 kB
JavaScript
/*!
* filename: ej2-treegrid.min.js
* version : 29.1.37
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
this.ej=this.ej||{},this.ej.treegrid=function(e,t,i,r,n,o){"use strict";function a(e){if(e.dataSource instanceof n.DataManager){var t=e.dataSource.adaptor;return t instanceof n.ODataAdaptor||t instanceof n.WebApiAdaptor||t instanceof n.WebMethodAdaptor||t instanceof n.CacheAdaptor||t instanceof n.UrlAdaptor}return!1}function s(e){return!!(e.dataSource&&"result"in e.dataSource)}function d(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function l(e){return!((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 p(e){for(var t=[],r=0,n=Object.keys(e).length;r<n;r++)i.getObject("hasChildRecords",e[parseInt(r.toString(),10)])&&t.push(e[parseInt(r.toString(),10)]);return t}function h(e,i,r){var n,o=t.isNullOrUndefined(i.parentItem)?null:m(e,i.parentItem.uniqueID);return null==o||(!e.initialRender||t.isNullOrUndefined(o[e.expandStateMapping])||o[e.expandStateMapping]?!1!==o.expanded&&(!o.parentItem||(n=m(e,o.parentItem.uniqueID),n&&e.initialRender&&!t.isNullOrUndefined(n[e.expandStateMapping])&&!n[e.expandStateMapping]?(n.expanded=!1,!1):(!n||!1!==n.expanded)&&(!n||h(e,n)))):(o.expanded=!1,!1))}function c(e){var i=[];if(t.isNullOrUndefined(e)||!e.hasChildRecords&&!t.isNullOrUndefined(e.childRecords)&&!e.childRecords.length)return[];if(!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||!t.isNullOrUndefined(r[parseInt(n.toString(),10)].childRecords)&&r[parseInt(n.toString(),10)].childRecords.length)&&(i=i.concat(c(r[parseInt(n.toString(),10)])));return i}function u(e){if(a(e)){var i=e.dataSource;return!t.isNullOrUndefined(i.ready)}return!0}function g(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 f(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){if(i){return e.uniqueIDFilterCollection[""+t]}return e.uniqueIDCollection[""+t]}function y(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}function S(e,i,r,o,a,s,d){var l,p,h,c=e.value,u=e.action,f=i.grid.getPrimaryKeyFieldNames()[0],y=i.dataSource instanceof n.DataManager?i.dataSource.dataSource.json:i.dataSource,S=[],R=c,x=!1;if("Batch"===i.editSettings.mode&&(h=i.grid.editModule.getBatchChanges()),"add"===u||"batchsave"===u&&"Batch"===i.editSettings.mode&&h.addedRecords.length){var C=v(e,y,i,r,o,a,d);c=C.value,x=C.isSkip}if(c instanceof Array?S=g(c):S.push(t.extend({},c)),!x&&("add"!==u||"Top"!==i.editSettings.newRowPosition&&"Bottom"!==i.editSettings.newRowPosition))for(var b=0;b<S.length;b++){"object"==typeof S[parseInt(b.toString(),10)][""+f]&&(S[parseInt(b.toString(),10)]=S[parseInt(b.toString(),10)][""+f]);var D=S[parseInt(b.toString(),10)].taskData?Object.keys(S[parseInt(b.toString(),10)].taskData):Object.keys(S[parseInt(b.toString(),10)]);l=y.length;for(;l--&&l>=0&&"break"!==function(){if(y[parseInt(l.toString(),10)][""+f]===S[parseInt(b.toString(),10)][""+f]){if("delete"!==u){if("edit"===u){for(p=0;p<D.length;p++)if(Object.prototype.hasOwnProperty.call(y[parseInt(l.toString(),10)],D[parseInt(p.toString(),10)])&&("Cell"!==i.editSettings.mode||!t.isNullOrUndefined(h)&&0===h.changedRecords.length||D[parseInt(p.toString(),10)]===s)){var e=m(i,S[parseInt(b.toString(),10)].uniqueID);y[parseInt(l.toString(),10)][D[parseInt(p.toString(),10)]]=S[parseInt(b.toString(),10)][D[parseInt(p.toString(),10)]],e&&e.taskData&&(e.taskData[D[parseInt(p.toString(),10)]]=e[D[parseInt(p.toString(),10)]]=y[parseInt(l.toString(),10)][D[parseInt(p.toString(),10)]])}}else if("add"===u||"batchsave"===u){var n=void 0;"Child"===i.editSettings.newRowPosition?r?(R.taskData[""+i.parentIdMapping]=y[parseInt(l.toString(),10)][""+i.idMapping],y.splice(l+1,0,R.taskData)):(Object.prototype.hasOwnProperty.call(y[parseInt(l.toString(),10)],i.childMapping)||(y[parseInt(l.toString(),10)][""+i.childMapping]=[]),y[parseInt(l.toString(),10)][""+i.childMapping].push(R.taskData),I(f,y[parseInt(l.toString(),10)],u,i,r,R)):"Below"===i.editSettings.newRowPosition?(y.splice(l+1,0,R.taskData),t.isNullOrUndefined(R.parentItem)||I(f,y[l+1],u,i,r,R)):o?"Above"===i.editSettings.newRowPosition&&(y.splice(l,0,R.taskData),t.isNullOrUndefined(R.parentItem)||I(f,y[parseInt(l.toString(),10)],u,i,r,R)):(n=0,y.splice(n,0,R.taskData))}return"break"}var a=y[parseInt(l.toString(),10)];if(y.splice(l,1),r){if(!t.isNullOrUndefined(a[""+i.parentIdMapping]))for(var d=i.flatData.filter(function(e){return e[""+i.idMapping]===a[""+i.parentIdMapping]})[0],c=d?d[""+i.childMapping]:[],g=c.length-1;g>=0;g--)if(c[parseInt(g.toString(),10)][""+i.idMapping]===a[""+i.idMapping]){i.enableImmutableMode||d.childRecords.length!==d.Children.length||d.childRecords.splice(g,1),c.splice(g,1),c.length||(d.hasChildRecords=!1,I(f,d,u,i,r));break}return"break"}}else t.isNullOrUndefined(y[parseInt(l.toString(),10)][""+i.childMapping])||w(y[parseInt(l.toString(),10)][""+i.childMapping],S[parseInt(b.toString(),10)],u,f,i,r,R,s)&&I(f,y[parseInt(l.toString(),10)],u,i,r)}(););}}function v(e,i,r,n,o,a,s){var d,l=!1,p=r.grid.getCurrentViewRecords();switch(d=t.extend({},e.value),d=f(d),r.editSettings.newRowPosition){case"Top":i.unshift(d),l=!0;break;case"Bottom":i.push(d),l=!0;break;case"Above":d=f(t.isNullOrUndefined(s)?d=t.extend({},p[o+1]):d=t.extend({},s));break;case"Below":case"Child":if(t.isNullOrUndefined(s)){var h=r.grid.getPrimaryKeyFieldNames()[0],c=p[parseInt(o.toString(),10)];d=f(d=!t.isNullOrUndefined(c)&&c[""+h]===e.value[""+h]||-1!==a?t.extend({},c):t.extend({},e.value));r.editModule.internalProperties.taskData=d}else d=f(d=t.extend({},s));-1===a&&(i.unshift(d),l=!0)}return{value:d,isSkip:l}}function w(e,i,r,n,o,a,s,d){for(var l=!1,p=e.length;p--&&p>=0;)if(e[parseInt(p.toString(),10)][""+n]===i[""+n]||a&&e[parseInt(p.toString(),10)][o.parentIdMapping]===i[o.idMapping]){if("edit"===r){for(var h=Object.keys(i),c=m(o,i.uniqueID),u=0;u<h.length;u++)if(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],h[parseInt(u.toString(),10)])&&("Cell"!==o.editSettings.mode||h[parseInt(u.toString(),10)]===d)&&(c[h[parseInt(u.toString(),10)]]=c.taskData[h[parseInt(u.toString(),10)]]=e[parseInt(p.toString(),10)][h[parseInt(u.toString(),10)]]=i[h[parseInt(u.toString(),10)]],"Normal"===o.grid.editSettings.mode&&"Cell"===o.editSettings.mode&&!t.isNullOrUndefined(o.grid.editModule))){o.grid.editModule.editModule.editRowIndex=i.index,o.grid.editModule.editModule.updateCurrentViewData(i)}break}"add"===r||"batchsave"===r?"Child"===o.editSettings.newRowPosition?a?(s[""+o.parentIdMapping]=e[parseInt(p.toString(),10)][o.idMapping],e.splice(p+1,0,s),I(n,e[parseInt(p.toString(),10)],r,o,a,s)):(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],o.childMapping)||(e[parseInt(p.toString(),10)][o.childMapping]=[]),e[parseInt(p.toString(),10)][o.childMapping].push(s.taskData),I(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Above"===o.editSettings.newRowPosition?(e.splice(p,0,s.taskData),t.isNullOrUndefined(s.parentItem)||I(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Below"===o.editSettings.newRowPosition&&(e.splice(p+1,0,s.taskData),t.isNullOrUndefined(s.parentItem)||I(n,e[parseInt(p.toString(),10)],r,o,a,s)):(e.splice(p,1),e.length||(l=!0))}else t.isNullOrUndefined(e[parseInt(p.toString(),10)][o.childMapping])||w(e[parseInt(p.toString(),10)][o.childMapping],i,r,n,o,a,s,d)&&I(n,e[parseInt(p.toString(),10)],r,o,a);return l}function I(e,i,r,o,a,s){if("Above"!==o.editSettings.newRowPosition&&"Below"!==o.editSettings.newRowPosition||"add"!==r&&"batchsave"!==r||t.isNullOrUndefined(s.parentItem)){var d,l=o.grid.getCurrentViewRecords();if(l.map(function(t,r){if(t[""+e]===i[""+e])return void(d=r)}),o.enableVirtualization&&t.isNullOrUndefined(d)){var p=t.getValue("uniqueIDCollection."+s.parentUniqueID,o);i=p}if(t.isNullOrUndefined(d)||(i=l[parseInt(d.toString(),10)]),o.enableVirtualization&&t.isNullOrUndefined(i)&&!t.isNullOrUndefined(s)&&(i=t.getValue("uniqueIDCollection."+s.parentUniqueID,o)),a||t.isNullOrUndefined(i.childRecords)||!i.childRecords.length?i.hasChildRecords=!1:i.hasChildRecords=!0,"add"===r||"batchsave"===r){i.expanded=!0,i.hasChildRecords=!0,o.sortSettings.columns.length&&t.isNullOrUndefined(s)&&(s=l.filter(function(e){return e.parentUniqueID===i.uniqueID?e:null}));var h=s?s instanceof Array?s[0]:s:l[d+1];"Below"!==o.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(i,"childRecords")?t.isNullOrUndefined(s)||i[""+e]===s[""+e]||i.childRecords.push(s):i.childRecords=[],-1===i.childRecords.indexOf(h)&&i[""+e]!==s[""+e]&&i.childRecords.unshift(h),a&&(Object.prototype.hasOwnProperty.call(i,o.childMapping)||(i[o.childMapping]=[]),-1===i[""+o.childMapping].indexOf(h)&&i[""+e]!==s[""+e]&&i[o.childMapping].unshift(h)))}for(var c=o.grid.getPrimaryKeyFieldNames()[0],u=o.grid.dataSource instanceof n.DataManager?o.grid.dataSource.dataSource.json:o.grid.dataSource,g=0;g<u.length;g++)if(u[parseInt(g.toString(),10)][""+c]===i[""+c]){u[parseInt(g.toString(),10)]=i;break}o.grid.setRowData(e,i);var f=o.getRowByIndex(d);"Batch"===o.editSettings.mode&&(f="add"===r?o.getRows()[o.grid.getCurrentViewRecords().indexOf(i)]:o.getRows()[o.grid.getRowIndexByPrimaryKey(i[""+e])]);var y=void 0;if((o.frozenRows||o.getFrozenColumns())&&(y=o.getRowByIndex(d)),!o.enableVirtualization&&!t.isNullOrUndefined(f)||!t.isNullOrUndefined(y)){var S=o.treeColumnIndex;o.allowRowDragAndDrop&&o.enableImmutableMode&&(S+=1),o.renderModule.cellRender({data:i,cell:f.cells[parseInt(S.toString(),10)]?f.cells[parseInt(S.toString(),10)]:y.cells[S-o.getFrozenColumns()],column:o.grid.getColumns()[o.treeColumnIndex],requestType:r}),(o.enableImmutableMode&&"indenting"===o.action||"outdenting"===o.action)&&o.renderModule.RowModifier({data:i,row:f})}}else m(o,s.parentItem.uniqueID).childRecords.push(s)}var R=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])})(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)}}(),x=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(){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={},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}(),b=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),x([t.Property(null)],i.prototype,"columns",void 0),i}(C),D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return R(t,e),t}(b),M=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])})(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)}}(),O=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;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},P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return M(i,e),O([t.Property("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),E=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])})(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)}}(),A=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(e){function i(){return null!==e&&e.apply(this,arguments)||this}return E(i,e),A([t.Property()],i.prototype,"field",void 0),A([t.Property()],i.prototype,"operator",void 0),A([t.Property()],i.prototype,"value",void 0),A([t.Property()],i.prototype,"matchCase",void 0),A([t.Property()],i.prototype,"ignoreAccent",void 0),A([t.Property()],i.prototype,"predicate",void 0),A([t.Property({})],i.prototype,"actualFilterValue",void 0),A([t.Property({})],i.prototype,"actualOperator",void 0),A([t.Property()],i.prototype,"type",void 0),A([t.Property()],i.prototype,"ejpredicate",void 0),A([t.Property()],i.prototype,"uid",void 0),A([t.Property()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return E(i,e),A([t.Collection([],N)],i.prototype,"columns",void 0),A([t.Property("FilterBar")],i.prototype,"type",void 0),A([t.Property()],i.prototype,"mode",void 0),A([t.Property(!0)],i.prototype,"showFilterBarStatus",void 0),A([t.Property(1500)],i.prototype,"immediateModeDelay",void 0),A([t.Property()],i.prototype,"operators",void 0),A([t.Property(!1)],i.prototype,"ignoreAccent",void 0),A([t.Property("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),k=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])})(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)}}(),q=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},T=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),q([t.Property("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),B=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])})(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)}}(),V="https://ej2.syncfusion.com/documentation/treegrid",z="https://ej2.syncfusion.com/documentation",L=!1,F=function(e){function r(t){return i.Grid.Inject(i.Logger),e.call(this,t)||this}return B(r,e),r.prototype.getModuleName=function(){return"logger"},r.prototype.log=function(e,r){e instanceof Array||(e=[e]);for(var n=e,o=0;o<n.length;o++){var a=i.detailLists[n[parseInt(o.toString(),10)]],s=a.check(r,this.parent);if(s.success){var d=a.generateMessage(r,this.parent,s.options);d=d.replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),L&&"primary_column_missing"===n[parseInt(o.toString(),10)]&&(d=d.replace("Editing","Row DragAndDrop"),L=!1);var l=d.indexOf("https"),p=d.substring(l);"module_missing"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/modules"):"primary_column_missing"===n[parseInt(o.toString(),10)]||"selection_key_missing"===n[parseInt(o.toString(),10)]?d=d.replace(p,z+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/edit"):"virtual_height"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/virtual"):"check_datasource_columns"===n[parseInt(o.toString(),10)]?d=d.replace(p,V+"/columns"):"locale_missing"===n[parseInt(o.toString(),10)]&&(d=d.replace(p,V+"/global-local/#localization")),"datasource_syntax_mismatch"===n[parseInt(o.toString(),10)]?t.isNullOrUndefined(this.treeGridObj)||t.isNullOrUndefined(this.treeGridObj.dataStateChange)||console[a.logType](d):console[a.logType](d)}}},r.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&&(L=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=j[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)}}},r}(i.Logger),j={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,i){var r={success:!1};return(t.isNullOrUndefined(i.idMapping)&&t.isNullOrUndefined(i.childMapping)&&t.isNullOrUndefined(i.parentIdMapping)||!t.isNullOrUndefined(i.idMapping)&&t.isNullOrUndefined(i.parentIdMapping)||t.isNullOrUndefined(i.idMapping)&&!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"+z+"/api/treegrid#childmapping\n"+z+"/api/treegrid#idmapping\n"+z+"/api/treegrid#$parentidmapping"}}},_=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])})(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){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 _(i,e),i.prototype.setCopyData=function(i){var r=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this.copyContent="";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++)if(a>0&&(this.treeCopyContent+="\n"),!n[o[parseInt(a.toString(),10)]].classList.contains("e-summaryrow")){var s=[].slice.call(n[o[parseInt(a.toString(),10)]].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,o[parseInt(a.toString(),10)],n,i,a),this.getCopyData(s,!1,"\t",i),this.treeCopyContent+=this.copyContent,this.copiedUniqueIdCollection.push(d),this.copyContent="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(r,o[parseInt(a.toString(),10)],n,i))}if(i){for(var l=[],a=0;a<this.treeGridParent.getVisibleColumns().length;a++)l[parseInt(a.toString(),10)]=this.treeGridParent.getVisibleColumns()[parseInt(a.toString(),10)].headerText;this.getCopyData(l,!1,"\t",i),this.treeCopyContent=this.copyContent+"\n"+this.treeCopyContent}var p={data:this.treeCopyContent,cancel:!1};if(this.treeGridParent.trigger("beforeCopy",p),p.cancel)return;this.clipBoardTextArea.value=this.copyContent=p.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){if(!t.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem))for(var a=e[parseInt(i.toString(),10)].parentItem.level,s=0;s<a+1;s++)for(var d=0;d<e.length;d++)if(!t.isNullOrUndefined(e[parseInt(i.toString(),10)].parentItem)&&e[parseInt(d.toString(),10)].uniqueID===e[parseInt(i.toString(),10)].parentItem.uniqueID){i=d;var l=[].slice.call(r[parseInt(i.toString(),10)].querySelectorAll(".e-rowcell")),p=e[parseInt(d.toString(),10)].uniqueID;if(-1===this.copiedUniqueIdCollection.indexOf(p)){this.getCopyData(l,!1,"\t",n),this.treeCopyContent=o>0?this.treeCopyContent+this.copyContent+"\n":this.copyContent+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(p),this.copyContent="";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){if(e[parseInt(i.toString(),10)].hasChildRecords)for(var o=e[parseInt(i.toString(),10)].childRecords,a=0;a<o.length;a++)for(var s=0;s<e.length;s++)if(!t.isNullOrUndefined(o[parseInt(a.toString(),10)].uniqueID)&&e[parseInt(s.toString(),10)].uniqueID===o[parseInt(a.toString(),10)].uniqueID){if(!t.isNullOrUndefined(r[parseInt(s.toString(),10)])&&!r[parseInt(s.toString(),10)].classList.contains("e-summaryrow")){var d=[].slice.call(r[parseInt(s.toString(),10)].querySelectorAll(".e-rowcell")),l=e[parseInt(s.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(l)&&(this.getCopyData(d,!1,"\t",n),this.treeCopyContent+="\n"+this.copyContent,this.copyContent="",this.copiedUniqueIdCollection.push(l),this.childContentData(e,s,r,n))}break}},i}(i.Clipboard),G=function(){function e(e){this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"selection"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.checkboxSelection=function(e){var r,n,o=i.getObject("target",e),s=i.parentsUntil(o,"e-checkbox-wrapper");if(s&&s.querySelectorAll(".e-treecheckselect").length>0){n=s.querySelector('input[type="checkbox"]');var d=[];d.push(o.closest("tr").rowIndex),this.selectCheckboxes(d),this.triggerChkChangeEvent(n,n.nextElementSibling.classList.contains("e-check"),o.closest("tr"))}else if(s&&s.querySelectorAll(".e-treeselectall").length>0&&this.parent.autoCheckHierarchy){var l=!s.querySelector(".e-frame").classList.contains("e-check")&&!s.querySelector(".e-frame").classList.contains("e-stop");this.headerSelection(l),n=s.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(n,l,o.closest("tr"))}!t.isNullOrUndefined(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&a(this.parent)&&this.parent.parentQuery.length>0&&((r=this.parent.query.queries).push.apply(r,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("checkboxChange",n)},e.prototype.getCheckboxcolumnIndex=function(){for(var e,t,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].showCheckbox&&(e=i[parseInt(r.toString(),10)].uid);for(var n=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv").length,o=0;o<n;o++)this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[parseInt(o.toString(),10)].getAttribute("e-mappinguid")===e&&(t=o);return t},e.prototype.headerCheckbox=function(){if(this.columnIndex=this.getCheckboxcolumnIndex(),this.columnIndex>-1&&0===this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length){var e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex],i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}});(n=r.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),n.insertBefore(i.cloneNode(),n.firstChild),t.isNullOrUndefined(e)||e.insertBefore(n,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()}else if(this.columnIndex>-1&&this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length>0){var n=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0],o=n.querySelector(".e-frame").classList.contains("e-check");this.parent.autoCheckHierarchy&&o&&this.headerSelection(o)}},e.prototype.renderColumnCheckbox=function(e){var i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),n=e.data;e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox");var o=!t.isNullOrUndefined(n.checkboxState)&&"uncheck"!==n.checkboxState,a=r.createCheckBox(this.parent.createElement,!1,{checked:o,label:" "});if(a.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(a.querySelector(".e-frame").style.width="18px"),"indeterminate"===n.checkboxState){var s=a.querySelectorAll(".e-frame")[0];t.removeClass([s],["e-check","e-stop","e-uncheck"]),a.querySelector(".e-frame").classList.add("e-stop")}return a.insertBefore(i.cloneNode(),a.firstChild),a},e.prototype.columnCheckbox=function(e){var i=this.renderColumnCheckbox(e),r=e.cell.querySelector(".e-treecolumn-container");if(t.isNullOrUndefined(r)){var n=this.parent.createElement("span",{className:"e-treecheckbox"}),o=e.cell.innerHTML;e.cell.innerHTML="",n.innerHTML=o;var a=this.parent.createElement("div",{className:"e-treecheckbox-container"});a.appendChild(i),a.appendChild(n),e.cell.appendChild(a)}else e.cell.querySelector(".e-hierarchycheckbox")||r.insertBefore(i,r.querySelectorAll(".e-treecell")[0])},e.prototype.selectCheckboxes=function(e){if(t.isNullOrUndefined(e)){this.parent.trigger("actionFailure",{error:"The provided value for the rowIndexes is undefined. Please ensure the rowIndexes contains number."})}for(var i=0;i<e.length;i++){var r=this.parent.getCurrentViewRecords()[e[parseInt(i.toString(),10)]],n=m(this.parent,r.uniqueID),o="uncheck"===(r=n).checkboxState?"check":"uncheck";r.checkboxState=o;for(var a=Object.keys(r),s=0;s<a.length;s++)Object.prototype.hasOwnProperty.call(n,a[parseInt(s.toString(),10)])&&(n[a[parseInt(s.toString(),10)]]=r[a[parseInt(s.toString(),10)]]);this.traverSelection(r,o,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},e.prototype.traverSelection=function(e,i,r){var n=0;if(this.updateSelectedItems(e,i),!r&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy){var o=e.childRecords;!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(o=this.getFilteredChildRecords(o)),n=o.length;for(var a=0;a<n;a++)o[parseInt(a.toString(),10)].isSummaryRow||(o[parseInt(a.toString(),10)].hasChildRecords?this.traverSelection(o[parseInt(a.toString(),10)],i,!0):this.updateSelectedItems(o[parseInt(a.toString(),10)],i))}},e.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return t.parent.filterModule.filteredResult.indexOf(e)>-1})},e.prototype.updateParentSelection=function(e){var i=0,r=[],n=m(this.parent,e.uniqueID);n&&n.childRecords&&(r=n.childRecords),!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(r=this.getFilteredChildRecords(r)),i=r&&r.length;var o=0,a=0;if(!t.isNullOrUndefined(n)){for(var s=0;s<r.length;s++){var d=m(this.parent,r[parseInt(s.toString(),10)].uniqueID);t.isNullOrUndefined(d)||("indeterminate"===d.checkboxState?o++:"check"===d.checkboxState&&a++)}o>0||a>0&&a!==i?n.checkboxState="indeterminate":(0!==a||n.hasFilteredChildRecords&&!t.isNullOrUndefined(n.hasFilteredChildRecords)||t.isNullOrUndefined(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==n.checkboxState)&&(0===a&&0===o||0===a&&n.hasFilteredChildRecords&&!t.isNullOrUndefined(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===n.checkboxState)?n.checkboxState="uncheck":n.checkboxState="check",this.updateSelectedItems(n,n.checkboxState),n.parentItem&&this.updateParentSelection(n.parentItem)}},e.prototype.headerSelection=function(e){var i=this,r=0,n=!1;if(!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0){var o=this.parent.filterModule.filteredResult;0===this.filteredList.length&&(this.filteredList=o),this.parent.grid.searchSettings.key.length?this.searchingRecords=o:this.filteredList!==o?(this.filteredList=o,n=!0):n=!1}this.filteredList.length>0&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length&&!t.isNullOrUndefined(e)&&(this.filteredList=this.searchingRecords));var s;if(s=!t.isNullOrUndefined(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&this.parent.filterSettings.columns.length>0?this.filteredList:!t.isNullOrUndefined(this.parent.filterModule)&&this.filteredList.length>0?this.filteredList:this.parent.flatData,s=a(this.parent)?this.parent.getCurrentViewRecords():s,!t.isNullOrUndefined(e))for(var d=0;d<s.length;d++)if(e){if("check"===s[parseInt(d.toString(),10)].checkboxState)continue;if(n)continue;s[parseInt(d.toString(),10)].checkboxState="check",this.updateSelectedItems(s[parseInt(d.toString(),10)],s[parseInt(d.toString(),10)].checkboxState)}else this.selectedItems.indexOf(s[parseInt(d.toString(),10)])>-1&&(s[parseInt(d.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(s[parseInt(d.toString(),10)],s[parseInt(d.toString(),10)].checkboxState),this.parent.autoCheckHierarchy&&this.updateParentSelection(s[parseInt(d.toString(),10)]));!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],s.filter(function(e){e.checkboxState="uncheck",i.updateSelectedItems(e,e.checkboxState)})),r=this.selectedItems.length;var l=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];r>0&&s.length>0?r===s.length||e?(t.removeClass([l],["e-stop"]),l.classList.add("e-check")):(t.removeClass([l],["e-check"]),l.classList.add("e-stop")):t.removeClass([l],["e-check","e-stop"])},e.prototype.updateSelectedItems=function(e,i){var r,n,o=this.parent.grid.currentViewData.filter(function(t){return t.uniqueID===e.uniqueID}),a=this.parent.grid.currentViewData.indexOf(o[0]),s=m(this.parent,e.uniqueID),d=this.parent.getRows()[parseInt(a.toString(),10)];if(a>-1){var l=void 0;(this.parent.frozenRows||this.parent.getFrozenColumns())&&(l=this.parent.getDataRows()[parseInt(a.toString(),10)]),n=d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]:l.querySelectorAll(".e-hierarchycheckbox .e-frame")[0],t.isNullOrUndefined(n)||t.removeClass([n],["e-check","e-stop","e-uncheck"])}if(r=s,t.isNullOrUndefined(r)&&(r=e),r.checkboxState=i,"check"===i&&t.isNullOrUndefined(e.isSummaryRow))-1!==a&&-1===this.selectedIndexes.indexOf(a)&&this.selectedIndexes.push(a),-1===this.selectedItems.indexOf(r)&&-1!==a&&!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1!==this.selectedItems.indexOf(r)||t.isNullOrUndefined(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&t.isNullOrUndefined(this.parent.filterModule)&&this.selectedItems.push(r);else if(("uncheck"===i||"indeterminate"===i)&&t.isNullOrUndefined(e.isSummaryRow)){var p=this.selectedItems.indexOf(r);if(-1!==p&&this.selectedItems.splice(p,1),-1!==this.selectedIndexes.indexOf(a)){var h=this.selectedIndexes.indexOf(a);this.selectedIndexes.splice(h,1)}}var c="indeterminate"===i?"e-stop":"e-"+i;a>-1&&(t.isNullOrUndefined(n)||(n.classList.add(c),d.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===i?"true":"uncheck"===i?"false":"mixed")))},e.prototype.updateGridActions=function(e){var i,r,n=this,o=e.requestType;if(d(this.parent)&&this.parent.autoCheckHierarchy)if("sorting"===o||"paging"===o){var s=this.parent.grid.getRows();r=(i=this.parent.getCurrentViewRecords()).length,this.selectedIndexes=[];for(p=0;p<r;p++)s[parseInt(p.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(p.toString(),10)],i[parseInt(p.toString(),10)].checkboxState)}else if("delete"===o||"add"===e.action){var l=[];"delete"===o?l=e.data:l.push(e.data);for(var p=0;p<l.length;p++){if("delete"===o){var h=this.parent.flatData.indexOf(l[parseInt(p.toString(),10)]),u=this.selectedIndexes.indexOf(h);this.selectedIndexes.splice(u,1),this.updateSelectedItems(l[parseInt(p.toString(),10)],"uncheck")}t.isNullOrUndefined(l[parseInt(p.toString(),10)].parentItem)||this.updateParentSelection(l[parseInt(p.toString(),10)].parentItem)}}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":("filtering"===o||"searching"===o||"refresh"===o&&!a(this.parent))&&(this.selectedItems=[],this.selectedIndexes=[],(i=!t.isNullOrUndefined(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0?this.parent.filterModule.filteredResult:this.parent.flatData).forEach(function(e){if(n.parent.enableVirtualization){e.hasChildRecords&&e.childRecords.length>0?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState);var i=c(e);i=n.getFilteredChildRecords(i);for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)].hasChildRecords?n.updateParentSelection(i[parseInt(r.toString(),10)]):i[parseInt(r.toString(),10)].hasChildRecords||t.isNullOrUndefined(i[parseInt(r.toString(),10)])||n.updateSelectedItems(i[parseInt(r.toString(),10)],i[parseInt(r.toString(),10)].checkboxState)}else e.hasChildRecords?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState)}),this.headerSelection())},e.prototype.getCheckedrecords=function(){return this.selectedItems},e.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes},e}(),Q=function(){function e(e){this.parent=e,i.Grid.Inject(i.Print),this.addEventListener()}return e.prototype.getModuleName=function(){return"print"},e.prototype.addEventListener=function(){this.parent.grid.on("printGrid-Init",this.printTreeGrid,this)},e.prototype.removeEventListener=function(){this.parent.grid.off("printGrid-Init",this.printTreeGrid)},e.prototype.printTreeGrid=function(e){var r=i.getObject("printgrid",e),n=i.getObject("element",e);r.addEventListener("queryCellInfo",this.parent.grid.queryCellInfo),r.addEventListener("rowDataBound",this.parent.grid.rowDataBound),r.addEventListener("beforeDataBound",this.parent.grid.beforeDataBound),t.addClass([n],"e-treegrid")},e.prototype.print=function(){this.parent.grid.print()},e.prototype.destroy=function(){this.removeEventListener()},e}(),K=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])})(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)}}(),W=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},Y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return K(i,e),W([t.Property()],i.prototype,"fields",void 0),W([t.Property(!1)],i.prototype,"ignoreCase",void 0),W([t.Property("contains")],i.prototype,"operator",void 0),W([t.Property()],i.prototype,"key",void 0),W([t.Property()],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),J=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])})(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)}}(),X=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},$=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return J(i,e),X([t.Property("Row")],i.prototype,"mode",void 0),X([t.Property("Flow")],i.prototype,"cellSelectionMode",void 0),X([t.Property("Single")],i.prototype,"type",void 0),X([t.Property(!1)],i.prototype,"persistSelection",void 0),X([t.Property("Default")],i.prototype,"checkboxMode",void 0),X([t.Property(!1)],i.prototype,"checkboxOnly",void 0),X([t.Property(!0)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Z=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 r=e.data,n=r.parentItem;if(!t.isNullOrUndefined(r.parentItem)&&!l(this.parent)&&(!this.parent.allowPaging||"Root"===this.parent.pageSettings.pageSizeMode||a(this.parent)&&!u(this.parent))&&(this.parent.initialRender&&(!(t.isNullOrUndefined(n[this.parent.expandStateMapping])||n[this.parent.expandStateMapping])||this.parent.enableCollapseAll)||!h(this.parent,e.data,this.parent.grid.getCurrentViewRecords()))&&!t.isNullOrUndefined(e.row)){this.parent.toggleRowVisibility(e.row,"e-childrow-hidden");var o=this.parent.grid.getRowsObject();this.parent.grid.isFrozenGrid()||t.isNullOrUndefined(e.row.getAttribute("data-uid"))||(o.filter(function(t){return t.uid===e.row.getAttribute("data-uid")})[0].visible=!1)}if(a(this.parent)&&!u(this.parent)){var s=this.parent,d=this.parent.getCurrentViewRecords().filter(function(e){return t.getValue(s.idMapping,e)===t.getValue(s.parentIdMapping,r)});if(d.length>0&&!d[0].isSummaryRow&&!t.isNullOrUndefined(e.row)){var p=d[0].expanded?"e-childrow-visible":"e-childrow-hidden";this.parent.toggleRowVisibility(e.row,p)}}i.getObject("isSummaryRow",e.data)&&t.addClass([e.row],"e-summaryrow"),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&&(t.isNullOrUndefined(r.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||t.isNullOrUndefined(e.row)||e.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(e.row,!0)}if(this.parent.isReact){var c=this;c.parent.renderReactTemplates(function(){c.parent.trigger("rowDataBound",e)})}else this.parent.trigger("rowDataBound",e)}},e.prototype.cellRender=function(e){if(e.data){var r,n,o=this.parent.grid,s=e.data,d=t.isNullOrUndefined(s.filterLevel)?s.level:s.filterLevel,l=0,p=this.parent.getColumnByUid(e.column.uid),c=s.isSummaryRow,u=this.parent.getFrozenColumns();r=t.isNullOrUndefined(s.parentItem)?s.index:s.parentItem.index;if((this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):o.getColumnIndexByUid(e.column.uid))!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!t.isNullOrUndefined(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var g=t.createElement("div",{className:"e-treecolumn-container"}),f=t.createElement("span",{className:"e-icons e-none"});f.style.width="10px",f.style.display="inline-block";for(var m=0;m<d;m++)l+=10,g.appendChild(f.cloneNode());var y=t.isNullOrUndefined(s.hasFilteredChildRecords)?s.hasChildRecords:s.hasFilteredChildRecords;if(y&&!t.isNullOrUndefined(s.childRecords)&&(y=this.parent.isFromGantt&&this.parent.loadChildOnDemand?s.hasChildRecords:!(0===s.childRecords.length)),y){t.addClass([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",s.expanded?"true":"false");var S=t.createElement("span",{className:"e-icons"}),v=void 0;if(this.parent.initialRender)v=s.expanded&&(t.isNullOrUndefined(s[this.parent.expandStateMapping])||s[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll;else if(v=!(!s.expanded||!h(this.parent,s,this.parent.grid.getCurrentViewRecords())),"Cell"===this.parent.editSettings.mode&&!a(this.parent)){var w=this.parent.flatData.find(function(e){return e.uniqueID===s.uniqueID});t.isNullOrUndefined(w)||(v=s.expanded!==w.expanded?w.expanded:s.expanded)}t.addClass([S],v?"e-treegridexpand":"e-treegridcollapse"),l+=18,g.appendChild(S),f.style.width="4px",l+=7,g.appendChild(f.cloneNode())}else(d||!d&&!s.level)&&(l+=20,g.appendChild(f.cloneNode()),g.appendChild(f.cloneNode()));n=t.createElement("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(n.style.width="Calc(100% - "+l+"px)"),t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level),this.updateTreeCell(e,n),g.appendChild(n),e.cell.appendChild(g)}if(o.getFrozenLeftColumnsCount()>0||o.getFrozenRightColumnsCount()>0){var I=o.getFrozenRightColumns(),R=o.getFrozenLeftColumns(),x=o.getMovableColumns();I.length>0&&I[0].field===e.column.field?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):R.length>0&&R[0].field===e.column.field?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):x.length>0&&x[0].field===e.column.field&&t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level)}else u>this.parent.treeColumnIndex&&u>0&&o.getColumnIndexByUid(e.column.uid)===u?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):u<this.parent.treeColumnIndex&&u>0&&(o.getColumnIndexByUid(e.column.uid)===u||o.getColumnIndexByUid(e.column.uid)===u-1)?t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level):u===this.parent.treeColumnIndex&&u>0&&o.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1&&t.addClass([e.cell],"e-gridrowindex"+r+"level"+s.level);if(!t.isNullOrUndefined(p)&&p.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)){var C=e.cell.querySelectorAll(".e-frame")[0];l+=parseInt(C.style.width,16),l+=10,(n=o.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+l+"px)"}if(c){t.addClass([e.cell],"e-summarycell");var b=i.getObject(e.column.field,e.data);b=t.isNullOrUndefined(b)?null:b,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=b:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=b}this.parent.args=e;var D=t.getValue("columnModel",this.parent)[this.parent.treeColumnIndex];if(t.isNullOrUndefined(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template)this.parent.trigger("queryCellInfo",e);else if(this.parent.isReact&&D.field!==e.column.field){var M=this;M.parent.renderReactTemplates(function(){M.parent.trigger("queryCellInfo",e)})}}},e.prototype.updateTreeCell=function(e,r){var n=t.getValue("columnModel",this.parent)[this.parent.treeColumnIndex],o=e.column.index;t.isNullOrUndefined(n.field)&&e.cell.setAttribute("aria-colindex",o+1+""),n.field!==e.column.field||t.isNullOrUndefined(n.template)||(e.column.template=n.template,e.column.templateFn=i.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)i.appendChildren(r,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(n.field!==e.column.field||t.isNullOrUndefined(n.template))for(;0<s;s=e.cell.children.length)r.appendChild(e.cell.children[parseInt((0).toString(),10)]);else{if(this.parent.isReact&&"string"!=typeof e.column.template){e.column.templateFn(e.data,this.parent,"columnTemplate",d,null,null,r),t.isNullOrUndefined(this.parent.grid.portals)&&(this.parent.grid.portals=this.parent.portals),this.parent.notify("renderReactTemplate",this.parent.portals);var l=this;l.parent.renderReactTemplates(function(){l.parent.trigger("queryCellInfo",e)})}else{var p=e.column.templateFn(i.extend({index:""},e.data),this.parent,"template",d,this.parent.isStringTemplate);i.appendChildren(r,p)}delete e.column.template,delete e.column.templateFn,e.cell.innerHTML=""}}else r.innerHTML=a,e.cell.innerHTML=""},e.prototype.refreshReactColumnTemplateByUid=function(e){var r=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var n=r.parent.grid.getRowsObject(),o=r.parent.getDataRows(),a=r.parent.grid.getIndentCount(),s=r.parent.grid.getNormalizedColumnIndex(e);if(0!==o.length)for(var d=0;d<n.length;d++)if(n[parseInt(d.toString(),10)].isDataRow&&!t.isNullOrUndefined(n[parseInt(d.toString(),10)].index)){var l=n[parseInt(d.toString(),10)].cells[parseInt(s.toString(),10)],p=new i.CellRenderer(r.parent.grid,r.parent.grid.serviceLocator),h=o.length>=n.length?r.parent.getCellFromIndex(n[parseInt(d.toString(),10)].index,s-a):o[n[parseInt(d.toString(),10)].index].querySelector(".e-templatecell");p.refreshTD(h,l,n[parseInt(d.toString(),10)].data,{index:n[parseInt(d.toString(),10)].index});var c=r.parent.getRows()[parseInt(d.toString(),10)].cells[parseInt(s.toString(),10)];r.cellRender({data:n[parseInt(d.toString(),10)].data,cell:c,column:l.column})}})},e.prototype.columnTemplateResult=function(e){this.templateResult=e.template},e.prototype.reactTemplateRender=function(e,t){this.parent.portals=e,this.parent.notify("renderReactTemplate",this.parent.portals),this.parent.renderReactTemplates(t)},e.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)},e}(),ee=function(){function e(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!t.isNullOrUndefined(this.parent.parentIdMapping)}return e.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on("remoteExpand",this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.d