@syncfusion/ej2-treegrid 34.2.8 → 35.1.46

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 (229) hide show
  1. package/README.md +16 -2
  2. package/dist/ej2-treegrid.min.js +2 -2
  3. package/dist/ej2-treegrid.umd.min.js +2 -2
  4. package/dist/ej2-treegrid.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-treegrid.es2015.js +1054 -590
  6. package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
  7. package/dist/es6/ej2-treegrid.es5.js +1159 -618
  8. package/dist/es6/ej2-treegrid.es5.js.map +1 -1
  9. package/dist/global/ej2-treegrid.min.js +2 -2
  10. package/dist/global/ej2-treegrid.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +5 -5
  13. package/src/global.js +1 -1
  14. package/src/treegrid/actions/crud-actions.js +4 -9
  15. package/src/treegrid/actions/dom-virtualization.d.ts +71 -0
  16. package/src/treegrid/actions/dom-virtualization.js +251 -0
  17. package/src/treegrid/actions/edit.d.ts +1 -4
  18. package/src/treegrid/actions/edit.js +23 -191
  19. package/src/treegrid/actions/filter.js +1 -1
  20. package/src/treegrid/actions/index.d.ts +1 -0
  21. package/src/treegrid/actions/index.js +1 -0
  22. package/src/treegrid/actions/page.js +12 -6
  23. package/src/treegrid/actions/rowdragdrop.js +20 -1
  24. package/src/treegrid/actions/selection.d.ts +21 -0
  25. package/src/treegrid/actions/selection.js +198 -32
  26. package/src/treegrid/actions/summary.js +25 -9
  27. package/src/treegrid/actions/toolbar.js +8 -5
  28. package/src/treegrid/base/constant.d.ts +6 -0
  29. package/src/treegrid/base/constant.js +6 -0
  30. package/src/treegrid/base/data.d.ts +17 -0
  31. package/src/treegrid/base/data.js +189 -132
  32. package/src/treegrid/base/treegrid-model.d.ts +35 -4
  33. package/src/treegrid/base/treegrid.d.ts +45 -7
  34. package/src/treegrid/base/treegrid.js +181 -73
  35. package/src/treegrid/enum.d.ts +12 -0
  36. package/src/treegrid/models/column.d.ts +2 -2
  37. package/src/treegrid/models/dom-virtualization-settings-model.d.ts +50 -0
  38. package/src/treegrid/models/dom-virtualization-settings.d.ts +43 -0
  39. package/src/treegrid/models/dom-virtualization-settings.js +47 -0
  40. package/src/treegrid/models/index.d.ts +2 -0
  41. package/src/treegrid/models/index.js +1 -0
  42. package/src/treegrid/models/summary-model.d.ts +1 -1
  43. package/src/treegrid/models/summary.d.ts +1 -1
  44. package/src/treegrid/renderer/dom-virtual-tree-content-renderer.d.ts +20 -0
  45. package/src/treegrid/renderer/dom-virtual-tree-content-renderer.js +49 -0
  46. package/src/treegrid/renderer/index.d.ts +1 -0
  47. package/src/treegrid/renderer/index.js +1 -0
  48. package/src/treegrid/renderer/render.js +4 -3
  49. package/src/treegrid/renderer/virtual-tree-content-render.js +1 -2
  50. package/helpers/e2e/index.d.ts +0 -1
  51. package/helpers/e2e/index.js +0 -8
  52. package/helpers/e2e/treegridhelper.d.ts +0 -21
  53. package/helpers/e2e/treegridhelper.js +0 -83
  54. package/styles/bds-lite.css +0 -402
  55. package/styles/bds-lite.scss +0 -3
  56. package/styles/bds.css +0 -422
  57. package/styles/bds.scss +0 -4
  58. package/styles/bootstrap-dark-lite.css +0 -406
  59. package/styles/bootstrap-dark-lite.scss +0 -3
  60. package/styles/bootstrap-dark.css +0 -426
  61. package/styles/bootstrap-dark.scss +0 -4
  62. package/styles/bootstrap-lite.css +0 -409
  63. package/styles/bootstrap-lite.scss +0 -3
  64. package/styles/bootstrap.css +0 -432
  65. package/styles/bootstrap.scss +0 -4
  66. package/styles/bootstrap4-lite.css +0 -406
  67. package/styles/bootstrap4-lite.scss +0 -3
  68. package/styles/bootstrap4.css +0 -426
  69. package/styles/bootstrap4.scss +0 -4
  70. package/styles/bootstrap5-dark-lite.css +0 -406
  71. package/styles/bootstrap5-dark-lite.scss +0 -3
  72. package/styles/bootstrap5-dark.css +0 -426
  73. package/styles/bootstrap5-dark.scss +0 -4
  74. package/styles/bootstrap5-lite.css +0 -406
  75. package/styles/bootstrap5-lite.scss +0 -3
  76. package/styles/bootstrap5.3-lite.css +0 -490
  77. package/styles/bootstrap5.3-lite.scss +0 -3
  78. package/styles/bootstrap5.3.css +0 -510
  79. package/styles/bootstrap5.3.scss +0 -4
  80. package/styles/bootstrap5.css +0 -426
  81. package/styles/bootstrap5.scss +0 -4
  82. package/styles/fabric-dark-lite.css +0 -409
  83. package/styles/fabric-dark-lite.scss +0 -3
  84. package/styles/fabric-dark.css +0 -432
  85. package/styles/fabric-dark.scss +0 -4
  86. package/styles/fabric-lite.css +0 -409
  87. package/styles/fabric-lite.scss +0 -3
  88. package/styles/fabric.css +0 -432
  89. package/styles/fabric.scss +0 -4
  90. package/styles/fluent-dark-lite.css +0 -417
  91. package/styles/fluent-dark-lite.scss +0 -3
  92. package/styles/fluent-dark.css +0 -444
  93. package/styles/fluent-dark.scss +0 -4
  94. package/styles/fluent-lite.css +0 -417
  95. package/styles/fluent-lite.scss +0 -3
  96. package/styles/fluent.css +0 -444
  97. package/styles/fluent.scss +0 -4
  98. package/styles/fluent2-lite.css +0 -507
  99. package/styles/fluent2-lite.scss +0 -3
  100. package/styles/fluent2.css +0 -531
  101. package/styles/fluent2.scss +0 -4
  102. package/styles/highcontrast-light-lite.css +0 -406
  103. package/styles/highcontrast-light-lite.scss +0 -3
  104. package/styles/highcontrast-light.css +0 -426
  105. package/styles/highcontrast-light.scss +0 -4
  106. package/styles/highcontrast-lite.css +0 -413
  107. package/styles/highcontrast-lite.scss +0 -3
  108. package/styles/highcontrast.css +0 -439
  109. package/styles/highcontrast.scss +0 -4
  110. package/styles/material-dark-lite.css +0 -406
  111. package/styles/material-dark-lite.scss +0 -3
  112. package/styles/material-dark.css +0 -426
  113. package/styles/material-dark.scss +0 -4
  114. package/styles/material-lite.css +0 -406
  115. package/styles/material-lite.scss +0 -3
  116. package/styles/material.css +0 -426
  117. package/styles/material.scss +0 -4
  118. package/styles/material3-dark-lite.css +0 -488
  119. package/styles/material3-dark-lite.scss +0 -3
  120. package/styles/material3-dark.css +0 -508
  121. package/styles/material3-dark.scss +0 -4
  122. package/styles/material3-lite.css +0 -490
  123. package/styles/material3-lite.scss +0 -3
  124. package/styles/material3.css +0 -510
  125. package/styles/material3.scss +0 -4
  126. package/styles/tailwind-dark-lite.css +0 -406
  127. package/styles/tailwind-dark-lite.scss +0 -3
  128. package/styles/tailwind-dark.css +0 -426
  129. package/styles/tailwind-dark.scss +0 -4
  130. package/styles/tailwind-lite.css +0 -406
  131. package/styles/tailwind-lite.scss +0 -3
  132. package/styles/tailwind.css +0 -426
  133. package/styles/tailwind.scss +0 -4
  134. package/styles/tailwind3-lite.css +0 -480
  135. package/styles/tailwind3-lite.scss +0 -3
  136. package/styles/tailwind3.css +0 -500
  137. package/styles/tailwind3.scss +0 -4
  138. package/styles/treegrid/_all.scss +0 -2
  139. package/styles/treegrid/_bds-definition.scss +0 -28
  140. package/styles/treegrid/_bigger.scss +0 -70
  141. package/styles/treegrid/_bootstrap-dark-definition.scss +0 -33
  142. package/styles/treegrid/_bootstrap-definition.scss +0 -33
  143. package/styles/treegrid/_bootstrap4-definition.scss +0 -33
  144. package/styles/treegrid/_bootstrap5-dark-definition.scss +0 -28
  145. package/styles/treegrid/_bootstrap5-definition.scss +0 -28
  146. package/styles/treegrid/_bootstrap5.3-definition.scss +0 -28
  147. package/styles/treegrid/_fabric-dark-definition.scss +0 -33
  148. package/styles/treegrid/_fabric-definition.scss +0 -33
  149. package/styles/treegrid/_fluent-dark-definition.scss +0 -29
  150. package/styles/treegrid/_fluent-definition.scss +0 -29
  151. package/styles/treegrid/_fluent2-definition.scss +0 -28
  152. package/styles/treegrid/_fusionnew-definition.scss +0 -26
  153. package/styles/treegrid/_highcontrast-definition.scss +0 -33
  154. package/styles/treegrid/_highcontrast-light-definition.scss +0 -33
  155. package/styles/treegrid/_icons.scss +0 -47
  156. package/styles/treegrid/_layout.scss +0 -531
  157. package/styles/treegrid/_material-dark-definition.scss +0 -33
  158. package/styles/treegrid/_material-definition.scss +0 -33
  159. package/styles/treegrid/_material3-dark-definition.scss +0 -28
  160. package/styles/treegrid/_material3-definition.scss +0 -28
  161. package/styles/treegrid/_tailwind-dark-definition.scss +0 -28
  162. package/styles/treegrid/_tailwind-definition.scss +0 -28
  163. package/styles/treegrid/_tailwind3-definition.scss +0 -28
  164. package/styles/treegrid/_theme.scss +0 -1
  165. package/styles/treegrid/_variables.scss +0 -2
  166. package/styles/treegrid/bds.css +0 -422
  167. package/styles/treegrid/bds.scss +0 -4
  168. package/styles/treegrid/bootstrap-dark.css +0 -426
  169. package/styles/treegrid/bootstrap-dark.scss +0 -4
  170. package/styles/treegrid/bootstrap.css +0 -432
  171. package/styles/treegrid/bootstrap.scss +0 -4
  172. package/styles/treegrid/bootstrap4.css +0 -426
  173. package/styles/treegrid/bootstrap4.scss +0 -4
  174. package/styles/treegrid/bootstrap5-dark.css +0 -426
  175. package/styles/treegrid/bootstrap5-dark.scss +0 -4
  176. package/styles/treegrid/bootstrap5.3.css +0 -510
  177. package/styles/treegrid/bootstrap5.3.scss +0 -4
  178. package/styles/treegrid/bootstrap5.css +0 -426
  179. package/styles/treegrid/bootstrap5.scss +0 -4
  180. package/styles/treegrid/fabric-dark.css +0 -432
  181. package/styles/treegrid/fabric-dark.scss +0 -4
  182. package/styles/treegrid/fabric.css +0 -432
  183. package/styles/treegrid/fabric.scss +0 -4
  184. package/styles/treegrid/fluent-dark.css +0 -444
  185. package/styles/treegrid/fluent-dark.scss +0 -4
  186. package/styles/treegrid/fluent.css +0 -444
  187. package/styles/treegrid/fluent.scss +0 -4
  188. package/styles/treegrid/fluent2.css +0 -531
  189. package/styles/treegrid/fluent2.scss +0 -4
  190. package/styles/treegrid/highcontrast-light.css +0 -426
  191. package/styles/treegrid/highcontrast-light.scss +0 -4
  192. package/styles/treegrid/highcontrast.css +0 -439
  193. package/styles/treegrid/highcontrast.scss +0 -4
  194. package/styles/treegrid/icons/_bds.scss +0 -38
  195. package/styles/treegrid/icons/_bootstrap-dark.scss +0 -48
  196. package/styles/treegrid/icons/_bootstrap.scss +0 -48
  197. package/styles/treegrid/icons/_bootstrap4.scss +0 -48
  198. package/styles/treegrid/icons/_bootstrap5-dark.scss +0 -1
  199. package/styles/treegrid/icons/_bootstrap5.3.scss +0 -48
  200. package/styles/treegrid/icons/_bootstrap5.scss +0 -48
  201. package/styles/treegrid/icons/_fabric-dark.scss +0 -48
  202. package/styles/treegrid/icons/_fabric.scss +0 -48
  203. package/styles/treegrid/icons/_fluent-dark.scss +0 -1
  204. package/styles/treegrid/icons/_fluent.scss +0 -48
  205. package/styles/treegrid/icons/_fluent2.scss +0 -48
  206. package/styles/treegrid/icons/_fusionnew.scss +0 -31
  207. package/styles/treegrid/icons/_highcontrast-light.scss +0 -48
  208. package/styles/treegrid/icons/_highcontrast.scss +0 -48
  209. package/styles/treegrid/icons/_material-dark.scss +0 -48
  210. package/styles/treegrid/icons/_material.scss +0 -48
  211. package/styles/treegrid/icons/_material3-dark.scss +0 -1
  212. package/styles/treegrid/icons/_material3.scss +0 -48
  213. package/styles/treegrid/icons/_tailwind-dark.scss +0 -48
  214. package/styles/treegrid/icons/_tailwind.scss +0 -48
  215. package/styles/treegrid/icons/_tailwind3.scss +0 -48
  216. package/styles/treegrid/material-dark.css +0 -426
  217. package/styles/treegrid/material-dark.scss +0 -4
  218. package/styles/treegrid/material.css +0 -426
  219. package/styles/treegrid/material.scss +0 -4
  220. package/styles/treegrid/material3-dark.css +0 -508
  221. package/styles/treegrid/material3-dark.scss +0 -4
  222. package/styles/treegrid/material3.css +0 -510
  223. package/styles/treegrid/material3.scss +0 -4
  224. package/styles/treegrid/tailwind-dark.css +0 -426
  225. package/styles/treegrid/tailwind-dark.scss +0 -4
  226. package/styles/treegrid/tailwind.css +0 -426
  227. package/styles/treegrid/tailwind.scss +0 -4
  228. package/styles/treegrid/tailwind3.css +0 -500
  229. package/styles/treegrid/tailwind3.scss +0 -4
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 34.2.8
3
+ * version : 35.1.46
4
4
  * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncfusion/ej2-treegrid",
