@visactor/vtable 0.21.4-alpha.4 → 0.22.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 (209) hide show
  1. package/cjs/ListTable.d.ts +2 -4
  2. package/cjs/ListTable.js +37 -28
  3. package/cjs/ListTable.js.map +1 -1
  4. package/cjs/PivotChart.d.ts +1 -0
  5. package/cjs/PivotChart.js +1 -0
  6. package/cjs/PivotChart.js.map +1 -1
  7. package/cjs/PivotTable.d.ts +1 -0
  8. package/cjs/PivotTable.js +13 -4
  9. package/cjs/PivotTable.js.map +1 -1
  10. package/cjs/components/menu/dom/MenuHandler.js.map +1 -1
  11. package/cjs/core/BaseTable.d.ts +14 -9
  12. package/cjs/core/BaseTable.js +44 -33
  13. package/cjs/core/BaseTable.js.map +1 -1
  14. package/cjs/core/row-series-number-helper.d.ts +8 -0
  15. package/cjs/core/row-series-number-helper.js +45 -0
  16. package/cjs/core/row-series-number-helper.js.map +1 -0
  17. package/cjs/core/style.js +2 -1
  18. package/cjs/core/tableHelper.js +1 -1
  19. package/cjs/core/tableHelper.js.map +1 -1
  20. package/cjs/data/CachedDataSource.d.ts +2 -2
  21. package/cjs/data/CachedDataSource.js +5 -5
  22. package/cjs/data/CachedDataSource.js.map +1 -1
  23. package/cjs/data/DataSource.d.ts +6 -2
  24. package/cjs/data/DataSource.js +113 -41
  25. package/cjs/data/DataSource.js.map +1 -1
  26. package/cjs/event/event.js.map +1 -1
  27. package/cjs/event/listener/table-group.js +2 -1
  28. package/cjs/event/listener/table-group.js.map +1 -1
  29. package/cjs/event/media-click.js +1 -2
  30. package/cjs/event/media-click.js.map +1 -1
  31. package/cjs/event/scroll.js +1 -0
  32. package/cjs/header-helper/header-helper.js.map +1 -1
  33. package/cjs/icons.js +14 -0
  34. package/cjs/icons.js.map +1 -1
  35. package/cjs/index.d.ts +1 -1
  36. package/cjs/index.js +1 -1
  37. package/cjs/index.js.map +1 -1
  38. package/cjs/layout/layout-helper.d.ts +1 -0
  39. package/cjs/layout/layout-helper.js +12 -2
  40. package/cjs/layout/layout-helper.js.map +1 -1
  41. package/cjs/layout/pivot-header-layout.d.ts +16 -5
  42. package/cjs/layout/pivot-header-layout.js +102 -46
  43. package/cjs/layout/pivot-header-layout.js.map +1 -1
  44. package/cjs/layout/simple-header-layout.d.ts +17 -4
  45. package/cjs/layout/simple-header-layout.js +170 -61
  46. package/cjs/layout/simple-header-layout.js.map +1 -1
  47. package/cjs/plugins/themes.js +1 -2
  48. package/cjs/scenegraph/component/cell-mover.js +1 -1
  49. package/cjs/scenegraph/component/cell-mover.js.map +1 -1
  50. package/cjs/scenegraph/component/custom.js +1 -1
  51. package/cjs/scenegraph/component/custom.js.map +1 -1
  52. package/cjs/scenegraph/component/menu.js.map +1 -1
  53. package/cjs/scenegraph/group-creater/cell-helper.d.ts +0 -1
  54. package/cjs/scenegraph/group-creater/cell-helper.js +28 -18
  55. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  56. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  57. package/cjs/scenegraph/group-creater/column-helper.js +3 -4
  58. package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
  59. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js +9 -2
  60. package/cjs/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  61. package/cjs/scenegraph/group-creater/progress/proxy.js +1 -1
  62. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  63. package/cjs/scenegraph/layout/compute-col-width.js +2 -2
  64. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  65. package/cjs/scenegraph/layout/compute-row-height.js +2 -2
  66. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  67. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  68. package/cjs/scenegraph/layout/update-row.js +8 -2
  69. package/cjs/scenegraph/layout/update-row.js.map +1 -1
  70. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  71. package/cjs/scenegraph/scenegraph.d.ts +1 -1
  72. package/cjs/scenegraph/scenegraph.js +4 -3
  73. package/cjs/scenegraph/scenegraph.js.map +1 -1
  74. package/cjs/scenegraph/select/update-select-border.d.ts +1 -3
  75. package/cjs/scenegraph/select/update-select-border.js +4 -21
  76. package/cjs/scenegraph/select/update-select-border.js.map +1 -1
  77. package/cjs/scenegraph/utils/get-cell-merge.js.map +1 -1
  78. package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  79. package/cjs/state/cell-move/adjust-header.js +3 -4
  80. package/cjs/state/cell-move/adjust-header.js.map +1 -1
  81. package/cjs/state/cell-move/index.js +15 -10
  82. package/cjs/state/cell-move/index.js.map +1 -1
  83. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  84. package/cjs/state/resize/update-resize-column.js.map +1 -1
  85. package/cjs/state/select/update-position.js +33 -6
  86. package/cjs/state/select/update-position.js.map +1 -1
  87. package/cjs/state/state.js +2 -1
  88. package/cjs/state/state.js.map +1 -1
  89. package/cjs/themes/component.js +1 -1
  90. package/cjs/ts-types/base-table.d.ts +15 -6
  91. package/cjs/ts-types/base-table.js.map +1 -1
  92. package/cjs/ts-types/icon.d.ts +4 -2
  93. package/cjs/ts-types/icon.js +3 -2
  94. package/cjs/ts-types/icon.js.map +1 -1
  95. package/cjs/ts-types/list-table/layout-map/api.d.ts +17 -3
  96. package/cjs/ts-types/list-table/layout-map/api.js.map +1 -1
  97. package/cjs/ts-types/new-data-set.d.ts +1 -2
  98. package/cjs/ts-types/new-data-set.js.map +1 -1
  99. package/cjs/ts-types/pivot-table/title.d.ts +5 -5
  100. package/cjs/ts-types/pivot-table/title.js.map +1 -1
  101. package/cjs/ts-types/table-engine.d.ts +30 -3
  102. package/cjs/ts-types/table-engine.js.map +1 -1
  103. package/cjs/vrender.js.map +1 -1
  104. package/dist/vtable.js +1042 -296
  105. package/dist/vtable.min.js +2 -2
  106. package/es/ListTable.d.ts +2 -4
  107. package/es/ListTable.js +37 -28
  108. package/es/ListTable.js.map +1 -1
  109. package/es/PivotChart.d.ts +1 -0
  110. package/es/PivotChart.js +1 -0
  111. package/es/PivotChart.js.map +1 -1
  112. package/es/PivotTable.d.ts +1 -0
  113. package/es/PivotTable.js +13 -4
  114. package/es/PivotTable.js.map +1 -1
  115. package/es/components/menu/dom/MenuHandler.js.map +1 -1
  116. package/es/core/BaseTable.d.ts +14 -9
  117. package/es/core/BaseTable.js +46 -34
  118. package/es/core/BaseTable.js.map +1 -1
  119. package/es/core/row-series-number-helper.d.ts +8 -0
  120. package/es/core/row-series-number-helper.js +14 -0
  121. package/es/core/row-series-number-helper.js.map +1 -0
  122. package/es/core/style.js +2 -1
  123. package/es/core/tableHelper.js +1 -1
  124. package/es/core/tableHelper.js.map +1 -1
  125. package/es/data/CachedDataSource.d.ts +2 -2
  126. package/es/data/CachedDataSource.js +5 -5
  127. package/es/data/CachedDataSource.js.map +1 -1
  128. package/es/data/DataSource.d.ts +6 -2
  129. package/es/data/DataSource.js +113 -41
  130. package/es/data/DataSource.js.map +1 -1
  131. package/es/event/event.js.map +1 -1
  132. package/es/event/listener/table-group.js +3 -2
  133. package/es/event/listener/table-group.js.map +1 -1
  134. package/es/event/media-click.js +1 -2
  135. package/es/event/media-click.js.map +1 -1
  136. package/es/event/scroll.js +2 -1
  137. package/es/header-helper/header-helper.js.map +1 -1
  138. package/es/icons.js +14 -0
  139. package/es/icons.js.map +1 -1
  140. package/es/index.d.ts +1 -1
  141. package/es/index.js +1 -1
  142. package/es/index.js.map +1 -1
  143. package/es/layout/layout-helper.d.ts +1 -0
  144. package/es/layout/layout-helper.js +10 -0
  145. package/es/layout/layout-helper.js.map +1 -1
  146. package/es/layout/pivot-header-layout.d.ts +16 -5
  147. package/es/layout/pivot-header-layout.js +102 -46
  148. package/es/layout/pivot-header-layout.js.map +1 -1
  149. package/es/layout/simple-header-layout.d.ts +17 -4
  150. package/es/layout/simple-header-layout.js +170 -61
  151. package/es/layout/simple-header-layout.js.map +1 -1
  152. package/es/plugins/themes.js +1 -2
  153. package/es/scenegraph/component/cell-mover.js +1 -1
  154. package/es/scenegraph/component/cell-mover.js.map +1 -1
  155. package/es/scenegraph/component/custom.js +1 -1
  156. package/es/scenegraph/component/custom.js.map +1 -1
  157. package/es/scenegraph/component/menu.js.map +1 -1
  158. package/es/scenegraph/group-creater/cell-helper.d.ts +0 -1
  159. package/es/scenegraph/group-creater/cell-helper.js +26 -14
  160. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  161. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  162. package/es/scenegraph/group-creater/column-helper.js +5 -6
  163. package/es/scenegraph/group-creater/column-helper.js.map +1 -1
  164. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js +6 -2
  165. package/es/scenegraph/group-creater/progress/create-group-for-first-screen.js.map +1 -1
  166. package/es/scenegraph/group-creater/progress/proxy.js +1 -1
  167. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  168. package/es/scenegraph/layout/compute-col-width.js +3 -3
  169. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  170. package/es/scenegraph/layout/compute-row-height.js +3 -3
  171. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  172. package/es/scenegraph/layout/update-height.js.map +1 -1
  173. package/es/scenegraph/layout/update-row.js +7 -2
  174. package/es/scenegraph/layout/update-row.js.map +1 -1
  175. package/es/scenegraph/layout/update-width.js.map +1 -1
  176. package/es/scenegraph/scenegraph.d.ts +1 -1
  177. package/es/scenegraph/scenegraph.js +4 -3
  178. package/es/scenegraph/scenegraph.js.map +1 -1
  179. package/es/scenegraph/select/update-select-border.d.ts +1 -3
  180. package/es/scenegraph/select/update-select-border.js +2 -18
  181. package/es/scenegraph/select/update-select-border.js.map +1 -1
  182. package/es/scenegraph/utils/get-cell-merge.js.map +1 -1
  183. package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
  184. package/es/state/cell-move/adjust-header.js +3 -4
  185. package/es/state/cell-move/adjust-header.js.map +1 -1
  186. package/es/state/cell-move/index.js +14 -10
  187. package/es/state/cell-move/index.js.map +1 -1
  188. package/es/state/hover/is-cell-hover.js.map +1 -1
  189. package/es/state/resize/update-resize-column.js.map +1 -1
  190. package/es/state/select/update-position.js +33 -6
  191. package/es/state/select/update-position.js.map +1 -1
  192. package/es/state/state.js +2 -1
  193. package/es/state/state.js.map +1 -1
  194. package/es/themes/component.js +1 -1
  195. package/es/ts-types/base-table.d.ts +15 -6
  196. package/es/ts-types/base-table.js.map +1 -1
  197. package/es/ts-types/icon.d.ts +4 -2
  198. package/es/ts-types/icon.js +3 -2
  199. package/es/ts-types/icon.js.map +1 -1
  200. package/es/ts-types/list-table/layout-map/api.d.ts +17 -3
  201. package/es/ts-types/list-table/layout-map/api.js.map +1 -1
  202. package/es/ts-types/new-data-set.d.ts +1 -2
  203. package/es/ts-types/new-data-set.js.map +1 -1
  204. package/es/ts-types/pivot-table/title.d.ts +5 -5
  205. package/es/ts-types/pivot-table/title.js.map +1 -1
  206. package/es/ts-types/table-engine.d.ts +30 -3
  207. package/es/ts-types/table-engine.js.map +1 -1
  208. package/es/vrender.js.map +1 -1
  209. package/package.json +5 -5
package/dist/vtable.js CHANGED
@@ -21572,6 +21572,7 @@
21572
21572
  IconFuncTypeEnum["collapse"] = "collapse";
21573
21573
  IconFuncTypeEnum["drillDown"] = "drillDown";
21574
21574
  IconFuncTypeEnum["drillUp"] = "drillUp";
21575
+ IconFuncTypeEnum["dragReorder"] = "dragReorder";
21575
21576
  })(IconFuncTypeEnum || (IconFuncTypeEnum = {}));
21576
21577
  var InternalIconName;
21577
21578
  (function (InternalIconName) {
@@ -21584,6 +21585,7 @@
21584
21585
  InternalIconName["dropdownIconName"] = "dropdownIcon";
21585
21586
  InternalIconName["expandIconName"] = "expand";
21586
21587
  InternalIconName["collapseIconName"] = "collapse";
21588
+ InternalIconName["dragReorderIconName"] = "dragReorder";
21587
21589
  })(InternalIconName || (InternalIconName = {}));
21588
21590
 
21589
21591
  var index$1 = /*#__PURE__*/Object.freeze({
@@ -33555,12 +33557,12 @@
33555
33557
  static get EVENT_TYPE() {
33556
33558
  return EVENT_TYPE;
33557
33559
  }
33558
- treeDataHierarchyState = new Map();
33560
+ hasHierarchyStateExpand = false;
33559
33561
  beforeChangedRecordsMap = [];
33560
33562
  registedAggregators = {};
33561
33563
  fieldAggregators = [];
33562
33564
  layoutColumnObjects = [];
33563
- constructor(dataSourceObj, dataConfig, pagination, columnObjs, hierarchyExpandLevel) {
33565
+ constructor(dataSourceObj, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel) {
33564
33566
  super();
33565
33567
  this.registerAggregators();
33566
33568
  this.dataSourceObj = dataSourceObj;
@@ -33581,29 +33583,34 @@
33581
33583
  this.hierarchyExpandLevel = hierarchyExpandLevel;
33582
33584
  }
33583
33585
  this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
33584
- this.initTreeHierarchyState();
33586
+ if (rowHierarchyType === 'tree') {
33587
+ this.initTreeHierarchyState();
33588
+ }
33585
33589
  this.updatePagerData();
33586
33590
  }
33587
33591
  initTreeHierarchyState() {
33588
- if (this.hierarchyExpandLevel) {
33589
- this.treeDataHierarchyState = new Map();
33590
- for (let i = 0; i < this._sourceLength; i++) {
33591
- const nodeData = this.getOriginalRecord(i);
33592
- nodeData.children && this.treeDataHierarchyState.set(i, HierarchyState.collapse);
33593
- }
33594
- this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
33595
- if (this.hierarchyExpandLevel > 1) {
33596
- let nodeLength = this._sourceLength;
33597
- for (let i = 0; i < nodeLength; i++) {
33598
- const indexKey = this.currentIndexedData[i];
33599
- const nodeData = this.getOriginalRecord(indexKey);
33600
- if (nodeData.children?.length > 0) {
33601
- this.treeDataHierarchyState.set(Array.isArray(indexKey) ? indexKey.join(',') : indexKey, HierarchyState.expand);
33602
- const childrenLength = this.initChildrenNodeHierarchy(indexKey, this.hierarchyExpandLevel, 2, nodeData);
33603
- i += childrenLength;
33604
- nodeLength += childrenLength;
33605
- }
33592
+ this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
33593
+ let nodeLength = this._sourceLength;
33594
+ for (let i = 0; i < nodeLength; i++) {
33595
+ const indexKey = this.currentIndexedData[i];
33596
+ const nodeData = this.getOriginalRecord(indexKey);
33597
+ if (nodeData.children?.length > 0) {
33598
+ if (this.hierarchyExpandLevel > 1) {
33599
+ !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.expand);
33600
+ }
33601
+ else {
33602
+ !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.collapse);
33606
33603
  }
33604
+ this.hasHierarchyStateExpand = true;
33605
+ if (nodeData.hierarchyState === HierarchyState.collapse) {
33606
+ continue;
33607
+ }
33608
+ const childrenLength = this.initChildrenNodeHierarchy(indexKey, this.hierarchyExpandLevel, 2, nodeData);
33609
+ i += childrenLength;
33610
+ nodeLength += childrenLength;
33611
+ }
33612
+ else if (nodeData.children === true) {
33613
+ !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.collapse);
33607
33614
  }
33608
33615
  }
33609
33616
  }
@@ -33678,25 +33685,29 @@
33678
33685
  }
33679
33686
  }
33680
33687
  initChildrenNodeHierarchy(indexKey, hierarchyExpandLevel, currentLevel, nodeData) {
33681
- if (currentLevel > hierarchyExpandLevel) {
33682
- return 0;
33683
- }
33684
33688
  let childTotalLength = 0;
33685
33689
  const nodeLength = nodeData.children?.length ?? 0;
33686
33690
  for (let j = 0; j < nodeLength; j++) {
33687
- childTotalLength += 1;
33691
+ if (currentLevel <= hierarchyExpandLevel || nodeData.hierarchyState === HierarchyState.expand) {
33692
+ childTotalLength += 1;
33693
+ }
33688
33694
  const childNodeData = nodeData.children[j];
33689
33695
  const childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [indexKey, j];
33690
- this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childTotalLength, 0, childIndexKey);
33696
+ if (currentLevel <= hierarchyExpandLevel || nodeData.hierarchyState === HierarchyState.expand) {
33697
+ this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childTotalLength, 0, childIndexKey);
33698
+ }
33691
33699
  if (childNodeData.children?.length > 0) {
33692
- if (currentLevel < hierarchyExpandLevel) {
33693
- this.treeDataHierarchyState.set(Array.isArray(childIndexKey) ? childIndexKey.join(',') : childIndexKey, HierarchyState.expand);
33700
+ if (currentLevel < hierarchyExpandLevel || childNodeData.hierarchyState === HierarchyState.expand) {
33701
+ !childNodeData.hierarchyState && (childNodeData.hierarchyState = HierarchyState.expand);
33702
+ this.hasHierarchyStateExpand = true;
33694
33703
  }
33695
33704
  else {
33696
- this.treeDataHierarchyState.set(Array.isArray(childIndexKey) ? childIndexKey.join(',') : childIndexKey, HierarchyState.collapse);
33705
+ !childNodeData.hierarchyState && (childNodeData.hierarchyState = HierarchyState.collapse);
33697
33706
  }
33698
33707
  }
33699
- childTotalLength += this.initChildrenNodeHierarchy(childIndexKey, hierarchyExpandLevel, currentLevel + 1, childNodeData);
33708
+ if (childNodeData.hierarchyState === HierarchyState.expand) {
33709
+ childTotalLength += this.initChildrenNodeHierarchy(childIndexKey, hierarchyExpandLevel, currentLevel + 1, childNodeData);
33710
+ }
33700
33711
  }
