@visactor/vtable 0.19.1-alpha.0 → 0.19.1

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 (145) hide show
  1. package/cjs/ListTable.js +4 -4
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.js +2 -1
  4. package/cjs/PivotChart.js.map +1 -1
  5. package/cjs/PivotTable.js +2 -2
  6. package/cjs/PivotTable.js.map +1 -1
  7. package/cjs/core/BaseTable.d.ts +0 -1
  8. package/cjs/core/BaseTable.js +12 -12
  9. package/cjs/core/BaseTable.js.map +1 -1
  10. package/cjs/dataset/dataset.js +43 -42
  11. package/cjs/dataset/dataset.js.map +1 -1
  12. package/cjs/edit/edit-manager.js +8 -8
  13. package/cjs/edit/edit-manager.js.map +1 -1
  14. package/cjs/event/listener/container-dom.js +2 -2
  15. package/cjs/event/listener/container-dom.js.map +1 -1
  16. package/cjs/header-helper/header-helper.js +2 -2
  17. package/cjs/header-helper/header-helper.js.map +1 -1
  18. package/cjs/index.d.ts +1 -1
  19. package/cjs/index.js +1 -1
  20. package/cjs/index.js.map +1 -1
  21. package/cjs/layout/pivot-header-layout.d.ts +3 -1
  22. package/cjs/layout/pivot-header-layout.js +55 -38
  23. package/cjs/layout/pivot-header-layout.js.map +1 -1
  24. package/cjs/layout/row-height-map.d.ts +1 -0
  25. package/cjs/layout/row-height-map.js +3 -0
  26. package/cjs/layout/row-height-map.js.map +1 -1
  27. package/cjs/scenegraph/component/custom.js +7 -7
  28. package/cjs/scenegraph/component/custom.js.map +1 -1
  29. package/cjs/scenegraph/graphic/group.d.ts +1 -0
  30. package/cjs/scenegraph/graphic/group.js +10 -0
  31. package/cjs/scenegraph/graphic/group.js.map +1 -1
  32. package/cjs/scenegraph/group-creater/cell-helper.js +6 -1
  33. package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
  34. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +4 -3
  35. package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  36. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +3 -2
  37. package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  38. package/cjs/scenegraph/group-creater/cell-type/image-cell.js +3 -2
  39. package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  40. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +3 -2
  41. package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  42. package/cjs/scenegraph/group-creater/cell-type/text-cell.js +6 -5
  43. package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  44. package/cjs/scenegraph/group-creater/cell-type/video-cell.js +3 -2
  45. package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  46. package/cjs/scenegraph/group-creater/progress/proxy.js +7 -3
  47. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  48. package/cjs/scenegraph/icon/icon-update.js +6 -2
  49. package/cjs/scenegraph/icon/icon-update.js.map +1 -1
  50. package/cjs/scenegraph/layout/compute-row-height.js +7 -9
  51. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  52. package/cjs/scenegraph/layout/update-height.js +4 -2
  53. package/cjs/scenegraph/layout/update-height.js.map +1 -1
  54. package/cjs/scenegraph/layout/update-width.js +4 -2
  55. package/cjs/scenegraph/layout/update-width.js.map +1 -1
  56. package/cjs/scenegraph/stick-text/index.js +13 -5
  57. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  58. package/cjs/scenegraph/utils/text-icon-layout.js +3 -2
  59. package/cjs/scenegraph/utils/text-icon-layout.js.map +1 -1
  60. package/cjs/state/hover/is-cell-hover.js +8 -4
  61. package/cjs/state/hover/is-cell-hover.js.map +1 -1
  62. package/cjs/state/hover/update-cell.js +8 -4
  63. package/cjs/state/hover/update-cell.js.map +1 -1
  64. package/cjs/tools/merge-range.d.ts +8 -0
  65. package/cjs/tools/merge-range.js +19 -0
  66. package/cjs/tools/merge-range.js.map +1 -0
  67. package/cjs/ts-types/customElement.d.ts +1 -0
  68. package/cjs/ts-types/customElement.js.map +1 -1
  69. package/cjs/ts-types/new-data-set.js.map +1 -1
  70. package/cjs/ts-types/table-engine.js.map +1 -1
  71. package/cjs/vrender.js.map +1 -1
  72. package/dist/vtable.js +257 -134
  73. package/dist/vtable.min.js +2 -2
  74. package/es/ListTable.js +4 -4
  75. package/es/ListTable.js.map +1 -1
  76. package/es/PivotChart.js +2 -1
  77. package/es/PivotChart.js.map +1 -1
  78. package/es/PivotTable.js +2 -2
  79. package/es/PivotTable.js.map +1 -1
  80. package/es/core/BaseTable.d.ts +0 -1
  81. package/es/core/BaseTable.js +12 -12
  82. package/es/core/BaseTable.js.map +1 -1
  83. package/es/dataset/dataset.js +43 -42
  84. package/es/dataset/dataset.js.map +1 -1
  85. package/es/edit/edit-manager.js +8 -8
  86. package/es/edit/edit-manager.js.map +1 -1
  87. package/es/event/listener/container-dom.js +2 -2
  88. package/es/event/listener/container-dom.js.map +1 -1
  89. package/es/header-helper/header-helper.js +3 -1
  90. package/es/header-helper/header-helper.js.map +1 -1
  91. package/es/index.d.ts +1 -1
  92. package/es/index.js +1 -1
  93. package/es/index.js.map +1 -1
  94. package/es/layout/pivot-header-layout.d.ts +3 -1
  95. package/es/layout/pivot-header-layout.js +54 -38
  96. package/es/layout/pivot-header-layout.js.map +1 -1
  97. package/es/layout/row-height-map.d.ts +1 -0
  98. package/es/layout/row-height-map.js +3 -0
  99. package/es/layout/row-height-map.js.map +1 -1
  100. package/es/scenegraph/component/custom.js +7 -7
  101. package/es/scenegraph/component/custom.js.map +1 -1
  102. package/es/scenegraph/graphic/group.d.ts +1 -0
  103. package/es/scenegraph/graphic/group.js +10 -0
  104. package/es/scenegraph/graphic/group.js.map +1 -1
  105. package/es/scenegraph/group-creater/cell-helper.js +6 -1
  106. package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
  107. package/es/scenegraph/group-creater/cell-type/chart-cell.js +4 -3
  108. package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
  109. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +3 -2
  110. package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
  111. package/es/scenegraph/group-creater/cell-type/image-cell.js +3 -2
  112. package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
  113. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +3 -2
  114. package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
  115. package/es/scenegraph/group-creater/cell-type/text-cell.js +6 -5
  116. package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
  117. package/es/scenegraph/group-creater/cell-type/video-cell.js +3 -2
  118. package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
  119. package/es/scenegraph/group-creater/progress/proxy.js +7 -3
  120. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  121. package/es/scenegraph/icon/icon-update.js +6 -1
  122. package/es/scenegraph/icon/icon-update.js.map +1 -1
  123. package/es/scenegraph/layout/compute-row-height.js +7 -9
  124. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  125. package/es/scenegraph/layout/update-height.js +4 -1
  126. package/es/scenegraph/layout/update-height.js.map +1 -1
  127. package/es/scenegraph/layout/update-width.js +4 -1
  128. package/es/scenegraph/layout/update-width.js.map +1 -1
  129. package/es/scenegraph/stick-text/index.js +12 -4
  130. package/es/scenegraph/stick-text/index.js.map +1 -1
  131. package/es/scenegraph/utils/text-icon-layout.js +3 -2
  132. package/es/scenegraph/utils/text-icon-layout.js.map +1 -1
  133. package/es/state/hover/is-cell-hover.js +8 -3
  134. package/es/state/hover/is-cell-hover.js.map +1 -1
  135. package/es/state/hover/update-cell.js +8 -3
  136. package/es/state/hover/update-cell.js.map +1 -1
  137. package/es/tools/merge-range.d.ts +8 -0
  138. package/es/tools/merge-range.js +13 -0
  139. package/es/tools/merge-range.js.map +1 -0
  140. package/es/ts-types/customElement.d.ts +1 -0
  141. package/es/ts-types/customElement.js.map +1 -1
  142. package/es/ts-types/new-data-set.js.map +1 -1
  143. package/es/ts-types/table-engine.js.map +1 -1
  144. package/es/vrender.js.map +1 -1
  145. package/package.json +5 -5
