@syncfusion/ej2-treegrid 20.1.55 → 20.1.56-97113

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 (126) hide show
  1. package/.eslintrc.json +16 -1
  2. package/CHANGELOG.md +15 -32
  3. package/README.md +64 -51
  4. package/dist/ej2-treegrid.min.js +1 -0
  5. package/dist/ej2-treegrid.umd.min.js +1 -10
  6. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es2015.js +2046 -1076
  8. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  9. package/dist/es6/ej2-treegrid.es5.js +2131 -1113
  10. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  11. package/dist/global/ej2-treegrid.min.js +1 -10
  12. package/dist/global/ej2-treegrid.min.js.map +1 -1
  13. package/dist/global/index.d.ts +0 -9
  14. package/helpers/e2e/index.js +8 -6
  15. package/helpers/e2e/treegridhelper.js +82 -65
  16. package/package.json +64 -64
  17. package/src/treegrid/actions/batch-edit.js +115 -87
  18. package/src/treegrid/actions/clipboard.d.ts +3 -2
  19. package/src/treegrid/actions/clipboard.js +37 -35
  20. package/src/treegrid/actions/context-menu.js +53 -1
  21. package/src/treegrid/actions/crud-actions.js +67 -56
  22. package/src/treegrid/actions/detail-row.js +7 -7
  23. package/src/treegrid/actions/edit.d.ts +1 -0
  24. package/src/treegrid/actions/edit.js +168 -115
  25. package/src/treegrid/actions/excel-export.js +2 -2
  26. package/src/treegrid/actions/filter.js +13 -16
  27. package/src/treegrid/actions/freeze-column.d.ts +1 -0
  28. package/src/treegrid/actions/freeze-column.js +48 -11
  29. package/src/treegrid/actions/infinite-scroll.js +25 -22
  30. package/src/treegrid/actions/logger.js +10 -10
  31. package/src/treegrid/actions/page.d.ts +1 -0
  32. package/src/treegrid/actions/page.js +21 -8
  33. package/src/treegrid/actions/reorder.js +2 -2
  34. package/src/treegrid/actions/rowdragdrop.js +142 -86
  35. package/src/treegrid/actions/selection.d.ts +1 -0
  36. package/src/treegrid/actions/selection.js +71 -39
  37. package/src/treegrid/actions/sort.js +17 -5
  38. package/src/treegrid/actions/summary.js +24 -24
  39. package/src/treegrid/actions/toolbar.js +45 -43
  40. package/src/treegrid/actions/virtual-scroll.js +7 -4
  41. package/src/treegrid/base/constant.d.ts +30 -0
  42. package/src/treegrid/base/constant.js +30 -0
  43. package/src/treegrid/base/data.d.ts +1 -0
  44. package/src/treegrid/base/data.js +257 -57
  45. package/src/treegrid/base/treegrid-model.d.ts +50 -34
  46. package/src/treegrid/base/treegrid.d.ts +57 -35
  47. package/src/treegrid/base/treegrid.js +363 -200
  48. package/src/treegrid/enum.d.ts +8 -2
  49. package/src/treegrid/enum.js +2 -0
  50. package/src/treegrid/models/column.d.ts +6 -6
  51. package/src/treegrid/models/column.js +9 -9
  52. package/src/treegrid/models/index.d.ts +2 -0
  53. package/src/treegrid/models/index.js +1 -0
  54. package/src/treegrid/models/loading-indicator-model.d.ts +20 -0
  55. package/src/treegrid/models/loading-indicator.d.ts +17 -0
  56. package/src/treegrid/models/loading-indicator.js +34 -0
  57. package/src/treegrid/renderer/render.d.ts +4 -4
  58. package/src/treegrid/renderer/render.js +33 -24
  59. package/src/treegrid/renderer/virtual-row-model-generator.js +15 -6
  60. package/src/treegrid/renderer/virtual-tree-content-render.d.ts +5 -2
  61. package/src/treegrid/renderer/virtual-tree-content-render.js +224 -106
  62. package/src/treegrid/renderer/virtual-tree-freeze-render.d.ts +59 -0
  63. package/src/treegrid/renderer/virtual-tree-freeze-render.js +163 -0
  64. package/src/treegrid/utils.js +13 -12
  65. package/styles/bootstrap-dark.css +14 -1
  66. package/styles/bootstrap.css +14 -1
  67. package/styles/bootstrap4.css +14 -1
  68. package/styles/bootstrap5-dark.css +16 -2
  69. package/styles/bootstrap5.css +16 -2
  70. package/styles/fabric-dark.css +14 -1
  71. package/styles/fabric.css +14 -1
  72. package/styles/fluent-dark.css +15 -2
  73. package/styles/fluent.css +15 -2
  74. package/styles/highcontrast-light.css +14 -1
  75. package/styles/highcontrast.css +14 -1
  76. package/styles/material-dark.css +14 -1
  77. package/styles/material.css +14 -1
  78. package/styles/tailwind-dark.css +14 -1
  79. package/styles/tailwind.css +14 -1
  80. package/styles/treegrid/_all.scss +1 -1
  81. package/styles/treegrid/_bootstrap-dark-definition.scss +1 -1
  82. package/styles/treegrid/_bootstrap-definition.scss +1 -2
  83. package/styles/treegrid/_bootstrap4-definition.scss +0 -1
  84. package/styles/treegrid/_bootstrap5-definition.scss +0 -1
  85. package/styles/treegrid/_fabric-dark-definition.scss +1 -2
  86. package/styles/treegrid/_fabric-definition.scss +1 -2
  87. package/styles/treegrid/_fluent-definition.scss +0 -1
  88. package/styles/treegrid/_fusionnew-definition.scss +28 -0
  89. package/styles/treegrid/_highcontrast-definition.scss +0 -1
  90. package/styles/treegrid/_highcontrast-light-definition.scss +0 -2
  91. package/styles/treegrid/_icons.scss +12 -1
  92. package/styles/treegrid/_layout.scss +4 -4
  93. package/styles/treegrid/_material-definition.scss +0 -1
  94. package/styles/treegrid/_material3-definition.scss +28 -0
  95. package/styles/treegrid/_tailwind-definition.scss +0 -1
  96. package/styles/treegrid/_theme.scss +1 -0
  97. package/styles/treegrid/bootstrap-dark.css +14 -1
  98. package/styles/treegrid/bootstrap.css +14 -1
  99. package/styles/treegrid/bootstrap4.css +14 -1
  100. package/styles/treegrid/bootstrap5-dark.css +16 -2
  101. package/styles/treegrid/bootstrap5.css +16 -2
  102. package/styles/treegrid/fabric-dark.css +14 -1
  103. package/styles/treegrid/fabric.css +14 -1
  104. package/styles/treegrid/fluent-dark.css +15 -2
  105. package/styles/treegrid/fluent.css +15 -2
  106. package/styles/treegrid/highcontrast-light.css +14 -1
  107. package/styles/treegrid/highcontrast.css +14 -1
  108. package/styles/treegrid/icons/_bootstrap-dark.scss +12 -1
  109. package/styles/treegrid/icons/_bootstrap.scss +12 -1
  110. package/styles/treegrid/icons/_bootstrap4.scss +12 -1
  111. package/styles/treegrid/icons/_bootstrap5.scss +11 -0
  112. package/styles/treegrid/icons/_fabric-dark.scss +12 -1
  113. package/styles/treegrid/icons/_fabric.scss +12 -1
  114. package/styles/treegrid/icons/_fluent.scss +11 -0
  115. package/styles/treegrid/icons/_fusionnew.scss +26 -0
  116. package/styles/treegrid/icons/_highcontrast-light.scss +12 -1
  117. package/styles/treegrid/icons/_highcontrast.scss +11 -0
  118. package/styles/treegrid/icons/_material-dark.scss +12 -1
  119. package/styles/treegrid/icons/_material.scss +11 -0
  120. package/styles/treegrid/icons/_material3.scss +26 -0
  121. package/styles/treegrid/icons/_tailwind-dark.scss +11 -0
  122. package/styles/treegrid/icons/_tailwind.scss +11 -0
  123. package/styles/treegrid/material-dark.css +14 -1
  124. package/styles/treegrid/material.css +14 -1
  125. package/styles/treegrid/tailwind-dark.css +14 -1
  126. package/styles/treegrid/tailwind.css +14 -1