33701
33712
  return childTotalLength;
33702
33713
  }
@@ -33761,8 +33772,8 @@
33761
33772
  return this.hasOriginalField(_getIndex(this.currentPagerIndexedData, index), field);
33762
33773
  }
33763
33774
  getHierarchyState(index) {
33764
- const indexed = this.getIndexKey(index);
33765
- return this.treeDataHierarchyState.get(Array.isArray(indexed) ? indexed.join(',') : indexed) ?? null;
33775
+ const record = this.getOriginalRecord(this.currentIndexedData[index]);
33776
+ return record?.hierarchyState ?? null;
33766
33777
  }
33767
33778
  toggleHierarchyState(index) {
33768
33779
  const oldIndexedData = this.currentIndexedData.slice(0);
@@ -33771,8 +33782,9 @@
33771
33782
  const data = this.getOriginalRecord(indexed);
33772
33783
  this.clearSortedIndexMap();
33773
33784
  if (state === HierarchyState.collapse) {
33774
- this.treeDataHierarchyState.set(Array.isArray(indexed) ? indexed.join(',') : indexed, HierarchyState.expand);
33785
+ data.hierarchyState = HierarchyState.expand;
33775
33786
  this.pushChildrenNode(indexed, HierarchyState.expand, data);
33787
+ this.hasHierarchyStateExpand = true;
33776
33788
  }
33777
33789
  else if (state === HierarchyState.expand) {
33778
33790
  let childrenLength = 0;
@@ -33784,13 +33796,13 @@
33784
33796
  for (let i = 0; i < nodeData.children.length; i++) {
33785
33797
  childrenLength += 1;
33786
33798
  const childIndex = Array.isArray(indexKey) ? indexKey.concat([i]) : [indexKey, i];
33787
- computeChildrenNodeLength(childIndex, this.treeDataHierarchyState.get(childIndex.join(',')), nodeData.children[i]);
33799
+ computeChildrenNodeLength(childIndex, nodeData.children[i].hierarchyState, nodeData.children[i]);
33788
33800
  }
33789
33801
  }
33790
33802
  };
33791
33803
  computeChildrenNodeLength(indexed, state, data);
33792
33804
  this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexed) + 1, childrenLength);
33793
- this.treeDataHierarchyState.set(Array.isArray(indexed) ? indexed.join(',') : indexed, HierarchyState.collapse);
33805
+ data.hierarchyState = HierarchyState.collapse;
33794
33806
  }
33795
33807
  this.updatePagerData();
33796
33808
  const newDiff = calculateArrayDiff(oldIndexedData, this.currentIndexedData);
@@ -33817,12 +33829,11 @@
33817
33829
  ? indexKey.concat([subNodeSortedIndexArray[i]])
33818
33830
  : [indexKey, subNodeSortedIndexArray[i]];
33819
33831
  this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childrenLength, 0, childIndex);
33820
- const preChildState = this.treeDataHierarchyState.get(childIndex.join(','));
33821
33832
  const childData = this.getOriginalRecord(childIndex);
33822
- if (!preChildState && childData.children) {
33823
- this.treeDataHierarchyState.set(childIndex.join(','), HierarchyState.collapse);
33833
+ if (!nodeData.children[i].hierarchyState && childData.children) {
33834
+ nodeData.children[i].hierarchyState = HierarchyState.collapse;
33824
33835
  }
33825
- childrenLength += this.pushChildrenNode(childIndex, this.treeDataHierarchyState.get(childIndex.join(',')), nodeData.children[subNodeSortedIndexArray[i]]);
33836
+ childrenLength += this.pushChildrenNode(childIndex, nodeData.children[i].hierarchyState, nodeData.children[subNodeSortedIndexArray[i]]);
33826
33837
  }
33827
33838
  }
33828
33839
  return childrenLength;
@@ -33840,20 +33851,11 @@
33840
33851
  if (typeof field === 'string' || typeof field === 'number') {
33841
33852
  const beforeChangedValue = this.beforeChangedRecordsMap[dataIndex][field];
33842
33853
  const record = this.getOriginalRecord(dataIndex);
33843
- let formatValue = value;
33844
33854
  if (typeof beforeChangedValue === 'number' && isAllDigits(value)) {
33845
- formatValue = parseFloat(value);
33846
- }
33847
- if (isPromise(record)) {
33848
- record
33849
- .then(record => {
33850
- record[field] = formatValue;
33851
- })
33852
- .catch((err) => {
33853
- });
33855
+ record[field] = parseFloat(value);
33854
33856
  }
33855
33857
  else {
33856
- record[field] = formatValue;
33858
+ record[field] = value;
33857
33859
  }
33858
33860
  }
33859
33861
  }
@@ -34038,7 +34040,8 @@
34038
34040
  let nodeLength = sortedIndexArray.length;
34039
34041
  window.performance.now();
34040
34042
  for (let i = 0; i < nodeLength; i++) {
34041
- const subNodeLength = this.pushChildrenNode(sortedIndexArray[i], this.treeDataHierarchyState.get(sortedIndexArray[i]), this.getOriginalRecord(sortedIndexArray[i]));
34043
+ const record = this.getOriginalRecord(sortedIndexArray[i]);
34044
+ const subNodeLength = this.pushChildrenNode(sortedIndexArray[i], record.hierarchyState, this.getOriginalRecord(sortedIndexArray[i]));
34042
34045
  nodeLength += subNodeLength;
34043
34046
  i += subNodeLength;
34044
34047
  }
@@ -34206,6 +34209,155 @@
34206
34209
  },
34207
34210
  length: 0
34208
34211
  });
34212
+ isCanExchangeOrder(sourceIndex, targetIndex) {
34213
+ if (this.hasHierarchyStateExpand) {
34214
+ let sourceIndexs = this.currentPagerIndexedData[sourceIndex];
34215
+ let targetIndexs = this.currentPagerIndexedData[targetIndex];
34216
+ if (Array.isArray(sourceIndexs)) {
34217
+ sourceIndexs = [...sourceIndexs];
34218
+ }
34219
+ else {
34220
+ sourceIndexs = [sourceIndexs];
34221
+ }
34222
+ if (Array.isArray(targetIndexs)) {
34223
+ targetIndexs = [...targetIndexs];
34224
+ }
34225
+ else {
34226
+ targetIndexs = [targetIndexs];
34227
+ }
34228
+ if (targetIndex > sourceIndex) {
34229
+ if (targetIndexs.length > sourceIndexs.length) {
34230
+ let targetNextIndexs = this.currentPagerIndexedData[targetIndex + 1];
34231
+ if (Array.isArray(targetNextIndexs)) {
34232
+ targetNextIndexs = [...targetNextIndexs];
34233
+ }
34234
+ else {
34235
+ targetNextIndexs = [targetNextIndexs];
34236
+ }
34237
+ if (targetNextIndexs.length < targetIndexs.length) {
34238
+ targetIndexs.splice(targetIndexs.length - 1, 1);
34239
+ }
34240
+ }
34241
+ }
34242
+ if (sourceIndexs.length === targetIndexs.length) {
34243
+ for (let i = 0; i <= sourceIndexs.length - 2; i++) {
34244
+ if (sourceIndexs[i] !== targetIndexs[i]) {
34245
+ return false;
34246
+ }
34247
+ }
34248
+ return true;
34249
+ }
34250
+ return false;
34251
+ }
34252
+ return true;
34253
+ }
34254
+ reorderRecord(sourceIndex, targetIndex) {
34255
+ if (this.lastOrder === 'asc' || this.lastOrder === 'desc') {
34256
+ return;
34257
+ }
34258
+ else if (this.isCanExchangeOrder(sourceIndex, targetIndex)) {
34259
+ if (this.hasHierarchyStateExpand) {
34260
+ let sourceIndexs = this.currentPagerIndexedData[sourceIndex];
34261
+ let targetIndexs = this.currentPagerIndexedData[targetIndex];
34262
+ if (Array.isArray(sourceIndexs)) {
34263
+ sourceIndexs = [...sourceIndexs];
34264
+ }
34265
+ else {
34266
+ sourceIndexs = [sourceIndexs];
34267
+ }
34268
+ if (Array.isArray(targetIndexs)) {
34269
+ targetIndexs = [...targetIndexs];
34270
+ }
34271
+ else {
34272
+ targetIndexs = [targetIndexs];
34273
+ }
34274
+ let sourceI;
34275
+ let targetI;
34276
+ if (sourceIndexs.length > 1 || targetIndexs.length > 1) {
34277
+ if (targetIndex > sourceIndex) {
34278
+ if (targetIndexs.length > sourceIndexs.length) {
34279
+ let targetNextIndexs = this.currentPagerIndexedData[targetIndex + 1];
34280
+ if (Array.isArray(targetNextIndexs)) {
34281
+ targetNextIndexs = [...targetNextIndexs];
34282
+ }
34283
+ else {
34284
+ targetNextIndexs = [targetNextIndexs];
34285
+ }
34286
+ if (targetNextIndexs.length < targetIndexs.length) {
34287
+ targetIndexs.splice(targetIndexs.length - 1, 1);
34288
+ }
34289
+ }
34290
+ }
34291
+ sourceI = sourceIndexs.splice(sourceIndexs.length - 1, 1)[0];
34292
+ targetI = targetIndexs.splice(targetIndexs.length - 1, 1)[0];
34293
+ if (sourceIndexs.length >= 1) {
34294
+ const parent = this.getOriginalRecord(sourceIndexs);
34295
+ const sourceIds = parent.children.splice(sourceI, 1);
34296
+ sourceIds.unshift(targetI, 0);
34297
+ Array.prototype.splice.apply(parent.children, sourceIds);
34298
+ }
34299
+ else {
34300
+ const sourceIds = this.source.splice(sourceI, 1);
34301
+ sourceIds.unshift(targetI, 0);
34302
+ Array.prototype.splice.apply(this.source, sourceIds);
34303
+ }
34304
+ }
34305
+ else {
34306
+ sourceI = this.currentPagerIndexedData[sourceIndex];
34307
+ targetI = this.currentPagerIndexedData[targetIndex];
34308
+ const records = this.source.splice(sourceI, 1);
34309
+ records.unshift(targetI, 0);
34310
+ Array.prototype.splice.apply(this.source, records);
34311
+ }
34312
+ this.restoreTreeHierarchyState();
34313
+ this.updatePagerData();
34314
+ }
34315
+ else {
34316
+ const records = this.source.splice(sourceIndex, 1);
34317
+ records.unshift(targetIndex, 0);
34318
+ Array.prototype.splice.apply(this.source, records);
34319
+ }
34320
+ }
34321
+ }
34322
+ restoreTreeHierarchyState() {
34323
+ if (this.hierarchyExpandLevel) {
34324
+ for (let i = 0; i < this._sourceLength; i++) {
34325
+ const nodeData = this.getOriginalRecord(i);
34326
+ nodeData.children && !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.collapse);
34327
+ }
34328
+ this.currentIndexedData = Array.from({ length: this._sourceLength }, (_, i) => i);
34329
+ let nodeLength = this._sourceLength;
34330
+ for (let i = 0; i < nodeLength; i++) {
34331
+ const indexKey = this.currentIndexedData[i];
34332
+ const nodeData = this.getOriginalRecord(indexKey);
34333
+ if (nodeData.children?.length > 0 && nodeData.hierarchyState === HierarchyState.expand) {
34334
+ this.hasHierarchyStateExpand = true;
34335
+ const childrenLength = this.restoreChildrenNodeHierarchy(indexKey, nodeData);
34336
+ i += childrenLength;
34337
+ nodeLength += childrenLength;
34338
+ }
34339
+ else if (nodeData.children === true) {
34340
+ !nodeData.hierarchyState && (nodeData.hierarchyState = HierarchyState.collapse);
34341
+ }
34342
+ }
34343
+ }
34344
+ }
34345
+ restoreChildrenNodeHierarchy(indexKey, nodeData) {
34346
+ let childTotalLength = 0;
34347
+ const nodeLength = nodeData.children?.length ?? 0;
34348
+ for (let j = 0; j < nodeLength; j++) {
34349
+ if (nodeData.hierarchyState === HierarchyState.expand) {
34350
+ childTotalLength += 1;
34351
+ }
34352
+ const childNodeData = nodeData.children[j];
34353
+ const childIndexKey = Array.isArray(indexKey) ? indexKey.concat(j) : [indexKey, j];
34354
+ if (nodeData.hierarchyState === HierarchyState.expand) {
34355
+ this.currentIndexedData.splice(this.currentIndexedData.indexOf(indexKey) + childTotalLength, 0, childIndexKey);
34356
+ }
34357
+ childTotalLength += this.restoreChildrenNodeHierarchy(childIndexKey, childNodeData);
34358
+ }
34359
+ return childTotalLength;
34360
+ }
34209
34361
  }
34210
34362
 
34211
34363
  function _setFieldCache(fCache, index, field, value) {
@@ -34218,7 +34370,7 @@
34218
34370
  static get EVENT_TYPE() {
34219
34371
  return DataSource.EVENT_TYPE;
34220
34372
  }
34221
- static ofArray(array, dataConfig, pagination, columnObjs, hierarchyExpandLevel) {
34373
+ static ofArray(array, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel) {
34222
34374
  return new CachedDataSource({
34223
34375
  get: (index) => {
34224
34376
  if (Array.isArray(index)) {
@@ -34228,10 +34380,10 @@
34228
34380
  },
34229
34381
  length: array.length,
34230
34382
  source: array
34231
- }, dataConfig, pagination, columnObjs, hierarchyExpandLevel);
34383
+ }, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel);
34232
34384
  }
34233
- constructor(opt, dataConfig, pagination, columnObjs, hierarchyExpandLevel) {
34234
- super(opt, dataConfig, pagination, columnObjs, hierarchyExpandLevel);
34385
+ constructor(opt, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel) {
34386
+ super(opt, dataConfig, pagination, columnObjs, rowHierarchyType, hierarchyExpandLevel);
34235
34387
  this._recordCache = {};
34236
34388
  this._fieldCache = {};
34237
34389
  }
@@ -34751,7 +34903,7 @@
34751
34903
  _dealWithUpdateDataSource(table, () => {
34752
34904
  const data = records;
34753
34905
  table.internalProps.records = records;
34754
- const newDataSource = (table.internalProps.dataSource = CachedDataSource.ofArray(data, table.internalProps.dataConfig, table.pagination, table.internalProps.layoutMap.columnObjects, table.options.hierarchyExpandLevel ?? (table._hasHierarchyTreeHeader?.() ? 1 : undefined)));
34906
+ const newDataSource = (table.internalProps.dataSource = CachedDataSource.ofArray(data, table.internalProps.dataConfig, table.pagination, table.internalProps.layoutMap.columnObjects, table.internalProps.layoutMap.rowHierarchyType, table.options.hierarchyExpandLevel ?? (table._hasHierarchyTreeHeader?.() ? 1 : undefined)));
34755
34907
  table.addReleaseObj(newDataSource);
34756
34908
  });
34757
34909
  }
@@ -35323,9 +35475,7 @@
35323
35475
  });
35324
35476
  }
35325
35477
  function decodeReactDom(dom) {
35326
- if (!dom ||
35327
- (!isValid$3(dom.$$typeof) &&
35328
- !isValid$3(dom.vtype))) {
35478
+ if (!dom || !dom.$$typeof) {
35329
35479
  return dom;
35330
35480
  }
35331
35481
  const type = dom.type;
@@ -35653,6 +35803,20 @@
35653
35803
  height: 13,
35654
35804
  cursor: 'pointer'
35655
35805
  };
35806
+ },
35807
+ get dragReorder() {
35808
+ return {
35809
+ type: 'svg',
35810
+ svg: '<svg t="1710129136961" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5166" width="200" height="200"><path d="M362.666667 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5167"></path><path d="M661.333333 192m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5168"></path><path d="M362.666667 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5169"></path><path d="M661.333333 512m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5170"></path><path d="M362.666667 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5171"></path><path d="M661.333333 832m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#666666" p-id="5172"></path></svg>',
35811
+ width: 20,
35812
+ height: 20,
35813
+ funcType: IconFuncTypeEnum.dragReorder,
35814
+ positionType: IconPosition.left,
35815
+ name: 'dragReorder',
35816
+ marginLeft: -10,
35817
+ marginRight: 10,
35818
+ cursor: 'grab'
35819
+ };
35656
35820
  }
35657
35821
  };
35658
35822
  function get$2() {
@@ -38183,6 +38347,16 @@
38183
38347
  if (isPromise(value)) {
38184
38348
  value = table.getCellValue(col, row);
38185
38349
  }
38350
+ let bgColorFunc;
38351
+ if (table.internalProps?.dataConfig?.mappingRules && !table.isHeader(col, row)) {
38352
+ table.internalProps?.dataConfig?.mappingRules?.forEach((mappingRule, i) => {
38353
+ if (mappingRule.bgColor &&
38354
+ table.internalProps.layoutMap.getIndicatorKey(col, row) ===
38355
+ mappingRule.bgColor.indicatorKey) {
38356
+ bgColorFunc = mappingRule.bgColor.mapping;
38357
+ }
38358
+ });
38359
+ }
38186
38360
  let cellGroup;
38187
38361
  if (type === 'text' || type === 'link') {
38188
38362
  if (type === 'link') {
@@ -38208,6 +38382,22 @@
38208
38382
  }
38209
38383
  }
38210
38384
  }
