@syncfusion/ej2-treegrid 20.1.47 → 20.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/ej2-treegrid.umd.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-treegrid.es2015.js +74 -39
  5. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  6. package/dist/es6/ej2-treegrid.es5.js +77 -46
  7. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  8. package/dist/global/ej2-treegrid.min.js +2 -2
  9. package/dist/global/ej2-treegrid.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +7 -7
  12. package/src/treegrid/actions/batch-edit.js +21 -4
  13. package/src/treegrid/actions/edit.js +15 -0
  14. package/src/treegrid/actions/filter.js +3 -0
  15. package/src/treegrid/actions/rowdragdrop.js +4 -9
  16. package/src/treegrid/base/treegrid-model.d.ts +1 -1
  17. package/src/treegrid/base/treegrid.d.ts +1 -6
  18. package/src/treegrid/base/treegrid.js +34 -33
  19. package/styles/bootstrap-dark.css +0 -8
  20. package/styles/bootstrap.css +0 -8
  21. package/styles/bootstrap4.css +0 -8
  22. package/styles/bootstrap5-dark.css +0 -8
  23. package/styles/bootstrap5.css +0 -8
  24. package/styles/fabric-dark.css +0 -8
  25. package/styles/fabric.css +0 -8
  26. package/styles/fluent-dark.css +1 -5
  27. package/styles/fluent.css +1 -5
  28. package/styles/highcontrast-light.css +0 -8
  29. package/styles/highcontrast.css +0 -8
  30. package/styles/material-dark.css +0 -8
  31. package/styles/material.css +0 -8
  32. package/styles/tailwind-dark.css +0 -8
  33. package/styles/tailwind.css +0 -8
  34. package/styles/treegrid/_bootstrap-dark-definition.scss +0 -2
  35. package/styles/treegrid/_bootstrap-definition.scss +0 -2
  36. package/styles/treegrid/_bootstrap4-definition.scss +0 -2
  37. package/styles/treegrid/_bootstrap5-definition.scss +0 -2
  38. package/styles/treegrid/_fabric-dark-definition.scss +0 -2
  39. package/styles/treegrid/_fabric-definition.scss +0 -2
  40. package/styles/treegrid/_fluent-definition.scss +0 -1
  41. package/styles/treegrid/_highcontrast-definition.scss +0 -2
  42. package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
  43. package/styles/treegrid/_layout.scss +4 -6
  44. package/styles/treegrid/_material-dark-definition.scss +0 -2
  45. package/styles/treegrid/_material-definition.scss +0 -2
  46. package/styles/treegrid/_tailwind-definition.scss +0 -2
  47. package/styles/treegrid/bootstrap-dark.css +0 -8
  48. package/styles/treegrid/bootstrap.css +0 -8
  49. package/styles/treegrid/bootstrap4.css +0 -8
  50. package/styles/treegrid/bootstrap5-dark.css +0 -8
  51. package/styles/treegrid/bootstrap5.css +0 -8
  52. package/styles/treegrid/fabric-dark.css +0 -8
  53. package/styles/treegrid/fabric.css +0 -8
  54. package/styles/treegrid/fluent-dark.css +1 -5
  55. package/styles/treegrid/fluent.css +1 -5
  56. package/styles/treegrid/highcontrast-light.css +0 -8
  57. package/styles/treegrid/highcontrast.css +0 -8
  58. package/styles/treegrid/material-dark.css +0 -8
  59. package/styles/treegrid/material.css +0 -8
  60. package/styles/treegrid/tailwind-dark.css +0 -8
  61. package/styles/treegrid/tailwind.css +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"ej2-treegrid.min.js","sources":["../../src/treegrid/utils.js","../../src/treegrid/actions/crud-actions.js","../../src/treegrid/models/column.js","../../src/treegrid/models/filter-settings.js","../../src/treegrid/models/textwrap-settings.js","../../src/treegrid/actions/logger.js","../../src/treegrid/actions/clipboard.js","../../src/treegrid/base/constant.js","../../src/treegrid/actions/selection.js","../../src/treegrid/actions/print.js","../../src/treegrid/models/search-settings.js","../../src/treegrid/models/selection-settings.js","../../src/treegrid/renderer/render.js","../../src/treegrid/base/data.js","../../src/treegrid/actions/rowdragdrop.js","../../src/treegrid/enum.js","../../src/treegrid/models/page-settings.js","../../src/treegrid/models/summary.js","../../src/treegrid/models/edit-settings.js","../../src/treegrid/models/sort-settings.js","../../src/treegrid/models/infinite-scroll-settings.js","../../src/treegrid/base/treegrid.js","../../src/treegrid/actions/reorder.js","../../src/treegrid/actions/resize.js","../../src/treegrid/models/rowdrop-settings.js","../../src/treegrid/renderer/virtual-row-model-generator.js","../../src/treegrid/actions/filter.js","../../src/treegrid/actions/excel-export.js","../../src/treegrid/actions/pdf-export.js","../../src/treegrid/actions/page.js","../../src/treegrid/actions/toolbar.js","../../src/treegrid/actions/summary.js","../../src/treegrid/actions/sort.js","../../src/treegrid/actions/column-menu.js","../../src/treegrid/actions/context-menu.js","../../src/treegrid/actions/batch-edit.js","../../src/treegrid/actions/edit.js","../../src/treegrid/actions/command-column.js","../../src/treegrid/actions/detail-row.js","../../src/treegrid/renderer/virtual-tree-content-render.js","../../src/treegrid/actions/virtual-scroll.js","../../src/treegrid/actions/freeze-column.js","../../src/treegrid/actions/column-chooser.js","../../src/treegrid/actions/infinite-scroll.js","../../src/global.js"],"sourcesContent":["import { getObject } from '@syncfusion/ej2-grids';\nimport { DataManager, ODataAdaptor, UrlAdaptor } from '@syncfusion/ej2-data';\nimport { WebApiAdaptor, WebMethodAdaptor, CacheAdaptor } from '@syncfusion/ej2-data';\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Specifies whether remote data binding\n */\nexport function isRemoteData(parent) {\n if (parent.dataSource instanceof DataManager) {\n var adaptor = parent.dataSource.adaptor;\n return (adaptor instanceof ODataAdaptor ||\n (adaptor instanceof WebApiAdaptor) || (adaptor instanceof WebMethodAdaptor) ||\n (adaptor instanceof CacheAdaptor) || adaptor instanceof UrlAdaptor);\n }\n return false;\n}\n/**\n * @param {TreeGrid | IGrid} parent - Tree Grid or Grid instance\n * @returns {boolean} - Returns whether custom binding\n */\nexport function isCountRequired(parent) {\n if (parent.dataSource && 'result' in parent.dataSource) {\n return true;\n }\n return false;\n}\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Returns whether checkbox column is enabled\n */\nexport function isCheckboxcolumn(parent) {\n for (var i = 0; i < parent.columns.length; i++) {\n if (parent.columns[i].showCheckbox) {\n return true;\n }\n }\n return false;\n}\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Returns whether filtering and searching done\n */\nexport function isFilterChildHierarchy(parent) {\n if ((!isNullOrUndefined(parent.grid.searchSettings.key) && parent.grid.searchSettings.key !== '' &&\n (parent.searchSettings.hierarchyMode === 'Child' || parent.searchSettings.hierarchyMode === 'None')) ||\n (parent.allowFiltering && parent.grid.filterSettings.columns.length &&\n (parent.filterSettings.hierarchyMode === 'Child' || parent.filterSettings.hierarchyMode === 'None'))) {\n return true;\n }\n return false;\n}\n/**\n * @param {Object} records - Define records for which parent records has to be found\n * @hidden\n * @returns {Object} - Returns parent records collection\n */\nexport function findParentRecords(records) {\n var datas = [];\n var recordsLength = Object.keys(records).length;\n for (var i = 0, len = recordsLength; i < len; i++) {\n var hasChild = getObject('hasChildRecords', records[i]);\n if (hasChild) {\n datas.push(records[i]);\n }\n }\n return datas;\n}\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Returns the expand status of record\n * @param {ITreeData} record - Define the record for which expand status has be found\n * @param {ITreeData[]} parents - Parent Data collection\n * @hidden\n */\nexport function getExpandStatus(parent, record, parents) {\n var parentRecord = isNullOrUndefined(record.parentItem) ? null :\n getParentData(parent, record.parentItem.uniqueID);\n var childParent;\n if (parentRecord != null) {\n if (parent.initialRender && !isNullOrUndefined(parentRecord[parent.expandStateMapping])\n && !parentRecord[parent.expandStateMapping]) {\n parentRecord.expanded = false;\n return false;\n }\n else if (parentRecord.expanded === false) {\n return false;\n }\n else if (parentRecord.parentItem) {\n childParent = getParentData(parent, parentRecord.parentItem.uniqueID);\n if (childParent && parent.initialRender && !isNullOrUndefined(childParent[parent.expandStateMapping])\n && !childParent[parent.expandStateMapping]) {\n childParent.expanded = false;\n return false;\n }\n if (childParent && childParent.expanded === false) {\n return false;\n }\n else if (childParent) {\n return getExpandStatus(parent, childParent, parents);\n }\n return true;\n }\n else {\n return true;\n }\n }\n else {\n return true;\n }\n}\n/**\n * @param {ITreeData} records - Define the record for which child records has to be found\n * @returns {Object[]} - Returns child records collection\n * @hidden\n */\nexport function findChildrenRecords(records) {\n var datas = [];\n if (isNullOrUndefined(records) || (!records.hasChildRecords && !isNullOrUndefined(records.childRecords)\n && !records.childRecords.length)) {\n return [];\n }\n if (!isNullOrUndefined(records.childRecords)) {\n var childRecords = records.childRecords;\n var keys = Object.keys(childRecords);\n for (var i = 0, len = keys.length; i < len; i++) {\n datas.push(childRecords[i]);\n if (childRecords[i].hasChildRecords || (!isNullOrUndefined(childRecords[i].childRecords) &&\n childRecords[i].childRecords.length)) {\n datas = datas.concat(findChildrenRecords(childRecords[i]));\n }\n }\n }\n return datas;\n}\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Returns whether local data binding\n */\nexport function isOffline(parent) {\n if (isRemoteData(parent)) {\n var dm = parent.dataSource;\n return !isNullOrUndefined(dm.ready);\n }\n return true;\n}\n/**\n * @param {Object[]} array - Defines the array to be cloned\n * @returns {Object[]} - Returns cloned array collection\n */\nexport function extendArray(array) {\n var objArr = [];\n var obj;\n var keys;\n for (var i = 0; array && i < array.length; i++) {\n keys = Object.keys(array[i]);\n obj = {};\n for (var j = 0; j < keys.length; j++) {\n obj[keys[j]] = array[i][keys[j]];\n }\n objArr.push(obj);\n }\n return objArr;\n}\n/**\n * @param {ITreeData} value - Defined the dirty data to be cleaned\n * @returns {ITreeData} - Returns cleaned original data\n */\nexport function getPlainData(value) {\n delete value.hasChildRecords;\n delete value.childRecords;\n delete value.index;\n delete value.parentItem;\n delete value.level;\n delete value.taskData;\n delete value.uniqueID;\n return value;\n}\n/**\n * @param {TreeGrid} parent - TreeGrid instance\n * @param {string} value - IdMapping field name\n * @param {boolean} requireFilter - Specified whether treegrid data is filtered\n * @returns {ITreeData} - Returns IdMapping matched record\n */\nexport function getParentData(parent, value, requireFilter) {\n if (requireFilter) {\n var idFilter = 'uniqueIDFilterCollection';\n return parent[idFilter][value];\n }\n else {\n var id = 'uniqueIDCollection';\n return parent[id][value];\n }\n}\n/**\n * @param {HTMLTableRowElement} el - Row element\n * @returns {boolean} - Returns whether hidden\n */\nexport function isHidden(el) {\n var style = window.getComputedStyle(el);\n return ((style.display === 'none') || (style.visibility === 'hidden'));\n}\n","import { isNullOrUndefined, extend, getValue } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { extendArray, getPlainData, getParentData } from '../utils';\n/**\n * Performs CRUD update to Tree Grid data source\n *\n * @param {{value: ITreeData, action: string }} details - Gets modified record value and CRUD action type\n * @param {TreeGrid} details.value - Gets modified record value\n * @param {string} details.action - CRUD action type\n * @param {TreeGrid} control - Tree Grid instance\n * @param {boolean} isSelfReference - Denotes whether Self Referential data binding\n * @param {number} addRowIndex - New add row index\n * @param {number} selectedIndex - Selected Row index\n * @param {string} columnName - Column field name\n * @param {ITreeData} addRowRecord - Newly added record\n * @returns {void}\n */\nexport function editAction(details, control, isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord) {\n var value = details.value;\n var action = details.action;\n var changedRecords = 'changedRecords';\n var i;\n var j;\n var addedRecords = 'addedRecords';\n var batchChanges;\n var key = control.grid.getPrimaryKeyFieldNames()[0];\n var treeData = control.dataSource instanceof DataManager ?\n control.dataSource.dataSource.json : control.dataSource;\n var modifiedData = [];\n var originalData = value;\n var isSkip = false;\n if (control.editSettings.mode === 'Batch') {\n batchChanges = control.grid.editModule.getBatchChanges();\n }\n if (action === 'add' || (action === 'batchsave' && (control.editSettings.mode === 'Batch'\n && batchChanges[addedRecords].length))) {\n var addAct = addAction(details, treeData, control, isSelfReference, addRowIndex, selectedIndex, addRowRecord);\n value = addAct.value;\n isSkip = addAct.isSkip;\n }\n if (value instanceof Array) {\n modifiedData = extendArray(value);\n }\n else {\n modifiedData.push(extend({}, value));\n }\n if (!isSkip && (action !== 'add' ||\n (control.editSettings.newRowPosition !== 'Top' && control.editSettings.newRowPosition !== 'Bottom'))) {\n for (var k = 0; k < modifiedData.length; k++) {\n if (typeof (modifiedData[k][key]) === 'object') {\n modifiedData[k] = modifiedData[k][key];\n }\n var keys = modifiedData[k].taskData ? Object.keys(modifiedData[k].taskData) :\n Object.keys(modifiedData[k]);\n i = treeData.length;\n var _loop_1 = function () {\n if (treeData[i][key] === modifiedData[k][key]) {\n if (action === 'delete') {\n var currentData_1 = treeData[i];\n treeData.splice(i, 1);\n if (isSelfReference) {\n if (!isNullOrUndefined(currentData_1[control.parentIdMapping])) {\n var parentData = control.flatData.filter(function (e) {\n return e[control.idMapping] === currentData_1[control.parentIdMapping];\n })[0];\n var childRecords = parentData ? parentData[control.childMapping] : [];\n for (var p = childRecords.length - 1; p >= 0; p--) {\n if (childRecords[p][control.idMapping] === currentData_1[control.idMapping]) {\n if (!control.enableImmutableMode) {\n parentData['childRecords'].splice(p, 1);\n }\n childRecords.splice(p, 1);\n if (!childRecords.length) {\n parentData.hasChildRecords = false;\n updateParentRow(key, parentData, action, control, isSelfReference);\n }\n break;\n }\n }\n }\n return \"break\";\n }\n }\n else {\n if (action === 'edit') {\n for (j = 0; j < keys.length; j++) {\n if (Object.prototype.hasOwnProperty.call(treeData[i], keys[j]) && ((control.editSettings.mode !== 'Cell'\n || (!isNullOrUndefined(batchChanges) && batchChanges[changedRecords].length === 0))\n || keys[j] === columnName)) {\n var editedData = getParentData(control, modifiedData[k].uniqueID);\n treeData[i][keys[j]] = modifiedData[k][keys[j]];\n if (editedData && editedData.taskData) {\n editedData.taskData[keys[j]] = editedData[keys[j]] = treeData[i][keys[j]];\n }\n }\n }\n }\n else if (action === 'add' || action === 'batchsave') {\n var index = void 0;\n if (control.editSettings.newRowPosition === 'Child') {\n if (isSelfReference) {\n originalData.taskData[control.parentIdMapping] = treeData[i][control.idMapping];\n treeData.splice(i + 1, 0, originalData.taskData);\n }\n else {\n if (!Object.prototype.hasOwnProperty.call(treeData[i], control.childMapping)) {\n treeData[i][control.childMapping] = [];\n }\n treeData[i][control.childMapping].push(originalData.taskData);\n updateParentRow(key, treeData[i], action, control, isSelfReference, originalData);\n }\n }\n else if (control.editSettings.newRowPosition === 'Below') {\n treeData.splice(i + 1, 0, originalData.taskData);\n if (!isNullOrUndefined(originalData.parentItem)) {\n updateParentRow(key, treeData[i + 1], action, control, isSelfReference, originalData);\n }\n }\n else if (!addRowIndex) {\n index = 0;\n treeData.splice(index, 0, originalData.taskData);\n }\n else if (control.editSettings.newRowPosition === 'Above') {\n treeData.splice(i, 0, originalData.taskData);\n if (!isNullOrUndefined(originalData.parentItem)) {\n updateParentRow(key, treeData[i], action, control, isSelfReference, originalData);\n }\n }\n }\n return \"break\";\n }\n }\n else if (!isNullOrUndefined(treeData[i][control.childMapping])) {\n if (removeChildRecords(treeData[i][control.childMapping], modifiedData[k], action, key, control, isSelfReference, originalData, columnName)) {\n updateParentRow(key, treeData[i], action, control, isSelfReference);\n }\n }\n };\n while (i-- && i >= 0) {\n var state_1 = _loop_1();\n if (state_1 === \"break\")\n break;\n }\n }\n }\n}\n/**\n * Performs Add action to Tree Grid data source\n *\n * @param {{value: ITreeData, action: string }} details - Gets modified record value and CRUD action type\n * @param {TreeGrid} details.value - Gets modified record value\n * @param {string} details.action - CRUD action type\n * @param {Object[]} treeData - Tree Grid data source\n * @param {TreeGrid} control - Tree Grid instance\n * @param {boolean} isSelfReference - Denotes whether Self Referential data binding\n * @param {number} addRowIndex - New add row index\n * @param {number} selectedIndex - Selected Row index\n * @param {ITreeData} addRowRecord - Newly added record\n * @returns {void}\n */\nexport function addAction(details, treeData, control, isSelfReference, addRowIndex, selectedIndex, addRowRecord) {\n var value;\n var isSkip = false;\n var currentViewRecords = control.grid.getCurrentViewRecords();\n value = extend({}, details.value);\n value = getPlainData(value);\n switch (control.editSettings.newRowPosition) {\n case 'Top':\n treeData.unshift(value);\n isSkip = true;\n break;\n case 'Bottom':\n treeData.push(value);\n isSkip = true;\n break;\n case 'Above':\n if (!isNullOrUndefined(addRowRecord)) {\n value = extend({}, addRowRecord);\n value = getPlainData(value);\n }\n else {\n value = extend({}, currentViewRecords[addRowIndex + 1]);\n value = getPlainData(value);\n }\n break;\n case 'Below':\n case 'Child':\n if (!isNullOrUndefined(addRowRecord)) {\n value = extend({}, addRowRecord);\n value = getPlainData(value);\n }\n else {\n var primaryKeys = control.grid.getPrimaryKeyFieldNames()[0];\n var currentdata = currentViewRecords[addRowIndex];\n if (!isNullOrUndefined(currentdata) && currentdata[primaryKeys] === details.value[primaryKeys] || selectedIndex !== -1) {\n value = extend({}, currentdata);\n }\n else {\n value = extend({}, details.value);\n }\n value = getPlainData(value);\n var internalProperty = 'internalProperties';\n control.editModule[internalProperty].taskData = value;\n }\n if (selectedIndex === -1) {\n treeData.unshift(value);\n isSkip = true;\n }\n }\n return { value: value, isSkip: isSkip };\n}\n/**\n * @param {ITreeData[]} childRecords - Child Records collection\n * @param {Object} modifiedData - Modified data in crud action\n * @param {string} action - crud action type\n * @param {string} key - Primary key field name\n * @param {TreeGrid} control - Tree Grid instance\n * @param {boolean} isSelfReference - Specified whether Self Referential data binding\n * @param {ITreeData} originalData - Non updated data from data source, of edited data\n * @param {string} columnName - column field name\n * @returns {boolean} Returns whether child records exists\n */\nexport function removeChildRecords(childRecords, modifiedData, action, key, control, isSelfReference, originalData, columnName) {\n var isChildAll = false;\n var j = childRecords.length;\n while (j-- && j >= 0) {\n if (childRecords[j][key] === modifiedData[key] ||\n (isSelfReference && childRecords[j][control.parentIdMapping] === modifiedData[control.idMapping])) {\n if (action === 'edit') {\n var keys = Object.keys(modifiedData);\n var editedData = getParentData(control, modifiedData.uniqueID);\n for (var i = 0; i < keys.length; i++) {\n if (Object.prototype.hasOwnProperty.call(childRecords[j], keys[i]) && (control.editSettings.mode !== 'Cell' || keys[i] === columnName)) {\n editedData[keys[i]] = editedData.taskData[keys[i]] = childRecords[j][keys[i]] = modifiedData[keys[i]];\n if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell') {\n var editModule = 'editModule';\n control.grid.editModule[editModule].editRowIndex = modifiedData.index;\n control.grid.editModule[editModule].updateCurrentViewData(modifiedData);\n }\n }\n }\n break;\n }\n else if (action === 'add' || action === 'batchsave') {\n if (control.editSettings.newRowPosition === 'Child') {\n if (isSelfReference) {\n originalData[control.parentIdMapping] = childRecords[j][control.idMapping];\n childRecords.splice(j + 1, 0, originalData);\n updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);\n }\n else {\n if (!Object.prototype.hasOwnProperty.call(childRecords[j], control.childMapping)) {\n childRecords[j][control.childMapping] = [];\n }\n childRecords[j][control.childMapping].push(originalData.taskData);\n updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);\n }\n }\n else if (control.editSettings.newRowPosition === 'Above') {\n childRecords.splice(j, 0, originalData.taskData);\n if (!isNullOrUndefined(originalData.parentItem)) {\n updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);\n }\n }\n else if (control.editSettings.newRowPosition === 'Below') {\n childRecords.splice(j + 1, 0, originalData.taskData);\n if (!isNullOrUndefined(originalData.parentItem)) {\n updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);\n }\n }\n }\n else {\n childRecords.splice(j, 1);\n if (!childRecords.length) {\n isChildAll = true;\n }\n }\n }\n else if (!isNullOrUndefined(childRecords[j][control.childMapping])) {\n if (removeChildRecords(childRecords[j][control.childMapping], modifiedData, action, key, control, isSelfReference, originalData, columnName)) {\n updateParentRow(key, childRecords[j], action, control, isSelfReference);\n }\n }\n }\n return isChildAll;\n}\n/**\n * @param {string} key - Primary key field name\n * @param {ITreeData} record - Parent Record which has to be updated\n * @param {string} action - CRUD action type\n * @param {TreeGrid} control - Tree Grid instance\n * @param {boolean} isSelfReference - Specified whether self referential data binding\n * @param {ITreeData} child - Specifies child record\n * @returns {void}\n */\nexport function updateParentRow(key, record, action, control, isSelfReference, child) {\n if ((control.editSettings.newRowPosition === 'Above' || control.editSettings.newRowPosition === 'Below')\n && ((action === 'add' || action === 'batchsave')) && !isNullOrUndefined(child.parentItem)) {\n var parentData = getParentData(control, child.parentItem.uniqueID);\n parentData.childRecords.push(child);\n }\n else {\n var currentRecords = control.grid.getCurrentViewRecords();\n var index_1;\n currentRecords.map(function (e, i) { if (e[key] === record[key]) {\n index_1 = i;\n return;\n } });\n if (!isNullOrUndefined(index_1)) {\n record = currentRecords[index_1];\n }\n if (control.enableVirtualization && isNullOrUndefined(record) && !isNullOrUndefined(child)) {\n record = getValue('uniqueIDCollection.' + child.parentUniqueID, control);\n }\n if (!isSelfReference && !isNullOrUndefined(record.childRecords) && record.childRecords.length) {\n record.hasChildRecords = true;\n }\n else {\n record.hasChildRecords = false;\n }\n if (action === 'add' || action === 'batchsave') {\n record.expanded = true;\n record.hasChildRecords = true;\n if (control.sortSettings.columns.length && isNullOrUndefined(child)) {\n child = currentRecords.filter(function (e) {\n if (e.parentUniqueID === record.uniqueID) {\n return e;\n }\n else {\n return null;\n }\n });\n }\n var childRecords = child ? child instanceof Array ? child[0] : child : currentRecords[index_1 + 1];\n if (control.editSettings.newRowPosition !== 'Below') {\n if (!Object.prototype.hasOwnProperty.call(record, 'childRecords')) {\n record.childRecords = [];\n }\n else {\n if (!isNullOrUndefined(child) && record[key] !== child[key]) {\n record.childRecords.push(child);\n }\n }\n if (record.childRecords.indexOf(childRecords) === -1 && record[key] !== child[key]) {\n record.childRecords.unshift(childRecords);\n }\n if (isSelfReference) {\n if (!Object.prototype.hasOwnProperty.call(record, control.childMapping)) {\n record[control.childMapping] = [];\n }\n if (record[control.childMapping].indexOf(childRecords) === -1 && record[key] !== child[key]) {\n record[control.childMapping].unshift(childRecords);\n }\n }\n }\n }\n var primaryKeys = control.grid.getPrimaryKeyFieldNames()[0];\n var data = control.grid.dataSource instanceof DataManager ?\n control.grid.dataSource.dataSource.json : control.grid.dataSource;\n for (var i = 0; i < data.length; i++) {\n if (data[i][primaryKeys] === record[primaryKeys]) {\n data[i] = record;\n break;\n }\n }\n control.grid.setRowData(key, record);\n var row = control.getRowByIndex(index_1);\n if (control.editSettings.mode === 'Batch') {\n row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record[key])];\n }\n var movableRow = void 0;\n if (control.frozenRows || control.getFrozenColumns()) {\n movableRow = control.getMovableRowByIndex(index_1);\n }\n if (!control.enableVirtualization && !isNullOrUndefined(row) || !isNullOrUndefined(movableRow)) {\n var index_2 = control.treeColumnIndex;\n if (control.allowRowDragAndDrop && control.enableImmutableMode) {\n index_2 = index_2 + 1;\n }\n control.renderModule.cellRender({\n data: record, cell: row.cells[index_2] ? row.cells[index_2]\n : movableRow.cells[index_2 - control.getFrozenColumns()],\n column: control.grid.getColumns()[control.treeColumnIndex],\n requestType: action\n });\n if (control.enableImmutableMode && control['action'] === 'indenting' || control['action'] === 'outdenting') {\n control.renderModule.RowModifier({\n data: record, row: row\n });\n }\n }\n }\n}\n","import { merge } from '@syncfusion/ej2-base';\n/**\n * Represents TreeGrid `Column` model class.\n */\nvar Column = /** @class */ (function () {\n function Column(options) {\n /**\n * If `allowEditing` set to false, then it disables editing of a particular column.\n * By default all columns are editable.\n *\n * @default true\n */\n this.allowEditing = true;\n /**\n * Defines the `IEditCell` object to customize default edit cell.\n *\n * @default {}\n */\n this.edit = {};\n /**\n * If `disableHtmlEncode` is set to true, it encodes the HTML of the header and content cells.\n *\n * @default true\n */\n this.disableHtmlEncode = true;\n /**\n * If `allowReordering` set to false, then it disables reorder of a particular column.\n * By default all columns can be reorder.\n *\n * @default true\n */\n this.allowReordering = true;\n /**\n * If `showColumnMenu` set to false, then it disable the column menu of a particular column.\n * By default column menu will show for all columns\n *\n * @default true\n */\n this.showColumnMenu = true;\n /**\n * If `allowFiltering` set to false, then it disables filtering option and filter bar element of a particular column.\n * By default all columns are filterable.\n *\n * @default true\n */\n this.allowFiltering = true;\n /**\n * If `allowSorting` set to false, then it disables sorting option of a particular column.\n * By default all columns are sortable.\n *\n * @default true\n */\n this.allowSorting = true;\n /**\n * If `allowResizing` is set to false, it disables resize option of a particular column.\n * By default all the columns can be resized.\n *\n * @default true\n */\n this.allowResizing = true;\n /**\n * It is used to customize the default filter options for a specific columns.\n * * type - Specifies the filter type as menu.\n * * ui - to render custom component for specific column it has following functions.\n * * ui.create – It is used for creating custom components.\n * * ui.read - It is used for read the value from the component.\n * * ui.write - It is used to apply component model as dynamically.\n *\n * @default null\n */\n this.filter = {};\n merge(this, options);\n }\n return Column;\n}());\nexport { Column };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Collection, Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Represents the Tree Grid predicate for the filter column.\n */\nvar Predicate = /** @class */ (function (_super) {\n __extends(Predicate, _super);\n function Predicate() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], Predicate.prototype, \"field\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"operator\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"value\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"matchCase\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"ignoreAccent\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"predicate\", void 0);\n __decorate([\n Property({})\n ], Predicate.prototype, \"actualFilterValue\", void 0);\n __decorate([\n Property({})\n ], Predicate.prototype, \"actualOperator\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"type\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"ejpredicate\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"uid\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"isForeignKey\", void 0);\n return Predicate;\n}(ChildProperty));\nexport { Predicate };\n/**\n * Configures the filtering behavior of the TreeGrid.\n */\nvar FilterSettings = /** @class */ (function (_super) {\n __extends(FilterSettings, _super);\n function FilterSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Collection([], Predicate)\n ], FilterSettings.prototype, \"columns\", void 0);\n __decorate([\n Property('FilterBar')\n ], FilterSettings.prototype, \"type\", void 0);\n __decorate([\n Property()\n ], FilterSettings.prototype, \"mode\", void 0);\n __decorate([\n Property(true)\n ], FilterSettings.prototype, \"showFilterBarStatus\", void 0);\n __decorate([\n Property(1500)\n ], FilterSettings.prototype, \"immediateModeDelay\", void 0);\n __decorate([\n Property()\n ], FilterSettings.prototype, \"operators\", void 0);\n __decorate([\n Property(false)\n ], FilterSettings.prototype, \"ignoreAccent\", void 0);\n __decorate([\n Property('Parent')\n ], FilterSettings.prototype, \"hierarchyMode\", void 0);\n return FilterSettings;\n}(ChildProperty));\nexport { FilterSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the textwrap behavior of the TreeGrid.\n */\nvar TextWrapSettings = /** @class */ (function (_super) {\n __extends(TextWrapSettings, _super);\n function TextWrapSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('Both')\n ], TextWrapSettings.prototype, \"wrapMode\", void 0);\n return TextWrapSettings;\n}(ChildProperty));\nexport { TextWrapSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { Logger as GridLogger, Grid, detailLists } from '@syncfusion/ej2-grids';\n/**\n * Logger module for TreeGrid\n *\n * @hidden\n */\nvar DOC_URL = 'https://ej2.syncfusion.com/documentation/treegrid';\nvar BASE_DOC_URL = 'https://ej2.syncfusion.com/documentation';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar WARNING = '[EJ2TreeGrid.Warning]';\nvar ERROR = '[EJ2TreeGrid.Error]';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar INFO = '[EJ2TreeGrid.Info]';\nvar IsRowDDEnabled = false;\nvar Logger = /** @class */ (function (_super) {\n __extends(Logger, _super);\n function Logger(parent) {\n var _this = this;\n Grid.Inject(GridLogger);\n _this = _super.call(this, parent) || this;\n return _this;\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} - Returns Logger module name\n */\n Logger.prototype.getModuleName = function () {\n return 'logger';\n };\n Logger.prototype.log = function (types, args) {\n if (!(types instanceof Array)) {\n types = [types];\n }\n var type = types;\n for (var i = 0; i < type.length; i++) {\n var item = detailLists[type[i]];\n var cOp = item.check(args, this.parent);\n if (cOp.success) {\n var message = item.generateMessage(args, this.parent, cOp.options);\n message = message.replace('EJ2Grid', 'EJ2TreeGrid').replace('* Hierarchy Grid', '').replace('* Grouping', '');\n if (IsRowDDEnabled && type[i] === 'primary_column_missing') {\n message = message.replace('Editing', 'Row DragAndDrop');\n IsRowDDEnabled = false;\n }\n var index = message.indexOf('https');\n var gridurl = message.substring(index);\n if (type[i] === 'module_missing') {\n message = message.replace(gridurl, DOC_URL + '/modules');\n }\n else if (type[i] === 'primary_column_missing' || type[i] === 'selection_key_missing') {\n message = message.replace(gridurl, BASE_DOC_URL + '/api/treegrid/column/#isprimarykey');\n }\n else if (type[i] === 'grid_remote_edit') {\n message = message.replace(gridurl, DOC_URL + '/edit');\n }\n else if (type[i] === 'virtual_height') {\n message = message.replace(gridurl, DOC_URL + '/virtual');\n }\n else if (type[i] === 'check_datasource_columns') {\n message = message.replace(gridurl, DOC_URL + '/columns');\n }\n else if (type[i] === 'locale_missing') {\n message = message.replace(gridurl, DOC_URL + '/global-local/#localization');\n }\n if (type[i] === 'datasource_syntax_mismatch') {\n if (!isNullOrUndefined(this.treeGridObj) && !isNullOrUndefined(this.treeGridObj.dataStateChange)) {\n // eslint-disable-next-line no-console\n console[item.logType](message);\n }\n }\n else {\n // eslint-disable-next-line no-console\n console[item.logType](message);\n }\n }\n }\n };\n Logger.prototype.treeLog = function (types, args, treeGrid) {\n this.treeGridObj = treeGrid;\n if (!(types instanceof Array)) {\n types = [types];\n }\n var type = types;\n if (treeGrid.allowRowDragAndDrop && !treeGrid.columns.filter(function (column) { return column.isPrimaryKey; }).length) {\n IsRowDDEnabled = true;\n this.log('primary_column_missing', args);\n }\n for (var i = 0; i < type.length; i++) {\n var item = treeGridDetails[type[i]];\n var cOp = item.check(args, treeGrid);\n if (cOp.success) {\n var message = item.generateMessage(args, treeGrid, cOp.options);\n // eslint-disable-next-line no-console\n console[item.logType](message);\n }\n }\n };\n return Logger;\n}(GridLogger));\nexport { Logger };\nexport var treeGridDetails = {\n // eslint-disable-next-line camelcase\n mapping_fields_missing: {\n type: 'mapping_fields_missing',\n logType: 'error',\n check: function (args, parent) {\n var opt = { success: false };\n if ((isNullOrUndefined(parent.idMapping) && isNullOrUndefined(parent.childMapping)\n && isNullOrUndefined(parent.parentIdMapping)) ||\n (!isNullOrUndefined(parent.idMapping) && isNullOrUndefined(parent.parentIdMapping)) ||\n (isNullOrUndefined(parent.idMapping) && !isNullOrUndefined(parent.parentIdMapping))) {\n opt = { success: true };\n }\n return opt;\n },\n generateMessage: function () {\n return ERROR + ':' + ' MAPPING FIELDS MISSING \\n' + 'One of the following fields is missing. It is ' +\n 'required for the hierarchical relationship of records in TreeGrid:\\n' +\n '* childMapping\\n' + '* idMapping\\n' + '* parentIdMapping\\n' +\n 'Refer to the following documentation links for more details.\\n' +\n (BASE_DOC_URL + \"/api/treegrid#childmapping\") + '\\n' +\n (BASE_DOC_URL + \"/api/treegrid#idmapping\") + '\\n' +\n (BASE_DOC_URL + \"/api/treegrid#$parentidmapping\");\n }\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as events from '../base/constant';\nimport { isNullOrUndefined, Browser } from '@syncfusion/ej2-base';\nimport { Clipboard as GridClipboard } from '@syncfusion/ej2-grids';\n/**\n * The `Clipboard` module is used to handle clipboard copy action.\n *\n * @hidden\n */\nvar TreeClipboard = /** @class */ (function (_super) {\n __extends(TreeClipboard, _super);\n function TreeClipboard(parent) {\n var _this = _super.call(this, parent.grid) || this;\n _this.treeCopyContent = '';\n _this.copiedUniqueIdCollection = [];\n _this.treeGridParent = parent;\n return _this;\n }\n TreeClipboard.prototype.setCopyData = function (withHeader) {\n var copyContent = 'copyContent';\n var getCopyData = 'getCopyData';\n var isSelect = 'isSelect';\n var uniqueID = 'uniqueID';\n var currentRecords = this.treeGridParent.getCurrentViewRecords();\n if (window.getSelection().toString() === '') {\n this.clipBoardTextArea.value = this[copyContent] = '';\n var rows = this.treeGridParent.grid.getRows();\n if (this.treeGridParent.selectionSettings.mode !== 'Cell') {\n var selectedIndexes = this.treeGridParent.getSelectedRowIndexes().sort(function (a, b) {\n return a - b;\n });\n for (var i = 0; i < selectedIndexes.length; i++) {\n if (i > 0) {\n this.treeCopyContent += '\\n';\n }\n if (!rows[selectedIndexes[i]].classList.contains('e-summaryrow')) {\n var cells = [].slice.call(rows[selectedIndexes[i]].querySelectorAll('.e-rowcell'));\n var uniqueid = this.treeGridParent.getSelectedRecords()[i][uniqueID];\n if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {\n if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {\n this.parentContentData(currentRecords, selectedIndexes[i], rows, withHeader, i);\n }\n this[getCopyData](cells, false, '\\t', withHeader);\n this.treeCopyContent += this[copyContent];\n this.copiedUniqueIdCollection.push(uniqueid);\n this[copyContent] = '';\n if (this.treeGridParent.copyHierarchyMode === 'Child' || this.treeGridParent.copyHierarchyMode === 'Both') {\n this.childContentData(currentRecords, selectedIndexes[i], rows, withHeader);\n }\n }\n }\n }\n if (withHeader) {\n var headerTextArray = [];\n for (var i = 0; i < this.treeGridParent.getVisibleColumns().length; i++) {\n headerTextArray[i] = this.treeGridParent.getVisibleColumns()[i].headerText;\n }\n this[getCopyData](headerTextArray, false, '\\t', withHeader);\n this.treeCopyContent = this[copyContent] + '\\n' + this.treeCopyContent;\n }\n var args = {\n data: this.treeCopyContent,\n cancel: false\n };\n this.treeGridParent.trigger(events.beforeCopy, args);\n if (args.cancel) {\n return;\n }\n this.clipBoardTextArea.value = this[copyContent] = args.data;\n if (!Browser.userAgent.match(/ipad|ipod|iphone/i)) {\n this.clipBoardTextArea.select();\n }\n else {\n this.clipBoardTextArea.setSelectionRange(0, this.clipBoardTextArea.value.length);\n }\n this[isSelect] = true;\n this.copiedUniqueIdCollection = [];\n this.treeCopyContent = '';\n }\n else {\n _super.prototype.setCopyData.call(this, withHeader);\n }\n }\n };\n TreeClipboard.prototype.parentContentData = function (currentRecords, selectedIndex, rows, withHeader, index) {\n var getCopyData = 'getCopyData';\n var copyContent = 'copyContent';\n var parentItem = 'parentItem';\n var uniqueID = 'uniqueID';\n var level = 'level';\n if (!isNullOrUndefined(currentRecords[selectedIndex][parentItem])) {\n var treeLevel = currentRecords[selectedIndex][parentItem][level];\n for (var i = 0; i < treeLevel + 1; i++) {\n for (var j = 0; j < currentRecords.length; j++) {\n if (!isNullOrUndefined(currentRecords[selectedIndex][parentItem]) &&\n currentRecords[j][uniqueID] === currentRecords[selectedIndex][parentItem][uniqueID]) {\n selectedIndex = j;\n var cells = [].slice.call(rows[selectedIndex].querySelectorAll('.e-rowcell'));\n var uniqueid = currentRecords[j][uniqueID];\n if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {\n this[getCopyData](cells, false, '\\t', withHeader);\n if (index > 0) {\n this.treeCopyContent = this.treeCopyContent + this[copyContent] + '\\n';\n }\n else {\n this.treeCopyContent = this[copyContent] + '\\n' + this.treeCopyContent;\n }\n this.copiedUniqueIdCollection.push(uniqueid);\n this[copyContent] = '';\n break;\n }\n }\n }\n }\n }\n };\n TreeClipboard.prototype.copy = function (withHeader) {\n _super.prototype.copy.call(this, withHeader);\n };\n TreeClipboard.prototype.paste = function (data, rowIndex, colIndex) {\n _super.prototype.paste.call(this, data, rowIndex, colIndex);\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns clipboard module name\n */\n TreeClipboard.prototype.getModuleName = function () {\n return 'clipboard';\n };\n /**\n * To destroy the clipboard\n *\n * @returns {void}\n * @hidden\n */\n TreeClipboard.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n TreeClipboard.prototype.childContentData = function (currentRecords, selectedIndex, rows, withHeader) {\n var getCopyData = 'getCopyData';\n var copyContent = 'copyContent';\n var childRecords = 'childRecords';\n var hasChildRecords = 'hasChildRecords';\n var uniqueID = 'uniqueID';\n if (currentRecords[selectedIndex][hasChildRecords]) {\n var childData = currentRecords[selectedIndex][childRecords];\n for (var i = 0; i < childData.length; i++) {\n for (var j = 0; j < currentRecords.length; j++) {\n if (!isNullOrUndefined(childData[i][uniqueID]) && currentRecords[j][uniqueID] === childData[i][uniqueID]) {\n if ((!isNullOrUndefined(rows[j])) && !rows[j].classList.contains('e-summaryrow')) {\n var cells = [].slice.call(rows[j].querySelectorAll('.e-rowcell'));\n var uniqueid = currentRecords[j][uniqueID];\n if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {\n this[getCopyData](cells, false, '\\t', withHeader);\n this.treeCopyContent += ('\\n' + this[copyContent]);\n this[copyContent] = '';\n this.copiedUniqueIdCollection.push(uniqueid);\n this.childContentData(currentRecords, j, rows, withHeader);\n }\n }\n break;\n }\n }\n }\n }\n };\n return TreeClipboard;\n}(GridClipboard));\nexport { TreeClipboard };\n","/**\n * @hidden\n */\nexport var load = 'load';\n/** @hidden */\nexport var rowDataBound = 'rowDataBound';\n/** @hidden */\nexport var dataBound = 'dataBound';\n/** @hidden */\nexport var queryCellInfo = 'queryCellInfo';\n/** @hidden */\nexport var beforeDataBound = 'beforeDataBound';\n/** @hidden */\nexport var actionBegin = 'actionBegin';\n/** @hidden */\nexport var dataStateChange = 'dataStateChange';\n/** @hidden */\nexport var actionComplete = 'actionComplete';\n/** @hidden */\nexport var rowSelecting = 'rowSelecting';\n/** @hidden */\nexport var rowSelected = 'rowSelected';\n/** @hidden */\nexport var checkboxChange = 'checkboxChange';\n/** @hidden */\nexport var rowDeselected = 'rowDeselected';\n/** @hidden */\nexport var toolbarClick = 'toolbarClick';\n/** @hidden */\nexport var beforeExcelExport = 'beforeExcelExport';\n/** @hidden */\nexport var beforePdfExport = 'beforePdfExport';\n/** @hidden */\nexport var resizeStop = 'resizeStop';\n/** @hidden */\nexport var expanded = 'expanded';\n/** @hidden */\nexport var expanding = 'expanding';\n/** @hidden */\nexport var collapsed = 'collapsed';\n/** @hidden */\nexport var collapsing = 'collapsing';\n/** @hidden */\nexport var remoteExpand = 'remoteExpand';\n/** @hidden */\nexport var localPagedExpandCollapse = 'localPagedExpandCollapse';\n/** @hidden */\nexport var pagingActions = 'pagingActions';\n/** @hidden */\nexport var printGridInit = 'printGrid-Init';\n/** @hidden */\nexport var contextMenuOpen = 'contextMenuOpen';\n/** @hidden */\nexport var contextMenuClick = 'contextMenuClick';\n/** @hidden */\nexport var beforeCopy = 'beforeCopy';\n/** @hidden */\nexport var beforePaste = 'beforePaste';\n/** @hidden */\nexport var savePreviousRowPosition = 'savePreviousRowPosition';\n/** @hidden */\nexport var crudAction = 'crudAction';\n/** @hidden */\nexport var beginEdit = 'beginEdit';\n/** @hidden */\nexport var beginAdd = 'beginAdd';\n/** @hidden */\nexport var recordDoubleClick = 'recordDoubleClick';\n/** @hidden */\nexport var cellSave = 'cellSave';\n/** @hidden */\nexport var cellSaved = 'cellSaved';\n/** @hidden */\nexport var cellEdit = 'cellEdit';\n/** @hidden */\nexport var batchDelete = 'batchDelete';\n/** @hidden */\nexport var batchCancel = 'batchCancel';\n/** @hidden */\nexport var batchAdd = 'batchAdd';\n/** @hidden */\nexport var beforeBatchDelete = 'beforeBatchDelete';\n/** @hidden */\nexport var beforeBatchAdd = 'beforeBatchAdd';\n/** @hidden */\nexport var beforeBatchSave = 'beforeBatchSave';\n/** @hidden */\nexport var batchSave = 'batchSave';\n/** @hidden */\nexport var keyPressed = 'key-pressed';\n/** @hidden */\nexport var updateData = 'update-data';\n/** @hidden */\nexport var doubleTap = 'double-tap';\n/** @hidden */\nexport var virtualColumnIndex = 'virtualColumnIndex';\n/** @hidden */\nexport var virtualActionArgs = 'virtual-action-args';\n/** @hidden */\nexport var destroy = 'destroy';\n/** @hidden */\nexport var dataListener = 'data-listener';\n/** @hidden */\nexport var indexModifier = 'index-modifier';\n/** @hidden */\nexport var beforeStartEdit = 'edit-form';\n/** @hidden */\nexport var beforeBatchCancel = 'before-batch-cancel';\n/** @hidden */\nexport var batchEditFormRendered = 'batcheditform-rendered';\n/** @hidden */\nexport var detailDataBound = 'detailDataBound';\n/** @hidden */\nexport var rowDrag = 'rowDrag';\n/** @hidden */\nexport var rowDragStartHelper = 'rowDragStartHelper';\n/** @hidden */\nexport var rowDrop = 'rowDrop';\n/** @hidden */\nexport var rowDragStart = 'rowDragStart';\n/** @hidden */\nexport var rowsAdd = 'rows-add';\n/** @hidden */\nexport var rowsRemove = 'rows-remove';\n/** @hidden */\nexport var rowdraging = 'row-draging';\n/** @hidden */\nexport var rowDropped = 'row-dropped';\n/** @hidden */\nexport var autoCol = 'auto-col';\n","import { isNullOrUndefined, removeClass } from '@syncfusion/ej2-base';\nimport { createCheckBox } from '@syncfusion/ej2-buttons';\nimport { parentsUntil, getObject } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { getParentData, isRemoteData, isCheckboxcolumn, findChildrenRecords } from '../utils';\n/**\n * TreeGrid Selection module\n *\n * @hidden\n */\nvar Selection = /** @class */ (function () {\n /**\n * Constructor for Selection module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Selection(parent) {\n this.parent = parent;\n this.selectedItems = [];\n this.selectedIndexes = [];\n this.filteredList = [];\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Selection module name\n */\n Selection.prototype.getModuleName = function () {\n return 'selection';\n };\n Selection.prototype.addEventListener = function () {\n this.parent.on('dataBoundArg', this.headerCheckbox, this);\n this.parent.on('columnCheckbox', this.columnCheckbox, this);\n this.parent.on('updateGridActions', this.updateGridActions, this);\n this.parent.grid.on('colgroup-refresh', this.headerCheckbox, this);\n this.parent.on('checkboxSelection', this.checkboxSelection, this);\n };\n Selection.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('dataBoundArg', this.headerCheckbox);\n this.parent.off('columnCheckbox', this.columnCheckbox);\n this.parent.grid.off('colgroup-refresh', this.headerCheckbox);\n this.parent.off('checkboxSelection', this.checkboxSelection);\n this.parent.off('updateGridActions', this.updateGridActions);\n };\n /**\n * To destroy the Selection\n *\n * @returns {void}\n * @hidden\n */\n Selection.prototype.destroy = function () {\n this.removeEventListener();\n };\n Selection.prototype.checkboxSelection = function (args) {\n var target = getObject('target', args);\n var checkWrap = parentsUntil(target, 'e-checkbox-wrapper');\n var checkBox;\n if (checkWrap && checkWrap.querySelectorAll('.e-treecheckselect').length > 0) {\n checkBox = checkWrap.querySelector('input[type=\"checkbox\"]');\n var rowIndex = [];\n rowIndex.push(target.closest('tr').rowIndex);\n this.selectCheckboxes(rowIndex);\n this.triggerChkChangeEvent(checkBox, checkBox.nextElementSibling.classList.contains('e-check'), target.closest('tr'));\n }\n else if (checkWrap && checkWrap.querySelectorAll('.e-treeselectall').length > 0 && this.parent.autoCheckHierarchy) {\n var checkBoxvalue = !checkWrap.querySelector('.e-frame').classList.contains('e-check')\n && !checkWrap.querySelector('.e-frame').classList.contains('e-stop');\n this.headerSelection(checkBoxvalue);\n checkBox = checkWrap.querySelector('input[type=\"checkbox\"]');\n this.triggerChkChangeEvent(checkBox, checkBoxvalue, target.closest('tr'));\n }\n };\n Selection.prototype.triggerChkChangeEvent = function (checkBox, checkState, rowElement) {\n var data = this.parent.getCurrentViewRecords()[rowElement.rowIndex];\n var args = { checked: checkState, target: checkBox, rowElement: rowElement,\n rowData: checkBox.classList.contains('e-treeselectall')\n ? this.parent.getCheckedRecords() : data };\n this.parent.trigger(events.checkboxChange, args);\n };\n Selection.prototype.getCheckboxcolumnIndex = function () {\n var mappingUid;\n var columnIndex;\n var columns = (this.parent.columns);\n for (var col = 0; col < columns.length; col++) {\n if (columns[col].showCheckbox) {\n mappingUid = this.parent.columns[col].uid;\n }\n }\n var headerCelllength = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv').length;\n for (var j = 0; j < headerCelllength; j++) {\n var headercell = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv')[j];\n if (headercell.getAttribute('e-mappinguid') === mappingUid) {\n columnIndex = j;\n }\n }\n return columnIndex;\n };\n Selection.prototype.headerCheckbox = function () {\n this.columnIndex = this.getCheckboxcolumnIndex();\n if (this.columnIndex > -1 && this.parent.getHeaderContent().querySelectorAll('.e-treeselectall').length === 0) {\n var headerElement = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv')[this.columnIndex];\n var value = false;\n var rowChkBox = this.parent.createElement('input', { className: 'e-treeselectall', attrs: { 'type': 'checkbox' } });\n var checkWrap = createCheckBox(this.parent.createElement, false, { checked: value, label: ' ' });\n checkWrap.classList.add('e-hierarchycheckbox');\n checkWrap.insertBefore(rowChkBox.cloneNode(), checkWrap.firstChild);\n if (!isNullOrUndefined(headerElement)) {\n headerElement.insertBefore(checkWrap, headerElement.firstChild);\n }\n if (this.parent.autoCheckHierarchy) {\n this.headerSelection();\n }\n }\n else if (this.columnIndex > -1 && this.parent.getHeaderContent().querySelectorAll('.e-treeselectall').length > 0) {\n var checkWrap = this.parent.getHeaderContent().querySelectorAll('.e-checkbox-wrapper')[0];\n var checkBoxvalue = checkWrap.querySelector('.e-frame').classList.contains('e-check');\n if (this.parent.autoCheckHierarchy && checkBoxvalue) {\n this.headerSelection(checkBoxvalue);\n }\n }\n };\n Selection.prototype.renderColumnCheckbox = function (args) {\n var rowChkBox = this.parent.createElement('input', { className: 'e-treecheckselect', attrs: { 'type': 'checkbox' } });\n var data = args.data;\n args.cell.classList.add('e-treegridcheckbox');\n args.cell.setAttribute('aria-label', 'checkbox');\n var value = (isNullOrUndefined(data.checkboxState) || data.checkboxState === 'uncheck') ? false : true;\n var checkWrap = createCheckBox(this.parent.createElement, false, { checked: value, label: ' ' });\n checkWrap.classList.add('e-hierarchycheckbox');\n if (this.parent.allowTextWrap) {\n checkWrap.querySelector('.e-frame').style.width = '18px';\n }\n if (data.checkboxState === 'indeterminate') {\n var checkbox = checkWrap.querySelectorAll('.e-frame')[0];\n removeClass([checkbox], ['e-check', 'e-stop', 'e-uncheck']);\n checkWrap.querySelector('.e-frame').classList.add('e-stop');\n }\n checkWrap.insertBefore(rowChkBox.cloneNode(), checkWrap.firstChild);\n return checkWrap;\n };\n Selection.prototype.columnCheckbox = function (container) {\n var checkWrap = this.renderColumnCheckbox(container);\n var containerELe = container.cell.querySelector('.e-treecolumn-container');\n if (!isNullOrUndefined(containerELe)) {\n if (!container.cell.querySelector('.e-hierarchycheckbox')) {\n containerELe.insertBefore(checkWrap, containerELe.querySelectorAll('.e-treecell')[0]);\n }\n }\n else {\n var spanEle = this.parent.createElement('span', { className: 'e-treecheckbox' });\n var data = container.cell.innerHTML;\n container.cell.innerHTML = '';\n spanEle.innerHTML = data;\n var divEle = this.parent.createElement('div', { className: 'e-treecheckbox-container' });\n divEle.appendChild(checkWrap);\n divEle.appendChild(spanEle);\n container.cell.appendChild(divEle);\n }\n };\n Selection.prototype.selectCheckboxes = function (rowIndexes) {\n for (var i = 0; i < rowIndexes.length; i++) {\n var record = this.parent.getCurrentViewRecords()[rowIndexes[i]];\n var flatRecord = getParentData(this.parent, record.uniqueID);\n record = flatRecord;\n var checkboxState = (record.checkboxState === 'uncheck') ? 'check' : 'uncheck';\n record.checkboxState = checkboxState;\n var keys = Object.keys(record);\n for (var j = 0; j < keys.length; j++) {\n if (Object.prototype.hasOwnProperty.call(flatRecord, keys[j])) {\n flatRecord[keys[j]] = record[keys[j]];\n }\n }\n this.traverSelection(record, checkboxState, false);\n if (this.parent.autoCheckHierarchy) {\n this.headerSelection();\n }\n }\n };\n Selection.prototype.traverSelection = function (record, checkboxState, ischildItem) {\n var length = 0;\n this.updateSelectedItems(record, checkboxState);\n if (!ischildItem && record.parentItem && this.parent.autoCheckHierarchy) {\n this.updateParentSelection(record.parentItem);\n }\n if (record.childRecords && this.parent.autoCheckHierarchy) {\n var childRecords = record.childRecords;\n if (!isNullOrUndefined(this.parent.filterModule) &&\n this.parent.filterModule.filteredResult.length > 0 && this.parent.autoCheckHierarchy) {\n childRecords = this.getFilteredChildRecords(childRecords);\n }\n length = childRecords.length;\n for (var count = 0; count < length; count++) {\n if (!childRecords[count].isSummaryRow) {\n if (childRecords[count].hasChildRecords) {\n this.traverSelection(childRecords[count], checkboxState, true);\n }\n else {\n this.updateSelectedItems(childRecords[count], checkboxState);\n }\n }\n }\n }\n };\n Selection.prototype.getFilteredChildRecords = function (childRecords) {\n var _this = this;\n var filteredChildRecords = childRecords.filter(function (e) {\n return _this.parent.filterModule.filteredResult.indexOf(e) > -1;\n });\n return filteredChildRecords;\n };\n Selection.prototype.updateParentSelection = function (parentRecord) {\n var length = 0;\n var childRecords = [];\n var record = getParentData(this.parent, parentRecord.uniqueID);\n if (record && record.childRecords) {\n childRecords = record.childRecords;\n }\n if (!isNullOrUndefined(this.parent.filterModule) &&\n this.parent.filterModule.filteredResult.length > 0 && this.parent.autoCheckHierarchy) {\n childRecords = this.getFilteredChildRecords(childRecords);\n }\n length = childRecords && childRecords.length;\n var indeter = 0;\n var checkChildRecords = 0;\n if (!isNullOrUndefined(record)) {\n for (var i = 0; i < childRecords.length; i++) {\n var currentRecord = getParentData(this.parent, childRecords[i].uniqueID);\n var checkBoxRecord = currentRecord;\n if (!isNullOrUndefined(checkBoxRecord)) {\n if (checkBoxRecord.checkboxState === 'indeterminate') {\n indeter++;\n }\n else if (checkBoxRecord.checkboxState === 'check') {\n checkChildRecords++;\n }\n }\n }\n if (indeter > 0 || (checkChildRecords > 0 && checkChildRecords !== length)) {\n record.checkboxState = 'indeterminate';\n }\n else if (checkChildRecords === 0 && indeter === 0) {\n record.checkboxState = 'uncheck';\n }\n else {\n record.checkboxState = 'check';\n }\n this.updateSelectedItems(record, record.checkboxState);\n if (record.parentItem) {\n this.updateParentSelection(record.parentItem);\n }\n }\n };\n Selection.prototype.headerSelection = function (checkAll) {\n var _this = this;\n var index = -1;\n var length = 0;\n if (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) {\n var filterResult = this.parent.filterModule.filteredResult;\n if (this.filteredList.length === 0) {\n this.filteredList = filterResult;\n }\n else {\n if (this.filteredList !== filterResult) {\n this.filteredList = filterResult;\n }\n }\n }\n if (this.filteredList.length > 0) {\n if (!this.parent.filterSettings.columns.length && this.filteredList.length) {\n this.filteredList = [];\n }\n }\n var data = (!isNullOrUndefined(this.parent.filterModule) &&\n (this.filteredList.length > 0)) ? this.filteredList :\n this.parent.flatData;\n data = isRemoteData(this.parent) ? this.parent.getCurrentViewRecords() : data;\n if (!isNullOrUndefined(checkAll)) {\n for (var i = 0; i < data.length; i++) {\n if (checkAll) {\n if (data[i].checkboxState === 'check') {\n continue;\n }\n data[i].checkboxState = 'check';\n this.updateSelectedItems(data[i], data[i].checkboxState);\n }\n else {\n index = this.selectedItems.indexOf(data[i]);\n if (index > -1) {\n data[i].checkboxState = 'uncheck';\n this.updateSelectedItems(data[i], data[i].checkboxState);\n if (this.parent.autoCheckHierarchy) {\n this.updateParentSelection(data[i]);\n }\n }\n }\n }\n }\n if (checkAll === false && this.parent.enableVirtualization) {\n this.selectedItems = [];\n this.selectedIndexes = [];\n data.filter(function (rec) {\n rec.checkboxState = 'uncheck';\n _this.updateSelectedItems(rec, rec.checkboxState);\n });\n }\n length = this.selectedItems.length;\n var checkbox = this.parent.getHeaderContent().querySelectorAll('.e-frame')[0];\n if (length > 0 && data.length > 0) {\n if (length !== data.length && !checkAll) {\n removeClass([checkbox], ['e-check']);\n checkbox.classList.add('e-stop');\n }\n else {\n removeClass([checkbox], ['e-stop']);\n checkbox.classList.add('e-check');\n }\n }\n else {\n removeClass([checkbox], ['e-check', 'e-stop']);\n }\n };\n Selection.prototype.updateSelectedItems = function (currentRecord, checkState) {\n var record = this.parent.getCurrentViewRecords().filter(function (e) {\n return e.uniqueID === currentRecord.uniqueID;\n });\n var checkedRecord;\n var recordIndex = this.parent.getCurrentViewRecords().indexOf(record[0]);\n var checkboxRecord = getParentData(this.parent, currentRecord.uniqueID);\n var checkbox;\n if (recordIndex > -1) {\n var tr = this.parent.getRows()[recordIndex];\n var movableTr = void 0;\n if (this.parent.frozenRows || this.parent.getFrozenColumns()) {\n movableTr = this.parent.getMovableDataRows()[recordIndex];\n }\n checkbox = tr.querySelectorAll('.e-frame')[0] ? tr.querySelectorAll('.e-frame')[0]\n : movableTr.querySelectorAll('.e-frame')[0];\n if (!isNullOrUndefined(checkbox)) {\n removeClass([checkbox], ['e-check', 'e-stop', 'e-uncheck']);\n }\n }\n checkedRecord = checkboxRecord;\n if (isNullOrUndefined(checkedRecord)) {\n checkedRecord = currentRecord;\n }\n checkedRecord.checkboxState = checkState;\n if (checkState === 'check' && isNullOrUndefined(currentRecord.isSummaryRow)) {\n if (recordIndex !== -1 && this.selectedIndexes.indexOf(recordIndex) === -1) {\n this.selectedIndexes.push(recordIndex);\n }\n if (this.selectedItems.indexOf(checkedRecord) === -1 && (recordIndex !== -1 &&\n (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0))) {\n this.selectedItems.push(checkedRecord);\n }\n if (this.selectedItems.indexOf(checkedRecord) === -1 && this.parent.enableVirtualization && ((!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0))) {\n this.selectedItems.push(checkedRecord);\n }\n if (this.selectedItems.indexOf(checkedRecord) === -1 && (!isNullOrUndefined(this.parent.filterModule) &&\n this.parent.filterModule.filteredResult.length === 0)) {\n this.selectedItems.push(checkedRecord);\n }\n if (this.selectedItems.indexOf(checkedRecord) === -1 && isNullOrUndefined(this.parent.filterModule)) {\n this.selectedItems.push(checkedRecord);\n }\n }\n else if ((checkState === 'uncheck' || checkState === 'indeterminate') && isNullOrUndefined(currentRecord.isSummaryRow)) {\n var index = this.selectedItems.indexOf(checkedRecord);\n if (index !== -1) {\n this.selectedItems.splice(index, 1);\n }\n if (this.selectedIndexes.indexOf(recordIndex) !== -1) {\n var checkedIndex = this.selectedIndexes.indexOf(recordIndex);\n this.selectedIndexes.splice(checkedIndex, 1);\n }\n }\n var checkBoxclass = checkState === 'indeterminate' ? 'e-stop' : 'e-' + checkState;\n if (recordIndex > -1) {\n if (!isNullOrUndefined(checkbox)) {\n checkbox.classList.add(checkBoxclass);\n }\n }\n };\n Selection.prototype.updateGridActions = function (args) {\n var _this = this;\n var requestType = args.requestType;\n var childData;\n var childLength;\n if (isCheckboxcolumn(this.parent)) {\n if (this.parent.autoCheckHierarchy) {\n if ((requestType === 'sorting' || requestType === 'paging')) {\n var rows = this.parent.grid.getRows();\n childData = this.parent.getCurrentViewRecords();\n childLength = childData.length;\n this.selectedIndexes = [];\n for (var i = 0; i < childLength; i++) {\n if (!rows[i].classList.contains('e-summaryrow')) {\n this.updateSelectedItems(childData[i], childData[i].checkboxState);\n }\n }\n }\n else if (requestType === 'delete' || args.action === 'add') {\n var updatedData = [];\n if (requestType === 'delete') {\n updatedData = args.data;\n }\n else {\n updatedData.push(args.data);\n }\n for (var i = 0; i < updatedData.length; i++) {\n if (requestType === 'delete') {\n var index = this.parent.flatData.indexOf(updatedData[i]);\n var checkedIndex = this.selectedIndexes.indexOf(index);\n this.selectedIndexes.splice(checkedIndex, 1);\n this.updateSelectedItems(updatedData[i], 'uncheck');\n }\n if (!isNullOrUndefined(updatedData[i].parentItem)) {\n this.updateParentSelection(updatedData[i].parentItem);\n }\n }\n }\n else if (args.requestType === 'add' && this.parent.autoCheckHierarchy) {\n args.data.checkboxState = 'uncheck';\n }\n else if (requestType === 'filtering' || requestType === 'searching' || requestType === 'refresh'\n && !isRemoteData(this.parent)) {\n this.selectedItems = [];\n this.selectedIndexes = [];\n childData = (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) ?\n this.parent.getCurrentViewRecords() : this.parent.flatData;\n childData.forEach(function (record) {\n if (_this.parent.enableVirtualization) {\n if (record.hasChildRecords) {\n _this.updateParentSelection(record);\n }\n else {\n _this.updateSelectedItems(record, record.checkboxState);\n }\n var child = findChildrenRecords(record);\n child = _this.getFilteredChildRecords(child);\n for (var i = 0; i < child.length; i++) {\n if (child[i].hasChildRecords) {\n _this.updateParentSelection(child[i]);\n }\n else if (!(child[i].hasChildRecords) && !isNullOrUndefined(child[i])) {\n _this.updateSelectedItems(child[i], child[i].checkboxState);\n }\n }\n }\n else {\n if (record.hasChildRecords) {\n _this.updateParentSelection(record);\n }\n else {\n _this.updateSelectedItems(record, record.checkboxState);\n }\n }\n });\n this.headerSelection();\n }\n }\n }\n };\n Selection.prototype.getCheckedrecords = function () {\n return this.selectedItems;\n };\n Selection.prototype.getCheckedRowIndexes = function () {\n return this.selectedIndexes;\n };\n return Selection;\n}());\nexport { Selection };\n","import * as events from '../base/constant';\nimport { Grid, getObject, Print as GridPrint } from '@syncfusion/ej2-grids';\nimport { addClass } from '@syncfusion/ej2-base';\n/**\n * TreeGrid Print module\n *\n * @hidden\n */\nvar Print = /** @class */ (function () {\n /**\n * Constructor for Print module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Print(parent) {\n this.parent = parent;\n Grid.Inject(GridPrint);\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Print module name\n */\n Print.prototype.getModuleName = function () {\n return 'print';\n };\n /**\n * @hidden\n * @returns {void}\n */\n Print.prototype.addEventListener = function () {\n this.parent.grid.on(events.printGridInit, this.printTreeGrid, this);\n };\n Print.prototype.removeEventListener = function () {\n this.parent.grid.off(events.printGridInit, this.printTreeGrid);\n };\n Print.prototype.printTreeGrid = function (printGrid) {\n var grid = getObject('printgrid', printGrid);\n var gridElement = getObject('element', printGrid);\n grid.addEventListener(events.queryCellInfo, this.parent.grid.queryCellInfo);\n grid.addEventListener(events.rowDataBound, this.parent.grid.rowDataBound);\n grid.addEventListener(events.beforeDataBound, this.parent.grid.beforeDataBound);\n addClass([gridElement], 'e-treegrid');\n };\n Print.prototype.print = function () {\n this.parent.grid.print();\n };\n /**\n * To destroy the Print\n *\n * @returns {void}\n * @hidden\n */\n Print.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Print;\n}());\nexport { Print };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the filtering behavior of the TreeGrid.\n */\nvar SearchSettings = /** @class */ (function (_super) {\n __extends(SearchSettings, _super);\n function SearchSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], SearchSettings.prototype, \"fields\", void 0);\n __decorate([\n Property(false)\n ], SearchSettings.prototype, \"ignoreCase\", void 0);\n __decorate([\n Property('contains')\n ], SearchSettings.prototype, \"operator\", void 0);\n __decorate([\n Property()\n ], SearchSettings.prototype, \"key\", void 0);\n __decorate([\n Property()\n ], SearchSettings.prototype, \"hierarchyMode\", void 0);\n return SearchSettings;\n}(ChildProperty));\nexport { SearchSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the selection behavior of the TreeGrid.\n */\nvar SelectionSettings = /** @class */ (function (_super) {\n __extends(SelectionSettings, _super);\n function SelectionSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('Row')\n ], SelectionSettings.prototype, \"mode\", void 0);\n __decorate([\n Property('Flow')\n ], SelectionSettings.prototype, \"cellSelectionMode\", void 0);\n __decorate([\n Property('Single')\n ], SelectionSettings.prototype, \"type\", void 0);\n __decorate([\n Property(false)\n ], SelectionSettings.prototype, \"persistSelection\", void 0);\n __decorate([\n Property('Default')\n ], SelectionSettings.prototype, \"checkboxMode\", void 0);\n __decorate([\n Property(false)\n ], SelectionSettings.prototype, \"checkboxOnly\", void 0);\n __decorate([\n Property(true)\n ], SelectionSettings.prototype, \"enableToggle\", void 0);\n return SelectionSettings;\n}(ChildProperty));\nexport { SelectionSettings };\n","import { getObject, appendChildren } from '@syncfusion/ej2-grids';\nimport { templateCompiler, extend } from '@syncfusion/ej2-grids';\nimport { addClass, createElement, isNullOrUndefined, getValue } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport { isRemoteData, isOffline, getExpandStatus, isFilterChildHierarchy } from '../utils';\n/**\n * TreeGrid render module\n *\n * @hidden\n */\nvar Render = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Render(parent) {\n this.parent = parent;\n this.templateResult = null;\n this.parent.grid.on('template-result', this.columnTemplateResult, this);\n this.parent.grid.on('reactTemplateRender', this.reactTemplateRender, this);\n }\n /**\n * Updated row elements for TreeGrid\n *\n * @param {RowDataBoundEventArgs} args - Row details before its bound to DOM\n * @returns {void}\n */\n Render.prototype.RowModifier = function (args) {\n if (!args.data) {\n return;\n }\n var data = args.data;\n var parentData = data.parentItem;\n if (!isNullOrUndefined(data.parentItem) && !isFilterChildHierarchy(this.parent) &&\n (!(this.parent.allowPaging && !(this.parent.pageSettings.pageSizeMode === 'Root')) ||\n (isRemoteData(this.parent) && !isOffline(this.parent)))) {\n var collapsed = (this.parent.initialRender && (!(isNullOrUndefined(parentData[this.parent.expandStateMapping]) ||\n parentData[this.parent.expandStateMapping]) || this.parent.enableCollapseAll)) ||\n !getExpandStatus(this.parent, args.data, this.parent.grid.getCurrentViewRecords());\n if (collapsed) {\n args.row.style.display = 'none';\n }\n }\n if (isRemoteData(this.parent) && !isOffline(this.parent)) {\n var proxy_1 = this.parent;\n var parentrec = this.parent.getCurrentViewRecords().filter(function (rec) {\n return getValue(proxy_1.idMapping, rec) === getValue(proxy_1.parentIdMapping, data);\n });\n if (parentrec.length > 0) {\n var display = parentrec[0].expanded ? 'table-row' : 'none';\n args.row.setAttribute('style', 'display: ' + display + ';');\n }\n }\n //addClass([args.row], 'e-gridrowindex' + index + 'level' + (<ITreeData>args.data).level);\n var summaryRow = getObject('isSummaryRow', args.data);\n if (summaryRow) {\n addClass([args.row], 'e-summaryrow');\n }\n if (args.row.querySelector('.e-treegridexpand')) {\n args.row.setAttribute('aria-expanded', 'true');\n }\n else if (args.row.querySelector('.e-treegridcollapse')) {\n args.row.setAttribute('aria-expanded', 'false');\n }\n if (this.parent.enableCollapseAll && this.parent.initialRender) {\n if (!isNullOrUndefined(data.parentItem)) {\n args.row.style.display = 'none';\n }\n }\n this.parent.trigger(events.rowDataBound, args);\n };\n /**\n * cell renderer for tree column index cell\n *\n * @param {QueryCellInfoEventArgs} args - Cell detail before its bound to DOM\n * @returns {void}\n */\n Render.prototype.cellRender = function (args) {\n if (!args.data) {\n return;\n }\n var grid = this.parent.grid;\n var data = args.data;\n var index;\n var ispadfilter = isNullOrUndefined(data.filterLevel);\n var pad = ispadfilter ? data.level : data.filterLevel;\n var totalIconsWidth = 0;\n var cellElement;\n var column = this.parent.getColumnByUid(args.column.uid);\n var summaryRow = data.isSummaryRow;\n var frozenColumns = this.parent.getFrozenColumns();\n if (!isNullOrUndefined(data.parentItem)) {\n index = data.parentItem.index;\n }\n else {\n index = data.index;\n }\n var columnIndex;\n var getVirtualColIndexByUid = 'getVirtualColIndexByUid';\n if (this.parent.enableColumnVirtualization && !this.parent.initialRender) {\n columnIndex = this.parent[getVirtualColIndexByUid](args.column.uid);\n }\n else {\n columnIndex = grid.getColumnIndexByUid(args.column.uid);\n }\n if (columnIndex === this.parent.treeColumnIndex && (args.requestType === 'add' || args.requestType\n === 'rowDragAndDrop' || args.requestType === 'delete' || isNullOrUndefined(args.cell.querySelector('.e-treecell')))) {\n var container = createElement('div', { className: 'e-treecolumn-container' });\n var emptyExpandIcon = createElement('span', {\n className: 'e-icons e-none',\n styles: 'width: 10px; display: inline-block'\n });\n for (var n = 0; n < pad; n++) {\n totalIconsWidth += 10;\n container.appendChild(emptyExpandIcon.cloneNode());\n }\n var iconRequired = !isNullOrUndefined(data.hasFilteredChildRecords)\n ? data.hasFilteredChildRecords : data.hasChildRecords;\n if (iconRequired && !isNullOrUndefined(data.childRecords)) {\n iconRequired = !(data.childRecords.length === 0);\n }\n if (iconRequired) {\n addClass([args.cell], 'e-treerowcell');\n var expandIcon = createElement('span', { className: 'e-icons' });\n var expand = void 0;\n if (this.parent.initialRender) {\n expand = data.expanded &&\n (isNullOrUndefined(data[this.parent.expandStateMapping]) || data[this.parent.expandStateMapping]) &&\n !this.parent.enableCollapseAll;\n }\n else {\n expand = !(!data.expanded || !getExpandStatus(this.parent, data, this.parent.grid.getCurrentViewRecords()));\n }\n addClass([expandIcon], (expand) ? 'e-treegridexpand' : 'e-treegridcollapse');\n totalIconsWidth += 18;\n container.appendChild(expandIcon);\n emptyExpandIcon.style.width = '7px';\n totalIconsWidth += 7;\n container.appendChild(emptyExpandIcon.cloneNode());\n }\n else if (pad || !pad && !data.level) {\n // icons width\n totalIconsWidth += 20;\n container.appendChild(emptyExpandIcon.cloneNode());\n container.appendChild(emptyExpandIcon.cloneNode());\n }\n //should add below code when paging funcitonality implemented\n // if (data.hasChildRecords) {\n // addClass([expandIcon], data.expanded ? 'e-treegridexpand' : 'e-treegridcollapse');\n // }\n cellElement = createElement('span', { className: 'e-treecell' });\n if (this.parent.allowTextWrap) {\n cellElement.style.width = 'Calc(100% - ' + totalIconsWidth + 'px)';\n }\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n this.updateTreeCell(args, cellElement);\n container.appendChild(cellElement);\n args.cell.appendChild(container);\n }\n else if (this.templateResult) {\n this.templateResult = null;\n }\n var freeze = (grid.getFrozenLeftColumnsCount() > 0 || grid.getFrozenRightColumnsCount() > 0) ? true : false;\n if (!freeze) {\n if (frozenColumns > this.parent.treeColumnIndex && frozenColumns > 0 &&\n grid.getColumnIndexByUid(args.column.uid) === frozenColumns) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n else if (frozenColumns < this.parent.treeColumnIndex && frozenColumns > 0 &&\n (grid.getColumnIndexByUid(args.column.uid) === frozenColumns\n || grid.getColumnIndexByUid(args.column.uid) === frozenColumns - 1)) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n else if (frozenColumns === this.parent.treeColumnIndex && frozenColumns > 0 &&\n grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex - 1) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n }\n else {\n var freezerightColumns = grid.getFrozenRightColumns();\n var freezeLeftColumns = grid.getFrozenLeftColumns();\n var movableColumns = grid.getMovableColumns();\n if ((freezerightColumns.length > 0) && freezerightColumns[0].field === args.column.field) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n else if ((freezeLeftColumns.length > 0) && freezeLeftColumns[0].field === args.column.field) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n else if ((movableColumns.length > 0) && movableColumns[0].field === args.column.field) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n }\n if (!isNullOrUndefined(column) && column.showCheckbox) {\n this.parent.notify('columnCheckbox', args);\n if (this.parent.allowTextWrap) {\n var checkboxElement = args.cell.querySelectorAll('.e-frame')[0];\n var width = parseInt(checkboxElement.style.width, 16);\n totalIconsWidth += width;\n totalIconsWidth += 10;\n if (grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex) {\n cellElement = args.cell.querySelector('.e-treecell');\n }\n else {\n cellElement = args.cell.querySelector('.e-treecheckbox');\n }\n cellElement.style.width = 'Calc(100% - ' + totalIconsWidth + 'px)';\n }\n }\n if (summaryRow) {\n addClass([args.cell], 'e-summarycell');\n var summaryData = getObject(args.column.field, args.data);\n if (args.cell.querySelector('.e-treecell') != null) {\n args.cell.querySelector('.e-treecell').innerHTML = summaryData;\n }\n else {\n args.cell.innerHTML = summaryData;\n }\n }\n if (isNullOrUndefined(this.parent.rowTemplate)) {\n this.parent.trigger(events.queryCellInfo, args);\n }\n };\n Render.prototype.updateTreeCell = function (args, cellElement) {\n var columnModel = getValue('columnModel', this.parent);\n var treeColumn = columnModel[this.parent.treeColumnIndex];\n var templateFn = 'templateFn';\n var colindex = args.column.index;\n if (isNullOrUndefined(treeColumn.field)) {\n args.cell.setAttribute('aria-colindex', colindex + '');\n }\n if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {\n args.column.template = treeColumn.template;\n args.column[templateFn] = templateCompiler(args.column.template);\n args.cell.classList.add('e-templatecell');\n }\n var textContent = args.cell.querySelector('.e-treecell') != null ?\n args.cell.querySelector('.e-treecell').innerHTML : args.cell.innerHTML;\n if (typeof (args.column.template) === 'object' && this.templateResult) {\n appendChildren(cellElement, this.templateResult);\n this.templateResult = null;\n args.cell.innerHTML = '';\n }\n else if (args.cell.classList.contains('e-templatecell')) {\n var len = args.cell.children.length;\n var tempID = this.parent.element.id + args.column.uid;\n if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {\n var portals = 'portals';\n var renderReactTemplates = 'renderReactTemplates';\n if (this.parent.isReact && typeof (args.column.template) !== 'string') {\n args.column[templateFn](args.data, this.parent, 'template', tempID, null, null, cellElement);\n if (isNullOrUndefined(this.parent.grid[portals])) {\n this.parent.grid[portals] = this.parent[portals];\n }\n this.parent.notify('renderReactTemplate', this.parent[portals]);\n this.parent[renderReactTemplates]();\n }\n else {\n var str = 'isStringTemplate';\n var result = args.column[templateFn](extend({ 'index': '' }, args.data), this.parent, 'template', tempID, this.parent[str]);\n appendChildren(cellElement, result);\n }\n delete args.column.template;\n delete args.column[templateFn];\n args.cell.innerHTML = '';\n }\n else {\n for (var i = 0; i < len; len = args.cell.children.length) {\n cellElement.appendChild(args.cell.children[i]);\n }\n }\n }\n else {\n cellElement.innerHTML = textContent;\n args.cell.innerHTML = '';\n }\n };\n Render.prototype.columnTemplateResult = function (args) {\n this.templateResult = args.template;\n };\n Render.prototype.reactTemplateRender = function (args) {\n var renderReactTemplates = 'renderReactTemplates';\n var portals = 'portals';\n this.parent[portals] = args;\n this.parent.notify('renderReactTemplate', this.parent[portals]);\n this.parent[renderReactTemplates]();\n };\n Render.prototype.destroy = function () {\n this.parent.grid.off('template-result', this.columnTemplateResult);\n this.parent.grid.off('reactTemplateRender', this.reactTemplateRender);\n };\n return Render;\n}());\nexport { Render };\n","import { extend, isNullOrUndefined, setValue, getValue, addClass, removeClass } from '@syncfusion/ej2-base';\nimport { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';\nimport { showSpinner, hideSpinner } from '@syncfusion/ej2-popups';\nimport { getObject, getUid } from '@syncfusion/ej2-grids';\nimport { isRemoteData, isOffline, isCountRequired, getExpandStatus } from '../utils';\nimport * as events from './constant';\n/**\n * Internal dataoperations for tree grid\n *\n * @hidden\n */\nvar DataManipulation = /** @class */ (function () {\n function DataManipulation(grid) {\n this.addedRecords = 'addedRecords';\n this.parent = grid;\n this.parentItems = [];\n this.taskIds = [];\n this.hierarchyData = [];\n this.storedIndex = -1;\n this.sortedData = [];\n this.isSortAction = false;\n this.addEventListener();\n this.dataResults = {};\n this.isSelfReference = !isNullOrUndefined(this.parent.parentIdMapping);\n }\n /**\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.addEventListener = function () {\n this.parent.on('updateRemoteLevel', this.updateParentRemoteData, this);\n this.parent.grid.on('sorting-begin', this.beginSorting, this);\n this.parent.on('updateAction', this.updateData, this);\n this.parent.on(events.remoteExpand, this.collectExpandingRecs, this);\n this.parent.on('dataProcessor', this.dataProcessor, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.remoteExpand, this.collectExpandingRecs);\n this.parent.off('updateRemoteLevel', this.updateParentRemoteData);\n this.parent.off('updateAction', this.updateData);\n this.parent.off('dataProcessor', this.dataProcessor);\n this.parent.grid.off('sorting-begin', this.beginSorting);\n };\n /**\n * To destroy the dataModule\n *\n * @returns {void}\n * @hidden\n */\n DataManipulation.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {boolean} -Returns whether remote data binding\n */\n DataManipulation.prototype.isRemote = function () {\n if (!(this.parent.dataSource instanceof DataManager)) {\n return false;\n }\n return true;\n // let gridData: DataManager = <DataManager>this.parent.dataSource;\n // return gridData.dataSource.offline !== true && gridData.dataSource.url !== undefined;\n };\n /**\n * Function to manipulate datasource\n *\n * @param {Object} data - Provide tree grid datasource to convert to flat data\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.convertToFlatData = function (data) {\n var _this = this;\n this.parent.flatData = (Object.keys(data).length === 0 && !(this.parent.dataSource instanceof DataManager) ?\n this.parent.dataSource : []);\n this.parent.parentData = [];\n if ((isRemoteData(this.parent) && !isOffline(this.parent)) && data instanceof DataManager && !(data instanceof Array)) {\n var dm = this.parent.dataSource;\n if (this.parent.parentIdMapping) {\n this.parent.query = isNullOrUndefined(this.parent.query) ?\n new Query() : this.parent.query;\n if (this.parent.parentIdMapping) {\n var filterKey = this.parent.query.params.filter(function (param) { return param.key === 'IdMapping'; });\n if (this.parent.initialRender && !filterKey.length) {\n this.parent.query.where(this.parent.parentIdMapping, 'equal', null);\n this.parent.query.addParams('IdMapping', this.parent.idMapping);\n }\n }\n if (!this.parent.hasChildMapping) {\n var qry = this.parent.query.clone();\n qry.queries = [];\n qry = qry.select([this.parent.parentIdMapping]);\n qry.isCountRequired = true;\n dm.executeQuery(qry).then(function (e) {\n _this.parentItems = DataUtil.distinct(e.result, _this.parent.parentIdMapping, false);\n var req = getObject('dataSource.requests', _this.parent).filter(function (e) {\n return e.httpRequest.statusText !== 'OK';\n }).length;\n if (req === 0) {\n setValue('grid.contentModule.isLoaded', true, _this.parent);\n if (!isNullOrUndefined(_this.zerothLevelData)) {\n setValue('cancel', false, _this.zerothLevelData);\n getValue('grid.renderModule', _this.parent).dataManagerSuccess(_this.zerothLevelData);\n _this.zerothLevelData = null;\n }\n _this.parent.grid.hideSpinner();\n }\n });\n }\n }\n }\n else if (data instanceof Array) {\n this.convertJSONData(data);\n }\n };\n DataManipulation.prototype.convertJSONData = function (data) {\n this.hierarchyData = [];\n this.taskIds = [];\n if (!this.parent.idMapping) {\n this.hierarchyData = data;\n }\n else {\n var keys = Object.keys(data);\n for (var i = 0; i < keys.length; i++) {\n var tempData = data[i];\n this.hierarchyData.push(extend({}, tempData));\n if (!isNullOrUndefined(tempData[this.parent.idMapping])) {\n this.taskIds.push(tempData[this.parent.idMapping]);\n }\n }\n }\n if (this.isSelfReference) {\n var selfData = [];\n var mappingData = new DataManager(this.hierarchyData).executeLocal(new Query()\n .group(this.parent.parentIdMapping));\n for (var i = 0; i < mappingData.length; i++) {\n var groupData = mappingData[i];\n var index = this.taskIds.indexOf(groupData.key);\n if (!isNullOrUndefined(groupData.key)) {\n if (index > -1) {\n var childData = (groupData.items);\n this.hierarchyData[index][this.parent.childMapping] = childData;\n continue;\n }\n }\n selfData.push.apply(selfData, groupData.items);\n }\n this.hierarchyData = this.selfReferenceUpdate(selfData);\n }\n if (!Object.keys(this.hierarchyData).length) {\n var isGantt = 'isGantt';\n var referenceData = !(this.parent.dataSource instanceof DataManager) && this.parent[isGantt];\n this.parent.flatData = referenceData ? (this.parent.dataSource) : [];\n }\n else {\n this.createRecords(this.hierarchyData);\n }\n this.storedIndex = -1;\n };\n // private crudActions(): void {\n // if (this.parent.dataSource instanceof DataManager && (this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {\n // let oldUpdate: Function = this.parent.dataSource.adaptor.update;\n // this.parent.dataSource.adaptor.update =\n // function (dm: DataManager, keyField: string, value: Object, tableName?: string, query?: Query, original?: Object): Object {\n // value = getPlainData(value);\n // return oldUpdate.apply(this, [dm, keyField, value, tableName, query, original]);\n // }\n // }\n // }\n DataManipulation.prototype.selfReferenceUpdate = function (selfData) {\n var result = [];\n while (this.hierarchyData.length > 0 && selfData.length > 0) {\n var index = selfData.indexOf(this.hierarchyData[0]);\n if (index === -1) {\n this.hierarchyData.shift();\n }\n else {\n result.push(this.hierarchyData.shift());\n selfData.splice(index, 1);\n }\n }\n return result;\n };\n /**\n * Function to update the zeroth level parent records in remote binding\n *\n * @param {BeforeDataBoundArgs} args - contains data before its bounds to tree grid\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.updateParentRemoteData = function (args) {\n var records = args.result;\n if (!this.parent.hasChildMapping && !this.parentItems.length &&\n (!this.parent.loadChildOnDemand)) {\n this.zerothLevelData = args;\n setValue('cancel', true, args);\n }\n else {\n if (!this.parent.loadChildOnDemand) {\n for (var rec = 0; rec < records.length; rec++) {\n if (isCountRequired(this.parent) && records[rec].hasChildRecords && this.parent.initialRender) {\n records[rec].expanded = false;\n }\n if (isNullOrUndefined(records[rec].index)) {\n records[rec].taskData = extend({}, records[rec]);\n records[rec].uniqueID = getUid(this.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + records[rec].uniqueID, records[rec], this.parent);\n records[rec].level = 0;\n records[rec].index = Math.ceil(Math.random() * 1000);\n if ((records[rec][this.parent.hasChildMapping] ||\n this.parentItems.indexOf(records[rec][this.parent.idMapping]) !== -1)) {\n records[rec].hasChildRecords = true;\n }\n records[rec].checkboxState = 'uncheck';\n }\n }\n }\n else {\n if (!isNullOrUndefined(records)) {\n this.convertToFlatData(records);\n }\n }\n }\n args.result = this.parent.loadChildOnDemand ? this.parent.flatData : records;\n this.parent.notify('updateResults', args);\n };\n /**\n * Function to manipulate datasource\n *\n * @param {{record: ITreeData, rows: HTMLTableRowElement[], parentRow: HTMLTableRowElement}} rowDetails - Row details for which child rows has to be fetched\n * @param {ITreeData} rowDetails.record - current expanding record\n * @param {HTMLTableRowElement[]} rowDetails.rows - Expanding Row element\n * @param {HTMLTableRowElement} rowDetails.parentRow - Curent expanding row element\n * @param {boolean} isChild - Specified whether current record is already a child record\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.collectExpandingRecs = function (rowDetails, isChild) {\n var gridRows = this.parent.getRows();\n if (this.parent.rowTemplate) {\n var rows = this.parent.getContentTable().rows;\n gridRows = [].slice.call(rows);\n }\n var childRecord;\n if (rowDetails.rows.length > 0) {\n if (!isChild) {\n rowDetails.record.expanded = true;\n }\n for (var i = 0; i < rowDetails.rows.length; i++) {\n rowDetails.rows[i].style.display = 'table-row';\n if (this.parent.loadChildOnDemand) {\n var targetEle = rowDetails.rows[i].getElementsByClassName('e-treegridcollapse')[0];\n childRecord = this.parent.rowTemplate ? this.parent.grid.getCurrentViewRecords()[rowDetails.rows[i].rowIndex] :\n this.parent.grid.getRowObjectFromUID(rowDetails.rows[i].getAttribute('data-Uid')).data;\n if (!isNullOrUndefined(targetEle) && childRecord.expanded) {\n addClass([targetEle], 'e-treegridexpand');\n removeClass([targetEle], 'e-treegridcollapse');\n }\n var childRows = [];\n childRows = gridRows.filter(function (r) {\n return r.querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1));\n });\n if (childRows.length && childRecord.expanded) {\n this.collectExpandingRecs({ record: childRecord, rows: childRows, parentRow: rowDetails.parentRow }, true);\n }\n }\n var expandingTd = rowDetails.rows[i].querySelector('.e-detailrowcollapse');\n if (!isNullOrUndefined(expandingTd)) {\n this.parent.grid.detailRowModule.expand(expandingTd);\n }\n }\n }\n else {\n this.fetchRemoteChildData({ record: rowDetails.record, rows: rowDetails.rows, parentRow: rowDetails.parentRow });\n }\n };\n DataManipulation.prototype.fetchRemoteChildData = function (rowDetails) {\n var _this = this;\n var args = { row: rowDetails.parentRow, data: rowDetails.record };\n var dm = this.parent.dataSource;\n var qry = this.parent.grid.getDataModule().generateQuery();\n var clonequries = qry.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });\n qry.queries = clonequries;\n qry.isCountRequired = true;\n qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);\n showSpinner(this.parent.element);\n dm.executeQuery(qry).then(function (e) {\n var datas = _this.parent.grid.currentViewData.slice();\n var inx = datas.indexOf(rowDetails.record);\n if (inx === -1) {\n _this.parent.grid.getRowsObject().forEach(function (rows) {\n if (rows.data.uniqueID === rowDetails.record.uniqueID) {\n inx = rows.index;\n }\n });\n }\n var haveChild = getObject('actual.nextLevel', e);\n var result = e.result;\n rowDetails.record.childRecords = result;\n for (var r = 0; r < result.length; r++) {\n result[r].taskData = extend({}, result[r]);\n result[r].level = rowDetails.record.level + 1;\n result[r].index = Math.ceil(Math.random() * 1000);\n var parentData = extend({}, rowDetails.record);\n delete parentData.childRecords;\n result[r].parentItem = parentData;\n result[r].parentUniqueID = rowDetails.record.uniqueID;\n result[r].uniqueID = getUid(_this.parent.element.id + '_data_');\n result[r].checkboxState = 'uncheck';\n setValue('uniqueIDCollection.' + result[r].uniqueID, result[r], _this.parent);\n // delete result[r].parentItem.childRecords;\n if ((result[r][_this.parent.hasChildMapping] || _this.parentItems.indexOf(result[r][_this.parent.idMapping]) !== -1)\n && !(haveChild && !haveChild[r])) {\n result[r].hasChildRecords = true;\n result[r].expanded = false;\n }\n datas.splice(inx + r + 1, 0, result[r]);\n }\n setValue('result', datas, e);\n setValue('action', 'beforecontentrender', e);\n _this.parent.trigger(events.actionComplete, e);\n hideSpinner(_this.parent.element);\n if (_this.parent.grid.aggregates.length > 0 && !_this.parent.enableVirtualization) {\n var gridQuery = getObject('query', e);\n var result_1 = 'result';\n if (isNullOrUndefined(gridQuery)) {\n gridQuery = getValue('grid.renderModule.data', _this.parent).aggregateQuery(new Query());\n }\n if (!isNullOrUndefined(gridQuery)) {\n var summaryQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onAggregates'; });\n e[result_1] = _this.parent.summaryModule.calculateSummaryValue(summaryQuery, e[result_1], true);\n }\n }\n e.count = _this.parent.grid.pageSettings.totalRecordsCount;\n var virtualArgs = {};\n if (_this.parent.enableVirtualization) {\n _this.remoteVirtualAction(virtualArgs);\n }\n var notifyArgs = { index: inx, childData: result };\n if (_this.parent.enableInfiniteScrolling) {\n _this.parent.notify('infinite-remote-expand', notifyArgs);\n }\n else {\n getValue('grid.renderModule', _this.parent).dataManagerSuccess(e, virtualArgs);\n }\n _this.parent.trigger(events.expanded, args);\n });\n };\n DataManipulation.prototype.remoteVirtualAction = function (virtualArgs) {\n virtualArgs.requestType = 'refresh';\n setValue('isExpandCollapse', true, virtualArgs);\n var contentModule = getValue('grid.contentModule', this.parent);\n var currentInfo = getValue('currentInfo', contentModule);\n var prevInfo = getValue('prevInfo', contentModule);\n if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page) {\n this.parent.grid.pageSettings.currentPage = prevInfo.page;\n }\n };\n DataManipulation.prototype.beginSorting = function () {\n this.isSortAction = true;\n };\n DataManipulation.prototype.createRecords = function (data, parentRecords) {\n var treeGridData = [];\n var keys = Object.keys(data);\n for (var i = 0, len = keys.length; i < len; i++) {\n var currentData = extend({}, data[i]);\n currentData.taskData = data[i];\n var level = 0;\n this.storedIndex++;\n if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {\n currentData.index = this.storedIndex;\n }\n if (!isNullOrUndefined(currentData[this.parent.childMapping]) ||\n (currentData[this.parent.hasChildMapping] && isCountRequired(this.parent))) {\n currentData.hasChildRecords = true;\n if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)\n && isNullOrUndefined(currentData[this.parent.childMapping])) {\n currentData.expanded = false;\n }\n else {\n currentData.expanded = !isNullOrUndefined(currentData[this.parent.expandStateMapping])\n ? currentData[this.parent.expandStateMapping] : true;\n }\n }\n if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {\n currentData.index = currentData.hasChildRecords ? this.storedIndex : this.storedIndex;\n }\n if (this.isSelfReference && isNullOrUndefined(currentData[this.parent.parentIdMapping])) {\n this.parent.parentData.push(currentData);\n }\n currentData.uniqueID = getUid(this.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + currentData.uniqueID, currentData, this.parent);\n if (!isNullOrUndefined(parentRecords)) {\n var parentData = extend({}, parentRecords);\n delete parentData.childRecords;\n delete parentData[this.parent.childMapping];\n if (this.isSelfReference) {\n delete parentData.taskData[this.parent.childMapping];\n }\n currentData.parentItem = parentData;\n currentData.parentUniqueID = parentData.uniqueID;\n level = parentRecords.level + 1;\n }\n if (!Object.prototype.hasOwnProperty.call(currentData, 'level')) {\n currentData.level = level;\n }\n currentData.checkboxState = 'uncheck';\n if (isNullOrUndefined(currentData[this.parent.parentIdMapping]) || currentData.parentItem) {\n this.parent.flatData.push(currentData);\n }\n if (!this.isSelfReference && currentData.level === 0) {\n this.parent.parentData.push(currentData);\n }\n if (!isNullOrUndefined(currentData[this.parent.childMapping] && currentData[this.parent.childMapping].length)) {\n var record = this.createRecords(currentData[this.parent.childMapping], currentData);\n currentData.childRecords = record;\n }\n treeGridData.push(currentData);\n }\n return treeGridData;\n };\n /**\n * Function to perform filtering/sorting action for local data\n *\n * @param {BeforeDataBoundArgs} args - data details to be processed before binding to grid\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.dataProcessor = function (args) {\n var isExport = getObject('isExport', args);\n var expresults = getObject('expresults', args);\n var exportType = getObject('exportType', args);\n var isPrinting = getObject('isPrinting', args);\n var dataObj;\n var actionArgs = getObject('actionArgs', args);\n var requestType = getObject('requestType', args);\n var actionData = getObject('data', args);\n var action = getObject('action', args);\n var actionAddArgs = actionArgs;\n var primaryKeyColumnName = this.parent.getPrimaryKeyFieldNames()[0];\n var dataValue = getObject('data', actionAddArgs);\n if ((!isNullOrUndefined(actionAddArgs)) && (!isNullOrUndefined(actionAddArgs.action)) && (actionAddArgs.action === 'add')\n && (!isNullOrUndefined(actionAddArgs.data)) && isNullOrUndefined(actionAddArgs.data[primaryKeyColumnName])) {\n actionAddArgs.data[primaryKeyColumnName] = args.result[actionAddArgs.index][primaryKeyColumnName];\n dataValue.taskData[primaryKeyColumnName] = args.result[actionAddArgs.index][primaryKeyColumnName];\n }\n if ((!isNullOrUndefined(actionArgs) && Object.keys(actionArgs).length) || requestType === 'save') {\n requestType = requestType ? requestType : actionArgs.requestType;\n actionData = actionData ? actionData : getObject('data', actionArgs);\n action = action ? action : getObject('action', actionArgs);\n if (this.parent.editSettings.mode === 'Batch') {\n this.batchChanges = this.parent.grid.editModule.getBatchChanges();\n }\n if (this.parent.isLocalData) {\n this.updateAction(actionData, action, requestType);\n }\n }\n if (isExport && !isNullOrUndefined(expresults)) {\n dataObj = expresults;\n }\n else {\n dataObj = isCountRequired(this.parent) ? getValue('result', this.parent.grid.dataSource)\n : this.parent.grid.dataSource;\n }\n var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;\n var count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)\n : results.length;\n var qry = new Query();\n var gridQuery = getObject('query', args);\n var filterQuery;\n var searchQuery;\n if (!isNullOrUndefined(gridQuery)) {\n filterQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });\n searchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });\n }\n if ((this.parent.grid.allowFiltering && this.parent.grid.filterSettings.columns.length) ||\n (this.parent.grid.searchSettings.key.length > 0) || (!isNullOrUndefined(gridQuery) &&\n (filterQuery.length || searchQuery.length) && this.parent.isLocalData)) {\n if (isNullOrUndefined(gridQuery)) {\n gridQuery = new Query();\n gridQuery = getValue('grid.renderModule.data', this.parent).filterQuery(gridQuery);\n gridQuery = getValue('grid.renderModule.data', this.parent).searchQuery(gridQuery);\n }\n var fltrQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });\n var srchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });\n qry.queries = fltrQuery.concat(srchQuery);\n var filteredData = new DataManager(results).executeLocal(qry);\n this.parent.notify('updateFilterRecs', { data: filteredData });\n results = this.dataResults.result;\n this.dataResults.result = null;\n if (this.parent.grid.aggregates.length > 0) {\n var query = getObject('query', args);\n if (isNullOrUndefined(gridQuery)) {\n gridQuery = getValue('grid.renderModule.data', this.parent).aggregateQuery(new Query());\n }\n if (!isNullOrUndefined(query)) {\n var summaryQuery = query.queries.filter(function (q) { return q.fn === 'onAggregates'; });\n results = this.parent.summaryModule.calculateSummaryValue(summaryQuery, results, true);\n }\n }\n }\n if (this.parent.grid.aggregates.length && this.parent.grid.sortSettings.columns.length === 0\n && this.parent.grid.filterSettings.columns.length === 0 && !this.parent.grid.searchSettings.key.length) {\n var gridQuery_1 = getObject('query', args);\n if (isNullOrUndefined(gridQuery_1)) {\n gridQuery_1 = getValue('grid.renderModule.data', this.parent).aggregateQuery(new Query());\n }\n var summaryQuery = gridQuery_1.queries.filter(function (q) { return q.fn === 'onAggregates'; });\n results = this.parent.summaryModule.calculateSummaryValue(summaryQuery, this.parent.flatData, true);\n }\n if (this.parent.grid.sortSettings.columns.length > 0 || this.isSortAction) {\n this.isSortAction = false;\n var parentData = this.parent.parentData;\n var query = getObject('query', args);\n var srtQry = new Query();\n for (var srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {\n var getColumnByField = 'getColumnByField';\n var col = this.parent.grid.renderModule.data[getColumnByField](this.parent.grid.\n sortSettings.columns[srt].field);\n var compFun = col.sortComparer && isOffline(this.parent) ?\n col.sortComparer.bind(col) :\n this.parent.grid.sortSettings.columns[srt].direction;\n srtQry.sortBy(this.parent.grid.sortSettings.columns[srt].field, compFun);\n }\n var modifiedData = new DataManager(parentData).executeLocal(srtQry);\n var sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: srtQry };\n this.parent.notify('createSort', sortArgs);\n results = sortArgs.modifiedData;\n this.dataResults.result = null;\n this.sortedData = results;\n this.parent.notify('updateModel', {});\n if (this.parent.grid.aggregates.length > 0 && !isNullOrUndefined(query)) {\n var isSort = false;\n var query_1 = getObject('query', args);\n var summaryQuery = query_1.queries.filter(function (q) { return q.fn === 'onAggregates'; });\n results = this.parent.summaryModule.calculateSummaryValue(summaryQuery, this.sortedData, isSort);\n }\n }\n count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)\n : results.length;\n var temp = this.paging(results, count, isExport, isPrinting, exportType, args);\n results = temp.result;\n count = temp.count;\n args.result = results;\n args.count = count;\n this.parent.notify('updateResults', args);\n };\n DataManipulation.prototype.paging = function (results, count, isExport, isPrinting, exportType, args) {\n if (this.parent.allowPaging && (!isExport || exportType === 'CurrentPage')\n && (!isPrinting || this.parent.printMode === 'CurrentPage')) {\n this.parent.notify(events.pagingActions, { result: results, count: count });\n results = this.dataResults.result;\n count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)\n : this.dataResults.count;\n }\n else if ((this.parent.enableVirtualization || this.parent.enableInfiniteScrolling) && (!isExport || exportType === 'CurrentPage')\n && getValue('requestType', args) !== 'save') {\n var actArgs = this.parent.enableInfiniteScrolling ? args : getValue('actionArgs', args);\n this.parent.notify(events.pagingActions, { result: results, count: count, actionArgs: actArgs });\n results = this.dataResults.result;\n count = this.dataResults.count;\n }\n var isPdfExport = 'isPdfExport';\n var isCollapsedStatePersist = 'isCollapsedStatePersist';\n if ((isPrinting === true || (args[isPdfExport] && (isNullOrUndefined(args[isCollapsedStatePersist])\n || args[isCollapsedStatePersist]))) && this.parent.printMode === 'AllPages') {\n var actualResults = [];\n for (var i = 0; i < results.length; i++) {\n var expandStatus = getExpandStatus(this.parent, results[i], this.parent.parentData);\n if (expandStatus) {\n actualResults.push(results[i]);\n }\n }\n results = actualResults;\n count = results.length;\n }\n var value = { result: results, count: count };\n return value;\n };\n DataManipulation.prototype.updateData = function (dataResult) {\n this.dataResults = dataResult;\n };\n DataManipulation.prototype.updateAction = function (actionData, action, requestType) {\n if ((requestType === 'delete' || requestType === 'save')) {\n this.parent.notify(events.crudAction, { value: actionData, action: action || requestType });\n }\n if (requestType === 'batchsave' && this.parent.editSettings.mode === 'Batch') {\n this.parent.notify(events.batchSave, {});\n }\n };\n return DataManipulation;\n}());\nexport { DataManipulation };\n","import { Grid, RowDD as GridDragDrop, parentsUntil } from '@syncfusion/ej2-grids';\nimport { getObject, Scroll } from '@syncfusion/ej2-grids';\nimport { closest, isNullOrUndefined, classList, setValue, extend, getValue, removeClass, addClass, setStyleAttribute } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport * as events from '../base/constant';\nimport { editAction } from './crud-actions';\nimport { getParentData, findChildrenRecords, isRemoteData, isOffline, isCountRequired } from '../utils';\n/**\n * TreeGrid RowDragAndDrop module\n *\n * @hidden\n */\nvar RowDD = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function RowDD(parent) {\n /** @hidden */\n this.canDrop = true;\n /** @hidden */\n this.isDraggedWithChild = false;\n /** @hidden */\n this.hasDropItem = true;\n /** @hidden */\n this.isaddtoBottom = false;\n Grid.Inject(GridDragDrop);\n this.parent = parent;\n this.addEventListener();\n }\n RowDD.prototype.getChildrecordsByParentID = function (id) {\n var treeGridDataSource;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n treeGridDataSource = this.parent.grid.dataSource.dataSource.json;\n }\n else {\n treeGridDataSource = this.parent.grid.dataSource;\n }\n var record = treeGridDataSource.filter(function (e) {\n return e.uniqueID === id;\n });\n return record;\n };\n /**\n * @hidden\n * @returns {void}\n */\n RowDD.prototype.addEventListener = function () {\n this.parent.on(events.rowdraging, this.Rowdraging, this);\n this.parent.on(events.rowDropped, this.rowDropped, this);\n this.parent.on(events.rowsAdd, this.rowsAdded, this);\n this.parent.on(events.rowsRemove, this.rowsRemoved, this);\n };\n /**\n * Reorder the rows based on given indexes and position\n *\n * @returns {void}\n * @param {number[]} fromIndexes - source indexes of rows to be re-ordered\n * @param {number} toIndex - Destination row index\n * @param {string} position - Drop position as above or below or child\n */\n RowDD.prototype.reorderRows = function (fromIndexes, toIndex, position) {\n var tObj = this.parent;\n var action = 'action';\n var updateRowAndCellElements = 'updateRowAndCellElements';\n if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {\n if (position === 'above') {\n this.dropPosition = 'topSegment';\n }\n if (position === 'below') {\n this.dropPosition = 'bottomSegment';\n }\n if (position === 'child') {\n this.dropPosition = 'middleSegment';\n }\n var data = [];\n for (var i = 0; i < fromIndexes.length; i++) {\n data[i] = this.parent.getCurrentViewRecords()[fromIndexes[i]];\n }\n var isByMethod = true;\n var args = {\n data: data,\n dropIndex: toIndex\n };\n if (!isCountRequired(this.parent)) {\n this.dropRows(args, isByMethod);\n }\n //this.refreshGridDataSource();\n if (tObj.isLocalData) {\n tObj.flatData = this.orderToIndex(tObj.flatData);\n }\n if (this.parent[action] === 'outdenting') {\n if (!isNullOrUndefined(data[0].parentItem)) {\n data[0].level = data[0].parentItem.level + 1;\n }\n }\n this.parent.grid.refresh();\n if (this.parent.enableImmutableMode && this.dropPosition === 'middleSegment') {\n var index = void 0;\n if (this.parent.allowRowDragAndDrop) {\n index = this.parent.treeColumnIndex + 1;\n }\n else if (this.parent[action] === 'indenting') {\n index = this.parent.treeColumnIndex;\n }\n var row = this.parent.getRows()[fromIndexes[0]];\n var dropData = args.data[0];\n var totalRecord = [];\n var rows = [];\n totalRecord.push(dropData);\n rows.push(row);\n var parentUniqueID = 'parentUniqueID';\n var parentData = getParentData(this.parent, args.data[0][parentUniqueID]);\n var parentrow = this.parent.getRows()[toIndex];\n totalRecord.push(parentData);\n rows.push(parentrow);\n this.parent[updateRowAndCellElements](totalRecord, rows, index);\n }\n if (this.parent.enableImmutableMode && this.parent[action] === 'outdenting') {\n var index = void 0;\n if (this.parent.allowRowDragAndDrop) {\n index = this.parent.treeColumnIndex + 1;\n }\n else if (this.parent[action] === 'outdenting') {\n index = this.parent.treeColumnIndex;\n }\n var record = args.data[0];\n var row = this.parent.getRows()[fromIndexes[0]];\n var totalRecord = [];\n var rows = [];\n totalRecord.push(record);\n rows.push(row);\n this.parent[updateRowAndCellElements](totalRecord, rows, index);\n }\n }\n else {\n return;\n }\n };\n RowDD.prototype.orderToIndex = function (currentData) {\n var _loop_1 = function (i) {\n currentData[i].index = i;\n if (!isNullOrUndefined(currentData[i].parentItem)) {\n var updatedParent = currentData.filter(function (data) {\n return data.uniqueID === currentData[i].parentUniqueID;\n })[0];\n currentData[i].parentItem.index = updatedParent.index;\n }\n };\n for (var i = 0; i < currentData.length; i++) {\n _loop_1(i);\n }\n return currentData;\n };\n RowDD.prototype.rowsAdded = function (e) {\n var draggedRecord;\n var dragRecords = e.records;\n for (var i = e.records.length - 1; i > -1; i--) {\n draggedRecord = dragRecords[i];\n if (draggedRecord.parentUniqueID) {\n var record = dragRecords.filter(function (data) {\n return data.uniqueID === draggedRecord.parentUniqueID;\n });\n if (record.length) {\n var index = record[0].childRecords.indexOf(draggedRecord);\n var parentRecord = record[0];\n if (index !== -1) {\n if (isNullOrUndefined(this.parent.idMapping)) {\n parentRecord.childRecords.splice(index, 1);\n if (!parentRecord.childRecords.length) {\n parentRecord.hasChildRecords = false;\n parentRecord.hasFilteredChildRecords = false;\n }\n }\n this.isDraggedWithChild = true;\n }\n }\n }\n }\n if (isNullOrUndefined(this.parent.dataSource) || !this.parent.dataSource.length) {\n var tObj = this.parent;\n var draggedRecord_1;\n var dragRecords_1 = e.records;\n var dragLength = e.records.length;\n for (var i = dragLength - 1; i > -1; i--) {\n draggedRecord_1 = dragRecords_1[i];\n if (!i && draggedRecord_1.hasChildRecords) {\n draggedRecord_1.taskData[this.parent.parentIdMapping] = null;\n }\n var recordIndex1 = 0;\n if (!isNullOrUndefined(tObj.parentIdMapping)) {\n tObj.childMapping = null;\n }\n if (!isNullOrUndefined(draggedRecord_1.taskData) && !isNullOrUndefined(tObj.childMapping) &&\n !Object.prototype.hasOwnProperty.call(draggedRecord_1.taskData, tObj.childMapping)) {\n draggedRecord_1.taskData[tObj.childMapping] = [];\n }\n if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.childMapping) &&\n (draggedRecord_1[tObj.childMapping]).length && !this.isDraggedWithChild &&\n !isNullOrUndefined(tObj.parentIdMapping)) {\n var childData = (draggedRecord_1[tObj.childMapping]);\n for (var j = 0; j < childData.length; j++) {\n if (dragRecords_1.indexOf(childData[j]) === -1) {\n dragRecords_1.splice(j, 0, childData[j]);\n childData[j].taskData = extend({}, childData[j]);\n i += 1;\n }\n }\n }\n if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.parentIdMapping) && draggedRecord_1[tObj.parentIdMapping] != null\n && !this.isDraggedWithChild) {\n draggedRecord_1.taskData[tObj.parentIdMapping] = null;\n delete draggedRecord_1.parentItem;\n delete draggedRecord_1.parentUniqueID;\n }\n if (isNullOrUndefined(tObj.dataSource)) {\n tObj.dataSource = [];\n }\n tObj.dataSource.splice(recordIndex1, 0, draggedRecord_1.taskData);\n }\n tObj.setProperties({ dataSource: tObj.dataSource }, false);\n }\n else {\n for (var i = 0; i < dragRecords.length; i++) {\n setValue('uniqueIDCollection.' + dragRecords[i].uniqueID, dragRecords[i], this.parent);\n }\n var args = { data: e.records, dropIndex: e.toIndex };\n if (this.parent.dataSource instanceof DataManager) {\n this.treeGridData = this.parent.dataSource.dataSource.json;\n this.treeData = this.parent.dataSource.dataSource.json;\n }\n else {\n this.treeGridData = this.parent.grid.dataSource;\n this.treeData = this.parent.dataSource;\n }\n if (isNullOrUndefined(this.dropPosition)) {\n this.dropPosition = 'bottomSegment';\n args.dropIndex = this.parent.getCurrentViewRecords().length > 1 ? this.parent.getCurrentViewRecords().length - 1 :\n args.dropIndex;\n args.data = args.data.map(function (i) {\n if (i.hasChildRecords && isNullOrUndefined(i.parentItem)) {\n i.level = 0;\n return i;\n }\n else {\n delete i.parentItem;\n delete i.parentUniqueID;\n i.level = 0;\n return i;\n }\n });\n }\n this.dropRows(args);\n }\n };\n RowDD.prototype.rowsRemoved = function (e) {\n for (var i = 0; i < e.records.length; i++) {\n this.draggedRecord = e.records[i];\n if (this.draggedRecord.hasChildRecords || this.draggedRecord.parentItem &&\n this.parent.grid.dataSource.\n indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0]) !== -1 ||\n this.draggedRecord.level === 0) {\n this.deleteDragRow();\n }\n }\n };\n RowDD.prototype.refreshGridDataSource = function () {\n var draggedRecord = this.draggedRecord;\n var droppedRecord = this.droppedRecord;\n var proxy = this.parent;\n var tempDataSource;\n var idx;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n tempDataSource = proxy.dataSource.dataSource.json;\n }\n else {\n tempDataSource = proxy.dataSource;\n }\n // eslint-disable-next-line max-len\n if (tempDataSource && (!isNullOrUndefined(droppedRecord) && !droppedRecord.parentItem) && !isNullOrUndefined(droppedRecord.taskData)) {\n var keys = Object.keys(tempDataSource);\n for (var i = 0; i < keys.length; i++) {\n if (tempDataSource[i][this.parent.childMapping] === droppedRecord.taskData[this.parent.childMapping]) {\n idx = i;\n }\n }\n if (this.dropPosition === 'topSegment') {\n if (!this.parent.idMapping) {\n tempDataSource.splice(idx, 0, draggedRecord.taskData);\n }\n }\n else if (this.dropPosition === 'bottomSegment') {\n if (!this.parent.idMapping) {\n tempDataSource.splice(idx + 1, 0, draggedRecord.taskData);\n }\n }\n }\n else if (!this.parent.parentIdMapping && (!isNullOrUndefined(droppedRecord) && droppedRecord.parentItem)) {\n if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {\n var record = this.getChildrecordsByParentID(droppedRecord.parentUniqueID)[0];\n var childRecords = record.childRecords;\n for (var i = 0; i < childRecords.length; i++) {\n droppedRecord.parentItem.taskData[this.parent.childMapping][i] = childRecords[i].taskData;\n }\n }\n }\n if (this.parent.parentIdMapping) {\n if (draggedRecord.parentItem) {\n if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {\n draggedRecord[this.parent.parentIdMapping] = droppedRecord[this.parent.parentIdMapping];\n draggedRecord.taskData[this.parent.parentIdMapping] = droppedRecord[this.parent.parentIdMapping];\n }\n else {\n draggedRecord[this.parent.parentIdMapping] = droppedRecord[this.parent.idMapping];\n draggedRecord.taskData[this.parent.parentIdMapping] = droppedRecord[this.parent.idMapping];\n }\n }\n else {\n draggedRecord.taskData[this.parent.parentIdMapping] = null;\n draggedRecord[this.parent.parentIdMapping] = null;\n }\n }\n };\n RowDD.prototype.removeFirstrowBorder = function (element) {\n var canremove = this.dropPosition === 'bottomSegment';\n if (this.parent.element.getElementsByClassName('e-firstrow-border').length > 0 && element &&\n (element.rowIndex !== 0 || canremove)) {\n this.parent.element.getElementsByClassName('e-firstrow-border')[0].remove();\n }\n };\n RowDD.prototype.removeLastrowBorder = function (element) {\n var isEmptyRow = element && (element.classList.contains('e-emptyrow') || element.classList.contains('e-columnheader')\n || element.classList.contains('e-detailrow'));\n var islastRowIndex = element && !isEmptyRow &&\n this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') !==\n element.getAttribute('data-uid');\n var canremove = islastRowIndex || this.dropPosition === 'topSegment';\n if (this.parent.element.getElementsByClassName('e-lastrow-border').length > 0 && element && (islastRowIndex || canremove)) {\n this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();\n }\n };\n RowDD.prototype.updateIcon = function (row, index, args) {\n var rowEle = args.target ? closest(args.target, 'tr') : null;\n this.dropPosition = undefined;\n var rowPositionHeight = 0;\n this.removeFirstrowBorder(rowEle);\n this.removeLastrowBorder(rowEle);\n for (var i = 0; i < args.rows.length; i++) {\n if (!isNullOrUndefined(rowEle) && rowEle.getAttribute('data-uid') === args.rows[i].getAttribute('data-uid')\n || !parentsUntil(args.target, 'e-gridcontent')) {\n this.dropPosition = 'Invalid';\n this.addErrorElem();\n }\n }\n // To get the corresponding drop position related to mouse position\n var tObj = this.parent;\n var rowTop = 0;\n var roundOff = 0;\n var toolHeight = tObj.toolbar && tObj.toolbar.length ?\n document.getElementById(tObj.element.id + '_gridcontrol_toolbarItems').offsetHeight : 0;\n // tObj.lastRow = tObj.getRowByIndex(tObj.getCurrentViewRecords().length - 1);\n var positionOffSet = this.getOffset(tObj.element);\n // let contentHeight1: number = (tObj.element.offsetHeight - (tObj.getContent() as HTMLElement).offsetHeight) + positionOffSet.top;\n var contentHeight = tObj.getHeaderContent().offsetHeight + positionOffSet.top + toolHeight;\n var scrollTop = tObj.getContent().firstElementChild.scrollTop;\n if (!isNullOrUndefined(rowEle)) {\n rowPositionHeight = rowEle.offsetTop - scrollTop;\n }\n // let scrollTop = (tObj.grid.scrollModule as any).content.scrollTop;\n rowTop = rowPositionHeight + contentHeight + roundOff;\n var rowBottom = rowTop + row[0].offsetHeight;\n var difference = rowBottom - rowTop;\n var divide = difference / 3;\n var topRowSegment = rowTop + divide;\n var middleRowSegment = topRowSegment + divide;\n var bottomRowSegment = middleRowSegment + divide;\n var mouseEvent = getObject('originalEvent.event', args);\n var touchEvent = getObject('originalEvent.event', args);\n var posy = (mouseEvent.type === 'mousemove') ? mouseEvent.pageY : ((!isNullOrUndefined(touchEvent) &&\n !isNullOrUndefined(touchEvent.changedTouches)) ? touchEvent.changedTouches[0].pageY : null);\n var isTopSegment = posy <= topRowSegment;\n var isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);\n var isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);\n if (isTopSegment || isMiddleRowSegment || isBottomRowSegment) {\n if (isTopSegment && this.dropPosition !== 'Invalid') {\n this.removeChildBorder();\n this.dropPosition = 'topSegment';\n this.removetopOrBottomBorder();\n this.addFirstrowBorder(rowEle);\n this.removeErrorElem();\n this.removeLastrowBorder(rowEle);\n this.topOrBottomBorder(args.target);\n }\n if (isMiddleRowSegment && this.dropPosition !== 'Invalid') {\n this.removetopOrBottomBorder();\n var rowElement = [];\n var element = closest(args.target, 'tr');\n rowElement = [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse'));\n if (rowElement.length > 0) {\n this.addRemoveClasses(rowElement, true, 'e-childborder');\n }\n this.addLastRowborder(rowEle);\n this.addFirstrowBorder(rowEle);\n this.dropPosition = 'middleSegment';\n }\n if (isBottomRowSegment && this.dropPosition !== 'Invalid') {\n this.removeErrorElem();\n this.removetopOrBottomBorder();\n this.removeChildBorder();\n this.dropPosition = 'bottomSegment';\n this.addLastRowborder(rowEle);\n this.removeFirstrowBorder(rowEle);\n this.topOrBottomBorder(args.target);\n }\n }\n return this.dropPosition;\n };\n RowDD.prototype.removeChildBorder = function () {\n var borderElem = [];\n borderElem = [].slice.call(this.parent.element.querySelectorAll('.e-childborder'));\n if (borderElem.length > 0) {\n this.addRemoveClasses(borderElem, false, 'e-childborder');\n }\n };\n RowDD.prototype.addFirstrowBorder = function (targetRow) {\n var node = this.parent.element;\n var tObj = this.parent;\n if (targetRow && targetRow.rowIndex === 0 && !targetRow.classList.contains('e-emptyrow')) {\n var div = this.parent.createElement('div', { className: 'e-firstrow-border' });\n var gridheaderEle = this.parent.getHeaderContent();\n var toolbarHeight = 0;\n if (tObj.toolbar) {\n toolbarHeight = tObj.toolbarModule.getToolbar().offsetHeight;\n }\n var multiplegrid = !isNullOrUndefined(this.parent.rowDropSettings.targetID);\n if (multiplegrid) {\n div.style.top = this.parent.grid.element.getElementsByClassName('e-gridheader')[0].offsetHeight\n + toolbarHeight + 'px';\n }\n div.style.width = multiplegrid ? node.offsetWidth + 'px' :\n node.offsetWidth - this.getScrollWidth() + 'px';\n if (!gridheaderEle.querySelectorAll('.e-firstrow-border').length) {\n gridheaderEle.appendChild(div);\n }\n }\n };\n RowDD.prototype.addLastRowborder = function (trElement) {\n var isEmptyRow = trElement && (trElement.classList.contains('e-emptyrow') ||\n trElement.classList.contains('e-columnheader') || trElement.classList.contains('e-detailrow'));\n if (trElement && !isEmptyRow && this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') ===\n trElement.getAttribute('data-uid')) {\n var bottomborder = this.parent.createElement('div', { className: 'e-lastrow-border' });\n var gridcontentEle = this.parent.getContent();\n bottomborder.style.width = this.parent.element.offsetWidth - this.getScrollWidth() + 'px';\n if (!gridcontentEle.querySelectorAll('.e-lastrow-border').length) {\n gridcontentEle.classList.add('e-treegrid-relative');\n gridcontentEle.appendChild(bottomborder);\n bottomborder.style.bottom = this.getScrollWidth() + 'px';\n }\n }\n };\n RowDD.prototype.getScrollWidth = function () {\n var scrollElem = this.parent.getContent().firstElementChild;\n return scrollElem.scrollWidth > scrollElem.offsetWidth ? Scroll.getScrollBarWidth() : 0;\n };\n RowDD.prototype.addErrorElem = function () {\n var dragelem = document.getElementsByClassName('e-cloneproperties')[0];\n var errorelem = dragelem.querySelectorAll('.e-errorelem').length;\n if (!errorelem && !this.parent.rowDropSettings.targetID) {\n var ele = document.createElement('div');\n classList(ele, ['e-errorcontainer'], []);\n classList(ele, ['e-icons', 'e-errorelem'], []);\n var errorVal = dragelem.querySelector('.errorValue');\n var content = dragelem.querySelector('.e-rowcell').innerHTML;\n if (errorVal) {\n content = errorVal.innerHTML;\n errorVal.parentNode.removeChild(errorVal);\n }\n dragelem.querySelector('.e-rowcell').innerHTML = '';\n var spanContent = document.createElement('span');\n spanContent.className = 'errorValue';\n spanContent.style.paddingLeft = '16px';\n spanContent.innerHTML = content;\n dragelem.querySelector('.e-rowcell').appendChild(ele);\n dragelem.querySelector('.e-rowcell').appendChild(spanContent);\n var dropItemSpan = document.querySelector('.e-dropitemscount');\n if (this.hasDropItem && dropItemSpan) {\n var dropItemLeft = parseInt(dropItemSpan.style.left, 10) + ele.offsetWidth + 16;\n var spanLeft = !this.parent.enableRtl ? dropItemLeft : 0;\n dropItemSpan.style.left = spanLeft + \"px\";\n this.hasDropItem = false;\n }\n }\n };\n RowDD.prototype.removeErrorElem = function () {\n var errorelem = document.querySelector('.e-errorelem');\n var errorValue = document.querySelector('.errorValue');\n var dropItemSpan = document.querySelector('.e-dropitemscount');\n if (errorelem) {\n if (dropItemSpan) {\n var dropItemLeft = parseInt(dropItemSpan.style.left, 10) - errorelem.offsetWidth - 16;\n setStyleAttribute(errorValue, {\n paddingLeft: '0px'\n });\n if (!this.parent.enableRtl) {\n setStyleAttribute(dropItemSpan, {\n left: dropItemLeft + \"px\"\n });\n }\n }\n errorelem.remove();\n }\n this.hasDropItem = true;\n };\n RowDD.prototype.topOrBottomBorder = function (target) {\n var rowElement = [];\n var element = closest(target, 'tr');\n rowElement = element ? [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse')) : [];\n if (rowElement.length) {\n if (this.dropPosition === 'topSegment') {\n this.addRemoveClasses(rowElement, true, 'e-droptop');\n if (this.parent.element.getElementsByClassName('e-lastrow-dragborder').length > 0) {\n this.parent.element.getElementsByClassName('e-lastrow-dragborder')[0].remove();\n }\n }\n if (this.dropPosition === 'bottomSegment') {\n this.addRemoveClasses(rowElement, true, 'e-dropbottom');\n }\n }\n };\n RowDD.prototype.removetopOrBottomBorder = function () {\n var border = [];\n border = [].slice.call(this.parent.element.querySelectorAll('.e-dropbottom, .e-droptop'));\n if (border.length) {\n this.addRemoveClasses(border, false, 'e-dropbottom');\n this.addRemoveClasses(border, false, 'e-droptop');\n }\n };\n RowDD.prototype.addRemoveClasses = function (cells, add, className) {\n for (var i = 0, len = cells.length; i < len; i++) {\n if (add) {\n cells[i].classList.add(className);\n }\n else {\n cells[i].classList.remove(className);\n }\n }\n };\n RowDD.prototype.getOffset = function (element) {\n var box = element.getBoundingClientRect();\n var body = document.body;\n var docElem = document.documentElement;\n var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\n var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n var clientTop = docElem.clientTop || body.clientTop || 0;\n var clientLeft = docElem.clientLeft || body.clientLeft || 0;\n var top = box.top + scrollTop - clientTop;\n var left = box.left + scrollLeft - clientLeft;\n return { top: Math.round(top), left: Math.round(left) };\n };\n RowDD.prototype.Rowdraging = function (args) {\n var tObj = this.parent;\n var cloneElement = this.parent.element.querySelector('.e-cloneproperties');\n cloneElement.style.cursor = '';\n var rowEle = args.target ? closest(args.target, 'tr') : null;\n var rowIdx = rowEle ? rowEle.rowIndex : -1;\n var dragRecords = [];\n var droppedRecord = tObj.getCurrentViewRecords()[rowIdx];\n this.removeErrorElem();\n this.canDrop = true;\n if (!args.data[0]) {\n dragRecords.push(args.data);\n }\n else {\n dragRecords = args.data;\n }\n if (rowIdx !== -1) {\n this.ensuredropPosition(dragRecords, droppedRecord);\n }\n else {\n this.canDrop = false;\n this.addErrorElem();\n }\n if (!tObj.rowDropSettings.targetID && this.canDrop) {\n tObj.rowDragAndDropModule.updateIcon(args.rows, rowIdx, args);\n }\n if (tObj.rowDropSettings.targetID) {\n var dropElement = parentsUntil(args.target, 'e-treegrid');\n if (dropElement && dropElement.id === this.parent.rowDropSettings.targetID) {\n var srcControl = dropElement.ej2_instances[0];\n srcControl.rowDragAndDropModule.updateIcon(args.rows, rowIdx, args);\n }\n }\n if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID)) {\n var dropElement = parentsUntil(args.target, 'e-treegrid');\n if (!dropElement) {\n cloneElement.style.cursor = 'default';\n }\n }\n };\n RowDD.prototype.rowDropped = function (args) {\n var tObj = this.parent;\n var parentItem = 'parentItem';\n if (!tObj.rowDropSettings.targetID) {\n if (parentsUntil(args.target, 'e-content')) {\n if (this.parent.element.querySelector('.e-errorelem')) {\n this.dropPosition = 'Invalid';\n }\n setValue('dropPosition', this.dropPosition, args);\n args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;\n tObj.trigger(events.rowDrop, args);\n if (!args.cancel) {\n if (!isCountRequired(this.parent)) {\n this.dropRows(args);\n }\n if (tObj.isLocalData) {\n tObj.flatData = this.orderToIndex(tObj.flatData);\n }\n tObj.grid.refresh();\n if (!isNullOrUndefined(tObj.getHeaderContent().querySelector('.e-firstrow-border'))) {\n tObj.getHeaderContent().querySelector('.e-firstrow-border').remove();\n }\n }\n }\n }\n else {\n if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID) || parentsUntil(args.target, 'e-treegrid') &&\n parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID || args.target && document.getElementById(tObj.rowDropSettings.targetID)) {\n setValue('dropPosition', this.dropPosition, args);\n tObj.trigger(events.rowDrop, args);\n if (!args.cancel && tObj.rowDropSettings.targetID) {\n this.dragDropGrid(args);\n if (tObj.isLocalData) {\n tObj.flatData = this.orderToIndex(tObj.flatData);\n }\n }\n }\n }\n this.removetopOrBottomBorder();\n this.removeChildBorder();\n if (!isNullOrUndefined(this.parent.element.getElementsByClassName('e-firstrow-border')[0])) {\n this.parent.element.getElementsByClassName('e-firstrow-border')[0].remove();\n }\n else if (!isNullOrUndefined(this.parent.element.getElementsByClassName('e-lastrow-border')[0])) {\n this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();\n }\n if (this.parent.enableImmutableMode && !this.parent.allowPaging && !isNullOrUndefined(args.data[0][parentItem])) {\n var index = this.parent.treeColumnIndex;\n index = index + 1;\n var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];\n var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField]);\n var row = this.parent.getRows()[rowIndex];\n var data = args.data[0];\n if (this.dropPosition === 'middleSegment') {\n var record = [];\n var rows = [];\n record.push(data);\n rows.push(row);\n var parentUniqueID = 'parentUniqueID';\n data = getParentData(this.parent, args.data[0][parentUniqueID]);\n rowIndex = this.parent.grid.getRowIndexByPrimaryKey(data[primaryKeyField]);\n var parentrow = this.parent.getRows()[rowIndex];\n record.push(data);\n rows.push(parentrow);\n for (var i = 0; i < record.length; i++) {\n this.parent.renderModule.cellRender({\n data: record[i], cell: rows[i].cells[index],\n column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],\n requestType: 'rowDragAndDrop'\n });\n }\n var targetEle = parentrow.getElementsByClassName('e-treegridcollapse')[0];\n if (!isNullOrUndefined(targetEle)) {\n removeClass([targetEle], 'e-treegridcollapse');\n addClass([targetEle], 'e-treegridexpand');\n }\n }\n else {\n this.parent.renderModule.cellRender({\n data: data, cell: row.cells[index],\n column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],\n requestType: 'rowDragAndDrop'\n });\n }\n }\n };\n RowDD.prototype.dragDropGrid = function (args) {\n var tObj = this.parent;\n var targetRow = closest(args.target, 'tr');\n var targetIndex = isNaN(this.getTargetIdx(targetRow)) ? 0 : this.getTargetIdx(targetRow);\n var dropElement = parentsUntil(args.target, 'e-treegrid');\n var srcControl;\n if (dropElement && dropElement.id === this.parent.rowDropSettings.targetID && !isRemoteData(this.parent)\n && !isCountRequired(this.parent)) {\n srcControl = dropElement.ej2_instances[0];\n var records = tObj.getSelectedRecords();\n var indexes = [];\n for (var i = 0; i < records.length; i++) {\n indexes[i] = records[i].index;\n }\n var data = srcControl.dataSource;\n if (this.parent.idMapping != null && (isNullOrUndefined(this.dropPosition) || this.dropPosition === 'bottomSegment' || this.dropPosition === 'Invalid') && !(data.length)) {\n var actualData = [];\n for (var i = 0; i < records.length; i++) {\n if (records[i].hasChildRecords) {\n actualData.push(records[i]);\n var child = findChildrenRecords(records[i]);\n for (var i_1 = 0; i_1 < child.length; i_1++) {\n actualData.push(child[i_1]); // push child records to drop the parent record along with its child records\n }\n }\n }\n if (actualData.length) {\n records = actualData;\n }\n }\n tObj.notify(events.rowsRemove, { indexes: indexes, records: records });\n srcControl.notify(events.rowsAdd, { toIndex: targetIndex, records: records });\n var srcControlFlatData = srcControl.rowDragAndDropModule.treeGridData;\n if (!isNullOrUndefined(srcControlFlatData)) {\n for (var i = 0; i < srcControlFlatData.length; i++) {\n srcControlFlatData[i].index = i;\n if (!isNullOrUndefined(srcControlFlatData[i].parentItem)) {\n var actualIndex = getValue('uniqueIDCollection.' + srcControlFlatData[i].parentUniqueID + '.index', srcControl);\n srcControlFlatData[i].parentItem.index = actualIndex;\n }\n }\n }\n tObj.grid.refresh();\n srcControl.grid.refresh();\n if (srcControl.grid.dataSource.length > 1) {\n srcControl.grid.refresh();\n if (!isNullOrUndefined(srcControl.getHeaderContent().querySelector('.e-firstrow-border'))) {\n srcControl.getHeaderContent().querySelector('.e-firstrow-border').remove();\n }\n if (!isNullOrUndefined(srcControl.getContent().querySelector('.e-lastrow-border'))) {\n srcControl.getContent().querySelector('.e-lastrow-border').remove();\n }\n }\n }\n if (isCountRequired(this.parent)) {\n srcControl = dropElement.ej2_instances[0];\n tObj.grid.refresh();\n srcControl.grid.refresh();\n }\n };\n RowDD.prototype.getTargetIdx = function (targetRow) {\n return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) : 0;\n };\n RowDD.prototype.getParentData = function (record) {\n var parentItem = record.parentItem;\n if (this.dropPosition === 'bottomSegment') {\n var selectedRecord = this.parent.getSelectedRecords()[0];\n this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);\n }\n if (this.dropPosition === 'middleSegment') {\n var level = this.parent.getSelectedRecords()[0].level;\n if (level === parentItem.level) {\n this.droppedRecord = getParentData(this.parent, parentItem.uniqueID);\n }\n else {\n this.getParentData(parentItem);\n }\n }\n };\n RowDD.prototype.dropRows = function (args, isByMethod) {\n if (this.dropPosition !== 'Invalid' && !isRemoteData(this.parent)) {\n var tObj = this.parent;\n var draggedRecord_2;\n var droppedRecord = void 0;\n if (isNullOrUndefined(args.dropIndex)) {\n var rowIndex = tObj.getSelectedRowIndexes()[0] - 1;\n var record = tObj.getCurrentViewRecords()[rowIndex];\n this.getParentData(record);\n }\n else {\n args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;\n this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];\n }\n var dragRecords = [];\n droppedRecord = this.droppedRecord;\n if (!args.data[0]) {\n dragRecords.push(args.data);\n }\n else {\n dragRecords = args.data;\n }\n var count = 0;\n var multiplegrid = this.parent.rowDropSettings.targetID;\n this.isMultipleGrid = multiplegrid;\n if (!multiplegrid) {\n this.ensuredropPosition(dragRecords, droppedRecord);\n }\n else {\n this.isaddtoBottom = multiplegrid && this.isDraggedWithChild;\n }\n var dragLength = dragRecords.length;\n if (!isNullOrUndefined(this.parent.idMapping)) {\n dragRecords.reverse();\n }\n var _loop_2 = function (i) {\n draggedRecord_2 = dragRecords[i];\n this_1.draggedRecord = draggedRecord_2;\n if (this_1.dropPosition !== 'Invalid') {\n if (!tObj.rowDropSettings.targetID || isByMethod) {\n this_1.deleteDragRow();\n }\n if (this_1.draggedRecord === this_1.droppedRecord) {\n var correctIndex = this_1.getTargetIdx(args.target.offsetParent.parentElement);\n if (isNaN(correctIndex)) {\n correctIndex = this_1.getTargetIdx(args.target.parentElement);\n }\n args.dropIndex = correctIndex;\n droppedRecord = this_1.droppedRecord = this_1.parent.getCurrentViewRecords()[args.dropIndex];\n }\n if (droppedRecord.parentItem || this_1.dropPosition === 'middleSegment') {\n var parentRecords = tObj.parentData;\n var newParentIndex = parentRecords.indexOf(this_1.draggedRecord);\n if (newParentIndex !== -1) {\n parentRecords.splice(newParentIndex, 1);\n }\n }\n var recordIndex1 = this_1.treeGridData.indexOf(droppedRecord);\n this_1.dropAtTop(recordIndex1);\n if (this_1.dropPosition === 'bottomSegment') {\n if (!droppedRecord.hasChildRecords) {\n if (this_1.parent.parentIdMapping) {\n this_1.treeData.splice(recordIndex1 + 1, 0, this_1.draggedRecord.taskData);\n }\n this_1.treeGridData.splice(recordIndex1 + 1, 0, this_1.draggedRecord);\n }\n else {\n count = this_1.getChildCount(droppedRecord, 0);\n if (this_1.parent.parentIdMapping) {\n this_1.treeData.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord.taskData);\n }\n this_1.treeGridData.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord);\n }\n if (isNullOrUndefined(droppedRecord.parentItem)) {\n delete draggedRecord_2.parentItem;\n delete draggedRecord_2.parentUniqueID;\n draggedRecord_2.level = 0;\n if (this_1.parent.parentIdMapping) {\n draggedRecord_2[this_1.parent.parentIdMapping] = null;\n }\n }\n if (droppedRecord.parentItem) {\n var rec = this_1.getChildrecordsByParentID(droppedRecord.parentUniqueID);\n var childRecords = rec[0].childRecords;\n var droppedRecordIndex = childRecords.indexOf(droppedRecord) + 1;\n childRecords.splice(droppedRecordIndex, 0, draggedRecord_2);\n draggedRecord_2.parentItem = droppedRecord.parentItem;\n draggedRecord_2.parentUniqueID = droppedRecord.parentUniqueID;\n if (this_1.parent.parentIdMapping) {\n draggedRecord_2[this_1.parent.parentIdMapping] = droppedRecord[this_1.parent.parentIdMapping];\n draggedRecord_2.parentItem = droppedRecord.parentItem;\n draggedRecord_2.level = droppedRecord.level;\n }\n }\n if (draggedRecord_2.hasChildRecords) {\n var level = 1;\n this_1.updateChildRecordLevel(draggedRecord_2, level);\n this_1.updateChildRecord(draggedRecord_2, recordIndex1 + count + 1);\n }\n }\n this_1.dropMiddle(recordIndex1);\n }\n if (isNullOrUndefined(draggedRecord_2.parentItem)) {\n var parentRecords = tObj.parentData;\n var newParentIndex = parentRecords.indexOf(this_1.droppedRecord);\n var nonRepeat_1 = 0;\n parentRecords.filter(function (e) {\n if (draggedRecord_2.uniqueID === e.uniqueID) {\n nonRepeat_1++;\n }\n });\n if (this_1.dropPosition === 'bottomSegment' && nonRepeat_1 === 0) {\n parentRecords.splice(newParentIndex + 1, 0, draggedRecord_2);\n }\n else if (this_1.dropPosition === 'topSegment' && nonRepeat_1 === 0) {\n parentRecords.splice(newParentIndex, 0, draggedRecord_2);\n }\n }\n tObj.rowDragAndDropModule.refreshGridDataSource();\n };\n var this_1 = this;\n for (var i = 0; i < dragLength; i++) {\n _loop_2(i);\n }\n }\n };\n RowDD.prototype.dropMiddle = function (recordIndex) {\n var tObj = this.parent;\n var childRecords = findChildrenRecords(this.droppedRecord);\n var childRecordsLength = (isNullOrUndefined(childRecords) ||\n childRecords.length === 0) ? recordIndex + 1 :\n childRecords.length + recordIndex + 1;\n if (this.dropPosition === 'middleSegment') {\n if (tObj.parentIdMapping) {\n this.treeData.splice(childRecordsLength, 0, this.draggedRecord.taskData);\n this.treeGridData.splice(childRecordsLength, 0, this.draggedRecord);\n }\n else {\n this.treeGridData.splice(childRecordsLength, 0, this.draggedRecord);\n }\n this.recordLevel();\n if (this.draggedRecord.hasChildRecords) {\n this.updateChildRecord(this.draggedRecord, childRecordsLength);\n }\n }\n };\n RowDD.prototype.dropAtTop = function (recordIndex1) {\n var tObj = this.parent;\n if (this.dropPosition === 'topSegment') {\n if (tObj.parentIdMapping) {\n this.treeData.splice(recordIndex1, 0, this.draggedRecord.taskData);\n }\n this.draggedRecord.parentItem = this.treeGridData[recordIndex1].parentItem;\n this.draggedRecord.parentUniqueID = this.treeGridData[recordIndex1].parentUniqueID;\n this.draggedRecord.level = this.treeGridData[recordIndex1].level;\n this.treeGridData.splice(recordIndex1, 0, this.draggedRecord);\n if (this.draggedRecord.hasChildRecords) {\n var level = 1;\n this.updateChildRecord(this.draggedRecord, recordIndex1);\n this.updateChildRecordLevel(this.draggedRecord, level);\n }\n if (this.droppedRecord.parentItem) {\n var rec = this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID);\n var childRecords = rec[0].childRecords;\n var droppedRecordIndex = childRecords.indexOf(this.droppedRecord);\n childRecords.splice(droppedRecordIndex, 0, this.draggedRecord);\n }\n }\n };\n RowDD.prototype.recordLevel = function () {\n var tObj = this.parent;\n var draggedRecord = this.draggedRecord;\n var droppedRecord = this.droppedRecord;\n var childItem = tObj.childMapping;\n if (!droppedRecord.hasChildRecords) {\n droppedRecord.hasChildRecords = true;\n droppedRecord.hasFilteredChildRecords = true;\n if (isNullOrUndefined(droppedRecord.childRecords) || droppedRecord.childRecords.length === 0) {\n droppedRecord.childRecords = [];\n if (!tObj.parentIdMapping && isNullOrUndefined(droppedRecord.taskData[childItem])) {\n droppedRecord.taskData[childItem] = [];\n }\n }\n }\n if (this.dropPosition === 'middleSegment') {\n var parentItem = extend({}, droppedRecord);\n delete parentItem.childRecords;\n draggedRecord.parentItem = parentItem;\n draggedRecord.parentUniqueID = droppedRecord.uniqueID;\n droppedRecord.childRecords.splice(droppedRecord.childRecords.length, 0, draggedRecord);\n var isSelfReference = 'isSelfReference';\n if (tObj[isSelfReference]) {\n droppedRecord[tObj.childMapping] = [];\n droppedRecord[tObj.childMapping].splice(droppedRecord[tObj.childMapping].length, 0, draggedRecord);\n }\n if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData[childItem])) {\n droppedRecord.taskData[tObj.childMapping].splice(droppedRecord.childRecords.length, 0, draggedRecord.taskData);\n }\n if (!draggedRecord.hasChildRecords) {\n draggedRecord.level = droppedRecord.level + 1;\n }\n else {\n var level = 1;\n draggedRecord.level = droppedRecord.level + 1;\n this.updateChildRecordLevel(draggedRecord, level);\n }\n droppedRecord.expanded = true;\n }\n };\n RowDD.prototype.deleteDragRow = function () {\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n this.treeGridData = this.parent.grid.dataSource.dataSource.json;\n this.treeData = this.parent.dataSource.dataSource.json;\n }\n else {\n this.treeGridData = this.parent.grid.dataSource;\n this.treeData = this.parent.dataSource;\n }\n var deletedRow = getParentData(this.parent, this.draggedRecord.uniqueID);\n if (!isNullOrUndefined(deletedRow.childRecords) && deletedRow.childRecords.length) {\n deletedRow.hasChildRecords = true;\n }\n this.removeRecords(deletedRow);\n };\n RowDD.prototype.updateChildRecord = function (record, count) {\n var currentRecord;\n var tObj = this.parent;\n var length = 0;\n if (!record.hasChildRecords) {\n return 0;\n }\n length = record.childRecords.length;\n for (var i = 0; i < length; i++) {\n currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, tObj);\n count++;\n tObj.flatData.splice(count, 0, currentRecord);\n setValue('uniqueIDCollection.' + currentRecord.uniqueID, currentRecord, this.parent);\n if (tObj.parentIdMapping) {\n this.treeData.splice(count, 0, currentRecord.taskData);\n }\n if (currentRecord.hasChildRecords) {\n count = this.updateChildRecord(currentRecord, count);\n }\n }\n return count;\n };\n RowDD.prototype.updateChildRecordLevel = function (record, level) {\n var length = 0;\n var currentRecord;\n level++;\n if (!record.hasChildRecords) {\n return 0;\n }\n length = record.childRecords.length;\n for (var i = 0; i < length; i++) {\n currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, this.parent);\n var parentData = void 0;\n if (record.parentItem) {\n parentData = getParentData(this.parent, record.parentItem.uniqueID);\n }\n if (isNullOrUndefined(parentData) && !isNullOrUndefined(record.parentItem)) {\n parentData = record.parentItem;\n }\n currentRecord.level = record.parentItem ? parentData.level + level : record.level + 1;\n if (currentRecord.hasChildRecords) {\n level--;\n level = this.updateChildRecordLevel(currentRecord, level);\n }\n }\n return level;\n };\n RowDD.prototype.removeRecords = function (record) {\n var tObj = this.parent;\n var dataSource;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n dataSource = this.parent.dataSource.dataSource.json;\n }\n else {\n dataSource = this.parent.dataSource;\n }\n var deletedRow = record;\n var isSelfReference = !isNullOrUndefined(tObj.parentIdMapping);\n var flatParentData = this.getChildrecordsByParentID(deletedRow.parentUniqueID)[0];\n if (deletedRow) {\n if (deletedRow.parentItem) {\n var childRecords = flatParentData ? flatParentData.childRecords : [];\n var childIndex = 0;\n if (childRecords && childRecords.length > 0) {\n childIndex = childRecords.indexOf(deletedRow);\n flatParentData.childRecords.splice(childIndex, 1);\n if (!this.parent.parentIdMapping || tObj.enableImmutableMode) {\n editAction({ value: deletedRow, action: 'delete' }, this.parent, isSelfReference, deletedRow.index, deletedRow.index);\n }\n }\n }\n if (tObj.parentIdMapping) {\n if (deletedRow.hasChildRecords && deletedRow.childRecords.length > 0) {\n this.removeChildItem(deletedRow);\n }\n var idx = void 0;\n var idz = void 0;\n var treeGridData = dataSource;\n for (var i = 0; i < treeGridData.length; i++) {\n if (treeGridData[i][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {\n idx = i;\n }\n }\n for (var i = 0; i < this.treeGridData.length; i++) {\n if (this.treeGridData[i][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {\n idz = i;\n }\n }\n if (idx !== -1 && !isNullOrUndefined(idx)) {\n dataSource.splice(idx, 1);\n }\n if (idz !== -1 && !isNullOrUndefined(idz)) {\n this.treeGridData.splice(idz, 1);\n }\n }\n var recordIndex = this.treeGridData.indexOf(deletedRow);\n if (!tObj.parentIdMapping) {\n var parentIndex = this.parent.parentData.indexOf(deletedRow);\n if (parentIndex !== -1) {\n tObj.parentData.splice(parentIndex, 1);\n dataSource.splice(parentIndex, 1);\n }\n }\n if (recordIndex === -1 && !tObj.parentIdMapping) {\n var primaryKeyField = tObj.getPrimaryKeyFieldNames()[0];\n for (var j = 0; j < this.treeGridData.length; j++) {\n if (this.treeGridData[j][primaryKeyField] === deletedRow[primaryKeyField]) {\n recordIndex = j;\n }\n }\n }\n if (!tObj.parentIdMapping) {\n var deletedRecordCount = this.getChildCount(deletedRow, 0);\n this.treeGridData.splice(recordIndex, deletedRecordCount + 1);\n }\n if (deletedRow.parentItem && flatParentData && flatParentData.childRecords && !flatParentData.childRecords.length) {\n flatParentData.expanded = false;\n flatParentData.hasChildRecords = false;\n flatParentData.hasFilteredChildRecords = false;\n }\n }\n };\n RowDD.prototype.removeChildItem = function (record) {\n var currentRecord;\n var idx;\n var idz;\n var dataSource;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n dataSource = this.parent.dataSource.dataSource.json;\n }\n else {\n dataSource = this.parent.dataSource;\n }\n for (var i = 0; i < record.childRecords.length; i++) {\n currentRecord = record.childRecords[i];\n if (!isNullOrUndefined(currentRecord.childRecords) && currentRecord.childRecords.length) {\n currentRecord.hasChildRecords = true;\n }\n var treeGridData = void 0;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n treeGridData = this.parent.dataSource.dataSource.json;\n }\n else {\n treeGridData = this.parent.dataSource;\n }\n for (var i_2 = 0; i_2 < treeGridData.length; i_2++) {\n if (treeGridData[i_2][this.parent.idMapping] === currentRecord.taskData[this.parent.idMapping]) {\n idx = i_2;\n }\n }\n for (var i_3 = 0; i_3 < this.treeGridData.length; i_3++) {\n if (this.treeGridData[i_3][this.parent.idMapping] === currentRecord.taskData[this.parent.idMapping]) {\n idz = i_3;\n break;\n }\n }\n if (idx !== -1 && !isNullOrUndefined(idx)) {\n dataSource.splice(idx, 1);\n }\n if (idz !== -1 && !isNullOrUndefined(idz)) {\n this.treeGridData.splice(idz, 1);\n }\n if (currentRecord.hasChildRecords) {\n this.removeChildItem(currentRecord);\n }\n }\n };\n RowDD.prototype.getChildCount = function (record, count) {\n var currentRecord;\n if (!record.hasChildRecords) {\n return 0;\n }\n for (var i = 0; i < record.childRecords.length; i++) {\n currentRecord = record.childRecords[i];\n count++;\n if (currentRecord.hasChildRecords) {\n count = this.getChildCount(currentRecord, count);\n }\n }\n return count;\n };\n RowDD.prototype.ensuredropPosition = function (draggedRecords, currentRecord) {\n var _this = this;\n draggedRecords.filter(function (e) {\n if (e.hasChildRecords && !isNullOrUndefined(e.childRecords)) {\n var valid = e.childRecords.indexOf(currentRecord);\n if (valid === -1) {\n _this.ensuredropPosition(e.childRecords, currentRecord);\n }\n else {\n _this.dropPosition = 'Invalid';\n _this.addErrorElem();\n _this.canDrop = false;\n return;\n }\n }\n });\n };\n RowDD.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {void}\n */\n RowDD.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.rowdraging, this.Rowdraging);\n this.parent.off(events.rowDropped, this.rowDropped);\n this.parent.off(events.rowsAdd, this.rowsAdded);\n this.parent.off(events.rowsRemove, this.rowsRemoved);\n };\n /**\n * hidden\n */\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns RowDragAndDrop module name\n */\n RowDD.prototype.getModuleName = function () {\n return 'rowDragAndDrop';\n };\n return RowDD;\n}());\nexport { RowDD };\n","/**\n * Defines Predefined toolbar items.\n *\n * @hidden\n */\nexport var ToolbarItem;\n(function (ToolbarItem) {\n ToolbarItem[ToolbarItem[\"Add\"] = 0] = \"Add\";\n ToolbarItem[ToolbarItem[\"Edit\"] = 1] = \"Edit\";\n ToolbarItem[ToolbarItem[\"Update\"] = 2] = \"Update\";\n ToolbarItem[ToolbarItem[\"Delete\"] = 3] = \"Delete\";\n ToolbarItem[ToolbarItem[\"Cancel\"] = 4] = \"Cancel\";\n ToolbarItem[ToolbarItem[\"Search\"] = 5] = \"Search\";\n ToolbarItem[ToolbarItem[\"ExpandAll\"] = 6] = \"ExpandAll\";\n ToolbarItem[ToolbarItem[\"CollapseAll\"] = 7] = \"CollapseAll\";\n ToolbarItem[ToolbarItem[\"ExcelExport\"] = 8] = \"ExcelExport\";\n ToolbarItem[ToolbarItem[\"PdfExport\"] = 9] = \"PdfExport\";\n ToolbarItem[ToolbarItem[\"CsvExport\"] = 10] = \"CsvExport\";\n ToolbarItem[ToolbarItem[\"Print\"] = 11] = \"Print\";\n ToolbarItem[ToolbarItem[\"RowIndent\"] = 12] = \"RowIndent\";\n ToolbarItem[ToolbarItem[\"RowOutdent\"] = 13] = \"RowOutdent\";\n})(ToolbarItem || (ToolbarItem = {}));\n/**\n * Defines predefined contextmenu items.\n *\n * @hidden\n */\nexport var ContextMenuItems;\n(function (ContextMenuItems) {\n ContextMenuItems[ContextMenuItems[\"AutoFit\"] = 0] = \"AutoFit\";\n ContextMenuItems[ContextMenuItems[\"AutoFitAll\"] = 1] = \"AutoFitAll\";\n ContextMenuItems[ContextMenuItems[\"SortAscending\"] = 2] = \"SortAscending\";\n ContextMenuItems[ContextMenuItems[\"SortDescending\"] = 3] = \"SortDescending\";\n ContextMenuItems[ContextMenuItems[\"Edit\"] = 4] = \"Edit\";\n ContextMenuItems[ContextMenuItems[\"Delete\"] = 5] = \"Delete\";\n ContextMenuItems[ContextMenuItems[\"Save\"] = 6] = \"Save\";\n ContextMenuItems[ContextMenuItems[\"Cancel\"] = 7] = \"Cancel\";\n ContextMenuItems[ContextMenuItems[\"PdfExport\"] = 8] = \"PdfExport\";\n ContextMenuItems[ContextMenuItems[\"ExcelExport\"] = 9] = \"ExcelExport\";\n ContextMenuItems[ContextMenuItems[\"CsvExport\"] = 10] = \"CsvExport\";\n ContextMenuItems[ContextMenuItems[\"FirstPage\"] = 11] = \"FirstPage\";\n ContextMenuItems[ContextMenuItems[\"PrevPage\"] = 12] = \"PrevPage\";\n ContextMenuItems[ContextMenuItems[\"LastPage\"] = 13] = \"LastPage\";\n ContextMenuItems[ContextMenuItems[\"NextPage\"] = 14] = \"NextPage\";\n ContextMenuItems[ContextMenuItems[\"AddRow\"] = 15] = \"AddRow\";\n})(ContextMenuItems || (ContextMenuItems = {}));\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the paging behavior of the TreeGrid.\n */\nvar PageSettings = /** @class */ (function (_super) {\n __extends(PageSettings, _super);\n function PageSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(12)\n ], PageSettings.prototype, \"pageSize\", void 0);\n __decorate([\n Property(8)\n ], PageSettings.prototype, \"pageCount\", void 0);\n __decorate([\n Property(1)\n ], PageSettings.prototype, \"currentPage\", void 0);\n __decorate([\n Property()\n ], PageSettings.prototype, \"totalRecordsCount\", void 0);\n __decorate([\n Property(false)\n ], PageSettings.prototype, \"enableQueryString\", void 0);\n __decorate([\n Property(false)\n ], PageSettings.prototype, \"pageSizes\", void 0);\n __decorate([\n Property(null)\n ], PageSettings.prototype, \"template\", void 0);\n __decorate([\n Property('All')\n ], PageSettings.prototype, \"pageSizeMode\", void 0);\n return PageSettings;\n}(ChildProperty));\nexport { PageSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty, Collection, getEnumValue, compile } from '@syncfusion/ej2-base';\nimport { Internationalization } from '@syncfusion/ej2-base';\nimport { CellType } from '@syncfusion/ej2-grids';\n/**\n * Configures the TreeGrid's aggregate column.\n */\nvar AggregateColumn = /** @class */ (function (_super) {\n __extends(AggregateColumn, _super);\n function AggregateColumn() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.intl = new Internationalization();\n _this.templateFn = {};\n return _this;\n }\n /**\n * Custom format function\n *\n * @hidden\n * @param {string} cultureName - culture name to format\n * @returns {void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n AggregateColumn.prototype.setFormatter = function (cultureName) {\n if (this.format && (this.format.skeleton || this.format.format)) {\n this.formatFn = this.getFormatFunction(this.format);\n }\n };\n /**\n * @param {NumberFormatOptions | DateFormatOptions} format - formatting options for number and date values\n * @hidden\n * @returns {Function} - return formatter function\n */\n AggregateColumn.prototype.getFormatFunction = function (format) {\n if (format.type) {\n return this.intl.getDateFormat(format);\n }\n else {\n return this.intl.getNumberFormat(format);\n }\n };\n /**\n * @hidden\n * @returns {Function} - Returns formatter function\n */\n AggregateColumn.prototype.getFormatter = function () {\n return this.formatFn;\n };\n /**\n * @param {Object} helper - Specified the helper\n * @hidden\n * @returns {void}\n */\n AggregateColumn.prototype.setTemplate = function (helper) {\n if (helper === void 0) { helper = {}; }\n if (this.footerTemplate !== undefined) {\n this.templateFn[getEnumValue(CellType, CellType.Summary)] = { fn: compile(this.footerTemplate, helper),\n property: 'footerTemplate' };\n }\n };\n /**\n * @param {CellType} type - specifies the cell type\n * @returns {Object} returns the object\n * @hidden\n */\n AggregateColumn.prototype.getTemplate = function (type) {\n return this.templateFn[getEnumValue(CellType, type)];\n };\n /**\n * @param {Object} prop - updates aggregate properties without change detection\n * @hidden\n * @returns {void}\n */\n AggregateColumn.prototype.setPropertiesSilent = function (prop) {\n this.setProperties(prop, true);\n };\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"type\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"footerTemplate\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"field\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"format\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"columnName\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"customAggregate\", void 0);\n return AggregateColumn;\n}(ChildProperty));\nexport { AggregateColumn };\nvar AggregateRow = /** @class */ (function (_super) {\n __extends(AggregateRow, _super);\n function AggregateRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Collection([], AggregateColumn)\n ], AggregateRow.prototype, \"columns\", void 0);\n __decorate([\n Property(true)\n ], AggregateRow.prototype, \"showChildSummary\", void 0);\n return AggregateRow;\n}(ChildProperty));\nexport { AggregateRow };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ChildProperty, Property } from '@syncfusion/ej2-base';\n/**\n * Configures the edit behavior of the TreeGrid.\n */\nvar EditSettings = /** @class */ (function (_super) {\n __extends(EditSettings, _super);\n function EditSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"allowAdding\", void 0);\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"allowEditing\", void 0);\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"allowDeleting\", void 0);\n __decorate([\n Property('Cell')\n ], EditSettings.prototype, \"mode\", void 0);\n __decorate([\n Property('Top')\n ], EditSettings.prototype, \"newRowPosition\", void 0);\n __decorate([\n Property(true)\n ], EditSettings.prototype, \"allowEditOnDblClick\", void 0);\n __decorate([\n Property(true)\n ], EditSettings.prototype, \"showConfirmDialog\", void 0);\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"showDeleteConfirmDialog\", void 0);\n __decorate([\n Property('')\n ], EditSettings.prototype, \"template\", void 0);\n __decorate([\n Property({})\n ], EditSettings.prototype, \"dialog\", void 0);\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"allowNextRowEdit\", void 0);\n return EditSettings;\n}(ChildProperty));\nexport { EditSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ChildProperty, Property, Collection } from '@syncfusion/ej2-base';\n/**\n * Represents the field name and direction of sort column.\n */\nvar SortDescriptor = /** @class */ (function (_super) {\n __extends(SortDescriptor, _super);\n function SortDescriptor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], SortDescriptor.prototype, \"field\", void 0);\n __decorate([\n Property()\n ], SortDescriptor.prototype, \"direction\", void 0);\n return SortDescriptor;\n}(ChildProperty));\nexport { SortDescriptor };\n/**\n * Configures the sorting behavior of TreeGrid.\n */\nvar SortSettings = /** @class */ (function (_super) {\n __extends(SortSettings, _super);\n function SortSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Collection([], SortDescriptor)\n ], SortSettings.prototype, \"columns\", void 0);\n __decorate([\n Property(true)\n ], SortSettings.prototype, \"allowUnsort\", void 0);\n return SortSettings;\n}(ChildProperty));\nexport { SortSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the infinite scroll behavior of Tree Grid.\n */\nvar InfiniteScrollSettings = /** @class */ (function (_super) {\n __extends(InfiniteScrollSettings, _super);\n function InfiniteScrollSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], InfiniteScrollSettings.prototype, \"enableCache\", void 0);\n __decorate([\n Property(3)\n ], InfiniteScrollSettings.prototype, \"maxBlocks\", void 0);\n __decorate([\n Property(3)\n ], InfiniteScrollSettings.prototype, \"initialBlocks\", void 0);\n return InfiniteScrollSettings;\n}(ChildProperty));\nexport { InfiniteScrollSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, addClass, createElement, EventHandler, isNullOrUndefined, extend } from '@syncfusion/ej2-base';\nimport { removeClass, Complex, Collection, getValue } from '@syncfusion/ej2-base';\nimport { Event, Property, NotifyPropertyChanges, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';\nimport { Column } from '../models/column';\nimport { CellRenderer } from '@syncfusion/ej2-grids';\nimport { RowDropSettings, getUid } from '@syncfusion/ej2-grids';\nimport { FilterSettings } from '../models/filter-settings';\nimport { TextWrapSettings } from '../models/textwrap-settings';\nimport { Logger as TreeLogger } from '../actions/logger';\nimport { TreeClipboard } from '../actions/clipboard';\nimport { Selection as TreeGridSelection } from '../actions/selection';\nimport { Print } from '../actions/print';\nimport * as events from '../base/constant';\nimport { SearchSettings } from '../models/search-settings';\nimport { SelectionSettings } from '../models/selection-settings';\nimport { getActualProperties, getObject } from '@syncfusion/ej2-grids';\nimport { DataManager, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';\nimport { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';\nimport { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';\nimport { Grid, Logger } from '@syncfusion/ej2-grids';\nimport { Render } from '../renderer/render';\nimport { DataManipulation } from './data';\nimport { RowDD } from '../actions/rowdragdrop';\nimport { iterateArrayOrObject } from '@syncfusion/ej2-grids';\nimport { ToolbarItem, ContextMenuItems } from '../enum';\nimport { PageSettings } from '../models/page-settings';\nimport { AggregateRow } from '../models/summary';\nimport { EditSettings } from '../models/edit-settings';\nimport { SortSettings } from '../models/sort-settings';\nimport { isHidden, getExpandStatus } from '../utils';\nimport { editAction } from '../actions/crud-actions';\nimport { InfiniteScrollSettings } from '../models/infinite-scroll-settings';\n/**\n * Represents the TreeGrid component.\n * ```html\n * <div id='treegrid'></div>\n * <script>\n * var treegridObj = new TreeGrid({ allowPaging: true });\n * treegridObj.appendTo('#treegrid');\n * </script>\n * ```\n */\nvar TreeGrid = /** @class */ (function (_super) {\n __extends(TreeGrid, _super);\n function TreeGrid(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.dataResults = {};\n _this.uniqueIDCollection = {};\n _this.uniqueIDFilterCollection = {};\n _this.changedRecords = 'changedRecords';\n _this.deletedRecords = 'deletedRecords';\n _this.addedRecords = 'addedRecords';\n _this.objectEqualityChecker = function (old, current) {\n if (old) {\n var keys = Object.keys(old);\n var isEqual = true;\n var excludeKeys = ['Children', 'childRecords', 'taskData', 'uniqueID', 'parentItem', 'parentUniqueID', 'index'];\n for (var i = 0; i < keys.length; i++) {\n if (old[keys[i]] !== current[keys[i]] && excludeKeys.indexOf(keys[i]) === -1) {\n var isDate = old[keys[i]] instanceof Date && current[keys[i]] instanceof Date;\n if (!isDate || (old[keys[i]].getTime() !== current[keys[i]].getTime())) {\n isEqual = false;\n break;\n }\n }\n }\n return isEqual;\n }\n else {\n return false;\n }\n };\n TreeGrid_1.Inject(TreeGridSelection);\n setValue('mergePersistData', _this.mergePersistTreeGridData, _this);\n var logger = 'Logger';\n if (!isNullOrUndefined(_this.injectedModules[logger])) {\n Grid.Inject(Logger);\n }\n _this.grid = new Grid();\n return _this;\n }\n TreeGrid_1 = TreeGrid;\n /**\n * Export TreeGrid data to Excel file(.xlsx).\n *\n * @param {ExcelExportProperties | TreeGridExcelExportProperties} excelExportProperties - Defines the export properties of the Tree Grid.\n * @param {boolean} isMultipleExport - Define to enable multiple export.\n * @param {workbook} workbook - Defines the Workbook if multiple export is enabled.\n * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.\n * @returns {Promise<any>} - Returns promise object of export action\n */\n /* eslint-disable */\n TreeGrid.prototype.excelExport = function (excelExportProperties, isMultipleExport, workbook, isBlob) {\n /* eslint-enable */\n return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, false);\n };\n /**\n * Export TreeGrid data to CSV file.\n *\n * @param {ExcelExportProperties} excelExportProperties - Defines the export properties of the TreeGrid.\n * @param {boolean} isMultipleExport - Define to enable multiple export.\n * @param {workbook} workbook - Defines the Workbook if multiple export is enabled.\n * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.\n * @returns {Promise<any>} - Returns promise object of export action\n */\n /* eslint-disable */\n TreeGrid.prototype.csvExport = function (excelExportProperties, isMultipleExport, workbook, isBlob) {\n /* eslint-enable */\n return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, true);\n };\n /**\n * Export TreeGrid data to PDF document.\n *\n * @param {PdfExportProperties | TreeGridPdfExportProperties} pdfExportProperties - Defines the export properties of the Tree Grid.\n * @param {boolean} isMultipleExport - Define to enable multiple export.\n * @param {Object} pdfDoc - Defined the Pdf Document if multiple export is enabled.\n * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.\n * @returns {Promise<any>} - Returns promise object of export action\n */\n TreeGrid.prototype.pdfExport = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {\n return this.pdfExportModule.Map(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns TreeGrid module name\n */\n TreeGrid.prototype.getModuleName = function () {\n return 'treegrid';\n };\n /**\n * For internal use only - Initialize the event handler;\n *\n * @private\n * @returns {void}\n */\n TreeGrid.prototype.preRender = function () {\n this.TreeGridLocale();\n this.initProperties();\n this.defaultLocale = {\n Above: 'Above',\n Below: 'Below',\n Child: 'Child',\n AddRow: 'Add Row',\n ExpandAll: 'Expand All',\n CollapseAll: 'Collapse All',\n RowIndent: 'Indent',\n RowOutdent: 'Outdent'\n };\n this.l10n = new L10n('treegrid', this.defaultLocale, this.locale);\n if (this.isSelfReference && isNullOrUndefined(this.childMapping)) {\n this.childMapping = 'Children';\n }\n };\n /**\n * Sorts a column with the given options.\n *\n * @param {string} columnName - Defines the column name to be sorted.\n * @param {SortDirection} direction - Defines the direction of sorting field.\n * @param {boolean} isMultiSort - Specifies whether the previous sorted columns are to be maintained.\n * @returns {void}\n */\n TreeGrid.prototype.sortByColumn = function (columnName, direction, isMultiSort) {\n if (this.sortModule) {\n this.sortModule.sortColumn(columnName, direction, isMultiSort);\n }\n };\n /**\n * Clears all the sorted columns of the TreeGrid.\n *\n * @returns {void}\n */\n TreeGrid.prototype.clearSorting = function () {\n if (this.sortModule) {\n this.sortModule.clearSorting();\n }\n };\n /**\n * Remove sorted column by field name.\n *\n * @param {string} field - Defines the column field name to remove sort.\n * @returns {void}\n * @hidden\n */\n TreeGrid.prototype.removeSortColumn = function (field) {\n if (this.sortModule) {\n this.sortModule.removeSortColumn(field);\n }\n };\n /**\n * Searches TreeGrid records using the given key.\n * You can customize the default search option by using the\n * [`searchSettings`](./#searchsettings/).\n *\n * @param {string} searchString - Defines the key.\n * @returns {void}\n */\n TreeGrid.prototype.search = function (searchString) {\n this.grid.search(searchString);\n };\n /**\n * Changes the column width to automatically fit its content to ensure that the width shows the content without wrapping/hiding.\n * > * This method ignores the hidden columns.\n * > * Uses the `autoFitColumns` method in the `dataBound` event to resize at initial rendering.\n *\n * @param {string |string[]} fieldNames - Defines the column names.\n * @returns {void}\n *\n *\n *\n */\n TreeGrid.prototype.autoFitColumns = function (fieldNames) {\n this.resizeModule.autoFitColumns(fieldNames);\n this.updateColumnModel();\n };\n /**\n * Changes the TreeGrid column positions by field names.\n *\n * @param {string} fromFName - Defines the origin field name.\n * @param {string} toFName - Defines the destination field name.\n * @returns {void}\n */\n TreeGrid.prototype.reorderColumns = function (fromFName, toFName) {\n this.grid.reorderColumns(fromFName, toFName);\n };\n TreeGrid.prototype.TreeGridLocale = function () {\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n var locale = L10n.locale;\n var localeObject = {};\n setValue(this.locale, {}, localeObject);\n var gridLocale;\n gridLocale = {};\n gridLocale = getObject(this.locale, locale);\n var treeGridLocale;\n treeGridLocale = {};\n treeGridLocale = getObject(this.getModuleName(), gridLocale);\n setValue('grid', treeGridLocale, getObject(this.locale, localeObject));\n L10n.load(localeObject);\n };\n /**\n * By default, prints all the pages of the TreeGrid and hides the pager.\n * > You can customize print options using the\n * [`printMode`](./#printmode).\n *\n * @returns {void}\n */\n TreeGrid.prototype.print = function () {\n this.printModule.print();\n };\n TreeGrid.prototype.treeGridkeyActionHandler = function (e) {\n if (this.allowKeyboard) {\n var target = void 0;\n var parentTarget = void 0;\n var column = void 0;\n var row = void 0;\n var summaryElement = void 0;\n switch (e.action) {\n case 'ctrlDownArrow':\n this.expandAll();\n break;\n case 'ctrlUpArrow':\n this.collapseAll();\n break;\n case 'ctrlShiftUpArrow':\n target = e.target;\n column = target.closest('.e-rowcell');\n row = column.closest('tr');\n if (row !== null && row !== undefined) {\n this.expandCollapseRequest(row.querySelector('.e-treegridexpand'));\n }\n break;\n case 'ctrlShiftDownArrow':\n target = e.target;\n column = target.closest('.e-rowcell');\n row = column.closest('tr');\n if (row !== null && row !== undefined) {\n this.expandCollapseRequest(row.querySelector('.e-treegridcollapse'));\n }\n break;\n case 'downArrow':\n if (!this.enableVirtualization) {\n parentTarget = e.target.parentElement;\n summaryElement = this.findnextRowElement(parentTarget);\n if (summaryElement !== null) {\n var rowIndex = summaryElement.rowIndex;\n this.selectRow(rowIndex);\n var cellIndex = e.target.cellIndex;\n var row_1 = summaryElement.children[cellIndex];\n addClass([row_1], 'e-focused');\n addClass([row_1], 'e-focus');\n }\n else {\n this.clearSelection();\n }\n }\n break;\n case 'upArrow':\n if (!this.enableVirtualization) {\n parentTarget = e.target.parentElement;\n summaryElement = this.findPreviousRowElement(parentTarget);\n if (summaryElement !== null) {\n var rIndex = summaryElement.rowIndex;\n this.selectRow(rIndex);\n var cIndex = e.target.cellIndex;\n var rows = summaryElement.children[cIndex];\n addClass([rows], 'e-focused');\n addClass([rows], 'e-focus');\n }\n else {\n this.clearSelection();\n }\n }\n }\n }\n };\n // Get Proper Row Element from the summary\n TreeGrid.prototype.findnextRowElement = function (summaryRowElement) {\n var rowElement = summaryRowElement.nextElementSibling;\n if (rowElement !== null && (rowElement.className.indexOf('e-summaryrow') !== -1 ||\n rowElement.style.display === 'none')) {\n rowElement = this.findnextRowElement(rowElement);\n }\n return rowElement;\n };\n // Get Proper Row Element from the summary\n TreeGrid.prototype.findPreviousRowElement = function (summaryRowElement) {\n var rowElement = summaryRowElement.previousElementSibling;\n if (rowElement !== null && (rowElement.className.indexOf('e-summaryrow') !== -1 ||\n rowElement.style.display === 'none')) {\n rowElement = this.findPreviousRowElement(rowElement);\n }\n return rowElement;\n };\n TreeGrid.prototype.initProperties = function () {\n this.defaultLocale = {};\n this.flatData = [];\n this.parentData = [];\n this.columnModel = [];\n this.isExpandAll = false;\n this.isCollapseAll = false;\n this.keyConfigs = {\n ctrlDownArrow: 'ctrl+downarrow',\n ctrlUpArrow: 'ctrl+uparrow',\n ctrlShiftUpArrow: 'ctrl+shift+uparrow',\n ctrlShiftDownArrow: 'ctrl+shift+downarrow',\n downArrow: 'downArrow',\n upArrow: 'upArrow'\n };\n this.isLocalData = (!(this.dataSource instanceof DataManager) || this.dataSource.dataSource.offline\n || (!isNullOrUndefined(this.dataSource.ready)) || this.dataSource.adaptor instanceof RemoteSaveAdaptor);\n this.isSelfReference = !isNullOrUndefined(this.parentIdMapping);\n };\n /**\n * Binding events to the element while component creation.\n *\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.wireEvents = function () {\n EventHandler.add(this.grid.element, 'click', this.mouseClickHandler, this);\n EventHandler.add(this.element, 'touchend', this.mouseClickHandler, this);\n this.keyboardModule = new KeyboardEvents(this.element, {\n keyAction: this.treeGridkeyActionHandler.bind(this),\n keyConfigs: this.keyConfigs,\n eventName: 'keydown'\n });\n if (this.allowKeyboard) {\n this.element.tabIndex = this.element.tabIndex === -1 ? 0 : this.element.tabIndex;\n }\n };\n /**\n * To provide the array of modules needed for component rendering\n *\n * @returns {ModuleDeclaration[]} - Returns TreeGrid modules collection\n * @hidden\n */\n TreeGrid.prototype.requiredModules = function () {\n var modules = [];\n var splitFrozenCount = 'splitFrozenCount';\n this.grid[splitFrozenCount](this.getGridColumns(this.columns));\n if (this.isDestroyed) {\n return modules;\n }\n modules.push({\n member: 'filter', args: [this, this.filterSettings]\n });\n if (!isNullOrUndefined(this.toolbar)) {\n modules.push({\n member: 'toolbar',\n args: [this]\n });\n }\n if (this.contextMenuItems) {\n modules.push({\n member: 'contextMenu',\n args: [this]\n });\n }\n if (this.allowPaging) {\n modules.push({\n member: 'pager',\n args: [this, this.pageSettings]\n });\n }\n if (this.allowReordering) {\n modules.push({\n member: 'reorder',\n args: [this]\n });\n }\n if (this.allowSorting) {\n modules.push({\n member: 'sort',\n args: [this]\n });\n }\n if (this.aggregates.length > 0) {\n modules.push({\n member: 'summary', args: [this]\n });\n }\n modules.push({\n member: 'resize', args: [this]\n });\n if (this.allowExcelExport) {\n modules.push({\n member: 'ExcelExport', args: [this]\n });\n }\n if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||\n this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {\n modules.push({\n member: 'freeze', args: [this]\n });\n }\n if (this.detailTemplate) {\n modules.push({\n member: 'detailRow', args: [this]\n });\n }\n if (this.allowPdfExport) {\n modules.push({\n member: 'PdfExport', args: [this]\n });\n }\n if (this.showColumnMenu) {\n modules.push({\n member: 'columnMenu', args: [this]\n });\n }\n if (this.showColumnChooser) {\n modules.push({\n member: 'ColumnChooser', args: [this]\n });\n }\n this.extendRequiredModules(modules);\n return modules;\n };\n TreeGrid.prototype.extendRequiredModules = function (modules) {\n if (this.allowRowDragAndDrop) {\n modules.push({\n member: 'rowDragAndDrop',\n args: [this]\n });\n }\n if (!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') || this.toolbar['includes']('Outdent'))) {\n TreeGrid_1.Inject(RowDD);\n modules.push({\n member: 'rowDragAndDrop',\n args: [this]\n });\n }\n if (this.editSettings.allowAdding || this.editSettings.allowDeleting || this.editSettings.allowEditing) {\n modules.push({\n member: 'edit',\n args: [this]\n });\n }\n if (this.isCommandColumn(this.columns)) {\n modules.push({\n member: 'commandColumn',\n args: [this]\n });\n }\n if (this.allowSelection) {\n modules.push({\n member: 'selection',\n args: [this]\n });\n }\n if (this.enableVirtualization) {\n modules.push({\n member: 'virtualScroll',\n args: [this]\n });\n }\n if (this.enableInfiniteScrolling) {\n modules.push({\n member: 'infiniteScroll',\n args: [this]\n });\n }\n modules.push({\n member: 'logger',\n args: [this.grid]\n });\n };\n TreeGrid.prototype.isCommandColumn = function (columns) {\n var _this = this;\n return columns.some(function (col) {\n if (col.columns) {\n return _this.isCommandColumn(col.columns);\n }\n return !!(col.commands || col.commandsTemplate);\n });\n };\n /**\n * Unbinding events from the element while component destroy.\n *\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.unwireEvents = function () {\n if (this.grid && this.grid.element) {\n EventHandler.remove(this.grid.element, 'click', this.mouseClickHandler);\n }\n };\n /**\n * Logs tree grid error message on console\n *\n * @param {string | string[]} types - Tree Grid error type\n * @param {object} args - Error details\n * @hidden\n * @private\n * @returns {void}\n */\n TreeGrid.prototype.log = function (types, args) {\n if (this.loggerModule) {\n this.loggerModule.treeLog(types, args, this);\n }\n };\n /**\n * For internal use only - To Initialize the component rendering.\n *\n * @private\n * @returns {void}\n */\n TreeGrid.prototype.render = function () {\n var _this = this;\n if (this.isReact) {\n this.grid.isReact = true;\n this.grid.portals = [];\n }\n if (this.isVue) {\n this.grid.isVue = true;\n }\n createSpinner({ target: this.element }, this.createElement);\n this.log(['mapping_fields_missing']);\n this.renderModule = new Render(this);\n this.dataModule = new DataManipulation(this);\n this.printModule = new Print(this);\n this.trigger(events.load);\n this.autoGenerateColumns();\n this.initialRender = true;\n if (!isNullOrUndefined(this.dataSource)) {\n this.convertTreeData(this.dataSource);\n }\n this.loadGrid();\n if (this.element.classList.contains('e-treegrid') && this.rowDropSettings.targetID) {\n this.grid.rowDropSettings.targetID += '_gridcontrol';\n }\n this.addListener();\n var gridContainer = createElement('div', { id: this.element.id + '_gridcontrol' });\n addClass([this.element], 'e-treegrid');\n if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {\n this.element.style.height = this.height;\n }\n if (!isNullOrUndefined(this.width) && typeof (this.width) === 'string' && this.width.indexOf('%') !== -1) {\n this.element.style.width = this.width;\n }\n this.element.appendChild(gridContainer);\n var gridRequiredModules = this.grid.requiredModules;\n this.grid.requiredModules = function () {\n var modules = [];\n modules = gridRequiredModules.apply(this);\n for (var i = 0; i < modules.length; i++) {\n if (modules[i].member === 'virtualscroll') {\n modules[i].member = 'treeVirtualScroll';\n }\n }\n return modules;\n };\n var root = 'root';\n this.grid[root] = this[root] ? this[root] : this;\n this.grid.appendTo(gridContainer);\n this.wireEvents();\n this.renderComplete();\n var destroyTemplate = 'destroyTemplate';\n var destroyTemplateFn = this.grid[destroyTemplate];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.grid[destroyTemplate] = function (args, index) {\n destroyTemplateFn.apply(_this.grid);\n var portals = 'portals';\n if (!(_this.isReact && isNullOrUndefined(_this[portals]))) {\n _this.clearTemplate(args, index);\n }\n };\n };\n TreeGrid.prototype.afterGridRender = function () {\n if (!isNullOrUndefined(this.grid.clipboardModule)) {\n this.grid.clipboardModule.destroy();\n }\n this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this);\n };\n TreeGrid.prototype.convertTreeData = function (data) {\n var _this = this;\n if (isCountRequired(this)) {\n data = getValue('result', data);\n }\n if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {\n this.flatData = data;\n this.flatData.filter(function (e) {\n setValue('uniqueIDCollection.' + e.uniqueID, e, _this);\n if (e.level === 0) {\n _this.parentData.push(e);\n }\n });\n }\n else {\n if (isCountRequired(this)) {\n var griddata = getValue('result', this.dataSource);\n this.dataModule.convertToFlatData(griddata);\n }\n else {\n this.dataModule.convertToFlatData(data);\n }\n }\n };\n // private getGridData(): Object {\n // if (isRemoteData(this)) {\n // return this.dataSource;\n // } else if (this.isLocalData && this.dataSource instanceof DataManager) {\n // this.dataSource.dataSource.json = this.flatData;\n // return this.dataSource;\n // }\n // return this.flatData;\n // }\n TreeGrid.prototype.bindGridProperties = function () {\n this.bindedDataSource();\n this.grid.enableRtl = this.enableRtl;\n this.grid.allowKeyboard = this.allowKeyboard;\n this.grid.columns = this.getGridColumns(this.columns);\n this.grid.allowExcelExport = this.allowExcelExport;\n this.grid.allowPdfExport = this.allowPdfExport;\n this.grid.query = this.query;\n this.grid.columnQueryMode = this.columnQueryMode;\n this.grid.allowPaging = this.allowPaging;\n this.grid.pageSettings = getActualProperties(this.pageSettings);\n this.grid.pagerTemplate = this.pagerTemplate;\n this.grid.showColumnMenu = this.showColumnMenu;\n this.grid.allowSorting = this.allowSorting;\n this.grid.allowFiltering = this.allowFiltering;\n this.grid.enableVirtualization = this.enableVirtualization;\n this.grid.enableColumnVirtualization = this.enableColumnVirtualization;\n this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;\n this.grid.infiniteScrollSettings = this.infiniteScrollSettings;\n this.grid.width = this.width;\n this.grid.height = this.height;\n this.grid.enableAltRow = this.enableAltRow;\n this.grid.allowReordering = this.allowReordering;\n this.grid.allowTextWrap = this.allowTextWrap;\n this.grid.allowResizing = this.allowResizing;\n this.grid.enableHover = this.enableHover;\n this.grid.enableAutoFill = this.enableAutoFill;\n this.grid.enableAdaptiveUI = this.enableAdaptiveUI;\n this.grid.enableImmutableMode = this.enableImmutableMode;\n this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;\n this.grid.rowDropSettings = getActualProperties(this.rowDropSettings);\n this.grid.rowHeight = this.rowHeight;\n this.grid.gridLines = this.gridLines;\n this.grid.allowSelection = this.allowSelection;\n this.grid.toolbar = getActualProperties(this.getGridToolbar());\n this.grid.toolbarTemplate = this.toolbarTemplate;\n this.grid.showColumnChooser = this.showColumnChooser;\n this.grid.filterSettings = getActualProperties(this.filterSettings);\n this.grid.selectionSettings = getActualProperties(this.selectionSettings);\n this.grid.sortSettings = getActualProperties(this.sortSettings);\n this.grid.searchSettings = getActualProperties(this.searchSettings);\n this.grid.aggregates = getActualProperties(this.aggregates);\n this.grid.textWrapSettings = getActualProperties(this.textWrapSettings);\n this.grid.printMode = getActualProperties(this.printMode);\n this.grid.locale = getActualProperties(this.locale);\n this.grid.selectedRowIndex = this.selectedRowIndex;\n this.grid.contextMenuItems = getActualProperties(this.getContextMenu());\n this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);\n this.grid.editSettings = this.getGridEditSettings();\n this.grid.rowTemplate = getActualProperties(this.rowTemplate);\n this.grid.detailTemplate = getActualProperties(this.detailTemplate);\n this.grid.frozenRows = this.frozenRows;\n this.grid.frozenColumns = this.frozenColumns;\n this.grid.clipMode = getActualProperties(this.clipMode);\n var templateInstance = 'templateDotnetInstance';\n this.grid[templateInstance] = this[templateInstance];\n var isJsComponent = 'isJsComponent';\n this.grid[isJsComponent] = true;\n };\n TreeGrid.prototype.triggerEvents = function (args) {\n this.trigger(getObject('name', args), args);\n };\n TreeGrid.prototype.bindGridEvents = function () {\n var _this = this;\n this.grid.rowSelecting = function (args) {\n if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')\n || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {\n args.cancel = true;\n return;\n }\n _this.trigger(events.rowSelecting, args);\n };\n this.grid.rowSelected = function (args) {\n if (_this.enableVirtualization && args.isHeaderCheckboxClicked &&\n _this.grid.currentViewData.length !== _this.grid.selectionModule.selectedRowIndexes.length) {\n var updateRowSelection = 'updateRowSelection';\n for (var i = 0; i < _this.getRows().length; i++) {\n if (_this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {\n _this.grid.selectionModule[updateRowSelection](_this.getRows()[i], _this.getCurrentViewRecords()[i].index);\n }\n }\n }\n _this.selectedRowIndex = _this.grid.selectedRowIndex;\n _this.notify(events.rowSelected, args);\n _this.trigger(events.rowSelected, args);\n };\n this.grid.rowDeselected = function (args) {\n _this.selectedRowIndex = _this.grid.selectedRowIndex;\n if (!isNullOrUndefined(args.data)) {\n _this.notify(events.rowDeselected, args);\n }\n _this.trigger(events.rowDeselected, args);\n };\n this.grid.resizeStop = function (args) {\n _this.updateColumnModel();\n _this.trigger(events.resizeStop, args);\n };\n this.grid.excelQueryCellInfo = function (args) {\n _this.notify('excelCellInfo', args);\n args = _this.dataResults;\n };\n this.grid.pdfQueryCellInfo = function (args) {\n _this.notify('pdfCellInfo', args);\n args = _this.dataResults;\n };\n this.grid.checkBoxChange = function (args) {\n _this.trigger(events.checkboxChange, args);\n };\n this.grid.pdfExportComplete = this.triggerEvents.bind(this);\n this.grid.excelExportComplete = this.triggerEvents.bind(this);\n this.grid.excelHeaderQueryCellInfo = this.triggerEvents.bind(this);\n this.grid.pdfHeaderQueryCellInfo = this.triggerEvents.bind(this);\n this.grid.dataSourceChanged = this.triggerEvents.bind(this);\n this.grid.recordDoubleClick = this.triggerEvents.bind(this);\n this.grid.rowDeselecting = this.triggerEvents.bind(this);\n this.grid.cellDeselected = this.triggerEvents.bind(this);\n this.grid.cellDeselecting = this.triggerEvents.bind(this);\n this.grid.columnMenuOpen = this.triggerEvents.bind(this);\n this.grid.columnMenuClick = this.triggerEvents.bind(this);\n this.grid.cellSelected = this.triggerEvents.bind(this);\n this.grid.headerCellInfo = this.triggerEvents.bind(this);\n this.grid.resizeStart = this.triggerEvents.bind(this);\n this.grid.resizing = this.triggerEvents.bind(this);\n this.grid.columnDrag = this.triggerEvents.bind(this);\n this.grid.columnDragStart = this.triggerEvents.bind(this);\n this.grid.columnDrop = this.triggerEvents.bind(this);\n this.grid.beforePrint = this.triggerEvents.bind(this);\n this.grid.beforeCopy = this.triggerEvents.bind(this);\n this.grid.beforePaste = function (args) {\n var rows = _this.getRows();\n var rowIndex = 'rowIndex';\n while (rows[args[rowIndex]].classList.contains('e-summaryrow')) {\n args[rowIndex]++;\n }\n _this.trigger(events.beforePaste, args);\n };\n this.grid.load = function () {\n _this.grid.on('initial-end', _this.afterGridRender, _this);\n if (!isNullOrUndefined(_this.loggerModule)) {\n var loggerModule = 'loggerModule';\n _this.loggerModule = _this.grid[loggerModule] = new TreeLogger(_this.grid);\n }\n };\n this.grid.printComplete = this.triggerEvents.bind(this);\n this.grid.actionFailure = this.triggerEvents.bind(this);\n this.extendedGridDataBoundEvent();\n this.extendedGridEvents();\n this.extendedGridActionEvents();\n this.extendedGridEditEvents();\n this.bindGridDragEvents();\n this.bindCallBackEvents();\n };\n TreeGrid.prototype.lastRowBorder = function (visiblerow, isAddBorder) {\n for (var j = 0; j < visiblerow.cells.length; j++) {\n if (isAddBorder) {\n addClass([visiblerow.cells[j]], 'e-lastrowcell');\n }\n else {\n removeClass([visiblerow.cells[j]], 'e-lastrowcell');\n }\n }\n };\n TreeGrid.prototype.isPixelHeight = function () {\n if (this.height !== 'auto' && this.height.toString().indexOf('%') === -1) {\n return true;\n }\n else {\n return false;\n }\n };\n TreeGrid.prototype.extendedGridDataBoundEvent = function () {\n var _this = this;\n this.grid.dataBound = function (args) {\n _this.updateRowTemplate();\n _this.updateColumnModel();\n _this.updateAltRow(_this.getRows());\n _this.notify('dataBoundArg', args);\n if (isRemoteData(_this) && !isOffline(_this) && !_this.hasChildMapping) {\n var req = getObject('dataSource.requests', _this).filter(function (e) {\n return e.httpRequest.statusText !== 'OK';\n }).length;\n setValue('grid.contentModule.isLoaded', !(req > 0), _this);\n }\n if (_this.isPixelHeight() && _this.initialRender) {\n var rows = _this.getContentTable().rows;\n var totalRows = [].slice.call(rows);\n for (var i = totalRows.length - 1; i > 0; i--) {\n if (!isHidden(totalRows[i])) {\n if (totalRows[i].nextElementSibling) {\n _this.lastRowBorder(totalRows[i], true);\n }\n break;\n }\n }\n }\n var action = 'action';\n if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults[action] === 'expand' || _this.dataResults[action] === 'collapse')) {\n var refreshPersistSelection = 'refreshPersistSelection';\n _this.grid.selectionModule[refreshPersistSelection]();\n if (_this.grid.selectionSettings.type === 'Single') {\n var updateRowSelection = 'updateRowSelection';\n var index = _this.getCurrentViewRecords().indexOf(_this.grid.selectionModule['data']);\n _this.grid.selectionModule[updateRowSelection](_this.getRows()[index], index);\n }\n }\n _this.trigger(events.dataBound, args);\n _this.initialRender = false;\n };\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var treeGrid = this;\n this.grid.beforeDataBound = function (args) {\n var dataSource = 'dataSource';\n var requestType = getObject('action', args);\n if (((isRemoteData(treeGrid) && !isOffline(treeGrid)) || isCountRequired(this)) && requestType !== 'edit') {\n treeGrid.notify('updateRemoteLevel', args);\n args = (treeGrid.dataResults);\n }\n else if (treeGrid.flatData.length === 0 && isOffline(treeGrid) && treeGrid.dataSource instanceof DataManager) {\n var dm = treeGrid.dataSource;\n treeGrid.dataModule.convertToFlatData(dm.dataSource.json);\n args.result = treeGrid.grid.dataSource[dataSource].json = treeGrid.flatData;\n }\n if (!isRemoteData(treeGrid) && !isCountRequired(this) && !isNullOrUndefined(treeGrid.dataSource)) {\n if (this.isPrinting) {\n setValue('isPrinting', true, args);\n }\n treeGrid.notify('dataProcessor', args);\n //args = treeGrid.dataModule.dataProcessor(args);\n }\n extend(args, treeGrid.dataResults);\n if (treeGrid.enableImmutableMode) {\n args.result = args.result.slice();\n }\n if (treeGrid.initialRender) {\n this.contentModule.objectEqualityChecker = treeGrid.objectEqualityChecker;\n }\n // treeGrid.notify(events.beforeDataBound, args);\n if (!this.isPrinting) {\n var callBackPromise_1 = new Deferred();\n treeGrid.trigger(events.beforeDataBound, args, function (beforeDataBoundArgs) {\n callBackPromise_1.resolve(beforeDataBoundArgs);\n });\n return callBackPromise_1;\n }\n };\n this.grid.log = function (type, args) {\n if (_this.loggerModule) {\n _this.loggerModule.log(type, args);\n }\n };\n };\n TreeGrid.prototype.bindCallBackEvents = function () {\n var _this = this;\n this.grid.toolbarClick = function (args) {\n if ((args.item.id === _this.grid.element.id + '_excelexport' && _this.allowExcelExport === false) ||\n (args.item.id === _this.grid.element.id + '_pdfexport' && _this.allowPdfExport === false) ||\n (args.item.id === _this.grid.element.id + '_csvexport' && _this.allowExcelExport === false)) {\n return;\n }\n var callBackPromise = new Deferred();\n _this.trigger(events.toolbarClick, args, function (toolbarargs) {\n if (!toolbarargs.cancel) {\n _this.notify(events.toolbarClick, args);\n }\n callBackPromise.resolve(toolbarargs);\n });\n return callBackPromise;\n };\n this.grid.cellSelecting = function (args) {\n var callBackPromise = new Deferred();\n _this.trigger(getObject('name', args), args, function (cellselectingArgs) {\n callBackPromise.resolve(cellselectingArgs);\n });\n return callBackPromise;\n };\n this.grid.beginEdit = function (args) {\n if (!isNullOrUndefined(args.row) && args.row.classList.contains('e-summaryrow')) {\n args.cancel = true;\n return;\n }\n var callBackPromise = new Deferred();\n _this.trigger(events.beginEdit, args, function (begineditArgs) {\n callBackPromise.resolve(begineditArgs);\n });\n return callBackPromise;\n };\n };\n TreeGrid.prototype.extendedGridEditEvents = function () {\n var _this = this;\n this.grid.dataStateChange = function (args) {\n if (_this.isExpandRefresh) {\n _this.isExpandRefresh = false;\n _this.grid.dataSource = { result: _this.flatData, count: getValue('count', _this.grid.dataSource) };\n }\n else {\n _this.trigger(events.dataStateChange, args);\n }\n };\n this.grid.cellSave = function (args) {\n if (_this.grid.isContextMenuOpen()) {\n var contextitems = _this.grid.contextMenuModule.contextMenu.element.getElementsByClassName('e-selected')[0];\n if ((isNullOrUndefined(contextitems) || contextitems.id !== _this.element.id + '_gridcontrol_cmenu_Save')) {\n args.cancel = true;\n }\n }\n var callBackPromise = new Deferred();\n _this.trigger(events.cellSave, args, function (cellsaveArgs) {\n if (!cellsaveArgs.cancel) {\n _this.notify(events.cellSave, cellsaveArgs);\n }\n callBackPromise.resolve(cellsaveArgs);\n });\n return callBackPromise;\n };\n this.grid.cellSaved = function (args) {\n _this.trigger(events.cellSaved, args);\n _this.notify(events.cellSaved, args);\n };\n this.grid.cellEdit = function (args) {\n var prom = 'promise';\n var promise = new Deferred();\n args[prom] = promise;\n _this.notify(events.cellEdit, args);\n return promise;\n };\n this.grid.batchAdd = function (args) {\n _this.trigger(events.batchAdd, args);\n _this.notify(events.batchAdd, args);\n };\n this.grid.beforeBatchSave = function (args) {\n _this.trigger(events.beforeBatchSave, args);\n _this.notify(events.beforeBatchSave, args);\n };\n this.grid.beforeBatchAdd = function (args) {\n _this.trigger(events.beforeBatchAdd, args);\n _this.notify(events.beforeBatchAdd, args);\n };\n this.grid.batchDelete = function (args) {\n _this.trigger(events.batchDelete, args);\n _this.notify(events.batchDelete, args);\n };\n this.grid.beforeBatchDelete = function (args) {\n _this.trigger(events.beforeBatchDelete, args);\n _this.notify(events.beforeBatchDelete, args);\n };\n this.grid.batchCancel = function (args) {\n if (_this.editSettings.mode !== 'Cell') {\n _this.trigger(events.batchCancel, args);\n }\n _this.notify(events.batchCancel, args);\n };\n };\n TreeGrid.prototype.updateRowTemplate = function () {\n this.treeColumnRowTemplate();\n };\n TreeGrid.prototype.bindedDataSource = function () {\n var dataSource = 'dataSource';\n var isDataAvailable = 'isDataAvailable';\n var adaptor = 'adaptor';\n var ready = 'ready';\n if (this.dataSource && isCountRequired(this)) {\n var data = this.flatData;\n var datacount = getValue('count', this.dataSource);\n this.grid.dataSource = { result: data, count: datacount };\n }\n else {\n this.grid.dataSource = !(this.dataSource instanceof DataManager) ?\n this.flatData : new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor);\n }\n if (this.dataSource instanceof DataManager && (this.dataSource.dataSource.offline || this.dataSource.ready)) {\n this.grid.dataSource[dataSource].json = extendArray(this.dataSource[dataSource].json);\n this.grid.dataSource[ready] = this.dataSource.ready;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var proxy_1 = this;\n if (!isNullOrUndefined(this.grid.dataSource[ready])) {\n this.grid.dataSource[ready].then(function (e) {\n var dm = proxy_1.grid.dataSource;\n dm[dataSource].offline = true;\n dm[isDataAvailable] = true;\n dm[dataSource].json = e.result;\n dm[adaptor] = new JsonAdaptor();\n });\n }\n }\n };\n TreeGrid.prototype.extendedGridActionEvents = function () {\n var _this = this;\n this.grid.actionBegin = function (args) {\n if (args.requestType === 'sorting' && args.target && args.target.parentElement &&\n args.target.parentElement.classList.contains('e-hierarchycheckbox')) {\n args.cancel = true;\n }\n var requestType = getObject('requestType', args);\n if (requestType === 'reorder') {\n _this.notify('getColumnIndex', {});\n }\n _this.notify('actionBegin', { editAction: args });\n if (!isRemoteData(_this) && !isNullOrUndefined(_this.filterModule) && !isCountRequired(_this)\n && (_this.grid.filterSettings.columns.length === 0 || _this.grid.searchSettings.key.length === 0)) {\n _this.notify('clearFilters', { flatData: _this.grid.dataSource });\n _this.grid.setProperties({ dataSource: _this.dataResults.result }, true);\n if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {\n _this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ?\n _this.grid.dataSource :\n (isNullOrUndefined(_this.grid.dataSource) ? new DataManager() : new DataManager(_this.grid.dataSource));\n _this.grid.renderModule.data.isQueryInvokedFromData = true;\n _this.grid.query = _this.grid.query instanceof Query ? _this.grid.query : new Query();\n }\n }\n if (_this.action !== 'indenting' && _this.action !== 'outdenting') {\n var callBackPromise_2 = new Deferred();\n _this.trigger(events.actionBegin, args, function (actionArgs) {\n if (!actionArgs.cancel) {\n _this.notify(events.beginEdit, actionArgs);\n }\n callBackPromise_2.resolve(actionArgs);\n });\n return callBackPromise_2;\n }\n };\n this.grid.actionComplete = function (args) {\n _this.notify('actioncomplete', args);\n _this.updateColumnModel();\n _this.updateTreeGridModel();\n if (args.requestType === 'reorder') {\n _this.notify('setColumnIndex', {});\n }\n _this.notify('actionComplete', { editAction: args });\n if (args.requestType === 'add' && (_this.editSettings.newRowPosition !== 'Top' && _this.editSettings.newRowPosition !== 'Bottom')) {\n _this.notify(events.beginAdd, args);\n }\n if (args.requestType === 'batchsave') {\n _this.notify(events.batchSave, args);\n }\n _this.notify('updateGridActions', args);\n if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {\n _this.grid.refresh();\n }\n if (_this.action === 'indenting' || _this.action === 'outdenting') {\n _this.action = _this.action === 'indenting' ? 'indented' : 'outdented';\n var actionArgs = {\n requestType: _this.action,\n data: _this.selectedRecords,\n row: _this.selectedRows\n };\n _this.trigger(events.actionComplete, actionArgs);\n _this.action = '';\n _this.selectedRecords = _this.selectedRows = [];\n }\n else {\n _this.trigger(events.actionComplete, args);\n }\n };\n };\n TreeGrid.prototype.extendedGridEvents = function () {\n var _this = this;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var treeGrid = this;\n this.grid.recordDoubleClick = function (args) {\n _this.trigger(events.recordDoubleClick, args);\n _this.notify(events.recordDoubleClick, args);\n };\n this.grid.detailDataBound = function (args) {\n _this.notify('detaildataBound', args);\n _this.trigger(events.detailDataBound, args);\n };\n this.grid.rowDataBound = function (args) {\n if (isNullOrUndefined(this.isPrinting)) {\n setValue('isPrinting', false, args);\n }\n else {\n setValue('isPrinting', this.isPrinting, args);\n }\n treeGrid.renderModule.RowModifier(args);\n };\n this.grid.queryCellInfo = function (args) {\n if (isNullOrUndefined(this.isPrinting)) {\n setValue('isPrinting', false, args);\n }\n else {\n setValue('isPrinting', this.isPrinting, args);\n }\n treeGrid.renderModule.cellRender(args);\n };\n this.grid.contextMenuClick = function (args) {\n _this.notify(events.contextMenuClick, args);\n _this.trigger(events.contextMenuClick, args);\n };\n this.grid.contextMenuOpen = function (args) {\n _this.notify(events.contextMenuOpen, args);\n _this.trigger(events.contextMenuOpen, args);\n };\n this.grid.queryCellInfo = function (args) {\n _this.renderModule.cellRender(args);\n };\n };\n TreeGrid.prototype.bindGridDragEvents = function () {\n var _this = this;\n this.grid.rowDragStartHelper = function (args) {\n _this.trigger(events.rowDragStartHelper, args);\n };\n this.grid.rowDragStart = function (args) {\n _this.trigger(events.rowDragStart, args);\n };\n this.grid.rowDrag = function (args) {\n if (_this.grid.isEdit) {\n args.cancel = true;\n return;\n }\n _this.notify(events.rowdraging, args);\n _this.trigger(events.rowDrag, args);\n };\n this.grid.rowDrop = function (args) {\n if (_this.grid.isEdit) {\n args.cancel = true;\n return;\n }\n _this.notify(events.rowDropped, args);\n args.cancel = true;\n };\n };\n /**\n * Renders TreeGrid component\n *\n * @private\n * @returns {void}\n */\n TreeGrid.prototype.loadGrid = function () {\n this.bindGridProperties();\n this.bindGridEvents();\n setValue('registeredTemplate', this.registeredTemplate, this.grid);\n var ref = 'viewContainerRef';\n setValue('viewContainerRef', this[ref], this.grid);\n };\n /**\n * AutoGenerate TreeGrid columns from first record\n *\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.autoGenerateColumns = function () {\n if (!this.columns.length && (!this.dataModule.isRemote() && Object.keys(this.dataSource).length)) {\n this.columns = [];\n // if (this.dataSource instanceof DataManager) {\n // record = (<DataManager>this.dataSource).dataSource.json[0];\n // } else {\n var record = this.dataSource[0];\n // }\n var keys = Object.keys(record);\n for (var i = 0; i < keys.length; i++) {\n if ([this.childMapping, this.parentIdMapping].indexOf(keys[i]) === -1) {\n this.columns.push(keys[i]);\n }\n }\n }\n };\n TreeGrid.prototype.getGridEditSettings = function () {\n var edit = {};\n var guid = 'guid';\n edit.allowAdding = this.editSettings.allowAdding;\n edit.allowEditing = this.editSettings.allowEditing;\n edit.allowDeleting = this.editSettings.allowDeleting;\n edit.newRowPosition = this.editSettings.newRowPosition === 'Bottom' ? 'Bottom' : 'Top';\n edit.allowEditOnDblClick = this.editSettings.allowEditOnDblClick;\n edit.showConfirmDialog = this.editSettings.showConfirmDialog;\n edit.template = this.editSettings.template;\n edit.showDeleteConfirmDialog = this.editSettings.showDeleteConfirmDialog;\n edit.allowNextRowEdit = this.editSettings.allowNextRowEdit;\n edit[guid] = this.editSettings[guid];\n edit.dialog = this.editSettings.dialog;\n switch (this.editSettings.mode) {\n case 'Dialog':\n edit.mode = this.editSettings.mode;\n break;\n case 'Batch':\n edit.mode = this.editSettings.mode;\n break;\n case 'Row':\n edit.mode = 'Normal';\n break;\n case 'Cell':\n edit.mode = 'Normal';\n edit.showConfirmDialog = false;\n break;\n }\n return edit;\n };\n /**\n * Defines grid toolbar from treegrid toolbar model\n *\n * @hidden\n * @returns {Object[]} - returns context menu items\n */\n TreeGrid.prototype.getContextMenu = function () {\n if (this.contextMenuItems) {\n var items = [];\n for (var i = 0; i < this.contextMenuItems.length; i++) {\n switch (this.contextMenuItems[i]) {\n case 'AddRow':\n case ContextMenuItems.AddRow:\n items.push({ text: this.l10n.getConstant('AddRow'),\n target: '.e-content', id: this.element.id + '_gridcontrol_cmenu_AddRow',\n items: [{ text: this.l10n.getConstant('Above'), id: 'Above' }, { text: this.l10n.getConstant('Below'), id: 'Below' }, { text: this.l10n.getConstant('Child'), id: 'Child' }] });\n break;\n default:\n items.push(this.contextMenuItems[i]);\n }\n }\n return items;\n }\n else {\n return null;\n }\n };\n /**\n * Defines grid toolbar from treegrid toolbar model\n *\n * @hidden\n * @returns {Object[]} - Returns toolbar items\n */\n TreeGrid.prototype.getGridToolbar = function () {\n if (this.toolbar) {\n var items = [];\n var tooltipText = void 0;\n for (var i = 0; i < this.toolbar.length; i++) {\n switch (this.toolbar[i]) {\n case 'Search':\n case ToolbarItem.Search:\n items.push('Search');\n break;\n case 'Print':\n case ToolbarItem.Print:\n items.push('Print');\n break;\n case 'ExpandAll':\n case ToolbarItem.ExpandAll:\n tooltipText = this.l10n.getConstant('ExpandAll');\n items.push({ text: tooltipText, tooltipText: tooltipText,\n prefixIcon: 'e-expand', id: this.element.id + '_gridcontrol_expandall' });\n break;\n case 'CollapseAll':\n case ToolbarItem.CollapseAll:\n tooltipText = this.l10n.getConstant('CollapseAll');\n items.push({ text: tooltipText,\n tooltipText: tooltipText, prefixIcon: 'e-collapse', id: this.element.id + '_gridcontrol_collapseall'\n });\n break;\n case 'Indent':\n case ToolbarItem.RowIndent:\n tooltipText = this.l10n.getConstant('RowIndent');\n items.push({\n text: tooltipText, tooltipText: tooltipText, disabled: true,\n prefixIcon: 'e-indent', id: this.element.id + '_gridcontrol_indent'\n });\n break;\n case 'Outdent':\n case ToolbarItem.RowOutdent:\n tooltipText = this.l10n.getConstant('RowOutdent');\n items.push({\n text: tooltipText, tooltipText: tooltipText, disabled: true,\n prefixIcon: 'e-outdent', id: this.element.id + '_gridcontrol_outdent'\n });\n break;\n default:\n items.push(this.toolbar[i]);\n }\n }\n return items;\n }\n else {\n return null;\n }\n };\n TreeGrid.prototype.getGridColumns = function (columns, isEmptyColumnModel, index) {\n if (isEmptyColumnModel === void 0) { isEmptyColumnModel = true; }\n if (index === void 0) { index = 0; }\n var column = columns;\n var stackedColumn = 'columns';\n if (isEmptyColumnModel) {\n this.columnModel = [];\n }\n var treeGridColumn;\n var gridColumn;\n index = index === 0 ? -1 : index;\n var gridColumnCollection = [];\n for (var i = 0; i < column.length; i++) {\n index = index + 1;\n var treeColumn = this.grid.getColumnByUid(column[i].uid);\n gridColumn = treeColumn ? treeColumn : {};\n treeGridColumn = {};\n if (typeof this.columns[i] === 'string') {\n gridColumn.field = treeGridColumn.field = this.columns[i];\n }\n else {\n for (var _i = 0, _a = Object.keys(column[i]); _i < _a.length; _i++) {\n var prop = _a[_i];\n if (index === this.treeColumnIndex && prop === 'template') {\n treeGridColumn[prop] = column[i][prop];\n }\n else if (prop === 'columns' && !isNullOrUndefined(column[i][prop])) {\n gridColumn[prop] = this.getGridColumns(column[i][prop], false, index);\n treeGridColumn[prop] = column[i][prop];\n }\n else if (!(treeColumn) || prop !== 'sortComparer') {\n gridColumn[prop] = treeGridColumn[prop] = column[i][prop];\n }\n }\n }\n if (!treeGridColumn[stackedColumn]) {\n this.columnModel.push(new Column(treeGridColumn));\n }\n gridColumnCollection.push(gridColumn);\n if (!isNullOrUndefined(this.columnModel[this.treeColumnIndex]) && this.enableRtl) {\n if (gridColumn.field === this.columnModel[this.treeColumnIndex].field) {\n if (isNullOrUndefined(this.treeColumnTextAlign)) {\n this.treeColumnTextAlign = this.columnModel[this.treeColumnIndex].textAlign;\n this.treeColumnField = this.columnModel[this.treeColumnIndex].field;\n }\n gridColumn.textAlign = 'Right';\n }\n }\n }\n return gridColumnCollection;\n };\n /**\n * Called internally if any of the property value changed.\n *\n * @param {TreeGridModel} newProp - properties details which has to be modified\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.onPropertyChanged = function (newProp) {\n var properties = Object.keys(newProp);\n var requireRefresh = false;\n for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {\n var prop = properties_1[_i];\n switch (prop) {\n case 'columns':\n this.grid.columns = this.getGridColumns(this.columns);\n break;\n case 'treeColumnIndex':\n this.grid.refreshColumns();\n break;\n case 'allowPaging':\n this.grid.allowPaging = this.allowPaging;\n break;\n case 'pageSettings':\n this.grid.pageSettings = getActualProperties(this.pageSettings);\n requireRefresh = true;\n break;\n case 'enableVirtualization':\n this.grid.enableVirtualization = this.enableVirtualization;\n break;\n case 'enableColumnVirtualization':\n this.grid.enableColumnVirtualization = this.enableColumnVirtualization;\n break;\n case 'toolbar':\n this.grid.toolbar = this.getGridToolbar();\n break;\n case 'allowSelection':\n this.grid.allowSelection = this.allowSelection;\n break;\n case 'selectionSettings':\n this.grid.selectionSettings = getActualProperties(this.selectionSettings);\n break;\n case 'allowSorting':\n this.grid.allowSorting = this.allowSorting;\n break;\n case 'allowMultiSorting':\n this.grid.allowMultiSorting = this.allowMultiSorting;\n break;\n case 'sortSettings':\n this.grid.sortSettings = getActualProperties(this.sortSettings);\n break;\n case 'searchSettings':\n this.grid.searchSettings = getActualProperties(this.searchSettings);\n break;\n case 'allowFiltering':\n this.grid.allowFiltering = this.allowFiltering;\n break;\n case 'filterSettings':\n if (!this.initialRender) {\n this.grid.filterSettings = getActualProperties(this.filterSettings);\n }\n break;\n case 'showColumnMenu':\n this.grid.showColumnMenu = this.showColumnMenu;\n break;\n case 'allowRowDragAndDrop':\n this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;\n break;\n case 'aggregates':\n this.grid.aggregates = getActualProperties(this.aggregates);\n break;\n case 'enableInfiniteScrolling':\n this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;\n break;\n case 'dataSource':\n this.isLocalData = (!(this.dataSource instanceof DataManager) || (!isNullOrUndefined(this.dataSource.ready))\n || this.dataSource.adaptor instanceof RemoteSaveAdaptor);\n this.convertTreeData(this.dataSource);\n if (this.isLocalData) {\n if (isCountRequired(this)) {\n var count = getValue('count', this.dataSource);\n this.grid.dataSource = { result: this.flatData, count: count };\n }\n else {\n var data = this.dataSource;\n this.grid.dataSource = !(data instanceof DataManager) ?\n this.flatData : new DataManager(data.dataSource, data.defaultQuery, data.adaptor);\n }\n if (this.enableVirtualization) {\n this.grid.contentModule.isDataSourceChanged = true;\n }\n }\n else {\n this.bindedDataSource();\n if (this.enableVirtualization) {\n this.grid.contentModule.removeEventListener();\n this.grid.contentModule.eventListener('on');\n this.grid.contentModule.renderTable();\n }\n }\n break;\n case 'query':\n this.grid.query = this.query;\n break;\n case 'enableCollapseAll':\n if (newProp[prop]) {\n this.collapseAll();\n }\n else {\n this.expandAll();\n }\n break;\n case 'expandStateMapping':\n this.grid.refresh();\n break;\n case 'gridLines':\n this.grid.gridLines = this.gridLines;\n break;\n case 'rowTemplate':\n this.grid.rowTemplate = getActualProperties(this.rowTemplate);\n break;\n case 'frozenRows':\n this.grid.frozenRows = this.frozenRows;\n break;\n case 'frozenColumns':\n this.grid.frozenColumns = this.frozenColumns;\n break;\n case 'rowHeight':\n this.grid.rowHeight = this.rowHeight;\n break;\n case 'height':\n if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {\n this.element.style.height = this.height;\n }\n this.grid.height = this.height;\n break;\n case 'width':\n if (!isNullOrUndefined(this.width) && typeof (this.width) === 'string' && this.width.indexOf('%') !== -1) {\n this.element.style.width = this.width;\n }\n this.grid.width = this.width;\n break;\n case 'locale':\n this.grid.locale = this.locale;\n break;\n case 'selectedRowIndex':\n this.grid.selectedRowIndex = this.selectedRowIndex;\n break;\n case 'enableAltRow':\n this.grid.enableAltRow = this.enableAltRow;\n break;\n case 'enableHover':\n this.grid.enableHover = this.enableHover;\n break;\n case 'enableAutoFill':\n this.grid.enableAutoFill = this.enableAutoFill;\n break;\n case 'enableAdaptiveUI':\n this.grid.enableAdaptiveUI = this.enableAdaptiveUI;\n break;\n case 'enableImmutableMode':\n this.grid.enableImmutableMode = this.enableImmutableMode;\n break;\n case 'allowExcelExport':\n this.grid.allowExcelExport = this.allowExcelExport;\n break;\n case 'allowPdfExport':\n this.grid.allowPdfExport = this.allowPdfExport;\n break;\n case 'enableRtl':\n if (!isNullOrUndefined(this.treeColumnField)) {\n this.updateTreeColumnTextAlign();\n }\n this.grid.enableRtl = this.enableRtl;\n break;\n case 'allowReordering':\n this.grid.allowReordering = this.allowReordering;\n break;\n case 'allowResizing':\n this.grid.allowResizing = this.allowResizing;\n break;\n case 'textWrapSettings':\n this.grid.textWrapSettings = getActualProperties(this.textWrapSettings);\n break;\n case 'allowTextWrap':\n this.grid.allowTextWrap = getActualProperties(this.allowTextWrap);\n this.grid.refresh();\n break;\n case 'contextMenuItems':\n this.grid.contextMenuItems = this.getContextMenu();\n break;\n case 'showColumnChooser':\n this.grid.showColumnChooser = this.showColumnChooser;\n break;\n case 'detailTemplate':\n this.grid.detailTemplate = getActualProperties(this.detailTemplate);\n break;\n case 'columnMenuItems':\n this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);\n break;\n case 'editSettings':\n if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp[prop].mode &&\n (newProp[prop].mode === 'Cell' || newProp[prop].mode === 'Row')) {\n this.grid.closeEdit();\n }\n this.grid.editSettings = this.getGridEditSettings();\n break;\n }\n if (requireRefresh) {\n this.grid.refresh();\n }\n }\n };\n TreeGrid.prototype.updateTreeColumnTextAlign = function () {\n var gridColumn = this.grid.getColumnByField(this.treeColumnField);\n gridColumn.textAlign = this.enableRtl ? 'Right' : this.treeColumnTextAlign;\n this.grid.refreshColumns();\n };\n /**\n * Destroys the component (detaches/removes all event handlers, attributes, classes, and empties the component element).\n *\n * @method destroy\n * @returns {void}\n */\n TreeGrid.prototype.destroy = function () {\n var treeGridElement = this.element;\n if (!treeGridElement) {\n return;\n }\n var hasTreeGridChild = treeGridElement.querySelector('.' + 'e-gridheader') &&\n treeGridElement.querySelector('.' + 'e-gridcontent') ? true : false;\n if (hasTreeGridChild) {\n this.unwireEvents();\n }\n this.removeListener();\n if (hasTreeGridChild) {\n _super.prototype.destroy.call(this);\n }\n if (this.grid) {\n this.grid.destroy();\n }\n if (this.dataModule) {\n this.dataModule.destroy();\n }\n var modules = ['dataModule', 'sortModule', 'renderModule', 'filterModule', 'printModule', 'clipboardModule',\n 'excelExportModule', 'pdfExportModule', 'toolbarModule', 'summaryModule', 'reorderModule', 'resizeModule',\n 'pagerModule', 'keyboardModule', 'columnMenuModule', 'contextMenuModule', 'editModule', 'virtualScrollModule',\n 'selectionModule', 'detailRow', 'rowDragAndDropModule', 'freezeModule'];\n for (var i = 0; i < modules.length; i++) {\n if (this[modules[i]]) {\n this[modules[i]] = null;\n }\n }\n this.element.innerHTML = '';\n this.grid = null;\n };\n /**\n * Update the TreeGrid model\n *\n * @method dataBind\n * @returns {void}\n * @private\n */\n TreeGrid.prototype.dataBind = function () {\n if (isNullOrUndefined(this.grid)) {\n return;\n }\n if (!isNullOrUndefined(this.rowDropSettings.targetID) &&\n isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))) {\n document.getElementById(this.rowDropSettings.targetID).id = this.grid.rowDropSettings.targetID;\n this.rowDropSettings.targetID = this.grid.rowDropSettings.targetID;\n }\n _super.prototype.dataBind.call(this);\n this.grid.dataBind();\n };\n /**\n * Get the properties to be maintained in the persisted state.\n *\n * @returns {string} - Returns persist properties details\n * @hidden\n */\n TreeGrid.prototype.getPersistData = function () {\n var keyEntity = ['pageSettings', 'sortSettings',\n 'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex', 'treeColumnIndex'];\n var ignoreOnPersist = {\n pageSettings: ['template', 'pageSizes', 'pageSizeMode', 'enableQueryString', 'totalRecordsCount', 'pageCount'],\n filterSettings: ['type', 'mode', 'showFilterBarStatus', 'immediateModeDelay', 'ignoreAccent', 'hierarchyMode'],\n searchSettings: ['fields', 'operator', 'ignoreCase'],\n sortSettings: [], columns: [], selectedRowIndex: []\n };\n var ignoreOnColumn = ['filter', 'edit', 'filterBarTemplate', 'headerTemplate', 'template',\n 'commandTemplate', 'commands', 'dataSource'];\n for (var i = 0; i < keyEntity.length; i++) {\n var currentObject = this[keyEntity[i]];\n for (var k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {\n var objVal = val[k];\n delete currentObject[objVal];\n }\n }\n this.ignoreInArrays(ignoreOnColumn, this.columns);\n return this.addOnPersist(keyEntity);\n };\n TreeGrid.prototype.ignoreInArrays = function (ignoreOnColumn, columns) {\n for (var i = 0; i < columns.length; i++) {\n if (columns[i].columns) {\n this.ignoreInColumn(ignoreOnColumn, columns[i]);\n this.ignoreInArrays(ignoreOnColumn, columns[i].columns);\n }\n else {\n this.ignoreInColumn(ignoreOnColumn, columns[i]);\n }\n }\n };\n TreeGrid.prototype.ignoreInColumn = function (ignoreOnColumn, column) {\n for (var i = 0; i < ignoreOnColumn.length; i++) {\n delete column[ignoreOnColumn[i]];\n column.filter = {};\n }\n };\n TreeGrid.prototype.mouseClickHandler = function (e) {\n if (!isNullOrUndefined(e.touches)) {\n return;\n }\n var target = e.target;\n if ((target.classList.contains('e-treegridexpand') ||\n target.classList.contains('e-treegridcollapse')) && (!this.isEditCollapse && !this.grid.isEdit)) {\n this.expandCollapseRequest(target);\n }\n this.isEditCollapse = false;\n this.notify('checkboxSelection', { target: target });\n };\n /**\n * Returns TreeGrid rows\n *\n * @returns {HTMLTableRowElement[]} - Returns row elements collection\n */\n TreeGrid.prototype.getRows = function () {\n return this.grid.getRows();\n };\n /**\n * Gets the pager of the TreeGrid.\n *\n * @returns {Element} - Returns pager element\n */\n TreeGrid.prototype.getPager = function () {\n return this.grid.getPager(); //get element from pager\n };\n /**\n * Adds a new record to the TreeGrid. Without passing parameters, it adds empty rows.\n * > `editSettings.allowEditing` should be true.\n *\n * @param {Object} data - Defines the new add record data.\n * @param {number} index - Defines the row index to be added.\n * @param {RowPosition} position - Defines the new row position to be added.\n * @returns {void}\n */\n TreeGrid.prototype.addRecord = function (data, index, position) {\n if (this.editModule) {\n var isAddedRowByMethod = 'isAddedRowByMethod';\n this.editModule[isAddedRowByMethod] = true;\n this.editModule.addRecord(data, index, position);\n }\n };\n /**\n * Cancels edited state.\n *\n * @returns {void}\n */\n TreeGrid.prototype.closeEdit = function () {\n if (this.grid.editModule) {\n this.grid.editModule.closeEdit();\n }\n };\n /**\n * Saves the cell that is currently edited. It does not save the value to the DataSource.\n *\n * @returns {void}\n */\n TreeGrid.prototype.saveCell = function () {\n if (this.grid.editModule) {\n this.grid.editModule.saveCell();\n }\n };\n /**\n * To update the specified cell by given value without changing into edited state.\n *\n * @param {number} rowIndex Defines the row index.\n * @param {string} field Defines the column field.\n * @param {string | number | boolean | Date} value - Defines the value to be changed.\n * @returns {void}\n */\n TreeGrid.prototype.updateCell = function (rowIndex, field, value) {\n if (this.grid.editModule) {\n this.grid.editModule.updateCell(rowIndex, field, value);\n }\n };\n /**\n * To update the specified row by given values without changing into edited state.\n *\n * @param {number} index Defines the row index.\n * @param {Object} data Defines the data object to be updated.\n * @returns {void}\n */\n TreeGrid.prototype.updateRow = function (index, data) {\n if (this.grid.editModule) {\n if (!isNullOrUndefined(index)) {\n var griddata = this.grid.getCurrentViewRecords()[index];\n extend(griddata, data);\n this.grid.editModule.updateRow(index, griddata);\n }\n else {\n this.grid.editModule.updateRow(index, data);\n }\n }\n };\n /**\n * Delete a record with Given options. If fieldName and data is not given then TreeGrid will delete the selected record.\n * > `editSettings.allowDeleting` should be true.\n *\n * @param {string} fieldName - Defines the primary key field, 'Name of the column'.\n * @param {Object} data - Defines the JSON data of the record to be deleted.\n * @returns {void}\n */\n TreeGrid.prototype.deleteRecord = function (fieldName, data) {\n if (this.grid.editModule) {\n this.grid.editModule.deleteRecord(fieldName, data);\n }\n };\n /**\n * To edit any particular row by TR element.\n *\n * @param {HTMLTableRowElement} row - Defines the table row to be edited.\n * @returns {void}\n */\n TreeGrid.prototype.startEdit = function (row) {\n if (this.grid.editModule) {\n this.grid.editModule.startEdit(row);\n }\n };\n /**\n * To edit any particular cell using row index and cell index.\n *\n * @param {number} rowIndex - Defines row index to edit a particular cell.\n * @param {string} field - Defines the field name of the column to perform cell edit.\n * @returns {void}\n */\n TreeGrid.prototype.editCell = function (rowIndex, field) {\n if (this.editModule) {\n this.editModule.editCell(rowIndex, field);\n }\n };\n /**\n * Enables or disables ToolBar items.\n *\n * @param {string[]} items - Defines the collection of itemID of ToolBar items.\n * @param {boolean} isEnable - Defines the items to be enabled or disabled.\n * @returns {void}\n */\n TreeGrid.prototype.enableToolbarItems = function (items, isEnable) {\n if (this.grid.toolbarModule) {\n this.grid.toolbarModule.enableItems(items, isEnable);\n }\n };\n /**\n * If TreeGrid is in editable state, you can save a record by invoking endEdit.\n *\n * @returns {void}\n */\n TreeGrid.prototype.endEdit = function () {\n if (this.grid.editModule) {\n this.grid.editModule.endEdit();\n }\n };\n /**\n * Column chooser can be displayed on screen by given position(X and Y axis).\n *\n * @param {number} x - Defines the X axis.\n * @param {number} y - Defines the Y axis.\n * @returns {void}\n */\n TreeGrid.prototype.openColumnChooser = function (x, y) {\n if (this.columnChooserModule) {\n this.columnChooserModule.openColumnChooser(x, y);\n }\n };\n /**\n * Delete any visible row by TR element.\n *\n * @param {HTMLTableRowElement} tr - Defines the table row element.\n * @returns {void}\n */\n TreeGrid.prototype.deleteRow = function (tr) {\n if (this.grid.editModule) {\n this.grid.editModule.deleteRow(tr);\n }\n };\n /**\n * Get the names of the primary key columns of the TreeGrid.\n *\n * @returns {string[]} - Returns primary key collection\n */\n TreeGrid.prototype.getPrimaryKeyFieldNames = function () {\n return this.grid.getPrimaryKeyFieldNames();\n };\n /**\n * Updates particular cell value based on the given primary key value.\n * > Primary key column must be specified using `columns.isPrimaryKey` property.\n *\n * @param {string| number} key - Specifies the PrimaryKey value of dataSource.\n * @param {string } field - Specifies the field name which you want to update.\n * @param {string | number | boolean | Date} value - To update new value for the particular cell.\n * @returns {void}\n */\n TreeGrid.prototype.setCellValue = function (key, field, value) {\n this.grid.setCellValue(key, field, value);\n var rowIndex = this.grid.getRowIndexByPrimaryKey(key);\n var record = this.getCurrentViewRecords()[rowIndex];\n if (!isNullOrUndefined(record)) {\n editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);\n }\n };\n /**\n * Updates and refresh the particular row values based on the given primary key value.\n * > Primary key column must be specified using `columns.isPrimaryKey` property.\n *\n * @param {string| number} key - Specifies the PrimaryKey value of dataSource.\n * @param {Object} rowData - To update new data for the particular row.\n * @returns {void}\n */\n TreeGrid.prototype.setRowData = function (key, rowData) {\n var currentRecords = this.getCurrentViewRecords();\n var primaryKey = this.grid.getPrimaryKeyFieldNames()[0];\n var level = 0;\n var record = {};\n currentRecords.some(function (value) {\n if (value[primaryKey] === key) {\n record = value;\n return true;\n }\n else {\n return false;\n }\n });\n level = record.level;\n rowData.level = level;\n rowData.index = record.index;\n rowData.childRecords = record.childRecords;\n rowData.taskData = record.taskData;\n rowData.uniqueID = record.uniqueID;\n rowData.parentItem = record.parentItem;\n rowData.checkboxState = record.checkboxState;\n rowData.hasChildRecords = record.hasChildRecords;\n rowData.parentUniqueID = record.parentUniqueID;\n rowData.expanded = record.expanded;\n this.grid.setRowData(key, rowData);\n var table = this.getContentTable();\n var sHeight = table.scrollHeight;\n var clientHeight = this.getContent().clientHeight;\n this.lastRowBorder(this.getRows()[record.index], sHeight <= clientHeight);\n };\n /**\n * Navigates to the specified target page.\n *\n * @param {number} pageNo - Defines the page number to navigate.\n * @returns {void}\n */\n TreeGrid.prototype.goToPage = function (pageNo) {\n if (this.grid.pagerModule) {\n this.grid.pagerModule.goToPage(pageNo);\n }\n };\n /**\n * Defines the text of external message.\n *\n * @param {string} message - Defines the message to update.\n * @returns {void}\n */\n TreeGrid.prototype.updateExternalMessage = function (message) {\n if (this.pagerModule) {\n this.grid.pagerModule.updateExternalMessage(message);\n }\n };\n /**\n * Gets a cell by row and column index.\n *\n * @param {number} rowIndex - Specifies the row index.\n * @param {number} columnIndex - Specifies the column index.\n * @returns {Element} - Returns cell element in grid content\n */\n TreeGrid.prototype.getCellFromIndex = function (rowIndex, columnIndex) {\n return this.grid.getCellFromIndex(rowIndex, columnIndex);\n };\n /**\n * Gets a Column by column name.\n *\n * @param {string} field - Specifies the column name.\n * @returns {Column} - Returns tree grid column\n */\n TreeGrid.prototype.getColumnByField = function (field) {\n return iterateArrayOrObject(this.columnModel, function (item) {\n if (item.field === field) {\n return item;\n }\n return undefined;\n })[0];\n };\n /**\n * Gets a column by UID.\n *\n * @param {string} uid - Specifies the column UID.\n * @returns {Column} - Returns tree grid column\n */\n TreeGrid.prototype.getColumnByUid = function (uid) {\n var Columns = this.initialRender ? this.grid.columns : this.columns;\n return iterateArrayOrObject(Columns, function (item) {\n if (item.uid === uid) {\n return item;\n }\n return undefined;\n })[0];\n };\n /**\n * Gets the collection of column fields.\n *\n * @returns {string[]} - Returns column field name as collection\n */\n TreeGrid.prototype.getColumnFieldNames = function () {\n return this.grid.getColumnFieldNames();\n };\n /**\n * Gets the footer div of the TreeGrid.\n *\n * @returns {Element} - Returns footer content div element\n */\n TreeGrid.prototype.getFooterContent = function () {\n return this.grid.getFooterContent();\n };\n /**\n * Gets the footer table element of the TreeGrid.\n *\n * @returns {Element} - Returns footer content table element\n */\n TreeGrid.prototype.getFooterContentTable = function () {\n return this.grid.getFooterContentTable();\n };\n /**\n * Shows a column by its column name.\n *\n * @param {string|string[]} keys - Defines a single or collection of column names.\n * @param {string} showBy - Defines the column key either as field name or header text.\n * @returns {void}\n */\n TreeGrid.prototype.showColumns = function (keys, showBy) {\n this.grid.showColumns(keys, showBy);\n this.updateColumnModel();\n };\n /**\n * Hides a column by column name.\n *\n * @param {string|string[]} keys - Defines a single or collection of column names.\n * @param {string} hideBy - Defines the column key either as field name or header text.\n * @returns {void}\n */\n TreeGrid.prototype.hideColumns = function (keys, hideBy) {\n this.grid.hideColumns(keys, hideBy);\n this.updateColumnModel();\n };\n /**\n * Gets a column header by column name.\n *\n * @param {string} field - Specifies the column name.\n * @returns {Element} - Returns column header element\n */\n TreeGrid.prototype.getColumnHeaderByField = function (field) {\n return this.grid.getColumnHeaderByField(field);\n };\n /**\n * Gets a column header by column index.\n *\n * @param {number} index - Specifies the column index.\n * @returns {Element} - Returns column header element\n */\n TreeGrid.prototype.getColumnHeaderByIndex = function (index) {\n return this.grid.getColumnHeaderByIndex(index);\n };\n /**\n * Gets a column header by UID.\n *\n * @param {string} uid - Specifies the column uid.\n * @returns {Element} - Returns column header element\n */\n TreeGrid.prototype.getColumnHeaderByUid = function (uid) {\n return this.grid.getColumnHeaderByUid(uid);\n };\n /**\n * Gets a column index by column name.\n *\n * @param {string} field - Specifies the column name.\n * @returns {number} - Returns column index\n */\n TreeGrid.prototype.getColumnIndexByField = function (field) {\n return this.grid.getColumnIndexByField(field);\n };\n TreeGrid.prototype.getVirtualColIndexByUid = function (uid) {\n var columnModel = 'columnModel';\n var index = iterateArrayOrObject(this.grid[columnModel], function (item, index) {\n if (item.uid === uid) {\n return index;\n }\n return undefined;\n })[0];\n return !isNullOrUndefined(index) ? index : -1;\n };\n /**\n * Gets a column index by UID.\n *\n * @param {string} uid - Specifies the column UID.\n * @returns {number} - Returns column index\n */\n TreeGrid.prototype.getColumnIndexByUid = function (uid) {\n return this.grid.getColumnIndexByUid(uid);\n };\n /**\n * Gets the columns from the TreeGrid.\n *\n * @param {boolean} isRefresh - Defined whether to update DOM\n * @returns {Column[]} - Returns treegrid columns collection\n */\n TreeGrid.prototype.getColumns = function (isRefresh) {\n this.updateColumnModel(this.grid.getColumns(isRefresh));\n return this.columnModel;\n };\n TreeGrid.prototype.updateColumnModel = function (column) {\n var temp;\n var field;\n var gridColumns = isNullOrUndefined(column) ? this.grid.getColumns() : column;\n if (this.treeColumnIndex !== -1 && this.columnModel[this.treeColumnIndex] &&\n !isNullOrUndefined(this.columnModel[this.treeColumnIndex].template)) {\n temp = this.columnModel[this.treeColumnIndex].template;\n field = this.columnModel[this.treeColumnIndex].field;\n }\n var stackedHeader = false;\n var gridColumn;\n if (!this.enableColumnVirtualization || (this.enableColumnVirtualization && this.columnModel.length === gridColumns.length)) {\n this.columnModel = [];\n for (var i = 0; i < gridColumns.length; i++) {\n gridColumn = {};\n for (var _i = 0, _a = Object.keys(gridColumns[i]); _i < _a.length; _i++) {\n var prop = _a[_i];\n gridColumn[prop] = gridColumns[i][prop];\n }\n this.columnModel.push(new Column(gridColumn));\n if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {\n this.columnModel[i].template = temp;\n }\n }\n }\n var merge = 'deepMerge';\n this[merge] = ['columns']; // Workaround for blazor updateModel\n if (this.grid.columns.length !== this.columnModel.length) {\n stackedHeader = true;\n }\n if (!stackedHeader) {\n this.setProperties({ columns: this.columnModel }, true);\n }\n this[merge] = undefined; // Workaround for blazor updateModel\n return this.columnModel;\n };\n /**\n * @param {string} columnUid - Defines column uid\n * @returns {void}\n * @hidden\n */\n TreeGrid.prototype.refreshReactColumnTemplateByUid = function (columnUid) {\n var _this = this;\n if (this.isReact) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.clearTemplate(['columnTemplate'], undefined, function () {\n var cells = 'cells';\n var rowIdx = 'index';\n var rowsObj = _this.grid.getRowsObject();\n var indent = _this.grid.getIndentCount();\n var cellIndex = _this.grid.getNormalizedColumnIndex(columnUid);\n for (var j = 0; j < rowsObj.length; j++) {\n if (rowsObj[j].isDataRow && !isNullOrUndefined(rowsObj[j].index)) {\n var cell = rowsObj[j][cells][cellIndex];\n var cellRenderer = new CellRenderer(_this.grid, _this.grid.serviceLocator);\n var td = _this.getCellFromIndex(rowsObj[j].index, cellIndex - indent);\n cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });\n }\n }\n });\n }\n };\n /**\n * Gets the content div of the TreeGrid.\n *\n * @returns {Element} - Return tree grid content element\n */\n TreeGrid.prototype.getContent = function () {\n return this.grid.getContent();\n };\n TreeGrid.prototype.mergePersistTreeGridData = function () {\n var persist1 = 'mergePersistGridData';\n this.grid[persist1].apply(this);\n };\n TreeGrid.prototype.mergeColumns = function (storedColumn, columns) {\n var persist2 = 'mergeColumns';\n this.grid[persist2].apply(this, [storedColumn, columns]);\n };\n TreeGrid.prototype.updateTreeGridModel = function () {\n this.setProperties({ filterSettings: getObject('properties', this.grid.filterSettings) }, true);\n this.setProperties({ pageSettings: getObject('properties', this.grid.pageSettings) }, true);\n this.setProperties({ searchSettings: getObject('properties', this.grid.searchSettings) }, true);\n this.setProperties({ sortSettings: getObject('properties', this.grid.sortSettings) }, true);\n };\n /**\n * Gets the content table of the TreeGrid.\n *\n * @returns {Element} - Returns content table element\n */\n TreeGrid.prototype.getContentTable = function () {\n return this.grid.getContentTable();\n };\n /**\n * Gets all the TreeGrid's data rows.\n *\n * @returns {Element[]} - Returns row elements\n */\n TreeGrid.prototype.getDataRows = function () {\n var dRows = [];\n var rows = this.grid.getDataRows();\n for (var i = 0, len = rows.length; i < len; i++) {\n if (!rows[i].classList.contains('e-summaryrow')) {\n dRows.push(rows[i]);\n }\n }\n return dRows;\n };\n /**\n * Get current visible data of TreeGrid.\n *\n * @returns {Object[]} - Returns current view records\n * @isGenericType true\n */\n TreeGrid.prototype.getCurrentViewRecords = function () {\n return this.grid.currentViewData;\n };\n /**\n * Gets the added, edited,and deleted data before bulk save to the DataSource in batch mode.\n *\n * @returns {Object} - Returns batch changes\n */\n TreeGrid.prototype.getBatchChanges = function () {\n return this.grid.editModule.getBatchChanges();\n };\n /**\n * Gets the header div of the TreeGrid.\n *\n * @returns {Element} - Returns Header content element\n */\n TreeGrid.prototype.getHeaderContent = function () {\n return this.grid.getHeaderContent();\n };\n /**\n * Gets the header table element of the TreeGrid.\n *\n * @returns {Element} - Return header table element\n */\n TreeGrid.prototype.getHeaderTable = function () {\n return this.grid.getHeaderTable();\n };\n /**\n * Gets a row by index.\n *\n * @param {number} index - Specifies the row index.\n * @returns {Element} - Returns row element\n */\n TreeGrid.prototype.getRowByIndex = function (index) {\n return this.grid.getRowByIndex(index);\n };\n /**\n * Get a row information based on cell\n *\n * @param {Element | EventTarget} target - Target row element\n * @returns {RowInfo} - Returns row information in a JSON object\n */\n TreeGrid.prototype.getRowInfo = function (target) {\n return this.grid.getRowInfo(target);\n };\n /**\n * Gets UID by column name.\n *\n * @param {string} field - Specifies the column name.\n * @returns {string} - Returns unique id based on column field name given\n */\n TreeGrid.prototype.getUidByColumnField = function (field) {\n return this.grid.getUidByColumnField(field);\n };\n /**\n * Gets the visible columns from the TreeGrid.\n *\n * @returns {Column[]} - Returns visible columns collection\n */\n TreeGrid.prototype.getVisibleColumns = function () {\n var cols = [];\n for (var _i = 0, _a = this.columnModel; _i < _a.length; _i++) {\n var col = _a[_i];\n if (col.visible) {\n cols.push(col);\n }\n }\n return cols;\n };\n /**\n * By default, TreeGrid shows the spinner for all its actions. You can use this method to show spinner at your needed time.\n *\n * @returns {void}\n */\n TreeGrid.prototype.showSpinner = function () {\n showSpinner(this.element);\n };\n /**\n * Manually shown spinner needs to hide by `hideSpinnner`.\n *\n * @returns {void}\n */\n TreeGrid.prototype.hideSpinner = function () {\n hideSpinner(this.element);\n };\n /**\n * Refreshes the TreeGrid header and content.\n *\n * @returns {void}\n */\n TreeGrid.prototype.refresh = function () {\n this.uniqueIDCollection = {};\n this.convertTreeData(this.dataSource);\n if (!isCountRequired(this)) {\n this.grid.dataSource = !(this.dataSource instanceof DataManager) ? this.flatData :\n new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor);\n }\n this.grid.refresh();\n };\n /**\n * Get the records of checked rows.\n *\n * @returns {Object[]} - Returns records that has been checked\n * @isGenericType true\n */\n TreeGrid.prototype.getCheckedRecords = function () {\n return this.selectionModule.getCheckedrecords();\n };\n /**\n * Get the visible records corresponding to rows visually displayed.\n *\n * @returns {Object[]} - Returns visible records based on collapse state of rows\n * @isGenericType true\n */\n TreeGrid.prototype.getVisibleRecords = function () {\n var visibleRecords = [];\n var currentViewRecords = this.getCurrentViewRecords();\n if (!this.allowPaging) {\n for (var i = 0; i < currentViewRecords.length; i++) {\n visibleRecords.push(currentViewRecords[i]);\n if (!currentViewRecords[i].expanded) {\n i += findChildrenRecords(currentViewRecords[i]).length;\n }\n }\n }\n else {\n visibleRecords = currentViewRecords;\n }\n return visibleRecords;\n };\n /**\n * Get the indexes of checked rows.\n *\n * @returns {number[]} - Returns checked row indexes\n */\n TreeGrid.prototype.getCheckedRowIndexes = function () {\n return this.selectionModule.getCheckedRowIndexes();\n };\n /**\n * Checked the checkboxes using rowIndexes.\n *\n * @param {number[]} indexes - row indexes\n * @returns {void}\n */\n TreeGrid.prototype.selectCheckboxes = function (indexes) {\n this.selectionModule.selectCheckboxes(indexes);\n };\n /**\n * Refreshes the TreeGrid column changes.\n *\n * @param {boolean} refreshUI - Defined whether to refresh the DOM\n * @returns {void}\n */\n TreeGrid.prototype.refreshColumns = function (refreshUI) {\n if (isNullOrUndefined(refreshUI) || refreshUI) {\n this.grid.columns = this.getGridColumns(this.columns);\n this.grid.refreshColumns();\n }\n else {\n this.grid.setProperties({ columns: this.getGridColumns(this.columns) }, true);\n }\n };\n /**\n * Refreshes the TreeGrid header.\n *\n * @returns {void}\n */\n TreeGrid.prototype.refreshHeader = function () {\n this.grid.refreshHeader();\n };\n /**\n * Expands or collapse child records\n *\n * @param {HTMLElement} target - Expand collapse icon cell as target element\n * @returns {void}\n * @hidden\n */\n TreeGrid.prototype.expandCollapseRequest = function (target) {\n if (this.editSettings.mode === 'Batch') {\n var obj = 'dialogObj';\n var showDialog = 'showDialog';\n if (this.getBatchChanges()[this.changedRecords].length ||\n this.getBatchChanges()[this.deletedRecords].length || this.getBatchChanges()[this.addedRecords].length) {\n var dialogObj = this.grid.editModule[obj];\n this.grid.editModule[showDialog]('CancelEdit', dialogObj);\n this.targetElement = target;\n return;\n }\n }\n if (this.rowTemplate) {\n var rowInfo = target.closest('.e-treerowcell').parentElement;\n var record = this.getCurrentViewRecords()[rowInfo.rowIndex];\n if (target.classList.contains('e-treegridexpand')) {\n this.collapseRow(rowInfo, record);\n }\n else {\n this.expandRow(rowInfo, record);\n }\n }\n else {\n var rowInfo = this.grid.getRowInfo(target);\n var record = rowInfo.rowData;\n if (this.enableImmutableMode) {\n record = this.getCurrentViewRecords()[rowInfo.rowIndex];\n }\n if (target.classList.contains('e-treegridexpand')) {\n this.collapseRow(rowInfo.row, record);\n }\n else {\n this.expandRow(rowInfo.row, record);\n }\n }\n };\n /**\n * Expands child rows\n *\n * @param {HTMLTableRowElement} row - Expands the given row\n * @param {Object} record - Expands the given record\n * @param {Object} key - Primary key value\n * @param {number} level - Specifies the hierarchical level of the record\n * @returns {void}\n */\n TreeGrid.prototype.expandRow = function (row, record, key, level) {\n var _this = this;\n record = this.getCollapseExpandRecords(row, record);\n if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {\n this.lastRowBorder(row, false);\n }\n var args = { data: record, row: row, cancel: false };\n this.trigger(events.expanding, args, function (expandingArgs) {\n if (!expandingArgs.cancel) {\n _this.expandCollapse('expand', row, record);\n if (expandingArgs.expandAll) {\n _this.expandCollapseAllChildren(record, 'expand', key, level);\n }\n var children = 'Children';\n if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {\n var collapseArgs = { data: record, row: row };\n _this.setHeightForFrozenContent();\n _this.trigger(events.expanded, collapseArgs);\n }\n }\n });\n };\n TreeGrid.prototype.expandCollapseAllChildren = function (record, action, key, level) {\n if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||\n (!isNullOrUndefined(level) && level !== record.level)) {\n return;\n }\n var records = findChildrenRecords(record).filter(function (e) {\n return e.hasChildRecords;\n });\n records.unshift(record);\n for (var i = 0; i < records.length; i++) {\n this.expandCollapse(action, null, records[i]);\n }\n };\n TreeGrid.prototype.setHeightForFrozenContent = function () {\n var freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;\n if (this.grid.getFrozenColumns() > 0 || freeze) {\n this.grid.contentModule.refreshScrollOffset();\n }\n };\n TreeGrid.prototype.getCollapseExpandRecords = function (row, record) {\n if (this.allowPaging && this.pageSettings.pageSizeMode === 'All' && this.isExpandAll && isNullOrUndefined(record) &&\n !isRemoteData(this)) {\n record = this.flatData.filter(function (e) {\n return e.hasChildRecords;\n });\n }\n else if (isNullOrUndefined(record)) {\n if (this.detailTemplate) {\n record = this.grid.getCurrentViewRecords()[row.getAttribute('aria-rowindex')];\n }\n else {\n record = this.grid.getCurrentViewRecords()[row.rowIndex];\n }\n }\n return record;\n };\n /**\n * Collapses child rows\n *\n * @param {HTMLTableRowElement} row - Collapse the given row\n * @param {Object} record - Collapse the given record\n * @param {Object} key - Primary key value\n * @returns {void}\n */\n TreeGrid.prototype.collapseRow = function (row, record, key) {\n var _this = this;\n record = this.getCollapseExpandRecords(row, record);\n var args = { data: record, row: row, cancel: false };\n this.trigger(events.collapsing, args, function (collapsingArgs) {\n if (!collapsingArgs.cancel) {\n if (collapsingArgs.collapseAll) {\n _this.expandCollapseAllChildren(record, 'collapse', key);\n }\n _this.expandCollapse('collapse', row, record);\n var collapseArgs = { data: record, row: row };\n if (!isRemoteData(_this)) {\n _this.setHeightForFrozenContent();\n _this.trigger(events.collapsed, collapseArgs);\n if (_this.enableInfiniteScrolling) {\n var scrollHeight = _this.grid.getContent().firstElementChild.scrollHeight;\n var scrollTop = _this.grid.getContent().firstElementChild.scrollTop;\n if ((scrollHeight - scrollTop) < _this.grid.getRowHeight() + +_this.height) {\n _this.grid.getContent().firstElementChild.scrollBy(0, _this.grid.getRowHeight());\n }\n }\n }\n }\n });\n };\n /**\n * Expands the records at specific hierarchical level\n *\n * @param {number} level - Expands the parent rows at given level\n * @returns {void}\n */\n TreeGrid.prototype.expandAtLevel = function (level) {\n if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {\n var rec = this.grid.dataSource.filter(function (e) {\n if (e.hasChildRecords && e.level === level) {\n e.expanded = true;\n }\n return e.hasChildRecords && e.level === level;\n });\n this.expandAction(rec, null, level, true);\n }\n else {\n var rec = this.getRecordDetails(level);\n var record = getObject('records', rec);\n this.expandAction(record, null, level);\n }\n };\n /**\n * Expands the records by given primary key value\n *\n * @param {Object} key - Expands the parent rows with given primary key value\n * @returns {void}\n */\n TreeGrid.prototype.expandByKey = function (key) {\n this.expandCollapseActionByKey(key, 'Expand');\n };\n TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {\n if (isPaging === void 0) { isPaging = false; }\n var _loop_1 = function (i) {\n if (!isNullOrUndefined(record[i].parentItem)) {\n var puniqueID_1 = record[i].parentItem.uniqueID;\n var parentItem = this_1.flatData.filter(function (e) {\n return e.uniqueID === puniqueID_1;\n });\n if (isRemoteData(this_1)) {\n parentItem = this_1.getCurrentViewRecords().filter(function (e) {\n return e.uniqueID === puniqueID_1;\n });\n }\n if (parentItem[0].expanded === false) {\n record.push(parentItem[0]);\n parentItem[0].expanded = true;\n }\n else {\n if (!getExpandStatus(this_1, parentItem[0], this_1.parentData)) {\n if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {\n record.push(parentItem[0]);\n }\n }\n }\n }\n if (!isPaging) {\n this_1.expandRow(null, record[i], key, level);\n }\n };\n var this_1 = this;\n for (var i = 0; i < record.length; i++) {\n _loop_1(i);\n }\n if (isPaging) {\n this.expandRow(null, record, key, level);\n }\n };\n TreeGrid.prototype.getRecordDetails = function (level) {\n var rows = this.getRows().filter(function (e) {\n return (e.className.indexOf('level' + level) !== -1\n && (e.querySelector('.e-treegridcollapse') || e.querySelector('.e-treegridexpand')));\n });\n var records = this.getCurrentViewRecords().filter(function (e) {\n return e.level === level && e.hasChildRecords;\n });\n var obj = { records: records, rows: rows };\n return obj;\n };\n /**\n * Collapses the records at specific hierarchical level\n *\n * @param {number} level - Define the parent row level which needs to be collapsed\n * @returns {void}\n */\n TreeGrid.prototype.collapseAtLevel = function (level) {\n if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {\n var record = this.grid.dataSource.filter(function (e) {\n if (e.hasChildRecords && e.level === level) {\n e.expanded = false;\n }\n return e.hasChildRecords && e.level === level;\n });\n this.collapseAction(record, null, true);\n }\n else {\n var rec = this.getRecordDetails(level);\n var records = getObject('records', rec);\n this.collapseAction(records);\n }\n };\n /**\n * Collapses the records by given primary key value\n *\n * @param {Object} key - Collapses the parent rows with given primary key value\n * @returns {void}\n */\n TreeGrid.prototype.collapseByKey = function (key) {\n this.expandCollapseActionByKey(key, 'Collapse');\n };\n TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {\n var primaryKeyField = this.getPrimaryKeyFieldNames()[0];\n var dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;\n if (!isNullOrUndefined(primaryKeyField)) {\n var rec = dataSource.filter(function (e) {\n return e[primaryKeyField].toString() === key.toString();\n });\n if (action === 'Expand') {\n this.expandAction(rec, key, null);\n }\n else {\n this.collapseAction(rec, key);\n }\n }\n };\n TreeGrid.prototype.collapseAction = function (record, key, isPaging) {\n if (isPaging === void 0) { isPaging = false; }\n if (isPaging) {\n this.collapseRow(null, record);\n }\n else {\n for (var i = 0; i < record.length; i++) {\n this.collapseRow(null, record[i], key);\n }\n }\n if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()\n && this.parentData.length === this.getRows().length) {\n var endIndex = 'endIndex';\n this.grid.contentModule.startIndex = -1;\n this.grid.contentModule[endIndex] = -1;\n }\n };\n /**\n * Expands All the rows\n *\n * @returns {void}\n */\n TreeGrid.prototype.expandAll = function () {\n this.expandCollapseAll('expand');\n };\n /**\n * Collapses All the rows\n *\n * @returns {void}\n */\n TreeGrid.prototype.collapseAll = function () {\n this.expandCollapseAll('collapse');\n };\n TreeGrid.prototype.expandCollapseAll = function (action) {\n var rows = this.getRows().filter(function (e) {\n return e.querySelector('.e-treegrid' + (action === 'expand' ? 'collapse' : 'expand'));\n });\n if (!rows.length && this.getRows().length) {\n rows.push(this.getRows()[0]);\n }\n this.isExpandAll = true;\n this.isCollapseAll = true;\n if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {\n this.flatData.filter(function (e) {\n if (e.hasChildRecords) {\n e.expanded = action === 'collapse' ? false : true;\n }\n });\n if (rows.length) {\n if (action === 'collapse') {\n this.collapseRow(rows[0]);\n }\n else {\n this.expandRow(rows[0]);\n }\n }\n else if (this.allowPaging) {\n var isExpandCollapseall = this.enableCollapseAll;\n this.setProperties({ enableCollapseAll: true }, true);\n this.grid.pagerModule.goToPage(1);\n this.setProperties({ enableCollapseAll: isExpandCollapseall }, true);\n }\n }\n else {\n for (var i = 0; i < rows.length; i++) {\n if (action === 'collapse') {\n this.collapseRow(rows[i]);\n }\n else {\n this.expandRow(rows[i]);\n }\n }\n }\n this.isExpandAll = false;\n this.isCollapseAll = false;\n };\n TreeGrid.prototype.expandCollapse = function (action, row, record, isChild) {\n var expandingArgs = { row: row, data: record, childData: [], requestType: action };\n var childRecords = this.getCurrentViewRecords().filter(function (e) {\n return e.parentUniqueID === record.uniqueID;\n });\n var targetEle;\n if (!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) {\n this.updateChildOnDemand(expandingArgs);\n }\n var gridRows = this.getRows();\n if (this.rowTemplate) {\n var rows = this.getContentTable().rows;\n gridRows = [].slice.call(rows);\n }\n var rowIndex;\n if (isNullOrUndefined(row)) {\n rowIndex = this.getCurrentViewRecords().indexOf(record);\n row = gridRows[rowIndex];\n }\n else {\n rowIndex = +row.getAttribute('aria-rowindex');\n }\n if (!isNullOrUndefined(row)) {\n row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');\n }\n if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)\n && !isCountRequired(this)) {\n this.notify(events.localPagedExpandCollapse, { action: action, row: row, record: record });\n }\n else {\n var displayAction = void 0;\n if (action === 'expand') {\n displayAction = 'table-row';\n if (!isChild) {\n record.expanded = true;\n this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;\n }\n if (!isNullOrUndefined(row)) {\n targetEle = row.getElementsByClassName('e-treegridcollapse')[0];\n }\n if (isChild && !isNullOrUndefined(record[this.expandStateMapping]) &&\n record[this.expandStateMapping] && isNullOrUndefined(targetEle)) {\n targetEle = row.getElementsByClassName('e-treegridexpand')[0];\n }\n if (isNullOrUndefined(targetEle)) {\n return;\n }\n if (!targetEle.classList.contains('e-treegridexpand')) {\n addClass([targetEle], 'e-treegridexpand');\n }\n removeClass([targetEle], 'e-treegridcollapse');\n }\n else {\n displayAction = 'none';\n if (!isChild || isCountRequired(this)) {\n record.expanded = false;\n this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;\n }\n if (!isNullOrUndefined(row)) {\n targetEle = row.getElementsByClassName('e-treegridexpand')[0];\n }\n if (isChild && !isNullOrUndefined(record[this.expandStateMapping]) &&\n !record[this.expandStateMapping] && isNullOrUndefined(targetEle)) {\n targetEle = row.getElementsByClassName('e-treegridcollapse')[0];\n }\n if (isNullOrUndefined(targetEle)) {\n return;\n }\n if (!targetEle.classList.contains('e-treegridcollapse')) {\n addClass([targetEle], 'e-treegridcollapse');\n }\n removeClass([targetEle], 'e-treegridexpand');\n }\n var detailrows = gridRows.filter(function (r) {\n return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));\n });\n if (isRemoteData(this) && !isOffline(this)) {\n this.remoteExpand(action, row, record);\n }\n else {\n if ((!isCountRequired(this) || childRecords.length) || action === 'collapse') {\n this.localExpand(action, row, record);\n }\n }\n if (this.isPixelHeight() && !row.cells[0].classList.contains('e-lastrowcell')) {\n var totalRows = this.getRows();\n var rows = this.getContentTable().rows;\n totalRows = [].slice.call(rows);\n for (var i = totalRows.length - 1; i >= 0; i--) {\n if (!isHidden(totalRows[i])) {\n var table = this.getContentTable();\n var sHeight = table.scrollHeight;\n var clientHeight = this.getContent().clientHeight;\n this.lastRowBorder(totalRows[i], sHeight <= clientHeight);\n break;\n }\n }\n }\n this.notify('rowExpandCollapse', { detailrows: detailrows, action: displayAction, record: record, row: row });\n this.updateAltRow(gridRows);\n }\n };\n TreeGrid.prototype.updateChildOnDemand = function (expandingArgs) {\n var _this = this;\n var deff = new Deferred();\n var childDataBind = 'childDataBind';\n expandingArgs[childDataBind] = deff.resolve;\n var record = expandingArgs.data;\n this.trigger(events.dataStateChange, expandingArgs);\n deff.promise.then(function () {\n if (expandingArgs.childData.length) {\n var currentData = (_this.flatData);\n var index = 0;\n for (var i = 0; i < currentData.length; i++) {\n if (currentData[i].taskData === record.taskData) {\n index = i;\n break;\n }\n }\n var data_1 = getValue('result', _this.dataSource);\n var childData = extendArray(expandingArgs.childData);\n var length_1 = record[_this.childMapping] ? record[_this.childMapping].length > childData.length ?\n record[_this.childMapping].length : childData.length : childData.length;\n for (var i = 0; i < length_1; i++) {\n if (record[_this.childMapping]) {\n data_1.filter(function (e, i) {\n if (e[_this.parentIdMapping] === record[_this.idMapping]) {\n data_1.splice(i, 1);\n }\n });\n }\n if (childData[i]) {\n childData[i].level = record.level + 1;\n childData[i].index = Math.ceil(Math.random() * 1000);\n childData[i].parentItem = extend({}, record);\n childData[i].taskData = extend({}, childData[i]);\n delete childData[i].parentItem.childRecords;\n delete childData[i].taskData.parentItem;\n childData[i].parentUniqueID = record.uniqueID;\n childData[i].uniqueID = getUid(_this.element.id + '_data_');\n setValue('uniqueIDCollection.' + childData[i].uniqueID, childData[i], _this);\n if (!isNullOrUndefined(childData[i][_this.childMapping]) ||\n (childData[i][_this.hasChildMapping] && isCountRequired(_this))) {\n childData[i].hasChildRecords = true;\n }\n currentData.splice(index + 1 + i, record[_this.childMapping] && record[_this.childMapping][i] ? 1 : 0, childData[i]);\n }\n else {\n currentData.splice(index + 1 + i, 1);\n }\n }\n currentData[index][_this.childMapping] = childData;\n currentData[index].childRecords = childData;\n currentData[index].expanded = true;\n setValue('uniqueIDCollection.' + currentData[index].uniqueID, currentData[index], _this);\n for (var j = 0; j < expandingArgs.childData.length; j++) {\n data_1.push(expandingArgs.childData[j]);\n }\n }\n _this.isExpandRefresh = true;\n _this.grid.refresh();\n _this.setHeightForFrozenContent();\n _this.trigger(events.expanded, expandingArgs);\n });\n };\n TreeGrid.prototype.remoteExpand = function (action, row, record) {\n var gridRows = this.getRows();\n if (this.rowTemplate) {\n var rows_1 = this.getContentTable().rows;\n gridRows = [].slice.call(rows_1);\n }\n var args = { data: record, row: row };\n var rows = [];\n rows = gridRows.filter(function (r) {\n return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));\n });\n if (action === 'expand') {\n this.notify(events.remoteExpand, { record: record, rows: rows, parentRow: row });\n var args_1 = { row: row, data: record };\n if (rows.length > 0) {\n this.setHeightForFrozenContent();\n this.trigger(events.expanded, args_1);\n }\n }\n else {\n this.collapseRemoteChild({ record: record, rows: rows });\n this.setHeightForFrozenContent();\n this.trigger(events.collapsed, args);\n }\n };\n TreeGrid.prototype.localExpand = function (action, row, record) {\n var rows;\n var childRecords = this.getCurrentViewRecords().filter(function (e) {\n return e.parentUniqueID === record.uniqueID;\n });\n if (this.isPixelHeight() && row.cells[0].classList.contains('e-lastrowcell')) {\n this.lastRowBorder(row, false);\n }\n var movableRows;\n var freezeRightRows;\n var gridRows = this.getRows();\n if (this.rowTemplate) {\n var rows_2 = this.getContentTable().rows;\n gridRows = [].slice.call(rows_2);\n }\n var displayAction = (action === 'expand') ? 'table-row' : 'none';\n var primaryKeyField = this.getPrimaryKeyFieldNames()[0];\n if (this.enableImmutableMode && !this.allowPaging) {\n rows = [];\n for (var i = 0; i < childRecords.length; i++) {\n var rowIndex = this.grid.getRowIndexByPrimaryKey(childRecords[i][primaryKeyField]);\n rows.push(this.getRows()[rowIndex]);\n }\n }\n else {\n rows = gridRows.filter(function (r) {\n return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));\n });\n }\n var freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;\n if (this.frozenRows || this.frozenColumns || this.getFrozenColumns() || freeze) {\n movableRows = this.getMovableRows().filter(function (r) {\n return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));\n });\n }\n if (freeze) {\n freezeRightRows = this.getFrozenRightRows().filter(function (r) {\n return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));\n });\n }\n for (var i = 0; i < rows.length; i++) {\n if (!isNullOrUndefined(rows[i])) {\n rows[i].style.display = displayAction;\n }\n if (!isNullOrUndefined(movableRows)) {\n movableRows[i].style.display = displayAction;\n }\n if (!isNullOrUndefined(freezeRightRows)) {\n freezeRightRows[i].style.display = displayAction;\n }\n this.notify('childRowExpand', { row: rows[i] });\n if ((!isNullOrUndefined(childRecords[i].childRecords) && childRecords[i].childRecords.length > 0) && (action !== 'expand' ||\n isNullOrUndefined(childRecords[i].expanded) || childRecords[i].expanded)) {\n this.expandCollapse(action, rows[i], childRecords[i], true);\n if (this.frozenColumns <= this.treeColumnIndex && !isNullOrUndefined(movableRows)) {\n this.expandCollapse(action, movableRows[i], childRecords[i], true);\n }\n }\n }\n };\n TreeGrid.prototype.updateAltRow = function (rows) {\n if (this.enableAltRow && !this.rowTemplate) {\n var visibleRowCount = 0;\n for (var i = 0; rows && i < rows.length; i++) {\n var gridRow = rows[i];\n if (gridRow.style.display !== 'none') {\n if (gridRow.classList.contains('e-altrow')) {\n removeClass([gridRow], 'e-altrow');\n }\n if (visibleRowCount % 2 !== 0 && !gridRow.classList.contains('e-summaryrow') && !gridRow.classList.contains('e-detailrow')) {\n addClass([gridRow], 'e-altrow');\n }\n if (!gridRow.classList.contains('e-summaryrow') && !gridRow.classList.contains('e-detailrow')) {\n visibleRowCount++;\n }\n }\n }\n }\n };\n TreeGrid.prototype.treeColumnRowTemplate = function () {\n if (this.rowTemplate) {\n var rows = this.getContentTable().rows;\n rows = [].slice.call(rows);\n for (var i = 0; i < rows.length; i++) {\n var rcell = this.grid.getContentTable().rows[i].cells[this.treeColumnIndex];\n var row = rows[i];\n var rowData = this.grid.getRowsObject()[i].data;\n var arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };\n this.renderModule.cellRender(arg);\n }\n }\n };\n TreeGrid.prototype.collapseRemoteChild = function (rowDetails, isChild) {\n if (!isChild) {\n rowDetails.record.expanded = false;\n }\n var rows = rowDetails.rows;\n var row;\n var childRecord;\n var movablerows = [];\n var rightrows = [];\n var freeze = (this.getFrozenLeftColumnsCount() > 0 || this.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n movablerows = this.getMovableRows().filter(function (r) {\n return r.querySelector('.e-gridrowindex' + rowDetails.record.index + 'level' + (rowDetails.record.level + 1));\n });\n rightrows = this.getFrozenRightRows().filter(function (r) {\n return r.querySelector('.e-gridrowindex' + rowDetails.record.index + 'level' + (rowDetails.record.level + 1));\n });\n }\n for (var i = 0; i < rows.length; i++) {\n rows[i].style.display = 'none';\n row = rows[i];\n var collapsingTd = rows[i].querySelector('.e-detailrowexpand');\n if (!isNullOrUndefined(collapsingTd)) {\n this.grid.detailRowModule.collapse(collapsingTd);\n }\n if (freeze) {\n movablerows[i].style.display = 'none';\n rightrows[i].style.display = 'none';\n if (!rows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n if (movablerows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n row = movablerows[i];\n }\n else if (rightrows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n row = rightrows[i];\n }\n }\n }\n if (row.querySelector('.e-treecolumn-container .e-treegridexpand')) {\n var expandElement = row.querySelector('.e-treecolumn-container .e-treegridexpand');\n childRecord = this.rowTemplate ? this.grid.getCurrentViewRecords()[rows[i].rowIndex] :\n this.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;\n if (!isNullOrUndefined(expandElement) && childRecord.expanded) {\n removeClass([expandElement], 'e-treegridexpand');\n addClass([expandElement], 'e-treegridcollapse');\n }\n var cRow = [];\n var eRows = this.getRows();\n for (var i_1 = 0; i_1 < eRows.length; i_1++) {\n if (eRows[i_1].querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1))) {\n cRow.push(eRows[i_1]);\n }\n }\n if (cRow.length && childRecord.expanded) {\n this.collapseRemoteChild({ record: childRecord, rows: cRow }, true);\n }\n }\n }\n };\n /**\n * Updates the rows and cells\n *\n * @param {Object[]} records - Updates the given records\n * @param {HTMLTableRowElement[]} rows - Updates the given rows\n * @param {number} index - Updates the given cell index\n * @returns {void}\n */\n TreeGrid.prototype.updateRowAndCellElements = function (records, rows, index) {\n for (var i = 0; i < records.length; i++) {\n this.renderModule.cellRender({\n data: records[i], cell: rows[i].cells[index],\n column: this.grid.getColumns()[this.treeColumnIndex],\n requestType: 'rowDragAndDrop'\n });\n if (this['action'] === 'indenting' || this['action'] === 'outdenting') {\n this.renderModule.RowModifier({\n data: records[i], row: rows[i]\n });\n }\n }\n };\n /**\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.addListener = function () {\n this.on('updateResults', this.updateResultModel, this);\n this.grid.on('initial-end', this.afterGridRender, this);\n };\n TreeGrid.prototype.updateResultModel = function (returnResult) {\n this.dataResults = returnResult;\n };\n /**\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.removeListener = function () {\n if (this.isDestroyed) {\n return;\n }\n this.off('updateResults', this.updateResultModel);\n this.grid.off('initial-end', this.afterGridRender);\n };\n /**\n * Filters TreeGrid row by column name with the given options.\n *\n * @param {string} fieldName - Defines the field name of the column.\n * @param {string} filterOperator - Defines the operator to filter records.\n * @param {string | number | Date | boolean} filterValue - Defines the value used to filter records.\n * @param {string} predicate - Defines the relationship between one filter query and another by using AND or OR predicate.\n * @param {boolean} matchCase - If match case is set to true, the TreeGrid filters the records with exact match. if false, it filters\n * case insensitive records (uppercase and lowercase letters are treated the same).\n * @param {boolean} ignoreAccent - If ignoreAccent is set to true,\n * then filter ignores diacritic characters or accents while filtering.\n * @param {string} actualFilterValue - Defines the actual filter value for filter column.\n * @param {string} actualOperator - Defines the actual filter operator for filter column.\n * @returns {void}\n */\n TreeGrid.prototype.filterByColumn = function (fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {\n this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);\n };\n /**\n * Clears all the filtered rows of the TreeGrid.\n *\n * @returns {void}\n */\n TreeGrid.prototype.clearFiltering = function () {\n this.grid.clearFiltering();\n };\n /**\n * Removes filtered column by field name.\n *\n * @param {string} field - Defines column field name to remove filter.\n * @param {boolean} isClearFilterBar - Specifies whether the filter bar value needs to be cleared.\n * @returns {void}\n * @hidden\n */\n TreeGrid.prototype.removeFilteredColsByField = function (field, isClearFilterBar) {\n this.grid.removeFilteredColsByField(field, isClearFilterBar);\n };\n /**\n * Selects a row by given index.\n *\n * @param {number} index - Defines the row index.\n * @param {boolean} isToggle - If set to true, then it toggles the selection.\n * @returns {void}\n */\n TreeGrid.prototype.selectRow = function (index, isToggle) {\n this.grid.selectRow(index, isToggle);\n };\n /**\n * Selects a collection of rows by indexes.\n *\n * @param {number[]} rowIndexes - Specifies the row indexes.\n * @returns {void}\n */\n TreeGrid.prototype.selectRows = function (rowIndexes) {\n this.grid.selectRows(rowIndexes);\n };\n /**\n * Deselects the current selected rows and cells.\n *\n * @returns {void}\n */\n TreeGrid.prototype.clearSelection = function () {\n this.grid.clearSelection();\n };\n /**\n * Copy the selected rows or cells data into clipboard.\n *\n * @param {boolean} withHeader - Specifies whether the column header text needs to be copied along with rows or cells.\n * @returns {void}\n */\n TreeGrid.prototype.copy = function (withHeader) {\n this.clipboardModule.copy(withHeader);\n };\n /**\n * Paste data from clipboard to selected cells.\n *\n * @param {boolean} data - Specifies the date for paste.\n * @param {boolean} rowIndex - Specifies the row index.\n * @param {boolean} colIndex - Specifies the column index.\n * @returns {void}\n */\n TreeGrid.prototype.paste = function (data, rowIndex, colIndex) {\n this.clipboardModule.paste(data, rowIndex, colIndex);\n };\n /**\n * Selects a cell by the given index.\n *\n * @param {IIndex} cellIndex - Defines the row and column indexes.\n * @param {boolean} isToggle - If set to true, then it toggles the selection.\n * @returns {void}\n */\n TreeGrid.prototype.selectCell = function (cellIndex, isToggle) {\n this.grid.selectCell(cellIndex, isToggle);\n };\n /**\n * Gets the collection of selected rows.\n *\n * @returns {Element[]} - Returns selected row elements collection\n */\n TreeGrid.prototype.getSelectedRows = function () {\n return this.grid.getSelectedRows();\n };\n /**\n * Gets a movable table cell by row and column index.\n *\n * @param {number} rowIndex - Specifies the row index.\n * @param {number} columnIndex - Specifies the column index.\n * @returns {Element} - Returns movable cell element from the indexes passed\n */\n TreeGrid.prototype.getMovableCellFromIndex = function (rowIndex, columnIndex) {\n return this.grid.getMovableCellFromIndex(rowIndex, columnIndex);\n };\n /**\n * Gets all the TreeGrid's movable table data rows.\n *\n * @returns {Element[]} - Returns element collection of movable rows\n */\n TreeGrid.prototype.getMovableDataRows = function () {\n return this.grid.getMovableDataRows();\n };\n /**\n * Gets a movable tables row by index.\n *\n * @param {number} index - Specifies the row index.\n * @returns {Element} - Returns movable row based on index passed\n */\n TreeGrid.prototype.getMovableRowByIndex = function (index) {\n return this.grid.getMovableRowByIndex(index);\n };\n /**\n * Gets the TreeGrid's movable content rows from frozen treegrid.\n *\n * @returns {Element[]}: Returns movable row element\n */\n TreeGrid.prototype.getMovableRows = function () {\n return this.grid.getMovableRows();\n };\n /**\n * Gets a frozen right tables row element by index.\n *\n * @param {number} index - Specifies the row index.\n * @returns {Element} returns the element\n */\n TreeGrid.prototype.getFrozenRightRowByIndex = function (index) {\n return this.grid.getFrozenRightRowByIndex(index);\n };\n /**\n * Gets the Tree Grid's frozen right content rows from frozen Tree Grid.\n *\n * @returns {Element[]} returns the element\n */\n TreeGrid.prototype.getFrozenRightRows = function () {\n return this.grid.getFrozenRightRows();\n };\n /**\n * Gets all the Tree Grid's frozen right table data rows.\n *\n * @returns {Element[]} Returns the Element\n */\n TreeGrid.prototype.getFrozenRightDataRows = function () {\n return this.grid.getFrozenRightDataRows();\n };\n /**\n * Gets a frozen right table cell by row and column index.\n *\n * @param {number} rowIndex - Specifies the row index.\n * @param {number} columnIndex - Specifies the column index.\n * @returns {Element} Returns the Element\n */\n TreeGrid.prototype.getFrozenRightCellFromIndex = function (rowIndex, columnIndex) {\n return this.grid.getFrozenRightCellFromIndex(rowIndex, columnIndex);\n };\n /**\n * Gets a frozen left column header by column index.\n *\n * @param {number} index - Specifies the column index.\n * @returns {Element} Returns the Element\n */\n TreeGrid.prototype.getFrozenLeftColumnHeaderByIndex = function (index) {\n return this.grid.getFrozenLeftColumnHeaderByIndex(index);\n };\n /**\n * Gets a frozen right column header by column index.\n *\n * @param {number} index - Specifies the column index.\n * @returns {Element} Returns the Element\n */\n TreeGrid.prototype.getFrozenRightColumnHeaderByIndex = function (index) {\n return this.grid.getFrozenRightColumnHeaderByIndex(index);\n };\n /**\n * Gets a movable column header by column index.\n *\n * @param {number} index - Specifies the column index.\n * @returns {Element} Returns the Element\n */\n TreeGrid.prototype.getMovableColumnHeaderByIndex = function (index) {\n return this.grid.getMovableColumnHeaderByIndex(index);\n };\n /**\n * @hidden\n * @returns {number} Returns the movable column count\n */\n TreeGrid.prototype.getMovableColumnsCount = function () {\n return this.grid.getMovableColumnsCount();\n };\n /**\n * @hidden\n * @returns {number} Returns the Frozen Left column\n */\n TreeGrid.prototype.getFrozenLeftColumnsCount = function () {\n return this.grid.getFrozenLeftColumnsCount();\n };\n /**\n * @hidden\n * @returns {number} Returns the Frozen Right column count\n */\n TreeGrid.prototype.getFrozenRightColumnsCount = function () {\n return this.grid.getFrozenRightColumnsCount();\n };\n /**\n * @hidden\n * @returns {Column[]} Returns the column\n */\n TreeGrid.prototype.getFrozenLeftColumns = function () {\n this.updateColumnModel(this.grid.getFrozenLeftColumns());\n return this.columnModel;\n };\n /**\n * @hidden\n * @returns {Column[]} Returns the column\n */\n TreeGrid.prototype.getFrozenRightColumns = function () {\n this.updateColumnModel(this.grid.getFrozenRightColumns());\n return this.columnModel;\n };\n /**\n * @hidden\n * @returns {number} Returns the visible movable count\n */\n TreeGrid.prototype.getVisibleMovableCount = function () {\n return this.grid.getVisibleMovableCount();\n };\n /**\n * @hidden\n * @returns {number} Returns the visible Frozen Right count\n */\n TreeGrid.prototype.getVisibleFrozenRightCount = function () {\n return this.grid.getVisibleFrozenRightCount();\n };\n /**\n * @hidden\n * @returns {number} Returns the visible Frozen left count\n */\n TreeGrid.prototype.getVisibleFrozenLeftCount = function () {\n return this.grid.getVisibleFrozenLeftCount();\n };\n /**\n * @hidden\n * @returns {Column[]} Returns the column\n */\n TreeGrid.prototype.getMovableColumns = function () {\n this.updateColumnModel(this.grid.getMovableColumns());\n return this.columnModel;\n };\n /**\n * Gets the number of frozen column in tree grid\n *\n * @hidden\n * @returns {number} - Returns frozen column count\n */\n TreeGrid.prototype.getFrozenColumns = function () {\n return this.getFrozenCount(this.columns, 0) + this.frozenColumns;\n };\n TreeGrid.prototype.getFrozenCount = function (cols, cnt) {\n for (var j = 0, len = cols.length; j < len; j++) {\n if (cols[j].columns) {\n cnt = this.getFrozenCount(cols[j].columns, cnt);\n }\n else {\n if (cols[j].isFrozen) {\n cnt++;\n }\n }\n }\n return cnt;\n };\n /**\n * Gets the collection of selected row indexes.\n *\n * @returns {number[]} - Returns selected rows index collection\n */\n TreeGrid.prototype.getSelectedRowIndexes = function () {\n return this.grid.getSelectedRowIndexes();\n };\n /**\n * Gets the collection of selected row and cell indexes.\n *\n * @returns {ISelectedCell[]} - Returns selected cell's index details\n */\n TreeGrid.prototype.getSelectedRowCellIndexes = function () {\n return this.grid.getSelectedRowCellIndexes();\n };\n /**\n * Gets the collection of selected records.\n *\n * @isGenericType true\n * @returns {Object[]} - Returns selected records collection\n */\n TreeGrid.prototype.getSelectedRecords = function () {\n return this.grid.getSelectedRecords();\n };\n /**\n * Gets the data module.\n *\n * @returns {{baseModule: Data, treeModule: DataManipulation}}: Returns grid and treegrid data module\n */\n TreeGrid.prototype.getDataModule = function () {\n return { baseModule: this.grid.getDataModule(), treeModule: this.dataModule };\n };\n /**\n * Reorder the rows based on given indexes and position\n *\n * @param {number[]} fromIndexes - Source indexes of rows\n * @param {number} toIndex - Destination index of row\n * @param {string} position - Defines drop position as above or below or child\n * @returns {void}\n */\n TreeGrid.prototype.reorderRows = function (fromIndexes, toIndex, position) {\n this.rowDragAndDropModule.reorderRows(fromIndexes, toIndex, position);\n };\n var TreeGrid_1;\n __decorate([\n Property(0)\n ], TreeGrid.prototype, \"frozenRows\", void 0);\n __decorate([\n Property(0)\n ], TreeGrid.prototype, \"frozenColumns\", void 0);\n __decorate([\n Property('Ellipsis')\n ], TreeGrid.prototype, \"clipMode\", void 0);\n __decorate([\n Property([])\n ], TreeGrid.prototype, \"columns\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"childMapping\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"hasChildMapping\", void 0);\n __decorate([\n Property(0)\n ], TreeGrid.prototype, \"treeColumnIndex\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"idMapping\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"parentIdMapping\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableCollapseAll\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"expandStateMapping\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowRowDragAndDrop\", void 0);\n __decorate([\n Property([])\n ], TreeGrid.prototype, \"dataSource\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"query\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"cloneQuery\", void 0);\n __decorate([\n Property('AllPages')\n ], TreeGrid.prototype, \"printMode\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowPaging\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"loadChildOnDemand\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowTextWrap\", void 0);\n __decorate([\n Complex({}, TextWrapSettings)\n ], TreeGrid.prototype, \"textWrapSettings\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowReordering\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowResizing\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"autoCheckHierarchy\", void 0);\n __decorate([\n Complex({}, PageSettings)\n ], TreeGrid.prototype, \"pageSettings\", void 0);\n __decorate([\n Complex({}, RowDropSettings)\n ], TreeGrid.prototype, \"rowDropSettings\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"pagerTemplate\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"showColumnMenu\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"showColumnChooser\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowSorting\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"allowMultiSorting\", void 0);\n __decorate([\n Complex({}, SortSettings)\n ], TreeGrid.prototype, \"sortSettings\", void 0);\n __decorate([\n Collection([], AggregateRow)\n ], TreeGrid.prototype, \"aggregates\", void 0);\n __decorate([\n Complex({}, EditSettings)\n ], TreeGrid.prototype, \"editSettings\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowFiltering\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"detailTemplate\", void 0);\n __decorate([\n Complex({}, FilterSettings)\n ], TreeGrid.prototype, \"filterSettings\", void 0);\n __decorate([\n Complex({}, SearchSettings)\n ], TreeGrid.prototype, \"searchSettings\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"toolbar\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"toolbarTemplate\", void 0);\n __decorate([\n Property('Default')\n ], TreeGrid.prototype, \"gridLines\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"contextMenuItems\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"columnMenuItems\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"rowTemplate\", void 0);\n __decorate([\n Property('Parent')\n ], TreeGrid.prototype, \"copyHierarchyMode\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"rowHeight\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"enableAltRow\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"allowKeyboard\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableHover\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableAutoFill\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableAdaptiveUI\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableImmutableMode\", void 0);\n __decorate([\n Property('auto')\n ], TreeGrid.prototype, \"height\", void 0);\n __decorate([\n Property('auto')\n ], TreeGrid.prototype, \"width\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableVirtualization\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableColumnVirtualization\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableInfiniteScrolling\", void 0);\n __decorate([\n Complex({}, InfiniteScrollSettings)\n ], TreeGrid.prototype, \"infiniteScrollSettings\", void 0);\n __decorate([\n Property('All')\n ], TreeGrid.prototype, \"columnQueryMode\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"load\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"expanding\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"expanded\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"collapsing\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"collapsed\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellSave\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellSaved\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"actionBegin\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"actionComplete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beginEdit\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"batchAdd\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"batchDelete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"batchCancel\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeBatchAdd\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeBatchDelete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeBatchSave\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellEdit\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"actionFailure\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"dataBound\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"dataSourceChanged\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"dataStateChange\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"recordDoubleClick\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDataBound\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"detailDataBound\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"queryCellInfo\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"allowSelection\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowSelecting\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowSelected\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDeselecting\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDeselected\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"headerCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellSelecting\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnMenuOpen\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnMenuClick\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellSelected\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellDeselecting\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellDeselected\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"resizeStart\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"resizing\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"resizeStop\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnDragStart\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnDrag\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnDrop\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"checkboxChange\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"printComplete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforePrint\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"toolbarClick\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeDataBound\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"contextMenuOpen\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"contextMenuClick\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeCopy\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforePaste\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDrag\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDragStart\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDragStartHelper\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDrop\", void 0);\n __decorate([\n Property(-1)\n ], TreeGrid.prototype, \"selectedRowIndex\", void 0);\n __decorate([\n Complex({}, SelectionSettings)\n ], TreeGrid.prototype, \"selectionSettings\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowExcelExport\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowPdfExport\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"pdfQueryCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"pdfHeaderQueryCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"excelQueryCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"excelHeaderQueryCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeExcelExport\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"excelExportComplete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforePdfExport\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"pdfExportComplete\", void 0);\n TreeGrid = TreeGrid_1 = __decorate([\n NotifyPropertyChanges\n ], TreeGrid);\n return TreeGrid;\n}(Component));\nexport { TreeGrid };\n","import { getObject, Grid, Reorder as GridReorder } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid Reorder module\n *\n * @hidden\n */\nvar Reorder = /** @class */ (function () {\n /**\n * Constructor for Reorder module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Reorder(parent) {\n Grid.Inject(GridReorder);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Reorder module name\n */\n Reorder.prototype.getModuleName = function () {\n return 'reorder';\n };\n /**\n * @hidden\n * @returns {void}\n */\n Reorder.prototype.addEventListener = function () {\n this.parent.on('getColumnIndex', this.getTreeColumn, this);\n };\n Reorder.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('getColumnIndex', this.getTreeColumn);\n };\n /**\n * To destroy the Reorder\n *\n * @returns {void}\n * @hidden\n */\n Reorder.prototype.destroy = function () {\n this.removeEventListener();\n };\n Reorder.prototype.getTreeColumn = function () {\n var columnModel = 'columnModel';\n var treeColumn = this.parent[columnModel][this.parent.treeColumnIndex];\n var treeIndex;\n var updatedCols = this.parent.getColumns();\n for (var f = 0; f < updatedCols.length; f++) {\n var treeColumnfield = getObject('field', treeColumn);\n var parentColumnfield = getObject('field', updatedCols[f]);\n if (treeColumnfield === parentColumnfield) {\n treeIndex = f;\n break;\n }\n }\n this.parent.setProperties({ treeColumnIndex: treeIndex }, true);\n };\n return Reorder;\n}());\nexport { Reorder };\n","import { Grid, Resize as GridResize } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid Resize module\n *\n * @hidden\n */\nvar Resize = /** @class */ (function () {\n /**\n * Constructor for Resize module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Resize(parent) {\n Grid.Inject(GridResize);\n this.parent = parent;\n }\n /**\n * Resize by field names.\n *\n * @param {string|string[]} fName - Defines the field name.\n * @returns {void}\n */\n Resize.prototype.autoFitColumns = function (fName) {\n this.parent.grid.autoFitColumns(fName);\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Resize module name\n */\n Resize.prototype.getModuleName = function () {\n return 'resize';\n };\n /**\n * Destroys the Resize.\n *\n * @function destroy\n * @returns {void}\n */\n Resize.prototype.destroy = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.grid.resizeModule.destroy();\n };\n return Resize;\n}());\nexport { Resize };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the row drop settings of the TreeGrid.\n */\nvar RowDropSettings = /** @class */ (function (_super) {\n __extends(RowDropSettings, _super);\n function RowDropSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], RowDropSettings.prototype, \"targetID\", void 0);\n return RowDropSettings;\n}(ChildProperty));\nexport { RowDropSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { VirtualRowModelGenerator } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { isCountRequired } from '../utils';\n/**\n * RowModelGenerator is used to generate grid data rows.\n *\n * @hidden\n */\nvar TreeVirtualRowModelGenerator = /** @class */ (function (_super) {\n __extends(TreeVirtualRowModelGenerator, _super);\n function TreeVirtualRowModelGenerator(parent) {\n var _this = _super.call(this, parent) || this;\n _this.addEventListener();\n return _this;\n }\n TreeVirtualRowModelGenerator.prototype.addEventListener = function () {\n this.parent.on(events.dataListener, this.getDatas, this);\n };\n TreeVirtualRowModelGenerator.prototype.getDatas = function (args) {\n this.visualData = args.data;\n };\n TreeVirtualRowModelGenerator.prototype.getDataInfo = function () {\n return _super.prototype.getData.call(this);\n };\n TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {\n if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext &&\n notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {\n this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);\n }\n else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext &&\n notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {\n this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);\n }\n var info = this.getDataInfo();\n if (!isNullOrUndefined(notifyArgs.virtualInfo)) {\n if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {\n notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;\n }\n else {\n notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);\n }\n }\n if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {\n return _super.prototype.generateRows.call(this, data, notifyArgs);\n }\n else {\n if (!isNullOrUndefined(notifyArgs.requestType) && notifyArgs.requestType.toString() === 'collapseAll') {\n notifyArgs.requestType = 'refresh';\n }\n var rows = _super.prototype.generateRows.call(this, data, notifyArgs);\n for (var r = 0; r < rows.length; r++) {\n rows[r].index = (this.visualData).indexOf(rows[r].data);\n }\n return rows;\n }\n };\n TreeVirtualRowModelGenerator.prototype.checkAndResetCache = function (action) {\n var clear = ['paging', 'refresh', 'sorting', 'filtering', 'searching', 'reorder',\n 'save', 'delete'].some(function (value) { return action === value; });\n if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {\n var model = 'model';\n var currentPage = this[model].currentPage;\n if (clear) {\n this.cache = {};\n this.data = {};\n this.groups = {};\n }\n else if (action === 'virtualscroll' && this.cache[currentPage] &&\n this.cache[currentPage].length > (this.parent.contentModule).getBlockSize()) {\n delete this.cache[currentPage];\n }\n }\n else {\n if (clear || action === 'virtualscroll') {\n this.cache = {};\n this.data = {};\n this.groups = {};\n }\n }\n return clear;\n };\n return TreeVirtualRowModelGenerator;\n}(VirtualRowModelGenerator));\nexport { TreeVirtualRowModelGenerator };\n","import { getObject, Filter as GridFilter, Grid } from '@syncfusion/ej2-grids';\nimport { isNullOrUndefined, setValue, getValue } from '@syncfusion/ej2-base';\nimport { getParentData } from '../utils';\n/**\n * TreeGrid Filter module will handle filtering action\n *\n * @hidden\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor for Filter module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Filter(parent) {\n Grid.Inject(GridFilter);\n this.parent = parent;\n this.isHierarchyFilter = false;\n this.filteredResult = [];\n this.flatFilteredData = [];\n this.filteredParentRecs = [];\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Filter module name\n */\n Filter.prototype.getModuleName = function () {\n return 'filter';\n };\n /**\n * To destroy the Filter module\n *\n * @returns {void}\n * @hidden\n */\n Filter.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {void}\n */\n Filter.prototype.addEventListener = function () {\n this.parent.on('updateFilterRecs', this.updatedFilteredRecord, this);\n this.parent.on('clearFilters', this.clearFilterLevel, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n Filter.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('updateFilterRecs', this.updatedFilteredRecord);\n this.parent.off('clearFilters', this.clearFilterLevel);\n };\n /**\n * Function to update filtered records\n *\n * @param {{data: Object} } dataDetails - Filtered data collection\n * @param {Object} dataDetails.data - Fliltered data collection\n * @hidden\n * @returns {void}\n */\n Filter.prototype.updatedFilteredRecord = function (dataDetails) {\n setValue('uniqueIDFilterCollection', {}, this.parent);\n this.flatFilteredData = dataDetails.data;\n this.filteredParentRecs = [];\n this.filteredResult = [];\n this.isHierarchyFilter = false;\n for (var f = 0; f < this.flatFilteredData.length; f++) {\n var rec = this.flatFilteredData[f];\n this.addParentRecord(rec);\n var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode\n : this.parent.searchSettings.hierarchyMode;\n if (((hierarchyMode === 'Child' || hierarchyMode === 'None') &&\n (this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== ''))) {\n this.isHierarchyFilter = true;\n }\n var ischild = getObject('childRecords', rec);\n if (!isNullOrUndefined(ischild) && ischild.length) {\n setValue('hasFilteredChildRecords', this.checkChildExsist(rec), rec);\n }\n var parent_1 = getObject('parentItem', rec);\n if (!isNullOrUndefined(parent_1)) {\n var parRecord = getParentData(this.parent, rec.parentItem.uniqueID, true);\n //let parRecord: Object = this.flatFilteredData.filter((e: ITreeData) => {\n // return e.uniqueID === rec.parentItem.uniqueID; })[0];\n setValue('hasFilteredChildRecords', true, parRecord);\n if (parRecord && parRecord.parentItem) {\n this.updateParentFilteredRecord(parRecord);\n }\n }\n }\n if (this.flatFilteredData.length > 0 && this.isHierarchyFilter) {\n this.updateFilterLevel();\n }\n this.parent.notify('updateAction', { result: this.filteredResult });\n };\n Filter.prototype.updateParentFilteredRecord = function (record) {\n var parRecord = getParentData(this.parent, record.parentItem.uniqueID, true);\n var uniqueIDValue = getValue('uniqueIDFilterCollection', this.parent);\n if (parRecord && Object.prototype.hasOwnProperty.call(uniqueIDValue, parRecord.uniqueID)) {\n setValue('hasFilteredChildRecords', true, parRecord);\n }\n if (parRecord && parRecord.parentItem) {\n this.updateParentFilteredRecord(parRecord);\n }\n };\n Filter.prototype.addParentRecord = function (record) {\n var parent = getParentData(this.parent, record.parentUniqueID);\n //let parent: Object = this.parent.flatData.filter((e: ITreeData) => {return e.uniqueID === record.parentUniqueID; })[0];\n var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode\n : this.parent.searchSettings.hierarchyMode;\n if (hierarchyMode === 'None' && (this.parent.grid.filterSettings.columns.length !== 0\n || this.parent.grid.searchSettings.key !== '')) {\n if (isNullOrUndefined(parent)) {\n if (this.flatFilteredData.indexOf(record) !== -1) {\n if (this.filteredResult.indexOf(record) === -1) {\n this.filteredResult.push(record);\n setValue('uniqueIDFilterCollection.' + record.uniqueID, record, this.parent);\n record.hasFilteredChildRecords = true;\n }\n return;\n }\n }\n else {\n this.addParentRecord(parent);\n if (this.flatFilteredData.indexOf(parent) !== -1 || this.filteredResult.indexOf(parent) !== -1) {\n if (this.filteredResult.indexOf(record) === -1) {\n this.filteredResult.push(record);\n setValue('uniqueIDFilterCollection.' + record.uniqueID, record, this.parent);\n }\n }\n else {\n if (this.filteredResult.indexOf(record) === -1 && this.flatFilteredData.indexOf(record) !== -1) {\n this.filteredResult.push(record);\n setValue('uniqueIDFilterCollection.' + record.uniqueID, record, this.parent);\n }\n }\n }\n }\n else {\n if (!isNullOrUndefined(parent)) {\n var hierarchyMode_1 = this.parent.grid.searchSettings.key === '' ?\n this.parent.filterSettings.hierarchyMode : this.parent.searchSettings.hierarchyMode;\n if (hierarchyMode_1 === 'Child' && (this.parent.grid.filterSettings.columns.length !== 0\n || this.parent.grid.searchSettings.key !== '')) {\n if (this.flatFilteredData.indexOf(parent) !== -1) {\n this.addParentRecord(parent);\n }\n }\n else {\n this.addParentRecord(parent);\n }\n }\n if (this.filteredResult.indexOf(record) === -1) {\n this.filteredResult.push(record);\n setValue('uniqueIDFilterCollection.' + record.uniqueID, record, this.parent);\n }\n }\n };\n Filter.prototype.checkChildExsist = function (records) {\n var childRec = getObject('childRecords', records);\n var isExist = false;\n for (var count = 0; count < childRec.length; count++) {\n var ischild = childRec[count].childRecords;\n var hierarchyMode = this.parent.grid.searchSettings.key === '' ?\n this.parent.filterSettings.hierarchyMode : this.parent.searchSettings.hierarchyMode;\n if (((hierarchyMode === 'Child' || hierarchyMode === 'Both') && (this.parent.grid.filterSettings.columns.length !== 0\n || this.parent.grid.searchSettings.key !== ''))) {\n var uniqueIDValue = getValue('uniqueIDFilterCollection', this.parent);\n if (!Object.prototype.hasOwnProperty.call(uniqueIDValue, childRec[count].uniqueID)) {\n this.filteredResult.push(childRec[count]);\n setValue('uniqueIDFilterCollection.' + childRec[count].uniqueID, childRec[count], this.parent);\n isExist = true;\n }\n }\n if ((hierarchyMode === 'None')\n && (this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== '')) {\n if (this.flatFilteredData.indexOf(childRec[count]) !== -1) {\n isExist = true;\n break;\n }\n }\n if (!isNullOrUndefined(ischild) && ischild.length) {\n isExist = this.checkChildExsist(childRec[count]);\n }\n if ((hierarchyMode === 'Child' || hierarchyMode === 'Both') && childRec.length) {\n isExist = true;\n }\n }\n return isExist;\n };\n Filter.prototype.updateFilterLevel = function () {\n var record = this.filteredResult;\n var len = this.filteredResult.length;\n for (var c = 0; c < len; c++) {\n var parent_2 = getParentData(this.parent, record[c].parentUniqueID);\n var isPrst = record.indexOf(parent_2) !== -1;\n if (isPrst) {\n var parent_3 = getParentData(this.parent, record[c].parentUniqueID, true);\n record[c].filterLevel = parent_3.filterLevel + 1;\n }\n else {\n record[c].filterLevel = 0;\n this.filteredParentRecs.push(record[c]);\n }\n }\n };\n Filter.prototype.clearFilterLevel = function (data) {\n var count = 0;\n var flatData = data.flatData;\n var len = flatData.length;\n var currentRecord;\n for (count; count < len; count++) {\n currentRecord = flatData[count];\n var fLevel = currentRecord.filterLevel;\n if (fLevel || fLevel === 0 || !isNullOrUndefined(currentRecord.hasFilteredChildRecords)) {\n currentRecord.hasFilteredChildRecords = null;\n currentRecord.filterLevel = null;\n }\n }\n this.filteredResult = [];\n this.parent.notify('updateResults', { result: flatData, count: flatData.length });\n };\n return Filter;\n}());\nexport { Filter };\n","import { getObject, Grid, ExcelExport as GridExcel } from '@syncfusion/ej2-grids';\nimport { isRemoteData, isOffline, getParentData, getExpandStatus } from '../utils';\nimport { isNullOrUndefined, setValue, extend } from '@syncfusion/ej2-base';\nimport { DataManager, Query } from '@syncfusion/ej2-data';\nimport * as event from '../base/constant';\n/**\n * TreeGrid Excel Export module\n *\n * @hidden\n */\nvar ExcelExport = /** @class */ (function () {\n /**\n * Constructor for Excel Export module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function ExcelExport(parent) {\n this.isCollapsedStatePersist = false;\n Grid.Inject(GridExcel);\n this.parent = parent;\n this.dataResults = {};\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns ExcelExport module name\n */\n ExcelExport.prototype.getModuleName = function () {\n return 'ExcelExport';\n };\n /**\n * @hidden\n * @returns {void}\n */\n ExcelExport.prototype.addEventListener = function () {\n this.parent.on('updateResults', this.updateExcelResultModel, this);\n this.parent.on('excelCellInfo', this.excelQueryCellInfo, this);\n this.parent.grid.on('export-RowDataBound', this.exportRowDataBound, this);\n this.parent.grid.on('finalPageSetup', this.finalPageSetup, this);\n };\n /**\n * To destroy the Excel Export\n *\n * @returns {void}\n * @hidden\n */\n ExcelExport.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {void}\n */\n ExcelExport.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('updateResults', this.updateExcelResultModel);\n this.parent.off('excelCellInfo', this.excelQueryCellInfo);\n this.parent.grid.off('export-RowDataBound', this.exportRowDataBound);\n this.parent.grid.off('finalPageSetup', this.finalPageSetup);\n };\n ExcelExport.prototype.updateExcelResultModel = function (returnResult) {\n this.dataResults = returnResult;\n };\n ExcelExport.prototype.Map = function (excelExportProperties, \n /* eslint-disable-next-line */\n isMultipleExport, workbook, isBlob, isCsv) {\n var _this = this;\n var dataSource = this.parent.dataSource;\n var property = Object();\n setValue('isCsv', isCsv, property);\n setValue('cancel', false, property);\n if (!isNullOrUndefined(excelExportProperties)) {\n this.isCollapsedStatePersist = excelExportProperties.isCollapsedStatePersist;\n }\n return new Promise(function (resolve) {\n var dm = _this.isLocal() && !(dataSource instanceof DataManager) ? new DataManager(dataSource)\n : _this.parent.dataSource;\n var query = new Query();\n if (!_this.isLocal()) {\n query = _this.generateQuery(query);\n setValue('query', query, property);\n }\n _this.parent.trigger(event.beforeExcelExport, extend(property, excelExportProperties));\n if (getObject('cancel', property)) {\n return null;\n }\n dm.executeQuery(query).then(function (e) {\n var customData = null;\n if (!isNullOrUndefined(excelExportProperties) && !isNullOrUndefined(excelExportProperties.dataSource)) {\n customData = excelExportProperties.dataSource;\n }\n excelExportProperties = _this.manipulateExportProperties(excelExportProperties, dataSource, e);\n return _this.parent.grid.excelExportModule.Map(_this.parent.grid, excelExportProperties, isMultipleExport, workbook, isCsv, isBlob).then(function (book) {\n if (customData != null) {\n excelExportProperties.dataSource = customData;\n }\n else {\n delete excelExportProperties.dataSource;\n }\n resolve(book);\n });\n });\n });\n };\n ExcelExport.prototype.generateQuery = function (query, property) {\n if (!isNullOrUndefined(property) && property.exportType === 'CurrentPage'\n && this.parent.allowPaging) {\n property.exportType = 'AllPages';\n query.addParams('ExportType', 'CurrentPage');\n query.where(this.parent.parentIdMapping, 'equal', null);\n query = getObject('grid.renderModule.data.pageQuery', this.parent)(query);\n }\n return query;\n };\n ExcelExport.prototype.manipulateExportProperties = function (property, dtSrc, queryResult) {\n //count not required for this query\n var args = Object();\n setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);\n setValue('isExport', true, args);\n if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {\n setValue('exportType', property.exportType, args);\n }\n if (!this.isLocal()) {\n this.parent.parentData = [];\n this.parent.dataModule.convertToFlatData(getObject('result', queryResult));\n setValue('expresults', this.parent.flatData, args);\n }\n this.parent.notify('dataProcessor', args);\n //args = this.parent.dataModule.dataProcessor(args);\n args = this.dataResults;\n dtSrc = isNullOrUndefined(args.result) ? this.parent.flatData.slice(0) : args.result;\n if (!this.isLocal()) {\n this.parent.flatData = [];\n }\n if (property && property.dataSource && this.isLocal()) {\n var flatsData = this.parent.flatData;\n var dataSrc = property.dataSource instanceof DataManager ? property.dataSource.dataSource.json : property.dataSource;\n this.parent.dataModule.convertToFlatData(dataSrc);\n dtSrc = this.parent.flatData;\n this.parent.flatData = flatsData;\n }\n property = isNullOrUndefined(property) ? Object() : property;\n property.dataSource = new DataManager({ json: dtSrc });\n return property;\n };\n /**\n * TreeGrid Excel Export cell modifier\n *\n * @param {ExcelQueryCellInfoEventArgs} args - current cell details\n * @hidden\n * @returns {void}\n */\n ExcelExport.prototype.excelQueryCellInfo = function (args) {\n if (this.parent.grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex) {\n var style = {};\n var data = args.data;\n var ispadfilter = isNullOrUndefined(data.filterLevel);\n var pad = ispadfilter ? data.level : data.filterLevel;\n style.indent = pad;\n args.style = style;\n }\n this.parent.notify('updateResults', args);\n this.parent.trigger('excelQueryCellInfo', args);\n };\n ExcelExport.prototype.exportRowDataBound = function (excelRow) {\n if (excelRow.type === 'excel') {\n var excelrowobj = excelRow.rowObj.data;\n var filtercolumnlength = this.parent.grid.filterSettings.columns.length;\n var rowlength = excelRow.excelRows.length;\n var rowlevel = excelrowobj.level;\n if (excelrowobj.parentItem && getParentData(this.parent, excelrowobj.parentItem.uniqueID, Boolean(filtercolumnlength))) {\n var expandedStatus = false;\n var sublevelState = false;\n var state = getExpandStatus(this.parent, excelrowobj, this.parent.parentData);\n if (this.isCollapsedStatePersist && (!state || !this.parent.isLocalData)) {\n expandedStatus = true;\n sublevelState = excelrowobj.expanded ? false : true;\n }\n excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel, isCollapsed: sublevelState,\n isHidden: expandedStatus };\n }\n else if (excelrowobj.hasChildRecords && isNullOrUndefined(excelrowobj.parentItem)) {\n excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel };\n }\n }\n };\n /* eslint-disable-next-line */\n ExcelExport.prototype.finalPageSetup = function (workbook) {\n for (var i = 0; i < workbook.worksheets.length; i++) {\n if (workbook.worksheets[i].rows) {\n workbook.worksheets[i].pageSetup = { isSummaryRowBelow: false };\n }\n }\n };\n ExcelExport.prototype.isLocal = function () {\n return !isRemoteData(this.parent) && isOffline(this.parent);\n };\n return ExcelExport;\n}());\nexport { ExcelExport };\n","import { getObject, PdfExport as GridPdf, Grid } from '@syncfusion/ej2-grids';\nimport { isRemoteData, isOffline } from '../utils';\nimport { isNullOrUndefined, setValue, extend, getValue } from '@syncfusion/ej2-base';\nimport { DataManager, Query } from '@syncfusion/ej2-data';\nimport * as event from '../base/constant';\n/**\n * TreeGrid PDF Export module\n *\n * @hidden\n */\nvar PdfExport = /** @class */ (function () {\n /**\n * Constructor for PDF export module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function PdfExport(parent) {\n Grid.Inject(GridPdf);\n this.parent = parent;\n this.dataResults = {};\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} PdfExport module name\n */\n PdfExport.prototype.getModuleName = function () {\n return 'PdfExport';\n };\n /**\n * @hidden\n * @returns {void}\n */\n PdfExport.prototype.addEventListener = function () {\n this.parent.on('pdfCellInfo', this.pdfQueryCellInfo, this);\n this.parent.on('updateResults', this.updatePdfResultModel, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n PdfExport.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('pdfCellInfo', this.pdfQueryCellInfo);\n this.parent.off('updateResults', this.updatePdfResultModel);\n };\n /**\n * To destroy the PDF Export\n *\n * @returns {void}\n * @hidden\n */\n PdfExport.prototype.destroy = function () {\n this.removeEventListener();\n };\n PdfExport.prototype.updatePdfResultModel = function (returnResult) {\n this.dataResults = returnResult;\n };\n PdfExport.prototype.Map = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {\n var _this = this;\n var dtSrc = this.parent.dataSource;\n var prop = Object();\n var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);\n setValue('cancel', false, prop);\n return new Promise(function (resolve) {\n var dm = isLocal && !(dtSrc instanceof DataManager) ? new DataManager(dtSrc)\n : _this.parent.dataSource;\n var query = new Query();\n if (!isLocal) {\n query = _this.generateQuery(query);\n setValue('query', query, prop);\n }\n _this.parent.trigger(event.beforePdfExport, extend(prop, pdfExportProperties));\n if (getObject('cancel', prop)) {\n return null;\n }\n dm.executeQuery(query).then(function (e) {\n var customsData = null;\n if (!isNullOrUndefined(pdfExportProperties) && !isNullOrUndefined(pdfExportProperties.dataSource)) {\n customsData = pdfExportProperties.dataSource;\n }\n pdfExportProperties = _this.manipulatePdfProperties(pdfExportProperties, dtSrc, e);\n return _this.parent.grid.pdfExportModule.Map(_this.parent.grid, pdfExportProperties, isMultipleExport, pdfDoc, isBlob).then(function (document) {\n if (customsData != null) {\n pdfExportProperties.dataSource = customsData;\n }\n else {\n delete pdfExportProperties.dataSource;\n }\n resolve(document);\n });\n });\n });\n };\n PdfExport.prototype.generateQuery = function (query, prop) {\n if (!isNullOrUndefined(prop) && prop.exportType === 'CurrentPage'\n && this.parent.allowPaging) {\n prop.exportType = 'AllPages';\n query.addParams('ExportType', 'CurrentPage');\n query.where(this.parent.parentIdMapping, 'equal', null);\n query = getObject('grid.renderModule.data.pageQuery', this.parent)(query);\n }\n return query;\n };\n PdfExport.prototype.manipulatePdfProperties = function (prop, dtSrc, queryResult) {\n var args = {};\n //count not required for this query\n var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);\n setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);\n setValue('isExport', true, args);\n setValue('isPdfExport', true, args);\n if (!isNullOrUndefined(prop) && !isNullOrUndefined(prop.isCollapsedStatePersist)) {\n setValue('isCollapsedStatePersist', prop.isCollapsedStatePersist, args);\n }\n if (!isNullOrUndefined(prop) && !isNullOrUndefined(prop.exportType)) {\n setValue('exportType', prop.exportType, args);\n }\n if (!isLocal) {\n this.parent.parentData = [];\n this.parent.dataModule.convertToFlatData(getValue('result', queryResult));\n setValue('expresults', this.parent.flatData, args);\n }\n this.parent.notify('dataProcessor', args);\n //args = this.parent.dataModule.dataProcessor(args);\n args = this.dataResults;\n dtSrc = isNullOrUndefined(args.result) ? this.parent.flatData.slice(0) : args.result;\n if (!isLocal) {\n this.parent.flatData = [];\n }\n if (prop && prop.dataSource && isLocal) {\n var flatDatas = this.parent.flatData;\n var dataSrc = prop.dataSource instanceof DataManager ? prop.dataSource.dataSource.json : prop.dataSource;\n this.parent.dataModule.convertToFlatData(dataSrc);\n dtSrc = this.parent.flatData;\n this.parent.flatData = flatDatas;\n }\n prop = isNullOrUndefined(prop) ? {} : prop;\n prop.dataSource = new DataManager({ json: dtSrc });\n return prop;\n };\n /**\n * TreeGrid PDF Export cell modifier\n *\n * @param {PdfQueryCellInfoEventArgs} args - Current cell details\n * @hidden\n * @returns {void}\n */\n PdfExport.prototype.pdfQueryCellInfo = function (args) {\n if (this.parent.grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex) {\n var style = {};\n var data = getObject('data', args);\n var ispadfilter = isNullOrUndefined(data.filterLevel);\n var pad = ispadfilter ? data.level : data.filterLevel;\n style.paragraphIndent = pad * 3;\n args.style = style;\n }\n this.parent.notify('updateResults', args);\n this.parent.trigger('pdfQueryCellInfo', args);\n };\n return PdfExport;\n}());\nexport { PdfExport };\n","import { Grid } from '@syncfusion/ej2-grids';\nimport { Page as GridPage } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { DataManager, Query, Predicate } from '@syncfusion/ej2-data';\nimport { getValue, isNullOrUndefined, addClass, removeClass } from '@syncfusion/ej2-base';\nimport { getExpandStatus, isFilterChildHierarchy } from '../utils';\n/**\n * The `Page` module is used to render pager and handle paging action.\n *\n * @hidden\n */\nvar Page = /** @class */ (function () {\n function Page(parent) {\n Grid.Inject(GridPage);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * @hidden\n * @returns {void}\n */\n Page.prototype.addEventListener = function () {\n this.parent.on(events.localPagedExpandCollapse, this.collapseExpandPagedchilds, this);\n this.parent.on(events.pagingActions, this.pageAction, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n Page.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.localPagedExpandCollapse, this.collapseExpandPagedchilds);\n this.parent.off(events.pagingActions, this.pageAction);\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Pager module name\n */\n Page.prototype.getModuleName = function () {\n return 'pager';\n };\n /**\n * Refreshes the page count, pager information, and external message.\n *\n * @returns {void}\n */\n Page.prototype.refresh = function () {\n this.parent.grid.pagerModule.refresh();\n };\n /**\n * To destroy the pager\n *\n * @returns {void}\n * @hidden\n */\n Page.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * Navigates to the target page according to the given number.\n *\n * @param {number} pageNo - Defines the page number to navigate.\n * @returns {void}\n */\n Page.prototype.goToPage = function (pageNo) {\n this.parent.grid.pagerModule.goToPage(pageNo);\n };\n /**\n * Defines the text of the external message.\n *\n * @param {string} message - Defines the message to update.\n * @returns {void}\n */\n Page.prototype.updateExternalMessage = function (message) {\n this.parent.grid.pagerModule.updateExternalMessage(message);\n };\n /**\n * @param {{action: string, row: HTMLTableRowElement, record: ITreeData, args: RowCollapsedEventArgs}} rowDetails - Expand Collapse details arguments\n * @param {string} rowDetails.action - Expand Collapse action type\n * @param {HTMLTableRowElement} rowDetails.row - Row element\n * @param {ITreeData} rowDetails.record - Row object data\n * @param {RowCollapsedEventArgs} rowDetails.args - Expand Collapse event arguments\n * @hidden\n * @returns {void}\n */\n Page.prototype.collapseExpandPagedchilds = function (rowDetails) {\n rowDetails.record.expanded = rowDetails.action === 'collapse' ? false : true;\n if (this.parent.enableImmutableMode) {\n var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames()[0];\n var record = this.parent.flatData.filter(function (e) {\n return e[primaryKeyField_1] === rowDetails.record[primaryKeyField_1];\n });\n if (record.length) {\n record[0].expanded = rowDetails.record.expanded;\n }\n }\n var ret = {\n result: this.parent.flatData,\n row: rowDetails.row,\n action: rowDetails.action,\n record: rowDetails.record,\n count: this.parent.flatData.length\n };\n getValue('grid.renderModule', this.parent).dataManagerSuccess(ret);\n if (this.parent.enableImmutableMode) {\n var row = 'row';\n var action = 'action';\n var targetEle = void 0;\n if (ret[action] === 'collapse') {\n targetEle = ret[row].getElementsByClassName('e-treegridexpand')[0];\n if (!isNullOrUndefined(targetEle)) {\n removeClass([targetEle], 'e-treegridexpand');\n addClass([targetEle], 'e-treegridcollapse');\n }\n }\n else if (ret[action] === 'expand') {\n targetEle = ret[row].getElementsByClassName('e-treegridcollapse')[0];\n if (!isNullOrUndefined(targetEle)) {\n removeClass([targetEle], 'e-treegridcollapse');\n addClass([targetEle], 'e-treegridexpand');\n }\n }\n }\n };\n Page.prototype.pageRoot = function (pagedResults, temp, result) {\n var newResults = isNullOrUndefined(result) ? [] : result;\n var _loop_1 = function (t) {\n newResults.push(temp[t]);\n var res = [];\n if (temp[t].hasChildRecords) {\n res = pagedResults.filter(function (e) {\n return temp[t].uniqueID === e.parentUniqueID;\n });\n newResults = this_1.pageRoot(pagedResults, res, newResults);\n }\n };\n var this_1 = this;\n for (var t = 0; t < temp.length; t++) {\n _loop_1(t);\n }\n return newResults;\n };\n Page.prototype.pageAction = function (pageingDetails) {\n var _this = this;\n var dm = new DataManager(pageingDetails.result);\n if (this.parent.pageSettings.pageSizeMode === 'Root') {\n var temp = [];\n var propname = (this.parent.grid.filterSettings.columns.length > 0) &&\n (this.parent.filterSettings.hierarchyMode === 'Child' || this.parent.filterSettings.hierarchyMode === 'None') ?\n 'filterLevel' : 'level';\n var query = new Query().where(propname, 'equal', 0);\n temp = dm.executeLocal(query);\n pageingDetails.count = temp.length;\n var size = this.parent.grid.pageSettings.pageSize;\n var current = this.parent.grid.pageSettings.currentPage;\n var skip = size * (current - 1);\n query = query.skip(skip).take(size);\n temp = dm.executeLocal(query);\n var newResults = this.pageRoot(pageingDetails.result, temp);\n pageingDetails.result = newResults;\n }\n else {\n var dm_1 = new DataManager(pageingDetails.result);\n var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);\n var parents_1 = dm_1.executeLocal(new Query().where(expanded));\n var visualData = void 0;\n if (isFilterChildHierarchy(this.parent) && ((this.parent.searchSettings.key !== this.parent.grid.searchSettings.key) ||\n (this.parent.filterSettings.columns.length !== this.parent.grid.filterSettings.columns.length))) {\n visualData = parents_1;\n }\n else {\n visualData = parents_1.filter(function (e) {\n return getExpandStatus(_this.parent, e, parents_1);\n });\n }\n pageingDetails.count = visualData.length;\n var query = new Query();\n var size = this.parent.grid.pageSettings.pageSize;\n var current = this.parent.grid.pageSettings.currentPage;\n if (visualData.length < (current * size)) {\n current = (Math.floor(visualData.length / size)) + ((visualData.length % size) ? 1 : 0);\n current = current ? current : 1;\n this.parent.grid.setProperties({ pageSettings: { currentPage: current } }, true);\n }\n var skip = size * (current - 1);\n query = query.skip(skip).take(size);\n dm_1.dataSource.json = visualData;\n pageingDetails.result = dm_1.executeLocal(query);\n }\n this.parent.notify('updateAction', pageingDetails);\n };\n return Page;\n}());\nexport { Page };\n","import { Grid, Toolbar as tool } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\n/**\n * Toolbar Module for TreeGrid\n *\n * @hidden\n */\nvar Toolbar = /** @class */ (function () {\n function Toolbar(parent) {\n Grid.Inject(tool);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} - Returns Toolbar module name\n */\n Toolbar.prototype.getModuleName = function () {\n return 'toolbar';\n };\n /**\n * @hidden\n * @returns {void}\n */\n Toolbar.prototype.addEventListener = function () {\n this.parent.on(events.rowSelected, this.refreshToolbar, this);\n this.parent.on(events.rowDeselected, this.refreshToolbar, this);\n this.parent.on(events.toolbarClick, this.toolbarClickHandler, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n Toolbar.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.rowSelected, this.refreshToolbar);\n this.parent.off(events.rowDeselected, this.refreshToolbar);\n this.parent.off(events.toolbarClick, this.toolbarClickHandler);\n };\n Toolbar.prototype.refreshToolbar = function (args) {\n var tObj = this.parent;\n if (args.row.rowIndex === 0 || tObj.getSelectedRecords().length > 1) {\n this.enableItems([tObj.element.id + '_gridcontrol_indent', tObj.element.id + '_gridcontrol_outdent'], false);\n }\n else if (args['name'] !== 'rowDeselected') {\n if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex])) {\n if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex]) &&\n (tObj.getCurrentViewRecords()[args.row.rowIndex].level >\n tObj.getCurrentViewRecords()[args.row.rowIndex - 1].level)) {\n this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);\n }\n else {\n this.enableItems([tObj.element.id + '_gridcontrol_indent'], true);\n }\n if (tObj.getCurrentViewRecords()[args.row.rowIndex].level ===\n tObj.getCurrentViewRecords()[args.row.rowIndex - 1].level) {\n this.enableItems([tObj.element.id + '_gridcontrol_indent'], true);\n }\n if (tObj.getCurrentViewRecords()[args.row.rowIndex].level === 0) {\n this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);\n }\n if (tObj.getCurrentViewRecords()[args.row.rowIndex].level !== 0) {\n this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);\n }\n }\n }\n if (args['name'] === 'rowDeselected') {\n if (this.parent.toolbar['includes']('Indent')) {\n this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);\n }\n if (this.parent.toolbar['includes']('Outdent')) {\n this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);\n }\n }\n if (args.row.rowIndex === 0 && !isNullOrUndefined(args.data.parentItem)) {\n this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);\n }\n };\n Toolbar.prototype.toolbarClickHandler = function (args) {\n var tObj = this.parent;\n var action = 'action';\n if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.editSettings.mode === 'Batch' &&\n args.item.id === this.parent.grid.element.id + '_update') {\n args.cancel = true;\n this.parent.grid.editModule.saveCell();\n }\n if (args.item.id === this.parent.grid.element.id + '_expandall') {\n this.parent.expandAll();\n }\n if (args.item.id === this.parent.grid.element.id + '_collapseall') {\n this.parent.collapseAll();\n }\n if (args.item.id === tObj.grid.element.id + '_indent' && tObj.getSelectedRecords().length) {\n var record = tObj.getCurrentViewRecords()[tObj.getSelectedRowIndexes()[0] - 1];\n var dropIndex = void 0;\n if (record.level > tObj.getSelectedRecords()[0].level) {\n for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {\n if (tObj.getCurrentViewRecords()[i].taskData === record.parentItem.taskData) {\n dropIndex = i;\n }\n }\n }\n else {\n dropIndex = tObj.getSelectedRowIndexes()[0] - 1;\n }\n this.parent[action] = 'indenting';\n this.eventTrigger('indenting', dropIndex);\n }\n if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length) {\n var dropIndex = void 0;\n var parentItem = tObj.getSelectedRecords()[0].parentItem;\n for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {\n if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {\n dropIndex = i;\n }\n }\n this.parent[action] = 'outdenting';\n this.eventTrigger('outdenting', dropIndex);\n }\n };\n Toolbar.prototype.eventTrigger = function (action, dropIndex) {\n var _this = this;\n var selectedRecords = 'selectedRecords';\n var selectedRows = 'selectedRows';\n this.parent[selectedRows] = this.parent.getSelectedRows();\n this.parent[selectedRecords] = this.parent.getSelectedRecords();\n var actionArgs = {\n requestType: action,\n data: this.parent.getSelectedRecords(),\n row: this.parent.getSelectedRows(),\n cancel: false\n };\n this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {\n if (!actionArgs.cancel) {\n if (actionArgs.requestType === 'indenting') {\n _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'child');\n }\n else if (actionArgs.requestType === 'outdenting') {\n _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'below');\n }\n }\n });\n };\n /**\n * Gets the toolbar of the TreeGrid.\n *\n * @returns {Element} - Returns Toolbar element\n * @hidden\n */\n Toolbar.prototype.getToolbar = function () {\n return this.parent.grid.toolbarModule.getToolbar();\n };\n /**\n * Enables or disables ToolBar items.\n *\n * @param {string[]} items - Defines the collection of itemID of ToolBar items.\n * @param {boolean} isEnable - Defines the items to be enabled or disabled.\n * @returns {void}\n * @hidden\n */\n Toolbar.prototype.enableItems = function (items, isEnable) {\n this.parent.grid.toolbarModule.enableItems(items, isEnable);\n };\n /**\n * Destroys the ToolBar.\n *\n * @method destroy\n * @returns {void}\n */\n Toolbar.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Toolbar;\n}());\nexport { Toolbar };\n","import { Query, DataManager } from '@syncfusion/ej2-data';\nimport { getObject, calculateAggregate, Aggregate as GridAggregate, Grid, appendChildren } from '@syncfusion/ej2-grids';\nimport { findParentRecords } from '../utils';\nimport { isNullOrUndefined, setValue, createElement, extend } from '@syncfusion/ej2-base';\n/**\n * TreeGrid Aggregate module\n *\n * @hidden\n */\nvar Aggregate = /** @class */ (function () {\n /**\n * Constructor for Aggregate module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Aggregate(parent) {\n Grid.Inject(GridAggregate);\n this.parent = parent;\n this.flatChildRecords = [];\n this.summaryQuery = [];\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Summary module name\n */\n Aggregate.prototype.getModuleName = function () {\n return 'summary';\n };\n Aggregate.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n };\n /**\n * Function to calculate summary values\n *\n * @param {QueryOptions[]} summaryQuery - DataManager query for aggregate operations\n * @param {Object[]} filteredData - Filtered data collection\n * @param {boolean} isSort - Specified whether sorting operation performed\n * @hidden\n * @returns {Object[]} - return flat records with summary values\n */\n Aggregate.prototype.calculateSummaryValue = function (summaryQuery, filteredData, isSort) {\n this.summaryQuery = summaryQuery;\n var parentRecord;\n var parentDataLength = Object.keys(filteredData).length;\n var parentData = [];\n for (var p = 0, len = parentDataLength; p < len; p++) {\n var summaryRow = getObject('isSummaryRow', filteredData[p]);\n if (!summaryRow) {\n parentData.push(filteredData[p]);\n }\n }\n var parentRecords = findParentRecords(parentData);\n var flatRecords = parentData.slice();\n var summaryLength = Object.keys(this.parent.aggregates).length;\n var dataLength = Object.keys(parentRecords).length;\n var childRecordsLength;\n var columns = this.parent.getColumns();\n if (this.parent.aggregates.filter(function (x) { return x.showChildSummary; }).length) {\n for (var i = 0, len = dataLength; i < len; i++) {\n parentRecord = parentRecords[i];\n childRecordsLength = this.getChildRecordsLength(parentRecord, flatRecords);\n if (childRecordsLength) {\n var _loop_1 = function (summaryRowIndex, len_1) {\n var item = void 0;\n item = {};\n for (var i_1 = 0; i_1 < columns.length; i_1++) {\n var field = (isNullOrUndefined(getObject('field', columns[i_1]))) ?\n columns[i_1] : getObject('field', (columns[i_1]));\n item[field] = null;\n }\n item = this_1.createSummaryItem(item, this_1.parent.aggregates[summaryRowIndex - 1]);\n if (this_1.parent.aggregates[summaryRowIndex - 1].showChildSummary) {\n var idx_1;\n flatRecords.map(function (e, i) {\n if (e.uniqueID === parentRecord.uniqueID) {\n idx_1 = i;\n return;\n }\n });\n var currentIndex = idx_1 + childRecordsLength + summaryRowIndex;\n var summaryParent = extend({}, parentRecord);\n delete summaryParent.childRecords;\n delete summaryParent[this_1.parent.childMapping];\n setValue('parentItem', summaryParent, item);\n var level = getObject('level', summaryParent);\n setValue('level', level + 1, item);\n setValue('isSummaryRow', true, item);\n setValue('parentUniqueID', summaryParent.uniqueID, item);\n if (isSort) {\n var childRecords = getObject('childRecords', parentRecord);\n if (childRecords.length) {\n childRecords.push(item);\n }\n }\n flatRecords.splice(currentIndex, 0, item);\n }\n else {\n return \"continue\";\n }\n };\n var this_1 = this;\n for (var summaryRowIndex = 1, len_1 = summaryLength; summaryRowIndex <= len_1; summaryRowIndex++) {\n _loop_1(summaryRowIndex, len_1);\n }\n this.flatChildRecords = [];\n }\n }\n }\n else {\n var items = {};\n for (var columnIndex = 0, length_1 = columns.length; columnIndex < length_1; columnIndex++) {\n var fields = isNullOrUndefined(getObject('field', columns[columnIndex])) ?\n columns[columnIndex] : getObject('field', columns[columnIndex]);\n items[fields] = null;\n }\n for (var summaryRowIndex = 1, length_2 = summaryLength; summaryRowIndex <= length_2; summaryRowIndex++) {\n this.createSummaryItem(items, this.parent.aggregates[summaryRowIndex - 1]);\n }\n }\n return flatRecords;\n };\n Aggregate.prototype.getChildRecordsLength = function (parentData, flatData) {\n var recordLength = Object.keys(flatData).length;\n var record;\n for (var i = 0, len = recordLength; i < len; i++) {\n record = flatData[i];\n var parent_1 = isNullOrUndefined(record.parentItem) ? null :\n flatData.filter(function (e) { return e.uniqueID === record.parentItem.uniqueID; })[0];\n if (parentData === parent_1) {\n this.flatChildRecords.push(record);\n var hasChild = getObject('hasChildRecords', record);\n if (hasChild) {\n this.getChildRecordsLength(record, flatData);\n }\n else {\n continue;\n }\n }\n }\n return this.flatChildRecords.length;\n };\n Aggregate.prototype.createSummaryItem = function (itemData, summary) {\n var summaryColumnLength = Object.keys(summary.columns).length;\n for (var i = 0, len = summaryColumnLength; i < len; i++) {\n var displayColumn = isNullOrUndefined(summary.columns[i].columnName) ? summary.columns[i].field :\n summary.columns[i].columnName;\n var keys = Object.keys(itemData);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (key === displayColumn) {\n if (this.flatChildRecords.length) {\n itemData[key] = this.getSummaryValues(summary.columns[i], this.flatChildRecords);\n }\n else if (this.parent.isLocalData) {\n var data = this.parent.dataSource instanceof DataManager ? this.parent.dataSource.dataSource.json\n : this.parent.flatData;\n itemData[key] = this.getSummaryValues(summary.columns[i], data);\n }\n }\n else {\n continue;\n }\n }\n }\n return itemData;\n };\n Aggregate.prototype.getSummaryValues = function (summaryColumn, summaryData) {\n var qry = new Query();\n var single = {};\n var helper = {};\n var type = !isNullOrUndefined(summaryColumn.field) ?\n this.parent.getColumnByField(summaryColumn.field).type : undefined;\n summaryColumn.setPropertiesSilent({ format: this.getFormatFromType(summaryColumn.format, type) });\n summaryColumn.setFormatter(this.parent.grid.locale);\n var formatFn = summaryColumn.getFormatter() || (function () { return function (a) { return a; }; })();\n summaryColumn.setTemplate(helper);\n var tempObj = summaryColumn.getTemplate(2);\n qry.queries = this.summaryQuery;\n qry.requiresCount();\n var sumData = new DataManager(summaryData).executeLocal(qry);\n var types = summaryColumn.type;\n var summaryKey;\n types = [summaryColumn.type];\n for (var i = 0; i < types.length; i++) {\n summaryKey = types[i];\n var key = summaryColumn.field + ' - ' + types[i].toLowerCase();\n var val = types[i] !== 'Custom' ? getObject('aggregates', sumData) :\n calculateAggregate(types[i], sumData, summaryColumn, this.parent);\n var disp = summaryColumn.columnName;\n var value_1 = types[i] !== 'Custom' ? val[key] : val;\n single[disp] = single[disp] || {};\n single[disp][key] = value_1;\n single[disp][types[i]] = !isNullOrUndefined(val) ? formatFn(value_1) : ' ';\n }\n helper.format = summaryColumn.getFormatter();\n var cellElement = createElement('td', {\n className: 'e-summary'\n });\n if (this.parent.isReact) {\n var renderReactTemplates = 'renderReactTemplates';\n tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property, '', null, null, cellElement);\n this.parent[renderReactTemplates]();\n }\n else {\n appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));\n }\n var value = single[summaryColumn.columnName][summaryKey];\n var summaryValue;\n if (cellElement.innerHTML.indexOf(value) === -1) {\n summaryValue = cellElement.innerHTML + value;\n return summaryValue;\n }\n else {\n return cellElement.innerHTML;\n }\n };\n Aggregate.prototype.getFormatFromType = function (summaryformat, type) {\n if (isNullOrUndefined(type) || typeof summaryformat !== 'string') {\n return summaryformat;\n }\n var obj;\n switch (type) {\n case 'number':\n obj = { format: summaryformat };\n break;\n case 'datetime':\n obj = { type: 'dateTime', skeleton: summaryformat };\n break;\n case 'date':\n obj = { type: type, skeleton: summaryformat };\n break;\n }\n return obj;\n };\n /**\n * To destroy the Aggregate module\n *\n * @returns {void}\n * @hidden\n */\n Aggregate.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Aggregate;\n}());\nexport { Aggregate };\n","import { isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { Sort as GridSort, Grid, getActualProperties } from '@syncfusion/ej2-grids';\nimport { getParentData } from '../utils';\n/**\n * Internal dataoperations for TreeGrid\n *\n * @hidden\n */\nvar Sort = /** @class */ (function () {\n function Sort(grid) {\n Grid.Inject(GridSort);\n this.parent = grid;\n this.taskIds = [];\n this.flatSortedData = [];\n this.storedIndex = -1;\n this.isSelfReference = !isNullOrUndefined(this.parent.parentIdMapping);\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Sort module name\n */\n Sort.prototype.getModuleName = function () {\n return 'sort';\n };\n /**\n * @hidden\n */\n Sort.prototype.addEventListener = function () {\n this.parent.on('updateModel', this.updateModel, this);\n this.parent.on('createSort', this.createdSortedRecords, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n Sort.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('updateModel', this.updateModel);\n this.parent.off('createSort', this.createdSortedRecords);\n };\n Sort.prototype.createdSortedRecords = function (sortParams) {\n var data = sortParams.modifiedData;\n var srtQry = sortParams.srtQry;\n this.iterateSort(data, srtQry);\n this.storedIndex = -1;\n sortParams.modifiedData = this.flatSortedData;\n this.flatSortedData = [];\n };\n Sort.prototype.iterateSort = function (data, srtQry) {\n for (var d = 0; d < data.length; d++) {\n if (this.parent.grid.filterSettings.columns.length > 0 || this.parent.grid.searchSettings.key !== '') {\n if (!isNullOrUndefined(getParentData(this.parent, data[d].uniqueID, true))) {\n this.storedIndex++;\n this.flatSortedData[this.storedIndex] = data[d];\n }\n }\n else {\n this.storedIndex++;\n this.flatSortedData[this.storedIndex] = data[d];\n }\n if (data[d].hasChildRecords) {\n var childSort = (new DataManager(data[d].childRecords).executeLocal(srtQry));\n this.iterateSort(childSort, srtQry);\n }\n }\n };\n /**\n * Sorts a column with the given options.\n *\n * @param {string} columnName - Defines the column name to be sorted.\n * @param {SortDirection} direction - Defines the direction of sorting field.\n * @param {boolean} isMultiSort - Specifies whether the previous sorted columns are to be maintained.\n * @returns {void}\n */\n Sort.prototype.sortColumn = function (columnName, direction, isMultiSort) {\n this.parent.grid.sortColumn(columnName, direction, isMultiSort);\n };\n Sort.prototype.removeSortColumn = function (field) {\n this.parent.grid.removeSortColumn(field);\n };\n /**\n * The function used to update sortSettings of TreeGrid.\n *\n * @returns {void}\n * @hidden\n */\n Sort.prototype.updateModel = function () {\n this.parent.setProperties({ sortSettings: getActualProperties(this.parent.grid.sortSettings) }, true);\n };\n /**\n * Clears all the sorted columns of the TreeGrid.\n *\n * @returns {void}\n */\n Sort.prototype.clearSorting = function () {\n this.parent.grid.clearSorting();\n this.updateModel();\n };\n /**\n * Destroys the Sorting of TreeGrid.\n *\n * @function destroy\n * @returns {void}\n */\n Sort.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Sort;\n}());\nexport { Sort };\n","import { Grid, ColumnMenu as GridColumnMenu } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid ColumnMenu module\n *\n * @hidden\n */\nvar ColumnMenu = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function ColumnMenu(parent) {\n Grid.Inject(GridColumnMenu);\n this.parent = parent;\n }\n ColumnMenu.prototype.getColumnMenu = function () {\n return this.parent.grid.columnMenuModule.getColumnMenu();\n };\n ColumnMenu.prototype.destroy = function () {\n //this.parent.grid.columnMenuModule.destroy();\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns ColumnMenu module name\n */\n ColumnMenu.prototype.getModuleName = function () {\n return 'columnMenu';\n };\n return ColumnMenu;\n}());\nexport { ColumnMenu };\n","import { Grid, ContextMenu as cmenu } from '@syncfusion/ej2-grids';\nimport { isNullOrUndefined, select } from '@syncfusion/ej2-base';\n/**\n * ContextMenu Module for TreeGrid\n *\n * @hidden\n */\nvar ContextMenu = /** @class */ (function () {\n function ContextMenu(parent) {\n Grid.Inject(cmenu);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * @hidden\n * @returns {void}\n */\n ContextMenu.prototype.addEventListener = function () {\n this.parent.on('contextMenuOpen', this.contextMenuOpen, this);\n this.parent.on('contextMenuClick', this.contextMenuClick, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n ContextMenu.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('contextMenuOpen', this.contextMenuOpen);\n this.parent.off('contextMenuClick', this.contextMenuClick);\n };\n ContextMenu.prototype.contextMenuOpen = function (args) {\n var addRow = select('#' + this.parent.element.id + '_gridcontrol_cmenu_AddRow', args.element);\n var editRecord = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Edit', args.element);\n if (addRow) {\n if (this.parent.grid.editSettings.allowAdding === false) {\n addRow.style.display = 'none';\n }\n else {\n addRow.style.display = 'block';\n }\n }\n if ((this.parent.editSettings.mode === 'Cell' || this.parent.editSettings.mode === 'Batch')\n && !(isNullOrUndefined(editRecord)) && !(editRecord.classList.contains('e-menu-hide'))) {\n editRecord.style.display = 'none';\n }\n };\n ContextMenu.prototype.contextMenuClick = function (args) {\n if (args.item.id === 'Above' || args.item.id === 'Below' || args.item.id === 'Child') {\n this.parent.notify('savePreviousRowPosition', args);\n this.parent.setProperties({ editSettings: { newRowPosition: args.item.id } }, true);\n this.parent.addRecord();\n }\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns ContextMenu module name\n */\n ContextMenu.prototype.getModuleName = function () {\n return 'contextMenu';\n };\n /**\n * Destroys the ContextMenu.\n *\n * @function destroy\n * @returns {void}\n */\n ContextMenu.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * Gets the context menu element from the TreeGrid.\n *\n * @returns {Element} Return Context Menu root element.\n */\n ContextMenu.prototype.getContextMenu = function () {\n return this.parent.grid.contextMenuModule.getContextMenu();\n };\n return ContextMenu;\n}());\nexport { ContextMenu };\n","import { isNullOrUndefined, extend, setValue, getValue, merge } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { findChildrenRecords, getParentData, extendArray } from '../utils';\nimport { getUid } from '@syncfusion/ej2-grids';\nimport { updateParentRow, editAction } from './crud-actions';\n/**\n * `BatchEdit` module is used to handle batch editing actions.\n *\n * @hidden\n */\nvar BatchEdit = /** @class */ (function () {\n function BatchEdit(parent) {\n this.batchChildCount = 0;\n this.addedRecords = 'addedRecords';\n this.deletedRecords = 'deletedRecords';\n this.batchAddedRecords = [];\n this.batchDeletedRecords = [];\n this.batchAddRowRecord = [];\n this.parent = parent;\n this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);\n this.batchRecords = [];\n this.currentViewRecords = [];\n this.isAdd = false;\n this.addEventListener();\n }\n BatchEdit.prototype.addEventListener = function () {\n this.parent.on(events.cellSaved, this.cellSaved, this);\n this.parent.on(events.batchAdd, this.batchAdd, this);\n this.parent.on(events.beforeBatchAdd, this.beforeBatchAdd, this);\n this.parent.on(events.batchSave, this.batchSave, this);\n this.parent.on(events.beforeBatchDelete, this.beforeBatchDelete, this);\n this.parent.on(events.beforeBatchSave, this.beforeBatchSave, this);\n this.parent.on('batchPageAction', this.batchPageAction, this);\n this.parent.on('batchCancelAction', this.batchCancelAction, this);\n this.parent.grid.on('immutable-batch-cancel', this.immutableBatchAction, this);\n this.parent.grid.on('next-cell-index', this.nextCellIndex, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n BatchEdit.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.cellSaved, this.cellSaved);\n this.parent.off(events.batchAdd, this.batchAdd);\n this.parent.off(events.batchSave, this.batchSave);\n this.parent.off(events.beforeBatchAdd, this.beforeBatchAdd);\n this.parent.off(events.beforeBatchDelete, this.beforeBatchDelete);\n this.parent.off(events.beforeBatchSave, this.beforeBatchSave);\n this.parent.off('batchPageAction', this.batchPageAction);\n this.parent.off('batchCancelAction', this.batchCancelAction);\n this.parent.grid.off('immutable-batch-cancel', this.immutableBatchAction);\n this.parent.grid.off('next-cell-index', this.nextCellIndex);\n };\n /**\n * To destroy the editModule\n *\n * @returns {void}\n * @hidden\n */\n BatchEdit.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {Object[]} Returns modified records in batch editing.\n */\n BatchEdit.prototype.getBatchRecords = function () {\n return this.batchRecords;\n };\n /**\n * @hidden\n * @returns {number} Returns index of newly add row\n */\n BatchEdit.prototype.getAddRowIndex = function () {\n return this.addRowIndex;\n };\n /**\n * @hidden\n * @returns {number} Returns selected row index\n */\n BatchEdit.prototype.getSelectedIndex = function () {\n return this.selectedIndex;\n };\n /**\n * @hidden\n * @returns {number} Returns newly added child count\n */\n BatchEdit.prototype.getBatchChildCount = function () {\n return this.batchChildCount;\n };\n BatchEdit.prototype.batchPageAction = function () {\n var data = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var index;\n if (!isNullOrUndefined(this.batchAddedRecords) && this.batchAddedRecords.length) {\n for (var i = 0; i < this.batchAddedRecords.length; i++) {\n index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);\n data.splice(index, 1);\n }\n }\n this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.batchDeletedRecords = this.currentViewRecords = [];\n };\n BatchEdit.prototype.cellSaved = function (args) {\n var actualCellIndex = args.cell.cellIndex;\n var frozenCols = this.parent.frozenColumns || this.parent.getFrozenColumns();\n if (frozenCols && args.columnObject.index > frozenCols) {\n actualCellIndex = actualCellIndex + frozenCols;\n }\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n var colCount = this.parent.getFrozenLeftColumnsCount() + actualCellIndex;\n if (colCount === this.parent.treeColumnIndex) {\n this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,\n column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)\n });\n }\n }\n else if (actualCellIndex === this.parent.treeColumnIndex) {\n this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,\n column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)\n });\n }\n if (this.isAdd && this.parent.editSettings.mode === 'Batch' && this.parent.editSettings.newRowPosition !== 'Bottom') {\n var data = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n var added = void 0;\n var level = 'level';\n var primaryKey_1 = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var currentDataIndex = void 0;\n var indexvalue = void 0;\n var parentItem = 'parentItem';\n var uniqueID = 'uniqueID';\n var parentRecord = this.selectedIndex > -1 ? this.batchRecords[this.addRowIndex][parentItem] : null;\n var idMapping = void 0;\n var parentUniqueID = void 0;\n var parentIdMapping = void 0;\n var rowObjectIndex = this.parent.editSettings.newRowPosition === 'Top' || this.selectedIndex === -1 ? 0 :\n this.parent.editSettings.newRowPosition === 'Above' ? this.addRowIndex\n : this.addRowIndex + 1;\n rowObjectIndex = this.getActualRowObjectIndex(rowObjectIndex);\n if (this.newBatchRowAdded) {\n if (this.batchRecords.length) {\n idMapping = this.batchRecords[this.addRowIndex][this.parent.idMapping];\n parentIdMapping = this.batchRecords[this.addRowIndex][this.parent.parentIdMapping];\n if (this.batchRecords[this.addRowIndex][parentItem]) {\n parentUniqueID = this.batchRecords[this.addRowIndex][parentItem][uniqueID];\n }\n }\n this.batchAddedRecords = extendArray(this.batchAddedRecords);\n this.batchAddRowRecord = extendArray(this.batchAddRowRecord);\n this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]);\n added = this.parent.grid.getRowsObject()[rowObjectIndex].changes;\n added.uniqueID = getUid(this.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + added.uniqueID, added, this.parent);\n if (!Object.prototype.hasOwnProperty.call(added, 'level')) {\n this.batchIndex = this.selectedIndex === -1 ? 0 : this.batchIndex;\n if (this.parent.editSettings.newRowPosition === 'Child') {\n added.primaryParent = parentRecord;\n if (this.selectedIndex > -1) {\n added.parentItem = extend({}, this.batchRecords[this.addRowIndex]);\n added.parentUniqueID = added.parentItem.uniqueID;\n delete added.parentItem.childRecords;\n delete added.parentItem[this.parent.childMapping];\n added.level = added.parentItem.level + 1;\n added.index = this.batchIndex;\n var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length;\n var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1];\n record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record;\n currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);\n if (this.isSelfReference) {\n added[this.parent.parentIdMapping] = idMapping;\n }\n updateParentRow(primaryKey_1, added.parentItem, 'add', this.parent, this.isSelfReference, added);\n }\n }\n else if ((this.parent.editSettings.newRowPosition === 'Above' || this.parent.editSettings.newRowPosition === 'Below')\n && !isNullOrUndefined(this.batchRecords[this.addRowIndex])) {\n added.level = this.batchRecords[this.addRowIndex][level];\n if (added.level && this.selectedIndex > -1) {\n added.parentItem = parentRecord;\n added.parentUniqueID = parentUniqueID;\n delete added.parentItem.childRecords;\n delete added.parentItem[this.parent.childMapping];\n }\n added.index = this.parent.editSettings.newRowPosition === 'Below' ? this.batchIndex : this.batchIndex - 1;\n if (this.parent.editSettings.newRowPosition === 'Below' && this.selectedIndex > -1) {\n var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length;\n var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1];\n record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record;\n currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);\n }\n if (this.parent.editSettings.newRowPosition === 'Above' && this.selectedIndex > -1) {\n var record = this.batchRecords[this.addRowIndex];\n currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);\n }\n if (this.isSelfReference) {\n added[this.parent.parentIdMapping] = parentIdMapping;\n }\n }\n added.index = added.index === -1 ? 0 : added.index;\n added.hasChildRecords = false;\n added.childRecords = [];\n this.batchRecords.splice(added.index, 0, added);\n this.currentViewRecords.splice(added.index, 0, added);\n if (currentDataIndex) {\n indexvalue = currentDataIndex;\n }\n else {\n indexvalue = added.index;\n }\n if (this.parent.editSettings.newRowPosition !== 'Above') {\n indexvalue = added.index === 0 ? indexvalue : indexvalue + 1;\n }\n data.splice(indexvalue, 0, added);\n this.batchAddedRecords.push(added);\n }\n this.parent.grid.getRowsObject()[rowObjectIndex].data = added;\n this.newBatchRowAdded = false;\n }\n if (this.parent.frozenColumns || this.parent.getFrozenColumns()\n && this.parent.grid.getRowsObject()[rowObjectIndex].edit === 'add') {\n merge(this.currentViewRecords[rowObjectIndex], this.parent.grid.getRowsObject()[rowObjectIndex].changes);\n }\n }\n };\n BatchEdit.prototype.beforeBatchAdd = function (e) {\n var isTabLastRow = 'isTabLastRow';\n if (this.parent.editSettings.mode === 'Cell' && this.parent.editModule[isTabLastRow]) {\n e.cancel = true;\n this.parent.editModule[isTabLastRow] = false;\n return;\n }\n this.selectedIndex = this.parent.grid.selectedRowIndex;\n this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;\n this.addRowRecord = this.parent.getSelectedRecords()[0];\n };\n BatchEdit.prototype.batchAdd = function (e) {\n if (this.parent.editSettings.newRowPosition !== 'Bottom') {\n this.isAdd = true;\n this.newBatchRowAdded = true;\n var actualIndex = 0;\n if (!this.batchRecords.length) {\n this.batchAddedRecords = [];\n this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n }\n if (this.parent.editSettings.newRowPosition !== 'Top') {\n var records = this.parent.grid.getCurrentViewRecords();\n if (this.parent.editSettings.mode === 'Batch' && (this.parent.getBatchChanges()[this.addedRecords].length > 1\n || this.parent.getBatchChanges()[this.deletedRecords].length)) {\n records = this.batchRecords;\n }\n this.updateChildCount(records);\n this.parent.notify(events.beginAdd, {});\n this.batchChildCount = 0;\n }\n this.updateRowIndex();\n // update focus module, need to refix this once grid source modified.\n var focusModule = getValue('focusModule', this.parent.grid);\n var table = this.parent.getContentTable();\n if (this.parent.getBatchChanges()[this.deletedRecords].length && this.parent.editSettings.newRowPosition === 'Above') {\n actualIndex = e.row.rowIndex;\n focusModule.getContent().matrix.matrix = this.matrix;\n }\n else {\n actualIndex = table.getElementsByClassName('e-batchrow')[0].rowIndex;\n // if (this.parent.frozenRows || this.parent.frozenColumns) {\n // actualIndex = this.batchIndex;\n // }\n }\n focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];\n }\n };\n BatchEdit.prototype.beforeBatchDelete = function (args) {\n if (!this.batchRecords.length) {\n this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n }\n var focusModule = getValue('focusModule', this.parent.grid);\n this.matrix = focusModule.getContent().matrix.matrix;\n var row = [];\n var records = [];\n var primarykey = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var data;\n var childs;\n var uid;\n if (!isNullOrUndefined(args.row) && this.parent.getSelectedRows().indexOf(args.row) === -1) {\n data = args.rowData;\n childs = findChildrenRecords(data);\n uid = args.row.getAttribute('data-uid');\n }\n else {\n data = this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length - 1];\n childs = findChildrenRecords(data);\n uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');\n }\n var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);\n if (childs.length) {\n var totalCount = parentRowIndex + childs.length;\n var firstChildIndex = parentRowIndex + 1;\n for (var i = firstChildIndex; i <= totalCount; i++) {\n row.push(this.parent.grid.getDataRows()[i]);\n if (this.parent.frozenRows || this.parent.frozenColumns || this.parent.getFrozenColumns()) {\n row.push(this.parent.grid.getMovableRows()[i]);\n }\n }\n }\n if (!isNullOrUndefined(data.parentItem)) {\n var parentItem = getParentData(this.parent, data.parentItem.uniqueID);\n if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {\n var childIndex = parentItem.childRecords.indexOf(data);\n parentItem.childRecords.splice(childIndex, 1);\n }\n this.batchDeletedRecords = extendArray(this.batchDeletedRecords);\n this.batchDeletedRecords.push(data);\n }\n childs.push(data);\n records = childs;\n for (var i = 0; i < records.length; i++) {\n var indexvalue = this.batchRecords.map(function (e) { return e[primarykey]; }).indexOf(records[i][primarykey]);\n if (indexvalue !== -1) {\n this.batchRecords.splice(indexvalue, 1);\n }\n }\n for (var i = 0; i < row.length; i++) {\n if (!isNullOrUndefined(row[i])) {\n this.parent.grid.selectionModule.selectedRecords.push(row[i]);\n }\n }\n };\n BatchEdit.prototype.updateRowIndex = function () {\n var rows = this.parent.grid.getDataRows();\n for (var i = 0; i < rows.length; i++) {\n rows[i].setAttribute('aria-rowindex', i.toString());\n }\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {\n var mRows = this.parent.grid.getMovableDataRows();\n var freezeRightRows = this.parent.grid.getFrozenRightDataRows();\n for (var i = 0; i < mRows.length; i++) {\n mRows[i].setAttribute('aria-rowindex', i.toString());\n if (freeze) {\n freezeRightRows[i].setAttribute('aria-rowindex', i.toString());\n }\n }\n }\n };\n BatchEdit.prototype.updateChildCount = function (records) {\n var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var addedRecords = 'addedRecords';\n var parentItem = this.parent.editSettings.newRowPosition === 'Child' ? 'primaryParent' : 'parentItem';\n for (var i = 0; i < this.parent.getBatchChanges()[addedRecords].length; i++) {\n if (!isNullOrUndefined(this.parent.getBatchChanges()[addedRecords][i][parentItem])) {\n if (this.parent.getBatchChanges()[addedRecords][i][parentItem][primaryKey] === records[this.addRowIndex][primaryKey]) {\n this.batchChildCount = this.batchChildCount + 1;\n }\n }\n }\n };\n BatchEdit.prototype.beforeBatchSave = function (e) {\n var changeRecords = 'changedRecords';\n var deleterecords = 'deletedRecords';\n var changedRecords = e.batchChanges[changeRecords];\n if (e.batchChanges[changeRecords].length) {\n var columnName = void 0;\n for (var i = 0; i < changedRecords.length; i++) {\n editAction({ value: changedRecords[i], action: 'edit' }, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, columnName);\n }\n }\n if (e.batchChanges[deleterecords].length) {\n var deletedRecords = e.batchChanges[deleterecords];\n var record = deletedRecords;\n for (var i = 0; i < record.length; i++) {\n this.deleteUniqueID(record[i].uniqueID);\n var childs = findChildrenRecords(record[i]);\n for (var c = 0; c < childs.length; c++) {\n this.deleteUniqueID(childs[c].uniqueID);\n }\n e.batchChanges[deleterecords] = e.batchChanges[deleterecords].concat(childs);\n }\n }\n this.isAdd = false;\n };\n BatchEdit.prototype.deleteUniqueID = function (value) {\n var idFilter = 'uniqueIDFilterCollection';\n delete this.parent[idFilter][value];\n var id = 'uniqueIDCollection';\n delete this.parent[id][value];\n };\n BatchEdit.prototype.batchCancelAction = function () {\n var targetElement = 'targetElement';\n var index;\n var parentItem = 'parentItem';\n var indexvalue = 'index';\n var currentViewRecords = this.parent.grid.getCurrentViewRecords();\n var childRecords = 'childRecords';\n var data = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];\n if (!isNullOrUndefined(this.batchAddedRecords)) {\n for (var i = 0; i < this.batchAddedRecords.length; i++) {\n index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);\n data.splice(index, 1);\n if (this.parent.editSettings.newRowPosition === 'Child') {\n index = currentViewRecords.map(function (e) { return e[primaryKey]; })\n .indexOf(this.batchAddedRecords[i][parentItem] ? this.batchAddedRecords[i][parentItem][primaryKey]\n : this.batchAddedRecords[i][primaryKey]);\n if (!isNullOrUndefined(currentViewRecords[index])) {\n var children = currentViewRecords[index][childRecords];\n for (var j = 0; children && j < children.length; j++) {\n if (children[j][primaryKey] === this.batchAddedRecords[i][primaryKey]) {\n currentViewRecords[index][childRecords].splice(j, 1);\n }\n }\n }\n }\n }\n }\n if (!isNullOrUndefined(this.parent[targetElement])) {\n var row = this.parent[targetElement].closest('tr');\n this.parent.collapseRow(row);\n this.parent[targetElement] = null;\n }\n if (!isNullOrUndefined(this.batchDeletedRecords)) {\n for (var i = 0; i < this.batchDeletedRecords.length; i++) {\n if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {\n index = currentViewRecords.map(function (e) { return e[primaryKey]; })\n .indexOf(this.batchDeletedRecords[i][parentItem][primaryKey]);\n var positionIndex = this.batchDeletedRecords[i][indexvalue] === 0 ? this.batchDeletedRecords[i][indexvalue] :\n this.batchDeletedRecords[i][indexvalue] - 1;\n if (!isNullOrUndefined(currentViewRecords[index])) {\n currentViewRecords[index][childRecords].splice(positionIndex, 0, this.batchDeletedRecords[i]);\n }\n }\n }\n }\n this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.currentViewRecords = [];\n this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n this.batchIndex = 0;\n this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n this.batchDeletedRecords = [];\n this.parent.grid.renderModule.refresh();\n };\n BatchEdit.prototype.batchSave = function (args) {\n if (this.parent.editSettings.mode === 'Batch') {\n var i = void 0;\n var batchChanges = Object.hasOwnProperty.call(args, 'updatedRecords') ? args.updatedRecords : this.parent.getBatchChanges();\n var deletedRecords = 'deletedRecords';\n var addedRecords = 'addedRecords';\n var index = 'index';\n var uniqueID = 'uniqueID';\n var data = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n var currentViewRecords = this.parent.grid.getCurrentViewRecords();\n var primarykey_1 = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var level = 'level';\n var addRecords = batchChanges[addedRecords];\n var parentItem = 'parentItem';\n var selectedIndex = void 0;\n var addRowIndex = void 0;\n var columnName = void 0;\n var addRowRecord = void 0;\n var childRecords = 'childRecords';\n if (addRecords.length > 1 && this.parent.editSettings.newRowPosition !== 'Bottom') {\n addRecords.reverse();\n }\n if (this.parent.editSettings.newRowPosition !== 'Bottom' && !Object.hasOwnProperty.call(args, 'updatedRecords')) {\n data.splice(data.length - addRecords.length, addRecords.length);\n if (!this.parent.allowPaging && data.length !== currentViewRecords.length) {\n if (currentViewRecords.length > addRecords.length) {\n currentViewRecords.splice(currentViewRecords.length - addRecords.length, addRecords.length);\n }\n }\n else {\n var totalRecords = extendArray(data);\n if (totalRecords.length) {\n var startIndex = totalRecords.map(function (e) { return e[primarykey_1]; })\n .indexOf(currentViewRecords[0][primarykey_1]);\n var endIndex = startIndex + this.parent.grid.pageSettings.pageSize;\n currentViewRecords = totalRecords.splice(startIndex, endIndex);\n }\n }\n }\n if (this.batchAddRowRecord.length === 0) {\n this.batchAddRowRecord.push(this.parent.flatData[args.index]);\n }\n for (i = 0; i < addRecords.length; i++) {\n var taskData = extend({}, addRecords[i]);\n delete taskData.parentItem;\n delete taskData.uniqueID;\n delete taskData.index;\n delete taskData.level;\n delete taskData.hasChildRecords;\n delete taskData.childRecords;\n delete taskData.parentUniqueID;\n if (!isNullOrUndefined(taskData.primaryParent)) {\n delete taskData.primaryParent;\n }\n addRecords[i].taskData = taskData;\n addRowRecord = this.batchAddRowRecord[i];\n if (isNullOrUndefined(addRowRecord)) {\n addRowRecord = this.batchAddRowRecord[i - 1];\n }\n if (this.isSelfReference) {\n if (!isNullOrUndefined(addRecords[i].parentItem)) {\n updateParentRow(primarykey_1, addRecords[i].parentItem, 'add', this.parent, this.isSelfReference, addRecords[i]);\n }\n }\n if (!isNullOrUndefined(addRowRecord)) {\n addRowIndex = addRowRecord.index;\n }\n if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {\n if (isNullOrUndefined(addRecords[i].parentItem) && this.selectedIndex === -1) {\n selectedIndex = -1;\n addRowRecord = null;\n }\n }\n editAction({ value: addRecords[i], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);\n selectedIndex = null;\n if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[i][parentItem])) {\n var indexValue = currentViewRecords.map(function (e) { return e[primarykey_1]; })\n .indexOf(addRecords[i][parentItem][primarykey_1]);\n var children = currentViewRecords[indexValue][childRecords];\n for (var j = 0; j < children.length; j++) {\n if (children[j][primarykey_1] === addRecords[i][primarykey_1]) {\n currentViewRecords[indexValue][childRecords].splice(j, 1);\n }\n }\n }\n }\n if (batchChanges[deletedRecords].length) {\n for (i = 0; i < batchChanges[deletedRecords].length; i++) {\n editAction({ value: batchChanges[deletedRecords][i], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);\n }\n }\n this.parent.parentData = [];\n for (var i_1 = 0; i_1 < data.length; i_1++) {\n data[i_1][index] = i_1;\n setValue('uniqueIDCollection.' + data[i_1][uniqueID] + '.index', i_1, this.parent);\n if (!data[i_1][level]) {\n this.parent.parentData.push(data[i_1]);\n }\n }\n }\n this.batchAddRowRecord = this.batchAddedRecords = this.batchRecords = this.batchDeletedRecords = this.currentViewRecords = [];\n };\n BatchEdit.prototype.getActualRowObjectIndex = function (index) {\n var rows = this.parent.grid.getDataRows();\n if ((this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child')\n && this.selectedIndex > -1) {\n if (!isNullOrUndefined(this.batchRecords[this.addRowIndex]) && this.batchRecords[this.addRowIndex].expanded) {\n if (this.parent.getBatchChanges()[this.addedRecords].length > 1\n || this.parent.getBatchChanges()[this.deletedRecords].length) {\n index += findChildrenRecords(this.batchRecords[this.addRowIndex]).length;\n if (this.parent.editSettings.newRowPosition !== 'Child') {\n var batchChildCount = this.getBatchChildCount();\n index = index + batchChildCount;\n }\n }\n else {\n index += findChildrenRecords(this.batchRecords[this.addRowIndex]).length;\n }\n }\n if (index >= rows.length) {\n index = rows.length - 1;\n }\n this.updateChildCount(this.parent.grid.getCurrentViewRecords());\n if (this.batchChildCount) {\n index += this.batchChildCount;\n }\n this.batchChildCount = 0;\n }\n return index;\n };\n BatchEdit.prototype.immutableBatchAction = function (e) {\n e.args.cancel = true;\n var changes = this.parent.grid.getBatchChanges();\n var addedRecords = [];\n var index = 'index';\n if (Object.keys(changes).length) {\n addedRecords = changes.addedRecords;\n }\n for (var i = 0; i < addedRecords.length; i++) {\n e.rows.splice(addedRecords[i][index], 1);\n }\n };\n BatchEdit.prototype.nextCellIndex = function (args) {\n var index = 'index';\n var rowIndex = 'rowIndex';\n args[index] = this.parent.getSelectedRows()[0][rowIndex];\n };\n return BatchEdit;\n}());\nexport { BatchEdit };\n","import { Grid, Edit as GridEdit, getUid, getObject, resetRowIndex } from '@syncfusion/ej2-grids';\nimport { parentsUntil } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { isNullOrUndefined, extend, setValue, removeClass, addClass, getValue } from '@syncfusion/ej2-base';\nimport { DataManager, RemoteSaveAdaptor } from '@syncfusion/ej2-data';\nimport { findChildrenRecords, getParentData, isCountRequired, isRemoteData } from '../utils';\nimport { editAction, updateParentRow } from './crud-actions';\nimport { BatchEdit } from './batch-edit';\n/**\n * TreeGrid Edit Module\n * The `Edit` module is used to handle editing actions.\n */\nvar Edit = /** @class */ (function () {\n /**\n * Constructor for Edit module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Edit(parent) {\n this.addedRecords = 'addedRecords';\n this.deletedRecords = 'deletedRecords';\n this.prevAriaRowIndex = '-1';\n this.isAddedRowByMethod = false;\n Grid.Inject(GridEdit);\n this.parent = parent;\n this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);\n this.previousNewRowPosition = null;\n this.internalProperties = {};\n this.batchEditModule = new BatchEdit(this.parent);\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Edit module name\n */\n Edit.prototype.getModuleName = function () {\n return 'edit';\n };\n /**\n * @hidden\n * @returns {void}\n */\n Edit.prototype.addEventListener = function () {\n this.parent.on(events.crudAction, this.crudAction, this);\n this.parent.on(events.beginEdit, this.beginEdit, this);\n this.parent.on(events.beginAdd, this.beginAdd, this);\n this.parent.on(events.recordDoubleClick, this.recordDoubleClick, this);\n this.parent.on(events.cellSave, this.cellSave, this);\n this.parent.on(events.batchCancel, this.batchCancel, this);\n this.parent.grid.on(events.keyPressed, this.keyPressed, this);\n this.parent.grid.on('batchedit-form', this.lastCellTab, this);\n this.parent.grid.on('content-ready', this.contentready, this);\n this.parent.on(events.cellEdit, this.cellEdit, this);\n this.parent.on('actionBegin', this.editActionEvents, this);\n this.parent.on('actionComplete', this.editActionEvents, this);\n this.parent.grid.on(events.doubleTap, this.recordDoubleClick, this);\n this.parent.grid.on('dblclick', this.gridDblClick, this);\n this.parent.grid.on('recordAdded', this.customCellSave, this);\n this.parent.on('savePreviousRowPosition', this.savePreviousRowPosition, this);\n // this.parent.on(events.beforeDataBound, this.beforeDataBound, this);\n this.parent.grid.on(events.beforeStartEdit, this.beforeStartEdit, this);\n this.parent.grid.on(events.beforeBatchCancel, this.beforeBatchCancel, this);\n this.parent.grid.on('reset-edit-props', this.resetIsOnBatch, this);\n this.parent.grid.on('get-row-position', this.getRowPosition, this);\n };\n Edit.prototype.gridDblClick = function (e) {\n this.doubleClickTarget = e.target;\n };\n Edit.prototype.getRowPosition = function (addArgs) {\n addArgs.newRowPosition = this.parent.editSettings.newRowPosition;\n addArgs.addRowIndex = this.addRowIndex;\n addArgs.ariaRowIndex = +this.prevAriaRowIndex;\n };\n Edit.prototype.beforeStartEdit = function (args) {\n this.parent.trigger(events.actionBegin, args);\n };\n Edit.prototype.beforeBatchCancel = function (args) {\n if (this.parent.editSettings.mode === 'Cell') {\n this.parent.trigger(events.actionComplete, args);\n }\n };\n /**\n * @hidden\n * @returns {void}\n */\n Edit.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.crudAction, this.crudAction);\n this.parent.off(events.beginEdit, this.beginEdit);\n this.parent.off(events.beginAdd, this.beginAdd);\n this.parent.off(events.recordDoubleClick, this.recordDoubleClick);\n this.parent.off(events.batchCancel, this.batchCancel);\n this.parent.grid.off(events.keyPressed, this.keyPressed);\n this.parent.grid.off('batchedit-form', this.lastCellTab);\n this.parent.grid.off('content-ready', this.contentready);\n this.parent.off(events.cellEdit, this.cellEdit);\n this.parent.off('actionBegin', this.editActionEvents);\n this.parent.off('actionComplete', this.editActionEvents);\n this.parent.grid.off('recordAdded', this.customCellSave);\n this.parent.grid.off(events.doubleTap, this.recordDoubleClick);\n this.parent.off('savePreviousRowPosition', this.savePreviousRowPosition);\n this.parent.grid.off(events.beforeStartEdit, this.beforeStartEdit);\n this.parent.grid.off(events.beforeBatchCancel, this.beforeBatchCancel);\n this.parent.grid.off('dblclick', this.gridDblClick);\n this.parent.grid.off('reset-edit-props', this.resetIsOnBatch);\n this.parent.grid.off('get-row-position', this.getRowPosition);\n //this.parent.grid.off('click', this.gridSingleClick);\n };\n /**\n * To destroy the editModule\n *\n * @returns {void}\n * @hidden\n */\n Edit.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @param {Column[]} cols - Column property Collection\n * @hidden\n * @returns {void}\n */\n Edit.prototype.applyFormValidation = function (cols) {\n this.parent.grid.editModule.applyFormValidation(cols);\n };\n Edit.prototype.editActionEvents = function (args) {\n var eventArgs = getObject('editAction', args);\n var eventName = getObject('name', eventArgs);\n var treeObj = this.parent;\n var adaptor = treeObj.dataSource.adaptor;\n if ((isRemoteData(treeObj) || adaptor instanceof RemoteSaveAdaptor) &&\n (eventArgs.requestType === 'save' && eventArgs.action === 'add') &&\n (treeObj.editSettings.newRowPosition === 'Child' || treeObj.editSettings.newRowPosition === 'Below'\n || treeObj.editSettings.newRowPosition === 'Above')) {\n if (eventName === 'actionBegin') {\n var rowIndex = isNullOrUndefined(eventArgs.row) || !Object.keys(eventArgs.row).length ? this.selectedIndex :\n eventArgs.row.rowIndex - 1;\n var keyData = (!isNullOrUndefined(rowIndex) && rowIndex !== -1) ?\n treeObj.getCurrentViewRecords()[rowIndex][treeObj.getPrimaryKeyFieldNames()[0]] : -1;\n treeObj.grid.query.addParams('relationalKey', keyData);\n }\n else if (eventName === 'actionComplete') {\n var paramsLength = treeObj.grid.query.params.length;\n for (var i = 0; i < paramsLength; i++) {\n if (treeObj.grid.query.params[i].key === 'relationalKey') {\n treeObj.grid.query.params.splice(i);\n }\n }\n }\n }\n if (this.parent.enableInfiniteScrolling && eventName === 'actionComplete') {\n this.infiniteAddAction(eventArgs);\n }\n if (this.parent.editSettings.mode === 'Batch' && eventArgs.requestType === 'paging') {\n this.parent.notify('batchPageAction', {});\n }\n };\n Edit.prototype.infiniteAddAction = function (args) {\n if ((args.requestType === 'save' && args.action === 'add') || args.requestType === 'delete') {\n if (this.parent.editSettings.newRowPosition !== 'Top' && this.selectedIndex !== -1\n && (args.requestType === 'save' && args.action === 'add')) {\n var rowObjects = this.parent.grid.getRowsObject();\n var newRowObject = rowObjects.splice(0, 1)[0];\n var newRowObjectIndex = this.addRowIndex;\n var currentData = this.parent.getCurrentViewRecords();\n if (this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {\n newRowObjectIndex += findChildrenRecords(currentData[newRowObjectIndex + 1]).length;\n }\n newRowObjectIndex = this.parent.editSettings.newRowPosition === 'Below' ? newRowObjectIndex + 1 : newRowObjectIndex;\n rowObjects.splice(newRowObjectIndex, 0, newRowObject);\n var newRecord = currentData.splice(0, 1)[0];\n currentData.splice(newRowObjectIndex, 0, newRecord);\n this.updateInfiniteCurrentViewData(newRecord, this.addRowIndex);\n }\n var movableRows = this.parent.grid.getMovableRows();\n var movableRowsObject = this.parent.grid.getMovableRowsObject();\n var isCache = this.parent.infiniteScrollSettings.enableCache;\n if (!isCache) {\n resetRowIndex(this.parent.grid, this.parent.grid.getRowsObject(), this.parent.grid.getRows(), 0);\n this.updateIndex(this.parent.grid.dataSource, this.parent.getRows(), this.parent.getCurrentViewRecords());\n }\n if (!isCache && this.parent.getFrozenColumns() > 0) {\n resetRowIndex(this.parent.grid, movableRowsObject, movableRows, 0);\n this.updateIndex(this.parent.grid.dataSource, movableRows, this.parent.getCurrentViewRecords());\n }\n }\n };\n Edit.prototype.updateInfiniteCurrentViewData = function (newRecord, newRowIndex) {\n var _this = this;\n var infiniteData = 'infiniteCurrentViewData';\n var updateCurrentViewData = 'updateCurrentViewData';\n var size = Math.ceil(newRowIndex / this.parent.grid.pageSettings.pageSize);\n var page = size > 0 ? size : 1;\n var dataIndex = newRowIndex - ((page - 1) * this.parent.pageSettings.pageSize);\n var infiniteCurrentViewData = this.parent.grid.infiniteScrollModule[infiniteData];\n infiniteCurrentViewData[1].splice(0, 1);\n var data = infiniteCurrentViewData[page];\n if (!isNullOrUndefined(this.addRowRecord)) {\n data.filter(function (e, index) {\n if (e.uniqueID === _this.addRowRecord.uniqueID) {\n dataIndex = index;\n }\n });\n if (this.addRowRecord.hasChildRecords && this.addRowRecord.childRecords.length &&\n this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {\n dataIndex += findChildrenRecords(this.addRowRecord).length;\n }\n }\n if (dataIndex >= this.parent.pageSettings.pageSize) {\n page += 1;\n data = infiniteCurrentViewData[page];\n dataIndex = dataIndex - this.parent.pageSettings.pageSize >= 0 ? dataIndex - this.parent.pageSettings.pageSize : 0;\n }\n dataIndex = this.parent.editSettings.newRowPosition === 'Below' ? dataIndex + 1 : dataIndex;\n data.splice(dataIndex, 0, newRecord);\n this.parent.grid.infiniteScrollModule[updateCurrentViewData]();\n };\n Edit.prototype.recordDoubleClick = function (args) {\n var target = args.target;\n if (isNullOrUndefined(target.closest('td.e-rowcell'))) {\n return;\n }\n if (!(this.parent.grid.editSettings.allowEditing) || this.parent.grid.isEdit) {\n return;\n }\n var column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('aria-colindex'));\n if (this.parent.editSettings.mode === 'Cell' && !this.isOnBatch && column && !column.isPrimaryKey &&\n this.parent.editSettings.allowEditing && column.allowEditing && !(target.classList.contains('e-treegridexpand') ||\n target.classList.contains('e-treegridcollapse')) && this.parent.editSettings.allowEditOnDblClick) {\n this.isOnBatch = true;\n this.parent.grid.setProperties({ selectedRowIndex: args.rowIndex }, true);\n if (this.parent.enableVirtualization) {\n var tr = parentsUntil(args.target, 'e-row');\n this.prevAriaRowIndex = tr.getAttribute('aria-rowindex');\n tr.setAttribute('aria-rowindex', tr.rowIndex + '');\n }\n this.updateGridEditMode('Batch');\n }\n };\n Edit.prototype.updateGridEditMode = function (mode) {\n this.parent.grid.setProperties({ editSettings: { mode: mode } }, true);\n var updateMethod = getObject('updateEditObj', this.parent.grid.editModule);\n updateMethod.apply(this.parent.grid.editModule);\n this.parent.grid.isEdit = false;\n };\n Edit.prototype.resetIsOnBatch = function () {\n if (this.parent.enableVirtualization && this.parent.editSettings.mode === 'Cell') {\n this.isOnBatch = false;\n this.updateGridEditMode('Normal');\n }\n };\n Edit.prototype.keyPressed = function (args) {\n if (this.isOnBatch) {\n this.keyPress = args.action;\n }\n if (args.action === 'f2') {\n this.recordDoubleClick(args);\n }\n if (args.action === 'escape') {\n this.parent.closeEdit();\n }\n };\n Edit.prototype.deleteUniqueID = function (value) {\n var idFilter = 'uniqueIDFilterCollection';\n delete this.parent[idFilter][value];\n var id = 'uniqueIDCollection';\n delete this.parent[id][value];\n };\n Edit.prototype.cellEdit = function (args) {\n var _this = this;\n var promise = 'promise';\n var prom = args[promise];\n delete args[promise];\n if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {\n args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);\n this.prevAriaRowIndex = undefined;\n }\n if (this.keyPress !== 'enter') {\n this.parent.trigger(events.cellEdit, args, function (celleditArgs) {\n if (!celleditArgs.cancel && _this.parent.editSettings.mode === 'Cell') {\n _this.enableToolbarItems('edit');\n }\n else if (celleditArgs.cancel && _this.parent.editSettings.mode === 'Cell') {\n _this.isOnBatch = false;\n _this.updateGridEditMode('Normal');\n }\n if (!isNullOrUndefined(prom)) {\n prom.resolve(celleditArgs);\n }\n });\n }\n if (this.doubleClickTarget && (this.doubleClickTarget.classList.contains('e-treegridexpand') ||\n this.doubleClickTarget.classList.contains('e-treegridcollapse') || this.doubleClickTarget.classList.contains('e-summarycell'))) {\n args.cancel = true;\n this.doubleClickTarget = null;\n return;\n }\n if (this.parent.editSettings.mode === 'Cell') {\n if (this.keyPress === 'tab' || this.keyPress === 'shiftTab') {\n this.keyPress = null;\n }\n else if (this.keyPress === 'enter') {\n args.cancel = true;\n this.keyPress = null;\n setValue('isEditCollapse', false, this.parent);\n }\n if (!args.columnObject.allowEditing) {\n args.cancel = true;\n }\n }\n // if (this.isAdd && this.parent.editSettings.mode === 'Batch' && !args.cell.parentElement.classList.contains('e-insertedrow')) {\n // this.isAdd = false;\n // }\n };\n Edit.prototype.enableToolbarItems = function (request) {\n if (!isNullOrUndefined(this.parent.grid.toolbarModule)) {\n var toolbarID = this.parent.element.id + '_gridcontrol_';\n this.parent.grid.toolbarModule.enableItems([toolbarID + 'add', toolbarID + 'edit', toolbarID + 'delete'], request === 'save');\n this.parent.grid.toolbarModule.enableItems([toolbarID + 'update', toolbarID + 'cancel'], request === 'edit');\n }\n };\n Edit.prototype.batchCancel = function () {\n if (this.parent.editSettings.mode === 'Cell') {\n var cellDetails = getValue('editModule.cellDetails', this.parent.grid.editModule);\n var treeCell = this.parent.getCellFromIndex(cellDetails.rowIndex, this.parent.treeColumnIndex);\n this.parent.renderModule.cellRender({\n data: cellDetails.rowData,\n cell: treeCell,\n column: this.parent.grid.getColumns()[this.parent.treeColumnIndex]\n });\n this.updateGridEditMode('Normal');\n this.isOnBatch = false;\n }\n if (this.parent.editSettings.mode === 'Batch') {\n this.parent.notify('batchCancelAction', {});\n }\n };\n Edit.prototype.customCellSave = function (args) {\n if (isCountRequired(this.parent) && this.parent.editSettings.mode === 'Cell' && args.action === 'edit') {\n this.updateCell(args, args.rowIndex);\n this.afterCellSave(args, args.row, args.rowIndex);\n }\n };\n Edit.prototype.cellSave = function (args) {\n var _this = this;\n if (this.parent.editSettings.mode === 'Cell' && this.parent.element.querySelector('form')) {\n args.cancel = true;\n var editModule = 'editModule';\n setValue('isEdit', false, this.parent.grid);\n setValue('isEditCollapse', true, this.parent);\n args.rowData[args.columnName] = args.value;\n var row_1;\n if (isNullOrUndefined(args.cell)) {\n row_1 = this.parent.grid.editModule[editModule].form.parentElement.parentNode;\n }\n else {\n row_1 = args.cell.parentNode;\n }\n var rowIndex_1;\n var primaryKeys_1 = this.parent.getPrimaryKeyFieldNames();\n if (isNullOrUndefined(row_1)) {\n this.parent.grid.getCurrentViewRecords().filter(function (e, i) {\n if (e[primaryKeys_1[0]] === args.rowData[primaryKeys_1[0]]) {\n rowIndex_1 = i;\n return;\n }\n });\n }\n else {\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n if (this.parent.getRows().indexOf(row_1) !== -1) {\n rowIndex_1 = this.parent.getRows().indexOf(row_1);\n }\n else if (this.parent.getFrozenRightRows().indexOf(row_1) !== -1) {\n rowIndex_1 = this.parent.getFrozenRightRows().indexOf(row_1);\n }\n else {\n rowIndex_1 = this.parent.getMovableRows().indexOf(row_1);\n }\n }\n else {\n rowIndex_1 = (this.parent.getRows().indexOf(row_1) === -1 && (this.parent.getFrozenColumns() > 0)) ?\n this.parent.grid.getMovableRows().indexOf(row_1) : this.parent.getRows().indexOf(row_1);\n }\n }\n var arg = {};\n extend(arg, args);\n arg.cancel = false;\n arg.type = 'save';\n row_1 = this.parent.grid.getRows()[row_1.rowIndex];\n this.parent.trigger(events.actionBegin, arg);\n if (!arg.cancel) {\n if ((row_1.rowIndex === this.parent.getCurrentViewRecords().length - 1) && this.keyPress === 'tab') {\n this.isTabLastRow = true;\n }\n if (!isRemoteData(this.parent) &&\n !(this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {\n if (isCountRequired(this.parent)) {\n var eventPromise = 'eventPromise';\n var editArgs = { requestType: 'save', data: args.rowData, action: 'edit', row: row_1,\n rowIndex: rowIndex_1, rowData: args.rowData, columnName: args.columnName,\n filterChoiceCount: null, excelSearchOperator: null };\n this.parent.grid.getDataModule()[eventPromise](editArgs, this.parent.grid.query);\n }\n else {\n this.updateCell(args, rowIndex_1);\n this.afterCellSave(args, row_1, rowIndex_1);\n }\n }\n else if (isRemoteData(this.parent) ||\n (this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {\n var query = this.parent.grid.query;\n var crud = null;\n crud = this.parent.grid.dataSource.update(primaryKeys_1[0], args.rowData, query.fromTable, query, args.previousValue);\n crud.then(function (e) {\n if (!isNullOrUndefined(e)) {\n args.rowData[args.columnName] = e[args.columnName];\n }\n _this.updateCell(args, rowIndex_1);\n _this.afterCellSave(args, row_1, rowIndex_1);\n });\n }\n }\n else {\n this.parent.grid.isEdit = true;\n }\n }\n };\n Edit.prototype.afterCellSave = function (args, row, rowIndex) {\n var mRow;\n if (this.parent.grid.aggregateModule) {\n this.parent.grid.aggregateModule.refresh(args.rowData);\n }\n this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(args.columnName)]);\n this.parent.grid.editModule.formObj.destroy();\n if (this.keyPress !== 'tab' && this.keyPress !== 'shiftTab') {\n this.updateGridEditMode('Normal');\n this.isOnBatch = false;\n }\n this.enableToolbarItems('save');\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n if (args.cell.closest('.e-frozen-left-header') || args.cell.closest('.e-frozen-left-content')) {\n mRow = this.parent.grid.getRows()[rowIndex];\n }\n else if (args.cell.closest('.e-movableheader') || args.cell.closest('.e-movablecontent')) {\n mRow = this.parent.grid.getMovableRows()[rowIndex];\n }\n else {\n mRow = this.parent.grid.getFrozenRightRows()[rowIndex];\n }\n removeClass([mRow], ['e-editedrow', 'e-batchrow']);\n removeClass(mRow.querySelectorAll('.e-rowcell'), ['e-editedbatchcell', 'e-updatedtd']);\n }\n else if (this.parent.getFrozenColumns() > 0) {\n if (args.cell.closest('.e-frozenheader') || args.cell.closest('.e-frozencontent')) {\n mRow = this.parent.grid.getRows()[rowIndex];\n }\n else {\n mRow = this.parent.grid.getMovableRows()[rowIndex];\n }\n removeClass([mRow], ['e-editedrow', 'e-batchrow']);\n removeClass(mRow.querySelectorAll('.e-rowcell'), ['e-editedbatchcell', 'e-updatedtd']);\n }\n removeClass([row], ['e-editedrow', 'e-batchrow']);\n removeClass(row.querySelectorAll('.e-rowcell'), ['e-editedbatchcell', 'e-updatedtd']);\n if (this.parent['isCellSaveFocus'] !== false) {\n this.parent.grid.focusModule.restoreFocus();\n }\n editAction({ value: args.rowData, action: 'edit' }, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, args.columnName);\n if ((row.rowIndex === this.parent.getCurrentViewRecords().length - 1) && this.keyPress === 'enter') {\n this.keyPress = null;\n }\n var saveArgs = {\n type: 'save', column: this.parent.getColumnByField(args.columnName), data: args.rowData,\n previousData: args.previousValue, row: row, target: args.cell\n };\n if (this.parent.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {\n this.parent.grid.refresh();\n }\n this.parent.trigger(events.actionComplete, saveArgs);\n };\n Edit.prototype.lastCellTab = function () {\n if (!this.parent.grid.isEdit && this.isOnBatch && this.keyPress === 'tab' && this.parent.editSettings.mode === 'Cell') {\n if (!this.parent.editSettings.allowNextRowEdit) {\n this.updateGridEditMode('Normal');\n this.isOnBatch = false;\n this.keyPress = null;\n }\n else {\n this.enableToolbarItems('edit');\n }\n }\n };\n Edit.prototype.updateCell = function (args, rowIndex) {\n this.parent.grid.editModule.updateCell(rowIndex, args.columnName, args.rowData[args.columnName]);\n this.parent.grid.getRowsObject()[rowIndex].data = args.rowData;\n };\n Edit.prototype.crudAction = function (details, columnName) {\n editAction(details, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, columnName, this.addRowRecord);\n this.parent.parentData = [];\n var data = this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource;\n for (var i = 0; i < data.length; i++) {\n data[i].index = i;\n var key = this.parent.grid.getPrimaryKeyFieldNames()[0];\n if (details.value[key] === data[i][key]) {\n if (details.action === 'add') {\n data[i].level = this.internalProperties.level;\n data[i].taskData = this.internalProperties.taskData;\n data[i].uniqueID = this.internalProperties.uniqueID;\n if (!isNullOrUndefined(this.internalProperties.parentItem)) {\n data[i].parentItem = this.internalProperties.parentItem;\n data[i].parentUniqueID = this.internalProperties.parentUniqueID;\n }\n data[i].childRecords = this.internalProperties.childRecords;\n }\n }\n setValue('uniqueIDCollection.' + data[i].uniqueID + '.index', i, this.parent);\n var adaptor = this.parent.dataSource.adaptor;\n if ((isRemoteData(this.parent) || adaptor instanceof RemoteSaveAdaptor)) {\n setValue('uniqueIDCollection.' + data[i].uniqueID, data[i], this.parent);\n }\n if (!data[i].level) {\n this.parent.parentData.push(data[i]);\n }\n }\n if (details.action === 'add' && this.previousNewRowPosition != null) {\n this.parent.setProperties({ editSettings: { newRowPosition: this.previousNewRowPosition } }, true);\n this.previousNewRowPosition = null;\n }\n };\n Edit.prototype.updateIndex = function (data, rows, records) {\n for (var j = 0; j < this.parent.getDataRows().length; j++) {\n var data1 = records[j];\n var index = getValue('uniqueIDCollection.' + data1.uniqueID + '.index', this.parent);\n data1.index = index;\n if (!isNullOrUndefined(data1.parentItem)) {\n var parentIndex = getValue('uniqueIDCollection.' + data1.parentItem.uniqueID + '.index', this.parent);\n data1.parentItem.index = parentIndex;\n }\n }\n var count = -1;\n var treeColIndex = this.parent.treeColumnIndex;\n if (this.parent.getFrozenColumns() > 0) {\n var cells = rows[0].querySelectorAll('.e-rowcell');\n for (var l = 0; l < cells.length; l++) {\n if (cells[l].classList.contains('e-gridrowindex0level0')) {\n treeColIndex = l;\n break;\n }\n }\n }\n for (var k = 0; k < this.parent.getRows().length; k++) {\n if (!rows[k].classList.contains('e-detailrow')) {\n count++;\n }\n var data2 = records[count];\n var index = data2.index;\n var level = data2.level;\n var row = rows[k];\n if (!isNullOrUndefined(data2.parentItem)) {\n index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);\n }\n var treecell = row.cells[treeColIndex];\n if (!isNullOrUndefined(treecell)) {\n for (var l = 0; l < treecell.classList.length; l++) {\n var value = treecell.classList[l];\n var remove = /e-gridrowindex/i;\n var removed = /e-griddetailrowindex/i;\n var result = value.match(remove);\n var results = value.match(removed);\n if (result != null) {\n removeClass([treecell], value);\n }\n if (results != null) {\n removeClass([treecell], value);\n }\n }\n if (!rows[k].classList.contains('e-detailrow')) {\n addClass([treecell], 'e-gridrowindex' + index + 'level' + level);\n }\n else {\n addClass([treecell], 'e-griddetailrowindex' + index + 'level' + level);\n }\n }\n }\n };\n Edit.prototype.beginAdd = function () {\n var position;\n var index = this.addRowIndex;\n var records = this.parent.grid.getCurrentViewRecords();\n if (this.parent.editSettings.mode === 'Batch') {\n index = this.batchEditModule.getAddRowIndex();\n this.selectedIndex = this.batchEditModule.getSelectedIndex();\n if (this.parent.getBatchChanges()[this.addedRecords].length > 1\n || this.parent.getBatchChanges()[this.deletedRecords].length) {\n records = this.batchEditModule.getBatchRecords();\n }\n }\n var rows = this.parent.grid.getDataRows();\n var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;\n var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;\n var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';\n if (this.parent.editSettings.mode !== 'Dialog') {\n if (this.parent.editSettings.newRowPosition === 'Above') {\n position = 'before';\n }\n else if ((this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child')\n && (this.selectedIndex > -1 || isVirtualization) && withinRange) {\n position = 'after';\n if (!isNullOrUndefined(records[index]) && records[index].expanded) {\n if (this.parent.editSettings.mode === 'Batch' && (this.parent.getBatchChanges()[this.addedRecords].length > 1\n || this.parent.getBatchChanges()[this.deletedRecords].length)) {\n index += findChildrenRecords(records[index]).length;\n if (this.parent.editSettings.newRowPosition !== 'Child') {\n var batchChildCount = this.batchEditModule.getBatchChildCount();\n index = index + batchChildCount;\n }\n }\n else {\n index += findChildrenRecords(records[index]).length;\n }\n }\n }\n if ((this.selectedIndex > -1 || isVirtualization) && withinRange\n && (index || (this.parent.editSettings.newRowPosition === 'Child'\n || this.parent.editSettings.newRowPosition === 'Below'))) {\n if (index >= rows.length - 1) {\n index = rows.length - 2;\n }\n var r = 'rows';\n var newRowObject = this.parent.grid.contentModule[r][0];\n var focussedElement = document.activeElement;\n rows[index + 1][position](rows[0]);\n setValue('batchIndex', index + 1, this.batchEditModule);\n var rowObjectIndex = this.parent.editSettings.newRowPosition === 'Above' ? index : index + 1;\n if (this.parent.editSettings.mode === 'Batch') {\n this.parent.grid.contentModule[r].splice(0, 1);\n this.parent.grid.contentModule[r].splice(rowObjectIndex, 0, newRowObject);\n }\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {\n var movableRows = this.parent.getMovableDataRows();\n var frows = 'freezeRows';\n var newFreezeRowObject = this.parent.grid.getRowsObject()[0];\n movableRows[index + 1][position](movableRows[0]);\n if (freeze) {\n var rightFrozenRows = this.parent.getFrozenRightDataRows();\n rightFrozenRows[index + 1][position](rightFrozenRows[0]);\n }\n if (this.parent.editSettings.mode === 'Batch') {\n this.parent.grid.contentModule[frows].splice(0, 1);\n this.parent.grid.contentModule[frows].splice(rowObjectIndex, 0, newFreezeRowObject);\n }\n setValue('batchIndex', index + 1, this.batchEditModule);\n }\n if (this.parent.editSettings.mode === 'Row' || this.parent.editSettings.mode === 'Cell') {\n var errors = this.parent.grid.getContentTable().querySelectorAll('.e-griderror');\n for (var i = 0; i < errors.length; i++) {\n errors[i].remove();\n }\n setValue('errorRules', [], this.parent.grid.editModule.formObj);\n }\n if (isVirtualization) {\n this.prevAriaRowIndex = '-1';\n }\n focussedElement.focus();\n }\n }\n };\n // private beforeDataBound(args: BeforeDataBoundArgs): void {\n // if (this.parent.grid.isEdit && this.parent.dataSource instanceof DataManager &&\n // this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor) {\n // let action: string = getValue('action', args);\n // let data: Object = getValue('data', args);\n // if (action === 'edit' && !isNullOrUndefined(this.editedData)) {\n // data = extend(this.editedData, data);\n // this.editedData = null;\n // }\n // if (!isNullOrUndefined(this.addedData)) {\n // let addedData: Object = args.result[args.result.length - 1];\n // addedData = extend(this.addedData, addedData);\n // this.addedData = null;\n // args.result.splice(this.addedIndex, 0, addedData);\n // args.result.splice(args.result.length, 1);\n // }\n // }\n // }\n Edit.prototype.beginEdit = function (args) {\n if (args.requestType === 'refresh' && this.isOnBatch) {\n args.cancel = true;\n return;\n }\n if (this.parent.editSettings.mode === 'Cell' && args.requestType === 'beginEdit') {\n args.cancel = true;\n return;\n }\n if (this.doubleClickTarget && (this.doubleClickTarget.classList.contains('e-treegridexpand') ||\n this.doubleClickTarget.classList.contains('e-treegridcollapse') || this.doubleClickTarget.classList.contains('e-frame'))) {\n args.cancel = true;\n this.doubleClickTarget = null;\n return;\n }\n if (args.requestType === 'delete') {\n var data_1 = args.data;\n if (isNullOrUndefined(args.data[0].uniqueID)) {\n var primaryKeys_2 = this.parent.getPrimaryKeyFieldNames();\n var _loop_1 = function (i) {\n this_1.parent.flatData.filter(function (e) {\n if (e[primaryKeys_2[0]] === args.data[i][primaryKeys_2[0]]) {\n data_1[i] = e;\n }\n });\n };\n var this_1 = this;\n for (var i = 0; i < data_1.length; i++) {\n _loop_1(i);\n }\n }\n for (var i = 0; i < data_1.length; i++) {\n this.deleteUniqueID(data_1[i].uniqueID);\n var childs = findChildrenRecords(data_1[i]);\n for (var c = 0; c < childs.length; c++) {\n this.deleteUniqueID(childs[c].uniqueID);\n }\n args.data = args.data.concat(childs);\n }\n }\n if (args.requestType === 'add' || (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling))) {\n if (!(this.parent.grid.selectedRowIndex === -1 && this.isAddedRowByMethod)\n && args.index === this.parent.grid.selectedRowIndex || args.index === 0) {\n this.selectedIndex = this.parent.grid.selectedRowIndex;\n }\n if (this.parent.enableVirtualization) {\n var selector = '.e-row[aria-rowindex=\"' + this.selectedIndex + '\"]';\n var row = void 0;\n if (this.selectedIndex > -1 && this.parent.editSettings.newRowPosition !== 'Top' &&\n this.parent.editSettings.newRowPosition !== 'Bottom') {\n this.prevAriaRowIndex = this.selectedIndex.toString();\n row = this.parent.getContent().querySelector(selector);\n this.addRowIndex = row ? row.rowIndex : 0;\n }\n else {\n if (this.prevAriaRowIndex && this.prevAriaRowIndex !== '-1') {\n selector = '.e-row[aria-rowindex=\"' + this.prevAriaRowIndex + '\"]';\n row = this.parent.getContent().querySelector(selector);\n this.addRowIndex = row ? row.rowIndex : 0;\n }\n else {\n this.addRowIndex = 0;\n }\n }\n }\n else {\n if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {\n this.addRowIndex = args.index;\n }\n else {\n this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;\n }\n }\n if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {\n this.addRowRecord = this.parent.flatData[args.index];\n }\n else {\n this.addRowRecord = this.parent.getSelectedRecords()[0];\n }\n }\n if (this.isAddedRowByMethod && args.index !== 0) {\n this.addRowRecord = this.parent.flatData[args.index];\n this.addRowIndex = args.index;\n }\n if (this.parent.editSettings.newRowPosition === 'Child' && isNullOrUndefined(this.addRowRecord)\n && !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {\n this.addRowRecord = this.parent.getSelectedRecords()[0];\n }\n this.isAddedRowByMethod = false;\n args = this.beginAddEdit(args);\n // if (args.requestType === 'save' &&\n // ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor))) {\n // if (args.action === 'edit') {\n // this.editedData = args.data;\n // } else if (args.action === 'add') {\n // this.addedData = value;\n // }\n // }\n };\n Edit.prototype.savePreviousRowPosition = function () {\n if (this.previousNewRowPosition === null) {\n this.previousNewRowPosition = this.parent.editSettings.newRowPosition;\n }\n };\n Edit.prototype.beginAddEdit = function (args) {\n var value = args.data;\n if (args.action === 'add') {\n var key = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var position = null;\n value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;\n var currentData = this.parent.grid.getCurrentViewRecords();\n if (this.parent.enableVirtualization && args.index !== 0) {\n this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);\n this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);\n }\n var index = this.addRowIndex;\n value.uniqueID = getUid(this.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + value.uniqueID, value, this.parent);\n var level = 0;\n var idMapping = void 0;\n var parentUniqueID = void 0;\n var parentItem = void 0;\n var parentIdMapping = void 0;\n var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';\n var rows = this.parent.getRows();\n var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;\n var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;\n if (currentData.length) {\n idMapping = currentData[this.addRowIndex][this.parent.idMapping];\n parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];\n if (currentData[this.addRowIndex].parentItem) {\n parentUniqueID = currentData[this.addRowIndex].parentItem.uniqueID;\n }\n parentItem = currentData[this.addRowIndex].parentItem;\n }\n if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length) {\n level = currentData[this.addRowIndex].level;\n if (this.parent.editSettings.newRowPosition === 'Above') {\n position = 'before';\n index = currentData[this.addRowIndex].index;\n }\n else if (this.parent.editSettings.newRowPosition === 'Below') {\n position = 'after';\n var childRecordCount = findChildrenRecords(currentData[this.addRowIndex]).length;\n var currentDataIndex = currentData[this.addRowIndex].index;\n index = (childRecordCount > 0) ? (currentDataIndex + childRecordCount) : (currentDataIndex);\n }\n else if (this.parent.editSettings.newRowPosition === 'Child') {\n position = 'after';\n if ((this.selectedIndex > -1 || isVirtualization) && withinRange) {\n value.parentItem = extend({}, currentData[this.addRowIndex]);\n value.parentUniqueID = value.parentItem.uniqueID;\n delete value.parentItem.childRecords;\n delete value.parentItem[this.parent.childMapping];\n }\n var childRecordCount1 = findChildrenRecords(currentData[this.addRowIndex]).length;\n var currentDataIndex1 = currentData[this.addRowIndex].index;\n if (this.selectedIndex >= 0) {\n value.level = level + 1;\n }\n index = (childRecordCount1 > 0) ? (currentDataIndex1 + childRecordCount1) : (currentDataIndex1);\n if (this.isSelfReference) {\n value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = idMapping;\n if (!isNullOrUndefined(value.parentItem)) {\n updateParentRow(key, value.parentItem, 'add', this.parent, this.isSelfReference, value);\n }\n }\n }\n if (this.parent.editSettings.newRowPosition === 'Above' || this.parent.editSettings.newRowPosition === 'Below') {\n if ((this.selectedIndex > -1 || isVirtualization) && level && withinRange) {\n value.parentUniqueID = parentUniqueID;\n value.parentItem = extend({}, parentItem);\n delete value.parentItem.childRecords;\n delete value.parentItem[this.parent.childMapping];\n }\n value.level = level;\n if (this.isSelfReference) {\n value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = parentIdMapping;\n if (!isNullOrUndefined(value.parentItem)) {\n updateParentRow(key, value.parentItem, 'add', this.parent, this.isSelfReference, value);\n }\n }\n }\n if (position != null && (this.selectedIndex > -1 || isVirtualization) && withinRange) {\n args.index = position === 'before' ? index : index + 1;\n }\n if (this.parent.editSettings.newRowPosition === 'Bottom') {\n var dataSource = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n args.index = dataSource.length;\n }\n }\n if (isNullOrUndefined(value.level)) {\n value.level = level;\n }\n value.hasChildRecords = false;\n value.childRecords = [];\n value.index = 0;\n }\n if (args.action === 'add') {\n this.internalProperties = { level: value.level, parentItem: value.parentItem, uniqueID: value.uniqueID,\n taskData: value.taskData, parentUniqueID: isNullOrUndefined(value.parentItem) ? undefined : value.parentItem.uniqueID,\n childRecords: value.childRecords };\n }\n if (args.requestType === 'delete') {\n var deletedValues = args.data;\n for (var i = 0; i < deletedValues.length; i++) {\n if (deletedValues[i].parentItem) {\n var parentItem = getParentData(this.parent, deletedValues[i].parentItem.uniqueID);\n if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {\n var childIndex = parentItem.childRecords.indexOf(deletedValues[i]);\n parentItem.childRecords.splice(childIndex, 1);\n }\n }\n }\n }\n return args;\n };\n /**\n * If the data,index and position given, Adds the record to treegrid rows otherwise it will create edit form.\n *\n * @returns {void}\n */\n Edit.prototype.addRecord = function (data, index, position) {\n if (this.parent.editSettings.newRowPosition === this.previousNewRowPosition || this.previousNewRowPosition === null) {\n this.previousNewRowPosition = this.parent.editSettings.newRowPosition;\n }\n if (!this.isSelfReference && !isNullOrUndefined(data) && Object.hasOwnProperty.call(data, this.parent.childMapping)) {\n var addRecords = [];\n var previousEditMode = this.parent.editSettings.mode;\n var previousGridEditMode = this.parent.grid.editSettings.mode;\n addRecords.push(data);\n this.parent.setProperties({ editSettings: { mode: 'Batch' } }, true);\n this.parent.grid.setProperties({ editSettings: { mode: 'Batch' } }, true);\n if (!isNullOrUndefined(position)) {\n this.parent.setProperties({ editSettings: { newRowPosition: position } }, true);\n }\n var updatedRecords = { addedRecords: addRecords, changedRecords: [], deletedRecords: [] };\n this.parent.notify(events.batchSave, { updatedRecords: updatedRecords, index: index });\n this.parent.setProperties({ editSettings: { mode: previousEditMode } }, true);\n this.parent.grid.setProperties({ editSettings: { mode: previousGridEditMode } }, true);\n this.parent.refresh();\n }\n else {\n if (data) {\n if (index > -1) {\n this.selectedIndex = index;\n this.addRowIndex = index;\n }\n else {\n this.selectedIndex = this.parent.selectedRowIndex;\n this.addRowIndex = this.parent.selectedRowIndex;\n }\n if (position) {\n this.parent.setProperties({ editSettings: { newRowPosition: position } }, true);\n }\n this.parent.grid.editModule.addRecord(data, index);\n }\n else {\n this.parent.grid.editModule.addRecord(data, index);\n }\n }\n };\n /**\n * Checks the status of validation at the time of editing. If validation is passed, it returns true.\n *\n * @returns {boolean} Returns form validation results\n */\n Edit.prototype.editFormValidate = function () {\n return this.parent.grid.editModule.editFormValidate();\n };\n /**\n * @hidden\n * @returns {void}\n */\n Edit.prototype.destroyForm = function () {\n this.parent.grid.editModule.destroyForm();\n };\n Edit.prototype.contentready = function (e) {\n if (!isNullOrUndefined(e.args.requestType)\n && (e.args.requestType.toString() === 'delete' || e.args.requestType.toString() === 'save'\n || (this.parent.editSettings.mode === 'Batch' && e.args.requestType.toString() === 'batchsave'))) {\n this.updateIndex(this.parent.grid.dataSource, this.parent.getRows(), this.parent.getCurrentViewRecords());\n if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns) {\n if (this.parent.grid.dataSource.length === this.parent.getMovableDataRows().length) {\n this.updateIndex(this.parent.grid.dataSource, this.parent.getMovableDataRows(), this.parent.getCurrentViewRecords());\n }\n }\n }\n };\n /**\n * If the row index and field is given, edits the particular cell in a row.\n *\n * @returns {void}\n */\n Edit.prototype.editCell = function (rowIndex, field) {\n if (this.parent.editSettings.mode === 'Cell' || this.parent.editSettings.mode === 'Batch') {\n if (this.parent.editSettings.mode !== 'Batch') {\n this.isOnBatch = true;\n this.updateGridEditMode('Batch');\n }\n this.parent.grid.editModule.editCell(rowIndex, field);\n }\n };\n return Edit;\n}());\nexport { Edit };\n","import { Grid, CommandColumn as Command } from '@syncfusion/ej2-grids';\n/**\n * Command Column Module for TreeGrid\n *\n * @hidden\n */\nvar CommandColumn = /** @class */ (function () {\n function CommandColumn(parent) {\n Grid.Inject(Command);\n this.parent = parent;\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns CommandColumn module name\n */\n CommandColumn.prototype.getModuleName = function () {\n return 'commandColumn';\n };\n /**\n * Destroys the ContextMenu.\n *\n * @function destroy\n * @returns {void}\n */\n CommandColumn.prototype.destroy = function () {\n //this.removeEventListener();\n };\n return CommandColumn;\n}());\nexport { CommandColumn };\n","import { Grid, getObject } from '@syncfusion/ej2-grids';\nimport { DetailRow as detailrow } from '@syncfusion/ej2-grids';\nimport { isNullOrUndefined, addClass } from '@syncfusion/ej2-base';\nimport { getExpandStatus, isRemoteData } from '../utils';\n/**\n * TreeGrid Detail Row module\n *\n * @hidden\n */\nvar DetailRow = /** @class */ (function () {\n function DetailRow(parent) {\n Grid.Inject(detailrow);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * @hidden\n */\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns DetailRow module name\n */\n DetailRow.prototype.getModuleName = function () {\n return 'detailRow';\n };\n DetailRow.prototype.addEventListener = function () {\n this.parent.on('dataBoundArg', this.dataBoundArg, this);\n this.parent.on('detaildataBound', this.detaildataBound, this);\n this.parent.grid.on('detail-indentcell-info', this.setIndentVisibility, this);\n this.parent.on('childRowExpand', this.childRowExpand, this);\n this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);\n this.parent.on('actioncomplete', this.actioncomplete, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n DetailRow.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('dataBoundArg', this.dataBoundArg);\n this.parent.off('detaildataBound', this.detaildataBound);\n this.parent.off('childRowExpand', this.childRowExpand);\n this.parent.off('rowExpandCollapse', this.rowExpandCollapse);\n this.parent.off('actioncomplete', this.actioncomplete);\n this.parent.grid.off('detail-indentcell-info', this.setIndentVisibility);\n };\n DetailRow.prototype.setIndentVisibility = function (args) {\n var visible = 'visible';\n args[visible] = false;\n };\n DetailRow.prototype.dataBoundArg = function () {\n var detailele = this.parent.getRows().filter(function (e) {\n return !e.classList.contains('e-detailrow');\n });\n for (var i = 0; i < detailele.length; i++) {\n var elements = detailele[i].getElementsByClassName('e-detailrowcollapse');\n var detailData = this.parent.grid.getRowObjectFromUID(detailele[i].getAttribute('data-Uid'));\n var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[i]);\n if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&\n getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {\n this.parent.grid.detailRowModule.expand(elements[0]);\n }\n }\n };\n DetailRow.prototype.childRowExpand = function (args) {\n var detailRowElement = args.row.getElementsByClassName('e-detailrowcollapse');\n if (!isNullOrUndefined(detailRowElement[0])) {\n this.parent.grid.detailRowModule.expand(detailRowElement[0]);\n }\n };\n DetailRow.prototype.rowExpandCollapse = function (args) {\n if (isRemoteData(this.parent)) {\n return;\n }\n for (var i = 0; i < args.detailrows.length; i++) {\n args.detailrows[i].style.display = args.action;\n }\n };\n DetailRow.prototype.detaildataBound = function (args) {\n var data = args.data;\n var row = args.detailElement.parentElement.previousSibling;\n var index = !isNullOrUndefined(data.parentItem) ? data.parentItem.index : data.index;\n var expandClass = 'e-gridrowindex' + index + 'level' + data.level;\n var classlist = row.querySelector('.' + expandClass).classList;\n var gridClas = [].slice.call(classlist).filter(function (gridclass) { return (gridclass === expandClass); });\n var newNo = gridClas[0].length;\n var slicedclas = gridClas.toString().slice(6, newNo);\n var detailClass = 'e-griddetail' + slicedclas;\n addClass([args.detailElement.parentElement], detailClass);\n };\n DetailRow.prototype.actioncomplete = function (args) {\n if (args.requestType === 'beginEdit' || args.requestType === 'add') {\n var spann = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));\n var colum = parseInt(spann, 10) - 1;\n var updtdcolum = colum.toString();\n args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', updtdcolum);\n }\n var focusElement = this.parent.grid.contentModule.getRows();\n for (var i = 0; i < focusElement.length; i++) {\n focusElement[i].cells[0].visible = false;\n }\n var focusModule = getObject('focusModule', this.parent.grid);\n var matrix = 'refreshMatrix';\n focusModule[matrix](true)({ rows: this.parent.grid.contentModule.getRows() });\n };\n /**\n * Destroys the DetailModule.\n *\n * @function destroy\n * @returns {void}\n */\n DetailRow.prototype.destroy = function () {\n this.removeEventListener();\n };\n return DetailRow;\n}());\nexport { DetailRow };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Cell, CellType } from '@syncfusion/ej2-grids';\nimport { VirtualContentRenderer } from '@syncfusion/ej2-grids';\nimport { InterSectionObserver } from '@syncfusion/ej2-grids';\nimport { TreeVirtualRowModelGenerator } from '../renderer/virtual-row-model-generator';\nimport * as events from '../base/constant';\nimport { isNullOrUndefined, EventHandler, getValue, setValue, Browser, debounce } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { isCountRequired } from '../utils';\nvar VirtualTreeContentRenderer = /** @class */ (function (_super) {\n __extends(VirtualTreeContentRenderer, _super);\n function VirtualTreeContentRenderer(parent, locator) {\n var _this = _super.call(this, parent, locator) || this;\n _this.isExpandCollapse = false;\n _this.translateY = 0;\n _this.maxiPage = 0;\n _this.recordAdded = false;\n /** @hidden */\n _this.startIndex = -1;\n _this.endIndex = -1;\n _this.preTranslate = 0;\n _this.isRemoteExpand = false;\n /** @hidden */\n _this.isDataSourceChanged = false;\n _this.addEventListener();\n return _this;\n }\n VirtualTreeContentRenderer.prototype.getModelGenerator = function () {\n return new TreeVirtualRowModelGenerator(this.parent);\n };\n VirtualTreeContentRenderer.prototype.getRowByIndex = function (index) {\n return this.parent.getDataRows().filter(function (e) { return parseInt(e.getAttribute('aria-rowindex'), 10) === index; })[0];\n };\n VirtualTreeContentRenderer.prototype.addEventListener = function () {\n this.parent.on(events.virtualActionArgs, this.virtualOtherAction, this);\n this.parent.on(events.indexModifier, this.indexModifier, this);\n };\n VirtualTreeContentRenderer.prototype.virtualOtherAction = function (args) {\n if (args.setTop) {\n this.translateY = 0;\n this.startIndex = 0;\n this.endIndex = this.parent.pageSettings.pageSize - 1;\n }\n else if (args.isExpandCollapse) {\n this.isExpandCollapse = true;\n }\n };\n VirtualTreeContentRenderer.prototype.indexModifier = function (args) {\n var content = this.parent.getContent().querySelector('.e-content');\n if (this.recordAdded && this.startIndex > -1 && this.endIndex > -1) {\n if (this.endIndex > args.count - this.parent.pageSettings.pageSize) {\n var nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());\n var lastIndex = nextSetResIndex + this.parent.getRows().length;\n if (lastIndex > args.count) {\n lastIndex = nextSetResIndex +\n (args.count - nextSetResIndex);\n }\n this.startIndex = lastIndex - this.parent.getRows().length;\n this.endIndex = lastIndex;\n }\n else {\n this.startIndex += 1;\n this.endIndex += 1;\n }\n this.recordAdded = false;\n }\n if (this.isDataSourceChanged) {\n this.startIndex = 0;\n this.endIndex = this.parent.pageSettings.pageSize - 1;\n }\n args.startIndex = this.startIndex;\n args.endIndex = this.endIndex;\n };\n VirtualTreeContentRenderer.prototype.eventListener = function (action) {\n var _this = this;\n if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {\n this.parent[action]('data-ready', this.onDataReady, this);\n this.parent[action]('refresh-virtual-block', this.refreshContentRows, this);\n this.fn = function () {\n _this.observers.observes(function (scrollArgs) { return _this.scrollListeners(scrollArgs); }, _this.onEnteredAction());\n _this.parent.off('content-ready', _this.fn);\n };\n this.parent.addEventListener('dataBound', this.dataBoundEvent.bind(this));\n this.parent.addEventListener('rowSelected', this.rowSelectedEvent.bind(this));\n this.parent[action]('select-virtual-Row', this.toSelectVirtualRow, this);\n this.parent.on('content-ready', this.fn, this);\n this.parent.addEventListener(events.actionComplete, this.onActionComplete.bind(this));\n this.parent[action]('virtual-scroll-edit-action-begin', this.beginEdit, this);\n this.parent[action]('virtual-scroll-add-action-begin', this.beginAdd, this);\n this.parent[action]('virtual-scroll-edit-success', this.virtualEditSuccess, this);\n this.parent[action]('edit-reset', this.resetIseditValue, this);\n this.parent[action]('get-virtual-data', this.getData, this);\n this.parent[action]('virtual-scroll-edit-cancel', this.cancelEdit, this);\n this.parent[action]('select-row-on-context-open', this.toSelectRowOnContextOpen, this);\n this.parent[action]('refresh-virtual-editform-cells', this.refreshCell, this);\n this.parent[action]('virtaul-cell-focus', this.cellFocus, this);\n }\n else {\n _super.prototype.eventListener.call(this, 'on');\n }\n };\n VirtualTreeContentRenderer.prototype.cellFocus = function (e) {\n var virtualCellFocus = 'virtualCellFocus';\n _super.prototype[virtualCellFocus].call(this, e);\n };\n VirtualTreeContentRenderer.prototype.onDataReady = function (e) {\n _super.prototype.onDataReady.call(this, e);\n if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {\n if (!isNullOrUndefined(e.count)) {\n this.totalRecords = e.count;\n if (!this.parent.enableColumnVirtualization) {\n getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');\n }\n }\n if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || this.isDataSourceChanged) {\n this.contents.scrollTop = 0;\n this.isDataSourceChanged = false;\n }\n }\n };\n VirtualTreeContentRenderer.prototype.renderTable = function () {\n _super.prototype.renderTable.call(this);\n if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {\n getValue('observer', this).options.debounceEvent = false;\n this.observers = new TreeInterSectionObserver(getValue('observer', this).element, getValue('observer', this).options);\n this.contents = this.getPanel().firstChild;\n }\n };\n VirtualTreeContentRenderer.prototype.getTranslateY = function (sTop, cHeight, info, isOnenter) {\n if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {\n if (this.isRemoteExpand) {\n this.isRemoteExpand = false;\n return this.preTranslate;\n }\n else {\n this.preTranslate = _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);\n return _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);\n }\n }\n else {\n return _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);\n }\n };\n VirtualTreeContentRenderer.prototype.dataBoundEvent = function () {\n var dataBoundEve = 'dataBound';\n var initialRowTop = 'initialRowTop';\n if (this.parent.getRows().length && !this[initialRowTop] && !isNullOrUndefined(this.parent.getRowByIndex(0))) {\n var rowTop = this.parent.getRowByIndex(0).getBoundingClientRect().top;\n var gridTop = this.parent.element.getBoundingClientRect().top;\n if (rowTop > 0) {\n this[initialRowTop] = this.parent.getRowByIndex(0).getBoundingClientRect().top - gridTop;\n }\n else {\n this[initialRowTop] = this.content.getBoundingClientRect().top -\n this.parent.getRowByIndex(0).getBoundingClientRect().height;\n }\n }\n _super.prototype[dataBoundEve].call(this);\n };\n VirtualTreeContentRenderer.prototype.rowSelectedEvent = function (args) {\n var rowSelected = 'rowSelected';\n _super.prototype[rowSelected].call(this, args);\n };\n VirtualTreeContentRenderer.prototype.toSelectVirtualRow = function (args) {\n if (this.parent.isEdit) {\n return;\n }\n var selectVirtualRow = 'selectVirtualRow';\n var containerRect = 'containerRect';\n if (isNullOrUndefined(this.observer[containerRect])) {\n this.observer[containerRect] = this.observers[containerRect];\n }\n if (isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule) || args.selectedIndex !== 0 ||\n isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {\n _super.prototype[selectVirtualRow].call(this, args);\n }\n };\n VirtualTreeContentRenderer.prototype.refreshCell = function (rowObj) {\n rowObj.cells = this.generateCells();\n };\n VirtualTreeContentRenderer.prototype.generateCells = function () {\n var cells = [];\n for (var i = 0; i < this.parent.columns.length; i++) {\n cells.push(this.generateCell(this.parent.columns[i]));\n }\n return cells;\n };\n VirtualTreeContentRenderer.prototype.generateCell = function (col, rowId, cellType, colSpan, oIndex, foreignKeyData) {\n var opt = {\n 'visible': col.visible,\n 'isDataCell': !isNullOrUndefined(col.field || col.template),\n 'isTemplate': !isNullOrUndefined(col.template),\n 'rowID': rowId,\n 'column': col,\n 'cellType': !isNullOrUndefined(cellType) ? cellType : CellType.Data,\n 'colSpan': colSpan,\n 'commands': col.commands,\n 'isForeignKey': col.isForeignColumn && col.isForeignColumn(),\n 'foreignKeyData': col.isForeignColumn && col.isForeignColumn() && getValue(col.field, foreignKeyData)\n };\n if (opt.isDataCell || opt.column.type === 'checkbox' || opt.commands) {\n opt.index = oIndex;\n }\n return new Cell(opt);\n };\n VirtualTreeContentRenderer.prototype.beginEdit = function (e) {\n var selector = '.e-row[aria-rowindex=\"' + e.index + '\"]';\n var index = this.parent.getContent().querySelector(selector).rowIndex;\n var rowData = this.parent.getCurrentViewRecords()[index];\n e.data = rowData;\n };\n VirtualTreeContentRenderer.prototype.beginAdd = function (args) {\n var addAction = 'addActionBegin';\n var isAdd = 'isAdd';\n var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, ariaRowIndex: this.ariaRowIndex };\n this.parent.notify('get-row-position', addArgs);\n this.rowPosition = addArgs.newRowPosition;\n this.addRowIndex = addArgs.addRowIndex;\n this.ariaRowIndex = addArgs.ariaRowIndex;\n var rows = this.parent.getRows();\n var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;\n var withInRange = this.parent.selectedRowIndex >= firstAriaIndex && this.parent.selectedRowIndex <= lastAriaIndex;\n if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {\n this[isAdd] = true;\n }\n if (this.rowPosition === 'Top' || this.rowPosition === 'Bottom' ||\n ((!this.addRowIndex || this.addRowIndex === -1) && (this.parent.selectedRowIndex === -1 || !withInRange))) {\n _super.prototype[addAction].call(this, args);\n }\n };\n VirtualTreeContentRenderer.prototype.restoreEditState = function () {\n var restoreEdit = 'restoreEdit';\n _super.prototype[restoreEdit].call(this);\n };\n VirtualTreeContentRenderer.prototype.resetIseditValue = function () {\n var resetIsEdit = 'resetIsedit';\n var isAdd = 'isAdd';\n this.parent.notify('reset-edit-props', {});\n if ((this.rowPosition === 'Top' || this.rowPosition === 'Bottom') && this[isAdd]) {\n _super.prototype[resetIsEdit].call(this);\n }\n };\n VirtualTreeContentRenderer.prototype.virtualEditSuccess = function () {\n var isAdd = 'isAdd';\n var content = this.parent.getContent().querySelector('.e-content');\n if (this[isAdd] && content.querySelector('.e-addedrow')) {\n this.recordAdded = true;\n }\n };\n VirtualTreeContentRenderer.prototype.cancelEdit = function (args) {\n var editCancel = 'editCancel';\n _super.prototype[editCancel].call(this, args);\n };\n VirtualTreeContentRenderer.prototype.toSelectRowOnContextOpen = function (args) {\n var selectRowOnContextOpen = 'selectRowOnContextOpen';\n _super.prototype[selectRowOnContextOpen].call(this, args);\n };\n VirtualTreeContentRenderer.prototype.restoreNewRow = function () {\n var isAdd = 'isAdd';\n var content = this.parent.getContent().querySelector('.e-content');\n if (this[isAdd] && !content.querySelector('.e-addedrow')) {\n this.parent.isEdit = false;\n this.parent.addRecord();\n }\n };\n VirtualTreeContentRenderer.prototype.getData = function (data) {\n var getVirtualData = 'getVirtualData';\n _super.prototype[getVirtualData].call(this, data);\n };\n VirtualTreeContentRenderer.prototype.onActionComplete = function (args) {\n if (args.requestType === 'add') {\n var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, ariaRowIndex: this.ariaRowIndex };\n this.parent.notify('get-row-position', addArgs);\n this.rowPosition = addArgs.newRowPosition;\n this.addRowIndex = addArgs.addRowIndex;\n this.ariaRowIndex = addArgs.ariaRowIndex;\n }\n var actionComplete = 'actionComplete';\n _super.prototype[actionComplete].call(this, args);\n };\n VirtualTreeContentRenderer.prototype.onEnteredAction = function () {\n var _this = this;\n return function (element, current, direction, e, isWheel, check) {\n var directVirtualRender = 'directVirtualRender';\n if (!_this.parent[directVirtualRender]) { // with this property, columns are rendered without debouncing on horizontal scroll.\n var preventEvent = 'preventEvent';\n if (Browser.isIE && !isWheel && check && !_this[preventEvent]) {\n _this.parent.showSpinner();\n }\n var xAxis = current.axis === 'X';\n var x = _this.getColumnOffset(xAxis ? _this.vgenerator.getColumnIndexes()[0] - 1 : _this.prevInfo.columnIndexes[0]\n - 1);\n if (xAxis) {\n var idx = Object.keys(_this.vgenerator.cOffsets).length - _this.prevInfo.columnIndexes.length;\n var maxLeft = _this.vgenerator.cOffsets[idx - 1];\n x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.\n }\n _this.virtualEle.adjustTable(x, _this.translateY);\n if (_this.parent.enableColumnVirtualization) {\n _this.header.virtualEle.adjustTable(x, 0);\n }\n }\n };\n };\n VirtualTreeContentRenderer.prototype.scrollListeners = function (scrollArgs) {\n var info = scrollArgs.sentinel;\n var outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);\n var content = this.parent.getContent().querySelector('.e-content');\n var scrollHeight = outBuffer * this.parent.getRowHeight();\n var upScroll = (scrollArgs.offset.top - this.translateY) < 0;\n var downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) >= scrollHeight;\n var selectedRowIndex = 'selectedRowIndex';\n if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {\n var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :\n this.parent.element.getBoundingClientRect().height);\n var index = (~~(content.scrollTop / this.parent.getRowHeight())\n + Math.ceil(vHeight / this.parent.getRowHeight()))\n - this.parent.pageSettings.pageSize;\n index = (index > 0) ? index : 0;\n if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 && index !== this[selectedRowIndex]) {\n index = this[selectedRowIndex];\n }\n this.startIndex = index;\n this.endIndex = index + this.parent.pageSettings.pageSize;\n if (this.endIndex > this.totalRecords) {\n var lastInx = this.totalRecords - 1;\n var remains = this.endIndex % lastInx;\n this.endIndex = lastInx;\n this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);\n }\n //var firsttdinx = parseInt(this.parent.getContent().querySelector('.e-content td').getAttribute('index'), 0);\n var rowPt = Math.ceil(scrollArgs.offset.top / this.parent.getRowHeight());\n rowPt = rowPt % this.parent.pageSettings.pageSize;\n var firsttdinx = 0;\n if (!isNullOrUndefined(this.parent.getRows()[rowPt]) &&\n !isNullOrUndefined(this.parent.getContent().querySelectorAll('.e-content tr')[rowPt])) {\n var attr = this.parent.getContent().querySelectorAll('.e-content tr')[rowPt]\n .querySelector('td').getAttribute('index');\n firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('aria-rowindex');\n }\n if (firsttdinx === 0) {\n this.translateY = scrollArgs.offset.top;\n }\n else {\n var height = this.parent.getRowHeight();\n this.translateY = (scrollArgs.offset.top - (outBuffer * height) > 0) ?\n scrollArgs.offset.top - (outBuffer * height) + 10 : 0;\n }\n }\n else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {\n var nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());\n var isLastBlock = (this[selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;\n if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 &&\n nextSetResIndex !== this[selectedRowIndex] && !isLastBlock) {\n nextSetResIndex = this[selectedRowIndex];\n }\n var lastIndex = nextSetResIndex + this.parent.pageSettings.pageSize;\n if (lastIndex > this.totalRecords) {\n lastIndex = nextSetResIndex +\n (this.totalRecords - nextSetResIndex);\n }\n this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;\n this.endIndex = lastIndex;\n if (scrollArgs.offset.top > (this.parent.getRowHeight() * this.totalRecords)) {\n this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);\n }\n else {\n this.translateY = scrollArgs.offset.top;\n }\n }\n if (((downScroll && (scrollArgs.offset.top < (this.parent.getRowHeight() * this.totalRecords)))\n || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left')) {\n var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);\n this.previousInfo = viewInfo;\n this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);\n var page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;\n this.parent.setProperties({ pageSettings: { currentPage: page } }, true);\n if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {\n viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;\n }\n this.parent.notify(viewInfo.event, { requestType: 'virtualscroll', virtualInfo: viewInfo, focusElement: scrollArgs.focusElement });\n }\n };\n VirtualTreeContentRenderer.prototype.appendContent = function (target, newChild, e) {\n if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {\n if (getValue('isExpandCollapse', e)) {\n this.isRemoteExpand = true;\n }\n _super.prototype.appendContent.call(this, target, newChild, e);\n }\n else {\n var info = e.virtualInfo.sentinelInfo && e.virtualInfo.sentinelInfo.axis === 'Y' &&\n getValue('currentInfo', this).page && getValue('currentInfo', this).page !== e.virtualInfo.page ?\n getValue('currentInfo', this) : e.virtualInfo;\n var cBlock = (info.columnIndexes[0]) - 1;\n var cOffset = this.getColumnOffset(cBlock);\n var width = void 0;\n if (this.parent.enableColumnVirtualization) {\n this.header.virtualEle.adjustTable(cOffset, 0);\n var cIndex = info.columnIndexes;\n width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';\n this.header.virtualEle.setWrapperWidth(width);\n }\n this.virtualEle.setWrapperWidth(width, (Browser.isIE || Browser.info.name === 'edge'));\n target = this.parent.createElement('tbody');\n target.appendChild(newChild);\n var replace = 'replaceWith';\n this.getTable().querySelector('tbody')[replace](target);\n if (!this.isExpandCollapse || this.translateY === 0) {\n this.translateY = this.translateY < 0 ? 0 : this.translateY;\n getValue('virtualEle', this).adjustTable(cOffset, this.translateY);\n }\n else {\n this.isExpandCollapse = false;\n }\n setValue('prevInfo', this.previousInfo ? this.previousInfo : info, this);\n if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'X') {\n this.parent.notify(events.autoCol, {});\n }\n var focusCell = 'focusCell';\n var restoreAdd = 'restoreAdd';\n var ensureSelectedRowPosition = 'ensureSelectedRowPosition';\n _super.prototype[focusCell].call(this, e);\n var isAdd = 'isAdd';\n if (this[isAdd] && !this.parent.getContent().querySelector('.e-content').querySelector('.e-addedrow')) {\n if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {\n if (this.ariaRowIndex >= this.startIndex) {\n this.restoreNewRow();\n }\n else if (this.addRowIndex && this.addRowIndex > -1) {\n this[isAdd] = false;\n this.parent.isEdit = false;\n }\n }\n }\n this.restoreEditState();\n _super.prototype[restoreAdd].call(this);\n _super.prototype[ensureSelectedRowPosition].call(this);\n }\n };\n VirtualTreeContentRenderer.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('data-ready', this.onDataReady);\n this.parent.off('content-ready', this.fn);\n this.parent.off('select-virtual-Row', this.toSelectVirtualRow);\n this.parent.off('dataBound', this.dataBoundEvent);\n this.parent.off('rowSelected', this.rowSelectedEvent);\n this.parent.off(events.virtualActionArgs, this.virtualOtherAction);\n this.parent.off(events.indexModifier, this.indexModifier);\n this.parent.off('virtual-scroll-edit-action-begin', this.beginEdit);\n this.parent.off('virtual-scroll-add-action-begin', this.beginAdd);\n this.parent.off('virtual-scroll-edit-success', this.virtualEditSuccess);\n this.parent.off('edit-reset', this.resetIseditValue);\n this.parent.off('get-virtual-data', this.getData);\n this.parent.off('virtual-scroll-edit-cancel', this.cancelEdit);\n this.parent.off('select-row-on-context-open', this.toSelectRowOnContextOpen);\n this.parent.off('refresh-virtual-editform-cells', this.refreshCell);\n this.parent.off('virtaul-cell-focus', this.cellFocus);\n };\n return VirtualTreeContentRenderer;\n}(VirtualContentRenderer));\nexport { VirtualTreeContentRenderer };\nvar TreeInterSectionObserver = /** @class */ (function (_super) {\n __extends(TreeInterSectionObserver, _super);\n function TreeInterSectionObserver() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isWheeling = false;\n _this.newPos = 0;\n _this.lastPos = 0;\n _this.timer = 0;\n return _this;\n }\n TreeInterSectionObserver.prototype.observes = function (callback, onEnterCallback) {\n var containerRect = 'containerRect';\n _super.prototype[containerRect] = getValue('options', this).container.getBoundingClientRect();\n EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);\n };\n TreeInterSectionObserver.prototype.clear = function () {\n this.lastPos = null;\n };\n TreeInterSectionObserver.prototype.virtualScrollHandlers = function (callback, onEnterCallback) {\n var _this = this;\n var delay = Browser.info.name === 'chrome' ? 200 : 100;\n var options = 'options';\n var movableEle = 'movableEle';\n var element = 'element';\n var fromWheel = 'fromWheel';\n var debounced100 = debounce(callback, delay);\n var debounced50 = debounce(callback, 50);\n this[options].prevTop = this[options].prevLeft = 0;\n return function (e) {\n var top = _this[options].movableContainer ? _this[options].container.scrollTop : e.target.scrollTop;\n var left = _this[options].movableContainer ? _this[options].scrollbar.scrollLeft : e.target.scrollLeft;\n var direction = _this[options].prevTop < top ? 'down' : 'up';\n direction = _this[options].prevLeft === left ? direction : _this[options].prevLeft < left ? 'right' : 'left';\n _this[options].prevTop = top;\n _this[options].prevLeft = left;\n var current = _this.sentinelInfo[direction];\n var delta = 0;\n _this.newPos = top;\n if (_this.lastPos != null) { // && newPos < maxScroll\n delta = _this.newPos - _this.lastPos;\n }\n _this.lastPos = _this.newPos;\n if (_this.timer) {\n clearTimeout(_this.timer);\n }\n _this.timer = setTimeout(_this.clear, 0);\n if ((delta > 100 || delta < -100) && (e && e.preventDefault)) {\n e.returnValue = false;\n e.preventDefault();\n }\n if (_this[options].axes.indexOf(current.axis) === -1) {\n return;\n }\n var check = _this.check(direction);\n if (current.entered && current.axis === 'X') {\n if (_this[movableEle] && (direction === 'right' || direction === 'left')) {\n onEnterCallback(_this[movableEle], current, direction, { top: top, left: left }, _this[fromWheel], check);\n }\n else {\n onEnterCallback(_this[element], current, direction, { top: top, left: left }, _this[fromWheel], check);\n }\n }\n if (check) {\n var fn = debounced100;\n if (current.axis === 'X') {\n fn = debounced50;\n fn({ direction: direction, sentinel: current, offset: { top: top, left: left },\n focusElement: document.activeElement });\n }\n else {\n callback({ direction: direction, sentinel: current, offset: { top: top, left: left },\n focusElement: document.activeElement });\n }\n }\n _this[fromWheel] = false;\n };\n };\n return TreeInterSectionObserver;\n}(InterSectionObserver));\nexport { TreeInterSectionObserver };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Grid, VirtualScroll as GridVirtualScroll } from '@syncfusion/ej2-grids';\nimport { RenderType } from '@syncfusion/ej2-grids';\nimport { getValue, isNullOrUndefined } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport { DataManager, Predicate, Query } from '@syncfusion/ej2-data';\nimport { getExpandStatus } from '../utils';\nimport { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';\nimport { VirtualHeaderRenderer } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid Virtual Scroll module will handle Virtualization\n *\n * @hidden\n */\nvar VirtualScroll = /** @class */ (function () {\n /**\n * Constructor for VirtualScroll module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function VirtualScroll(parent) {\n this.prevstartIndex = -1;\n this.prevendIndex = -1;\n this.parent = parent;\n Grid.Inject(TreeVirtual);\n this.addEventListener();\n }\n VirtualScroll.prototype.returnVisualData = function (args) {\n args.data = this.visualData;\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} - Returns VirtualScroll module name\n */\n VirtualScroll.prototype.getModuleName = function () {\n return 'virtualScroll';\n };\n /**\n * @hidden\n * @returns {void}\n */\n VirtualScroll.prototype.addEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.on(events.localPagedExpandCollapse, this.collapseExpandVirtualchilds, this);\n this.parent.on(events.pagingActions, this.virtualPageAction, this);\n this.parent.on(events.destroy, this.destroy, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n VirtualScroll.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.localPagedExpandCollapse, this.collapseExpandVirtualchilds);\n this.parent.off(events.pagingActions, this.virtualPageAction);\n this.parent.off(events.destroy, this.destroy);\n };\n VirtualScroll.prototype.collapseExpandVirtualchilds = function (row) {\n this.parent.grid.notify(events.virtualActionArgs, { isExpandCollapse: true });\n this.expandCollapseRec = row.record;\n row.record.expanded = row.action === 'collapse' ? false : true;\n var ret = {\n result: this.parent.flatData,\n row: row.row,\n action: row.action,\n record: row.record,\n count: this.parent.flatData.length\n };\n if (this.parent.enableVirtualization && this.parent.selectionSettings.mode === 'Cell' ||\n this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {\n this.parent.grid.clearSelection();\n }\n var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';\n getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });\n };\n VirtualScroll.prototype.virtualPageAction = function (pageingDetails) {\n var _this = this;\n var dm = new DataManager(pageingDetails.result);\n var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);\n var parents = dm.executeLocal(new Query().where(expanded));\n var visualData = parents.filter(function (e) {\n return getExpandStatus(_this.parent, e, parents);\n });\n this.visualData = visualData;\n this.parent.grid.notify(events.dataListener, { data: visualData });\n var counts = { startIndex: -1, endIndex: -1, count: pageingDetails.count };\n this.parent.grid.notify(events.indexModifier, counts);\n var startIndex = counts.startIndex;\n var endIndex = counts.endIndex;\n pageingDetails.count = visualData.length;\n if (startIndex === -1 && endIndex === -1) {\n var query = new Query();\n var size = this.parent.grid.pageSettings.pageSize;\n var current = this.parent.grid.pageSettings.currentPage;\n var skip = size * (current - 1);\n query = query.skip(skip).take(size);\n dm.dataSource.json = visualData;\n pageingDetails.result = dm.executeLocal(query);\n }\n else {\n var requestType = pageingDetails.actionArgs.requestType;\n if (requestType === 'filtering' || requestType === 'collapseAll' ||\n (requestType === 'refresh' && this.parent.enableCollapseAll && endIndex > visualData.length)) {\n startIndex = 0;\n endIndex = this.parent.grid.pageSettings.pageSize - 1;\n this.parent.grid.getContent().firstElementChild.scrollTop = 0;\n this.parent.grid.notify(events.virtualActionArgs, { setTop: true });\n }\n //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&\n //this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {\n if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||\n (pageingDetails.actionArgs.requestType === 'refresh' && startIndex !== this.prevstartIndex)) &&\n (startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length)) {\n startIndex = 0;\n }\n if (!isNullOrUndefined(this.expandCollapseRec)) {\n var resourceCount = this.parent.getRows();\n var sIndex = visualData.indexOf(this.expandCollapseRec);\n var tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);\n if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {\n sIndex = visualData.length - resourceCount.length;\n sIndex = sIndex > 0 ? sIndex : 0;\n startIndex = sIndex;\n endIndex = visualData.length;\n }\n else if (getValue('isCollapseAll', this.parent)) {\n startIndex = 0;\n endIndex = this.parent.grid.pageSettings.pageSize - 1;\n this.parent.grid.notify(events.virtualActionArgs, { setTop: true });\n }\n }\n //}\n if ((this.parent.enableCollapseAll || this.parent.expandStateMapping) && !isNullOrUndefined(this.expandCollapseRec)) {\n if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {\n startIndex = 0;\n }\n else if (!this.parent['isExpandAll']) {\n startIndex = this.prevstartIndex === -1 ? 0 : this.prevstartIndex;\n }\n }\n this.expandCollapseRec = null;\n pageingDetails.result = visualData.slice(startIndex, endIndex);\n this.prevstartIndex = startIndex;\n this.prevendIndex = endIndex;\n }\n this.parent.notify('updateAction', pageingDetails);\n };\n /**\n * To destroy the virtualScroll module\n *\n * @returns {void}\n * @hidden\n */\n VirtualScroll.prototype.destroy = function () {\n this.removeEventListener();\n };\n return VirtualScroll;\n}());\nexport { VirtualScroll };\nvar TreeVirtual = /** @class */ (function (_super) {\n __extends(TreeVirtual, _super);\n function TreeVirtual(parent, locator) {\n var _this = _super.call(this, parent, locator) || this;\n getValue('parent', _this).off('initial-load', getValue('instantiateRenderer', _this), _this);\n getValue('parent', _this).on('initial-load', _this.instantiateRenderers, _this);\n return _this;\n }\n TreeVirtual.prototype.getModuleName = function () {\n return 'treeVirtualScroll';\n };\n TreeVirtual.prototype.instantiateRenderers = function () {\n var parentGrid = getValue('parent', this);\n getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');\n var renderer = getValue('locator', this).getService('rendererFactory');\n if (parentGrid.enableColumnVirtualization) {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);\n }\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);\n //renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));\n this.ensurePageSize();\n };\n TreeVirtual.prototype.ensurePageSize = function () {\n var parentGrid = getValue('parent', this);\n var rowHeight = parentGrid.getRowHeight();\n if (!isNullOrUndefined(parentGrid.height) && typeof (parentGrid.height) === 'string' && parentGrid.height.indexOf('%') !== -1) {\n parentGrid.element.style.height = parentGrid.height;\n }\n var vHeight = parentGrid.height.toString().indexOf('%') < 0 ? parentGrid.height :\n parentGrid.element.getBoundingClientRect().height;\n var blockSize = ~~(vHeight / rowHeight);\n var height = blockSize * 2;\n var size = parentGrid.pageSettings.pageSize;\n parentGrid.setProperties({ pageSettings: { pageSize: size < height ? height : size } }, true);\n };\n return TreeVirtual;\n}(GridVirtualScroll));\nexport { TreeVirtual };\n","import { parentsUntil } from '@syncfusion/ej2-grids';\nimport { Grid, Freeze as FreezeColumn } from '@syncfusion/ej2-grids';\nimport { addClass } from '@syncfusion/ej2-base';\n/**\n * TreeGrid Freeze module\n *\n * @hidden\n */\nvar Freeze = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Freeze(parent) {\n Grid.Inject(FreezeColumn);\n this.parent = parent;\n this.addEventListener();\n }\n Freeze.prototype.addEventListener = function () {\n this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);\n this.parent.on('dataBoundArg', this.dataBoundArg, this);\n this.parent.grid.on('dblclick', this.dblClickHandler, this);\n };\n Freeze.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('rowExpandCollapse', this.rowExpandCollapse);\n this.parent.off('dataBoundArg', this.dataBoundArg);\n this.parent.grid.off('dblclick', this.dblClickHandler);\n };\n Freeze.prototype.rowExpandCollapse = function (args) {\n var movableRows = this.parent.getMovableDataRows();\n var frozenrows = this.parent.getRows();\n var rows;\n var frozenRightRows;\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n frozenRightRows = this.parent.getFrozenRightRows().filter(function (e) {\n return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));\n });\n }\n if (!args.detailrows.length) {\n rows = movableRows.filter(function (e) {\n return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));\n });\n }\n else {\n rows = args.detailrows;\n }\n for (var i = 0; i < rows.length; i++) {\n var rData = this.parent.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;\n rows[i].style.display = args.action;\n if (freeze) {\n frozenRightRows[i].style.display = args.action;\n }\n var queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'\n : '.e-treecolumn-container .e-treegridexpand';\n if (frozenrows[rows[i].rowIndex].querySelector(queryselector)) {\n var cRow = [];\n for (var i_1 = 0; i_1 < movableRows.length; i_1++) {\n if (movableRows[i_1].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {\n cRow.push(movableRows[i_1]);\n }\n }\n if (cRow.length) {\n this.rowExpandCollapse({ detailrows: cRow, action: args.action });\n }\n }\n }\n };\n Freeze.prototype.dblClickHandler = function (e) {\n if (parentsUntil(e.target, 'e-rowcell') &&\n this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {\n this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));\n }\n };\n Freeze.prototype.dataBoundArg = function () {\n var checkboxColumn = this.parent.getColumns().filter(function (e) {\n return e.showCheckbox;\n });\n if (checkboxColumn.length && this.parent.freezeModule && this.parent.initialRender) {\n addClass([this.parent.element.getElementsByClassName('e-grid')[0]], 'e-checkselection');\n }\n };\n Freeze.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Freeze module name\n */\n Freeze.prototype.getModuleName = function () {\n return 'freeze';\n };\n return Freeze;\n}());\nexport { Freeze };\n","import { Grid, ColumnChooser as GridColumnChooser } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid ColumnChooser module\n *\n * @hidden\n */\nvar ColumnChooser = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance.\n */\n function ColumnChooser(parent) {\n Grid.Inject(GridColumnChooser);\n this.parent = parent;\n }\n /**\n * Column chooser can be displayed on screen by given position(X and Y axis).\n *\n * @param {number} X - Defines the X axis.\n * @param {number} Y - Defines the Y axis.\n * @returns {void}\n */\n ColumnChooser.prototype.openColumnChooser = function (X, Y) {\n return this.parent.grid.columnChooserModule.openColumnChooser(X, Y);\n };\n /**\n * Destroys the openColumnChooser.\n *\n * @function destroy\n * @returns {void}\n */\n ColumnChooser.prototype.destroy = function () {\n //this.parent.grid.ColumnChooserModule.destroy();\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns ColumnChooser module name\n */\n ColumnChooser.prototype.getModuleName = function () {\n return 'ColumnChooser';\n };\n return ColumnChooser;\n}());\nexport { ColumnChooser };\n","import { Grid, InfiniteScroll as GridInfiniteScroll } from '@syncfusion/ej2-grids';\nimport { RowRenderer, resetRowIndex } from '@syncfusion/ej2-grids';\nimport { getValue, isNullOrUndefined, remove } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport { DataManager, Predicate, Query } from '@syncfusion/ej2-data';\nimport { findChildrenRecords, getExpandStatus } from '../utils';\n/**\n * TreeGrid Infinite Scroll module will handle Infinite Scrolling.\n *\n * @hidden\n */\nvar InfiniteScroll = /** @class */ (function () {\n /**\n * Constructor for VirtualScroll module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function InfiniteScroll(parent) {\n this.parent = parent;\n Grid.Inject(GridInfiniteScroll);\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} - Returns Logger module name\n */\n InfiniteScroll.prototype.getModuleName = function () {\n return 'infiniteScroll';\n };\n /**\n * @hidden\n * @returns {void}\n */\n InfiniteScroll.prototype.addEventListener = function () {\n this.parent.on(events.pagingActions, this.infinitePageAction, this);\n this.parent.on('infinite-remote-expand', this.infiniteRemoteExpand, this);\n this.parent.grid.on('delete-complete', this.infiniteDeleteHandler, this);\n this.parent.grid.on('infinite-edit-handler', this.infiniteEditHandler, this);\n this.parent.grid.on('infinite-crud-cancel', this.createRows, this);\n this.parent.grid.on('content-ready', this.contentready, this);\n this.parent.on(events.localPagedExpandCollapse, this.collapseExpandInfinitechilds, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n InfiniteScroll.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('infinite-remote-expand', this.infiniteRemoteExpand);\n this.parent.grid.off('delete-complete', this.infiniteDeleteHandler);\n this.parent.grid.off('infinite-edit-handler', this.infiniteEditHandler);\n this.parent.off(events.pagingActions, this.infinitePageAction);\n this.parent.grid.off('infinite-crud-cancel', this.createRows);\n this.parent.grid.off('content-ready', this.contentready);\n this.parent.off(events.localPagedExpandCollapse, this.collapseExpandInfinitechilds);\n };\n /**\n * Handles the Expand Collapse action for Remote data with infinite scrolling.\n *\n * @param {{ index: number, childData: ITreeData[] }} args - expanded row index and its child data\n * @param { number } args.index - expanded row index\n * @param { ITreeData[] } args.childData - child data of expanded row\n * @returns {void}\n */\n InfiniteScroll.prototype.infiniteRemoteExpand = function (args) {\n var rowObjects = this.parent.grid.getRowsObject();\n var locator = 'serviceLocator';\n var generateRows = 'generateRows';\n var serviceLocator = this.parent.grid.infiniteScrollModule[locator];\n var rowRenderer = new RowRenderer(serviceLocator, null, this.parent.grid);\n var rows = this.parent.getRows();\n var position = args.index === rows.length - 1 ? 'after' : 'before';\n var cols = this.parent.grid.getColumns();\n var childRowObjects = this.parent.grid.infiniteScrollModule[generateRows](args.childData, args);\n var childRowElements = [];\n for (var i = 0; i < childRowObjects.length; i++) {\n childRowElements.push(rowRenderer.render(childRowObjects[i], cols));\n }\n rowObjects.splice.apply(rowObjects, [args.index + 1, 0].concat(childRowObjects));\n for (var i = 0; i < childRowElements.length; i++) {\n if (position === 'after') {\n rows[args.index + i][position](childRowElements[i]);\n }\n else {\n rows[args.index + i + 1][position](childRowElements[i]);\n }\n rows.splice(args.index + 1 + i, 0, childRowElements[i]);\n }\n resetRowIndex(this.parent.grid, this.parent.grid.getRowsObject(), this.parent.grid.getRows(), 0);\n };\n /**\n * Resetted the row index for expand collapse action for cache support.\n *\n * @returns {void}\n */\n InfiniteScroll.prototype.contentready = function () {\n if (this.parent.infiniteScrollSettings.enableCache && !isNullOrUndefined(this.parent.editModule)) {\n var updateIndex = 'updateIndex';\n this.parent.editModule[updateIndex](this.parent.grid.dataSource, this.parent.getRows(), this.parent.getCurrentViewRecords());\n if (this.parent.getFrozenColumns()) {\n this.parent.editModule[updateIndex](this.parent.grid.dataSource, this.parent.getMovableDataRows(), this.parent.getCurrentViewRecords());\n }\n }\n };\n InfiniteScroll.prototype.collapseExpandInfinitechilds = function (row) {\n row.record.expanded = row.action === 'collapse' ? false : true;\n var ret = {\n result: this.parent.flatData,\n row: row.row,\n action: row.action,\n record: row.record,\n count: this.parent.flatData.length\n };\n var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';\n getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });\n };\n /**\n * Handles the page query for Data operations and CRUD actions.\n *\n * @param {{ result: ITreeData[], count: number, actionArgs: object }} pageingDetails - data, its count and action details\n * @param {ITreeData[]} pageingDetails.result - data on scroll action\n * @param {number} pageingDetails.count - data count on scroll action\n * @param {Object} pageingDetails.actionArgs - scroll action details\n * @returns {void}\n */\n InfiniteScroll.prototype.infinitePageAction = function (pageingDetails) {\n var _this = this;\n var dm = new DataManager(pageingDetails.result);\n var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);\n var infiniteParents = dm.executeLocal(new Query().where(expanded));\n var visualData = infiniteParents.filter(function (e) {\n return getExpandStatus(_this.parent, e, infiniteParents);\n });\n var actionArgs = getValue('actionArgs', pageingDetails.actionArgs);\n var actions = getValue('actions', this.parent.grid.infiniteScrollModule);\n var initial = actions.some(function (value) { return value === actionArgs.requestType; });\n var initialRender = initial ? true : this.parent.initialRender ? true : false;\n this.visualData = visualData;\n pageingDetails.count = visualData.length;\n if (getValue('isPrinting', pageingDetails.actionArgs)) {\n pageingDetails.result = visualData;\n }\n else {\n var query = new Query();\n var isCache = this.parent.infiniteScrollSettings.enableCache;\n if (isCache && this.parent.infiniteScrollSettings.initialBlocks > this.parent.infiniteScrollSettings.maxBlocks) {\n this.parent.infiniteScrollSettings.initialBlocks = this.parent.infiniteScrollSettings.maxBlocks;\n }\n var size = initialRender ?\n this.parent.pageSettings.pageSize * this.parent.infiniteScrollSettings.initialBlocks :\n this.parent.pageSettings.pageSize;\n var current = this.parent.grid.pageSettings.currentPage;\n if (!isNullOrUndefined(actionArgs)) {\n var lastIndex = getValue('lastIndex', this.parent.grid.infiniteScrollModule);\n var firstIndex = getValue('firstIndex', this.parent.grid.infiniteScrollModule);\n if (!isCache && actionArgs.requestType === 'delete') {\n var skip = lastIndex - actionArgs.data.length + 1;\n var take = actionArgs.data.length;\n query = query.skip(skip).take(take);\n }\n else if (isCache && actionArgs.requestType === 'delete' ||\n (actionArgs.requestType === 'save' && actionArgs.action === 'add')) {\n query = query.skip(firstIndex);\n query = query.take(this.parent.infiniteScrollSettings.initialBlocks * this.parent.pageSettings.pageSize);\n }\n else {\n if ((pageingDetails.actionArgs['action'] === 'expand' || pageingDetails.actionArgs['action'] === 'collapse') && this.parent.grid.pageSettings.currentPage !== 1) {\n current = 1;\n size = this.parent.pageSettings.pageSize * this.parent.grid.pageSettings.currentPage;\n }\n query = query.page(current, size);\n }\n }\n else {\n query = query.page(current, size);\n }\n dm.dataSource.json = visualData;\n if (!isCache && !isNullOrUndefined(actionArgs) && actionArgs.requestType === 'save' && actionArgs.action === 'add') {\n pageingDetails.result = [actionArgs.data];\n }\n else {\n pageingDetails.result = dm.executeLocal(query);\n }\n }\n this.parent.notify('updateAction', pageingDetails);\n };\n /**\n * Handles the currentviewdata for delete operation.\n *\n * @param {{ e: InfiniteScrollArgs, result: Object[] }} args - Scroller and data details\n * @param {InfiniteScrollArgs} args.e - scroller details while CRUD\n * @param {Object[]} args.result - data details while CRUD\n * @returns {void}\n */\n InfiniteScroll.prototype.infiniteEditHandler = function (args) {\n var infiniteData = 'infiniteCurrentViewData';\n var infiniteCurrentViewData = this.parent.grid.infiniteScrollModule[infiniteData];\n var keys = Object.keys(infiniteCurrentViewData);\n if (args.e.requestType === 'delete' && args.result.length > 1) {\n for (var i = 1; i < args.result.length; i++) {\n infiniteCurrentViewData[keys[keys.length - 1]].push(args.result[i]);\n }\n }\n };\n /**\n * Handles the row objects for delete operation.\n *\n * @param {ActionEventArgs} args - crud action details\n * @returns {void}\n */\n InfiniteScroll.prototype.infiniteDeleteHandler = function (args) {\n if (args.requestType === 'delete') {\n var rows = this.parent.grid.getRowsObject();\n var rowElms = this.parent.getRows();\n var data = args.data instanceof Array ? args.data : [args.data];\n var keyField = this.parent.grid.getPrimaryKeyFieldNames()[0];\n this.removeRows(rowElms, rows, data, keyField, true);\n if (this.parent.getFrozenColumns() > 0) {\n var mRows = this.parent.grid.getMovableRowsObject();\n var mRowElms = this.parent.grid.getMovableRows();\n this.removeRows(mRowElms, mRows, data, keyField);\n }\n }\n };\n /**\n * Handles the row objects for delete operation.\n *\n * @param {Element[]} rowElms - row elements\n * @param {Row<Column>[]} rows - Row object collection\n * @param {Object[]} data - data collection\n * @param {string} keyField - primary key name\n * @param { boolean} isFrozen - Specifies whether frozen column enabled\n * @returns {void}\n */\n InfiniteScroll.prototype.removeRows = function (rowElms, rows, data, keyField, isFrozen) {\n var _this = this;\n var resetInfiniteCurrentViewData = 'resetInfiniteCurrentViewData';\n var _loop_1 = function (i) {\n rows.filter(function (e, index) {\n if (e.data[keyField] === data[i][keyField]) {\n if (isFrozen) {\n var page = Math.ceil((index + 1) / _this.parent.grid.pageSettings.pageSize);\n _this.parent.grid.infiniteScrollModule[resetInfiniteCurrentViewData](page, index);\n }\n rows.splice(index, 1);\n remove(rowElms[index]);\n rowElms.splice(index, 1);\n }\n });\n };\n for (var i = 0; i < data.length; i++) {\n _loop_1(i);\n }\n };\n /**\n * Handles the row objects for Add operation.\n */\n InfiniteScroll.prototype.createRows = function (eventArgs) {\n var locator = 'serviceLocator';\n var actionArgs = eventArgs.args.e;\n var row = eventArgs.row;\n var serviceLocator = this.parent.grid.infiniteScrollModule[locator];\n var rowRenderer = new RowRenderer(serviceLocator, null, this.parent.grid);\n var tbody;\n var currentData = this.parent.getCurrentViewRecords();\n var currentRows = eventArgs.isMovable ? this.parent.grid.getMovableRows()\n : this.parent.grid.getDataRows();\n if (eventArgs.isFrozenRight) {\n tbody = this.parent.element.querySelector('.e-frozen-right-content').querySelector('tbody');\n }\n else {\n tbody = !this.parent.grid.isFrozenGrid() ? this.parent.getContent().querySelector('tbody') : eventArgs.isMovable\n ? this.parent.grid.getMovableVirtualContent().querySelector('tbody')\n : this.parent.grid.getFrozenVirtualContent().querySelector('tbody');\n }\n if (this.parent.frozenRows) {\n tbody = eventArgs.isFrozenRows && this.parent.grid.infiniteScrollModule.requestType !== 'add'\n || !eventArgs.isFrozenRows && this.parent.grid.infiniteScrollModule.requestType === 'add'\n ? !this.parent.grid.isFrozenGrid() ? this.parent.getHeaderContent().querySelector('tbody')\n : eventArgs.isMovable ? this.parent.grid.getMovableVirtualHeader().querySelector('tbody')\n : eventArgs.isFrozenRight ? this.parent.element.querySelector('.e-frozen-right-header').querySelector('tbody')\n : this.parent.grid.getFrozenVirtualHeader().querySelector('tbody') : tbody;\n }\n var position;\n var addRowIndex = 'addRowIndex';\n var newRowIndex = this.parent.editModule[addRowIndex];\n for (var i = 0; i < row.length; i++) {\n var newRow = rowRenderer.render(row[i], this.parent.grid.getColumns());\n if (actionArgs.requestType === 'save' && actionArgs.action === 'add') {\n if (getValue('selectedIndex', this.parent.editModule) !== -1 && this.parent.editSettings.newRowPosition !== 'Top') {\n if (this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {\n position = 'after';\n newRowIndex += findChildrenRecords(currentData[newRowIndex + 1]).length;\n if (this.parent.editSettings.newRowPosition === 'Child') {\n newRowIndex -= 1; //// for child position already child record is added in childRecords so subtracting 1\n }\n currentRows[newRowIndex][position](newRow);\n }\n else if (this.parent.editSettings.newRowPosition === 'Above') {\n position = 'before';\n currentRows[this.parent.editModule[addRowIndex]][position](newRow);\n }\n }\n else if (this.parent.editSettings.newRowPosition === 'Bottom') {\n tbody.appendChild(newRow);\n }\n else {\n tbody.insertBefore(newRow, tbody.firstElementChild);\n }\n }\n else if (actionArgs.requestType === 'delete') {\n tbody.appendChild(newRow);\n }\n }\n eventArgs.cancel = true;\n };\n /**\n * To destroy the infiniteScroll module\n *\n * @returns {void}\n * @hidden\n */\n InfiniteScroll.prototype.destroy = function () {\n this.removeEventListener();\n };\n return InfiniteScroll;\n}());\nexport { InfiniteScroll };\n","import * as index from './index';\nindex.TreeGrid.Inject(index.Filter, index.Page, index.Sort, index.Reorder, index.Toolbar, index.Aggregate, index.Resize, index.ColumnMenu, index.ExcelExport, index.PdfExport, index.CommandColumn, index.ContextMenu, index.Edit, index.Selection, index.VirtualScroll, index.DetailRow, index.RowDD, index.Freeze, index.ColumnChooser, index.Logger, index.InfiniteScroll);\nexport * from './index';\n"],"names":["isRemoteData","parent","dataSource","DataManager","adaptor","ODataAdaptor","WebApiAdaptor","WebMethodAdaptor","CacheAdaptor","UrlAdaptor","isCountRequired","isCheckboxcolumn","i","columns","length","showCheckbox","isFilterChildHierarchy","isNullOrUndefined","grid","searchSettings","key","hierarchyMode","allowFiltering","filterSettings","findParentRecords","records","datas","len","Object","keys","getObject","push","getExpandStatus","record","parents","childParent","parentRecord","parentItem","getParentData","uniqueID","initialRender","expandStateMapping","expanded","findChildrenRecords","hasChildRecords","childRecords","concat","isOffline","dm","ready","extendArray","array","obj","objArr","j","getPlainData","value","index","level","taskData","requireFilter","isHidden","el","style","window","getComputedStyle","display","visibility","editAction","details","control","isSelfReference","addRowIndex","selectedIndex","columnName","addRowRecord","batchChanges","action","getPrimaryKeyFieldNames","treeData","json","modifiedData","originalData","isSkip","editSettings","mode","editModule","getBatchChanges","addAct","addAction","Array","extend","newRowPosition","k","prototype","hasOwnProperty","call","editedData","parentIdMapping","idMapping","splice","childMapping","updateParentRow","currentData_1","parentData","flatData","filter","e","p","enableImmutableMode","removeChildRecords","currentViewRecords","getCurrentViewRecords","unshift","primaryKeys","currentdata","isChildAll","editRowIndex","updateCurrentViewData","child","index_1","currentRecords","map","enableVirtualization","getValue","parentUniqueID","sortSettings","indexOf","data","setRowData","row","getRowByIndex","getRows","getRowIndexByPrimaryKey","movableRow","frozenRows","getFrozenColumns","getMovableRowByIndex","index_2","treeColumnIndex","allowRowDragAndDrop","renderModule","cellRender","cell","cells","column","getColumns","requestType","RowModifier","Column","options","this","allowEditing","edit","disableHtmlEncode","allowReordering","showColumnMenu","allowSorting","allowResizing","merge","__extends","extendStatics","d","b","setPrototypeOf","__proto__","__","constructor","create","__decorate","decorators","target","desc","c","arguments","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","Predicate","_super","apply","Property","ChildProperty","FilterSettings","Collection","TextWrapSettings","DOC_URL","BASE_DOC_URL","IsRowDDEnabled","Logger","Grid","Inject","GridLogger","getModuleName","log","types","args","type","item","detailLists","cOp","check","success","message","generateMessage","replace","gridurl","substring","treeGridObj","dataStateChange","console","logType","treeLog","treeGrid","isPrimaryKey","treeGridDetails","mapping_fields_missing","opt","ERROR","TreeClipboard","_this","treeCopyContent","copiedUniqueIdCollection","treeGridParent","setCopyData","withHeader","getSelection","toString","clipBoardTextArea","rows","selectionSettings","selectedIndexes","getSelectedRowIndexes","sort","a","classList","contains","slice","querySelectorAll","uniqueid","getSelectedRecords","copyHierarchyMode","parentContentData","childContentData","headerTextArray","getVisibleColumns","headerText","cancel","trigger","Browser","userAgent","match","setSelectionRange","select","treeLevel","copy","paste","rowIndex","colIndex","destroy","childData","GridClipboard","Selection","selectedItems","filteredList","addEventListener","on","headerCheckbox","columnCheckbox","updateGridActions","checkboxSelection","removeEventListener","isDestroyed","off","checkBox","checkWrap","parentsUntil","querySelector","closest","selectCheckboxes","triggerChkChangeEvent","nextElementSibling","autoCheckHierarchy","checkBoxvalue","headerSelection","checkState","rowElement","checked","rowData","getCheckedRecords","getCheckboxcolumnIndex","mappingUid","columnIndex","col","uid","headerCelllength","getHeaderContent","getAttribute","headerElement","rowChkBox","createElement","className","attrs","createCheckBox","label","add","insertBefore","cloneNode","firstChild","renderColumnCheckbox","setAttribute","checkboxState","allowTextWrap","width","checkbox","removeClass","container","containerELe","spanEle","innerHTML","divEle","appendChild","rowIndexes","flatRecord","traverSelection","ischildItem","updateSelectedItems","updateParentSelection","filterModule","filteredResult","getFilteredChildRecords","count","isSummaryRow","indeter","checkChildRecords","checkBoxRecord","checkAll","filterResult","rec","currentRecord","checkedRecord","recordIndex","checkboxRecord","tr","movableTr","getMovableDataRows","checkedIndex","checkBoxclass","childLength","updatedData","forEach","getCheckedrecords","getCheckedRowIndexes","Print","GridPrint","printTreeGrid","printGrid","gridElement","queryCellInfo","rowDataBound","beforeDataBound","addClass","print","SearchSettings","SelectionSettings","Render","templateResult","columnTemplateResult","reactTemplateRender","allowPaging","pageSettings","pageSizeMode","enableCollapseAll","proxy_1","parentrec","cellElement","pad","filterLevel","totalIconsWidth","getColumnByUid","summaryRow","frozenColumns","enableColumnVirtualization","getColumnIndexByUid","emptyExpandIcon","styles","n","iconRequired","hasFilteredChildRecords","expandIcon","expand","updateTreeCell","getFrozenLeftColumnsCount","getFrozenRightColumnsCount","freezerightColumns","getFrozenRightColumns","freezeLeftColumns","getFrozenLeftColumns","movableColumns","getMovableColumns","field","notify","checkboxElement","parseInt","summaryData","rowTemplate","treeColumn","colindex","template","templateCompiler","textContent","appendChildren","children","tempID","element","id","isReact","result","DataManipulation","addedRecords","parentItems","taskIds","hierarchyData","storedIndex","sortedData","isSortAction","dataResults","updateParentRemoteData","beginSorting","updateData","collectExpandingRecs","dataProcessor","isRemote","convertToFlatData","query","Query","filterKey","params","param","where","addParams","hasChildMapping","qry","clone","queries","executeQuery","then","DataUtil","distinct","httpRequest","statusText","setValue","zerothLevelData","dataManagerSuccess","hideSpinner","convertJSONData","tempData","selfData","mappingData","executeLocal","group","groupData","items","selfReferenceUpdate","createRecords","referenceData","shift","loadChildOnDemand","getUid","Math","ceil","random","rowDetails","isChild","gridRows","getContentTable","childRecord","targetEle","getElementsByClassName","getRowObjectFromUID","childRows","parentRow","expandingTd","detailRowModule","fetchRemoteChildData","getDataModule","generateQuery","clonequries","fn","showSpinner","currentViewData","inx","getRowsObject","haveChild","aggregates","gridQuery","aggregateQuery","summaryQuery","q","summaryModule","calculateSummaryValue","totalRecordsCount","virtualArgs","remoteVirtualAction","notifyArgs","enableInfiniteScrolling","contentModule","currentInfo","prevInfo","loadNext","currentPage","nextInfo","page","parentRecords","treeGridData","currentData","dataObj","isExport","expresults","exportType","isPrinting","actionArgs","actionData","actionAddArgs","primaryKeyColumnName","dataValue","isLocalData","updateAction","filterQuery","searchQuery","results","fltrQuery","srchQuery","filteredData","gridQuery_1","srtQry","srt","compFun","sortComparer","bind","direction","sortBy","sortArgs","temp","paging","printMode","actArgs","actualResults","dataResult","RowDD","canDrop","isDraggedWithChild","hasDropItem","isaddtoBottom","GridDragDrop","getChildrecordsByParentID","Rowdraging","rowDropped","rowsAdded","rowsRemoved","reorderRows","fromIndexes","toIndex","position","tObj","dropPosition","dropIndex","dropRows","orderToIndex","refresh","dropData","totalRecord","parentrow","updatedParent","draggedRecord","dragRecords","draggedRecord_1","dragRecords_1","setProperties","deleteDragRow","refreshGridDataSource","tempDataSource","idx","droppedRecord","proxy","removeFirstrowBorder","canremove","remove","removeLastrowBorder","isEmptyRow","islastRowIndex","updateIcon","rowEle","undefined","rowPositionHeight","addErrorElem","rowTop","toolHeight","toolbar","document","getElementById","offsetHeight","positionOffSet","getOffset","contentHeight","top","scrollTop","getContent","firstElementChild","offsetTop","divide","topRowSegment","middleRowSegment","bottomRowSegment","mouseEvent","touchEvent","posy","pageY","changedTouches","isTopSegment","isMiddleRowSegment","isBottomRowSegment","removeChildBorder","removetopOrBottomBorder","addFirstrowBorder","removeErrorElem","topOrBottomBorder","addRemoveClasses","addLastRowborder","borderElem","targetRow","node","div","gridheaderEle","toolbarHeight","toolbarModule","getToolbar","multiplegrid","rowDropSettings","targetID","offsetWidth","getScrollWidth","trElement","bottomborder","gridcontentEle","bottom","scrollElem","scrollWidth","Scroll","getScrollBarWidth","dragelem","ele","errorVal","content","parentNode","removeChild","spanContent","paddingLeft","dropItemSpan","dropItemLeft","left","spanLeft","enableRtl","errorelem","errorValue","setStyleAttribute","border","box","getBoundingClientRect","body","docElem","documentElement","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","round","cloneElement","cursor","rowIdx","ensuredropPosition","rowDragAndDropModule","dropElement","ej2_instances","dragDropGrid","fromIndex","getTargetIdx","parentElement","primaryKeyField","srcControl","targetIndex","isNaN","indexes","actualData","i_1","srcControlFlatData","actualIndex","selectedRecord","isByMethod","draggedRecord_2","isMultipleGrid","dragLength","reverse","this_1","correctIndex","offsetParent","newParentIndex","recordIndex1","dropAtTop","getChildCount","droppedRecordIndex","updateChildRecordLevel","updateChildRecord","dropMiddle","nonRepeat_1","childRecordsLength","recordLevel","childItem","deletedRow","removeRecords","flatParentData","childIndex","removeChildItem","idz","parentIndex","deletedRecordCount","i_2","i_3","draggedRecords","ToolbarItem","ContextMenuItems","PageSettings","AggregateColumn","intl","Internationalization","templateFn","setFormatter","cultureName","format","skeleton","formatFn","getFormatFunction","getDateFormat","getNumberFormat","getFormatter","setTemplate","helper","footerTemplate","getEnumValue","CellType","Summary","compile","property","getTemplate","setPropertiesSilent","prop","AggregateRow","EditSettings","SortDescriptor","SortSettings","InfiniteScrollSettings","TreeGrid","uniqueIDCollection","uniqueIDFilterCollection","changedRecords","deletedRecords","objectEqualityChecker","old","current","isEqual","excludeKeys","Date","getTime","TreeGrid_1","TreeGridSelection","mergePersistTreeGridData","injectedModules","excelExport","excelExportProperties","isMultipleExport","workbook","isBlob","excelExportModule","Map","csvExport","pdfExport","pdfExportProperties","pdfDoc","pdfExportModule","preRender","TreeGridLocale","initProperties","defaultLocale","Above","Below","Child","AddRow","ExpandAll","CollapseAll","RowIndent","RowOutdent","l10n","L10n","locale","sortByColumn","isMultiSort","sortModule","sortColumn","clearSorting","removeSortColumn","search","searchString","autoFitColumns","fieldNames","resizeModule","updateColumnModel","reorderColumns","fromFName","toFName","localeObject","gridLocale","treeGridLocale","load","printModule","treeGridkeyActionHandler","allowKeyboard","parentTarget","summaryElement","expandAll","collapseAll","expandCollapseRequest","findnextRowElement","selectRow","cellIndex","row_1","clearSelection","findPreviousRowElement","rIndex","cIndex","summaryRowElement","previousElementSibling","columnModel","isExpandAll","isCollapseAll","keyConfigs","ctrlDownArrow","ctrlUpArrow","ctrlShiftUpArrow","ctrlShiftDownArrow","downArrow","upArrow","offline","RemoteSaveAdaptor","wireEvents","EventHandler","mouseClickHandler","keyboardModule","KeyboardEvents","keyAction","eventName","tabIndex","requiredModules","modules","getGridColumns","member","contextMenuItems","allowExcelExport","detailTemplate","allowPdfExport","showColumnChooser","extendRequiredModules","allowAdding","allowDeleting","isCommandColumn","allowSelection","some","commands","commandsTemplate","unwireEvents","loggerModule","render","portals","isVue","createSpinner","dataModule","autoGenerateColumns","convertTreeData","loadGrid","addListener","gridContainer","height","gridRequiredModules","appendTo","renderComplete","destroyTemplateFn","clearTemplate","afterGridRender","clipboardModule","griddata","bindGridProperties","bindedDataSource","columnQueryMode","getActualProperties","pagerTemplate","infiniteScrollSettings","enableAltRow","enableHover","enableAutoFill","enableAdaptiveUI","rowHeight","gridLines","getGridToolbar","toolbarTemplate","textWrapSettings","selectedRowIndex","getContextMenu","columnMenuItems","getGridEditSettings","clipMode","triggerEvents","bindGridEvents","rowSelecting","rowSelected","isHeaderCheckboxClicked","selectionModule","selectedRowIndexes","rowDeselected","resizeStop","excelQueryCellInfo","pdfQueryCellInfo","checkBoxChange","pdfExportComplete","excelExportComplete","excelHeaderQueryCellInfo","pdfHeaderQueryCellInfo","dataSourceChanged","recordDoubleClick","rowDeselecting","cellDeselected","cellDeselecting","columnMenuOpen","columnMenuClick","cellSelected","headerCellInfo","resizeStart","resizing","columnDrag","columnDragStart","columnDrop","beforePrint","beforeCopy","beforePaste","TreeLogger","printComplete","actionFailure","extendedGridDataBoundEvent","extendedGridEvents","extendedGridActionEvents","extendedGridEditEvents","bindGridDragEvents","bindCallBackEvents","lastRowBorder","visiblerow","isAddBorder","isPixelHeight","dataBound","updateRowTemplate","updateAltRow","req","totalRows","persistSelection","callBackPromise_1","Deferred","beforeDataBoundArgs","resolve","toolbarClick","callBackPromise","toolbarargs","cellSelecting","cellselectingArgs","beginEdit","begineditArgs","isExpandRefresh","cellSave","isContextMenuOpen","contextitems","contextMenuModule","contextMenu","cellsaveArgs","cellSaved","cellEdit","promise","batchAdd","beforeBatchSave","beforeBatchAdd","batchDelete","beforeBatchDelete","batchCancel","treeColumnRowTemplate","datacount","defaultQuery","JsonAdaptor","actionBegin","dataManager","isQueryInvokedFromData","callBackPromise_2","actionComplete","updateTreeGridModel","ag","showChildSummary","selectedRecords","selectedRows","detailDataBound","contextMenuClick","contextMenuOpen","rowDragStartHelper","rowDragStart","rowDrag","isEdit","rowDrop","registeredTemplate","allowEditOnDblClick","showConfirmDialog","showDeleteConfirmDialog","allowNextRowEdit","dialog","text","getConstant","tooltipText","Search","prefixIcon","disabled","isEmptyColumnModel","treeGridColumn","gridColumn","gridColumnCollection","_i","_a","treeColumnTextAlign","textAlign","treeColumnField","onPropertyChanged","newProp","requireRefresh","properties_1","refreshColumns","allowMultiSorting","isDataSourceChanged","eventListener","renderTable","updateTreeColumnTextAlign","closeEdit","getColumnByField","treeGridElement","hasTreeGridChild","removeListener","dataBind","getPersistData","keyEntity","ignoreOnPersist","ignoreOnColumn","currentObject","val","ignoreInArrays","addOnPersist","ignoreInColumn","touches","isEditCollapse","getPager","addRecord","saveCell","updateCell","updateRow","deleteRecord","fieldName","startEdit","editCell","enableToolbarItems","isEnable","enableItems","endEdit","openColumnChooser","x","y","columnChooserModule","deleteRow","setCellValue","primaryKey","sHeight","scrollHeight","clientHeight","goToPage","pageNo","pagerModule","updateExternalMessage","getCellFromIndex","iterateArrayOrObject","Columns","getColumnFieldNames","getFooterContent","getFooterContentTable","showColumns","showBy","hideColumns","hideBy","getColumnHeaderByField","getColumnHeaderByIndex","getColumnHeaderByUid","getColumnIndexByField","getVirtualColIndexByUid","isRefresh","gridColumns","stackedHeader","refreshReactColumnTemplateByUid","columnUid","rowsObj","indent","getIndentCount","getNormalizedColumnIndex","isDataRow","cellRenderer","CellRenderer","serviceLocator","td","refreshTD","mergeColumns","storedColumn","getDataRows","dRows","getHeaderTable","getRowInfo","getUidByColumnField","cols","visible","getVisibleRecords","visibleRecords","refreshUI","refreshHeader","dialogObj","targetElement","rowInfo","collapseRow","expandRow","getCollapseExpandRecords","expandingArgs","expandCollapse","expandCollapseAllChildren","collapseArgs","setHeightForFrozenContent","freeze","refreshScrollOffset","collapsingArgs","getRowHeight","scrollBy","expandAtLevel","expandAction","getRecordDetails","expandByKey","expandCollapseActionByKey","isPaging","puniqueID_1","collapseAtLevel","collapseAction","collapseByKey","startIndex","expandCollapseAll","isExpandCollapseall","updateChildOnDemand","displayAction","detailrows","remoteExpand","localExpand","deff","data_1","length_1","rows_1","args_1","collapseRemoteChild","movableRows","freezeRightRows","rows_2","getMovableRows","getFrozenRightRows","visibleRowCount","gridRow","rcell","arg","movablerows","rightrows","collapsingTd","collapse","expandElement","cRow","eRows","updateRowAndCellElements","updateResultModel","returnResult","filterByColumn","filterOperator","filterValue","predicate","matchCase","ignoreAccent","actualFilterValue","actualOperator","clearFiltering","removeFilteredColsByField","isClearFilterBar","isToggle","selectRows","selectCell","getSelectedRows","getMovableCellFromIndex","getFrozenRightRowByIndex","getFrozenRightDataRows","getFrozenRightCellFromIndex","getFrozenLeftColumnHeaderByIndex","getFrozenRightColumnHeaderByIndex","getMovableColumnHeaderByIndex","getMovableColumnsCount","getVisibleMovableCount","getVisibleFrozenRightCount","getVisibleFrozenLeftCount","getFrozenCount","cnt","isFrozen","getSelectedRowCellIndexes","baseModule","treeModule","Complex","RowDropSettings","Event","NotifyPropertyChanges","Component","Reorder","GridReorder","getTreeColumn","treeIndex","updatedCols","f","Resize","GridResize","fName","TreeVirtualRowModelGenerator","getDatas","visualData","getDataInfo","getData","generateRows","virtualInfo","info","blockIndexes","getBlockIndexes","url","checkAndResetCache","clear","cache","groups","getBlockSize","VirtualRowModelGenerator","Filter","GridFilter","isHierarchyFilter","flatFilteredData","filteredParentRecs","updatedFilteredRecord","clearFilterLevel","dataDetails","addParentRecord","ischild","checkChildExsist","parent_1","parRecord","updateParentFilteredRecord","updateFilterLevel","uniqueIDValue","childRec","isExist","parent_2","parent_3","fLevel","ExcelExport","isCollapsedStatePersist","GridExcel","updateExcelResultModel","exportRowDataBound","finalPageSetup","isCsv","Promise","isLocal","customData","manipulateExportProperties","book","dtSrc","queryResult","flatsData","dataSrc","excelRow","excelrowobj","rowObj","filtercolumnlength","rowlength","excelRows","rowlevel","Boolean","expandedStatus","sublevelState","state","grouping","outlineLevel","isCollapsed","worksheets","pageSetup","isSummaryRowBelow","PdfExport","GridPdf","updatePdfResultModel","customsData","manipulatePdfProperties","flatDatas","paragraphIndent","Page","GridPage","collapseExpandPagedchilds","pageAction","primaryKeyField_1","ret","pageRoot","pagedResults","newResults","t","res","pageingDetails","propname","skip","size","pageSize","take","dm_1","or","parents_1","floor","Toolbar","tool","refreshToolbar","toolbarClickHandler","eventTrigger","Aggregate","GridAggregate","flatChildRecords","isSort","flatRecords","summaryLength","dataLength","getChildRecordsLength","summaryRowIndex","len_1","createSummaryItem","idx_1","currentIndex","summaryParent","length_2","itemData","summary","displayColumn","keys_1","getSummaryValues","summaryColumn","single","getFormatFromType","tempObj","requiresCount","summaryKey","sumData","toLowerCase","calculateAggregate","disp","value_1","summaryformat","Sort","GridSort","flatSortedData","updateModel","createdSortedRecords","sortParams","iterateSort","childSort","ColumnMenu","GridColumnMenu","getColumnMenu","columnMenuModule","ContextMenu","cmenu","addRow","editRecord","BatchEdit","batchChildCount","batchAddedRecords","batchDeletedRecords","batchAddRowRecord","batchRecords","isAdd","batchSave","batchPageAction","batchCancelAction","immutableBatchAction","nextCellIndex","getBatchRecords","getAddRowIndex","getSelectedIndex","getBatchChildCount","actualCellIndex","frozenCols","columnObject","getColumnByIndex","added","primaryKey_1","currentDataIndex","indexvalue","rowObjectIndex","getActualRowObjectIndex","newBatchRowAdded","changes","batchIndex","primaryParent","childRecordCount","updateChildCount","updateRowIndex","focusModule","table","matrix","childs","primarykey","parentRowIndex","getRowElementByUID","totalCount","mRows","deleteUniqueID","positionIndex","updatedRecords","primarykey_1","addRecords","totalRecords","endIndex","indexValue","Edit","prevAriaRowIndex","isAddedRowByMethod","GridEdit","previousNewRowPosition","internalProperties","batchEditModule","crudAction","beginAdd","keyPressed","lastCellTab","contentready","editActionEvents","gridDblClick","customCellSave","savePreviousRowPosition","beforeStartEdit","beforeBatchCancel","resetIsOnBatch","getRowPosition","doubleClickTarget","addArgs","ariaRowIndex","applyFormValidation","eventArgs","treeObj","keyData","paramsLength","infiniteAddAction","rowObjects","newRowObject","newRowObjectIndex","newRecord","updateInfiniteCurrentViewData","movableRowsObject","getMovableRowsObject","isCache","enableCache","resetRowIndex","updateIndex","newRowIndex","dataIndex","infiniteCurrentViewData","infiniteScrollModule","isOnBatch","updateGridEditMode","keyPress","prom","celleditArgs","request","toolbarID","cellDetails","treeCell","afterCellSave","form","rowIndex_1","primaryKeys_1","isTabLastRow","update","fromTable","previousValue","editArgs","filterChoiceCount","excelSearchOperator","mRow","aggregateModule","destroyWidgets","formObj","restoreFocus","saveArgs","previousData","data1","treeColIndex","l","data2","treecell","firstAriaIndex","lastAriaIndex","withinRange","isVirtualization","focussedElement","activeElement","newFreezeRowObject","rightFrozenRows","errors","focus","primaryKeys_2","selector","beginAddEdit","childRecordCount1","currentDataIndex1","deletedValues","previousEditMode","previousGridEditMode","editFormValidate","destroyForm","CommandColumn","Command","DetailRow","detailrow","dataBoundArg","detaildataBound","setIndentVisibility","childRowExpand","rowExpandCollapse","actioncomplete","detailele","elements","detailData","detailRowElement","detailElement","previousSibling","expandClass","classlist","gridClas","gridclass","newNo","detailClass","spann","updtdcolum","focusElement","VirtualTreeContentRenderer","locator","isExpandCollapse","translateY","maxiPage","recordAdded","preTranslate","isRemoteExpand","getModelGenerator","virtualOtherAction","indexModifier","setTop","nextSetResIndex","lastIndex","onDataReady","refreshContentRows","observers","observes","scrollArgs","scrollListeners","onEnteredAction","dataBoundEvent","rowSelectedEvent","toSelectVirtualRow","onActionComplete","virtualEditSuccess","resetIseditValue","cancelEdit","toSelectRowOnContextOpen","refreshCell","cellFocus","setVirtualHeight","contents","debounceEvent","TreeInterSectionObserver","getPanel","getTranslateY","sTop","cHeight","isOnenter","gridTop","observer","generateCells","generateCell","rowId","cellType","colSpan","oIndex","foreignKeyData","isDataCell","isTemplate","rowID","Data","isForeignKey","isForeignColumn","Cell","rowPosition","withInRange","restoreEditState","restoreNewRow","isWheel","isIE","xAxis","axis","getColumnOffset","vgenerator","getColumnIndexes","columnIndexes","cOffsets","maxLeft","virtualEle","adjustTable","header","sentinel","outBuffer","upScroll","offset","downScroll","vHeight","lastInx","remains","rowPt","firsttdinx","isLastBlock","viewInfo","previousInfo","setColumnIndexesInView","loadSelf","event","appendContent","newChild","sentinelInfo","cBlock","cOffset","setWrapperWidth","name","getTable","VirtualContentRenderer","isWheeling","newPos","lastPos","timer","callback","onEnterCallback","virtualScrollHandlers","delay","debounced50","debounce","prevTop","prevLeft","movableContainer","scrollbar","delta","clearTimeout","setTimeout","preventDefault","returnValue","axes","entered","InterSectionObserver","VirtualScroll","prevstartIndex","prevendIndex","TreeVirtual","returnVisualData","collapseExpandVirtualchilds","virtualPageAction","expandCollapseRec","counts","resourceCount","sIndex","instantiateRenderers","parentGrid","renderer","getService","RenderType","Header","VirtualHeaderRenderer","Content","ensurePageSize","GridVirtualScroll","Freeze","FreezeColumn","dblClickHandler","frozenRightRows","frozenrows","rData","queryselector","freezeModule","ColumnChooser","GridColumnChooser","X","Y","InfiniteScroll","GridInfiniteScroll","infinitePageAction","infiniteRemoteExpand","infiniteDeleteHandler","infiniteEditHandler","createRows","collapseExpandInfinitechilds","rowRenderer","RowRenderer","childRowObjects","childRowElements","infiniteParents","initialBlocks","maxBlocks","firstIndex","rowElms","keyField","removeRows","mRowElms","tbody","currentRows","isMovable","isFrozenRight","isFrozenGrid","getMovableVirtualContent","getFrozenVirtualContent","isFrozenRows","getMovableVirtualHeader","getFrozenVirtualHeader","newRow","index.TreeGrid","index.Filter","index.Page","index.Sort","index.Reorder","index.Toolbar","index.Aggregate","index.Resize","index.ColumnMenu","index.ExcelExport","index.PdfExport","index.CommandColumn","index.ContextMenu","index.Edit","index.Selection","index.VirtualScroll","index.DetailRow","index.RowDD","index.Freeze","index.ColumnChooser","index.Logger","index.InfiniteScroll"],"mappings":"uEAQA,SAAgBA,GAAaC,GACzB,GAAIA,EAAOC,qBAAsBC,eAAa,CAC1C,GAAIC,GAAUH,EAAOC,WAAWE,OAChC,OAAQA,aAAmBC,iBACtBD,YAAmBE,kBAAmBF,YAAmBG,qBACzDH,YAAmBI,iBAAiBJ,YAAmBK,cAEhE,OAAO,EAMX,QAAgBC,GAAgBT,GAC5B,SAAIA,EAAOC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eC,GAAiBC,GAAcC,GAAkBC,GAAmBC,GAAiBC,GAAqBC,GAAmBC,GAAYC,EAAiBC,GAAqBC,GAAiBC,EAAaC,GAAcC,GAAqBC,EAAcC,yBrCEtU,sBAEQ,2BAEH,4BAEI,kCAEE,gCAEJ,gCAEI,mCAED,gCAEF,6BAED,+BAEG,iCAED,+BAED,mCAEK,sCAEF,+BAEL,wBAEF,uBAEC,wBAEA,yBAEC,4BAEE,0CAEY,2CAEX,gCAEA,mCAEE,qCAEC,gCAEN,2BAEC,wCAEY,uCAEb,yBAED,uBAED,+BAES,+BAET,uBAEC,uBAED,yBAEG,4BAEA,yBAEH,+BAES,qCAEH,mCAEC,8BAEN,yBAEC,2BAEA,0BAED,kCAES,yCAED,gCAEV,yBAEK,gCAEC,mCAEE,gCAEE,8CAEI,2CAEN,4BAER,+BAEW,+BAEX,yBAEK,yBAEL,wBAEG,2BAEA,2BAEA,wBAEH"}
1
+ {"version":3,"file":"ej2-treegrid.min.js","sources":["../../src/treegrid/utils.js","../../src/treegrid/actions/crud-actions.js","../../src/treegrid/models/column.js","../../src/treegrid/models/filter-settings.js","../../src/treegrid/models/textwrap-settings.js","../../src/treegrid/actions/logger.js","../../src/treegrid/actions/clipboard.js","../../src/treegrid/base/constant.js","../../src/treegrid/actions/selection.js","../../src/treegrid/actions/print.js","../../src/treegrid/models/search-settings.js","../../src/treegrid/models/selection-settings.js","../../src/treegrid/renderer/render.js","../../src/treegrid/base/data.js","../../src/treegrid/actions/rowdragdrop.js","../../src/treegrid/enum.js","../../src/treegrid/models/page-settings.js","../../src/treegrid/models/summary.js","../../src/treegrid/models/edit-settings.js","../../src/treegrid/models/sort-settings.js","../../src/treegrid/models/infinite-scroll-settings.js","../../src/treegrid/base/treegrid.js","../../src/treegrid/actions/reorder.js","../../src/treegrid/actions/resize.js","../../src/treegrid/models/rowdrop-settings.js","../../src/treegrid/renderer/virtual-row-model-generator.js","../../src/treegrid/actions/filter.js","../../src/treegrid/actions/excel-export.js","../../src/treegrid/actions/pdf-export.js","../../src/treegrid/actions/page.js","../../src/treegrid/actions/toolbar.js","../../src/treegrid/actions/summary.js","../../src/treegrid/actions/sort.js","../../src/treegrid/actions/column-menu.js","../../src/treegrid/actions/context-menu.js","../../src/treegrid/actions/batch-edit.js","../../src/treegrid/actions/edit.js","../../src/treegrid/actions/command-column.js","../../src/treegrid/actions/detail-row.js","../../src/treegrid/renderer/virtual-tree-content-render.js","../../src/treegrid/actions/virtual-scroll.js","../../src/treegrid/actions/freeze-column.js","../../src/treegrid/actions/column-chooser.js","../../src/treegrid/actions/infinite-scroll.js","../../src/global.js"],"sourcesContent":["import { getObject } from '@syncfusion/ej2-grids';\nimport { DataManager, ODataAdaptor, UrlAdaptor } from '@syncfusion/ej2-data';\nimport { WebApiAdaptor, WebMethodAdaptor, CacheAdaptor } from '@syncfusion/ej2-data';\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Specifies whether remote data binding\n */\nexport function isRemoteData(parent) {\n if (parent.dataSource instanceof DataManager) {\n var adaptor = parent.dataSource.adaptor;\n return (adaptor instanceof ODataAdaptor ||\n (adaptor instanceof WebApiAdaptor) || (adaptor instanceof WebMethodAdaptor) ||\n (adaptor instanceof CacheAdaptor) || adaptor instanceof UrlAdaptor);\n }\n return false;\n}\n/**\n * @param {TreeGrid | IGrid} parent - Tree Grid or Grid instance\n * @returns {boolean} - Returns whether custom binding\n */\nexport function isCountRequired(parent) {\n if (parent.dataSource && 'result' in parent.dataSource) {\n return true;\n }\n return false;\n}\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Returns whether checkbox column is enabled\n */\nexport function isCheckboxcolumn(parent) {\n for (var i = 0; i < parent.columns.length; i++) {\n if (parent.columns[i].showCheckbox) {\n return true;\n }\n }\n return false;\n}\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Returns whether filtering and searching done\n */\nexport function isFilterChildHierarchy(parent) {\n if ((!isNullOrUndefined(parent.grid.searchSettings.key) && parent.grid.searchSettings.key !== '' &&\n (parent.searchSettings.hierarchyMode === 'Child' || parent.searchSettings.hierarchyMode === 'None')) ||\n (parent.allowFiltering && parent.grid.filterSettings.columns.length &&\n (parent.filterSettings.hierarchyMode === 'Child' || parent.filterSettings.hierarchyMode === 'None'))) {\n return true;\n }\n return false;\n}\n/**\n * @param {Object} records - Define records for which parent records has to be found\n * @hidden\n * @returns {Object} - Returns parent records collection\n */\nexport function findParentRecords(records) {\n var datas = [];\n var recordsLength = Object.keys(records).length;\n for (var i = 0, len = recordsLength; i < len; i++) {\n var hasChild = getObject('hasChildRecords', records[i]);\n if (hasChild) {\n datas.push(records[i]);\n }\n }\n return datas;\n}\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Returns the expand status of record\n * @param {ITreeData} record - Define the record for which expand status has be found\n * @param {ITreeData[]} parents - Parent Data collection\n * @hidden\n */\nexport function getExpandStatus(parent, record, parents) {\n var parentRecord = isNullOrUndefined(record.parentItem) ? null :\n getParentData(parent, record.parentItem.uniqueID);\n var childParent;\n if (parentRecord != null) {\n if (parent.initialRender && !isNullOrUndefined(parentRecord[parent.expandStateMapping])\n && !parentRecord[parent.expandStateMapping]) {\n parentRecord.expanded = false;\n return false;\n }\n else if (parentRecord.expanded === false) {\n return false;\n }\n else if (parentRecord.parentItem) {\n childParent = getParentData(parent, parentRecord.parentItem.uniqueID);\n if (childParent && parent.initialRender && !isNullOrUndefined(childParent[parent.expandStateMapping])\n && !childParent[parent.expandStateMapping]) {\n childParent.expanded = false;\n return false;\n }\n if (childParent && childParent.expanded === false) {\n return false;\n }\n else if (childParent) {\n return getExpandStatus(parent, childParent, parents);\n }\n return true;\n }\n else {\n return true;\n }\n }\n else {\n return true;\n }\n}\n/**\n * @param {ITreeData} records - Define the record for which child records has to be found\n * @returns {Object[]} - Returns child records collection\n * @hidden\n */\nexport function findChildrenRecords(records) {\n var datas = [];\n if (isNullOrUndefined(records) || (!records.hasChildRecords && !isNullOrUndefined(records.childRecords)\n && !records.childRecords.length)) {\n return [];\n }\n if (!isNullOrUndefined(records.childRecords)) {\n var childRecords = records.childRecords;\n var keys = Object.keys(childRecords);\n for (var i = 0, len = keys.length; i < len; i++) {\n datas.push(childRecords[i]);\n if (childRecords[i].hasChildRecords || (!isNullOrUndefined(childRecords[i].childRecords) &&\n childRecords[i].childRecords.length)) {\n datas = datas.concat(findChildrenRecords(childRecords[i]));\n }\n }\n }\n return datas;\n}\n/**\n * @param {TreeGrid} parent - Tree Grid instance\n * @returns {boolean} - Returns whether local data binding\n */\nexport function isOffline(parent) {\n if (isRemoteData(parent)) {\n var dm = parent.dataSource;\n return !isNullOrUndefined(dm.ready);\n }\n return true;\n}\n/**\n * @param {Object[]} array - Defines the array to be cloned\n * @returns {Object[]} - Returns cloned array collection\n */\nexport function extendArray(array) {\n var objArr = [];\n var obj;\n var keys;\n for (var i = 0; array && i < array.length; i++) {\n keys = Object.keys(array[i]);\n obj = {};\n for (var j = 0; j < keys.length; j++) {\n obj[keys[j]] = array[i][keys[j]];\n }\n objArr.push(obj);\n }\n return objArr;\n}\n/**\n * @param {ITreeData} value - Defined the dirty data to be cleaned\n * @returns {ITreeData} - Returns cleaned original data\n */\nexport function getPlainData(value) {\n delete value.hasChildRecords;\n delete value.childRecords;\n delete value.index;\n delete value.parentItem;\n delete value.level;\n delete value.taskData;\n delete value.uniqueID;\n return value;\n}\n/**\n * @param {TreeGrid} parent - TreeGrid instance\n * @param {string} value - IdMapping field name\n * @param {boolean} requireFilter - Specified whether treegrid data is filtered\n * @returns {ITreeData} - Returns IdMapping matched record\n */\nexport function getParentData(parent, value, requireFilter) {\n if (requireFilter) {\n var idFilter = 'uniqueIDFilterCollection';\n return parent[idFilter][value];\n }\n else {\n var id = 'uniqueIDCollection';\n return parent[id][value];\n }\n}\n/**\n * @param {HTMLTableRowElement} el - Row element\n * @returns {boolean} - Returns whether hidden\n */\nexport function isHidden(el) {\n var style = window.getComputedStyle(el);\n return ((style.display === 'none') || (style.visibility === 'hidden'));\n}\n","import { isNullOrUndefined, extend, getValue } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { extendArray, getPlainData, getParentData } from '../utils';\n/**\n * Performs CRUD update to Tree Grid data source\n *\n * @param {{value: ITreeData, action: string }} details - Gets modified record value and CRUD action type\n * @param {TreeGrid} details.value - Gets modified record value\n * @param {string} details.action - CRUD action type\n * @param {TreeGrid} control - Tree Grid instance\n * @param {boolean} isSelfReference - Denotes whether Self Referential data binding\n * @param {number} addRowIndex - New add row index\n * @param {number} selectedIndex - Selected Row index\n * @param {string} columnName - Column field name\n * @param {ITreeData} addRowRecord - Newly added record\n * @returns {void}\n */\nexport function editAction(details, control, isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord) {\n var value = details.value;\n var action = details.action;\n var changedRecords = 'changedRecords';\n var i;\n var j;\n var addedRecords = 'addedRecords';\n var batchChanges;\n var key = control.grid.getPrimaryKeyFieldNames()[0];\n var treeData = control.dataSource instanceof DataManager ?\n control.dataSource.dataSource.json : control.dataSource;\n var modifiedData = [];\n var originalData = value;\n var isSkip = false;\n if (control.editSettings.mode === 'Batch') {\n batchChanges = control.grid.editModule.getBatchChanges();\n }\n if (action === 'add' || (action === 'batchsave' && (control.editSettings.mode === 'Batch'\n && batchChanges[addedRecords].length))) {\n var addAct = addAction(details, treeData, control, isSelfReference, addRowIndex, selectedIndex, addRowRecord);\n value = addAct.value;\n isSkip = addAct.isSkip;\n }\n if (value instanceof Array) {\n modifiedData = extendArray(value);\n }\n else {\n modifiedData.push(extend({}, value));\n }\n if (!isSkip && (action !== 'add' ||\n (control.editSettings.newRowPosition !== 'Top' && control.editSettings.newRowPosition !== 'Bottom'))) {\n for (var k = 0; k < modifiedData.length; k++) {\n if (typeof (modifiedData[k][key]) === 'object') {\n modifiedData[k] = modifiedData[k][key];\n }\n var keys = modifiedData[k].taskData ? Object.keys(modifiedData[k].taskData) :\n Object.keys(modifiedData[k]);\n i = treeData.length;\n var _loop_1 = function () {\n if (treeData[i][key] === modifiedData[k][key]) {\n if (action === 'delete') {\n var currentData_1 = treeData[i];\n treeData.splice(i, 1);\n if (isSelfReference) {\n if (!isNullOrUndefined(currentData_1[control.parentIdMapping])) {\n var parentData = control.flatData.filter(function (e) {\n return e[control.idMapping] === currentData_1[control.parentIdMapping];\n })[0];\n var childRecords = parentData ? parentData[control.childMapping] : [];\n for (var p = childRecords.length - 1; p >= 0; p--) {\n if (childRecords[p][control.idMapping] === currentData_1[control.idMapping]) {\n if (!control.enableImmutableMode) {\n parentData['childRecords'].splice(p, 1);\n }\n childRecords.splice(p, 1);\n if (!childRecords.length) {\n parentData.hasChildRecords = false;\n updateParentRow(key, parentData, action, control, isSelfReference);\n }\n break;\n }\n }\n }\n return \"break\";\n }\n }\n else {\n if (action === 'edit') {\n for (j = 0; j < keys.length; j++) {\n if (Object.prototype.hasOwnProperty.call(treeData[i], keys[j]) && ((control.editSettings.mode !== 'Cell'\n || (!isNullOrUndefined(batchChanges) && batchChanges[changedRecords].length === 0))\n || keys[j] === columnName)) {\n var editedData = getParentData(control, modifiedData[k].uniqueID);\n treeData[i][keys[j]] = modifiedData[k][keys[j]];\n if (editedData && editedData.taskData) {\n editedData.taskData[keys[j]] = editedData[keys[j]] = treeData[i][keys[j]];\n }\n }\n }\n }\n else if (action === 'add' || action === 'batchsave') {\n var index = void 0;\n if (control.editSettings.newRowPosition === 'Child') {\n if (isSelfReference) {\n originalData.taskData[control.parentIdMapping] = treeData[i][control.idMapping];\n treeData.splice(i + 1, 0, originalData.taskData);\n }\n else {\n if (!Object.prototype.hasOwnProperty.call(treeData[i], control.childMapping)) {\n treeData[i][control.childMapping] = [];\n }\n treeData[i][control.childMapping].push(originalData.taskData);\n updateParentRow(key, treeData[i], action, control, isSelfReference, originalData);\n }\n }\n else if (control.editSettings.newRowPosition === 'Below') {\n treeData.splice(i + 1, 0, originalData.taskData);\n if (!isNullOrUndefined(originalData.parentItem)) {\n updateParentRow(key, treeData[i + 1], action, control, isSelfReference, originalData);\n }\n }\n else if (!addRowIndex) {\n index = 0;\n treeData.splice(index, 0, originalData.taskData);\n }\n else if (control.editSettings.newRowPosition === 'Above') {\n treeData.splice(i, 0, originalData.taskData);\n if (!isNullOrUndefined(originalData.parentItem)) {\n updateParentRow(key, treeData[i], action, control, isSelfReference, originalData);\n }\n }\n }\n return \"break\";\n }\n }\n else if (!isNullOrUndefined(treeData[i][control.childMapping])) {\n if (removeChildRecords(treeData[i][control.childMapping], modifiedData[k], action, key, control, isSelfReference, originalData, columnName)) {\n updateParentRow(key, treeData[i], action, control, isSelfReference);\n }\n }\n };\n while (i-- && i >= 0) {\n var state_1 = _loop_1();\n if (state_1 === \"break\")\n break;\n }\n }\n }\n}\n/**\n * Performs Add action to Tree Grid data source\n *\n * @param {{value: ITreeData, action: string }} details - Gets modified record value and CRUD action type\n * @param {TreeGrid} details.value - Gets modified record value\n * @param {string} details.action - CRUD action type\n * @param {Object[]} treeData - Tree Grid data source\n * @param {TreeGrid} control - Tree Grid instance\n * @param {boolean} isSelfReference - Denotes whether Self Referential data binding\n * @param {number} addRowIndex - New add row index\n * @param {number} selectedIndex - Selected Row index\n * @param {ITreeData} addRowRecord - Newly added record\n * @returns {void}\n */\nexport function addAction(details, treeData, control, isSelfReference, addRowIndex, selectedIndex, addRowRecord) {\n var value;\n var isSkip = false;\n var currentViewRecords = control.grid.getCurrentViewRecords();\n value = extend({}, details.value);\n value = getPlainData(value);\n switch (control.editSettings.newRowPosition) {\n case 'Top':\n treeData.unshift(value);\n isSkip = true;\n break;\n case 'Bottom':\n treeData.push(value);\n isSkip = true;\n break;\n case 'Above':\n if (!isNullOrUndefined(addRowRecord)) {\n value = extend({}, addRowRecord);\n value = getPlainData(value);\n }\n else {\n value = extend({}, currentViewRecords[addRowIndex + 1]);\n value = getPlainData(value);\n }\n break;\n case 'Below':\n case 'Child':\n if (!isNullOrUndefined(addRowRecord)) {\n value = extend({}, addRowRecord);\n value = getPlainData(value);\n }\n else {\n var primaryKeys = control.grid.getPrimaryKeyFieldNames()[0];\n var currentdata = currentViewRecords[addRowIndex];\n if (!isNullOrUndefined(currentdata) && currentdata[primaryKeys] === details.value[primaryKeys] || selectedIndex !== -1) {\n value = extend({}, currentdata);\n }\n else {\n value = extend({}, details.value);\n }\n value = getPlainData(value);\n var internalProperty = 'internalProperties';\n control.editModule[internalProperty].taskData = value;\n }\n if (selectedIndex === -1) {\n treeData.unshift(value);\n isSkip = true;\n }\n }\n return { value: value, isSkip: isSkip };\n}\n/**\n * @param {ITreeData[]} childRecords - Child Records collection\n * @param {Object} modifiedData - Modified data in crud action\n * @param {string} action - crud action type\n * @param {string} key - Primary key field name\n * @param {TreeGrid} control - Tree Grid instance\n * @param {boolean} isSelfReference - Specified whether Self Referential data binding\n * @param {ITreeData} originalData - Non updated data from data source, of edited data\n * @param {string} columnName - column field name\n * @returns {boolean} Returns whether child records exists\n */\nexport function removeChildRecords(childRecords, modifiedData, action, key, control, isSelfReference, originalData, columnName) {\n var isChildAll = false;\n var j = childRecords.length;\n while (j-- && j >= 0) {\n if (childRecords[j][key] === modifiedData[key] ||\n (isSelfReference && childRecords[j][control.parentIdMapping] === modifiedData[control.idMapping])) {\n if (action === 'edit') {\n var keys = Object.keys(modifiedData);\n var editedData = getParentData(control, modifiedData.uniqueID);\n for (var i = 0; i < keys.length; i++) {\n if (Object.prototype.hasOwnProperty.call(childRecords[j], keys[i]) && (control.editSettings.mode !== 'Cell' || keys[i] === columnName)) {\n editedData[keys[i]] = editedData.taskData[keys[i]] = childRecords[j][keys[i]] = modifiedData[keys[i]];\n if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell') {\n var editModule = 'editModule';\n control.grid.editModule[editModule].editRowIndex = modifiedData.index;\n control.grid.editModule[editModule].updateCurrentViewData(modifiedData);\n }\n }\n }\n break;\n }\n else if (action === 'add' || action === 'batchsave') {\n if (control.editSettings.newRowPosition === 'Child') {\n if (isSelfReference) {\n originalData[control.parentIdMapping] = childRecords[j][control.idMapping];\n childRecords.splice(j + 1, 0, originalData);\n updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);\n }\n else {\n if (!Object.prototype.hasOwnProperty.call(childRecords[j], control.childMapping)) {\n childRecords[j][control.childMapping] = [];\n }\n childRecords[j][control.childMapping].push(originalData.taskData);\n updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);\n }\n }\n else if (control.editSettings.newRowPosition === 'Above') {\n childRecords.splice(j, 0, originalData.taskData);\n if (!isNullOrUndefined(originalData.parentItem)) {\n updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);\n }\n }\n else if (control.editSettings.newRowPosition === 'Below') {\n childRecords.splice(j + 1, 0, originalData.taskData);\n if (!isNullOrUndefined(originalData.parentItem)) {\n updateParentRow(key, childRecords[j], action, control, isSelfReference, originalData);\n }\n }\n }\n else {\n childRecords.splice(j, 1);\n if (!childRecords.length) {\n isChildAll = true;\n }\n }\n }\n else if (!isNullOrUndefined(childRecords[j][control.childMapping])) {\n if (removeChildRecords(childRecords[j][control.childMapping], modifiedData, action, key, control, isSelfReference, originalData, columnName)) {\n updateParentRow(key, childRecords[j], action, control, isSelfReference);\n }\n }\n }\n return isChildAll;\n}\n/**\n * @param {string} key - Primary key field name\n * @param {ITreeData} record - Parent Record which has to be updated\n * @param {string} action - CRUD action type\n * @param {TreeGrid} control - Tree Grid instance\n * @param {boolean} isSelfReference - Specified whether self referential data binding\n * @param {ITreeData} child - Specifies child record\n * @returns {void}\n */\nexport function updateParentRow(key, record, action, control, isSelfReference, child) {\n if ((control.editSettings.newRowPosition === 'Above' || control.editSettings.newRowPosition === 'Below')\n && ((action === 'add' || action === 'batchsave')) && !isNullOrUndefined(child.parentItem)) {\n var parentData = getParentData(control, child.parentItem.uniqueID);\n parentData.childRecords.push(child);\n }\n else {\n var currentRecords = control.grid.getCurrentViewRecords();\n var index_1;\n currentRecords.map(function (e, i) { if (e[key] === record[key]) {\n index_1 = i;\n return;\n } });\n if (!isNullOrUndefined(index_1)) {\n record = currentRecords[index_1];\n }\n if (control.enableVirtualization && isNullOrUndefined(record) && !isNullOrUndefined(child)) {\n record = getValue('uniqueIDCollection.' + child.parentUniqueID, control);\n }\n if (!isSelfReference && !isNullOrUndefined(record.childRecords) && record.childRecords.length) {\n record.hasChildRecords = true;\n }\n else {\n record.hasChildRecords = false;\n }\n if (action === 'add' || action === 'batchsave') {\n record.expanded = true;\n record.hasChildRecords = true;\n if (control.sortSettings.columns.length && isNullOrUndefined(child)) {\n child = currentRecords.filter(function (e) {\n if (e.parentUniqueID === record.uniqueID) {\n return e;\n }\n else {\n return null;\n }\n });\n }\n var childRecords = child ? child instanceof Array ? child[0] : child : currentRecords[index_1 + 1];\n if (control.editSettings.newRowPosition !== 'Below') {\n if (!Object.prototype.hasOwnProperty.call(record, 'childRecords')) {\n record.childRecords = [];\n }\n else {\n if (!isNullOrUndefined(child) && record[key] !== child[key]) {\n record.childRecords.push(child);\n }\n }\n if (record.childRecords.indexOf(childRecords) === -1 && record[key] !== child[key]) {\n record.childRecords.unshift(childRecords);\n }\n if (isSelfReference) {\n if (!Object.prototype.hasOwnProperty.call(record, control.childMapping)) {\n record[control.childMapping] = [];\n }\n if (record[control.childMapping].indexOf(childRecords) === -1 && record[key] !== child[key]) {\n record[control.childMapping].unshift(childRecords);\n }\n }\n }\n }\n var primaryKeys = control.grid.getPrimaryKeyFieldNames()[0];\n var data = control.grid.dataSource instanceof DataManager ?\n control.grid.dataSource.dataSource.json : control.grid.dataSource;\n for (var i = 0; i < data.length; i++) {\n if (data[i][primaryKeys] === record[primaryKeys]) {\n data[i] = record;\n break;\n }\n }\n control.grid.setRowData(key, record);\n var row = control.getRowByIndex(index_1);\n if (control.editSettings.mode === 'Batch') {\n row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record[key])];\n }\n var movableRow = void 0;\n if (control.frozenRows || control.getFrozenColumns()) {\n movableRow = control.getMovableRowByIndex(index_1);\n }\n if (!control.enableVirtualization && !isNullOrUndefined(row) || !isNullOrUndefined(movableRow)) {\n var index_2 = control.treeColumnIndex;\n if (control.allowRowDragAndDrop && control.enableImmutableMode) {\n index_2 = index_2 + 1;\n }\n control.renderModule.cellRender({\n data: record, cell: row.cells[index_2] ? row.cells[index_2]\n : movableRow.cells[index_2 - control.getFrozenColumns()],\n column: control.grid.getColumns()[control.treeColumnIndex],\n requestType: action\n });\n if (control.enableImmutableMode && control['action'] === 'indenting' || control['action'] === 'outdenting') {\n control.renderModule.RowModifier({\n data: record, row: row\n });\n }\n }\n }\n}\n","import { merge } from '@syncfusion/ej2-base';\n/**\n * Represents TreeGrid `Column` model class.\n */\nvar Column = /** @class */ (function () {\n function Column(options) {\n /**\n * If `allowEditing` set to false, then it disables editing of a particular column.\n * By default all columns are editable.\n *\n * @default true\n */\n this.allowEditing = true;\n /**\n * Defines the `IEditCell` object to customize default edit cell.\n *\n * @default {}\n */\n this.edit = {};\n /**\n * If `disableHtmlEncode` is set to true, it encodes the HTML of the header and content cells.\n *\n * @default true\n */\n this.disableHtmlEncode = true;\n /**\n * If `allowReordering` set to false, then it disables reorder of a particular column.\n * By default all columns can be reorder.\n *\n * @default true\n */\n this.allowReordering = true;\n /**\n * If `showColumnMenu` set to false, then it disable the column menu of a particular column.\n * By default column menu will show for all columns\n *\n * @default true\n */\n this.showColumnMenu = true;\n /**\n * If `allowFiltering` set to false, then it disables filtering option and filter bar element of a particular column.\n * By default all columns are filterable.\n *\n * @default true\n */\n this.allowFiltering = true;\n /**\n * If `allowSorting` set to false, then it disables sorting option of a particular column.\n * By default all columns are sortable.\n *\n * @default true\n */\n this.allowSorting = true;\n /**\n * If `allowResizing` is set to false, it disables resize option of a particular column.\n * By default all the columns can be resized.\n *\n * @default true\n */\n this.allowResizing = true;\n /**\n * It is used to customize the default filter options for a specific columns.\n * * type - Specifies the filter type as menu.\n * * ui - to render custom component for specific column it has following functions.\n * * ui.create – It is used for creating custom components.\n * * ui.read - It is used for read the value from the component.\n * * ui.write - It is used to apply component model as dynamically.\n *\n * @default null\n */\n this.filter = {};\n merge(this, options);\n }\n return Column;\n}());\nexport { Column };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Collection, Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Represents the Tree Grid predicate for the filter column.\n */\nvar Predicate = /** @class */ (function (_super) {\n __extends(Predicate, _super);\n function Predicate() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], Predicate.prototype, \"field\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"operator\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"value\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"matchCase\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"ignoreAccent\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"predicate\", void 0);\n __decorate([\n Property({})\n ], Predicate.prototype, \"actualFilterValue\", void 0);\n __decorate([\n Property({})\n ], Predicate.prototype, \"actualOperator\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"type\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"ejpredicate\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"uid\", void 0);\n __decorate([\n Property()\n ], Predicate.prototype, \"isForeignKey\", void 0);\n return Predicate;\n}(ChildProperty));\nexport { Predicate };\n/**\n * Configures the filtering behavior of the TreeGrid.\n */\nvar FilterSettings = /** @class */ (function (_super) {\n __extends(FilterSettings, _super);\n function FilterSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Collection([], Predicate)\n ], FilterSettings.prototype, \"columns\", void 0);\n __decorate([\n Property('FilterBar')\n ], FilterSettings.prototype, \"type\", void 0);\n __decorate([\n Property()\n ], FilterSettings.prototype, \"mode\", void 0);\n __decorate([\n Property(true)\n ], FilterSettings.prototype, \"showFilterBarStatus\", void 0);\n __decorate([\n Property(1500)\n ], FilterSettings.prototype, \"immediateModeDelay\", void 0);\n __decorate([\n Property()\n ], FilterSettings.prototype, \"operators\", void 0);\n __decorate([\n Property(false)\n ], FilterSettings.prototype, \"ignoreAccent\", void 0);\n __decorate([\n Property('Parent')\n ], FilterSettings.prototype, \"hierarchyMode\", void 0);\n return FilterSettings;\n}(ChildProperty));\nexport { FilterSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the textwrap behavior of the TreeGrid.\n */\nvar TextWrapSettings = /** @class */ (function (_super) {\n __extends(TextWrapSettings, _super);\n function TextWrapSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('Both')\n ], TextWrapSettings.prototype, \"wrapMode\", void 0);\n return TextWrapSettings;\n}(ChildProperty));\nexport { TextWrapSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { Logger as GridLogger, Grid, detailLists } from '@syncfusion/ej2-grids';\n/**\n * Logger module for TreeGrid\n *\n * @hidden\n */\nvar DOC_URL = 'https://ej2.syncfusion.com/documentation/treegrid';\nvar BASE_DOC_URL = 'https://ej2.syncfusion.com/documentation';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar WARNING = '[EJ2TreeGrid.Warning]';\nvar ERROR = '[EJ2TreeGrid.Error]';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nvar INFO = '[EJ2TreeGrid.Info]';\nvar IsRowDDEnabled = false;\nvar Logger = /** @class */ (function (_super) {\n __extends(Logger, _super);\n function Logger(parent) {\n var _this = this;\n Grid.Inject(GridLogger);\n _this = _super.call(this, parent) || this;\n return _this;\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} - Returns Logger module name\n */\n Logger.prototype.getModuleName = function () {\n return 'logger';\n };\n Logger.prototype.log = function (types, args) {\n if (!(types instanceof Array)) {\n types = [types];\n }\n var type = types;\n for (var i = 0; i < type.length; i++) {\n var item = detailLists[type[i]];\n var cOp = item.check(args, this.parent);\n if (cOp.success) {\n var message = item.generateMessage(args, this.parent, cOp.options);\n message = message.replace('EJ2Grid', 'EJ2TreeGrid').replace('* Hierarchy Grid', '').replace('* Grouping', '');\n if (IsRowDDEnabled && type[i] === 'primary_column_missing') {\n message = message.replace('Editing', 'Row DragAndDrop');\n IsRowDDEnabled = false;\n }\n var index = message.indexOf('https');\n var gridurl = message.substring(index);\n if (type[i] === 'module_missing') {\n message = message.replace(gridurl, DOC_URL + '/modules');\n }\n else if (type[i] === 'primary_column_missing' || type[i] === 'selection_key_missing') {\n message = message.replace(gridurl, BASE_DOC_URL + '/api/treegrid/column/#isprimarykey');\n }\n else if (type[i] === 'grid_remote_edit') {\n message = message.replace(gridurl, DOC_URL + '/edit');\n }\n else if (type[i] === 'virtual_height') {\n message = message.replace(gridurl, DOC_URL + '/virtual');\n }\n else if (type[i] === 'check_datasource_columns') {\n message = message.replace(gridurl, DOC_URL + '/columns');\n }\n else if (type[i] === 'locale_missing') {\n message = message.replace(gridurl, DOC_URL + '/global-local/#localization');\n }\n if (type[i] === 'datasource_syntax_mismatch') {\n if (!isNullOrUndefined(this.treeGridObj) && !isNullOrUndefined(this.treeGridObj.dataStateChange)) {\n // eslint-disable-next-line no-console\n console[item.logType](message);\n }\n }\n else {\n // eslint-disable-next-line no-console\n console[item.logType](message);\n }\n }\n }\n };\n Logger.prototype.treeLog = function (types, args, treeGrid) {\n this.treeGridObj = treeGrid;\n if (!(types instanceof Array)) {\n types = [types];\n }\n var type = types;\n if (treeGrid.allowRowDragAndDrop && !treeGrid.columns.filter(function (column) { return column.isPrimaryKey; }).length) {\n IsRowDDEnabled = true;\n this.log('primary_column_missing', args);\n }\n for (var i = 0; i < type.length; i++) {\n var item = treeGridDetails[type[i]];\n var cOp = item.check(args, treeGrid);\n if (cOp.success) {\n var message = item.generateMessage(args, treeGrid, cOp.options);\n // eslint-disable-next-line no-console\n console[item.logType](message);\n }\n }\n };\n return Logger;\n}(GridLogger));\nexport { Logger };\nexport var treeGridDetails = {\n // eslint-disable-next-line camelcase\n mapping_fields_missing: {\n type: 'mapping_fields_missing',\n logType: 'error',\n check: function (args, parent) {\n var opt = { success: false };\n if ((isNullOrUndefined(parent.idMapping) && isNullOrUndefined(parent.childMapping)\n && isNullOrUndefined(parent.parentIdMapping)) ||\n (!isNullOrUndefined(parent.idMapping) && isNullOrUndefined(parent.parentIdMapping)) ||\n (isNullOrUndefined(parent.idMapping) && !isNullOrUndefined(parent.parentIdMapping))) {\n opt = { success: true };\n }\n return opt;\n },\n generateMessage: function () {\n return ERROR + ':' + ' MAPPING FIELDS MISSING \\n' + 'One of the following fields is missing. It is ' +\n 'required for the hierarchical relationship of records in TreeGrid:\\n' +\n '* childMapping\\n' + '* idMapping\\n' + '* parentIdMapping\\n' +\n 'Refer to the following documentation links for more details.\\n' +\n (BASE_DOC_URL + \"/api/treegrid#childmapping\") + '\\n' +\n (BASE_DOC_URL + \"/api/treegrid#idmapping\") + '\\n' +\n (BASE_DOC_URL + \"/api/treegrid#$parentidmapping\");\n }\n }\n};\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport * as events from '../base/constant';\nimport { isNullOrUndefined, Browser } from '@syncfusion/ej2-base';\nimport { Clipboard as GridClipboard } from '@syncfusion/ej2-grids';\n/**\n * The `Clipboard` module is used to handle clipboard copy action.\n *\n * @hidden\n */\nvar TreeClipboard = /** @class */ (function (_super) {\n __extends(TreeClipboard, _super);\n function TreeClipboard(parent) {\n var _this = _super.call(this, parent.grid) || this;\n _this.treeCopyContent = '';\n _this.copiedUniqueIdCollection = [];\n _this.treeGridParent = parent;\n return _this;\n }\n TreeClipboard.prototype.setCopyData = function (withHeader) {\n var copyContent = 'copyContent';\n var getCopyData = 'getCopyData';\n var isSelect = 'isSelect';\n var uniqueID = 'uniqueID';\n var currentRecords = this.treeGridParent.getCurrentViewRecords();\n if (window.getSelection().toString() === '') {\n this.clipBoardTextArea.value = this[copyContent] = '';\n var rows = this.treeGridParent.grid.getRows();\n if (this.treeGridParent.selectionSettings.mode !== 'Cell') {\n var selectedIndexes = this.treeGridParent.getSelectedRowIndexes().sort(function (a, b) {\n return a - b;\n });\n for (var i = 0; i < selectedIndexes.length; i++) {\n if (i > 0) {\n this.treeCopyContent += '\\n';\n }\n if (!rows[selectedIndexes[i]].classList.contains('e-summaryrow')) {\n var cells = [].slice.call(rows[selectedIndexes[i]].querySelectorAll('.e-rowcell'));\n var uniqueid = this.treeGridParent.getSelectedRecords()[i][uniqueID];\n if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {\n if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {\n this.parentContentData(currentRecords, selectedIndexes[i], rows, withHeader, i);\n }\n this[getCopyData](cells, false, '\\t', withHeader);\n this.treeCopyContent += this[copyContent];\n this.copiedUniqueIdCollection.push(uniqueid);\n this[copyContent] = '';\n if (this.treeGridParent.copyHierarchyMode === 'Child' || this.treeGridParent.copyHierarchyMode === 'Both') {\n this.childContentData(currentRecords, selectedIndexes[i], rows, withHeader);\n }\n }\n }\n }\n if (withHeader) {\n var headerTextArray = [];\n for (var i = 0; i < this.treeGridParent.getVisibleColumns().length; i++) {\n headerTextArray[i] = this.treeGridParent.getVisibleColumns()[i].headerText;\n }\n this[getCopyData](headerTextArray, false, '\\t', withHeader);\n this.treeCopyContent = this[copyContent] + '\\n' + this.treeCopyContent;\n }\n var args = {\n data: this.treeCopyContent,\n cancel: false\n };\n this.treeGridParent.trigger(events.beforeCopy, args);\n if (args.cancel) {\n return;\n }\n this.clipBoardTextArea.value = this[copyContent] = args.data;\n if (!Browser.userAgent.match(/ipad|ipod|iphone/i)) {\n this.clipBoardTextArea.select();\n }\n else {\n this.clipBoardTextArea.setSelectionRange(0, this.clipBoardTextArea.value.length);\n }\n this[isSelect] = true;\n this.copiedUniqueIdCollection = [];\n this.treeCopyContent = '';\n }\n else {\n _super.prototype.setCopyData.call(this, withHeader);\n }\n }\n };\n TreeClipboard.prototype.parentContentData = function (currentRecords, selectedIndex, rows, withHeader, index) {\n var getCopyData = 'getCopyData';\n var copyContent = 'copyContent';\n var parentItem = 'parentItem';\n var uniqueID = 'uniqueID';\n var level = 'level';\n if (!isNullOrUndefined(currentRecords[selectedIndex][parentItem])) {\n var treeLevel = currentRecords[selectedIndex][parentItem][level];\n for (var i = 0; i < treeLevel + 1; i++) {\n for (var j = 0; j < currentRecords.length; j++) {\n if (!isNullOrUndefined(currentRecords[selectedIndex][parentItem]) &&\n currentRecords[j][uniqueID] === currentRecords[selectedIndex][parentItem][uniqueID]) {\n selectedIndex = j;\n var cells = [].slice.call(rows[selectedIndex].querySelectorAll('.e-rowcell'));\n var uniqueid = currentRecords[j][uniqueID];\n if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {\n this[getCopyData](cells, false, '\\t', withHeader);\n if (index > 0) {\n this.treeCopyContent = this.treeCopyContent + this[copyContent] + '\\n';\n }\n else {\n this.treeCopyContent = this[copyContent] + '\\n' + this.treeCopyContent;\n }\n this.copiedUniqueIdCollection.push(uniqueid);\n this[copyContent] = '';\n break;\n }\n }\n }\n }\n }\n };\n TreeClipboard.prototype.copy = function (withHeader) {\n _super.prototype.copy.call(this, withHeader);\n };\n TreeClipboard.prototype.paste = function (data, rowIndex, colIndex) {\n _super.prototype.paste.call(this, data, rowIndex, colIndex);\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns clipboard module name\n */\n TreeClipboard.prototype.getModuleName = function () {\n return 'clipboard';\n };\n /**\n * To destroy the clipboard\n *\n * @returns {void}\n * @hidden\n */\n TreeClipboard.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n TreeClipboard.prototype.childContentData = function (currentRecords, selectedIndex, rows, withHeader) {\n var getCopyData = 'getCopyData';\n var copyContent = 'copyContent';\n var childRecords = 'childRecords';\n var hasChildRecords = 'hasChildRecords';\n var uniqueID = 'uniqueID';\n if (currentRecords[selectedIndex][hasChildRecords]) {\n var childData = currentRecords[selectedIndex][childRecords];\n for (var i = 0; i < childData.length; i++) {\n for (var j = 0; j < currentRecords.length; j++) {\n if (!isNullOrUndefined(childData[i][uniqueID]) && currentRecords[j][uniqueID] === childData[i][uniqueID]) {\n if ((!isNullOrUndefined(rows[j])) && !rows[j].classList.contains('e-summaryrow')) {\n var cells = [].slice.call(rows[j].querySelectorAll('.e-rowcell'));\n var uniqueid = currentRecords[j][uniqueID];\n if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {\n this[getCopyData](cells, false, '\\t', withHeader);\n this.treeCopyContent += ('\\n' + this[copyContent]);\n this[copyContent] = '';\n this.copiedUniqueIdCollection.push(uniqueid);\n this.childContentData(currentRecords, j, rows, withHeader);\n }\n }\n break;\n }\n }\n }\n }\n };\n return TreeClipboard;\n}(GridClipboard));\nexport { TreeClipboard };\n","/**\n * @hidden\n */\nexport var load = 'load';\n/** @hidden */\nexport var rowDataBound = 'rowDataBound';\n/** @hidden */\nexport var dataBound = 'dataBound';\n/** @hidden */\nexport var queryCellInfo = 'queryCellInfo';\n/** @hidden */\nexport var beforeDataBound = 'beforeDataBound';\n/** @hidden */\nexport var actionBegin = 'actionBegin';\n/** @hidden */\nexport var dataStateChange = 'dataStateChange';\n/** @hidden */\nexport var actionComplete = 'actionComplete';\n/** @hidden */\nexport var rowSelecting = 'rowSelecting';\n/** @hidden */\nexport var rowSelected = 'rowSelected';\n/** @hidden */\nexport var checkboxChange = 'checkboxChange';\n/** @hidden */\nexport var rowDeselected = 'rowDeselected';\n/** @hidden */\nexport var toolbarClick = 'toolbarClick';\n/** @hidden */\nexport var beforeExcelExport = 'beforeExcelExport';\n/** @hidden */\nexport var beforePdfExport = 'beforePdfExport';\n/** @hidden */\nexport var resizeStop = 'resizeStop';\n/** @hidden */\nexport var expanded = 'expanded';\n/** @hidden */\nexport var expanding = 'expanding';\n/** @hidden */\nexport var collapsed = 'collapsed';\n/** @hidden */\nexport var collapsing = 'collapsing';\n/** @hidden */\nexport var remoteExpand = 'remoteExpand';\n/** @hidden */\nexport var localPagedExpandCollapse = 'localPagedExpandCollapse';\n/** @hidden */\nexport var pagingActions = 'pagingActions';\n/** @hidden */\nexport var printGridInit = 'printGrid-Init';\n/** @hidden */\nexport var contextMenuOpen = 'contextMenuOpen';\n/** @hidden */\nexport var contextMenuClick = 'contextMenuClick';\n/** @hidden */\nexport var beforeCopy = 'beforeCopy';\n/** @hidden */\nexport var beforePaste = 'beforePaste';\n/** @hidden */\nexport var savePreviousRowPosition = 'savePreviousRowPosition';\n/** @hidden */\nexport var crudAction = 'crudAction';\n/** @hidden */\nexport var beginEdit = 'beginEdit';\n/** @hidden */\nexport var beginAdd = 'beginAdd';\n/** @hidden */\nexport var recordDoubleClick = 'recordDoubleClick';\n/** @hidden */\nexport var cellSave = 'cellSave';\n/** @hidden */\nexport var cellSaved = 'cellSaved';\n/** @hidden */\nexport var cellEdit = 'cellEdit';\n/** @hidden */\nexport var batchDelete = 'batchDelete';\n/** @hidden */\nexport var batchCancel = 'batchCancel';\n/** @hidden */\nexport var batchAdd = 'batchAdd';\n/** @hidden */\nexport var beforeBatchDelete = 'beforeBatchDelete';\n/** @hidden */\nexport var beforeBatchAdd = 'beforeBatchAdd';\n/** @hidden */\nexport var beforeBatchSave = 'beforeBatchSave';\n/** @hidden */\nexport var batchSave = 'batchSave';\n/** @hidden */\nexport var keyPressed = 'key-pressed';\n/** @hidden */\nexport var updateData = 'update-data';\n/** @hidden */\nexport var doubleTap = 'double-tap';\n/** @hidden */\nexport var virtualColumnIndex = 'virtualColumnIndex';\n/** @hidden */\nexport var virtualActionArgs = 'virtual-action-args';\n/** @hidden */\nexport var destroy = 'destroy';\n/** @hidden */\nexport var dataListener = 'data-listener';\n/** @hidden */\nexport var indexModifier = 'index-modifier';\n/** @hidden */\nexport var beforeStartEdit = 'edit-form';\n/** @hidden */\nexport var beforeBatchCancel = 'before-batch-cancel';\n/** @hidden */\nexport var batchEditFormRendered = 'batcheditform-rendered';\n/** @hidden */\nexport var detailDataBound = 'detailDataBound';\n/** @hidden */\nexport var rowDrag = 'rowDrag';\n/** @hidden */\nexport var rowDragStartHelper = 'rowDragStartHelper';\n/** @hidden */\nexport var rowDrop = 'rowDrop';\n/** @hidden */\nexport var rowDragStart = 'rowDragStart';\n/** @hidden */\nexport var rowsAdd = 'rows-add';\n/** @hidden */\nexport var rowsRemove = 'rows-remove';\n/** @hidden */\nexport var rowdraging = 'row-draging';\n/** @hidden */\nexport var rowDropped = 'row-dropped';\n/** @hidden */\nexport var autoCol = 'auto-col';\n","import { isNullOrUndefined, removeClass } from '@syncfusion/ej2-base';\nimport { createCheckBox } from '@syncfusion/ej2-buttons';\nimport { parentsUntil, getObject } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { getParentData, isRemoteData, isCheckboxcolumn, findChildrenRecords } from '../utils';\n/**\n * TreeGrid Selection module\n *\n * @hidden\n */\nvar Selection = /** @class */ (function () {\n /**\n * Constructor for Selection module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Selection(parent) {\n this.parent = parent;\n this.selectedItems = [];\n this.selectedIndexes = [];\n this.filteredList = [];\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Selection module name\n */\n Selection.prototype.getModuleName = function () {\n return 'selection';\n };\n Selection.prototype.addEventListener = function () {\n this.parent.on('dataBoundArg', this.headerCheckbox, this);\n this.parent.on('columnCheckbox', this.columnCheckbox, this);\n this.parent.on('updateGridActions', this.updateGridActions, this);\n this.parent.grid.on('colgroup-refresh', this.headerCheckbox, this);\n this.parent.on('checkboxSelection', this.checkboxSelection, this);\n };\n Selection.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('dataBoundArg', this.headerCheckbox);\n this.parent.off('columnCheckbox', this.columnCheckbox);\n this.parent.grid.off('colgroup-refresh', this.headerCheckbox);\n this.parent.off('checkboxSelection', this.checkboxSelection);\n this.parent.off('updateGridActions', this.updateGridActions);\n };\n /**\n * To destroy the Selection\n *\n * @returns {void}\n * @hidden\n */\n Selection.prototype.destroy = function () {\n this.removeEventListener();\n };\n Selection.prototype.checkboxSelection = function (args) {\n var target = getObject('target', args);\n var checkWrap = parentsUntil(target, 'e-checkbox-wrapper');\n var checkBox;\n if (checkWrap && checkWrap.querySelectorAll('.e-treecheckselect').length > 0) {\n checkBox = checkWrap.querySelector('input[type=\"checkbox\"]');\n var rowIndex = [];\n rowIndex.push(target.closest('tr').rowIndex);\n this.selectCheckboxes(rowIndex);\n this.triggerChkChangeEvent(checkBox, checkBox.nextElementSibling.classList.contains('e-check'), target.closest('tr'));\n }\n else if (checkWrap && checkWrap.querySelectorAll('.e-treeselectall').length > 0 && this.parent.autoCheckHierarchy) {\n var checkBoxvalue = !checkWrap.querySelector('.e-frame').classList.contains('e-check')\n && !checkWrap.querySelector('.e-frame').classList.contains('e-stop');\n this.headerSelection(checkBoxvalue);\n checkBox = checkWrap.querySelector('input[type=\"checkbox\"]');\n this.triggerChkChangeEvent(checkBox, checkBoxvalue, target.closest('tr'));\n }\n };\n Selection.prototype.triggerChkChangeEvent = function (checkBox, checkState, rowElement) {\n var data = this.parent.getCurrentViewRecords()[rowElement.rowIndex];\n var args = { checked: checkState, target: checkBox, rowElement: rowElement,\n rowData: checkBox.classList.contains('e-treeselectall')\n ? this.parent.getCheckedRecords() : data };\n this.parent.trigger(events.checkboxChange, args);\n };\n Selection.prototype.getCheckboxcolumnIndex = function () {\n var mappingUid;\n var columnIndex;\n var columns = (this.parent.columns);\n for (var col = 0; col < columns.length; col++) {\n if (columns[col].showCheckbox) {\n mappingUid = this.parent.columns[col].uid;\n }\n }\n var headerCelllength = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv').length;\n for (var j = 0; j < headerCelllength; j++) {\n var headercell = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv')[j];\n if (headercell.getAttribute('e-mappinguid') === mappingUid) {\n columnIndex = j;\n }\n }\n return columnIndex;\n };\n Selection.prototype.headerCheckbox = function () {\n this.columnIndex = this.getCheckboxcolumnIndex();\n if (this.columnIndex > -1 && this.parent.getHeaderContent().querySelectorAll('.e-treeselectall').length === 0) {\n var headerElement = this.parent.getHeaderContent().querySelectorAll('.e-headercelldiv')[this.columnIndex];\n var value = false;\n var rowChkBox = this.parent.createElement('input', { className: 'e-treeselectall', attrs: { 'type': 'checkbox' } });\n var checkWrap = createCheckBox(this.parent.createElement, false, { checked: value, label: ' ' });\n checkWrap.classList.add('e-hierarchycheckbox');\n checkWrap.insertBefore(rowChkBox.cloneNode(), checkWrap.firstChild);\n if (!isNullOrUndefined(headerElement)) {\n headerElement.insertBefore(checkWrap, headerElement.firstChild);\n }\n if (this.parent.autoCheckHierarchy) {\n this.headerSelection();\n }\n }\n else if (this.columnIndex > -1 && this.parent.getHeaderContent().querySelectorAll('.e-treeselectall').length > 0) {\n var checkWrap = this.parent.getHeaderContent().querySelectorAll('.e-checkbox-wrapper')[0];\n var checkBoxvalue = checkWrap.querySelector('.e-frame').classList.contains('e-check');\n if (this.parent.autoCheckHierarchy && checkBoxvalue) {\n this.headerSelection(checkBoxvalue);\n }\n }\n };\n Selection.prototype.renderColumnCheckbox = function (args) {\n var rowChkBox = this.parent.createElement('input', { className: 'e-treecheckselect', attrs: { 'type': 'checkbox' } });\n var data = args.data;\n args.cell.classList.add('e-treegridcheckbox');\n args.cell.setAttribute('aria-label', 'checkbox');\n var value = (isNullOrUndefined(data.checkboxState) || data.checkboxState === 'uncheck') ? false : true;\n var checkWrap = createCheckBox(this.parent.createElement, false, { checked: value, label: ' ' });\n checkWrap.classList.add('e-hierarchycheckbox');\n if (this.parent.allowTextWrap) {\n checkWrap.querySelector('.e-frame').style.width = '18px';\n }\n if (data.checkboxState === 'indeterminate') {\n var checkbox = checkWrap.querySelectorAll('.e-frame')[0];\n removeClass([checkbox], ['e-check', 'e-stop', 'e-uncheck']);\n checkWrap.querySelector('.e-frame').classList.add('e-stop');\n }\n checkWrap.insertBefore(rowChkBox.cloneNode(), checkWrap.firstChild);\n return checkWrap;\n };\n Selection.prototype.columnCheckbox = function (container) {\n var checkWrap = this.renderColumnCheckbox(container);\n var containerELe = container.cell.querySelector('.e-treecolumn-container');\n if (!isNullOrUndefined(containerELe)) {\n if (!container.cell.querySelector('.e-hierarchycheckbox')) {\n containerELe.insertBefore(checkWrap, containerELe.querySelectorAll('.e-treecell')[0]);\n }\n }\n else {\n var spanEle = this.parent.createElement('span', { className: 'e-treecheckbox' });\n var data = container.cell.innerHTML;\n container.cell.innerHTML = '';\n spanEle.innerHTML = data;\n var divEle = this.parent.createElement('div', { className: 'e-treecheckbox-container' });\n divEle.appendChild(checkWrap);\n divEle.appendChild(spanEle);\n container.cell.appendChild(divEle);\n }\n };\n Selection.prototype.selectCheckboxes = function (rowIndexes) {\n for (var i = 0; i < rowIndexes.length; i++) {\n var record = this.parent.getCurrentViewRecords()[rowIndexes[i]];\n var flatRecord = getParentData(this.parent, record.uniqueID);\n record = flatRecord;\n var checkboxState = (record.checkboxState === 'uncheck') ? 'check' : 'uncheck';\n record.checkboxState = checkboxState;\n var keys = Object.keys(record);\n for (var j = 0; j < keys.length; j++) {\n if (Object.prototype.hasOwnProperty.call(flatRecord, keys[j])) {\n flatRecord[keys[j]] = record[keys[j]];\n }\n }\n this.traverSelection(record, checkboxState, false);\n if (this.parent.autoCheckHierarchy) {\n this.headerSelection();\n }\n }\n };\n Selection.prototype.traverSelection = function (record, checkboxState, ischildItem) {\n var length = 0;\n this.updateSelectedItems(record, checkboxState);\n if (!ischildItem && record.parentItem && this.parent.autoCheckHierarchy) {\n this.updateParentSelection(record.parentItem);\n }\n if (record.childRecords && this.parent.autoCheckHierarchy) {\n var childRecords = record.childRecords;\n if (!isNullOrUndefined(this.parent.filterModule) &&\n this.parent.filterModule.filteredResult.length > 0 && this.parent.autoCheckHierarchy) {\n childRecords = this.getFilteredChildRecords(childRecords);\n }\n length = childRecords.length;\n for (var count = 0; count < length; count++) {\n if (!childRecords[count].isSummaryRow) {\n if (childRecords[count].hasChildRecords) {\n this.traverSelection(childRecords[count], checkboxState, true);\n }\n else {\n this.updateSelectedItems(childRecords[count], checkboxState);\n }\n }\n }\n }\n };\n Selection.prototype.getFilteredChildRecords = function (childRecords) {\n var _this = this;\n var filteredChildRecords = childRecords.filter(function (e) {\n return _this.parent.filterModule.filteredResult.indexOf(e) > -1;\n });\n return filteredChildRecords;\n };\n Selection.prototype.updateParentSelection = function (parentRecord) {\n var length = 0;\n var childRecords = [];\n var record = getParentData(this.parent, parentRecord.uniqueID);\n if (record && record.childRecords) {\n childRecords = record.childRecords;\n }\n if (!isNullOrUndefined(this.parent.filterModule) &&\n this.parent.filterModule.filteredResult.length > 0 && this.parent.autoCheckHierarchy) {\n childRecords = this.getFilteredChildRecords(childRecords);\n }\n length = childRecords && childRecords.length;\n var indeter = 0;\n var checkChildRecords = 0;\n if (!isNullOrUndefined(record)) {\n for (var i = 0; i < childRecords.length; i++) {\n var currentRecord = getParentData(this.parent, childRecords[i].uniqueID);\n var checkBoxRecord = currentRecord;\n if (!isNullOrUndefined(checkBoxRecord)) {\n if (checkBoxRecord.checkboxState === 'indeterminate') {\n indeter++;\n }\n else if (checkBoxRecord.checkboxState === 'check') {\n checkChildRecords++;\n }\n }\n }\n if (indeter > 0 || (checkChildRecords > 0 && checkChildRecords !== length)) {\n record.checkboxState = 'indeterminate';\n }\n else if (checkChildRecords === 0 && indeter === 0) {\n record.checkboxState = 'uncheck';\n }\n else {\n record.checkboxState = 'check';\n }\n this.updateSelectedItems(record, record.checkboxState);\n if (record.parentItem) {\n this.updateParentSelection(record.parentItem);\n }\n }\n };\n Selection.prototype.headerSelection = function (checkAll) {\n var _this = this;\n var index = -1;\n var length = 0;\n if (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) {\n var filterResult = this.parent.filterModule.filteredResult;\n if (this.filteredList.length === 0) {\n this.filteredList = filterResult;\n }\n else {\n if (this.filteredList !== filterResult) {\n this.filteredList = filterResult;\n }\n }\n }\n if (this.filteredList.length > 0) {\n if (!this.parent.filterSettings.columns.length && this.filteredList.length) {\n this.filteredList = [];\n }\n }\n var data = (!isNullOrUndefined(this.parent.filterModule) &&\n (this.filteredList.length > 0)) ? this.filteredList :\n this.parent.flatData;\n data = isRemoteData(this.parent) ? this.parent.getCurrentViewRecords() : data;\n if (!isNullOrUndefined(checkAll)) {\n for (var i = 0; i < data.length; i++) {\n if (checkAll) {\n if (data[i].checkboxState === 'check') {\n continue;\n }\n data[i].checkboxState = 'check';\n this.updateSelectedItems(data[i], data[i].checkboxState);\n }\n else {\n index = this.selectedItems.indexOf(data[i]);\n if (index > -1) {\n data[i].checkboxState = 'uncheck';\n this.updateSelectedItems(data[i], data[i].checkboxState);\n if (this.parent.autoCheckHierarchy) {\n this.updateParentSelection(data[i]);\n }\n }\n }\n }\n }\n if (checkAll === false && this.parent.enableVirtualization) {\n this.selectedItems = [];\n this.selectedIndexes = [];\n data.filter(function (rec) {\n rec.checkboxState = 'uncheck';\n _this.updateSelectedItems(rec, rec.checkboxState);\n });\n }\n length = this.selectedItems.length;\n var checkbox = this.parent.getHeaderContent().querySelectorAll('.e-frame')[0];\n if (length > 0 && data.length > 0) {\n if (length !== data.length && !checkAll) {\n removeClass([checkbox], ['e-check']);\n checkbox.classList.add('e-stop');\n }\n else {\n removeClass([checkbox], ['e-stop']);\n checkbox.classList.add('e-check');\n }\n }\n else {\n removeClass([checkbox], ['e-check', 'e-stop']);\n }\n };\n Selection.prototype.updateSelectedItems = function (currentRecord, checkState) {\n var record = this.parent.getCurrentViewRecords().filter(function (e) {\n return e.uniqueID === currentRecord.uniqueID;\n });\n var checkedRecord;\n var recordIndex = this.parent.getCurrentViewRecords().indexOf(record[0]);\n var checkboxRecord = getParentData(this.parent, currentRecord.uniqueID);\n var checkbox;\n if (recordIndex > -1) {\n var tr = this.parent.getRows()[recordIndex];\n var movableTr = void 0;\n if (this.parent.frozenRows || this.parent.getFrozenColumns()) {\n movableTr = this.parent.getMovableDataRows()[recordIndex];\n }\n checkbox = tr.querySelectorAll('.e-frame')[0] ? tr.querySelectorAll('.e-frame')[0]\n : movableTr.querySelectorAll('.e-frame')[0];\n if (!isNullOrUndefined(checkbox)) {\n removeClass([checkbox], ['e-check', 'e-stop', 'e-uncheck']);\n }\n }\n checkedRecord = checkboxRecord;\n if (isNullOrUndefined(checkedRecord)) {\n checkedRecord = currentRecord;\n }\n checkedRecord.checkboxState = checkState;\n if (checkState === 'check' && isNullOrUndefined(currentRecord.isSummaryRow)) {\n if (recordIndex !== -1 && this.selectedIndexes.indexOf(recordIndex) === -1) {\n this.selectedIndexes.push(recordIndex);\n }\n if (this.selectedItems.indexOf(checkedRecord) === -1 && (recordIndex !== -1 &&\n (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0))) {\n this.selectedItems.push(checkedRecord);\n }\n if (this.selectedItems.indexOf(checkedRecord) === -1 && this.parent.enableVirtualization && ((!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0))) {\n this.selectedItems.push(checkedRecord);\n }\n if (this.selectedItems.indexOf(checkedRecord) === -1 && (!isNullOrUndefined(this.parent.filterModule) &&\n this.parent.filterModule.filteredResult.length === 0)) {\n this.selectedItems.push(checkedRecord);\n }\n if (this.selectedItems.indexOf(checkedRecord) === -1 && isNullOrUndefined(this.parent.filterModule)) {\n this.selectedItems.push(checkedRecord);\n }\n }\n else if ((checkState === 'uncheck' || checkState === 'indeterminate') && isNullOrUndefined(currentRecord.isSummaryRow)) {\n var index = this.selectedItems.indexOf(checkedRecord);\n if (index !== -1) {\n this.selectedItems.splice(index, 1);\n }\n if (this.selectedIndexes.indexOf(recordIndex) !== -1) {\n var checkedIndex = this.selectedIndexes.indexOf(recordIndex);\n this.selectedIndexes.splice(checkedIndex, 1);\n }\n }\n var checkBoxclass = checkState === 'indeterminate' ? 'e-stop' : 'e-' + checkState;\n if (recordIndex > -1) {\n if (!isNullOrUndefined(checkbox)) {\n checkbox.classList.add(checkBoxclass);\n }\n }\n };\n Selection.prototype.updateGridActions = function (args) {\n var _this = this;\n var requestType = args.requestType;\n var childData;\n var childLength;\n if (isCheckboxcolumn(this.parent)) {\n if (this.parent.autoCheckHierarchy) {\n if ((requestType === 'sorting' || requestType === 'paging')) {\n var rows = this.parent.grid.getRows();\n childData = this.parent.getCurrentViewRecords();\n childLength = childData.length;\n this.selectedIndexes = [];\n for (var i = 0; i < childLength; i++) {\n if (!rows[i].classList.contains('e-summaryrow')) {\n this.updateSelectedItems(childData[i], childData[i].checkboxState);\n }\n }\n }\n else if (requestType === 'delete' || args.action === 'add') {\n var updatedData = [];\n if (requestType === 'delete') {\n updatedData = args.data;\n }\n else {\n updatedData.push(args.data);\n }\n for (var i = 0; i < updatedData.length; i++) {\n if (requestType === 'delete') {\n var index = this.parent.flatData.indexOf(updatedData[i]);\n var checkedIndex = this.selectedIndexes.indexOf(index);\n this.selectedIndexes.splice(checkedIndex, 1);\n this.updateSelectedItems(updatedData[i], 'uncheck');\n }\n if (!isNullOrUndefined(updatedData[i].parentItem)) {\n this.updateParentSelection(updatedData[i].parentItem);\n }\n }\n }\n else if (args.requestType === 'add' && this.parent.autoCheckHierarchy) {\n args.data.checkboxState = 'uncheck';\n }\n else if (requestType === 'filtering' || requestType === 'searching' || requestType === 'refresh'\n && !isRemoteData(this.parent)) {\n this.selectedItems = [];\n this.selectedIndexes = [];\n childData = (!isNullOrUndefined(this.parent.filterModule) && this.parent.filterModule.filteredResult.length > 0) ?\n this.parent.getCurrentViewRecords() : this.parent.flatData;\n childData.forEach(function (record) {\n if (_this.parent.enableVirtualization) {\n if (record.hasChildRecords) {\n _this.updateParentSelection(record);\n }\n else {\n _this.updateSelectedItems(record, record.checkboxState);\n }\n var child = findChildrenRecords(record);\n child = _this.getFilteredChildRecords(child);\n for (var i = 0; i < child.length; i++) {\n if (child[i].hasChildRecords) {\n _this.updateParentSelection(child[i]);\n }\n else if (!(child[i].hasChildRecords) && !isNullOrUndefined(child[i])) {\n _this.updateSelectedItems(child[i], child[i].checkboxState);\n }\n }\n }\n else {\n if (record.hasChildRecords) {\n _this.updateParentSelection(record);\n }\n else {\n _this.updateSelectedItems(record, record.checkboxState);\n }\n }\n });\n this.headerSelection();\n }\n }\n }\n };\n Selection.prototype.getCheckedrecords = function () {\n return this.selectedItems;\n };\n Selection.prototype.getCheckedRowIndexes = function () {\n return this.selectedIndexes;\n };\n return Selection;\n}());\nexport { Selection };\n","import * as events from '../base/constant';\nimport { Grid, getObject, Print as GridPrint } from '@syncfusion/ej2-grids';\nimport { addClass } from '@syncfusion/ej2-base';\n/**\n * TreeGrid Print module\n *\n * @hidden\n */\nvar Print = /** @class */ (function () {\n /**\n * Constructor for Print module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Print(parent) {\n this.parent = parent;\n Grid.Inject(GridPrint);\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Print module name\n */\n Print.prototype.getModuleName = function () {\n return 'print';\n };\n /**\n * @hidden\n * @returns {void}\n */\n Print.prototype.addEventListener = function () {\n this.parent.grid.on(events.printGridInit, this.printTreeGrid, this);\n };\n Print.prototype.removeEventListener = function () {\n this.parent.grid.off(events.printGridInit, this.printTreeGrid);\n };\n Print.prototype.printTreeGrid = function (printGrid) {\n var grid = getObject('printgrid', printGrid);\n var gridElement = getObject('element', printGrid);\n grid.addEventListener(events.queryCellInfo, this.parent.grid.queryCellInfo);\n grid.addEventListener(events.rowDataBound, this.parent.grid.rowDataBound);\n grid.addEventListener(events.beforeDataBound, this.parent.grid.beforeDataBound);\n addClass([gridElement], 'e-treegrid');\n };\n Print.prototype.print = function () {\n this.parent.grid.print();\n };\n /**\n * To destroy the Print\n *\n * @returns {void}\n * @hidden\n */\n Print.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Print;\n}());\nexport { Print };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the filtering behavior of the TreeGrid.\n */\nvar SearchSettings = /** @class */ (function (_super) {\n __extends(SearchSettings, _super);\n function SearchSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], SearchSettings.prototype, \"fields\", void 0);\n __decorate([\n Property(false)\n ], SearchSettings.prototype, \"ignoreCase\", void 0);\n __decorate([\n Property('contains')\n ], SearchSettings.prototype, \"operator\", void 0);\n __decorate([\n Property()\n ], SearchSettings.prototype, \"key\", void 0);\n __decorate([\n Property()\n ], SearchSettings.prototype, \"hierarchyMode\", void 0);\n return SearchSettings;\n}(ChildProperty));\nexport { SearchSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the selection behavior of the TreeGrid.\n */\nvar SelectionSettings = /** @class */ (function (_super) {\n __extends(SelectionSettings, _super);\n function SelectionSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('Row')\n ], SelectionSettings.prototype, \"mode\", void 0);\n __decorate([\n Property('Flow')\n ], SelectionSettings.prototype, \"cellSelectionMode\", void 0);\n __decorate([\n Property('Single')\n ], SelectionSettings.prototype, \"type\", void 0);\n __decorate([\n Property(false)\n ], SelectionSettings.prototype, \"persistSelection\", void 0);\n __decorate([\n Property('Default')\n ], SelectionSettings.prototype, \"checkboxMode\", void 0);\n __decorate([\n Property(false)\n ], SelectionSettings.prototype, \"checkboxOnly\", void 0);\n __decorate([\n Property(true)\n ], SelectionSettings.prototype, \"enableToggle\", void 0);\n return SelectionSettings;\n}(ChildProperty));\nexport { SelectionSettings };\n","import { getObject, appendChildren } from '@syncfusion/ej2-grids';\nimport { templateCompiler, extend } from '@syncfusion/ej2-grids';\nimport { addClass, createElement, isNullOrUndefined, getValue } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport { isRemoteData, isOffline, getExpandStatus, isFilterChildHierarchy } from '../utils';\n/**\n * TreeGrid render module\n *\n * @hidden\n */\nvar Render = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Render(parent) {\n this.parent = parent;\n this.templateResult = null;\n this.parent.grid.on('template-result', this.columnTemplateResult, this);\n this.parent.grid.on('reactTemplateRender', this.reactTemplateRender, this);\n }\n /**\n * Updated row elements for TreeGrid\n *\n * @param {RowDataBoundEventArgs} args - Row details before its bound to DOM\n * @returns {void}\n */\n Render.prototype.RowModifier = function (args) {\n if (!args.data) {\n return;\n }\n var data = args.data;\n var parentData = data.parentItem;\n if (!isNullOrUndefined(data.parentItem) && !isFilterChildHierarchy(this.parent) &&\n (!(this.parent.allowPaging && !(this.parent.pageSettings.pageSizeMode === 'Root')) ||\n (isRemoteData(this.parent) && !isOffline(this.parent)))) {\n var collapsed = (this.parent.initialRender && (!(isNullOrUndefined(parentData[this.parent.expandStateMapping]) ||\n parentData[this.parent.expandStateMapping]) || this.parent.enableCollapseAll)) ||\n !getExpandStatus(this.parent, args.data, this.parent.grid.getCurrentViewRecords());\n if (collapsed) {\n args.row.style.display = 'none';\n }\n }\n if (isRemoteData(this.parent) && !isOffline(this.parent)) {\n var proxy_1 = this.parent;\n var parentrec = this.parent.getCurrentViewRecords().filter(function (rec) {\n return getValue(proxy_1.idMapping, rec) === getValue(proxy_1.parentIdMapping, data);\n });\n if (parentrec.length > 0) {\n var display = parentrec[0].expanded ? 'table-row' : 'none';\n args.row.setAttribute('style', 'display: ' + display + ';');\n }\n }\n //addClass([args.row], 'e-gridrowindex' + index + 'level' + (<ITreeData>args.data).level);\n var summaryRow = getObject('isSummaryRow', args.data);\n if (summaryRow) {\n addClass([args.row], 'e-summaryrow');\n }\n if (args.row.querySelector('.e-treegridexpand')) {\n args.row.setAttribute('aria-expanded', 'true');\n }\n else if (args.row.querySelector('.e-treegridcollapse')) {\n args.row.setAttribute('aria-expanded', 'false');\n }\n if (this.parent.enableCollapseAll && this.parent.initialRender) {\n if (!isNullOrUndefined(data.parentItem)) {\n args.row.style.display = 'none';\n }\n }\n this.parent.trigger(events.rowDataBound, args);\n };\n /**\n * cell renderer for tree column index cell\n *\n * @param {QueryCellInfoEventArgs} args - Cell detail before its bound to DOM\n * @returns {void}\n */\n Render.prototype.cellRender = function (args) {\n if (!args.data) {\n return;\n }\n var grid = this.parent.grid;\n var data = args.data;\n var index;\n var ispadfilter = isNullOrUndefined(data.filterLevel);\n var pad = ispadfilter ? data.level : data.filterLevel;\n var totalIconsWidth = 0;\n var cellElement;\n var column = this.parent.getColumnByUid(args.column.uid);\n var summaryRow = data.isSummaryRow;\n var frozenColumns = this.parent.getFrozenColumns();\n if (!isNullOrUndefined(data.parentItem)) {\n index = data.parentItem.index;\n }\n else {\n index = data.index;\n }\n var columnIndex;\n var getVirtualColIndexByUid = 'getVirtualColIndexByUid';\n if (this.parent.enableColumnVirtualization && !this.parent.initialRender) {\n columnIndex = this.parent[getVirtualColIndexByUid](args.column.uid);\n }\n else {\n columnIndex = grid.getColumnIndexByUid(args.column.uid);\n }\n if (columnIndex === this.parent.treeColumnIndex && (args.requestType === 'add' || args.requestType\n === 'rowDragAndDrop' || args.requestType === 'delete' || isNullOrUndefined(args.cell.querySelector('.e-treecell')))) {\n var container = createElement('div', { className: 'e-treecolumn-container' });\n var emptyExpandIcon = createElement('span', {\n className: 'e-icons e-none',\n styles: 'width: 10px; display: inline-block'\n });\n for (var n = 0; n < pad; n++) {\n totalIconsWidth += 10;\n container.appendChild(emptyExpandIcon.cloneNode());\n }\n var iconRequired = !isNullOrUndefined(data.hasFilteredChildRecords)\n ? data.hasFilteredChildRecords : data.hasChildRecords;\n if (iconRequired && !isNullOrUndefined(data.childRecords)) {\n iconRequired = !(data.childRecords.length === 0);\n }\n if (iconRequired) {\n addClass([args.cell], 'e-treerowcell');\n var expandIcon = createElement('span', { className: 'e-icons' });\n var expand = void 0;\n if (this.parent.initialRender) {\n expand = data.expanded &&\n (isNullOrUndefined(data[this.parent.expandStateMapping]) || data[this.parent.expandStateMapping]) &&\n !this.parent.enableCollapseAll;\n }\n else {\n expand = !(!data.expanded || !getExpandStatus(this.parent, data, this.parent.grid.getCurrentViewRecords()));\n }\n addClass([expandIcon], (expand) ? 'e-treegridexpand' : 'e-treegridcollapse');\n totalIconsWidth += 18;\n container.appendChild(expandIcon);\n emptyExpandIcon.style.width = '7px';\n totalIconsWidth += 7;\n container.appendChild(emptyExpandIcon.cloneNode());\n }\n else if (pad || !pad && !data.level) {\n // icons width\n totalIconsWidth += 20;\n container.appendChild(emptyExpandIcon.cloneNode());\n container.appendChild(emptyExpandIcon.cloneNode());\n }\n //should add below code when paging funcitonality implemented\n // if (data.hasChildRecords) {\n // addClass([expandIcon], data.expanded ? 'e-treegridexpand' : 'e-treegridcollapse');\n // }\n cellElement = createElement('span', { className: 'e-treecell' });\n if (this.parent.allowTextWrap) {\n cellElement.style.width = 'Calc(100% - ' + totalIconsWidth + 'px)';\n }\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n this.updateTreeCell(args, cellElement);\n container.appendChild(cellElement);\n args.cell.appendChild(container);\n }\n else if (this.templateResult) {\n this.templateResult = null;\n }\n var freeze = (grid.getFrozenLeftColumnsCount() > 0 || grid.getFrozenRightColumnsCount() > 0) ? true : false;\n if (!freeze) {\n if (frozenColumns > this.parent.treeColumnIndex && frozenColumns > 0 &&\n grid.getColumnIndexByUid(args.column.uid) === frozenColumns) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n else if (frozenColumns < this.parent.treeColumnIndex && frozenColumns > 0 &&\n (grid.getColumnIndexByUid(args.column.uid) === frozenColumns\n || grid.getColumnIndexByUid(args.column.uid) === frozenColumns - 1)) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n else if (frozenColumns === this.parent.treeColumnIndex && frozenColumns > 0 &&\n grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex - 1) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n }\n else {\n var freezerightColumns = grid.getFrozenRightColumns();\n var freezeLeftColumns = grid.getFrozenLeftColumns();\n var movableColumns = grid.getMovableColumns();\n if ((freezerightColumns.length > 0) && freezerightColumns[0].field === args.column.field) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n else if ((freezeLeftColumns.length > 0) && freezeLeftColumns[0].field === args.column.field) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n else if ((movableColumns.length > 0) && movableColumns[0].field === args.column.field) {\n addClass([args.cell], 'e-gridrowindex' + index + 'level' + data.level);\n }\n }\n if (!isNullOrUndefined(column) && column.showCheckbox) {\n this.parent.notify('columnCheckbox', args);\n if (this.parent.allowTextWrap) {\n var checkboxElement = args.cell.querySelectorAll('.e-frame')[0];\n var width = parseInt(checkboxElement.style.width, 16);\n totalIconsWidth += width;\n totalIconsWidth += 10;\n if (grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex) {\n cellElement = args.cell.querySelector('.e-treecell');\n }\n else {\n cellElement = args.cell.querySelector('.e-treecheckbox');\n }\n cellElement.style.width = 'Calc(100% - ' + totalIconsWidth + 'px)';\n }\n }\n if (summaryRow) {\n addClass([args.cell], 'e-summarycell');\n var summaryData = getObject(args.column.field, args.data);\n if (args.cell.querySelector('.e-treecell') != null) {\n args.cell.querySelector('.e-treecell').innerHTML = summaryData;\n }\n else {\n args.cell.innerHTML = summaryData;\n }\n }\n if (isNullOrUndefined(this.parent.rowTemplate)) {\n this.parent.trigger(events.queryCellInfo, args);\n }\n };\n Render.prototype.updateTreeCell = function (args, cellElement) {\n var columnModel = getValue('columnModel', this.parent);\n var treeColumn = columnModel[this.parent.treeColumnIndex];\n var templateFn = 'templateFn';\n var colindex = args.column.index;\n if (isNullOrUndefined(treeColumn.field)) {\n args.cell.setAttribute('aria-colindex', colindex + '');\n }\n if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {\n args.column.template = treeColumn.template;\n args.column[templateFn] = templateCompiler(args.column.template);\n args.cell.classList.add('e-templatecell');\n }\n var textContent = args.cell.querySelector('.e-treecell') != null ?\n args.cell.querySelector('.e-treecell').innerHTML : args.cell.innerHTML;\n if (typeof (args.column.template) === 'object' && this.templateResult) {\n appendChildren(cellElement, this.templateResult);\n this.templateResult = null;\n args.cell.innerHTML = '';\n }\n else if (args.cell.classList.contains('e-templatecell')) {\n var len = args.cell.children.length;\n var tempID = this.parent.element.id + args.column.uid;\n if (treeColumn.field === args.column.field && !isNullOrUndefined(treeColumn.template)) {\n var portals = 'portals';\n var renderReactTemplates = 'renderReactTemplates';\n if (this.parent.isReact && typeof (args.column.template) !== 'string') {\n args.column[templateFn](args.data, this.parent, 'template', tempID, null, null, cellElement);\n if (isNullOrUndefined(this.parent.grid[portals])) {\n this.parent.grid[portals] = this.parent[portals];\n }\n this.parent.notify('renderReactTemplate', this.parent[portals]);\n this.parent[renderReactTemplates]();\n }\n else {\n var str = 'isStringTemplate';\n var result = args.column[templateFn](extend({ 'index': '' }, args.data), this.parent, 'template', tempID, this.parent[str]);\n appendChildren(cellElement, result);\n }\n delete args.column.template;\n delete args.column[templateFn];\n args.cell.innerHTML = '';\n }\n else {\n for (var i = 0; i < len; len = args.cell.children.length) {\n cellElement.appendChild(args.cell.children[i]);\n }\n }\n }\n else {\n cellElement.innerHTML = textContent;\n args.cell.innerHTML = '';\n }\n };\n Render.prototype.columnTemplateResult = function (args) {\n this.templateResult = args.template;\n };\n Render.prototype.reactTemplateRender = function (args) {\n var renderReactTemplates = 'renderReactTemplates';\n var portals = 'portals';\n this.parent[portals] = args;\n this.parent.notify('renderReactTemplate', this.parent[portals]);\n this.parent[renderReactTemplates]();\n };\n Render.prototype.destroy = function () {\n this.parent.grid.off('template-result', this.columnTemplateResult);\n this.parent.grid.off('reactTemplateRender', this.reactTemplateRender);\n };\n return Render;\n}());\nexport { Render };\n","import { extend, isNullOrUndefined, setValue, getValue, addClass, removeClass } from '@syncfusion/ej2-base';\nimport { DataManager, Query, DataUtil } from '@syncfusion/ej2-data';\nimport { showSpinner, hideSpinner } from '@syncfusion/ej2-popups';\nimport { getObject, getUid } from '@syncfusion/ej2-grids';\nimport { isRemoteData, isOffline, isCountRequired, getExpandStatus } from '../utils';\nimport * as events from './constant';\n/**\n * Internal dataoperations for tree grid\n *\n * @hidden\n */\nvar DataManipulation = /** @class */ (function () {\n function DataManipulation(grid) {\n this.addedRecords = 'addedRecords';\n this.parent = grid;\n this.parentItems = [];\n this.taskIds = [];\n this.hierarchyData = [];\n this.storedIndex = -1;\n this.sortedData = [];\n this.isSortAction = false;\n this.addEventListener();\n this.dataResults = {};\n this.isSelfReference = !isNullOrUndefined(this.parent.parentIdMapping);\n }\n /**\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.addEventListener = function () {\n this.parent.on('updateRemoteLevel', this.updateParentRemoteData, this);\n this.parent.grid.on('sorting-begin', this.beginSorting, this);\n this.parent.on('updateAction', this.updateData, this);\n this.parent.on(events.remoteExpand, this.collectExpandingRecs, this);\n this.parent.on('dataProcessor', this.dataProcessor, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.remoteExpand, this.collectExpandingRecs);\n this.parent.off('updateRemoteLevel', this.updateParentRemoteData);\n this.parent.off('updateAction', this.updateData);\n this.parent.off('dataProcessor', this.dataProcessor);\n this.parent.grid.off('sorting-begin', this.beginSorting);\n };\n /**\n * To destroy the dataModule\n *\n * @returns {void}\n * @hidden\n */\n DataManipulation.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {boolean} -Returns whether remote data binding\n */\n DataManipulation.prototype.isRemote = function () {\n if (!(this.parent.dataSource instanceof DataManager)) {\n return false;\n }\n return true;\n // let gridData: DataManager = <DataManager>this.parent.dataSource;\n // return gridData.dataSource.offline !== true && gridData.dataSource.url !== undefined;\n };\n /**\n * Function to manipulate datasource\n *\n * @param {Object} data - Provide tree grid datasource to convert to flat data\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.convertToFlatData = function (data) {\n var _this = this;\n this.parent.flatData = (Object.keys(data).length === 0 && !(this.parent.dataSource instanceof DataManager) ?\n this.parent.dataSource : []);\n this.parent.parentData = [];\n if ((isRemoteData(this.parent) && !isOffline(this.parent)) && data instanceof DataManager && !(data instanceof Array)) {\n var dm = this.parent.dataSource;\n if (this.parent.parentIdMapping) {\n this.parent.query = isNullOrUndefined(this.parent.query) ?\n new Query() : this.parent.query;\n if (this.parent.parentIdMapping) {\n var filterKey = this.parent.query.params.filter(function (param) { return param.key === 'IdMapping'; });\n if (this.parent.initialRender && !filterKey.length) {\n this.parent.query.where(this.parent.parentIdMapping, 'equal', null);\n this.parent.query.addParams('IdMapping', this.parent.idMapping);\n }\n }\n if (!this.parent.hasChildMapping) {\n var qry = this.parent.query.clone();\n qry.queries = [];\n qry = qry.select([this.parent.parentIdMapping]);\n qry.isCountRequired = true;\n dm.executeQuery(qry).then(function (e) {\n _this.parentItems = DataUtil.distinct(e.result, _this.parent.parentIdMapping, false);\n var req = getObject('dataSource.requests', _this.parent).filter(function (e) {\n return e.httpRequest.statusText !== 'OK';\n }).length;\n if (req === 0) {\n setValue('grid.contentModule.isLoaded', true, _this.parent);\n if (!isNullOrUndefined(_this.zerothLevelData)) {\n setValue('cancel', false, _this.zerothLevelData);\n getValue('grid.renderModule', _this.parent).dataManagerSuccess(_this.zerothLevelData);\n _this.zerothLevelData = null;\n }\n _this.parent.grid.hideSpinner();\n }\n });\n }\n }\n }\n else if (data instanceof Array) {\n this.convertJSONData(data);\n }\n };\n DataManipulation.prototype.convertJSONData = function (data) {\n this.hierarchyData = [];\n this.taskIds = [];\n if (!this.parent.idMapping) {\n this.hierarchyData = data;\n }\n else {\n var keys = Object.keys(data);\n for (var i = 0; i < keys.length; i++) {\n var tempData = data[i];\n this.hierarchyData.push(extend({}, tempData));\n if (!isNullOrUndefined(tempData[this.parent.idMapping])) {\n this.taskIds.push(tempData[this.parent.idMapping]);\n }\n }\n }\n if (this.isSelfReference) {\n var selfData = [];\n var mappingData = new DataManager(this.hierarchyData).executeLocal(new Query()\n .group(this.parent.parentIdMapping));\n for (var i = 0; i < mappingData.length; i++) {\n var groupData = mappingData[i];\n var index = this.taskIds.indexOf(groupData.key);\n if (!isNullOrUndefined(groupData.key)) {\n if (index > -1) {\n var childData = (groupData.items);\n this.hierarchyData[index][this.parent.childMapping] = childData;\n continue;\n }\n }\n selfData.push.apply(selfData, groupData.items);\n }\n this.hierarchyData = this.selfReferenceUpdate(selfData);\n }\n if (!Object.keys(this.hierarchyData).length) {\n var isGantt = 'isGantt';\n var referenceData = !(this.parent.dataSource instanceof DataManager) && this.parent[isGantt];\n this.parent.flatData = referenceData ? (this.parent.dataSource) : [];\n }\n else {\n this.createRecords(this.hierarchyData);\n }\n this.storedIndex = -1;\n };\n // private crudActions(): void {\n // if (this.parent.dataSource instanceof DataManager && (this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {\n // let oldUpdate: Function = this.parent.dataSource.adaptor.update;\n // this.parent.dataSource.adaptor.update =\n // function (dm: DataManager, keyField: string, value: Object, tableName?: string, query?: Query, original?: Object): Object {\n // value = getPlainData(value);\n // return oldUpdate.apply(this, [dm, keyField, value, tableName, query, original]);\n // }\n // }\n // }\n DataManipulation.prototype.selfReferenceUpdate = function (selfData) {\n var result = [];\n while (this.hierarchyData.length > 0 && selfData.length > 0) {\n var index = selfData.indexOf(this.hierarchyData[0]);\n if (index === -1) {\n this.hierarchyData.shift();\n }\n else {\n result.push(this.hierarchyData.shift());\n selfData.splice(index, 1);\n }\n }\n return result;\n };\n /**\n * Function to update the zeroth level parent records in remote binding\n *\n * @param {BeforeDataBoundArgs} args - contains data before its bounds to tree grid\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.updateParentRemoteData = function (args) {\n var records = args.result;\n if (!this.parent.hasChildMapping && !this.parentItems.length &&\n (!this.parent.loadChildOnDemand)) {\n this.zerothLevelData = args;\n setValue('cancel', true, args);\n }\n else {\n if (!this.parent.loadChildOnDemand) {\n for (var rec = 0; rec < records.length; rec++) {\n if (isCountRequired(this.parent) && records[rec].hasChildRecords && this.parent.initialRender) {\n records[rec].expanded = false;\n }\n if (isNullOrUndefined(records[rec].index)) {\n records[rec].taskData = extend({}, records[rec]);\n records[rec].uniqueID = getUid(this.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + records[rec].uniqueID, records[rec], this.parent);\n records[rec].level = 0;\n records[rec].index = Math.ceil(Math.random() * 1000);\n if ((records[rec][this.parent.hasChildMapping] ||\n this.parentItems.indexOf(records[rec][this.parent.idMapping]) !== -1)) {\n records[rec].hasChildRecords = true;\n }\n records[rec].checkboxState = 'uncheck';\n }\n }\n }\n else {\n if (!isNullOrUndefined(records)) {\n this.convertToFlatData(records);\n }\n }\n }\n args.result = this.parent.loadChildOnDemand ? this.parent.flatData : records;\n this.parent.notify('updateResults', args);\n };\n /**\n * Function to manipulate datasource\n *\n * @param {{record: ITreeData, rows: HTMLTableRowElement[], parentRow: HTMLTableRowElement}} rowDetails - Row details for which child rows has to be fetched\n * @param {ITreeData} rowDetails.record - current expanding record\n * @param {HTMLTableRowElement[]} rowDetails.rows - Expanding Row element\n * @param {HTMLTableRowElement} rowDetails.parentRow - Curent expanding row element\n * @param {boolean} isChild - Specified whether current record is already a child record\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.collectExpandingRecs = function (rowDetails, isChild) {\n var gridRows = this.parent.getRows();\n if (this.parent.rowTemplate) {\n var rows = this.parent.getContentTable().rows;\n gridRows = [].slice.call(rows);\n }\n var childRecord;\n if (rowDetails.rows.length > 0) {\n if (!isChild) {\n rowDetails.record.expanded = true;\n }\n for (var i = 0; i < rowDetails.rows.length; i++) {\n rowDetails.rows[i].style.display = 'table-row';\n if (this.parent.loadChildOnDemand) {\n var targetEle = rowDetails.rows[i].getElementsByClassName('e-treegridcollapse')[0];\n childRecord = this.parent.rowTemplate ? this.parent.grid.getCurrentViewRecords()[rowDetails.rows[i].rowIndex] :\n this.parent.grid.getRowObjectFromUID(rowDetails.rows[i].getAttribute('data-Uid')).data;\n if (!isNullOrUndefined(targetEle) && childRecord.expanded) {\n addClass([targetEle], 'e-treegridexpand');\n removeClass([targetEle], 'e-treegridcollapse');\n }\n var childRows = [];\n childRows = gridRows.filter(function (r) {\n return r.querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1));\n });\n if (childRows.length && childRecord.expanded) {\n this.collectExpandingRecs({ record: childRecord, rows: childRows, parentRow: rowDetails.parentRow }, true);\n }\n }\n var expandingTd = rowDetails.rows[i].querySelector('.e-detailrowcollapse');\n if (!isNullOrUndefined(expandingTd)) {\n this.parent.grid.detailRowModule.expand(expandingTd);\n }\n }\n }\n else {\n this.fetchRemoteChildData({ record: rowDetails.record, rows: rowDetails.rows, parentRow: rowDetails.parentRow });\n }\n };\n DataManipulation.prototype.fetchRemoteChildData = function (rowDetails) {\n var _this = this;\n var args = { row: rowDetails.parentRow, data: rowDetails.record };\n var dm = this.parent.dataSource;\n var qry = this.parent.grid.getDataModule().generateQuery();\n var clonequries = qry.queries.filter(function (e) { return e.fn !== 'onPage' && e.fn !== 'onWhere'; });\n qry.queries = clonequries;\n qry.isCountRequired = true;\n qry.where(this.parent.parentIdMapping, 'equal', rowDetails.record[this.parent.idMapping]);\n showSpinner(this.parent.element);\n dm.executeQuery(qry).then(function (e) {\n var datas = _this.parent.grid.currentViewData.slice();\n var inx = datas.indexOf(rowDetails.record);\n if (inx === -1) {\n _this.parent.grid.getRowsObject().forEach(function (rows) {\n if (rows.data.uniqueID === rowDetails.record.uniqueID) {\n inx = rows.index;\n }\n });\n }\n var haveChild = getObject('actual.nextLevel', e);\n var result = e.result;\n rowDetails.record.childRecords = result;\n for (var r = 0; r < result.length; r++) {\n result[r].taskData = extend({}, result[r]);\n result[r].level = rowDetails.record.level + 1;\n result[r].index = Math.ceil(Math.random() * 1000);\n var parentData = extend({}, rowDetails.record);\n delete parentData.childRecords;\n result[r].parentItem = parentData;\n result[r].parentUniqueID = rowDetails.record.uniqueID;\n result[r].uniqueID = getUid(_this.parent.element.id + '_data_');\n result[r].checkboxState = 'uncheck';\n setValue('uniqueIDCollection.' + result[r].uniqueID, result[r], _this.parent);\n // delete result[r].parentItem.childRecords;\n if ((result[r][_this.parent.hasChildMapping] || _this.parentItems.indexOf(result[r][_this.parent.idMapping]) !== -1)\n && !(haveChild && !haveChild[r])) {\n result[r].hasChildRecords = true;\n result[r].expanded = false;\n }\n datas.splice(inx + r + 1, 0, result[r]);\n }\n setValue('result', datas, e);\n setValue('action', 'beforecontentrender', e);\n _this.parent.trigger(events.actionComplete, e);\n hideSpinner(_this.parent.element);\n if (_this.parent.grid.aggregates.length > 0 && !_this.parent.enableVirtualization) {\n var gridQuery = getObject('query', e);\n var result_1 = 'result';\n if (isNullOrUndefined(gridQuery)) {\n gridQuery = getValue('grid.renderModule.data', _this.parent).aggregateQuery(new Query());\n }\n if (!isNullOrUndefined(gridQuery)) {\n var summaryQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onAggregates'; });\n e[result_1] = _this.parent.summaryModule.calculateSummaryValue(summaryQuery, e[result_1], true);\n }\n }\n e.count = _this.parent.grid.pageSettings.totalRecordsCount;\n var virtualArgs = {};\n if (_this.parent.enableVirtualization) {\n _this.remoteVirtualAction(virtualArgs);\n }\n var notifyArgs = { index: inx, childData: result };\n if (_this.parent.enableInfiniteScrolling) {\n _this.parent.notify('infinite-remote-expand', notifyArgs);\n }\n else {\n getValue('grid.renderModule', _this.parent).dataManagerSuccess(e, virtualArgs);\n }\n _this.parent.trigger(events.expanded, args);\n });\n };\n DataManipulation.prototype.remoteVirtualAction = function (virtualArgs) {\n virtualArgs.requestType = 'refresh';\n setValue('isExpandCollapse', true, virtualArgs);\n var contentModule = getValue('grid.contentModule', this.parent);\n var currentInfo = getValue('currentInfo', contentModule);\n var prevInfo = getValue('prevInfo', contentModule);\n if (currentInfo.loadNext && this.parent.grid.pageSettings.currentPage === currentInfo.nextInfo.page) {\n this.parent.grid.pageSettings.currentPage = prevInfo.page;\n }\n };\n DataManipulation.prototype.beginSorting = function () {\n this.isSortAction = true;\n };\n DataManipulation.prototype.createRecords = function (data, parentRecords) {\n var treeGridData = [];\n var keys = Object.keys(data);\n for (var i = 0, len = keys.length; i < len; i++) {\n var currentData = extend({}, data[i]);\n currentData.taskData = data[i];\n var level = 0;\n this.storedIndex++;\n if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {\n currentData.index = this.storedIndex;\n }\n if (!isNullOrUndefined(currentData[this.parent.childMapping]) ||\n (currentData[this.parent.hasChildMapping] && isCountRequired(this.parent))) {\n currentData.hasChildRecords = true;\n if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)\n && isNullOrUndefined(currentData[this.parent.childMapping])) {\n currentData.expanded = false;\n }\n else {\n currentData.expanded = !isNullOrUndefined(currentData[this.parent.expandStateMapping])\n ? currentData[this.parent.expandStateMapping] : true;\n }\n }\n if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {\n currentData.index = currentData.hasChildRecords ? this.storedIndex : this.storedIndex;\n }\n if (this.isSelfReference && isNullOrUndefined(currentData[this.parent.parentIdMapping])) {\n this.parent.parentData.push(currentData);\n }\n currentData.uniqueID = getUid(this.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + currentData.uniqueID, currentData, this.parent);\n if (!isNullOrUndefined(parentRecords)) {\n var parentData = extend({}, parentRecords);\n delete parentData.childRecords;\n delete parentData[this.parent.childMapping];\n if (this.isSelfReference) {\n delete parentData.taskData[this.parent.childMapping];\n }\n currentData.parentItem = parentData;\n currentData.parentUniqueID = parentData.uniqueID;\n level = parentRecords.level + 1;\n }\n if (!Object.prototype.hasOwnProperty.call(currentData, 'level')) {\n currentData.level = level;\n }\n currentData.checkboxState = 'uncheck';\n if (isNullOrUndefined(currentData[this.parent.parentIdMapping]) || currentData.parentItem) {\n this.parent.flatData.push(currentData);\n }\n if (!this.isSelfReference && currentData.level === 0) {\n this.parent.parentData.push(currentData);\n }\n if (!isNullOrUndefined(currentData[this.parent.childMapping] && currentData[this.parent.childMapping].length)) {\n var record = this.createRecords(currentData[this.parent.childMapping], currentData);\n currentData.childRecords = record;\n }\n treeGridData.push(currentData);\n }\n return treeGridData;\n };\n /**\n * Function to perform filtering/sorting action for local data\n *\n * @param {BeforeDataBoundArgs} args - data details to be processed before binding to grid\n * @hidden\n * @returns {void}\n */\n DataManipulation.prototype.dataProcessor = function (args) {\n var isExport = getObject('isExport', args);\n var expresults = getObject('expresults', args);\n var exportType = getObject('exportType', args);\n var isPrinting = getObject('isPrinting', args);\n var dataObj;\n var actionArgs = getObject('actionArgs', args);\n var requestType = getObject('requestType', args);\n var actionData = getObject('data', args);\n var action = getObject('action', args);\n var actionAddArgs = actionArgs;\n var primaryKeyColumnName = this.parent.getPrimaryKeyFieldNames()[0];\n var dataValue = getObject('data', actionAddArgs);\n if ((!isNullOrUndefined(actionAddArgs)) && (!isNullOrUndefined(actionAddArgs.action)) && (actionAddArgs.action === 'add')\n && (!isNullOrUndefined(actionAddArgs.data)) && isNullOrUndefined(actionAddArgs.data[primaryKeyColumnName])) {\n actionAddArgs.data[primaryKeyColumnName] = args.result[actionAddArgs.index][primaryKeyColumnName];\n dataValue.taskData[primaryKeyColumnName] = args.result[actionAddArgs.index][primaryKeyColumnName];\n }\n if ((!isNullOrUndefined(actionArgs) && Object.keys(actionArgs).length) || requestType === 'save') {\n requestType = requestType ? requestType : actionArgs.requestType;\n actionData = actionData ? actionData : getObject('data', actionArgs);\n action = action ? action : getObject('action', actionArgs);\n if (this.parent.editSettings.mode === 'Batch') {\n this.batchChanges = this.parent.grid.editModule.getBatchChanges();\n }\n if (this.parent.isLocalData) {\n this.updateAction(actionData, action, requestType);\n }\n }\n if (isExport && !isNullOrUndefined(expresults)) {\n dataObj = expresults;\n }\n else {\n dataObj = isCountRequired(this.parent) ? getValue('result', this.parent.grid.dataSource)\n : this.parent.grid.dataSource;\n }\n var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;\n var count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)\n : results.length;\n var qry = new Query();\n var gridQuery = getObject('query', args);\n var filterQuery;\n var searchQuery;\n if (!isNullOrUndefined(gridQuery)) {\n filterQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });\n searchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });\n }\n if ((this.parent.grid.allowFiltering && this.parent.grid.filterSettings.columns.length) ||\n (this.parent.grid.searchSettings.key.length > 0) || (!isNullOrUndefined(gridQuery) &&\n (filterQuery.length || searchQuery.length) && this.parent.isLocalData)) {\n if (isNullOrUndefined(gridQuery)) {\n gridQuery = new Query();\n gridQuery = getValue('grid.renderModule.data', this.parent).filterQuery(gridQuery);\n gridQuery = getValue('grid.renderModule.data', this.parent).searchQuery(gridQuery);\n }\n var fltrQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });\n var srchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });\n qry.queries = fltrQuery.concat(srchQuery);\n var filteredData = new DataManager(results).executeLocal(qry);\n this.parent.notify('updateFilterRecs', { data: filteredData });\n results = this.dataResults.result;\n this.dataResults.result = null;\n if (this.parent.grid.aggregates.length > 0) {\n var query = getObject('query', args);\n if (isNullOrUndefined(gridQuery)) {\n gridQuery = getValue('grid.renderModule.data', this.parent).aggregateQuery(new Query());\n }\n if (!isNullOrUndefined(query)) {\n var summaryQuery = query.queries.filter(function (q) { return q.fn === 'onAggregates'; });\n results = this.parent.summaryModule.calculateSummaryValue(summaryQuery, results, true);\n }\n }\n }\n if (this.parent.grid.aggregates.length && this.parent.grid.sortSettings.columns.length === 0\n && this.parent.grid.filterSettings.columns.length === 0 && !this.parent.grid.searchSettings.key.length) {\n var gridQuery_1 = getObject('query', args);\n if (isNullOrUndefined(gridQuery_1)) {\n gridQuery_1 = getValue('grid.renderModule.data', this.parent).aggregateQuery(new Query());\n }\n var summaryQuery = gridQuery_1.queries.filter(function (q) { return q.fn === 'onAggregates'; });\n results = this.parent.summaryModule.calculateSummaryValue(summaryQuery, this.parent.flatData, true);\n }\n if (this.parent.grid.sortSettings.columns.length > 0 || this.isSortAction) {\n this.isSortAction = false;\n var parentData = this.parent.parentData;\n var query = getObject('query', args);\n var srtQry = new Query();\n for (var srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {\n var getColumnByField = 'getColumnByField';\n var col = this.parent.grid.renderModule.data[getColumnByField](this.parent.grid.\n sortSettings.columns[srt].field);\n var compFun = col.sortComparer && isOffline(this.parent) ?\n col.sortComparer.bind(col) :\n this.parent.grid.sortSettings.columns[srt].direction;\n srtQry.sortBy(this.parent.grid.sortSettings.columns[srt].field, compFun);\n }\n var modifiedData = new DataManager(parentData).executeLocal(srtQry);\n var sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: srtQry };\n this.parent.notify('createSort', sortArgs);\n results = sortArgs.modifiedData;\n this.dataResults.result = null;\n this.sortedData = results;\n this.parent.notify('updateModel', {});\n if (this.parent.grid.aggregates.length > 0 && !isNullOrUndefined(query)) {\n var isSort = false;\n var query_1 = getObject('query', args);\n var summaryQuery = query_1.queries.filter(function (q) { return q.fn === 'onAggregates'; });\n results = this.parent.summaryModule.calculateSummaryValue(summaryQuery, this.sortedData, isSort);\n }\n }\n count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)\n : results.length;\n var temp = this.paging(results, count, isExport, isPrinting, exportType, args);\n results = temp.result;\n count = temp.count;\n args.result = results;\n args.count = count;\n this.parent.notify('updateResults', args);\n };\n DataManipulation.prototype.paging = function (results, count, isExport, isPrinting, exportType, args) {\n if (this.parent.allowPaging && (!isExport || exportType === 'CurrentPage')\n && (!isPrinting || this.parent.printMode === 'CurrentPage')) {\n this.parent.notify(events.pagingActions, { result: results, count: count });\n results = this.dataResults.result;\n count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)\n : this.dataResults.count;\n }\n else if ((this.parent.enableVirtualization || this.parent.enableInfiniteScrolling) && (!isExport || exportType === 'CurrentPage')\n && getValue('requestType', args) !== 'save') {\n var actArgs = this.parent.enableInfiniteScrolling ? args : getValue('actionArgs', args);\n this.parent.notify(events.pagingActions, { result: results, count: count, actionArgs: actArgs });\n results = this.dataResults.result;\n count = this.dataResults.count;\n }\n var isPdfExport = 'isPdfExport';\n var isCollapsedStatePersist = 'isCollapsedStatePersist';\n if ((isPrinting === true || (args[isPdfExport] && (isNullOrUndefined(args[isCollapsedStatePersist])\n || args[isCollapsedStatePersist]))) && this.parent.printMode === 'AllPages') {\n var actualResults = [];\n for (var i = 0; i < results.length; i++) {\n var expandStatus = getExpandStatus(this.parent, results[i], this.parent.parentData);\n if (expandStatus) {\n actualResults.push(results[i]);\n }\n }\n results = actualResults;\n count = results.length;\n }\n var value = { result: results, count: count };\n return value;\n };\n DataManipulation.prototype.updateData = function (dataResult) {\n this.dataResults = dataResult;\n };\n DataManipulation.prototype.updateAction = function (actionData, action, requestType) {\n if ((requestType === 'delete' || requestType === 'save')) {\n this.parent.notify(events.crudAction, { value: actionData, action: action || requestType });\n }\n if (requestType === 'batchsave' && this.parent.editSettings.mode === 'Batch') {\n this.parent.notify(events.batchSave, {});\n }\n };\n return DataManipulation;\n}());\nexport { DataManipulation };\n","import { Grid, RowDD as GridDragDrop, parentsUntil } from '@syncfusion/ej2-grids';\nimport { getObject, Scroll } from '@syncfusion/ej2-grids';\nimport { closest, isNullOrUndefined, classList, setValue, extend, getValue, removeClass, addClass, setStyleAttribute } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport * as events from '../base/constant';\nimport { editAction } from './crud-actions';\nimport { getParentData, findChildrenRecords, isRemoteData, isOffline, isCountRequired } from '../utils';\n/**\n * TreeGrid RowDragAndDrop module\n *\n * @hidden\n */\nvar RowDD = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function RowDD(parent) {\n /** @hidden */\n this.canDrop = true;\n /** @hidden */\n this.isDraggedWithChild = false;\n /** @hidden */\n this.hasDropItem = true;\n /** @hidden */\n this.isaddtoBottom = false;\n Grid.Inject(GridDragDrop);\n this.parent = parent;\n this.addEventListener();\n }\n RowDD.prototype.getChildrecordsByParentID = function (id) {\n var treeGridDataSource;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n treeGridDataSource = this.parent.grid.dataSource.dataSource.json;\n }\n else {\n treeGridDataSource = this.parent.grid.dataSource;\n }\n var record = treeGridDataSource.filter(function (e) {\n return e.uniqueID === id;\n });\n return record;\n };\n /**\n * @hidden\n * @returns {void}\n */\n RowDD.prototype.addEventListener = function () {\n this.parent.on(events.rowdraging, this.Rowdraging, this);\n this.parent.on(events.rowDropped, this.rowDropped, this);\n this.parent.on(events.rowsAdd, this.rowsAdded, this);\n this.parent.on(events.rowsRemove, this.rowsRemoved, this);\n };\n /**\n * Reorder the rows based on given indexes and position\n *\n * @returns {void}\n * @param {number[]} fromIndexes - source indexes of rows to be re-ordered\n * @param {number} toIndex - Destination row index\n * @param {string} position - Drop position as above or below or child\n */\n RowDD.prototype.reorderRows = function (fromIndexes, toIndex, position) {\n var tObj = this.parent;\n var action = 'action';\n var updateRowAndCellElements = 'updateRowAndCellElements';\n if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {\n if (position === 'above') {\n this.dropPosition = 'topSegment';\n }\n if (position === 'below') {\n this.dropPosition = 'bottomSegment';\n }\n if (position === 'child') {\n this.dropPosition = 'middleSegment';\n }\n var data = [];\n for (var i = 0; i < fromIndexes.length; i++) {\n data[i] = this.parent.getCurrentViewRecords()[fromIndexes[i]];\n }\n var isByMethod = true;\n var args = {\n data: data,\n dropIndex: toIndex\n };\n if (!isCountRequired(this.parent)) {\n this.dropRows(args, isByMethod);\n }\n //this.refreshGridDataSource();\n if (tObj.isLocalData) {\n tObj.flatData = this.orderToIndex(tObj.flatData);\n }\n if (this.parent[action] === 'outdenting') {\n if (!isNullOrUndefined(data[0].parentItem)) {\n data[0].level = data[0].parentItem.level + 1;\n }\n }\n this.parent.grid.refresh();\n if (this.parent.enableImmutableMode && this.dropPosition === 'middleSegment') {\n var index = void 0;\n if (this.parent.allowRowDragAndDrop) {\n index = this.parent.treeColumnIndex + 1;\n }\n else if (this.parent[action] === 'indenting') {\n index = this.parent.treeColumnIndex;\n }\n var row = this.parent.getRows()[fromIndexes[0]];\n var dropData = args.data[0];\n var totalRecord = [];\n var rows = [];\n totalRecord.push(dropData);\n rows.push(row);\n var parentUniqueID = 'parentUniqueID';\n var parentData = getParentData(this.parent, args.data[0][parentUniqueID]);\n var parentrow = this.parent.getRows()[toIndex];\n totalRecord.push(parentData);\n rows.push(parentrow);\n this.parent[updateRowAndCellElements](totalRecord, rows, index);\n }\n if (this.parent.enableImmutableMode && this.parent[action] === 'outdenting') {\n var index = void 0;\n if (this.parent.allowRowDragAndDrop) {\n index = this.parent.treeColumnIndex + 1;\n }\n else if (this.parent[action] === 'outdenting') {\n index = this.parent.treeColumnIndex;\n }\n var record = args.data[0];\n var row = this.parent.getRows()[fromIndexes[0]];\n var totalRecord = [];\n var rows = [];\n totalRecord.push(record);\n rows.push(row);\n this.parent[updateRowAndCellElements](totalRecord, rows, index);\n }\n }\n else {\n return;\n }\n };\n RowDD.prototype.orderToIndex = function (currentData) {\n for (var i = 0; i < currentData.length; i++) {\n currentData[i].index = i;\n if (!isNullOrUndefined(currentData[i].parentItem)) {\n var updatedParent = getValue('uniqueIDCollection.' + currentData[i].parentUniqueID, this.parent);\n currentData[i].parentItem.index = updatedParent.index;\n }\n }\n return currentData;\n };\n RowDD.prototype.rowsAdded = function (e) {\n var draggedRecord;\n var dragRecords = e.records;\n for (var i = e.records.length - 1; i > -1; i--) {\n draggedRecord = dragRecords[i];\n if (draggedRecord.parentUniqueID) {\n var record = dragRecords.filter(function (data) {\n return data.uniqueID === draggedRecord.parentUniqueID;\n });\n if (record.length) {\n var index = record[0].childRecords.indexOf(draggedRecord);\n var parentRecord = record[0];\n if (index !== -1) {\n if (isNullOrUndefined(this.parent.idMapping)) {\n parentRecord.childRecords.splice(index, 1);\n if (!parentRecord.childRecords.length) {\n parentRecord.hasChildRecords = false;\n parentRecord.hasFilteredChildRecords = false;\n }\n }\n this.isDraggedWithChild = true;\n }\n }\n }\n }\n if (isNullOrUndefined(this.parent.dataSource) || !this.parent.dataSource.length) {\n var tObj = this.parent;\n var draggedRecord_1;\n var dragRecords_1 = e.records;\n var dragLength = e.records.length;\n for (var i = dragLength - 1; i > -1; i--) {\n draggedRecord_1 = dragRecords_1[i];\n if (!i && draggedRecord_1.hasChildRecords) {\n draggedRecord_1.taskData[this.parent.parentIdMapping] = null;\n }\n var recordIndex1 = 0;\n if (!isNullOrUndefined(tObj.parentIdMapping)) {\n tObj.childMapping = null;\n }\n if (!isNullOrUndefined(draggedRecord_1.taskData) && !isNullOrUndefined(tObj.childMapping) &&\n !Object.prototype.hasOwnProperty.call(draggedRecord_1.taskData, tObj.childMapping)) {\n draggedRecord_1.taskData[tObj.childMapping] = [];\n }\n if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.childMapping) &&\n (draggedRecord_1[tObj.childMapping]).length && !this.isDraggedWithChild &&\n !isNullOrUndefined(tObj.parentIdMapping)) {\n var childData = (draggedRecord_1[tObj.childMapping]);\n for (var j = 0; j < childData.length; j++) {\n if (dragRecords_1.indexOf(childData[j]) === -1) {\n dragRecords_1.splice(j, 0, childData[j]);\n childData[j].taskData = extend({}, childData[j]);\n i += 1;\n }\n }\n }\n if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.parentIdMapping) && draggedRecord_1[tObj.parentIdMapping] != null\n && !this.isDraggedWithChild) {\n draggedRecord_1.taskData[tObj.parentIdMapping] = null;\n delete draggedRecord_1.parentItem;\n delete draggedRecord_1.parentUniqueID;\n }\n if (isNullOrUndefined(tObj.dataSource)) {\n tObj.dataSource = [];\n }\n tObj.dataSource.splice(recordIndex1, 0, draggedRecord_1.taskData);\n }\n tObj.setProperties({ dataSource: tObj.dataSource }, false);\n }\n else {\n for (var i = 0; i < dragRecords.length; i++) {\n setValue('uniqueIDCollection.' + dragRecords[i].uniqueID, dragRecords[i], this.parent);\n }\n var args = { data: e.records, dropIndex: e.toIndex };\n if (this.parent.dataSource instanceof DataManager) {\n this.treeGridData = this.parent.dataSource.dataSource.json;\n this.treeData = this.parent.dataSource.dataSource.json;\n }\n else {\n this.treeGridData = this.parent.grid.dataSource;\n this.treeData = this.parent.dataSource;\n }\n if (isNullOrUndefined(this.dropPosition)) {\n this.dropPosition = 'bottomSegment';\n args.dropIndex = this.parent.getCurrentViewRecords().length > 1 ? this.parent.getCurrentViewRecords().length - 1 :\n args.dropIndex;\n args.data = args.data.map(function (i) {\n if (i.hasChildRecords && isNullOrUndefined(i.parentItem)) {\n i.level = 0;\n return i;\n }\n else {\n delete i.parentItem;\n delete i.parentUniqueID;\n i.level = 0;\n return i;\n }\n });\n }\n this.dropRows(args);\n }\n };\n RowDD.prototype.rowsRemoved = function (e) {\n for (var i = 0; i < e.records.length; i++) {\n this.draggedRecord = e.records[i];\n if (this.draggedRecord.hasChildRecords || this.draggedRecord.parentItem &&\n this.parent.grid.dataSource.\n indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0]) !== -1 ||\n this.draggedRecord.level === 0) {\n this.deleteDragRow();\n }\n }\n };\n RowDD.prototype.refreshGridDataSource = function () {\n var draggedRecord = this.draggedRecord;\n var droppedRecord = this.droppedRecord;\n var proxy = this.parent;\n var tempDataSource;\n var idx;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n tempDataSource = proxy.dataSource.dataSource.json;\n }\n else {\n tempDataSource = proxy.dataSource;\n }\n // eslint-disable-next-line max-len\n if (tempDataSource && (!isNullOrUndefined(droppedRecord) && !droppedRecord.parentItem) && !isNullOrUndefined(droppedRecord.taskData)) {\n var keys = Object.keys(tempDataSource);\n for (var i = 0; i < keys.length; i++) {\n if (tempDataSource[i][this.parent.childMapping] === droppedRecord.taskData[this.parent.childMapping]) {\n idx = i;\n }\n }\n if (this.dropPosition === 'topSegment') {\n if (!this.parent.idMapping) {\n tempDataSource.splice(idx, 0, draggedRecord.taskData);\n }\n }\n else if (this.dropPosition === 'bottomSegment') {\n if (!this.parent.idMapping) {\n tempDataSource.splice(idx + 1, 0, draggedRecord.taskData);\n }\n }\n }\n else if (!this.parent.parentIdMapping && (!isNullOrUndefined(droppedRecord) && droppedRecord.parentItem)) {\n if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {\n var record = this.getChildrecordsByParentID(droppedRecord.parentUniqueID)[0];\n var childRecords = record.childRecords;\n for (var i = 0; i < childRecords.length; i++) {\n droppedRecord.parentItem.taskData[this.parent.childMapping][i] = childRecords[i].taskData;\n }\n }\n }\n if (this.parent.parentIdMapping) {\n if (draggedRecord.parentItem) {\n if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {\n draggedRecord[this.parent.parentIdMapping] = droppedRecord[this.parent.parentIdMapping];\n draggedRecord.taskData[this.parent.parentIdMapping] = droppedRecord[this.parent.parentIdMapping];\n }\n else {\n draggedRecord[this.parent.parentIdMapping] = droppedRecord[this.parent.idMapping];\n draggedRecord.taskData[this.parent.parentIdMapping] = droppedRecord[this.parent.idMapping];\n }\n }\n else {\n draggedRecord.taskData[this.parent.parentIdMapping] = null;\n draggedRecord[this.parent.parentIdMapping] = null;\n }\n }\n };\n RowDD.prototype.removeFirstrowBorder = function (element) {\n var canremove = this.dropPosition === 'bottomSegment';\n if (this.parent.element.getElementsByClassName('e-firstrow-border').length > 0 && element &&\n (element.rowIndex !== 0 || canremove)) {\n this.parent.element.getElementsByClassName('e-firstrow-border')[0].remove();\n }\n };\n RowDD.prototype.removeLastrowBorder = function (element) {\n var isEmptyRow = element && (element.classList.contains('e-emptyrow') || element.classList.contains('e-columnheader')\n || element.classList.contains('e-detailrow'));\n var islastRowIndex = element && !isEmptyRow &&\n this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') !==\n element.getAttribute('data-uid');\n var canremove = islastRowIndex || this.dropPosition === 'topSegment';\n if (this.parent.element.getElementsByClassName('e-lastrow-border').length > 0 && element && (islastRowIndex || canremove)) {\n this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();\n }\n };\n RowDD.prototype.updateIcon = function (row, index, args) {\n var rowEle = args.target ? closest(args.target, 'tr') : null;\n this.dropPosition = undefined;\n var rowPositionHeight = 0;\n this.removeFirstrowBorder(rowEle);\n this.removeLastrowBorder(rowEle);\n for (var i = 0; i < args.rows.length; i++) {\n if (!isNullOrUndefined(rowEle) && rowEle.getAttribute('data-uid') === args.rows[i].getAttribute('data-uid')\n || !parentsUntil(args.target, 'e-gridcontent')) {\n this.dropPosition = 'Invalid';\n this.addErrorElem();\n }\n }\n // To get the corresponding drop position related to mouse position\n var tObj = this.parent;\n var rowTop = 0;\n var roundOff = 0;\n var toolHeight = tObj.toolbar && tObj.toolbar.length ?\n document.getElementById(tObj.element.id + '_gridcontrol_toolbarItems').offsetHeight : 0;\n // tObj.lastRow = tObj.getRowByIndex(tObj.getCurrentViewRecords().length - 1);\n var positionOffSet = this.getOffset(tObj.element);\n // let contentHeight1: number = (tObj.element.offsetHeight - (tObj.getContent() as HTMLElement).offsetHeight) + positionOffSet.top;\n var contentHeight = tObj.getHeaderContent().offsetHeight + positionOffSet.top + toolHeight;\n var scrollTop = tObj.getContent().firstElementChild.scrollTop;\n if (!isNullOrUndefined(rowEle)) {\n rowPositionHeight = rowEle.offsetTop - scrollTop;\n }\n // let scrollTop = (tObj.grid.scrollModule as any).content.scrollTop;\n rowTop = rowPositionHeight + contentHeight + roundOff;\n var rowBottom = rowTop + row[0].offsetHeight;\n var difference = rowBottom - rowTop;\n var divide = difference / 3;\n var topRowSegment = rowTop + divide;\n var middleRowSegment = topRowSegment + divide;\n var bottomRowSegment = middleRowSegment + divide;\n var mouseEvent = getObject('originalEvent.event', args);\n var touchEvent = getObject('originalEvent.event', args);\n var posy = (mouseEvent.type === 'mousemove') ? mouseEvent.pageY : ((!isNullOrUndefined(touchEvent) &&\n !isNullOrUndefined(touchEvent.changedTouches)) ? touchEvent.changedTouches[0].pageY : null);\n var isTopSegment = posy <= topRowSegment;\n var isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);\n var isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);\n if (isTopSegment || isMiddleRowSegment || isBottomRowSegment) {\n if (isTopSegment && this.dropPosition !== 'Invalid') {\n this.removeChildBorder();\n this.dropPosition = 'topSegment';\n this.removetopOrBottomBorder();\n this.addFirstrowBorder(rowEle);\n this.removeErrorElem();\n this.removeLastrowBorder(rowEle);\n this.topOrBottomBorder(args.target);\n }\n if (isMiddleRowSegment && this.dropPosition !== 'Invalid') {\n this.removetopOrBottomBorder();\n var rowElement = [];\n var element = closest(args.target, 'tr');\n rowElement = [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse'));\n if (rowElement.length > 0) {\n this.addRemoveClasses(rowElement, true, 'e-childborder');\n }\n this.addLastRowborder(rowEle);\n this.addFirstrowBorder(rowEle);\n this.dropPosition = 'middleSegment';\n }\n if (isBottomRowSegment && this.dropPosition !== 'Invalid') {\n this.removeErrorElem();\n this.removetopOrBottomBorder();\n this.removeChildBorder();\n this.dropPosition = 'bottomSegment';\n this.addLastRowborder(rowEle);\n this.removeFirstrowBorder(rowEle);\n this.topOrBottomBorder(args.target);\n }\n }\n return this.dropPosition;\n };\n RowDD.prototype.removeChildBorder = function () {\n var borderElem = [];\n borderElem = [].slice.call(this.parent.element.querySelectorAll('.e-childborder'));\n if (borderElem.length > 0) {\n this.addRemoveClasses(borderElem, false, 'e-childborder');\n }\n };\n RowDD.prototype.addFirstrowBorder = function (targetRow) {\n var node = this.parent.element;\n var tObj = this.parent;\n if (targetRow && targetRow.rowIndex === 0 && !targetRow.classList.contains('e-emptyrow')) {\n var div = this.parent.createElement('div', { className: 'e-firstrow-border' });\n var gridheaderEle = this.parent.getHeaderContent();\n var toolbarHeight = 0;\n if (tObj.toolbar) {\n toolbarHeight = tObj.toolbarModule.getToolbar().offsetHeight;\n }\n var multiplegrid = !isNullOrUndefined(this.parent.rowDropSettings.targetID);\n if (multiplegrid) {\n div.style.top = this.parent.grid.element.getElementsByClassName('e-gridheader')[0].offsetHeight\n + toolbarHeight + 'px';\n }\n div.style.width = multiplegrid ? node.offsetWidth + 'px' :\n node.offsetWidth - this.getScrollWidth() + 'px';\n if (!gridheaderEle.querySelectorAll('.e-firstrow-border').length) {\n gridheaderEle.appendChild(div);\n }\n }\n };\n RowDD.prototype.addLastRowborder = function (trElement) {\n var isEmptyRow = trElement && (trElement.classList.contains('e-emptyrow') ||\n trElement.classList.contains('e-columnheader') || trElement.classList.contains('e-detailrow'));\n if (trElement && !isEmptyRow && this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') ===\n trElement.getAttribute('data-uid')) {\n var bottomborder = this.parent.createElement('div', { className: 'e-lastrow-border' });\n var gridcontentEle = this.parent.getContent();\n bottomborder.style.width = this.parent.element.offsetWidth - this.getScrollWidth() + 'px';\n if (!gridcontentEle.querySelectorAll('.e-lastrow-border').length) {\n gridcontentEle.classList.add('e-treegrid-relative');\n gridcontentEle.appendChild(bottomborder);\n bottomborder.style.bottom = this.getScrollWidth() + 'px';\n }\n }\n };\n RowDD.prototype.getScrollWidth = function () {\n var scrollElem = this.parent.getContent().firstElementChild;\n return scrollElem.scrollWidth > scrollElem.offsetWidth ? Scroll.getScrollBarWidth() : 0;\n };\n RowDD.prototype.addErrorElem = function () {\n var dragelem = document.getElementsByClassName('e-cloneproperties')[0];\n var errorelem = dragelem.querySelectorAll('.e-errorelem').length;\n if (!errorelem && !this.parent.rowDropSettings.targetID) {\n var ele = document.createElement('div');\n classList(ele, ['e-errorcontainer'], []);\n classList(ele, ['e-icons', 'e-errorelem'], []);\n var errorVal = dragelem.querySelector('.errorValue');\n var content = dragelem.querySelector('.e-rowcell').innerHTML;\n if (errorVal) {\n content = errorVal.innerHTML;\n errorVal.parentNode.removeChild(errorVal);\n }\n dragelem.querySelector('.e-rowcell').innerHTML = '';\n var spanContent = document.createElement('span');\n spanContent.className = 'errorValue';\n spanContent.style.paddingLeft = '16px';\n spanContent.innerHTML = content;\n dragelem.querySelector('.e-rowcell').appendChild(ele);\n dragelem.querySelector('.e-rowcell').appendChild(spanContent);\n var dropItemSpan = document.querySelector('.e-dropitemscount');\n if (this.hasDropItem && dropItemSpan) {\n var dropItemLeft = parseInt(dropItemSpan.style.left, 10) + ele.offsetWidth + 16;\n var spanLeft = !this.parent.enableRtl ? dropItemLeft : 0;\n dropItemSpan.style.left = spanLeft + \"px\";\n this.hasDropItem = false;\n }\n }\n };\n RowDD.prototype.removeErrorElem = function () {\n var errorelem = document.querySelector('.e-errorelem');\n var errorValue = document.querySelector('.errorValue');\n var dropItemSpan = document.querySelector('.e-dropitemscount');\n if (errorelem) {\n if (dropItemSpan) {\n var dropItemLeft = parseInt(dropItemSpan.style.left, 10) - errorelem.offsetWidth - 16;\n setStyleAttribute(errorValue, {\n paddingLeft: '0px'\n });\n if (!this.parent.enableRtl) {\n setStyleAttribute(dropItemSpan, {\n left: dropItemLeft + \"px\"\n });\n }\n }\n errorelem.remove();\n }\n this.hasDropItem = true;\n };\n RowDD.prototype.topOrBottomBorder = function (target) {\n var rowElement = [];\n var element = closest(target, 'tr');\n rowElement = element ? [].slice.call(element.querySelectorAll('.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse')) : [];\n if (rowElement.length) {\n if (this.dropPosition === 'topSegment') {\n this.addRemoveClasses(rowElement, true, 'e-droptop');\n if (this.parent.element.getElementsByClassName('e-lastrow-dragborder').length > 0) {\n this.parent.element.getElementsByClassName('e-lastrow-dragborder')[0].remove();\n }\n }\n if (this.dropPosition === 'bottomSegment') {\n this.addRemoveClasses(rowElement, true, 'e-dropbottom');\n }\n }\n };\n RowDD.prototype.removetopOrBottomBorder = function () {\n var border = [];\n border = [].slice.call(this.parent.element.querySelectorAll('.e-dropbottom, .e-droptop'));\n if (border.length) {\n this.addRemoveClasses(border, false, 'e-dropbottom');\n this.addRemoveClasses(border, false, 'e-droptop');\n }\n };\n RowDD.prototype.addRemoveClasses = function (cells, add, className) {\n for (var i = 0, len = cells.length; i < len; i++) {\n if (add) {\n cells[i].classList.add(className);\n }\n else {\n cells[i].classList.remove(className);\n }\n }\n };\n RowDD.prototype.getOffset = function (element) {\n var box = element.getBoundingClientRect();\n var body = document.body;\n var docElem = document.documentElement;\n var scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop;\n var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft;\n var clientTop = docElem.clientTop || body.clientTop || 0;\n var clientLeft = docElem.clientLeft || body.clientLeft || 0;\n var top = box.top + scrollTop - clientTop;\n var left = box.left + scrollLeft - clientLeft;\n return { top: Math.round(top), left: Math.round(left) };\n };\n RowDD.prototype.Rowdraging = function (args) {\n var tObj = this.parent;\n var cloneElement = this.parent.element.querySelector('.e-cloneproperties');\n cloneElement.style.cursor = '';\n var rowEle = args.target ? closest(args.target, 'tr') : null;\n var rowIdx = rowEle ? rowEle.rowIndex : -1;\n var dragRecords = [];\n var droppedRecord = tObj.getCurrentViewRecords()[rowIdx];\n this.removeErrorElem();\n this.canDrop = true;\n if (!args.data[0]) {\n dragRecords.push(args.data);\n }\n else {\n dragRecords = args.data;\n }\n if (rowIdx !== -1) {\n this.ensuredropPosition(dragRecords, droppedRecord);\n }\n else {\n this.canDrop = false;\n this.addErrorElem();\n }\n if (!tObj.rowDropSettings.targetID && this.canDrop) {\n tObj.rowDragAndDropModule.updateIcon(args.rows, rowIdx, args);\n }\n if (tObj.rowDropSettings.targetID) {\n var dropElement = parentsUntil(args.target, 'e-treegrid');\n if (dropElement && dropElement.id === this.parent.rowDropSettings.targetID) {\n var srcControl = dropElement.ej2_instances[0];\n srcControl.rowDragAndDropModule.updateIcon(args.rows, rowIdx, args);\n }\n }\n if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID)) {\n var dropElement = parentsUntil(args.target, 'e-treegrid');\n if (!dropElement) {\n cloneElement.style.cursor = 'default';\n }\n }\n };\n RowDD.prototype.rowDropped = function (args) {\n var tObj = this.parent;\n var parentItem = 'parentItem';\n if (!tObj.rowDropSettings.targetID) {\n if (parentsUntil(args.target, 'e-content')) {\n if (this.parent.element.querySelector('.e-errorelem')) {\n this.dropPosition = 'Invalid';\n }\n setValue('dropPosition', this.dropPosition, args);\n args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;\n tObj.trigger(events.rowDrop, args);\n if (!args.cancel) {\n if (!isCountRequired(this.parent)) {\n this.dropRows(args);\n }\n if (tObj.isLocalData) {\n tObj.flatData = this.orderToIndex(tObj.flatData);\n }\n tObj.grid.refresh();\n if (!isNullOrUndefined(tObj.getHeaderContent().querySelector('.e-firstrow-border'))) {\n tObj.getHeaderContent().querySelector('.e-firstrow-border').remove();\n }\n }\n }\n }\n else {\n if (args.target && closest(args.target, '#' + tObj.rowDropSettings.targetID) || parentsUntil(args.target, 'e-treegrid') &&\n parentsUntil(args.target, 'e-treegrid').id === tObj.rowDropSettings.targetID || args.target && document.getElementById(tObj.rowDropSettings.targetID)) {\n setValue('dropPosition', this.dropPosition, args);\n tObj.trigger(events.rowDrop, args);\n if (!args.cancel && tObj.rowDropSettings.targetID) {\n this.dragDropGrid(args);\n if (tObj.isLocalData) {\n tObj.flatData = this.orderToIndex(tObj.flatData);\n }\n }\n }\n }\n this.removetopOrBottomBorder();\n this.removeChildBorder();\n if (!isNullOrUndefined(this.parent.element.getElementsByClassName('e-firstrow-border')[0])) {\n this.parent.element.getElementsByClassName('e-firstrow-border')[0].remove();\n }\n else if (!isNullOrUndefined(this.parent.element.getElementsByClassName('e-lastrow-border')[0])) {\n this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();\n }\n if (this.parent.enableImmutableMode && !this.parent.allowPaging && !isNullOrUndefined(args.data[0][parentItem])) {\n var index = this.parent.treeColumnIndex;\n index = index + 1;\n var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];\n var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField]);\n var row = this.parent.getRows()[rowIndex];\n var data = args.data[0];\n if (this.dropPosition === 'middleSegment') {\n var record = [];\n var rows = [];\n record.push(data);\n rows.push(row);\n var parentUniqueID = 'parentUniqueID';\n data = getParentData(this.parent, args.data[0][parentUniqueID]);\n rowIndex = this.parent.grid.getRowIndexByPrimaryKey(data[primaryKeyField]);\n var parentrow = this.parent.getRows()[rowIndex];\n record.push(data);\n rows.push(parentrow);\n for (var i = 0; i < record.length; i++) {\n this.parent.renderModule.cellRender({\n data: record[i], cell: rows[i].cells[index],\n column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],\n requestType: 'rowDragAndDrop'\n });\n }\n var targetEle = parentrow.getElementsByClassName('e-treegridcollapse')[0];\n if (!isNullOrUndefined(targetEle)) {\n removeClass([targetEle], 'e-treegridcollapse');\n addClass([targetEle], 'e-treegridexpand');\n }\n }\n else {\n this.parent.renderModule.cellRender({\n data: data, cell: row.cells[index],\n column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],\n requestType: 'rowDragAndDrop'\n });\n }\n }\n };\n RowDD.prototype.dragDropGrid = function (args) {\n var tObj = this.parent;\n var targetRow = closest(args.target, 'tr');\n var targetIndex = isNaN(this.getTargetIdx(targetRow)) ? 0 : this.getTargetIdx(targetRow);\n var dropElement = parentsUntil(args.target, 'e-treegrid');\n var srcControl;\n if (dropElement && dropElement.id === this.parent.rowDropSettings.targetID && !isRemoteData(this.parent)\n && !isCountRequired(this.parent)) {\n srcControl = dropElement.ej2_instances[0];\n var records = tObj.getSelectedRecords();\n var indexes = [];\n for (var i = 0; i < records.length; i++) {\n indexes[i] = records[i].index;\n }\n var data = srcControl.dataSource;\n if (this.parent.idMapping != null && (isNullOrUndefined(this.dropPosition) || this.dropPosition === 'bottomSegment' || this.dropPosition === 'Invalid') && !(data.length)) {\n var actualData = [];\n for (var i = 0; i < records.length; i++) {\n if (records[i].hasChildRecords) {\n actualData.push(records[i]);\n var child = findChildrenRecords(records[i]);\n for (var i_1 = 0; i_1 < child.length; i_1++) {\n actualData.push(child[i_1]); // push child records to drop the parent record along with its child records\n }\n }\n }\n if (actualData.length) {\n records = actualData;\n }\n }\n tObj.notify(events.rowsRemove, { indexes: indexes, records: records });\n srcControl.notify(events.rowsAdd, { toIndex: targetIndex, records: records });\n var srcControlFlatData = srcControl.rowDragAndDropModule.treeGridData;\n if (!isNullOrUndefined(srcControlFlatData)) {\n for (var i = 0; i < srcControlFlatData.length; i++) {\n srcControlFlatData[i].index = i;\n if (!isNullOrUndefined(srcControlFlatData[i].parentItem)) {\n var actualIndex = getValue('uniqueIDCollection.' + srcControlFlatData[i].parentUniqueID + '.index', srcControl);\n srcControlFlatData[i].parentItem.index = actualIndex;\n }\n }\n }\n tObj.grid.refresh();\n srcControl.grid.refresh();\n if (srcControl.grid.dataSource.length > 1) {\n srcControl.grid.refresh();\n if (!isNullOrUndefined(srcControl.getHeaderContent().querySelector('.e-firstrow-border'))) {\n srcControl.getHeaderContent().querySelector('.e-firstrow-border').remove();\n }\n if (!isNullOrUndefined(srcControl.getContent().querySelector('.e-lastrow-border'))) {\n srcControl.getContent().querySelector('.e-lastrow-border').remove();\n }\n }\n }\n if (isCountRequired(this.parent)) {\n srcControl = dropElement.ej2_instances[0];\n tObj.grid.refresh();\n srcControl.grid.refresh();\n }\n };\n RowDD.prototype.getTargetIdx = function (targetRow) {\n return targetRow ? parseInt(targetRow.getAttribute('aria-rowindex'), 10) : 0;\n };\n RowDD.prototype.getParentData = function (record) {\n var parentItem = record.parentItem;\n if (this.dropPosition === 'bottomSegment') {\n var selectedRecord = this.parent.getSelectedRecords()[0];\n this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);\n }\n if (this.dropPosition === 'middleSegment') {\n var level = this.parent.getSelectedRecords()[0].level;\n if (level === parentItem.level) {\n this.droppedRecord = getParentData(this.parent, parentItem.uniqueID);\n }\n else {\n this.getParentData(parentItem);\n }\n }\n };\n RowDD.prototype.dropRows = function (args, isByMethod) {\n if (this.dropPosition !== 'Invalid' && !isRemoteData(this.parent)) {\n var tObj = this.parent;\n var draggedRecord_2;\n var droppedRecord = void 0;\n if (isNullOrUndefined(args.dropIndex)) {\n var rowIndex = tObj.getSelectedRowIndexes()[0] - 1;\n var record = tObj.getCurrentViewRecords()[rowIndex];\n this.getParentData(record);\n }\n else {\n args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;\n this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];\n }\n var dragRecords = [];\n droppedRecord = this.droppedRecord;\n if (!args.data[0]) {\n dragRecords.push(args.data);\n }\n else {\n dragRecords = args.data;\n }\n var count = 0;\n var multiplegrid = this.parent.rowDropSettings.targetID;\n this.isMultipleGrid = multiplegrid;\n if (!multiplegrid) {\n this.ensuredropPosition(dragRecords, droppedRecord);\n }\n else {\n this.isaddtoBottom = multiplegrid && this.isDraggedWithChild;\n }\n var dragLength = dragRecords.length;\n if (!isNullOrUndefined(this.parent.idMapping)) {\n dragRecords.reverse();\n }\n var _loop_1 = function (i) {\n draggedRecord_2 = dragRecords[i];\n this_1.draggedRecord = draggedRecord_2;\n if (this_1.dropPosition !== 'Invalid') {\n if (!tObj.rowDropSettings.targetID || isByMethod) {\n this_1.deleteDragRow();\n }\n if (this_1.draggedRecord === this_1.droppedRecord) {\n var correctIndex = this_1.getTargetIdx(args.target.offsetParent.parentElement);\n if (isNaN(correctIndex)) {\n correctIndex = this_1.getTargetIdx(args.target.parentElement);\n }\n args.dropIndex = correctIndex;\n droppedRecord = this_1.droppedRecord = this_1.parent.getCurrentViewRecords()[args.dropIndex];\n }\n if (droppedRecord.parentItem || this_1.dropPosition === 'middleSegment') {\n var parentRecords = tObj.parentData;\n var newParentIndex = parentRecords.indexOf(this_1.draggedRecord);\n if (newParentIndex !== -1) {\n parentRecords.splice(newParentIndex, 1);\n }\n }\n var recordIndex1 = this_1.treeGridData.indexOf(droppedRecord);\n this_1.dropAtTop(recordIndex1);\n if (this_1.dropPosition === 'bottomSegment') {\n if (!droppedRecord.hasChildRecords) {\n if (this_1.parent.parentIdMapping) {\n this_1.treeData.splice(recordIndex1 + 1, 0, this_1.draggedRecord.taskData);\n }\n this_1.treeGridData.splice(recordIndex1 + 1, 0, this_1.draggedRecord);\n }\n else {\n count = this_1.getChildCount(droppedRecord, 0);\n if (this_1.parent.parentIdMapping) {\n this_1.treeData.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord.taskData);\n }\n this_1.treeGridData.splice(recordIndex1 + count + 1, 0, this_1.draggedRecord);\n }\n if (isNullOrUndefined(droppedRecord.parentItem)) {\n delete draggedRecord_2.parentItem;\n delete draggedRecord_2.parentUniqueID;\n draggedRecord_2.level = 0;\n if (this_1.parent.parentIdMapping) {\n draggedRecord_2[this_1.parent.parentIdMapping] = null;\n }\n }\n if (droppedRecord.parentItem) {\n var rec = this_1.getChildrecordsByParentID(droppedRecord.parentUniqueID);\n var childRecords = rec[0].childRecords;\n var droppedRecordIndex = childRecords.indexOf(droppedRecord) + 1;\n childRecords.splice(droppedRecordIndex, 0, draggedRecord_2);\n draggedRecord_2.parentItem = droppedRecord.parentItem;\n draggedRecord_2.parentUniqueID = droppedRecord.parentUniqueID;\n if (this_1.parent.parentIdMapping) {\n draggedRecord_2[this_1.parent.parentIdMapping] = droppedRecord[this_1.parent.parentIdMapping];\n draggedRecord_2.parentItem = droppedRecord.parentItem;\n draggedRecord_2.level = droppedRecord.level;\n }\n }\n if (draggedRecord_2.hasChildRecords) {\n var level = 1;\n this_1.updateChildRecordLevel(draggedRecord_2, level);\n this_1.updateChildRecord(draggedRecord_2, recordIndex1 + count + 1);\n }\n }\n this_1.dropMiddle(recordIndex1);\n }\n if (isNullOrUndefined(draggedRecord_2.parentItem)) {\n var parentRecords = tObj.parentData;\n var newParentIndex = parentRecords.indexOf(this_1.droppedRecord);\n var nonRepeat_1 = 0;\n parentRecords.filter(function (e) {\n if (draggedRecord_2.uniqueID === e.uniqueID) {\n nonRepeat_1++;\n }\n });\n if (this_1.dropPosition === 'bottomSegment' && nonRepeat_1 === 0) {\n parentRecords.splice(newParentIndex + 1, 0, draggedRecord_2);\n }\n else if (this_1.dropPosition === 'topSegment' && nonRepeat_1 === 0) {\n parentRecords.splice(newParentIndex, 0, draggedRecord_2);\n }\n }\n tObj.rowDragAndDropModule.refreshGridDataSource();\n };\n var this_1 = this;\n for (var i = 0; i < dragLength; i++) {\n _loop_1(i);\n }\n }\n };\n RowDD.prototype.dropMiddle = function (recordIndex) {\n var tObj = this.parent;\n var childRecords = findChildrenRecords(this.droppedRecord);\n var childRecordsLength = (isNullOrUndefined(childRecords) ||\n childRecords.length === 0) ? recordIndex + 1 :\n childRecords.length + recordIndex + 1;\n if (this.dropPosition === 'middleSegment') {\n if (tObj.parentIdMapping) {\n this.treeData.splice(childRecordsLength, 0, this.draggedRecord.taskData);\n this.treeGridData.splice(childRecordsLength, 0, this.draggedRecord);\n }\n else {\n this.treeGridData.splice(childRecordsLength, 0, this.draggedRecord);\n }\n this.recordLevel();\n if (this.draggedRecord.hasChildRecords) {\n this.updateChildRecord(this.draggedRecord, childRecordsLength);\n }\n }\n };\n RowDD.prototype.dropAtTop = function (recordIndex1) {\n var tObj = this.parent;\n if (this.dropPosition === 'topSegment') {\n if (tObj.parentIdMapping) {\n this.treeData.splice(recordIndex1, 0, this.draggedRecord.taskData);\n }\n this.draggedRecord.parentItem = this.treeGridData[recordIndex1].parentItem;\n this.draggedRecord.parentUniqueID = this.treeGridData[recordIndex1].parentUniqueID;\n this.draggedRecord.level = this.treeGridData[recordIndex1].level;\n this.treeGridData.splice(recordIndex1, 0, this.draggedRecord);\n if (this.draggedRecord.hasChildRecords) {\n var level = 1;\n this.updateChildRecord(this.draggedRecord, recordIndex1);\n this.updateChildRecordLevel(this.draggedRecord, level);\n }\n if (this.droppedRecord.parentItem) {\n var rec = this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID);\n var childRecords = rec[0].childRecords;\n var droppedRecordIndex = childRecords.indexOf(this.droppedRecord);\n childRecords.splice(droppedRecordIndex, 0, this.draggedRecord);\n }\n }\n };\n RowDD.prototype.recordLevel = function () {\n var tObj = this.parent;\n var draggedRecord = this.draggedRecord;\n var droppedRecord = this.droppedRecord;\n var childItem = tObj.childMapping;\n if (!droppedRecord.hasChildRecords) {\n droppedRecord.hasChildRecords = true;\n droppedRecord.hasFilteredChildRecords = true;\n if (isNullOrUndefined(droppedRecord.childRecords) || droppedRecord.childRecords.length === 0) {\n droppedRecord.childRecords = [];\n if (!tObj.parentIdMapping && isNullOrUndefined(droppedRecord.taskData[childItem])) {\n droppedRecord.taskData[childItem] = [];\n }\n }\n }\n if (this.dropPosition === 'middleSegment') {\n var parentItem = extend({}, droppedRecord);\n delete parentItem.childRecords;\n draggedRecord.parentItem = parentItem;\n draggedRecord.parentUniqueID = droppedRecord.uniqueID;\n droppedRecord.childRecords.splice(droppedRecord.childRecords.length, 0, draggedRecord);\n var isSelfReference = 'isSelfReference';\n if (tObj[isSelfReference]) {\n droppedRecord[tObj.childMapping] = [];\n droppedRecord[tObj.childMapping].splice(droppedRecord[tObj.childMapping].length, 0, draggedRecord);\n }\n if (!isNullOrUndefined(draggedRecord) && !tObj.parentIdMapping && !isNullOrUndefined(droppedRecord.taskData[childItem])) {\n droppedRecord.taskData[tObj.childMapping].splice(droppedRecord.childRecords.length, 0, draggedRecord.taskData);\n }\n if (!draggedRecord.hasChildRecords) {\n draggedRecord.level = droppedRecord.level + 1;\n }\n else {\n var level = 1;\n draggedRecord.level = droppedRecord.level + 1;\n this.updateChildRecordLevel(draggedRecord, level);\n }\n droppedRecord.expanded = true;\n }\n };\n RowDD.prototype.deleteDragRow = function () {\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n this.treeGridData = this.parent.grid.dataSource.dataSource.json;\n this.treeData = this.parent.dataSource.dataSource.json;\n }\n else {\n this.treeGridData = this.parent.grid.dataSource;\n this.treeData = this.parent.dataSource;\n }\n var deletedRow = getParentData(this.parent, this.draggedRecord.uniqueID);\n if (!isNullOrUndefined(deletedRow.childRecords) && deletedRow.childRecords.length) {\n deletedRow.hasChildRecords = true;\n }\n this.removeRecords(deletedRow);\n };\n RowDD.prototype.updateChildRecord = function (record, count) {\n var currentRecord;\n var tObj = this.parent;\n var length = 0;\n if (!record.hasChildRecords) {\n return 0;\n }\n length = record.childRecords.length;\n for (var i = 0; i < length; i++) {\n currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, tObj);\n count++;\n tObj.flatData.splice(count, 0, currentRecord);\n setValue('uniqueIDCollection.' + currentRecord.uniqueID, currentRecord, this.parent);\n if (tObj.parentIdMapping) {\n this.treeData.splice(count, 0, currentRecord.taskData);\n }\n if (currentRecord.hasChildRecords) {\n count = this.updateChildRecord(currentRecord, count);\n }\n }\n return count;\n };\n RowDD.prototype.updateChildRecordLevel = function (record, level) {\n var length = 0;\n var currentRecord;\n level++;\n if (!record.hasChildRecords) {\n return 0;\n }\n length = record.childRecords.length;\n for (var i = 0; i < length; i++) {\n currentRecord = getValue('uniqueIDCollection.' + record.childRecords[i].uniqueID, this.parent);\n var parentData = void 0;\n if (record.parentItem) {\n parentData = getParentData(this.parent, record.parentItem.uniqueID);\n }\n if (isNullOrUndefined(parentData) && !isNullOrUndefined(record.parentItem)) {\n parentData = record.parentItem;\n }\n currentRecord.level = record.parentItem ? parentData.level + level : record.level + 1;\n if (currentRecord.hasChildRecords) {\n level--;\n level = this.updateChildRecordLevel(currentRecord, level);\n }\n }\n return level;\n };\n RowDD.prototype.removeRecords = function (record) {\n var tObj = this.parent;\n var dataSource;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n dataSource = this.parent.dataSource.dataSource.json;\n }\n else {\n dataSource = this.parent.dataSource;\n }\n var deletedRow = record;\n var isSelfReference = !isNullOrUndefined(tObj.parentIdMapping);\n var flatParentData = this.getChildrecordsByParentID(deletedRow.parentUniqueID)[0];\n if (deletedRow) {\n if (deletedRow.parentItem) {\n var childRecords = flatParentData ? flatParentData.childRecords : [];\n var childIndex = 0;\n if (childRecords && childRecords.length > 0) {\n childIndex = childRecords.indexOf(deletedRow);\n flatParentData.childRecords.splice(childIndex, 1);\n if (!this.parent.parentIdMapping || tObj.enableImmutableMode) {\n editAction({ value: deletedRow, action: 'delete' }, this.parent, isSelfReference, deletedRow.index, deletedRow.index);\n }\n }\n }\n if (tObj.parentIdMapping) {\n if (deletedRow.hasChildRecords && deletedRow.childRecords.length > 0) {\n this.removeChildItem(deletedRow);\n }\n var idx = void 0;\n var idz = void 0;\n var treeGridData = dataSource;\n for (var i = 0; i < treeGridData.length; i++) {\n if (treeGridData[i][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {\n idx = i;\n }\n }\n for (var i = 0; i < this.treeGridData.length; i++) {\n if (this.treeGridData[i][this.parent.idMapping] === deletedRow.taskData[this.parent.idMapping]) {\n idz = i;\n }\n }\n if (idx !== -1 && !isNullOrUndefined(idx)) {\n dataSource.splice(idx, 1);\n }\n if (idz !== -1 && !isNullOrUndefined(idz)) {\n this.treeGridData.splice(idz, 1);\n }\n }\n var recordIndex = this.treeGridData.indexOf(deletedRow);\n if (!tObj.parentIdMapping) {\n var parentIndex = this.parent.parentData.indexOf(deletedRow);\n if (parentIndex !== -1) {\n tObj.parentData.splice(parentIndex, 1);\n dataSource.splice(parentIndex, 1);\n }\n }\n if (recordIndex === -1 && !tObj.parentIdMapping) {\n var primaryKeyField = tObj.getPrimaryKeyFieldNames()[0];\n for (var j = 0; j < this.treeGridData.length; j++) {\n if (this.treeGridData[j][primaryKeyField] === deletedRow[primaryKeyField]) {\n recordIndex = j;\n }\n }\n }\n if (!tObj.parentIdMapping) {\n var deletedRecordCount = this.getChildCount(deletedRow, 0);\n this.treeGridData.splice(recordIndex, deletedRecordCount + 1);\n }\n if (deletedRow.parentItem && flatParentData && flatParentData.childRecords && !flatParentData.childRecords.length) {\n flatParentData.expanded = false;\n flatParentData.hasChildRecords = false;\n flatParentData.hasFilteredChildRecords = false;\n }\n }\n };\n RowDD.prototype.removeChildItem = function (record) {\n var currentRecord;\n var idx;\n var idz;\n var dataSource;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n dataSource = this.parent.dataSource.dataSource.json;\n }\n else {\n dataSource = this.parent.dataSource;\n }\n for (var i = 0; i < record.childRecords.length; i++) {\n currentRecord = record.childRecords[i];\n if (!isNullOrUndefined(currentRecord.childRecords) && currentRecord.childRecords.length) {\n currentRecord.hasChildRecords = true;\n }\n var treeGridData = void 0;\n if (this.parent.dataSource instanceof DataManager && isOffline(this.parent)) {\n treeGridData = this.parent.dataSource.dataSource.json;\n }\n else {\n treeGridData = this.parent.dataSource;\n }\n for (var i_2 = 0; i_2 < treeGridData.length; i_2++) {\n if (treeGridData[i_2][this.parent.idMapping] === currentRecord.taskData[this.parent.idMapping]) {\n idx = i_2;\n }\n }\n for (var i_3 = 0; i_3 < this.treeGridData.length; i_3++) {\n if (this.treeGridData[i_3][this.parent.idMapping] === currentRecord.taskData[this.parent.idMapping]) {\n idz = i_3;\n break;\n }\n }\n if (idx !== -1 && !isNullOrUndefined(idx)) {\n dataSource.splice(idx, 1);\n }\n if (idz !== -1 && !isNullOrUndefined(idz)) {\n this.treeGridData.splice(idz, 1);\n }\n if (currentRecord.hasChildRecords) {\n this.removeChildItem(currentRecord);\n }\n }\n };\n RowDD.prototype.getChildCount = function (record, count) {\n var currentRecord;\n if (!record.hasChildRecords) {\n return 0;\n }\n for (var i = 0; i < record.childRecords.length; i++) {\n currentRecord = record.childRecords[i];\n count++;\n if (currentRecord.hasChildRecords) {\n count = this.getChildCount(currentRecord, count);\n }\n }\n return count;\n };\n RowDD.prototype.ensuredropPosition = function (draggedRecords, currentRecord) {\n var _this = this;\n draggedRecords.filter(function (e) {\n if (e.hasChildRecords && !isNullOrUndefined(e.childRecords)) {\n var valid = e.childRecords.indexOf(currentRecord);\n if (valid === -1) {\n _this.ensuredropPosition(e.childRecords, currentRecord);\n }\n else {\n _this.dropPosition = 'Invalid';\n _this.addErrorElem();\n _this.canDrop = false;\n return;\n }\n }\n });\n };\n RowDD.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {void}\n */\n RowDD.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.rowdraging, this.Rowdraging);\n this.parent.off(events.rowDropped, this.rowDropped);\n this.parent.off(events.rowsAdd, this.rowsAdded);\n this.parent.off(events.rowsRemove, this.rowsRemoved);\n };\n /**\n * hidden\n */\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns RowDragAndDrop module name\n */\n RowDD.prototype.getModuleName = function () {\n return 'rowDragAndDrop';\n };\n return RowDD;\n}());\nexport { RowDD };\n","/**\n * Defines Predefined toolbar items.\n *\n * @hidden\n */\nexport var ToolbarItem;\n(function (ToolbarItem) {\n ToolbarItem[ToolbarItem[\"Add\"] = 0] = \"Add\";\n ToolbarItem[ToolbarItem[\"Edit\"] = 1] = \"Edit\";\n ToolbarItem[ToolbarItem[\"Update\"] = 2] = \"Update\";\n ToolbarItem[ToolbarItem[\"Delete\"] = 3] = \"Delete\";\n ToolbarItem[ToolbarItem[\"Cancel\"] = 4] = \"Cancel\";\n ToolbarItem[ToolbarItem[\"Search\"] = 5] = \"Search\";\n ToolbarItem[ToolbarItem[\"ExpandAll\"] = 6] = \"ExpandAll\";\n ToolbarItem[ToolbarItem[\"CollapseAll\"] = 7] = \"CollapseAll\";\n ToolbarItem[ToolbarItem[\"ExcelExport\"] = 8] = \"ExcelExport\";\n ToolbarItem[ToolbarItem[\"PdfExport\"] = 9] = \"PdfExport\";\n ToolbarItem[ToolbarItem[\"CsvExport\"] = 10] = \"CsvExport\";\n ToolbarItem[ToolbarItem[\"Print\"] = 11] = \"Print\";\n ToolbarItem[ToolbarItem[\"RowIndent\"] = 12] = \"RowIndent\";\n ToolbarItem[ToolbarItem[\"RowOutdent\"] = 13] = \"RowOutdent\";\n})(ToolbarItem || (ToolbarItem = {}));\n/**\n * Defines predefined contextmenu items.\n *\n * @hidden\n */\nexport var ContextMenuItems;\n(function (ContextMenuItems) {\n ContextMenuItems[ContextMenuItems[\"AutoFit\"] = 0] = \"AutoFit\";\n ContextMenuItems[ContextMenuItems[\"AutoFitAll\"] = 1] = \"AutoFitAll\";\n ContextMenuItems[ContextMenuItems[\"SortAscending\"] = 2] = \"SortAscending\";\n ContextMenuItems[ContextMenuItems[\"SortDescending\"] = 3] = \"SortDescending\";\n ContextMenuItems[ContextMenuItems[\"Edit\"] = 4] = \"Edit\";\n ContextMenuItems[ContextMenuItems[\"Delete\"] = 5] = \"Delete\";\n ContextMenuItems[ContextMenuItems[\"Save\"] = 6] = \"Save\";\n ContextMenuItems[ContextMenuItems[\"Cancel\"] = 7] = \"Cancel\";\n ContextMenuItems[ContextMenuItems[\"PdfExport\"] = 8] = \"PdfExport\";\n ContextMenuItems[ContextMenuItems[\"ExcelExport\"] = 9] = \"ExcelExport\";\n ContextMenuItems[ContextMenuItems[\"CsvExport\"] = 10] = \"CsvExport\";\n ContextMenuItems[ContextMenuItems[\"FirstPage\"] = 11] = \"FirstPage\";\n ContextMenuItems[ContextMenuItems[\"PrevPage\"] = 12] = \"PrevPage\";\n ContextMenuItems[ContextMenuItems[\"LastPage\"] = 13] = \"LastPage\";\n ContextMenuItems[ContextMenuItems[\"NextPage\"] = 14] = \"NextPage\";\n ContextMenuItems[ContextMenuItems[\"AddRow\"] = 15] = \"AddRow\";\n})(ContextMenuItems || (ContextMenuItems = {}));\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the paging behavior of the TreeGrid.\n */\nvar PageSettings = /** @class */ (function (_super) {\n __extends(PageSettings, _super);\n function PageSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(12)\n ], PageSettings.prototype, \"pageSize\", void 0);\n __decorate([\n Property(8)\n ], PageSettings.prototype, \"pageCount\", void 0);\n __decorate([\n Property(1)\n ], PageSettings.prototype, \"currentPage\", void 0);\n __decorate([\n Property()\n ], PageSettings.prototype, \"totalRecordsCount\", void 0);\n __decorate([\n Property(false)\n ], PageSettings.prototype, \"enableQueryString\", void 0);\n __decorate([\n Property(false)\n ], PageSettings.prototype, \"pageSizes\", void 0);\n __decorate([\n Property(null)\n ], PageSettings.prototype, \"template\", void 0);\n __decorate([\n Property('All')\n ], PageSettings.prototype, \"pageSizeMode\", void 0);\n return PageSettings;\n}(ChildProperty));\nexport { PageSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty, Collection, getEnumValue, compile } from '@syncfusion/ej2-base';\nimport { Internationalization } from '@syncfusion/ej2-base';\nimport { CellType } from '@syncfusion/ej2-grids';\n/**\n * Configures the TreeGrid's aggregate column.\n */\nvar AggregateColumn = /** @class */ (function (_super) {\n __extends(AggregateColumn, _super);\n function AggregateColumn() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.intl = new Internationalization();\n _this.templateFn = {};\n return _this;\n }\n /**\n * Custom format function\n *\n * @hidden\n * @param {string} cultureName - culture name to format\n * @returns {void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n AggregateColumn.prototype.setFormatter = function (cultureName) {\n if (this.format && (this.format.skeleton || this.format.format)) {\n this.formatFn = this.getFormatFunction(this.format);\n }\n };\n /**\n * @param {NumberFormatOptions | DateFormatOptions} format - formatting options for number and date values\n * @hidden\n * @returns {Function} - return formatter function\n */\n AggregateColumn.prototype.getFormatFunction = function (format) {\n if (format.type) {\n return this.intl.getDateFormat(format);\n }\n else {\n return this.intl.getNumberFormat(format);\n }\n };\n /**\n * @hidden\n * @returns {Function} - Returns formatter function\n */\n AggregateColumn.prototype.getFormatter = function () {\n return this.formatFn;\n };\n /**\n * @param {Object} helper - Specified the helper\n * @hidden\n * @returns {void}\n */\n AggregateColumn.prototype.setTemplate = function (helper) {\n if (helper === void 0) { helper = {}; }\n if (this.footerTemplate !== undefined) {\n this.templateFn[getEnumValue(CellType, CellType.Summary)] = { fn: compile(this.footerTemplate, helper),\n property: 'footerTemplate' };\n }\n };\n /**\n * @param {CellType} type - specifies the cell type\n * @returns {Object} returns the object\n * @hidden\n */\n AggregateColumn.prototype.getTemplate = function (type) {\n return this.templateFn[getEnumValue(CellType, type)];\n };\n /**\n * @param {Object} prop - updates aggregate properties without change detection\n * @hidden\n * @returns {void}\n */\n AggregateColumn.prototype.setPropertiesSilent = function (prop) {\n this.setProperties(prop, true);\n };\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"type\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"footerTemplate\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"field\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"format\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"columnName\", void 0);\n __decorate([\n Property()\n ], AggregateColumn.prototype, \"customAggregate\", void 0);\n return AggregateColumn;\n}(ChildProperty));\nexport { AggregateColumn };\nvar AggregateRow = /** @class */ (function (_super) {\n __extends(AggregateRow, _super);\n function AggregateRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Collection([], AggregateColumn)\n ], AggregateRow.prototype, \"columns\", void 0);\n __decorate([\n Property(true)\n ], AggregateRow.prototype, \"showChildSummary\", void 0);\n return AggregateRow;\n}(ChildProperty));\nexport { AggregateRow };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ChildProperty, Property } from '@syncfusion/ej2-base';\n/**\n * Configures the edit behavior of the TreeGrid.\n */\nvar EditSettings = /** @class */ (function (_super) {\n __extends(EditSettings, _super);\n function EditSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"allowAdding\", void 0);\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"allowEditing\", void 0);\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"allowDeleting\", void 0);\n __decorate([\n Property('Cell')\n ], EditSettings.prototype, \"mode\", void 0);\n __decorate([\n Property('Top')\n ], EditSettings.prototype, \"newRowPosition\", void 0);\n __decorate([\n Property(true)\n ], EditSettings.prototype, \"allowEditOnDblClick\", void 0);\n __decorate([\n Property(true)\n ], EditSettings.prototype, \"showConfirmDialog\", void 0);\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"showDeleteConfirmDialog\", void 0);\n __decorate([\n Property('')\n ], EditSettings.prototype, \"template\", void 0);\n __decorate([\n Property({})\n ], EditSettings.prototype, \"dialog\", void 0);\n __decorate([\n Property(false)\n ], EditSettings.prototype, \"allowNextRowEdit\", void 0);\n return EditSettings;\n}(ChildProperty));\nexport { EditSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ChildProperty, Property, Collection } from '@syncfusion/ej2-base';\n/**\n * Represents the field name and direction of sort column.\n */\nvar SortDescriptor = /** @class */ (function (_super) {\n __extends(SortDescriptor, _super);\n function SortDescriptor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], SortDescriptor.prototype, \"field\", void 0);\n __decorate([\n Property()\n ], SortDescriptor.prototype, \"direction\", void 0);\n return SortDescriptor;\n}(ChildProperty));\nexport { SortDescriptor };\n/**\n * Configures the sorting behavior of TreeGrid.\n */\nvar SortSettings = /** @class */ (function (_super) {\n __extends(SortSettings, _super);\n function SortSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Collection([], SortDescriptor)\n ], SortSettings.prototype, \"columns\", void 0);\n __decorate([\n Property(true)\n ], SortSettings.prototype, \"allowUnsort\", void 0);\n return SortSettings;\n}(ChildProperty));\nexport { SortSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the infinite scroll behavior of Tree Grid.\n */\nvar InfiniteScrollSettings = /** @class */ (function (_super) {\n __extends(InfiniteScrollSettings, _super);\n function InfiniteScrollSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property(false)\n ], InfiniteScrollSettings.prototype, \"enableCache\", void 0);\n __decorate([\n Property(3)\n ], InfiniteScrollSettings.prototype, \"maxBlocks\", void 0);\n __decorate([\n Property(3)\n ], InfiniteScrollSettings.prototype, \"initialBlocks\", void 0);\n return InfiniteScrollSettings;\n}(ChildProperty));\nexport { InfiniteScrollSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Component, addClass, createElement, EventHandler, isNullOrUndefined, extend } from '@syncfusion/ej2-base';\nimport { removeClass, Complex, Collection, getValue } from '@syncfusion/ej2-base';\nimport { Event, Property, NotifyPropertyChanges, setValue, KeyboardEvents, L10n } from '@syncfusion/ej2-base';\nimport { Column } from '../models/column';\nimport { RowDropSettings, getUid } from '@syncfusion/ej2-grids';\nimport { FilterSettings } from '../models/filter-settings';\nimport { TextWrapSettings } from '../models/textwrap-settings';\nimport { Logger as TreeLogger } from '../actions/logger';\nimport { TreeClipboard } from '../actions/clipboard';\nimport { Selection as TreeGridSelection } from '../actions/selection';\nimport { Print } from '../actions/print';\nimport * as events from '../base/constant';\nimport { SearchSettings } from '../models/search-settings';\nimport { SelectionSettings } from '../models/selection-settings';\nimport { getActualProperties, getObject } from '@syncfusion/ej2-grids';\nimport { DataManager, RemoteSaveAdaptor, Query, JsonAdaptor, Deferred } from '@syncfusion/ej2-data';\nimport { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';\nimport { isRemoteData, isOffline, extendArray, isCountRequired, findChildrenRecords } from '../utils';\nimport { Grid, Logger } from '@syncfusion/ej2-grids';\nimport { Render } from '../renderer/render';\nimport { DataManipulation } from './data';\nimport { RowDD } from '../actions/rowdragdrop';\nimport { iterateArrayOrObject } from '@syncfusion/ej2-grids';\nimport { ToolbarItem, ContextMenuItems } from '../enum';\nimport { PageSettings } from '../models/page-settings';\nimport { AggregateRow } from '../models/summary';\nimport { EditSettings } from '../models/edit-settings';\nimport { SortSettings } from '../models/sort-settings';\nimport { isHidden, getExpandStatus } from '../utils';\nimport { editAction } from '../actions/crud-actions';\nimport { InfiniteScrollSettings } from '../models/infinite-scroll-settings';\n/**\n * Represents the TreeGrid component.\n * ```html\n * <div id='treegrid'></div>\n * <script>\n * var treegridObj = new TreeGrid({ allowPaging: true });\n * treegridObj.appendTo('#treegrid');\n * </script>\n * ```\n */\nvar TreeGrid = /** @class */ (function (_super) {\n __extends(TreeGrid, _super);\n function TreeGrid(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.dataResults = {};\n _this.uniqueIDCollection = {};\n _this.uniqueIDFilterCollection = {};\n _this.changedRecords = 'changedRecords';\n _this.deletedRecords = 'deletedRecords';\n _this.addedRecords = 'addedRecords';\n _this.objectEqualityChecker = function (old, current) {\n if (old) {\n var keys = Object.keys(old);\n var isEqual = true;\n var excludeKeys = ['Children', 'childRecords', 'taskData', 'uniqueID', 'parentItem', 'parentUniqueID', 'index'];\n for (var i = 0; i < keys.length; i++) {\n if (old[keys[i]] !== current[keys[i]] && excludeKeys.indexOf(keys[i]) === -1) {\n var isDate = old[keys[i]] instanceof Date && current[keys[i]] instanceof Date;\n if (!isDate || (old[keys[i]].getTime() !== current[keys[i]].getTime())) {\n isEqual = false;\n break;\n }\n }\n }\n return isEqual;\n }\n else {\n return false;\n }\n };\n TreeGrid_1.Inject(TreeGridSelection);\n setValue('mergePersistData', _this.mergePersistTreeGridData, _this);\n var logger = 'Logger';\n if (!isNullOrUndefined(_this.injectedModules[logger])) {\n Grid.Inject(Logger);\n }\n _this.grid = new Grid();\n return _this;\n }\n TreeGrid_1 = TreeGrid;\n /**\n * Export TreeGrid data to Excel file(.xlsx).\n *\n * @param {ExcelExportProperties | TreeGridExcelExportProperties} excelExportProperties - Defines the export properties of the Tree Grid.\n * @param {boolean} isMultipleExport - Define to enable multiple export.\n * @param {workbook} workbook - Defines the Workbook if multiple export is enabled.\n * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.\n * @returns {Promise<any>} - Returns promise object of export action\n */\n /* eslint-disable */\n TreeGrid.prototype.excelExport = function (excelExportProperties, isMultipleExport, workbook, isBlob) {\n /* eslint-enable */\n return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, false);\n };\n /**\n * Export TreeGrid data to CSV file.\n *\n * @param {ExcelExportProperties} excelExportProperties - Defines the export properties of the TreeGrid.\n * @param {boolean} isMultipleExport - Define to enable multiple export.\n * @param {workbook} workbook - Defines the Workbook if multiple export is enabled.\n * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.\n * @returns {Promise<any>} - Returns promise object of export action\n */\n /* eslint-disable */\n TreeGrid.prototype.csvExport = function (excelExportProperties, isMultipleExport, workbook, isBlob) {\n /* eslint-enable */\n return this.excelExportModule.Map(excelExportProperties, isMultipleExport, workbook, isBlob, true);\n };\n /**\n * Export TreeGrid data to PDF document.\n *\n * @param {PdfExportProperties | TreeGridPdfExportProperties} pdfExportProperties - Defines the export properties of the Tree Grid.\n * @param {boolean} isMultipleExport - Define to enable multiple export.\n * @param {Object} pdfDoc - Defined the Pdf Document if multiple export is enabled.\n * @param {boolean} isBlob - If 'isBlob' set to true, then it will be returned as blob data.\n * @returns {Promise<any>} - Returns promise object of export action\n */\n TreeGrid.prototype.pdfExport = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {\n return this.pdfExportModule.Map(pdfExportProperties, isMultipleExport, pdfDoc, isBlob);\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns TreeGrid module name\n */\n TreeGrid.prototype.getModuleName = function () {\n return 'treegrid';\n };\n /**\n * For internal use only - Initialize the event handler;\n *\n * @private\n * @returns {void}\n */\n TreeGrid.prototype.preRender = function () {\n this.TreeGridLocale();\n this.initProperties();\n this.defaultLocale = {\n Above: 'Above',\n Below: 'Below',\n Child: 'Child',\n AddRow: 'Add Row',\n ExpandAll: 'Expand All',\n CollapseAll: 'Collapse All',\n RowIndent: 'Indent',\n RowOutdent: 'Outdent'\n };\n this.l10n = new L10n('treegrid', this.defaultLocale, this.locale);\n if (this.isSelfReference && isNullOrUndefined(this.childMapping)) {\n this.childMapping = 'Children';\n }\n };\n /**\n * Sorts a column with the given options.\n *\n * @param {string} columnName - Defines the column name to be sorted.\n * @param {SortDirection} direction - Defines the direction of sorting field.\n * @param {boolean} isMultiSort - Specifies whether the previous sorted columns are to be maintained.\n * @returns {void}\n */\n TreeGrid.prototype.sortByColumn = function (columnName, direction, isMultiSort) {\n if (this.sortModule) {\n this.sortModule.sortColumn(columnName, direction, isMultiSort);\n }\n };\n /**\n * Clears all the sorted columns of the TreeGrid.\n *\n * @returns {void}\n */\n TreeGrid.prototype.clearSorting = function () {\n if (this.sortModule) {\n this.sortModule.clearSorting();\n }\n };\n /**\n * Remove sorted column by field name.\n *\n * @param {string} field - Defines the column field name to remove sort.\n * @returns {void}\n * @hidden\n */\n TreeGrid.prototype.removeSortColumn = function (field) {\n if (this.sortModule) {\n this.sortModule.removeSortColumn(field);\n }\n };\n /**\n * Searches TreeGrid records using the given key.\n * You can customize the default search option by using the\n * [`searchSettings`](./#searchsettings/).\n *\n * @param {string} searchString - Defines the key.\n * @returns {void}\n */\n TreeGrid.prototype.search = function (searchString) {\n this.grid.search(searchString);\n };\n /**\n * Changes the column width to automatically fit its content to ensure that the width shows the content without wrapping/hiding.\n * > * This method ignores the hidden columns.\n * > * Uses the `autoFitColumns` method in the `dataBound` event to resize at initial rendering.\n *\n * @param {string |string[]} fieldNames - Defines the column names.\n * @returns {void}\n *\n *\n *\n */\n TreeGrid.prototype.autoFitColumns = function (fieldNames) {\n this.resizeModule.autoFitColumns(fieldNames);\n this.updateColumnModel();\n };\n /**\n * Changes the TreeGrid column positions by field names.\n *\n * @param {string} fromFName - Defines the origin field name.\n * @param {string} toFName - Defines the destination field name.\n * @returns {void}\n */\n TreeGrid.prototype.reorderColumns = function (fromFName, toFName) {\n this.grid.reorderColumns(fromFName, toFName);\n };\n TreeGrid.prototype.TreeGridLocale = function () {\n /* eslint-disable-next-line @typescript-eslint/no-explicit-any */\n var locale = L10n.locale;\n var localeObject = {};\n setValue(this.locale, {}, localeObject);\n var gridLocale;\n gridLocale = {};\n gridLocale = getObject(this.locale, locale);\n var treeGridLocale;\n treeGridLocale = {};\n treeGridLocale = getObject(this.getModuleName(), gridLocale);\n setValue('grid', treeGridLocale, getObject(this.locale, localeObject));\n L10n.load(localeObject);\n };\n /**\n * By default, prints all the pages of the TreeGrid and hides the pager.\n * > You can customize print options using the\n * [`printMode`](./#printmode).\n *\n * @returns {void}\n */\n TreeGrid.prototype.print = function () {\n this.printModule.print();\n };\n TreeGrid.prototype.treeGridkeyActionHandler = function (e) {\n if (this.allowKeyboard) {\n var target = void 0;\n var parentTarget = void 0;\n var column = void 0;\n var row = void 0;\n var summaryElement = void 0;\n switch (e.action) {\n case 'ctrlDownArrow':\n this.expandAll();\n break;\n case 'ctrlUpArrow':\n this.collapseAll();\n break;\n case 'ctrlShiftUpArrow':\n target = e.target;\n column = target.closest('.e-rowcell');\n row = column.closest('tr');\n if (row !== null && row !== undefined) {\n this.expandCollapseRequest(row.querySelector('.e-treegridexpand'));\n }\n break;\n case 'ctrlShiftDownArrow':\n target = e.target;\n column = target.closest('.e-rowcell');\n row = column.closest('tr');\n if (row !== null && row !== undefined) {\n this.expandCollapseRequest(row.querySelector('.e-treegridcollapse'));\n }\n break;\n case 'downArrow':\n if (!this.enableVirtualization) {\n parentTarget = e.target.parentElement;\n summaryElement = this.findnextRowElement(parentTarget);\n if (summaryElement !== null) {\n var rowIndex = summaryElement.rowIndex;\n this.selectRow(rowIndex);\n var cellIndex = e.target.cellIndex;\n var row_1 = summaryElement.children[cellIndex];\n addClass([row_1], 'e-focused');\n addClass([row_1], 'e-focus');\n }\n else {\n this.clearSelection();\n }\n }\n break;\n case 'upArrow':\n if (!this.enableVirtualization) {\n parentTarget = e.target.parentElement;\n summaryElement = this.findPreviousRowElement(parentTarget);\n if (summaryElement !== null) {\n var rIndex = summaryElement.rowIndex;\n this.selectRow(rIndex);\n var cIndex = e.target.cellIndex;\n var rows = summaryElement.children[cIndex];\n addClass([rows], 'e-focused');\n addClass([rows], 'e-focus');\n }\n else {\n this.clearSelection();\n }\n }\n }\n }\n };\n // Get Proper Row Element from the summary\n TreeGrid.prototype.findnextRowElement = function (summaryRowElement) {\n var rowElement = summaryRowElement.nextElementSibling;\n if (rowElement !== null && (rowElement.className.indexOf('e-summaryrow') !== -1 ||\n rowElement.style.display === 'none')) {\n rowElement = this.findnextRowElement(rowElement);\n }\n return rowElement;\n };\n // Get Proper Row Element from the summary\n TreeGrid.prototype.findPreviousRowElement = function (summaryRowElement) {\n var rowElement = summaryRowElement.previousElementSibling;\n if (rowElement !== null && (rowElement.className.indexOf('e-summaryrow') !== -1 ||\n rowElement.style.display === 'none')) {\n rowElement = this.findPreviousRowElement(rowElement);\n }\n return rowElement;\n };\n TreeGrid.prototype.initProperties = function () {\n this.defaultLocale = {};\n this.flatData = [];\n this.parentData = [];\n this.columnModel = [];\n this.isExpandAll = false;\n this.isCollapseAll = false;\n this.keyConfigs = {\n ctrlDownArrow: 'ctrl+downarrow',\n ctrlUpArrow: 'ctrl+uparrow',\n ctrlShiftUpArrow: 'ctrl+shift+uparrow',\n ctrlShiftDownArrow: 'ctrl+shift+downarrow',\n downArrow: 'downArrow',\n upArrow: 'upArrow'\n };\n this.isLocalData = (!(this.dataSource instanceof DataManager) || this.dataSource.dataSource.offline\n || (!isNullOrUndefined(this.dataSource.ready)) || this.dataSource.adaptor instanceof RemoteSaveAdaptor);\n this.isSelfReference = !isNullOrUndefined(this.parentIdMapping);\n };\n /**\n * Binding events to the element while component creation.\n *\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.wireEvents = function () {\n EventHandler.add(this.grid.element, 'click', this.mouseClickHandler, this);\n EventHandler.add(this.element, 'touchend', this.mouseClickHandler, this);\n this.keyboardModule = new KeyboardEvents(this.element, {\n keyAction: this.treeGridkeyActionHandler.bind(this),\n keyConfigs: this.keyConfigs,\n eventName: 'keydown'\n });\n if (this.allowKeyboard) {\n this.element.tabIndex = this.element.tabIndex === -1 ? 0 : this.element.tabIndex;\n }\n };\n /**\n * To provide the array of modules needed for component rendering\n *\n * @returns {ModuleDeclaration[]} - Returns TreeGrid modules collection\n * @hidden\n */\n TreeGrid.prototype.requiredModules = function () {\n var modules = [];\n var splitFrozenCount = 'splitFrozenCount';\n this.grid[splitFrozenCount](this.getGridColumns(this.columns));\n if (this.isDestroyed) {\n return modules;\n }\n modules.push({\n member: 'filter', args: [this, this.filterSettings]\n });\n if (!isNullOrUndefined(this.toolbar)) {\n modules.push({\n member: 'toolbar',\n args: [this]\n });\n }\n if (this.contextMenuItems) {\n modules.push({\n member: 'contextMenu',\n args: [this]\n });\n }\n if (this.allowPaging) {\n modules.push({\n member: 'pager',\n args: [this, this.pageSettings]\n });\n }\n if (this.allowReordering) {\n modules.push({\n member: 'reorder',\n args: [this]\n });\n }\n if (this.allowSorting) {\n modules.push({\n member: 'sort',\n args: [this]\n });\n }\n if (this.aggregates.length > 0) {\n modules.push({\n member: 'summary', args: [this]\n });\n }\n modules.push({\n member: 'resize', args: [this]\n });\n if (this.allowExcelExport) {\n modules.push({\n member: 'ExcelExport', args: [this]\n });\n }\n if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||\n this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount()) {\n modules.push({\n member: 'freeze', args: [this]\n });\n }\n if (this.detailTemplate) {\n modules.push({\n member: 'detailRow', args: [this]\n });\n }\n if (this.allowPdfExport) {\n modules.push({\n member: 'PdfExport', args: [this]\n });\n }\n if (this.showColumnMenu) {\n modules.push({\n member: 'columnMenu', args: [this]\n });\n }\n if (this.showColumnChooser) {\n modules.push({\n member: 'ColumnChooser', args: [this]\n });\n }\n this.extendRequiredModules(modules);\n return modules;\n };\n TreeGrid.prototype.extendRequiredModules = function (modules) {\n if (this.allowRowDragAndDrop) {\n modules.push({\n member: 'rowDragAndDrop',\n args: [this]\n });\n }\n if (!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') || this.toolbar['includes']('Outdent'))) {\n TreeGrid_1.Inject(RowDD);\n modules.push({\n member: 'rowDragAndDrop',\n args: [this]\n });\n }\n if (this.editSettings.allowAdding || this.editSettings.allowDeleting || this.editSettings.allowEditing) {\n modules.push({\n member: 'edit',\n args: [this]\n });\n }\n if (this.isCommandColumn(this.columns)) {\n modules.push({\n member: 'commandColumn',\n args: [this]\n });\n }\n if (this.allowSelection) {\n modules.push({\n member: 'selection',\n args: [this]\n });\n }\n if (this.enableVirtualization) {\n modules.push({\n member: 'virtualScroll',\n args: [this]\n });\n }\n if (this.enableInfiniteScrolling) {\n modules.push({\n member: 'infiniteScroll',\n args: [this]\n });\n }\n modules.push({\n member: 'logger',\n args: [this.grid]\n });\n };\n TreeGrid.prototype.isCommandColumn = function (columns) {\n var _this = this;\n return columns.some(function (col) {\n if (col.columns) {\n return _this.isCommandColumn(col.columns);\n }\n return !!(col.commands || col.commandsTemplate);\n });\n };\n /**\n * Unbinding events from the element while component destroy.\n *\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.unwireEvents = function () {\n if (this.grid && this.grid.element) {\n EventHandler.remove(this.grid.element, 'click', this.mouseClickHandler);\n }\n };\n /**\n * Logs tree grid error message on console\n *\n * @param {string | string[]} types - Tree Grid error type\n * @param {object} args - Error details\n * @hidden\n * @private\n * @returns {void}\n */\n TreeGrid.prototype.log = function (types, args) {\n if (this.loggerModule) {\n this.loggerModule.treeLog(types, args, this);\n }\n };\n /**\n * For internal use only - To Initialize the component rendering.\n *\n * @private\n * @returns {void}\n */\n TreeGrid.prototype.render = function () {\n var _this = this;\n if (this.isReact) {\n this.grid.isReact = true;\n this.grid.portals = [];\n }\n if (this.isVue) {\n this.grid.isVue = true;\n }\n createSpinner({ target: this.element }, this.createElement);\n this.log(['mapping_fields_missing']);\n this.renderModule = new Render(this);\n this.dataModule = new DataManipulation(this);\n this.printModule = new Print(this);\n this.trigger(events.load);\n this.autoGenerateColumns();\n this.initialRender = true;\n if (!isNullOrUndefined(this.dataSource)) {\n this.convertTreeData(this.dataSource);\n }\n this.loadGrid();\n if (this.element.classList.contains('e-treegrid') && this.rowDropSettings.targetID) {\n this.grid.rowDropSettings.targetID += '_gridcontrol';\n }\n this.addListener();\n var gridContainer = createElement('div', { id: this.element.id + '_gridcontrol' });\n addClass([this.element], 'e-treegrid');\n if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {\n this.element.style.height = this.height;\n }\n if (!isNullOrUndefined(this.width) && typeof (this.width) === 'string' && this.width.indexOf('%') !== -1) {\n this.element.style.width = this.width;\n }\n this.element.appendChild(gridContainer);\n var gridRequiredModules = this.grid.requiredModules;\n this.grid.requiredModules = function () {\n var modules = [];\n modules = gridRequiredModules.apply(this);\n for (var i = 0; i < modules.length; i++) {\n if (modules[i].member === 'virtualscroll') {\n modules[i].member = 'treeVirtualScroll';\n }\n }\n return modules;\n };\n var root = 'root';\n this.grid[root] = this[root] ? this[root] : this;\n this.grid.appendTo(gridContainer);\n this.wireEvents();\n this.renderComplete();\n var destroyTemplate = 'destroyTemplate';\n var destroyTemplateFn = this.grid[destroyTemplate];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.grid[destroyTemplate] = function (args, index) {\n destroyTemplateFn.apply(_this.grid);\n var portals = 'portals';\n if (!(_this.isReact && isNullOrUndefined(_this[portals]))) {\n _this.clearTemplate(args, index);\n }\n };\n };\n TreeGrid.prototype.afterGridRender = function () {\n if (!isNullOrUndefined(this.grid.clipboardModule)) {\n this.grid.clipboardModule.destroy();\n }\n this.clipboardModule = this.grid.clipboardModule = new TreeClipboard(this);\n };\n TreeGrid.prototype.convertTreeData = function (data) {\n var _this = this;\n if (isCountRequired(this)) {\n data = getValue('result', data);\n }\n if (data instanceof Array && data.length > 0 && Object.prototype.hasOwnProperty.call(data[0], 'level')) {\n this.flatData = data;\n this.flatData.filter(function (e) {\n setValue('uniqueIDCollection.' + e.uniqueID, e, _this);\n if (e.level === 0) {\n _this.parentData.push(e);\n }\n });\n }\n else {\n if (isCountRequired(this)) {\n var griddata = getValue('result', this.dataSource);\n this.dataModule.convertToFlatData(griddata);\n }\n else {\n this.dataModule.convertToFlatData(data);\n }\n }\n };\n // private getGridData(): Object {\n // if (isRemoteData(this)) {\n // return this.dataSource;\n // } else if (this.isLocalData && this.dataSource instanceof DataManager) {\n // this.dataSource.dataSource.json = this.flatData;\n // return this.dataSource;\n // }\n // return this.flatData;\n // }\n TreeGrid.prototype.bindGridProperties = function () {\n this.bindedDataSource();\n this.grid.enableRtl = this.enableRtl;\n this.grid.allowKeyboard = this.allowKeyboard;\n this.grid.columns = this.getGridColumns(this.columns);\n this.grid.allowExcelExport = this.allowExcelExport;\n this.grid.allowPdfExport = this.allowPdfExport;\n this.grid.query = this.query;\n this.grid.columnQueryMode = this.columnQueryMode;\n this.grid.allowPaging = this.allowPaging;\n this.grid.pageSettings = getActualProperties(this.pageSettings);\n this.grid.pagerTemplate = this.pagerTemplate;\n this.grid.showColumnMenu = this.showColumnMenu;\n this.grid.allowSorting = this.allowSorting;\n this.grid.allowFiltering = this.allowFiltering;\n this.grid.enableVirtualization = this.enableVirtualization;\n this.grid.enableColumnVirtualization = this.enableColumnVirtualization;\n this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;\n this.grid.infiniteScrollSettings = this.infiniteScrollSettings;\n this.grid.width = this.width;\n this.grid.height = this.height;\n this.grid.enableAltRow = this.enableAltRow;\n this.grid.allowReordering = this.allowReordering;\n this.grid.allowTextWrap = this.allowTextWrap;\n this.grid.allowResizing = this.allowResizing;\n this.grid.enableHover = this.enableHover;\n this.grid.enableAutoFill = this.enableAutoFill;\n this.grid.enableAdaptiveUI = this.enableAdaptiveUI;\n this.grid.enableImmutableMode = this.enableImmutableMode;\n this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;\n this.grid.rowDropSettings = getActualProperties(this.rowDropSettings);\n this.grid.rowHeight = this.rowHeight;\n this.grid.gridLines = this.gridLines;\n this.grid.allowSelection = this.allowSelection;\n this.grid.toolbar = getActualProperties(this.getGridToolbar());\n this.grid.toolbarTemplate = this.toolbarTemplate;\n this.grid.showColumnChooser = this.showColumnChooser;\n this.grid.filterSettings = getActualProperties(this.filterSettings);\n this.grid.selectionSettings = getActualProperties(this.selectionSettings);\n this.grid.sortSettings = getActualProperties(this.sortSettings);\n this.grid.searchSettings = getActualProperties(this.searchSettings);\n this.grid.aggregates = getActualProperties(this.aggregates);\n this.grid.textWrapSettings = getActualProperties(this.textWrapSettings);\n this.grid.printMode = getActualProperties(this.printMode);\n this.grid.locale = getActualProperties(this.locale);\n this.grid.selectedRowIndex = this.selectedRowIndex;\n this.grid.contextMenuItems = getActualProperties(this.getContextMenu());\n this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);\n this.grid.editSettings = this.getGridEditSettings();\n this.grid.rowTemplate = getActualProperties(this.rowTemplate);\n this.grid.detailTemplate = getActualProperties(this.detailTemplate);\n this.grid.frozenRows = this.frozenRows;\n this.grid.frozenColumns = this.frozenColumns;\n this.grid.clipMode = getActualProperties(this.clipMode);\n var templateInstance = 'templateDotnetInstance';\n this.grid[templateInstance] = this[templateInstance];\n var isJsComponent = 'isJsComponent';\n this.grid[isJsComponent] = true;\n };\n TreeGrid.prototype.triggerEvents = function (args) {\n this.trigger(getObject('name', args), args);\n };\n TreeGrid.prototype.bindGridEvents = function () {\n var _this = this;\n this.grid.rowSelecting = function (args) {\n if (!isNullOrUndefined(args.target) && (args.target.classList.contains('e-treegridexpand')\n || args.target.classList.contains('e-treegridcollapse') || args.target.classList.contains('e-summarycell'))) {\n args.cancel = true;\n return;\n }\n _this.trigger(events.rowSelecting, args);\n };\n this.grid.rowSelected = function (args) {\n if (_this.enableVirtualization && args.isHeaderCheckboxClicked &&\n _this.grid.currentViewData.length !== _this.grid.selectionModule.selectedRowIndexes.length) {\n var updateRowSelection = 'updateRowSelection';\n for (var i = 0; i < _this.getRows().length; i++) {\n if (_this.getRows()[i].getElementsByClassName('e-frame e-icons e-uncheck').length) {\n _this.grid.selectionModule[updateRowSelection](_this.getRows()[i], _this.getCurrentViewRecords()[i].index);\n }\n }\n }\n _this.selectedRowIndex = _this.grid.selectedRowIndex;\n _this.notify(events.rowSelected, args);\n _this.trigger(events.rowSelected, args);\n };\n this.grid.rowDeselected = function (args) {\n _this.selectedRowIndex = _this.grid.selectedRowIndex;\n if (!isNullOrUndefined(args.data)) {\n _this.notify(events.rowDeselected, args);\n }\n _this.trigger(events.rowDeselected, args);\n };\n this.grid.resizeStop = function (args) {\n _this.updateColumnModel();\n _this.trigger(events.resizeStop, args);\n };\n this.grid.excelQueryCellInfo = function (args) {\n _this.notify('excelCellInfo', args);\n args = _this.dataResults;\n };\n this.grid.pdfQueryCellInfo = function (args) {\n _this.notify('pdfCellInfo', args);\n args = _this.dataResults;\n };\n this.grid.checkBoxChange = function (args) {\n _this.trigger(events.checkboxChange, args);\n };\n this.grid.pdfExportComplete = this.triggerEvents.bind(this);\n this.grid.excelExportComplete = this.triggerEvents.bind(this);\n this.grid.excelHeaderQueryCellInfo = this.triggerEvents.bind(this);\n this.grid.pdfHeaderQueryCellInfo = this.triggerEvents.bind(this);\n this.grid.dataSourceChanged = this.triggerEvents.bind(this);\n this.grid.recordDoubleClick = this.triggerEvents.bind(this);\n this.grid.rowDeselecting = this.triggerEvents.bind(this);\n this.grid.cellDeselected = this.triggerEvents.bind(this);\n this.grid.cellDeselecting = this.triggerEvents.bind(this);\n this.grid.columnMenuOpen = this.triggerEvents.bind(this);\n this.grid.columnMenuClick = this.triggerEvents.bind(this);\n this.grid.cellSelected = this.triggerEvents.bind(this);\n this.grid.headerCellInfo = this.triggerEvents.bind(this);\n this.grid.resizeStart = this.triggerEvents.bind(this);\n this.grid.resizing = this.triggerEvents.bind(this);\n this.grid.columnDrag = this.triggerEvents.bind(this);\n this.grid.columnDragStart = this.triggerEvents.bind(this);\n this.grid.columnDrop = this.triggerEvents.bind(this);\n this.grid.beforePrint = this.triggerEvents.bind(this);\n this.grid.beforeCopy = this.triggerEvents.bind(this);\n this.grid.beforePaste = function (args) {\n var rows = _this.getRows();\n var rowIndex = 'rowIndex';\n while (rows[args[rowIndex]].classList.contains('e-summaryrow')) {\n args[rowIndex]++;\n }\n _this.trigger(events.beforePaste, args);\n };\n this.grid.load = function () {\n _this.grid.on('initial-end', _this.afterGridRender, _this);\n if (!isNullOrUndefined(_this.loggerModule)) {\n var loggerModule = 'loggerModule';\n _this.loggerModule = _this.grid[loggerModule] = new TreeLogger(_this.grid);\n }\n };\n this.grid.printComplete = this.triggerEvents.bind(this);\n this.grid.actionFailure = this.triggerEvents.bind(this);\n this.extendedGridDataBoundEvent();\n this.extendedGridEvents();\n this.extendedGridActionEvents();\n this.extendedGridEditEvents();\n this.bindGridDragEvents();\n this.bindCallBackEvents();\n };\n TreeGrid.prototype.lastRowBorder = function (visiblerow, isAddBorder) {\n for (var j = 0; j < visiblerow.cells.length; j++) {\n if (isAddBorder) {\n addClass([visiblerow.cells[j]], 'e-lastrowcell');\n }\n else {\n removeClass([visiblerow.cells[j]], 'e-lastrowcell');\n }\n }\n };\n TreeGrid.prototype.isPixelHeight = function () {\n if (this.height !== 'auto' && this.height.toString().indexOf('%') === -1) {\n return true;\n }\n else {\n return false;\n }\n };\n TreeGrid.prototype.extendedGridDataBoundEvent = function () {\n var _this = this;\n this.grid.dataBound = function (args) {\n _this.updateRowTemplate();\n _this.updateColumnModel();\n _this.updateAltRow(_this.getRows());\n _this.notify('dataBoundArg', args);\n if (isRemoteData(_this) && !isOffline(_this) && !_this.hasChildMapping) {\n var req = getObject('dataSource.requests', _this).filter(function (e) {\n return e.httpRequest.statusText !== 'OK';\n }).length;\n setValue('grid.contentModule.isLoaded', !(req > 0), _this);\n }\n if (_this.isPixelHeight() && _this.initialRender) {\n var rows = _this.getContentTable().rows;\n var totalRows = [].slice.call(rows);\n for (var i = totalRows.length - 1; i > 0; i--) {\n if (!isHidden(totalRows[i])) {\n if (totalRows[i].nextElementSibling) {\n _this.lastRowBorder(totalRows[i], true);\n }\n break;\n }\n }\n }\n var action = 'action';\n if (_this.enableVirtualization && _this.selectionSettings.persistSelection && (_this.dataResults[action] === 'expand' || _this.dataResults[action] === 'collapse')) {\n var refreshPersistSelection = 'refreshPersistSelection';\n _this.grid.selectionModule[refreshPersistSelection]();\n if (_this.grid.selectionSettings.type === 'Single') {\n var updateRowSelection = 'updateRowSelection';\n var index = _this.getCurrentViewRecords().indexOf(_this.grid.selectionModule['data']);\n _this.grid.selectionModule[updateRowSelection](_this.getRows()[index], index);\n }\n }\n _this.trigger(events.dataBound, args);\n _this.initialRender = false;\n };\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var treeGrid = this;\n this.grid.beforeDataBound = function (args) {\n var dataSource = 'dataSource';\n var requestType = getObject('action', args);\n if (((isRemoteData(treeGrid) && !isOffline(treeGrid)) || isCountRequired(this)) && requestType !== 'edit') {\n treeGrid.notify('updateRemoteLevel', args);\n args = (treeGrid.dataResults);\n }\n else if (treeGrid.flatData.length === 0 && isOffline(treeGrid) && treeGrid.dataSource instanceof DataManager) {\n var dm = treeGrid.dataSource;\n treeGrid.dataModule.convertToFlatData(dm.dataSource.json);\n args.result = treeGrid.grid.dataSource[dataSource].json = treeGrid.flatData;\n }\n if (!isRemoteData(treeGrid) && !isCountRequired(this) && !isNullOrUndefined(treeGrid.dataSource)) {\n if (this.isPrinting) {\n setValue('isPrinting', true, args);\n }\n treeGrid.notify('dataProcessor', args);\n //args = treeGrid.dataModule.dataProcessor(args);\n }\n extend(args, treeGrid.dataResults);\n if (treeGrid.enableImmutableMode) {\n args.result = args.result.slice();\n }\n if (treeGrid.initialRender) {\n this.contentModule.objectEqualityChecker = treeGrid.objectEqualityChecker;\n }\n // treeGrid.notify(events.beforeDataBound, args);\n if (!this.isPrinting) {\n var callBackPromise_1 = new Deferred();\n treeGrid.trigger(events.beforeDataBound, args, function (beforeDataBoundArgs) {\n callBackPromise_1.resolve(beforeDataBoundArgs);\n });\n return callBackPromise_1;\n }\n };\n this.grid.log = function (type, args) {\n if (_this.loggerModule) {\n _this.loggerModule.log(type, args);\n }\n };\n };\n TreeGrid.prototype.bindCallBackEvents = function () {\n var _this = this;\n this.grid.toolbarClick = function (args) {\n if ((args.item.id === _this.grid.element.id + '_excelexport' && _this.allowExcelExport === false) ||\n (args.item.id === _this.grid.element.id + '_pdfexport' && _this.allowPdfExport === false) ||\n (args.item.id === _this.grid.element.id + '_csvexport' && _this.allowExcelExport === false)) {\n return;\n }\n var callBackPromise = new Deferred();\n _this.trigger(events.toolbarClick, args, function (toolbarargs) {\n if (!toolbarargs.cancel) {\n _this.notify(events.toolbarClick, args);\n }\n callBackPromise.resolve(toolbarargs);\n });\n return callBackPromise;\n };\n this.grid.cellSelecting = function (args) {\n var callBackPromise = new Deferred();\n _this.trigger(getObject('name', args), args, function (cellselectingArgs) {\n callBackPromise.resolve(cellselectingArgs);\n });\n return callBackPromise;\n };\n this.grid.beginEdit = function (args) {\n if (!isNullOrUndefined(args.row) && args.row.classList.contains('e-summaryrow')) {\n args.cancel = true;\n return;\n }\n var callBackPromise = new Deferred();\n _this.trigger(events.beginEdit, args, function (begineditArgs) {\n callBackPromise.resolve(begineditArgs);\n });\n return callBackPromise;\n };\n };\n TreeGrid.prototype.extendedGridEditEvents = function () {\n var _this = this;\n this.grid.dataStateChange = function (args) {\n if (_this.isExpandRefresh) {\n _this.isExpandRefresh = false;\n _this.grid.dataSource = { result: _this.flatData, count: getValue('count', _this.grid.dataSource) };\n }\n else {\n _this.trigger(events.dataStateChange, args);\n }\n };\n this.grid.cellSave = function (args) {\n if (_this.grid.isContextMenuOpen()) {\n var contextitems = _this.grid.contextMenuModule.contextMenu.element.getElementsByClassName('e-selected')[0];\n if ((isNullOrUndefined(contextitems) || contextitems.id !== _this.element.id + '_gridcontrol_cmenu_Save')) {\n args.cancel = true;\n }\n }\n var callBackPromise = new Deferred();\n _this.trigger(events.cellSave, args, function (cellsaveArgs) {\n if (!cellsaveArgs.cancel) {\n _this.notify(events.cellSave, cellsaveArgs);\n }\n callBackPromise.resolve(cellsaveArgs);\n });\n return callBackPromise;\n };\n this.grid.cellSaved = function (args) {\n _this.trigger(events.cellSaved, args);\n _this.notify(events.cellSaved, args);\n };\n this.grid.cellEdit = function (args) {\n var prom = 'promise';\n var promise = new Deferred();\n args[prom] = promise;\n _this.notify(events.cellEdit, args);\n return promise;\n };\n this.grid.batchAdd = function (args) {\n _this.trigger(events.batchAdd, args);\n _this.notify(events.batchAdd, args);\n };\n this.grid.beforeBatchSave = function (args) {\n _this.trigger(events.beforeBatchSave, args);\n _this.notify(events.beforeBatchSave, args);\n };\n this.grid.beforeBatchAdd = function (args) {\n _this.trigger(events.beforeBatchAdd, args);\n _this.notify(events.beforeBatchAdd, args);\n };\n this.grid.batchDelete = function (args) {\n _this.trigger(events.batchDelete, args);\n _this.notify(events.batchDelete, args);\n };\n this.grid.beforeBatchDelete = function (args) {\n _this.trigger(events.beforeBatchDelete, args);\n _this.notify(events.beforeBatchDelete, args);\n };\n this.grid.batchCancel = function (args) {\n if (_this.editSettings.mode !== 'Cell') {\n _this.trigger(events.batchCancel, args);\n }\n _this.notify(events.batchCancel, args);\n };\n };\n TreeGrid.prototype.updateRowTemplate = function () {\n this.treeColumnRowTemplate();\n };\n TreeGrid.prototype.bindedDataSource = function () {\n var dataSource = 'dataSource';\n var isDataAvailable = 'isDataAvailable';\n var adaptor = 'adaptor';\n var ready = 'ready';\n if (this.dataSource && isCountRequired(this)) {\n var data = this.flatData;\n var datacount = getValue('count', this.dataSource);\n this.grid.dataSource = { result: data, count: datacount };\n }\n else {\n this.grid.dataSource = !(this.dataSource instanceof DataManager) ?\n this.flatData : new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor);\n }\n if (this.dataSource instanceof DataManager && (this.dataSource.dataSource.offline || this.dataSource.ready)) {\n this.grid.dataSource[dataSource].json = extendArray(this.dataSource[dataSource].json);\n this.grid.dataSource[ready] = this.dataSource.ready;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var proxy_1 = this;\n if (!isNullOrUndefined(this.grid.dataSource[ready])) {\n this.grid.dataSource[ready].then(function (e) {\n var dm = proxy_1.grid.dataSource;\n dm[dataSource].offline = true;\n dm[isDataAvailable] = true;\n dm[dataSource].json = e.result;\n dm[adaptor] = new JsonAdaptor();\n });\n }\n }\n };\n TreeGrid.prototype.extendedGridActionEvents = function () {\n var _this = this;\n this.grid.actionBegin = function (args) {\n if (args.requestType === 'sorting' && args.target && args.target.parentElement &&\n args.target.parentElement.classList.contains('e-hierarchycheckbox')) {\n args.cancel = true;\n }\n var requestType = getObject('requestType', args);\n if (requestType === 'reorder') {\n _this.notify('getColumnIndex', {});\n }\n _this.notify('actionBegin', { editAction: args });\n if (!isRemoteData(_this) && !isNullOrUndefined(_this.filterModule) && !isCountRequired(_this)\n && (_this.grid.filterSettings.columns.length === 0 || _this.grid.searchSettings.key.length === 0)) {\n _this.notify('clearFilters', { flatData: _this.grid.dataSource });\n _this.grid.setProperties({ dataSource: _this.dataResults.result }, true);\n if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {\n _this.grid.renderModule.data.dataManager = _this.grid.dataSource instanceof DataManager ?\n _this.grid.dataSource :\n (isNullOrUndefined(_this.grid.dataSource) ? new DataManager() : new DataManager(_this.grid.dataSource));\n _this.grid.renderModule.data.isQueryInvokedFromData = true;\n _this.grid.query = _this.grid.query instanceof Query ? _this.grid.query : new Query();\n }\n }\n if (_this.action !== 'indenting' && _this.action !== 'outdenting') {\n var callBackPromise_2 = new Deferred();\n _this.trigger(events.actionBegin, args, function (actionArgs) {\n if (!actionArgs.cancel) {\n _this.notify(events.beginEdit, actionArgs);\n }\n callBackPromise_2.resolve(actionArgs);\n });\n return callBackPromise_2;\n }\n };\n this.grid.actionComplete = function (args) {\n _this.notify('actioncomplete', args);\n _this.updateColumnModel();\n _this.updateTreeGridModel();\n if (args.requestType === 'reorder') {\n _this.notify('setColumnIndex', {});\n }\n _this.notify('actionComplete', { editAction: args });\n if (args.requestType === 'add' && (_this.editSettings.newRowPosition !== 'Top' && _this.editSettings.newRowPosition !== 'Bottom')) {\n _this.notify(events.beginAdd, args);\n }\n if (args.requestType === 'batchsave') {\n _this.notify(events.batchSave, args);\n }\n _this.notify('updateGridActions', args);\n if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {\n _this.grid.refresh();\n }\n if (_this.action === 'indenting' || _this.action === 'outdenting') {\n _this.action = _this.action === 'indenting' ? 'indented' : 'outdented';\n var actionArgs = {\n requestType: _this.action,\n data: _this.selectedRecords,\n row: _this.selectedRows\n };\n _this.trigger(events.actionComplete, actionArgs);\n _this.action = '';\n _this.selectedRecords = _this.selectedRows = [];\n }\n else {\n _this.trigger(events.actionComplete, args);\n }\n };\n };\n TreeGrid.prototype.extendedGridEvents = function () {\n var _this = this;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var treeGrid = this;\n this.grid.recordDoubleClick = function (args) {\n _this.trigger(events.recordDoubleClick, args);\n _this.notify(events.recordDoubleClick, args);\n };\n this.grid.detailDataBound = function (args) {\n _this.notify('detaildataBound', args);\n _this.trigger(events.detailDataBound, args);\n };\n this.grid.rowDataBound = function (args) {\n if (isNullOrUndefined(this.isPrinting)) {\n setValue('isPrinting', false, args);\n }\n else {\n setValue('isPrinting', this.isPrinting, args);\n }\n treeGrid.renderModule.RowModifier(args);\n };\n this.grid.queryCellInfo = function (args) {\n if (isNullOrUndefined(this.isPrinting)) {\n setValue('isPrinting', false, args);\n }\n else {\n setValue('isPrinting', this.isPrinting, args);\n }\n treeGrid.renderModule.cellRender(args);\n };\n this.grid.contextMenuClick = function (args) {\n _this.notify(events.contextMenuClick, args);\n _this.trigger(events.contextMenuClick, args);\n };\n this.grid.contextMenuOpen = function (args) {\n _this.notify(events.contextMenuOpen, args);\n _this.trigger(events.contextMenuOpen, args);\n };\n this.grid.queryCellInfo = function (args) {\n _this.renderModule.cellRender(args);\n };\n };\n TreeGrid.prototype.bindGridDragEvents = function () {\n var _this = this;\n this.grid.rowDragStartHelper = function (args) {\n _this.trigger(events.rowDragStartHelper, args);\n };\n this.grid.rowDragStart = function (args) {\n _this.trigger(events.rowDragStart, args);\n };\n this.grid.rowDrag = function (args) {\n if (_this.grid.isEdit) {\n args.cancel = true;\n return;\n }\n _this.notify(events.rowdraging, args);\n _this.trigger(events.rowDrag, args);\n };\n this.grid.rowDrop = function (args) {\n if (_this.grid.isEdit) {\n args.cancel = true;\n return;\n }\n _this.notify(events.rowDropped, args);\n args.cancel = true;\n };\n };\n /**\n * Renders TreeGrid component\n *\n * @private\n * @returns {void}\n */\n TreeGrid.prototype.loadGrid = function () {\n this.bindGridProperties();\n this.bindGridEvents();\n setValue('registeredTemplate', this.registeredTemplate, this.grid);\n var ref = 'viewContainerRef';\n setValue('viewContainerRef', this[ref], this.grid);\n };\n /**\n * AutoGenerate TreeGrid columns from first record\n *\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.autoGenerateColumns = function () {\n if (!this.columns.length && (!this.dataModule.isRemote() && Object.keys(this.dataSource).length)) {\n this.columns = [];\n // if (this.dataSource instanceof DataManager) {\n // record = (<DataManager>this.dataSource).dataSource.json[0];\n // } else {\n var record = this.dataSource[0];\n // }\n var keys = Object.keys(record);\n for (var i = 0; i < keys.length; i++) {\n if ([this.childMapping, this.parentIdMapping].indexOf(keys[i]) === -1) {\n this.columns.push(keys[i]);\n }\n }\n }\n };\n TreeGrid.prototype.getGridEditSettings = function () {\n var edit = {};\n var guid = 'guid';\n edit.allowAdding = this.editSettings.allowAdding;\n edit.allowEditing = this.editSettings.allowEditing;\n edit.allowDeleting = this.editSettings.allowDeleting;\n edit.newRowPosition = this.editSettings.newRowPosition === 'Bottom' ? 'Bottom' : 'Top';\n edit.allowEditOnDblClick = this.editSettings.allowEditOnDblClick;\n edit.showConfirmDialog = this.editSettings.showConfirmDialog;\n edit.template = this.editSettings.template;\n edit.showDeleteConfirmDialog = this.editSettings.showDeleteConfirmDialog;\n edit.allowNextRowEdit = this.editSettings.allowNextRowEdit;\n edit[guid] = this.editSettings[guid];\n edit.dialog = this.editSettings.dialog;\n switch (this.editSettings.mode) {\n case 'Dialog':\n edit.mode = this.editSettings.mode;\n break;\n case 'Batch':\n edit.mode = this.editSettings.mode;\n break;\n case 'Row':\n edit.mode = 'Normal';\n break;\n case 'Cell':\n edit.mode = 'Normal';\n edit.showConfirmDialog = false;\n break;\n }\n return edit;\n };\n /**\n * Defines grid toolbar from treegrid toolbar model\n *\n * @hidden\n * @returns {Object[]} - returns context menu items\n */\n TreeGrid.prototype.getContextMenu = function () {\n if (this.contextMenuItems) {\n var items = [];\n for (var i = 0; i < this.contextMenuItems.length; i++) {\n switch (this.contextMenuItems[i]) {\n case 'AddRow':\n case ContextMenuItems.AddRow:\n items.push({ text: this.l10n.getConstant('AddRow'),\n target: '.e-content', id: this.element.id + '_gridcontrol_cmenu_AddRow',\n items: [{ text: this.l10n.getConstant('Above'), id: 'Above' }, { text: this.l10n.getConstant('Below'), id: 'Below' }, { text: this.l10n.getConstant('Child'), id: 'Child' }] });\n break;\n default:\n items.push(this.contextMenuItems[i]);\n }\n }\n return items;\n }\n else {\n return null;\n }\n };\n /**\n * Defines grid toolbar from treegrid toolbar model\n *\n * @hidden\n * @returns {Object[]} - Returns toolbar items\n */\n TreeGrid.prototype.getGridToolbar = function () {\n if (this.toolbar) {\n var items = [];\n var tooltipText = void 0;\n for (var i = 0; i < this.toolbar.length; i++) {\n switch (this.toolbar[i]) {\n case 'Search':\n case ToolbarItem.Search:\n items.push('Search');\n break;\n case 'Print':\n case ToolbarItem.Print:\n items.push('Print');\n break;\n case 'ExpandAll':\n case ToolbarItem.ExpandAll:\n tooltipText = this.l10n.getConstant('ExpandAll');\n items.push({ text: tooltipText, tooltipText: tooltipText,\n prefixIcon: 'e-expand', id: this.element.id + '_gridcontrol_expandall' });\n break;\n case 'CollapseAll':\n case ToolbarItem.CollapseAll:\n tooltipText = this.l10n.getConstant('CollapseAll');\n items.push({ text: tooltipText,\n tooltipText: tooltipText, prefixIcon: 'e-collapse', id: this.element.id + '_gridcontrol_collapseall'\n });\n break;\n case 'Indent':\n case ToolbarItem.RowIndent:\n tooltipText = this.l10n.getConstant('RowIndent');\n items.push({\n text: tooltipText, tooltipText: tooltipText, disabled: true,\n prefixIcon: 'e-indent', id: this.element.id + '_gridcontrol_indent'\n });\n break;\n case 'Outdent':\n case ToolbarItem.RowOutdent:\n tooltipText = this.l10n.getConstant('RowOutdent');\n items.push({\n text: tooltipText, tooltipText: tooltipText, disabled: true,\n prefixIcon: 'e-outdent', id: this.element.id + '_gridcontrol_outdent'\n });\n break;\n default:\n items.push(this.toolbar[i]);\n }\n }\n return items;\n }\n else {\n return null;\n }\n };\n TreeGrid.prototype.getGridColumns = function (columns, isEmptyColumnModel, index) {\n if (isEmptyColumnModel === void 0) { isEmptyColumnModel = true; }\n if (index === void 0) { index = 0; }\n var column = columns;\n var stackedColumn = 'columns';\n if (isEmptyColumnModel) {\n this.columnModel = [];\n }\n var treeGridColumn;\n var gridColumn;\n index = index === 0 ? -1 : index;\n var gridColumnCollection = [];\n for (var i = 0; i < column.length; i++) {\n index = index + 1;\n var treeColumn = this.grid.getColumnByUid(column[i].uid);\n gridColumn = treeColumn ? treeColumn : {};\n treeGridColumn = {};\n if (typeof this.columns[i] === 'string') {\n gridColumn.field = treeGridColumn.field = this.columns[i];\n }\n else {\n for (var _i = 0, _a = Object.keys(column[i]); _i < _a.length; _i++) {\n var prop = _a[_i];\n if (index === this.treeColumnIndex && prop === 'template') {\n treeGridColumn[prop] = column[i][prop];\n }\n else if (prop === 'columns' && !isNullOrUndefined(column[i][prop])) {\n gridColumn[prop] = this.getGridColumns(column[i][prop], false, index);\n treeGridColumn[prop] = column[i][prop];\n }\n else if (!(treeColumn) || prop !== 'sortComparer') {\n gridColumn[prop] = treeGridColumn[prop] = column[i][prop];\n }\n }\n }\n if (!treeGridColumn[stackedColumn]) {\n this.columnModel.push(new Column(treeGridColumn));\n }\n gridColumnCollection.push(gridColumn);\n if (!isNullOrUndefined(this.columnModel[this.treeColumnIndex]) && this.enableRtl) {\n if (gridColumn.field === this.columnModel[this.treeColumnIndex].field) {\n if (isNullOrUndefined(this.treeColumnTextAlign)) {\n this.treeColumnTextAlign = this.columnModel[this.treeColumnIndex].textAlign;\n this.treeColumnField = this.columnModel[this.treeColumnIndex].field;\n }\n gridColumn.textAlign = 'Right';\n }\n }\n }\n return gridColumnCollection;\n };\n /**\n * Called internally if any of the property value changed.\n *\n * @param {TreeGridModel} newProp - properties details which has to be modified\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.onPropertyChanged = function (newProp) {\n var properties = Object.keys(newProp);\n var requireRefresh = false;\n for (var _i = 0, properties_1 = properties; _i < properties_1.length; _i++) {\n var prop = properties_1[_i];\n switch (prop) {\n case 'columns':\n this.grid.columns = this.getGridColumns(this.columns);\n break;\n case 'treeColumnIndex':\n this.grid.refreshColumns();\n break;\n case 'allowPaging':\n this.grid.allowPaging = this.allowPaging;\n break;\n case 'pageSettings':\n this.grid.pageSettings = getActualProperties(this.pageSettings);\n requireRefresh = true;\n break;\n case 'enableVirtualization':\n this.grid.enableVirtualization = this.enableVirtualization;\n break;\n case 'enableColumnVirtualization':\n this.grid.enableColumnVirtualization = this.enableColumnVirtualization;\n break;\n case 'toolbar':\n this.grid.toolbar = this.getGridToolbar();\n break;\n case 'allowSelection':\n this.grid.allowSelection = this.allowSelection;\n break;\n case 'selectionSettings':\n this.grid.selectionSettings = getActualProperties(this.selectionSettings);\n break;\n case 'allowSorting':\n this.grid.allowSorting = this.allowSorting;\n break;\n case 'allowMultiSorting':\n this.grid.allowMultiSorting = this.allowMultiSorting;\n break;\n case 'sortSettings':\n this.grid.sortSettings = getActualProperties(this.sortSettings);\n break;\n case 'searchSettings':\n this.grid.searchSettings = getActualProperties(this.searchSettings);\n break;\n case 'allowFiltering':\n this.grid.allowFiltering = this.allowFiltering;\n break;\n case 'filterSettings':\n if (!this.initialRender) {\n this.grid.filterSettings = getActualProperties(this.filterSettings);\n }\n break;\n case 'showColumnMenu':\n this.grid.showColumnMenu = this.showColumnMenu;\n break;\n case 'allowRowDragAndDrop':\n this.grid.allowRowDragAndDrop = this.allowRowDragAndDrop;\n break;\n case 'aggregates':\n this.grid.aggregates = getActualProperties(this.aggregates);\n break;\n case 'enableInfiniteScrolling':\n this.grid.enableInfiniteScrolling = this.enableInfiniteScrolling;\n break;\n case 'dataSource':\n this.isLocalData = (!(this.dataSource instanceof DataManager) || (!isNullOrUndefined(this.dataSource.ready))\n || this.dataSource.adaptor instanceof RemoteSaveAdaptor);\n this.convertTreeData(this.dataSource);\n if (this.isLocalData) {\n if (isCountRequired(this)) {\n var count = getValue('count', this.dataSource);\n this.grid.dataSource = { result: this.flatData, count: count };\n }\n else {\n var data = this.dataSource;\n this.grid.dataSource = !(data instanceof DataManager) ?\n this.flatData : new DataManager(data.dataSource, data.defaultQuery, data.adaptor);\n }\n if (this.enableVirtualization) {\n this.grid.contentModule.isDataSourceChanged = true;\n }\n }\n else {\n this.bindedDataSource();\n if (this.enableVirtualization) {\n this.grid.contentModule.removeEventListener();\n this.grid.contentModule.eventListener('on');\n this.grid.contentModule.renderTable();\n }\n }\n break;\n case 'query':\n this.grid.query = this.query;\n break;\n case 'enableCollapseAll':\n if (newProp[prop]) {\n this.collapseAll();\n }\n else {\n this.expandAll();\n }\n break;\n case 'expandStateMapping':\n this.grid.refresh();\n break;\n case 'gridLines':\n this.grid.gridLines = this.gridLines;\n break;\n case 'rowTemplate':\n this.grid.rowTemplate = getActualProperties(this.rowTemplate);\n break;\n case 'frozenRows':\n this.grid.frozenRows = this.frozenRows;\n break;\n case 'frozenColumns':\n this.grid.frozenColumns = this.frozenColumns;\n break;\n case 'rowHeight':\n this.grid.rowHeight = this.rowHeight;\n break;\n case 'height':\n if (!isNullOrUndefined(this.height) && typeof (this.height) === 'string' && this.height.indexOf('%') !== -1) {\n this.element.style.height = this.height;\n }\n this.grid.height = this.height;\n break;\n case 'width':\n if (!isNullOrUndefined(this.width) && typeof (this.width) === 'string' && this.width.indexOf('%') !== -1) {\n this.element.style.width = this.width;\n }\n this.grid.width = this.width;\n break;\n case 'locale':\n this.grid.locale = this.locale;\n break;\n case 'selectedRowIndex':\n this.grid.selectedRowIndex = this.selectedRowIndex;\n break;\n case 'enableAltRow':\n this.grid.enableAltRow = this.enableAltRow;\n break;\n case 'enableHover':\n this.grid.enableHover = this.enableHover;\n break;\n case 'enableAutoFill':\n this.grid.enableAutoFill = this.enableAutoFill;\n break;\n case 'enableAdaptiveUI':\n this.grid.enableAdaptiveUI = this.enableAdaptiveUI;\n break;\n case 'enableImmutableMode':\n this.grid.enableImmutableMode = this.enableImmutableMode;\n break;\n case 'allowExcelExport':\n this.grid.allowExcelExport = this.allowExcelExport;\n break;\n case 'allowPdfExport':\n this.grid.allowPdfExport = this.allowPdfExport;\n break;\n case 'enableRtl':\n if (!isNullOrUndefined(this.treeColumnField)) {\n this.updateTreeColumnTextAlign();\n }\n this.grid.enableRtl = this.enableRtl;\n break;\n case 'allowReordering':\n this.grid.allowReordering = this.allowReordering;\n break;\n case 'allowResizing':\n this.grid.allowResizing = this.allowResizing;\n break;\n case 'textWrapSettings':\n this.grid.textWrapSettings = getActualProperties(this.textWrapSettings);\n break;\n case 'allowTextWrap':\n this.grid.allowTextWrap = getActualProperties(this.allowTextWrap);\n this.grid.refresh();\n break;\n case 'contextMenuItems':\n this.grid.contextMenuItems = this.getContextMenu();\n break;\n case 'showColumnChooser':\n this.grid.showColumnChooser = this.showColumnChooser;\n break;\n case 'detailTemplate':\n this.grid.detailTemplate = getActualProperties(this.detailTemplate);\n break;\n case 'columnMenuItems':\n this.grid.columnMenuItems = getActualProperties(this.columnMenuItems);\n break;\n case 'editSettings':\n if (this.grid.isEdit && this.grid.editSettings.mode === 'Normal' && newProp[prop].mode &&\n (newProp[prop].mode === 'Cell' || newProp[prop].mode === 'Row')) {\n this.grid.closeEdit();\n }\n this.grid.editSettings = this.getGridEditSettings();\n break;\n }\n if (requireRefresh) {\n this.grid.refresh();\n }\n }\n };\n TreeGrid.prototype.updateTreeColumnTextAlign = function () {\n var gridColumn = this.grid.getColumnByField(this.treeColumnField);\n gridColumn.textAlign = this.enableRtl ? 'Right' : this.treeColumnTextAlign;\n this.grid.refreshColumns();\n };\n /**\n * Destroys the component (detaches/removes all event handlers, attributes, classes, and empties the component element).\n *\n * @method destroy\n * @returns {void}\n */\n TreeGrid.prototype.destroy = function () {\n var treeGridElement = this.element;\n if (!treeGridElement) {\n return;\n }\n var hasTreeGridChild = treeGridElement.querySelector('.' + 'e-gridheader') &&\n treeGridElement.querySelector('.' + 'e-gridcontent') ? true : false;\n if (hasTreeGridChild) {\n this.unwireEvents();\n }\n this.removeListener();\n if (hasTreeGridChild) {\n _super.prototype.destroy.call(this);\n }\n if (this.grid) {\n this.grid.destroy();\n }\n if (this.dataModule) {\n this.dataModule.destroy();\n }\n var modules = ['dataModule', 'sortModule', 'renderModule', 'filterModule', 'printModule', 'clipboardModule',\n 'excelExportModule', 'pdfExportModule', 'toolbarModule', 'summaryModule', 'reorderModule', 'resizeModule',\n 'pagerModule', 'keyboardModule', 'columnMenuModule', 'contextMenuModule', 'editModule', 'virtualScrollModule',\n 'selectionModule', 'detailRow', 'rowDragAndDropModule', 'freezeModule'];\n for (var i = 0; i < modules.length; i++) {\n if (this[modules[i]]) {\n this[modules[i]] = null;\n }\n }\n this.element.innerHTML = '';\n this.grid = null;\n };\n /**\n * Update the TreeGrid model\n *\n * @method dataBind\n * @returns {void}\n * @private\n */\n TreeGrid.prototype.dataBind = function () {\n if (isNullOrUndefined(this.grid)) {\n return;\n }\n if (!isNullOrUndefined(this.rowDropSettings.targetID) &&\n isNullOrUndefined(document.getElementById(this.grid.rowDropSettings.targetID))) {\n document.getElementById(this.rowDropSettings.targetID).id = this.grid.rowDropSettings.targetID;\n this.rowDropSettings.targetID = this.grid.rowDropSettings.targetID;\n }\n _super.prototype.dataBind.call(this);\n this.grid.dataBind();\n };\n /**\n * Get the properties to be maintained in the persisted state.\n *\n * @returns {string} - Returns persist properties details\n * @hidden\n */\n TreeGrid.prototype.getPersistData = function () {\n var keyEntity = ['pageSettings', 'sortSettings',\n 'filterSettings', 'columns', 'searchSettings', 'selectedRowIndex', 'treeColumnIndex'];\n var ignoreOnPersist = {\n pageSettings: ['template', 'pageSizes', 'pageSizeMode', 'enableQueryString', 'totalRecordsCount', 'pageCount'],\n filterSettings: ['type', 'mode', 'showFilterBarStatus', 'immediateModeDelay', 'ignoreAccent', 'hierarchyMode'],\n searchSettings: ['fields', 'operator', 'ignoreCase'],\n sortSettings: [], columns: [], selectedRowIndex: []\n };\n var ignoreOnColumn = ['filter', 'edit', 'filterBarTemplate', 'headerTemplate', 'template',\n 'commandTemplate', 'commands', 'dataSource'];\n for (var i = 0; i < keyEntity.length; i++) {\n var currentObject = this[keyEntity[i]];\n for (var k = 0, val = ignoreOnPersist[keyEntity[i]]; (!isNullOrUndefined(val) && k < val.length); k++) {\n var objVal = val[k];\n delete currentObject[objVal];\n }\n }\n this.ignoreInArrays(ignoreOnColumn, this.columns);\n return this.addOnPersist(keyEntity);\n };\n TreeGrid.prototype.ignoreInArrays = function (ignoreOnColumn, columns) {\n for (var i = 0; i < columns.length; i++) {\n if (columns[i].columns) {\n this.ignoreInColumn(ignoreOnColumn, columns[i]);\n this.ignoreInArrays(ignoreOnColumn, columns[i].columns);\n }\n else {\n this.ignoreInColumn(ignoreOnColumn, columns[i]);\n }\n }\n };\n TreeGrid.prototype.ignoreInColumn = function (ignoreOnColumn, column) {\n for (var i = 0; i < ignoreOnColumn.length; i++) {\n delete column[ignoreOnColumn[i]];\n column.filter = {};\n }\n };\n TreeGrid.prototype.mouseClickHandler = function (e) {\n if (!isNullOrUndefined(e.touches)) {\n return;\n }\n var target = e.target;\n if ((target.classList.contains('e-treegridexpand') ||\n target.classList.contains('e-treegridcollapse')) && (!this.isEditCollapse && !this.grid.isEdit)) {\n this.expandCollapseRequest(target);\n }\n this.isEditCollapse = false;\n this.notify('checkboxSelection', { target: target });\n };\n /**\n * Returns TreeGrid rows\n *\n * @returns {HTMLTableRowElement[]} - Returns row elements collection\n */\n TreeGrid.prototype.getRows = function () {\n return this.grid.getRows();\n };\n /**\n * Gets the pager of the TreeGrid.\n *\n * @returns {Element} - Returns pager element\n */\n TreeGrid.prototype.getPager = function () {\n return this.grid.getPager(); //get element from pager\n };\n /**\n * Adds a new record to the TreeGrid. Without passing parameters, it adds empty rows.\n * > `editSettings.allowEditing` should be true.\n *\n * @param {Object} data - Defines the new add record data.\n * @param {number} index - Defines the row index to be added.\n * @param {RowPosition} position - Defines the new row position to be added.\n * @returns {void}\n */\n TreeGrid.prototype.addRecord = function (data, index, position) {\n if (this.editModule) {\n var isAddedRowByMethod = 'isAddedRowByMethod';\n this.editModule[isAddedRowByMethod] = true;\n this.editModule.addRecord(data, index, position);\n }\n };\n /**\n * Cancels edited state.\n *\n * @returns {void}\n */\n TreeGrid.prototype.closeEdit = function () {\n if (this.grid.editModule) {\n this.grid.editModule.closeEdit();\n }\n };\n /**\n * Saves the cell that is currently edited. It does not save the value to the DataSource.\n *\n * @returns {void}\n */\n TreeGrid.prototype.saveCell = function () {\n if (this.grid.editModule) {\n this.grid.editModule.saveCell();\n }\n };\n /**\n * To update the specified cell by given value without changing into edited state.\n *\n * @param {number} rowIndex Defines the row index.\n * @param {string} field Defines the column field.\n * @param {string | number | boolean | Date} value - Defines the value to be changed.\n * @returns {void}\n */\n TreeGrid.prototype.updateCell = function (rowIndex, field, value) {\n if (this.grid.editModule) {\n this.grid.editModule.updateCell(rowIndex, field, value);\n }\n };\n /**\n * To update the specified row by given values without changing into edited state.\n *\n * @param {number} index Defines the row index.\n * @param {Object} data Defines the data object to be updated.\n * @returns {void}\n */\n TreeGrid.prototype.updateRow = function (index, data) {\n if (this.grid.editModule) {\n if (!isNullOrUndefined(index)) {\n var griddata = this.grid.getCurrentViewRecords()[index];\n extend(griddata, data);\n this.grid.editModule.updateRow(index, griddata);\n }\n else {\n this.grid.editModule.updateRow(index, data);\n }\n }\n };\n /**\n * Delete a record with Given options. If fieldName and data is not given then TreeGrid will delete the selected record.\n * > `editSettings.allowDeleting` should be true.\n *\n * @param {string} fieldName - Defines the primary key field, 'Name of the column'.\n * @param {Object} data - Defines the JSON data of the record to be deleted.\n * @returns {void}\n */\n TreeGrid.prototype.deleteRecord = function (fieldName, data) {\n if (this.grid.editModule) {\n this.grid.editModule.deleteRecord(fieldName, data);\n }\n };\n /**\n * To edit any particular row by TR element.\n *\n * @param {HTMLTableRowElement} row - Defines the table row to be edited.\n * @returns {void}\n */\n TreeGrid.prototype.startEdit = function (row) {\n if (this.grid.editModule) {\n this.grid.editModule.startEdit(row);\n }\n };\n /**\n * To edit any particular cell using row index and cell index.\n *\n * @param {number} rowIndex - Defines row index to edit a particular cell.\n * @param {string} field - Defines the field name of the column to perform cell edit.\n * @returns {void}\n */\n TreeGrid.prototype.editCell = function (rowIndex, field) {\n if (this.editModule) {\n this.editModule.editCell(rowIndex, field);\n }\n };\n /**\n * Enables or disables ToolBar items.\n *\n * @param {string[]} items - Defines the collection of itemID of ToolBar items.\n * @param {boolean} isEnable - Defines the items to be enabled or disabled.\n * @returns {void}\n */\n TreeGrid.prototype.enableToolbarItems = function (items, isEnable) {\n if (this.grid.toolbarModule) {\n this.grid.toolbarModule.enableItems(items, isEnable);\n }\n };\n /**\n * If TreeGrid is in editable state, you can save a record by invoking endEdit.\n *\n * @returns {void}\n */\n TreeGrid.prototype.endEdit = function () {\n if (this.grid.editModule) {\n this.grid.editModule.endEdit();\n }\n };\n /**\n * Column chooser can be displayed on screen by given position(X and Y axis).\n *\n * @param {number} x - Defines the X axis.\n * @param {number} y - Defines the Y axis.\n * @returns {void}\n */\n TreeGrid.prototype.openColumnChooser = function (x, y) {\n if (this.columnChooserModule) {\n this.columnChooserModule.openColumnChooser(x, y);\n }\n };\n /**\n * Delete any visible row by TR element.\n *\n * @param {HTMLTableRowElement} tr - Defines the table row element.\n * @returns {void}\n */\n TreeGrid.prototype.deleteRow = function (tr) {\n if (this.grid.editModule) {\n this.grid.editModule.deleteRow(tr);\n }\n };\n /**\n * Get the names of the primary key columns of the TreeGrid.\n *\n * @returns {string[]} - Returns primary key collection\n */\n TreeGrid.prototype.getPrimaryKeyFieldNames = function () {\n return this.grid.getPrimaryKeyFieldNames();\n };\n /**\n * Updates particular cell value based on the given primary key value.\n * > Primary key column must be specified using `columns.isPrimaryKey` property.\n *\n * @param {string| number} key - Specifies the PrimaryKey value of dataSource.\n * @param {string } field - Specifies the field name which you want to update.\n * @param {string | number | boolean | Date} value - To update new value for the particular cell.\n * @returns {void}\n */\n TreeGrid.prototype.setCellValue = function (key, field, value) {\n this.grid.setCellValue(key, field, value);\n var rowIndex = this.grid.getRowIndexByPrimaryKey(key);\n var record = this.getCurrentViewRecords()[rowIndex];\n if (!isNullOrUndefined(record)) {\n editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, field);\n }\n };\n /**\n * Updates and refresh the particular row values based on the given primary key value.\n * > Primary key column must be specified using `columns.isPrimaryKey` property.\n *\n * @param {string| number} key - Specifies the PrimaryKey value of dataSource.\n * @param {Object} rowData - To update new data for the particular row.\n * @returns {void}\n */\n TreeGrid.prototype.setRowData = function (key, rowData) {\n var currentRecords = this.getCurrentViewRecords();\n var primaryKey = this.grid.getPrimaryKeyFieldNames()[0];\n var level = 0;\n var record = {};\n currentRecords.some(function (value) {\n if (value[primaryKey] === key) {\n record = value;\n return true;\n }\n else {\n return false;\n }\n });\n level = record.level;\n rowData.level = level;\n rowData.index = record.index;\n rowData.childRecords = record.childRecords;\n rowData.taskData = record.taskData;\n rowData.uniqueID = record.uniqueID;\n rowData.parentItem = record.parentItem;\n rowData.checkboxState = record.checkboxState;\n rowData.hasChildRecords = record.hasChildRecords;\n rowData.parentUniqueID = record.parentUniqueID;\n rowData.expanded = record.expanded;\n this.grid.setRowData(key, rowData);\n var visibleRecords = this.getVisibleRecords();\n if (visibleRecords.length > 0 && key === (visibleRecords[visibleRecords.length - 1])[primaryKey]) {\n var table = this.getContentTable();\n var sHeight = table.scrollHeight;\n var clientHeight = this.getContent().clientHeight;\n this.lastRowBorder(this.getRows()[currentRecords.indexOf(record)], sHeight <= clientHeight);\n }\n };\n /**\n * Navigates to the specified target page.\n *\n * @param {number} pageNo - Defines the page number to navigate.\n * @returns {void}\n */\n TreeGrid.prototype.goToPage = function (pageNo) {\n if (this.grid.pagerModule) {\n this.grid.pagerModule.goToPage(pageNo);\n }\n };\n /**\n * Defines the text of external message.\n *\n * @param {string} message - Defines the message to update.\n * @returns {void}\n */\n TreeGrid.prototype.updateExternalMessage = function (message) {\n if (this.pagerModule) {\n this.grid.pagerModule.updateExternalMessage(message);\n }\n };\n /**\n * Gets a cell by row and column index.\n *\n * @param {number} rowIndex - Specifies the row index.\n * @param {number} columnIndex - Specifies the column index.\n * @returns {Element} - Returns cell element in grid content\n */\n TreeGrid.prototype.getCellFromIndex = function (rowIndex, columnIndex) {\n return this.grid.getCellFromIndex(rowIndex, columnIndex);\n };\n /**\n * Gets a Column by column name.\n *\n * @param {string} field - Specifies the column name.\n * @returns {Column} - Returns tree grid column\n */\n TreeGrid.prototype.getColumnByField = function (field) {\n return iterateArrayOrObject(this.columnModel, function (item) {\n if (item.field === field) {\n return item;\n }\n return undefined;\n })[0];\n };\n /**\n * Gets a column by UID.\n *\n * @param {string} uid - Specifies the column UID.\n * @returns {Column} - Returns tree grid column\n */\n TreeGrid.prototype.getColumnByUid = function (uid) {\n var Columns = this.initialRender ? this.grid.columns : this.columns;\n return iterateArrayOrObject(Columns, function (item) {\n if (item.uid === uid) {\n return item;\n }\n return undefined;\n })[0];\n };\n /**\n * Gets the collection of column fields.\n *\n * @returns {string[]} - Returns column field name as collection\n */\n TreeGrid.prototype.getColumnFieldNames = function () {\n return this.grid.getColumnFieldNames();\n };\n /**\n * Gets the footer div of the TreeGrid.\n *\n * @returns {Element} - Returns footer content div element\n */\n TreeGrid.prototype.getFooterContent = function () {\n return this.grid.getFooterContent();\n };\n /**\n * Gets the footer table element of the TreeGrid.\n *\n * @returns {Element} - Returns footer content table element\n */\n TreeGrid.prototype.getFooterContentTable = function () {\n return this.grid.getFooterContentTable();\n };\n /**\n * Shows a column by its column name.\n *\n * @param {string|string[]} keys - Defines a single or collection of column names.\n * @param {string} showBy - Defines the column key either as field name or header text.\n * @returns {void}\n */\n TreeGrid.prototype.showColumns = function (keys, showBy) {\n this.grid.showColumns(keys, showBy);\n this.updateColumnModel();\n };\n /**\n * Hides a column by column name.\n *\n * @param {string|string[]} keys - Defines a single or collection of column names.\n * @param {string} hideBy - Defines the column key either as field name or header text.\n * @returns {void}\n */\n TreeGrid.prototype.hideColumns = function (keys, hideBy) {\n this.grid.hideColumns(keys, hideBy);\n this.updateColumnModel();\n };\n /**\n * Gets a column header by column name.\n *\n * @param {string} field - Specifies the column name.\n * @returns {Element} - Returns column header element\n */\n TreeGrid.prototype.getColumnHeaderByField = function (field) {\n return this.grid.getColumnHeaderByField(field);\n };\n /**\n * Gets a column header by column index.\n *\n * @param {number} index - Specifies the column index.\n * @returns {Element} - Returns column header element\n */\n TreeGrid.prototype.getColumnHeaderByIndex = function (index) {\n return this.grid.getColumnHeaderByIndex(index);\n };\n /**\n * Gets a column header by UID.\n *\n * @param {string} uid - Specifies the column uid.\n * @returns {Element} - Returns column header element\n */\n TreeGrid.prototype.getColumnHeaderByUid = function (uid) {\n return this.grid.getColumnHeaderByUid(uid);\n };\n /**\n * Gets a column index by column name.\n *\n * @param {string} field - Specifies the column name.\n * @returns {number} - Returns column index\n */\n TreeGrid.prototype.getColumnIndexByField = function (field) {\n return this.grid.getColumnIndexByField(field);\n };\n TreeGrid.prototype.getVirtualColIndexByUid = function (uid) {\n var columnModel = 'columnModel';\n var index = iterateArrayOrObject(this.grid[columnModel], function (item, index) {\n if (item.uid === uid) {\n return index;\n }\n return undefined;\n })[0];\n return !isNullOrUndefined(index) ? index : -1;\n };\n /**\n * Gets a column index by UID.\n *\n * @param {string} uid - Specifies the column UID.\n * @returns {number} - Returns column index\n */\n TreeGrid.prototype.getColumnIndexByUid = function (uid) {\n return this.grid.getColumnIndexByUid(uid);\n };\n /**\n * Gets the columns from the TreeGrid.\n *\n * @param {boolean} isRefresh - Defined whether to update DOM\n * @returns {Column[]} - Returns treegrid columns collection\n */\n TreeGrid.prototype.getColumns = function (isRefresh) {\n this.updateColumnModel(this.grid.getColumns(isRefresh));\n return this.columnModel;\n };\n TreeGrid.prototype.updateColumnModel = function (column) {\n var temp;\n var field;\n var gridColumns = isNullOrUndefined(column) ? this.grid.getColumns() : column;\n if (this.treeColumnIndex !== -1 && this.columnModel[this.treeColumnIndex] &&\n !isNullOrUndefined(this.columnModel[this.treeColumnIndex].template)) {\n temp = this.columnModel[this.treeColumnIndex].template;\n field = this.columnModel[this.treeColumnIndex].field;\n }\n var stackedHeader = false;\n var gridColumn;\n if (!this.enableColumnVirtualization || (this.enableColumnVirtualization && this.columnModel.length === gridColumns.length)) {\n this.columnModel = [];\n for (var i = 0; i < gridColumns.length; i++) {\n gridColumn = {};\n for (var _i = 0, _a = Object.keys(gridColumns[i]); _i < _a.length; _i++) {\n var prop = _a[_i];\n gridColumn[prop] = gridColumns[i][prop];\n }\n this.columnModel.push(new Column(gridColumn));\n if (field === this.columnModel[i].field && this.columnModel[i].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {\n this.columnModel[i].template = temp;\n }\n }\n }\n var merge = 'deepMerge';\n this[merge] = ['columns']; // Workaround for blazor updateModel\n if (this.grid.columns.length !== this.columnModel.length) {\n stackedHeader = true;\n }\n if (!stackedHeader) {\n this.setProperties({ columns: this.columnModel }, true);\n }\n this[merge] = undefined; // Workaround for blazor updateModel\n return this.columnModel;\n };\n /**\n * Gets the content div of the TreeGrid.\n *\n * @returns {Element} - Return tree grid content element\n */\n TreeGrid.prototype.getContent = function () {\n return this.grid.getContent();\n };\n TreeGrid.prototype.mergePersistTreeGridData = function () {\n var persist1 = 'mergePersistGridData';\n this.grid[persist1].apply(this);\n };\n TreeGrid.prototype.mergeColumns = function (storedColumn, columns) {\n var persist2 = 'mergeColumns';\n this.grid[persist2].apply(this, [storedColumn, columns]);\n };\n TreeGrid.prototype.updateTreeGridModel = function () {\n this.setProperties({ filterSettings: getObject('properties', this.grid.filterSettings) }, true);\n this.setProperties({ pageSettings: getObject('properties', this.grid.pageSettings) }, true);\n this.setProperties({ searchSettings: getObject('properties', this.grid.searchSettings) }, true);\n this.setProperties({ sortSettings: getObject('properties', this.grid.sortSettings) }, true);\n };\n /**\n * Gets the content table of the TreeGrid.\n *\n * @returns {Element} - Returns content table element\n */\n TreeGrid.prototype.getContentTable = function () {\n return this.grid.getContentTable();\n };\n /**\n * Gets all the TreeGrid's data rows.\n *\n * @returns {Element[]} - Returns row elements\n */\n TreeGrid.prototype.getDataRows = function () {\n var dRows = [];\n var rows = this.grid.getDataRows();\n for (var i = 0, len = rows.length; i < len; i++) {\n if (!rows[i].classList.contains('e-summaryrow')) {\n dRows.push(rows[i]);\n }\n }\n return dRows;\n };\n /**\n * Get current visible data of TreeGrid.\n *\n * @returns {Object[]} - Returns current view records\n * @isGenericType true\n */\n TreeGrid.prototype.getCurrentViewRecords = function () {\n return this.grid.currentViewData;\n };\n /**\n * Gets the added, edited,and deleted data before bulk save to the DataSource in batch mode.\n *\n * @returns {Object} - Returns batch changes\n */\n TreeGrid.prototype.getBatchChanges = function () {\n return this.grid.editModule.getBatchChanges();\n };\n /**\n * Gets the header div of the TreeGrid.\n *\n * @returns {Element} - Returns Header content element\n */\n TreeGrid.prototype.getHeaderContent = function () {\n return this.grid.getHeaderContent();\n };\n /**\n * Gets the header table element of the TreeGrid.\n *\n * @returns {Element} - Return header table element\n */\n TreeGrid.prototype.getHeaderTable = function () {\n return this.grid.getHeaderTable();\n };\n /**\n * Gets a row by index.\n *\n * @param {number} index - Specifies the row index.\n * @returns {Element} - Returns row element\n */\n TreeGrid.prototype.getRowByIndex = function (index) {\n return this.grid.getRowByIndex(index);\n };\n /**\n * Get a row information based on cell\n *\n * @param {Element | EventTarget} target - Target row element\n * @returns {RowInfo} - Returns row information in a JSON object\n */\n TreeGrid.prototype.getRowInfo = function (target) {\n return this.grid.getRowInfo(target);\n };\n /**\n * Gets UID by column name.\n *\n * @param {string} field - Specifies the column name.\n * @returns {string} - Returns unique id based on column field name given\n */\n TreeGrid.prototype.getUidByColumnField = function (field) {\n return this.grid.getUidByColumnField(field);\n };\n /**\n * Gets the visible columns from the TreeGrid.\n *\n * @returns {Column[]} - Returns visible columns collection\n */\n TreeGrid.prototype.getVisibleColumns = function () {\n var cols = [];\n for (var _i = 0, _a = this.columnModel; _i < _a.length; _i++) {\n var col = _a[_i];\n if (col.visible) {\n cols.push(col);\n }\n }\n return cols;\n };\n /**\n * By default, TreeGrid shows the spinner for all its actions. You can use this method to show spinner at your needed time.\n *\n * @returns {void}\n */\n TreeGrid.prototype.showSpinner = function () {\n showSpinner(this.element);\n };\n /**\n * Manually shown spinner needs to hide by `hideSpinnner`.\n *\n * @returns {void}\n */\n TreeGrid.prototype.hideSpinner = function () {\n hideSpinner(this.element);\n };\n /**\n * Refreshes the TreeGrid header and content.\n *\n * @returns {void}\n */\n TreeGrid.prototype.refresh = function () {\n this.uniqueIDCollection = {};\n this.convertTreeData(this.dataSource);\n if (!isCountRequired(this)) {\n if (!(this.dataSource instanceof DataManager)) {\n this.grid.dataSource = this.flatData;\n }\n else {\n this.grid.setProperties({\n dataSource: new DataManager(this.dataSource.dataSource, this.dataSource.defaultQuery, this.dataSource.adaptor)\n }, true);\n }\n }\n this.grid.refresh();\n };\n /**\n * Get the records of checked rows.\n *\n * @returns {Object[]} - Returns records that has been checked\n * @isGenericType true\n */\n TreeGrid.prototype.getCheckedRecords = function () {\n return this.selectionModule.getCheckedrecords();\n };\n /**\n * Get the visible records corresponding to rows visually displayed.\n *\n * @returns {Object[]} - Returns visible records based on collapse state of rows\n * @isGenericType true\n */\n TreeGrid.prototype.getVisibleRecords = function () {\n var visibleRecords = [];\n var currentViewRecords = this.getCurrentViewRecords();\n if (!this.allowPaging) {\n for (var i = 0; i < currentViewRecords.length; i++) {\n visibleRecords.push(currentViewRecords[i]);\n if (!currentViewRecords[i].expanded) {\n i += findChildrenRecords(currentViewRecords[i]).length;\n }\n }\n }\n else {\n visibleRecords = currentViewRecords;\n }\n return visibleRecords;\n };\n /**\n * Get the indexes of checked rows.\n *\n * @returns {number[]} - Returns checked row indexes\n */\n TreeGrid.prototype.getCheckedRowIndexes = function () {\n return this.selectionModule.getCheckedRowIndexes();\n };\n /**\n * Checked the checkboxes using rowIndexes.\n *\n * @param {number[]} indexes - row indexes\n * @returns {void}\n */\n TreeGrid.prototype.selectCheckboxes = function (indexes) {\n this.selectionModule.selectCheckboxes(indexes);\n };\n /**\n * Refreshes the TreeGrid column changes.\n *\n * @param {boolean} refreshUI - Defined whether to refresh the DOM\n * @returns {void}\n */\n TreeGrid.prototype.refreshColumns = function (refreshUI) {\n if (isNullOrUndefined(refreshUI) || refreshUI) {\n this.grid.columns = this.getGridColumns(this.columns);\n this.grid.refreshColumns();\n }\n else {\n this.grid.setProperties({ columns: this.getGridColumns(this.columns) }, true);\n }\n };\n /**\n * Refreshes the TreeGrid header.\n *\n * @returns {void}\n */\n TreeGrid.prototype.refreshHeader = function () {\n this.grid.refreshHeader();\n };\n /**\n * Expands or collapse child records\n *\n * @param {HTMLElement} target - Expand collapse icon cell as target element\n * @returns {void}\n * @hidden\n */\n TreeGrid.prototype.expandCollapseRequest = function (target) {\n if (this.editSettings.mode === 'Batch') {\n var obj = 'dialogObj';\n var showDialog = 'showDialog';\n if (this.getBatchChanges()[this.changedRecords].length ||\n this.getBatchChanges()[this.deletedRecords].length || this.getBatchChanges()[this.addedRecords].length) {\n var dialogObj = this.grid.editModule[obj];\n this.grid.editModule[showDialog]('CancelEdit', dialogObj);\n this.targetElement = target;\n return;\n }\n }\n if (this.rowTemplate) {\n var rowInfo = target.closest('.e-treerowcell').parentElement;\n var record = this.getCurrentViewRecords()[rowInfo.rowIndex];\n if (target.classList.contains('e-treegridexpand')) {\n this.collapseRow(rowInfo, record);\n }\n else {\n this.expandRow(rowInfo, record);\n }\n }\n else {\n var rowInfo = this.grid.getRowInfo(target);\n var record = rowInfo.rowData;\n if (this.enableImmutableMode) {\n record = this.getCurrentViewRecords()[rowInfo.rowIndex];\n }\n if (target.classList.contains('e-treegridexpand')) {\n this.collapseRow(rowInfo.row, record);\n }\n else {\n this.expandRow(rowInfo.row, record);\n }\n }\n };\n /**\n * Expands child rows\n *\n * @param {HTMLTableRowElement} row - Expands the given row\n * @param {Object} record - Expands the given record\n * @param {Object} key - Primary key value\n * @param {number} level - Specifies the hierarchical level of the record\n * @returns {void}\n */\n TreeGrid.prototype.expandRow = function (row, record, key, level) {\n var _this = this;\n record = this.getCollapseExpandRecords(row, record);\n if (!isNullOrUndefined(row) && row.cells[0].classList.contains('e-lastrowcell')) {\n this.lastRowBorder(row, false);\n }\n var args = { data: record, row: row, cancel: false };\n this.trigger(events.expanding, args, function (expandingArgs) {\n if (!expandingArgs.cancel) {\n _this.expandCollapse('expand', row, record);\n if (expandingArgs.expandAll) {\n _this.expandCollapseAllChildren(record, 'expand', key, level);\n }\n var children = 'Children';\n if (!(isRemoteData(_this) && !isOffline(_this)) && (!isCountRequired(_this) || !isNullOrUndefined(record[children]))) {\n var collapseArgs = { data: record, row: row };\n _this.setHeightForFrozenContent();\n if (!isNullOrUndefined(_this.expandStateMapping)) {\n _this.updateExpandStateMapping(collapseArgs.data, true);\n }\n _this.trigger(events.expanded, collapseArgs);\n }\n }\n });\n };\n TreeGrid.prototype.expandCollapseAllChildren = function (record, action, key, level) {\n if ((!isNullOrUndefined(key) && record[this.getPrimaryKeyFieldNames()[0]] !== key) ||\n (!isNullOrUndefined(level) && level !== record.level)) {\n return;\n }\n var records = findChildrenRecords(record).filter(function (e) {\n return e.hasChildRecords;\n });\n records.unshift(record);\n for (var i = 0; i < records.length; i++) {\n this.expandCollapse(action, null, records[i]);\n }\n };\n TreeGrid.prototype.setHeightForFrozenContent = function () {\n var freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;\n if (this.grid.getFrozenColumns() > 0 || freeze) {\n this.grid.contentModule.refreshScrollOffset();\n }\n };\n TreeGrid.prototype.getCollapseExpandRecords = function (row, record) {\n if (this.allowPaging && this.pageSettings.pageSizeMode === 'All' && this.isExpandAll && isNullOrUndefined(record) &&\n !isRemoteData(this)) {\n record = this.flatData.filter(function (e) {\n return e.hasChildRecords;\n });\n }\n else if (isNullOrUndefined(record)) {\n if (this.detailTemplate) {\n record = this.grid.getCurrentViewRecords()[row.getAttribute('aria-rowindex')];\n }\n else {\n record = this.grid.getCurrentViewRecords()[row.rowIndex];\n }\n }\n return record;\n };\n /**\n * Collapses child rows\n *\n * @param {HTMLTableRowElement} row - Collapse the given row\n * @param {Object} record - Collapse the given record\n * @param {Object} key - Primary key value\n * @returns {void}\n */\n TreeGrid.prototype.collapseRow = function (row, record, key) {\n var _this = this;\n record = this.getCollapseExpandRecords(row, record);\n var args = { data: record, row: row, cancel: false };\n this.trigger(events.collapsing, args, function (collapsingArgs) {\n if (!collapsingArgs.cancel) {\n if (collapsingArgs.collapseAll) {\n _this.expandCollapseAllChildren(record, 'collapse', key);\n }\n _this.expandCollapse('collapse', row, record);\n var collapseArgs = { data: record, row: row };\n if (!isRemoteData(_this)) {\n _this.setHeightForFrozenContent();\n if (!isNullOrUndefined(_this.expandStateMapping)) {\n _this.updateExpandStateMapping(collapseArgs.data, false);\n }\n _this.trigger(events.collapsed, collapseArgs);\n if (_this.enableInfiniteScrolling) {\n var scrollHeight = _this.grid.getContent().firstElementChild.scrollHeight;\n var scrollTop = _this.grid.getContent().firstElementChild.scrollTop;\n if ((scrollHeight - scrollTop) < _this.grid.getRowHeight() + +_this.height) {\n _this.grid.getContent().firstElementChild.scrollBy(0, _this.grid.getRowHeight());\n }\n }\n }\n }\n });\n };\n TreeGrid.prototype.updateExpandStateMapping = function (record, state) {\n var totalRecords = record;\n if (totalRecords.length) {\n for (var i = 0; i < totalRecords.length; i++) {\n totalRecords[i][this.expandStateMapping] = state;\n editAction({ value: totalRecords[i], action: 'edit' }, this, this.isSelfReference, totalRecords[i].index, this.grid.selectedRowIndex, this.expandStateMapping);\n }\n }\n else {\n record[this.expandStateMapping] = state;\n editAction({ value: record, action: 'edit' }, this, this.isSelfReference, record.index, this.grid.selectedRowIndex, this.expandStateMapping);\n }\n };\n /**\n * Expands the records at specific hierarchical level\n *\n * @param {number} level - Expands the parent rows at given level\n * @returns {void}\n */\n TreeGrid.prototype.expandAtLevel = function (level) {\n if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {\n var rec = this.grid.dataSource.filter(function (e) {\n if (e.hasChildRecords && e.level === level) {\n e.expanded = true;\n }\n return e.hasChildRecords && e.level === level;\n });\n this.expandAction(rec, null, level, true);\n }\n else {\n var rec = this.getRecordDetails(level);\n var record = getObject('records', rec);\n this.expandAction(record, null, level);\n }\n };\n /**\n * Expands the records by given primary key value\n *\n * @param {Object} key - Expands the parent rows with given primary key value\n * @returns {void}\n */\n TreeGrid.prototype.expandByKey = function (key) {\n this.expandCollapseActionByKey(key, 'Expand');\n };\n TreeGrid.prototype.expandAction = function (record, key, level, isPaging) {\n if (isPaging === void 0) { isPaging = false; }\n var _loop_1 = function (i) {\n if (!isNullOrUndefined(record[i].parentItem)) {\n var puniqueID_1 = record[i].parentItem.uniqueID;\n var parentItem = this_1.flatData.filter(function (e) {\n return e.uniqueID === puniqueID_1;\n });\n if (isRemoteData(this_1)) {\n parentItem = this_1.getCurrentViewRecords().filter(function (e) {\n return e.uniqueID === puniqueID_1;\n });\n }\n if (parentItem[0].expanded === false) {\n record.push(parentItem[0]);\n parentItem[0].expanded = true;\n }\n else {\n if (!getExpandStatus(this_1, parentItem[0], this_1.parentData)) {\n if (parentItem[0].expanded && parentItem[0].parentItem !== undefined) {\n record.push(parentItem[0]);\n }\n }\n }\n }\n if (!isPaging) {\n this_1.expandRow(null, record[i], key, level);\n }\n };\n var this_1 = this;\n for (var i = 0; i < record.length; i++) {\n _loop_1(i);\n }\n if (isPaging) {\n this.expandRow(null, record, key, level);\n }\n };\n TreeGrid.prototype.getRecordDetails = function (level) {\n var rows = this.getRows().filter(function (e) {\n return (e.className.indexOf('level' + level) !== -1\n && (e.querySelector('.e-treegridcollapse') || e.querySelector('.e-treegridexpand')));\n });\n var records = this.getCurrentViewRecords().filter(function (e) {\n return e.level === level && e.hasChildRecords;\n });\n var obj = { records: records, rows: rows };\n return obj;\n };\n /**\n * Collapses the records at specific hierarchical level\n *\n * @param {number} level - Define the parent row level which needs to be collapsed\n * @returns {void}\n */\n TreeGrid.prototype.collapseAtLevel = function (level) {\n if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization) && !isRemoteData(this)) {\n var record = this.grid.dataSource.filter(function (e) {\n if (e.hasChildRecords && e.level === level) {\n e.expanded = false;\n }\n return e.hasChildRecords && e.level === level;\n });\n this.collapseAction(record, null, true);\n }\n else {\n var rec = this.getRecordDetails(level);\n var records = getObject('records', rec);\n this.collapseAction(records);\n }\n };\n /**\n * Collapses the records by given primary key value\n *\n * @param {Object} key - Collapses the parent rows with given primary key value\n * @returns {void}\n */\n TreeGrid.prototype.collapseByKey = function (key) {\n this.expandCollapseActionByKey(key, 'Collapse');\n };\n TreeGrid.prototype.expandCollapseActionByKey = function (key, action) {\n var primaryKeyField = this.getPrimaryKeyFieldNames()[0];\n var dataSource = isRemoteData(this) ? this.getCurrentViewRecords() : this.grid.dataSource;\n if (!isNullOrUndefined(primaryKeyField)) {\n var rec = dataSource.filter(function (e) {\n return e[primaryKeyField].toString() === key.toString();\n });\n if (action === 'Expand') {\n this.expandAction(rec, key, null);\n }\n else {\n this.collapseAction(rec, key);\n }\n }\n };\n TreeGrid.prototype.collapseAction = function (record, key, isPaging) {\n if (isPaging === void 0) { isPaging = false; }\n if (isPaging) {\n this.collapseRow(null, record);\n }\n else {\n for (var i = 0; i < record.length; i++) {\n this.collapseRow(null, record[i], key);\n }\n }\n if (!this.grid.contentModule.isDataSourceChanged && this.enableVirtualization && this.getRows()\n && this.parentData.length === this.getRows().length) {\n var endIndex = 'endIndex';\n this.grid.contentModule.startIndex = -1;\n this.grid.contentModule[endIndex] = -1;\n }\n };\n /**\n * Expands All the rows\n *\n * @returns {void}\n */\n TreeGrid.prototype.expandAll = function () {\n this.expandCollapseAll('expand');\n };\n /**\n * Collapses All the rows\n *\n * @returns {void}\n */\n TreeGrid.prototype.collapseAll = function () {\n this.expandCollapseAll('collapse');\n };\n TreeGrid.prototype.expandCollapseAll = function (action) {\n var rows = this.getRows().filter(function (e) {\n return e.querySelector('.e-treegrid' + (action === 'expand' ? 'collapse' : 'expand'));\n });\n if (!rows.length && this.getRows().length) {\n rows.push(this.getRows()[0]);\n }\n this.isExpandAll = true;\n this.isCollapseAll = true;\n if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)) {\n this.flatData.filter(function (e) {\n if (e.hasChildRecords) {\n e.expanded = action === 'collapse' ? false : true;\n }\n });\n if (rows.length) {\n if (action === 'collapse') {\n this.collapseRow(rows[0]);\n }\n else {\n this.expandRow(rows[0]);\n }\n }\n else if (this.allowPaging) {\n var isExpandCollapseall = this.enableCollapseAll;\n this.setProperties({ enableCollapseAll: true }, true);\n this.grid.pagerModule.goToPage(1);\n this.setProperties({ enableCollapseAll: isExpandCollapseall }, true);\n }\n }\n else {\n for (var i = 0; i < rows.length; i++) {\n if (action === 'collapse') {\n this.collapseRow(rows[i]);\n }\n else {\n this.expandRow(rows[i]);\n }\n }\n }\n this.isExpandAll = false;\n this.isCollapseAll = false;\n };\n TreeGrid.prototype.expandCollapse = function (action, row, record, isChild) {\n var expandingArgs = { row: row, data: record, childData: [], requestType: action };\n var childRecords = this.getCurrentViewRecords().filter(function (e) {\n return e.parentUniqueID === record.uniqueID;\n });\n var targetEle;\n if (!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) {\n this.updateChildOnDemand(expandingArgs);\n }\n var gridRows = this.getRows();\n if (this.rowTemplate) {\n var rows = this.getContentTable().rows;\n gridRows = [].slice.call(rows);\n }\n var rowIndex;\n if (isNullOrUndefined(row)) {\n rowIndex = this.getCurrentViewRecords().indexOf(record);\n row = gridRows[rowIndex];\n }\n else {\n rowIndex = +row.getAttribute('aria-rowindex');\n }\n if (!isNullOrUndefined(row)) {\n row.setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');\n }\n if (((this.allowPaging && this.pageSettings.pageSizeMode === 'All') || this.enableVirtualization || this.enableInfiniteScrolling) && !isRemoteData(this)\n && !isCountRequired(this)) {\n this.notify(events.localPagedExpandCollapse, { action: action, row: row, record: record });\n }\n else {\n var displayAction = void 0;\n if (action === 'expand') {\n displayAction = 'table-row';\n if (!isChild) {\n record.expanded = true;\n this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;\n }\n if (!isNullOrUndefined(row)) {\n targetEle = row.getElementsByClassName('e-treegridcollapse')[0];\n }\n if (isChild && !isNullOrUndefined(record[this.expandStateMapping]) &&\n record[this.expandStateMapping] && isNullOrUndefined(targetEle)) {\n targetEle = row.getElementsByClassName('e-treegridexpand')[0];\n }\n if (isNullOrUndefined(targetEle)) {\n return;\n }\n if (!targetEle.classList.contains('e-treegridexpand')) {\n addClass([targetEle], 'e-treegridexpand');\n }\n removeClass([targetEle], 'e-treegridcollapse');\n }\n else {\n displayAction = 'none';\n if (!isChild || isCountRequired(this)) {\n record.expanded = false;\n this.uniqueIDCollection[record.uniqueID].expanded = record.expanded;\n }\n if (!isNullOrUndefined(row)) {\n targetEle = row.getElementsByClassName('e-treegridexpand')[0];\n }\n if (isChild && !isNullOrUndefined(record[this.expandStateMapping]) &&\n !record[this.expandStateMapping] && isNullOrUndefined(targetEle)) {\n targetEle = row.getElementsByClassName('e-treegridcollapse')[0];\n }\n if (isNullOrUndefined(targetEle)) {\n return;\n }\n if (!targetEle.classList.contains('e-treegridcollapse')) {\n addClass([targetEle], 'e-treegridcollapse');\n }\n removeClass([targetEle], 'e-treegridexpand');\n }\n var detailrows = gridRows.filter(function (r) {\n return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));\n });\n if (isRemoteData(this) && !isOffline(this)) {\n this.remoteExpand(action, row, record);\n }\n else {\n if ((!isCountRequired(this) || childRecords.length) || action === 'collapse') {\n this.localExpand(action, row, record);\n }\n }\n if (this.isPixelHeight() && !row.cells[0].classList.contains('e-lastrowcell')) {\n var totalRows = this.getRows();\n var rows = this.getContentTable().rows;\n totalRows = [].slice.call(rows);\n for (var i = totalRows.length - 1; i >= 0; i--) {\n if (!isHidden(totalRows[i])) {\n var table = this.getContentTable();\n var sHeight = table.scrollHeight;\n var clientHeight = this.getContent().clientHeight;\n this.lastRowBorder(totalRows[i], sHeight <= clientHeight);\n break;\n }\n }\n }\n this.notify('rowExpandCollapse', { detailrows: detailrows, action: displayAction, record: record, row: row });\n this.updateAltRow(gridRows);\n }\n };\n TreeGrid.prototype.updateChildOnDemand = function (expandingArgs) {\n var _this = this;\n var deff = new Deferred();\n var childDataBind = 'childDataBind';\n expandingArgs[childDataBind] = deff.resolve;\n var record = expandingArgs.data;\n this.trigger(events.dataStateChange, expandingArgs);\n deff.promise.then(function () {\n if (expandingArgs.childData.length) {\n var currentData = (_this.flatData);\n var index = 0;\n for (var i = 0; i < currentData.length; i++) {\n if (currentData[i].taskData === record.taskData) {\n index = i;\n break;\n }\n }\n var data_1 = getValue('result', _this.dataSource);\n var childData = extendArray(expandingArgs.childData);\n var length_1 = record[_this.childMapping] ? record[_this.childMapping].length > childData.length ?\n record[_this.childMapping].length : childData.length : childData.length;\n for (var i = 0; i < length_1; i++) {\n if (record[_this.childMapping]) {\n data_1.filter(function (e, i) {\n if (e[_this.parentIdMapping] === record[_this.idMapping]) {\n data_1.splice(i, 1);\n }\n });\n }\n if (childData[i]) {\n childData[i].level = record.level + 1;\n childData[i].index = Math.ceil(Math.random() * 1000);\n childData[i].parentItem = extend({}, record);\n childData[i].taskData = extend({}, childData[i]);\n delete childData[i].parentItem.childRecords;\n delete childData[i].taskData.parentItem;\n childData[i].parentUniqueID = record.uniqueID;\n childData[i].uniqueID = getUid(_this.element.id + '_data_');\n setValue('uniqueIDCollection.' + childData[i].uniqueID, childData[i], _this);\n if (!isNullOrUndefined(childData[i][_this.childMapping]) ||\n (childData[i][_this.hasChildMapping] && isCountRequired(_this))) {\n childData[i].hasChildRecords = true;\n }\n currentData.splice(index + 1 + i, record[_this.childMapping] && record[_this.childMapping][i] ? 1 : 0, childData[i]);\n }\n else {\n currentData.splice(index + 1 + i, 1);\n }\n }\n currentData[index][_this.childMapping] = childData;\n currentData[index].childRecords = childData;\n currentData[index].expanded = true;\n setValue('uniqueIDCollection.' + currentData[index].uniqueID, currentData[index], _this);\n for (var j = 0; j < expandingArgs.childData.length; j++) {\n data_1.push(expandingArgs.childData[j]);\n }\n }\n _this.isExpandRefresh = true;\n _this.grid.refresh();\n _this.setHeightForFrozenContent();\n _this.trigger(events.expanded, expandingArgs);\n });\n };\n TreeGrid.prototype.remoteExpand = function (action, row, record) {\n var gridRows = this.getRows();\n if (this.rowTemplate) {\n var rows_1 = this.getContentTable().rows;\n gridRows = [].slice.call(rows_1);\n }\n var args = { data: record, row: row };\n var rows = [];\n rows = gridRows.filter(function (r) {\n return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));\n });\n if (action === 'expand') {\n this.notify(events.remoteExpand, { record: record, rows: rows, parentRow: row });\n var args_1 = { row: row, data: record };\n if (rows.length > 0) {\n this.setHeightForFrozenContent();\n this.trigger(events.expanded, args_1);\n }\n }\n else {\n this.collapseRemoteChild({ record: record, rows: rows });\n this.setHeightForFrozenContent();\n this.trigger(events.collapsed, args);\n }\n };\n TreeGrid.prototype.localExpand = function (action, row, record) {\n var rows;\n var childRecords = this.getCurrentViewRecords().filter(function (e) {\n return e.parentUniqueID === record.uniqueID;\n });\n if (this.isPixelHeight() && row.cells[0].classList.contains('e-lastrowcell')) {\n this.lastRowBorder(row, false);\n }\n var movableRows;\n var freezeRightRows;\n var gridRows = this.getRows();\n if (this.rowTemplate) {\n var rows_2 = this.getContentTable().rows;\n gridRows = [].slice.call(rows_2);\n }\n var displayAction = (action === 'expand') ? 'table-row' : 'none';\n var primaryKeyField = this.getPrimaryKeyFieldNames()[0];\n if (this.enableImmutableMode && !this.allowPaging) {\n rows = [];\n for (var i = 0; i < childRecords.length; i++) {\n var rowIndex = this.grid.getRowIndexByPrimaryKey(childRecords[i][primaryKeyField]);\n rows.push(this.getRows()[rowIndex]);\n }\n }\n else {\n rows = gridRows.filter(function (r) {\n return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));\n });\n }\n var freeze = (this.grid.getFrozenLeftColumnsCount() > 0 || this.grid.getFrozenRightColumnsCount() > 0) ? true : false;\n if (this.frozenRows || this.frozenColumns || this.getFrozenColumns() || freeze) {\n movableRows = this.getMovableRows().filter(function (r) {\n return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));\n });\n }\n if (freeze) {\n freezeRightRows = this.getFrozenRightRows().filter(function (r) {\n return r.querySelector('.e-gridrowindex' + record.index + 'level' + (record.level + 1));\n });\n }\n for (var i = 0; i < rows.length; i++) {\n if (!isNullOrUndefined(rows[i])) {\n rows[i].style.display = displayAction;\n }\n if (!isNullOrUndefined(movableRows)) {\n movableRows[i].style.display = displayAction;\n }\n if (!isNullOrUndefined(freezeRightRows)) {\n freezeRightRows[i].style.display = displayAction;\n }\n this.notify('childRowExpand', { row: rows[i] });\n if ((!isNullOrUndefined(childRecords[i].childRecords) && childRecords[i].childRecords.length > 0) && (action !== 'expand' ||\n isNullOrUndefined(childRecords[i].expanded) || childRecords[i].expanded)) {\n this.expandCollapse(action, rows[i], childRecords[i], true);\n if (this.frozenColumns <= this.treeColumnIndex && !isNullOrUndefined(movableRows)) {\n this.expandCollapse(action, movableRows[i], childRecords[i], true);\n }\n }\n }\n };\n TreeGrid.prototype.updateAltRow = function (rows) {\n if (this.enableAltRow && !this.rowTemplate) {\n var visibleRowCount = 0;\n for (var i = 0; rows && i < rows.length; i++) {\n var gridRow = rows[i];\n if (gridRow.style.display !== 'none') {\n if (gridRow.classList.contains('e-altrow')) {\n removeClass([gridRow], 'e-altrow');\n }\n if (visibleRowCount % 2 !== 0 && !gridRow.classList.contains('e-summaryrow') && !gridRow.classList.contains('e-detailrow')) {\n addClass([gridRow], 'e-altrow');\n }\n if (!gridRow.classList.contains('e-summaryrow') && !gridRow.classList.contains('e-detailrow')) {\n visibleRowCount++;\n }\n }\n }\n }\n };\n TreeGrid.prototype.treeColumnRowTemplate = function () {\n if (this.rowTemplate) {\n var rows = this.getContentTable().rows;\n rows = [].slice.call(rows);\n for (var i = 0; i < rows.length; i++) {\n var rcell = this.grid.getContentTable().rows[i].cells[this.treeColumnIndex];\n var row = rows[i];\n var rowData = this.grid.getRowsObject()[i].data;\n var arg = { data: rowData, row: row, cell: rcell, column: this.getColumns()[this.treeColumnIndex] };\n this.renderModule.cellRender(arg);\n }\n }\n };\n TreeGrid.prototype.collapseRemoteChild = function (rowDetails, isChild) {\n if (!isChild) {\n rowDetails.record.expanded = false;\n }\n var rows = rowDetails.rows;\n var row;\n var childRecord;\n var movablerows = [];\n var rightrows = [];\n var freeze = (this.getFrozenLeftColumnsCount() > 0 || this.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n movablerows = this.getMovableRows().filter(function (r) {\n return r.querySelector('.e-gridrowindex' + rowDetails.record.index + 'level' + (rowDetails.record.level + 1));\n });\n rightrows = this.getFrozenRightRows().filter(function (r) {\n return r.querySelector('.e-gridrowindex' + rowDetails.record.index + 'level' + (rowDetails.record.level + 1));\n });\n }\n for (var i = 0; i < rows.length; i++) {\n rows[i].style.display = 'none';\n row = rows[i];\n var collapsingTd = rows[i].querySelector('.e-detailrowexpand');\n if (!isNullOrUndefined(collapsingTd)) {\n this.grid.detailRowModule.collapse(collapsingTd);\n }\n if (freeze) {\n movablerows[i].style.display = 'none';\n rightrows[i].style.display = 'none';\n if (!rows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n if (movablerows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n row = movablerows[i];\n }\n else if (rightrows[i].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n row = rightrows[i];\n }\n }\n }\n if (row.querySelector('.e-treecolumn-container .e-treegridexpand')) {\n var expandElement = row.querySelector('.e-treecolumn-container .e-treegridexpand');\n childRecord = this.rowTemplate ? this.grid.getCurrentViewRecords()[rows[i].rowIndex] :\n this.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;\n if (!isNullOrUndefined(expandElement) && childRecord.expanded) {\n removeClass([expandElement], 'e-treegridexpand');\n addClass([expandElement], 'e-treegridcollapse');\n }\n var cRow = [];\n var eRows = this.getRows();\n for (var i_1 = 0; i_1 < eRows.length; i_1++) {\n if (eRows[i_1].querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1))) {\n cRow.push(eRows[i_1]);\n }\n }\n if (cRow.length && childRecord.expanded) {\n this.collapseRemoteChild({ record: childRecord, rows: cRow }, true);\n }\n }\n }\n };\n /**\n * Updates the rows and cells\n *\n * @param {Object[]} records - Updates the given records\n * @param {HTMLTableRowElement[]} rows - Updates the given rows\n * @param {number} index - Updates the given cell index\n * @returns {void}\n */\n TreeGrid.prototype.updateRowAndCellElements = function (records, rows, index) {\n for (var i = 0; i < records.length; i++) {\n this.renderModule.cellRender({\n data: records[i], cell: rows[i].cells[index],\n column: this.grid.getColumns()[this.treeColumnIndex],\n requestType: 'rowDragAndDrop'\n });\n if (this['action'] === 'indenting' || this['action'] === 'outdenting') {\n this.renderModule.RowModifier({\n data: records[i], row: rows[i]\n });\n }\n }\n };\n /**\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.addListener = function () {\n this.on('updateResults', this.updateResultModel, this);\n this.grid.on('initial-end', this.afterGridRender, this);\n };\n TreeGrid.prototype.updateResultModel = function (returnResult) {\n this.dataResults = returnResult;\n };\n /**\n * @hidden\n * @returns {void}\n */\n TreeGrid.prototype.removeListener = function () {\n if (this.isDestroyed) {\n return;\n }\n this.off('updateResults', this.updateResultModel);\n this.grid.off('initial-end', this.afterGridRender);\n };\n /**\n * Filters TreeGrid row by column name with the given options.\n *\n * @param {string} fieldName - Defines the field name of the column.\n * @param {string} filterOperator - Defines the operator to filter records.\n * @param {string | number | Date | boolean} filterValue - Defines the value used to filter records.\n * @param {string} predicate - Defines the relationship between one filter query and another by using AND or OR predicate.\n * @param {boolean} matchCase - If match case is set to true, the TreeGrid filters the records with exact match. if false, it filters\n * case insensitive records (uppercase and lowercase letters are treated the same).\n * @param {boolean} ignoreAccent - If ignoreAccent is set to true,\n * then filter ignores diacritic characters or accents while filtering.\n * @param {string} actualFilterValue - Defines the actual filter value for filter column.\n * @param {string} actualOperator - Defines the actual filter operator for filter column.\n * @returns {void}\n */\n TreeGrid.prototype.filterByColumn = function (fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator) {\n this.grid.filterByColumn(fieldName, filterOperator, filterValue, predicate, matchCase, ignoreAccent, actualFilterValue, actualOperator);\n };\n /**\n * Clears all the filtered rows of the TreeGrid.\n *\n * @returns {void}\n */\n TreeGrid.prototype.clearFiltering = function () {\n this.grid.clearFiltering();\n };\n /**\n * Removes filtered column by field name.\n *\n * @param {string} field - Defines column field name to remove filter.\n * @param {boolean} isClearFilterBar - Specifies whether the filter bar value needs to be cleared.\n * @returns {void}\n * @hidden\n */\n TreeGrid.prototype.removeFilteredColsByField = function (field, isClearFilterBar) {\n this.grid.removeFilteredColsByField(field, isClearFilterBar);\n };\n /**\n * Selects a row by given index.\n *\n * @param {number} index - Defines the row index.\n * @param {boolean} isToggle - If set to true, then it toggles the selection.\n * @returns {void}\n */\n TreeGrid.prototype.selectRow = function (index, isToggle) {\n this.grid.selectRow(index, isToggle);\n };\n /**\n * Selects a collection of rows by indexes.\n *\n * @param {number[]} rowIndexes - Specifies the row indexes.\n * @returns {void}\n */\n TreeGrid.prototype.selectRows = function (rowIndexes) {\n this.grid.selectRows(rowIndexes);\n };\n /**\n * Deselects the current selected rows and cells.\n *\n * @returns {void}\n */\n TreeGrid.prototype.clearSelection = function () {\n this.grid.clearSelection();\n };\n /**\n * Copy the selected rows or cells data into clipboard.\n *\n * @param {boolean} withHeader - Specifies whether the column header text needs to be copied along with rows or cells.\n * @returns {void}\n */\n TreeGrid.prototype.copy = function (withHeader) {\n this.clipboardModule.copy(withHeader);\n };\n /**\n * Paste data from clipboard to selected cells.\n *\n * @param {boolean} data - Specifies the date for paste.\n * @param {boolean} rowIndex - Specifies the row index.\n * @param {boolean} colIndex - Specifies the column index.\n * @returns {void}\n */\n TreeGrid.prototype.paste = function (data, rowIndex, colIndex) {\n this.clipboardModule.paste(data, rowIndex, colIndex);\n };\n /**\n * Selects a cell by the given index.\n *\n * @param {IIndex} cellIndex - Defines the row and column indexes.\n * @param {boolean} isToggle - If set to true, then it toggles the selection.\n * @returns {void}\n */\n TreeGrid.prototype.selectCell = function (cellIndex, isToggle) {\n this.grid.selectCell(cellIndex, isToggle);\n };\n /**\n * Gets the collection of selected rows.\n *\n * @returns {Element[]} - Returns selected row elements collection\n */\n TreeGrid.prototype.getSelectedRows = function () {\n return this.grid.getSelectedRows();\n };\n /**\n * Gets a movable table cell by row and column index.\n *\n * @param {number} rowIndex - Specifies the row index.\n * @param {number} columnIndex - Specifies the column index.\n * @returns {Element} - Returns movable cell element from the indexes passed\n */\n TreeGrid.prototype.getMovableCellFromIndex = function (rowIndex, columnIndex) {\n return this.grid.getMovableCellFromIndex(rowIndex, columnIndex);\n };\n /**\n * Gets all the TreeGrid's movable table data rows.\n *\n * @returns {Element[]} - Returns element collection of movable rows\n */\n TreeGrid.prototype.getMovableDataRows = function () {\n return this.grid.getMovableDataRows();\n };\n /**\n * Gets a movable tables row by index.\n *\n * @param {number} index - Specifies the row index.\n * @returns {Element} - Returns movable row based on index passed\n */\n TreeGrid.prototype.getMovableRowByIndex = function (index) {\n return this.grid.getMovableRowByIndex(index);\n };\n /**\n * Gets the TreeGrid's movable content rows from frozen treegrid.\n *\n * @returns {Element[]}: Returns movable row element\n */\n TreeGrid.prototype.getMovableRows = function () {\n return this.grid.getMovableRows();\n };\n /**\n * Gets a frozen right tables row element by index.\n *\n * @param {number} index - Specifies the row index.\n * @returns {Element} returns the element\n */\n TreeGrid.prototype.getFrozenRightRowByIndex = function (index) {\n return this.grid.getFrozenRightRowByIndex(index);\n };\n /**\n * Gets the Tree Grid's frozen right content rows from frozen Tree Grid.\n *\n * @returns {Element[]} returns the element\n */\n TreeGrid.prototype.getFrozenRightRows = function () {\n return this.grid.getFrozenRightRows();\n };\n /**\n * Gets all the Tree Grid's frozen right table data rows.\n *\n * @returns {Element[]} Returns the Element\n */\n TreeGrid.prototype.getFrozenRightDataRows = function () {\n return this.grid.getFrozenRightDataRows();\n };\n /**\n * Gets a frozen right table cell by row and column index.\n *\n * @param {number} rowIndex - Specifies the row index.\n * @param {number} columnIndex - Specifies the column index.\n * @returns {Element} Returns the Element\n */\n TreeGrid.prototype.getFrozenRightCellFromIndex = function (rowIndex, columnIndex) {\n return this.grid.getFrozenRightCellFromIndex(rowIndex, columnIndex);\n };\n /**\n * Gets a frozen left column header by column index.\n *\n * @param {number} index - Specifies the column index.\n * @returns {Element} Returns the Element\n */\n TreeGrid.prototype.getFrozenLeftColumnHeaderByIndex = function (index) {\n return this.grid.getFrozenLeftColumnHeaderByIndex(index);\n };\n /**\n * Gets a frozen right column header by column index.\n *\n * @param {number} index - Specifies the column index.\n * @returns {Element} Returns the Element\n */\n TreeGrid.prototype.getFrozenRightColumnHeaderByIndex = function (index) {\n return this.grid.getFrozenRightColumnHeaderByIndex(index);\n };\n /**\n * Gets a movable column header by column index.\n *\n * @param {number} index - Specifies the column index.\n * @returns {Element} Returns the Element\n */\n TreeGrid.prototype.getMovableColumnHeaderByIndex = function (index) {\n return this.grid.getMovableColumnHeaderByIndex(index);\n };\n /**\n * @hidden\n * @returns {number} Returns the movable column count\n */\n TreeGrid.prototype.getMovableColumnsCount = function () {\n return this.grid.getMovableColumnsCount();\n };\n /**\n * @hidden\n * @returns {number} Returns the Frozen Left column\n */\n TreeGrid.prototype.getFrozenLeftColumnsCount = function () {\n return this.grid.getFrozenLeftColumnsCount();\n };\n /**\n * @hidden\n * @returns {number} Returns the Frozen Right column count\n */\n TreeGrid.prototype.getFrozenRightColumnsCount = function () {\n return this.grid.getFrozenRightColumnsCount();\n };\n /**\n * @hidden\n * @returns {Column[]} Returns the column\n */\n TreeGrid.prototype.getFrozenLeftColumns = function () {\n this.updateColumnModel(this.grid.getFrozenLeftColumns());\n return this.columnModel;\n };\n /**\n * @hidden\n * @returns {Column[]} Returns the column\n */\n TreeGrid.prototype.getFrozenRightColumns = function () {\n this.updateColumnModel(this.grid.getFrozenRightColumns());\n return this.columnModel;\n };\n /**\n * @hidden\n * @returns {number} Returns the visible movable count\n */\n TreeGrid.prototype.getVisibleMovableCount = function () {\n return this.grid.getVisibleMovableCount();\n };\n /**\n * @hidden\n * @returns {number} Returns the visible Frozen Right count\n */\n TreeGrid.prototype.getVisibleFrozenRightCount = function () {\n return this.grid.getVisibleFrozenRightCount();\n };\n /**\n * @hidden\n * @returns {number} Returns the visible Frozen left count\n */\n TreeGrid.prototype.getVisibleFrozenLeftCount = function () {\n return this.grid.getVisibleFrozenLeftCount();\n };\n /**\n * @hidden\n * @returns {Column[]} Returns the column\n */\n TreeGrid.prototype.getMovableColumns = function () {\n this.updateColumnModel(this.grid.getMovableColumns());\n return this.columnModel;\n };\n /**\n * Gets the number of frozen column in tree grid\n *\n * @hidden\n * @returns {number} - Returns frozen column count\n */\n TreeGrid.prototype.getFrozenColumns = function () {\n return this.getFrozenCount(this.columns, 0) + this.frozenColumns;\n };\n TreeGrid.prototype.getFrozenCount = function (cols, cnt) {\n for (var j = 0, len = cols.length; j < len; j++) {\n if (cols[j].columns) {\n cnt = this.getFrozenCount(cols[j].columns, cnt);\n }\n else {\n if (cols[j].isFrozen) {\n cnt++;\n }\n }\n }\n return cnt;\n };\n /**\n * Gets the collection of selected row indexes.\n *\n * @returns {number[]} - Returns selected rows index collection\n */\n TreeGrid.prototype.getSelectedRowIndexes = function () {\n return this.grid.getSelectedRowIndexes();\n };\n /**\n * Gets the collection of selected row and cell indexes.\n *\n * @returns {ISelectedCell[]} - Returns selected cell's index details\n */\n TreeGrid.prototype.getSelectedRowCellIndexes = function () {\n return this.grid.getSelectedRowCellIndexes();\n };\n /**\n * Gets the collection of selected records.\n *\n * @isGenericType true\n * @returns {Object[]} - Returns selected records collection\n */\n TreeGrid.prototype.getSelectedRecords = function () {\n return this.grid.getSelectedRecords();\n };\n /**\n * Gets the data module.\n *\n * @returns {{baseModule: Data, treeModule: DataManipulation}}: Returns grid and treegrid data module\n */\n TreeGrid.prototype.getDataModule = function () {\n return { baseModule: this.grid.getDataModule(), treeModule: this.dataModule };\n };\n /**\n * Reorder the rows based on given indexes and position\n *\n * @param {number[]} fromIndexes - Source indexes of rows\n * @param {number} toIndex - Destination index of row\n * @param {string} position - Defines drop position as above or below or child\n * @returns {void}\n */\n TreeGrid.prototype.reorderRows = function (fromIndexes, toIndex, position) {\n this.rowDragAndDropModule.reorderRows(fromIndexes, toIndex, position);\n };\n var TreeGrid_1;\n __decorate([\n Property(0)\n ], TreeGrid.prototype, \"frozenRows\", void 0);\n __decorate([\n Property(0)\n ], TreeGrid.prototype, \"frozenColumns\", void 0);\n __decorate([\n Property('Ellipsis')\n ], TreeGrid.prototype, \"clipMode\", void 0);\n __decorate([\n Property([])\n ], TreeGrid.prototype, \"columns\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"childMapping\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"hasChildMapping\", void 0);\n __decorate([\n Property(0)\n ], TreeGrid.prototype, \"treeColumnIndex\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"idMapping\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"parentIdMapping\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableCollapseAll\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"expandStateMapping\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowRowDragAndDrop\", void 0);\n __decorate([\n Property([])\n ], TreeGrid.prototype, \"dataSource\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"query\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"cloneQuery\", void 0);\n __decorate([\n Property('AllPages')\n ], TreeGrid.prototype, \"printMode\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowPaging\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"loadChildOnDemand\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowTextWrap\", void 0);\n __decorate([\n Complex({}, TextWrapSettings)\n ], TreeGrid.prototype, \"textWrapSettings\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowReordering\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowResizing\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"autoCheckHierarchy\", void 0);\n __decorate([\n Complex({}, PageSettings)\n ], TreeGrid.prototype, \"pageSettings\", void 0);\n __decorate([\n Complex({}, RowDropSettings)\n ], TreeGrid.prototype, \"rowDropSettings\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"pagerTemplate\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"showColumnMenu\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"showColumnChooser\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowSorting\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"allowMultiSorting\", void 0);\n __decorate([\n Complex({}, SortSettings)\n ], TreeGrid.prototype, \"sortSettings\", void 0);\n __decorate([\n Collection([], AggregateRow)\n ], TreeGrid.prototype, \"aggregates\", void 0);\n __decorate([\n Complex({}, EditSettings)\n ], TreeGrid.prototype, \"editSettings\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowFiltering\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"detailTemplate\", void 0);\n __decorate([\n Complex({}, FilterSettings)\n ], TreeGrid.prototype, \"filterSettings\", void 0);\n __decorate([\n Complex({}, SearchSettings)\n ], TreeGrid.prototype, \"searchSettings\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"toolbar\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"toolbarTemplate\", void 0);\n __decorate([\n Property('Default')\n ], TreeGrid.prototype, \"gridLines\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"contextMenuItems\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"columnMenuItems\", void 0);\n __decorate([\n Property()\n ], TreeGrid.prototype, \"rowTemplate\", void 0);\n __decorate([\n Property('Parent')\n ], TreeGrid.prototype, \"copyHierarchyMode\", void 0);\n __decorate([\n Property(null)\n ], TreeGrid.prototype, \"rowHeight\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"enableAltRow\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"allowKeyboard\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableHover\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableAutoFill\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableAdaptiveUI\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableImmutableMode\", void 0);\n __decorate([\n Property('auto')\n ], TreeGrid.prototype, \"height\", void 0);\n __decorate([\n Property('auto')\n ], TreeGrid.prototype, \"width\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableVirtualization\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableColumnVirtualization\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"enableInfiniteScrolling\", void 0);\n __decorate([\n Complex({}, InfiniteScrollSettings)\n ], TreeGrid.prototype, \"infiniteScrollSettings\", void 0);\n __decorate([\n Property('All')\n ], TreeGrid.prototype, \"columnQueryMode\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"created\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"load\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"expanding\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"expanded\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"collapsing\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"collapsed\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellSave\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellSaved\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"actionBegin\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"actionComplete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beginEdit\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"batchAdd\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"batchDelete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"batchCancel\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeBatchAdd\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeBatchDelete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeBatchSave\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellEdit\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"actionFailure\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"dataBound\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"dataSourceChanged\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"dataStateChange\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"recordDoubleClick\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDataBound\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"detailDataBound\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"queryCellInfo\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"allowSelection\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowSelecting\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowSelected\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDeselecting\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDeselected\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"headerCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellSelecting\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnMenuOpen\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnMenuClick\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellSelected\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellDeselecting\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"cellDeselected\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"resizeStart\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"resizing\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"resizeStop\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnDragStart\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnDrag\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"columnDrop\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"checkboxChange\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"printComplete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforePrint\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"toolbarClick\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeDataBound\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"contextMenuOpen\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"contextMenuClick\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeCopy\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforePaste\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDrag\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDragStart\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDragStartHelper\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"rowDrop\", void 0);\n __decorate([\n Property(-1)\n ], TreeGrid.prototype, \"selectedRowIndex\", void 0);\n __decorate([\n Complex({}, SelectionSettings)\n ], TreeGrid.prototype, \"selectionSettings\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowExcelExport\", void 0);\n __decorate([\n Property(false)\n ], TreeGrid.prototype, \"allowPdfExport\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"pdfQueryCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"pdfHeaderQueryCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"excelQueryCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"excelHeaderQueryCellInfo\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforeExcelExport\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"excelExportComplete\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"beforePdfExport\", void 0);\n __decorate([\n Event()\n ], TreeGrid.prototype, \"pdfExportComplete\", void 0);\n TreeGrid = TreeGrid_1 = __decorate([\n NotifyPropertyChanges\n ], TreeGrid);\n return TreeGrid;\n}(Component));\nexport { TreeGrid };\n","import { getObject, Grid, Reorder as GridReorder } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid Reorder module\n *\n * @hidden\n */\nvar Reorder = /** @class */ (function () {\n /**\n * Constructor for Reorder module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Reorder(parent) {\n Grid.Inject(GridReorder);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Reorder module name\n */\n Reorder.prototype.getModuleName = function () {\n return 'reorder';\n };\n /**\n * @hidden\n * @returns {void}\n */\n Reorder.prototype.addEventListener = function () {\n this.parent.on('getColumnIndex', this.getTreeColumn, this);\n };\n Reorder.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('getColumnIndex', this.getTreeColumn);\n };\n /**\n * To destroy the Reorder\n *\n * @returns {void}\n * @hidden\n */\n Reorder.prototype.destroy = function () {\n this.removeEventListener();\n };\n Reorder.prototype.getTreeColumn = function () {\n var columnModel = 'columnModel';\n var treeColumn = this.parent[columnModel][this.parent.treeColumnIndex];\n var treeIndex;\n var updatedCols = this.parent.getColumns();\n for (var f = 0; f < updatedCols.length; f++) {\n var treeColumnfield = getObject('field', treeColumn);\n var parentColumnfield = getObject('field', updatedCols[f]);\n if (treeColumnfield === parentColumnfield) {\n treeIndex = f;\n break;\n }\n }\n this.parent.setProperties({ treeColumnIndex: treeIndex }, true);\n };\n return Reorder;\n}());\nexport { Reorder };\n","import { Grid, Resize as GridResize } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid Resize module\n *\n * @hidden\n */\nvar Resize = /** @class */ (function () {\n /**\n * Constructor for Resize module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Resize(parent) {\n Grid.Inject(GridResize);\n this.parent = parent;\n }\n /**\n * Resize by field names.\n *\n * @param {string|string[]} fName - Defines the field name.\n * @returns {void}\n */\n Resize.prototype.autoFitColumns = function (fName) {\n this.parent.grid.autoFitColumns(fName);\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Resize module name\n */\n Resize.prototype.getModuleName = function () {\n return 'resize';\n };\n /**\n * Destroys the Resize.\n *\n * @function destroy\n * @returns {void}\n */\n Resize.prototype.destroy = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.grid.resizeModule.destroy();\n };\n return Resize;\n}());\nexport { Resize };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the row drop settings of the TreeGrid.\n */\nvar RowDropSettings = /** @class */ (function (_super) {\n __extends(RowDropSettings, _super);\n function RowDropSettings() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property()\n ], RowDropSettings.prototype, \"targetID\", void 0);\n return RowDropSettings;\n}(ChildProperty));\nexport { RowDropSettings };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { VirtualRowModelGenerator } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { isCountRequired } from '../utils';\n/**\n * RowModelGenerator is used to generate grid data rows.\n *\n * @hidden\n */\nvar TreeVirtualRowModelGenerator = /** @class */ (function (_super) {\n __extends(TreeVirtualRowModelGenerator, _super);\n function TreeVirtualRowModelGenerator(parent) {\n var _this = _super.call(this, parent) || this;\n _this.addEventListener();\n return _this;\n }\n TreeVirtualRowModelGenerator.prototype.addEventListener = function () {\n this.parent.on(events.dataListener, this.getDatas, this);\n };\n TreeVirtualRowModelGenerator.prototype.getDatas = function (args) {\n this.visualData = args.data;\n };\n TreeVirtualRowModelGenerator.prototype.getDataInfo = function () {\n return _super.prototype.getData.call(this);\n };\n TreeVirtualRowModelGenerator.prototype.generateRows = function (data, notifyArgs) {\n if (!isNullOrUndefined(notifyArgs.virtualInfo) && notifyArgs.virtualInfo.loadNext &&\n notifyArgs.virtualInfo.nextInfo.page !== this.parent.pageSettings.currentPage) {\n this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.nextInfo.page } }, true);\n }\n else if (!isNullOrUndefined(notifyArgs.virtualInfo) && !notifyArgs.virtualInfo.loadNext &&\n notifyArgs.virtualInfo.page !== this.parent.pageSettings.currentPage) {\n this.parent.setProperties({ pageSettings: { currentPage: notifyArgs.virtualInfo.page } }, true);\n }\n var info = this.getDataInfo();\n if (!isNullOrUndefined(notifyArgs.virtualInfo)) {\n if (notifyArgs.virtualInfo.direction !== 'right' && notifyArgs.virtualInfo.direction !== 'left') {\n notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;\n }\n else {\n notifyArgs.virtualInfo.blockIndexes = this.getBlockIndexes(notifyArgs.virtualInfo.page);\n }\n }\n if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {\n return _super.prototype.generateRows.call(this, data, notifyArgs);\n }\n else {\n if (!isNullOrUndefined(notifyArgs.requestType) && notifyArgs.requestType.toString() === 'collapseAll') {\n notifyArgs.requestType = 'refresh';\n }\n var rows = _super.prototype.generateRows.call(this, data, notifyArgs);\n for (var r = 0; r < rows.length; r++) {\n rows[r].index = (this.visualData).indexOf(rows[r].data);\n }\n return rows;\n }\n };\n TreeVirtualRowModelGenerator.prototype.checkAndResetCache = function (action) {\n var clear = ['paging', 'refresh', 'sorting', 'filtering', 'searching', 'reorder',\n 'save', 'delete'].some(function (value) { return action === value; });\n if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {\n var model = 'model';\n var currentPage = this[model].currentPage;\n if (clear) {\n this.cache = {};\n this.data = {};\n this.groups = {};\n }\n else if (action === 'virtualscroll' && this.cache[currentPage] &&\n this.cache[currentPage].length > (this.parent.contentModule).getBlockSize()) {\n delete this.cache[currentPage];\n }\n }\n else {\n if (clear || action === 'virtualscroll') {\n this.cache = {};\n this.data = {};\n this.groups = {};\n }\n }\n return clear;\n };\n return TreeVirtualRowModelGenerator;\n}(VirtualRowModelGenerator));\nexport { TreeVirtualRowModelGenerator };\n","import { getObject, Filter as GridFilter, Grid } from '@syncfusion/ej2-grids';\nimport { isNullOrUndefined, setValue, getValue } from '@syncfusion/ej2-base';\nimport { getParentData } from '../utils';\n/**\n * TreeGrid Filter module will handle filtering action\n *\n * @hidden\n */\nvar Filter = /** @class */ (function () {\n /**\n * Constructor for Filter module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Filter(parent) {\n Grid.Inject(GridFilter);\n this.parent = parent;\n this.isHierarchyFilter = false;\n this.filteredResult = [];\n this.flatFilteredData = [];\n this.filteredParentRecs = [];\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Filter module name\n */\n Filter.prototype.getModuleName = function () {\n return 'filter';\n };\n /**\n * To destroy the Filter module\n *\n * @returns {void}\n * @hidden\n */\n Filter.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {void}\n */\n Filter.prototype.addEventListener = function () {\n this.parent.on('updateFilterRecs', this.updatedFilteredRecord, this);\n this.parent.on('clearFilters', this.clearFilterLevel, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n Filter.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('updateFilterRecs', this.updatedFilteredRecord);\n this.parent.off('clearFilters', this.clearFilterLevel);\n };\n /**\n * Function to update filtered records\n *\n * @param {{data: Object} } dataDetails - Filtered data collection\n * @param {Object} dataDetails.data - Fliltered data collection\n * @hidden\n * @returns {void}\n */\n Filter.prototype.updatedFilteredRecord = function (dataDetails) {\n setValue('uniqueIDFilterCollection', {}, this.parent);\n this.flatFilteredData = dataDetails.data;\n this.filteredParentRecs = [];\n this.filteredResult = [];\n this.isHierarchyFilter = false;\n for (var f = 0; f < this.flatFilteredData.length; f++) {\n var rec = this.flatFilteredData[f];\n this.addParentRecord(rec);\n var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode\n : this.parent.searchSettings.hierarchyMode;\n if (((hierarchyMode === 'Child' || hierarchyMode === 'None') &&\n (this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== ''))) {\n this.isHierarchyFilter = true;\n }\n var ischild = getObject('childRecords', rec);\n if (!isNullOrUndefined(ischild) && ischild.length) {\n setValue('hasFilteredChildRecords', this.checkChildExsist(rec), rec);\n }\n var parent_1 = getObject('parentItem', rec);\n if (!isNullOrUndefined(parent_1)) {\n var parRecord = getParentData(this.parent, rec.parentItem.uniqueID, true);\n //let parRecord: Object = this.flatFilteredData.filter((e: ITreeData) => {\n // return e.uniqueID === rec.parentItem.uniqueID; })[0];\n setValue('hasFilteredChildRecords', true, parRecord);\n if (parRecord && parRecord.parentItem) {\n this.updateParentFilteredRecord(parRecord);\n }\n }\n }\n if (this.flatFilteredData.length > 0 && this.isHierarchyFilter) {\n this.updateFilterLevel();\n }\n this.parent.notify('updateAction', { result: this.filteredResult });\n };\n Filter.prototype.updateParentFilteredRecord = function (record) {\n var parRecord = getParentData(this.parent, record.parentItem.uniqueID, true);\n var uniqueIDValue = getValue('uniqueIDFilterCollection', this.parent);\n if (parRecord && Object.prototype.hasOwnProperty.call(uniqueIDValue, parRecord.uniqueID)) {\n setValue('hasFilteredChildRecords', true, parRecord);\n }\n if (parRecord && parRecord.parentItem) {\n this.updateParentFilteredRecord(parRecord);\n }\n };\n Filter.prototype.addParentRecord = function (record) {\n var parent = getParentData(this.parent, record.parentUniqueID);\n //let parent: Object = this.parent.flatData.filter((e: ITreeData) => {return e.uniqueID === record.parentUniqueID; })[0];\n var hierarchyMode = this.parent.grid.searchSettings.key === '' ? this.parent.filterSettings.hierarchyMode\n : this.parent.searchSettings.hierarchyMode;\n if (hierarchyMode === 'None' && (this.parent.grid.filterSettings.columns.length !== 0\n || this.parent.grid.searchSettings.key !== '')) {\n if (isNullOrUndefined(parent)) {\n if (this.flatFilteredData.indexOf(record) !== -1) {\n if (this.filteredResult.indexOf(record) === -1) {\n this.filteredResult.push(record);\n setValue('uniqueIDFilterCollection.' + record.uniqueID, record, this.parent);\n record.hasFilteredChildRecords = true;\n }\n return;\n }\n }\n else {\n this.addParentRecord(parent);\n if (this.flatFilteredData.indexOf(parent) !== -1 || this.filteredResult.indexOf(parent) !== -1) {\n if (this.filteredResult.indexOf(record) === -1) {\n this.filteredResult.push(record);\n setValue('uniqueIDFilterCollection.' + record.uniqueID, record, this.parent);\n }\n }\n else {\n if (this.filteredResult.indexOf(record) === -1 && this.flatFilteredData.indexOf(record) !== -1) {\n this.filteredResult.push(record);\n setValue('uniqueIDFilterCollection.' + record.uniqueID, record, this.parent);\n }\n }\n }\n }\n else {\n if (!isNullOrUndefined(parent)) {\n var hierarchyMode_1 = this.parent.grid.searchSettings.key === '' ?\n this.parent.filterSettings.hierarchyMode : this.parent.searchSettings.hierarchyMode;\n if (hierarchyMode_1 === 'Child' && (this.parent.grid.filterSettings.columns.length !== 0\n || this.parent.grid.searchSettings.key !== '')) {\n if (this.flatFilteredData.indexOf(parent) !== -1) {\n this.addParentRecord(parent);\n }\n }\n else {\n if (parent['expanded'] === false && this.parent.getVisibleRecords().indexOf(record) === -1 && isNullOrUndefined(this.parent['dataResults']['action'])) {\n this.parent.expandRow(this.parent.getRows()[parent['index']], parent);\n }\n this.addParentRecord(parent);\n }\n }\n if (this.filteredResult.indexOf(record) === -1) {\n this.filteredResult.push(record);\n setValue('uniqueIDFilterCollection.' + record.uniqueID, record, this.parent);\n }\n }\n };\n Filter.prototype.checkChildExsist = function (records) {\n var childRec = getObject('childRecords', records);\n var isExist = false;\n for (var count = 0; count < childRec.length; count++) {\n var ischild = childRec[count].childRecords;\n var hierarchyMode = this.parent.grid.searchSettings.key === '' ?\n this.parent.filterSettings.hierarchyMode : this.parent.searchSettings.hierarchyMode;\n if (((hierarchyMode === 'Child' || hierarchyMode === 'Both') && (this.parent.grid.filterSettings.columns.length !== 0\n || this.parent.grid.searchSettings.key !== ''))) {\n var uniqueIDValue = getValue('uniqueIDFilterCollection', this.parent);\n if (!Object.prototype.hasOwnProperty.call(uniqueIDValue, childRec[count].uniqueID)) {\n this.filteredResult.push(childRec[count]);\n setValue('uniqueIDFilterCollection.' + childRec[count].uniqueID, childRec[count], this.parent);\n isExist = true;\n }\n }\n if ((hierarchyMode === 'None')\n && (this.parent.grid.filterSettings.columns.length !== 0 || this.parent.grid.searchSettings.key !== '')) {\n if (this.flatFilteredData.indexOf(childRec[count]) !== -1) {\n isExist = true;\n break;\n }\n }\n if (!isNullOrUndefined(ischild) && ischild.length) {\n isExist = this.checkChildExsist(childRec[count]);\n }\n if ((hierarchyMode === 'Child' || hierarchyMode === 'Both') && childRec.length) {\n isExist = true;\n }\n }\n return isExist;\n };\n Filter.prototype.updateFilterLevel = function () {\n var record = this.filteredResult;\n var len = this.filteredResult.length;\n for (var c = 0; c < len; c++) {\n var parent_2 = getParentData(this.parent, record[c].parentUniqueID);\n var isPrst = record.indexOf(parent_2) !== -1;\n if (isPrst) {\n var parent_3 = getParentData(this.parent, record[c].parentUniqueID, true);\n record[c].filterLevel = parent_3.filterLevel + 1;\n }\n else {\n record[c].filterLevel = 0;\n this.filteredParentRecs.push(record[c]);\n }\n }\n };\n Filter.prototype.clearFilterLevel = function (data) {\n var count = 0;\n var flatData = data.flatData;\n var len = flatData.length;\n var currentRecord;\n for (count; count < len; count++) {\n currentRecord = flatData[count];\n var fLevel = currentRecord.filterLevel;\n if (fLevel || fLevel === 0 || !isNullOrUndefined(currentRecord.hasFilteredChildRecords)) {\n currentRecord.hasFilteredChildRecords = null;\n currentRecord.filterLevel = null;\n }\n }\n this.filteredResult = [];\n this.parent.notify('updateResults', { result: flatData, count: flatData.length });\n };\n return Filter;\n}());\nexport { Filter };\n","import { getObject, Grid, ExcelExport as GridExcel } from '@syncfusion/ej2-grids';\nimport { isRemoteData, isOffline, getParentData, getExpandStatus } from '../utils';\nimport { isNullOrUndefined, setValue, extend } from '@syncfusion/ej2-base';\nimport { DataManager, Query } from '@syncfusion/ej2-data';\nimport * as event from '../base/constant';\n/**\n * TreeGrid Excel Export module\n *\n * @hidden\n */\nvar ExcelExport = /** @class */ (function () {\n /**\n * Constructor for Excel Export module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function ExcelExport(parent) {\n this.isCollapsedStatePersist = false;\n Grid.Inject(GridExcel);\n this.parent = parent;\n this.dataResults = {};\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns ExcelExport module name\n */\n ExcelExport.prototype.getModuleName = function () {\n return 'ExcelExport';\n };\n /**\n * @hidden\n * @returns {void}\n */\n ExcelExport.prototype.addEventListener = function () {\n this.parent.on('updateResults', this.updateExcelResultModel, this);\n this.parent.on('excelCellInfo', this.excelQueryCellInfo, this);\n this.parent.grid.on('export-RowDataBound', this.exportRowDataBound, this);\n this.parent.grid.on('finalPageSetup', this.finalPageSetup, this);\n };\n /**\n * To destroy the Excel Export\n *\n * @returns {void}\n * @hidden\n */\n ExcelExport.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {void}\n */\n ExcelExport.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('updateResults', this.updateExcelResultModel);\n this.parent.off('excelCellInfo', this.excelQueryCellInfo);\n this.parent.grid.off('export-RowDataBound', this.exportRowDataBound);\n this.parent.grid.off('finalPageSetup', this.finalPageSetup);\n };\n ExcelExport.prototype.updateExcelResultModel = function (returnResult) {\n this.dataResults = returnResult;\n };\n ExcelExport.prototype.Map = function (excelExportProperties, \n /* eslint-disable-next-line */\n isMultipleExport, workbook, isBlob, isCsv) {\n var _this = this;\n var dataSource = this.parent.dataSource;\n var property = Object();\n setValue('isCsv', isCsv, property);\n setValue('cancel', false, property);\n if (!isNullOrUndefined(excelExportProperties)) {\n this.isCollapsedStatePersist = excelExportProperties.isCollapsedStatePersist;\n }\n return new Promise(function (resolve) {\n var dm = _this.isLocal() && !(dataSource instanceof DataManager) ? new DataManager(dataSource)\n : _this.parent.dataSource;\n var query = new Query();\n if (!_this.isLocal()) {\n query = _this.generateQuery(query);\n setValue('query', query, property);\n }\n _this.parent.trigger(event.beforeExcelExport, extend(property, excelExportProperties));\n if (getObject('cancel', property)) {\n return null;\n }\n dm.executeQuery(query).then(function (e) {\n var customData = null;\n if (!isNullOrUndefined(excelExportProperties) && !isNullOrUndefined(excelExportProperties.dataSource)) {\n customData = excelExportProperties.dataSource;\n }\n excelExportProperties = _this.manipulateExportProperties(excelExportProperties, dataSource, e);\n return _this.parent.grid.excelExportModule.Map(_this.parent.grid, excelExportProperties, isMultipleExport, workbook, isCsv, isBlob).then(function (book) {\n if (customData != null) {\n excelExportProperties.dataSource = customData;\n }\n else {\n delete excelExportProperties.dataSource;\n }\n resolve(book);\n });\n });\n });\n };\n ExcelExport.prototype.generateQuery = function (query, property) {\n if (!isNullOrUndefined(property) && property.exportType === 'CurrentPage'\n && this.parent.allowPaging) {\n property.exportType = 'AllPages';\n query.addParams('ExportType', 'CurrentPage');\n query.where(this.parent.parentIdMapping, 'equal', null);\n query = getObject('grid.renderModule.data.pageQuery', this.parent)(query);\n }\n return query;\n };\n ExcelExport.prototype.manipulateExportProperties = function (property, dtSrc, queryResult) {\n //count not required for this query\n var args = Object();\n setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);\n setValue('isExport', true, args);\n if (!isNullOrUndefined(property) && !isNullOrUndefined(property.exportType)) {\n setValue('exportType', property.exportType, args);\n }\n if (!this.isLocal()) {\n this.parent.parentData = [];\n this.parent.dataModule.convertToFlatData(getObject('result', queryResult));\n setValue('expresults', this.parent.flatData, args);\n }\n this.parent.notify('dataProcessor', args);\n //args = this.parent.dataModule.dataProcessor(args);\n args = this.dataResults;\n dtSrc = isNullOrUndefined(args.result) ? this.parent.flatData.slice(0) : args.result;\n if (!this.isLocal()) {\n this.parent.flatData = [];\n }\n if (property && property.dataSource && this.isLocal()) {\n var flatsData = this.parent.flatData;\n var dataSrc = property.dataSource instanceof DataManager ? property.dataSource.dataSource.json : property.dataSource;\n this.parent.dataModule.convertToFlatData(dataSrc);\n dtSrc = this.parent.flatData;\n this.parent.flatData = flatsData;\n }\n property = isNullOrUndefined(property) ? Object() : property;\n property.dataSource = new DataManager({ json: dtSrc });\n return property;\n };\n /**\n * TreeGrid Excel Export cell modifier\n *\n * @param {ExcelQueryCellInfoEventArgs} args - current cell details\n * @hidden\n * @returns {void}\n */\n ExcelExport.prototype.excelQueryCellInfo = function (args) {\n if (this.parent.grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex) {\n var style = {};\n var data = args.data;\n var ispadfilter = isNullOrUndefined(data.filterLevel);\n var pad = ispadfilter ? data.level : data.filterLevel;\n style.indent = pad;\n args.style = style;\n }\n this.parent.notify('updateResults', args);\n this.parent.trigger('excelQueryCellInfo', args);\n };\n ExcelExport.prototype.exportRowDataBound = function (excelRow) {\n if (excelRow.type === 'excel') {\n var excelrowobj = excelRow.rowObj.data;\n var filtercolumnlength = this.parent.grid.filterSettings.columns.length;\n var rowlength = excelRow.excelRows.length;\n var rowlevel = excelrowobj.level;\n if (excelrowobj.parentItem && getParentData(this.parent, excelrowobj.parentItem.uniqueID, Boolean(filtercolumnlength))) {\n var expandedStatus = false;\n var sublevelState = false;\n var state = getExpandStatus(this.parent, excelrowobj, this.parent.parentData);\n if (this.isCollapsedStatePersist && (!state || !this.parent.isLocalData)) {\n expandedStatus = true;\n sublevelState = excelrowobj.expanded ? false : true;\n }\n excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel, isCollapsed: sublevelState,\n isHidden: expandedStatus };\n }\n else if (excelrowobj.hasChildRecords && isNullOrUndefined(excelrowobj.parentItem)) {\n excelRow.excelRows[rowlength - 1].grouping = { outlineLevel: rowlevel };\n }\n }\n };\n /* eslint-disable-next-line */\n ExcelExport.prototype.finalPageSetup = function (workbook) {\n for (var i = 0; i < workbook.worksheets.length; i++) {\n if (workbook.worksheets[i].rows) {\n workbook.worksheets[i].pageSetup = { isSummaryRowBelow: false };\n }\n }\n };\n ExcelExport.prototype.isLocal = function () {\n return !isRemoteData(this.parent) && isOffline(this.parent);\n };\n return ExcelExport;\n}());\nexport { ExcelExport };\n","import { getObject, PdfExport as GridPdf, Grid } from '@syncfusion/ej2-grids';\nimport { isRemoteData, isOffline } from '../utils';\nimport { isNullOrUndefined, setValue, extend, getValue } from '@syncfusion/ej2-base';\nimport { DataManager, Query } from '@syncfusion/ej2-data';\nimport * as event from '../base/constant';\n/**\n * TreeGrid PDF Export module\n *\n * @hidden\n */\nvar PdfExport = /** @class */ (function () {\n /**\n * Constructor for PDF export module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function PdfExport(parent) {\n Grid.Inject(GridPdf);\n this.parent = parent;\n this.dataResults = {};\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} PdfExport module name\n */\n PdfExport.prototype.getModuleName = function () {\n return 'PdfExport';\n };\n /**\n * @hidden\n * @returns {void}\n */\n PdfExport.prototype.addEventListener = function () {\n this.parent.on('pdfCellInfo', this.pdfQueryCellInfo, this);\n this.parent.on('updateResults', this.updatePdfResultModel, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n PdfExport.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('pdfCellInfo', this.pdfQueryCellInfo);\n this.parent.off('updateResults', this.updatePdfResultModel);\n };\n /**\n * To destroy the PDF Export\n *\n * @returns {void}\n * @hidden\n */\n PdfExport.prototype.destroy = function () {\n this.removeEventListener();\n };\n PdfExport.prototype.updatePdfResultModel = function (returnResult) {\n this.dataResults = returnResult;\n };\n PdfExport.prototype.Map = function (pdfExportProperties, isMultipleExport, pdfDoc, isBlob) {\n var _this = this;\n var dtSrc = this.parent.dataSource;\n var prop = Object();\n var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);\n setValue('cancel', false, prop);\n return new Promise(function (resolve) {\n var dm = isLocal && !(dtSrc instanceof DataManager) ? new DataManager(dtSrc)\n : _this.parent.dataSource;\n var query = new Query();\n if (!isLocal) {\n query = _this.generateQuery(query);\n setValue('query', query, prop);\n }\n _this.parent.trigger(event.beforePdfExport, extend(prop, pdfExportProperties));\n if (getObject('cancel', prop)) {\n return null;\n }\n dm.executeQuery(query).then(function (e) {\n var customsData = null;\n if (!isNullOrUndefined(pdfExportProperties) && !isNullOrUndefined(pdfExportProperties.dataSource)) {\n customsData = pdfExportProperties.dataSource;\n }\n pdfExportProperties = _this.manipulatePdfProperties(pdfExportProperties, dtSrc, e);\n return _this.parent.grid.pdfExportModule.Map(_this.parent.grid, pdfExportProperties, isMultipleExport, pdfDoc, isBlob).then(function (document) {\n if (customsData != null) {\n pdfExportProperties.dataSource = customsData;\n }\n else {\n delete pdfExportProperties.dataSource;\n }\n resolve(document);\n });\n });\n });\n };\n PdfExport.prototype.generateQuery = function (query, prop) {\n if (!isNullOrUndefined(prop) && prop.exportType === 'CurrentPage'\n && this.parent.allowPaging) {\n prop.exportType = 'AllPages';\n query.addParams('ExportType', 'CurrentPage');\n query.where(this.parent.parentIdMapping, 'equal', null);\n query = getObject('grid.renderModule.data.pageQuery', this.parent)(query);\n }\n return query;\n };\n PdfExport.prototype.manipulatePdfProperties = function (prop, dtSrc, queryResult) {\n var args = {};\n //count not required for this query\n var isLocal = !isRemoteData(this.parent) && isOffline(this.parent);\n setValue('query', this.parent.grid.getDataModule().generateQuery(true), args);\n setValue('isExport', true, args);\n setValue('isPdfExport', true, args);\n if (!isNullOrUndefined(prop) && !isNullOrUndefined(prop.isCollapsedStatePersist)) {\n setValue('isCollapsedStatePersist', prop.isCollapsedStatePersist, args);\n }\n if (!isNullOrUndefined(prop) && !isNullOrUndefined(prop.exportType)) {\n setValue('exportType', prop.exportType, args);\n }\n if (!isLocal) {\n this.parent.parentData = [];\n this.parent.dataModule.convertToFlatData(getValue('result', queryResult));\n setValue('expresults', this.parent.flatData, args);\n }\n this.parent.notify('dataProcessor', args);\n //args = this.parent.dataModule.dataProcessor(args);\n args = this.dataResults;\n dtSrc = isNullOrUndefined(args.result) ? this.parent.flatData.slice(0) : args.result;\n if (!isLocal) {\n this.parent.flatData = [];\n }\n if (prop && prop.dataSource && isLocal) {\n var flatDatas = this.parent.flatData;\n var dataSrc = prop.dataSource instanceof DataManager ? prop.dataSource.dataSource.json : prop.dataSource;\n this.parent.dataModule.convertToFlatData(dataSrc);\n dtSrc = this.parent.flatData;\n this.parent.flatData = flatDatas;\n }\n prop = isNullOrUndefined(prop) ? {} : prop;\n prop.dataSource = new DataManager({ json: dtSrc });\n return prop;\n };\n /**\n * TreeGrid PDF Export cell modifier\n *\n * @param {PdfQueryCellInfoEventArgs} args - Current cell details\n * @hidden\n * @returns {void}\n */\n PdfExport.prototype.pdfQueryCellInfo = function (args) {\n if (this.parent.grid.getColumnIndexByUid(args.column.uid) === this.parent.treeColumnIndex) {\n var style = {};\n var data = getObject('data', args);\n var ispadfilter = isNullOrUndefined(data.filterLevel);\n var pad = ispadfilter ? data.level : data.filterLevel;\n style.paragraphIndent = pad * 3;\n args.style = style;\n }\n this.parent.notify('updateResults', args);\n this.parent.trigger('pdfQueryCellInfo', args);\n };\n return PdfExport;\n}());\nexport { PdfExport };\n","import { Grid } from '@syncfusion/ej2-grids';\nimport { Page as GridPage } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { DataManager, Query, Predicate } from '@syncfusion/ej2-data';\nimport { getValue, isNullOrUndefined, addClass, removeClass } from '@syncfusion/ej2-base';\nimport { getExpandStatus, isFilterChildHierarchy } from '../utils';\n/**\n * The `Page` module is used to render pager and handle paging action.\n *\n * @hidden\n */\nvar Page = /** @class */ (function () {\n function Page(parent) {\n Grid.Inject(GridPage);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * @hidden\n * @returns {void}\n */\n Page.prototype.addEventListener = function () {\n this.parent.on(events.localPagedExpandCollapse, this.collapseExpandPagedchilds, this);\n this.parent.on(events.pagingActions, this.pageAction, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n Page.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.localPagedExpandCollapse, this.collapseExpandPagedchilds);\n this.parent.off(events.pagingActions, this.pageAction);\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Pager module name\n */\n Page.prototype.getModuleName = function () {\n return 'pager';\n };\n /**\n * Refreshes the page count, pager information, and external message.\n *\n * @returns {void}\n */\n Page.prototype.refresh = function () {\n this.parent.grid.pagerModule.refresh();\n };\n /**\n * To destroy the pager\n *\n * @returns {void}\n * @hidden\n */\n Page.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * Navigates to the target page according to the given number.\n *\n * @param {number} pageNo - Defines the page number to navigate.\n * @returns {void}\n */\n Page.prototype.goToPage = function (pageNo) {\n this.parent.grid.pagerModule.goToPage(pageNo);\n };\n /**\n * Defines the text of the external message.\n *\n * @param {string} message - Defines the message to update.\n * @returns {void}\n */\n Page.prototype.updateExternalMessage = function (message) {\n this.parent.grid.pagerModule.updateExternalMessage(message);\n };\n /**\n * @param {{action: string, row: HTMLTableRowElement, record: ITreeData, args: RowCollapsedEventArgs}} rowDetails - Expand Collapse details arguments\n * @param {string} rowDetails.action - Expand Collapse action type\n * @param {HTMLTableRowElement} rowDetails.row - Row element\n * @param {ITreeData} rowDetails.record - Row object data\n * @param {RowCollapsedEventArgs} rowDetails.args - Expand Collapse event arguments\n * @hidden\n * @returns {void}\n */\n Page.prototype.collapseExpandPagedchilds = function (rowDetails) {\n rowDetails.record.expanded = rowDetails.action === 'collapse' ? false : true;\n if (this.parent.enableImmutableMode) {\n var primaryKeyField_1 = this.parent.getPrimaryKeyFieldNames()[0];\n var record = this.parent.flatData.filter(function (e) {\n return e[primaryKeyField_1] === rowDetails.record[primaryKeyField_1];\n });\n if (record.length) {\n record[0].expanded = rowDetails.record.expanded;\n }\n }\n var ret = {\n result: this.parent.flatData,\n row: rowDetails.row,\n action: rowDetails.action,\n record: rowDetails.record,\n count: this.parent.flatData.length\n };\n getValue('grid.renderModule', this.parent).dataManagerSuccess(ret);\n if (this.parent.enableImmutableMode) {\n var row = 'row';\n var action = 'action';\n var targetEle = void 0;\n if (ret[action] === 'collapse') {\n targetEle = ret[row].getElementsByClassName('e-treegridexpand')[0];\n if (!isNullOrUndefined(targetEle)) {\n removeClass([targetEle], 'e-treegridexpand');\n addClass([targetEle], 'e-treegridcollapse');\n }\n }\n else if (ret[action] === 'expand') {\n targetEle = ret[row].getElementsByClassName('e-treegridcollapse')[0];\n if (!isNullOrUndefined(targetEle)) {\n removeClass([targetEle], 'e-treegridcollapse');\n addClass([targetEle], 'e-treegridexpand');\n }\n }\n }\n };\n Page.prototype.pageRoot = function (pagedResults, temp, result) {\n var newResults = isNullOrUndefined(result) ? [] : result;\n var _loop_1 = function (t) {\n newResults.push(temp[t]);\n var res = [];\n if (temp[t].hasChildRecords) {\n res = pagedResults.filter(function (e) {\n return temp[t].uniqueID === e.parentUniqueID;\n });\n newResults = this_1.pageRoot(pagedResults, res, newResults);\n }\n };\n var this_1 = this;\n for (var t = 0; t < temp.length; t++) {\n _loop_1(t);\n }\n return newResults;\n };\n Page.prototype.pageAction = function (pageingDetails) {\n var _this = this;\n var dm = new DataManager(pageingDetails.result);\n if (this.parent.pageSettings.pageSizeMode === 'Root') {\n var temp = [];\n var propname = (this.parent.grid.filterSettings.columns.length > 0) &&\n (this.parent.filterSettings.hierarchyMode === 'Child' || this.parent.filterSettings.hierarchyMode === 'None') ?\n 'filterLevel' : 'level';\n var query = new Query().where(propname, 'equal', 0);\n temp = dm.executeLocal(query);\n pageingDetails.count = temp.length;\n var size = this.parent.grid.pageSettings.pageSize;\n var current = this.parent.grid.pageSettings.currentPage;\n var skip = size * (current - 1);\n query = query.skip(skip).take(size);\n temp = dm.executeLocal(query);\n var newResults = this.pageRoot(pageingDetails.result, temp);\n pageingDetails.result = newResults;\n }\n else {\n var dm_1 = new DataManager(pageingDetails.result);\n var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);\n var parents_1 = dm_1.executeLocal(new Query().where(expanded));\n var visualData = void 0;\n if (isFilterChildHierarchy(this.parent) && ((this.parent.searchSettings.key !== this.parent.grid.searchSettings.key) ||\n (this.parent.filterSettings.columns.length !== this.parent.grid.filterSettings.columns.length))) {\n visualData = parents_1;\n }\n else {\n visualData = parents_1.filter(function (e) {\n return getExpandStatus(_this.parent, e, parents_1);\n });\n }\n pageingDetails.count = visualData.length;\n var query = new Query();\n var size = this.parent.grid.pageSettings.pageSize;\n var current = this.parent.grid.pageSettings.currentPage;\n if (visualData.length < (current * size)) {\n current = (Math.floor(visualData.length / size)) + ((visualData.length % size) ? 1 : 0);\n current = current ? current : 1;\n this.parent.grid.setProperties({ pageSettings: { currentPage: current } }, true);\n }\n var skip = size * (current - 1);\n query = query.skip(skip).take(size);\n dm_1.dataSource.json = visualData;\n pageingDetails.result = dm_1.executeLocal(query);\n }\n this.parent.notify('updateAction', pageingDetails);\n };\n return Page;\n}());\nexport { Page };\n","import { Grid, Toolbar as tool } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { isNullOrUndefined } from '@syncfusion/ej2-base';\n/**\n * Toolbar Module for TreeGrid\n *\n * @hidden\n */\nvar Toolbar = /** @class */ (function () {\n function Toolbar(parent) {\n Grid.Inject(tool);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} - Returns Toolbar module name\n */\n Toolbar.prototype.getModuleName = function () {\n return 'toolbar';\n };\n /**\n * @hidden\n * @returns {void}\n */\n Toolbar.prototype.addEventListener = function () {\n this.parent.on(events.rowSelected, this.refreshToolbar, this);\n this.parent.on(events.rowDeselected, this.refreshToolbar, this);\n this.parent.on(events.toolbarClick, this.toolbarClickHandler, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n Toolbar.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.rowSelected, this.refreshToolbar);\n this.parent.off(events.rowDeselected, this.refreshToolbar);\n this.parent.off(events.toolbarClick, this.toolbarClickHandler);\n };\n Toolbar.prototype.refreshToolbar = function (args) {\n var tObj = this.parent;\n if (args.row.rowIndex === 0 || tObj.getSelectedRecords().length > 1) {\n this.enableItems([tObj.element.id + '_gridcontrol_indent', tObj.element.id + '_gridcontrol_outdent'], false);\n }\n else if (args['name'] !== 'rowDeselected') {\n if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex])) {\n if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex]) &&\n (tObj.getCurrentViewRecords()[args.row.rowIndex].level >\n tObj.getCurrentViewRecords()[args.row.rowIndex - 1].level)) {\n this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);\n }\n else {\n this.enableItems([tObj.element.id + '_gridcontrol_indent'], true);\n }\n if (tObj.getCurrentViewRecords()[args.row.rowIndex].level ===\n tObj.getCurrentViewRecords()[args.row.rowIndex - 1].level) {\n this.enableItems([tObj.element.id + '_gridcontrol_indent'], true);\n }\n if (tObj.getCurrentViewRecords()[args.row.rowIndex].level === 0) {\n this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);\n }\n if (tObj.getCurrentViewRecords()[args.row.rowIndex].level !== 0) {\n this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);\n }\n }\n }\n if (args['name'] === 'rowDeselected') {\n if (this.parent.toolbar['includes']('Indent')) {\n this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);\n }\n if (this.parent.toolbar['includes']('Outdent')) {\n this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);\n }\n }\n if (args.row.rowIndex === 0 && !isNullOrUndefined(args.data.parentItem)) {\n this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);\n }\n };\n Toolbar.prototype.toolbarClickHandler = function (args) {\n var tObj = this.parent;\n var action = 'action';\n if (this.parent.editSettings.mode === 'Cell' && this.parent.grid.editSettings.mode === 'Batch' &&\n args.item.id === this.parent.grid.element.id + '_update') {\n args.cancel = true;\n this.parent.grid.editModule.saveCell();\n }\n if (args.item.id === this.parent.grid.element.id + '_expandall') {\n this.parent.expandAll();\n }\n if (args.item.id === this.parent.grid.element.id + '_collapseall') {\n this.parent.collapseAll();\n }\n if (args.item.id === tObj.grid.element.id + '_indent' && tObj.getSelectedRecords().length) {\n var record = tObj.getCurrentViewRecords()[tObj.getSelectedRowIndexes()[0] - 1];\n var dropIndex = void 0;\n if (record.level > tObj.getSelectedRecords()[0].level) {\n for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {\n if (tObj.getCurrentViewRecords()[i].taskData === record.parentItem.taskData) {\n dropIndex = i;\n }\n }\n }\n else {\n dropIndex = tObj.getSelectedRowIndexes()[0] - 1;\n }\n this.parent[action] = 'indenting';\n this.eventTrigger('indenting', dropIndex);\n }\n if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length) {\n var dropIndex = void 0;\n var parentItem = tObj.getSelectedRecords()[0].parentItem;\n for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {\n if (tObj.getCurrentViewRecords()[i].taskData === parentItem.taskData) {\n dropIndex = i;\n }\n }\n this.parent[action] = 'outdenting';\n this.eventTrigger('outdenting', dropIndex);\n }\n };\n Toolbar.prototype.eventTrigger = function (action, dropIndex) {\n var _this = this;\n var selectedRecords = 'selectedRecords';\n var selectedRows = 'selectedRows';\n this.parent[selectedRows] = this.parent.getSelectedRows();\n this.parent[selectedRecords] = this.parent.getSelectedRecords();\n var actionArgs = {\n requestType: action,\n data: this.parent.getSelectedRecords(),\n row: this.parent.getSelectedRows(),\n cancel: false\n };\n this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {\n if (!actionArgs.cancel) {\n if (actionArgs.requestType === 'indenting') {\n _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'child');\n }\n else if (actionArgs.requestType === 'outdenting') {\n _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'below');\n }\n }\n });\n };\n /**\n * Gets the toolbar of the TreeGrid.\n *\n * @returns {Element} - Returns Toolbar element\n * @hidden\n */\n Toolbar.prototype.getToolbar = function () {\n return this.parent.grid.toolbarModule.getToolbar();\n };\n /**\n * Enables or disables ToolBar items.\n *\n * @param {string[]} items - Defines the collection of itemID of ToolBar items.\n * @param {boolean} isEnable - Defines the items to be enabled or disabled.\n * @returns {void}\n * @hidden\n */\n Toolbar.prototype.enableItems = function (items, isEnable) {\n this.parent.grid.toolbarModule.enableItems(items, isEnable);\n };\n /**\n * Destroys the ToolBar.\n *\n * @method destroy\n * @returns {void}\n */\n Toolbar.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Toolbar;\n}());\nexport { Toolbar };\n","import { Query, DataManager } from '@syncfusion/ej2-data';\nimport { getObject, calculateAggregate, Aggregate as GridAggregate, Grid, appendChildren } from '@syncfusion/ej2-grids';\nimport { findParentRecords } from '../utils';\nimport { isNullOrUndefined, setValue, createElement, extend } from '@syncfusion/ej2-base';\n/**\n * TreeGrid Aggregate module\n *\n * @hidden\n */\nvar Aggregate = /** @class */ (function () {\n /**\n * Constructor for Aggregate module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Aggregate(parent) {\n Grid.Inject(GridAggregate);\n this.parent = parent;\n this.flatChildRecords = [];\n this.summaryQuery = [];\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Summary module name\n */\n Aggregate.prototype.getModuleName = function () {\n return 'summary';\n };\n Aggregate.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n };\n /**\n * Function to calculate summary values\n *\n * @param {QueryOptions[]} summaryQuery - DataManager query for aggregate operations\n * @param {Object[]} filteredData - Filtered data collection\n * @param {boolean} isSort - Specified whether sorting operation performed\n * @hidden\n * @returns {Object[]} - return flat records with summary values\n */\n Aggregate.prototype.calculateSummaryValue = function (summaryQuery, filteredData, isSort) {\n this.summaryQuery = summaryQuery;\n var parentRecord;\n var parentDataLength = Object.keys(filteredData).length;\n var parentData = [];\n for (var p = 0, len = parentDataLength; p < len; p++) {\n var summaryRow = getObject('isSummaryRow', filteredData[p]);\n if (!summaryRow) {\n parentData.push(filteredData[p]);\n }\n }\n var parentRecords = findParentRecords(parentData);\n var flatRecords = parentData.slice();\n var summaryLength = Object.keys(this.parent.aggregates).length;\n var dataLength = Object.keys(parentRecords).length;\n var childRecordsLength;\n var columns = this.parent.getColumns();\n if (this.parent.aggregates.filter(function (x) { return x.showChildSummary; }).length) {\n for (var i = 0, len = dataLength; i < len; i++) {\n parentRecord = parentRecords[i];\n childRecordsLength = this.getChildRecordsLength(parentRecord, flatRecords);\n if (childRecordsLength) {\n var _loop_1 = function (summaryRowIndex, len_1) {\n var item = void 0;\n item = {};\n for (var i_1 = 0; i_1 < columns.length; i_1++) {\n var field = (isNullOrUndefined(getObject('field', columns[i_1]))) ?\n columns[i_1] : getObject('field', (columns[i_1]));\n item[field] = null;\n }\n item = this_1.createSummaryItem(item, this_1.parent.aggregates[summaryRowIndex - 1]);\n if (this_1.parent.aggregates[summaryRowIndex - 1].showChildSummary) {\n var idx_1;\n flatRecords.map(function (e, i) {\n if (e.uniqueID === parentRecord.uniqueID) {\n idx_1 = i;\n return;\n }\n });\n var currentIndex = idx_1 + childRecordsLength + summaryRowIndex;\n var summaryParent = extend({}, parentRecord);\n delete summaryParent.childRecords;\n delete summaryParent[this_1.parent.childMapping];\n setValue('parentItem', summaryParent, item);\n var level = getObject('level', summaryParent);\n setValue('level', level + 1, item);\n setValue('isSummaryRow', true, item);\n setValue('parentUniqueID', summaryParent.uniqueID, item);\n if (isSort) {\n var childRecords = getObject('childRecords', parentRecord);\n if (childRecords.length) {\n childRecords.push(item);\n }\n }\n flatRecords.splice(currentIndex, 0, item);\n }\n else {\n return \"continue\";\n }\n };\n var this_1 = this;\n for (var summaryRowIndex = 1, len_1 = summaryLength; summaryRowIndex <= len_1; summaryRowIndex++) {\n _loop_1(summaryRowIndex, len_1);\n }\n this.flatChildRecords = [];\n }\n }\n }\n else {\n var items = {};\n for (var columnIndex = 0, length_1 = columns.length; columnIndex < length_1; columnIndex++) {\n var fields = isNullOrUndefined(getObject('field', columns[columnIndex])) ?\n columns[columnIndex] : getObject('field', columns[columnIndex]);\n items[fields] = null;\n }\n for (var summaryRowIndex = 1, length_2 = summaryLength; summaryRowIndex <= length_2; summaryRowIndex++) {\n this.createSummaryItem(items, this.parent.aggregates[summaryRowIndex - 1]);\n }\n }\n return flatRecords;\n };\n Aggregate.prototype.getChildRecordsLength = function (parentData, flatData) {\n var recordLength = Object.keys(flatData).length;\n var record;\n for (var i = 0, len = recordLength; i < len; i++) {\n record = flatData[i];\n var parent_1 = isNullOrUndefined(record.parentItem) ? null :\n flatData.filter(function (e) { return e.uniqueID === record.parentItem.uniqueID; })[0];\n if (parentData === parent_1) {\n this.flatChildRecords.push(record);\n var hasChild = getObject('hasChildRecords', record);\n if (hasChild) {\n this.getChildRecordsLength(record, flatData);\n }\n else {\n continue;\n }\n }\n }\n return this.flatChildRecords.length;\n };\n Aggregate.prototype.createSummaryItem = function (itemData, summary) {\n var summaryColumnLength = Object.keys(summary.columns).length;\n for (var i = 0, len = summaryColumnLength; i < len; i++) {\n var displayColumn = isNullOrUndefined(summary.columns[i].columnName) ? summary.columns[i].field :\n summary.columns[i].columnName;\n var keys = Object.keys(itemData);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n if (key === displayColumn) {\n if (this.flatChildRecords.length) {\n itemData[key] = this.getSummaryValues(summary.columns[i], this.flatChildRecords);\n }\n else if (this.parent.isLocalData) {\n var data = this.parent.dataSource instanceof DataManager ? this.parent.dataSource.dataSource.json\n : this.parent.flatData;\n itemData[key] = this.getSummaryValues(summary.columns[i], data);\n }\n }\n else {\n continue;\n }\n }\n }\n return itemData;\n };\n Aggregate.prototype.getSummaryValues = function (summaryColumn, summaryData) {\n var qry = new Query();\n var single = {};\n var helper = {};\n var type = !isNullOrUndefined(summaryColumn.field) ?\n this.parent.getColumnByField(summaryColumn.field).type : undefined;\n summaryColumn.setPropertiesSilent({ format: this.getFormatFromType(summaryColumn.format, type) });\n summaryColumn.setFormatter(this.parent.grid.locale);\n var formatFn = summaryColumn.getFormatter() || (function () { return function (a) { return a; }; })();\n summaryColumn.setTemplate(helper);\n var tempObj = summaryColumn.getTemplate(2);\n qry.queries = this.summaryQuery;\n qry.requiresCount();\n var sumData = new DataManager(summaryData).executeLocal(qry);\n var types = summaryColumn.type;\n var summaryKey;\n types = [summaryColumn.type];\n for (var i = 0; i < types.length; i++) {\n summaryKey = types[i];\n var key = summaryColumn.field + ' - ' + types[i].toLowerCase();\n var val = types[i] !== 'Custom' ? getObject('aggregates', sumData) :\n calculateAggregate(types[i], sumData, summaryColumn, this.parent);\n var disp = summaryColumn.columnName;\n var value_1 = types[i] !== 'Custom' ? val[key] : val;\n single[disp] = single[disp] || {};\n single[disp][key] = value_1;\n single[disp][types[i]] = !isNullOrUndefined(val) ? formatFn(value_1) : ' ';\n }\n helper.format = summaryColumn.getFormatter();\n var cellElement = createElement('td', {\n className: 'e-summary'\n });\n if (this.parent.isReact) {\n var renderReactTemplates = 'renderReactTemplates';\n tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property, '', null, null, cellElement);\n this.parent[renderReactTemplates]();\n }\n else {\n appendChildren(cellElement, tempObj.fn(single[summaryColumn.columnName], this.parent, tempObj.property));\n }\n var value = single[summaryColumn.columnName][summaryKey];\n var summaryValue;\n if (cellElement.innerHTML.indexOf(value) === -1) {\n summaryValue = cellElement.innerHTML + value;\n return summaryValue;\n }\n else {\n return cellElement.innerHTML;\n }\n };\n Aggregate.prototype.getFormatFromType = function (summaryformat, type) {\n if (isNullOrUndefined(type) || typeof summaryformat !== 'string') {\n return summaryformat;\n }\n var obj;\n switch (type) {\n case 'number':\n obj = { format: summaryformat };\n break;\n case 'datetime':\n obj = { type: 'dateTime', skeleton: summaryformat };\n break;\n case 'date':\n obj = { type: type, skeleton: summaryformat };\n break;\n }\n return obj;\n };\n /**\n * To destroy the Aggregate module\n *\n * @returns {void}\n * @hidden\n */\n Aggregate.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Aggregate;\n}());\nexport { Aggregate };\n","import { isNullOrUndefined } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { Sort as GridSort, Grid, getActualProperties } from '@syncfusion/ej2-grids';\nimport { getParentData } from '../utils';\n/**\n * Internal dataoperations for TreeGrid\n *\n * @hidden\n */\nvar Sort = /** @class */ (function () {\n function Sort(grid) {\n Grid.Inject(GridSort);\n this.parent = grid;\n this.taskIds = [];\n this.flatSortedData = [];\n this.storedIndex = -1;\n this.isSelfReference = !isNullOrUndefined(this.parent.parentIdMapping);\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Sort module name\n */\n Sort.prototype.getModuleName = function () {\n return 'sort';\n };\n /**\n * @hidden\n */\n Sort.prototype.addEventListener = function () {\n this.parent.on('updateModel', this.updateModel, this);\n this.parent.on('createSort', this.createdSortedRecords, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n Sort.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('updateModel', this.updateModel);\n this.parent.off('createSort', this.createdSortedRecords);\n };\n Sort.prototype.createdSortedRecords = function (sortParams) {\n var data = sortParams.modifiedData;\n var srtQry = sortParams.srtQry;\n this.iterateSort(data, srtQry);\n this.storedIndex = -1;\n sortParams.modifiedData = this.flatSortedData;\n this.flatSortedData = [];\n };\n Sort.prototype.iterateSort = function (data, srtQry) {\n for (var d = 0; d < data.length; d++) {\n if (this.parent.grid.filterSettings.columns.length > 0 || this.parent.grid.searchSettings.key !== '') {\n if (!isNullOrUndefined(getParentData(this.parent, data[d].uniqueID, true))) {\n this.storedIndex++;\n this.flatSortedData[this.storedIndex] = data[d];\n }\n }\n else {\n this.storedIndex++;\n this.flatSortedData[this.storedIndex] = data[d];\n }\n if (data[d].hasChildRecords) {\n var childSort = (new DataManager(data[d].childRecords).executeLocal(srtQry));\n this.iterateSort(childSort, srtQry);\n }\n }\n };\n /**\n * Sorts a column with the given options.\n *\n * @param {string} columnName - Defines the column name to be sorted.\n * @param {SortDirection} direction - Defines the direction of sorting field.\n * @param {boolean} isMultiSort - Specifies whether the previous sorted columns are to be maintained.\n * @returns {void}\n */\n Sort.prototype.sortColumn = function (columnName, direction, isMultiSort) {\n this.parent.grid.sortColumn(columnName, direction, isMultiSort);\n };\n Sort.prototype.removeSortColumn = function (field) {\n this.parent.grid.removeSortColumn(field);\n };\n /**\n * The function used to update sortSettings of TreeGrid.\n *\n * @returns {void}\n * @hidden\n */\n Sort.prototype.updateModel = function () {\n this.parent.setProperties({ sortSettings: getActualProperties(this.parent.grid.sortSettings) }, true);\n };\n /**\n * Clears all the sorted columns of the TreeGrid.\n *\n * @returns {void}\n */\n Sort.prototype.clearSorting = function () {\n this.parent.grid.clearSorting();\n this.updateModel();\n };\n /**\n * Destroys the Sorting of TreeGrid.\n *\n * @function destroy\n * @returns {void}\n */\n Sort.prototype.destroy = function () {\n this.removeEventListener();\n };\n return Sort;\n}());\nexport { Sort };\n","import { Grid, ColumnMenu as GridColumnMenu } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid ColumnMenu module\n *\n * @hidden\n */\nvar ColumnMenu = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function ColumnMenu(parent) {\n Grid.Inject(GridColumnMenu);\n this.parent = parent;\n }\n ColumnMenu.prototype.getColumnMenu = function () {\n return this.parent.grid.columnMenuModule.getColumnMenu();\n };\n ColumnMenu.prototype.destroy = function () {\n //this.parent.grid.columnMenuModule.destroy();\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns ColumnMenu module name\n */\n ColumnMenu.prototype.getModuleName = function () {\n return 'columnMenu';\n };\n return ColumnMenu;\n}());\nexport { ColumnMenu };\n","import { Grid, ContextMenu as cmenu } from '@syncfusion/ej2-grids';\nimport { isNullOrUndefined, select } from '@syncfusion/ej2-base';\n/**\n * ContextMenu Module for TreeGrid\n *\n * @hidden\n */\nvar ContextMenu = /** @class */ (function () {\n function ContextMenu(parent) {\n Grid.Inject(cmenu);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * @hidden\n * @returns {void}\n */\n ContextMenu.prototype.addEventListener = function () {\n this.parent.on('contextMenuOpen', this.contextMenuOpen, this);\n this.parent.on('contextMenuClick', this.contextMenuClick, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n ContextMenu.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('contextMenuOpen', this.contextMenuOpen);\n this.parent.off('contextMenuClick', this.contextMenuClick);\n };\n ContextMenu.prototype.contextMenuOpen = function (args) {\n var addRow = select('#' + this.parent.element.id + '_gridcontrol_cmenu_AddRow', args.element);\n var editRecord = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Edit', args.element);\n if (addRow) {\n if (this.parent.grid.editSettings.allowAdding === false) {\n addRow.style.display = 'none';\n }\n else {\n addRow.style.display = 'block';\n }\n }\n if ((this.parent.editSettings.mode === 'Cell' || this.parent.editSettings.mode === 'Batch')\n && !(isNullOrUndefined(editRecord)) && !(editRecord.classList.contains('e-menu-hide'))) {\n editRecord.style.display = 'none';\n }\n };\n ContextMenu.prototype.contextMenuClick = function (args) {\n if (args.item.id === 'Above' || args.item.id === 'Below' || args.item.id === 'Child') {\n this.parent.notify('savePreviousRowPosition', args);\n this.parent.setProperties({ editSettings: { newRowPosition: args.item.id } }, true);\n this.parent.addRecord();\n }\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns ContextMenu module name\n */\n ContextMenu.prototype.getModuleName = function () {\n return 'contextMenu';\n };\n /**\n * Destroys the ContextMenu.\n *\n * @function destroy\n * @returns {void}\n */\n ContextMenu.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * Gets the context menu element from the TreeGrid.\n *\n * @returns {Element} Return Context Menu root element.\n */\n ContextMenu.prototype.getContextMenu = function () {\n return this.parent.grid.contextMenuModule.getContextMenu();\n };\n return ContextMenu;\n}());\nexport { ContextMenu };\n","import { isNullOrUndefined, extend, setValue, getValue, merge } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { findChildrenRecords, getParentData, extendArray } from '../utils';\nimport { getUid } from '@syncfusion/ej2-grids';\nimport { updateParentRow, editAction } from './crud-actions';\nimport { classList } from '@syncfusion/ej2-base';\n/**\n * `BatchEdit` module is used to handle batch editing actions.\n *\n * @hidden\n */\nvar BatchEdit = /** @class */ (function () {\n function BatchEdit(parent) {\n this.batchChildCount = 0;\n this.addedRecords = 'addedRecords';\n this.deletedRecords = 'deletedRecords';\n this.batchAddedRecords = [];\n this.batchDeletedRecords = [];\n this.batchAddRowRecord = [];\n this.parent = parent;\n this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);\n this.batchRecords = [];\n this.currentViewRecords = [];\n this.isAdd = false;\n this.addEventListener();\n }\n BatchEdit.prototype.addEventListener = function () {\n this.parent.on(events.cellSaved, this.cellSaved, this);\n this.parent.on(events.batchAdd, this.batchAdd, this);\n this.parent.on(events.beforeBatchAdd, this.beforeBatchAdd, this);\n this.parent.on(events.batchSave, this.batchSave, this);\n this.parent.on(events.beforeBatchDelete, this.beforeBatchDelete, this);\n this.parent.on(events.beforeBatchSave, this.beforeBatchSave, this);\n this.parent.on('batchPageAction', this.batchPageAction, this);\n this.parent.on('batchCancelAction', this.batchCancelAction, this);\n this.parent.grid.on('immutable-batch-cancel', this.immutableBatchAction, this);\n this.parent.grid.on('next-cell-index', this.nextCellIndex, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n BatchEdit.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.cellSaved, this.cellSaved);\n this.parent.off(events.batchAdd, this.batchAdd);\n this.parent.off(events.batchSave, this.batchSave);\n this.parent.off(events.beforeBatchAdd, this.beforeBatchAdd);\n this.parent.off(events.beforeBatchDelete, this.beforeBatchDelete);\n this.parent.off(events.beforeBatchSave, this.beforeBatchSave);\n this.parent.off('batchPageAction', this.batchPageAction);\n this.parent.off('batchCancelAction', this.batchCancelAction);\n this.parent.grid.off('immutable-batch-cancel', this.immutableBatchAction);\n this.parent.grid.off('next-cell-index', this.nextCellIndex);\n };\n /**\n * To destroy the editModule\n *\n * @returns {void}\n * @hidden\n */\n BatchEdit.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @hidden\n * @returns {Object[]} Returns modified records in batch editing.\n */\n BatchEdit.prototype.getBatchRecords = function () {\n return this.batchRecords;\n };\n /**\n * @hidden\n * @returns {number} Returns index of newly add row\n */\n BatchEdit.prototype.getAddRowIndex = function () {\n return this.addRowIndex;\n };\n /**\n * @hidden\n * @returns {number} Returns selected row index\n */\n BatchEdit.prototype.getSelectedIndex = function () {\n return this.selectedIndex;\n };\n /**\n * @hidden\n * @returns {number} Returns newly added child count\n */\n BatchEdit.prototype.getBatchChildCount = function () {\n return this.batchChildCount;\n };\n BatchEdit.prototype.batchPageAction = function () {\n var data = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var index;\n if (!isNullOrUndefined(this.batchAddedRecords) && this.batchAddedRecords.length) {\n for (var i = 0; i < this.batchAddedRecords.length; i++) {\n index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);\n data.splice(index, 1);\n }\n }\n this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.batchDeletedRecords = this.currentViewRecords = [];\n };\n BatchEdit.prototype.cellSaved = function (args) {\n var actualCellIndex = args.cell.cellIndex;\n var frozenCols = this.parent.frozenColumns || this.parent.getFrozenColumns();\n if (frozenCols && args.columnObject.index > frozenCols) {\n actualCellIndex = actualCellIndex + frozenCols;\n }\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n var colCount = this.parent.getFrozenLeftColumnsCount() + actualCellIndex;\n if (colCount === this.parent.treeColumnIndex) {\n this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,\n column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)\n });\n }\n }\n else if (actualCellIndex === this.parent.treeColumnIndex) {\n this.parent.renderModule.cellRender({ data: args.rowData, cell: args.cell,\n column: this.parent.grid.getColumnByIndex(args.cell.cellIndex)\n });\n }\n if (this.isAdd && this.parent.editSettings.mode === 'Batch' && this.parent.editSettings.newRowPosition !== 'Bottom') {\n var data = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n var added = void 0;\n var level = 'level';\n var primaryKey_1 = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var currentDataIndex = void 0;\n var indexvalue = void 0;\n var parentItem = 'parentItem';\n var uniqueID = 'uniqueID';\n var parentRecord = this.selectedIndex > -1 ? this.batchRecords[this.addRowIndex][parentItem] : null;\n var idMapping = void 0;\n var parentUniqueID = void 0;\n var parentIdMapping = void 0;\n var rowObjectIndex = this.parent.editSettings.newRowPosition === 'Top' || this.selectedIndex === -1 ? 0 :\n this.parent.editSettings.newRowPosition === 'Above' ? this.addRowIndex\n : this.addRowIndex + 1;\n rowObjectIndex = this.getActualRowObjectIndex(rowObjectIndex);\n if (this.newBatchRowAdded) {\n if (this.batchRecords.length) {\n idMapping = this.batchRecords[this.addRowIndex][this.parent.idMapping];\n parentIdMapping = this.batchRecords[this.addRowIndex][this.parent.parentIdMapping];\n if (this.batchRecords[this.addRowIndex][parentItem]) {\n parentUniqueID = this.batchRecords[this.addRowIndex][parentItem][uniqueID];\n }\n }\n this.batchAddedRecords = extendArray(this.batchAddedRecords);\n this.batchAddRowRecord = extendArray(this.batchAddRowRecord);\n this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]);\n added = this.parent.grid.getRowsObject()[rowObjectIndex].changes;\n added.uniqueID = getUid(this.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + added.uniqueID, added, this.parent);\n if (!Object.prototype.hasOwnProperty.call(added, 'level')) {\n this.batchIndex = this.selectedIndex === -1 ? 0 : this.batchIndex;\n if (this.parent.editSettings.newRowPosition === 'Child') {\n added.primaryParent = parentRecord;\n if (this.selectedIndex > -1) {\n added.parentItem = extend({}, this.batchRecords[this.addRowIndex]);\n added.parentUniqueID = added.parentItem.uniqueID;\n delete added.parentItem.childRecords;\n delete added.parentItem[this.parent.childMapping];\n added.level = added.parentItem.level + 1;\n added.index = this.batchIndex;\n var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length;\n var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1];\n record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record;\n currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);\n if (this.isSelfReference) {\n added[this.parent.parentIdMapping] = idMapping;\n }\n updateParentRow(primaryKey_1, added.parentItem, 'add', this.parent, this.isSelfReference, added);\n }\n }\n else if ((this.parent.editSettings.newRowPosition === 'Above' || this.parent.editSettings.newRowPosition === 'Below')\n && !isNullOrUndefined(this.batchRecords[this.addRowIndex])) {\n added.level = this.batchRecords[this.addRowIndex][level];\n if (added.level && this.selectedIndex > -1) {\n added.parentItem = parentRecord;\n added.parentUniqueID = parentUniqueID;\n delete added.parentItem.childRecords;\n delete added.parentItem[this.parent.childMapping];\n }\n added.index = this.parent.editSettings.newRowPosition === 'Below' ? this.batchIndex : this.batchIndex - 1;\n if (this.parent.editSettings.newRowPosition === 'Below' && this.selectedIndex > -1) {\n var childRecordCount = findChildrenRecords(this.batchRecords[this.addRowIndex]).length;\n var record = findChildrenRecords(this.batchRecords[this.addRowIndex])[childRecordCount - 1];\n record = isNullOrUndefined(record) ? this.batchRecords[this.addRowIndex] : record;\n currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);\n }\n if (this.parent.editSettings.newRowPosition === 'Above' && this.selectedIndex > -1) {\n var record = this.batchRecords[this.addRowIndex];\n currentDataIndex = data.map(function (e) { return e[primaryKey_1]; }).indexOf(record[primaryKey_1]);\n }\n if (this.isSelfReference) {\n added[this.parent.parentIdMapping] = parentIdMapping;\n }\n }\n added.index = added.index === -1 ? 0 : added.index;\n added.hasChildRecords = false;\n added.childRecords = [];\n this.batchRecords.splice(added.index, 0, added);\n this.currentViewRecords.splice(added.index, 0, added);\n if (currentDataIndex) {\n indexvalue = currentDataIndex;\n }\n else {\n indexvalue = added.index;\n }\n if (this.parent.editSettings.newRowPosition !== 'Above') {\n indexvalue = added.index === 0 ? indexvalue : indexvalue + 1;\n }\n data.splice(indexvalue, 0, added);\n this.batchAddedRecords.push(added);\n }\n this.parent.grid.getRowsObject()[rowObjectIndex].data = added;\n this.newBatchRowAdded = false;\n }\n if (this.parent.frozenColumns || this.parent.getFrozenColumns()\n && this.parent.grid.getRowsObject()[rowObjectIndex].edit === 'add') {\n merge(this.currentViewRecords[rowObjectIndex], this.parent.grid.getRowsObject()[rowObjectIndex].changes);\n }\n }\n };\n BatchEdit.prototype.beforeBatchAdd = function (e) {\n var isTabLastRow = 'isTabLastRow';\n if (this.parent.editSettings.mode === 'Cell' && this.parent.editModule[isTabLastRow]) {\n e.cancel = true;\n this.parent.editModule[isTabLastRow] = false;\n return;\n }\n if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && this.parent.grid.selectedRowIndex === -1) {\n this.selectedIndex = this.parent.editModule['selectedIndex'];\n this.addRowIndex = this.parent.editModule['addRowIndex'];\n this.addRowRecord = this.parent.getCurrentViewRecords()[this.selectedIndex];\n }\n else {\n this.selectedIndex = this.parent.grid.selectedRowIndex;\n this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;\n this.parent.editModule['addRowIndex'] = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;\n this.addRowRecord = this.parent.getSelectedRecords()[0];\n }\n };\n BatchEdit.prototype.batchAdd = function (e) {\n if (this.parent.editSettings.newRowPosition !== 'Bottom') {\n this.isAdd = true;\n this.newBatchRowAdded = true;\n var actualIndex = 0;\n if (!this.batchRecords.length) {\n this.batchAddedRecords = [];\n this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n }\n if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex'])) {\n classList(this.parent.grid.getDataRows()[0], ['e-batchrow'], []);\n }\n if (this.parent.editSettings.newRowPosition !== 'Top') {\n var records = this.parent.grid.getCurrentViewRecords();\n if (this.parent.editSettings.mode === 'Batch' && (this.parent.getBatchChanges()[this.addedRecords].length > 1\n || this.parent.getBatchChanges()[this.deletedRecords].length)) {\n records = this.batchRecords;\n }\n this.updateChildCount(records);\n this.parent.notify(events.beginAdd, {});\n this.batchChildCount = 0;\n }\n this.updateRowIndex();\n // update focus module, need to refix this once grid source modified.\n var focusModule = getValue('focusModule', this.parent.grid);\n var table = this.parent.getContentTable();\n if (this.parent.getBatchChanges()[this.deletedRecords].length && this.parent.editSettings.newRowPosition === 'Above') {\n actualIndex = e.row.rowIndex;\n focusModule.getContent().matrix.matrix = this.matrix;\n }\n else {\n actualIndex = table.getElementsByClassName('e-batchrow')[0].rowIndex;\n // if (this.parent.frozenRows || this.parent.frozenColumns) {\n // actualIndex = this.batchIndex;\n // }\n }\n focusModule.getContent().matrix.current = [actualIndex, focusModule.getContent().matrix.current[1]];\n }\n };\n BatchEdit.prototype.beforeBatchDelete = function (args) {\n if (!this.batchRecords.length) {\n this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n }\n var focusModule = getValue('focusModule', this.parent.grid);\n this.matrix = focusModule.getContent().matrix.matrix;\n var row = [];\n var records = [];\n var primarykey = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var data;\n var childs;\n var uid;\n if (!isNullOrUndefined(args.row) && this.parent.getSelectedRows().indexOf(args.row) === -1) {\n data = args.rowData;\n childs = findChildrenRecords(data);\n uid = args.row.getAttribute('data-uid');\n }\n else {\n data = this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length - 1];\n childs = findChildrenRecords(data);\n uid = this.parent.getSelectedRows()[0].getAttribute('data-uid');\n }\n var parentRowIndex = parseInt(this.parent.grid.getRowElementByUID(uid).getAttribute('aria-rowindex'), 10);\n if (childs.length) {\n var totalCount = parentRowIndex + childs.length;\n var firstChildIndex = parentRowIndex + 1;\n for (var i = firstChildIndex; i <= totalCount; i++) {\n row.push(this.parent.grid.getDataRows()[i]);\n if (this.parent.frozenRows || this.parent.frozenColumns || this.parent.getFrozenColumns()) {\n row.push(this.parent.grid.getMovableRows()[i]);\n }\n }\n }\n if (!isNullOrUndefined(data.parentItem)) {\n var parentItem = getParentData(this.parent, data.parentItem.uniqueID);\n if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {\n var childIndex = parentItem.childRecords.indexOf(data);\n parentItem.childRecords.splice(childIndex, 1);\n }\n this.batchDeletedRecords = extendArray(this.batchDeletedRecords);\n this.batchDeletedRecords.push(data);\n }\n childs.push(data);\n records = childs;\n for (var i = 0; i < records.length; i++) {\n var indexvalue = this.batchRecords.map(function (e) { return e[primarykey]; }).indexOf(records[i][primarykey]);\n if (indexvalue !== -1) {\n this.batchRecords.splice(indexvalue, 1);\n }\n }\n for (var i = 0; i < row.length; i++) {\n if (!isNullOrUndefined(row[i])) {\n this.parent.grid.selectionModule.selectedRecords.push(row[i]);\n }\n }\n };\n BatchEdit.prototype.updateRowIndex = function () {\n var rows = this.parent.grid.getDataRows();\n for (var i = 0; i < rows.length; i++) {\n rows[i].setAttribute('aria-rowindex', i.toString());\n }\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {\n var mRows = this.parent.grid.getMovableDataRows();\n var freezeRightRows = this.parent.grid.getFrozenRightDataRows();\n for (var i = 0; i < mRows.length; i++) {\n mRows[i].setAttribute('aria-rowindex', i.toString());\n if (freeze) {\n freezeRightRows[i].setAttribute('aria-rowindex', i.toString());\n }\n }\n }\n };\n BatchEdit.prototype.updateChildCount = function (records) {\n var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var addedRecords = 'addedRecords';\n var parentItem = this.parent.editSettings.newRowPosition === 'Child' ? 'primaryParent' : 'parentItem';\n for (var i = 0; i < this.parent.getBatchChanges()[addedRecords].length; i++) {\n if (!isNullOrUndefined(this.parent.getBatchChanges()[addedRecords][i][parentItem])) {\n if (this.parent.getBatchChanges()[addedRecords][i][parentItem][primaryKey] === records[this.addRowIndex][primaryKey]) {\n this.batchChildCount = this.batchChildCount + 1;\n }\n }\n }\n };\n BatchEdit.prototype.beforeBatchSave = function (e) {\n var changeRecords = 'changedRecords';\n var deleterecords = 'deletedRecords';\n var changedRecords = e.batchChanges[changeRecords];\n if (e.batchChanges[changeRecords].length) {\n var columnName = void 0;\n for (var i = 0; i < changedRecords.length; i++) {\n editAction({ value: changedRecords[i], action: 'edit' }, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, columnName);\n }\n }\n if (e.batchChanges[deleterecords].length) {\n var deletedRecords = e.batchChanges[deleterecords];\n var record = deletedRecords;\n for (var i = 0; i < record.length; i++) {\n this.deleteUniqueID(record[i].uniqueID);\n var childs = findChildrenRecords(record[i]);\n for (var c = 0; c < childs.length; c++) {\n this.deleteUniqueID(childs[c].uniqueID);\n }\n e.batchChanges[deleterecords] = e.batchChanges[deleterecords].concat(childs);\n }\n }\n this.isAdd = false;\n };\n BatchEdit.prototype.deleteUniqueID = function (value) {\n var idFilter = 'uniqueIDFilterCollection';\n delete this.parent[idFilter][value];\n var id = 'uniqueIDCollection';\n delete this.parent[id][value];\n };\n BatchEdit.prototype.batchCancelAction = function () {\n var targetElement = 'targetElement';\n var index;\n var parentItem = 'parentItem';\n var indexvalue = 'index';\n var currentViewRecords = this.parent.grid.getCurrentViewRecords();\n var childRecords = 'childRecords';\n var data = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n var primaryKey = this.parent.grid.getPrimaryKeyFieldNames()[0];\n if (!isNullOrUndefined(this.batchAddedRecords)) {\n for (var i = 0; i < this.batchAddedRecords.length; i++) {\n index = data.map(function (e) { return e[primaryKey]; }).indexOf(this.batchAddedRecords[i][primaryKey]);\n data.splice(index, 1);\n if (this.parent.editSettings.newRowPosition === 'Child') {\n index = currentViewRecords.map(function (e) { return e[primaryKey]; })\n .indexOf(this.batchAddedRecords[i][parentItem] ? this.batchAddedRecords[i][parentItem][primaryKey]\n : this.batchAddedRecords[i][primaryKey]);\n if (!isNullOrUndefined(currentViewRecords[index])) {\n var children = currentViewRecords[index][childRecords];\n for (var j = 0; children && j < children.length; j++) {\n if (children[j][primaryKey] === this.batchAddedRecords[i][primaryKey]) {\n currentViewRecords[index][childRecords].splice(j, 1);\n }\n }\n }\n }\n }\n }\n if (!isNullOrUndefined(this.parent[targetElement])) {\n var row = this.parent[targetElement].closest('tr');\n this.parent.collapseRow(row);\n this.parent[targetElement] = null;\n }\n if (!isNullOrUndefined(this.batchDeletedRecords)) {\n for (var i = 0; i < this.batchDeletedRecords.length; i++) {\n if (!isNullOrUndefined(this.batchDeletedRecords[i][parentItem])) {\n index = currentViewRecords.map(function (e) { return e[primaryKey]; })\n .indexOf(this.batchDeletedRecords[i][parentItem][primaryKey]);\n var positionIndex = this.batchDeletedRecords[i][indexvalue] === 0 ? this.batchDeletedRecords[i][indexvalue] :\n this.batchDeletedRecords[i][indexvalue] - 1;\n if (!isNullOrUndefined(currentViewRecords[index])) {\n currentViewRecords[index][childRecords].splice(positionIndex, 0, this.batchDeletedRecords[i]);\n }\n }\n }\n }\n this.batchAddedRecords = this.batchRecords = this.batchAddRowRecord = this.currentViewRecords = [];\n this.batchRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n this.batchIndex = 0;\n this.currentViewRecords = extendArray(this.parent.grid.getCurrentViewRecords());\n this.batchDeletedRecords = [];\n this.parent.grid.renderModule.refresh();\n };\n BatchEdit.prototype.batchSave = function (args) {\n if (this.parent.editSettings.mode === 'Batch') {\n var i = void 0;\n var batchChanges = Object.hasOwnProperty.call(args, 'updatedRecords') ? args.updatedRecords : this.parent.getBatchChanges();\n var deletedRecords = 'deletedRecords';\n var addedRecords = 'addedRecords';\n var index = 'index';\n var uniqueID = 'uniqueID';\n var data = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n var currentViewRecords = this.parent.grid.getCurrentViewRecords();\n var primarykey_1 = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var level = 'level';\n var addRecords = batchChanges[addedRecords];\n var parentItem = 'parentItem';\n var selectedIndex = void 0;\n var addRowIndex = void 0;\n var columnName = void 0;\n var addRowRecord = void 0;\n var childRecords = 'childRecords';\n if (addRecords.length > 1 && this.parent.editSettings.newRowPosition !== 'Bottom') {\n addRecords.reverse();\n }\n if (this.parent.editSettings.newRowPosition !== 'Bottom' && !Object.hasOwnProperty.call(args, 'updatedRecords')) {\n data.splice(data.length - addRecords.length, addRecords.length);\n if (this.parent.editModule['isAddedRowByMethod'] && addRecords.length && !isNullOrUndefined(this.parent.editModule['addRowIndex'])) {\n var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[0].ariaRowIndex);\n data.splice(index_1, 0, addRecords[0]);\n }\n if (!this.parent.allowPaging && data.length !== currentViewRecords.length) {\n if (currentViewRecords.length > addRecords.length) {\n currentViewRecords.splice(currentViewRecords.length - addRecords.length, addRecords.length);\n }\n }\n else {\n var totalRecords = extendArray(data);\n if (totalRecords.length) {\n var startIndex = totalRecords.map(function (e) { return e[primarykey_1]; })\n .indexOf(currentViewRecords[0][primarykey_1]);\n var endIndex = startIndex + this.parent.grid.pageSettings.pageSize;\n currentViewRecords = totalRecords.splice(startIndex, endIndex);\n }\n }\n }\n if (this.batchAddRowRecord.length === 0) {\n this.batchAddRowRecord.push(this.parent.flatData[args.index]);\n }\n for (i = 0; i < addRecords.length; i++) {\n var taskData = extend({}, addRecords[i]);\n delete taskData.parentItem;\n delete taskData.uniqueID;\n delete taskData.index;\n delete taskData.level;\n delete taskData.hasChildRecords;\n delete taskData.childRecords;\n delete taskData.parentUniqueID;\n if (!isNullOrUndefined(taskData.primaryParent)) {\n delete taskData.primaryParent;\n }\n addRecords[i].taskData = taskData;\n addRowRecord = this.batchAddRowRecord[i];\n if (isNullOrUndefined(addRowRecord)) {\n addRowRecord = this.batchAddRowRecord[i - 1];\n }\n if (this.isSelfReference) {\n if (!isNullOrUndefined(addRecords[i].parentItem)) {\n updateParentRow(primarykey_1, addRecords[i].parentItem, 'add', this.parent, this.isSelfReference, addRecords[i]);\n }\n }\n if (!isNullOrUndefined(addRowRecord)) {\n addRowIndex = addRowRecord.index;\n }\n if (this.parent.editSettings.newRowPosition !== 'Top' && this.parent.editSettings.newRowPosition !== 'Bottom') {\n if (isNullOrUndefined(addRecords[i].parentItem) && this.selectedIndex === -1) {\n selectedIndex = -1;\n addRowRecord = null;\n }\n }\n editAction({ value: addRecords[i], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);\n selectedIndex = null;\n if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[i][parentItem]) &&\n (isNullOrUndefined(this.parent.editModule['addRowIndex']) || this.isSelfReference)) {\n var indexValue = currentViewRecords.map(function (e) { return e[primarykey_1]; })\n .indexOf(addRecords[i][parentItem][primarykey_1]);\n var children = currentViewRecords[indexValue][childRecords];\n for (var j = 0; j < children.length; j++) {\n if (children[j][primarykey_1] === addRecords[i][primarykey_1]) {\n currentViewRecords[indexValue][childRecords].splice(j, 1);\n }\n }\n }\n }\n if (batchChanges[deletedRecords].length) {\n for (i = 0; i < batchChanges[deletedRecords].length; i++) {\n editAction({ value: batchChanges[deletedRecords][i], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);\n }\n }\n this.parent.parentData = [];\n for (var i_1 = 0; i_1 < data.length; i_1++) {\n data[i_1][index] = i_1;\n setValue('uniqueIDCollection.' + data[i_1][uniqueID] + '.index', i_1, this.parent);\n if (!data[i_1][level]) {\n this.parent.parentData.push(data[i_1]);\n }\n }\n }\n this.batchAddRowRecord = this.batchAddedRecords = this.batchRecords = this.batchDeletedRecords = this.currentViewRecords = [];\n };\n BatchEdit.prototype.getActualRowObjectIndex = function (index) {\n var rows = this.parent.grid.getDataRows();\n if ((this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child')\n && this.selectedIndex > -1) {\n if (!isNullOrUndefined(this.batchRecords[this.addRowIndex]) && this.batchRecords[this.addRowIndex].expanded) {\n if (this.parent.getBatchChanges()[this.addedRecords].length > 1\n || this.parent.getBatchChanges()[this.deletedRecords].length) {\n index += findChildrenRecords(this.batchRecords[this.addRowIndex]).length;\n if (this.parent.editSettings.newRowPosition !== 'Child') {\n var batchChildCount = this.getBatchChildCount();\n index = index + batchChildCount;\n }\n }\n else {\n index += findChildrenRecords(this.batchRecords[this.addRowIndex]).length;\n }\n }\n if (index >= rows.length) {\n index = rows.length - 1;\n }\n this.updateChildCount(this.parent.grid.getCurrentViewRecords());\n if (this.batchChildCount) {\n index += this.batchChildCount;\n }\n this.batchChildCount = 0;\n }\n return index;\n };\n BatchEdit.prototype.immutableBatchAction = function (e) {\n e.args.cancel = true;\n var changes = this.parent.grid.getBatchChanges();\n var addedRecords = [];\n var index = 'index';\n if (Object.keys(changes).length) {\n addedRecords = changes.addedRecords;\n }\n for (var i = 0; i < addedRecords.length; i++) {\n e.rows.splice(addedRecords[i][index], 1);\n }\n };\n BatchEdit.prototype.nextCellIndex = function (args) {\n var index = 'index';\n var rowIndex = 'rowIndex';\n args[index] = this.parent.getSelectedRows()[0][rowIndex];\n };\n return BatchEdit;\n}());\nexport { BatchEdit };\n","import { Grid, Edit as GridEdit, getUid, getObject, resetRowIndex } from '@syncfusion/ej2-grids';\nimport { parentsUntil } from '@syncfusion/ej2-grids';\nimport * as events from '../base/constant';\nimport { isNullOrUndefined, extend, setValue, removeClass, addClass, getValue } from '@syncfusion/ej2-base';\nimport { DataManager, RemoteSaveAdaptor } from '@syncfusion/ej2-data';\nimport { findChildrenRecords, getParentData, isCountRequired, isRemoteData } from '../utils';\nimport { editAction, updateParentRow } from './crud-actions';\nimport { BatchEdit } from './batch-edit';\n/**\n * TreeGrid Edit Module\n * The `Edit` module is used to handle editing actions.\n */\nvar Edit = /** @class */ (function () {\n /**\n * Constructor for Edit module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Edit(parent) {\n this.addedRecords = 'addedRecords';\n this.deletedRecords = 'deletedRecords';\n this.prevAriaRowIndex = '-1';\n this.isAddedRowByMethod = false;\n Grid.Inject(GridEdit);\n this.parent = parent;\n this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);\n this.previousNewRowPosition = null;\n this.internalProperties = {};\n this.batchEditModule = new BatchEdit(this.parent);\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Edit module name\n */\n Edit.prototype.getModuleName = function () {\n return 'edit';\n };\n /**\n * @hidden\n * @returns {void}\n */\n Edit.prototype.addEventListener = function () {\n this.parent.on(events.crudAction, this.crudAction, this);\n this.parent.on(events.beginEdit, this.beginEdit, this);\n this.parent.on(events.beginAdd, this.beginAdd, this);\n this.parent.on(events.recordDoubleClick, this.recordDoubleClick, this);\n this.parent.on(events.cellSave, this.cellSave, this);\n this.parent.on(events.batchCancel, this.batchCancel, this);\n this.parent.grid.on(events.keyPressed, this.keyPressed, this);\n this.parent.grid.on('batchedit-form', this.lastCellTab, this);\n this.parent.grid.on('content-ready', this.contentready, this);\n this.parent.on(events.cellEdit, this.cellEdit, this);\n this.parent.on('actionBegin', this.editActionEvents, this);\n this.parent.on('actionComplete', this.editActionEvents, this);\n this.parent.grid.on(events.doubleTap, this.recordDoubleClick, this);\n this.parent.grid.on('dblclick', this.gridDblClick, this);\n this.parent.grid.on('recordAdded', this.customCellSave, this);\n this.parent.on('savePreviousRowPosition', this.savePreviousRowPosition, this);\n // this.parent.on(events.beforeDataBound, this.beforeDataBound, this);\n this.parent.grid.on(events.beforeStartEdit, this.beforeStartEdit, this);\n this.parent.grid.on(events.beforeBatchCancel, this.beforeBatchCancel, this);\n this.parent.grid.on('reset-edit-props', this.resetIsOnBatch, this);\n this.parent.grid.on('get-row-position', this.getRowPosition, this);\n };\n Edit.prototype.gridDblClick = function (e) {\n this.doubleClickTarget = e.target;\n };\n Edit.prototype.getRowPosition = function (addArgs) {\n addArgs.newRowPosition = this.parent.editSettings.newRowPosition;\n addArgs.addRowIndex = this.addRowIndex;\n addArgs.ariaRowIndex = +this.prevAriaRowIndex;\n };\n Edit.prototype.beforeStartEdit = function (args) {\n this.parent.trigger(events.actionBegin, args);\n };\n Edit.prototype.beforeBatchCancel = function (args) {\n if (this.parent.editSettings.mode === 'Cell') {\n this.parent.trigger(events.actionComplete, args);\n }\n };\n /**\n * @hidden\n * @returns {void}\n */\n Edit.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.crudAction, this.crudAction);\n this.parent.off(events.beginEdit, this.beginEdit);\n this.parent.off(events.beginAdd, this.beginAdd);\n this.parent.off(events.recordDoubleClick, this.recordDoubleClick);\n this.parent.off(events.batchCancel, this.batchCancel);\n this.parent.grid.off(events.keyPressed, this.keyPressed);\n this.parent.grid.off('batchedit-form', this.lastCellTab);\n this.parent.grid.off('content-ready', this.contentready);\n this.parent.off(events.cellEdit, this.cellEdit);\n this.parent.off('actionBegin', this.editActionEvents);\n this.parent.off('actionComplete', this.editActionEvents);\n this.parent.grid.off('recordAdded', this.customCellSave);\n this.parent.grid.off(events.doubleTap, this.recordDoubleClick);\n this.parent.off('savePreviousRowPosition', this.savePreviousRowPosition);\n this.parent.grid.off(events.beforeStartEdit, this.beforeStartEdit);\n this.parent.grid.off(events.beforeBatchCancel, this.beforeBatchCancel);\n this.parent.grid.off('dblclick', this.gridDblClick);\n this.parent.grid.off('reset-edit-props', this.resetIsOnBatch);\n this.parent.grid.off('get-row-position', this.getRowPosition);\n //this.parent.grid.off('click', this.gridSingleClick);\n };\n /**\n * To destroy the editModule\n *\n * @returns {void}\n * @hidden\n */\n Edit.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * @param {Column[]} cols - Column property Collection\n * @hidden\n * @returns {void}\n */\n Edit.prototype.applyFormValidation = function (cols) {\n this.parent.grid.editModule.applyFormValidation(cols);\n };\n Edit.prototype.editActionEvents = function (args) {\n var eventArgs = getObject('editAction', args);\n var eventName = getObject('name', eventArgs);\n var treeObj = this.parent;\n var adaptor = treeObj.dataSource.adaptor;\n if ((isRemoteData(treeObj) || adaptor instanceof RemoteSaveAdaptor) &&\n (eventArgs.requestType === 'save' && eventArgs.action === 'add') &&\n (treeObj.editSettings.newRowPosition === 'Child' || treeObj.editSettings.newRowPosition === 'Below'\n || treeObj.editSettings.newRowPosition === 'Above')) {\n if (eventName === 'actionBegin') {\n var rowIndex = isNullOrUndefined(eventArgs.row) || !Object.keys(eventArgs.row).length ? this.selectedIndex :\n eventArgs.row.rowIndex - 1;\n var keyData = (!isNullOrUndefined(rowIndex) && rowIndex !== -1) ?\n treeObj.getCurrentViewRecords()[rowIndex][treeObj.getPrimaryKeyFieldNames()[0]] : -1;\n treeObj.grid.query.addParams('relationalKey', keyData);\n }\n else if (eventName === 'actionComplete') {\n var paramsLength = treeObj.grid.query.params.length;\n for (var i = 0; i < paramsLength; i++) {\n if (treeObj.grid.query.params[i].key === 'relationalKey') {\n treeObj.grid.query.params.splice(i);\n }\n }\n }\n }\n if (this.parent.enableInfiniteScrolling && eventName === 'actionComplete') {\n this.infiniteAddAction(eventArgs);\n }\n if (this.parent.editSettings.mode === 'Batch' && eventArgs.requestType === 'paging') {\n this.parent.notify('batchPageAction', {});\n }\n };\n Edit.prototype.infiniteAddAction = function (args) {\n if ((args.requestType === 'save' && args.action === 'add') || args.requestType === 'delete') {\n if (this.parent.editSettings.newRowPosition !== 'Top' && this.selectedIndex !== -1\n && (args.requestType === 'save' && args.action === 'add')) {\n var rowObjects = this.parent.grid.getRowsObject();\n var newRowObject = rowObjects.splice(0, 1)[0];\n var newRowObjectIndex = this.addRowIndex;\n var currentData = this.parent.getCurrentViewRecords();\n if (this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {\n newRowObjectIndex += findChildrenRecords(currentData[newRowObjectIndex + 1]).length;\n }\n newRowObjectIndex = this.parent.editSettings.newRowPosition === 'Below' ? newRowObjectIndex + 1 : newRowObjectIndex;\n rowObjects.splice(newRowObjectIndex, 0, newRowObject);\n var newRecord = currentData.splice(0, 1)[0];\n currentData.splice(newRowObjectIndex, 0, newRecord);\n this.updateInfiniteCurrentViewData(newRecord, this.addRowIndex);\n }\n var movableRows = this.parent.grid.getMovableRows();\n var movableRowsObject = this.parent.grid.getMovableRowsObject();\n var isCache = this.parent.infiniteScrollSettings.enableCache;\n if (!isCache) {\n resetRowIndex(this.parent.grid, this.parent.grid.getRowsObject(), this.parent.grid.getRows(), 0);\n this.updateIndex(this.parent.grid.dataSource, this.parent.getRows(), this.parent.getCurrentViewRecords());\n }\n if (!isCache && this.parent.getFrozenColumns() > 0) {\n resetRowIndex(this.parent.grid, movableRowsObject, movableRows, 0);\n this.updateIndex(this.parent.grid.dataSource, movableRows, this.parent.getCurrentViewRecords());\n }\n }\n };\n Edit.prototype.updateInfiniteCurrentViewData = function (newRecord, newRowIndex) {\n var _this = this;\n var infiniteData = 'infiniteCurrentViewData';\n var updateCurrentViewData = 'updateCurrentViewData';\n var size = Math.ceil(newRowIndex / this.parent.grid.pageSettings.pageSize);\n var page = size > 0 ? size : 1;\n var dataIndex = newRowIndex - ((page - 1) * this.parent.pageSettings.pageSize);\n var infiniteCurrentViewData = this.parent.grid.infiniteScrollModule[infiniteData];\n infiniteCurrentViewData[1].splice(0, 1);\n var data = infiniteCurrentViewData[page];\n if (!isNullOrUndefined(this.addRowRecord)) {\n data.filter(function (e, index) {\n if (e.uniqueID === _this.addRowRecord.uniqueID) {\n dataIndex = index;\n }\n });\n if (this.addRowRecord.hasChildRecords && this.addRowRecord.childRecords.length &&\n this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {\n dataIndex += findChildrenRecords(this.addRowRecord).length;\n }\n }\n if (dataIndex >= this.parent.pageSettings.pageSize) {\n page += 1;\n data = infiniteCurrentViewData[page];\n dataIndex = dataIndex - this.parent.pageSettings.pageSize >= 0 ? dataIndex - this.parent.pageSettings.pageSize : 0;\n }\n dataIndex = this.parent.editSettings.newRowPosition === 'Below' ? dataIndex + 1 : dataIndex;\n data.splice(dataIndex, 0, newRecord);\n this.parent.grid.infiniteScrollModule[updateCurrentViewData]();\n };\n Edit.prototype.recordDoubleClick = function (args) {\n var target = args.target;\n if (isNullOrUndefined(target.closest('td.e-rowcell'))) {\n return;\n }\n if (!(this.parent.grid.editSettings.allowEditing) || this.parent.grid.isEdit) {\n return;\n }\n var column = this.parent.grid.getColumnByIndex(+target.closest('td.e-rowcell').getAttribute('aria-colindex'));\n if (this.parent.editSettings.mode === 'Cell' && !this.isOnBatch && column && !column.isPrimaryKey &&\n this.parent.editSettings.allowEditing && column.allowEditing && !(target.classList.contains('e-treegridexpand') ||\n target.classList.contains('e-treegridcollapse')) && this.parent.editSettings.allowEditOnDblClick) {\n this.isOnBatch = true;\n this.parent.grid.setProperties({ selectedRowIndex: args.rowIndex }, true);\n if (this.parent.enableVirtualization) {\n var tr = parentsUntil(args.target, 'e-row');\n this.prevAriaRowIndex = tr.getAttribute('aria-rowindex');\n tr.setAttribute('aria-rowindex', tr.rowIndex + '');\n }\n this.updateGridEditMode('Batch');\n }\n };\n Edit.prototype.updateGridEditMode = function (mode) {\n this.parent.grid.setProperties({ editSettings: { mode: mode } }, true);\n var updateMethod = getObject('updateEditObj', this.parent.grid.editModule);\n updateMethod.apply(this.parent.grid.editModule);\n this.parent.grid.isEdit = false;\n };\n Edit.prototype.resetIsOnBatch = function () {\n if (this.parent.enableVirtualization && this.parent.editSettings.mode === 'Cell') {\n this.isOnBatch = false;\n this.updateGridEditMode('Normal');\n }\n };\n Edit.prototype.keyPressed = function (args) {\n if (this.isOnBatch) {\n this.keyPress = args.action;\n }\n if (args.action === 'f2') {\n this.recordDoubleClick(args);\n }\n if (args.action === 'escape') {\n this.parent.closeEdit();\n }\n };\n Edit.prototype.deleteUniqueID = function (value) {\n var idFilter = 'uniqueIDFilterCollection';\n delete this.parent[idFilter][value];\n var id = 'uniqueIDCollection';\n delete this.parent[id][value];\n };\n Edit.prototype.cellEdit = function (args) {\n var _this = this;\n var promise = 'promise';\n var prom = args[promise];\n delete args[promise];\n if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {\n args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);\n this.prevAriaRowIndex = undefined;\n }\n if (this.keyPress !== 'enter') {\n this.parent.trigger(events.cellEdit, args, function (celleditArgs) {\n if (!celleditArgs.cancel && _this.parent.editSettings.mode === 'Cell') {\n _this.enableToolbarItems('edit');\n }\n else if (celleditArgs.cancel && _this.parent.editSettings.mode === 'Cell') {\n _this.isOnBatch = false;\n _this.updateGridEditMode('Normal');\n }\n if (!isNullOrUndefined(prom)) {\n prom.resolve(celleditArgs);\n }\n });\n }\n if (this.doubleClickTarget && (this.doubleClickTarget.classList.contains('e-treegridexpand') ||\n this.doubleClickTarget.classList.contains('e-treegridcollapse') || this.doubleClickTarget.classList.contains('e-summarycell'))) {\n args.cancel = true;\n this.doubleClickTarget = null;\n return;\n }\n if (this.parent.editSettings.mode === 'Cell') {\n if (this.keyPress === 'tab' || this.keyPress === 'shiftTab') {\n this.keyPress = null;\n }\n else if (this.keyPress === 'enter') {\n args.cancel = true;\n this.keyPress = null;\n setValue('isEditCollapse', false, this.parent);\n }\n if (!args.columnObject.allowEditing) {\n args.cancel = true;\n }\n }\n // if (this.isAdd && this.parent.editSettings.mode === 'Batch' && !args.cell.parentElement.classList.contains('e-insertedrow')) {\n // this.isAdd = false;\n // }\n };\n Edit.prototype.enableToolbarItems = function (request) {\n if (!isNullOrUndefined(this.parent.grid.toolbarModule)) {\n var toolbarID = this.parent.element.id + '_gridcontrol_';\n this.parent.grid.toolbarModule.enableItems([toolbarID + 'add', toolbarID + 'edit', toolbarID + 'delete'], request === 'save');\n this.parent.grid.toolbarModule.enableItems([toolbarID + 'update', toolbarID + 'cancel'], request === 'edit');\n }\n };\n Edit.prototype.batchCancel = function () {\n if (this.parent.editSettings.mode === 'Cell') {\n var cellDetails = getValue('editModule.cellDetails', this.parent.grid.editModule);\n var treeCell = this.parent.getCellFromIndex(cellDetails.rowIndex, this.parent.treeColumnIndex);\n this.parent.renderModule.cellRender({\n data: cellDetails.rowData,\n cell: treeCell,\n column: this.parent.grid.getColumns()[this.parent.treeColumnIndex]\n });\n this.updateGridEditMode('Normal');\n this.isOnBatch = false;\n }\n if (this.parent.editSettings.mode === 'Batch') {\n this.parent.notify('batchCancelAction', {});\n }\n };\n Edit.prototype.customCellSave = function (args) {\n if (isCountRequired(this.parent) && this.parent.editSettings.mode === 'Cell' && args.action === 'edit') {\n this.updateCell(args, args.rowIndex);\n this.afterCellSave(args, args.row, args.rowIndex);\n }\n };\n Edit.prototype.cellSave = function (args) {\n var _this = this;\n if (this.parent.editSettings.mode === 'Cell' && this.parent.element.querySelector('form')) {\n args.cancel = true;\n var editModule = 'editModule';\n setValue('isEdit', false, this.parent.grid);\n setValue('isEditCollapse', true, this.parent);\n args.rowData[args.columnName] = args.value;\n var row_1;\n if (isNullOrUndefined(args.cell)) {\n row_1 = this.parent.grid.editModule[editModule].form.parentElement.parentNode;\n }\n else {\n row_1 = args.cell.parentNode;\n }\n var rowIndex_1;\n var primaryKeys_1 = this.parent.getPrimaryKeyFieldNames();\n if (isNullOrUndefined(row_1)) {\n this.parent.grid.getCurrentViewRecords().filter(function (e, i) {\n if (e[primaryKeys_1[0]] === args.rowData[primaryKeys_1[0]]) {\n rowIndex_1 = i;\n return;\n }\n });\n }\n else {\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n if (this.parent.getRows().indexOf(row_1) !== -1) {\n rowIndex_1 = this.parent.getRows().indexOf(row_1);\n }\n else if (this.parent.getFrozenRightRows().indexOf(row_1) !== -1) {\n rowIndex_1 = this.parent.getFrozenRightRows().indexOf(row_1);\n }\n else {\n rowIndex_1 = this.parent.getMovableRows().indexOf(row_1);\n }\n }\n else {\n rowIndex_1 = (this.parent.getRows().indexOf(row_1) === -1 && (this.parent.getFrozenColumns() > 0)) ?\n this.parent.grid.getMovableRows().indexOf(row_1) : this.parent.getRows().indexOf(row_1);\n }\n }\n var arg = {};\n extend(arg, args);\n arg.cancel = false;\n arg.type = 'save';\n row_1 = this.parent.grid.getRows()[row_1.rowIndex];\n this.parent.trigger(events.actionBegin, arg);\n if (!arg.cancel) {\n if ((row_1.rowIndex === this.parent.getCurrentViewRecords().length - 1) && this.keyPress === 'tab') {\n this.isTabLastRow = true;\n }\n if (!isRemoteData(this.parent) &&\n !(this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {\n if (isCountRequired(this.parent)) {\n var eventPromise = 'eventPromise';\n var editArgs = { requestType: 'save', data: args.rowData, action: 'edit', row: row_1,\n rowIndex: rowIndex_1, rowData: args.rowData, columnName: args.columnName,\n filterChoiceCount: null, excelSearchOperator: null };\n this.parent.grid.getDataModule()[eventPromise](editArgs, this.parent.grid.query);\n }\n else {\n this.updateCell(args, rowIndex_1);\n this.afterCellSave(args, row_1, rowIndex_1);\n }\n }\n else if (isRemoteData(this.parent) ||\n (this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor)) {\n var query = this.parent.grid.query;\n var crud = null;\n crud = this.parent.grid.dataSource.update(primaryKeys_1[0], args.rowData, query.fromTable, query, args.previousValue);\n crud.then(function (e) {\n if (!isNullOrUndefined(e)) {\n args.rowData[args.columnName] = e[args.columnName];\n }\n _this.updateCell(args, rowIndex_1);\n _this.afterCellSave(args, row_1, rowIndex_1);\n });\n }\n }\n else {\n this.parent.grid.isEdit = true;\n }\n }\n };\n Edit.prototype.afterCellSave = function (args, row, rowIndex) {\n var mRow;\n if (this.parent.grid.aggregateModule) {\n this.parent.grid.aggregateModule.refresh(args.rowData);\n }\n this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(args.columnName)]);\n this.parent.grid.editModule.formObj.destroy();\n if (this.keyPress !== 'tab' && this.keyPress !== 'shiftTab') {\n this.updateGridEditMode('Normal');\n this.isOnBatch = false;\n }\n this.enableToolbarItems('save');\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n if (args.cell.closest('.e-frozen-left-header') || args.cell.closest('.e-frozen-left-content')) {\n mRow = this.parent.grid.getRows()[rowIndex];\n }\n else if (args.cell.closest('.e-movableheader') || args.cell.closest('.e-movablecontent')) {\n mRow = this.parent.grid.getMovableRows()[rowIndex];\n }\n else {\n mRow = this.parent.grid.getFrozenRightRows()[rowIndex];\n }\n removeClass([mRow], ['e-editedrow', 'e-batchrow']);\n removeClass(mRow.querySelectorAll('.e-rowcell'), ['e-editedbatchcell', 'e-updatedtd']);\n }\n else if (this.parent.getFrozenColumns() > 0) {\n if (args.cell.closest('.e-frozenheader') || args.cell.closest('.e-frozencontent')) {\n mRow = this.parent.grid.getRows()[rowIndex];\n }\n else {\n mRow = this.parent.grid.getMovableRows()[rowIndex];\n }\n removeClass([mRow], ['e-editedrow', 'e-batchrow']);\n removeClass(mRow.querySelectorAll('.e-rowcell'), ['e-editedbatchcell', 'e-updatedtd']);\n }\n removeClass([row], ['e-editedrow', 'e-batchrow']);\n removeClass(row.querySelectorAll('.e-rowcell'), ['e-editedbatchcell', 'e-updatedtd']);\n if (this.parent['isCellSaveFocus'] !== false) {\n this.parent.grid.focusModule.restoreFocus();\n }\n editAction({ value: args.rowData, action: 'edit' }, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, args.columnName);\n if ((row.rowIndex === this.parent.getCurrentViewRecords().length - 1) && this.keyPress === 'enter') {\n this.keyPress = null;\n }\n var saveArgs = {\n type: 'save', column: this.parent.getColumnByField(args.columnName), data: args.rowData,\n previousData: args.previousValue, row: row, target: args.cell\n };\n if (this.parent.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {\n this.parent.grid.refresh();\n }\n this.parent.trigger(events.actionComplete, saveArgs);\n };\n Edit.prototype.lastCellTab = function () {\n if (!this.parent.grid.isEdit && this.isOnBatch && this.keyPress === 'tab' && this.parent.editSettings.mode === 'Cell') {\n if (!this.parent.editSettings.allowNextRowEdit) {\n this.updateGridEditMode('Normal');\n this.isOnBatch = false;\n this.keyPress = null;\n }\n else {\n this.enableToolbarItems('edit');\n }\n }\n };\n Edit.prototype.updateCell = function (args, rowIndex) {\n this.parent.grid.editModule.updateCell(rowIndex, args.columnName, args.rowData[args.columnName]);\n this.parent.grid.getRowsObject()[rowIndex].data = args.rowData;\n };\n Edit.prototype.crudAction = function (details, columnName) {\n editAction(details, this.parent, this.isSelfReference, this.addRowIndex, this.selectedIndex, columnName, this.addRowRecord);\n this.parent.parentData = [];\n var data = this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource;\n for (var i = 0; i < data.length; i++) {\n data[i].index = i;\n var key = this.parent.grid.getPrimaryKeyFieldNames()[0];\n if (details.value[key] === data[i][key]) {\n if (details.action === 'add') {\n data[i].level = this.internalProperties.level;\n data[i].taskData = this.internalProperties.taskData;\n data[i].uniqueID = this.internalProperties.uniqueID;\n if (!isNullOrUndefined(this.internalProperties.parentItem)) {\n data[i].parentItem = this.internalProperties.parentItem;\n data[i].parentUniqueID = this.internalProperties.parentUniqueID;\n }\n data[i].childRecords = this.internalProperties.childRecords;\n }\n }\n setValue('uniqueIDCollection.' + data[i].uniqueID + '.index', i, this.parent);\n var adaptor = this.parent.dataSource.adaptor;\n if ((isRemoteData(this.parent) || adaptor instanceof RemoteSaveAdaptor)) {\n setValue('uniqueIDCollection.' + data[i].uniqueID, data[i], this.parent);\n }\n if (!data[i].level) {\n this.parent.parentData.push(data[i]);\n }\n }\n if (details.action === 'add' && this.previousNewRowPosition != null) {\n this.parent.setProperties({ editSettings: { newRowPosition: this.previousNewRowPosition } }, true);\n this.previousNewRowPosition = null;\n }\n };\n Edit.prototype.updateIndex = function (data, rows, records) {\n for (var j = 0; j < this.parent.getDataRows().length; j++) {\n var data1 = records[j];\n var index = getValue('uniqueIDCollection.' + data1.uniqueID + '.index', this.parent);\n data1.index = index;\n if (!isNullOrUndefined(data1.parentItem)) {\n var parentIndex = getValue('uniqueIDCollection.' + data1.parentItem.uniqueID + '.index', this.parent);\n data1.parentItem.index = parentIndex;\n }\n }\n var count = -1;\n var treeColIndex = this.parent.treeColumnIndex;\n if (this.parent.getFrozenColumns() > 0) {\n var cells = rows[0].querySelectorAll('.e-rowcell');\n for (var l = 0; l < cells.length; l++) {\n if (cells[l].classList.contains('e-gridrowindex0level0')) {\n treeColIndex = l;\n break;\n }\n }\n }\n for (var k = 0; k < this.parent.getRows().length; k++) {\n if (!rows[k].classList.contains('e-detailrow')) {\n count++;\n }\n var data2 = records[count];\n var index = data2.index;\n var level = data2.level;\n var row = rows[k];\n if (!isNullOrUndefined(data2.parentItem)) {\n index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);\n }\n var treecell = row.cells[treeColIndex];\n if (!isNullOrUndefined(treecell)) {\n for (var l = 0; l < treecell.classList.length; l++) {\n var value = treecell.classList[l];\n var remove = /e-gridrowindex/i;\n var removed = /e-griddetailrowindex/i;\n var result = value.match(remove);\n var results = value.match(removed);\n if (result != null) {\n removeClass([treecell], value);\n }\n if (results != null) {\n removeClass([treecell], value);\n }\n }\n if (!rows[k].classList.contains('e-detailrow')) {\n addClass([treecell], 'e-gridrowindex' + index + 'level' + level);\n }\n else {\n addClass([treecell], 'e-griddetailrowindex' + index + 'level' + level);\n }\n }\n }\n };\n Edit.prototype.beginAdd = function () {\n var position;\n var index = this.addRowIndex;\n var records = this.parent.grid.getCurrentViewRecords();\n if (this.parent.editSettings.mode === 'Batch') {\n index = this.batchEditModule.getAddRowIndex();\n this.selectedIndex = this.batchEditModule.getSelectedIndex();\n if (this.parent.getBatchChanges()[this.addedRecords].length > 1\n || this.parent.getBatchChanges()[this.deletedRecords].length) {\n records = this.batchEditModule.getBatchRecords();\n }\n }\n var rows = this.parent.grid.getDataRows();\n var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;\n var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;\n var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';\n if (this.parent.editSettings.mode !== 'Dialog') {\n if (this.parent.editSettings.newRowPosition === 'Above') {\n position = 'before';\n }\n else if ((this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child')\n && (this.selectedIndex > -1 || isVirtualization) && withinRange) {\n position = 'after';\n if (!isNullOrUndefined(records[index]) && records[index].expanded) {\n if (this.parent.editSettings.mode === 'Batch' && (this.parent.getBatchChanges()[this.addedRecords].length > 1\n || this.parent.getBatchChanges()[this.deletedRecords].length)) {\n index += findChildrenRecords(records[index]).length;\n if (this.parent.editSettings.newRowPosition !== 'Child') {\n var batchChildCount = this.batchEditModule.getBatchChildCount();\n index = index + batchChildCount;\n }\n }\n else {\n index += findChildrenRecords(records[index]).length;\n }\n }\n }\n if ((this.selectedIndex > -1 || isVirtualization) && withinRange\n && (index || (this.parent.editSettings.newRowPosition === 'Child'\n || this.parent.editSettings.newRowPosition === 'Below'))) {\n if (index >= rows.length - 1) {\n index = rows.length - 2;\n }\n var r = 'rows';\n var newRowObject = this.parent.grid.contentModule[r][0];\n var focussedElement = document.activeElement;\n rows[index + 1][position](rows[0]);\n setValue('batchIndex', index + 1, this.batchEditModule);\n var rowObjectIndex = this.parent.editSettings.newRowPosition === 'Above' ? index : index + 1;\n if (this.parent.editSettings.mode === 'Batch') {\n this.parent.grid.contentModule[r].splice(0, 1);\n this.parent.grid.contentModule[r].splice(rowObjectIndex, 0, newRowObject);\n }\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns || freeze) {\n var movableRows = this.parent.getMovableDataRows();\n var frows = 'freezeRows';\n var newFreezeRowObject = this.parent.grid.getRowsObject()[0];\n movableRows[index + 1][position](movableRows[0]);\n if (freeze) {\n var rightFrozenRows = this.parent.getFrozenRightDataRows();\n rightFrozenRows[index + 1][position](rightFrozenRows[0]);\n }\n if (this.parent.editSettings.mode === 'Batch') {\n this.parent.grid.contentModule[frows].splice(0, 1);\n this.parent.grid.contentModule[frows].splice(rowObjectIndex, 0, newFreezeRowObject);\n }\n setValue('batchIndex', index + 1, this.batchEditModule);\n }\n if (this.parent.editSettings.mode === 'Row' || this.parent.editSettings.mode === 'Cell') {\n var errors = this.parent.grid.getContentTable().querySelectorAll('.e-griderror');\n for (var i = 0; i < errors.length; i++) {\n errors[i].remove();\n }\n setValue('errorRules', [], this.parent.grid.editModule.formObj);\n }\n if (isVirtualization) {\n this.prevAriaRowIndex = '-1';\n }\n focussedElement.focus();\n }\n }\n if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1) {\n index = this.batchEditModule.getAddRowIndex();\n this.selectedIndex = this.batchEditModule.getSelectedIndex();\n if (this.parent.editModule['isAddedRowByMethod']) {\n var args = {\n action: \"add\",\n data: this.parent.getBatchChanges()['addedRecords'][0],\n index: index,\n seletedRow: 0\n };\n this.parent.editModule.beginAddEdit(args);\n this.parent.editModule.batchEditModule['batchAddRowRecord'].push(this.parent.editModule.batchEditModule['addRowRecord']);\n this.parent.editModule.batchEditModule['batchAddedRecords'].push(args['data']);\n }\n }\n };\n // private beforeDataBound(args: BeforeDataBoundArgs): void {\n // if (this.parent.grid.isEdit && this.parent.dataSource instanceof DataManager &&\n // this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor) {\n // let action: string = getValue('action', args);\n // let data: Object = getValue('data', args);\n // if (action === 'edit' && !isNullOrUndefined(this.editedData)) {\n // data = extend(this.editedData, data);\n // this.editedData = null;\n // }\n // if (!isNullOrUndefined(this.addedData)) {\n // let addedData: Object = args.result[args.result.length - 1];\n // addedData = extend(this.addedData, addedData);\n // this.addedData = null;\n // args.result.splice(this.addedIndex, 0, addedData);\n // args.result.splice(args.result.length, 1);\n // }\n // }\n // }\n Edit.prototype.beginEdit = function (args) {\n if (args.requestType === 'refresh' && this.isOnBatch) {\n args.cancel = true;\n return;\n }\n if (this.parent.editSettings.mode === 'Cell' && args.requestType === 'beginEdit') {\n args.cancel = true;\n return;\n }\n if (this.doubleClickTarget && (this.doubleClickTarget.classList.contains('e-treegridexpand') ||\n this.doubleClickTarget.classList.contains('e-treegridcollapse') || this.doubleClickTarget.classList.contains('e-frame'))) {\n args.cancel = true;\n this.doubleClickTarget = null;\n return;\n }\n if (args.requestType === 'delete') {\n var data_1 = args.data;\n if (isNullOrUndefined(args.data[0].uniqueID)) {\n var primaryKeys_2 = this.parent.getPrimaryKeyFieldNames();\n var _loop_1 = function (i) {\n this_1.parent.flatData.filter(function (e) {\n if (e[primaryKeys_2[0]] === args.data[i][primaryKeys_2[0]]) {\n data_1[i] = e;\n }\n });\n };\n var this_1 = this;\n for (var i = 0; i < data_1.length; i++) {\n _loop_1(i);\n }\n }\n for (var i = 0; i < data_1.length; i++) {\n this.deleteUniqueID(data_1[i].uniqueID);\n var childs = findChildrenRecords(data_1[i]);\n for (var c = 0; c < childs.length; c++) {\n this.deleteUniqueID(childs[c].uniqueID);\n }\n args.data = args.data.concat(childs);\n }\n }\n if (args.requestType === 'add' || (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling))) {\n if (!(this.parent.grid.selectedRowIndex === -1 && this.isAddedRowByMethod)\n && args.index === this.parent.grid.selectedRowIndex || args.index === 0) {\n this.selectedIndex = this.parent.grid.selectedRowIndex;\n }\n if (this.parent.enableVirtualization) {\n var selector = '.e-row[aria-rowindex=\"' + this.selectedIndex + '\"]';\n var row = void 0;\n if (this.selectedIndex > -1 && this.parent.editSettings.newRowPosition !== 'Top' &&\n this.parent.editSettings.newRowPosition !== 'Bottom') {\n this.prevAriaRowIndex = this.selectedIndex.toString();\n row = this.parent.getContent().querySelector(selector);\n this.addRowIndex = row ? row.rowIndex : 0;\n }\n else {\n if (this.prevAriaRowIndex && this.prevAriaRowIndex !== '-1') {\n selector = '.e-row[aria-rowindex=\"' + this.prevAriaRowIndex + '\"]';\n row = this.parent.getContent().querySelector(selector);\n this.addRowIndex = row ? row.rowIndex : 0;\n }\n else {\n this.addRowIndex = 0;\n }\n }\n }\n else {\n if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {\n this.addRowIndex = args.index;\n }\n else {\n this.addRowIndex = this.parent.grid.selectedRowIndex > -1 ? this.parent.grid.selectedRowIndex : 0;\n }\n }\n if (this.isAddedRowByMethod && (this.parent.enableVirtualization || this.parent.enableInfiniteScrolling)) {\n this.addRowRecord = this.parent.flatData[args.index];\n }\n else {\n this.addRowRecord = this.parent.getSelectedRecords()[0];\n }\n }\n if (this.isAddedRowByMethod && args.index !== 0) {\n this.addRowRecord = this.parent.flatData[args.index];\n this.addRowIndex = args.index;\n }\n if (this.parent.editSettings.newRowPosition === 'Child' && isNullOrUndefined(this.addRowRecord)\n && !isNullOrUndefined(this.parent.getSelectedRecords()[0])) {\n this.addRowRecord = this.parent.getSelectedRecords()[0];\n }\n this.isAddedRowByMethod = false;\n args = this.beginAddEdit(args);\n // if (args.requestType === 'save' &&\n // ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.adaptor instanceof RemoteSaveAdaptor))) {\n // if (args.action === 'edit') {\n // this.editedData = args.data;\n // } else if (args.action === 'add') {\n // this.addedData = value;\n // }\n // }\n };\n Edit.prototype.savePreviousRowPosition = function () {\n if (this.previousNewRowPosition === null) {\n this.previousNewRowPosition = this.parent.editSettings.newRowPosition;\n }\n };\n Edit.prototype.beginAddEdit = function (args) {\n var value = args.data;\n if (args.action === 'add') {\n var key = this.parent.grid.getPrimaryKeyFieldNames()[0];\n var position = null;\n value.taskData = isNullOrUndefined(value.taskData) ? extend({}, args.data) : value.taskData;\n var currentData = this.parent.grid.getCurrentViewRecords();\n if (this.parent.enableVirtualization && args.index !== 0) {\n this.addRowIndex = this.parent.grid.getCurrentViewRecords().indexOf(this.addRowRecord);\n this.selectedIndex = parseInt(this.parent.getRows()[this.addRowIndex].getAttribute('aria-rowindex'), 10);\n }\n var index = this.addRowIndex;\n value.uniqueID = getUid(this.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + value.uniqueID, value, this.parent);\n var level = 0;\n var idMapping = void 0;\n var parentUniqueID = void 0;\n var parentItem = void 0;\n var parentIdMapping = void 0;\n var isVirtualization = this.parent.enableVirtualization && this.addRowIndex > -1 && this.prevAriaRowIndex !== '-1';\n var rows = this.parent.getRows();\n var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;\n var withinRange = this.selectedIndex >= firstAriaIndex && this.selectedIndex <= lastAriaIndex;\n if (currentData.length) {\n idMapping = currentData[this.addRowIndex][this.parent.idMapping];\n parentIdMapping = currentData[this.addRowIndex][this.parent.parentIdMapping];\n if (currentData[this.addRowIndex].parentItem) {\n parentUniqueID = currentData[this.addRowIndex].parentItem.uniqueID;\n }\n parentItem = currentData[this.addRowIndex].parentItem;\n }\n if (this.parent.editSettings.newRowPosition !== 'Top' && currentData.length) {\n level = currentData[this.addRowIndex].level;\n if (this.parent.editSettings.newRowPosition === 'Above') {\n position = 'before';\n index = currentData[this.addRowIndex].index;\n }\n else if (this.parent.editSettings.newRowPosition === 'Below') {\n position = 'after';\n var childRecordCount = findChildrenRecords(currentData[this.addRowIndex]).length;\n var currentDataIndex = currentData[this.addRowIndex].index;\n index = (childRecordCount > 0) ? (currentDataIndex + childRecordCount) : (currentDataIndex);\n }\n else if (this.parent.editSettings.newRowPosition === 'Child') {\n position = 'after';\n if ((this.selectedIndex > -1 || isVirtualization) && withinRange) {\n value.parentItem = extend({}, currentData[this.addRowIndex]);\n value.parentUniqueID = value.parentItem.uniqueID;\n delete value.parentItem.childRecords;\n delete value.parentItem[this.parent.childMapping];\n }\n var childRecordCount1 = findChildrenRecords(currentData[this.addRowIndex]).length;\n var currentDataIndex1 = currentData[this.addRowIndex].index;\n if (this.selectedIndex >= 0) {\n value.level = level + 1;\n }\n index = (childRecordCount1 > 0) ? (currentDataIndex1 + childRecordCount1) : (currentDataIndex1);\n if (this.isSelfReference) {\n value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = idMapping;\n if (!isNullOrUndefined(value.parentItem)) {\n updateParentRow(key, value.parentItem, 'add', this.parent, this.isSelfReference, value);\n }\n }\n }\n if (this.parent.editSettings.newRowPosition === 'Above' || this.parent.editSettings.newRowPosition === 'Below') {\n if ((this.selectedIndex > -1 || isVirtualization) && level && withinRange) {\n value.parentUniqueID = parentUniqueID;\n value.parentItem = extend({}, parentItem);\n delete value.parentItem.childRecords;\n delete value.parentItem[this.parent.childMapping];\n }\n value.level = level;\n if (this.isSelfReference) {\n value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = parentIdMapping;\n if (!isNullOrUndefined(value.parentItem)) {\n updateParentRow(key, value.parentItem, 'add', this.parent, this.isSelfReference, value);\n }\n }\n }\n if (position != null && (this.selectedIndex > -1 || isVirtualization) && withinRange) {\n args.index = position === 'before' ? index : index + 1;\n }\n if (this.parent.editSettings.newRowPosition === 'Bottom') {\n var dataSource = (this.parent.grid.dataSource instanceof DataManager ?\n this.parent.grid.dataSource.dataSource.json : this.parent.grid.dataSource);\n args.index = dataSource.length;\n }\n }\n if (isNullOrUndefined(value.level)) {\n value.level = level;\n }\n value.hasChildRecords = false;\n value.childRecords = [];\n value.index = 0;\n }\n if (args.action === 'add') {\n this.internalProperties = { level: value.level, parentItem: value.parentItem, uniqueID: value.uniqueID,\n taskData: value.taskData, parentUniqueID: isNullOrUndefined(value.parentItem) ? undefined : value.parentItem.uniqueID,\n childRecords: value.childRecords };\n }\n if (args.requestType === 'delete') {\n var deletedValues = args.data;\n for (var i = 0; i < deletedValues.length; i++) {\n if (deletedValues[i].parentItem) {\n var parentItem = getParentData(this.parent, deletedValues[i].parentItem.uniqueID);\n if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {\n var childIndex = parentItem.childRecords.indexOf(deletedValues[i]);\n parentItem.childRecords.splice(childIndex, 1);\n }\n }\n }\n }\n return args;\n };\n /**\n * If the data,index and position given, Adds the record to treegrid rows otherwise it will create edit form.\n *\n * @returns {void}\n */\n Edit.prototype.addRecord = function (data, index, position) {\n if (this.parent.editSettings.newRowPosition === this.previousNewRowPosition || this.previousNewRowPosition === null) {\n this.previousNewRowPosition = this.parent.editSettings.newRowPosition;\n }\n if (!this.isSelfReference && !isNullOrUndefined(data) && Object.hasOwnProperty.call(data, this.parent.childMapping)) {\n var addRecords = [];\n var previousEditMode = this.parent.editSettings.mode;\n var previousGridEditMode = this.parent.grid.editSettings.mode;\n addRecords.push(data);\n this.parent.setProperties({ editSettings: { mode: 'Batch' } }, true);\n this.parent.grid.setProperties({ editSettings: { mode: 'Batch' } }, true);\n if (!isNullOrUndefined(position)) {\n this.parent.setProperties({ editSettings: { newRowPosition: position } }, true);\n }\n var updatedRecords = { addedRecords: addRecords, changedRecords: [], deletedRecords: [] };\n this.parent.notify(events.batchSave, { updatedRecords: updatedRecords, index: index });\n this.parent.setProperties({ editSettings: { mode: previousEditMode } }, true);\n this.parent.grid.setProperties({ editSettings: { mode: previousGridEditMode } }, true);\n this.parent.refresh();\n }\n else {\n if (data) {\n if (index > -1) {\n this.selectedIndex = index;\n this.addRowIndex = index;\n }\n else {\n this.selectedIndex = this.parent.selectedRowIndex;\n this.addRowIndex = this.parent.selectedRowIndex;\n }\n if (position) {\n this.parent.setProperties({ editSettings: { newRowPosition: position } }, true);\n }\n this.parent.grid.editModule.addRecord(data, index);\n }\n else {\n this.parent.grid.editModule.addRecord(data, index);\n }\n }\n };\n /**\n * Checks the status of validation at the time of editing. If validation is passed, it returns true.\n *\n * @returns {boolean} Returns form validation results\n */\n Edit.prototype.editFormValidate = function () {\n return this.parent.grid.editModule.editFormValidate();\n };\n /**\n * @hidden\n * @returns {void}\n */\n Edit.prototype.destroyForm = function () {\n this.parent.grid.editModule.destroyForm();\n };\n Edit.prototype.contentready = function (e) {\n if (!isNullOrUndefined(e.args.requestType)\n && (e.args.requestType.toString() === 'delete' || e.args.requestType.toString() === 'save'\n || (this.parent.editSettings.mode === 'Batch' && e.args.requestType.toString() === 'batchsave'))) {\n this.updateIndex(this.parent.grid.dataSource, this.parent.getRows(), this.parent.getCurrentViewRecords());\n if (this.parent.frozenRows || this.parent.getFrozenColumns() || this.parent.frozenColumns) {\n if (this.parent.grid.dataSource.length === this.parent.getMovableDataRows().length) {\n this.updateIndex(this.parent.grid.dataSource, this.parent.getMovableDataRows(), this.parent.getCurrentViewRecords());\n }\n }\n }\n };\n /**\n * If the row index and field is given, edits the particular cell in a row.\n *\n * @returns {void}\n */\n Edit.prototype.editCell = function (rowIndex, field) {\n if (this.parent.editSettings.mode === 'Cell' || this.parent.editSettings.mode === 'Batch') {\n if (this.parent.editSettings.mode !== 'Batch') {\n this.isOnBatch = true;\n this.updateGridEditMode('Batch');\n }\n this.parent.grid.editModule.editCell(rowIndex, field);\n }\n };\n return Edit;\n}());\nexport { Edit };\n","import { Grid, CommandColumn as Command } from '@syncfusion/ej2-grids';\n/**\n * Command Column Module for TreeGrid\n *\n * @hidden\n */\nvar CommandColumn = /** @class */ (function () {\n function CommandColumn(parent) {\n Grid.Inject(Command);\n this.parent = parent;\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns CommandColumn module name\n */\n CommandColumn.prototype.getModuleName = function () {\n return 'commandColumn';\n };\n /**\n * Destroys the ContextMenu.\n *\n * @function destroy\n * @returns {void}\n */\n CommandColumn.prototype.destroy = function () {\n //this.removeEventListener();\n };\n return CommandColumn;\n}());\nexport { CommandColumn };\n","import { Grid, getObject } from '@syncfusion/ej2-grids';\nimport { DetailRow as detailrow } from '@syncfusion/ej2-grids';\nimport { isNullOrUndefined, addClass } from '@syncfusion/ej2-base';\nimport { getExpandStatus, isRemoteData } from '../utils';\n/**\n * TreeGrid Detail Row module\n *\n * @hidden\n */\nvar DetailRow = /** @class */ (function () {\n function DetailRow(parent) {\n Grid.Inject(detailrow);\n this.parent = parent;\n this.addEventListener();\n }\n /**\n * @hidden\n */\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns DetailRow module name\n */\n DetailRow.prototype.getModuleName = function () {\n return 'detailRow';\n };\n DetailRow.prototype.addEventListener = function () {\n this.parent.on('dataBoundArg', this.dataBoundArg, this);\n this.parent.on('detaildataBound', this.detaildataBound, this);\n this.parent.grid.on('detail-indentcell-info', this.setIndentVisibility, this);\n this.parent.on('childRowExpand', this.childRowExpand, this);\n this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);\n this.parent.on('actioncomplete', this.actioncomplete, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n DetailRow.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('dataBoundArg', this.dataBoundArg);\n this.parent.off('detaildataBound', this.detaildataBound);\n this.parent.off('childRowExpand', this.childRowExpand);\n this.parent.off('rowExpandCollapse', this.rowExpandCollapse);\n this.parent.off('actioncomplete', this.actioncomplete);\n this.parent.grid.off('detail-indentcell-info', this.setIndentVisibility);\n };\n DetailRow.prototype.setIndentVisibility = function (args) {\n var visible = 'visible';\n args[visible] = false;\n };\n DetailRow.prototype.dataBoundArg = function () {\n var detailele = this.parent.getRows().filter(function (e) {\n return !e.classList.contains('e-detailrow');\n });\n for (var i = 0; i < detailele.length; i++) {\n var elements = detailele[i].getElementsByClassName('e-detailrowcollapse');\n var detailData = this.parent.grid.getRowObjectFromUID(detailele[i].getAttribute('data-Uid'));\n var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[i]);\n if (isNullOrUndefined(parentItem) || !isNullOrUndefined(parentItem) &&\n getExpandStatus(this.parent, detailData.data, this.parent.grid.getCurrentViewRecords())) {\n this.parent.grid.detailRowModule.expand(elements[0]);\n }\n }\n };\n DetailRow.prototype.childRowExpand = function (args) {\n var detailRowElement = args.row.getElementsByClassName('e-detailrowcollapse');\n if (!isNullOrUndefined(detailRowElement[0])) {\n this.parent.grid.detailRowModule.expand(detailRowElement[0]);\n }\n };\n DetailRow.prototype.rowExpandCollapse = function (args) {\n if (isRemoteData(this.parent)) {\n return;\n }\n for (var i = 0; i < args.detailrows.length; i++) {\n args.detailrows[i].style.display = args.action;\n }\n };\n DetailRow.prototype.detaildataBound = function (args) {\n var data = args.data;\n var row = args.detailElement.parentElement.previousSibling;\n var index = !isNullOrUndefined(data.parentItem) ? data.parentItem.index : data.index;\n var expandClass = 'e-gridrowindex' + index + 'level' + data.level;\n var classlist = row.querySelector('.' + expandClass).classList;\n var gridClas = [].slice.call(classlist).filter(function (gridclass) { return (gridclass === expandClass); });\n var newNo = gridClas[0].length;\n var slicedclas = gridClas.toString().slice(6, newNo);\n var detailClass = 'e-griddetail' + slicedclas;\n addClass([args.detailElement.parentElement], detailClass);\n };\n DetailRow.prototype.actioncomplete = function (args) {\n if (args.requestType === 'beginEdit' || args.requestType === 'add') {\n var spann = (args.row.querySelectorAll('.e-editcell')[0].getAttribute('colSpan'));\n var colum = parseInt(spann, 10) - 1;\n var updtdcolum = colum.toString();\n args.row.querySelectorAll('.e-editcell')[0].setAttribute('colSpan', updtdcolum);\n }\n var focusElement = this.parent.grid.contentModule.getRows();\n for (var i = 0; i < focusElement.length; i++) {\n focusElement[i].cells[0].visible = false;\n }\n var focusModule = getObject('focusModule', this.parent.grid);\n var matrix = 'refreshMatrix';\n focusModule[matrix](true)({ rows: this.parent.grid.contentModule.getRows() });\n };\n /**\n * Destroys the DetailModule.\n *\n * @function destroy\n * @returns {void}\n */\n DetailRow.prototype.destroy = function () {\n this.removeEventListener();\n };\n return DetailRow;\n}());\nexport { DetailRow };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Cell, CellType } from '@syncfusion/ej2-grids';\nimport { VirtualContentRenderer } from '@syncfusion/ej2-grids';\nimport { InterSectionObserver } from '@syncfusion/ej2-grids';\nimport { TreeVirtualRowModelGenerator } from '../renderer/virtual-row-model-generator';\nimport * as events from '../base/constant';\nimport { isNullOrUndefined, EventHandler, getValue, setValue, Browser, debounce } from '@syncfusion/ej2-base';\nimport { DataManager } from '@syncfusion/ej2-data';\nimport { isCountRequired } from '../utils';\nvar VirtualTreeContentRenderer = /** @class */ (function (_super) {\n __extends(VirtualTreeContentRenderer, _super);\n function VirtualTreeContentRenderer(parent, locator) {\n var _this = _super.call(this, parent, locator) || this;\n _this.isExpandCollapse = false;\n _this.translateY = 0;\n _this.maxiPage = 0;\n _this.recordAdded = false;\n /** @hidden */\n _this.startIndex = -1;\n _this.endIndex = -1;\n _this.preTranslate = 0;\n _this.isRemoteExpand = false;\n /** @hidden */\n _this.isDataSourceChanged = false;\n _this.addEventListener();\n return _this;\n }\n VirtualTreeContentRenderer.prototype.getModelGenerator = function () {\n return new TreeVirtualRowModelGenerator(this.parent);\n };\n VirtualTreeContentRenderer.prototype.getRowByIndex = function (index) {\n return this.parent.getDataRows().filter(function (e) { return parseInt(e.getAttribute('aria-rowindex'), 10) === index; })[0];\n };\n VirtualTreeContentRenderer.prototype.addEventListener = function () {\n this.parent.on(events.virtualActionArgs, this.virtualOtherAction, this);\n this.parent.on(events.indexModifier, this.indexModifier, this);\n };\n VirtualTreeContentRenderer.prototype.virtualOtherAction = function (args) {\n if (args.setTop) {\n this.translateY = 0;\n this.startIndex = 0;\n this.endIndex = this.parent.pageSettings.pageSize - 1;\n }\n else if (args.isExpandCollapse) {\n this.isExpandCollapse = true;\n }\n };\n VirtualTreeContentRenderer.prototype.indexModifier = function (args) {\n var content = this.parent.getContent().querySelector('.e-content');\n if (this.recordAdded && this.startIndex > -1 && this.endIndex > -1) {\n if (this.endIndex > args.count - this.parent.pageSettings.pageSize) {\n var nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());\n var lastIndex = nextSetResIndex + this.parent.getRows().length;\n if (lastIndex > args.count) {\n lastIndex = nextSetResIndex +\n (args.count - nextSetResIndex);\n }\n this.startIndex = lastIndex - this.parent.getRows().length;\n this.endIndex = lastIndex;\n }\n else {\n this.startIndex += 1;\n this.endIndex += 1;\n }\n this.recordAdded = false;\n }\n if (this.isDataSourceChanged) {\n this.startIndex = 0;\n this.endIndex = this.parent.pageSettings.pageSize - 1;\n }\n args.startIndex = this.startIndex;\n args.endIndex = this.endIndex;\n };\n VirtualTreeContentRenderer.prototype.eventListener = function (action) {\n var _this = this;\n if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {\n this.parent[action]('data-ready', this.onDataReady, this);\n this.parent[action]('refresh-virtual-block', this.refreshContentRows, this);\n this.fn = function () {\n _this.observers.observes(function (scrollArgs) { return _this.scrollListeners(scrollArgs); }, _this.onEnteredAction());\n _this.parent.off('content-ready', _this.fn);\n };\n this.parent.addEventListener('dataBound', this.dataBoundEvent.bind(this));\n this.parent.addEventListener('rowSelected', this.rowSelectedEvent.bind(this));\n this.parent[action]('select-virtual-Row', this.toSelectVirtualRow, this);\n this.parent.on('content-ready', this.fn, this);\n this.parent.addEventListener(events.actionComplete, this.onActionComplete.bind(this));\n this.parent[action]('virtual-scroll-edit-action-begin', this.beginEdit, this);\n this.parent[action]('virtual-scroll-add-action-begin', this.beginAdd, this);\n this.parent[action]('virtual-scroll-edit-success', this.virtualEditSuccess, this);\n this.parent[action]('edit-reset', this.resetIseditValue, this);\n this.parent[action]('get-virtual-data', this.getData, this);\n this.parent[action]('virtual-scroll-edit-cancel', this.cancelEdit, this);\n this.parent[action]('select-row-on-context-open', this.toSelectRowOnContextOpen, this);\n this.parent[action]('refresh-virtual-editform-cells', this.refreshCell, this);\n this.parent[action]('virtaul-cell-focus', this.cellFocus, this);\n }\n else {\n _super.prototype.eventListener.call(this, 'on');\n }\n };\n VirtualTreeContentRenderer.prototype.cellFocus = function (e) {\n var virtualCellFocus = 'virtualCellFocus';\n _super.prototype[virtualCellFocus].call(this, e);\n };\n VirtualTreeContentRenderer.prototype.onDataReady = function (e) {\n _super.prototype.onDataReady.call(this, e);\n if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {\n if (!isNullOrUndefined(e.count)) {\n this.totalRecords = e.count;\n if (!this.parent.enableColumnVirtualization) {\n getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');\n }\n }\n if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || this.isDataSourceChanged) {\n this.contents.scrollTop = 0;\n this.isDataSourceChanged = false;\n }\n }\n };\n VirtualTreeContentRenderer.prototype.renderTable = function () {\n _super.prototype.renderTable.call(this);\n if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {\n getValue('observer', this).options.debounceEvent = false;\n this.observers = new TreeInterSectionObserver(getValue('observer', this).element, getValue('observer', this).options);\n this.contents = this.getPanel().firstChild;\n }\n };\n VirtualTreeContentRenderer.prototype.getTranslateY = function (sTop, cHeight, info, isOnenter) {\n if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {\n if (this.isRemoteExpand) {\n this.isRemoteExpand = false;\n return this.preTranslate;\n }\n else {\n this.preTranslate = _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);\n return _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);\n }\n }\n else {\n return _super.prototype.getTranslateY.call(this, sTop, cHeight, info, isOnenter);\n }\n };\n VirtualTreeContentRenderer.prototype.dataBoundEvent = function () {\n var dataBoundEve = 'dataBound';\n var initialRowTop = 'initialRowTop';\n if (this.parent.getRows().length && !this[initialRowTop] && !isNullOrUndefined(this.parent.getRowByIndex(0))) {\n var rowTop = this.parent.getRowByIndex(0).getBoundingClientRect().top;\n var gridTop = this.parent.element.getBoundingClientRect().top;\n if (rowTop > 0) {\n this[initialRowTop] = this.parent.getRowByIndex(0).getBoundingClientRect().top - gridTop;\n }\n else {\n this[initialRowTop] = this.content.getBoundingClientRect().top -\n this.parent.getRowByIndex(0).getBoundingClientRect().height;\n }\n }\n _super.prototype[dataBoundEve].call(this);\n };\n VirtualTreeContentRenderer.prototype.rowSelectedEvent = function (args) {\n var rowSelected = 'rowSelected';\n _super.prototype[rowSelected].call(this, args);\n };\n VirtualTreeContentRenderer.prototype.toSelectVirtualRow = function (args) {\n if (this.parent.isEdit) {\n return;\n }\n var selectVirtualRow = 'selectVirtualRow';\n var containerRect = 'containerRect';\n if (isNullOrUndefined(this.observer[containerRect])) {\n this.observer[containerRect] = this.observers[containerRect];\n }\n if (isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule) || args.selectedIndex !== 0 ||\n isNullOrUndefined(this.parent['clipboardModule'].treeGridParent.editModule['addRowIndex'])) {\n _super.prototype[selectVirtualRow].call(this, args);\n }\n };\n VirtualTreeContentRenderer.prototype.refreshCell = function (rowObj) {\n rowObj.cells = this.generateCells();\n };\n VirtualTreeContentRenderer.prototype.generateCells = function () {\n var cells = [];\n for (var i = 0; i < this.parent.columns.length; i++) {\n cells.push(this.generateCell(this.parent.columns[i]));\n }\n return cells;\n };\n VirtualTreeContentRenderer.prototype.generateCell = function (col, rowId, cellType, colSpan, oIndex, foreignKeyData) {\n var opt = {\n 'visible': col.visible,\n 'isDataCell': !isNullOrUndefined(col.field || col.template),\n 'isTemplate': !isNullOrUndefined(col.template),\n 'rowID': rowId,\n 'column': col,\n 'cellType': !isNullOrUndefined(cellType) ? cellType : CellType.Data,\n 'colSpan': colSpan,\n 'commands': col.commands,\n 'isForeignKey': col.isForeignColumn && col.isForeignColumn(),\n 'foreignKeyData': col.isForeignColumn && col.isForeignColumn() && getValue(col.field, foreignKeyData)\n };\n if (opt.isDataCell || opt.column.type === 'checkbox' || opt.commands) {\n opt.index = oIndex;\n }\n return new Cell(opt);\n };\n VirtualTreeContentRenderer.prototype.beginEdit = function (e) {\n var selector = '.e-row[aria-rowindex=\"' + e.index + '\"]';\n var index = this.parent.getContent().querySelector(selector).rowIndex;\n var rowData = this.parent.getCurrentViewRecords()[index];\n e.data = rowData;\n };\n VirtualTreeContentRenderer.prototype.beginAdd = function (args) {\n var addAction = 'addActionBegin';\n var isAdd = 'isAdd';\n var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, ariaRowIndex: this.ariaRowIndex };\n this.parent.notify('get-row-position', addArgs);\n this.rowPosition = addArgs.newRowPosition;\n this.addRowIndex = addArgs.addRowIndex;\n this.ariaRowIndex = addArgs.ariaRowIndex;\n var rows = this.parent.getRows();\n var firstAriaIndex = rows.length ? +rows[0].getAttribute('aria-rowindex') : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('aria-rowindex') : 0;\n var withInRange = this.parent.selectedRowIndex >= firstAriaIndex && this.parent.selectedRowIndex <= lastAriaIndex;\n if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {\n this[isAdd] = true;\n }\n if (this.rowPosition === 'Top' || this.rowPosition === 'Bottom' ||\n ((!this.addRowIndex || this.addRowIndex === -1) && (this.parent.selectedRowIndex === -1 || !withInRange))) {\n _super.prototype[addAction].call(this, args);\n }\n };\n VirtualTreeContentRenderer.prototype.restoreEditState = function () {\n var restoreEdit = 'restoreEdit';\n _super.prototype[restoreEdit].call(this);\n };\n VirtualTreeContentRenderer.prototype.resetIseditValue = function () {\n var resetIsEdit = 'resetIsedit';\n var isAdd = 'isAdd';\n this.parent.notify('reset-edit-props', {});\n if ((this.rowPosition === 'Top' || this.rowPosition === 'Bottom') && this[isAdd]) {\n _super.prototype[resetIsEdit].call(this);\n }\n };\n VirtualTreeContentRenderer.prototype.virtualEditSuccess = function () {\n var isAdd = 'isAdd';\n var content = this.parent.getContent().querySelector('.e-content');\n if (this[isAdd] && content.querySelector('.e-addedrow')) {\n this.recordAdded = true;\n }\n };\n VirtualTreeContentRenderer.prototype.cancelEdit = function (args) {\n var editCancel = 'editCancel';\n _super.prototype[editCancel].call(this, args);\n };\n VirtualTreeContentRenderer.prototype.toSelectRowOnContextOpen = function (args) {\n var selectRowOnContextOpen = 'selectRowOnContextOpen';\n _super.prototype[selectRowOnContextOpen].call(this, args);\n };\n VirtualTreeContentRenderer.prototype.restoreNewRow = function () {\n var isAdd = 'isAdd';\n var content = this.parent.getContent().querySelector('.e-content');\n if (this[isAdd] && !content.querySelector('.e-addedrow')) {\n this.parent.isEdit = false;\n this.parent.addRecord();\n }\n };\n VirtualTreeContentRenderer.prototype.getData = function (data) {\n var getVirtualData = 'getVirtualData';\n _super.prototype[getVirtualData].call(this, data);\n };\n VirtualTreeContentRenderer.prototype.onActionComplete = function (args) {\n if (args.requestType === 'add') {\n var addArgs = { newRowPosition: this.rowPosition, addRowIndex: this.addRowIndex, ariaRowIndex: this.ariaRowIndex };\n this.parent.notify('get-row-position', addArgs);\n this.rowPosition = addArgs.newRowPosition;\n this.addRowIndex = addArgs.addRowIndex;\n this.ariaRowIndex = addArgs.ariaRowIndex;\n }\n var actionComplete = 'actionComplete';\n _super.prototype[actionComplete].call(this, args);\n };\n VirtualTreeContentRenderer.prototype.onEnteredAction = function () {\n var _this = this;\n return function (element, current, direction, e, isWheel, check) {\n var directVirtualRender = 'directVirtualRender';\n if (!_this.parent[directVirtualRender]) { // with this property, columns are rendered without debouncing on horizontal scroll.\n var preventEvent = 'preventEvent';\n if (Browser.isIE && !isWheel && check && !_this[preventEvent]) {\n _this.parent.showSpinner();\n }\n var xAxis = current.axis === 'X';\n var x = _this.getColumnOffset(xAxis ? _this.vgenerator.getColumnIndexes()[0] - 1 : _this.prevInfo.columnIndexes[0]\n - 1);\n if (xAxis) {\n var idx = Object.keys(_this.vgenerator.cOffsets).length - _this.prevInfo.columnIndexes.length;\n var maxLeft = _this.vgenerator.cOffsets[idx - 1];\n x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.\n }\n _this.virtualEle.adjustTable(x, _this.translateY);\n if (_this.parent.enableColumnVirtualization) {\n _this.header.virtualEle.adjustTable(x, 0);\n }\n }\n };\n };\n VirtualTreeContentRenderer.prototype.scrollListeners = function (scrollArgs) {\n var info = scrollArgs.sentinel;\n var outBuffer = this.parent.pageSettings.pageSize - Math.ceil(this.parent.pageSettings.pageSize / 2);\n var content = this.parent.getContent().querySelector('.e-content');\n var scrollHeight = outBuffer * this.parent.getRowHeight();\n var upScroll = (scrollArgs.offset.top - this.translateY) < 0;\n var downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) >= scrollHeight;\n var selectedRowIndex = 'selectedRowIndex';\n if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {\n var vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :\n this.parent.element.getBoundingClientRect().height);\n var index = (~~(content.scrollTop / this.parent.getRowHeight())\n + Math.ceil(vHeight / this.parent.getRowHeight()))\n - this.parent.pageSettings.pageSize;\n index = (index > 0) ? index : 0;\n if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 && index !== this[selectedRowIndex]) {\n index = this[selectedRowIndex];\n }\n this.startIndex = index;\n this.endIndex = index + this.parent.pageSettings.pageSize;\n if (this.endIndex > this.totalRecords) {\n var lastInx = this.totalRecords - 1;\n var remains = this.endIndex % lastInx;\n this.endIndex = lastInx;\n this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);\n }\n //var firsttdinx = parseInt(this.parent.getContent().querySelector('.e-content td').getAttribute('index'), 0);\n var rowPt = Math.ceil(scrollArgs.offset.top / this.parent.getRowHeight());\n rowPt = rowPt % this.parent.pageSettings.pageSize;\n var firsttdinx = 0;\n if (!isNullOrUndefined(this.parent.getRows()[rowPt]) &&\n !isNullOrUndefined(this.parent.getContent().querySelectorAll('.e-content tr')[rowPt])) {\n var attr = this.parent.getContent().querySelectorAll('.e-content tr')[rowPt]\n .querySelector('td').getAttribute('index');\n firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('aria-rowindex');\n }\n if (firsttdinx === 0) {\n this.translateY = scrollArgs.offset.top;\n }\n else {\n var height = this.parent.getRowHeight();\n this.translateY = (scrollArgs.offset.top - (outBuffer * height) > 0) ?\n scrollArgs.offset.top - (outBuffer * height) + 10 : 0;\n }\n }\n else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {\n var nextSetResIndex = ~~(content.scrollTop / this.parent.getRowHeight());\n var isLastBlock = (this[selectedRowIndex] + this.parent.pageSettings.pageSize) < this.totalRecords ? false : true;\n if (!isNullOrUndefined(this[selectedRowIndex]) && this[selectedRowIndex] !== -1 &&\n nextSetResIndex !== this[selectedRowIndex] && !isLastBlock) {\n nextSetResIndex = this[selectedRowIndex];\n }\n var lastIndex = nextSetResIndex + this.parent.pageSettings.pageSize;\n if (lastIndex > this.totalRecords) {\n lastIndex = nextSetResIndex +\n (this.totalRecords - nextSetResIndex);\n }\n this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;\n this.endIndex = lastIndex;\n if (scrollArgs.offset.top > (this.parent.getRowHeight() * this.totalRecords)) {\n this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);\n }\n else {\n this.translateY = scrollArgs.offset.top;\n }\n }\n if (((downScroll && (scrollArgs.offset.top < (this.parent.getRowHeight() * this.totalRecords)))\n || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left')) {\n var viewInfo = this.currentInfo = getValue('getInfoFromView', this).apply(this, [scrollArgs.direction, info, scrollArgs.offset]);\n this.previousInfo = viewInfo;\n this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization ? viewInfo.columnIndexes : []);\n var page = viewInfo.loadNext && !viewInfo.loadSelf ? viewInfo.nextInfo.page : viewInfo.page;\n this.parent.setProperties({ pageSettings: { currentPage: page } }, true);\n if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {\n viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;\n }\n this.parent.notify(viewInfo.event, { requestType: 'virtualscroll', virtualInfo: viewInfo, focusElement: scrollArgs.focusElement });\n }\n };\n VirtualTreeContentRenderer.prototype.appendContent = function (target, newChild, e) {\n if ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || isCountRequired(this.parent)) {\n if (getValue('isExpandCollapse', e)) {\n this.isRemoteExpand = true;\n }\n _super.prototype.appendContent.call(this, target, newChild, e);\n }\n else {\n var info = e.virtualInfo.sentinelInfo && e.virtualInfo.sentinelInfo.axis === 'Y' &&\n getValue('currentInfo', this).page && getValue('currentInfo', this).page !== e.virtualInfo.page ?\n getValue('currentInfo', this) : e.virtualInfo;\n var cBlock = (info.columnIndexes[0]) - 1;\n var cOffset = this.getColumnOffset(cBlock);\n var width = void 0;\n if (this.parent.enableColumnVirtualization) {\n this.header.virtualEle.adjustTable(cOffset, 0);\n var cIndex = info.columnIndexes;\n width = this.getColumnOffset(cIndex[cIndex.length - 1]) - this.getColumnOffset(cIndex[0] - 1) + '';\n this.header.virtualEle.setWrapperWidth(width);\n }\n this.virtualEle.setWrapperWidth(width, (Browser.isIE || Browser.info.name === 'edge'));\n target = this.parent.createElement('tbody');\n target.appendChild(newChild);\n var replace = 'replaceWith';\n this.getTable().querySelector('tbody')[replace](target);\n if (!this.isExpandCollapse || this.translateY === 0) {\n this.translateY = this.translateY < 0 ? 0 : this.translateY;\n getValue('virtualEle', this).adjustTable(cOffset, this.translateY);\n }\n else {\n this.isExpandCollapse = false;\n }\n setValue('prevInfo', this.previousInfo ? this.previousInfo : info, this);\n if (e.requestType === 'virtualscroll' && e.virtualInfo.sentinelInfo.axis === 'X') {\n this.parent.notify(events.autoCol, {});\n }\n var focusCell = 'focusCell';\n var restoreAdd = 'restoreAdd';\n var ensureSelectedRowPosition = 'ensureSelectedRowPosition';\n _super.prototype[focusCell].call(this, e);\n var isAdd = 'isAdd';\n if (this[isAdd] && !this.parent.getContent().querySelector('.e-content').querySelector('.e-addedrow')) {\n if (!(this.rowPosition === 'Top' || this.rowPosition === 'Bottom')) {\n if (this.ariaRowIndex >= this.startIndex) {\n this.restoreNewRow();\n }\n else if (this.addRowIndex && this.addRowIndex > -1) {\n this[isAdd] = false;\n this.parent.isEdit = false;\n }\n }\n }\n this.restoreEditState();\n _super.prototype[restoreAdd].call(this);\n _super.prototype[ensureSelectedRowPosition].call(this);\n }\n };\n VirtualTreeContentRenderer.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('data-ready', this.onDataReady);\n this.parent.off('content-ready', this.fn);\n this.parent.off('select-virtual-Row', this.toSelectVirtualRow);\n this.parent.off('dataBound', this.dataBoundEvent);\n this.parent.off('rowSelected', this.rowSelectedEvent);\n this.parent.off(events.virtualActionArgs, this.virtualOtherAction);\n this.parent.off(events.indexModifier, this.indexModifier);\n this.parent.off('virtual-scroll-edit-action-begin', this.beginEdit);\n this.parent.off('virtual-scroll-add-action-begin', this.beginAdd);\n this.parent.off('virtual-scroll-edit-success', this.virtualEditSuccess);\n this.parent.off('edit-reset', this.resetIseditValue);\n this.parent.off('get-virtual-data', this.getData);\n this.parent.off('virtual-scroll-edit-cancel', this.cancelEdit);\n this.parent.off('select-row-on-context-open', this.toSelectRowOnContextOpen);\n this.parent.off('refresh-virtual-editform-cells', this.refreshCell);\n this.parent.off('virtaul-cell-focus', this.cellFocus);\n };\n return VirtualTreeContentRenderer;\n}(VirtualContentRenderer));\nexport { VirtualTreeContentRenderer };\nvar TreeInterSectionObserver = /** @class */ (function (_super) {\n __extends(TreeInterSectionObserver, _super);\n function TreeInterSectionObserver() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isWheeling = false;\n _this.newPos = 0;\n _this.lastPos = 0;\n _this.timer = 0;\n return _this;\n }\n TreeInterSectionObserver.prototype.observes = function (callback, onEnterCallback) {\n var containerRect = 'containerRect';\n _super.prototype[containerRect] = getValue('options', this).container.getBoundingClientRect();\n EventHandler.add(getValue('options', this).container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback), this);\n };\n TreeInterSectionObserver.prototype.clear = function () {\n this.lastPos = null;\n };\n TreeInterSectionObserver.prototype.virtualScrollHandlers = function (callback, onEnterCallback) {\n var _this = this;\n var delay = Browser.info.name === 'chrome' ? 200 : 100;\n var options = 'options';\n var movableEle = 'movableEle';\n var element = 'element';\n var fromWheel = 'fromWheel';\n var debounced100 = debounce(callback, delay);\n var debounced50 = debounce(callback, 50);\n this[options].prevTop = this[options].prevLeft = 0;\n return function (e) {\n var top = _this[options].movableContainer ? _this[options].container.scrollTop : e.target.scrollTop;\n var left = _this[options].movableContainer ? _this[options].scrollbar.scrollLeft : e.target.scrollLeft;\n var direction = _this[options].prevTop < top ? 'down' : 'up';\n direction = _this[options].prevLeft === left ? direction : _this[options].prevLeft < left ? 'right' : 'left';\n _this[options].prevTop = top;\n _this[options].prevLeft = left;\n var current = _this.sentinelInfo[direction];\n var delta = 0;\n _this.newPos = top;\n if (_this.lastPos != null) { // && newPos < maxScroll\n delta = _this.newPos - _this.lastPos;\n }\n _this.lastPos = _this.newPos;\n if (_this.timer) {\n clearTimeout(_this.timer);\n }\n _this.timer = setTimeout(_this.clear, 0);\n if ((delta > 100 || delta < -100) && (e && e.preventDefault)) {\n e.returnValue = false;\n e.preventDefault();\n }\n if (_this[options].axes.indexOf(current.axis) === -1) {\n return;\n }\n var check = _this.check(direction);\n if (current.entered && current.axis === 'X') {\n if (_this[movableEle] && (direction === 'right' || direction === 'left')) {\n onEnterCallback(_this[movableEle], current, direction, { top: top, left: left }, _this[fromWheel], check);\n }\n else {\n onEnterCallback(_this[element], current, direction, { top: top, left: left }, _this[fromWheel], check);\n }\n }\n if (check) {\n var fn = debounced100;\n if (current.axis === 'X') {\n fn = debounced50;\n fn({ direction: direction, sentinel: current, offset: { top: top, left: left },\n focusElement: document.activeElement });\n }\n else {\n callback({ direction: direction, sentinel: current, offset: { top: top, left: left },\n focusElement: document.activeElement });\n }\n }\n _this[fromWheel] = false;\n };\n };\n return TreeInterSectionObserver;\n}(InterSectionObserver));\nexport { TreeInterSectionObserver };\n","var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nimport { Grid, VirtualScroll as GridVirtualScroll } from '@syncfusion/ej2-grids';\nimport { RenderType } from '@syncfusion/ej2-grids';\nimport { getValue, isNullOrUndefined } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport { DataManager, Predicate, Query } from '@syncfusion/ej2-data';\nimport { getExpandStatus } from '../utils';\nimport { VirtualTreeContentRenderer } from '../renderer/virtual-tree-content-render';\nimport { VirtualHeaderRenderer } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid Virtual Scroll module will handle Virtualization\n *\n * @hidden\n */\nvar VirtualScroll = /** @class */ (function () {\n /**\n * Constructor for VirtualScroll module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function VirtualScroll(parent) {\n this.prevstartIndex = -1;\n this.prevendIndex = -1;\n this.parent = parent;\n Grid.Inject(TreeVirtual);\n this.addEventListener();\n }\n VirtualScroll.prototype.returnVisualData = function (args) {\n args.data = this.visualData;\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} - Returns VirtualScroll module name\n */\n VirtualScroll.prototype.getModuleName = function () {\n return 'virtualScroll';\n };\n /**\n * @hidden\n * @returns {void}\n */\n VirtualScroll.prototype.addEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.on(events.localPagedExpandCollapse, this.collapseExpandVirtualchilds, this);\n this.parent.on(events.pagingActions, this.virtualPageAction, this);\n this.parent.on(events.destroy, this.destroy, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n VirtualScroll.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off(events.localPagedExpandCollapse, this.collapseExpandVirtualchilds);\n this.parent.off(events.pagingActions, this.virtualPageAction);\n this.parent.off(events.destroy, this.destroy);\n };\n VirtualScroll.prototype.collapseExpandVirtualchilds = function (row) {\n this.parent.grid.notify(events.virtualActionArgs, { isExpandCollapse: true });\n this.expandCollapseRec = row.record;\n row.record.expanded = row.action === 'collapse' ? false : true;\n var ret = {\n result: this.parent.flatData,\n row: row.row,\n action: row.action,\n record: row.record,\n count: this.parent.flatData.length\n };\n if (this.parent.enableVirtualization && this.parent.selectionSettings.mode === 'Cell' ||\n this.parent.selectionSettings.mode === 'Row' && !this.parent.selectionSettings.persistSelection) {\n this.parent.grid.clearSelection();\n }\n var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';\n getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });\n };\n VirtualScroll.prototype.virtualPageAction = function (pageingDetails) {\n var _this = this;\n var dm = new DataManager(pageingDetails.result);\n var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);\n var parents = dm.executeLocal(new Query().where(expanded));\n var visualData = parents.filter(function (e) {\n return getExpandStatus(_this.parent, e, parents);\n });\n this.visualData = visualData;\n this.parent.grid.notify(events.dataListener, { data: visualData });\n var counts = { startIndex: -1, endIndex: -1, count: pageingDetails.count };\n this.parent.grid.notify(events.indexModifier, counts);\n var startIndex = counts.startIndex;\n var endIndex = counts.endIndex;\n pageingDetails.count = visualData.length;\n if (startIndex === -1 && endIndex === -1) {\n var query = new Query();\n var size = this.parent.grid.pageSettings.pageSize;\n var current = this.parent.grid.pageSettings.currentPage;\n var skip = size * (current - 1);\n query = query.skip(skip).take(size);\n dm.dataSource.json = visualData;\n pageingDetails.result = dm.executeLocal(query);\n }\n else {\n var requestType = pageingDetails.actionArgs.requestType;\n if (requestType === 'filtering' || requestType === 'collapseAll' ||\n (requestType === 'refresh' && this.parent.enableCollapseAll && endIndex > visualData.length)) {\n startIndex = 0;\n endIndex = this.parent.grid.pageSettings.pageSize - 1;\n this.parent.grid.getContent().firstElementChild.scrollTop = 0;\n this.parent.grid.notify(events.virtualActionArgs, { setTop: true });\n }\n //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&\n //this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {\n if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||\n (pageingDetails.actionArgs.requestType === 'refresh' && startIndex !== this.prevstartIndex)) &&\n (startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length)) {\n startIndex = 0;\n }\n if (!isNullOrUndefined(this.expandCollapseRec)) {\n var resourceCount = this.parent.getRows();\n var sIndex = visualData.indexOf(this.expandCollapseRec);\n var tempdata = visualData.slice(sIndex, sIndex + resourceCount.length);\n if (tempdata.length < resourceCount.length && sIndex >= 0 && startIndex !== 0) {\n sIndex = visualData.length - resourceCount.length;\n sIndex = sIndex > 0 ? sIndex : 0;\n startIndex = sIndex;\n endIndex = visualData.length;\n }\n else if (getValue('isCollapseAll', this.parent)) {\n startIndex = 0;\n endIndex = this.parent.grid.pageSettings.pageSize - 1;\n this.parent.grid.notify(events.virtualActionArgs, { setTop: true });\n }\n }\n //}\n if ((this.parent.enableCollapseAll || this.parent.expandStateMapping) && !isNullOrUndefined(this.expandCollapseRec)) {\n if (pageingDetails.count < this.parent.getRows()[0].getBoundingClientRect().height) {\n startIndex = 0;\n }\n else if (!this.parent['isExpandAll']) {\n startIndex = this.prevstartIndex === -1 ? 0 : this.prevstartIndex;\n }\n }\n this.expandCollapseRec = null;\n pageingDetails.result = visualData.slice(startIndex, endIndex);\n this.prevstartIndex = startIndex;\n this.prevendIndex = endIndex;\n }\n this.parent.notify('updateAction', pageingDetails);\n };\n /**\n * To destroy the virtualScroll module\n *\n * @returns {void}\n * @hidden\n */\n VirtualScroll.prototype.destroy = function () {\n this.removeEventListener();\n };\n return VirtualScroll;\n}());\nexport { VirtualScroll };\nvar TreeVirtual = /** @class */ (function (_super) {\n __extends(TreeVirtual, _super);\n function TreeVirtual(parent, locator) {\n var _this = _super.call(this, parent, locator) || this;\n getValue('parent', _this).off('initial-load', getValue('instantiateRenderer', _this), _this);\n getValue('parent', _this).on('initial-load', _this.instantiateRenderers, _this);\n return _this;\n }\n TreeVirtual.prototype.getModuleName = function () {\n return 'treeVirtualScroll';\n };\n TreeVirtual.prototype.instantiateRenderers = function () {\n var parentGrid = getValue('parent', this);\n getValue('parent', this).log(['limitation', 'virtual_height'], 'virtualization');\n var renderer = getValue('locator', this).getService('rendererFactory');\n if (parentGrid.enableColumnVirtualization) {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Header, new VirtualHeaderRenderer(getValue('parent', this), getValue('locator', this))]);\n }\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);\n //renderer.addRenderer(RenderType.Content, new VirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this)));\n this.ensurePageSize();\n };\n TreeVirtual.prototype.ensurePageSize = function () {\n var parentGrid = getValue('parent', this);\n var rowHeight = parentGrid.getRowHeight();\n if (!isNullOrUndefined(parentGrid.height) && typeof (parentGrid.height) === 'string' && parentGrid.height.indexOf('%') !== -1) {\n parentGrid.element.style.height = parentGrid.height;\n }\n var vHeight = parentGrid.height.toString().indexOf('%') < 0 ? parentGrid.height :\n parentGrid.element.getBoundingClientRect().height;\n var blockSize = ~~(vHeight / rowHeight);\n var height = blockSize * 2;\n var size = parentGrid.pageSettings.pageSize;\n parentGrid.setProperties({ pageSettings: { pageSize: size < height ? height : size } }, true);\n };\n return TreeVirtual;\n}(GridVirtualScroll));\nexport { TreeVirtual };\n","import { parentsUntil } from '@syncfusion/ej2-grids';\nimport { Grid, Freeze as FreezeColumn } from '@syncfusion/ej2-grids';\nimport { addClass } from '@syncfusion/ej2-base';\n/**\n * TreeGrid Freeze module\n *\n * @hidden\n */\nvar Freeze = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function Freeze(parent) {\n Grid.Inject(FreezeColumn);\n this.parent = parent;\n this.addEventListener();\n }\n Freeze.prototype.addEventListener = function () {\n this.parent.on('rowExpandCollapse', this.rowExpandCollapse, this);\n this.parent.on('dataBoundArg', this.dataBoundArg, this);\n this.parent.grid.on('dblclick', this.dblClickHandler, this);\n };\n Freeze.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('rowExpandCollapse', this.rowExpandCollapse);\n this.parent.off('dataBoundArg', this.dataBoundArg);\n this.parent.grid.off('dblclick', this.dblClickHandler);\n };\n Freeze.prototype.rowExpandCollapse = function (args) {\n var movableRows = this.parent.getMovableDataRows();\n var frozenrows = this.parent.getRows();\n var rows;\n var frozenRightRows;\n var freeze = (this.parent.getFrozenLeftColumnsCount() > 0 ||\n this.parent.getFrozenRightColumnsCount() > 0) ? true : false;\n if (freeze) {\n frozenRightRows = this.parent.getFrozenRightRows().filter(function (e) {\n return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));\n });\n }\n if (!args.detailrows.length) {\n rows = movableRows.filter(function (e) {\n return e.querySelector('.e-gridrowindex' + args.record.index + 'level' + (args.record.level + 1));\n });\n }\n else {\n rows = args.detailrows;\n }\n for (var i = 0; i < rows.length; i++) {\n var rData = this.parent.grid.getRowObjectFromUID(rows[i].getAttribute('data-Uid')).data;\n rows[i].style.display = args.action;\n if (freeze) {\n frozenRightRows[i].style.display = args.action;\n }\n var queryselector = args.action === 'none' ? '.e-treecolumn-container .e-treegridcollapse'\n : '.e-treecolumn-container .e-treegridexpand';\n if (frozenrows[rows[i].rowIndex].querySelector(queryselector)) {\n var cRow = [];\n for (var i_1 = 0; i_1 < movableRows.length; i_1++) {\n if (movableRows[i_1].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {\n cRow.push(movableRows[i_1]);\n }\n }\n if (cRow.length) {\n this.rowExpandCollapse({ detailrows: cRow, action: args.action });\n }\n }\n }\n };\n Freeze.prototype.dblClickHandler = function (e) {\n if (parentsUntil(e.target, 'e-rowcell') &&\n this.parent.grid.editSettings.allowEditOnDblClick && this.parent.editSettings.mode !== 'Cell') {\n this.parent.grid.editModule.startEdit(parentsUntil(e.target, 'e-row'));\n }\n };\n Freeze.prototype.dataBoundArg = function () {\n var checkboxColumn = this.parent.getColumns().filter(function (e) {\n return e.showCheckbox;\n });\n if (checkboxColumn.length && this.parent.freezeModule && this.parent.initialRender) {\n addClass([this.parent.element.getElementsByClassName('e-grid')[0]], 'e-checkselection');\n }\n };\n Freeze.prototype.destroy = function () {\n this.removeEventListener();\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns Freeze module name\n */\n Freeze.prototype.getModuleName = function () {\n return 'freeze';\n };\n return Freeze;\n}());\nexport { Freeze };\n","import { Grid, ColumnChooser as GridColumnChooser } from '@syncfusion/ej2-grids';\n/**\n * TreeGrid ColumnChooser module\n *\n * @hidden\n */\nvar ColumnChooser = /** @class */ (function () {\n /**\n * Constructor for render module\n *\n * @param {TreeGrid} parent - Tree Grid instance.\n */\n function ColumnChooser(parent) {\n Grid.Inject(GridColumnChooser);\n this.parent = parent;\n }\n /**\n * Column chooser can be displayed on screen by given position(X and Y axis).\n *\n * @param {number} X - Defines the X axis.\n * @param {number} Y - Defines the Y axis.\n * @returns {void}\n */\n ColumnChooser.prototype.openColumnChooser = function (X, Y) {\n return this.parent.grid.columnChooserModule.openColumnChooser(X, Y);\n };\n /**\n * Destroys the openColumnChooser.\n *\n * @function destroy\n * @returns {void}\n */\n ColumnChooser.prototype.destroy = function () {\n //this.parent.grid.ColumnChooserModule.destroy();\n };\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} Returns ColumnChooser module name\n */\n ColumnChooser.prototype.getModuleName = function () {\n return 'ColumnChooser';\n };\n return ColumnChooser;\n}());\nexport { ColumnChooser };\n","import { Grid, InfiniteScroll as GridInfiniteScroll } from '@syncfusion/ej2-grids';\nimport { RowRenderer, resetRowIndex } from '@syncfusion/ej2-grids';\nimport { getValue, isNullOrUndefined, remove } from '@syncfusion/ej2-base';\nimport * as events from '../base/constant';\nimport { DataManager, Predicate, Query } from '@syncfusion/ej2-data';\nimport { findChildrenRecords, getExpandStatus } from '../utils';\n/**\n * TreeGrid Infinite Scroll module will handle Infinite Scrolling.\n *\n * @hidden\n */\nvar InfiniteScroll = /** @class */ (function () {\n /**\n * Constructor for VirtualScroll module\n *\n * @param {TreeGrid} parent - Tree Grid instance\n */\n function InfiniteScroll(parent) {\n this.parent = parent;\n Grid.Inject(GridInfiniteScroll);\n this.addEventListener();\n }\n /**\n * For internal use only - Get the module name.\n *\n * @private\n * @returns {string} - Returns Logger module name\n */\n InfiniteScroll.prototype.getModuleName = function () {\n return 'infiniteScroll';\n };\n /**\n * @hidden\n * @returns {void}\n */\n InfiniteScroll.prototype.addEventListener = function () {\n this.parent.on(events.pagingActions, this.infinitePageAction, this);\n this.parent.on('infinite-remote-expand', this.infiniteRemoteExpand, this);\n this.parent.grid.on('delete-complete', this.infiniteDeleteHandler, this);\n this.parent.grid.on('infinite-edit-handler', this.infiniteEditHandler, this);\n this.parent.grid.on('infinite-crud-cancel', this.createRows, this);\n this.parent.grid.on('content-ready', this.contentready, this);\n this.parent.on(events.localPagedExpandCollapse, this.collapseExpandInfinitechilds, this);\n };\n /**\n * @hidden\n * @returns {void}\n */\n InfiniteScroll.prototype.removeEventListener = function () {\n if (this.parent.isDestroyed) {\n return;\n }\n this.parent.off('infinite-remote-expand', this.infiniteRemoteExpand);\n this.parent.grid.off('delete-complete', this.infiniteDeleteHandler);\n this.parent.grid.off('infinite-edit-handler', this.infiniteEditHandler);\n this.parent.off(events.pagingActions, this.infinitePageAction);\n this.parent.grid.off('infinite-crud-cancel', this.createRows);\n this.parent.grid.off('content-ready', this.contentready);\n this.parent.off(events.localPagedExpandCollapse, this.collapseExpandInfinitechilds);\n };\n /**\n * Handles the Expand Collapse action for Remote data with infinite scrolling.\n *\n * @param {{ index: number, childData: ITreeData[] }} args - expanded row index and its child data\n * @param { number } args.index - expanded row index\n * @param { ITreeData[] } args.childData - child data of expanded row\n * @returns {void}\n */\n InfiniteScroll.prototype.infiniteRemoteExpand = function (args) {\n var rowObjects = this.parent.grid.getRowsObject();\n var locator = 'serviceLocator';\n var generateRows = 'generateRows';\n var serviceLocator = this.parent.grid.infiniteScrollModule[locator];\n var rowRenderer = new RowRenderer(serviceLocator, null, this.parent.grid);\n var rows = this.parent.getRows();\n var position = args.index === rows.length - 1 ? 'after' : 'before';\n var cols = this.parent.grid.getColumns();\n var childRowObjects = this.parent.grid.infiniteScrollModule[generateRows](args.childData, args);\n var childRowElements = [];\n for (var i = 0; i < childRowObjects.length; i++) {\n childRowElements.push(rowRenderer.render(childRowObjects[i], cols));\n }\n rowObjects.splice.apply(rowObjects, [args.index + 1, 0].concat(childRowObjects));\n for (var i = 0; i < childRowElements.length; i++) {\n if (position === 'after') {\n rows[args.index + i][position](childRowElements[i]);\n }\n else {\n rows[args.index + i + 1][position](childRowElements[i]);\n }\n rows.splice(args.index + 1 + i, 0, childRowElements[i]);\n }\n resetRowIndex(this.parent.grid, this.parent.grid.getRowsObject(), this.parent.grid.getRows(), 0);\n };\n /**\n * Resetted the row index for expand collapse action for cache support.\n *\n * @returns {void}\n */\n InfiniteScroll.prototype.contentready = function () {\n if (this.parent.infiniteScrollSettings.enableCache && !isNullOrUndefined(this.parent.editModule)) {\n var updateIndex = 'updateIndex';\n this.parent.editModule[updateIndex](this.parent.grid.dataSource, this.parent.getRows(), this.parent.getCurrentViewRecords());\n if (this.parent.getFrozenColumns()) {\n this.parent.editModule[updateIndex](this.parent.grid.dataSource, this.parent.getMovableDataRows(), this.parent.getCurrentViewRecords());\n }\n }\n };\n InfiniteScroll.prototype.collapseExpandInfinitechilds = function (row) {\n row.record.expanded = row.action === 'collapse' ? false : true;\n var ret = {\n result: this.parent.flatData,\n row: row.row,\n action: row.action,\n record: row.record,\n count: this.parent.flatData.length\n };\n var requestType = getValue('isCollapseAll', this.parent) ? 'collapseAll' : 'refresh';\n getValue('grid.renderModule', this.parent).dataManagerSuccess(ret, { requestType: requestType });\n };\n /**\n * Handles the page query for Data operations and CRUD actions.\n *\n * @param {{ result: ITreeData[], count: number, actionArgs: object }} pageingDetails - data, its count and action details\n * @param {ITreeData[]} pageingDetails.result - data on scroll action\n * @param {number} pageingDetails.count - data count on scroll action\n * @param {Object} pageingDetails.actionArgs - scroll action details\n * @returns {void}\n */\n InfiniteScroll.prototype.infinitePageAction = function (pageingDetails) {\n var _this = this;\n var dm = new DataManager(pageingDetails.result);\n var expanded = new Predicate('expanded', 'notequal', null).or('expanded', 'notequal', undefined);\n var infiniteParents = dm.executeLocal(new Query().where(expanded));\n var visualData = infiniteParents.filter(function (e) {\n return getExpandStatus(_this.parent, e, infiniteParents);\n });\n var actionArgs = getValue('actionArgs', pageingDetails.actionArgs);\n var actions = getValue('actions', this.parent.grid.infiniteScrollModule);\n var initial = actions.some(function (value) { return value === actionArgs.requestType; });\n var initialRender = initial ? true : this.parent.initialRender ? true : false;\n this.visualData = visualData;\n pageingDetails.count = visualData.length;\n if (getValue('isPrinting', pageingDetails.actionArgs)) {\n pageingDetails.result = visualData;\n }\n else {\n var query = new Query();\n var isCache = this.parent.infiniteScrollSettings.enableCache;\n if (isCache && this.parent.infiniteScrollSettings.initialBlocks > this.parent.infiniteScrollSettings.maxBlocks) {\n this.parent.infiniteScrollSettings.initialBlocks = this.parent.infiniteScrollSettings.maxBlocks;\n }\n var size = initialRender ?\n this.parent.pageSettings.pageSize * this.parent.infiniteScrollSettings.initialBlocks :\n this.parent.pageSettings.pageSize;\n var current = this.parent.grid.pageSettings.currentPage;\n if (!isNullOrUndefined(actionArgs)) {\n var lastIndex = getValue('lastIndex', this.parent.grid.infiniteScrollModule);\n var firstIndex = getValue('firstIndex', this.parent.grid.infiniteScrollModule);\n if (!isCache && actionArgs.requestType === 'delete') {\n var skip = lastIndex - actionArgs.data.length + 1;\n var take = actionArgs.data.length;\n query = query.skip(skip).take(take);\n }\n else if (isCache && actionArgs.requestType === 'delete' ||\n (actionArgs.requestType === 'save' && actionArgs.action === 'add')) {\n query = query.skip(firstIndex);\n query = query.take(this.parent.infiniteScrollSettings.initialBlocks * this.parent.pageSettings.pageSize);\n }\n else {\n if ((pageingDetails.actionArgs['action'] === 'expand' || pageingDetails.actionArgs['action'] === 'collapse') && this.parent.grid.pageSettings.currentPage !== 1) {\n current = 1;\n size = this.parent.pageSettings.pageSize * this.parent.grid.pageSettings.currentPage;\n }\n query = query.page(current, size);\n }\n }\n else {\n query = query.page(current, size);\n }\n dm.dataSource.json = visualData;\n if (!isCache && !isNullOrUndefined(actionArgs) && actionArgs.requestType === 'save' && actionArgs.action === 'add') {\n pageingDetails.result = [actionArgs.data];\n }\n else {\n pageingDetails.result = dm.executeLocal(query);\n }\n }\n this.parent.notify('updateAction', pageingDetails);\n };\n /**\n * Handles the currentviewdata for delete operation.\n *\n * @param {{ e: InfiniteScrollArgs, result: Object[] }} args - Scroller and data details\n * @param {InfiniteScrollArgs} args.e - scroller details while CRUD\n * @param {Object[]} args.result - data details while CRUD\n * @returns {void}\n */\n InfiniteScroll.prototype.infiniteEditHandler = function (args) {\n var infiniteData = 'infiniteCurrentViewData';\n var infiniteCurrentViewData = this.parent.grid.infiniteScrollModule[infiniteData];\n var keys = Object.keys(infiniteCurrentViewData);\n if (args.e.requestType === 'delete' && args.result.length > 1) {\n for (var i = 1; i < args.result.length; i++) {\n infiniteCurrentViewData[keys[keys.length - 1]].push(args.result[i]);\n }\n }\n };\n /**\n * Handles the row objects for delete operation.\n *\n * @param {ActionEventArgs} args - crud action details\n * @returns {void}\n */\n InfiniteScroll.prototype.infiniteDeleteHandler = function (args) {\n if (args.requestType === 'delete') {\n var rows = this.parent.grid.getRowsObject();\n var rowElms = this.parent.getRows();\n var data = args.data instanceof Array ? args.data : [args.data];\n var keyField = this.parent.grid.getPrimaryKeyFieldNames()[0];\n this.removeRows(rowElms, rows, data, keyField, true);\n if (this.parent.getFrozenColumns() > 0) {\n var mRows = this.parent.grid.getMovableRowsObject();\n var mRowElms = this.parent.grid.getMovableRows();\n this.removeRows(mRowElms, mRows, data, keyField);\n }\n }\n };\n /**\n * Handles the row objects for delete operation.\n *\n * @param {Element[]} rowElms - row elements\n * @param {Row<Column>[]} rows - Row object collection\n * @param {Object[]} data - data collection\n * @param {string} keyField - primary key name\n * @param { boolean} isFrozen - Specifies whether frozen column enabled\n * @returns {void}\n */\n InfiniteScroll.prototype.removeRows = function (rowElms, rows, data, keyField, isFrozen) {\n var _this = this;\n var resetInfiniteCurrentViewData = 'resetInfiniteCurrentViewData';\n var _loop_1 = function (i) {\n rows.filter(function (e, index) {\n if (e.data[keyField] === data[i][keyField]) {\n if (isFrozen) {\n var page = Math.ceil((index + 1) / _this.parent.grid.pageSettings.pageSize);\n _this.parent.grid.infiniteScrollModule[resetInfiniteCurrentViewData](page, index);\n }\n rows.splice(index, 1);\n remove(rowElms[index]);\n rowElms.splice(index, 1);\n }\n });\n };\n for (var i = 0; i < data.length; i++) {\n _loop_1(i);\n }\n };\n /**\n * Handles the row objects for Add operation.\n */\n InfiniteScroll.prototype.createRows = function (eventArgs) {\n var locator = 'serviceLocator';\n var actionArgs = eventArgs.args.e;\n var row = eventArgs.row;\n var serviceLocator = this.parent.grid.infiniteScrollModule[locator];\n var rowRenderer = new RowRenderer(serviceLocator, null, this.parent.grid);\n var tbody;\n var currentData = this.parent.getCurrentViewRecords();\n var currentRows = eventArgs.isMovable ? this.parent.grid.getMovableRows()\n : this.parent.grid.getDataRows();\n if (eventArgs.isFrozenRight) {\n tbody = this.parent.element.querySelector('.e-frozen-right-content').querySelector('tbody');\n }\n else {\n tbody = !this.parent.grid.isFrozenGrid() ? this.parent.getContent().querySelector('tbody') : eventArgs.isMovable\n ? this.parent.grid.getMovableVirtualContent().querySelector('tbody')\n : this.parent.grid.getFrozenVirtualContent().querySelector('tbody');\n }\n if (this.parent.frozenRows) {\n tbody = eventArgs.isFrozenRows && this.parent.grid.infiniteScrollModule.requestType !== 'add'\n || !eventArgs.isFrozenRows && this.parent.grid.infiniteScrollModule.requestType === 'add'\n ? !this.parent.grid.isFrozenGrid() ? this.parent.getHeaderContent().querySelector('tbody')\n : eventArgs.isMovable ? this.parent.grid.getMovableVirtualHeader().querySelector('tbody')\n : eventArgs.isFrozenRight ? this.parent.element.querySelector('.e-frozen-right-header').querySelector('tbody')\n : this.parent.grid.getFrozenVirtualHeader().querySelector('tbody') : tbody;\n }\n var position;\n var addRowIndex = 'addRowIndex';\n var newRowIndex = this.parent.editModule[addRowIndex];\n for (var i = 0; i < row.length; i++) {\n var newRow = rowRenderer.render(row[i], this.parent.grid.getColumns());\n if (actionArgs.requestType === 'save' && actionArgs.action === 'add') {\n if (getValue('selectedIndex', this.parent.editModule) !== -1 && this.parent.editSettings.newRowPosition !== 'Top') {\n if (this.parent.editSettings.newRowPosition === 'Below' || this.parent.editSettings.newRowPosition === 'Child') {\n position = 'after';\n newRowIndex += findChildrenRecords(currentData[newRowIndex + 1]).length;\n if (this.parent.editSettings.newRowPosition === 'Child') {\n newRowIndex -= 1; //// for child position already child record is added in childRecords so subtracting 1\n }\n currentRows[newRowIndex][position](newRow);\n }\n else if (this.parent.editSettings.newRowPosition === 'Above') {\n position = 'before';\n currentRows[this.parent.editModule[addRowIndex]][position](newRow);\n }\n }\n else if (this.parent.editSettings.newRowPosition === 'Bottom') {\n tbody.appendChild(newRow);\n }\n else {\n tbody.insertBefore(newRow, tbody.firstElementChild);\n }\n }\n else if (actionArgs.requestType === 'delete') {\n tbody.appendChild(newRow);\n }\n }\n eventArgs.cancel = true;\n };\n /**\n * To destroy the infiniteScroll module\n *\n * @returns {void}\n * @hidden\n */\n InfiniteScroll.prototype.destroy = function () {\n this.removeEventListener();\n };\n return InfiniteScroll;\n}());\nexport { InfiniteScroll };\n","import * as index from './index';\nindex.TreeGrid.Inject(index.Filter, index.Page, index.Sort, index.Reorder, index.Toolbar, index.Aggregate, index.Resize, index.ColumnMenu, index.ExcelExport, index.PdfExport, index.CommandColumn, index.ContextMenu, index.Edit, index.Selection, index.VirtualScroll, index.DetailRow, index.RowDD, index.Freeze, index.ColumnChooser, index.Logger, index.InfiniteScroll);\nexport * from './index';\n"],"names":["isRemoteData","parent","dataSource","DataManager","adaptor","ODataAdaptor","WebApiAdaptor","WebMethodAdaptor","CacheAdaptor","UrlAdaptor","isCountRequired","isCheckboxcolumn","i","columns","length","showCheckbox","isFilterChildHierarchy","isNullOrUndefined","grid","searchSettings","key","hierarchyMode","allowFiltering","filterSettings","findParentRecords","records","datas","len","Object","keys","getObject","push","getExpandStatus","record","parents","childParent","parentRecord","parentItem","getParentData","uniqueID","initialRender","expandStateMapping","expanded","findChildrenRecords","hasChildRecords","childRecords","concat","isOffline","dm","ready","extendArray","array","obj","objArr","j","getPlainData","value","index","level","taskData","requireFilter","isHidden","el","style","window","getComputedStyle","display","visibility","editAction","details","control","isSelfReference","addRowIndex","selectedIndex","columnName","addRowRecord","batchChanges","action","getPrimaryKeyFieldNames","treeData","json","modifiedData","originalData","isSkip","editSettings","mode","editModule","getBatchChanges","addAct","addAction","Array","extend","newRowPosition","k","prototype","hasOwnProperty","call","editedData","parentIdMapping","idMapping","splice","childMapping","updateParentRow","currentData_1","parentData","flatData","filter","e","p","enableImmutableMode","removeChildRecords","currentViewRecords","getCurrentViewRecords","unshift","primaryKeys","currentdata","isChildAll","editRowIndex","updateCurrentViewData","child","index_1","currentRecords","map","enableVirtualization","getValue","parentUniqueID","sortSettings","indexOf","data","setRowData","row","getRowByIndex","getRows","getRowIndexByPrimaryKey","movableRow","frozenRows","getFrozenColumns","getMovableRowByIndex","index_2","treeColumnIndex","allowRowDragAndDrop","renderModule","cellRender","cell","cells","column","getColumns","requestType","RowModifier","Column","options","this","allowEditing","edit","disableHtmlEncode","allowReordering","showColumnMenu","allowSorting","allowResizing","merge","__extends","extendStatics","d","b","setPrototypeOf","__proto__","__","constructor","create","__decorate","decorators","target","desc","c","arguments","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","Predicate","_super","apply","Property","ChildProperty","FilterSettings","Collection","TextWrapSettings","DOC_URL","BASE_DOC_URL","IsRowDDEnabled","Logger","Grid","Inject","GridLogger","getModuleName","log","types","args","type","item","detailLists","cOp","check","success","message","generateMessage","replace","gridurl","substring","treeGridObj","dataStateChange","console","logType","treeLog","treeGrid","isPrimaryKey","treeGridDetails","mapping_fields_missing","opt","ERROR","TreeClipboard","_this","treeCopyContent","copiedUniqueIdCollection","treeGridParent","setCopyData","withHeader","getSelection","toString","clipBoardTextArea","rows","selectionSettings","selectedIndexes","getSelectedRowIndexes","sort","a","classList","contains","slice","querySelectorAll","uniqueid","getSelectedRecords","copyHierarchyMode","parentContentData","childContentData","headerTextArray","getVisibleColumns","headerText","cancel","trigger","Browser","userAgent","match","setSelectionRange","select","treeLevel","copy","paste","rowIndex","colIndex","destroy","childData","GridClipboard","Selection","selectedItems","filteredList","addEventListener","on","headerCheckbox","columnCheckbox","updateGridActions","checkboxSelection","removeEventListener","isDestroyed","off","checkBox","checkWrap","parentsUntil","querySelector","closest","selectCheckboxes","triggerChkChangeEvent","nextElementSibling","autoCheckHierarchy","checkBoxvalue","headerSelection","checkState","rowElement","checked","rowData","getCheckedRecords","getCheckboxcolumnIndex","mappingUid","columnIndex","col","uid","headerCelllength","getHeaderContent","getAttribute","headerElement","rowChkBox","createElement","className","attrs","createCheckBox","label","add","insertBefore","cloneNode","firstChild","renderColumnCheckbox","setAttribute","checkboxState","allowTextWrap","width","checkbox","removeClass","container","containerELe","spanEle","innerHTML","divEle","appendChild","rowIndexes","flatRecord","traverSelection","ischildItem","updateSelectedItems","updateParentSelection","filterModule","filteredResult","getFilteredChildRecords","count","isSummaryRow","indeter","checkChildRecords","checkBoxRecord","checkAll","filterResult","rec","currentRecord","checkedRecord","recordIndex","checkboxRecord","tr","movableTr","getMovableDataRows","checkedIndex","checkBoxclass","childLength","updatedData","forEach","getCheckedrecords","getCheckedRowIndexes","Print","GridPrint","printTreeGrid","printGrid","gridElement","queryCellInfo","rowDataBound","beforeDataBound","addClass","print","SearchSettings","SelectionSettings","Render","templateResult","columnTemplateResult","reactTemplateRender","allowPaging","pageSettings","pageSizeMode","enableCollapseAll","proxy_1","parentrec","cellElement","pad","filterLevel","totalIconsWidth","getColumnByUid","summaryRow","frozenColumns","enableColumnVirtualization","getColumnIndexByUid","emptyExpandIcon","styles","n","iconRequired","hasFilteredChildRecords","expandIcon","expand","updateTreeCell","getFrozenLeftColumnsCount","getFrozenRightColumnsCount","freezerightColumns","getFrozenRightColumns","freezeLeftColumns","getFrozenLeftColumns","movableColumns","getMovableColumns","field","notify","checkboxElement","parseInt","summaryData","rowTemplate","treeColumn","colindex","template","templateCompiler","textContent","appendChildren","children","tempID","element","id","isReact","result","DataManipulation","addedRecords","parentItems","taskIds","hierarchyData","storedIndex","sortedData","isSortAction","dataResults","updateParentRemoteData","beginSorting","updateData","collectExpandingRecs","dataProcessor","isRemote","convertToFlatData","query","Query","filterKey","params","param","where","addParams","hasChildMapping","qry","clone","queries","executeQuery","then","DataUtil","distinct","httpRequest","statusText","setValue","zerothLevelData","dataManagerSuccess","hideSpinner","convertJSONData","tempData","selfData","mappingData","executeLocal","group","groupData","items","selfReferenceUpdate","createRecords","referenceData","shift","loadChildOnDemand","getUid","Math","ceil","random","rowDetails","isChild","gridRows","getContentTable","childRecord","targetEle","getElementsByClassName","getRowObjectFromUID","childRows","parentRow","expandingTd","detailRowModule","fetchRemoteChildData","getDataModule","generateQuery","clonequries","fn","showSpinner","currentViewData","inx","getRowsObject","haveChild","aggregates","gridQuery","aggregateQuery","summaryQuery","q","summaryModule","calculateSummaryValue","totalRecordsCount","virtualArgs","remoteVirtualAction","notifyArgs","enableInfiniteScrolling","contentModule","currentInfo","prevInfo","loadNext","currentPage","nextInfo","page","parentRecords","treeGridData","currentData","dataObj","isExport","expresults","exportType","isPrinting","actionArgs","actionData","actionAddArgs","primaryKeyColumnName","dataValue","isLocalData","updateAction","filterQuery","searchQuery","results","fltrQuery","srchQuery","filteredData","gridQuery_1","srtQry","srt","compFun","sortComparer","bind","direction","sortBy","sortArgs","temp","paging","printMode","actArgs","actualResults","dataResult","RowDD","canDrop","isDraggedWithChild","hasDropItem","isaddtoBottom","GridDragDrop","getChildrecordsByParentID","Rowdraging","rowDropped","rowsAdded","rowsRemoved","reorderRows","fromIndexes","toIndex","position","tObj","dropPosition","dropIndex","dropRows","orderToIndex","refresh","dropData","totalRecord","parentrow","updatedParent","draggedRecord","dragRecords","draggedRecord_1","dragRecords_1","setProperties","deleteDragRow","refreshGridDataSource","tempDataSource","idx","droppedRecord","proxy","removeFirstrowBorder","canremove","remove","removeLastrowBorder","isEmptyRow","islastRowIndex","updateIcon","rowEle","undefined","rowPositionHeight","addErrorElem","rowTop","toolHeight","toolbar","document","getElementById","offsetHeight","positionOffSet","getOffset","contentHeight","top","scrollTop","getContent","firstElementChild","offsetTop","divide","topRowSegment","middleRowSegment","bottomRowSegment","mouseEvent","touchEvent","posy","pageY","changedTouches","isTopSegment","isMiddleRowSegment","isBottomRowSegment","removeChildBorder","removetopOrBottomBorder","addFirstrowBorder","removeErrorElem","topOrBottomBorder","addRemoveClasses","addLastRowborder","borderElem","targetRow","node","div","gridheaderEle","toolbarHeight","toolbarModule","getToolbar","multiplegrid","rowDropSettings","targetID","offsetWidth","getScrollWidth","trElement","bottomborder","gridcontentEle","bottom","scrollElem","scrollWidth","Scroll","getScrollBarWidth","dragelem","ele","errorVal","content","parentNode","removeChild","spanContent","paddingLeft","dropItemSpan","dropItemLeft","left","spanLeft","enableRtl","errorelem","errorValue","setStyleAttribute","border","box","getBoundingClientRect","body","docElem","documentElement","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","round","cloneElement","cursor","rowIdx","ensuredropPosition","rowDragAndDropModule","dropElement","ej2_instances","dragDropGrid","fromIndex","getTargetIdx","parentElement","primaryKeyField","srcControl","targetIndex","isNaN","indexes","actualData","i_1","srcControlFlatData","actualIndex","selectedRecord","isByMethod","draggedRecord_2","isMultipleGrid","dragLength","reverse","this_1","correctIndex","offsetParent","newParentIndex","recordIndex1","dropAtTop","getChildCount","droppedRecordIndex","updateChildRecordLevel","updateChildRecord","dropMiddle","nonRepeat_1","childRecordsLength","recordLevel","childItem","deletedRow","removeRecords","flatParentData","childIndex","removeChildItem","idz","parentIndex","deletedRecordCount","i_2","i_3","draggedRecords","ToolbarItem","ContextMenuItems","PageSettings","AggregateColumn","intl","Internationalization","templateFn","setFormatter","cultureName","format","skeleton","formatFn","getFormatFunction","getDateFormat","getNumberFormat","getFormatter","setTemplate","helper","footerTemplate","getEnumValue","CellType","Summary","compile","property","getTemplate","setPropertiesSilent","prop","AggregateRow","EditSettings","SortDescriptor","SortSettings","InfiniteScrollSettings","TreeGrid","uniqueIDCollection","uniqueIDFilterCollection","changedRecords","deletedRecords","objectEqualityChecker","old","current","isEqual","excludeKeys","Date","getTime","TreeGrid_1","TreeGridSelection","mergePersistTreeGridData","injectedModules","excelExport","excelExportProperties","isMultipleExport","workbook","isBlob","excelExportModule","Map","csvExport","pdfExport","pdfExportProperties","pdfDoc","pdfExportModule","preRender","TreeGridLocale","initProperties","defaultLocale","Above","Below","Child","AddRow","ExpandAll","CollapseAll","RowIndent","RowOutdent","l10n","L10n","locale","sortByColumn","isMultiSort","sortModule","sortColumn","clearSorting","removeSortColumn","search","searchString","autoFitColumns","fieldNames","resizeModule","updateColumnModel","reorderColumns","fromFName","toFName","localeObject","gridLocale","treeGridLocale","load","printModule","treeGridkeyActionHandler","allowKeyboard","parentTarget","summaryElement","expandAll","collapseAll","expandCollapseRequest","findnextRowElement","selectRow","cellIndex","row_1","clearSelection","findPreviousRowElement","rIndex","cIndex","summaryRowElement","previousElementSibling","columnModel","isExpandAll","isCollapseAll","keyConfigs","ctrlDownArrow","ctrlUpArrow","ctrlShiftUpArrow","ctrlShiftDownArrow","downArrow","upArrow","offline","RemoteSaveAdaptor","wireEvents","EventHandler","mouseClickHandler","keyboardModule","KeyboardEvents","keyAction","eventName","tabIndex","requiredModules","modules","getGridColumns","member","contextMenuItems","allowExcelExport","detailTemplate","allowPdfExport","showColumnChooser","extendRequiredModules","allowAdding","allowDeleting","isCommandColumn","allowSelection","some","commands","commandsTemplate","unwireEvents","loggerModule","render","portals","isVue","createSpinner","dataModule","autoGenerateColumns","convertTreeData","loadGrid","addListener","gridContainer","height","gridRequiredModules","appendTo","renderComplete","destroyTemplateFn","clearTemplate","afterGridRender","clipboardModule","griddata","bindGridProperties","bindedDataSource","columnQueryMode","getActualProperties","pagerTemplate","infiniteScrollSettings","enableAltRow","enableHover","enableAutoFill","enableAdaptiveUI","rowHeight","gridLines","getGridToolbar","toolbarTemplate","textWrapSettings","selectedRowIndex","getContextMenu","columnMenuItems","getGridEditSettings","clipMode","triggerEvents","bindGridEvents","rowSelecting","rowSelected","isHeaderCheckboxClicked","selectionModule","selectedRowIndexes","rowDeselected","resizeStop","excelQueryCellInfo","pdfQueryCellInfo","checkBoxChange","pdfExportComplete","excelExportComplete","excelHeaderQueryCellInfo","pdfHeaderQueryCellInfo","dataSourceChanged","recordDoubleClick","rowDeselecting","cellDeselected","cellDeselecting","columnMenuOpen","columnMenuClick","cellSelected","headerCellInfo","resizeStart","resizing","columnDrag","columnDragStart","columnDrop","beforePrint","beforeCopy","beforePaste","TreeLogger","printComplete","actionFailure","extendedGridDataBoundEvent","extendedGridEvents","extendedGridActionEvents","extendedGridEditEvents","bindGridDragEvents","bindCallBackEvents","lastRowBorder","visiblerow","isAddBorder","isPixelHeight","dataBound","updateRowTemplate","updateAltRow","req","totalRows","persistSelection","callBackPromise_1","Deferred","beforeDataBoundArgs","resolve","toolbarClick","callBackPromise","toolbarargs","cellSelecting","cellselectingArgs","beginEdit","begineditArgs","isExpandRefresh","cellSave","isContextMenuOpen","contextitems","contextMenuModule","contextMenu","cellsaveArgs","cellSaved","cellEdit","promise","batchAdd","beforeBatchSave","beforeBatchAdd","batchDelete","beforeBatchDelete","batchCancel","treeColumnRowTemplate","datacount","defaultQuery","JsonAdaptor","actionBegin","dataManager","isQueryInvokedFromData","callBackPromise_2","actionComplete","updateTreeGridModel","ag","showChildSummary","selectedRecords","selectedRows","detailDataBound","contextMenuClick","contextMenuOpen","rowDragStartHelper","rowDragStart","rowDrag","isEdit","rowDrop","registeredTemplate","allowEditOnDblClick","showConfirmDialog","showDeleteConfirmDialog","allowNextRowEdit","dialog","text","getConstant","tooltipText","Search","prefixIcon","disabled","isEmptyColumnModel","treeGridColumn","gridColumn","gridColumnCollection","_i","_a","treeColumnTextAlign","textAlign","treeColumnField","onPropertyChanged","newProp","requireRefresh","properties_1","refreshColumns","allowMultiSorting","isDataSourceChanged","eventListener","renderTable","updateTreeColumnTextAlign","closeEdit","getColumnByField","treeGridElement","hasTreeGridChild","removeListener","dataBind","getPersistData","keyEntity","ignoreOnPersist","ignoreOnColumn","currentObject","val","ignoreInArrays","addOnPersist","ignoreInColumn","touches","isEditCollapse","getPager","addRecord","saveCell","updateCell","updateRow","deleteRecord","fieldName","startEdit","editCell","enableToolbarItems","isEnable","enableItems","endEdit","openColumnChooser","x","y","columnChooserModule","deleteRow","setCellValue","primaryKey","visibleRecords","getVisibleRecords","sHeight","scrollHeight","clientHeight","goToPage","pageNo","pagerModule","updateExternalMessage","getCellFromIndex","iterateArrayOrObject","Columns","getColumnFieldNames","getFooterContent","getFooterContentTable","showColumns","showBy","hideColumns","hideBy","getColumnHeaderByField","getColumnHeaderByIndex","getColumnHeaderByUid","getColumnIndexByField","getVirtualColIndexByUid","isRefresh","gridColumns","stackedHeader","mergeColumns","storedColumn","getDataRows","dRows","getHeaderTable","getRowInfo","getUidByColumnField","cols","visible","refreshUI","refreshHeader","dialogObj","targetElement","rowInfo","collapseRow","expandRow","getCollapseExpandRecords","expandingArgs","expandCollapse","expandCollapseAllChildren","collapseArgs","setHeightForFrozenContent","updateExpandStateMapping","freeze","refreshScrollOffset","collapsingArgs","getRowHeight","scrollBy","state","totalRecords","expandAtLevel","expandAction","getRecordDetails","expandByKey","expandCollapseActionByKey","isPaging","puniqueID_1","collapseAtLevel","collapseAction","collapseByKey","startIndex","expandCollapseAll","isExpandCollapseall","updateChildOnDemand","displayAction","detailrows","remoteExpand","localExpand","deff","data_1","length_1","rows_1","args_1","collapseRemoteChild","movableRows","freezeRightRows","rows_2","getMovableRows","getFrozenRightRows","visibleRowCount","gridRow","rcell","arg","movablerows","rightrows","collapsingTd","collapse","expandElement","cRow","eRows","updateRowAndCellElements","updateResultModel","returnResult","filterByColumn","filterOperator","filterValue","predicate","matchCase","ignoreAccent","actualFilterValue","actualOperator","clearFiltering","removeFilteredColsByField","isClearFilterBar","isToggle","selectRows","selectCell","getSelectedRows","getMovableCellFromIndex","getFrozenRightRowByIndex","getFrozenRightDataRows","getFrozenRightCellFromIndex","getFrozenLeftColumnHeaderByIndex","getFrozenRightColumnHeaderByIndex","getMovableColumnHeaderByIndex","getMovableColumnsCount","getVisibleMovableCount","getVisibleFrozenRightCount","getVisibleFrozenLeftCount","getFrozenCount","cnt","isFrozen","getSelectedRowCellIndexes","baseModule","treeModule","Complex","RowDropSettings","Event","NotifyPropertyChanges","Component","Reorder","GridReorder","getTreeColumn","treeIndex","updatedCols","f","Resize","GridResize","fName","TreeVirtualRowModelGenerator","getDatas","visualData","getDataInfo","getData","generateRows","virtualInfo","info","blockIndexes","getBlockIndexes","url","checkAndResetCache","clear","cache","groups","getBlockSize","VirtualRowModelGenerator","Filter","GridFilter","isHierarchyFilter","flatFilteredData","filteredParentRecs","updatedFilteredRecord","clearFilterLevel","dataDetails","addParentRecord","ischild","checkChildExsist","parent_1","parRecord","updateParentFilteredRecord","updateFilterLevel","uniqueIDValue","childRec","isExist","parent_2","parent_3","fLevel","ExcelExport","isCollapsedStatePersist","GridExcel","updateExcelResultModel","exportRowDataBound","finalPageSetup","isCsv","Promise","isLocal","customData","manipulateExportProperties","book","dtSrc","queryResult","flatsData","dataSrc","indent","excelRow","excelrowobj","rowObj","filtercolumnlength","rowlength","excelRows","rowlevel","Boolean","expandedStatus","sublevelState","grouping","outlineLevel","isCollapsed","worksheets","pageSetup","isSummaryRowBelow","PdfExport","GridPdf","updatePdfResultModel","customsData","manipulatePdfProperties","flatDatas","paragraphIndent","Page","GridPage","collapseExpandPagedchilds","pageAction","primaryKeyField_1","ret","pageRoot","pagedResults","newResults","t","res","pageingDetails","propname","skip","size","pageSize","take","dm_1","or","parents_1","floor","Toolbar","tool","refreshToolbar","toolbarClickHandler","eventTrigger","Aggregate","GridAggregate","flatChildRecords","isSort","flatRecords","summaryLength","dataLength","getChildRecordsLength","summaryRowIndex","len_1","createSummaryItem","idx_1","currentIndex","summaryParent","length_2","itemData","summary","displayColumn","keys_1","getSummaryValues","summaryColumn","single","getFormatFromType","tempObj","requiresCount","summaryKey","sumData","toLowerCase","calculateAggregate","disp","value_1","summaryformat","Sort","GridSort","flatSortedData","updateModel","createdSortedRecords","sortParams","iterateSort","childSort","ColumnMenu","GridColumnMenu","getColumnMenu","columnMenuModule","ContextMenu","cmenu","addRow","editRecord","BatchEdit","batchChildCount","batchAddedRecords","batchDeletedRecords","batchAddRowRecord","batchRecords","isAdd","batchSave","batchPageAction","batchCancelAction","immutableBatchAction","nextCellIndex","getBatchRecords","getAddRowIndex","getSelectedIndex","getBatchChildCount","actualCellIndex","frozenCols","columnObject","getColumnByIndex","added","primaryKey_1","currentDataIndex","indexvalue","rowObjectIndex","getActualRowObjectIndex","newBatchRowAdded","changes","batchIndex","primaryParent","childRecordCount","updateChildCount","updateRowIndex","focusModule","table","matrix","childs","primarykey","parentRowIndex","getRowElementByUID","totalCount","mRows","deleteUniqueID","positionIndex","updatedRecords","primarykey_1","addRecords","ariaRowIndex","endIndex","indexValue","Edit","prevAriaRowIndex","isAddedRowByMethod","GridEdit","previousNewRowPosition","internalProperties","batchEditModule","crudAction","beginAdd","keyPressed","lastCellTab","contentready","editActionEvents","gridDblClick","customCellSave","savePreviousRowPosition","beforeStartEdit","beforeBatchCancel","resetIsOnBatch","getRowPosition","doubleClickTarget","addArgs","applyFormValidation","eventArgs","treeObj","keyData","paramsLength","infiniteAddAction","rowObjects","newRowObject","newRowObjectIndex","newRecord","updateInfiniteCurrentViewData","movableRowsObject","getMovableRowsObject","isCache","enableCache","resetRowIndex","updateIndex","newRowIndex","dataIndex","infiniteCurrentViewData","infiniteScrollModule","isOnBatch","updateGridEditMode","keyPress","prom","celleditArgs","request","toolbarID","cellDetails","treeCell","afterCellSave","form","rowIndex_1","primaryKeys_1","isTabLastRow","update","fromTable","previousValue","editArgs","filterChoiceCount","excelSearchOperator","mRow","aggregateModule","destroyWidgets","formObj","restoreFocus","saveArgs","previousData","data1","treeColIndex","l","data2","treecell","firstAriaIndex","lastAriaIndex","withinRange","isVirtualization","focussedElement","activeElement","newFreezeRowObject","rightFrozenRows","errors","focus","seletedRow","beginAddEdit","primaryKeys_2","selector","childRecordCount1","currentDataIndex1","deletedValues","previousEditMode","previousGridEditMode","editFormValidate","destroyForm","CommandColumn","Command","DetailRow","detailrow","dataBoundArg","detaildataBound","setIndentVisibility","childRowExpand","rowExpandCollapse","actioncomplete","detailele","elements","detailData","detailRowElement","detailElement","previousSibling","expandClass","classlist","gridClas","gridclass","newNo","detailClass","spann","updtdcolum","focusElement","VirtualTreeContentRenderer","locator","isExpandCollapse","translateY","maxiPage","recordAdded","preTranslate","isRemoteExpand","getModelGenerator","virtualOtherAction","indexModifier","setTop","nextSetResIndex","lastIndex","onDataReady","refreshContentRows","observers","observes","scrollArgs","scrollListeners","onEnteredAction","dataBoundEvent","rowSelectedEvent","toSelectVirtualRow","onActionComplete","virtualEditSuccess","resetIseditValue","cancelEdit","toSelectRowOnContextOpen","refreshCell","cellFocus","setVirtualHeight","contents","debounceEvent","TreeInterSectionObserver","getPanel","getTranslateY","sTop","cHeight","isOnenter","gridTop","observer","generateCells","generateCell","rowId","cellType","colSpan","oIndex","foreignKeyData","isDataCell","isTemplate","rowID","Data","isForeignKey","isForeignColumn","Cell","rowPosition","withInRange","restoreEditState","restoreNewRow","isWheel","isIE","xAxis","axis","getColumnOffset","vgenerator","getColumnIndexes","columnIndexes","cOffsets","maxLeft","virtualEle","adjustTable","header","sentinel","outBuffer","upScroll","offset","downScroll","vHeight","lastInx","remains","rowPt","firsttdinx","isLastBlock","viewInfo","previousInfo","setColumnIndexesInView","loadSelf","event","appendContent","newChild","sentinelInfo","cBlock","cOffset","setWrapperWidth","name","getTable","VirtualContentRenderer","isWheeling","newPos","lastPos","timer","callback","onEnterCallback","virtualScrollHandlers","delay","debounced50","debounce","prevTop","prevLeft","movableContainer","scrollbar","delta","clearTimeout","setTimeout","preventDefault","returnValue","axes","entered","InterSectionObserver","VirtualScroll","prevstartIndex","prevendIndex","TreeVirtual","returnVisualData","collapseExpandVirtualchilds","virtualPageAction","expandCollapseRec","counts","resourceCount","sIndex","instantiateRenderers","parentGrid","renderer","getService","RenderType","Header","VirtualHeaderRenderer","Content","ensurePageSize","GridVirtualScroll","Freeze","FreezeColumn","dblClickHandler","frozenRightRows","frozenrows","rData","queryselector","freezeModule","ColumnChooser","GridColumnChooser","X","Y","InfiniteScroll","GridInfiniteScroll","infinitePageAction","infiniteRemoteExpand","infiniteDeleteHandler","infiniteEditHandler","createRows","collapseExpandInfinitechilds","serviceLocator","rowRenderer","RowRenderer","childRowObjects","childRowElements","infiniteParents","initialBlocks","maxBlocks","firstIndex","rowElms","keyField","removeRows","mRowElms","tbody","currentRows","isMovable","isFrozenRight","isFrozenGrid","getMovableVirtualContent","getFrozenVirtualContent","isFrozenRows","getMovableVirtualHeader","getFrozenVirtualHeader","newRow","index.TreeGrid","index.Filter","index.Page","index.Sort","index.Reorder","index.Toolbar","index.Aggregate","index.Resize","index.ColumnMenu","index.ExcelExport","index.PdfExport","index.CommandColumn","index.ContextMenu","index.Edit","index.Selection","index.VirtualScroll","index.DetailRow","index.RowDD","index.Freeze","index.ColumnChooser","index.Logger","index.InfiniteScroll"],"mappings":"uEAQA,SAAgBA,GAAaC,GACzB,GAAIA,EAAOC,qBAAsBC,eAAa,CAC1C,GAAIC,GAAUH,EAAOC,WAAWE,OAChC,OAAQA,aAAmBC,iBACtBD,YAAmBE,kBAAmBF,YAAmBG,qBACzDH,YAAmBI,iBAAiBJ,YAAmBK,cAEhE,OAAO,EAMX,QAAgBC,GAAgBT,GAC5B,SAAIA,EAAOC,YAAc,UAAYD,GAAOC,YAShD,QAAgBS,GAAiBV,GAC7B,IAAK,GAAIW,GAAI,EAAGA,EAAIX,EAAOY,QAAQC,OAAQF,IACvC,GAAIX,EAAOY,QAAQD,GAAGG,aAClB,OAAO,CAGf,QAAO,EAMX,QAAgBC,GAAuBf,GACnC,SAAMgB,oBAAkBhB,EAAOiB,KAAKC,eAAeC,MAA2C,KAAnCnB,EAAOiB,KAAKC,eAAeC,KACzC,UAAxCnB,EAAOkB,eAAeE,eAAqE,SAAxCpB,EAAOkB,eAAeE,kBACzEpB,EAAOqB,iBAAkBrB,EAAOiB,KAAKK,eAAeV,QAAQC,QAChB,UAAxCb,EAAOsB,eAAeF,eAAqE,SAAxCpB,EAAOsB,eAAeF,gBAU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