package/dist/vtable.js CHANGED
@@ -32501,6 +32501,22 @@
32501
32501
  }
32502
32502
  return null;
32503
32503
  }
32504
+ addCellGroup(cellGroup) {
32505
+ if (this.childrenCount === 0 || this.lastChild.row === cellGroup.row - 1) {
32506
+ this.addChild(cellGroup);
32507
+ }
32508
+ else {
32509
+ let c = this._firstChild;
32510
+ for (let i = 0; i < this.childrenCount; i++) {
32511
+ if (c.row === cellGroup.row - 1) {
32512
+ this.insertAfter(cellGroup, c);
32513
+ return;
32514
+ }
32515
+ c = c._next;
32516
+ }
32517
+ this.addChild(cellGroup);
32518
+ }
32519
+ }
32504
32520
  getChildAt(index) {
32505
32521
  const child = super.getChildAt(index);
32506
32522
  if (child && child.name === 'border-rect') {
@@ -32743,6 +32759,7 @@
32743
32759
  strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
32744
32760
  strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
32745
32761
  cursor: cellTheme?.group?.cursor ?? undefined,
32762
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
32746
32763
  lineCap: 'square',
32747
32764
  clip: true,
32748
32765
  cornerRadius: cellTheme.group.cornerRadius
@@ -32750,7 +32767,7 @@
32750
32767
  cellGroup.role = 'cell';
32751
32768
  cellGroup.col = col;
32752
32769
  cellGroup.row = row;
32753
- columnGroup?.addChild(cellGroup);
32770
+ columnGroup?.addCellGroup(cellGroup);
32754
32771
  }
32755
32772
  cellGroup.AABBBounds.width();
32756
32773
  const chartGroup = new Chart({
@@ -33133,6 +33150,7 @@
33133
33150
  strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
33134
33151
  strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
33135
33152
  cursor: cellTheme?.group?.cursor ?? undefined,
33153
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
33136
33154
  lineCap: 'square',
33137
33155
  clip: true,
33138
33156
  cornerRadius: cellTheme.group.cornerRadius
@@ -33140,7 +33158,7 @@
33140
33158
  cellGroup.role = 'cell';
33141
33159
  cellGroup.col = col;
33142
33160
  cellGroup.row = row;
33143
- columnGroup?.addChild(cellGroup);
33161
+ columnGroup?.addCellGroup(cellGroup);
33144
33162
  const value = table.getCellValue(col, row);
33145
33163
  const image = createImage({
33146
33164
  x: padding[3],
@@ -33781,6 +33799,7 @@
33781
33799
  strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
33782
33800
  strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
33783
33801
  cursor: cellTheme?.group?.cursor ?? undefined,
33802
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
33784
33803
  lineCap: 'square',
33785
33804
  clip: true,
33786
33805
  cornerRadius: cellTheme.group.cornerRadius
@@ -33788,7 +33807,7 @@
33788
33807
  cellGroup.role = 'cell';
33789
33808
  cellGroup.col = col;
33790
33809
  cellGroup.row = row;
33791
- columnGroup?.addChild(cellGroup);
33810
+ columnGroup?.addCellGroup(cellGroup);
33792
33811
  }
33793
33812
  const chartGroup = createSparkLine(col, row, width, height, padding, table);
33794
33813
  if (chartGroup) {
@@ -34543,11 +34562,11 @@
34543
34562
  child.setAttribute('x', child.attribute.x + detaX);
34544
34563
  }
34545
34564
  else if (child.name === 'content' || child.name === 'text') {
34546
- child.AABBBounds.width();
34547
- if (textAlign === 'center') {
34565
+ const childTextAlign = child.attribute.textAlign ?? textAlign;
34566
+ if (childTextAlign === 'center') {
34548
34567
  child.setAttribute('x', padding[3] + leftIconWidth + (distWidth - (padding[1] + padding[3]) - leftIconWidth - rightIconWidth) / 2);
34549
34568
  }
34550
- else if (textAlign === 'right') {
34569
+ else if (childTextAlign === 'right') {
34551
34570
  child.setAttribute('x', padding[3] + distWidth - (padding[1] + padding[3]) - rightIconWidth);
34552
34571
  }
34553
34572
  else ;
@@ -34690,6 +34709,7 @@
34690
34709
  strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
34691
34710
  strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
34692
34711
  cursor: cellTheme?.group?.cursor ?? undefined,
34712
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
34693
34713
  lineCap: 'square',
34694
34714
  clip: true,
34695
34715
  cornerRadius: cellTheme.group.cornerRadius
@@ -34697,7 +34717,7 @@
34697
34717
  cellGroup.role = 'cell';
34698
34718
  cellGroup.col = col;
34699
34719
  cellGroup.row = row;
34700
- columnGroup?.addChild(cellGroup);
34720
+ columnGroup?.addCellGroup(cellGroup);
34701
34721
  if (customElementsGroup) {
34702
34722
  cellGroup.appendChild(customElementsGroup);
34703
34723
  }
@@ -34761,6 +34781,7 @@
34761
34781
  strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
34762
34782
  strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
34763
34783
  cursor: cellTheme?.group?.cursor ?? undefined,
34784
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
34764
34785
  lineCap: 'square',
34765
34786
  clip: true,
34766
34787
  cornerRadius: cellTheme.group.cornerRadius
@@ -34768,7 +34789,7 @@
34768
34789
  cellGroup.role = 'cell';
34769
34790
  cellGroup.col = col;
34770
34791
  cellGroup.row = row;
34771
- columnGroup?.addChild(cellGroup);
34792
+ columnGroup?.addCellGroup(cellGroup);
34772
34793
  const value = table.getCellValue(col, row);
34773
34794
  const video = document.createElement('video');
34774
34795
  video.addEventListener('loadeddata', () => {
@@ -34853,6 +34874,7 @@
34853
34874
  strokeArrayWidth: cellTheme?.group?.strokeArrayWidth ?? undefined,
34854
34875
  strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
34855
34876
  cursor: cellTheme?.group?.cursor ?? undefined,
34877
+ lineDash: cellTheme?.group?.lineDash ?? undefined,
34856
34878
  lineCap: 'square',
34857
34879
  clip: true,
34858
34880
  cornerRadius: cellTheme.group.cornerRadius
@@ -34860,7 +34882,7 @@
34860
34882
  cellGroup.role = 'cell';
34861
34883
  cellGroup.col = col;
34862
34884
  cellGroup.row = row;
34863
- columnGroup?.addChild(cellGroup);
34885
+ columnGroup?.addCellGroup(cellGroup);
34864
34886
  }
34865
34887
  const checkboxComponent = createCheckbox(col, row, colWidth, width, height, padding, cellTheme, define, table);
34866
34888
  if (checkboxComponent) {
@@ -35182,6 +35204,12 @@
35182
35204
  cornerRadius: cellTheme?.group?.cornerRadius ?? 0,
35183
35205
  y: table.scenegraph.getCellGroupY(row)
35184
35206
  });
35207
+ oldCellGroup.forEachChildren((child) => {
35208
+ child.setAttributes({
35209
+ dx: 0,
35210
+ dy: 0
35211
+ });
35212
+ });
35185
35213
  const textMark = oldCellGroup.getChildByName('text');
35186
35214
  if (textMark) {
35187
35215
  const text = table.getCellValue(col, row);
@@ -35611,6 +35639,7 @@
35611
35639
  pickable: !!element.pickable,
35612
35640
  cursor: element.cursor
35613
35641
  });
35642
+ arc.name = element.name;
35614
35643
  customGroup.appendChild(arc);
35615
35644
  break;
35616
35645
  case 'text':
@@ -35633,6 +35662,7 @@
35633
35662
  pickable: !!element.pickable,
35634
35663
  fill: element.color ?? element.fill
35635
35664
  }, element));
35665
+ text.name = element.name;
35636
35666
  customGroup.appendChild(text);
35637
35667
  break;
35638
35668
  case 'rect':
@@ -35649,6 +35679,7 @@
35649
35679
  pickable: !!element.pickable,
35650
35680
  cursor: element.cursor
35651
35681
  });
35682
+ rect.name = element.name;
35652
35683
  customGroup.appendChild(rect);
35653
35684
  break;
35654
35685
  case 'circle':
@@ -35663,6 +35694,7 @@
35663
35694
  pickable: !!element.pickable,
35664
35695
  cursor: element.cursor
35665
35696
  });