38385
+ if (bgColorFunc) {
38386
+ const cellValue = table.getCellOriginValue(col, row);
38387
+ const bgColor = bgColorFunc(table, cellValue);
38388
+ if (bgColor) {
38389
+ if (cellTheme) {
38390
+ cellTheme.group.fill = bgColor;
38391
+ }
38392
+ else {
38393
+ cellTheme = {
38394
+ group: {
38395
+ fill: bgColor
38396
+ }
38397
+ };
38398
+ }
38399
+ }
38400
+ }
38211
38401
  let customElementsGroup;
38212
38402
  let renderDefault = true;
38213
38403
  if (customResult) {
@@ -38404,11 +38594,23 @@
38404
38594
  const type = table.isHeader(col, row)
38405
38595
  ? table._getHeaderLayoutMap(col, row).headerType
38406
38596
  : table.getBodyColumnType(col, row);
38407
- const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;
38597
+ const mayHaveIcon = cellLocation !== 'body'
38598
+ ? true
38599
+ : define?.dragOrder || !!define?.icon || !!define?.tree;
38408
38600
  const padding = cellTheme._vtable.padding;
38409
38601
  const textAlign = cellTheme.text.textAlign;
38410
38602
  const textBaseline = cellTheme.text.textBaseline;
38411
38603
  let newCellGroup;
38604
+ let bgColorFunc;
38605
+ if (table.internalProps?.dataConfig?.mappingRules && !table.isHeader(col, row)) {
38606
+ table.internalProps?.dataConfig?.mappingRules?.forEach((mappingRule, i) => {
38607
+ if (mappingRule.bgColor &&
38608
+ table.internalProps.layoutMap.getIndicatorKey(col, row) ===
38609
+ mappingRule.bgColor.indicatorKey) {
38610
+ bgColorFunc = mappingRule.bgColor.mapping;
38611
+ }
38612
+ });
38613
+ }
38412
38614
  let cellWidth;
38413
38615
  let cellHeight;
38414
38616
  if (range) {
@@ -38421,10 +38623,10 @@
38421
38623
  }
38422
38624
  if (isPromise(value)) {
38423
38625
  oldCellGroup.removeAllChild();
38424
- dealPromiseData(value, table, updateCellContent.bind(null, type, value, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult));
38626
+ dealPromiseData(value, table, updateCellContent.bind(null, type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult));
38425
38627
  }
38426
38628
  else {
38427
- newCellGroup = updateCellContent(type, value, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult);
38629
+ newCellGroup = updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult);
38428
38630
  }
38429
38631
  if (isMerge) {
38430
38632
  const { width: contentWidth } = newCellGroup.attribute;
@@ -38435,7 +38637,7 @@
38435
38637
  }
38436
38638
  return newCellGroup;
38437
38639
  }
38438
- function updateCellContent(type, value, define, table, col, row, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult) {
38640
+ function updateCellContent(type, value, define, table, col, row, bgColorFunc, cellWidth, cellHeight, oldCellGroup, padding, textAlign, textBaseline, mayHaveIcon, addNew, cellTheme, range, customResult) {
38439
38641
  if (isPromise(value)) {
38440
38642
  value = table.getCellValue(col, row);
38441
38643
  }
@@ -38454,7 +38656,7 @@
38454
38656
  }
38455
38657
  function canUseFastUpdate(col, row, oldCellGroup, autoWrapText, table) {
38456
38658
  const define = table.getBodyColumnDefine(col, row);
38457
- const mayHaveIcon = !!define?.icon || !!define?.tree;
38659
+ const mayHaveIcon = !!define?.icon || !!define?.tree || define?.dragOrder;
38458
38660
  const cellType = table.getBodyColumnType(col, row);
38459
38661
  const autoRowHeight = table.heightMode === 'autoHeight';
38460
38662
  const value = table.getCellValue(col, row);
@@ -38474,10 +38676,10 @@
38474
38676
  for (let col = range.start.col; col <= range.end.col; col++) {
38475
38677
  for (let row = range.start.row; row <= range.end.row; row++) {
38476
38678
  const cellGroup = table.scenegraph.getCell(col, row, true);
38477
- if (cellGroup.role === 'cell' && range.start.row !== range.end.row && cellGroup.contentWidth !== cellWidth) {
38679
+ if (range.start.row !== range.end.row) {
38478
38680
  updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.heightMode === 'autoHeight', padding, textAlign, textBaseline);
38479
38681
  }
38480
- if (cellGroup.role === 'cell' && range.start.col !== range.end.col && cellGroup.contentHeight !== cellHeight) {
38682
+ if (range.start.col !== range.end.col) {
38481
38683
  updateCellContentWidth(cellGroup, cellWidth, cellHeight, 0, table.heightMode === 'autoHeight', padding, textAlign, textBaseline, table.scenegraph);
38482
38684
  }
38483
38685
  cellGroup.contentWidth = cellWidth;
@@ -39779,7 +39981,11 @@
39779
39981
  const cellType = table.isHeader(col, row)
39780
39982
  ? table._getHeaderLayoutMap(col, row)?.headerType
39781
39983
  : table.getBodyColumnType(col, row);
39782
- if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {
39984
+ if (isValid$3(cellType) &&
39985
+ cellType !== 'text' &&
39986
+ cellType !== 'link' &&
39987
+ cellType !== 'progressbar' &&
39988
+ cellType !== 'checkbox') {
39783
39989
  const defaultHeight = table.getDefaultRowHeight(row);
39784
39990
  maxHeight = Math.max(maxHeight, isNumber$4(defaultHeight) ? defaultHeight : table.defaultRowHeight);
39785
39991
  continue;
@@ -39944,7 +40150,7 @@
39944
40150
  }
39945
40151
  else {
39946
40152
  const define = table.getBodyColumnDefine(col, row);
39947
- mayHaveIcon = !!define?.icon || !!define?.tree;
40153
+ mayHaveIcon = !!define?.icon || !!define?.tree || define?.dragOrder;
39948
40154
  }
39949
40155
  if (mayHaveIcon) {
39950
40156
  const icons = table.getCellIcons(col, row);
@@ -40825,9 +41031,9 @@
40825
41031
  menuInfo = contextmenu;
40826
41032
  }
40827
41033
  else if (typeof contextmenu === 'function') {
40828
- const { field } = this._table.isHeader(col, row)
41034
+ const { field } = (this._table.isHeader(col, row)
40829
41035
  ? this._table.getHeaderDefine(col, row)
40830
- : this._table.getBodyColumnDefine(col, row);
41036
+ : this._table.getBodyColumnDefine(col, row));
40831
41037
  menuInfo = contextmenu(field, row, col);
40832
41038
  }
40833
41039
  return {
@@ -41003,7 +41209,8 @@
41003
41209
  linePoints.push({ x: 0, y: 0 });
41004
41210
  linePoints.push({ x: 0, y: this.table.tableNoFrameHeight });
41005
41211
  }
41006
- else if (cellLocation === 'rowHeader') {
41212
+ else if (cellLocation === 'rowHeader' ||
41213
+ this.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) {
41007
41214
  rectY = this.table.getRowsHeight(0, row - 1) - this.table.stateManager.scroll.verticalBarPos;
41008
41215
  rectX = this.table.getColsWidth(0, this.table.frozenColCount - 1);
41009
41216
  rectWidth = this.table.tableNoFrameWidth;
@@ -43296,7 +43503,11 @@
43296
43503
  const cellType = table.isHeader(col, row)
43297
43504
  ? table._getHeaderLayoutMap(col, row)?.headerType
43298
43505
  : table.getBodyColumnType(col, row);
43299
- if (cellType !== 'text' && cellType !== 'link' && cellType !== 'progressbar' && cellType !== 'checkbox') {
43506
+ if (isValid$3(cellType) &&
43507
+ cellType !== 'text' &&
43508
+ cellType !== 'link' &&
43509
+ cellType !== 'progressbar' &&
43510
+ cellType !== 'checkbox') {
43300
43511
  maxWidth = Math.max(maxWidth, table.getColWidthDefinedNumber(col) || 0);
43301
43512
  continue;
43302
43513
  }
@@ -43308,7 +43519,8 @@
43308
43519
  continue;
43309
43520
  }
43310
43521
  if (hd?.hierarchyLevel) {
43311
- cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * (layoutMap.rowHierarchyIndent ?? 0);
43522
+ cellHierarchyIndent =
43523
+ (hd.hierarchyLevel ?? 0) * (layoutMap.rowHierarchyIndent ?? 0);
43312
43524
  }
43313
43525
  }
43314
43526
  else {
@@ -43411,7 +43623,7 @@
43411
43623
  }
43412
43624
  else {
43413
43625
  const define = table.getBodyColumnDefine(col, row);
43414
- mayHaveIcon = !!define?.icon || !!define?.tree;
43626
+ mayHaveIcon = !!define?.icon || !!define?.tree || define?.dragOrder;
43415
43627
  }
43416
43628
  if (mayHaveIcon) {
43417
43629
  const icons = table.getCellIcons(col, row);
@@ -43579,7 +43791,9 @@
43579
43791
  const define = cellLocation !== 'body'
43580
43792
  ? table.getHeaderDefine(colForDefine, rowForDefine)
43581
43793
  : table.getBodyColumnDefine(colForDefine, rowForDefine);
43582
- const mayHaveIcon = cellLocation !== 'body' ? true : !!define?.icon || !!define?.tree;
43794
+ const mayHaveIcon = cellLocation !== 'body'
43795
+ ? true
43796
+ : define?.dragOrder || !!define?.icon || !!define?.tree;
43583
43797
  if (!range && (cellLocation !== 'body' || define?.mergeCell)) {
43584
43798
  range = table.getCellRange(col, row);
43585
43799
  isMerge = range.start.col !== range.end.col || range.start.row !== range.end.row;
@@ -43607,8 +43821,9 @@
43607
43821
  if (cellLocation !== 'body' && !cellTheme.group.fill) {
43608
43822
  cellTheme.group.fill = '#fff';
43609
43823
  }
43610
- const type = (table.isHeader(col, row) ? table._getHeaderLayoutMap(col, row).headerType : table.getBodyColumnType(col, row)) ||
43611
- 'text';
43824
+ const type = (table.isHeader(col, row)
43825
+ ? table._getHeaderLayoutMap(col, row).headerType
43826
+ : table.getBodyColumnType(col, row)) || 'text';
43612
43827
  if (isPromise(value)) {
43613
43828
  dealPromiseData(value, table, createCell.bind(null, type, value, define, table, col, row, colWidth, cellWidth, cellHeight, columnGroup, y, padding, textAlign, textBaseline, mayHaveIcon, cellTheme, range, customResult));
43614
43829
  columnGroup.updateColumnRowNumber(row);
@@ -43621,12 +43836,12 @@
43621
43836
  columnGroup.updateColumnRowNumber(row);
43622
43837
  if (isMerge) {
43623
43838
  const rangeHeight = table.getRowHeight(row);
43624
- table.getColWidth(col);
43839
+ const rangeWidth = table.getColWidth(col);
43625
43840
  const { width: contentWidth } = cellGroup.attribute;
43626
43841
  const { height: contentHeight } = cellGroup.attribute;
43627
43842
  cellGroup.contentWidth = contentWidth;
43628
43843
  cellGroup.contentHeight = contentHeight;
43629
- dealWithMergeCellSize(range, contentWidth, contentHeight, padding, textAlign, textBaseline, table);
43844
+ resizeCellGroup(cellGroup, rangeWidth, rangeHeight, range, table);
43630
43845
  columnGroup.updateColumnHeight(rangeHeight);
43631
43846
  y += rangeHeight;
43632
43847
  }
@@ -43740,9 +43955,29 @@
43740
43955
  createColGroup(cornerHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, 0, table.columnHeaderLevelCount - 1, table.isListTable() ? 'columnHeader' : 'cornerHeader', table);
43741
43956
  distCol - table.rightFrozenColCount >= table.frozenColCount &&
43742
43957
  createColGroup(colHeaderGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, 0, table.columnHeaderLevelCount - 1, 'columnHeader', table);
43743
- createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.columnHeaderLevelCount, distRow - table.bottomFrozenRowCount, table.isListTable() && !table.internalProps.transpose ? 'body' : 'rowHeader', table);
43958
+ if (table.frozenColCount > 0) {
43959
+ if (table.leftRowSeriesNumberCount > 0) {
43960
+ createColGroup(rowHeaderGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.columnHeaderLevelCount, distRow - table.bottomFrozenRowCount, 'rowHeader', table);
43961
+ }
43962
+ if (table.rowHeaderLevelCount > 0) {
43963
+ createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.leftRowSeriesNumberCount, table.leftRowSeriesNumberCount + table.rowHeaderLevelCount - 1, table.columnHeaderLevelCount, distRow - table.bottomFrozenRowCount, 'rowHeader', table);
43964
+ }
43965
+ if (table.frozenColCount > table.rowHeaderLevelCount + table.leftRowSeriesNumberCount) {
43966
+ createColGroup(rowHeaderGroup, xOrigin, yOrigin, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.frozenColCount - 1, table.columnHeaderLevelCount, distRow - table.bottomFrozenRowCount, 'body', table);
43967
+ }
43968
+ }
43744
43969
  if (table.bottomFrozenRowCount > 0) {
43745
- createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, table.frozenColCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isListTable() ? (table.transpose ? 'rowHeader' : 'body') : 'rowHeader', table);
43970
+ if (table.frozenColCount > 0) {
43971
+ if (table.leftRowSeriesNumberCount > 0) {
43972
+ createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, 0, table.leftRowSeriesNumberCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, 'rowHeader', table);
43973
+ }
43974
+ if (table.rowHeaderLevelCount > 0) {
43975
+ createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, table.leftRowSeriesNumberCount, table.leftRowSeriesNumberCount + table.rowHeaderLevelCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, 'rowHeader', table);
43976
+ }
43977
+ if (table.frozenColCount > table.rowHeaderLevelCount + table.leftRowSeriesNumberCount) {
43978
+ createColGroup(leftBottomCornerGroup, xOrigin, yOrigin, table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, table.frozenColCount - 1, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, 'body', table);
43979
+ }
43980
+ }
43746
43981
  distCol - table.rightFrozenColCount >= table.frozenColCount &&
43747
43982
  createColGroup(bottomFrozenGroup, xOrigin, yOrigin, table.frozenColCount, distCol - table.rightFrozenColCount, table.rowCount - 1 - table.bottomFrozenRowCount + 1, table.rowCount - 1, table.isPivotChart() ? 'rowHeader' : 'body', table);
43748
43983
  }
@@ -44642,7 +44877,7 @@
44642
44877
  computeColsWidth(this.table, this.currentCol + 1, endCol);
44643
44878
  for (let row = 0; row < this.table.rowCount; row++) {
44644
44879
  const cellGroup = this.highPerformanceGetCell(this.currentCol, row);
44645
- if (cellGroup.role === 'cell' && isNumber$4(cellGroup.mergeStartCol) && cellGroup.mergeStartCol > this.currentCol) {
44880
+ if (isNumber$4(cellGroup.mergeStartCol) && cellGroup.mergeStartCol > this.currentCol) {
44646
44881
  this.table.scenegraph.updateCellContent(cellGroup.col, cellGroup.row);
44647
44882
  }
44648
44883
  }
@@ -45203,7 +45438,7 @@
45203
45438
  });
45204
45439
  }
45205
45440
  }
45206
- function updateCellSelectBorder(scene, newStartCol, newStartRow, newEndCol, newEndRow) {
45441
+ function updateCellSelectBorder(scene, newStartCol, newStartRow, newEndCol, newEndRow, ifExtendSelectRange = true) {
45207
45442
  let startCol = Math.max(Math.min(newEndCol, newStartCol), 0);
45208
45443
  let startRow = Math.max(Math.min(newEndRow, newStartRow), 0);
45209
45444
  let endCol = Math.min(Math.max(newEndCol, newStartCol), scene.table.colCount - 1);
@@ -45266,7 +45501,7 @@
45266
45501
  extendSelectRange();
45267
45502
  }
45268
45503
  };
45269
- extendSelectRange();
45504
+ ifExtendSelectRange && extendSelectRange();
45270
45505
  scene.selectingRangeComponents.forEach((selectComp, key) => {
45271
45506
  selectComp.rect.delete();
45272
45507
  });
@@ -45380,22 +45615,6 @@
45380
45615
  scene.createCellSelectBorder(columnHeaderStartCol, columnHeaderStartRow, columnHeaderEndCol, columnHeaderEndRow, 'body', `${startCol}${startRow}${endCol}${endRow}`, strokeArray);
45381
45616
  }
45382
45617
  }
45383
- function hideCellSelectBorder(scene) {
45384
- scene.selectingRangeComponents.forEach((selectComp, key) => {
45385
- selectComp.rect.setAttribute('visible', false);
45386
- });
45387
- scene.selectedRangeComponents.forEach((selectComp, key) => {
45388
- selectComp.rect.setAttribute('visible', false);
45389
- });
45390
- }
45391
- function restoreCellSelectBorder(scene) {
45392
- scene.selectingRangeComponents.forEach((selectComp, key) => {
45393
- selectComp.rect.setAttribute('visible', false);
45394
- });
45395
- scene.selectedRangeComponents.forEach((selectComp, key) => {
45396
- selectComp.rect.setAttribute('visible', false);
45397
- });
45398
- }
45399
45618
 
45400
45619
  function createCellSelectBorder(scene, start_Col, start_Row, end_Col, end_Row, selectRangeType, selectId, strokes) {
45401
45620
  const startCol = Math.min(start_Col, end_Col);
@@ -45546,6 +45765,7 @@
45546
45765
  updateBottomFrozeCellGroups();
45547
45766
  }
45548
45767
  else if (removeRows.length) {
45768
+ setRowSeriesNumberCellNeedUpdate(removeRows[removeRows.length - 1], scene);
45549
45769
  scene.proxy.updateCellGroups(scene.proxy.screenRowCount * 2);
45550
45770
  updateBottomFrozeCellGroups();
45551
45771
  scene.proxy.progress();
@@ -45824,6 +46044,13 @@
45824
46044
  }
45825
46045
  }
45826
46046
  }
46047
+ function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
46048
+ if (scene.table.isHasSeriesNumber()) {
46049
+ for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) {
46050
+ updateCell$1(0, row, scene.table, false);
46051
+ }
46052
+ }
46053
+ }
45827
46054
 
