@visactor/vtable 0.23.0-alpha.0 → 0.23.0

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 (203) hide show
  1. package/cjs/ListTable.d.ts +3 -3
  2. package/cjs/ListTable.js +45 -34
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotTable.d.ts +1 -1
  5. package/cjs/PivotTable.js +19 -17
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/body-helper/style/Style.d.ts +3 -0
  8. package/cjs/body-helper/style/Style.js +22 -15
  9. package/cjs/body-helper/style/Style.js.map +1 -1
  10. package/cjs/components/legend/continue-legend/continue-legend.js +1 -1
  11. package/cjs/components/legend/continue-legend/continue-legend.js.map +1 -1
  12. package/cjs/components/legend/discrete-legend/discrete-legend.js +1 -1
  13. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  14. package/cjs/core/BaseTable.d.ts +3 -1
  15. package/cjs/core/BaseTable.js +27 -17
  16. package/cjs/core/BaseTable.js.map +1 -1
  17. package/cjs/core/TABLE_EVENT_TYPE.d.ts +2 -0
  18. package/cjs/core/TABLE_EVENT_TYPE.js +2 -0
  19. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  20. package/cjs/core/tableHelper.js +1 -2
  21. package/cjs/core/tableHelper.js.map +1 -1
  22. package/cjs/data/CachedDataSource.d.ts +1 -0
  23. package/cjs/data/CachedDataSource.js +10 -6
  24. package/cjs/data/CachedDataSource.js.map +1 -1
  25. package/cjs/data/DataSource.d.ts +10 -3
  26. package/cjs/data/DataSource.js +159 -95
  27. package/cjs/data/DataSource.js.map +1 -1
  28. package/cjs/edit/edit-manager.js +10 -9
  29. package/cjs/edit/edit-manager.js.map +1 -1
  30. package/cjs/event/event.js +11 -5
  31. package/cjs/event/event.js.map +1 -1
  32. package/cjs/event/listener/table-group.js +2 -2
  33. package/cjs/event/listener/table-group.js.map +1 -1
  34. package/cjs/event/media-click.js +2 -1
  35. package/cjs/event/sparkline-event.js +1 -2
  36. package/cjs/header-helper/style/Style.d.ts +3 -0
  37. package/cjs/header-helper/style/Style.js +26 -19
  38. package/cjs/header-helper/style/Style.js.map +1 -1
  39. package/cjs/index.d.ts +1 -1
  40. package/cjs/index.js +1 -1
  41. package/cjs/index.js.map +1 -1
  42. package/cjs/layout/pivot-header-layout.js +4 -2
  43. package/cjs/layout/pivot-header-layout.js.map +1 -1
  44. package/cjs/layout/simple-header-layout.d.ts +3 -2
  45. package/cjs/layout/simple-header-layout.js +40 -25
  46. package/cjs/layout/simple-header-layout.js.map +1 -1
  47. package/cjs/scenegraph/component/table-component.js +13 -8
  48. package/cjs/scenegraph/component/table-component.js.map +1 -1
  49. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js +10 -6
  50. package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  51. package/cjs/scenegraph/group-creater/cell-helper.js +3 -1
  52. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  53. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +3 -2
  54. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +20 -6
  55. package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  56. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
  57. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  58. package/cjs/scenegraph/layout/compute-col-width.js +12 -8
  59. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  60. package/cjs/scenegraph/layout/compute-row-height.js +72 -71
  61. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  62. package/cjs/scenegraph/layout/frozen.js +2 -2
  63. package/cjs/scenegraph/layout/frozen.js.map +1 -1
  64. package/cjs/scenegraph/layout/update-height.js +18 -11
  65. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  66. package/cjs/scenegraph/layout/update-width.js +19 -13
  67. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  68. package/cjs/scenegraph/scenegraph.js +3 -3
  69. package/cjs/scenegraph/scenegraph.js.map +1 -1
  70. package/cjs/scenegraph/utils/cell-border-stroke-width.js +15 -10
  71. package/cjs/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  72. package/cjs/scenegraph/utils/text-icon-layout.js +4 -4
  73. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  74. package/cjs/scenegraph/utils/text-measure.js +6 -6
  75. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  76. package/cjs/state/cell-move/index.js +1 -1
  77. package/cjs/state/cell-move/index.js.map +1 -1
  78. package/cjs/state/resize/update-resize-column.js +1 -1
  79. package/cjs/state/resize/update-resize-column.js.map +1 -1
  80. package/cjs/state/select/update-position.js +39 -8
  81. package/cjs/state/select/update-position.js.map +1 -1
  82. package/cjs/state/state.d.ts +6 -0
  83. package/cjs/state/state.js +49 -17
  84. package/cjs/state/state.js.map +1 -1
  85. package/cjs/themes/theme.js +11 -3
  86. package/cjs/themes/theme.js.map +1 -1
  87. package/cjs/tools/util.d.ts +0 -1
  88. package/cjs/tools/util.js +3 -13
  89. package/cjs/tools/util.js.map +1 -1
  90. package/cjs/ts-types/base-table.d.ts +3 -0
  91. package/cjs/ts-types/base-table.js.map +1 -1
  92. package/cjs/ts-types/events.d.ts +18 -0
  93. package/cjs/ts-types/events.js.map +1 -1
  94. package/cjs/ts-types/list-table/define/progressbar-define.d.ts +2 -2
  95. package/cjs/ts-types/list-table/define/progressbar-define.js.map +1 -1
  96. package/cjs/ts-types/table-engine.d.ts +4 -4
  97. package/cjs/ts-types/table-engine.js.map +1 -1
  98. package/cjs/ts-types/theme.d.ts +1 -0
  99. package/cjs/ts-types/theme.js.map +1 -1
  100. package/cjs/vrender.js.map +1 -1
  101. package/dist/vtable.js +935 -466
  102. package/dist/vtable.min.js +2 -2
  103. package/es/ListTable.d.ts +3 -3
  104. package/es/ListTable.js +46 -35
  105. package/es/ListTable.js.map +1 -1
  106. package/es/PivotTable.d.ts +1 -1
  107. package/es/PivotTable.js +19 -17
  108. package/es/PivotTable.js.map +1 -1
  109. package/es/body-helper/style/Style.d.ts +3 -0
  110. package/es/body-helper/style/Style.js +22 -15
  111. package/es/body-helper/style/Style.js.map +1 -1
  112. package/es/components/legend/continue-legend/continue-legend.js +1 -1
  113. package/es/components/legend/continue-legend/continue-legend.js.map +1 -1
  114. package/es/components/legend/discrete-legend/discrete-legend.js +1 -1
  115. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  116. package/es/core/BaseTable.d.ts +3 -1
  117. package/es/core/BaseTable.js +27 -17
  118. package/es/core/BaseTable.js.map +1 -1
  119. package/es/core/TABLE_EVENT_TYPE.d.ts +2 -0
  120. package/es/core/TABLE_EVENT_TYPE.js +2 -0
  121. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  122. package/es/core/tableHelper.js +1 -2
  123. package/es/core/tableHelper.js.map +1 -1
  124. package/es/data/CachedDataSource.d.ts +1 -0
  125. package/es/data/CachedDataSource.js +9 -7
  126. package/es/data/CachedDataSource.js.map +1 -1
  127. package/es/data/DataSource.d.ts +10 -3
  128. package/es/data/DataSource.js +159 -95
  129. package/es/data/DataSource.js.map +1 -1
  130. package/es/edit/edit-manager.js +10 -9
  131. package/es/edit/edit-manager.js.map +1 -1
  132. package/es/event/event.js +11 -5
  133. package/es/event/event.js.map +1 -1
  134. package/es/event/listener/table-group.js +2 -2
  135. package/es/event/listener/table-group.js.map +1 -1
  136. package/es/event/media-click.js +2 -1
  137. package/es/event/sparkline-event.js +1 -2
  138. package/es/header-helper/style/Style.d.ts +3 -0
  139. package/es/header-helper/style/Style.js +26 -19
  140. package/es/header-helper/style/Style.js.map +1 -1
  141. package/es/index.d.ts +1 -1
  142. package/es/index.js +1 -1
  143. package/es/index.js.map +1 -1
  144. package/es/layout/pivot-header-layout.js +4 -2
  145. package/es/layout/pivot-header-layout.js.map +1 -1
  146. package/es/layout/simple-header-layout.d.ts +3 -2
  147. package/es/layout/simple-header-layout.js +40 -25
  148. package/es/layout/simple-header-layout.js.map +1 -1
  149. package/es/scenegraph/component/table-component.js +13 -8
  150. package/es/scenegraph/component/table-component.js.map +1 -1
  151. package/es/scenegraph/graphic/contributions/group-contribution-render.js +10 -6
  152. package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
  153. package/es/scenegraph/group-creater/cell-helper.js +2 -1
  154. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  155. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.d.ts +3 -2
  156. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +21 -5
  157. package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
  158. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +1 -1
  159. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  160. package/es/scenegraph/layout/compute-col-width.js +11 -8
  161. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  162. package/es/scenegraph/layout/compute-row-height.js +71 -70
  163. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  164. package/es/scenegraph/layout/frozen.js +2 -2
  165. package/es/scenegraph/layout/frozen.js.map +1 -1
  166. package/es/scenegraph/layout/update-height.js +16 -9
  167. package/es/scenegraph/layout/update-height.js.map +1 -1
  168. package/es/scenegraph/layout/update-width.js +19 -10
  169. package/es/scenegraph/layout/update-width.js.map +1 -1
  170. package/es/scenegraph/scenegraph.js +3 -3
  171. package/es/scenegraph/scenegraph.js.map +1 -1
  172. package/es/scenegraph/utils/cell-border-stroke-width.js +10 -7
  173. package/es/scenegraph/utils/cell-border-stroke-width.js.map +1 -1
  174. package/es/scenegraph/utils/text-icon-layout.js +4 -4
  175. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  176. package/es/scenegraph/utils/text-measure.js +6 -6
  177. package/es/scenegraph/utils/text-measure.js.map +1 -1
  178. package/es/state/cell-move/index.js +1 -1
  179. package/es/state/cell-move/index.js.map +1 -1
  180. package/es/state/resize/update-resize-column.js +1 -1
  181. package/es/state/resize/update-resize-column.js.map +1 -1
  182. package/es/state/select/update-position.js +39 -8
  183. package/es/state/select/update-position.js.map +1 -1
  184. package/es/state/state.d.ts +6 -0
  185. package/es/state/state.js +49 -17
  186. package/es/state/state.js.map +1 -1
  187. package/es/themes/theme.js +8 -2
  188. package/es/themes/theme.js.map +1 -1
  189. package/es/tools/util.d.ts +0 -1
  190. package/es/tools/util.js +0 -10
  191. package/es/tools/util.js.map +1 -1
  192. package/es/ts-types/base-table.d.ts +3 -0
  193. package/es/ts-types/base-table.js.map +1 -1
  194. package/es/ts-types/events.d.ts +18 -0
  195. package/es/ts-types/events.js.map +1 -1
  196. package/es/ts-types/list-table/define/progressbar-define.d.ts +2 -2
  197. package/es/ts-types/list-table/define/progressbar-define.js.map +1 -1
  198. package/es/ts-types/table-engine.d.ts +4 -4
  199. package/es/ts-types/table-engine.js.map +1 -1
  200. package/es/ts-types/theme.d.ts +1 -0
  201. package/es/ts-types/theme.js.map +1 -1
  202. package/es/vrender.js.map +1 -1
  203. package/package.json +5 -5