35697
+ circle.name = element.name;
35666
35698
  customGroup.appendChild(circle);
35667
35699
  break;
35668
35700
  case 'icon':
@@ -35680,6 +35712,7 @@
35680
35712
  pickable: !!element.pickable,
35681
35713
  cursor: element.cursor
35682
35714
  });
35715
+ icon.name = element.name;
35683
35716
  icon.role = 'icon-custom';
35684
35717
  customGroup.appendChild(icon);
35685
35718
  break;
@@ -35699,6 +35732,7 @@
35699
35732
  cursor: element.cursor,
35700
35733
  shape: element.shape
35701
35734
  });
35735
+ image.name = element.name;
35702
35736
  image.role = 'image-custom';
35703
35737
  customGroup.appendChild(image);
35704
35738
  break;
@@ -35709,6 +35743,7 @@
35709
35743
  pickable: !!element.pickable,
35710
35744
  cursor: element.cursor
35711
35745
  });
35746
+ line.name = element.name;
35712
35747
  customGroup.appendChild(line);
35713
35748
  break;
35714
35749
  }
@@ -36821,7 +36856,7 @@
36821
36856
  const oldRowHeights = [];
36822
36857
  const newHeights = [];
36823
36858
  if (update) {
36824
- for (let row = 0; row < table.rowCount; row++) {
36859
+ for (let row = rowStart; row <= rowEnd; row++) {
36825
36860
  oldRowHeights[row] = table.getRowHeight(row);
36826
36861
  }
36827
36862
  }
@@ -36911,9 +36946,13 @@
36911
36946
  }
36912
36947
  }