45828
46055
  function handleTextStick(table) {
45829
46056
  const { changedCells } = table.internalProps.stick;
@@ -47633,8 +47860,8 @@
47633
47860
  deleteAllSelectBorder() {
47634
47861
  deleteAllSelectBorder(this);
47635
47862
  }
47636
- updateCellSelectBorder(newStartCol, newStartRow, newEndCol, newEndRow) {
47637
- updateCellSelectBorder(this, newStartCol, newStartRow, newEndCol, newEndRow);
47863
+ updateCellSelectBorder(newStartCol, newStartRow, newEndCol, newEndRow, extendSelectRange = true) {
47864
+ updateCellSelectBorder(this, newStartCol, newStartRow, newEndCol, newEndRow, extendSelectRange);
47638
47865
  }
47639
47866
  recreateAllSelectRangeComponents() {
47640
47867
  deleteAllSelectBorder(this);
@@ -48754,7 +48981,7 @@
48754
48981
  end: { col: table.colCount - 1, row: table.rowCount - 1 }
48755
48982
  });
48756
48983
  const currentRange = state.select.ranges[state.select.ranges.length - 1];
48757
- scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, currentRange.end.col, currentRange.end.row);
48984
+ scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, currentRange.end.col, currentRange.end.row, false);
48758
48985
  }
48759
48986
  else if (cellPos.col !== -1 && cellPos.row !== -1 && (col === -1 || row === -1)) {
48760
48987
  cellPos.col = -1;
@@ -48788,6 +49015,7 @@
48788
49015
  scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, currentRange.end.col, currentRange.end.row);
48789
49016
  }
48790
49017
  else {
49018
+ let extendSelectRange = true;
48791
49019
  if (cellPos.col !== -1 && cellPos.row !== -1 && !isCtrl) {
48792
49020
  state.select.ranges = [];
48793
49021
  scenegraph.deleteAllSelectBorder();
@@ -48806,6 +49034,20 @@
48806
49034
  end: { col: table.colCount - 1, row: cellRange.end.row }
48807
49035
  });
48808
49036
  }
49037
+ else if (table.internalProps.layoutMap.isSeriesNumberInHeader(col, row)) {
49038
+ extendSelectRange = false;
49039
+ state.select.ranges.push({
49040
+ start: { col: 0, row: 0 },
49041
+ end: { col: table.colCount - 1, row: table.rowCount - 1 }
49042
+ });
49043
+ }
49044
+ else if (table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) {
49045
+ extendSelectRange = false;
49046
+ state.select.ranges.push({
49047
+ start: { col, row: row },
49048
+ end: { col: table.colCount - 1, row: row }
49049
+ });
49050
+ }
48809
49051
  else if (col >= 0 && row >= 0) {
48810
49052
  const cellRange = table.getCellRange(col, row);
48811
49053
  state.select.ranges.push({
@@ -48817,25 +49059,36 @@
48817
49059
  cellPos.row = row;
48818
49060
  const currentRange = state.select.ranges?.[state.select.ranges.length - 1];
48819
49061
  currentRange &&
48820
- scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, currentRange.end.col, currentRange.end.row);
49062
+ scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, currentRange.end.col, currentRange.end.row, extendSelectRange);
48821
49063
  }
48822
49064
  }
48823
49065
  else if (interactionState === InteractionState.grabing && !table.stateManager.isResizeCol()) {
49066
+ let extendSelectRange = true;
48824
49067
  if (cellPos.col === -1) {
48825
49068
  cellPos.col = col;
48826
49069
  }
48827
49070
  if (cellPos.row === -1) {
48828
49071
  cellPos.row = row;
48829
49072
  }
48830
- const currentRange = state.select.ranges[state.select.ranges.length - 1];
48831
- currentRange &&
48832
- (currentRange.end = {
48833
- col,
48834
- row
48835
- });
48836
49073
  cellPos.col = col;
48837
49074
  cellPos.row = row;
48838
- currentRange && scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, col, row);
49075
+ const currentRange = state.select.ranges[state.select.ranges.length - 1];
49076
+ if (currentRange) {
49077
+ if (table.internalProps.layoutMap.isSeriesNumberInBody(currentRange.start.col, currentRange.start.row)) {
49078
+ extendSelectRange = false;
49079
+ currentRange.end = {
49080
+ col: table.colCount - 1,
49081
+ row
49082
+ };
49083
+ }
49084
+ else {
49085
+ currentRange.end = {
49086
+ col,
49087
+ row
49088
+ };
49089
+ }
49090
+ scenegraph.updateCellSelectBorder(currentRange.start.col, currentRange.start.row, currentRange.end.col, currentRange.end.row, extendSelectRange);
49091
+ }
48839
49092
  }
48840
49093
  scenegraph.updateNextFrame();
48841
49094
  }
@@ -48998,11 +49251,11 @@
48998
49251
  }
48999
49252
  }
49000
49253
  else if (table.isRowHeader(source.col, source.row)) {
49254
+ const layoutMap = table.internalProps.layoutMap;
49001
49255
  const targetCellRange = table.getCellRange(sourceCellRange.start.col, target.row);
49002
- if (target.col >= table.rowHeaderLevelCount) {
49003
- target.col = table.rowHeaderLevelCount - 1;
49256
+ if (target.col >= table.rowHeaderLevelCount + layoutMap.leftRowSeriesNumberColumnCount) {
49257
+ target.col = table.rowHeaderLevelCount + layoutMap.leftRowSeriesNumberColumnCount - 1;
49004
49258
  }
49005
- const layoutMap = table.internalProps.layoutMap;
49006
49259
  if (layoutMap.rowHierarchyType === 'tree') {
49007
49260
  const sourceRowHeaderPaths = layoutMap.getCellHeaderPathsWidthTreeNode(source.col, source.row)
49008
49261
  .rowHeaderPaths;
@@ -49040,7 +49293,12 @@
49040
49293
  state.columnMove.x = x - state.table.tableX;
49041
49294
  state.columnMove.y = y - state.table.tableY;
49042
49295
  const cellLocation = state.table.getCellLocation(col, row);
49043
- const delta = cellLocation === 'columnHeader' ? state.columnMove.x : cellLocation === 'rowHeader' ? state.columnMove.y : 0;
49296
+ const delta = cellLocation === 'columnHeader'
49297
+ ? state.columnMove.x
49298
+ : cellLocation === 'rowHeader' ||
49299
+ state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)
49300
+ ? state.columnMove.y
49301
+ : 0;
49044
49302
  state.table.scenegraph.component.showMoveCol(col, row, delta);
49045
49303
  state.table.stateManager.updateSelectPos(-1, -1);
49046
49304
  state.table.scenegraph.updateNextFrame();
@@ -49085,7 +49343,8 @@
49085
49343
  state.table.stateManager.scroll.horizontalBarPos;
49086
49344
  }
49087
49345
  }
49088
- else if (cellLocation === 'rowHeader') {
49346
+ else if (cellLocation === 'rowHeader' ||
49347
+ state.table.internalProps.layoutMap.isSeriesNumberInBody(col, row)) {
49089
49348
  backY = state.columnMove.y;
49090
49349
  if (state.table.isFrozenRow(row)) {
49091
49350
  lineY =
@@ -49114,26 +49373,45 @@
49114
49373
  state.columnMove.rowSource >= 0 &&
49115
49374
  state.columnMove.colTarget >= 0 &&
49116
49375
  state.columnMove.rowTarget >= 0) {
49117
- const sourceMergeInfo = getCellMergeInfo(state.table, state.columnMove.colSource, state.columnMove.rowSource);
49118
- const targetMergeInfo = getCellMergeInfo(state.table, state.columnMove.colTarget, state.columnMove.rowTarget);
49376
+ const oldSourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource);
49377
+ const oldTargetMergeInfo = state.table.getCellRange(state.columnMove.colTarget, state.columnMove.rowTarget);
49119
49378
  const moveContext = state.table._moveHeaderPosition({ col: state.columnMove.colSource, row: state.columnMove.rowSource }, { col: state.columnMove.colTarget, row: state.columnMove.rowTarget });
49120
49379
  if (moveContext) {
49380
+ state.table.internalProps.layoutMap.clearCellRangeMap();
49381
+ const sourceMergeInfo = state.table.getCellRange(state.columnMove.colSource, state.columnMove.rowSource);
49382
+ const targetMergeInfo = state.table.getCellRange(state.columnMove.colTarget, state.columnMove.rowTarget);
49383
+ const colMin = Math.min(sourceMergeInfo.start.col, targetMergeInfo.start.col, oldSourceMergeInfo.start.col, oldTargetMergeInfo.start.col);
49384
+ const colMax = Math.max(sourceMergeInfo.end.col, targetMergeInfo.end.col, oldSourceMergeInfo.end.col, oldTargetMergeInfo.end.col);
49385
+ const rowMin = Math.min(sourceMergeInfo.start.row, targetMergeInfo.start.row, oldSourceMergeInfo.start.row, oldTargetMergeInfo.start.row);
49386
+ let rowMax = Math.max(sourceMergeInfo.end.row, targetMergeInfo.end.row, oldSourceMergeInfo.end.row, oldTargetMergeInfo.end.row);
49387
+ if (moveContext.moveType === 'row' &&
49388
+ state.table.internalProps.layoutMap.rowHierarchyType === 'tree') {
49389
+ if (moveContext.targetIndex > moveContext.sourceIndex) {
49390
+ rowMax = rowMax + moveContext.targetSize - 1;
49391
+ }
49392
+ else {
49393
+ rowMax = rowMax + moveContext.sourceSize - 1;
49394
+ }
49395
+ }
49396
+ if (!state.table.transpose &&
49397
+ state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource)) {
49398
+ state.table.changeRecordOrder(moveContext.sourceIndex, moveContext.targetIndex);
49399
+ }
49121
49400
  if (moveContext.moveType === 'column') {
49122
- clearWidthsAndHeightsCache(Math.min(sourceMergeInfo?.start?.col ?? state.columnMove.colSource, targetMergeInfo?.start?.col ?? state.columnMove.colTarget), Math.max(sourceMergeInfo?.end?.col ?? state.columnMove.colSource, targetMergeInfo?.end?.col ?? state.columnMove.colTarget), 0, -1, state.table);
49401
+ clearWidthsAndHeightsCache(colMin, colMax, 0, -1, state.table);
49123
49402
  }
49124
49403
  else {
49125
- clearWidthsAndHeightsCache(0, -1, Math.min(sourceMergeInfo?.start?.row ?? state.columnMove.rowSource, targetMergeInfo?.start?.row ?? state.columnMove.rowTarget), Math.max(sourceMergeInfo?.end?.row ?? state.columnMove.rowSource, targetMergeInfo?.end?.row ?? state.columnMove.rowTarget), state.table);
49404
+ clearWidthsAndHeightsCache(0, -1, rowMin, rowMax, state.table);
49126
49405
  }
49127
49406
  state.table.clearCellStyleCache();
49128
- if (moveContext.moveType === 'column') {
49129
- state.table.scenegraph.updateHeaderPosition(Math.min(moveContext.sourceIndex, moveContext.targetIndex), Math.min(moveContext.targetIndex > moveContext.sourceIndex
49130
- ? moveContext.targetIndex + moveContext.sourceSize - 1
49131
- : moveContext.sourceIndex + moveContext.sourceSize - 1, state.table.colCount - 1), 0, -1, moveContext.moveType);
49407
+ if (state.table.internalProps.layoutMap.isSeriesNumberInBody(state.columnMove.colSource, state.columnMove.rowSource)) {
49408
+ state.table.scenegraph.updateHeaderPosition(state.table.scenegraph.proxy.colStart, state.table.scenegraph.proxy.colEnd, state.table.scenegraph.proxy.rowStart, state.table.scenegraph.proxy.rowEnd, moveContext.moveType);
49409
+ }
49410
+ else if (moveContext.moveType === 'column') {
49411
+ state.table.scenegraph.updateHeaderPosition(colMin, colMax, 0, -1, moveContext.moveType);
49132
49412
  }
49133
49413
  else {
49134
- state.table.scenegraph.updateHeaderPosition(0, -1, Math.min(moveContext.sourceIndex, moveContext.targetIndex), Math.min(moveContext.targetIndex > moveContext.sourceIndex
49135
- ? moveContext.targetIndex + moveContext.sourceSize - 1
49136
- : moveContext.sourceIndex + moveContext.sourceSize - 1, state.table.rowCount - 1), moveContext.moveType);
49414
+ state.table.scenegraph.updateHeaderPosition(0, -1, rowMin, rowMax, moveContext.moveType);
49137
49415
  }
49138
49416
  if (state.table.internalProps.frozenColDragHeaderMode === 'adjustFrozenCount' && state.table.isListTable()) {
49139
49417
  if (state.table.isFrozenColumn(state.columnMove.colTarget) &&
@@ -49738,7 +50016,9 @@
49738
50016
  checkFrozen() {
49739
50017
  const originalFrozenColCount = this.table.isListTable() && !this.table.internalProps.transpose
49740
50018
  ? this.table.options.frozenColCount
49741
- : this.table.rowHeaderLevelCount;
50019
+ : this.table.isPivotChart()
50020
+ ? this.table.rowHeaderLevelCount ?? 0
50021
+ : Math.max((this.table.rowHeaderLevelCount ?? 0) + this.table.internalProps.layoutMap.leftRowSeriesNumberColumnCount, this.table.options.frozenColCount ?? 0);
49742
50022
  if (originalFrozenColCount) {
49743
50023
  if (this.table.tableNoFrameWidth - this.table.getColsWidth(0, originalFrozenColCount - 1) <= 120) {
49744
50024
  this.table._setFrozenColCount(0);
@@ -50717,6 +50997,10 @@
50717
50997
  }
50718
50998
  }
50719
50999
  }
51000
+ else if (hitIcon.attribute.funcType === IconFuncTypeEnum.dragReorder) {
51001
+ stateManager.startMoveCol(eventArgsSet.eventArgs.col, eventArgsSet.eventArgs.row, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
51002
+ stateManager.updateInteractionState(InteractionState.grabing);
51003
+ }
50720
51004
  if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_CELL)) {
50721
51005
  const eventArgsSet = getCellEventArgsSet(e);
50722
51006
  if (eventArgsSet.eventArgs) {
@@ -55062,6 +55346,19 @@
55062
55346
  return high < 0 ? 0 : high;
55063
55347
  }
55064
55348
 
55349
+ class RowSeriesNumberHelper {
55350
+ dragReorderIconName;
55351
+ _table;
55352
+ constructor(_table) {
55353
+ this._table = _table;
55354
+ const regedIcons = get$2();
55355
+ this.dragReorderIconName = regedIcons[InternalIconName.dragReorderIconName];
55356
+ }
55357
+ getIcons(col, row) {
55358
+ return [this.dragReorderIconName];
55359
+ }
55360
+ }
55361
+
55065
55362
  class CustomCellStylePlugin {
55066
55363
  table;
55067
55364
  customCellStyle;
@@ -55207,7 +55504,7 @@
55207
55504
  return TABLE_EVENT_TYPE;
55208
55505
  }
55209
55506
  options;
55210
- version = "0.21.4-alpha.4";
55507
+ version = "0.22.0";
55211
55508
  pagination;
55212
55509
  id = `VTable${Date.now()}`;
55213
55510
  headerStyleCache;
@@ -55222,7 +55519,7 @@
55222
55519
  if (!container && options.mode !== 'node') {
55223
55520
  throw new Error("vtable's container is undefined");
55224
55521
  }
55225
- const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, keyboardOptions, eventOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth } = options;
55522
+ const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth } = options;
55226
55523
  this.container = container;
55227
55524
  this.options = options;
55228
55525
  this.options.container = container;
@@ -55274,6 +55571,7 @@
55274
55571
  internalProps.defaultHeaderColWidth = defaultHeaderColWidth ?? defaultColWidth;
55275
55572
  internalProps.keyboardOptions = keyboardOptions;
55276
55573
  internalProps.eventOptions = eventOptions;
55574
+ internalProps.rowSeriesNumber = rowSeriesNumber;
55277
55575
  internalProps.columnResizeMode = columnResizeMode;
55278
55576
  internalProps.dragHeaderMode = dragHeaderMode;
55279
55577
  internalProps.renderChartAsync = renderChartAsync;
@@ -55312,6 +55610,7 @@
55312
55610
  internalProps.theme.isPivot = this.isPivotTable();
55313
55611
  internalProps.bodyHelper = new BodyHelper(this);
55314
55612
  internalProps.headerHelper = new HeaderHelper(this);
55613
+ internalProps.rowSeriesNumberHelper = new RowSeriesNumberHelper(this);
55315
55614
  internalProps.autoWrapText = options.autoWrapText;
55316
55615
  internalProps.allowFrozenColCount = options.allowFrozenColCount ?? 0;
55317
55616
  internalProps.limitMaxAutoWidth = options.limitMaxAutoWidth ?? 450;
@@ -56298,7 +56597,7 @@
56298
56597
  }
56299
56598
  updateOption(options) {
56300
56599
  this.options = options;
56301
- const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, customRender, renderChartAsync, renderChartAsyncBatchCount, overscrollBehavior, limitMinWidth } = options;
56600
+ const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth = 80, keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, pixelRatio, widthMode, heightMode, autoFillWidth, autoFillHeight, customRender, renderChartAsync, renderChartAsyncBatchCount, overscrollBehavior, limitMinWidth } = options;
56302
56601
  if (pixelRatio && pixelRatio !== this.internalProps.pixelRatio) {
56303
56602
  this.internalProps.pixelRatio = pixelRatio;
56304
56603
  }
@@ -56336,6 +56635,7 @@
56336
56635
  internalProps.defaultHeaderColWidth = defaultHeaderColWidth ?? defaultColWidth;
56337
56636
  internalProps.keyboardOptions = keyboardOptions;
56338
56637
  internalProps.eventOptions = eventOptions;
56638
+ internalProps.rowSeriesNumber = rowSeriesNumber;
56339
56639
  internalProps.columnResizeMode = columnResizeMode;
56340
56640
  internalProps.dragHeaderMode = dragHeaderMode;
56341
56641
  internalProps.renderChartAsync = renderChartAsync;
@@ -56689,7 +56989,10 @@
56689
56989
  }