@@ -67,13 +67,13 @@ export class DataSource extends EventTarget {
67
67
  return EVENT_TYPE;
68
68
  }
69
69
  constructor(dataSourceObj, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel) {
70
- var _a, _b;
70
+ var _a;
71
71
  super(), this.currentIndexedData = [], this.hierarchyExpandLevel = 0, this.hasHierarchyStateExpand = !1,
72
72
  this.beforeChangedRecordsMap = [], this.registedAggregators = {}, this.fieldAggregators = [],
73
73
  this.layoutColumnObjects = [], this.registerAggregators(), this.dataSourceObj = dataSourceObj,
74
- this.dataConfig = dataConfig, this._get = (null == dataSourceObj ? void 0 : dataSourceObj.get.bind(dataSourceObj)) || void 0,
75
- this.layoutColumnObjects = columnObjs, this._source = this.processRecords(null !== (_a = null == dataSourceObj ? void 0 : dataSourceObj.source) && void 0 !== _a ? _a : dataSourceObj),
76
- this._sourceLength = (null === (_b = this._source) || void 0 === _b ? void 0 : _b.length) || 0,
74
+ this.dataConfig = dataConfig, this._get = null == dataSourceObj ? void 0 : dataSourceObj.get,
75
+ this.layoutColumnObjects = columnObjs, this._source = (null == dataSourceObj ? void 0 : dataSourceObj.records) ? this.processRecords(null == dataSourceObj ? void 0 : dataSourceObj.records) : dataSourceObj,
76
+ this._sourceLength = (null === (_a = this._source) || void 0 === _a ? void 0 : _a.length) || 0,
77
77
  this.sortedIndexMap = new Map, this._currentPagerIndexedData = [], this.userPagination = pagination,
78
78
  this.pagination = pagination || {
79
79
  totalCount: this._sourceLength,
@@ -83,7 +83,7 @@ export class DataSource extends EventTarget {
83
83
  this.currentIndexedData = Array.from({
84
84
  length: this._sourceLength
85
85
  }, ((_, i) => i)), "tree" === rowHierarchyType && this.initTreeHierarchyState(),
86
- this.updatePagerData();
86
+ this.rowHierarchyType = rowHierarchyType, this.updatePagerData();
87
87
  }
88
88
  initTreeHierarchyState() {
89
89
  var _a;
@@ -92,8 +92,8 @@ export class DataSource extends EventTarget {
92
92
  }, ((_, i) => i));
93
93
  let nodeLength = this._sourceLength;
94
94
  for (let i = 0; i < nodeLength; i++) {
95
- const indexKey = this.currentIndexedData[i], nodeData = this.getOriginalRecord(indexKey);
96
- if ((null === (_a = nodeData.children) || void 0 === _a ? void 0 : _a.length) > 0) {
95
+ const indexKey = this.currentIndexedData[i], nodeData = this.getOriginalRecord(indexKey), children = null !== (_a = nodeData.filteredChildren) && void 0 !== _a ? _a : nodeData.children;
96
+ if ((null == children ? void 0 : children.length) > 0) {
97
97
  if (this.hierarchyExpandLevel > 1 ? !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.expand) : !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.collapse),
98
98
  this.hasHierarchyStateExpand = !0, nodeData.hierarchyState === HierarchyState.collapse) continue;
99
99
  const childrenLength = this.initChildrenNodeHierarchy(indexKey, this.hierarchyExpandLevel, 2, nodeData);
@@ -126,18 +126,29 @@ export class DataSource extends EventTarget {
126
126
  }
127
127
  }
128
128
  processRecords(records) {
129
- var _a, _b;
129
+ var _a, _b, _c, _d, _e, _f, _g, _h;
130
130
  this._generateFieldAggragations();
131
- const filteredRecords = [], isHasAggregation = this.fieldAggregators.length >= 1, isHasFilterRule = (null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) >= 1;
132
- if (isHasFilterRule || isHasAggregation) {
131
+ const filteredRecords = [], isHasAggregation = this.fieldAggregators.length >= 1;
132
+ if ((null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) >= 1 || (null === (_c = this.lastFilterRules) || void 0 === _c ? void 0 : _c.length) >= 1 || isHasAggregation) {
133
133
  for (let i = 0, len = records.length; i < len; i++) {
134
134
  const record = records[i];
135
- isHasFilterRule ? this.filterRecord(record) && (filteredRecords.push(record), isHasAggregation && this.processRecord(record)) : isHasAggregation && this.processRecord(record);
135
+ (null === (_e = null === (_d = this.dataConfig) || void 0 === _d ? void 0 : _d.filterRules) || void 0 === _e ? void 0 : _e.length) >= 1 ? this.filterRecord(record) && (filteredRecords.push(record),
136
+ "tree" === this.rowHierarchyType && record.children && (record.filteredChildren = this.filteredChildren(record.children)),
137
+ isHasAggregation && this.processRecord(record)) : (null === (_f = this.lastFilterRules) || void 0 === _f ? void 0 : _f.length) >= 1 ? (this.clearFilteredChildren(record),
138
+ isHasAggregation && this.processRecord(record)) : isHasAggregation && this.processRecord(record);
136
139
  }
137
- if (isHasFilterRule) return filteredRecords;
140
+ if ((null === (_h = null === (_g = this.dataConfig) || void 0 === _g ? void 0 : _g.filterRules) || void 0 === _h ? void 0 : _h.length) >= 1) return filteredRecords;
138
141
  }
139
142
  return records;
140
143
  }
144
+ filteredChildren(records) {
145
+ const filteredRecords = [];
146
+ for (let i = 0, len = records.length; i < len; i++) {
147
+ const record = records[i];
148
+ this.filterRecord(record) && (filteredRecords.push(record), record.children && (record.filteredChildren = this.filteredChildren(record.children)));
149
+ }
150
+ return filteredRecords;
151
+ }
141
152
  processRecord(record) {
142
153
  for (let i = 0; i < this.fieldAggregators.length; i++) {
143
154
  this.fieldAggregators[i].push(record);
@@ -146,12 +157,12 @@ export class DataSource extends EventTarget {
146
157
  initChildrenNodeHierarchy(indexKey, hierarchyExpandLevel, currentLevel, nodeData) {
147
158
  var _a, _b, _c;
148
159
  let childTotalLength = 0;
149
- const nodeLength = null !== (_b = null === (_a = nodeData.children) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
160
+ const nodeLength = nodeData.filteredChildren ? nodeData.filteredChildren.length : null !== (_b = null === (_a = nodeData.children) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
150
161
  for (let j = 0; j < nodeLength; j++) {
151
162
  (currentLevel <= hierarchyExpandLevel || nodeData.hierarchyState === HierarchyState.expand) && (childTotalLength += 1);
152
- const childNodeData = nodeData.children[j], childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [ indexKey, j ];
163
+ const childNodeData = nodeData.filteredChildren ? nodeData.filteredChildren[j] : nodeData.children[j], childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [ indexKey, j ];
153
164
  (currentLevel <= hierarchyExpandLevel || nodeData.hierarchyState === HierarchyState.expand) && this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childTotalLength, 0, childIndexKey),
154
- (null === (_c = childNodeData.children) || void 0 === _c ? void 0 : _c.length) > 0 && (currentLevel < hierarchyExpandLevel || childNodeData.hierarchyState === HierarchyState.expand ? (!childNodeData.hierarchyState && (childNodeData.hierarchyState = HierarchyState.expand),
165
+ (childNodeData.filteredChildren ? childNodeData.filteredChildren.length > 0 : (null === (_c = childNodeData.children) || void 0 === _c ? void 0 : _c.length) > 0) && (currentLevel < hierarchyExpandLevel || childNodeData.hierarchyState === HierarchyState.expand ? (!childNodeData.hierarchyState && (childNodeData.hierarchyState = HierarchyState.expand),
155
166
  this.hasHierarchyStateExpand = !0) : !childNodeData.hierarchyState && (childNodeData.hierarchyState = HierarchyState.collapse)),
156
167
  childNodeData.hierarchyState === HierarchyState.expand && (childTotalLength += this.initChildrenNodeHierarchy(childIndexKey, hierarchyExpandLevel, currentLevel + 1, childNodeData));
157
168
  }
@@ -172,6 +183,9 @@ export class DataSource extends EventTarget {
172
183
  firstLevelIndex >= startIndex && firstLevelIndex < endIndex) this._currentPagerIndexedData.push(currentIndexedData[i]); else if (firstLevelIndex >= endIndex) break;
173
184
  } else if (this._sourceLength > 0) throw new Error("currentIndexedData should has values!");
174
185
  }
186
+ get records() {
187
+ return Array.isArray(this._source) ? this._source : [];
188
+ }
175
189
  get source() {
176
190
  return this._source;
177
191
  }
@@ -207,10 +221,12 @@ export class DataSource extends EventTarget {
207
221
  this.pushChildrenNode(indexed, HierarchyState.expand, data), this.hasHierarchyStateExpand = !0; else if (state === HierarchyState.expand) {
208
222
  let childrenLength = 0;
209
223
  const computeChildrenNodeLength = (indexKey, hierarchyState, nodeData) => {
210
- if (hierarchyState && hierarchyState !== HierarchyState.collapse && hierarchyState !== HierarchyState.none && nodeData.children) for (let i = 0; i < nodeData.children.length; i++) {
224
+ if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) return;
225
+ const children = nodeData.filteredChildren ? nodeData.filteredChildren : nodeData.children;
226
+ if (children) for (let i = 0; i < children.length; i++) {
211
227
  childrenLength += 1;
212
228
  const childIndex = Array.isArray(indexKey) ? indexKey.concat([ i ]) : [ indexKey, i ];
213
- computeChildrenNodeLength(childIndex, nodeData.children[i].hierarchyState, nodeData.children[i]);
229
+ computeChildrenNodeLength(childIndex, children[i].hierarchyState, children[i]);
214
230
  }
215
231
  };
216
232
  computeChildrenNodeLength(indexed, state, data), this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexed) + 1, childrenLength),
@@ -220,22 +236,24 @@ export class DataSource extends EventTarget {
220
236
  return calculateArrayDiff(oldIndexedData, this.currentIndexedData);
221
237
  }
222
238
  pushChildrenNode(indexKey, hierarchyState, nodeData) {
239
+ var _a;
223
240
  if (!hierarchyState || hierarchyState === HierarchyState.collapse || hierarchyState === HierarchyState.none) return 0;
224
241
  let childrenLength = 0;
225
- if (nodeData.children) {
242
+ const children = nodeData.filteredChildren ? nodeData.filteredChildren : nodeData.children;
243
+ if (children) {
226
244
  const subNodeSortedIndexArray = Array.from({
227
- length: nodeData.children.length
245
+ length: children.length
228
246
  }, ((_, i) => i));
229
247
  this.lastOrder && "normal" !== this.lastOrder && this.lastOrderField && sort.sort((index => isValid(subNodeSortedIndexArray[index]) ? subNodeSortedIndexArray[index] : subNodeSortedIndexArray[index] = index), ((index, rel) => {
230
248
  subNodeSortedIndexArray[index] = rel;
231
- }), nodeData.children.length, this.lastOrderFn, this.lastOrder, (index => this.getOriginalField(Array.isArray(indexKey) ? indexKey.concat([ index ]) : [ indexKey, index ], this.lastOrderField)));
249
+ }), children.length, this.lastOrderFn, this.lastOrder, (index => this.getOriginalField(Array.isArray(indexKey) ? indexKey.concat([ index ]) : [ indexKey, index ], this.lastOrderField)));
232
250
  for (let i = 0; i < subNodeSortedIndexArray.length; i++) {
233
251
  childrenLength += 1;
234
252
  const childIndex = Array.isArray(indexKey) ? indexKey.concat([ subNodeSortedIndexArray[i] ]) : [ indexKey, subNodeSortedIndexArray[i] ];
235
253
  this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childrenLength, 0, childIndex);
236
254
  const childData = this.getOriginalRecord(childIndex);
237
- !nodeData.children[i].hierarchyState && childData.children && (nodeData.children[i].hierarchyState = HierarchyState.collapse),
238
- childrenLength += this.pushChildrenNode(childIndex, nodeData.children[i].hierarchyState, nodeData.children[subNodeSortedIndexArray[i]]);
255
+ !childData.hierarchyState && (null !== (_a = childData.filteredChildren) && void 0 !== _a ? _a : childData.children) && (childData.hierarchyState = HierarchyState.collapse),
256
+ childrenLength += this.pushChildrenNode(childIndex, childData.hierarchyState, children[subNodeSortedIndexArray[i]]);
239
257
  }
240
258
  }
241
259
  return childrenLength;
@@ -258,74 +276,94 @@ export class DataSource extends EventTarget {
258
276
  }
259
277
  }
260
278
  setRecord(record, index) {
261
- const indexed = this.getIndexKey(index);
262
- if (Array.isArray(indexed)) {
263
- const c_node_index = indexed[indexed.length - 1];
264
- this.getOriginalRecord(indexed.slice(0, indexed.length - 1)).children.splice(c_node_index, 1, record);
265
- } else this.source.splice(indexed, 1, record);
279
+ var _a, _b;
280
+ let isAdd = !0;
281
+ if ((null === (_b = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) || void 0 === _b ? void 0 : _b.length) >= 1 && (this.filterRecord(record) ? "tree" === this.rowHierarchyType && record.children && (record.filteredChildren = this.filteredChildren(record.children)) : isAdd = !1),
282
+ isAdd && Array.isArray(this.records)) {
283
+ const indexed = this.getIndexKey(index);
284
+ Array.isArray(indexed) || this.records.splice(indexed, 1, record);
285
+ }
266
286
  }
267
287
  addRecord(record, index) {
268
- if (this.source.splice(index, 0, record), this.currentIndexedData.push(this.currentIndexedData.length),
269
- this._sourceLength += 1, this.initTreeHierarchyState(), this.userPagination) {
270
- this.pagination.totalCount = this._sourceLength;
271
- const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
272
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
273
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
274
- this.updatePagerData();
288
+ var _a;
289
+ if (Array.isArray(this.records)) {
290
+ if (this.records.splice(index, 0, record), this.currentIndexedData.push(this.currentIndexedData.length),
291
+ this._sourceLength += 1, "tree" === this.rowHierarchyType && this.initTreeHierarchyState(),
292
+ this.userPagination) {
293
+ this.pagination.totalCount = this._sourceLength;
294
+ const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
295
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
296
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
297
+ this.updatePagerData();
298
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, 1);
299
+ }
275
300
  }
276
301
  addRecords(recordArr, index) {
277
- if (Array.isArray(recordArr)) {
278
- this.source.splice(index, 0, ...recordArr);
279
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
280
- this._sourceLength += recordArr.length;
302
+ var _a;
303
+ if (Array.isArray(this.records)) {
304
+ if (Array.isArray(recordArr)) {
305
+ this.records.splice(index, 0, ...recordArr);
306
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
307
+ this._sourceLength += recordArr.length;
308
+ }
309
+ if (this.userPagination) {
310
+ this.pagination.totalCount = this._sourceLength;
311
+ const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
312
+ index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
313
+ } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
314
+ this.updatePagerData();
315
+ (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.added) && this.dataSourceObj.added(index, recordArr.length);
281
316
  }
282
- if (this.userPagination) {
283
- this.pagination.totalCount = this._sourceLength;
284
- const {perPageCount: perPageCount, currentPage: currentPage} = this.pagination;
285
- index < perPageCount * (currentPage || 0) + perPageCount && this.updatePagerData();
286
- } else this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength,
287
- this.updatePagerData();
288
317
  }
289
318
  addRecordForSorted(record) {
290
- this.source.push(record), this.currentIndexedData.push(this.currentIndexedData.length),
319
+ Array.isArray(this.records) && (this.records.push(record), this.currentIndexedData.push(this.currentIndexedData.length),
291
320
  this._sourceLength += 1, this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength,
292
- this.pagination.totalCount = this._sourceLength);
321
+ this.pagination.totalCount = this._sourceLength));
293
322
  }
294
323
  addRecordsForSorted(recordArr) {
295
- if (Array.isArray(recordArr)) {
296
- this.source.push(...recordArr);
297
- for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
298
- this._sourceLength += recordArr.length, this.sortedIndexMap.clear();
324
+ if (Array.isArray(this.records)) {
325
+ if (Array.isArray(recordArr)) {
326
+ this.records.push(...recordArr);
327
+ for (let i = 0; i < recordArr.length; i++) this.currentIndexedData.push(this.currentIndexedData.length);
328
+ this._sourceLength += recordArr.length, this.sortedIndexMap.clear();
329
+ }
330
+ this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength);
299
331
  }
300
- this.userPagination || (this.pagination.perPageCount = this._sourceLength, this.pagination.totalCount = this._sourceLength);
301
332
  }
302
333
  deleteRecords(recordIndexs) {
303
- const realDeletedRecordIndexs = [], recordIndexsMaxToMin = recordIndexs.sort(((a, b) => b - a));
304
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
305
- const recordIndex = recordIndexsMaxToMin[index];
306
- recordIndex >= this._sourceLength || recordIndex < 0 || (realDeletedRecordIndexs.push(recordIndex),
307
- this.source.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1);
334
+ var _a;
335
+ if (Array.isArray(this.records)) {
336
+ const realDeletedRecordIndexs = [], recordIndexsMaxToMin = recordIndexs.sort(((a, b) => b - a));
337
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
338
+ const recordIndex = recordIndexsMaxToMin[index];
339
+ recordIndex >= this._sourceLength || recordIndex < 0 || (realDeletedRecordIndexs.push(recordIndex),
340
+ this.records.splice(recordIndex, 1), this.currentIndexedData.pop(), this._sourceLength -= 1);
341
+ }
342
+ return this.userPagination || (this.pagination.perPageCount = this._sourceLength,
343
+ this.pagination.totalCount = this._sourceLength), this.updatePagerData(), (null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.deleted) && this.dataSourceObj.deleted(realDeletedRecordIndexs),
344
+ realDeletedRecordIndexs;
308
345
  }
309
- return this.userPagination || (this.pagination.perPageCount = this._sourceLength,
310
- this.pagination.totalCount = this._sourceLength), this.updatePagerData(), realDeletedRecordIndexs;
346
+ return [];
311
347
  }
312
348
  deleteRecordsForSorted(recordIndexs) {
313
- const recordIndexsMaxToMin = recordIndexs.sort(((a, b) => b - a));
314
- for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
315
- const recordIndex = recordIndexsMaxToMin[index];
316
- if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
317
- const rawIndex = this.currentIndexedData[recordIndex];
318
- this.source.splice(rawIndex, 1), this._sourceLength -= 1;
349
+ if (Array.isArray(this.records)) {
350
+ const recordIndexsMaxToMin = recordIndexs.sort(((a, b) => b - a));
351
+ for (let index = 0; index < recordIndexsMaxToMin.length; index++) {
352
+ const recordIndex = recordIndexsMaxToMin[index];
353
+ if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
354
+ const rawIndex = this.currentIndexedData[recordIndex];
355
+ this.records.splice(rawIndex, 1), this._sourceLength -= 1;
356
+ }
357
+ this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength,
358
+ this.pagination.totalCount = this._sourceLength);
319
359
  }
320
- this.sortedIndexMap.clear(), this.userPagination || (this.pagination.perPageCount = this._sourceLength,
321
- this.pagination.totalCount = this._sourceLength);
322
360
  }
323
361
  updateRecords(records, recordIndexs) {
324
362
  const realDeletedRecordIndexs = [];
325
363
  for (let index = 0; index < recordIndexs.length; index++) {
326
364
  const recordIndex = recordIndexs[index];
327
365
  recordIndex >= this._sourceLength || recordIndex < 0 || (realDeletedRecordIndexs.push(recordIndex),
328
- this.source[recordIndex] = records[index]);
366
+ this.records[recordIndex] = records[index]);
329
367
  }
330
368
  return this.userPagination && this.updatePagerData(), realDeletedRecordIndexs;
331
369
  }
@@ -336,7 +374,7 @@ export class DataSource extends EventTarget {
336
374
  if (recordIndex >= this._sourceLength || recordIndex < 0) continue;
337
375
  const rawIndex = this.currentIndexedData[recordIndex];
338
376
  if ("number" != typeof rawIndex) return;
339
- realDeletedRecordIndexs.push(recordIndex), this.source[rawIndex] = records[index];
377
+ realDeletedRecordIndexs.push(recordIndex), this.records[rawIndex] = records[index];
340
378
  }
341
379
  this.sortedIndexMap.clear();
342
380
  }
@@ -364,18 +402,23 @@ export class DataSource extends EventTarget {
364
402
  }, this.sortedIndexMap.set(field, filedMap)), filedMap[order] = sortedIndexArray,