36913
36948
  else {
36914
- table.clearRowHeightCache();
36915
- for (let row = 0; row < table.rowCount; row++) {
36916
- newHeights[row] = table.getRowHeight(row);
36949
+ if (table.rowCount !== table.rowHeightsMap.length) {
36950
+ table.clearRowHeightCache();
36951
+ }
36952
+ if (update) {
36953
+ for (let row = rowStart; row <= rowEnd; row++) {
36954
+ newHeights[row] = table.getRowHeight(row);
36955
+ }
36917
36956
  }
36918
36957
  }
36919
36958
  if ((rowStart === 0 && rowEnd === table.rowCount - 1) || isClearRowRangeHeightsMap) {
@@ -36962,7 +37001,7 @@
36962
37001
  let actualHeight = 0;
36963
37002
  let actualHeaderHeight = 0;
36964
37003
  for (let row = 0; row < table.rowCount; row++) {
36965
- const rowHeight = update ? newHeights[row] : table.getRowHeight(row);
37004
+ const rowHeight = update ? newHeights[row] ?? table.getRowHeight(row) : table.getRowHeight(row);
36966
37005
  if (row < table.columnHeaderLevelCount ||
36967
37006
  (table.isPivotChart() && row >= table.rowCount - table.bottomFrozenRowCount)) {
36968
37007
  actualHeaderHeight += rowHeight;
@@ -37002,7 +37041,7 @@
37002
37041
  }
37003
37042
  }
37004
37043
  if (update) {
37005
- for (let row = 0; row < table.rowCount; row++) {
37044
+ for (let row = rowStart; row <= rowEnd; row++) {
37006
37045
  const newRowHeight = newHeights[row] ?? table.getRowHeight(row);
37007
37046
  if (newRowHeight !== oldRowHeights[row]) {
37008
37047
  table._setRowHeight(row, newRowHeight);
@@ -37370,6 +37409,29 @@
37370
37409
  };
37371
37410
  }
37372
37411
 
37412
+ function getCellMergeRange(cellGroup, scene) {
37413
+ const { mergeStartCol, mergeEndCol, mergeStartRow, mergeEndRow, col, row } = cellGroup;
37414
+ const { colStart, colEnd, rowStart, rowEnd, bodyLeftCol, bodyRightCol, bodyTopRow, bodyBottomRow } = scene.proxy;
37415
+ let cellRangeColStart = mergeStartCol;
37416
+ let cellRangeColEnd = mergeEndCol;
37417
+ let cellRangeRowStart = mergeStartRow;
37418
+ let cellRangeRowEnd = mergeEndRow;
37419
+ if (col >= bodyLeftCol && col <= bodyRightCol) {
37420
+ cellRangeColStart = Math.max(cellGroup.mergeStartCol, colStart);
37421
+ cellRangeColEnd = Math.min(cellGroup.mergeEndCol, colEnd);
37422
+ }
37423
+ if (row >= bodyTopRow && row <= bodyBottomRow) {
37424
+ cellRangeRowStart = Math.max(cellGroup.mergeStartRow, rowStart);
37425
+ cellRangeRowEnd = Math.min(cellGroup.mergeEndRow, rowEnd);
37426
+ }
37427
+ return {
37428
+ colStart: cellRangeColStart,
37429
+ colEnd: cellRangeColEnd,
37430
+ rowStart: cellRangeRowStart,
37431
+ rowEnd: cellRangeRowEnd
37432
+ };
37433
+ }
37434
+
37373
37435
  function updateRowHeight(scene, row, detaY, skipTableHeightMap) {
37374
37436
  if (!skipTableHeightMap) {
37375
37437
  scene.table._setRowHeight(row, scene.table.getRowHeight(row) + detaY, true);
@@ -37500,8 +37562,9 @@
37500
37562
  for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
37501
37563
  distHeight += table.getRowHeight(row);
37502
37564
  }
37503
- for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
37504
- for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
37565
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
37566
+ for (let col = colStart; col <= colEnd; col++) {
37567
+ for (let row = rowStart; row <= rowEnd; row++) {
37505
37568
  const singleCellGroup = table.scenegraph.getCell(col, row);
37506
37569
  singleCellGroup.forEachChildren((child) => {
37507
37570
  child.setAttributes({
@@ -37806,8 +37869,9 @@
37806
37869
  for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
37807
37870
  cellHeight += table.getRowHeight(row);
37808
37871
  }
37809
- for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
37810
- for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
37872
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
37873
+ for (let col = colStart; col <= colEnd; col++) {
37874
+ for (let row = rowStart; row <= rowEnd; row++) {
37811
37875
  const singleCellGroup = table.scenegraph.getCell(col, row);
37812
37876
  singleCellGroup.forEachChildren((child) => {
37813
37877
  child.setAttributes({
@@ -39303,8 +39367,9 @@
39303
39367
  isValid$1(cellGroup.mergeStartRow) &&
39304
39368
  isValid$1(cellGroup.mergeEndCol) &&
39305
39369
  isValid$1(cellGroup.mergeEndRow)) {
39306
- for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
39307
- for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
39370
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
39371
+ for (let col = colStart; col <= colEnd; col++) {
39372
+ for (let row = rowStart; row <= rowEnd; row++) {
39308
39373
  const key = isCellHover(table.stateManager, col, row, cellGroup);
39309
39374
  if (key && (!colorKey || key === 'cellBgColor')) {
39310
39375
  colorKey = key;
@@ -41527,6 +41592,10 @@
41527
41592
  }
41528
41593
  updateCellGroupPosition(cellGroup, newRow, y) {
41529
41594
  cellGroup.row = newRow;
41595
+ cellGroup.mergeStartCol = undefined;
41596
+ cellGroup.mergeStartRow = undefined;
41597
+ cellGroup.mergeEndCol = undefined;
41598
+ cellGroup.mergeEndRow = undefined;
41530
41599
  cellGroup.setAttribute('y', y);
41531
41600
  cellGroup.needUpdate = true;
41532
41601
  cellGroup.needUpdateForAutoRowHeight = true;
@@ -41589,10 +41658,15 @@
41589
41658
  if (cacheCellGroup.row === row) {
41590
41659
  return cacheCellGroup;
41591
41660
  }
41592
- else if (cacheCellGroup.row > row) {
41593
- return getCellByCache(cacheCellGroup._prev, row);
41661
+ const prev = cacheCellGroup._prev;
41662
+ const next = cacheCellGroup._next;
41663
+ if (cacheCellGroup.row > row && prev && prev.row === row - 1) {
41664
+ return getCellByCache(prev, row);
41665
+ }
41666
+ if (cacheCellGroup.row < row && next && next.row === row + 1) {
41667
+ return getCellByCache(next, row);
41594
41668
  }
41595
- return getCellByCache(cacheCellGroup._next, row);
41669
+ return null;
41596
41670
  }
41597
41671
 
41598
41672
  function moveHeaderPosition(colSource, rowSource, colTarget, rowTarget, sourceMergeInfo, targetMergeInfo, table) {
@@ -42628,8 +42702,9 @@
42628
42702
  isNumber$2(cellGroup.mergeStartRow) &&
42629
42703
  isNumber$2(cellGroup.mergeEndCol) &&
42630
42704
  isNumber$2(cellGroup.mergeEndRow)) {
42631
- for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
42632
- for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
42705
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
42706
+ for (let col = colStart; col <= colEnd; col++) {
42707
+ for (let row = rowStart; row <= rowEnd; row++) {
42633
42708
  const singleCellGroup = table.scenegraph.getCell(col, row);
42634
42709
  dealVertical(singleCellGroup, minTop, maxTop, changedCells);
42635
42710
  }
@@ -42689,8 +42764,9 @@
42689
42764
  isNumber$2(cellGroup.mergeStartRow) &&
42690
42765
  isNumber$2(cellGroup.mergeEndCol) &&
42691
42766
  isNumber$2(cellGroup.mergeEndRow)) {
42692
- for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
42693
- for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
42767
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
42768
+ for (let col = colStart; col <= colEnd; col++) {
42769
+ for (let row = rowStart; row <= rowEnd; row++) {
42694
42770
  const singleCellGroup = table.scenegraph.getCell(col, row);
42695
42771
  dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells);
42696
42772
  }
@@ -43632,9 +43708,10 @@
43632
43708
  isValid$1(cellGroup.mergeStartRow) &&
43633
43709
  isValid$1(cellGroup.mergeEndCol) &&
43634
43710
  isValid$1(cellGroup.mergeEndRow)) {
43635
- for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
43636
- for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
43637
- updateCellGroupIcon(scene.getCell(col, row), filter, dealer);
43711
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, scene);
43712
+ for (let col = colStart; col <= colEnd; col++) {
43713
+ for (let row = rowStart; row <= rowEnd; row++) {
43714
+ updateCellGroupIcon(scene.highPerformanceGetCell(col, row), filter, dealer);
43638
43715
  }
43639
43716
  }
43640
43717
  }
@@ -45199,14 +45276,15 @@
45199
45276
  }
45200
45277
 
45201
45278
  function updateCell(scenegraph, col, row) {
45202
- const cellGroup = scenegraph.getCell(col, row);
45279
+ const cellGroup = scenegraph.highPerformanceGetCell(col, row);
45203
45280
  if (isValid$1(cellGroup.mergeStartCol) &&
45204
45281
  isValid$1(cellGroup.mergeStartRow) &&
45205
45282
  isValid$1(cellGroup.mergeEndCol) &&
45206
45283
  isValid$1(cellGroup.mergeEndRow)) {
45207
- for (let col = cellGroup.mergeStartCol; col <= cellGroup.mergeEndCol; col++) {
45208
- for (let row = cellGroup.mergeStartRow; row <= cellGroup.mergeEndRow; row++) {
45209
- const mergeCell = scenegraph.getCell(col, row);
45284
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, scenegraph);
45285
+ for (let col = colStart; col <= colEnd; col++) {
45286
+ for (let row = rowStart; row <= rowEnd; row++) {
45287
+ const mergeCell = scenegraph.highPerformanceGetCell(col, row);
45210
45288
  mergeCell.addUpdateBoundTag();
45211
45289
  }
45212
45290
  }
@@ -47995,9 +48073,9 @@
47995
48073
  if (table.editorManager.editingEditor) {
47996
48074
  table.editorManager.completeEdit();
47997
48075
  table.getElement().focus();
47998
- }
47999
- if (table.getEditor(targetCol, targetRow)) {
48000
- table.editorManager.startEditCell(targetCol, targetRow);
48076
+ if (table.getEditor(targetCol, targetRow)) {
48077
+ table.editorManager.startEditCell(targetCol, targetRow);
48078
+ }
48001
48079
  }
48002
48080
  }
48003
48081
  }
@@ -49652,7 +49730,10 @@
49652
49730
  getSortIcon(order, _table, col, row) {
49653
49731
  const icon = order === 'asc' ? this.downIcon : order === 'desc' ? this.upIcon : this.normalIcon;
49654
49732
  const headerC = _table.getHeaderDefine(col, row);
49655
- if (!headerC || !(headerC.showSort || headerC.sort) || (headerC.columns && headerC.columns.length > 0)) {
49733
+ if (!headerC ||
49734
+ headerC.showSort === false ||
49735
+ (!isValid$1(headerC.showSort) && !headerC.sort) ||
49736
+ (headerC.columns && headerC.columns.length > 0)) {
49656
49737
  return null;
49657
49738
  }
49658
49739
  return icon;
@@ -51385,6 +51466,9 @@
51385
51466
  this.totalSum = 0;
51386
51467
  this.table = table;
51387
51468
  }
51469
+ get length() {
51470
+ return this.data.size;
51471
+ }
51388
51472
  clear() {
51389
51473
  this.data.clear();
51390
51474
  this.cumulativeSum.clear();
@@ -51608,7 +51692,6 @@
51608
51692
  class BaseTable extends EventTarget$1 {
51609
51693
  internalProps;
51610
51694
  showFrozenIcon = true;
51611
- showSort = true;
51612
51695
  padding;
51613
51696
  globalDropDownMenu;
51614
51697
  tableNoFrameWidth;
@@ -51631,7 +51714,7 @@
51631
51714
  return TABLE_EVENT_TYPE;
51632
51715
  }
51633
51716
  options;
51634
- version = "0.19.1-alpha.0";
51717
+ version = "0.19.1";
51635
51718
  pagination;
51636
51719
  id = `VTable${Date.now()}`;
51637
51720
  headerStyleCache;
@@ -52257,7 +52340,6 @@
52257
52340
  }
52258
52341
  else {
52259
52342
  absoluteLeft = this.getColsWidth(0, col - 1) || 0;
52260
- absoluteLeft += this.scrollLeft;
52261
52343
  }
52262
52344
  }
52263
52345
  else {
@@ -52271,7 +52353,6 @@
52271
52353
  }
52272
52354
  else {
52273
52355
  absoluteTop = this.getRowsHeight(0, row - 1);
52274
- absoluteTop += this.scrollTop;
52275
52356
  }
52276
52357
  }
52277
52358
  else {
@@ -52368,20 +52449,19 @@
52368
52449
  const isFrozenEndCell = this.isFrozenCell(endCol, endRow);
52369
52450
  let absoluteLeft = this.getColsWidth(0, startCol - 1) || 0;
52370
52451
  let width = this.getColsWidth(startCol, endCol);
52371
- if (isFrozenStartCell && isFrozenStartCell.col) {
52452
+ if (isFrozenStartCell?.col) {
52372
52453
  const scrollLeft = this.scrollLeft;
52373
52454
  absoluteLeft += scrollLeft;
52374
- if (!isFrozenEndCell || !isFrozenEndCell.col) {
52455
+ if (!isFrozenEndCell?.col) {
52375
52456
  width -= scrollLeft;
52376
52457
  width = Math.max(width, this.getColsWidth(startCol, this.frozenColCount - 1));
52377
52458
  }
52378
52459
  }
52379
- let absoluteTop = this.getRowsHeight(0, startRow - 1);
52460
+ const absoluteTop = this.getRowsHeight(0, startRow - 1);
52380
52461
  let height = this.getRowsHeight(startRow, endRow);
52381
- if (isFrozenStartCell && isFrozenStartCell.row) {
52462
+ if (isFrozenStartCell?.row) {
52382
52463
  const scrollTop = this.scrollTop;
52383
- absoluteTop += scrollTop;
52384
- if (!isFrozenEndCell || !isFrozenEndCell.row) {
52464
+ if (!isFrozenEndCell?.row) {
52385
52465
  height -= scrollTop;
52386
52466
  height = Math.max(height, this.getRowsHeight(startRow, this.frozenRowCount - 1));
52387
52467
  }
@@ -55799,14 +55879,17 @@
55799
55879
  return;
55800
55880
  }
55801
55881
  const target = e?.target;
55802
- if (this.editingEditor.targetIsOnEditor) {
55803
- if (target && this.editingEditor.targetIsOnEditor(target)) {
55882
+ const { editingEditor: editor } = this;
55883
+ if (target) {
55884
+ if (editor.targetIsOnEditor) {
55885
+ if (editor.targetIsOnEditor(target)) {
55886
+ return;
55887
+ }
55888
+ }
55889
+ else if (!editor.isEditorElement || editor.isEditorElement(target)) {
55804
55890
  return;
55805
55891
  }
55806
55892
  }
55807
- else if (!this.editingEditor.isEditorElement || (target && this.editingEditor.isEditorElement?.(target))) {
55808
- return;
55809
- }
55810
55893
  if (!this.editingEditor.getValue) ;
55811
55894
  const changedValue = this.editingEditor.getValue?.();
55812
55895
  this.table.changeCellValue(this.editCell.col, this.editCell.row, changedValue);
@@ -56395,7 +56478,7 @@
56395
56478
  else {
56396
56479
  hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
56397
56480
  }
56398
- if (hd?.define?.sort) {
56481
+ if (hd.define.sort !== false) {
56399
56482
  this.dataSource.sort(hd.field, order, sortFunc);
56400
56483
  this.internalProps.layoutMap.clearCellRangeMap();
56401
56484
  this.scenegraph.sortCell();
@@ -56455,7 +56538,9 @@
56455
56538
  else {
56456
56539
  hd = this.internalProps.layoutMap.headerObjects.find((col) => col && col.field === field);
56457
56540
  }
56458
- this.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
56541
+ if (hd.define.sort !== false) {
56542
+ this.dataSource.sort(hd.field, order, sortFunc ?? defaultOrderFn);
56543
+ }
56459
56544
  }
56460
56545
  }
56461
56546
  this.refreshRowColCount();
@@ -57080,70 +57165,9 @@
57080
57165
  this.rowDimensionKeys = this.rowDimensionTree.dimensionKeys.valueArr();
57081
57166
  this.fullRowDimensionKeys = this.fullRowDimensionKeys.concat(this.rowDimensionKeys);
57082
57167
  this.resetRowHeaderLevelCount();
57083
- if (this.columnDimensionTree.tree.children?.length >= 1) {
57084
- this.columnHeaderObjs = this._addHeaders(this._columnHeaderCellIds, 0, this.columnDimensionTree.tree.children, []);
57085
- }
57086
- if (this.columnHeaderTitle) {
57087
- this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
57088
- const id = ++this.sharedVar.seqId;
57089
- const firstRowIds = Array(this.colCount - this.rowHeaderLevelCount).fill(id);
57090
- this._columnHeaderCellIds.unshift(firstRowIds);
57091
- const cell = {
57092
- id,
57093
- title: typeof this.columnHeaderTitle.title === 'string'
57094
- ? this.columnHeaderTitle.title
57095
- : this.columnsDefine.reduce((title, value) => {
57096
- if (typeof value === 'string') {
57097
- return title;
57098
- }
57099
- return title + (title ? `/${value.title}` : `${value.title}`);
57100
- }, ''),
57101
- field: undefined,
57102
- headerType: this.columnHeaderTitle.headerType ?? 'text',
57103
- style: this.columnHeaderTitle.headerStyle,
57104
- define: {
57105
- id,
57106
- disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
57107
- disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
57108
- }
57109
- };
57110
- this.columnHeaderObjs.push(cell);
57111
- this._headerObjects[id] = cell;
57112
- }
57168
+ this._generateColHeaderIds();
57113
57169
  this.colIndex = 0;
57114
- if (this.rowDimensionTree.tree.children?.length >= 1) {
57115
- this.rowHeaderObjs =
57116
- this.rowHierarchyType === 'tree'
57117
- ? this._addHeadersForTreeMode(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, true, this.rowsDefine)
57118
- : this._addHeaders(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, []);
57119
- }
57120
- if (this.rowHeaderTitle) {
57121
- this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
57122
- const id = ++this.sharedVar.seqId;
57123
- const firstColIds = Array(this._rowHeaderCellIds_FULL[0]?.length ?? this.rowDimensionTree.tree.size).fill(id);
57124
- this._rowHeaderCellIds_FULL.unshift(firstColIds);
57125
- const cell = {
57126
- id,
57127
- title: typeof this.rowHeaderTitle.title === 'string'
57128
- ? this.rowHeaderTitle.title
57129
- : this.rowsDefine.reduce((title, value) => {
57130
- if (typeof value === 'string') {
57131
- return title;
57132
- }
57133
- return title + (title ? `/${value.title}` : `${value.title}`);
57134
- }, ''),
57135
- field: undefined,
57136
- headerType: this.rowHeaderTitle.headerType ?? 'text',
57137
- style: this.rowHeaderTitle.headerStyle,
57138
- define: {
57139
- id,
57140
- disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
57141
- disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
57142
- }
57143
- };
57144
- this.rowHeaderObjs.push(cell);
57145
- this._headerObjects[id] = cell;
57146
- }
57170
+ this._generateRowHeaderIds();
57147
57171
  if (this._table.isPivotChart()) {
57148
57172
  this.hasTwoIndicatorAxes = this._indicators.some(indicatorObject => {
57149
57173
  if (indicatorObject.chartSpec &&
@@ -57247,6 +57271,73 @@
57247
57271
  }
57248
57272
  this.setColumnWidths();
57249
57273
  }
57274
+ _generateColHeaderIds() {
57275
+ if (this.columnDimensionTree.tree.children?.length >= 1) {
57276
+ this.columnHeaderObjs = this._addHeaders(this._columnHeaderCellIds, 0, this.columnDimensionTree.tree.children, []);
57277
+ }
57278
+ if (this.columnHeaderTitle) {
57279
+ this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
57280
+ const id = ++this.sharedVar.seqId;
57281
+ const firstRowIds = Array(this.colCount - this.rowHeaderLevelCount).fill(id);
57282
+ this._columnHeaderCellIds.unshift(firstRowIds);
57283
+ const cell = {
57284
+ id,
57285
+ title: typeof this.columnHeaderTitle.title === 'string'
57286
+ ? this.columnHeaderTitle.title
57287
+ : this.columnsDefine.reduce((title, value) => {
57288
+ if (typeof value === 'string') {
57289
+ return title;
57290
+ }
57291
+ return title + (title ? `/${value.title}` : `${value.title}`);
57292
+ }, ''),
57293
+ field: undefined,
57294
+ headerType: this.columnHeaderTitle.headerType ?? 'text',
57295
+ style: this.columnHeaderTitle.headerStyle,
57296
+ define: {
57297
+ id,
57298
+ disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
57299
+ disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
57300
+ }
57301
+ };
57302
+ this.columnHeaderObjs.push(cell);
57303
+ this._headerObjects[id] = cell;
57304
+ }
57305
+ }
57306
+ _generateRowHeaderIds() {
57307
+ if (this.rowDimensionTree.tree.children?.length >= 1) {
57308
+ this.rowHeaderObjs =
57309
+ this.rowHierarchyType === 'tree'
57310
+ ? this._addHeadersForTreeMode(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, [], this.rowDimensionTree.totalLevel, true, this.rowsDefine)
57311
+ : this._addHeaders(this._rowHeaderCellIds_FULL, 0, this.rowDimensionTree.tree.children, []);
57312
+ }
57313
+ if (this.rowHeaderTitle) {
57314
+ this.sharedVar.seqId = Math.max(this.sharedVar.seqId, this._headerObjects.length);
57315
+ const id = ++this.sharedVar.seqId;
57316
+ const firstColIds = Array(this._rowHeaderCellIds_FULL[0]?.length ?? this.rowDimensionTree.tree.size).fill(id);
57317
+ this._rowHeaderCellIds_FULL.unshift(firstColIds);
57318
+ const cell = {
57319
+ id,
57320
+ title: typeof this.rowHeaderTitle.title === 'string'
57321
+ ? this.rowHeaderTitle.title
57322
+ : this.rowsDefine.reduce((title, value) => {
57323
+ if (typeof value === 'string') {
57324
+ return title;
57325
+ }
57326
+ return title + (title ? `/${value.title}` : `${value.title}`);
57327
+ }, ''),
57328
+ field: undefined,
57329
+ headerType: this.rowHeaderTitle.headerType ?? 'text',
57330
+ style: this.rowHeaderTitle.headerStyle,
57331
+ define: {
57332
+ id,
57333
+ disableHeaderHover: !!this.columnHeaderTitle.disableHeaderHover,
57334
+ disableHeaderSelect: !!this.columnHeaderTitle.disableHeaderSelect
57335
+ }
57336
+ };
57337
+ this.rowHeaderObjs.push(cell);
57338
+ this._headerObjects[id] = cell;
57339
+ }
57340
+ }
57250
57341
  _addHeaders(_headerCellIds, row, header, roots) {
57251
57342
  const _this = this;
57252
57343
  function _newRow(row) {
@@ -59105,7 +59196,24 @@
59105
59196
  });
59106
59197
  return totalCount;
59107
59198
  }
59108
- updateDataset(dataset) {
59199
+ resetHeaderTree() {
59200
+ this._rowHeaderCellIds_FULL = [];
59201
+ this._columnHeaderCellIds = [];
59202
+ const dataset = this.dataset;
59203
+ this.rowTree = dataset.rowHeaderTree;
59204
+ this.columnTree = dataset.colHeaderTree;
59205
+ this.columnDimensionTree = new DimensionTree(this.columnTree ?? [], this.sharedVar);
59206
+ this.rowDimensionTree = new DimensionTree(this.rowTree ?? [], this.sharedVar, this.rowHierarchyType, this.rowHierarchyType === 'tree' ? this.rowExpandLevel : undefined);
59207
+ this._generateColHeaderIds();
59208
+ this.colIndex = 0;
59209
+ this._generateRowHeaderIds();
59210
+ this.resetColumnHeaderLevelCount();
59211
+ this._rowHeaderCellIds_FULL = transpose(this._rowHeaderCellIds_FULL);
59212
+ this._headerObjectMap = this._headerObjects.reduce((o, e) => {
59213
+ o[e.id] = e;
59214
+ return o;
59215
+ }, {});
59216
+ this.setPagination(this.pagination);
59109
59217
  }
59110
59218
  }
59111
59219
  function scaleWholeRangeSize(count, bandwidth, paddingInner, paddingOuter) {
@@ -59725,14 +59833,14 @@
59725
59833
  this.needSplitPositiveAndNegative = needSplitPositiveAndNegative ?? false;
59726
59834
  this.rowsIsTotal = new Array(this.rows?.length ?? 0).fill(false);
59727
59835
  this.colsIsTotal = new Array(this.columns?.length ?? 0).fill(false);
59728
- if (this.totals?.row?.showSubTotals) {
59836
+ if (this.totals?.row && this.totals.row.showSubTotals !== false) {
59729
59837
  for (let i = 0, len = this.totals?.row?.subTotalsDimensions?.length; i < len; i++) {
59730
59838
  const dimension = this.totals.row.subTotalsDimensions[i];
59731
59839
  const dimensionIndex = this.rows.indexOf(dimension);
59732
59840
  this.rowsIsTotal[dimensionIndex] = true;
59733
59841
  }
59734
59842
  }
59735
- if (this.totals?.column?.showSubTotals) {
59843
+ if (this.totals?.column && this.totals.column.showSubTotals !== false) {
59736
59844
  for (let i = 0, len = this.totals?.column?.subTotalsDimensions?.length; i < len; i++) {
59737
59845
  const dimension = this.totals.column.subTotalsDimensions[i];
59738
59846
  const dimensionIndex = this.columns.indexOf(dimension);
@@ -59975,8 +60083,7 @@
59975
60083
  isToTalRecord = true;
59976
60084
  break;
59977
60085
  }
59978
- else if (this.dataConfig?.totals?.row?.showSubTotals &&
59979
- this.dataConfig?.totals?.row?.subTotalsDimensions.indexOf(this.rows[l - 1]) >= 0) {
60086
+ else if (this.dataConfig?.totals?.row?.subTotalsDimensions.indexOf(this.rows[l - 1]) >= 0) {
59980
60087
  if (this.rowHierarchyType === 'grid') {
59981
60088
  rowKey.push(this.rowSubTotalLabel);
59982
60089
  }
@@ -60000,8 +60107,7 @@
60000
60107
  isToTalRecord = true;
60001
60108
  break;
60002
60109
  }
60003
- else if (this.dataConfig?.totals?.column?.showSubTotals &&
60004
- this.dataConfig?.totals?.column?.subTotalsDimensions.indexOf(this.columns[n - 1]) >= 0) {
60110
+ else if (this.dataConfig?.totals?.column?.subTotalsDimensions.indexOf(this.columns[n - 1]) >= 0) {
60005
60111
  colKey.push(this.colSubTotalLabel);
60006
60112
  isToTalRecord = true;
60007
60113
  break;
@@ -60107,6 +60213,19 @@
60107
60213
  this.sorted = false;
60108
60214
  this.sortRules = sortRules;
60109
60215
  this.sortKeys();
60216
+ if (!this.customRowTree) {
60217
+ if (this.rowHierarchyType === 'tree') {
60218
+ this.rowHeaderTree = this.ArrToTree1(this.rowKeys, this.rows, this.indicatorsAsCol ? undefined : this.indicators, this.totals?.row?.showGrandTotals ||
60219
+ (!this.indicatorsAsCol && this.columns.length === 0) ||
60220
+ (this.indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel);
60221
+ }
60222
+ else {
60223
+ this.rowHeaderTree = this.ArrToTree(this.rowKeys, this.rows, this.indicatorsAsCol ? undefined : this.indicators, this.rowsIsTotal, this.totals?.row?.showGrandTotals || (this.indicatorsAsCol && this.rows.length === 0), this.rowGrandTotalLabel, this.rowSubTotalLabel, this.totals?.row?.showGrandTotalsOnTop ?? false, this.totals?.row?.showSubTotalsOnTop ?? false);
60224
+ }
60225
+ }
60226
+ if (!this.customColTree) {
60227
+ this.colHeaderTree = this.ArrToTree(this.colKeys, this.columns, this.indicatorsAsCol ? this.indicators : undefined, this.colsIsTotal, this.totals?.column?.showGrandTotals || (!this.indicatorsAsCol && this.columns.length === 0), this.colGrandTotalLabel, this.colSubTotalLabel, this.totals?.column?.showGrandTotalsOnLeft ?? false, this.totals?.column?.showSubTotalsOnLeft ?? false);
60228
+ }
60110
60229
  }
60111
60230
  updateFilterRules(filterRules, isResetTree = false) {
60112
60231
  this.filterRules = filterRules;
@@ -60275,9 +60394,9 @@
60275
60394
  let bChanged = b;
60276
60395
  if (sorter.fieldIndex < fieldArr.length - 1) {
60277
60396
  aChanged = a.slice(0, sorter.fieldIndex + 1);
60278
- aChanged.push(isRow ? that.totals?.row?.subTotalLabel : that.totals?.column?.subTotalLabel);
60397
+ aChanged.push(isRow ? that.rowSubTotalLabel : that.colSubTotalLabel);
60279
60398
  bChanged = b.slice(0, sorter.fieldIndex + 1);
60280
- bChanged.push(isRow ? that.totals?.row?.subTotalLabel : that.totals?.column?.subTotalLabel);
60399
+ bChanged.push(isRow ? that.rowSubTotalLabel : that.colSubTotalLabel);
60281
60400
  }
60282
60401
  comparison = sorter.func(aChanged, bChanged);
60283
60402
  }
@@ -60327,8 +60446,8 @@
60327
60446
  }
60328
60447
  totalStatistics() {
60329
60448
  const that = this;
60330
- if ((that?.totals?.column?.showSubTotals && that?.totals?.column?.subTotalsDimensions?.length >= 1) ||
60331
- (that?.totals?.row?.showSubTotals && that?.totals?.row?.subTotalsDimensions?.length >= 1) ||
60449
+ if (that?.totals?.column?.subTotalsDimensions?.length >= 1 ||
60450
+ that?.totals?.row?.subTotalsDimensions?.length >= 1 ||
60332
60451
  that?.totals?.column?.showGrandTotals ||
60333
60452
  that?.totals?.row?.showGrandTotals) {
60334
60453
  const rowTotalKeys = [];
@@ -60343,7 +60462,7 @@
60343
60462
  const dimensionIndex = that.columns.indexOf(dimension);
60344
60463
  if (dimensionIndex >= 0) {
60345
60464
  const colTotalKey = colKey.slice(0, dimensionIndex + 1);
60346
- colTotalKey.push(that.totals?.column?.subTotalLabel ?? '小计');
60465
+ colTotalKey.push(that.colSubTotalLabel);
60347
60466
  const flatColTotalKey = colTotalKey.join(this.stringJoinChar);
60348
60467
  if (this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey]) {
60349
60468
  this.tree[flatRowKey][flatColTotalKey] = this.totalRecordsTree?.[flatRowKey]?.[flatColTotalKey];
@@ -60400,7 +60519,7 @@
60400
60519
  if (dimensionIndex >= 0 && dimensionIndex < that.rows.length - 1) {
60401
60520
  const rowTotalKey = rowKey.slice(0, dimensionIndex + 1);
60402
60521
  if (this.rowHierarchyType === 'grid') {
60403
- rowTotalKey.push(that.totals?.row?.subTotalLabel ?? '小计');
60522
+ rowTotalKey.push(that.rowSubTotalLabel);
60404
60523
  }
60405
60524
  const flatRowTotalKey = rowTotalKey.join(this.stringJoinChar);
60406
60525
  if (!this.tree[flatRowTotalKey]) {
@@ -61220,6 +61339,7 @@
61220
61339
  updateSortRules(sortRules) {
61221
61340
  this.internalProps.dataConfig.sortRules = sortRules;
61222
61341
  this.dataset.updateSortRules(sortRules);
61342
+ this.internalProps.layoutMap.resetHeaderTree();
61223
61343
  this.scenegraph.clearCells();
61224
61344
  this.refreshHeader();
61225
61345
  this.scenegraph.createSceneGraph();
@@ -61942,7 +62062,10 @@
61942
62062
  updateSortRules(sortRules) {
61943
62063
  this.internalProps.dataConfig.sortRules = sortRules;
61944
62064
  this.dataset.updateSortRules(sortRules);
61945
- this.internalProps.layoutMap.updateDataset(this.dataset);
62065
+ this.internalProps.layoutMap.resetHeaderTree();
62066
+ this.scenegraph.clearCells();
62067
+ this.refreshHeader();
62068
+ this.scenegraph.createSceneGraph();
61946
62069
  this.render();
61947
62070
  }
61948
62071
  updatePivotSortState(pivotSortStateConfig) {
@@ -62991,7 +63114,7 @@
62991
63114
  }
62992
63115
 
62993
63116
  registerForVrender();
62994
- const version = "0.19.1-alpha.0";
63117
+ const version = "0.19.1";
62995
63118
  function getIcons() {
62996
63119
  return get$1();
62997
63120
  }