3
- "version": "34.2.8",
3
+ "version": "35.1.46",
4
4
  "description": "Essential JS 2 TreeGrid Component",
5
5
  "author": "Syncfusion Inc.",
6
6
  "license": "SEE LICENSE IN license",
@@ -8,10 +8,10 @@
8
8
  "module": "./index.js",
9
9
  "es2015": "./dist/es6/ej2-treegrid.es5.js",
10
10
  "dependencies": {
11
- "@syncfusion/ej2-base": "~34.2.8",
12
- "@syncfusion/ej2-data": "~34.2.8",
13
- "@syncfusion/ej2-grids": "~34.2.8",
14
- "@syncfusion/ej2-popups": "~34.2.8"
11
+ "@syncfusion/ej2-base": "~35.1.37",
12
+ "@syncfusion/ej2-data": "~35.1.37",
13
+ "@syncfusion/ej2-grids": "~35.1.42",
14
+ "@syncfusion/ej2-popups": "~35.1.42"
15
15
  },
16
16
  "devDependencies": {},
17
17
  "keywords": [
package/src/global.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import * as index from './index';
2
- index.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);
2
+ index.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, index.DomVirtualization);
3
3
  export * from './index';
@@ -86,9 +86,9 @@ export function editAction(details, control, isSelfReference, addRowIndex, selec
86
86
  else {
87
87
  if (action === 'edit') {
88
88
  for (j = 0; j < keys.length; j++) {
89
- if (Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) && ((control.editSettings.mode !== 'Cell'
90
- || (!isNullOrUndefined(batchChanges) && batchChanges["" + changedRecords].length === 0))
91
- || keys[parseInt(j.toString(), 10)] === columnName)) {
89
+ if (Object.prototype.hasOwnProperty.call(treeData[parseInt(i.toString(), 10)], keys[parseInt(j.toString(), 10)]) &&
90
+ ((!isNullOrUndefined(control.editSettings.mode) || (!isNullOrUndefined(batchChanges) && batchChanges["" + changedRecords].length === 0))
91
+ || keys[parseInt(j.toString(), 10)] === columnName)) {
92
92
  var editedData = getParentData(control, modifiedData[parseInt(k.toString(), 10)].uniqueID);
93
93
  treeData[parseInt(i.toString(), 10)][keys[parseInt(j.toString(), 10)]] =
94
94
  modifiedData[parseInt(k.toString(), 10)][keys[parseInt(j.toString(), 10)]];
@@ -241,16 +241,11 @@ export function removeChildRecords(childRecords, modifiedData, action, key, cont
241
241
  var editedData = getParentData(control, modifiedData.uniqueID);
242
242
  for (var i = 0; i < keys.length; i++) {
243
243
  if (Object.prototype.hasOwnProperty.call(childRecords[parseInt(j.toString(), 10)], keys[parseInt(i.toString(), 10)]) &&
244
- (control.editSettings.mode !== 'Cell' || keys[parseInt(i.toString(), 10)] === columnName)) {
244
+ (!isNullOrUndefined(control.editSettings.mode) || keys[parseInt(i.toString(), 10)] === columnName)) {
245
245
  editedData[keys[parseInt(i.toString(), 10)]] =
246
246
  editedData.taskData[keys[parseInt(i.toString(), 10)]] =
247
247
  childRecords[parseInt(j.toString(), 10)][keys[parseInt(i.toString(), 10)]] =
248
248
  modifiedData[keys[parseInt(i.toString(), 10)]];
249
- if (control.grid.editSettings.mode === 'Normal' && control.editSettings.mode === 'Cell' && !isNullOrUndefined(control.grid.editModule)) {
250
- var editModule = 'editModule';
251
- control.grid.editModule["" + editModule].editRowIndex = modifiedData.index;
252
- control.grid.editModule["" + editModule].updateCurrentViewData(modifiedData);
253
- }
254
249
  }
255
250
  }
256
251
  break;
@@ -0,0 +1,71 @@
1
+ import { TreeGrid } from '../base/treegrid';
2
+ import { IGrid, ServiceLocator } from '@syncfusion/ej2-grids';
3
+ import { DomVirtualization as GridDomVirtualization } from '@syncfusion/ej2-grids';
4
+ /**
5
+ * TreeGrid DOM Virtualization module handles high-performance rendering of large hierarchical datasets.
6
+ *
7
+ * @hidden
8
+ */
9
+ export declare class DomVirtualization {
10
+ private parent;
11
+ private locator;
12
+ private visualData;
13
+ /** @hidden */
14
+ startIndex: number;
15
+ /** @hidden */
16
+ endIndex: number;
17
+ /**
18
+ * Constructor for DomVirtualization module
19
+ *
20
+ * @param {TreeGrid} parent - TreeGrid instance
21
+ * @param {ServiceLocator} locator - Service locator for dependency injection
22
+ */
23
+ constructor(parent: TreeGrid, locator?: ServiceLocator);
24
+ getModuleName(): string;
25
+ /**
26
+ * @hidden
27
+ * @returns {void}
28
+ */
29
+ addEventListener(): void;
30
+ /**
31
+ * @hidden
32
+ * @returns {void}
33
+ */
34
+ removeEventListener(): void;
35
+ /**
36
+ * Handles the action related to virtual scrolling with paging details.
37
+ *
38
+ * @param {Object} pageingDetails - Contains the result data, count of results, and action arguments.
39
+ * @param {ITreeData[]} pageingDetails.result - The result data to be handled.
40
+ * @param {number} pageingDetails.count - The count of results.
41
+ * @param {ActionEventArgs} pageingDetails.actionArgs - The action arguments related to the virtual page action.
42
+ * @returns {void}
43
+ */
44
+ private virtualPageAction;
45
+ private calculateChildCount;
46
+ /**
47
+ * Handles the virtual child collapse or expand action in a tree grid.
48
+ *
49
+ * @param {object} row - Object containing information about the collapse/expand action.
50
+ * @param {string} row.action - The type of action, either "collapse" or "expand".
51
+ * @param {HTMLTableRowElement} row.row - The HTML row element that is affected by the action.
52
+ * @param {ITreeData} row.record - The tree data record associated with the row.
53
+ * @param {RowCollapsedEventArgs} row.args - Additional event arguments related to the row collapse or expand.
54
+ *
55
+ * @returns {void} No return value as the function executes a procedure.
56
+ */
57
+ private collapseExpandVirtualchilds;
58
+ private updateCurrentDomVirtualRecords;
59
+ destroy(): void;
60
+ }
61
+ export declare class DomVirtualTreeExtension extends GridDomVirtualization {
62
+ /**
63
+ * Constructor for DomVirtualTreeExtension
64
+ *
65
+ * @param {IGrid} parent - Grid instance (actually TreeGrid)
66
+ * @param {ServiceLocator} locator - Service locator for dependency injection
67
+ */
68
+ constructor(parent: IGrid, locator?: ServiceLocator);
69
+ getModuleName(): string;
70
+ protected instantiateRenderers(): void;
71
+ }
@@ -0,0 +1,251 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ extendStatics(d, b);
10
+ function __() { this.constructor = d; }
11
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
+ };
13
+ })();
14
+ import { RenderType, Grid } from '@syncfusion/ej2-grids';
15
+ import { DomVirtualization as GridDomVirtualization } from '@syncfusion/ej2-grids';
16
+ import { initialLoad, destroy } from '@syncfusion/ej2-grids';
17
+ import { DomVirtualTreeContentRenderer } from '../renderer/dom-virtual-tree-content-renderer';
18
+ import { getValue, initializeTelemetryFeature, isNullOrUndefined } from '@syncfusion/ej2-base';
19
+ import * as events from '../base/constant';
20
+ import { DataManager, Query } from '@syncfusion/ej2-data';
21
+ import { getExpandStatus, isOffline, isRemoteData } from '../utils';
22
+ /**
23
+ * TreeGrid DOM Virtualization module handles high-performance rendering of large hierarchical datasets.
24
+ *
25
+ * @hidden
26
+ */
27
+ var DomVirtualization = /** @class */ (function () {
28
+ /**
29
+ * Constructor for DomVirtualization module
30
+ *
31
+ * @param {TreeGrid} parent - TreeGrid instance
32
+ * @param {ServiceLocator} locator - Service locator for dependency injection
33
+ */
34
+ function DomVirtualization(parent, locator) {
35
+ /** @hidden */
36
+ this.startIndex = -1;
37
+ /** @hidden */
38
+ this.endIndex = -1;
39
+ initializeTelemetryFeature('DomVirtualization', 'TreeGrid');
40
+ this.parent = parent;
41
+ this.locator = locator;
42
+ Grid.Inject(DomVirtualTreeExtension);
43
+ this.addEventListener();
44
+ }
45
+ DomVirtualization.prototype.getModuleName = function () {
46
+ return 'domVirtualization';
47
+ };
48
+ /**
49
+ * @hidden
50
+ * @returns {void}
51
+ */
52
+ DomVirtualization.prototype.addEventListener = function () {
53
+ if (this.parent.isDestroyed) {
54
+ return;
55
+ }
56
+ this.parent.on(destroy, this.destroy, this);
57
+ this.parent.on(events.virtualExpandCollapse, this.collapseExpandVirtualchilds, this);
58
+ this.parent.on(events.pagingActions, this.virtualPageAction, this);
59
+ this.parent.grid.on(events.beforeDomVirtualRenderRows, this.updateCurrentDomVirtualRecords, this);
60
+ };
61
+ /**
62
+ * @hidden
63
+ * @returns {void}
64
+ */
65
+ DomVirtualization.prototype.removeEventListener = function () {
66
+ if (this.parent.isDestroyed) {
67
+ return;
68
+ }
69
+ this.parent.off(destroy, this.destroy);
70
+ this.parent.off(events.virtualExpandCollapse, this.collapseExpandVirtualchilds);
71
+ this.parent.off(events.pagingActions, this.virtualPageAction);
72
+ this.parent.grid.off(events.beforeDomVirtualRenderRows, this.updateCurrentDomVirtualRecords);
73
+ };
74
+ /**
75
+ * Handles the action related to virtual scrolling with paging details.
76
+ *
77
+ * @param {Object} pageingDetails - Contains the result data, count of results, and action arguments.
78
+ * @param {ITreeData[]} pageingDetails.result - The result data to be handled.
79
+ * @param {number} pageingDetails.count - The count of results.
80
+ * @param {ActionEventArgs} pageingDetails.actionArgs - The action arguments related to the virtual page action.
81
+ * @returns {void}
82
+ */
83
+ DomVirtualization.prototype.virtualPageAction = function (pageingDetails) {
84
+ var _this = this;
85
+ var actionArgs = getValue('actionArgs', pageingDetails.actionArgs);
86
+ var action = getValue('action', pageingDetails.actionArgs);
87
+ var isFiltering = (pageingDetails.actionArgs.requestType === 'filtering' && (pageingDetails.actionArgs.action !== 'clear-filter' && pageingDetails.actionArgs.action !== 'clearFilter')) ||
88
+ (!isNullOrUndefined(this.parent['filterModule']) && (this.parent['filterModule'].filteredResult && this.parent['filterModule'].filteredResult.length > 0));
89
+ var isFlatHierarchy = this.parent.filterSettings.hierarchyMode === 'Child' ||
90
+ this.parent.filterSettings.hierarchyMode === 'None';
91
+ var parents = pageingDetails.result;
92
+ parents = isFiltering && isFlatHierarchy ? parents.filter(function (e) {
93
+ if (isNullOrUndefined(e.parentItem)) {
94
+ return true;
95
+ }
96
+ var hasParentInFilteredList = parents.some(function (p) { return p.uniqueID === e.parentItem.uniqueID; });
97
+ return hasParentInFilteredList ? getExpandStatus(_this.parent, e, parents) : true;
98
+ }) : parents.filter(function (e) { return getExpandStatus(_this.parent, e, parents); });
99
+ this.parent.virtualDomScrollData = parents;
100
+ var dm = new DataManager(parents);
101
+ this.visualData = parents;
102
+ var query = new Query();
103
+ if (this.parent.allowPaging || this.parent.enableVirtualization) {
104
+ var take = isNullOrUndefined(actionArgs.requestType) || actionArgs.requestType === 'dom-virtualscroll' ?
105
+ pageingDetails.actionArgs.result.length : pageingDetails.result.length;
106
+ if (action === 'collapse') {
107
+ take = this.parent.grid.currentViewData.length;
108
+ }
109
+ var skip = this.parent.grid.pageSettings.currentPage <= 1 ? 0 :
110
+ (this.parent.grid.pageSettings.currentPage - 1) * this.parent.grid.pageSettings.pageSize;
111
+ if (actionArgs.requestType === 'dom-virtualscroll') {
112
+ var pagingQueries = (pageingDetails.actionArgs && pageingDetails.actionArgs.query
113
+ && pageingDetails.actionArgs.query.queries) || [];
114
+ var takeQuery = pagingQueries.filter(function (q) { return q.fn === 'onTake'; });
115
+ var explicitTake = takeQuery.length > 0
116
+ ? takeQuery[parseInt((takeQuery.length - 1).toString(), 10)] : undefined;
117
+ if (!isNullOrUndefined(explicitTake) && typeof explicitTake.e.nos === 'number') {
118
+ take = explicitTake.e.nos;
119
+ }
120
+ }
121
+ else if ((actionArgs.requestType === 'filtering' || actionArgs.requestType === 'searching') && skip > 0) {
122
+ skip = 0;
123
+ this.parent.grid.setProperties({ pageSettings: { currentPage: 1 } }, true);
124
+ }
125
+ query = query.skip(skip).take(take);
126
+ }
127
+ dm.dataSource.json = this.visualData;
128
+ pageingDetails.result = dm.executeLocal(query);
129
+ pageingDetails.count = this.visualData.length;
130
+ this.parent.notify('updateAction', pageingDetails);
131
+ };
132
+ DomVirtualization.prototype.calculateChildCount = function (startIndex, level, records) {
133
+ var count = 0;
134
+ for (var i = startIndex; i < records.length; i++) {
135
+ if (records[i + 1] && (level === records[i + 1].level || level === records[i + 1].level + 1)) {
136
+ break;
137
+ }
138
+ count++;
139
+ }
140
+ return count;
141
+ };
142
+ /**
143
+ * Handles the virtual child collapse or expand action in a tree grid.
144
+ *
145
+ * @param {object} row - Object containing information about the collapse/expand action.
146
+ * @param {string} row.action - The type of action, either "collapse" or "expand".
147
+ * @param {HTMLTableRowElement} row.row - The HTML row element that is affected by the action.
148
+ * @param {ITreeData} row.record - The tree data record associated with the row.
149
+ * @param {RowCollapsedEventArgs} row.args - Additional event arguments related to the row collapse or expand.
150
+ *
151
+ * @returns {void} No return value as the function executes a procedure.
152
+ */
153
+ DomVirtualization.prototype.collapseExpandVirtualchilds = function (row) {
154
+ var contentModule = this.parent.grid.contentModule;
155
+ var isRemote = isRemoteData(this.parent) && !isOffline(this.parent);
156
+ var flatData = isRemote ? this.parent.getCurrentViewRecords() : this.parent.enableVirtualization ?
157
+ this.parent.virtualDomScrollData.slice() : this.parent.grid.currentViewData.slice();
158
+ var totalflatData = this.parent.infiniteScrollData;
159
+ var uniqueIDCollpaseCollection = this.parent.uniqueIDCollpaseCollection;
160
+ var startIndex = contentModule.currentStartIndex;
161
+ if (getValue('isCollapseAll', this.parent) || getValue('isExpandAll', this.parent)) {
162
+ if (row.action === 'collapse') {
163
+ flatData.filter(function (e) {
164
+ if (e.hasChildRecords) {
165
+ e.expanded = row.action === 'collapse' ? false : true;
166
+ }
167
+ });
168
+ flatData.splice.apply(flatData, [0, flatData.length].concat(this.parent.parentData));
169
+ // this.parent.pageSettings.totalRecordsCount = this.parent.parentData.length;
170
+ }
171
+ else {
172
+ totalflatData.filter(function (e) {
173
+ if (e.hasChildRecords) {
174
+ e.expanded = row.action === 'collapse' ? false : true;
175
+ }
176
+ });
177
+ flatData.splice.apply(flatData, [0, flatData.length].concat(totalflatData));
178
+ // this.parent.pageSettings.totalRecordsCount = totalflatData.length;
179
+ }
180
+ }
181
+ else {
182
+ row.record.expanded = row.action === 'collapse' ? false : true;
183
+ for (var i = startIndex; i < flatData.length; i++) {
184
+ if (row.record.uniqueID === flatData[parseInt(i.toString(), 10)].uniqueID &&
185
+ row.record.childRecords.length > 0) {
186
+ if (row.action === 'collapse') {
187
+ var level = flatData[parseInt(i.toString(), 10)].level;
188
+ var count = this.calculateChildCount(i, level, flatData);
189
+ // this.parent.pageSettings.totalRecordsCount -= count;
190
+ uniqueIDCollpaseCollection[row.record.uniqueID] = flatData.splice(i + 1, count);
191
+ }
192
+ else {
193
+ if (uniqueIDCollpaseCollection[row.record.uniqueID] && uniqueIDCollpaseCollection[row.record.uniqueID].length) {
194
+ flatData.splice.apply(flatData, [i + 1, 0].concat(uniqueIDCollpaseCollection[row.record.uniqueID]));
195
+ // this.parent.pageSettings.totalRecordsCount += uniqueIDCollpaseCollection[row.record.uniqueID].length;
196
+ }
197
+ else {
198
+ uniqueIDCollpaseCollection[row.record.uniqueID] = row.record.childRecords;
199
+ flatData.splice.apply(flatData, [i + 1, 0].concat(uniqueIDCollpaseCollection[row.record.uniqueID]));
200
+ // this.parent.pageSettings.totalRecordsCount += uniqueIDCollpaseCollection[row.record.uniqueID].length;
201
+ }
202
+ }
203
+ break;
204
+ }
205
+ }
206
+ }
207
+ var actionDetails = {
208
+ result: flatData,
209
+ row: row.row,
210
+ action: row.action,
211
+ record: row.record,
212
+ count: flatData.length
213
+ };
214
+ getValue('grid.renderModule', this.parent).dataManagerSuccess(actionDetails, { requestType: 'refresh' });
215
+ };
216
+ DomVirtualization.prototype.updateCurrentDomVirtualRecords = function (args) {
217
+ this.startIndex = args.startIndex;
218
+ this.endIndex = args.endIndex;
219
+ this.parent.currentDomVirtualRecords = this.parent.virtualDomScrollData.slice(this.startIndex, this.endIndex);
220
+ };
221
+ DomVirtualization.prototype.destroy = function () {
222
+ this.removeEventListener();
223
+ };
224
+ return DomVirtualization;
225
+ }());
226
+ export { DomVirtualization };
227
+ var DomVirtualTreeExtension = /** @class */ (function (_super) {
228
+ __extends(DomVirtualTreeExtension, _super);
229
+ /**
230
+ * Constructor for DomVirtualTreeExtension
231
+ *
232
+ * @param {IGrid} parent - Grid instance (actually TreeGrid)
233
+ * @param {ServiceLocator} locator - Service locator for dependency injection
234
+ */
235
+ function DomVirtualTreeExtension(parent, locator) {
236
+ var _this = _super.call(this, parent, locator) || this;
237
+ getValue('parent', _this).off(initialLoad, getValue('instantiateRenderer', _this), _this);
238
+ getValue('parent', _this).on(initialLoad, _this.instantiateRenderers, _this);
239
+ return _this;
240
+ }
241
+ DomVirtualTreeExtension.prototype.getModuleName = function () {
242
+ return 'treeDomVirtualization';
243
+ };
244
+ DomVirtualTreeExtension.prototype.instantiateRenderers = function () {
245
+ var rendererFactory = getValue('locator', this).getService('rendererFactory');
246
+ getValue('addRenderer', rendererFactory)
247
+ .apply(rendererFactory, [RenderType.Content, new DomVirtualTreeContentRenderer(getValue('parent', this), getValue('locator', this))]);
248
+ };
249
+ return DomVirtualTreeExtension;
250
+ }(GridDomVirtualization));
251
+ export { DomVirtualTreeExtension };
@@ -49,8 +49,8 @@ export declare class Edit {
49
49
  addEventListener(): void;
50
50
  private gridDblClick;
51
51
  private getRowPosition;
52
+ private resetDoubleClickTarget;
52
53
  private beforeStartEdit;
53
- private beforeBatchCancel;
54
54
  /**
55
55
  * @hidden
56
56
  * @returns {void}
@@ -73,8 +73,6 @@ export declare class Edit {
73
73
  private infiniteAddAction;
74
74
  private updateInfiniteCurrentViewData;
75
75
  private recordDoubleClick;
76
- private updateGridEditMode;
77
- private resetIsOnBatch;
78
76
  private keyPressed;
79
77
  private deleteUniqueID;
80
78
  private cellEdit;
@@ -82,7 +80,6 @@ export declare class Edit {
82
80
  private batchCancel;
83
81
  private customCellSave;
84
82
  private cellSave;
85
- private afterCellSave;
86
83
  private lastCellTab;
87
84
  private updateCell;
88
85
  private crudAction;