56690
56990
  getCellType(col, row) {
56691
56991
  let cellType;
56692
- if (this.isHeader(col, row)) {
56992
+ if (this.isSeriesNumberInHeader(col, row)) {
56993
+ return this.internalProps.layoutMap.getSeriesNumberHeader(col, row).cellType;
56994
+ }
56995
+ else if (this.isHeader(col, row)) {
56693
56996
  cellType = this.internalProps.layoutMap.getHeader(col, row).headerType;
56694
56997
  }
56695
56998
  else {
@@ -56817,6 +57120,14 @@
56817
57120
  _dropDownMenuIsHighlight(colNow, rowNow, index) {
56818
57121
  return this.stateManager.dropDownMenuIsHighlight(colNow, rowNow, index);
56819
57122
  }
57123
+ isSeriesNumberInBody(col, row) {
57124
+ return (this.internalProps.layoutMap &&
57125
+ this.internalProps.layoutMap.isSeriesNumberInBody(col, row));
57126
+ }
57127
+ isSeriesNumberInHeader(col, row) {
57128
+ return (this.internalProps.layoutMap &&
57129
+ this.internalProps.layoutMap.isSeriesNumberInHeader(col, row));
57130
+ }
56820
57131
  isHeader(col, row) {
56821
57132
  return this.internalProps.layoutMap && this.internalProps.layoutMap.isHeader(col, row);
56822
57133
  }
@@ -56970,19 +57281,12 @@
56970
57281
  }
56971
57282
  return cacheStyle;
56972
57283
  }
56973
- let bgColorFunc;
56974
- if (this.internalProps?.dataConfig?.mappingRules && !this.isHeader(col, row)) {
56975
- this.internalProps?.dataConfig?.mappingRules?.forEach((mappingRule, i) => {
56976
- if (mappingRule.bgColor &&
56977
- this.internalProps.layoutMap.getIndicatorKey(col, row) ===
56978
- mappingRule.bgColor.indicatorKey) {
56979
- bgColorFunc = mappingRule.bgColor.mapping;
56980
- }
56981
- });
56982
- }
56983
57284
  let cacheKey;
56984
57285
  const cellType = this.getCellType(col, row);
56985
- if ((this.isListTable() && !this.transpose) ||
57286
+ if (this.isSeriesNumberInBody(col, row)) {
57287
+ cacheKey = `${col}-series-` + cellType;
57288
+ }
57289
+ else if ((this.isListTable() && !this.transpose) ||
56986
57290
  (this.isPivotTable() && this.internalProps.layoutMap.indicatorsAsCol)) {
56987
57291
  cacheKey = col + cellType;
56988
57292
  }
@@ -57017,9 +57321,6 @@
57017
57321
  dataValue: this.getCellOriginValue(col, row),
57018
57322
  cellHeaderPaths: this.getCellHeaderPaths(col, row)
57019
57323
  }, styleClass, this.options.autoWrapText, this.theme);
57020
- if (bgColorFunc) {
57021
- cacheStyle = mergeStyle(cacheStyle, { bgColor: bgColorFunc });
57022
- }
57023
57324
  if (!isFunction$3(style)) {
57024
57325
  if (layoutMap.isBottomFrozenRow(row)) {
57025
57326
  this.bodyBottomStyleCache.set(cacheKey, cacheStyle);
@@ -57121,6 +57422,23 @@
57121
57422
  if (this.isHeader(col, row)) {
57122
57423
  icons = this.internalProps.headerHelper.getIcons(col, row);
57123
57424
  }
57425
+ else if (this.internalProps.layoutMap.isSeriesNumber(col, row)) {
57426
+ const dragOrder = this.internalProps.layoutMap.getSeriesNumberBody(col, row)?.define
57427
+ ?.dragOrder;
57428
+ if (dragOrder) {
57429
+ icons = this.internalProps.rowSeriesNumberHelper.getIcons(col, row);
57430
+ }
57431
+ const cellValue = this.getCellValue(col, row);
57432
+ const dataValue = this.getCellOriginValue(col, row);
57433
+ const ctx = this.internalProps.context;
57434
+ const cellIcon = this.internalProps.bodyHelper.getIcons(col, row, cellValue, dataValue, ctx);
57435
+ if (icons?.length > 0) {
57436
+ icons = icons.concat();
57437
+ }
57438
+ else if (cellIcon?.length > 0) {
57439
+ icons = cellIcon;
57440
+ }
57441
+ }
57124
57442
  else {
57125
57443
  const cellValue = this.getCellValue(col, row);
57126
57444
  const dataValue = this.getCellOriginValue(col, row);
@@ -57307,7 +57625,7 @@
57307
57625
  const copyCellValue = getCopyCellValue(c, r, range);
57308
57626
  if (typeof Promise !== 'undefined' && copyCellValue instanceof Promise) ;
57309
57627
  else {
57310
- const strCellValue = isValid$3(copyCellValue) ? `${copyCellValue}` : '';
57628
+ const strCellValue = `${copyCellValue}`;
57311
57629
  if (/^\[object .*\]$/.exec(strCellValue)) ;
57312
57630
  else {
57313
57631
  copyValue += strCellValue;
@@ -57481,20 +57799,11 @@
57481
57799
  this.scrollToCell({ col, row });
57482
57800
  }
57483
57801
  const cellRect = this.getCellRelativeRect(col, row);
57484
- if (this.stateManager.select?.ranges?.length > 0) {
57485
- hideCellSelectBorder(this.scenegraph);
57486
- }
57487
- const { col: hoverCol, row: hoverRow } = this.stateManager.hover.cellPos;
57488
- this.stateManager.updateHoverPos(-1, -1);
57489
57802
  const c = this.scenegraph.stage.toCanvas(false, new AABBBounds$1().set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY));
57490
57803
  if (!isInView) {
57491
57804
  this.setScrollTop(scrollTop);
57492
57805
  this.setScrollLeft(scrollLeft);
57493
57806
  }
57494
- if (this.stateManager.select?.ranges?.length > 0) {
57495
- restoreCellSelectBorder(this.scenegraph);
57496
- }
57497
- this.stateManager.updateHoverPos(hoverCol, hoverRow);
57498
57807
  return c.toDataURL();
57499
57808
  }
57500
57809
  exportCellRangeImg(cellRange) {
@@ -57592,12 +57901,23 @@
57592
57901
  }
57593
57902
  }
57594
57903
  }
57904
+ changeRecordOrder(source, target) {
57905
+ }
57595
57906
  registerCustomCellStyle(customStyleId, customStyle) {
57596
57907
  this.customCellStylePlugin.registerCustomCellStyle(customStyleId, customStyle);
57597
57908
  }
57598
57909
  arrangeCustomCellStyle(cellPos, customStyleId) {
57599
57910
  this.customCellStylePlugin.arrangeCustomCellStyle(cellPos, customStyleId);
57600
57911
  }
57912
+ isSeriesNumber(col, row) {
57913
+ return this.internalProps.layoutMap.isSeriesNumber(col, row);
57914
+ }
57915
+ isHasSeriesNumber() {
57916
+ return this.internalProps.layoutMap?.leftRowSeriesNumberColumnCount > 0;
57917
+ }
57918
+ get leftRowSeriesNumberCount() {
57919
+ return this.internalProps.layoutMap?.leftRowSeriesNumberColumnCount ?? 0;
57920
+ }
57601
57921
  }
57602
57922
 
57603
57923
  var core = /*#__PURE__*/Object.freeze({
@@ -58090,6 +58410,16 @@
58090
58410
  }
58091
58411
  return count;
58092
58412
  }
58413
+ function checkHasTreeDefine(layoutMap) {
58414
+ const columnObjects = layoutMap.columnObjects;
58415
+ for (let i = 0; i < columnObjects.length; i++) {
58416
+ const column = columnObjects[i];
58417
+ if (column?.define?.tree) {
58418
+ return true;
58419
+ }
58420
+ }
58421
+ return false;
58422
+ }
58093
58423
 
58094
58424
  class DimensionTree {
58095
58425
  sharedVar;
@@ -58509,6 +58839,11 @@
58509
58839
  _headerObjectMap;
58510
58840
  _headerCellIds;
58511
58841
  _columns;
58842
+ rowSeriesNumberColumn;
58843
+ leftRowSeriesNumberColumn;
58844
+ rightRowSeriesNumberColumn;
58845
+ leftRowSeriesNumberColumnCount = 0;
58846
+ rightRowSeriesNumberColumnCount = 0;
58512
58847
  columnTree;
58513
58848
  bodyRowSpanCount = 1;
58514
58849
  hierarchyIndent;
@@ -58519,6 +58854,7 @@
58519
58854
  _hasAggregation = false;
58520
58855
  _hasAggregationOnTopCount = 0;
58521
58856
  _hasAggregationOnBottomCount = 0;
58857
+ rowHierarchyType;
58522
58858
  _cellRangeMap;
58523
58859
  constructor(table, columns, showHeader, hierarchyIndent) {
58524
58860
  this._cellRangeMap = new Map();
@@ -58533,9 +58869,57 @@
58533
58869
  o[e.id] = e;
58534
58870
  return o;
58535
58871
  }, {});
58872
+ this.rowHierarchyType = checkHasTreeDefine(this) ? 'tree' : 'grid';
58536
58873
  this._hasAggregation = checkHasAggregation(this);
58537
58874
  this._hasAggregationOnBottomCount = checkHasAggregationOnBottom(this);
58538
58875
  this._hasAggregationOnTopCount = checkHasAggregationOnTop(this);
58876
+ this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
58877
+ }
58878
+ handleRowSeriesNumber(rowSeriesNumber) {
58879
+ if (rowSeriesNumber) {
58880
+ if (Array.isArray(rowSeriesNumber)) {
58881
+ this.rowSeriesNumberColumn = rowSeriesNumber.map(seriesNumber => {
58882
+ return {
58883
+ id: this.seqId++,
58884
+ title: seriesNumber.title,
58885
+ define: seriesNumber,
58886
+ cellType: seriesNumber.cellType ?? 'text',
58887
+ style: seriesNumber.style,
58888
+ width: seriesNumber.width,
58889
+ format: seriesNumber.format,
58890
+ field: seriesNumber.field,
58891
+ icon: seriesNumber.icon,
58892
+ headerIcon: seriesNumber.headerIcon,
58893
+ isChildNode: false
58894
+ };
58895
+ });
58896
+ }
58897
+ else {
58898
+ this.rowSeriesNumberColumn = [
58899
+ {
58900
+ id: this.seqId++,
58901
+ title: rowSeriesNumber.title,
58902
+ define: rowSeriesNumber,
58903
+ cellType: rowSeriesNumber.cellType ?? 'text',
58904
+ style: rowSeriesNumber.style,
58905
+ width: rowSeriesNumber.width,
58906
+ format: rowSeriesNumber.format,
58907
+ field: '',
58908
+ icon: rowSeriesNumber.icon,
58909
+ headerIcon: rowSeriesNumber.headerIcon,
58910
+ isChildNode: false
58911
+ }
58912
+ ];
58913
+ }
58914
+ this.leftRowSeriesNumberColumn = this.rowSeriesNumberColumn.filter(rowSeriesNumberItem => {
58915
+ return true;
58916
+ });
58917
+ this.rightRowSeriesNumberColumn = this.rowSeriesNumberColumn.filter(rowSeriesNumberItem => {
58918
+ return false;
58919
+ });
58920
+ this.leftRowSeriesNumberColumnCount = this.leftRowSeriesNumberColumn.length;
58921
+ this.rightRowSeriesNumberColumnCount = this.rightRowSeriesNumberColumn.length;
58922
+ }
58539
58923
  }