365
403
  this.updatePagerData(), this.fireListeners(EVENT_TYPE.CHANGE_ORDER, null);
366
404
  }
367
- filterRecord(record) {
405
+ clearFilteredChildren(record) {
368
406
  var _a, _b;
407
+ record.filteredChildren = void 0;
408
+ for (let i = 0; null !== (_b = i < (null === (_a = record.children) || void 0 === _a ? void 0 : _a.length)) && void 0 !== _b && _b; i++) this.clearFilteredChildren(record.children[i]);
409
+ }
410
+ filterRecord(record) {
411
+ var _a, _b, _c;
369
412
  let isReserved = !0;
370
- for (let i = 0; i < this.dataConfig.filterRules.length; i++) {
371
- const filterRule = null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules[i];
413
+ for (let i = 0; i < (null === (_a = this.dataConfig.filterRules) || void 0 === _a ? void 0 : _a.length); i++) {
414
+ const filterRule = null === (_b = this.dataConfig) || void 0 === _b ? void 0 : _b.filterRules[i];
372
415
  if (filterRule.filterKey) {
373
416
  const filterValue = record[filterRule.filterKey];
374
417
  if (-1 === filterRule.filteredValues.indexOf(filterValue)) {
375
418
  isReserved = !1;
376
419
  break;
377
420
  }
378
- } else if (!(null === (_b = filterRule.filterFunc) || void 0 === _b ? void 0 : _b.call(filterRule, record))) {
421
+ } else if (!(null === (_c = filterRule.filterFunc) || void 0 === _c ? void 0 : _c.call(filterRule, record))) {
379
422
  isReserved = !1;
380
423
  break;
381
424
  }
@@ -384,7 +427,8 @@ export class DataSource extends EventTarget {
384
427
  }
385
428
  updateFilterRulesForSorted(filterRules) {
386
429
  var _a, _b, _c;
387
- this.dataConfig.filterRules = filterRules, this._source = this.processRecords(null !== (_b = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.source) && void 0 !== _b ? _b : this.dataSourceObj),
430
+ this.lastFilterRules = this.dataConfig.filterRules, this.dataConfig.filterRules = filterRules,
431
+ this._source = this.processRecords(null !== (_b = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : this.dataSourceObj),
388
432
  this._sourceLength = (null === (_c = this._source) || void 0 === _c ? void 0 : _c.length) || 0,
389
433
  this.sortedIndexMap.clear(), this.currentIndexedData = Array.from({
390
434
  length: this._sourceLength
@@ -393,12 +437,14 @@ export class DataSource extends EventTarget {
393
437
  }
394
438
  updateFilterRules(filterRules) {
395
439
  var _a, _b, _c;
396
- this.dataConfig.filterRules = filterRules, this._source = this.processRecords(null !== (_b = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.source) && void 0 !== _b ? _b : this.dataSourceObj),
440
+ this.lastFilterRules = this.dataConfig.filterRules, this.dataConfig.filterRules = filterRules,
441
+ this._source = this.processRecords(null !== (_b = null === (_a = this.dataSourceObj) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : this.dataSourceObj),
397
442
  this._sourceLength = (null === (_c = this._source) || void 0 === _c ? void 0 : _c.length) || 0,
398
443
  this.currentIndexedData = Array.from({
399
444
  length: this._sourceLength
400
445
  }, ((_, i) => i)), this.userPagination || (this.pagination.perPageCount = this._sourceLength,
401
- this.pagination.totalCount = this._sourceLength), this.updatePagerData();
446
+ this.pagination.totalCount = this._sourceLength, "tree" === this.rowHierarchyType && this.initTreeHierarchyState()),
447
+ this.updatePagerData();
402
448
  }
403
449
  clearSortedIndexMap() {
404
450
  this.lastOrderField && this.lastOrder && this.sortedIndexMap.forEach(((sortMap, key) => {
@@ -424,7 +470,7 @@ export class DataSource extends EventTarget {
424
470
  }
425
471
  release() {
426
472
  var _a;
427
- null === (_a = super.release) || void 0 === _a || _a.call(this);
473
+ null === (_a = super.release) || void 0 === _a || _a.call(this), this.lastFilterRules = null;
428
474
  }
429
475
  clearSortedMap() {
430
476
  this.currentIndexedData && (this.currentIndexedData.length = 0), this.currentIndexedData = null,
@@ -436,14 +482,18 @@ export class DataSource extends EventTarget {
436
482
  this.currentIndexedData = null, this.currentPagerIndexedData.length = 0;
437
483
  }
438
484
  getOriginalRecord(dataIndex) {
439
- var _a;
440
- return (null === (_a = this.dataConfig) || void 0 === _a ? void 0 : _a.filterRules) ? this.source[dataIndex] : getValue(this._get(dataIndex), (val => {
485
+ let data;
486
+ return data = this.dataSourceObj.records ? Array.isArray(dataIndex) ? getValueFromDeepArray(this.records, dataIndex) : this.records[dataIndex] : this._get(dataIndex),
487
+ getValue(data, (val => {
441
488
  this.recordPromiseCallBack(dataIndex, val);
442
489
  }));
443
490
  }
444
491
  getRawRecord(dataIndex) {
445
492
  var _a;
446
- return (null === (_a = this.beforeChangedRecordsMap) || void 0 === _a ? void 0 : _a[dataIndex]) ? this.beforeChangedRecordsMap[dataIndex] : getValue(this._get(dataIndex), (val => {
493
+ if (null === (_a = this.beforeChangedRecordsMap) || void 0 === _a ? void 0 : _a[dataIndex]) return this.beforeChangedRecordsMap[dataIndex];
494
+ let data;
495
+ return data = this.dataSourceObj.records ? Array.isArray(dataIndex) ? getValueFromDeepArray(this.records, dataIndex) : this.records[dataIndex] : this._get(dataIndex),
496
+ getValue(data, (val => {
447
497
  this.recordPromiseCallBack(dataIndex, val);
448
498
  }));
449
499
  }
@@ -486,6 +536,7 @@ export class DataSource extends EventTarget {
486
536
  return !0;
487
537
  }
488
538
  reorderRecord(sourceIndex, targetIndex) {
539
+ var _a;
489
540
  if ("asc" !== this.lastOrder && "desc" !== this.lastOrder && this.isCanExchangeOrder(sourceIndex, targetIndex)) if (this.hasHierarchyStateExpand) {
490
541
  let sourceI, targetI, sourceIndexs = this.currentPagerIndexedData[sourceIndex], targetIndexs = this.currentPagerIndexedData[targetIndex];
491
542
  if (sourceIndexs = Array.isArray(sourceIndexs) ? [ ...sourceIndexs ] : [ sourceIndexs ],
@@ -498,37 +549,37 @@ export class DataSource extends EventTarget {
498
549
  }
499
550
  if (sourceI = sourceIndexs.splice(sourceIndexs.length - 1, 1)[0], targetI = targetIndexs.splice(targetIndexs.length - 1, 1)[0],
500
551
  sourceIndexs.length >= 1) {
501
- const parent = this.getOriginalRecord(sourceIndexs), sourceIds = parent.children.splice(sourceI, 1);
502
- sourceIds.unshift(targetI, 0), Array.prototype.splice.apply(parent.children, sourceIds);
552
+ const parent = this.getOriginalRecord(sourceIndexs), sourceIds = parent.filteredChildren ? parent.filteredChildren.splice(sourceI, 1) : parent.children.splice(sourceI, 1);
553
+ sourceIds.unshift(targetI, 0), Array.prototype.splice.apply(null !== (_a = parent.filteredChildren) && void 0 !== _a ? _a : parent.children, sourceIds);
503
554
  } else {
504
- const sourceIds = this.source.splice(sourceI, 1);
505
- sourceIds.unshift(targetI, 0), Array.prototype.splice.apply(this.source, sourceIds);
555
+ const sourceIds = this.records.splice(sourceI, 1);
556
+ sourceIds.unshift(targetI, 0), Array.prototype.splice.apply(this.records, sourceIds);
506
557
  }
507
558
  } else {
508
559
  sourceI = this.currentPagerIndexedData[sourceIndex], targetI = this.currentPagerIndexedData[targetIndex];
509
- const records = this.source.splice(sourceI, 1);
510
- records.unshift(targetI, 0), Array.prototype.splice.apply(this.source, records);
560
+ const records = this.records.splice(sourceI, 1);
561
+ records.unshift(targetI, 0), Array.prototype.splice.apply(this.records, records);
511
562
  }
512
563
  this.restoreTreeHierarchyState(), this.updatePagerData();
513
564
  } else {
514
- const records = this.source.splice(sourceIndex, 1);
515
- records.unshift(targetIndex, 0), Array.prototype.splice.apply(this.source, records);
565
+ const records = this.records.splice(sourceIndex, 1);
566
+ records.unshift(targetIndex, 0), Array.prototype.splice.apply(this.records, records);
516
567
  }
517
568
  }
518
569
  restoreTreeHierarchyState() {
519
- var _a;
570
+ var _a, _b;
520
571
  if (this.hierarchyExpandLevel) {
521
572
  for (let i = 0; i < this._sourceLength; i++) {
522
573
  const nodeData = this.getOriginalRecord(i);
523
- nodeData.children && !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.collapse);
574
+ (null !== (_a = nodeData.filteredChildren) && void 0 !== _a ? _a : nodeData.children) && !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.collapse);
524
575
  }
525
576
  this.currentIndexedData = Array.from({
526
577
  length: this._sourceLength
527
578
  }, ((_, i) => i));
528
579
  let nodeLength = this._sourceLength;
529
580
  for (let i = 0; i < nodeLength; i++) {
530
- const indexKey = this.currentIndexedData[i], nodeData = this.getOriginalRecord(indexKey);
531
- if ((null === (_a = nodeData.children) || void 0 === _a ? void 0 : _a.length) > 0 && nodeData.hierarchyState === HierarchyState.expand) {
581
+ const indexKey = this.currentIndexedData[i], nodeData = this.getOriginalRecord(indexKey), children = null !== (_b = nodeData.filteredChildren) && void 0 !== _b ? _b : nodeData.children;
582
+ if ((null == children ? void 0 : children.length) > 0 && nodeData.hierarchyState === HierarchyState.expand) {
532
583
  this.hasHierarchyStateExpand = !0;
533
584
  const childrenLength = this.restoreChildrenNodeHierarchy(indexKey, nodeData);
534
585
  i += childrenLength, nodeLength += childrenLength;
@@ -539,10 +590,10 @@ export class DataSource extends EventTarget {
539
590
  restoreChildrenNodeHierarchy(indexKey, nodeData) {
540
591
  var _a, _b;
541
592
  let childTotalLength = 0;
542
- const nodeLength = null !== (_b = null === (_a = nodeData.children) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
593
+ const children = null !== (_a = nodeData.filteredChildren) && void 0 !== _a ? _a : nodeData.children, nodeLength = null !== (_b = null == children ? void 0 : children.length) && void 0 !== _b ? _b : 0;
543
594
  for (let j = 0; j < nodeLength; j++) {
544
595
  nodeData.hierarchyState === HierarchyState.expand && (childTotalLength += 1);
545
- const childNodeData = nodeData.children[j], childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [ indexKey, j ];
596
+ const childNodeData = children[j], childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [ indexKey, j ];
546
597
  nodeData.hierarchyState === HierarchyState.expand && this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childTotalLength, 0, childIndexKey),
547
598
  childTotalLength += this.restoreChildrenNodeHierarchy(childIndexKey, childNodeData);
548
599
  }
@@ -550,8 +601,21 @@ export class DataSource extends EventTarget {
550
601
  }
551
602
  }
552
603
 
604
+ function getValueFromDeepArray(array, index) {
605
+ var _a;
606
+ let result = array;
607
+ for (let i = 0; i < index.length; i++) {
608
+ const currentIdx = index[i];
609
+ if (!result[currentIdx]) return;
610
+ result = result[currentIdx];
611
+ const children = null !== (_a = result.filteredChildren) && void 0 !== _a ? _a : null == result ? void 0 : result.children;
612
+ children && i + 1 < index.length && (result = children);
613
+ }
614
+ return result;
615
+ }
616
+
617
+ //# sourceMappingURL=DataSource.js.map
553
618
  DataSource.EMPTY = new DataSource({
554
619
  get() {},
555
620
  length: 0
556
- });
557
- //# sourceMappingURL=DataSource.js.map
621
+ });