@@ -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/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/actions/rowdragdrop.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 if (action === 'add') {\n row = control.getRows()[control.grid.getCurrentViewRecords().indexOf(record)];\n }\n else {\n row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record[key])];\n }\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 /**\n * Update the State changes reflected for TreeGrid columndirective in react platform.\n *\n * @param {Column} column - specifies the column\n * @returns {void}\n * @hidden\n */\n Column.prototype.setProperties = function (column) {\n //Angular two way binding\n var keys = Object.keys(column);\n for (var i = 0; i < keys.length; i++) {\n this[keys[i]] = column[keys[i]];\n //Refresh the react columnTemplates on state change\n if (this.parent && this.parent['isReact'] && keys[i] === 'template') {\n var refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';\n this.parent.clipboardModule['treeGridParent'].renderModule[refreshReactColumnTemplateByUid](this.uid);\n }\n }\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 stackedHeader = \"stackedHeader\";\n var columnModel = 'columnModel';\n var columns = this.parent[stackedHeader] ? this.parent[columnModel] : (this.parent.columns);\n for (var col = 0; col < columns.length; col++) {\n if (columns[col].showCheckbox) {\n mappingUid = 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, CellRenderer } 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 /**\n * @param {string} columnUid - Defines column uid\n * @returns {void}\n * @hidden\n */\n Render.prototype.refreshReactColumnTemplateByUid = function (columnUid) {\n var _this = this;\n if (this.parent.isReact) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.parent.clearTemplate(['columnTemplate'], undefined, function () {\n var cells = 'cells';\n var rowIdx = 'index';\n var rowsObj = _this.parent.grid.getRowsObject();\n var indent = _this.parent.grid.getIndentCount();\n var cellIndex = _this.parent.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.parent.grid, _this.parent.grid.serviceLocator);\n var td = _this.parent.getCellFromIndex(rowsObj[j].index, cellIndex - indent);\n cellRenderer.refreshTD(td, cell, rowsObj[j].data, { index: rowsObj[j][rowIdx] });\n }\n }\n });\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","/**\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 { 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.indentOutdentAction = 'indentOutdentAction';\n _this.modifiedRecords = [];\n _this.stackedHeader = false;\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 var IsRowDDInjected = this.injectedModules.filter(function (e) {\n return e.name === 'RowDD';\n });\n if (this.allowRowDragAndDrop || IsRowDDInjected.length) {\n if ((!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') ||\n this.toolbar['includes']('Outdent')))) {\n this.isIndentEnabled = true;\n }\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 if (this.isIndentEnabled) {\n this.refreshToolbarItems();\n }\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.refreshToolbarItems = function () {\n var toolbarElement = this.toolbarModule.getToolbar();\n var indentID = this.element.id + '_gridcontrol_indent';\n var outdentID = this.element.id + '_gridcontrol_outdent';\n var indentElement = toolbarElement.querySelector('#' + indentID).parentElement;\n var outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;\n indentElement.classList.add('e-hidden');\n outdentElement.classList.add('e-hidden');\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 selectedItem_1 = [_this.selectedRecords];\n var actionArgs = {\n data: selectedItem_1,\n dropIndex: _this.dropIndex,\n dropPosition: _this.dropPosition,\n modifiedRecords: _this.modifiedRecords,\n requestType: _this.action,\n row: _this.selectedRows\n };\n _this.trigger(events.actionComplete, actionArgs);\n var currentPageItem = _this.getCurrentViewRecords().filter(function (e) {\n return e.uniqueID === selectedItem_1[0].uniqueID;\n });\n if (!currentPageItem.length) {\n _this.refreshToolbarItems();\n }\n _this.action = '';\n _this.selectedRecords = _this.selectedRows = _this.modifiedRecords = [];\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,\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,\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 var columnModel = 'columnModel';\n if (this.grid.columns.length !== this.columnModel.length) {\n Columns = this.grid[columnModel];\n }\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 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 this.stackedHeader = true;\n }\n if (!this.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 /**\n * Indents the record to one level of hierarchy. Moves the selected row as the last child of its previous row.\n *\n * @param {Object} record – specifies the record to do indented\n * @returns {void}\n */\n TreeGrid.prototype.indent = function (record) {\n if (!isNullOrUndefined(this.rowDragAndDropModule)) {\n record = record;\n this.rowDragAndDropModule[this.indentOutdentAction](record, 'indent');\n }\n };\n /**\n * Outdent the record to one level of hierarchy. Moves the selected row as sibling to its parent row.\n *\n * @param {Object} record – specifies the record to do outdented\n * @returns {void}\n */\n TreeGrid.prototype.outdent = function (record) {\n if (!isNullOrUndefined(this.rowDragAndDropModule)) {\n record = record;\n this.rowDragAndDropModule[this.indentOutdentAction](record, 'outdent');\n }\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","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.modifiedRecords = 'modifiedRecords';\n /** @hidden */\n this.selectedRecords = 'selectedRecords';\n /** @hidden */\n this.selectedRows = 'selectedRows';\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 dropPosition = 'dropPosition';\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 this.parent[dropPosition] = this.dropPosition;\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.indentOutdentAction = function (record, request) {\n var tObj = this.parent;\n var action = 'action';\n var droppedIndex = 'dropIndex';\n var selectedItemIndex = -1;\n if (isNullOrUndefined(record) && this.parent.selectedRowIndex === -1) {\n return;\n }\n else {\n if (this.parent.enableVirtualization && this.parent.selectedRowIndex !== -1) {\n selectedItemIndex = this.parent.getSelectedRows()[0].rowIndex;\n }\n else if (this.parent.selectedRowIndex !== -1) {\n selectedItemIndex = this.parent.selectedRowIndex;\n }\n this.selectedItem = isNullOrUndefined(record) ?\n tObj.getCurrentViewRecords()[selectedItemIndex] : record;\n var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];\n var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[primaryKeyField]);\n this.selectedRow = this.parent[this.selectedRows] = selectedItemIndex !== -1 ?\n this.parent.getSelectedRows()[0]\n : this.parent.grid.getRowByIndex(rowIndex);\n this.selectedRecord = this.parent[this.selectedRecords] = selectedItemIndex !== -1 ?\n tObj.getCurrentViewRecords()[selectedItemIndex]\n : this.selectedItem;\n if (request === 'indent') {\n var record_1 = tObj.getCurrentViewRecords()[this.selectedRow.rowIndex - 1];\n var dropIndex = void 0;\n if (this.selectedRow.rowIndex === 0 || this.selectedRow.rowIndex === -1 ||\n tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level - record_1.level === 1) {\n return;\n }\n if (record_1.level > this.selectedRecord.level) {\n for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {\n if (tObj.getCurrentViewRecords()[i].taskData === record_1.parentItem.taskData) {\n dropIndex = i;\n }\n }\n }\n else {\n dropIndex = this.selectedRow.rowIndex - 1;\n }\n tObj[action] = 'indenting';\n tObj[droppedIndex] = dropIndex;\n this.eventTrigger('indenting', dropIndex);\n }\n else if (request === 'outdent') {\n if (this.selectedRow.rowIndex === -1 || this.selectedRow.rowIndex === 0 ||\n tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level === 0) {\n return;\n }\n var dropIndex = void 0;\n var parentItem = this.selectedRecord.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 tObj[action] = 'outdenting';\n tObj[droppedIndex] = dropIndex;\n this.eventTrigger('outdenting', dropIndex);\n }\n }\n };\n RowDD.prototype.eventTrigger = function (action, dropIndex) {\n var _this = this;\n var actionArgs = {\n action: action,\n cancel: false,\n data: [this.parent[this.selectedRecords]],\n row: this.parent[this.selectedRows]\n };\n this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {\n if (!actionArgs.cancel) {\n if (actionArgs.action === 'indenting') {\n _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'child');\n }\n else if (actionArgs.action === 'outdenting') {\n _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'below');\n }\n }\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)\n && 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, data) {\n var parentItem = record.parentItem;\n var selectedItemIndex = -1;\n if (this.parent.enableVirtualization && this.parent.selectedRowIndex !== -1) {\n selectedItemIndex = this.parent.getSelectedRows()[0].rowIndex;\n }\n else if (this.parent.selectedRowIndex !== -1) {\n selectedItemIndex = this.parent.selectedRowIndex;\n }\n if (this.dropPosition === 'bottomSegment') {\n var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];\n var rowIndex = selectedItemIndex === -1 ?\n (this.parent.grid.getRowIndexByPrimaryKey(data[0][primaryKeyField])) - 1\n : this.parent.getSelectedRowIndexes()[0] - 1;\n var selectedRecord = this.parent.getCurrentViewRecords()[rowIndex];\n this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);\n }\n if (this.dropPosition === 'middleSegment') {\n var level = this.parent.getCurrentViewRecords()[selectedItemIndex].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 primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];\n var rowIndex = tObj.selectedRowIndex === -1 ?\n (this.parent.grid.getRowIndexByPrimaryKey(args.data[0][primaryKeyField])) - 1\n : tObj.getSelectedRowIndexes()[0] - 1;\n var record = tObj.getCurrentViewRecords()[rowIndex];\n this.getParentData(record, args.data);\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 this.parent[this.modifiedRecords].push(args.data[0], droppedRecord);\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 if (this.parent[this.modifiedRecords].indexOf(flatParentData) === -1 && !isNullOrUndefined(flatParentData)) {\n this.parent[this.modifiedRecords].push(flatParentData);\n }\n if (!isNullOrUndefined(flatParentData)) {\n this.updateModifiedRecords(flatParentData);\n }\n }\n };\n RowDD.prototype.updateModifiedRecords = function (record) {\n var parentData = getParentData(this.parent, record.parentUniqueID);\n if (!isNullOrUndefined(parentData)) {\n this.parent[this.modifiedRecords].push(parentData);\n this.updateModifiedRecords(parentData);\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","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 var indentElement;\n var outdentElement;\n var indentID = tObj.element.id + '_gridcontrol_indent';\n var outdentID = tObj.element.id + '_gridcontrol_outdent';\n var toolbarElement = this.parent.grid.toolbarModule.getToolbar();\n var indentEle = toolbarElement.querySelector('#' + indentID);\n var outdentEle = toolbarElement.querySelector('#' + outdentID);\n var row = args.row;\n var selectedrow = tObj.getSelectedRows()[0];\n if (!isNullOrUndefined(row[0])) {\n row = row[0];\n }\n row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;\n if (indentEle !== null && outdentEle !== null) {\n indentElement = toolbarElement.querySelector('#' + indentID).parentElement;\n outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;\n if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {\n indentElement.classList.add('e-hidden');\n outdentElement.classList.add('e-hidden');\n }\n else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {\n var selectedItem = tObj.getCurrentViewRecords()[row.rowIndex];\n if (!isNullOrUndefined(selectedItem)) {\n if ((selectedItem.level > tObj.getCurrentViewRecords()[row.rowIndex - 1].level)) {\n indentElement.classList.add('e-hidden');\n }\n else {\n indentElement.classList.remove('e-hidden');\n }\n if (selectedItem.level === tObj.getCurrentViewRecords()[row.rowIndex - 1].level) {\n indentElement.classList.remove('e-hidden');\n }\n if (selectedItem.level === 0) {\n outdentElement.classList.add('e-hidden');\n }\n if (selectedItem.level !== 0) {\n outdentElement.classList.remove('e-hidden');\n }\n }\n }\n if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {\n if (this.parent.toolbar['includes']('Indent')) {\n indentElement.classList.add('e-hidden');\n }\n if (this.parent.toolbar['includes']('Outdent')) {\n outdentElement.classList.add('e-hidden');\n }\n }\n }\n };\n Toolbar.prototype.toolbarClickHandler = function (args) {\n var tObj = this.parent;\n var indentOutdentAction = 'indentOutdentAction';\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 && !isNullOrUndefined(tObj.rowDragAndDropModule)) {\n this.parent.rowDragAndDropModule[indentOutdentAction](null, 'indent');\n }\n if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length\n && !isNullOrUndefined(tObj.rowDragAndDropModule)) {\n this.parent.rowDragAndDropModule[indentOutdentAction](null, 'outdent');\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].getAttribute('aria-rowindex'), 10);\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 ? currentData.indexOf(currentData[0]) : 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 && this.startIndex === -1)) {\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' || requestType === 'searching' ||\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","setProperties","clipboardModule","uid","__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","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","refreshReactColumnTemplateByUid","columnUid","clearTemplate","undefined","rowsObj","getRowsObject","indent","getIndentCount","cellIndex","getNormalizedColumnIndex","isDataRow","cellRenderer","CellRenderer","serviceLocator","td","getCellFromIndex","refreshTD","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","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","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","indentOutdentAction","modifiedRecords","stackedHeader","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","parentElement","findnextRowElement","selectRow","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","toolbar","contextMenuItems","allowExcelExport","detailTemplate","allowPdfExport","showColumnChooser","extendRequiredModules","IsRowDDInjected","name","isIndentEnabled","allowAdding","allowDeleting","isCommandColumn","allowSelection","some","commands","commandsTemplate","unwireEvents","remove","loggerModule","render","portals","isVue","createSpinner","dataModule","autoGenerateColumns","convertTreeData","loadGrid","rowDropSettings","targetID","addListener","gridContainer","height","gridRequiredModules","appendTo","refreshToolbarItems","renderComplete","destroyTemplateFn","toolbarElement","toolbarModule","getToolbar","indentID","outdentID","indentElement","outdentElement","afterGridRender","griddata","bindGridProperties","bindedDataSource","enableRtl","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","refresh","selectedItem_1","selectedRecords","dropIndex","dropPosition","selectedRows","detailDataBound","contextMenuClick","contextMenuOpen","rowDragStartHelper","rowDragStart","rowDrag","isEdit","rowDrop","registeredTemplate","allowEditOnDblClick","showConfirmDialog","showDeleteConfirmDialog","allowNextRowEdit","dialog","text","getConstant","tooltipText","Search","prefixIcon","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","document","getElementById","getPersistData","keyEntity","ignoreOnPersist","ignoreOnColumn","currentObject","val","ignoreInArrays","addOnPersist","ignoreInColumn","touches","isEditCollapse","getPager","addRecord","position","saveCell","updateCell","updateRow","deleteRecord","fieldName","startEdit","editCell","enableToolbarItems","isEnable","enableItems","endEdit","openColumnChooser","x","y","columnChooserModule","deleteRow","setCellValue","primaryKey","visibleRecords","getVisibleRecords","sHeight","scrollHeight","clientHeight","getContent","goToPage","pageNo","pagerModule","updateExternalMessage","iterateArrayOrObject","Columns","getColumnFieldNames","getFooterContent","getFooterContentTable","showColumns","showBy","hideColumns","hideBy","getColumnHeaderByField","getColumnHeaderByIndex","getColumnHeaderByUid","getColumnIndexByField","getVirtualColIndexByUid","isRefresh","gridColumns","mergeColumns","storedColumn","getDataRows","dRows","getHeaderTable","getRowInfo","getUidByColumnField","cols","visible","indexes","refreshUI","refreshHeader","dialogObj","targetElement","rowInfo","collapseRow","expandRow","getCollapseExpandRecords","expandingArgs","expandCollapse","expandCollapseAllChildren","collapseArgs","setHeightForFrozenContent","updateExpandStateMapping","freeze","refreshScrollOffset","collapsingArgs","firstElementChild","scrollTop","getRowHeight","scrollBy","state","totalRecords","expandAtLevel","expandAction","getRecordDetails","expandByKey","expandCollapseActionByKey","isPaging","this_1","puniqueID_1","collapseAtLevel","collapseAction","collapseByKey","primaryKeyField","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","i_1","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","reorderRows","fromIndexes","toIndex","rowDragAndDropModule","outdent","Complex","RowDropSettings","Event","NotifyPropertyChanges","Component","Reorder","GridReorder","getTreeColumn","treeIndex","updatedCols","f","Resize","GridResize","fName","RowDD","canDrop","isDraggedWithChild","hasDropItem","isaddtoBottom","GridDragDrop","getChildrecordsByParentID","Rowdraging","rowDropped","rowsAdded","rowsRemoved","tObj","dropRows","orderToIndex","dropData","totalRecord","parentrow","request","selectedItemIndex","selectedItem","selectedRow","selectedRecord","record_1","eventTrigger","updatedParent","draggedRecord","dragRecords","draggedRecord_1","dragRecords_1","deleteDragRow","refreshGridDataSource","tempDataSource","idx","droppedRecord","proxy","removeFirstrowBorder","canremove","removeLastrowBorder","isEmptyRow","islastRowIndex","updateIcon","rowEle","rowPositionHeight","addErrorElem","rowTop","toolHeight","offsetHeight","positionOffSet","getOffset","contentHeight","top","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","multiplegrid","offsetWidth","getScrollWidth","trElement","bottomborder","gridcontentEle","bottom","scrollElem","scrollWidth","Scroll","getScrollBarWidth","dragelem","ele","errorVal","content","parentNode","removeChild","spanContent","paddingLeft","dropItemSpan","dropItemLeft","left","spanLeft","errorelem","errorValue","setStyleAttribute","border","box","getBoundingClientRect","body","docElem","documentElement","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","round","cloneElement","cursor","rowIdx","ensuredropPosition","dropElement","ej2_instances","dragDropGrid","fromIndex","getTargetIdx","srcControl","targetIndex","isNaN","actualData","srcControlFlatData","actualIndex","isByMethod","draggedRecord_2","isMultipleGrid","dragLength","reverse","correctIndex","offsetParent","newParentIndex","recordIndex1","dropAtTop","getChildCount","droppedRecordIndex","updateChildRecordLevel","updateChildRecord","dropMiddle","nonRepeat_1","childRecordsLength","recordLevel","childItem","deletedRow","removeRecords","flatParentData","childIndex","removeChildItem","idz","parentIndex","deletedRecordCount","updateModifiedRecords","i_2","i_3","draggedRecords","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","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","indentEle","outdentEle","selectedrow","isCheckBoxSelection","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","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","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","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,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,gBAUtF,QAAgBG,GAAkBC,GAG9B,IAAK,GAFDC,MAEKd,EAAI,EAAGe,EADIC,OAAOC,KAAKJ,GAASX,OACJF,EAAIe,EAAKf,IAC3BkB,YAAU,kBAAmBL,EAAQb,KAEhDc,EAAMK,KAAKN,EAAQb,GAG3B,OAAOc,GASX,QAAgBM,GAAgB/B,EAAQgC,EAAQC,GAC5C,GAEIC,GAFAC,EAAenB,oBAAkBgB,EAAOI,YAAc,KACtDC,EAAcrC,EAAQgC,EAAOI,WAAWE,SAE5C,OAAoB,OAAhBH,KACInC,EAAOuC,eAAkBvB,oBAAkBmB,EAAanC,EAAOwC,sBAC3DL,EAAanC,EAAOwC,q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AEA,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/loading-indicator.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/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/actions/rowdragdrop.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/renderer/virtual-tree-freeze-render.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[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)]);\n if (hasChild) {\n datas.push(records[parseInt(i.toString(), 10)]);\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.filter(function (item) { return !item.isSummaryRow; });\n var keys = Object.keys(childRecords);\n for (var i = 0, len = keys.length; i < len; i++) {\n datas.push(childRecords[parseInt(i.toString(), 10)]);\n if (childRecords[parseInt(i.toString(), 10)].hasChildRecords ||\n (!isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].childRecords) &&\n childRecords[parseInt(i.toString(), 10)].childRecords.length)) {\n datas = datas.concat(findChildrenRecords(childRecords[parseInt(i.toString(), 10)]));\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[parseInt(i.toString(), 10)]);\n obj = {};\n for (var j = 0; j < keys.length; j++) {\n obj[keys[parseInt(j.toString(), 10)]] = array[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]];\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[parseInt(k.toString(), 10)][\"\" + key]) === 'object') {\n modifiedData[parseInt(k.toString(), 10)] = modifiedData[parseInt(k.toString(), 10)][\"\" + key];\n }\n var keys = modifiedData[parseInt(k.toString(), 10)].taskData ?\n Object.keys(modifiedData[parseInt(k.toString(), 10)].taskData) :\n Object.keys(modifiedData[parseInt(k.toString(), 10)]);\n i = treeData.length;\n var _loop_1 = function () {\n if (treeData[parseInt(i.toString(), 10)][\"\" + key] === modifiedData[parseInt(k.toString(), 10)][\"\" + key]) {\n if (action === 'delete') {\n var currentData_1 = treeData[parseInt(i.toString(), 10)];\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[parseInt(p.toString(), 10)][\"\" + control.idMapping] === currentData_1[\"\" + control.idMapping]) {\n if (!control.enableImmutableMode && parentData.childRecords.length === parentData['Children'].length) {\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[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) && ((control.editSettings.mode !== 'Cell'\n || (!isNullOrUndefined(batchChanges) && batchChanges[\"\" + changedRecords].length === 0))\n || keys[parseInt(j.toString(), 10)] === columnName)) {\n var editedData = getParentData(control, modifiedData[parseInt(k.toString(), 10)].uniqueID);\n treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]] =\n modifiedData[parseInt(k.toString(), 10)][keys[parseInt(j.toString(), 10)]];\n if (editedData && editedData.taskData) {\n editedData.taskData[keys[parseInt(j.toString(), 10)]] = editedData[keys[parseInt(j.toString(), 10)]]\n = treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]];\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[parseInt(i.toString(), 10)][\"\" + control.idMapping];\n treeData.splice(i + 1, 0, originalData.taskData);\n }\n else {\n if (!Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], control.childMapping)) {\n treeData[parseInt(i.toString(), 10)][\"\" + control.childMapping] = [];\n }\n treeData[parseInt(i.toString(), 10)][\"\" + control.childMapping].push(originalData.taskData);\n updateParentRow(key, treeData[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)], action, control, isSelfReference, originalData);\n }\n }\n }\n return \"break\";\n }\n }\n else if (!isNullOrUndefined(treeData[parseInt(i.toString(), 10)][\"\" + control.childMapping])) {\n if (removeChildRecords(treeData[parseInt(i.toString(), 10)][\"\" + control.childMapping], modifiedData[parseInt(k.toString(), 10)], action, key, control, isSelfReference, originalData, columnName)) {\n updateParentRow(key, treeData[parseInt(i.toString(), 10)], 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[parseInt(addRowIndex.toString(), 10)];\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[parseInt(j.toString(), 10)][\"\" + key] === modifiedData[\"\" + key] ||\n (isSelfReference && childRecords[parseInt(j.toString(), 10)][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[parseInt(j.toString(), 10)], keys[parseInt(i.toString(), 10)]) &&\n (control.editSettings.mode !== 'Cell' || keys[parseInt(i.toString(), 10)] === columnName)) {\n editedData[keys[parseInt(i.toString(), 10)]] =\n editedData.taskData[keys[parseInt(i.toString(), 10)]] =\n childRecords[parseInt(j.toString(), 10)][keys[parseInt(i.toString(), 10)]] =\n modifiedData[keys[parseInt(i.toString(), 10)]];\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[parseInt(j.toString(), 10)][control.idMapping];\n childRecords.splice(j + 1, 0, originalData);\n updateParentRow(key, childRecords[parseInt(j.toString(), 10)], action, control, isSelfReference, originalData);\n }\n else {\n if (!Object.prototype.hasOwnProperty.call(childRecords[parseInt(j.toString(), 10)], control.childMapping)) {\n childRecords[parseInt(j.toString(), 10)][control.childMapping] = [];\n }\n childRecords[parseInt(j.toString(), 10)][control.childMapping].push(originalData.taskData);\n updateParentRow(key, childRecords[parseInt(j.toString(), 10)], 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[parseInt(j.toString(), 10)], 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[parseInt(j.toString(), 10)], 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[parseInt(j.toString(), 10)][control.childMapping])) {\n if (removeChildRecords(childRecords[parseInt(j.toString(), 10)][control.childMapping], modifiedData, action, key, control, isSelfReference, originalData, columnName)) {\n updateParentRow(key, childRecords[parseInt(j.toString(), 10)], 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 (control.enableVirtualization && isNullOrUndefined(index_1)) {\n var updatedParent = getValue('uniqueIDCollection.' + child.parentUniqueID, control);\n record = updatedParent;\n }\n if (!isNullOrUndefined(index_1)) {\n record = currentRecords[parseInt(index_1.toString(), 10)];\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[parseInt(i.toString(), 10)][\"\" + primaryKeys] === record[\"\" + primaryKeys]) {\n data[parseInt(i.toString(), 10)] = 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 if (action === 'add') {\n row = control.getRows()[control.grid.getCurrentViewRecords().indexOf(record)];\n }\n else {\n row = control.getRows()[control.grid.getRowIndexByPrimaryKey(record[\"\" + key])];\n }\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[parseInt(index_2.toString(), 10)] ? row.cells[parseInt(index_2.toString(), 10)]\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 /**\n * Update the State changes reflected for TreeGrid columndirective in react platform.\n *\n * @param {Column} column - specifies the column\n * @returns {void}\n * @hidden\n */\n Column.prototype.setProperties = function (column) {\n //Angular two way binding\n var keys = Object.keys(column);\n for (var i = 0; i < keys.length; i++) {\n this[keys[parseInt(i.toString(), 10)]] = column[keys[parseInt(i.toString(), 10)]];\n //Refresh the react columnTemplates on state change\n if (this.parent && this.parent['isReact'] && keys[parseInt(i.toString(), 10)] === 'template') {\n var refreshReactColumnTemplateByUid = 'refreshReactColumnTemplateByUid';\n this.parent.clipboardModule['treeGridParent'].renderModule[\"\" + refreshReactColumnTemplateByUid](this.uid);\n }\n }\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 { Property, ChildProperty } from '@syncfusion/ej2-base';\n/**\n * Configures the Loading Indicator of the Tree Grid.\n */\nvar LoadingIndicator = /** @class */ (function (_super) {\n __extends(LoadingIndicator, _super);\n function LoadingIndicator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n __decorate([\n Property('Spinner')\n ], LoadingIndicator.prototype, \"indicatorType\", void 0);\n return LoadingIndicator;\n}(ChildProperty));\nexport { LoadingIndicator };\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[parseInt(i.toString(), 10)]];\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[parseInt(i.toString(), 10)] === '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[parseInt(i.toString(), 10)] === 'module_missing') {\n message = message.replace(gridurl, DOC_URL + '/modules');\n }\n else if (type[parseInt(i.toString(), 10)] === 'primary_column_missing' || type[parseInt(i.toString(), 10)] === 'selection_key_missing') {\n message = message.replace(gridurl, BASE_DOC_URL + '/api/treegrid/column/#isprimarykey');\n }\n else if (type[parseInt(i.toString(), 10)] === 'grid_remote_edit') {\n message = message.replace(gridurl, DOC_URL + '/edit');\n }\n else if (type[parseInt(i.toString(), 10)] === 'virtual_height') {\n message = message.replace(gridurl, DOC_URL + '/virtual');\n }\n else if (type[parseInt(i.toString(), 10)] === 'check_datasource_columns') {\n message = message.replace(gridurl, DOC_URL + '/columns');\n }\n else if (type[parseInt(i.toString(), 10)] === 'locale_missing') {\n message = message.replace(gridurl, DOC_URL + '/global-local/#localization');\n }\n if (type[parseInt(i.toString(), 10)] === '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[parseInt(i.toString(), 10)]];\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, serviceLocator) {\n var _this = _super.call(this, parent.grid, serviceLocator) || this;\n _this.treeCopyContent = '';\n _this.copiedUniqueIdCollection = [];\n _this.treeGridParent = parent;\n _this.serviceLocator = serviceLocator;\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[parseInt(i.toString(), 10)]].classList.contains('e-summaryrow')) {\n var cells = [].slice.call(rows[selectedIndexes[parseInt(i.toString(), 10)]].querySelectorAll('.e-rowcell'));\n var uniqueid = this.treeGridParent.getSelectedRecords()[parseInt(i.toString(), 10)][\"\" + uniqueID];\n if (this.copiedUniqueIdCollection.indexOf(uniqueid) === -1) {\n if (this.treeGridParent.copyHierarchyMode === 'Parent' || this.treeGridParent.copyHierarchyMode === 'Both') {\n this.parentContentData(currentRecords, selectedIndexes[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)] =\n this.treeGridParent.getVisibleColumns()[parseInt(i.toString(), 10)].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[parseInt(selectedIndex.toString(), 10)][\"\" + parentItem])) {\n var treeLevel = currentRecords[parseInt(selectedIndex.toString(), 10)][\"\" + parentItem][\"\" + level];\n for (var i = 0; i < treeLevel + 1; i++) {\n for (var j = 0; j < currentRecords.length; j++) {\n if (!isNullOrUndefined(currentRecords[parseInt(selectedIndex.toString(), 10)][\"\" + parentItem]) &&\n currentRecords[parseInt(j.toString(), 10)][\"\" + uniqueID] === currentRecords[parseInt(selectedIndex.toString(), 10)][\"\" + parentItem][\"\" + uniqueID]) {\n selectedIndex = j;\n var cells = [].slice.call(rows[parseInt(selectedIndex.toString(), 10)].querySelectorAll('.e-rowcell'));\n var uniqueid = currentRecords[parseInt(j.toString(), 10)][\"\" + 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[parseInt(selectedIndex.toString(), 10)][\"\" + hasChildRecords]) {\n var childData = currentRecords[parseInt(selectedIndex.toString(), 10)][\"\" + childRecords];\n for (var i = 0; i < childData.length; i++) {\n for (var j = 0; j < currentRecords.length; j++) {\n if (!isNullOrUndefined(childData[parseInt(i.toString(), 10)][\"\" + uniqueID]) && currentRecords[parseInt(j.toString(), 10)][\"\" + uniqueID] === childData[parseInt(i.toString(), 10)][\"\" + uniqueID]) {\n if ((!isNullOrUndefined(rows[parseInt(j.toString(), 10)])) && !rows[parseInt(j.toString(), 10)].classList.contains('e-summaryrow')) {\n var cells = [].slice.call(rows[parseInt(j.toString(), 10)].querySelectorAll('.e-rowcell'));\n var uniqueid = currentRecords[parseInt(j.toString(), 10)][\"\" + 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/** @hidden */\nexport var rowDeselecting = 'rowDeselecting';\n/** @hidden */\nexport var headerContent = 'e-headercontent';\n/** @hidden */\nexport var movableContent = 'e-movablecontent';\n/** @hidden */\nexport var movableHeader = 'e-movableheader';\n/** @hidden */\nexport var frozenContent = 'e-frozencontent';\n/** @hidden */\nexport var frozenHeader = 'e-frozenheader';\n/** @hidden */\nexport var content = 'e-content';\n/** @hidden */\nexport var table = 'e-table';\n/** @hidden */\nexport var leftRight = 'Left-Right';\n/** @hidden */\nexport var frozenRight = 'frozen-right';\n/** @hidden */\nexport var frozenLeft = 'frozen-left';\n/** @hidden */\nexport var dataColIndex = 'data-colindex';\n/** @hidden */\nexport var ariaColIndex = 'aria-colindex';\n/** @hidden */\nexport var dataRowIndex = 'data-rowindex';\n/** @hidden */\nexport var ariaRowIndex = 'aria-rowindex';\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.searchingRecords = [];\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 stackedHeader = 'stackedHeader';\n var columnModel = 'columnModel';\n var columns = this.parent[\"\" + stackedHeader] ? this.parent[\"\" + columnModel] : (this.parent.columns);\n for (var col = 0; col < columns.length; col++) {\n if (columns[parseInt(col.toString(), 10)].showCheckbox) {\n mappingUid = columns[parseInt(col.toString(), 10)].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')[parseInt(j.toString(), 10)];\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', 'aria-label': '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[parseInt(i.toString(), 10)]];\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[parseInt(j.toString(), 10)])) {\n flatRecord[keys[parseInt(j.toString(), 10)]] = record[keys[parseInt(j.toString(), 10)]];\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[parseInt(count.toString(), 10)].isSummaryRow) {\n if (childRecords[parseInt(count.toString(), 10)].hasChildRecords) {\n this.traverSelection(childRecords[parseInt(count.toString(), 10)], checkboxState, true);\n }\n else {\n this.updateSelectedItems(childRecords[parseInt(count.toString(), 10)], 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[parseInt(i.toString(), 10)].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 && (!record.hasFilteredChildRecords || isNullOrUndefined(record.hasFilteredChildRecords)) && !isNullOrUndefined(this.parent['dataResults']['actionArgs']) &&\n (this.parent['dataResults']['actionArgs'].requestType === 'searching' || this.parent['dataResults']['actionArgs'].requestType === 'filtering') && record.checkboxState === 'check') {\n record.checkboxState = 'check';\n }\n else if ((checkChildRecords === 0 && indeter === 0) || (checkChildRecords === 0 && record.hasFilteredChildRecords && !isNullOrUndefined(this.parent['dataResults']['actionArgs']) &&\n (this.parent['dataResults']['actionArgs'].requestType === 'searching' || this.parent['dataResults']['actionArgs'].requestType === 'filtering') && record.checkboxState === 'check')) {\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 //This property used to maintain the check state of the currentview data after clear filtering\n var multiFilterCheckState = false;\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 if (this.parent.grid.searchSettings.key.length) {\n this.searchingRecords = filterResult;\n }\n else {\n if (this.filteredList !== filterResult) {\n this.filteredList = filterResult;\n multiFilterCheckState = true;\n }\n else {\n multiFilterCheckState = false;\n }\n }\n }\n if (this.filteredList.length > 0) {\n if (!this.parent.filterSettings.columns.length && this.filteredList.length && !this.parent.grid.searchSettings.key.length) {\n this.filteredList = [];\n }\n if (this.searchingRecords.length && !isNullOrUndefined(checkAll)) {\n this.filteredList = this.searchingRecords;\n }\n }\n var data;\n if (!(isNullOrUndefined(this.parent.filterModule)) &&\n this.parent.filterModule.filteredResult.length === 0 && this.parent.getCurrentViewRecords().length === 0 &&\n this.parent.filterSettings.columns.length > 0) {\n data = this.filteredList;\n }\n else {\n data = (!isNullOrUndefined(this.parent.filterModule) &&\n (this.filteredList.length > 0)) ? this.filteredList : this.parent.flatData;\n }\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[parseInt(i.toString(), 10)].checkboxState === 'check') {\n continue;\n }\n if (multiFilterCheckState) {\n continue;\n }\n data[parseInt(i.toString(), 10)].checkboxState = 'check';\n this.updateSelectedItems(data[parseInt(i.toString(), 10)], data[parseInt(i.toString(), 10)].checkboxState);\n }\n else {\n index = this.selectedItems.indexOf(data[parseInt(i.toString(), 10)]);\n if (index > -1) {\n data[parseInt(i.toString(), 10)].checkboxState = 'uncheck';\n this.updateSelectedItems(data[parseInt(i.toString(), 10)], data[parseInt(i.toString(), 10)].checkboxState);\n if (this.parent.autoCheckHierarchy) {\n this.updateParentSelection(data[parseInt(i.toString(), 10)]);\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 tr = this.parent.getRows()[parseInt(recordIndex.toString(), 10)];\n var checkbox;\n if (recordIndex > -1) {\n var movableTr = void 0;\n if (this.parent.frozenRows || this.parent.getFrozenColumns()) {\n movableTr = this.parent.getMovableDataRows()[parseInt(recordIndex.toString(), 10)];\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 var chkstate = checkState === 'check' ? 'checked' : checkState === 'uncheck' ? 'unchecked' : 'mixed';\n tr.querySelector('.e-treecheckselect').setAttribute('aria-checked', checkState === 'check' ? 'true' : checkState === 'uncheck' ? 'false' : 'mixed');\n tr.querySelector('.e-frame').setAttribute('title', 'checkbox' + chkstate);\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[parseInt(i.toString(), 10)].classList.contains('e-summaryrow')) {\n this.updateSelectedItems(childData[parseInt(i.toString(), 10)], childData[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)]);\n var checkedIndex = this.selectedIndexes.indexOf(index);\n this.selectedIndexes.splice(checkedIndex, 1);\n this.updateSelectedItems(updatedData[parseInt(i.toString(), 10)], 'uncheck');\n }\n if (!isNullOrUndefined(updatedData[parseInt(i.toString(), 10)].parentItem)) {\n this.updateParentSelection(updatedData[parseInt(i.toString(), 10)].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 && record.childRecords.length > 0) {\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[parseInt(i.toString(), 10)].hasChildRecords) {\n _this.updateParentSelection(child[parseInt(i.toString(), 10)]);\n }\n else if (!(child[parseInt(i.toString(), 10)].hasChildRecords) &&\n !isNullOrUndefined(child[parseInt(i.toString(), 10)])) {\n _this.updateSelectedItems(child[parseInt(i.toString(), 10)], child[parseInt(i.toString(), 10)].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, CellRenderer } 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 && !parentrec[0].isSummaryRow) {\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 args.cell.setAttribute('aria-expanded', data.expanded ? 'true' : 'false');\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 if (args.column.template) {\n args.cell.innerHTML = null;\n }\n else {\n args.cell.innerHTML = summaryData;\n }\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('data-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, 'columnTemplate', 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[parseInt(i.toString(), 10)]);\n }\n }\n }\n else {\n cellElement.innerHTML = textContent;\n args.cell.innerHTML = '';\n }\n };\n /**\n * @param {string} columnUid - Defines column uid\n * @returns {void}\n * @hidden\n */\n Render.prototype.refreshReactColumnTemplateByUid = function (columnUid) {\n var _this = this;\n if (this.parent.isReact) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.parent.clearTemplate(['columnTemplate'], undefined, function () {\n var cells = 'cells';\n var rowIdx = 'index';\n var rowsObj = _this.parent.grid.getRowsObject();\n var indent = _this.parent.grid.getIndentCount();\n var cellIndex = _this.parent.grid.getNormalizedColumnIndex(columnUid);\n for (var j = 0; j < rowsObj.length; j++) {\n if (rowsObj[parseInt(j.toString(), 10)].isDataRow && !isNullOrUndefined(rowsObj[parseInt(j.toString(), 10)].index)) {\n var cell = rowsObj[parseInt(j.toString(), 10)][\"\" + cells][parseInt(cellIndex.toString(), 10)];\n var cellRenderer = new CellRenderer(_this.parent.grid, _this.parent.grid.serviceLocator);\n var td = _this.parent.getCellFromIndex(rowsObj[parseInt(j.toString(), 10)].index, cellIndex - indent);\n cellRenderer.refreshTD(td, cell, rowsObj[parseInt(j.toString(), 10)].data, { index: rowsObj[parseInt(j.toString(), 10)][\"\" + rowIdx] });\n var treecell = _this.parent.getRows()[parseInt(j.toString(), 10)]\n .cells[parseInt(cellIndex.toString(), 10)];\n _this.cellRender({ data: rowsObj[parseInt(j.toString(), 10)].data, cell: treecell, column: cell.column });\n }\n }\n });\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[parseInt(i.toString(), 10)];\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[parseInt(i.toString(), 10)];\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[parseInt(index.toString(), 10)][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 actionArgs = 'actionArgs';\n if (isRemoteData(this.parent) && this.parent.enableVirtualization && args[\"\" + actionArgs].requestType === 'virtualscroll') {\n this.parent.hideSpinner();\n }\n var records = args.result;\n if (isRemoteData(this.parent) && this.parent.enableVirtualization && (args[\"\" + actionArgs].requestType === 'virtualscroll' || args[\"\" + actionArgs].action === 'clearFilter' || args[\"\" + actionArgs].searchString === '')) {\n this.parent.query.expands = [];\n }\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 var _loop_1 = function (rec) {\n if (isCountRequired(this_1.parent) && records[parseInt(rec.toString(), 10)].hasChildRecords &&\n this_1.parent.initialRender) {\n records[parseInt(rec.toString(), 10)].expanded = false;\n }\n if (isRemoteData(this_1.parent) && this_1.parent.enableVirtualization) {\n var childRecords_1 = [];\n var parent_1 = this_1.parent;\n records.filter(function (e) {\n if (e[\"\" + parent_1.parentIdMapping] === records[parseInt(rec.toString(), 10)][\"\" + parent_1.idMapping]) {\n childRecords_1.push(e);\n }\n });\n if (childRecords_1.length) {\n records[parseInt(rec.toString(), 10)].expanded = true;\n }\n else if (records[parseInt(rec.toString(), 10)].hasChildRecords) {\n records[parseInt(rec.toString(), 10)].expanded = false;\n }\n }\n if (isNullOrUndefined(records[parseInt(rec.toString(), 10)].index)) {\n records[parseInt(rec.toString(), 10)].taskData = extend({}, records[parseInt(rec.toString(), 10)]);\n records[parseInt(rec.toString(), 10)].uniqueID = getUid(this_1.parent.element.id + '_data_');\n setValue('uniqueIDCollection.' + records[parseInt(rec.toString(), 10)].uniqueID, records[parseInt(rec.toString(), 10)], this_1.parent);\n records[parseInt(rec.toString(), 10)].level = 0;\n if (isRemoteData(this_1.parent) && this_1.parent.enableVirtualization && records[parseInt(rec.toString(), 10)][\"\" + this_1.parent.parentIdMapping] && records[parseInt(rec.toString(), 10)].level === 0) {\n records[parseInt(rec.toString(), 10)].level = records[parseInt(rec.toString(), 10)].level + 1;\n }\n records[parseInt(rec.toString(), 10)].index = Math.ceil(Math.random() * 1000);\n if ((records[parseInt(rec.toString(), 10)][this_1.parent.hasChildMapping] ||\n this_1.parentItems.indexOf(records[parseInt(rec.toString(), 10)][this_1.parent.idMapping]) !== -1)) {\n records[parseInt(rec.toString(), 10)].hasChildRecords = true;\n }\n records[parseInt(rec.toString(), 10)].checkboxState = 'uncheck';\n }\n };\n var this_1 = this;\n for (var rec = 0; rec < records.length; rec++) {\n _loop_1(rec);\n }\n }\n else {\n var dataResults = 'dataResults';\n var expandRecord = 'expandRecord';\n if (!isNullOrUndefined(records) && !((this.parent.loadChildOnDemand) && isCountRequired(this.parent) && !isNullOrUndefined(this.parent[\"\" + dataResults][\"\" + expandRecord])) &&\n !(isRemoteData(this.parent) && this.parent.loadChildOnDemand && args[\"\" + actionArgs].isExpandCollapse && this.parent.enableVirtualization)) {\n this.convertToFlatData(records);\n }\n }\n }\n if (isRemoteData(this.parent) && this.parent.loadChildOnDemand && args[\"\" + actionArgs].isExpandCollapse && this.parent.enableVirtualization) {\n args.result = records;\n }\n else if (isRemoteData(this.parent) && this.parent.enableVirtualization && !this.parent.loadChildOnDemand) {\n args.result = records;\n }\n else {\n args.result = this.parent.loadChildOnDemand ? this.parent.flatData : records;\n }\n if (isRemoteData(this.parent) && this.parent.enableVirtualization && this.parent.loadChildOnDemand\n && 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 query = 'query';\n var summaryQuery = args[\"\" + query].queries.filter(function (q) { return q.fn === 'onAggregates'; });\n args.result = this.parent.summaryModule.calculateSummaryValue(summaryQuery, this.parent.flatData, true);\n }\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 var name = 'name';\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[parseInt(i.toString(), 10)].style.display = 'table-row';\n if (this.parent.loadChildOnDemand) {\n var targetEle = rowDetails.rows[parseInt(i.toString(), 10)].getElementsByClassName('e-treegridcollapse')[0];\n childRecord = this.parent.rowTemplate ?\n this.parent.grid.getCurrentViewRecords()[rowDetails.rows[parseInt(i.toString(), 10)].rowIndex] :\n this.parent.grid.getRowObjectFromUID(rowDetails.rows[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)].querySelector('.e-detailrowcollapse');\n if (!isNullOrUndefined(expandingTd)) {\n this.parent.grid.detailRowModule.expand(expandingTd);\n }\n }\n }\n else {\n this.fetchRemoteChildData({ action: rowDetails[\"\" + name], 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 if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {\n qry.take(this.parent.pageSettings.pageSize);\n var expandDetail = [];\n expandDetail.push('ExpandingAction', rowDetails.record[this.parent.idMapping]);\n qry.expand(expandDetail);\n }\n else if (this.parent.enableVirtualization && rowDetails.action === 'collapse') {\n qry.take(this.parent.grid.pageSettings.pageSize);\n var expandDetail = [];\n expandDetail.push('CollapsingAction', rowDetails.record[this.parent.idMapping]);\n qry.expand(expandDetail);\n }\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 remoteExpandedData = 'remoteExpandedData';\n var remoteCollapsedData = 'remoteCollapsedData';\n var level = 'level';\n var datas = _this.parent.grid.currentViewData.slice();\n var inx = datas.indexOf(rowDetails.record);\n if (_this.parent.enableVirtualization && (rowDetails.action === 'collapse' || rowDetails.action === 'remoteExpand')) {\n datas = [];\n for (var i = 0; i < inx; i++) {\n datas.push(_this.parent.grid.currentViewData[parseInt(i.toString(), 10)]);\n }\n }\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 if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping] === rowDetails.record[\"\" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {\n _this.parent[\"\" + remoteExpandedData].push(rowDetails.record);\n }\n else if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping] === rowDetails.record[\"\" + _this.parent.idMapping] && rowDetails.action === 'collapse') {\n for (var i = 0; i < _this.parent[\"\" + remoteExpandedData].length; i++) {\n if (rowDetails.record[\"\" + _this.parent.idMapping] === _this.parent[\"\" + remoteExpandedData][parseInt(i.toString(), 10)][\"\" + _this.parent.idMapping]) {\n _this.parent[\"\" + remoteExpandedData].splice(i, 1);\n }\n }\n }\n result[parseInt(r.toString(), 10)].taskData = extend({}, result[parseInt(r.toString(), 10)]);\n if (result[parseInt(r.toString(), 10)][\"\" + _this.parent.parentIdMapping] && _this.parent.enableVirtualization && _this.parent[\"\" + remoteExpandedData].length) {\n for (var i = 0; i < _this.parent[\"\" + remoteExpandedData].length; i++) {\n if (result[parseInt(r.toString(), 10)][\"\" + _this.parent.parentIdMapping] === _this.parent[\"\" + remoteExpandedData][parseInt(i.toString(), 10)][\"\" + _this.parent.idMapping]) {\n result[parseInt(r.toString(), 10)].level = _this.parent[\"\" + remoteExpandedData][parseInt(i.toString(), 10)][\"\" + level] + 1;\n var parentData = _this.parent[\"\" + remoteExpandedData][parseInt(i.toString(), 10)];\n result[parseInt(r.toString(), 10)].parentItem = parentData;\n result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;\n }\n }\n }\n else if (_this.parent.enableVirtualization) {\n if ((result[parseInt(r.toString(), 10)][\"\" + _this.parent.hasChildMapping] ||\n _this.parentItems.indexOf(result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping]) !== -1)\n && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {\n if (isNullOrUndefined(result[parseInt(r.toString(), 10)][\"\" + _this.parent.parentIdMapping])) {\n result[parseInt(r.toString(), 10)].level = 0;\n }\n else {\n result[parseInt(r.toString(), 10)].level = rowDetails.record.level;\n }\n }\n else {\n var parentData = extend({}, rowDetails.record);\n delete parentData.childRecords;\n result[parseInt(r.toString(), 10)].parentItem = parentData;\n result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;\n }\n }\n else {\n result[parseInt(r.toString(), 10)].level = rowDetails.record.level + 1;\n var parentData = extend({}, rowDetails.record);\n delete parentData.childRecords;\n result[parseInt(r.toString(), 10)].parentItem = parentData;\n result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;\n }\n result[parseInt(r.toString(), 10)].index = Math.ceil(Math.random() * 1000);\n result[parseInt(r.toString(), 10)].uniqueID = getUid(_this.parent.element.id + '_data_');\n result[parseInt(r.toString(), 10)].checkboxState = 'uncheck';\n if (_this.parent.enableVirtualization && isNullOrUndefined(result[parseInt(r.toString(), 10)].level)) {\n for (var p = 0; p < _this.parent.grid.currentViewData.length; p++) {\n if (_this.parent.grid.currentViewData[parseInt(p.toString(), 10)][\"\" + _this.parent.idMapping] === result[parseInt(r.toString(), 10)][\"\" + _this.parent.parentIdMapping]) {\n result[parseInt(r.toString(), 10)].level = _this.parent.grid.currentViewData[parseInt(p.toString(), 10)]['level'] + 1;\n }\n }\n }\n setValue('uniqueIDCollection.' + result[parseInt(r.toString(), 10)].uniqueID, result[parseInt(r.toString(), 10)], _this.parent);\n // delete result[r].parentItem.childRecords;\n if ((result[parseInt(r.toString(), 10)][\"\" + _this.parent.hasChildMapping] ||\n _this.parentItems.indexOf(result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping]) !== -1)\n && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {\n result[parseInt(r.toString(), 10)].hasChildRecords = true;\n if (_this.parent.enableVirtualization && _this.parent.loadChildOnDemand) {\n for (var i = 0; i < _this.parent[\"\" + remoteCollapsedData].length; i++) {\n if (result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping] === _this.parent[\"\" + remoteCollapsedData][parseInt(i.toString(), 10)][\"\" + _this.parent.idMapping]) {\n result[parseInt(r.toString(), 10)].expanded = _this.parent[\"\" + remoteCollapsedData][parseInt(i.toString(), 10)]['expanded'];\n }\n }\n if (rowDetails.action === 'collapse' && result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping] !== rowDetails.record[\"\" + _this.parent.idMapping] && result[parseInt(r.toString(), 10)].expanded !== false) {\n result[parseInt(r.toString(), 10)].expanded = true;\n }\n else if (rowDetails.action === 'collapse' && result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping] === rowDetails.record[\"\" + _this.parent.idMapping]) {\n result[parseInt(r.toString(), 10)].expanded = false;\n _this.parent[\"\" + remoteCollapsedData].push(rowDetails.record);\n }\n else if (rowDetails.action === 'remoteExpand') {\n for (var i = 0; i < _this.parent.grid.currentViewData.length; i++) {\n if (_this.parent.grid.currentViewData[parseInt(i.toString(), 10)][\"\" + _this.parent.idMapping] === result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping]) {\n result.splice(r, 1, _this.parent.grid.currentViewData[parseInt(i.toString(), 10)]);\n }\n }\n if (result[parseInt(r.toString(), 10)][_this.parent.idMapping] === rowDetails.record[\"\" + _this.parent.idMapping]) {\n for (var i = 0; i < _this.parent[\"\" + remoteCollapsedData].length; i++) {\n if (rowDetails.record[\"\" + _this.parent.idMapping] === _this.parent[\"\" + remoteCollapsedData][parseInt(i.toString(), 10)][\"\" + _this.parent.idMapping]) {\n _this.parent[\"\" + remoteCollapsedData].splice(i, 1);\n }\n }\n }\n if (result[parseInt(r.toString(), 10)].expanded !== false) {\n result[parseInt(r.toString(), 10)].expanded = true;\n }\n }\n }\n else if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][\"\" + _this.parent.idMapping] === rowDetails.record[\"\" + _this.parent.idMapping] && rowDetails.action !== 'collapse') {\n result[parseInt(r.toString(), 10)].expanded = true;\n }\n else if (!(_this.parent.enableVirtualization && _this.parent.loadChildOnDemand)) {\n result[parseInt(r.toString(), 10)].expanded = false;\n }\n }\n datas.splice(inx + r + 1, 0, result[parseInt(r.toString(), 10)]);\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 if (_this.parent.enableVirtualization) {\n _this.parent.grid.pageSettings.totalRecordsCount = e.count;\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 if (isRemoteData(this.parent) && this.parent.enableVirtualization) {\n var index = this.parent.query.queries.indexOf(this.parent.query.queries.filter(function (q) { return q.fn === 'onSortBy'; })[0]);\n if (index !== -1) {\n this.parent.query.queries.splice(index, 1);\n }\n if (this.parent.grid.sortSettings.columns.length === 0) {\n this.parent.query.sortBy(null, null);\n }\n }\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[parseInt(i.toString(), 10)]);\n currentData.taskData = data[parseInt(i.toString(), 10)];\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]) && !isCountRequired(this.parent)) ||\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 var remoteCollapsedData = 'remoteCollapsedData';\n if (this.parent.enableVirtualization && this.parent.loadChildOnDemand && isRemoteData(this.parent)\n && !this.parent.initialRender) {\n if (!currentData.hasChildRecords && isNullOrUndefined(currentData[\"\" + this.parent.parentIdMapping])) {\n currentData.hasChildRecords = true;\n for (var c = 0; c < this.parent[\"\" + remoteCollapsedData].length; c++) {\n if (this.parent[\"\" + remoteCollapsedData][parseInt(c.toString(), 10)][\"\" + this.parent.idMapping] === currentData[\"\" + this.parent.idMapping]) {\n currentData.expanded = false;\n }\n }\n }\n else if (currentData.level === 0 && isNullOrUndefined(parentRecords) && !currentData.hasChildRecords) {\n currentData.level = currentData.level + 1;\n }\n if (currentData[\"\" + this.parent.hasChildMapping] && !isNullOrUndefined(currentData[\"\" + this.parent.expandStateMapping])) {\n currentData.expanded = currentData[\"\" + this.parent.expandStateMapping];\n currentData.hasChildRecords = true;\n }\n this.parent.flatData.push(currentData);\n }\n else if (isNullOrUndefined(currentData[\"\" + this.parent.parentIdMapping]) || currentData.parentItem) {\n this.parent.flatData.push(currentData);\n this.parent['infiniteScrollData'].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[parseInt(srt.toString(), 10)].field);\n var compFun = col.sortComparer && isOffline(this.parent) ?\n col.sortComparer.bind(col) :\n this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].direction;\n srtQry.sortBy(this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].field, compFun);\n }\n var modifiedData = new DataManager(parentData).executeLocal(srtQry);\n if (this.parent.allowRowDragAndDrop && !isNullOrUndefined(this.parent.rowDragAndDropModule['draggedRecord']) &&\n this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {\n var dragdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);\n modifiedData.splice(dragdIndex, 1);\n var dropdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);\n if (this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {\n modifiedData.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);\n }\n else if (this.parent.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {\n modifiedData.splice(dropdIndex + 1, 0, this.parent.rowDragAndDropModule['draggedRecord']);\n }\n }\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[parseInt(i.toString(), 10)], this.parent.parentData);\n if (expandStatus) {\n actualResults.push(results[parseInt(i.toString(), 10)]);\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","/**\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[\"RowIndent\"] = 16] = \"RowIndent\";\n ContextMenuItems[ContextMenuItems[\"RowOutdent\"] = 17] = \"RowOutdent\";\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, merge } 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 { LoadingIndicator } from '../models/loading-indicator';\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 { 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';\nimport * as literals from '../base/constant';\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.indentOutdentAction = 'indentOutdentAction';\n _this.modifiedRecords = [];\n _this.stackedHeader = false;\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[parseInt(i.toString(), 10)]] !== current[keys[parseInt(i.toString(), 10)]] &&\n excludeKeys.indexOf(keys[parseInt(i.toString(), 10)]) === -1) {\n var isDate = old[keys[parseInt(i.toString(), 10)]] instanceof Date &&\n current[keys[parseInt(i.toString(), 10)]] instanceof Date;\n if (!isDate || (old[keys[parseInt(i.toString(), 10)]].getTime() !==\n current[keys[parseInt(i.toString(), 10)]].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 if (!isNullOrUndefined(column)) {\n row = column.closest('tr');\n if (!isNullOrUndefined(row) && !(isNullOrUndefined(row.getElementsByClassName('e-treegridexpand')[0]))) {\n this.expandCollapseRequest(row.querySelector('.e-treegridexpand'));\n }\n }\n break;\n case 'ctrlShiftDownArrow':\n target = e.target;\n column = target.closest('.e-rowcell');\n if (!isNullOrUndefined(column)) {\n row = column.closest('tr');\n if (!isNullOrUndefined(row) && !(isNullOrUndefined(row.getElementsByClassName('e-treegridcollapse')[0]))) {\n this.expandCollapseRequest(row.querySelector('.e-treegridcollapse'));\n }\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[parseInt(cellIndex.toString(), 10)];\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[parseInt(cIndex.toString(), 10)];\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.infiniteScrollData = [];\n this.remoteCollapsedData = [];\n this.remoteExpandedData = [];\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 var freezePresent = this.injectedModules.filter(function (e) {\n return e.prototype.getModuleName() === 'freeze';\n });\n if (this.frozenColumns || this.frozenRows || this.getFrozenColumns() ||\n this.grid.getFrozenLeftColumnsCount() || this.grid.getFrozenRightColumnsCount() || freezePresent.length) {\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 var IsRowDDInjected = this.injectedModules.filter(function (e) {\n return e.prototype.getModuleName() === 'rowDragAndDrop';\n });\n if (this.allowRowDragAndDrop || IsRowDDInjected.length) {\n if ((!isNullOrUndefined(this.toolbar) && (this.toolbar['includes']('Indent') ||\n this.toolbar['includes']('Outdent')))) {\n this.isIndentEnabled = true;\n }\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[parseInt(i.toString(), 10)].member === 'virtualscroll') {\n modules[parseInt(i.toString(), 10)].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 if (this.isIndentEnabled) {\n this.refreshToolbarItems();\n }\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.refreshToolbarItems = function () {\n var toolbarElement = this.toolbarModule.getToolbar();\n var indentID = this.element.id + '_gridcontrol_indent';\n var outdentID = this.element.id + '_gridcontrol_outdent';\n var indentElement = toolbarElement.querySelector('#' + indentID).parentElement;\n var outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;\n indentElement.classList.add('e-hidden');\n outdentElement.classList.add('e-hidden');\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, this.grid.serviceLocator);\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.enableVirtualMaskRow = this.enableVirtualMaskRow;\n this.grid.loadingIndicator = this.loadingIndicator;\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.IsExpandCollapseClicked = 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 && (!isNullOrUndefined(args.data) && args.data['hasChildRecords'])) {\n args.cancel = true;\n return;\n }\n };\n TreeGrid.prototype.bindGridEvents = function () {\n var _this = this;\n this.grid.rowSelecting = function (args) {\n _this.IsExpandCollapseClicked(args);\n _this.trigger(events.rowSelecting, args);\n };\n this.grid.rowDeselecting = function (args) {\n _this.IsExpandCollapseClicked(args);\n _this.trigger(events.rowDeselecting, 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()[parseInt(i.toString(), 10)].getElementsByClassName('e-frame e-icons e-uncheck').length) {\n _this.grid.selectionModule[\"\" + updateRowSelection](_this.getRows()[parseInt(i.toString(), 10)], _this.getCurrentViewRecords()[parseInt(i.toString(), 10)].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.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[parseInt(j.toString(), 10)]], 'e-lastrowcell');\n }\n else {\n removeClass([visiblerow.cells[parseInt(j.toString(), 10)]], '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[parseInt(i.toString(), 10)])) {\n if (totalRows[parseInt(i.toString(), 10)].nextElementSibling) {\n _this.lastRowBorder(totalRows[parseInt(i.toString(), 10)], 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()[parseInt(index.toString(), 10)], 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 if (args.action.requestType !== 'infiniteScroll') {\n _this.infiniteScrollData = [];\n }\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 if (isRemoteData(_this) && _this.enableVirtualization) {\n if (args.requestType === 'virtualscroll') {\n _this.query.expand('VirtualScrollingAction');\n _this.showSpinner();\n }\n else if (args.requestType === 'searching' && args.searchString === '') {\n _this.query.expand('ClearSearchingAction');\n }\n else if (args.action === 'clearFilter') {\n _this.query.expand('ClearFilteringAction');\n }\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 (args.action === 'filter') {\n if (_this.filterModule['currentFilterObject'] !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {\n _this.expandAll();\n }\n }\n if (args.requestType === 'searching') {\n if (_this.searchSettings.key !== '' && _this.enableVirtualization && !_this.initialRender && !(isRemoteData(_this) && _this.enableVirtualization)) {\n _this.expandAll();\n }\n }\n if (args.action === 'clearFilter' && _this.enableCollapseAll) {\n _this.collapseAll();\n }\n if (_this.action === 'indenting' || _this.action === 'outdenting') {\n _this.action = _this.action === 'indenting' ? 'indented' : 'outdented';\n var selectedItem_1 = [_this.selectedRecords];\n var actionArgs = {\n data: selectedItem_1,\n dropIndex: _this.dropIndex,\n dropPosition: _this.dropPosition,\n modifiedRecords: _this.modifiedRecords,\n requestType: _this.action,\n row: _this.selectedRows\n };\n _this.trigger(events.actionComplete, actionArgs);\n var currentPageItem = _this.getCurrentViewRecords().filter(function (e) {\n return e.uniqueID === selectedItem_1[0].uniqueID;\n });\n if (!currentPageItem.length) {\n _this.refreshToolbarItems();\n }\n _this.action = '';\n _this.selectedRecords = _this.selectedRows = _this.modifiedRecords = [];\n }\n else {\n if (_this.grid.isFrozenGrid() && _this.enableVirtualization && args['tableName'] === 'movable') {\n var movableContent = _this.grid.element.querySelector('.' + literals.movableContent);\n var frozenContent = _this.grid.element.querySelector('.' + literals.frozenContent);\n movableContent.style.height = frozenContent.style.height = 'auto';\n }\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[parseInt(i.toString(), 10)]) === -1) {\n this.columns.push(keys[parseInt(i.toString(), 10)]);\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[parseInt(i.toString(), 10)]) {\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 case 'Indent':\n case ContextMenuItems.RowIndent:\n items.push({ text: this.l10n.getConstant('RowIndent'),\n target: '.e-content', iconCss: 'e-indent e-icons', id: this.element.id + '_gridcontrol_cmenu_Indent' });\n break;\n case 'Outdent':\n case ContextMenuItems.RowOutdent:\n items.push({ text: this.l10n.getConstant('RowOutdent'),\n target: '.e-content', iconCss: 'e-outdent e-icons', id: this.element.id + '_gridcontrol_cmenu_Outdent' });\n break;\n default:\n items.push(this.contextMenuItems[parseInt(i.toString(), 10)]);\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 this.l10n = new L10n('treegrid', this.defaultLocale, this.locale);\n var items = [];\n var tooltipText = void 0;\n for (var i = 0; i < this.toolbar.length; i++) {\n switch (this.toolbar[parseInt(i.toString(), 10)]) {\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,\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,\n prefixIcon: 'e-outdent', id: this.element.id + '_gridcontrol_outdent'\n });\n break;\n default:\n items.push(this.toolbar[parseInt(i.toString(), 10)]);\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 if (this.columnModel.length === 0) {\n index = index === 0 ? -1 : index;\n }\n var gridColumnCollection = [];\n for (var i = 0; i < column.length; i++) {\n index = index + 1;\n var treeColumn = this.grid.getColumnByUid(column[parseInt(i.toString(), 10)].uid);\n gridColumn = treeColumn ? treeColumn : {};\n treeGridColumn = {};\n if (typeof this.columns[parseInt(i.toString(), 10)] === 'string') {\n gridColumn.field = treeGridColumn.field = this.columns[parseInt(i.toString(), 10)];\n }\n else {\n for (var _i = 0, _a = Object.keys(column[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {\n var prop = _a[_i];\n if (index === this.treeColumnIndex && prop === 'template') {\n treeGridColumn[\"\" + prop] = column[parseInt(i.toString(), 10)][\"\" + prop];\n }\n else if (prop === 'columns' && !isNullOrUndefined(column[parseInt(i.toString(), 10)][\"\" + prop])) {\n gridColumn[\"\" + prop] = this.getGridColumns(column[parseInt(i.toString(), 10)][\"\" + prop], false, this.columnModel.length - 1);\n treeGridColumn[\"\" + prop] = column[parseInt(i.toString(), 10)][\"\" + prop];\n }\n else if (this.initialRender && !isNullOrUndefined(treeColumn) && this.enablePersistence && prop === 'edit') {\n gridColumn[\"\" + prop] = treeGridColumn[\"\" + prop] = treeColumn[\"\" + prop];\n }\n else if (!(treeColumn) || prop !== 'sortComparer') {\n gridColumn[\"\" + prop] = treeGridColumn[\"\" + prop] = column[parseInt(i.toString(), 10)][\"\" + 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 this.TreeGridLocale();\n this.grid.toolbar = this.getGridToolbar();\n this.grid.contextMenuItems = this.getContextMenu();\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[parseInt(i.toString(), 10)]]) {\n this[modules[parseInt(i.toString(), 10)]] = 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[parseInt(i.toString(), 10)]];\n for (var k = 0, val = ignoreOnPersist[keyEntity[parseInt(i.toString(), 10)]]; (!isNullOrUndefined(val) && k < val.length); k++) {\n var objVal = val[parseInt(k.toString(), 10)];\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[parseInt(i.toString(), 10)].columns) {\n this.ignoreInColumn(ignoreOnColumn, columns[parseInt(i.toString(), 10)]);\n this.ignoreInArrays(ignoreOnColumn, columns[parseInt(i.toString(), 10)].columns);\n }\n else {\n this.ignoreInColumn(ignoreOnColumn, columns[parseInt(i.toString(), 10)]);\n }\n }\n };\n TreeGrid.prototype.ignoreInColumn = function (ignoreOnColumn, column) {\n for (var i = 0; i < ignoreOnColumn.length; i++) {\n delete column[ignoreOnColumn[parseInt(i.toString(), 10)]];\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()[parseInt(index.toString(), 10)];\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()[parseInt(rowIndex.toString(), 10)];\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 var columnModel = 'columnModel';\n if (this.grid.columns.length !== this.columnModel.length) {\n Columns = this.grid[\"\" + columnModel];\n }\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 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[parseInt(i.toString(), 10)]); _i < _a.length; _i++) {\n var prop = _a[_i];\n gridColumn[\"\" + prop] = gridColumns[parseInt(i.toString(), 10)][\"\" + prop];\n }\n this.columnModel.push(new Column(gridColumn));\n if (field === this.columnModel[parseInt(i.toString(), 10)].field && this.columnModel[parseInt(i.toString(), 10)].type !== 'checkbox' && (!isNullOrUndefined(temp) && temp !== '')) {\n this.columnModel[parseInt(i.toString(), 10)].template = temp;\n }\n }\n }\n var deepMerge = 'deepMerge';\n this[\"\" + deepMerge] = ['columns']; // Workaround for blazor updateModel\n if (this.grid.columns.length !== this.columnModel.length) {\n this.stackedHeader = true;\n }\n if (!this.stackedHeader) {\n merge(this.columns, this.columnModel);\n }\n this[\"\" + deepMerge] = 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[parseInt(i.toString(), 10)].classList.contains('e-summaryrow')) {\n dRows.push(rows[parseInt(i.toString(), 10)]);\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[parseInt(i.toString(), 10)]);\n if (!currentViewRecords[parseInt(i.toString(), 10)].expanded) {\n i += findChildrenRecords(currentViewRecords[parseInt(i.toString(), 10)]).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 || this.getBatchChanges()[this.deletedRecords].length ||\n this.getBatchChanges()[this.addedRecords].length) && this.editSettings.showConfirmDialog) {\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_1 = this.grid.getRowInfo(target);\n var record = rowInfo_1.rowData;\n if (this.grid.isFrozenGrid() && this.enableVirtualization && !Object.keys(record).length) {\n var freezeRows = 'freezeRows';\n record = this.grid.contentModule[\"\" + freezeRows].filter(function (e) { return e.uid === rowInfo_1.row.getAttribute('data-uid'); })[0].data;\n }\n if (this.enableImmutableMode) {\n record = this.getCurrentViewRecords()[rowInfo_1.rowIndex];\n }\n if (target.classList.contains('e-treegridexpand')) {\n this.collapseRow(rowInfo_1.row, record);\n }\n else {\n this.expandRow(rowInfo_1.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[parseInt(i.toString(), 10)]);\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('data-rowindex')];\n }\n else {\n record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];\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[parseInt(i.toString(), 10)][this.expandStateMapping] = state;\n editAction({ value: totalRecords[parseInt(i.toString(), 10)], action: 'edit' }, this, this.isSelfReference, totalRecords[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)].parentItem)) {\n var puniqueID_1 = record[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)], 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 for (var i = 0; i < rows.length; i++) {\n if (action === 'collapse') {\n this.collapseRow(rows[parseInt(i.toString(), 10)]);\n }\n else {\n this.expandRow(rows[parseInt(i.toString(), 10)]);\n }\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[parseInt(i.toString(), 10)]);\n }\n else {\n this.expandRow(rows[parseInt(i.toString(), 10)]);\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) || (action === 'collapse' || (this.isExpandAll && this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {\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[parseInt(rowIndex.toString(), 10)];\n }\n else {\n rowIndex = +row.getAttribute('data-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 row.querySelectorAll('.e-treerowcell')[0].setAttribute('aria-expanded', action === 'expand' ? 'true' : 'false');\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 (!isNullOrUndefined(targetEle) && targetEle.closest('.e-treerowcell').classList.contains('e-cellselectionbackground')) {\n targetEle.closest('.e-treerowcell').classList.remove('e-cellselectionbackground');\n targetEle.closest('.e-treerowcell').removeAttribute('aria-selected');\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[parseInt(i.toString(), 10)])) {\n var table = this.getContentTable();\n var sHeight = table.scrollHeight;\n var clientHeight = this.getContent().clientHeight;\n this.lastRowBorder(totalRows[parseInt(i.toString(), 10)], 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 if (expandingArgs.requestType === 'collapse' && isCountRequired(this)) {\n var flatDataRecords = this.flatData.slice();\n for (var i = 0; i < flatDataRecords.length; i++) {\n if (flatDataRecords[parseInt(i.toString(), 10)]['parentUniqueID'] === expandingArgs.data['uniqueID']) {\n flatDataRecords.splice(i, 1);\n i = i - 1;\n }\n }\n this.dataResults.result = flatDataRecords;\n return;\n }\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 if (isCountRequired(_this)) {\n _this.flatData = _this.dataResults.result;\n }\n if (_this.enableInfiniteScrolling && isCountRequired(_this)) {\n _this.flatData = _this.infiniteScrollData;\n }\n var currentData = (_this.flatData);\n var index = 0;\n for (var i = 0; i < currentData.length; i++) {\n if (currentData[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)]) {\n childData[parseInt(i.toString(), 10)].level = record.level + 1;\n childData[parseInt(i.toString(), 10)].index = Math.ceil(Math.random() * 1000);\n childData[parseInt(i.toString(), 10)].parentItem = extend({}, record);\n childData[parseInt(i.toString(), 10)].taskData = extend({}, childData[parseInt(i.toString(), 10)]);\n delete childData[parseInt(i.toString(), 10)].parentItem.childRecords;\n delete childData[parseInt(i.toString(), 10)].taskData.parentItem;\n childData[parseInt(i.toString(), 10)].parentUniqueID = record.uniqueID;\n childData[parseInt(i.toString(), 10)].uniqueID = getUid(_this.element.id + '_data_');\n setValue('uniqueIDCollection.' + childData[parseInt(i.toString(), 10)].uniqueID, childData[parseInt(i.toString(), 10)], _this);\n if (!isNullOrUndefined(childData[parseInt(i.toString(), 10)][_this.childMapping]) ||\n (childData[parseInt(i.toString(), 10)][_this.hasChildMapping] && isCountRequired(_this))) {\n childData[parseInt(i.toString(), 10)].hasChildRecords = true;\n }\n if (isCountRequired(_this) && record[_this.childMapping] && record[_this.childMapping][parseInt(i.toString(), 10)]) {\n currentData.splice(index + 1 + i, 0, childData[parseInt(i.toString(), 10)]);\n }\n else {\n currentData.splice(index + 1 + i, record[_this.childMapping] &&\n record[_this.childMapping][parseInt(i.toString(), 10)] ? 1 : 0, childData[parseInt(i.toString(), 10)]);\n }\n }\n else {\n currentData.splice(index + 1 + i, 1);\n }\n }\n currentData[parseInt(index.toString(), 10)][\"\" + _this.childMapping] = childData;\n currentData[parseInt(index.toString(), 10)].childRecords = childData;\n currentData[parseInt(index.toString(), 10)].expanded = true;\n setValue('uniqueIDCollection.' + currentData[parseInt(index.toString(), 10)].uniqueID, currentData[parseInt(index.toString(), 10)], _this);\n for (var j = 0; j < expandingArgs.childData.length; j++) {\n data_1.push(expandingArgs.childData[parseInt(j.toString(), 10)]);\n }\n }\n if (isCountRequired(_this) && _this.loadChildOnDemand && expandingArgs.requestType === 'expand') {\n _this.dataResults['expandRecord'] = {};\n _this.dataResults['expandRecord'] = expandingArgs.data;\n }\n _this.isExpandRefresh = true;\n var scrollHeightBeforeRefresh = _this.getContentTable().parentElement.scrollTop;\n _this.grid.refresh();\n _this.setHeightForFrozenContent();\n if (_this.enableInfiniteScrolling) {\n _this.getContentTable().parentElement.scrollTop = scrollHeightBeforeRefresh;\n }\n _this.trigger(events.expanded, expandingArgs);\n });\n };\n TreeGrid.prototype.remoteExpand = function (action, row, record) {\n var gridRows = this.getRows();\n var fetchRemoteChildData = 'fetchRemoteChildData';\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))) || (r.querySelector('.e-gridrowindex' + record.index + 'level0' + '.e-summarycell')));\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 if (action === 'collapse' && this.enableVirtualization) {\n this.dataModule[\"\" + fetchRemoteChildData]({ action: action, record: args.data, rows: null, parentRow: args.row });\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[parseInt(i.toString(), 10)][\"\" + primaryKeyField]);\n rows.push(this.getRows()[parseInt(rowIndex.toString(), 10)]);\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 var gridRowsObject = this.grid.getRowsObject();\n var currentViewData = this.getCurrentViewRecords();\n var currentRecord = currentViewData.filter(function (e) {\n return e.uniqueID === record.uniqueID;\n });\n var currentIndex = currentViewData.indexOf(currentRecord[0]);\n if (!isNullOrUndefined(gridRowsObject[parseInt(currentIndex.toString(), 10)].visible) &&\n gridRowsObject[parseInt(currentIndex.toString(), 10)].visible !== false) {\n gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = true;\n }\n var detailrows = gridRows.filter(function (r) {\n return r.classList.contains('e-griddetailrowindex' + record.index + 'level' + (record.level + 1));\n });\n for (var i = 0; i < rows.length; i++) {\n if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)])) {\n rows[parseInt(i.toString(), 10)].style.display = displayAction;\n }\n if (!isNullOrUndefined(rows[parseInt(i.toString(), 10)]) && !this.allowPaging && !(this.enableVirtualization\n || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {\n gridRowsObject[rows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction !== 'none' ? true : false;\n var parentRecord = currentViewData.filter(function (e) {\n return e.uniqueID === currentRecord[0].parentUniqueID;\n });\n if (!isNullOrUndefined(parentRecord[0]) && gridRows[currentViewData.indexOf(parentRecord[0])].getElementsByClassName('e-treegridcollapse').length) {\n gridRowsObject[parseInt(currentIndex.toString(), 10)].visible = false;\n }\n }\n if (!isNullOrUndefined(movableRows)) {\n movableRows[parseInt(i.toString(), 10)].style.display = displayAction;\n }\n if (!isNullOrUndefined(freezeRightRows)) {\n freezeRightRows[parseInt(i.toString(), 10)].style.display = displayAction;\n }\n this.notify('childRowExpand', { row: rows[parseInt(i.toString(), 10)] });\n if ((!isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].childRecords) && childRecords[parseInt(i.toString(), 10)].childRecords.length > 0) && (action !== 'expand' ||\n isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].expanded) || childRecords[parseInt(i.toString(), 10)].expanded)) {\n this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);\n if (this.frozenColumns <= this.treeColumnIndex && !isNullOrUndefined(movableRows)) {\n this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);\n }\n }\n }\n for (var i = 0; i < detailrows.length; i++) {\n if (!isNullOrUndefined(detailrows[parseInt(i.toString(), 10)]) && !this.allowPaging && !(this.enableVirtualization\n || this.enableInfiniteScrolling || isRemoteData(this) || isCountRequired(this))) {\n gridRowsObject[detailrows[parseInt(i.toString(), 10)].rowIndex].visible = displayAction !== 'none' ? true : false;\n detailrows[parseInt(i.toString(), 10)].style.display = displayAction;\n }\n }\n if (!this.allowPaging && !(this.enableVirtualization || this.enableInfiniteScrolling || isRemoteData(this)\n || isCountRequired(this))) {\n this.grid.notify('refresh-Expand-and-Collapse', { rows: this.grid.getRowsObject() });\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[parseInt(i.toString(), 10)];\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[parseInt(i.toString(), 10)]\n .cells[this.treeColumnIndex];\n var row = rows[parseInt(i.toString(), 10)];\n var rowData = this.grid.getRowsObject()[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)].style.display = 'none';\n row = rows[parseInt(i.toString(), 10)];\n var collapsingTd = rows[parseInt(i.toString(), 10)].querySelector('.e-detailrowexpand');\n if (!isNullOrUndefined(collapsingTd)) {\n this.grid.detailRowModule.collapse(collapsingTd);\n }\n if (freeze) {\n movablerows[parseInt(i.toString(), 10)].style.display = 'none';\n rightrows[parseInt(i.toString(), 10)].style.display = 'none';\n if (!rows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n if (movablerows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n row = movablerows[parseInt(i.toString(), 10)];\n }\n else if (rightrows[parseInt(i.toString(), 10)].querySelector('.e-treecolumn-container .e-treegridexpand')) {\n row = rightrows[parseInt(i.toString(), 10)];\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[parseInt(i.toString(), 10)].rowIndex] :\n this.grid.getRowObjectFromUID(rows[parseInt(i.toString(), 10)].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[parseInt(i_1.toString(), 10)].querySelector('.e-gridrowindex' + childRecord.index + 'level' + (childRecord.level + 1))) {\n cRow.push(eRows[parseInt(i_1.toString(), 10)]);\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[parseInt(i.toString(), 10)], cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],\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[parseInt(i.toString(), 10)], row: rows[parseInt(i.toString(), 10)]\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[parseInt(j.toString(), 10)].columns) {\n cnt = this.getFrozenCount(cols[parseInt(j.toString(), 10)].columns, cnt);\n }\n else {\n if (cols[parseInt(j.toString(), 10)].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 /**\n * Indents the record to one level of hierarchy. Moves the selected row as the last child of its previous row.\n *\n * @param {Object} record – specifies the record to do indented\n * @returns {void}\n */\n TreeGrid.prototype.indent = function (record) {\n if (!isNullOrUndefined(this.rowDragAndDropModule)) {\n record = record;\n this.rowDragAndDropModule[this.indentOutdentAction](record, 'indent');\n }\n };\n /**\n * Outdent the record to one level of hierarchy. Moves the selected row as sibling to its parent row.\n *\n * @param {Object} record – specifies the record to do outdented\n * @returns {void}\n */\n TreeGrid.prototype.outdent = function (record) {\n if (!isNullOrUndefined(this.rowDragAndDropModule)) {\n record = record;\n this.rowDragAndDropModule[this.indentOutdentAction](record, 'outdent');\n }\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 Complex({}, LoadingIndicator)\n ], TreeGrid.prototype, \"loadingIndicator\", void 0);\n __decorate([\n Property(true)\n ], TreeGrid.prototype, \"enableVirtualMaskRow\", 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[parseInt(f.toString(), 10)]);\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","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.modifiedRecords = 'modifiedRecords';\n /** @hidden */\n this.selectedRecords = 'selectedRecords';\n /** @hidden */\n this.selectedRows = 'selectedRows';\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 dropPosition = 'dropPosition';\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 this.parent[\"\" + dropPosition] = this.dropPosition;\n var data = [];\n for (var i = 0; i < fromIndexes.length; i++) {\n var index = this.parent.getRowByIndex(fromIndexes[parseInt(i.toString(), 10)]).rowIndex;\n data[parseInt(i.toString(), 10)] = this.parent.getCurrentViewRecords()[parseInt(index.toString(), 10)];\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()[parseInt(toIndex.toString(), 10)];\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.indentOutdentAction = function (record, request) {\n var tObj = this.parent;\n var action = 'action';\n var droppedIndex = 'dropIndex';\n var selectedItemIndex = -1;\n if (isNullOrUndefined(record) && this.parent.selectedRowIndex === -1) {\n return;\n }\n else {\n if (this.parent.enableVirtualization && this.parent.selectedRowIndex !== -1) {\n selectedItemIndex = this.parent.getSelectedRows()[0].rowIndex;\n }\n else if (this.parent.selectedRowIndex !== -1) {\n selectedItemIndex = this.parent.selectedRowIndex;\n }\n this.selectedItem = isNullOrUndefined(record) ?\n tObj.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)] : record;\n var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];\n var rowIndex = this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[\"\" + primaryKeyField]);\n this.selectedRow = this.parent[this.selectedRows] = selectedItemIndex !== -1 ?\n this.parent.getSelectedRows()[0]\n : this.parent.grid.getRowByIndex(rowIndex);\n this.selectedRecord = this.parent[this.selectedRecords] = selectedItemIndex !== -1 ?\n tObj.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)]\n : this.selectedItem;\n if (request === 'indent') {\n var record_1 = tObj.getCurrentViewRecords()[this.selectedRow.rowIndex - 1];\n var dropIndex = void 0;\n if (this.selectedRow.rowIndex === 0 || this.selectedRow.rowIndex === -1 ||\n tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level - record_1.level === 1) {\n return;\n }\n if (record_1.level > this.selectedRecord.level) {\n for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {\n if (tObj.getCurrentViewRecords()[parseInt(i.toString(), 10)].taskData ===\n record_1.parentItem.taskData) {\n dropIndex = i;\n if (tObj.enableVirtualization) {\n dropIndex = parseInt(tObj.getRows()[parseInt(i.toString(), 10)].getAttribute('data-rowindex'), 10);\n }\n }\n }\n }\n else {\n dropIndex = this.selectedRow.rowIndex - 1;\n }\n if (this.parent.enableVirtualization && this.selectedRecord && !(record_1.level > this.selectedRecord.level)) {\n dropIndex = parseInt(this.selectedRow.getAttribute('data-rowindex'), 10) - 1;\n }\n tObj[\"\" + action] = 'indenting';\n tObj[\"\" + droppedIndex] = dropIndex;\n this.eventTrigger('indenting', dropIndex);\n }\n else if (request === 'outdent') {\n if (this.selectedRow.rowIndex === -1 || this.selectedRow.rowIndex === 0 ||\n tObj.getCurrentViewRecords()[this.selectedRow.rowIndex].level === 0) {\n return;\n }\n var dropIndex = void 0;\n var parentItem = this.selectedRecord.parentItem;\n for (var i = 0; i < tObj.getCurrentViewRecords().length; i++) {\n if (tObj.getCurrentViewRecords()[parseInt(i.toString(), 10)].uniqueID === parentItem.uniqueID) {\n dropIndex = i;\n }\n }\n if (this.parent.enableVirtualization && this.selectedRecord) {\n dropIndex = parseInt(this.parent.getRows()[parseInt(dropIndex.toString(), 10)].getAttribute('data-rowindex'), 10);\n }\n tObj[\"\" + action] = 'outdenting';\n tObj[\"\" + droppedIndex] = dropIndex;\n this.eventTrigger('outdenting', dropIndex);\n }\n }\n };\n RowDD.prototype.eventTrigger = function (action, dropIndex) {\n var _this = this;\n var actionArgs = {\n action: action,\n cancel: false,\n data: [this.parent[this.selectedRecords]],\n row: this.parent[this.selectedRows]\n };\n this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {\n if (!actionArgs.cancel) {\n if (actionArgs.action === 'indenting') {\n if (_this.parent.enableVirtualization) {\n _this.reorderRows([parseInt(_this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'child');\n }\n else {\n _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'child');\n }\n }\n else if (actionArgs.action === 'outdenting') {\n if (_this.parent.enableVirtualization) {\n _this.reorderRows([parseInt(_this.selectedRow.getAttribute('data-rowindex'), 10)], dropIndex, 'below');\n }\n else {\n _this.reorderRows([_this.selectedRow.rowIndex], dropIndex, 'below');\n }\n }\n }\n });\n };\n RowDD.prototype.orderToIndex = function (currentData) {\n for (var i = 0; i < currentData.length; i++) {\n currentData[parseInt(i.toString(), 10)].index = i;\n if (!isNullOrUndefined(currentData[parseInt(i.toString(), 10)].parentItem)) {\n var updatedParent = getValue('uniqueIDCollection.' + currentData[parseInt(i.toString(), 10)].parentUniqueID, this.parent);\n currentData[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)];\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[parseInt(i.toString(), 10)];\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[parseInt(j.toString(), 10)]) === -1) {\n dragRecords_1.splice(j, 0, childData[parseInt(j.toString(), 10)]);\n childData[parseInt(j.toString(), 10)].taskData = extend({}, childData[parseInt(j.toString(), 10)]);\n i += 1;\n }\n }\n }\n if (Object.prototype.hasOwnProperty.call(draggedRecord_1, tObj.parentIdMapping)\n && 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[parseInt(i.toString(), 10)].uniqueID, dragRecords[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)];\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[parseInt(i.toString(), 10)][this.parent.childMapping] ===\n 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][parseInt(i.toString(), 10)]\n = childRecords[parseInt(i.toString(), 10)].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;\n if (this.parent.enableVirtualization) {\n islastRowIndex = element && !isEmptyRow &&\n this.parent.getRows()[this.parent.getCurrentViewRecords().length - 1].getAttribute('data-uid') !==\n element.getAttribute('data-uid');\n }\n else {\n islastRowIndex = element && !isEmptyRow &&\n this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length - 1).getAttribute('data-uid') !==\n element.getAttribute('data-uid');\n }\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[parseInt(i.toString(), 10)].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 if (this.parent.enableVirtualization) {\n rowTop = rowEle.getBoundingClientRect().top;\n }\n else {\n rowTop = rowPositionHeight + contentHeight + roundOff;\n }\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.getRows()[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[parseInt(i.toString(), 10)].classList.add(className);\n }\n else {\n cells[parseInt(i.toString(), 10)].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()[parseInt(rowIdx.toString(), 10)];\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()[parseInt(rowIndex.toString(), 10)];\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()[parseInt(rowIndex.toString(), 10)];\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[parseInt(i.toString(), 10)],\n cell: rows[parseInt(i.toString(), 10)].cells[parseInt(index.toString(), 10)],\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[parseInt(index.toString(), 10)],\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[parseInt(i.toString(), 10)] = records[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)].hasChildRecords) {\n actualData.push(records[parseInt(i.toString(), 10)]);\n var child = findChildrenRecords(records[parseInt(i.toString(), 10)]);\n for (var i_1 = 0; i_1 < child.length; i_1++) {\n actualData.push(child[parseInt(i_1.toString(), 10)]); // 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[parseInt(i.toString(), 10)].index = i;\n if (!isNullOrUndefined(srcControlFlatData[parseInt(i.toString(), 10)].parentItem)) {\n var actualIndex = getValue('uniqueIDCollection.' + srcControlFlatData[parseInt(i.toString(), 10)].parentUniqueID + '.index', srcControl);\n srcControlFlatData[parseInt(i.toString(), 10)].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('data-rowindex'), 10) : 0;\n };\n RowDD.prototype.getParentData = function (record, data) {\n var parentItem = record.parentItem;\n var selectedItemIndex = -1;\n if (this.parent.enableVirtualization && this.parent.selectedRowIndex !== -1) {\n selectedItemIndex = this.parent.getSelectedRows()[0].rowIndex;\n }\n else if (this.parent.selectedRowIndex !== -1) {\n selectedItemIndex = this.parent.selectedRowIndex;\n }\n if (this.dropPosition === 'bottomSegment') {\n var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];\n var rowIndex = selectedItemIndex === -1 ?\n (this.parent.grid.getRowIndexByPrimaryKey(data[0][\"\" + primaryKeyField]))\n : this.parent.getSelectedRowIndexes()[0];\n var selectedRecord = this.parent.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];\n this.droppedRecord = getParentData(this.parent, selectedRecord.parentItem.uniqueID);\n }\n if (this.dropPosition === 'middleSegment') {\n var level = this.parent.getCurrentViewRecords()[parseInt(selectedItemIndex.toString(), 10)].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 primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];\n var rowIndex = tObj.selectedRowIndex === -1 ?\n (this.parent.grid.getRowIndexByPrimaryKey(args.data[0][\"\" + primaryKeyField])) - 1\n : tObj.getSelectedRowIndexes()[0] - 1;\n var record = tObj.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];\n this.getParentData(record, args.data);\n }\n else {\n args.dropIndex = args.dropIndex === args.fromIndex ? this.getTargetIdx(args.target.parentElement) : args.dropIndex;\n if (this.parent.enableVirtualization) {\n var index = this.parent.getRowByIndex(args.dropIndex).rowIndex;\n this.droppedRecord = tObj.getCurrentViewRecords()[parseInt(index.toString(), 10)];\n }\n else {\n this.droppedRecord = tObj.getCurrentViewRecords()[args.dropIndex];\n }\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 this.parent[this.modifiedRecords].push(args.data[0], droppedRecord);\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[parseInt(i.toString(), 10)];\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 draggedRecord_2.level = droppedRecord.level;\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[parseInt(recordIndex1.toString(), 10)].parentItem;\n this.draggedRecord.parentUniqueID = this.treeGridData[parseInt(recordIndex1.toString(), 10)].parentUniqueID;\n this.draggedRecord.level = this.treeGridData[parseInt(recordIndex1.toString(), 10)].level;\n this.treeGridData.splice(parseInt(recordIndex1.toString(), 10), 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 if (!this.isMultipleGrid) {\n currentRecord = getValue('uniqueIDCollection.' + record.childRecords[parseInt(i.toString(), 10)].uniqueID, tObj);\n }\n else {\n currentRecord = record.childRecords[parseInt(i.toString(), 10)];\n }\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 if (!this.isMultipleGrid) {\n currentRecord = getValue('uniqueIDCollection.' + record.childRecords[parseInt(i.toString(), 10)].uniqueID, this.parent);\n }\n else {\n currentRecord = record.childRecords[parseInt(i.toString(), 10)];\n }\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[parseInt(i.toString(), 10)][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[parseInt(i.toString(), 10)][this.parent.idMapping]\n === 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[parseInt(j.toString(), 10)][\"\" + 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 if (this.parent[this.modifiedRecords].indexOf(flatParentData) === -1 && !isNullOrUndefined(flatParentData)) {\n this.parent[this.modifiedRecords].push(flatParentData);\n }\n if (!isNullOrUndefined(flatParentData)) {\n this.updateModifiedRecords(flatParentData);\n }\n }\n };\n RowDD.prototype.updateModifiedRecords = function (record) {\n var parentData = getParentData(this.parent, record.parentUniqueID);\n if (!isNullOrUndefined(parentData)) {\n this.parent[this.modifiedRecords].push(parentData);\n this.updateModifiedRecords(parentData);\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[parseInt(i.toString(), 10)];\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[parseInt(i_2.toString(), 10)][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[parseInt(i_3.toString(), 10)][this.parent.idMapping]\n === 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[parseInt(i.toString(), 10)];\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","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 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 || notifyArgs.virtualInfo.blockIndexes.length === 1) {\n notifyArgs.virtualInfo.blockIndexes = info.blockIndexes;\n }\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[parseInt(r.toString(), 10)].index = (this.visualData).indexOf(rows[parseInt(r.toString(), 10)].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.movableCache = {};\n this.frozenRightCache = {};\n this.data = {};\n this.groups = {};\n }\n else if (action === 'virtualscroll' && this.cache[parseInt(currentPage.toString(), 10)] &&\n this.cache[parseInt(currentPage.toString(), 10)].length >\n (this.parent.contentModule).getBlockSize()) {\n delete this.cache[parseInt(currentPage.toString(), 10)];\n }\n }\n else {\n if (clear || action === 'virtualscroll') {\n this.cache = {};\n this.data = {};\n this.groups = {};\n this.movableCache = {};\n this.frozenRightCache = {};\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[parseInt(f.toString(), 10)];\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[parseInt(count.toString(), 10)].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[parseInt(count.toString(), 10)].uniqueID)) {\n this.filteredResult.push(childRec[parseInt(count.toString(), 10)]);\n setValue('uniqueIDFilterCollection.' + childRec[parseInt(count.toString(), 10)].uniqueID, childRec[parseInt(count.toString(), 10)], 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[parseInt(count.toString(), 10)]) !== -1) {\n isExist = true;\n break;\n }\n }\n if (!isNullOrUndefined(ischild) && ischild.length) {\n isExist = this.checkChildExsist(childRec[parseInt(count.toString(), 10)]);\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[parseInt(c.toString(), 10)].parentUniqueID);\n var isPrst = record.indexOf(parent_2) !== -1;\n if (isPrst) {\n var parent_3 = getParentData(this.parent, record[parseInt(c.toString(), 10)].parentUniqueID, true);\n record[parseInt(c.toString(), 10)].filterLevel = parent_3.filterLevel + 1;\n }\n else {\n record[parseInt(c.toString(), 10)].filterLevel = 0;\n this.filteredParentRecs.push(record[parseInt(c.toString(), 10)]);\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[parseInt(count.toString(), 10)];\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[parseInt(i.toString(), 10)].rows) {\n workbook.worksheets[parseInt(i.toString(), 10)].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 this.parent.flatData.map(function (e) { return e.expanded = e.uniqueID === rowDetails.record.uniqueID &&\n e.expanded !== rowDetails.record.expanded ? rowDetails.record.expanded : e.expanded; });\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[parseInt(t.toString(), 10)]);\n var res = [];\n if (temp[parseInt(t.toString(), 10)].hasChildRecords) {\n res = pagedResults.filter(function (e) {\n return temp[parseInt(t.toString(), 10)].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.updatePageSize = function (pageingDetails) {\n var updateSize = pageingDetails.result.length;\n var gridPagerModule = this.parent.grid.pagerModule;\n if (this.parent.pageSettings.pageSizes === true) {\n if (gridPagerModule.pagerObj.pagerdropdownModule['dropDownListObject'].value === gridPagerModule.pagerObj.getLocalizedLabel('All')) {\n gridPagerModule['pagerObj'].totalRecordsCount = updateSize;\n this.parent.grid.pageSettings.pageSize = updateSize;\n }\n }\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 this.updatePageSize(pageingDetails);\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 toolbarElement = this.parent.grid.toolbarModule.getToolbar();\n if (!isNullOrUndefined(toolbarElement)) {\n var tObj = this.parent;\n var indentElement = void 0;\n var outdentElement = void 0;\n var indentID = tObj.element.id + '_gridcontrol_indent';\n var outdentID = tObj.element.id + '_gridcontrol_outdent';\n var indentEle = toolbarElement.querySelector('#' + indentID);\n var outdentEle = toolbarElement.querySelector('#' + outdentID);\n var row = args.row;\n var selectedrow = tObj.getSelectedRows()[0];\n if (!isNullOrUndefined(row[0])) {\n row = row[0];\n }\n row = (!isNullOrUndefined(selectedrow) && selectedrow.rowIndex !== row.rowIndex) ? selectedrow : row;\n if (indentEle !== null && outdentEle !== null) {\n indentElement = toolbarElement.querySelector('#' + indentID).parentElement;\n outdentElement = toolbarElement.querySelector('#' + outdentID).parentElement;\n if (row.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {\n indentElement.classList.add('e-hidden');\n outdentElement.classList.add('e-hidden');\n }\n else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {\n var selectedItem = tObj.getCurrentViewRecords()[row.rowIndex];\n if (!isNullOrUndefined(selectedItem)) {\n if ((selectedItem.level > tObj.getCurrentViewRecords()[row.rowIndex - 1].level)) {\n indentElement.classList.add('e-hidden');\n }\n else {\n indentElement.classList.remove('e-hidden');\n }\n if (selectedItem.level === tObj.getCurrentViewRecords()[row.rowIndex - 1].level) {\n indentElement.classList.remove('e-hidden');\n }\n if (selectedItem.level === 0) {\n outdentElement.classList.add('e-hidden');\n }\n if (selectedItem.level !== 0) {\n outdentElement.classList.remove('e-hidden');\n }\n }\n }\n if (args['name'] === 'rowDeselected' && isNullOrUndefined(selectedrow) && !tObj.grid.isCheckBoxSelection) {\n if (this.parent.toolbar['includes']('Indent')) {\n indentElement.classList.add('e-hidden');\n }\n if (this.parent.toolbar['includes']('Outdent')) {\n outdentElement.classList.add('e-hidden');\n }\n }\n }\n }\n };\n Toolbar.prototype.toolbarClickHandler = function (args) {\n var tObj = this.parent;\n var indentOutdentAction = 'indentOutdentAction';\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 && !isNullOrUndefined(tObj.rowDragAndDropModule)) {\n this.parent.rowDragAndDropModule[\"\" + indentOutdentAction](null, 'indent');\n }\n if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length\n && !isNullOrUndefined(tObj.rowDragAndDropModule)) {\n this.parent.rowDragAndDropModule[\"\" + indentOutdentAction](null, 'outdent');\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[parseInt(p.toString(), 10)]);\n if (!summaryRow) {\n parentData.push(filteredData[parseInt(p.toString(), 10)]);\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[parseInt(i.toString(), 10)];\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[parseInt(i_1.toString(), 10)]))) ?\n columns[parseInt(i_1.toString(), 10)] : getObject('field', (columns[parseInt(i_1.toString(), 10)]));\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[parseInt(columnIndex.toString(), 10)])) ?\n columns[parseInt(columnIndex.toString(), 10)] : getObject('field', columns[parseInt(columnIndex.toString(), 10)]);\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[parseInt(i.toString(), 10)];\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[parseInt(i.toString(), 10)].columnName) ?\n summary.columns[parseInt(i.toString(), 10)].field : summary.columns[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)];\n var key = summaryColumn.field + ' - ' + types[parseInt(i.toString(), 10)].toLowerCase();\n var val = types[parseInt(i.toString(), 10)] !== 'Custom' ? getObject('aggregates', sumData) :\n calculateAggregate(types[parseInt(i.toString(), 10)], sumData, summaryColumn, this.parent);\n var disp = summaryColumn.columnName;\n var value_1 = types[parseInt(i.toString(), 10)] !== 'Custom' ? val[\"\" + key] : val;\n single[\"\" + disp] = single[\"\" + disp] || {};\n single[\"\" + disp][\"\" + key] = value_1;\n single[\"\" + disp][types[parseInt(i.toString(), 10)]] = !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[parseInt(d.toString(), 10)].uniqueID, true))) {\n this.storedIndex++;\n this.flatSortedData[this.storedIndex] = data[parseInt(d.toString(), 10)];\n }\n }\n else {\n this.storedIndex++;\n this.flatSortedData[this.storedIndex] = data[parseInt(d.toString(), 10)];\n }\n if (data[parseInt(d.toString(), 10)].hasChildRecords) {\n var childSort = (new DataManager(data[parseInt(d.toString(), 10)].childRecords)\n .executeLocal(srtQry));\n if (this.parent.allowRowDragAndDrop && data[parseInt(d.toString(), 10)].childRecords.indexOf(this.parent.rowDragAndDropModule['draggedRecord']) !== -1 && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {\n var dragdIndex = childSort.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);\n childSort.splice(dragdIndex, 1);\n var dropdIndex = childSort.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);\n if (this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {\n childSort.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);\n }\n else if (this.parent.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {\n childSort.splice(dropdIndex + 1, 0, this.parent.rowDragAndDropModule['draggedRecord']);\n }\n }\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 var indent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Indent', args.element);\n var outdent = select('#' + this.parent.element.id + '_gridcontrol_cmenu_Outdent', args.element);\n if (addRow) {\n if (this.parent.grid.editSettings.allowAdding === false || this.parent.grid.isEdit) {\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 var tObj = this.parent;\n var selectedrow = tObj.getSelectedRows()[0];\n if ((indent || outdent) && !isNullOrUndefined(selectedrow)) {\n var targetElement = args.event.target.closest('td');\n if (isNullOrUndefined(targetElement) || (!isNullOrUndefined(targetElement) && !targetElement.classList.contains('e-rowcell'))) {\n indent.style.display = outdent.style.display = 'none';\n }\n else {\n if (selectedrow.rowIndex === 0 || tObj.getSelectedRowIndexes().length > 1) {\n indent.style.display = outdent.style.display = 'none';\n }\n else if (args['name'] !== 'rowDeselected' || (!isNullOrUndefined(selectedrow) && tObj.grid.isCheckBoxSelection)) {\n var selectedItem = tObj.getCurrentViewRecords()[selectedrow.rowIndex];\n if (!isNullOrUndefined(selectedItem)) {\n if ((selectedItem.level > tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level) || this.parent.editSettings.mode === 'Batch'\n || this.parent.editSettings.mode === 'Cell') {\n indent.style.display = 'none';\n }\n else {\n indent.style.display = 'block';\n }\n if ((selectedItem.level === tObj.getCurrentViewRecords()[selectedrow.rowIndex - 1].level) && this.parent.editSettings.mode !== 'Batch'\n && this.parent.editSettings.mode !== 'Cell') {\n indent.style.display = 'block';\n }\n if ((selectedItem.level === 0) || this.parent.editSettings.mode === 'Batch'\n || this.parent.editSettings.mode === 'Cell') {\n outdent.style.display = 'none';\n }\n else {\n outdent.style.display = 'block';\n }\n }\n }\n }\n }\n else {\n if (tObj.grid.isEdit && isNullOrUndefined(selectedrow)) {\n indent.style.display = 'none';\n outdent.style.display = 'none';\n }\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.editModule['isAddedRowByContextMenu'] = true;\n this.parent.addRecord();\n }\n if (args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' || args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Outdent') {\n if (!isNullOrUndefined(this.parent.rowDragAndDropModule)) {\n var indentOutdentAction = 'indentOutdentAction';\n var action = args.item.id === this.parent.element.id + '_gridcontrol_cmenu_Indent' ? 'indent' : 'outdent';\n this.parent.rowDragAndDropModule[\"\" + indentOutdentAction](null, action);\n }\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[parseInt(i.toString(), 10)][\"\" + 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[parseInt(this.addRowIndex.toString(), 10)][\"\" + 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[parseInt(this.addRowIndex.toString(), 10)][\"\" + parentItem]) {\n parentUniqueID = this.batchRecords[parseInt(this.addRowIndex.toString(), 10)][\"\" + 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()[parseInt(rowObjectIndex.toString(), 10)].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[parseInt(this.addRowIndex.toString(), 10)][\"\" + 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()[parseInt(rowObjectIndex.toString(), 10)].data = added;\n this.newBatchRowAdded = false;\n }\n if (this.parent.frozenColumns || this.parent.getFrozenColumns()\n && this.parent.grid.getRowsObject()[parseInt(rowObjectIndex.toString(), 10)].edit === 'add') {\n merge(this.currentViewRecords[parseInt(rowObjectIndex.toString(), 10)], this.parent.grid.getRowsObject()[parseInt(rowObjectIndex.toString(), 10)].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']) &&\n !this.parent.editModule['isAddedRowByContextMenu'] && (this.parent.grid.selectedRowIndex === -1 || this.parent.editModule['batchEditModule'].isAdd)) {\n this.selectedIndex = this.parent.editModule['selectedIndex'];\n this.addRowIndex = this.parent.editModule['addRowIndex'];\n this.addRowRecord = this.batchRecords.length ? this.batchRecords[this.selectedIndex]\n : 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 if (this.parent.editModule['isAddedRowByMethod'] && !isNullOrUndefined(this.parent.editModule['addRowIndex']) && !this.parent.editModule['isAddedRowByContextMenu']) {\n var newlyAddedRecords = this.parent.getBatchChanges()['addedRecords'];\n var index = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[newlyAddedRecords.length - 1].getAttribute('data-rowindex'), 10);\n this.batchRecords.splice(index, 0, newlyAddedRecords[newlyAddedRecords.length - 1]);\n }\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('data-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()[parseInt(i.toString(), 10)]);\n if (this.parent.frozenRows || this.parent.frozenColumns || this.parent.getFrozenColumns()) {\n row.push(this.parent.grid.getMovableRows()[parseInt(i.toString(), 10)]);\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[parseInt(i.toString(), 10)][\"\" + 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[parseInt(i.toString(), 10)])) {\n this.parent.grid.selectionModule.selectedRecords.push(row[parseInt(i.toString(), 10)]);\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[parseInt(i.toString(), 10)].setAttribute('data-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[parseInt(i.toString(), 10)].setAttribute('data-rowindex', i.toString());\n if (freeze) {\n freezeRightRows[parseInt(i.toString(), 10)].setAttribute('data-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][parseInt(i.toString(), 10)][\"\" + parentItem])) {\n if (this.parent.getBatchChanges()[\"\" + addedRecords][parseInt(i.toString(), 10)][\"\" + parentItem][\"\" + primaryKey] === records[parseInt(this.addRowIndex.toString(), 10)][\"\" + 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[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)].uniqueID);\n var childs = findChildrenRecords(record[parseInt(i.toString(), 10)]);\n for (var c = 0; c < childs.length; c++) {\n this.deleteUniqueID(childs[parseInt(c.toString(), 10)].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[parseInt(i.toString(), 10)][\"\" + primaryKey]);\n if (index !== -1) {\n data.splice(index, 1);\n }\n if (this.parent.editSettings.newRowPosition === 'Child') {\n index = currentViewRecords.map(function (e) { return e[\"\" + primaryKey]; })\n .indexOf(this.batchAddedRecords[parseInt(i.toString(), 10)][\"\" + parentItem] ? this.batchAddedRecords[parseInt(i.toString(), 10)][\"\" + parentItem][\"\" + primaryKey]\n : this.batchAddedRecords[parseInt(i.toString(), 10)][\"\" + primaryKey]);\n if (!isNullOrUndefined(currentViewRecords[parseInt(index.toString(), 10)])) {\n var children = currentViewRecords[parseInt(index.toString(), 10)][\"\" + childRecords];\n for (var j = 0; children && j < children.length; j++) {\n if (children[parseInt(j.toString(), 10)][\"\" + primaryKey] === this.batchAddedRecords[parseInt(i.toString(), 10)][\"\" + primaryKey]) {\n currentViewRecords[parseInt(index.toString(), 10)][\"\" + 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[parseInt(i.toString(), 10)][\"\" + parentItem])) {\n index = currentViewRecords.map(function (e) { return e[\"\" + primaryKey]; })\n .indexOf(this.batchDeletedRecords[parseInt(i.toString(), 10)][\"\" + parentItem][\"\" + primaryKey]);\n var positionIndex = this.batchDeletedRecords[parseInt(i.toString(), 10)][\"\" + indexvalue] === 0 ? this.batchDeletedRecords[parseInt(i.toString(), 10)][\"\" + indexvalue] :\n this.batchDeletedRecords[parseInt(i.toString(), 10)][\"\" + indexvalue] - 1;\n if (!isNullOrUndefined(currentViewRecords[parseInt(index.toString(), 10)])) {\n currentViewRecords[parseInt(index.toString(), 10)][\"\" + childRecords].splice(positionIndex, 0, this.batchDeletedRecords[parseInt(i.toString(), 10)]);\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']) && !this.parent.editModule['isAddedRowByContextMenu']) {\n addRecords.reverse();\n for (var i_1 = 0; i_1 < addRecords.length; i_1++) {\n var index_1 = parseInt(this.parent.getContentTable().getElementsByClassName('e-insertedrow')[parseInt(i_1.toString(), 10)].getAttribute('data-rowindex'), 10);\n data.splice(index_1, 0, addRecords[parseInt(i_1.toString(), 10)]);\n }\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 if (this.parent.editModule['isAddedRowByContextMenu']) {\n addRecords.reverse();\n }\n for (i = 0; i < addRecords.length; i++) {\n var taskData = extend({}, addRecords[parseInt(i.toString(), 10)]);\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 if (addRecords.length > 1 && this.parent.editModule['isAddedRowByContextMenu']) {\n var rowPosition = this.parent.editSettings.newRowPosition;\n this.parent.editSettings.newRowPosition = this.parent.editModule['previousNewRowPosition'];\n this.parent.editModule['previousNewRowPosition'] = rowPosition;\n }\n addRecords[parseInt(i.toString(), 10)].taskData = taskData;\n addRowRecord = this.batchAddRowRecord[parseInt(i.toString(), 10)];\n if (isNullOrUndefined(addRowRecord)) {\n addRowRecord = this.batchAddRowRecord[i - 1];\n }\n if (this.isSelfReference) {\n if (!isNullOrUndefined(addRecords[parseInt(i.toString(), 10)].parentItem)) {\n updateParentRow(primarykey_1, addRecords[parseInt(i.toString(), 10)].parentItem, 'add', this.parent, this.isSelfReference, addRecords[parseInt(i.toString(), 10)]);\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[parseInt(i.toString(), 10)].parentItem) && this.selectedIndex === -1) {\n selectedIndex = -1;\n addRowRecord = null;\n }\n }\n editAction({ value: addRecords[parseInt(i.toString(), 10)], action: 'add' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);\n selectedIndex = null;\n if (this.parent.editSettings.newRowPosition === 'Child' && !isNullOrUndefined(addRecords[parseInt(i.toString(), 10)][\"\" + parentItem]) &&\n (isNullOrUndefined(this.parent.editModule['addRowIndex']) || this.isSelfReference)) {\n var indexValue = currentViewRecords.map(function (e) { return e[\"\" + primarykey_1]; })\n .indexOf(addRecords[parseInt(i.toString(), 10)][\"\" + parentItem][\"\" + primarykey_1]);\n var children = currentViewRecords[parseInt(indexValue.toString(), 10)][\"\" + childRecords];\n for (var j = 0; j < children.length; j++) {\n if (children[parseInt(j.toString(), 10)][\"\" + primarykey_1] === addRecords[parseInt(i.toString(), 10)][\"\" + primarykey_1]) {\n currentViewRecords[parseInt(indexValue.toString(), 10)][\"\" + 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][parseInt(i.toString(), 10)], action: 'delete' }, this.parent, this.isSelfReference, addRowIndex, selectedIndex, columnName, addRowRecord);\n }\n }\n this.parent.parentData = [];\n for (var i_2 = 0; i_2 < data.length; i_2++) {\n data[parseInt(i_2.toString(), 10)][\"\" + index] = i_2;\n setValue('uniqueIDCollection.' + data[parseInt(i_2.toString(), 10)][\"\" + uniqueID] + '.index', i_2, this.parent);\n if (!data[parseInt(i_2.toString(), 10)][\"\" + level]) {\n this.parent.parentData.push(data[parseInt(i_2.toString(), 10)]);\n }\n }\n }\n this.batchAddRowRecord = this.batchAddedRecords = this.batchRecords = this.batchDeletedRecords = this.currentViewRecords = [];\n if (this.parent.editModule['isAddedRowByContextMenu']) {\n this.parent.editModule['isAddedRowByContextMenu'] = false;\n }\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[parseInt(i.toString(), 10)][\"\" + index], 1);\n }\n };\n BatchEdit.prototype.nextCellIndex = function (args) {\n var index = 'index';\n var rowIndex = 'rowIndex';\n if (this.parent.getSelectedRows().length) {\n args[\"\" + index] = this.parent.getSelectedRows()[0][\"\" + rowIndex];\n }\n else {\n args[\"\" + index] = this.batchIndex;\n }\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 this.isAddedRowByContextMenu = 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.dataRowIndex = +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()[parseInt(rowIndex.toString(), 10)][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[parseInt(i.toString(), 10)].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[parseInt(page.toString(), 10)];\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[parseInt(page.toString(), 10)];\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('data-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('data-rowindex');\n tr.setAttribute('data-rowindex', tr.rowIndex + '');\n }\n this.updateGridEditMode('Batch');\n }\n else if (this.parent.editSettings.mode === 'Cell' && (!column.allowEditing || column.isPrimaryKey)) {\n this.isOnBatch = true;\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('data-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.parent.enableVirtualization) {\n this.parent.grid.contentModule['editedRowIndex'] = this.parent.grid.editModule.editModule['index'];\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 if (this.parent.enableVirtualization) {\n this.parent.grid.contentModule['virtualData'] = {};\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()[parseInt(rowIndex.toString(), 10)];\n }\n else if (args.cell.closest('.e-movableheader') || args.cell.closest('.e-movablecontent')) {\n mRow = this.parent.grid.getMovableRows()[parseInt(rowIndex.toString(), 10)];\n }\n else {\n mRow = this.parent.grid.getFrozenRightRows()[parseInt(rowIndex.toString(), 10)];\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()[parseInt(rowIndex.toString(), 10)];\n }\n else {\n mRow = this.parent.grid.getMovableRows()[parseInt(rowIndex.toString(), 10)];\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()[parseInt(rowIndex.toString(), 10)].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[parseInt(i.toString(), 10)].index = i;\n var key = this.parent.grid.getPrimaryKeyFieldNames()[0];\n if (details.value[\"\" + key] === data[parseInt(i.toString(), 10)][\"\" + key]) {\n if (details.action === 'add') {\n data[parseInt(i.toString(), 10)].level = this.internalProperties.level;\n data[parseInt(i.toString(), 10)].taskData = this.internalProperties.taskData;\n data[parseInt(i.toString(), 10)].uniqueID = this.internalProperties.uniqueID;\n if (!isNullOrUndefined(this.internalProperties.parentItem)) {\n data[parseInt(i.toString(), 10)].parentItem = this.internalProperties.parentItem;\n data[parseInt(i.toString(), 10)].parentUniqueID = this.internalProperties.parentUniqueID;\n }\n data[parseInt(i.toString(), 10)].childRecords = this.internalProperties.childRecords;\n }\n }\n setValue('uniqueIDCollection.' + data[parseInt(i.toString(), 10)].uniqueID + '.index', i, this.parent);\n var adaptor = this.parent.dataSource.adaptor;\n if ((isRemoteData(this.parent) || adaptor instanceof RemoteSaveAdaptor)) {\n setValue('uniqueIDCollection.' + data[parseInt(i.toString(), 10)].uniqueID, data[parseInt(i.toString(), 10)], this.parent);\n }\n if (!data[parseInt(i.toString(), 10)].level) {\n this.parent.parentData.push(data[parseInt(i.toString(), 10)]);\n }\n }\n if (!this.parent.enableInfiniteScrolling) {\n if (details.action === 'add' && this.previousNewRowPosition != null) {\n this.parent.setProperties({ editSettings: { newRowPosition: this.previousNewRowPosition } }, true);\n this.previousNewRowPosition = null;\n }\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[parseInt(j.toString(), 10)];\n if (!isNullOrUndefined(data1)) {\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 }\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[parseInt(l.toString(), 10)].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[parseInt(k.toString(), 10)].classList.contains('e-detailrow')) {\n count++;\n }\n var data2 = records[parseInt(count.toString(), 10)];\n if (!isNullOrUndefined(data2)) {\n var index = data2.index;\n var level = data2.level;\n var row = rows[parseInt(k.toString(), 10)];\n if (!isNullOrUndefined(data2.parentItem)) {\n index = getValue('uniqueIDCollection.' + data2.parentItem.uniqueID + '.index', this.parent);\n }\n var treecell = row.cells[parseInt(treeColIndex.toString(), 10)];\n if (!isNullOrUndefined(treecell)) {\n for (var l = 0; l < treecell.classList.length; l++) {\n var value = treecell.classList[parseInt(l.toString(), 10)];\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[parseInt(k.toString(), 10)].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 };\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('data-rowindex') : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-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[parseInt(index.toString(), 10)]) &&\n records[parseInt(index.toString(), 10)].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[parseInt(index.toString(), 10)]).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[parseInt(index.toString(), 10)]).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[parseInt(i.toString(), 10)].remove();\n }\n setValue('errorRules', [], this.parent.grid.editModule.formObj);\n }\n if (isVirtualization) {\n this.prevAriaRowIndex = '-1';\n }\n if (!this.parent.enableVirtualization || this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {\n focussedElement.focus();\n }\n if (this.parent.enableVirtualization && !Object.keys(this.parent.grid.contentModule['emptyRowData']).length) {\n this.parent.grid.contentModule['createEmptyRowdata']();\n }\n }\n }\n if (this.parent.editSettings.mode === 'Batch' && !isNullOrUndefined(this.addRowIndex) && this.addRowIndex !== -1 && this['isAddedRowByMethod'] && !this.isAddedRowByContextMenu) {\n index = this.batchEditModule.getAddRowIndex();\n this.selectedIndex = this.batchEditModule.getSelectedIndex();\n var batchAddedRecords = this.parent.getBatchChanges()['addedRecords'];\n var newlyAddedRecord = void 0;\n if (batchAddedRecords.length) {\n for (var i = 0; i < batchAddedRecords.length; i++) {\n if (isNullOrUndefined(batchAddedRecords[parseInt(i.toString(), 10)].uniqueID)) {\n newlyAddedRecord = batchAddedRecords[parseInt(i.toString(), 10)];\n }\n }\n }\n var args = {\n action: 'add',\n data: newlyAddedRecord,\n index: index,\n seletedRow: 0\n };\n this.beginAddEdit(args);\n this.batchEditModule['batchAddRowRecord'].push(this.batchEditModule['addRowRecord']);\n this.batchEditModule['batchAddedRecords'].push(args['data']);\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[parseInt(i.toString(), 10)][primaryKeys_2[0]]) {\n data_1[parseInt(i.toString(), 10)] = 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[parseInt(i.toString(), 10)].uniqueID);\n var childs = findChildrenRecords(data_1[parseInt(i.toString(), 10)]);\n for (var c = 0; c < childs.length; c++) {\n this.deleteUniqueID(childs[parseInt(c.toString(), 10)].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[data-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[data-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 if (args.index !== 0) {\n this.addRowIndex = args.index;\n }\n else {\n this.addRowIndex = this.parent.grid.selectedRowIndex;\n }\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[this.parent.grid.selectedRowIndex];\n if (this.parent.enableVirtualization && this.isAddedRowByContextMenu) {\n this.addRowRecord = this.parent.getCurrentViewRecords()[this.addRowIndex];\n }\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 = void 0;\n if (this.parent.enableVirtualization && args.index !== 0) {\n currentData = this.parent.flatData;\n }\n else if (this.parent.editSettings.mode === 'Batch' && this['isAddedRowByMethod'] && !isNullOrUndefined(this.addRowIndex)) {\n currentData = this.batchEditModule['batchRecords'];\n }\n else {\n currentData = this.parent.grid.getCurrentViewRecords();\n }\n if (this.parent.enableVirtualization && args.index !== 0) {\n this.addRowIndex = this.parent.flatData.indexOf(this.addRowRecord);\n this.selectedIndex = this.addRowIndex;\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 ? currentData.indexOf(currentData[0]) : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-rowindex') : 0;\n var withinRange = this.parent.enableVirtualization && args.index !== 0 ? true :\n 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 if (!this.parent.isLocalData && this.parent.editModule.selectedIndex === -1) {\n value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = null;\n }\n else {\n value.taskData[this.parent.parentIdMapping] = value[this.parent.parentIdMapping] = idMapping;\n }\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[parseInt(i.toString(), 10)].parentItem) {\n var parentItem = getParentData(this.parent, deletedValues[parseInt(i.toString(), 10)].parentItem.uniqueID);\n if (!isNullOrUndefined(parentItem) && parentItem.hasChildRecords) {\n var childIndex = parentItem.childRecords.indexOf(deletedValues[parseInt(i.toString(), 10)]);\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[parseInt(i.toString(), 10)].getElementsByClassName('e-detailrowcollapse');\n var detailData = this.parent.grid.getRowObjectFromUID(detailele[parseInt(i.toString(), 10)].getAttribute('data-Uid'));\n var parentItem = getObject('parentItem', this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(), 10)]);\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[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)].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 * as literals from '../base/constant';\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('data-rowindex'), 10) === index; })[0];\n };\n VirtualTreeContentRenderer.prototype.getMovableVirtualRowByIndex = function (index) {\n return this.getRowCollection(index, true);\n };\n VirtualTreeContentRenderer.prototype.getFrozenRightVirtualRowByIndex = function (index) {\n return this.getRowCollection(index, false, false, true);\n };\n VirtualTreeContentRenderer.prototype.getRowCollection = function (index, isMovable, isRowObject, isFrozenRight) {\n var startIdx = parseInt(this.parent.getRows()[0].getAttribute(literals.dataRowIndex), 10);\n var rowCollection = isMovable ? this.parent.getMovableDataRows() : this.parent.getDataRows();\n rowCollection = isFrozenRight ? this.parent.getFrozenRightDataRows() : rowCollection;\n var collection = isRowObject ? this.parent.getCurrentViewRecords() : rowCollection;\n var selectedRow = collection[index - startIdx];\n if (this.parent.frozenRows && this.parent.pageSettings.currentPage > 1) {\n if (!isRowObject) {\n selectedRow = index <= this.parent.frozenRows ? rowCollection[parseInt(index.toString(), 10)]\n : rowCollection[(index - startIdx) + this.parent.frozenRows];\n }\n else {\n selectedRow = index <= this.parent.frozenRows ?\n this.parent.getRowsObject()[parseInt(index.toString(), 10)].data : selectedRow;\n }\n }\n return selectedRow;\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 if (this.parent.root.editSettings.newRowPosition !== 'Top' && this.parent.root.editModule.selectedIndex !== -1 || this.parent.root.editModule.selectedIndex !== -1) {\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(), _this.parent);\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 // To overcome the white space issue in last page when records collapsed\n if (this.parent.isFrozenGrid() && e.count < Object.keys(this.parent.dataSource).length) {\n var width = this.parent.enableColumnVirtualization ?\n this.getColumnOffset(this.parent.columns.length - 1) + 'px' : '100%';\n var height = (this.parent.getRowHeight() * e.count) -\n (this.parent.getRowHeight() * this.parent.pageSettings.pageSize);\n getValue('virtualEle', this).setVirtualHeight(height, width);\n }\n if (!this.parent.enableColumnVirtualization && !this.parent.isFrozenGrid()) {\n getValue('virtualEle', this).setVirtualHeight(this.parent.getRowHeight() * e.count, '100%');\n }\n }\n if ((!isNullOrUndefined(e.requestType) && e.requestType.toString() === 'collapseAll') || (this.isDataSourceChanged && (this.startIndex === -1 || this.startIndex === 0 && this['preStartIndex'] === 0))) {\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 (!isNullOrUndefined(this.parent.getRowByIndex(0)) && this.parent.getRows().length && !this[\"\" + initialRowTop]) {\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[parseInt(i.toString(), 10)]));\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 this['editedRowIndex'] = e.index;\n var selector = '.e-row[data-rowindex=\"' + e.index + '\"]';\n var index = this.parent.getContent().querySelector(selector).rowIndex;\n var rowData = this.parent.getCurrentViewRecords()[parseInt(index.toString(), 10)];\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, dataRowIndex: this.dataRowIndex };\n this.parent.notify('get-row-position', addArgs);\n this.rowPosition = addArgs.newRowPosition;\n this.addRowIndex = addArgs.addRowIndex;\n this.dataRowIndex = addArgs.dataRowIndex;\n var rows = this.parent.getRows();\n var firstAriaIndex = rows.length ? +rows[0].getAttribute('data-rowindex') : 0;\n var lastAriaIndex = rows.length ? +rows[rows.length - 1].getAttribute('data-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.editModule.addRecord(null, this.parent.root.editModule.selectedIndex);\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, dataRowIndex: this.dataRowIndex };\n this.parent.notify('get-row-position', addArgs);\n this.rowPosition = addArgs.newRowPosition;\n this.addRowIndex = addArgs.addRowIndex;\n this.dataRowIndex = this.parent.root.editModule.selectedIndex;\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] && !_this.parent.enableVirtualMaskRow) {\n _this.parent.showSpinner();\n }\n if (_this.parent.enableVirtualMaskRow && !_this[\"\" + preventEvent]) {\n setTimeout(function () {\n _this.parent.showMaskRow(current.axis);\n _this.parent.notify('showGanttShimmer', { requestType: 'showShimmer' });\n }, 0);\n }\n var height = _this.content.getBoundingClientRect().height;\n var top_1 = _this.prevInfo.offsets ? _this.prevInfo.offsets.top : null;\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 var y = _this.getTranslateY(e.top, height, xAxis && top_1 === e.top ? _this.prevInfo : undefined, true);\n if (!_this.parent.isFrozenGrid() || _this.parent.enableVirtualMaskRow) {\n if (_this.parent.enableVirtualMaskRow) {\n var upScroll = (e.top - _this.translateY) < 0;\n y = (Math.round(_this.translateY) > y && !upScroll) ? Math.round(_this.translateY) : y;\n _this.virtualEle.adjustTable(x, y);\n }\n else {\n _this.virtualEle.adjustTable(x, _this.translateY);\n }\n if (_this.parent.enableColumnVirtualization) {\n _this.header.virtualEle.adjustTable(x, 0);\n }\n }\n }\n };\n };\n VirtualTreeContentRenderer.prototype.scrollListeners = function (scrollArgs) {\n this['scrollAfterEdit']();\n var info = scrollArgs.sentinel;\n var rowHeight = this.parent.getRowHeight();\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 * rowHeight;\n var upScroll = (scrollArgs.offset.top - this.translateY) < 0;\n var downScroll = Math.ceil(scrollArgs.offset.top - this.translateY) + rowHeight >= scrollHeight;\n var selectedRowIndex = 'selectedRowIndex';\n var currentViewData = this.parent.currentViewData;\n var indexValue = 'index';\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 / rowHeight)\n + Math.ceil(vHeight / rowHeight))\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 if (currentViewData.length && (currentViewData[0][\"\" + indexValue] >= this.parent.pageSettings.pageSize / 2) &&\n ((currentViewData[0][\"\" + indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {\n this.startIndex = currentViewData[0][\"\" + indexValue] - (this.parent.pageSettings.pageSize / 2);\n this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;\n }\n //var firsttdinx = parseInt(this.parent.getContent().querySelector('.e-content td').getAttribute('index'), 0);\n var rowPt = Math.ceil(scrollArgs.offset.top / rowHeight);\n rowPt = rowPt % this.parent.pageSettings.pageSize;\n var firsttdinx = 0;\n if (!isNullOrUndefined(this.parent.getRows()[parseInt(rowPt.toString(), 10)]) &&\n !isNullOrUndefined(this.parent.getContent().querySelectorAll('.e-content tr')[parseInt(rowPt.toString(), 10)])) {\n var attr = this.parent.getContent().querySelectorAll('.e-content tr')[parseInt(rowPt.toString(), 10)]\n .querySelector('td').getAttribute('index');\n firsttdinx = +attr; // this.parent.getContent().querySelector('.e-content tr').getAttribute('data-rowindex');\n }\n if (firsttdinx === 0) {\n if (this.parent.allowRowDragAndDrop) {\n this.translateY = scrollArgs.offset.top - rowHeight * 2;\n }\n else {\n this.translateY = scrollArgs.offset.top;\n }\n }\n else {\n this.translateY = (scrollArgs.offset.top - (outBuffer * rowHeight) > 0) ?\n scrollArgs.offset.top - (outBuffer * rowHeight) + 10 : 0;\n }\n }\n else if (downScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {\n var nextSetResIndex = ~~(content.scrollTop / rowHeight);\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 (currentViewData.length && this.startIndex > currentViewData[0][\"\" + indexValue] &&\n ((this.startIndex - currentViewData[0][\"\" + indexValue]) < (this.parent.pageSettings.pageSize / 2))) {\n this.startIndex = currentViewData[0][\"\" + indexValue] + (this.parent.pageSettings.pageSize / 2);\n }\n if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {\n this.translateY = this.getTranslateY(scrollArgs.offset.top, content.getBoundingClientRect().height);\n }\n else {\n if (this.parent.allowRowDragAndDrop) {\n this.translateY = scrollArgs.offset.top - rowHeight * 2;\n }\n else {\n this.translateY = scrollArgs.offset.top;\n }\n }\n }\n if (((downScroll && (scrollArgs.offset.top < (rowHeight * this.totalRecords)))\n || (upScroll)) || (scrollArgs.direction === 'right' || scrollArgs.direction === 'left') ||\n ((this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined\n && !this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') && (downScroll || upScroll) || isCountRequired(this.parent))) {\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 this.requestType = 'virtualscroll';\n if (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left') {\n viewInfo.event = viewInfo.event === 'refresh-virtual-block' ? 'model-changed' : viewInfo.event;\n }\n if (this.parent.enableVirtualMaskRow) {\n this.parent.showMaskRow(info.axis);\n this.parent.addShimmerEffect();\n this.parent.notify('showGanttShimmer', { requestType: 'showShimmer' });\n }\n this.parent.notify(viewInfo.event, { requestType: 'virtualscroll', virtualInfo: viewInfo, focusElement: scrollArgs.focusElement });\n }\n else {\n if (this.parent.enableVirtualMaskRow) {\n this.parent.removeMaskRow();\n this.parent.notify('removeGanttShimmer', { requestType: 'hideShimmer' });\n }\n }\n };\n VirtualTreeContentRenderer.prototype.appendContent = function (target, newChild, e) {\n var isFrozen = this.parent.isFrozenGrid();\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) || this.parent.isFrozenGrid()) {\n if (getValue('isExpandCollapse', e)) {\n this.isRemoteExpand = true;\n }\n if (isFrozen && ((isNullOrUndefined(this.requestType) && getValue('requestTypes', this).indexOf('isFrozen') === -1) ||\n (this.parent.enableVirtualMaskRow && this.requestType === 'virtualscroll'))) {\n getValue('requestTypes', this).push('isFrozen');\n this.requestType = 'isFrozen';\n }\n _super.prototype.appendContent.call(this, target, newChild, e);\n if (getValue('requestTypes', this).indexOf('isFrozen') !== -1) {\n getValue('requestTypes', this).splice(getValue('requestTypes', this).indexOf('isFrozen'), 1);\n this.requestType = this.requestType === 'isFrozen' ? undefined : this.requestType;\n }\n if (isFrozen && (!this.isExpandCollapse || this.translateY === 0)) {\n this.translateY = this.translateY < 0 ? 0 : this.translateY;\n getValue('virtualEle', this).adjustTable(0, this.translateY);\n }\n else {\n this.isExpandCollapse = false;\n }\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.dataRowIndex >= 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, instance) {\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, instance), this);\n if (getValue('options', this).movableContainer) {\n var movableContainerRect = 'movableContainerRect';\n _super.prototype[\"\" + movableContainerRect] = getValue('options', this).movableContainer.getBoundingClientRect();\n EventHandler.add(getValue('options', this).movableContainer, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback, instance), this);\n }\n };\n TreeInterSectionObserver.prototype.clear = function () {\n this.lastPos = null;\n };\n TreeInterSectionObserver.prototype.virtualScrollHandlers = function (callback, onEnterCallback, instance) {\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' || instance.enableVirtualMaskRow)) {\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 = debounced50;\n if (current.axis === 'X') {\n fn({ direction: direction, sentinel: current, offset: { top: top, left: left },\n focusElement: document.activeElement });\n }\n else {\n if ((instance.dataSource instanceof DataManager && instance.dataSource.dataSource.url !== undefined\n && !instance.dataSource.dataSource.offline && instance.dataSource.dataSource.url !== '') || isCountRequired(instance)\n || instance.enableVirtualMaskRow) {\n fn = instance.enableVirtualMaskRow ? debounced100 : fn;\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 }\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' || requestType === 'searching' ||\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 startIndex = startIndex < 0 ? 0 : startIndex;\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.isFrozenGrid()) {\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 }\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","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 { ColumnFreezeContentRenderer, FreezeContentRender, FreezeRowModelGenerator, RenderType } from '@syncfusion/ej2-grids';\nimport * as literals from '../base/constant';\nimport { ColumnVirtualFreezeRenderer, setDebounce, VirtualFreezeHdrRenderer, VirtualFreezeRenderer } from '@syncfusion/ej2-grids';\nimport { TreeInterSectionObserver, VirtualTreeContentRenderer } from './virtual-tree-content-render';\nimport { getValue } from '@syncfusion/ej2-base';\n/**\n * VirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table\n *\n * @hidden\n */\nvar VirtualTreeFreezeRenderer = /** @class */ (function (_super) {\n __extends(VirtualTreeFreezeRenderer, _super);\n function VirtualTreeFreezeRenderer(parent, locator) {\n var _this = _super.call(this, parent, locator) || this;\n _this.addEventListener();\n return _this;\n }\n /**\n * @returns {void}\n * @hidden\n */\n VirtualTreeFreezeRenderer.prototype.renderTable = function () {\n this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);\n this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);\n this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')\n .getRenderer(RenderType.Header).virtualHdrRenderer;\n FreezeContentRender.prototype.renderTable.call(this);\n this.virtualRenderer.setPanel(this.parent.getContent());\n this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');\n var movableCont = this.getMovableContent();\n var minHeight = this.parent.height;\n this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + literals.content);\n this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';\n this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);\n this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();\n if (this.parent.enableColumnVirtualization) {\n this.virtualRenderer.virtualEle.movableContent = this.virtualRenderer.movableContent\n = this.getPanel().querySelector('.' + literals.movableContent);\n this.virtualRenderer.virtualEle.renderMovableWrapper(minHeight);\n this.virtualRenderer.virtualEle.renderMovablePlaceHolder();\n var tbl = movableCont.querySelector('table');\n this.virtualRenderer.virtualEle.movableTable = tbl;\n this.virtualRenderer.virtualEle.movableWrapper.appendChild(tbl);\n movableCont.appendChild(this.virtualRenderer.virtualEle.movableWrapper);\n movableCont.appendChild(this.virtualRenderer.virtualEle.movablePlaceholder);\n }\n this.virtualRenderer.virtualEle.wrapper.appendChild(this.getFrozenContent());\n this.virtualRenderer.virtualEle.wrapper.appendChild(movableCont);\n this.virtualRenderer.virtualEle.table = this.getTable();\n setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());\n };\n /**\n * @param {HTMLElement} target - specifies the target\n * @param {DocumentFragment} newChild - specifies the newChild\n * @param {NotifyArgs} e - specifies the notifyargs\n * @returns {void}\n * @hidden\n */\n VirtualTreeFreezeRenderer.prototype.appendContent = function (target, newChild, e) {\n getValue('observer', this.virtualRenderer).options.debounceEvent = false;\n this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);\n this.virtualRenderer['contents'] = this.getPanel().firstChild;\n _super.prototype.appendContent.call(this, target, newChild, e);\n };\n /**\n * @param {Object[]} data - specifies the data\n * @param {NotifyArgs} e - specifies the notifyargs\n * @returns {Row<Column>[]} returns the row\n * @hidden\n */\n VirtualTreeFreezeRenderer.prototype.generateRows = function (data, e) {\n return _super.prototype.generateRows.call(this, data, e);\n };\n return VirtualTreeFreezeRenderer;\n}(VirtualFreezeRenderer));\nexport { VirtualTreeFreezeRenderer };\n/**\n * ColumnVirtualTreeFreezeRenderer is used to render the virtual table within the frozen and movable content table\n *\n * @hidden\n */\nvar ColumnVirtualTreeFreezeRenderer = /** @class */ (function (_super) {\n __extends(ColumnVirtualTreeFreezeRenderer, _super);\n function ColumnVirtualTreeFreezeRenderer(parent, locator) {\n var _this = _super.call(this, parent, locator) || this;\n _this.serviceLoc = locator;\n _this.eventListener('on');\n return _this;\n }\n /**\n * @returns {void}\n * @hidden\n */\n ColumnVirtualTreeFreezeRenderer.prototype.renderTable = function () {\n this.virtualRenderer = new VirtualTreeContentRenderer(this.parent, this.serviceLoc);\n this.virtualRenderer.header = this.serviceLoc.getService('rendererFactory')\n .getRenderer(RenderType.Header).virtualHdrRenderer;\n this.freezeRowGenerator = new FreezeRowModelGenerator(this.parent);\n ColumnFreezeContentRenderer.prototype.renderTable.call(this);\n this.virtualRenderer.setPanel(this.parent.getContent());\n this.scrollbar = this.parent.getContent().querySelector('.e-movablescrollbar');\n var frozenRightCont = this.getFrozenRightContent();\n var frzCont = this.getFrozenContent();\n var movableCont = this.getMovableContent();\n if (this.parent.getFrozenMode() === 'Right') {\n frzCont = frozenRightCont;\n }\n this.virtualRenderer.virtualEle.content = this.virtualRenderer.content = this.getPanel().querySelector('.' + literals.content);\n this.virtualRenderer.virtualEle.content.style.overflowX = 'hidden';\n var minHeight = this.parent.height;\n this.virtualRenderer.virtualEle.renderFrozenWrapper(minHeight);\n this.virtualRenderer.virtualEle.renderFrozenPlaceHolder();\n _super.prototype['renderVirtualFrozenLeft'].call(this, frzCont, movableCont);\n _super.prototype['renderVirtualFrozenRight'].call(this, frzCont, movableCont);\n _super.prototype['renderVirtualFrozenLeftRight'].call(this, frzCont, movableCont, frozenRightCont);\n this.virtualRenderer.virtualEle.table = this.getTable();\n setDebounce(this.parent, this.virtualRenderer, this.scrollbar, this.getMovableContent());\n };\n ColumnVirtualTreeFreezeRenderer.prototype.appendContent = function (target, newChild, e) {\n getValue('observer', this.virtualRenderer).options.debounceEvent = false;\n this.virtualRenderer['observers'] = new TreeInterSectionObserver(getValue('observer', this.virtualRenderer).element, getValue('observer', this.virtualRenderer).options, getValue('observer', this.virtualRenderer).movableEle);\n this.virtualRenderer['contents'] = this.getPanel().firstChild;\n _super.prototype.appendContent.call(this, target, newChild, e);\n };\n return ColumnVirtualTreeFreezeRenderer;\n}(ColumnVirtualFreezeRenderer));\nexport { ColumnVirtualTreeFreezeRenderer };\n/**\n * VirtualTreeFreezeHdrRenderer is used to render the virtual table within the frozen and movable header table\n *\n * @hidden\n */\nvar VirtualTreeFreezeHdrRenderer = /** @class */ (function (_super) {\n __extends(VirtualTreeFreezeHdrRenderer, _super);\n function VirtualTreeFreezeHdrRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n /**\n * @returns {void}\n * @hidden\n */\n VirtualTreeFreezeHdrRenderer.prototype.renderTable = function () {\n _super.prototype.renderTable.call(this);\n };\n VirtualTreeFreezeHdrRenderer.prototype.rfshMovable = function () {\n _super.prototype.rfshMovable.call(this);\n };\n return VirtualTreeFreezeHdrRenderer;\n}(VirtualFreezeHdrRenderer));\nexport { VirtualTreeFreezeHdrRenderer };\n","import { ColumnFreezeContentRenderer, ColumnFreezeHeaderRenderer, FreezeContentRender, FreezeRender, parentsUntil, RenderType } from '@syncfusion/ej2-grids';\nimport { Grid, Freeze as FreezeColumn } from '@syncfusion/ej2-grids';\nimport { addClass, getValue } from '@syncfusion/ej2-base';\nimport { ColumnVirtualTreeFreezeRenderer, VirtualTreeFreezeRenderer, VirtualTreeFreezeHdrRenderer } from '../renderer/virtual-tree-freeze-render';\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 this.parent.grid.on('initial-load', this.instantiateRenderer, 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 this.parent.grid.off('initial-load', this.instantiateRenderer);\n };\n Freeze.prototype.instantiateRenderer = function () {\n var renderer = getValue('serviceLocator', this.parent.grid).getService('rendererFactory');\n if (this.parent.getFrozenColumns()) {\n if (this.parent.enableColumnVirtualization) {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Header, new VirtualTreeFreezeHdrRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);\n }\n else {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Header, new FreezeRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);\n }\n if (this.parent.enableVirtualization) {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Content, new VirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);\n }\n else {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Content, new FreezeContentRender(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);\n }\n }\n if (this.parent.getFrozenLeftColumnsCount() || this.parent.getFrozenRightColumnsCount()) {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Header, new ColumnFreezeHeaderRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);\n if (this.parent.enableVirtualization) {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Content, new ColumnVirtualTreeFreezeRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);\n }\n else {\n getValue('addRenderer', renderer)\n .apply(renderer, [RenderType.Content, new ColumnFreezeContentRenderer(getValue('grid', this.parent), getValue('serviceLocator', this.parent.grid))]);\n }\n }\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[parseInt(i.toString(), 10)].getAttribute('data-Uid')).data;\n rows[parseInt(i.toString(), 10)].style.display = args.action;\n if (freeze && frozenRightRows.length) {\n frozenRightRows[parseInt(i.toString(), 10)].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[parseInt(i.toString(), 10)].rowIndex].querySelector(queryselector)) {\n var cRow = [];\n for (var i_1 = 0; i_1 < movableRows.length; i_1++) {\n if (movableRows[parseInt(i_1.toString(), 10)].querySelector('.e-gridrowindex' + rData.index + 'level' + (rData.level + 1))) {\n cRow.push(movableRows[parseInt(i_1.toString(), 10)]);\n }\n }\n if (cRow.length) {\n var data = this.parent.getCurrentViewRecords()[cRow[0].rowIndex];\n this.rowExpandCollapse({ detailrows: cRow, action: args.action, record: data });\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' && (!e.target['classList'].contains('e-treegridcollapse') && !e.target['classList'].contains('e-treegridexpand'))) {\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[parseInt(i.toString(), 10)], 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[parseInt(i.toString(), 10)]);\n }\n else {\n rows[args.index + i + 1][\"\" + position](childRowElements[parseInt(i.toString(), 10)]);\n }\n rows.splice(args.index + 1 + i, 0, childRowElements[parseInt(i.toString(), 10)]);\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 if (this.parent.grid.infiniteScrollModule['isInitialRender'] && !this.parent.initialRender) {\n this.parent.grid.pageSettings.currentPage = 1;\n }\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.grid.pageSettings.pageSize * this.parent.infiniteScrollSettings.initialBlocks :\n this.parent.grid.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.grid.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[parseInt(i.toString(), 10)]);\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[parseInt(i.toString(), 10)][\"\" + 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[parseInt(index.toString(), 10)]);\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[parseInt(i.toString(), 10)], 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[parseInt(newRowIndex.toString(), 10)]).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[parseInt(newRowIndex.toString(), 10)][\"\" + 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","parseInt","toString","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","filter","item","isSummaryRow","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","e","p","enableImmutableMode","removeChildRecords","currentViewRecords","getCurrentViewRecords","unshift","primaryKeys","currentdata","isChildAll","editRowIndex","updateCurrentViewData","child","index_1","currentRecords","map","enableVirtualization","updatedParent","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","setProperties","clipboardModule","uid","__extends","extendStatics","d","b","setPrototypeOf","__proto__","__","constructor","create","__decorate","decorators","target","desc","c","arguments","r","getOwnPropertyDescriptor","Reflect","decorate","defineProperty","LoadingIndicator","_super","apply","Property","ChildProperty","Predicate","FilterSettings","Collection","TextWrapSettings","DOC_URL","BASE_DOC_URL","IsRowDDEnabled","Logger","Grid","Inject","GridLogger","getModuleName","log","types","args","type","detailLists","cOp","check","success","message","generateMessage","replace","gridurl","substring","treeGridObj","dataStateChange","console","logType","treeLog","treeGrid","isPrimaryKey","treeGridDetails","mapping_fields_missing","opt","ERROR","TreeClipboard","serviceLocator","_this","treeCopyContent","copiedUniqueIdCollection","treeGridParent","setCopyData","withHeader","getSelection","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","searchingRecords","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","headerCelllength","getHeaderContent","getAttribute","headerElement","rowChkBox","createElement","className","attrs","createCheckBox","label","add","insertBefore","cloneNode","firstChild","renderColumnCheckbox","aria-label","setAttribute","checkboxState","allowTextWrap","width","checkbox","removeClass","container","containerELe","spanEle","innerHTML","divEle","appendChild","rowIndexes","flatRecord","traverSelection","ischildItem","updateSelectedItems","updateParentSelection","filterModule","filteredResult","getFilteredChildRecords","count","indeter","checkChildRecords","checkBoxRecord","hasFilteredChildRecords","checkAll","multiFilterCheckState","filterResult","rec","currentRecord","checkedRecord","recordIndex","checkboxRecord","tr","movableTr","getMovableDataRows","checkedIndex","checkBoxclass","chkstate","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","expandIcon","expand","updateTreeCell","getFrozenLeftColumnsCount","getFrozenRightColumnsCount","freezerightColumns","getFrozenRightColumns","freezeLeftColumns","getFrozenLeftColumns","movableColumns","getMovableColumns","field","notify","checkboxElement","summaryData","template","rowTemplate","treeColumn","colindex","templateCompiler","textContent","appendChildren","children","tempID","element","id","isReact","result","refreshReactColumnTemplateByUid","columnUid","clearTemplate","undefined","rowsObj","getRowsObject","indent","getIndentCount","cellIndex","getNormalizedColumnIndex","isDataRow","cellRenderer","CellRenderer","td","getCellFromIndex","refreshTD","treecell","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","searchString","expands","loadChildOnDemand","isExpandCollapse","this_1","childRecords_1","parent_1","getUid","Math","ceil","random","aggregates","summaryQuery","q","fn","summaryModule","calculateSummaryValue","rowDetails","isChild","gridRows","getContentTable","childRecord","targetEle","getElementsByClassName","getRowObjectFromUID","childRows","parentRow","expandingTd","detailRowModule","fetchRemoteChildData","getDataModule","generateQuery","clonequries","take","pageSize","expandDetail","showSpinner","currentViewData","inx","haveChild","gridQuery","aggregateQuery","totalRecordsCount","virtualArgs","remoteVirtualAction","notifyArgs","enableInfiniteScrolling","contentModule","currentInfo","prevInfo","loadNext","currentPage","nextInfo","page","sortBy","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","rowDragAndDropModule","dragdIndex","dropdIndex","sortArgs","temp","paging","printMode","actArgs","actualResults","dataResult","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","indentOutdentAction","modifiedRecords","stackedHeader","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","autoFitColumns","fieldNames","resizeModule","updateColumnModel","reorderColumns","fromFName","toFName","localeObject","gridLocale","treeGridLocale","load","printModule","treeGridkeyActionHandler","allowKeyboard","parentTarget","summaryElement","expandAll","collapseAll","expandCollapseRequest","parentElement","findnextRowElement","selectRow","row_1","clearSelection","findPreviousRowElement","rIndex","cIndex","summaryRowElement","previousElementSibling","infiniteScrollData","remoteCollapsedData","remoteExpandedData","columnModel","isExpandAll","isCollapseAll","keyConfigs","ctrlDownArrow","ctrlUpArrow","ctrlShiftUpArrow","ctrlShiftDownArrow","downArrow","upArrow","offline","RemoteSaveAdaptor","wireEvents","EventHandler","mouseClickHandler","keyboardModule","KeyboardEvents","keyAction","eventName","tabIndex","requiredModules","modules","getGridColumns","member","toolbar","contextMenuItems","allowExcelExport","freezePresent","detailTemplate","allowPdfExport","showColumnChooser","extendRequiredModules","IsRowDDInjected","isIndentEnabled","allowAdding","allowDeleting","isCommandColumn","allowSelection","some","commands","commandsTemplate","unwireEvents","remove","loggerModule","render","portals","isVue","createSpinner","dataModule","autoGenerateColumns","convertTreeData","loadGrid","rowDropSettings","targetID","addListener","gridContainer","height","gridRequiredModules","appendTo","refreshToolbarItems","renderComplete","destroyTemplateFn","toolbarElement","toolbarModule","getToolbar","indentID","outdentID","indentElement","outdentElement","afterGridRender","griddata","bindGridProperties","bindedDataSource","enableRtl","columnQueryMode","getActualProperties","pagerTemplate","infiniteScrollSettings","enableVirtualMaskRow","loadingIndicator","enableAltRow","enableHover","enableAutoFill","enableAdaptiveUI","rowHeight","gridLines","getGridToolbar","toolbarTemplate","textWrapSettings","selectedRowIndex","getContextMenu","columnMenuItems","getGridEditSettings","clipMode","triggerEvents","IsExpandCollapseClicked","bindGridEvents","rowSelecting","rowDeselecting","rowSelected","isHeaderCheckboxClicked","selectionModule","selectedRowIndexes","rowDeselected","resizeStop","excelQueryCellInfo","pdfQueryCellInfo","checkBoxChange","pdfExportComplete","excelExportComplete","excelHeaderQueryCellInfo","pdfHeaderQueryCellInfo","dataSourceChanged","recordDoubleClick","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","refresh","selectedItem_1","selectedRecords","dropIndex","dropPosition","selectedRows","isFrozenGrid","movableContent","frozenContent","detailDataBound","contextMenuClick","contextMenuOpen","rowDragStartHelper","rowDragStart","rowDrag","isEdit","rowDrop","registeredTemplate","allowEditOnDblClick","showConfirmDialog","showDeleteConfirmDialog","allowNextRowEdit","dialog","text","getConstant","iconCss","tooltipText","Search","prefixIcon","isEmptyColumnModel","treeGridColumn","gridColumn","gridColumnCollection","_i","_a","enablePersistence","treeColumnTextAlign","textAlign","treeColumnField","onPropertyChanged","newProp","requireRefresh","properties_1","refreshColumns","allowMultiSorting","isDataSourceChanged","eventListener","renderTable","updateTreeColumnTextAlign","closeEdit","getColumnByField","treeGridElement","hasTreeGridChild","removeListener","dataBind","document","getElementById","getPersistData","keyEntity","ignoreOnPersist","ignoreOnColumn","currentObject","val","ignoreInArrays","addOnPersist","ignoreInColumn","touches","isEditCollapse","getPager","addRecord","position","saveCell","updateCell","updateRow","deleteRecord","fieldName","startEdit","editCell","enableToolbarItems","isEnable","enableItems","endEdit","openColumnChooser","x","y","columnChooserModule","deleteRow","setCellValue","primaryKey","visibleRecords","getVisibleRecords","sHeight","scrollHeight","clientHeight","getContent","goToPage","pageNo","pagerModule","updateExternalMessage","iterateArrayOrObject","Columns","getColumnFieldNames","getFooterContent","getFooterContentTable","showColumns","showBy","hideColumns","hideBy","getColumnHeaderByField","getColumnHeaderByIndex","getColumnHeaderByUid","getColumnIndexByField","getVirtualColIndexByUid","isRefresh","gridColumns","mergeColumns","storedColumn","getDataRows","dRows","getHeaderTable","getRowInfo","getUidByColumnField","cols","visible","indexes","refreshUI","refreshHeader","dialogObj","targetElement","rowInfo","collapseRow","expandRow","rowInfo_1","getCollapseExpandRecords","expandingArgs","expandCollapse","expandCollapseAllChildren","collapseArgs","setHeightForFrozenContent","updateExpandStateMapping","freeze","refreshScrollOffset","collapsingArgs","firstElementChild","scrollTop","getRowHeight","scrollBy","state","totalRecords","expandAtLevel","expandAction","getRecordDetails","expandByKey","expandCollapseActionByKey","isPaging","puniqueID_1","collapseAtLevel","collapseAction","collapseByKey","primaryKeyField","startIndex","expandCollapseAll","isExpandCollapseall","updateChildOnDemand","displayAction","detailrows","remoteExpand","localExpand","removeAttribute","flatDataRecords","deff","data_1","length_1","scrollHeightBeforeRefresh","rows_1","args_1","collapseRemoteChild","movableRows","freezeRightRows","rows_2","getMovableRows","getFrozenRightRows","gridRowsObject","currentIndex","visibleRowCount","gridRow","rcell","arg","movablerows","rightrows","collapsingTd","collapse","expandElement","cRow","eRows","i_1","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","reorderRows","fromIndexes","toIndex","outdent","Complex","RowDropSettings","Event","NotifyPropertyChanges","Component","Reorder","GridReorder","getTreeColumn","treeIndex","updatedCols","f","Resize","GridResize","fName","RowDD","canDrop","isDraggedWithChild","hasDropItem","isaddtoBottom","GridDragDrop","getChildrecordsByParentID","Rowdraging","rowDropped","rowsAdded","rowsRemoved","tObj","dropRows","orderToIndex","dropData","totalRecord","parentrow","request","selectedItemIndex","selectedItem","selectedRow","selectedRecord","record_1","eventTrigger","draggedRecord","dragRecords","draggedRecord_1","dragRecords_1","deleteDragRow","refreshGridDataSource","tempDataSource","idx","droppedRecord","proxy","removeFirstrowBorder","canremove","removeLastrowBorder","islastRowIndex","isEmptyRow","updateIcon","rowEle","rowPositionHeight","addErrorElem","rowTop","toolHeight","offsetHeight","positionOffSet","getOffset","contentHeight","top","offsetTop","divide","getBoundingClientRect","topRowSegment","middleRowSegment","bottomRowSegment","mouseEvent","touchEvent","posy","pageY","changedTouches","isTopSegment","isMiddleRowSegment","isBottomRowSegment","removeChildBorder","removetopOrBottomBorder","addFirstrowBorder","removeErrorElem","topOrBottomBorder","addRemoveClasses","addLastRowborder","borderElem","targetRow","node","div","gridheaderEle","toolbarHeight","multiplegrid","offsetWidth","getScrollWidth","trElement","bottomborder","gridcontentEle","bottom","scrollElem","scrollWidth","Scroll","getScrollBarWidth","dragelem","ele","errorVal","content","parentNode","removeChild","spanContent","paddingLeft","dropItemSpan","dropItemLeft","left","spanLeft","errorelem","errorValue","setStyleAttribute","border","box","body","docElem","documentElement","pageYOffset","scrollLeft","pageXOffset","clientTop","clientLeft","round","cloneElement","cursor","rowIdx","ensuredropPosition","dropElement","ej2_instances","dragDropGrid","fromIndex","getTargetIdx","srcControl","targetIndex","isNaN","actualData","srcControlFlatData","actualIndex","isByMethod","draggedRecord_2","isMultipleGrid","dragLength","reverse","correctIndex","offsetParent","newParentIndex","recordIndex1","dropAtTop","getChildCount","droppedRecordIndex","updateChildRecordLevel","updateChildRecord","dropMiddle","nonRepeat_1","childRecordsLength","recordLevel","childItem","deletedRow","removeRecords","flatParentData","childIndex","removeChildItem","idz","parentIndex","deletedRecordCount","updateModifiedRecords","i_2","i_3","draggedRecords","TreeVirtualRowModelGenerator","getDatas","visualData","getDataInfo","getData","generateRows","virtualInfo","info","url","blockIndexes","getBlockIndexes","checkAndResetCache","clear","cache","movableCache","frozenRightCache","groups","getBlockSize","VirtualRowModelGenerator","Filter","GridFilter","isHierarchyFilter","flatFilteredData","filteredParentRecs","updatedFilteredRecord","clearFilterLevel","dataDetails","addParentRecord","ischild","checkChildExsist","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","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","updatePageSize","pageingDetails","updateSize","gridPagerModule","pageSizes","pagerObj","pagerdropdownModule","getLocalizedLabel","propname","skip","size","dm_1","or","parents_1","floor","Toolbar","tool","refreshToolbar","toolbarClickHandler","indentEle","outdentEle","selectedrow","isCheckBoxSelection","Aggregate","GridAggregate","flatChildRecords","isSort","flatRecords","summaryLength","dataLength","getChildRecordsLength","summaryRowIndex","len_1","createSummaryItem","idx_1","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","event","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","newlyAddedRecords","childs","primarykey","parentRowIndex","getRowElementByUID","totalCount","mRows","deleteUniqueID","positionIndex","updatedRecords","primarykey_1","addRecords","endIndex","rowPosition","indexValue","Edit","prevAriaRowIndex","isAddedRowByMethod","isAddedRowByContextMenu","GridEdit","previousNewRowPosition","internalProperties","batchEditModule","crudAction","beginAdd","keyPressed","lastCellTab","contentready","editActionEvents","gridDblClick","customCellSave","savePreviousRowPosition","beforeStartEdit","beforeBatchCancel","resetIsOnBatch","getRowPosition","doubleClickTarget","addArgs","dataRowIndex","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","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","firstAriaIndex","lastAriaIndex","withinRange","isVirtualization","focussedElement","activeElement","newFreezeRowObject","rightFrozenRows","errors","focus","newlyAddedRecord","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","translateY","maxiPage","recordAdded","preTranslate","isRemoteExpand","getModelGenerator","getMovableVirtualRowByIndex","getRowCollection","getFrozenRightVirtualRowByIndex","isMovable","isRowObject","isFrozenRight","startIdx","rowCollection","virtualOtherAction","indexModifier","setTop","nextSetResIndex","lastIndex","root","onDataReady","refreshContentRows","observers","observes","scrollArgs","scrollListeners","onEnteredAction","dataBoundEvent","rowSelectedEvent","toSelectVirtualRow","onActionComplete","virtualEditSuccess","resetIseditValue","cancelEdit","toSelectRowOnContextOpen","refreshCell","cellFocus","getColumnOffset","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","withInRange","restoreEditState","restoreNewRow","isWheel","isIE","setTimeout","showMaskRow","axis","top_1","offsets","xAxis","vgenerator","getColumnIndexes","columnIndexes","cOffsets","maxLeft","upScroll","virtualEle","adjustTable","header","sentinel","outBuffer","offset","downScroll","vHeight","lastInx","remains","rowPt","firsttdinx","isLastBlock","viewInfo","previousInfo","setColumnIndexesInView","loadSelf","addShimmerEffect","removeMaskRow","appendContent","newChild","sentinelInfo","cBlock","cOffset","setWrapperWidth","name","getTable","VirtualContentRenderer","isWheeling","newPos","lastPos","timer","callback","onEnterCallback","instance","virtualScrollHandlers","movableContainer","delay","debounced100","debounce","debounced50","prevTop","prevLeft","scrollbar","delta","clearTimeout","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","VirtualTreeFreezeRenderer","freezeRowGenerator","FreezeRowModelGenerator","virtualRenderer","serviceLoc","getRenderer","virtualHdrRenderer","FreezeContentRender","setPanel","movableCont","getMovableContent","minHeight","overflowX","renderFrozenWrapper","renderFrozenPlaceHolder","renderMovableWrapper","renderMovablePlaceHolder","tbl","movableTable","movableWrapper","movablePlaceholder","wrapper","getFrozenContent","setDebounce","movableEle","VirtualFreezeRenderer","ColumnVirtualTreeFreezeRenderer","ColumnFreezeContentRenderer","frozenRightCont","getFrozenRightContent","frzCont","getFrozenMode","ColumnVirtualFreezeRenderer","VirtualTreeFreezeHdrRenderer","rfshMovable","VirtualFreezeHdrRenderer","Freeze","FreezeColumn","dblClickHandler","instantiateRenderer","FreezeRender","ColumnFreezeHeaderRenderer","frozenRightRows","frozenrows","rData","queryselector","freezeModule","ColumnChooser","GridColumnChooser","X","Y","InfiniteScroll","GridInfiniteScroll","infinitePageAction","infiniteRemoteExpand","infiniteDeleteHandler","infiniteEditHandler","createRows","collapseExpandInfinitechilds","rowRenderer","RowRenderer","childRowObjects","childRowElements","infiniteParents","actions","initialBlocks","maxBlocks","firstIndex","rowElms","keyField","removeRows","mRowElms","tbody","currentRows","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,QAAQE,SAASH,EAAEI,WAAY,KAAKC,aAC3C,OAAO,CAGf,QAAO,EAMX,QAAgBC,GAAuBjB,GACnC,SAAMkB,oBAAkBlB,EAAOmB,KAAKC,eAAeC,MAA2C,KAAnCrB,EAAOmB,KAAKC,eAAeC,KACzC,UAAxCrB,EAAOoB,eAAeE,eAAqE,SAAxCtB,EAAOoB,eAAeE,kBACzEtB,EAAOuB,iBAAkBvB,EAAOmB,KAAKK,eAAeZ,QAAQC,QAChB,UAAxCb,EAAOwB,eAAeF,eAAqE,SAAxCtB,EAAOwB,eAAeF,gBAUtF,QAAgBG,GAAkBC,GAG9B,IAAK,GAFDC,MAEKhB,EAAI,EAAGiB,EADIC,O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