58540
58924
  get transpose() {
58541
58925
  return this._transpose;
@@ -58549,8 +58933,103 @@
58549
58933
  set showHeader(_showHeader) {
58550
58934
  this._showHeader = _showHeader;
58551
58935
  }
58936
+ isSeriesNumberInHeader(col, row) {
58937
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount) {
58938
+ if (this.transpose) {
58939
+ return false;
58940
+ }
58941
+ else if (row < this.headerLevelCount) {
58942
+ return true;
58943
+ }
58944
+ }
58945
+ if (this.rightRowSeriesNumberColumnCount > 0 &&
58946
+ row >= 0 &&
58947
+ col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
58948
+ if (this.transpose) {
58949
+ return false;
58950
+ }
58951
+ else if (row < this.headerLevelCount) {
58952
+ return true;
58953
+ }
58954
+ }
58955
+ return false;
58956
+ }
58957
+ isSeriesNumberInBody(col, row) {
58958
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
58959
+ if (this.transpose) {
58960
+ return true;
58961
+ }
58962
+ if (row >= this.headerLevelCount) {
58963
+ return true;
58964
+ }
58965
+ }
58966
+ if (this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
58967
+ if (this.transpose) {
58968
+ return true;
58969
+ }
58970
+ if (row >= this.headerLevelCount) {
58971
+ return true;
58972
+ }
58973
+ }
58974
+ return false;
58975
+ }
58976
+ isSeriesNumber(col, row) {
58977
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount) {
58978
+ return true;
58979
+ }
58980
+ if (this.rightRowSeriesNumberColumnCount > 0 &&
58981
+ row >= 0 &&
58982
+ col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
58983
+ return true;
58984
+ }
58985
+ return false;
58986
+ }
58987
+ getSeriesNumberHeader(col, row) {
58988
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
58989
+ if (this.transpose) {
58990
+ return undefined;
58991
+ }
58992
+ if (row < this.headerLevelCount) {
58993
+ return Object.assign({}, this.leftRowSeriesNumberColumn[col], {
58994
+ style: this._table.internalProps.rowSeriesNumber.headerStyle
58995
+ });
58996
+ }
58997
+ }
58998
+ if (this.rightRowSeriesNumberColumnCount > 0 &&
58999
+ col >= this.colCount - this.rightRowSeriesNumberColumnCount &&
59000
+ row < this.headerLevelCount) {
59001
+ if (this.transpose) {
59002
+ return undefined;
59003
+ }
59004
+ if (row < this.headerLevelCount) {
59005
+ return this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)];
59006
+ }
59007
+ }
59008
+ return undefined;
59009
+ }
59010
+ getSeriesNumberBody(col, row) {
59011
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
59012
+ if (this.transpose) {
59013
+ return this.leftRowSeriesNumberColumn[col];
59014
+ }
59015
+ if (row >= this.headerLevelCount) {
59016
+ return this.leftRowSeriesNumberColumn[col];
59017
+ }
59018
+ }
59019
+ if (this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
59020
+ if (this.transpose) {
59021
+ return this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)];
59022
+ }
59023
+ if (row >= this.headerLevelCount) {
59024
+ return this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)];
59025
+ }
59026
+ }
59027
+ return undefined;
59028
+ }
58552
59029
  isHeader(col, row) {
58553
- if (this.transpose && col >= 0 && col < this.headerLevelCount) {
59030
+ if (this.transpose &&
59031
+ col >= this.leftRowSeriesNumberColumnCount &&
59032
+ col < this.headerLevelCount + this.leftRowSeriesNumberColumnCount) {
58554
59033
  return true;
58555
59034
  }
58556
59035
  if (!this.transpose && row >= 0 && row < this.headerLevelCount) {
@@ -58715,13 +59194,19 @@
58715
59194
  return 'body';
58716
59195
  }
58717
59196
  isRowHeader(col, row) {
58718
- if (this.transpose && col >= 0 && col <= this.headerLevelCount - 1) {
59197
+ if (this.transpose &&
59198
+ col >= this.leftRowSeriesNumberColumnCount &&
59199
+ col < this.headerLevelCount + this.leftRowSeriesNumberColumnCount) {
58719
59200
  return true;
58720
59201
  }
58721
59202
  return false;
58722
59203
  }
58723
59204
  isColumnHeader(col, row) {
58724
- if (!this.transpose && row >= 0 && row <= this.headerLevelCount - 1) {
59205
+ if (!this.transpose &&
59206
+ row >= 0 &&
59207
+ row <= this.headerLevelCount - 1 &&
59208
+ col >= this.leftRowSeriesNumberColumnCount &&
59209
+ col < this.colCount - this.rightRowSeriesNumberColumnCount) {
58725
59210
  return true;
58726
59211
  }
58727
59212
  return false;
@@ -58896,7 +59381,12 @@
58896
59381
  return 0;
58897
59382
  }
58898
59383
  get colCount() {
58899
- return this.transpose ? this.headerLevelCount + this.recordsCount : this._columns.length;
59384
+ return this.transpose
59385
+ ? this.headerLevelCount +
59386
+ this.recordsCount +
59387
+ this.leftRowSeriesNumberColumnCount +
59388
+ this.rightRowSeriesNumberColumnCount
59389
+ : this._columns.length + this.leftRowSeriesNumberColumnCount + this.rightRowSeriesNumberColumnCount;
58900
59390
  }
58901
59391
  get rowCount() {
58902
59392
  return this.transpose ? this._columns.length : this.headerLevelCount + this.recordsCount;
@@ -58923,61 +59413,79 @@
58923
59413
  return this._columns;
58924
59414
  }
58925
59415
  getColumnWidthDefined(col) {
58926
- if (this.transpose) {
58927
- let width = 0;
58928
- let maxWidth;
58929
- let minWidth;
58930
- if (col >= this.rowHeaderLevelCount) {
58931
- let isAuto;
58932
- this.columnObjects.forEach((obj, index) => {
58933
- if (typeof obj.width === 'number') {
58934
- width = Math.max(obj.width, width);
58935
- }
58936
- else if (obj.width === 'auto') {
58937
- isAuto = true;
58938
- }
58939
- if (typeof obj.minWidth === 'number') {
58940
- minWidth = Math.max(obj.minWidth, minWidth);
58941
- }
58942
- if (typeof obj.maxWidth === 'number') {
58943
- maxWidth = Math.max(obj.maxWidth, maxWidth);
58944
- }
58945
- });
58946
- width = width > 0 ? width : isAuto ? 'auto' : undefined;
58947
- return { width, minWidth, maxWidth };
59416
+ if (col >= 0) {
59417
+ if (col < this.leftRowSeriesNumberColumnCount) {
59418
+ return this.leftRowSeriesNumberColumn[col];
58948
59419
  }
58949
- if (this.isRowHeader(col, 0)) {
58950
- const defaultWidth = Array.isArray(this._table.defaultHeaderColWidth)
58951
- ? this._table.defaultHeaderColWidth[col] ?? this._table.defaultColWidth
58952
- : this._table.defaultHeaderColWidth;
58953
- if (defaultWidth === 'auto') {
58954
- return { width: 'auto' };
59420
+ if (this.transpose) {
59421
+ let width = 0;
59422
+ let maxWidth;
59423
+ let minWidth;
59424
+ if (col >= this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount) {
59425
+ let isAuto;
59426
+ this.columnObjects.forEach((obj, index) => {
59427
+ if (typeof obj.width === 'number') {
59428
+ width = Math.max(obj.width, width);
59429
+ }
59430
+ else if (obj.width === 'auto') {
59431
+ isAuto = true;
59432
+ }
59433
+ if (typeof obj.minWidth === 'number') {
59434
+ minWidth = Math.max(obj.minWidth, minWidth);
59435
+ }
59436
+ if (typeof obj.maxWidth === 'number') {
59437
+ maxWidth = Math.max(obj.maxWidth, maxWidth);
59438
+ }
59439
+ });
59440
+ width = width > 0 ? width : isAuto ? 'auto' : undefined;
59441
+ return { width, minWidth, maxWidth };
59442
+ }
59443
+ if (this.isRowHeader(col, 0)) {
59444
+ const defaultWidth = Array.isArray(this._table.defaultHeaderColWidth)
59445
+ ? this._table.defaultHeaderColWidth[col] ?? this._table.defaultColWidth
59446
+ : this._table.defaultHeaderColWidth;
59447
+ if (defaultWidth === 'auto') {
59448
+ return { width: 'auto' };
59449
+ }
59450
+ return { width: defaultWidth };
58955
59451
  }
58956
- return { width: defaultWidth };
58957
59452
  }
59453
+ return this._columns[col - this.leftRowSeriesNumberColumnCount];
58958
59454
  }
58959
- return this._columns[col];
59455
+ return undefined;
58960
59456
  }
58961
59457
  getCellId(col, row) {
58962
59458
  if (this.transpose) {
58963
- if (this.headerLevelCount <= col) {
59459
+ if (col >= this.headerLevelCount + this.leftRowSeriesNumberColumnCount) {
58964
59460
  return this._columns[row]?.id;
58965
59461
  }
58966
- return this._headerCellIds[col]?.[row];
59462
+ if (this.isSeriesNumber(col, row)) {
59463
+ return row + '_series_number';
59464
+ }
59465
+ return this._headerCellIds[col - this.leftRowSeriesNumberColumnCount]?.[row];
59466
+ }
59467
+ if (this.isSeriesNumber(col, row)) {
59468
+ return this.rowSeriesNumberColumn[col].id;
58967
59469
  }
58968
59470
  if (this.headerLevelCount <= row) {
58969
- return this._columns[col]?.id;
59471
+ return this._columns[col - this.leftRowSeriesNumberColumnCount]?.id;
58970
59472
  }
58971
- return this._headerCellIds[row]?.[col];
59473
+ return this._headerCellIds[row]?.[col - this.leftRowSeriesNumberColumnCount];
58972
59474
  }
58973
59475
  getHeader(col, row) {
59476
+ if (this.isSeriesNumberInHeader(col, row)) {
59477
+ return this.getSeriesNumberHeader(col, row);
59478
+ }
58974
59479
  const id = this.getCellId(col, row);
58975
59480
  return this._headerObjectMap[id];
58976
59481
  }
58977
59482
  getHeaderField(col, row) {
58978
59483
  const id = this.getCellId(col, row);
58979
59484
  return (this._headerObjectMap[id]?.field ||
58980
- (this.transpose ? this._columns[row] && this._columns[row].field : this._columns[col] && this._columns[col].field));
59485
+ (this.transpose
59486
+ ? this._columns[row] && this._columns[row].field
59487
+ : this._columns[col - this.leftRowSeriesNumberColumnCount] &&
59488
+ this._columns[col - this.leftRowSeriesNumberColumnCount].field));
58981
59489
  }
58982
59490
  getHeaderCellAdressById(id) {
58983
59491
  for (let i = 0; i < this._headerCellIds.length; i++) {
@@ -58987,7 +59495,7 @@
58987
59495
  if (this.transpose) {
58988
59496
  return { col: i, row: j };
58989
59497
  }
58990
- return { col: j, row: i };
59498
+ return { col: j + this.leftRowSeriesNumberColumnCount, row: i };
58991
59499
  }
58992
59500
  }
58993
59501
  }
@@ -58998,7 +59506,10 @@
58998
59506
  return this.getHeaderCellAdressById(hd.id);
58999
59507
  }
59000
59508
  getBody(col, _row) {
59001
- return this.transpose ? this._columns[_row] : this._columns[col];
59509
+ if (this.isSeriesNumber(col, _row)) {
59510
+ return this.getSeriesNumberBody(col, _row);
59511
+ }
59512
+ return this.transpose ? this._columns[_row] : this._columns[col - this.leftRowSeriesNumberColumnCount];
59002
59513
  }
59003
59514
  getBodyLayoutRangeById(id) {
59004
59515
  if (this.transpose) {
@@ -59013,7 +59524,7 @@
59013
59524
  }
59014
59525
  else {
59015
59526
  for (let col = 0; col < (this.colCount ?? 0); col++) {
59016
- if (id === this._columns[col].id) {
59527
+ if (id === this._columns[col - this.leftRowSeriesNumberColumnCount].id) {
59017
59528
  return {
59018
59529
  start: { col, row: 0 },
59019
59530
  end: { col, row: 0 }
@@ -59039,17 +59550,18 @@
59039
59550
  }
59040
59551
  else {
59041
59552
  if (this.headerLevelCount <= row) {
59042
- if (this.headerLevelCount <= row && this.columnObjects[col]?.define?.mergeCell) {
59553
+ if (this.headerLevelCount <= row &&
59554
+ this.columnObjects[col - this.leftRowSeriesNumberColumnCount]?.define?.mergeCell) {
59043
59555
  const value = this._table.getCellValue(col, row);
59044
59556
  for (let r = row - 1; r >= this.headerLevelCount; r--) {
59045
59557
  const last_Value = this._table.getCellValue(col, r);
59046
- if (typeof this.columnObjects[col].define.mergeCell === 'boolean') {
59558
+ if (typeof this.columnObjects[col - this.leftRowSeriesNumberColumnCount].define.mergeCell === 'boolean') {
59047
59559
  if (value !== last_Value) {
59048
59560
  break;
59049
59561
  }
59050
59562
  }
59051
59563
  else {
59052
- if (!this.columnObjects[col].define.mergeCell(value, last_Value)) {
59564
+ if (!this.columnObjects[col - this.leftRowSeriesNumberColumnCount].define.mergeCell(value, last_Value)) {
59053
59565
  break;
59054
59566
  }
59055
59567
  }
@@ -59057,13 +59569,13 @@
59057
59569
  }
59058
59570
  for (let r = row + 1; r < this.rowCount; r++) {
59059
59571
  const next_Value = this._table.getCellValue(col, r);
59060
- if (typeof this.columnObjects[col].define.mergeCell === 'boolean') {
59572
+ if (typeof this.columnObjects[col - this.leftRowSeriesNumberColumnCount].define.mergeCell === 'boolean') {
59061
59573
  if (value !== next_Value) {
59062
59574
  break;
59063
59575
  }
59064
59576
  }
59065
59577
  else {
59066
- if (!this.columnObjects[col].define.mergeCell(value, next_Value)) {
59578
+ if (!this.columnObjects[col - this.leftRowSeriesNumberColumnCount].define.mergeCell(value, next_Value)) {
59067
59579
  break;
59068
59580
  }
59069
59581
  }
@@ -59104,10 +59616,11 @@
59104
59616
  }
59105
59617
  getCellRangeTranspose(col, row) {
59106
59618
  const result = { start: { col, row }, end: { col, row } };
59107
- if (this.headerLevelCount <= col || (col === -1 && row === -1)) {
59108
- if (this.headerLevelCount <= col && this.columnObjects[row]?.define?.mergeCell) {
59619
+ if (this.headerLevelCount + this.leftRowSeriesNumberColumnCount <= col || (col === -1 && row === -1)) {
59620
+ if (this.headerLevelCount + this.leftRowSeriesNumberColumnCount <= col &&
59621
+ this.columnObjects[row]?.define?.mergeCell) {
59109
59622
  const value = this._table.getCellValue(col, row);
59110
- for (let c = col - 1; c >= this.headerLevelCount; c--) {
59623
+ for (let c = col - 1; c >= this.headerLevelCount + this.leftRowSeriesNumberColumnCount; c--) {
59111
59624
  const last_Value = this._table.getCellValue(c, row);
59112
59625
  if (typeof this.columnObjects[row].define.mergeCell === 'boolean') {
59113
59626
  if (value !== last_Value) {
@@ -59157,7 +59670,7 @@
59157
59670
  }
59158
59671
  result.start.col = c;
59159
59672
  }
59160
- for (let c = col + 1; c < this.headerLevelCount; c++) {
59673
+ for (let c = col + 1; c < this.headerLevelCount + this.leftRowSeriesNumberColumnCount; c++) {
59161
59674
  if (id !== this.getCellId(c, row)) {
59162
59675
  break;
59163
59676
  }
@@ -59238,7 +59751,8 @@
59238
59751
  define: colDef,
59239
59752
  columnWidthComputeMode: colDef.columnWidthComputeMode,
59240
59753
  disableColumnResize: colDef?.disableColumnResize,
59241
- aggregation: this._getAggregationForColumn(colDef, col)
59754
+ aggregation: this._getAggregationForColumn(colDef, col),
59755
+ isChildNode: row >= 1
59242
59756
  });
59243
59757
  for (let r = row + 1; r < this._headerCellIds.length; r++) {
59244
59758
  this._headerCellIds[r][col] = id;
@@ -59300,12 +59814,15 @@
59300
59814
  return newRow;
59301
59815
  }
59302
59816
  getCellHeaderPaths(col, row) {
59817
+ if (this.isSeriesNumber(col, row)) {
59818
+ return undefined;
59819
+ }
59303
59820
  let colPath = [];
59304
59821
  let rowPath = [];
59305
59822
  if (!this.transpose) {
59306
59823
  colPath = [
59307
59824
  {
59308
- field: this._columns[col].field
59825
+ field: this._columns[col - this.leftRowSeriesNumberColumnCount].field
59309
59826
  }
59310
59827
  ];
59311
59828
  }
@@ -59330,11 +59847,35 @@
59330
59847
  return this.getCellId(col, row - 1);
59331
59848
  }
59332
59849
  else if (this.isRowHeader(col, row)) {
59850
+ if (this.isSeriesNumberInBody(col - 1, row)) {
59851
+ return undefined;
59852
+ }
59333
59853
  return this.getCellId(col - 1, row);
59334
59854
  }
59335
59855
  return undefined;
59336
59856
  }
59337
59857
  canMoveHeaderPosition(source, target) {
59858
+ if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) {
59859
+ return false;
59860
+ }
59861
+ else if (!this.transpose &&
59862
+ this.isSeriesNumberInBody(target.col, target.row) &&
59863
+ this.isSeriesNumberInBody(source.col, source.row)) {
59864
+ return true;
59865
+ }
59866
+ else if (this.transpose &&
59867
+ this.isSeriesNumberInBody(target.col, target.row) &&
59868
+ this.isSeriesNumberInBody(source.col, source.row)) {
59869
+ if (this._getColumnDefine(source.col + this.leftRowSeriesNumberColumnCount, source.row).isChildNode &&
59870
+ this._getColumnDefine(target.col + this.leftRowSeriesNumberColumnCount, target.row).isChildNode) {
59871
+ source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1;
59872
+ target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1;
59873
+ }
59874
+ else {
59875
+ source.col = source.col + this.leftRowSeriesNumberColumnCount;
59876
+ target.col = target.col + this.leftRowSeriesNumberColumnCount;
59877
+ }
59878
+ }
59338
59879
  if (source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) {
59339
59880
  return false;
59340
59881
  }
@@ -59358,7 +59899,7 @@
59358
59899
  }
59359
59900
  moveHeaderPosition(source, target) {
59360
59901
  if (this.canMoveHeaderPosition(source, target)) {
59361
- const sourceCellRange = this.getCellRange(source.col, source.row);
59902
+ let sourceCellRange = this.getCellRange(source.col, source.row);
59362
59903
  if (this.isColumnHeader(source.col, source.row)) {
59363
59904
  const sourceSize = sourceCellRange.end.col - sourceCellRange.start.col + 1;
59364
59905
  let targetIndex;
@@ -59373,14 +59914,14 @@
59373
59914
  return null;
59374
59915
  }
59375
59916
  for (let row = 0; row < this._headerCellIds.length; row++) {
59376
- const sourceIds = this._headerCellIds[row].splice(sourceCellRange.start.col, sourceSize);
59377
- sourceIds.unshift(targetIndex, 0);
59917
+ const sourceIds = this._headerCellIds[row].splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
59918
+ sourceIds.unshift(targetIndex - this.leftRowSeriesNumberColumnCount, 0);
59378
59919
  Array.prototype.splice.apply(this._headerCellIds[row], sourceIds);
59379
59920
  }
59380
- const sourceColumns = this._columns.splice(sourceCellRange.start.col, sourceSize);
59381
- sourceColumns.unshift(targetIndex, 0);
59921
+ const sourceColumns = this._columns.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
59922
+ sourceColumns.unshift((targetIndex - this.leftRowSeriesNumberColumnCount), 0);
59382
59923
  Array.prototype.splice.apply(this._columns, sourceColumns);
59383
- this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col, targetIndex);
59924
+ this.columnTree.movePosition(sourceCellRange.start.row, sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, targetIndex - this.leftRowSeriesNumberColumnCount);
59384
59925
  this.columnTree.reset(this.columnTree.tree.children, true);
59385
59926
  this._cellRangeMap = new Map();
59386
59927
  return {
@@ -59391,7 +59932,11 @@
59391
59932
  moveType: 'column'
59392
59933
  };
59393
59934
  }
59394
- else if (this.isRowHeader(source.col, source.row)) {
59935
+ else if (this.isRowHeader(source.col, source.row) ||
59936
+ (this.isSeriesNumberInBody(source.col, source.row) && this.transpose)) {
59937
+ if (this.isSeriesNumberInBody(source.col, source.row)) {
59938
+ sourceCellRange = this.getCellRange(source.col + this.leftRowSeriesNumberColumnCount, source.row);
59939
+ }
59395
59940
  const sourceSize = sourceCellRange.end.row - sourceCellRange.start.row + 1;
59396
59941
  let targetIndex;
59397
59942
  const targetCellRange = this.getCellRange(sourceCellRange.start.col, target.row);
@@ -59412,7 +59957,7 @@
59412
59957
  const sourceColumns = this._columns.splice(sourceCellRange.start.row, sourceSize);
59413
59958
  sourceColumns.unshift(targetIndex, 0);
59414
59959
  Array.prototype.splice.apply(this._columns, sourceColumns);
59415
- this.columnTree.movePosition(sourceCellRange.start.col, sourceCellRange.start.row, targetIndex);
59960
+ this.columnTree.movePosition(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceCellRange.start.row, targetIndex + (target.row > source.row ? sourceCellRange.end.row - sourceCellRange.start.row : 0));
59416
59961
  this.columnTree.reset(this.columnTree.tree.children, true);
59417
59962
  this._cellRangeMap = new Map();
59418
59963
  return {
@@ -59423,6 +59968,15 @@
59423
59968
  moveType: 'row'
59424
59969
  };
59425
59970
  }
59971
+ else if (this.isSeriesNumberInBody(source.col, source.row)) {
59972
+ return {
59973
+ sourceIndex: source.row,
59974
+ targetIndex: target.row,
59975
+ sourceSize: 1,
59976
+ targetSize: 1,
59977
+ moveType: 'row'
59978
+ };
59979
+ }
59426
59980
  }
59427
59981
  return null;
59428
59982
  }
@@ -59439,14 +59993,14 @@
59439
59993
  };
59440
59994
  }
59441
59995
  setChartInstance(_col, _row, chartInstance) {
59442
- const columnObj = this.transpose ? this._columns[_row] : this._columns[_col];
59996
+ const columnObj = this.transpose ? this._columns[_row] : this._columns[_col - this.leftRowSeriesNumberColumnCount];
59443
59997
  if (typeof columnObj.chartSpec === 'function') {
59444
59998
  return;
59445
59999
  }
59446
60000
  columnObj.chartInstance = chartInstance;
59447
60001
  }
59448
60002
  getChartInstance(_col, _row) {
59449
- const columnObj = this.transpose ? this._columns[_row] : this._columns[_col];
60003
+ const columnObj = this.transpose ? this._columns[_row] : this._columns[_col - this.leftRowSeriesNumberColumnCount];
59450
60004
  return columnObj.chartInstance;
59451
60005
  }
59452
60006
  checkHasChart() {
@@ -59518,6 +60072,18 @@
59518
60072
  }, []);
59519
60073
  return result;
59520
60074
  }
60075
+ _getColumnDefine(col, row) {
60076
+ if (col >= 0) {
60077
+ if (col < this.leftRowSeriesNumberColumnCount) {
60078
+ return this.leftRowSeriesNumberColumn[col];
60079
+ }
60080
+ if (this.transpose) {
60081
+ return this._columns[row];
60082
+ }
60083
+ return this._columns[col - this.leftRowSeriesNumberColumnCount];
60084
+ }
60085
+ return undefined;
60086
+ }
59521
60087
  }
59522
60088
 
59523
60089
  class Title {
@@ -59893,7 +60459,15 @@
59893
60459
  return customMergeText;
59894
60460
  }
59895
60461
  const table = this;
59896
- if (table.internalProps.layoutMap.isHeader(col, row)) {
60462
+ if (table.internalProps.layoutMap.isSeriesNumber(col, row)) {
60463
+ if (table.internalProps.layoutMap.isSeriesNumberInHeader(col, row)) {
60464
+ const { title } = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
60465
+ return title;
60466
+ }
60467
+ const { format } = table.internalProps.layoutMap.getSeriesNumberBody(col, row);
60468
+ return typeof format === 'function' ? format(col, row, this) : row - this.columnHeaderLevelCount + 1;
60469
+ }
60470
+ else if (table.internalProps.layoutMap.isHeader(col, row)) {
59897
60471
  const { title } = table.internalProps.layoutMap.getHeader(col, row);
59898
60472
  return typeof title === 'function' ? title() : title;
59899
60473
  }
@@ -59915,7 +60489,15 @@
59915
60489
  return null;
59916
60490
  }
59917
60491
  const table = this;
59918
- if (table.internalProps.layoutMap.isHeader(col, row)) {
60492
+ if (table.internalProps.layoutMap.isSeriesNumber(col, row)) {
60493
+ if (table.internalProps.layoutMap.isSeriesNumberInHeader(col, row)) {
60494
+ const { title } = table.internalProps.layoutMap.getSeriesNumberHeader(col, row);
60495
+ return title;
60496
+ }
60497
+ const { format } = table.internalProps.layoutMap.getSeriesNumberBody(col, row);
60498
+ return typeof format === 'function' ? format(col, row, this) : row - this.columnHeaderLevelCount;
60499
+ }
60500
+ else if (table.internalProps.layoutMap.isHeader(col, row)) {
59919
60501
  const { title } = table.internalProps.layoutMap.getHeader(col, row);
59920
60502
  return typeof title === 'function' ? title() : title;
59921
60503
  }
@@ -60029,7 +60611,6 @@
60029
60611
  }
60030
60612
  else if (options.records) {
60031
60613
  this.setRecords(options.records, {
60032
- restoreHierarchyState: options.restoreHierarchyState,
60033
60614
  sortState: options.sortState
60034
60615
  });
60035
60616
  }
@@ -60096,9 +60677,9 @@
60096
60677
  layoutMap.hasAggregationOnBottomCount;
60097
60678
  if (table.transpose) {
60098
60679
  table.rowCount = layoutMap.rowCount ?? 0;
60099
- table.colCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount;
60680
+ table.colCount = layoutMap.colCount ?? 0;
60100
60681
  table.frozenRowCount = 0;
60101
- this.internalProps.frozenColCount = layoutMap.headerLevelCount ?? 0;
60682
+ this.internalProps.frozenColCount = Math.max((layoutMap.headerLevelCount ?? 0) + layoutMap.leftRowSeriesNumberColumnCount, this.options.frozenColCount ?? 0);
60102
60683
  if (table.bottomFrozenRowCount !== (this.options.bottomFrozenRowCount ?? 0)) {
60103
60684
  table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
60104
60685
  }
@@ -60128,7 +60709,7 @@
60128
60709
  if (table.internalProps.layoutMap.isHeader(col, row)) {
60129
60710
  return null;
60130
60711
  }
60131
- const index = table.getRecordShowIndexByCell(col, row);
60712
+ const index = table.getRecordShowIndexByCell(table.transpose ? col - table.internalProps.layoutMap.leftRowSeriesNumberColumnCount : col, row);
60132
60713
  return table.internalProps.dataSource.getField(index, field, col, row, this);
60133
60714
  }
60134
60715
  getRawFieldData(field, col, row) {
@@ -60143,10 +60724,12 @@
60143
60724
  return table.internalProps.dataSource.getRawField(index, field, col, row, this);
60144
60725
  }
60145
60726
  _moveHeaderPosition(source, target) {
60727
+ const sourceCellRange = this.getCellRange(source.col, source.row);
60728
+ const targetCellRange = this.getCellRange(target.col, target.row);
60146
60729
  const moveContext = this.internalProps.layoutMap.moveHeaderPosition(source, target);
60147
60730
  if (moveContext) {
60148
60731
  if (moveContext.moveType === 'column') {
60149
- this.colWidthsMap.adjustOrder(moveContext.sourceIndex, moveContext.targetIndex, moveContext.sourceSize);
60732
+ this.colWidthsMap.exchangeOrder(sourceCellRange.start.col, sourceCellRange.end.col - sourceCellRange.start.col + 1, targetCellRange.start.col, targetCellRange.end.col - targetCellRange.start.col + 1, moveContext.targetIndex);
60150
60733
  if (!this.transpose) {
60151
60734
  this.colWidthsLimit = {};
60152
60735
  for (let col = 0; col < this.internalProps.layoutMap.columnWidths.length; col++) {
@@ -60159,23 +60742,30 @@
60159
60742
  }
60160
60743
  }
60161
60744
  }
60162
- const colStart = Math.min(moveContext.sourceIndex, moveContext.targetIndex);
60163
- const colEnd = Math.max(moveContext.sourceIndex, moveContext.targetIndex);
60164
- for (let col = colStart; col <= colEnd; col++) {
60165
- this._clearColRangeWidthsMap(col);
60166
- }
60167
60745
  }
60168
60746
  else {
60169
- const rowStart = Math.min(moveContext.sourceIndex, moveContext.targetIndex);
60170
- const rowEnd = Math.max(moveContext.sourceIndex, moveContext.targetIndex);
60171
- for (let row = rowStart; row <= rowEnd; row++) {
60172
- this._clearRowRangeHeightsMap(row);
60747
+ if (moveContext.targetIndex > moveContext.sourceIndex) {
60748
+ this.rowHeightsMap.exchangeOrder(moveContext.sourceIndex, moveContext.sourceSize, moveContext.targetIndex + moveContext.sourceSize - moveContext.targetSize, moveContext.targetSize, moveContext.targetIndex);
60749
+ }
60750
+ else {
60751
+ this.rowHeightsMap.exchangeOrder(moveContext.sourceIndex, moveContext.sourceSize, moveContext.targetIndex, moveContext.targetSize, moveContext.targetIndex);
60173
60752
  }
60174
60753
  }
60175
60754
  return moveContext;
60176
60755
  }
60177
60756
  return null;
60178
60757
  }
60758
+ changeRecordOrder(sourceIndex, targetIndex) {
60759
+ if (this.transpose) {
60760
+ sourceIndex = this.getRecordShowIndexByCell(sourceIndex, 0);
60761
+ targetIndex = this.getRecordShowIndexByCell(targetIndex, 0);
60762
+ }
60763
+ else {
60764
+ sourceIndex = this.getRecordShowIndexByCell(0, sourceIndex);
60765
+ targetIndex = this.getRecordShowIndexByCell(0, targetIndex);
60766
+ }
60767
+ this.dataSource.reorderRecord(sourceIndex, targetIndex);
60768
+ }
60179
60769
  getCellAddress(findTargetRecord, field) {
60180
60770
  let targetRecordIndex;
60181
60771
  for (let i = 0; i < this.internalProps.records.length; i++) {
@@ -60426,10 +61016,6 @@
60426
61016
  this.internalProps.sortState = sort;
60427
61017
  this.stateManager.setSortState(this.sortState);
60428
61018
  }
60429
- const currentPagerIndexedData = this.dataSource?._currentPagerIndexedData;
60430
- const currentIndexedData = this.dataSource?.currentIndexedData;
60431
- const treeDataHierarchyState = this.dataSource?.treeDataHierarchyState;
60432
- const oldRecordLength = this.records?.length ?? 0;
60433
61019
  if (records) {
60434
61020
  _setRecords(this, records);
60435
61021
  if (this.sortState) {
@@ -60451,20 +61037,10 @@
60451
61037
  }
60452
61038
  }
60453
61039
  }
60454
- if (option?.restoreHierarchyState && oldRecordLength === this.records?.length) {
60455
- this.dataSource._currentPagerIndexedData = currentPagerIndexedData;
60456
- this.dataSource.currentIndexedData = currentIndexedData;
60457
- this.dataSource.treeDataHierarchyState = treeDataHierarchyState;
60458
- }
60459
61040
  this.refreshRowColCount();
60460
61041
  }
60461
61042
  else {
60462
61043
  _setRecords(this, records);
60463
- if (option?.restoreHierarchyState && oldRecordLength === this.records?.length) {
60464
- this.dataSource._currentPagerIndexedData = currentPagerIndexedData;
60465
- this.dataSource.currentIndexedData = currentIndexedData;
60466
- this.dataSource.treeDataHierarchyState = treeDataHierarchyState;
60467
- }
60468
61044
  }
60469
61045
  this.stateManager.initCheckedState(records);
60470
61046
  this.clearCellStyleCache();
@@ -61083,6 +61659,11 @@
61083
61659
  _lastCellCol;
61084
61660
  _lastCellRow;
61085
61661
  _lastCellHeaderPath;
61662
+ rowSeriesNumberColumn;
61663
+ leftRowSeriesNumberColumn;
61664
+ leftRowSeriesNumberColumnCount = 0;
61665
+ rightRowSeriesNumberColumn;
61666
+ rightRowSeriesNumberColumnCount = 0;
61086
61667
  constructor(table, dataset) {
61087
61668
  this.sharedVar = { seqId: 0 };
61088
61669
  this._table = table;
@@ -61258,8 +61839,52 @@
61258
61839
  return false;
61259
61840
  });
61260
61841
  }
61842
+ this.handleRowSeriesNumber(table.internalProps.rowSeriesNumber);
61261
61843
  this.setColumnWidths();
61262
61844
  }
61845
+ handleRowSeriesNumber(rowSeriesNumber) {
61846
+ if (rowSeriesNumber) {
61847
+ if (Array.isArray(rowSeriesNumber)) {
61848
+ this.rowSeriesNumberColumn = rowSeriesNumber.map(seriesNumber => {
61849
+ return {
61850
+ id: '',
61851
+ title: seriesNumber.title,
61852
+ define: seriesNumber,
61853
+ cellType: seriesNumber.cellType ?? 'text',
61854
+ width: seriesNumber.width,
61855
+ style: seriesNumber.style,
61856
+ format: seriesNumber.format,
61857
+ field: seriesNumber.field,
61858
+ icon: seriesNumber.icon
61859
+ };
61860
+ });
61861
+ }
61862
+ else {
61863
+ this.rowSeriesNumberColumn = [
61864
+ {
61865
+ id: '',
61866
+ title: rowSeriesNumber.title,
61867
+ define: rowSeriesNumber,
61868
+ cellType: rowSeriesNumber.cellType ?? 'text',
61869
+ style: rowSeriesNumber.style,
61870
+ width: rowSeriesNumber.width,
61871
+ format: rowSeriesNumber.format,
61872
+ field: '',
61873
+ icon: rowSeriesNumber.icon,
61874
+ isChildNode: false
61875
+ }
61876
+ ];
61877
+ }
61878
+ this.leftRowSeriesNumberColumn = this.rowSeriesNumberColumn.filter(rowSeriesNumberItem => {
61879
+ return true;
61880
+ });
61881
+ this.rightRowSeriesNumberColumn = this.rowSeriesNumberColumn.filter(rowSeriesNumberItem => {
61882
+ return false;
61883
+ });
61884
+ this.leftRowSeriesNumberColumnCount = this.leftRowSeriesNumberColumn.length;
61885
+ this.rightRowSeriesNumberColumnCount = this.rightRowSeriesNumberColumn.length;
61886
+ }
61887
+ }
61263
61888
  _generateColHeaderIds() {
61264
61889
  if (this.columnDimensionTree.tree.children?.length >= 1) {
61265
61890
  this.columnHeaderObjs = this._addHeaders(this._columnHeaderCellIds, 0, this.columnDimensionTree.tree.children, []);
@@ -61280,12 +61905,12 @@
61280
61905
  return title + (title ? `/${value.title}` : `${value.title}`);
61281
61906
  }, ''),
61282
61907
  field: undefined,
61283
- headerType: this.columnHeaderTitle.headerType ?? 'text',
61284
- style: this.columnHeaderTitle.headerStyle,
61908
+ headerType: this.columnHeaderTitle?.headerType ?? 'text',
61909
+ style: this.columnHeaderTitle?.headerStyle,
61285
61910
  define: {
61286
61911
  id,
61287
- disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
61288
- disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
61912
+ disableHeaderHover: !!this.columnHeaderTitle?.disableHeaderHover,
61913
+ disableHeaderSelect: !!this.columnHeaderTitle?.disableHeaderSelect
61289
61914
  }
61290
61915
  };
61291
61916
  this.columnHeaderObjs.push(cell);
@@ -61315,12 +61940,12 @@
61315
61940
  return title + (title ? `/${value.title}` : `${value.title}`);
61316
61941
  }, ''),
61317
61942
  field: undefined,
61318
- headerType: this.rowHeaderTitle.headerType ?? 'text',
61319
- style: this.rowHeaderTitle.headerStyle,
61943
+ headerType: this.rowHeaderTitle?.headerType ?? 'text',
61944
+ style: this.rowHeaderTitle?.headerStyle,
61320
61945
  define: {
61321
61946
  id,
61322
- disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
61323
- disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
61947
+ disableHeaderHover: !!this.rowHeaderTitle?.disableHeaderHover,
61948
+ disableHeaderSelect: !!this.rowHeaderTitle?.disableHeaderSelect
61324
61949
  }
61325
61950
  };
61326
61951
  this.rowHeaderObjs.push(cell);
@@ -61491,16 +62116,19 @@
61491
62116
  }
61492
62117
  setColumnWidths() {
61493
62118
  const returnWidths = new Array(this.colCount).fill(undefined);
62119
+ if (this.leftRowSeriesNumberColumnCount) {
62120
+ returnWidths[0] = this.leftRowSeriesNumberColumn[0];
62121
+ }
61494
62122
  if (this.showHeader && this.showRowHeader) {
61495
62123
  if (this.rowHeaderTitle) {
61496
- returnWidths[0] = {};
62124
+ returnWidths[0 + this.leftRowSeriesNumberColumnCount] = {};
61497
62125
  }
61498
62126
  if (this.rowHierarchyType === 'tree') {
61499
62127
  const mainDimensionFirstRowKey = this.rowDimensionKeys[0];
61500
62128
  if (mainDimensionFirstRowKey) {
61501
62129
  const dimension = this.rowsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === mainDimensionFirstRowKey);
61502
62130
  dimension &&
61503
- (returnWidths[0 + (this.rowHeaderTitle ? 1 : 0)] = {
62131
+ (returnWidths[0 + (this.rowHeaderTitle ? 1 : 0) + this.leftRowSeriesNumberColumnCount] = {
61504
62132
  width: dimension.width,
61505
62133
  minWidth: dimension.minWidth,
61506
62134
  maxWidth: dimension.maxWidth
@@ -61511,7 +62139,7 @@
61511
62139
  if (curDimensionFirstRowKey) {
61512
62140
  const dimension = this.extensionRows[index].rows?.find((dimension) => typeof dimension === 'string' ? false : dimension.dimensionKey === curDimensionFirstRowKey);
61513
62141
  dimension &&
61514
- (returnWidths[index + 1 + (this.rowHeaderTitle ? 1 : 0)] = {
62142
+ (returnWidths[index + 1 + (this.rowHeaderTitle ? 1 : 0) + this.leftRowSeriesNumberColumnCount] = {
61515
62143
  width: dimension.width,
61516
62144
  minWidth: dimension.minWidth,
61517
62145
  maxWidth: dimension.maxWidth
@@ -61523,7 +62151,7 @@
61523
62151
  this.rowDimensionKeys.forEach((objKey, index) => {
61524
62152
  const dimension = this.rowsDefine?.find(dimension => typeof dimension === 'string' ? false : dimension.dimensionKey === objKey);
61525
62153
  dimension &&
61526
- (returnWidths[index + (this.rowHeaderTitle ? 1 : 0)] = {
62154
+ (returnWidths[index + (this.rowHeaderTitle ? 1 : 0) + this.leftRowSeriesNumberColumnCount] = {
61527
62155
  width: dimension.width,
61528
62156
  minWidth: dimension.minWidth,
61529
62157
  maxWidth: dimension.maxWidth
@@ -61617,7 +62245,8 @@
61617
62245
  return 'body';
61618
62246
  }
61619
62247
  isHeader(col, row) {
61620
- if (col >= 0 && col < this.rowHeaderLevelCount) {
62248
+ if (col >= this.leftRowSeriesNumberColumnCount &&
62249
+ col < this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount) {
61621
62250
  return true;
61622
62251
  }
61623
62252
  if (row >= 0 && row < this.columnHeaderLevelCount) {
@@ -61632,7 +62261,10 @@
61632
62261
  return false;
61633
62262
  }
61634
62263
  isCornerHeader(col, row) {
61635
- if (col >= 0 && col < this.rowHeaderLevelCount && row >= 0 && row < this.columnHeaderLevelCount) {
62264
+ if (col >= 0 &&
62265
+ col < this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount &&
62266
+ row >= 0 &&
62267
+ row < this.columnHeaderLevelCount) {
61636
62268
  return true;
61637
62269
  }
61638
62270
  return false;
@@ -61644,13 +62276,20 @@
61644
62276
  return false;
61645
62277
  }
61646
62278
  isRowHeader(col, row) {
61647
- if (col >= 0 && col < this.rowHeaderLevelCount && row >= this.columnHeaderLevelCount) {
62279
+ if (col >= this.leftRowSeriesNumberColumnCount &&
62280
+ col < this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount &&
62281
+ row >= this.columnHeaderLevelCount) {
61648
62282
  return true;
61649
62283
  }
61650
62284
  return false;
61651
62285
  }
61652
62286
  isFrozen(col, row) {
61653
- return (this.isFrozenColumn(col) || this.isRightFrozenColumn(col) || this.isBottomFrozenRow(row) || this.isFrozenRow(row));
62287
+ return (this.isFrozenColumn(col) ||
62288
+ this.isRightFrozenColumn(col) ||
62289
+ this.isBottomFrozenRow(row) ||
62290
+ this.isFrozenRow(row) ||
62291
+ this.isSeriesNumberInBody(col, row) ||
62292
+ this.isSeriesNumberInHeader(col, row));
61654
62293
  }
61655
62294
  isFrozenColumn(col, row) {
61656
62295
  if (isValid$3(row)) {
@@ -61852,7 +62491,10 @@
61852
62491
  this._rowHeaderLevelCount = count;
61853
62492
  }
61854
62493
  get colCount() {
61855
- return (this.columnDimensionTree.tree.size + this.rowHeaderLevelCount + this.rightHeaderColCount);
62494
+ return (this.columnDimensionTree.tree.size +
62495
+ this.rowHeaderLevelCount +
62496
+ this.rightHeaderColCount +
62497
+ this.leftRowSeriesNumberColumnCount);
61856
62498
  }
61857
62499
  get rowCount() {
61858
62500
  return (((Array.isArray(this._table.records) ? this._table.records.length > 0 : true) &&
@@ -61928,25 +62570,31 @@
61928
62570
  }
61929
62571
  getCellId(col, row) {
61930
62572
  if (row >= 0 && col >= 0) {
61931
- if (this.isCornerHeader(col, row)) {
61932
- return this._cornerHeaderCellIds[row][col];
62573
+ if (this.isSeriesNumber(col, row)) {
62574
+ return '';
62575
+ }
62576
+ else if (this.isCornerHeader(col, row)) {
62577
+ return this._cornerHeaderCellIds[row][col - this.leftRowSeriesNumberColumnCount];
61933
62578
  }
61934
62579
  else if (this.isColumnHeader(col, row)) {
61935
- return this._columnHeaderCellIds[row][col - this.rowHeaderLevelCount];
62580
+ return this._columnHeaderCellIds[row][col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
61936
62581
  }
61937
62582
  else if (this.isRowHeader(col, row)) {
61938
- return this._rowHeaderCellIds[row - this.columnHeaderLevelCount]?.[col];
62583
+ return this._rowHeaderCellIds[row - this.columnHeaderLevelCount]?.[col - this.leftRowSeriesNumberColumnCount];
61939
62584
  }
61940
62585
  else if (this.isRightFrozenColumn(col, row)) {
61941
62586
  return this._rowHeaderCellIds[row - this.columnHeaderLevelCount][this.rowHeaderLevelCount - 1];
61942
62587
  }
61943
62588
  else if (this.isBottomFrozenRow(col, row)) {
61944
- return this._columnHeaderCellIds[this.columnHeaderLevelCount - 1]?.[col - this.rowHeaderLevelCount];
62589
+ return this._columnHeaderCellIds[this.columnHeaderLevelCount - 1]?.[col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount];
61945
62590
  }
61946
62591
  }
61947
62592
  return undefined;
61948
62593
  }
61949
62594
  getHeader(col, row) {
62595
+ if (this.isSeriesNumberInHeader(col, row)) {
62596
+ return this.getSeriesNumberHeader(col, row);
62597
+ }
61950
62598
  const id = this.getCellId(col, row);
61951
62599
  return this._headerObjectMap[id] ?? { id: undefined, field: '', headerType: 'text', define: undefined };
61952
62600
  }
@@ -61986,6 +62634,9 @@
61986
62634
  return this.getHeaderCellAdressById(hd.id);
61987
62635
  }
61988
62636
  getBody(_col, _row) {
62637
+ if (this.isSeriesNumber(_col, _row)) {
62638
+ return this.getSeriesNumberBody(_col, _row);
62639
+ }
61989
62640
  const paths = this.getCellHeaderPaths(_col, _row);
61990
62641
  if (this.indicatorsAsCol) {
61991
62642
  const indicatorKey = paths.colHeaderPaths?.find(colPath => colPath.indicatorKey)?.indicatorKey;
@@ -62081,7 +62732,8 @@
62081
62732
  result.start.row = r;
62082
62733
  }
62083
62734
  for (let r = row + 1; r < (this.rowCount ?? 0); r++) {
62084
- if (id !== this.getCellId(col, r)) {
62735
+ if (id !== this.getCellId(col, r) ||
62736
+ (this.isSeriesNumberInHeader(col, row) && r >= this.columnHeaderLevelCount)) {
62085
62737
  break;
62086
62738
  }
62087
62739
  result.end.row = r;
@@ -62122,13 +62774,13 @@
62122
62774
  return 0;
62123
62775
  }
62124
62776
  getBodyIndexByCol(col) {
62125
- if (col < this.rowHeaderLevelCount) {
62777
+ if (col < this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount) {
62126
62778
  return -1;
62127
62779
  }
62128
62780
  else if (col >= this.colCount - this.rightHeaderColCount) {
62129
62781
  return -1;
62130
62782
  }
62131
- return col - this.rowHeaderLevelCount;
62783
+ return col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount;
62132
62784
  }
62133
62785
  getRecordStartRowByRecordIndex(index) {
62134
62786
  return this.columnHeaderLevelCount + index;
@@ -62181,7 +62833,9 @@
62181
62833
  }
62182
62834
  }
62183
62835
  else {
62184
- rowPath = this.rowDimensionTree.getTreePath(recordRow, this.showHeader && this.showRowHeader ? col - (this.rowHeaderTitle ? 1 : 0) : this.rowDimensionTree.totalLevel);
62836
+ rowPath = this.rowDimensionTree.getTreePath(recordRow, this.showHeader && this.showRowHeader
62837
+ ? col - (this.rowHeaderTitle ? 1 : 0) - this.leftRowSeriesNumberColumnCount
62838
+ : this.rowDimensionTree.totalLevel);
62185
62839
  }
62186
62840
  }
62187
62841
  const p = { colHeaderPaths: colPath, rowHeaderPaths: rowPath, cellLocation: this.getCellLocation(col, row) };
@@ -62300,14 +62954,14 @@
62300
62954
  return title + (title ? `/${value.title}` : `${value.title}`);
62301
62955
  }, ''),
62302
62956
  field: undefined,
62303
- headerType: this.rowHeaderTitle.headerType ?? 'text',
62304
- style: this.rowHeaderTitle.headerStyle,
62957
+ headerType: this.rowHeaderTitle?.headerType ?? 'text',
62958
+ style: this.rowHeaderTitle?.headerStyle,
62305
62959
  define: {
62306
62960
  field: '',
62307
62961
  headerType: 'text',
62308
62962
  cellType: 'text',
62309
- disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
62310
- disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
62963
+ disableHeaderHover: !!this.rowHeaderTitle?.disableHeaderHover,
62964
+ disableHeaderSelect: !!this.rowHeaderTitle?.disableHeaderSelect
62311
62965
  }
62312
62966
  };
62313
62967
  this.rowHeaderObjs.push(cell);
@@ -62324,7 +62978,7 @@
62324
62978
  }, {});
62325
62979
  this._CellHeaderPathMap = new Map();
62326
62980
  this._largeCellRangeCache.length = 0;
62327
- const diffCell = diffCellAddress(col, row, oldRowHeaderCellIds.map(oldCellId => oldCellId[col]), this._rowHeaderCellIds_FULL.map(newCellId => newCellId[col]), oldRowHeaderCellPositons, this);
62981
+ const diffCell = diffCellAddress(col, row, oldRowHeaderCellIds.map(oldCellId => oldCellId[col - this.leftRowSeriesNumberColumnCount]), this._rowHeaderCellIds_FULL.map(newCellId => newCellId[col - this.leftRowSeriesNumberColumnCount]), oldRowHeaderCellPositons, this);
62328
62982
  this._rowHeaderCellIds = this._rowHeaderCellIds_FULL.slice();
62329
62983
  return diffCell;
62330
62984
  }
@@ -62351,10 +63005,14 @@
62351
63005
  if (this.rowHierarchyType === 'grid') {
62352
63006
  col = this.rowDimensionKeys.indexOf(highlightDimension.dimensionKey);
62353
63007
  }
62354
- return col === -1 ? undefined : { col: this.rowHeaderTitle ? col + 1 : col, row: 0 };
63008
+ return col === -1
63009
+ ? undefined
63010
+ : { col: (this.rowHeaderTitle ? col + 1 : col) + this.leftRowSeriesNumberColumnCount, row: 0 };
62355
63011
  }
62356
63012
  const row = this.colDimensionKeys.indexOf(highlightDimension.dimensionKey);
62357
- return row === -1 ? undefined : { col: 0, row: this.columnHeaderTitle ? row + 1 : row };
63013
+ return row === -1
63014
+ ? undefined
63015
+ : { col: 0 + this.leftRowSeriesNumberColumnCount, row: this.columnHeaderTitle ? row + 1 : row };
62358
63016
  }
62359
63017
  let isCol = false;
62360
63018
  for (let j = 0; j < colArr.length; j++) {
@@ -62389,15 +63047,15 @@
62389
63047
  const { startInTotal, level } = rowDimension;
62390
63048
  row += startInTotal;
62391
63049
  if (this.rowHierarchyType === 'grid') {
62392
- col = this.rowHeaderTitle ? level + 1 : level;
63050
+ col = (this.rowHeaderTitle ? level + 1 : level) + this.leftRowSeriesNumberColumnCount;
62393
63051
  }
62394
63052
  else {
62395
- col = 0;
63053
+ col = 0 + this.leftRowSeriesNumberColumnCount;
62396
63054
  }
62397
63055
  return { col, row };
62398
63056
  }
62399
63057
  else if (colDimension) {
62400
- col = this.rowHeaderLevelCount;
63058
+ col = this.rowHeaderLevelCount + this.leftRowSeriesNumberColumnCount;
62401
63059
  const { startInTotal, level } = colDimension;
62402
63060
  col += startInTotal;
62403
63061
  row = this.columnHeaderTitle ? level + 1 : level;
@@ -62431,7 +63089,7 @@
62431
63089
  else if (this.isCornerHeader(col, row)) {
62432
63090
  if (this?.cornerSetting?.titleOnDimension === 'row') {
62433
63091
  pivotInfo.push({
62434
- dimensionKey: this.rowDimensionKeys[this.rowHeaderTitle ? col - 1 : col],
63092
+ dimensionKey: this.rowDimensionKeys[(this.rowHeaderTitle ? col - 1 : col) - this.leftRowSeriesNumberColumnCount],
62435
63093
  isPivotCorner: true
62436
63094
  });
62437
63095
  }
@@ -62482,9 +63140,16 @@
62482
63140
  return undefined;
62483
63141
  }
62484
63142
  canMoveHeaderPosition(source, target) {
63143
+ if (this.isSeriesNumberInHeader(target.col, target.row) || this.isSeriesNumberInHeader(source.col, source.row)) {
63144
+ return false;
63145
+ }
62485
63146
  if (source.col < 0 || source.row < 0 || target.col < 0 || target.row < 0) {
62486
63147
  return false;
62487
63148
  }
63149
+ if (this.isSeriesNumberInBody(target.col, target.row) && this.isSeriesNumberInBody(source.col, source.row)) {
63150
+ source.col = source.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1;
63151
+ target.col = target.col + this.leftRowSeriesNumberColumnCount + this.rowHeaderLevelCount - 1;
63152
+ }
62488
63153
  const sourceCellRange = this.getCellRange(source.col, source.row);
62489
63154
  if (this.isColumnHeader(source.col, source.row)) {
62490
63155
  const sourceTopId = this.getParentCellId(source.col, sourceCellRange.start.row);
@@ -62538,14 +63203,14 @@
62538
63203
  return null;
62539
63204
  }
62540
63205
  for (let row = 0; row < this._columnHeaderCellIds.length; row++) {
62541
- const sourceIds = this._columnHeaderCellIds[row].splice(sourceCellRange.start.col - this.rowHeaderLevelCount, sourceSize);
62542
- sourceIds.unshift(targetIndex - this.rowHeaderLevelCount, 0);
63206
+ const sourceIds = this._columnHeaderCellIds[row].splice(sourceCellRange.start.col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, sourceSize);
63207
+ sourceIds.unshift(targetIndex - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, 0);
62543
63208
  Array.prototype.splice.apply(this._columnHeaderCellIds[row], sourceIds);
62544
63209
  }
62545
- const sourceColumns = this._columnWidths.splice(sourceCellRange.start.col, sourceSize);
62546
- sourceColumns.unshift(targetIndex, 0);
63210
+ const sourceColumns = this._columnWidths.splice(sourceCellRange.start.col - this.leftRowSeriesNumberColumnCount, sourceSize);
63211
+ sourceColumns.unshift((targetIndex - this.leftRowSeriesNumberColumnCount), 0);
62547
63212
  Array.prototype.splice.apply(this._columnWidths, sourceColumns);
62548
- this.columnDimensionTree.movePosition(this.getCellHeaderPathsWidthTreeNode(source.col, source.row).colHeaderPaths.length - 1, sourceCellRange.start.col - this.rowHeaderLevelCount, targetCellRange.start.col - this.rowHeaderLevelCount);
63213
+ this.columnDimensionTree.movePosition(this.getCellHeaderPathsWidthTreeNode(source.col, source.row).colHeaderPaths.length - 1, sourceCellRange.start.col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount, targetCellRange.start.col - this.rowHeaderLevelCount - this.leftRowSeriesNumberColumnCount);
62549
63214
  this.columnDimensionTree.reset(this.columnDimensionTree.tree.children, true);
62550
63215
  this._CellHeaderPathMap = new Map();
62551
63216
  this._largeCellRangeCache.length = 0;
@@ -62697,7 +63362,7 @@
62697
63362
  dimension.indicatorKey === rowDimension.indicatorKey &&
62698
63363
  (!rowDimension.value || dimension.value === rowDimension.value))) {
62699
63364
  rowArr = dimension.children;
62700
- if (needLowestLevel && (!rowArr || rowArr.some(row => row.dimensionKey === 'axis'))) {
63365
+ if (needLowestLevel && !rowArr) {
62701
63366
  rowDimensionFinded = dimension;
62702
63367
  }
62703
63368
  else if (!needLowestLevel) {
@@ -62719,7 +63384,7 @@
62719
63384
  const { startInTotal, level } = rowDimensionFinded ?? defaultDimension;
62720
63385
  row += startInTotal ?? 0;
62721
63386
  if (this.rowHierarchyType === 'grid') {
62722
- defaultCol = this.rowHeaderTitle ? level + 1 : level;
63387
+ defaultCol = (this.rowHeaderTitle ? level + 1 : level) + this.leftRowSeriesNumberColumnCount;
62723
63388
  }
62724
63389
  else {
62725
63390
  defaultCol = 0;
@@ -63232,6 +63897,75 @@
63232
63897
  }, {});
63233
63898
  this.setPagination(this.pagination);
63234
63899
  }
63900
+ isSeriesNumberInHeader(col, row) {
63901
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount) {
63902
+ if (row < this.headerLevelCount) {
63903
+ return true;
63904
+ }
63905
+ }
63906
+ if (this.rightRowSeriesNumberColumnCount > 0 &&
63907
+ row >= 0 &&
63908
+ col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
63909
+ if (row < this.headerLevelCount) {
63910
+ return true;
63911
+ }
63912
+ }
63913
+ return false;
63914
+ }
63915
+ isSeriesNumberInBody(col, row) {
63916
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
63917
+ if (row >= this.headerLevelCount) {
63918
+ return true;
63919
+ }
63920
+ }
63921
+ if (this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
63922
+ if (row >= this.headerLevelCount) {
63923
+ return true;
63924
+ }
63925
+ }
63926
+ return false;
63927
+ }
63928
+ isSeriesNumber(col, row) {
63929
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && row >= 0 && col < this.leftRowSeriesNumberColumnCount) {
63930
+ return true;
63931
+ }
63932
+ if (this.rightRowSeriesNumberColumnCount > 0 &&
63933
+ row >= 0 &&
63934
+ col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
63935
+ return true;
63936
+ }
63937
+ return false;
63938
+ }
63939
+ getSeriesNumberHeader(col, row) {
63940
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
63941
+ if (row < this.headerLevelCount) {
63942
+ return Object.assign({}, this.leftRowSeriesNumberColumn[col], {
63943
+ style: this._table.internalProps.rowSeriesNumber.headerStyle
63944
+ });
63945
+ }
63946
+ }
63947
+ if (this.rightRowSeriesNumberColumnCount > 0 &&
63948
+ col >= this.colCount - this.rightRowSeriesNumberColumnCount &&
63949
+ row < this.headerLevelCount) {
63950
+ if (row < this.headerLevelCount) {
63951
+ return this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)];
63952
+ }
63953
+ }
63954
+ return undefined;
63955
+ }
63956
+ getSeriesNumberBody(col, row) {
63957
+ if (this.leftRowSeriesNumberColumnCount > 0 && col >= 0 && col < this.leftRowSeriesNumberColumnCount) {
63958
+ if (row >= this.headerLevelCount) {
63959
+ return this.leftRowSeriesNumberColumn[col];
63960
+ }
63961
+ }
63962
+ if (this.rightRowSeriesNumberColumnCount > 0 && col >= this.colCount - this.rightRowSeriesNumberColumnCount) {
63963
+ if (row >= this.headerLevelCount) {
63964
+ return this.rightRowSeriesNumberColumn[col - (this.colCount - this.rightRowSeriesNumberColumnCount)];
63965
+ }
63966
+ }
63967
+ return undefined;
63968
+ }
63235
63969
  }
63236
63970
  function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {
63237
63971
  if (paddingInner === 1) {
@@ -64769,7 +65503,7 @@
64769
65503
  }
64770
65504
  table.colCount = layoutMap.colCount ?? 0;
64771
65505
  table.rowCount = layoutMap.rowCount ?? 0;
64772
- table.internalProps.frozenColCount = layoutMap.rowHeaderLevelCount ?? 0;
65506
+ this.internalProps.frozenColCount = Math.max((layoutMap.rowHeaderLevelCount ?? 0) + layoutMap.leftRowSeriesNumberColumnCount, this.options.frozenColCount ?? 0);
64773
65507
  table.frozenRowCount = layoutMap.headerLevelCount;
64774
65508
  if (table.bottomFrozenRowCount !== (this.options.bottomFrozenRowCount ?? 0)) {
64775
65509
  table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
@@ -64861,7 +65595,15 @@
64861
65595
  if (customMergeText) {
64862
65596
  return customMergeText;
64863
65597
  }
64864
- if (this.internalProps.layoutMap.isHeader(col, row)) {
65598
+ if (this.internalProps.layoutMap.isSeriesNumber(col, row)) {
65599
+ if (this.internalProps.layoutMap.isSeriesNumberInHeader(col, row)) {
65600
+ const { title } = this.internalProps.layoutMap.getSeriesNumberHeader(col, row);
65601
+ return title;
65602
+ }
65603
+ const { format } = this.internalProps.layoutMap.getSeriesNumberBody(col, row);
65604
+ return typeof format === 'function' ? format(col, row, this) : row - this.columnHeaderLevelCount + 1;
65605
+ }
65606
+ else if (this.internalProps.layoutMap.isHeader(col, row)) {
64865
65607
  const { title, fieldFormat } = this.internalProps.layoutMap.getHeader(col, row);
64866
65608
  return typeof fieldFormat === 'function' ? fieldFormat(title, col, row, this) : title;
64867
65609
  }
@@ -65417,6 +66159,8 @@
65417
66159
  }
65418
66160
  return false;
65419
66161
  }
66162
+ changeRecordOrder(source, target) {
66163
+ }
65420
66164
  }
65421
66165
 
65422
66166
  class PivotChart extends BaseTable {
@@ -66308,6 +67052,8 @@
66308
67052
  }
66309
67053
  return false;
66310
67054
  }
67055
+ changeRecordOrder(source, target) {
67056
+ }
66311
67057
  }
66312
67058
 
66313
67059
  class Circle extends Circle$1 {
@@ -66817,7 +67563,7 @@
66817
67563
  }
66818
67564
 
66819
67565
  registerForVrender();
66820
- const version = "0.21.4-alpha.4";
67566
+ const version = "0.22.0";
66821
67567
  function getIcons() {
66822
67568
  return get$2();
66823
67569
  }