@visactor/vtable 0.23.2 → 0.23.4

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 (129) hide show
  1. package/cjs/ListTable.js +4 -1
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/body-helper/body-helper.js +2 -1
  4. package/cjs/body-helper/body-helper.js.map +1 -1
  5. package/cjs/components/tooltip/TooltipHandler.d.ts +1 -0
  6. package/cjs/components/tooltip/TooltipHandler.js +36 -33
  7. package/cjs/components/tooltip/TooltipHandler.js.map +1 -1
  8. package/cjs/core/BaseTable.d.ts +10 -2
  9. package/cjs/core/BaseTable.js +28 -9
  10. package/cjs/core/BaseTable.js.map +1 -1
  11. package/cjs/core/FouseInput.js +2 -1
  12. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  13. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  14. package/cjs/core/row-series-number-helper.js +1 -2
  15. package/cjs/event/event.d.ts +3 -2
  16. package/cjs/event/event.js +10 -8
  17. package/cjs/event/event.js.map +1 -1
  18. package/cjs/event/listener/container-dom.js +1 -1
  19. package/cjs/event/listener/container-dom.js.map +1 -1
  20. package/cjs/event/listener/scroll-bar.js +9 -3
  21. package/cjs/event/listener/scroll-bar.js.map +1 -1
  22. package/cjs/event/listener/table-group.js +17 -17
  23. package/cjs/event/listener/table-group.js.map +1 -1
  24. package/cjs/event/listener/touch.js +20 -18
  25. package/cjs/event/listener/touch.js.map +1 -1
  26. package/cjs/header-helper/header-helper.js +2 -1
  27. package/cjs/header-helper/header-helper.js.map +1 -1
  28. package/cjs/index.d.ts +1 -1
  29. package/cjs/index.js +1 -1
  30. package/cjs/index.js.map +1 -1
  31. package/cjs/layout/chart-helper/get-chart-spec.js +2 -2
  32. package/cjs/layout/chart-helper/get-chart-spec.js.map +1 -1
  33. package/cjs/layout/pivot-header-layout.js +6 -2
  34. package/cjs/layout/pivot-header-layout.js.map +1 -1
  35. package/cjs/layout/tree-helper.js +1 -0
  36. package/cjs/plugins/custom-cell-style.d.ts +1 -0
  37. package/cjs/plugins/custom-cell-style.js +7 -0
  38. package/cjs/plugins/custom-cell-style.js.map +1 -1
  39. package/cjs/plugins/themes.js +1 -2
  40. package/cjs/scenegraph/component/table-component.js +2 -2
  41. package/cjs/scenegraph/component/table-component.js.map +1 -1
  42. package/cjs/scenegraph/group-creater/progress/proxy.js +3 -2
  43. package/cjs/scenegraph/group-creater/progress/proxy.js.map +1 -1
  44. package/cjs/scenegraph/layout/compute-col-width.js +8 -5
  45. package/cjs/scenegraph/layout/compute-col-width.js.map +1 -1
  46. package/cjs/scenegraph/layout/compute-row-height.js +12 -8
  47. package/cjs/scenegraph/layout/compute-row-height.js.map +1 -1
  48. package/cjs/scenegraph/scenegraph.js +2 -3
  49. package/cjs/scenegraph/scenegraph.js.map +1 -1
  50. package/cjs/scenegraph/stick-text/index.js +1 -1
  51. package/cjs/scenegraph/stick-text/index.js.map +1 -1
  52. package/cjs/scenegraph/utils/text-measure.d.ts +1 -0
  53. package/cjs/scenegraph/utils/text-measure.js +11 -1
  54. package/cjs/scenegraph/utils/text-measure.js.map +1 -1
  55. package/cjs/state/state.js +5 -4
  56. package/cjs/state/state.js.map +1 -1
  57. package/cjs/ts-types/base-table.d.ts +5 -1
  58. package/cjs/ts-types/base-table.js.map +1 -1
  59. package/cjs/ts-types/events.d.ts +10 -2
  60. package/cjs/ts-types/events.js.map +1 -1
  61. package/cjs/ts-types/table-engine.d.ts +2 -0
  62. package/cjs/ts-types/table-engine.js.map +1 -1
  63. package/cjs/vrender.js.map +1 -1
  64. package/dist/vtable.js +736 -629
  65. package/dist/vtable.min.js +2 -2
  66. package/es/ListTable.js +3 -1
  67. package/es/ListTable.js.map +1 -1
  68. package/es/body-helper/body-helper.js +2 -1
  69. package/es/body-helper/body-helper.js.map +1 -1
  70. package/es/components/tooltip/TooltipHandler.d.ts +1 -0
  71. package/es/components/tooltip/TooltipHandler.js +36 -33
  72. package/es/components/tooltip/TooltipHandler.js.map +1 -1
  73. package/es/core/BaseTable.d.ts +10 -2
  74. package/es/core/BaseTable.js +29 -10
  75. package/es/core/BaseTable.js.map +1 -1
  76. package/es/core/FouseInput.js +2 -1
  77. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  78. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  79. package/es/core/row-series-number-helper.js +1 -2
  80. package/es/event/event.d.ts +3 -2
  81. package/es/event/event.js +10 -8
  82. package/es/event/event.js.map +1 -1
  83. package/es/event/listener/container-dom.js +1 -1
  84. package/es/event/listener/container-dom.js.map +1 -1
  85. package/es/event/listener/scroll-bar.js +10 -2
  86. package/es/event/listener/scroll-bar.js.map +1 -1
  87. package/es/event/listener/table-group.js +17 -17
  88. package/es/event/listener/table-group.js.map +1 -1
  89. package/es/event/listener/touch.js +19 -15
  90. package/es/event/listener/touch.js.map +1 -1
  91. package/es/header-helper/header-helper.js +2 -1
  92. package/es/header-helper/header-helper.js.map +1 -1
  93. package/es/index.d.ts +1 -1
  94. package/es/index.js +1 -1
  95. package/es/index.js.map +1 -1
  96. package/es/layout/chart-helper/get-chart-spec.js +4 -2
  97. package/es/layout/chart-helper/get-chart-spec.js.map +1 -1
  98. package/es/layout/pivot-header-layout.js +6 -2
  99. package/es/layout/pivot-header-layout.js.map +1 -1
  100. package/es/layout/tree-helper.js +2 -1
  101. package/es/plugins/custom-cell-style.d.ts +1 -0
  102. package/es/plugins/custom-cell-style.js +7 -0
  103. package/es/plugins/custom-cell-style.js.map +1 -1
  104. package/es/plugins/themes.js +1 -2
  105. package/es/scenegraph/component/table-component.js +2 -2
  106. package/es/scenegraph/component/table-component.js.map +1 -1
  107. package/es/scenegraph/group-creater/progress/proxy.js +4 -1
  108. package/es/scenegraph/group-creater/progress/proxy.js.map +1 -1
  109. package/es/scenegraph/layout/compute-col-width.js +8 -5
  110. package/es/scenegraph/layout/compute-col-width.js.map +1 -1
  111. package/es/scenegraph/layout/compute-row-height.js +14 -9
  112. package/es/scenegraph/layout/compute-row-height.js.map +1 -1
  113. package/es/scenegraph/scenegraph.js +1 -4
  114. package/es/scenegraph/scenegraph.js.map +1 -1
  115. package/es/scenegraph/stick-text/index.js +1 -1
  116. package/es/scenegraph/stick-text/index.js.map +1 -1
  117. package/es/scenegraph/utils/text-measure.d.ts +1 -0
  118. package/es/scenegraph/utils/text-measure.js +9 -1
  119. package/es/scenegraph/utils/text-measure.js.map +1 -1
  120. package/es/state/state.js +5 -4
  121. package/es/state/state.js.map +1 -1
  122. package/es/ts-types/base-table.d.ts +5 -1
  123. package/es/ts-types/base-table.js.map +1 -1
  124. package/es/ts-types/events.d.ts +10 -2
  125. package/es/ts-types/events.js.map +1 -1
  126. package/es/ts-types/table-engine.d.ts +2 -0
  127. package/es/ts-types/table-engine.js.map +1 -1
  128. package/es/vrender.js.map +1 -1
  129. package/package.json +4 -4
package/dist/vtable.js CHANGED
@@ -39523,9 +39523,160 @@
39523
39523
  };
39524
39524
  }
39525
39525
 
39526
+ let customAlphabetCharSet = '';
39527
+ let textMeasureMode = 'quick';
39528
+ const textMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
39529
+ if (isBound(TextMeasureContribution)) {
39530
+ rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
39531
+ }
39532
+ else {
39533
+ bind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
39534
+ }
39535
+ });
39536
+ const restoreTextMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
39537
+ if (isBound(TextMeasureContribution)) {
39538
+ rebind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();
39539
+ }
39540
+ else {
39541
+ bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();
39542
+ }
39543
+ });
39544
+ const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
39545
+ return new TextMeasure({
39546
+ defaultFontParams: {
39547
+ fontFamily: DefaultTextStyle.fontFamily,
39548
+ fontSize: DefaultTextStyle.fontSize
39549
+ },
39550
+ getTextBounds: useNaiveCanvas ? undefined : getTextBounds$1,
39551
+ specialCharSet: `{}()//&-/: .,@%'"~…=${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789${customAlphabetCharSet}`,
39552
+ ...(option ?? {})
39553
+ }, textSpec);
39554
+ };
39555
+ const fastTextMeasureCache = new Map();
39556
+ function getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle = 'normal') {
39557
+ const key = `${fontSize}-${fontWeight}-${fontFamily}-${fontStyle}`;
39558
+ const cache = fastTextMeasureCache.get(key);
39559
+ if (cache) {
39560
+ return cache;
39561
+ }
39562
+ const fastTextMeasure = initTextMeasure({
39563
+ fontSize,
39564
+ fontFamily,
39565
+ fontWeight,
39566
+ fontStyle
39567
+ });
39568
+ fastTextMeasureCache.set(key, fastTextMeasure);
39569
+ return fastTextMeasure;
39570
+ }
39571
+ class FastTextMeasureContribution extends DefaultTextMeasureContribution {
39572
+ measureTextWidth(text, options) {
39573
+ const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
39574
+ const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
39575
+ const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
39576
+ return textMeasure.width;
39577
+ }
39578
+ measureText(text, options) {
39579
+ const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
39580
+ const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
39581
+ const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
39582
+ return textMeasure;
39583
+ }
39584
+ }
39585
+ class TextMeasureTool {
39586
+ measureText(text, options) {
39587
+ const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
39588
+ const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
39589
+ const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
39590
+ return textMeasure;
39591
+ }
39592
+ measureTextWidth(text, options) {
39593
+ const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
39594
+ const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
39595
+ const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
39596
+ return textMeasure.width;
39597
+ }
39598
+ clipText(text, options, width) {
39599
+ if (text.length === 0) {
39600
+ return { str: '', width: 0 };
39601
+ }
39602
+ let length = this.measureTextWidth(text, options);
39603
+ if (length <= width) {
39604
+ return { str: text, width: length };
39605
+ }
39606
+ length = this.measureTextWidth(text[0], options);
39607
+ if (length > width) {
39608
+ return { str: '', width: 0 };
39609
+ }
39610
+ return this._clipText(text, options, width, 0, text.length - 1);
39611
+ }
39612
+ _clipText(text, options, width, leftIdx, rightIdx) {
39613
+ const middleIdx = Math.floor((leftIdx + rightIdx) / 2);
39614
+ const subText = text.substring(0, middleIdx + 1);
39615
+ const strWidth = this.measureTextWidth(subText, options);
39616
+ let length;
39617
+ if (strWidth > width) {
39618
+ if (subText.length <= 1) {
39619
+ return { str: '', width: 0 };
39620
+ }
39621
+ const str = text.substring(0, middleIdx);
39622
+ length = this.measureTextWidth(str, options);
39623
+ if (length <= width) {
39624
+ return { str, width: length };
39625
+ }
39626
+ return this._clipText(text, options, width, leftIdx, middleIdx);
39627
+ }
39628
+ else if (strWidth < width) {
39629
+ if (middleIdx >= text.length - 1) {
39630
+ return { str: text, width: this.measureTextWidth(text, options) };
39631
+ }
39632
+ const str = text.substring(0, middleIdx + 2);
39633
+ length = this.measureTextWidth(str, options);
39634
+ if (length >= width) {
39635
+ return { str: subText, width: strWidth };
39636
+ }
39637
+ return this._clipText(text, options, width, middleIdx, rightIdx);
39638
+ }
39639
+ return { str: subText, width: strWidth };
39640
+ }
39641
+ clipTextWithSuffix(text, options, width, suffix) {
39642
+ if (suffix === '') {
39643
+ return this.clipText(text, options, width);
39644
+ }
39645
+ if (text.length === 0) {
39646
+ return { str: '', width: 0 };
39647
+ }
39648
+ const length = this.measureTextWidth(text, options);
39649
+ if (length <= width) {
39650
+ return { str: text, width: length };
39651
+ }
39652
+ const suffixWidth = this.measureTextWidth(suffix, options);
39653
+ if (suffixWidth > width) {
39654
+ return { str: '', width: 0 };
39655
+ }
39656
+ width -= suffixWidth;
39657
+ const data = this._clipText(text, options, width, 0, text.length - 1);
39658
+ data.str += suffix;
39659
+ data.width += suffixWidth;
39660
+ return data;
39661
+ }
39662
+ }
39663
+ const textMeasure = new TextMeasureTool();
39664
+ function setCustomAlphabetCharSet(str) {
39665
+ customAlphabetCharSet = str;
39666
+ fastTextMeasureCache.clear();
39667
+ }
39668
+ function restoreMeasureText() {
39669
+ textMeasureMode = 'canvas';
39670
+ container.load(restoreTextMeasureModule);
39671
+ }
39526
39672
  const utilTextMark = new Text$1({
39527
39673
  ignoreBuf: true
39528
39674
  });
39675
+ function measureTextBounds(attribute) {
39676
+ utilTextMark.setAttributes(attribute);
39677
+ return utilTextMark.AABBBounds;
39678
+ }
39679
+
39529
39680
  const utilRichTextMark = new RichText({
39530
39681
  width: 0,
39531
39682
  height: 0,
@@ -39642,11 +39793,16 @@
39642
39793
  }
39643
39794
  if (table.heightMode === 'adaptive') {
39644
39795
  table._clearRowRangeHeightsMap();
39645
- const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);
39646
- const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;
39647
- const totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;
39648
- const startRow = table.columnHeaderLevelCount;
39649
- const endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;
39796
+ let totalDrawHeight = table.tableNoFrameHeight;
39797
+ let startRow = 0;
39798
+ let endRow = table.rowCount;
39799
+ if (table.heightAdaptiveMode === 'only-body') {
39800
+ const columnHeaderHeight = table.getRowsHeight(0, table.columnHeaderLevelCount - 1);
39801
+ const bottomHeaderHeight = table.isPivotChart() ? table.getBottomFrozenRowsHeight() : 0;
39802
+ totalDrawHeight = table.tableNoFrameHeight - columnHeaderHeight - bottomHeaderHeight;
39803
+ startRow = table.columnHeaderLevelCount;
39804
+ endRow = table.isPivotChart() ? table.rowCount - table.bottomFrozenRowCount : table.rowCount;
39805
+ }
39650
39806
  let actualHeight = 0;
39651
39807
  for (let row = startRow; row < endRow; row++) {
39652
39808
  actualHeight += update ? newHeights[row] : table.getRowHeight(row);
@@ -40039,7 +40195,7 @@
40039
40195
  spaceBetweenTextAndIcon
40040
40196
  });
40041
40197
  utilCheckBoxMark.render();
40042
- maxHeight = utilTextMark.AABBBounds.height();
40198
+ maxHeight = utilCheckBoxMark.AABBBounds.height();
40043
40199
  }
40044
40200
  else {
40045
40201
  maxHeight = Math.max(size, lines.length * lineHeight);
@@ -40086,7 +40242,7 @@
40086
40242
  else if (autoWrapText) {
40087
40243
  const hierarchyOffset = getHierarchyOffset(col, row, table);
40088
40244
  const maxLineWidth = cellWidth - (padding[1] + padding[3]) - iconWidth - hierarchyOffset;
40089
- utilTextMark.setAttributes({
40245
+ const bounds = measureTextBounds({
40090
40246
  maxLineWidth,
40091
40247
  text: lines,
40092
40248
  fontSize,
@@ -40097,7 +40253,7 @@
40097
40253
  wordBreak: 'break-word',
40098
40254
  whiteSpace: lines.length === 1 && !autoWrapText ? 'no-wrap' : 'normal'
40099
40255
  });
40100
- maxHeight = utilTextMark.AABBBounds.height() || (typeof lineHeight === 'number' ? lineHeight : fontSize);
40256
+ maxHeight = bounds.height() || (typeof lineHeight === 'number' ? lineHeight : fontSize);
40101
40257
  }
40102
40258
  else {
40103
40259
  maxHeight = lines.length * lineHeight;
@@ -41340,7 +41496,10 @@
41340
41496
  const hoverOn = this.table.theme.scrollStyle.hoverOn;
41341
41497
  let attrY = 0;
41342
41498
  if (this.table.theme.scrollStyle.barToSide) {
41343
- attrY = this.table.tableNoFrameHeight - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
41499
+ attrY =
41500
+ this.table.tableNoFrameHeight -
41501
+ (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) +
41502
+ this.table.tableY;
41344
41503
  }
41345
41504
  else {
41346
41505
  attrY = y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
@@ -41375,7 +41534,10 @@
41375
41534
  let attrX = 0;
41376
41535
  const hoverOn = this.table.theme.scrollStyle.hoverOn;
41377
41536
  if (this.table.theme.scrollStyle.barToSide) {
41378
- attrX = this.table.tableNoFrameWidth - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x);
41537
+ attrX =
41538
+ this.table.tableNoFrameWidth -
41539
+ (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x) +
41540
+ this.table.tableX;
41379
41541
  }
41380
41542
  else {
41381
41543
  attrX = x - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x);
@@ -42943,174 +43105,27 @@
42943
43105
  }
42944
43106
  }
42945
43107
 
42946
- let customAlphabetCharSet = '';
42947
- let textMeasureMode = 'quick';
42948
- const textMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
42949
- if (isBound(TextMeasureContribution)) {
42950
- rebind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
42951
- }
42952
- else {
42953
- bind(TextMeasureContribution).to(FastTextMeasureContribution).inSingletonScope();
42954
- }
42955
- });
42956
- const restoreTextMeasureModule = new ContainerModule((bind, unbind, isBound, rebind) => {
42957
- if (isBound(TextMeasureContribution)) {
42958
- rebind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();
42959
- }
42960
- else {
42961
- bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope();
42962
- }
42963
- });
42964
- const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
42965
- return new TextMeasure({
42966
- defaultFontParams: {
42967
- fontFamily: DefaultTextStyle.fontFamily,
42968
- fontSize: DefaultTextStyle.fontSize
42969
- },
42970
- getTextBounds: useNaiveCanvas ? undefined : getTextBounds$1,
42971
- specialCharSet: `{}()//&-/: .,@%'"~…=${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789${customAlphabetCharSet}`,
42972
- ...(option ?? {})
42973
- }, textSpec);
42974
- };
42975
- const fastTextMeasureCache = new Map();
42976
- function getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle = 'normal') {
42977
- const key = `${fontSize}-${fontWeight}-${fontFamily}-${fontStyle}`;
42978
- const cache = fastTextMeasureCache.get(key);
42979
- if (cache) {
42980
- return cache;
42981
- }
42982
- const fastTextMeasure = initTextMeasure({
42983
- fontSize,
42984
- fontFamily,
42985
- fontWeight,
42986
- fontStyle
42987
- });
42988
- fastTextMeasureCache.set(key, fastTextMeasure);
42989
- return fastTextMeasure;
42990
- }
42991
- class FastTextMeasureContribution extends DefaultTextMeasureContribution {
42992
- measureTextWidth(text, options) {
42993
- const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
42994
- const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
42995
- const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
42996
- return textMeasure.width;
42997
- }
42998
- measureText(text, options) {
42999
- const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
43000
- const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
43001
- const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
43002
- return textMeasure;
43003
- }
43004
- }
43005
- class TextMeasureTool {
43006
- measureText(text, options) {
43007
- const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
43008
- const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
43009
- const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
43010
- return textMeasure;
43011
- }
43012
- measureTextWidth(text, options) {
43013
- const { fontSize, fontFamily = 'Arial,sans-serif', fontWeight = 'normal', fontStyle = 'normal' } = options;
43014
- const fastTextMeasure = getFastTextMeasure(fontSize, fontWeight, fontFamily, fontStyle);
43015
- const textMeasure = fastTextMeasure.measure(text, textMeasureMode);
43016
- return textMeasure.width;
43017
- }
43018
- clipText(text, options, width) {
43019
- if (text.length === 0) {
43020
- return { str: '', width: 0 };
43108
+ let SuffixTextBeforeRenderContribution = class SuffixTextBeforeRenderContribution {
43109
+ time = BaseRenderContributionTime.afterFillStroke;
43110
+ useStyle = true;
43111
+ order = 0;
43112
+ drawShape(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
43113
+ const { text: str, underline = textAttribute.underline, lineThrough = textAttribute.lineThrough, direction = textAttribute.direction, whiteSpace = textAttribute.whiteSpace, fontSize = textAttribute.fontSize, verticalMode = textAttribute.verticalMode, ellipsis = textAttribute.ellipsis, textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline, x: originX = textAttribute.x, y: originY = textAttribute.y } = text.attribute;
43114
+ let isEmpty = false;
43115
+ if (Array.isArray(text)) {
43116
+ const layoutData = text.cache?.layoutData;
43117
+ if (ellipsis && layoutData && layoutData.lines.every(line => line.str === '')) {
43118
+ isEmpty = true;
43119
+ }
43021
43120
  }
43022
- let length = this.measureTextWidth(text, options);
43023
- if (length <= width) {
43024
- return { str: text, width: length };
43121
+ else {
43122
+ const { cache } = text;
43123
+ if (ellipsis && cache && cache.clipedText === '' && cache.clipedWidth === 0) {
43124
+ isEmpty = true;
43125
+ }
43025
43126
  }
43026
- length = this.measureTextWidth(text[0], options);
43027
- if (length > width) {
43028
- return { str: '', width: 0 };
43029
- }
43030
- return this._clipText(text, options, width, 0, text.length - 1);
43031
- }
43032
- _clipText(text, options, width, leftIdx, rightIdx) {
43033
- const middleIdx = Math.floor((leftIdx + rightIdx) / 2);
43034
- const subText = text.substring(0, middleIdx + 1);
43035
- const strWidth = this.measureTextWidth(subText, options);
43036
- let length;
43037
- if (strWidth > width) {
43038
- if (subText.length <= 1) {
43039
- return { str: '', width: 0 };
43040
- }
43041
- const str = text.substring(0, middleIdx);
43042
- length = this.measureTextWidth(str, options);
43043
- if (length <= width) {
43044
- return { str, width: length };
43045
- }
43046
- return this._clipText(text, options, width, leftIdx, middleIdx);
43047
- }
43048
- else if (strWidth < width) {
43049
- if (middleIdx >= text.length - 1) {
43050
- return { str: text, width: this.measureTextWidth(text, options) };
43051
- }
43052
- const str = text.substring(0, middleIdx + 2);
43053
- length = this.measureTextWidth(str, options);
43054
- if (length >= width) {
43055
- return { str: subText, width: strWidth };
43056
- }
43057
- return this._clipText(text, options, width, middleIdx, rightIdx);
43058
- }
43059
- return { str: subText, width: strWidth };
43060
- }
43061
- clipTextWithSuffix(text, options, width, suffix) {
43062
- if (suffix === '') {
43063
- return this.clipText(text, options, width);
43064
- }
43065
- if (text.length === 0) {
43066
- return { str: '', width: 0 };
43067
- }
43068
- const length = this.measureTextWidth(text, options);
43069
- if (length <= width) {
43070
- return { str: text, width: length };
43071
- }
43072
- const suffixWidth = this.measureTextWidth(suffix, options);
43073
- if (suffixWidth > width) {
43074
- return { str: '', width: 0 };
43075
- }
43076
- width -= suffixWidth;
43077
- const data = this._clipText(text, options, width, 0, text.length - 1);
43078
- data.str += suffix;
43079
- data.width += suffixWidth;
43080
- return data;
43081
- }
43082
- }
43083
- const textMeasure = new TextMeasureTool();
43084
- function setCustomAlphabetCharSet(str) {
43085
- customAlphabetCharSet = str;
43086
- fastTextMeasureCache.clear();
43087
- }
43088
- function restoreMeasureText() {
43089
- textMeasureMode = 'canvas';
43090
- container.load(restoreTextMeasureModule);
43091
- }
43092
-
43093
- let SuffixTextBeforeRenderContribution = class SuffixTextBeforeRenderContribution {
43094
- time = BaseRenderContributionTime.afterFillStroke;
43095
- useStyle = true;
43096
- order = 0;
43097
- drawShape(text, context, x, y, doFill, doStroke, fVisible, sVisible, textAttribute, drawContext, fillCb, strokeCb, doFillOrStroke) {
43098
- const { text: str, underline = textAttribute.underline, lineThrough = textAttribute.lineThrough, direction = textAttribute.direction, whiteSpace = textAttribute.whiteSpace, fontSize = textAttribute.fontSize, verticalMode = textAttribute.verticalMode, ellipsis = textAttribute.ellipsis, textAlign = textAttribute.textAlign, textBaseline = textAttribute.textBaseline, x: originX = textAttribute.x, y: originY = textAttribute.y } = text.attribute;
43099
- let isEmpty = false;
43100
- if (Array.isArray(text)) {
43101
- const layoutData = text.cache?.layoutData;
43102
- if (ellipsis && layoutData && layoutData.lines.every(line => line.str === '')) {
43103
- isEmpty = true;
43104
- }
43105
- }
43106
- else {
43107
- const { cache } = text;
43108
- if (ellipsis && cache && cache.clipedText === '' && cache.clipedWidth === 0) {
43109
- isEmpty = true;
43110
- }
43111
- }
43112
- if (!isEmpty) {
43113
- return;
43127
+ if (!isEmpty) {
43128
+ return;
43114
43129
  }
43115
43130
  const textStr = isString$2(ellipsis) ? ellipsis : '...';
43116
43131
  const lineHeight = calculateLineHeight(text.attribute.lineHeight, fontSize) ?? fontSize;
@@ -43284,15 +43299,19 @@
43284
43299
  table._clearColRangeWidthsMap();
43285
43300
  const canvasWidth = table.tableNoFrameWidth;
43286
43301
  let actualHeaderWidth = 0;
43287
- for (let col = 0; col < table.colCount; col++) {
43288
- const colWidth = update ? newWidths[col] : table.getColWidth(col);
43289
- if (col < table.rowHeaderLevelCount ||
43290
- (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)) {
43291
- actualHeaderWidth += colWidth;
43302
+ let startCol = 0;
43303
+ let endCol = table.colCount;
43304
+ if (table.widthAdaptiveMode === 'only-body') {
43305
+ for (let col = 0; col < table.colCount; col++) {
43306
+ const colWidth = update ? newWidths[col] : table.getColWidth(col);
43307
+ if (col < table.rowHeaderLevelCount ||
43308
+ (table.isPivotChart() && col >= table.colCount - table.rightFrozenColCount)) {
43309
+ actualHeaderWidth += colWidth;
43310
+ }
43292
43311
  }
43312
+ startCol = table.rowHeaderLevelCount;
43313
+ endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
43293
43314
  }
43294
- const startCol = table.rowHeaderLevelCount;
43295
- const endCol = table.isPivotChart() ? table.colCount - table.rightFrozenColCount : table.colCount;
43296
43315
  getAdaptiveWidth(canvasWidth - actualHeaderWidth, startCol, endCol, update, newWidths, table);
43297
43316
  }
43298
43317
  else if (table.autoFillWidth) {
@@ -44574,6 +44593,269 @@
44574
44593
  await proxy.progress();
44575
44594
  }
44576
44595
 
44596
+ function handleTextStick(table) {
44597
+ const { changedCells } = table.internalProps.stick;
44598
+ changedCells.forEach((cellPos) => {
44599
+ const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);
44600
+ cellGroup.forEachChildren((child) => {
44601
+ child.setAttributes({
44602
+ dx: cellPos.dx,
44603
+ dy: cellPos.dy
44604
+ });
44605
+ });
44606
+ });
44607
+ changedCells.clear();
44608
+ const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
44609
+ const frozenRowsHeight = table.getFrozenRowsHeight();
44610
+ const frozenColsWidth = table.getFrozenColsWidth();
44611
+ const { row: rowTop } = table.getRowAt(scrollTop + frozenRowsHeight + 1);
44612
+ const { col: colLeft } = table.getColAt(scrollLeft + frozenColsWidth + 1);
44613
+ const rowStart = Math.max(rowTop, table.frozenRowCount);
44614
+ const colStart = Math.max(colLeft, table.frozenColCount);
44615
+ const rowEnd = table.getAllRowsHeight() > table.tableNoFrameHeight
44616
+ ? table.getRowAt(scrollTop + table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() - 1).row
44617
+ : table.rowCount - table.bottomFrozenRowCount - 1;
44618
+ const colEnd = table.getAllColsWidth() > table.tableNoFrameWidth
44619
+ ? table.getColAt(scrollLeft + table.tableNoFrameWidth - table.getRightFrozenColsWidth() - 1).col
44620
+ : table.colCount - table.rightFrozenColCount - 1;
44621
+ if (colEnd < 0 || rowEnd < 0) {
44622
+ return;
44623
+ }
44624
+ for (let row = 0; row < frozenRowCount; row++) {
44625
+ if (colEnd < colStart) {
44626
+ break;
44627
+ }
44628
+ [colStart, colEnd].forEach((col) => {
44629
+ const style = table._getCellStyle(col, row);
44630
+ if (style?.textStick) {
44631
+ const cellGroup = table.scenegraph.getCell(col, row);
44632
+ adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
44633
+ }
44634
+ });
44635
+ }
44636
+ for (let col = 0; col < frozenColCount; col++) {
44637
+ if (rowEnd < rowStart) {
44638
+ break;
44639
+ }
44640
+ [rowStart, rowEnd].forEach((row) => {
44641
+ const style = table._getCellStyle(col, row);
44642
+ if (style?.textStick && table.internalProps.layoutMap.rowHierarchyType !== 'tree') {
44643
+ const cellGroup = table.scenegraph.getCell(col, row);
44644
+ adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
44645
+ }
44646
+ });
44647
+ }
44648
+ for (let col = colStart; col <= colEnd; col++) {
44649
+ if (rowEnd < rowStart) {
44650
+ break;
44651
+ }
44652
+ [rowStart, rowEnd].forEach((row) => {
44653
+ const style = table._getCellStyle(col, row);
44654
+ if (style?.textStick) {
44655
+ const cellGroup = table.scenegraph.getCell(col, row);
44656
+ adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
44657
+ }
44658
+ });
44659
+ }
44660
+ for (let row = rowStart; row < rowEnd; row++) {
44661
+ if (colEnd < colStart) {
44662
+ break;
44663
+ }
44664
+ [colStart, colEnd].forEach((col) => {
44665
+ const style = table._getCellStyle(col, row);
44666
+ if (table._getCellStyle(col, row)?.textStick) {
44667
+ const cellGroup = table.scenegraph.getCell(col, row);
44668
+ adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
44669
+ }
44670
+ });
44671
+ }
44672
+ }
44673
+ function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table) {
44674
+ if (isNumber$4(cellGroup.mergeStartCol) &&
44675
+ isNumber$4(cellGroup.mergeStartRow) &&
44676
+ isNumber$4(cellGroup.mergeEndCol) &&
44677
+ isNumber$4(cellGroup.mergeEndRow)) {
44678
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
44679
+ for (let col = colStart; col <= colEnd; col++) {
44680
+ for (let row = rowStart; row <= rowEnd; row++) {
44681
+ const singleCellGroup = table.scenegraph.getCell(col, row);
44682
+ dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
44683
+ }
44684
+ }
44685
+ }
44686
+ else {
44687
+ dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
44688
+ }
44689
+ }
44690
+ function dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign) {
44691
+ const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
44692
+ if (!graphic) {
44693
+ return;
44694
+ }
44695
+ if (graphic.type === 'image') {
44696
+ const { image: url } = graphic.attribute;
44697
+ if (!url || !graphic.resources) {
44698
+ return;
44699
+ }
44700
+ const res = graphic.resources.get(url);
44701
+ if (res.state !== 'success') {
44702
+ return;
44703
+ }
44704
+ }
44705
+ const textBaseline = graphic.textBaseline ?? 'top';
44706
+ graphic.AABBBounds.width();
44707
+ const textTop = graphic.globalAABBBounds.y1;
44708
+ const textBottom = graphic.globalAABBBounds.y2;
44709
+ if (textBaseline === 'middle' && textStickBaseOnAlign) {
44710
+ const cellTop = cellGroup.globalAABBBounds.y1 + (cellGroup.firstChild?.attribute.dy ?? 0);
44711
+ const cellBottom = cellTop + (cellGroup.contentHeight ?? cellGroup.attribute.height ?? 0);
44712
+ if (cellTop < minTop || cellBottom > maxTop) {
44713
+ const visibleCellTop = Math.max(cellTop, minTop);
44714
+ const visibleCellBottom = Math.min(cellBottom, maxTop);
44715
+ const delta = graphic.globalTransMatrix.f - (visibleCellBottom + visibleCellTop) / 2;
44716
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
44717
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
44718
+ col: cellGroup.col,
44719
+ row: cellGroup.row,
44720
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
44721
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
44722
+ });
44723
+ cellGroup.forEachChildren((child) => {
44724
+ child.setAttribute('dy', (child.attribute.dy ?? 0) - delta + 2);
44725
+ });
44726
+ }
44727
+ }
44728
+ else if (textTop < minTop) {
44729
+ const deltaHeight = textTop - minTop;
44730
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
44731
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
44732
+ col: cellGroup.col,
44733
+ row: cellGroup.row,
44734
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
44735
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
44736
+ });
44737
+ cellGroup.forEachChildren((child) => {
44738
+ child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight + 2);
44739
+ });
44740
+ }
44741
+ else if (textBottom > maxTop) {
44742
+ const deltaHeight = textBottom - maxTop;
44743
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
44744
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
44745
+ col: cellGroup.col,
44746
+ row: cellGroup.row,
44747
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
44748
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
44749
+ });
44750
+ cellGroup.forEachChildren((child) => {
44751
+ child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight);
44752
+ });
44753
+ }
44754
+ }
44755
+ function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table) {
44756
+ if (isNumber$4(cellGroup.mergeStartCol) &&
44757
+ isNumber$4(cellGroup.mergeStartRow) &&
44758
+ isNumber$4(cellGroup.mergeEndCol) &&
44759
+ isNumber$4(cellGroup.mergeEndRow)) {
44760
+ const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
44761
+ for (let col = colStart; col <= colEnd; col++) {
44762
+ for (let row = rowStart; row <= rowEnd; row++) {
44763
+ const singleCellGroup = table.scenegraph.getCell(col, row);
44764
+ dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
44765
+ }
44766
+ }
44767
+ }
44768
+ else {
44769
+ dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
44770
+ }
44771
+ }
44772
+ function dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign) {
44773
+ const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
44774
+ if (!graphic) {
44775
+ return;
44776
+ }
44777
+ if (graphic.type === 'image') {
44778
+ const { image: url } = graphic.attribute;
44779
+ if (!url || !graphic.resources) {
44780
+ return;
44781
+ }
44782
+ const res = graphic.resources.get(url);
44783
+ if (res.state !== 'success') {
44784
+ return;
44785
+ }
44786
+ }
44787
+ const textAlign = graphic.attribute.textAlign ?? graphic.textAlign ?? 'left';
44788
+ graphic.AABBBounds.width();
44789
+ const textLeft = graphic.globalAABBBounds.x1;
44790
+ const textRight = graphic.globalAABBBounds.x2;
44791
+ if (textAlign === 'center' && textStickBaseOnAlign) {
44792
+ const cellLeft = cellGroup.globalAABBBounds.x1 + (cellGroup.firstChild?.attribute.dx ?? 0);
44793
+ const cellRight = cellLeft + (cellGroup.contentWidth ?? cellGroup.attribute.width ?? 0);
44794
+ if (cellLeft < minLeft || cellRight > maxLeft) {
44795
+ const visibleCellLeft = Math.max(cellLeft, minLeft);
44796
+ const visibleCellRight = Math.min(cellRight, maxLeft);
44797
+ const delta = graphic.globalTransMatrix.e - (visibleCellRight + visibleCellLeft) / 2;
44798
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
44799
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
44800
+ col: cellGroup.col,
44801
+ row: cellGroup.row,
44802
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
44803
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
44804
+ });
44805
+ cellGroup.forEachChildren((child) => {
44806
+ child.setAttribute('dx', (child.attribute.dx ?? 0) - delta + 2);
44807
+ });
44808
+ }
44809
+ }
44810
+ else if (textLeft < minLeft) {
44811
+ const deltaWidth = textLeft - minLeft;
44812
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
44813
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
44814
+ col: cellGroup.col,
44815
+ row: cellGroup.row,
44816
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
44817
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
44818
+ });
44819
+ cellGroup.forEachChildren((child) => {
44820
+ child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth + 2);
44821
+ });
44822
+ }
44823
+ else if (textRight > maxLeft) {
44824
+ const deltaWidth = textRight - maxLeft;
44825
+ !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
44826
+ changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
44827
+ col: cellGroup.col,
44828
+ row: cellGroup.row,
44829
+ dx: cellGroup.firstChild?.attribute.dx ?? 0,
44830
+ dy: cellGroup.firstChild?.attribute.dy ?? 0
44831
+ });
44832
+ cellGroup.forEachChildren((child) => {
44833
+ child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth);
44834
+ });
44835
+ }
44836
+ }
44837
+ function checkHaveTextStick(table) {
44838
+ const headerObjects = table.internalProps.layoutMap.headerObjects;
44839
+ const columnObjects = table.internalProps.layoutMap.columnObjects;
44840
+ for (let i = 0; i < headerObjects.length; i++) {
44841
+ const header = headerObjects[i];
44842
+ if (header && header.style?.textStick) {
44843
+ return true;
44844
+ }
44845
+ }
44846
+ for (let i = 0; i < columnObjects.length; i++) {
44847
+ const column = columnObjects[i];
44848
+ if (column && column.style?.textStick) {
44849
+ return true;
44850
+ }
44851
+ }
44852
+ const themeStick = table.theme.headerStyle.textStick || table.theme.rowHeaderStyle.textStick || table.theme.bodyStyle.textStick;
44853
+ if (themeStick) {
44854
+ return true;
44855
+ }
44856
+ return false;
44857
+ }
44858
+
44577
44859
  class SceneProxy {
44578
44860
  table;
44579
44861
  isRelease = false;
@@ -44719,6 +45001,8 @@
44719
45001
  await this.createRow();
44720
45002
  await this.progress();
44721
45003
  }
45004
+ handleTextStick(this.table);
45005
+ this.table.scenegraph.updateNextFrame();
44722
45006
  resolve();
44723
45007
  }, 16);
44724
45008
  });
@@ -46035,332 +46319,73 @@
46035
46319
  addNeedUpdateTag(rangeBefore, scene);
46036
46320
  row = rangeBefore.start.row;
46037
46321
  }
46038
- const rangeAfter = scene.table.getCellRange(col, afterRow);
46039
- if (rangeAfter.start.row <= afterRow + 1 && rangeAfter.end.row >= afterRow + 1) {
46040
- addNeedUpdateTag(rangeAfter, scene);
46041
- row = rangeAfter.start.row;
46042
- }
46043
- if (isValid$3(row)) {
46044
- updateRow = isValid$3(updateRow) ? Math.min(updateRow, row) : row;
46045
- }
46046
- }
46047
- return updateRow;
46048
- }
46049
- function _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene) {
46050
- let updateRow;
46051
- for (let col = 0; col < scene.table.colCount; col++) {
46052
- let row;
46053
- const beforeCell = scene.highPerformanceGetCell(col, beforeRow);
46054
- if (beforeCell.mergeStartRow && beforeCell.mergeEndRow && beforeCell.mergeEndRow > beforeRow) {
46055
- addNeedUpdateTag({
46056
- start: {
46057
- row: beforeCell.mergeStartRow,
46058
- col: scene.table.heightMode === 'autoHeight' ? 0 : beforeCell.mergeStartCol
46059
- },
46060
- end: {
46061
- row: beforeCell.mergeEndRow,
46062
- col: scene.table.heightMode === 'autoHeight' ? scene.table.colCount - 1 : beforeCell.mergeEndCol
46063
- }
46064
- }, scene);
46065
- row = beforeCell.mergeStartRow;
46066
- }
46067
- const afterCell = scene.highPerformanceGetCell(col, afterRow);
46068
- if (afterCell.mergeStartRow && afterCell.mergeEndRow && afterCell.mergeStartRow < afterRow) {
46069
- addNeedUpdateTag({
46070
- start: {
46071
- row: afterCell.mergeStartRow,
46072
- col: scene.table.heightMode === 'autoHeight' ? 0 : afterCell.mergeStartCol
46073
- },
46074
- end: {
46075
- row: afterCell.mergeEndRow,
46076
- col: scene.table.heightMode === 'autoHeight' ? scene.table.colCount - 1 : afterCell.mergeEndCol
46077
- }
46078
- }, scene);
46079
- row = afterCell.mergeStartRow;
46080
- }
46081
- if (isValid$3(row)) {
46082
- updateRow = isValid$3(updateRow) ? Math.min(updateRow, row) : row;
46083
- }
46084
- }
46085
- return updateRow;
46086
- }
46087
- function addNeedUpdateTag(range, scene) {
46088
- const { start, end } = range;
46089
- for (let col = start.col; col <= end.col; col++) {
46090
- for (let row = start.row; row <= end.row; row++) {
46091
- const cellGroup = scene.highPerformanceGetCell(col, row, true);
46092
- if (!cellGroup) {
46093
- continue;
46094
- }
46095
- cellGroup.needUpdate = true;
46096
- }
46097
- }
46098
- }
46099
- function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
46100
- if (scene.table.isHasSeriesNumber()) {
46101
- for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) {
46102
- updateCell$1(0, row, scene.table, false);
46103
- }
46104
- }
46105
- }
46106
-
46107
- function handleTextStick(table) {
46108
- const { changedCells } = table.internalProps.stick;
46109
- changedCells.forEach((cellPos) => {
46110
- const cellGroup = table.scenegraph.getCell(cellPos.col, cellPos.row);
46111
- cellGroup.forEachChildren((child) => {
46112
- child.setAttributes({
46113
- dx: cellPos.dx,
46114
- dy: cellPos.dy
46115
- });
46116
- });
46117
- });
46118
- changedCells.clear();
46119
- const { scrollTop, scrollLeft, frozenRowCount, frozenColCount } = table;
46120
- const frozenRowsHeight = table.getFrozenRowsHeight();
46121
- const frozenColsWidth = table.getFrozenColsWidth();
46122
- const { row: rowTop } = table.getRowAt(scrollTop + frozenRowsHeight + 1);
46123
- const { col: colLeft } = table.getColAt(scrollLeft + frozenColsWidth + 1);
46124
- const rowStart = Math.max(rowTop, table.frozenRowCount);
46125
- const colStart = Math.max(colLeft, table.frozenColCount);
46126
- const rowEnd = table.getAllRowsHeight() > table.tableNoFrameHeight
46127
- ? table.getRowAt(scrollTop + table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() - 1).row
46128
- : table.rowCount - table.bottomFrozenRowCount - 1;
46129
- const colEnd = table.getAllColsWidth() > table.tableNoFrameWidth
46130
- ? table.getColAt(scrollLeft + table.tableNoFrameWidth - table.getRightFrozenColsWidth() - 1).col
46131
- : table.colCount - table.rightFrozenColCount - 1;
46132
- if (colEnd < 0 || rowEnd < 0) {
46133
- return;
46134
- }
46135
- for (let row = 0; row < frozenRowCount; row++) {
46136
- if (colEnd < colStart) {
46137
- break;
46138
- }
46139
- [colStart, colEnd].forEach((col) => {
46140
- const style = table._getCellStyle(col, row);
46141
- if (style?.textStick) {
46142
- const cellGroup = table.scenegraph.getCell(col, row);
46143
- adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
46144
- }
46145
- });
46146
- }
46147
- for (let col = 0; col < frozenColCount; col++) {
46148
- if (rowEnd < rowStart) {
46149
- break;
46150
- }
46151
- [rowStart, rowEnd].forEach((row) => {
46152
- const style = table._getCellStyle(col, row);
46153
- if (style?.textStick && table.internalProps.layoutMap.rowHierarchyType !== 'tree') {
46154
- const cellGroup = table.scenegraph.getCell(col, row);
46155
- adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
46156
- }
46157
- });
46158
- }
46159
- for (let col = colStart; col <= colEnd; col++) {
46160
- if (rowEnd < rowStart) {
46161
- break;
46162
- }
46163
- [rowStart, rowEnd].forEach((row) => {
46164
- const style = table._getCellStyle(col, row);
46165
- if (style?.textStick) {
46166
- const cellGroup = table.scenegraph.getCell(col, row);
46167
- adjustCellContentVerticalLayout(cellGroup, frozenRowsHeight + table.tableY, table.tableNoFrameHeight - table.getBottomFrozenRowsHeight() + table.tableY, changedCells, style?.textStickBaseOnAlign, table);
46168
- }
46169
- });
46170
- }
46171
- for (let row = rowStart; row < rowEnd; row++) {
46172
- if (colEnd < colStart) {
46173
- break;
46174
- }
46175
- [colStart, colEnd].forEach((col) => {
46176
- const style = table._getCellStyle(col, row);
46177
- if (table._getCellStyle(col, row)?.textStick) {
46178
- const cellGroup = table.scenegraph.getCell(col, row);
46179
- adjustCellContentHorizontalLayout(cellGroup, frozenColsWidth + table.tableX, table.tableNoFrameWidth - table.getRightFrozenColsWidth() + table.tableX, changedCells, style?.textStickBaseOnAlign, table);
46180
- }
46181
- });
46182
- }
46183
- }
46184
- function adjustCellContentVerticalLayout(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign, table) {
46185
- if (isNumber$4(cellGroup.mergeStartCol) &&
46186
- isNumber$4(cellGroup.mergeStartRow) &&
46187
- isNumber$4(cellGroup.mergeEndCol) &&
46188
- isNumber$4(cellGroup.mergeEndRow)) {
46189
- const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
46190
- for (let col = colStart; col <= colEnd; col++) {
46191
- for (let row = rowStart; row <= rowEnd; row++) {
46192
- const singleCellGroup = table.scenegraph.getCell(col, row);
46193
- dealVertical(singleCellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
46194
- }
46195
- }
46196
- }
46197
- else {
46198
- dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign);
46199
- }
46200
- }
46201
- function dealVertical(cellGroup, minTop, maxTop, changedCells, textStickBaseOnAlign) {
46202
- const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
46203
- if (!graphic) {
46204
- return;
46205
- }
46206
- if (graphic.type === 'image') {
46207
- const { image: url } = graphic.attribute;
46208
- if (!url || !graphic.resources) {
46209
- return;
46210
- }
46211
- const res = graphic.resources.get(url);
46212
- if (res.state !== 'success') {
46213
- return;
46214
- }
46215
- }
46216
- const textBaseline = graphic.textBaseline ?? 'top';
46217
- graphic.AABBBounds.width();
46218
- const textTop = graphic.globalAABBBounds.y1;
46219
- const textBottom = graphic.globalAABBBounds.y2;
46220
- if (textBaseline === 'middle' && textStickBaseOnAlign) {
46221
- const cellTop = cellGroup.globalAABBBounds.y1 + (cellGroup.firstChild?.attribute.dy ?? 0);
46222
- const cellBottom = cellTop + (cellGroup.contentHeight ?? cellGroup.attribute.height ?? 0);
46223
- if (cellTop < minTop || cellBottom > maxTop) {
46224
- const visibleCellTop = Math.max(cellTop, minTop);
46225
- const visibleCellBottom = Math.min(cellBottom, maxTop);
46226
- const delta = graphic.globalTransMatrix.f - (visibleCellBottom + visibleCellTop) / 2;
46227
- !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
46228
- changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
46229
- col: cellGroup.col,
46230
- row: cellGroup.row,
46231
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
46232
- dy: cellGroup.firstChild?.attribute.dy ?? 0
46233
- });
46234
- cellGroup.forEachChildren((child) => {
46235
- child.setAttribute('dy', (child.attribute.dy ?? 0) - delta + 2);
46236
- });
46237
- }
46238
- }
46239
- else if (textTop < minTop) {
46240
- const deltaHeight = textTop - minTop;
46241
- !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
46242
- changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
46243
- col: cellGroup.col,
46244
- row: cellGroup.row,
46245
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
46246
- dy: cellGroup.firstChild?.attribute.dy ?? 0
46247
- });
46248
- cellGroup.forEachChildren((child) => {
46249
- child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight + 2);
46250
- });
46251
- }
46252
- else if (textBottom > maxTop) {
46253
- const deltaHeight = textBottom - maxTop;
46254
- !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
46255
- changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
46256
- col: cellGroup.col,
46257
- row: cellGroup.row,
46258
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
46259
- dy: cellGroup.firstChild?.attribute.dy ?? 0
46260
- });
46261
- cellGroup.forEachChildren((child) => {
46262
- child.setAttribute('dy', (child.attribute.dy ?? 0) - deltaHeight);
46263
- });
46264
- }
46265
- }
46266
- function adjustCellContentHorizontalLayout(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign, table) {
46267
- if (isNumber$4(cellGroup.mergeStartCol) &&
46268
- isNumber$4(cellGroup.mergeStartRow) &&
46269
- isNumber$4(cellGroup.mergeEndCol) &&
46270
- isNumber$4(cellGroup.mergeEndRow)) {
46271
- const { colStart, colEnd, rowStart, rowEnd } = getCellMergeRange(cellGroup, table.scenegraph);
46272
- for (let col = colStart; col <= colEnd; col++) {
46273
- for (let row = rowStart; row <= rowEnd; row++) {
46274
- const singleCellGroup = table.scenegraph.getCell(col, row);
46275
- dealHorizontal(singleCellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
46276
- }
46277
- }
46278
- }
46279
- else {
46280
- dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign);
46281
- }
46282
- }
46283
- function dealHorizontal(cellGroup, minLeft, maxLeft, changedCells, textStickBaseOnAlign) {
46284
- const graphic = cellGroup.getChildByName('text', true) || cellGroup.getChildByName('image', true);
46285
- if (!graphic) {
46286
- return;
46287
- }
46288
- if (graphic.type === 'image') {
46289
- const { image: url } = graphic.attribute;
46290
- if (!url || !graphic.resources) {
46291
- return;
46322
+ const rangeAfter = scene.table.getCellRange(col, afterRow);
46323
+ if (rangeAfter.start.row <= afterRow + 1 && rangeAfter.end.row >= afterRow + 1) {
46324
+ addNeedUpdateTag(rangeAfter, scene);
46325
+ row = rangeAfter.start.row;
46292
46326
  }
46293
- const res = graphic.resources.get(url);
46294
- if (res.state !== 'success') {
46295
- return;
46327
+ if (isValid$3(row)) {
46328
+ updateRow = isValid$3(updateRow) ? Math.min(updateRow, row) : row;
46296
46329
  }
46297
46330
  }
46298
- const textAlign = graphic.attribute.textAlign ?? graphic.textAlign ?? 'left';
46299
- graphic.AABBBounds.width();
46300
- const textLeft = graphic.globalAABBBounds.x1;
46301
- const textRight = graphic.globalAABBBounds.x2;
46302
- if (textAlign === 'center' && textStickBaseOnAlign) {
46303
- const cellLeft = cellGroup.globalAABBBounds.x1 + (cellGroup.firstChild?.attribute.dx ?? 0);
46304
- const cellRight = cellLeft + (cellGroup.contentWidth ?? cellGroup.attribute.width ?? 0);
46305
- if (cellLeft < minLeft || cellRight > maxLeft) {
46306
- const visibleCellLeft = Math.max(cellLeft, minLeft);
46307
- const visibleCellRight = Math.min(cellRight, maxLeft);
46308
- const delta = graphic.globalTransMatrix.e - (visibleCellRight + visibleCellLeft) / 2;
46309
- !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
46310
- changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
46311
- col: cellGroup.col,
46312
- row: cellGroup.row,
46313
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
46314
- dy: cellGroup.firstChild?.attribute.dy ?? 0
46315
- });
46316
- cellGroup.forEachChildren((child) => {
46317
- child.setAttribute('dx', (child.attribute.dx ?? 0) - delta + 2);
46318
- });
46331
+ return updateRow;
46332
+ }
46333
+ function _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene) {
46334
+ let updateRow;
46335
+ for (let col = 0; col < scene.table.colCount; col++) {
46336
+ let row;
46337
+ const beforeCell = scene.highPerformanceGetCell(col, beforeRow);
46338
+ if (beforeCell.mergeStartRow && beforeCell.mergeEndRow && beforeCell.mergeEndRow > beforeRow) {
46339
+ addNeedUpdateTag({
46340
+ start: {
46341
+ row: beforeCell.mergeStartRow,
46342
+ col: scene.table.heightMode === 'autoHeight' ? 0 : beforeCell.mergeStartCol
46343
+ },
46344
+ end: {
46345
+ row: beforeCell.mergeEndRow,
46346
+ col: scene.table.heightMode === 'autoHeight' ? scene.table.colCount - 1 : beforeCell.mergeEndCol
46347
+ }
46348
+ }, scene);
46349
+ row = beforeCell.mergeStartRow;
46350
+ }
46351
+ const afterCell = scene.highPerformanceGetCell(col, afterRow);
46352
+ if (afterCell.mergeStartRow && afterCell.mergeEndRow && afterCell.mergeStartRow < afterRow) {
46353
+ addNeedUpdateTag({
46354
+ start: {
46355
+ row: afterCell.mergeStartRow,
46356
+ col: scene.table.heightMode === 'autoHeight' ? 0 : afterCell.mergeStartCol
46357
+ },
46358
+ end: {
46359
+ row: afterCell.mergeEndRow,
46360
+ col: scene.table.heightMode === 'autoHeight' ? scene.table.colCount - 1 : afterCell.mergeEndCol
46361
+ }
46362
+ }, scene);
46363
+ row = afterCell.mergeStartRow;
46364
+ }
46365
+ if (isValid$3(row)) {
46366
+ updateRow = isValid$3(updateRow) ? Math.min(updateRow, row) : row;
46319
46367
  }
46320
46368
  }
46321
- else if (textLeft < minLeft) {
46322
- const deltaWidth = textLeft - minLeft;
46323
- !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
46324
- changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
46325
- col: cellGroup.col,
46326
- row: cellGroup.row,
46327
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
46328
- dy: cellGroup.firstChild?.attribute.dy ?? 0
46329
- });
46330
- cellGroup.forEachChildren((child) => {
46331
- child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth + 2);
46332
- });
46333
- }
46334
- else if (textRight > maxLeft) {
46335
- const deltaWidth = textRight - maxLeft;
46336
- !changedCells.has(`${cellGroup.col}-${cellGroup.row}`) &&
46337
- changedCells.set(`${cellGroup.col}-${cellGroup.row}`, {
46338
- col: cellGroup.col,
46339
- row: cellGroup.row,
46340
- dx: cellGroup.firstChild?.attribute.dx ?? 0,
46341
- dy: cellGroup.firstChild?.attribute.dy ?? 0
46342
- });
46343
- cellGroup.forEachChildren((child) => {
46344
- child.setAttribute('dx', (child.attribute.dx ?? 0) - deltaWidth);
46345
- });
46346
- }
46369
+ return updateRow;
46347
46370
  }
46348
- function checkHaveTextStick(table) {
46349
- const headerObjects = table.internalProps.layoutMap.headerObjects;
46350
- const columnObjects = table.internalProps.layoutMap.columnObjects;
46351
- for (let i = 0; i < headerObjects.length; i++) {
46352
- const header = headerObjects[i];
46353
- if (header && header.style?.textStick) {
46354
- return true;
46371
+ function addNeedUpdateTag(range, scene) {
46372
+ const { start, end } = range;
46373
+ for (let col = start.col; col <= end.col; col++) {
46374
+ for (let row = start.row; row <= end.row; row++) {
46375
+ const cellGroup = scene.highPerformanceGetCell(col, row, true);
46376
+ if (!cellGroup) {
46377
+ continue;
46378
+ }
46379
+ cellGroup.needUpdate = true;
46355
46380
  }
46356
46381
  }
46357
- for (let i = 0; i < columnObjects.length; i++) {
46358
- const column = columnObjects[i];
46359
- if (column && column.style?.textStick) {
46360
- return true;
46382
+ }
46383
+ function setRowSeriesNumberCellNeedUpdate(startUpdateRow, scene) {
46384
+ if (scene.table.isHasSeriesNumber()) {
46385
+ for (let row = startUpdateRow; row <= scene.table.rowCount - 1; row++) {
46386
+ updateCell$1(0, row, scene.table, false);
46361
46387
  }
46362
46388
  }
46363
- return false;
46364
46389
  }
46365
46390
 
46366
46391
  function dealFrozen(scene) {
@@ -48295,7 +48320,6 @@
48295
48320
  this.createFrameBorder();
48296
48321
  this.updateBorderSizeAndPosition();
48297
48322
  this.component.updateScrollBar();
48298
- handleTextStick(this.table);
48299
48323
  this.updateNextFrame();
48300
48324
  }
48301
48325
  dealWidthMode() {
@@ -50333,21 +50357,22 @@
50333
50357
  this.table.scenegraph.setY(-top);
50334
50358
  const yRatio = top / (totalHeight - this.table.scenegraph.height);
50335
50359
  this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
50336
- this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
50337
- scrollTop: this.scroll.verticalBarPos,
50338
- scrollLeft: this.scroll.horizontalBarPos,
50339
- scrollHeight: this.table.theme.scrollStyle?.width,
50340
- scrollWidth: this.table.theme.scrollStyle?.width,
50341
- viewHeight: this.table.tableNoFrameHeight,
50342
- viewWidth: this.table.tableNoFrameWidth,
50343
- scrollDirection: 'vertical',
50344
- scrollRatioY: yRatio
50345
- });
50346
50360
  if (oldVerticalBarPos !== top) {
50361
+ this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
50362
+ scrollTop: this.scroll.verticalBarPos,
50363
+ scrollLeft: this.scroll.horizontalBarPos,
50364
+ scrollHeight: this.table.theme.scrollStyle?.width,
50365
+ scrollWidth: this.table.theme.scrollStyle?.width,
50366
+ viewHeight: this.table.tableNoFrameHeight,
50367
+ viewWidth: this.table.tableNoFrameWidth,
50368
+ scrollDirection: 'vertical',
50369
+ scrollRatioY: yRatio
50370
+ });
50347
50371
  this.checkVerticalScrollBarEnd();
50348
50372
  }
50349
50373
  }
50350
50374
  setScrollLeft(left) {
50375
+ this.table.scrollLeft;
50351
50376
  const totalWidth = this.table.getAllColsWidth();
50352
50377
  this.table.getFrozenColsWidth();
50353
50378
  left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width));
@@ -50363,17 +50388,17 @@
50363
50388
  this.table.scenegraph.setX(-left);
50364
50389
  const xRatio = left / (totalWidth - this.table.scenegraph.width);
50365
50390
  this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
50366
- this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
50367
- scrollTop: this.scroll.verticalBarPos,
50368
- scrollLeft: this.scroll.horizontalBarPos,
50369
- scrollHeight: this.table.theme.scrollStyle?.width,
50370
- scrollWidth: this.table.theme.scrollStyle?.width,
50371
- viewHeight: this.table.tableNoFrameHeight,
50372
- viewWidth: this.table.tableNoFrameWidth,
50373
- scrollDirection: 'horizontal',
50374
- scrollRatioX: xRatio
50375
- });
50376
50391
  if (oldHorizontalBarPos !== left) {
50392
+ this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
50393
+ scrollTop: this.scroll.verticalBarPos,
50394
+ scrollLeft: this.scroll.horizontalBarPos,
50395
+ scrollHeight: this.table.theme.scrollStyle?.width,
50396
+ scrollWidth: this.table.theme.scrollStyle?.width,
50397
+ viewHeight: this.table.tableNoFrameHeight,
50398
+ viewWidth: this.table.tableNoFrameWidth,
50399
+ scrollDirection: 'horizontal',
50400
+ scrollRatioX: xRatio
50401
+ });
50377
50402
  this.checkHorizontalScrollBarEnd();
50378
50403
  }
50379
50404
  }
@@ -51124,6 +51149,11 @@
51124
51149
  stateManager.showHorizontalScrollBar();
51125
51150
  stateManager.showVerticalScrollBar();
51126
51151
  }
51152
+ if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEENTER_TABLE)) {
51153
+ table.fireListeners(TABLE_EVENT_TYPE.MOUSEENTER_TABLE, {
51154
+ event: e.nativeEvent
51155
+ });
51156
+ }
51127
51157
  });
51128
51158
  table.scenegraph.tableGroup.addEventListener('pointerleave', (e) => {
51129
51159
  if (!stateManager.isResizeCol() && !stateManager.isMoveCol() && !stateManager.isSelecting()) {
@@ -51153,10 +51183,7 @@
51153
51183
  const target = e.target;
51154
51184
  if (target && !target.isDescendantsOf(table.scenegraph.tableGroup)) {
51155
51185
  table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_TABLE, {
51156
- col: -1,
51157
- row: -1,
51158
- event: e.nativeEvent,
51159
- target: undefined
51186
+ event: e.nativeEvent
51160
51187
  });
51161
51188
  }
51162
51189
  });
@@ -51213,6 +51240,11 @@
51213
51240
  eventManager.dealTableHover();
51214
51241
  });
51215
51242
  table.scenegraph.tableGroup.addEventListener('pointerdown', (e) => {
51243
+ if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
51244
+ table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
51245
+ event: e.nativeEvent
51246
+ });
51247
+ }
51216
51248
  table.eventManager.isDown = true;
51217
51249
  table.eventManager.LastBodyPointerXY = { x: e.x, y: e.y };
51218
51250
  table.eventManager.LastPointerXY = { x: e.x, y: e.y };
@@ -51220,6 +51252,7 @@
51220
51252
  return;
51221
51253
  }
51222
51254
  const eventArgsSet = getCellEventArgsSet(e);
51255
+ eventManager.downIcon = undefined;
51223
51256
  if (stateManager.interactionState !== InteractionState.default) {
51224
51257
  return;
51225
51258
  }
@@ -51233,6 +51266,7 @@
51233
51266
  const hitIcon = eventArgsSet?.eventArgs?.target?.role?.startsWith('icon')
51234
51267
  ? eventArgsSet.eventArgs.target
51235
51268
  : undefined;
51269
+ eventManager.downIcon = hitIcon;
51236
51270
  if (!hitIcon || hitIcon.attribute.interactive === false) {
51237
51271
  if (e.pointerType === 'touch') {
51238
51272
  eventManager.touchEnd = false;
@@ -51406,7 +51440,7 @@
51406
51440
  }
51407
51441
  }
51408
51442
  }
51409
- if (!eventManager.touchMove && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
51443
+ if (!eventManager.touchMove && e.button === 0 && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
51410
51444
  const { col, row } = eventArgsSet.eventArgs;
51411
51445
  const cellInfo = table.getCellInfo(col, row);
51412
51446
  let icon;
@@ -51519,16 +51553,14 @@
51519
51553
  }
51520
51554
  function endResizeCol(table) {
51521
51555
  table.stateManager.endResizeCol();
51522
- if (table.hasListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END)) {
51523
- const columns = [];
51524
- for (let col = 0; col < table.colCount; col++) {
51525
- columns.push(table.getColWidth(col));
51526
- }
51527
- table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
51528
- col: table.stateManager.columnResize.col,
51529
- colWidths: columns
51530
- });
51556
+ const columns = [];
51557
+ for (let col = 0; col < table.colCount; col++) {
51558
+ columns.push(table.getColWidth(col));
51531
51559
  }
51560
+ table.fireListeners(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, {
51561
+ col: table.stateManager.columnResize.col,
51562
+ colWidths: columns
51563
+ });
51532
51564
  }
51533
51565
  function dblclickHandler(e, table) {
51534
51566
  const eventArgsSet = getCellEventArgsSet(e);
@@ -51601,6 +51633,11 @@
51601
51633
  }
51602
51634
  scenegraph.table.stateManager.hideMenu();
51603
51635
  scenegraph.table.editorManager?.completeEdit();
51636
+ if (scenegraph.table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
51637
+ scenegraph.table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
51638
+ event: e.nativeEvent
51639
+ });
51640
+ }
51604
51641
  });
51605
51642
  scenegraph.component.vScrollBar.addEventListener('pointerup', () => {
51606
51643
  stateManager.fastScrolling = false;
@@ -51626,6 +51663,11 @@
51626
51663
  }
51627
51664
  scenegraph.table.stateManager.hideMenu();
51628
51665
  scenegraph.table.editorManager?.completeEdit();
51666
+ if (scenegraph.table.hasListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE)) {
51667
+ scenegraph.table.fireListeners(TABLE_EVENT_TYPE.MOUSEDOWN_TABLE, {
51668
+ event: e.nativeEvent
51669
+ });
51670
+ }
51629
51671
  });
51630
51672
  scenegraph.component.hScrollBar.addEventListener('pointerup', () => {
51631
51673
  stateManager.fastScrolling = false;
@@ -52213,8 +52255,10 @@
52213
52255
  const rightFrozenColsWidth = table.getRightFrozenColsWidth();
52214
52256
  const startCell = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].start;
52215
52257
  const endCell = table.stateManager.select.ranges[table.stateManager.select.ranges.length - 1].end;
52216
- const canScrollY = table.isFrozenRow(startCell.row) === false || table.isFrozenRow(endCell.row) === false;
52217
- const canScrollX = table.isFrozenColumn(startCell.col) === false || table.isFrozenColumn(endCell.col) === false;
52258
+ const canScrollY = (table.isFrozenRow(startCell.row) === false || table.isFrozenRow(endCell.row) === false) &&
52259
+ table.getAllRowsHeight() > table.tableNoFrameHeight;
52260
+ const canScrollX = (table.isFrozenColumn(startCell.col) === false || table.isFrozenColumn(endCell.col) === false) &&
52261
+ table.getAllColsWidth() > table.tableNoFrameWidth;
52218
52262
  if (((y > drawRange.bottom - bottomFrozenRowHeight || y < drawRange.top + topFrozenRowHeight) && canScrollY) ||
52219
52263
  ((x > drawRange.right - rightFrozenColsWidth || x < drawRange.left + leftFrozenColsWidth) && canScrollX)) {
52220
52264
  table.eventManager.scrollXSpeed = 0;
@@ -52325,25 +52369,30 @@
52325
52369
  if (!eventManager.isTouchdown || !isTouchEvent$1(e)) {
52326
52370
  return;
52327
52371
  }
52328
- if (eventManager.touchMovePoints.length > 4) {
52329
- eventManager.touchMovePoints.shift();
52330
- }
52331
- eventManager.touchMovePoints.push({
52332
- x: e.changedTouches[0].pageX,
52333
- y: e.changedTouches[0].pageY,
52334
- timestamp: Date.now()
52335
- });
52336
- const deltaX = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].x +
52337
- eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].x;
52338
- const deltaY = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].y +
52339
- eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].y;
52340
- handleWhell({ deltaX, deltaY }, stateManager);
52341
- if (e.cancelable &&
52342
- (table.internalProps.overscrollBehavior === 'none' ||
52343
- (Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, stateManager)) ||
52344
- (Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, stateManager)))) {
52372
+ if (eventManager.downIcon?.attribute?.funcType === IconFuncTypeEnum.dragReorder) {
52345
52373
  e.preventDefault();
52346
52374
  }
52375
+ else {
52376
+ if (eventManager.touchMovePoints.length > 4) {
52377
+ eventManager.touchMovePoints.shift();
52378
+ }
52379
+ eventManager.touchMovePoints.push({
52380
+ x: e.changedTouches[0].pageX,
52381
+ y: e.changedTouches[0].pageY,
52382
+ timestamp: Date.now()
52383
+ });
52384
+ const deltaX = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].x +
52385
+ eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].x;
52386
+ const deltaY = -eventManager.touchMovePoints[eventManager.touchMovePoints.length - 1].y +
52387
+ eventManager.touchMovePoints[eventManager.touchMovePoints.length - 2].y;
52388
+ handleWhell({ deltaX, deltaY }, stateManager);
52389
+ if (e.cancelable &&
52390
+ (table.internalProps.overscrollBehavior === 'none' ||
52391
+ (Math.abs(deltaY) >= Math.abs(deltaX) && deltaY !== 0 && isVerticalScrollable(deltaY, stateManager)) ||
52392
+ (Math.abs(deltaY) <= Math.abs(deltaX) && deltaX !== 0 && isHorizontalScrollable(deltaX, stateManager)))) {
52393
+ e.preventDefault();
52394
+ }
52395
+ }
52347
52396
  };
52348
52397
  window.addEventListener('touchmove', globalTouchMoveCallback, { passive: false });
52349
52398
  eventManager.globalEventListeners.push({
@@ -52357,23 +52406,28 @@
52357
52406
  if (!eventManager.isTouchdown || !isTouchEvent$1(e)) {
52358
52407
  return;
52359
52408
  }
52360
- if (eventManager.touchMovePoints?.length) {
52361
- if (eventManager.touchMovePoints.length > 4) {
52362
- eventManager.touchMovePoints.shift();
52409
+ if (eventManager.downIcon?.attribute?.funcType === IconFuncTypeEnum.dragReorder) {
52410
+ e.preventDefault();
52411
+ }
52412
+ else {
52413
+ if (eventManager.touchMovePoints?.length) {
52414
+ if (eventManager.touchMovePoints.length > 4) {
52415
+ eventManager.touchMovePoints.shift();
52416
+ }
52417
+ eventManager.touchMovePoints.push({
52418
+ x: e.changedTouches[0].pageX,
52419
+ y: e.changedTouches[0].pageY,
52420
+ timestamp: Date.now()
52421
+ });
52422
+ const firstPoint = eventManager.touchMovePoints[0];
52423
+ const lastPoint = eventManager.touchMovePoints[eventManager.touchMovePoints?.length - 1];
52424
+ const vX = (lastPoint.x - firstPoint.x) / (lastPoint.timestamp - firstPoint.timestamp);
52425
+ const vY = (lastPoint.y - firstPoint.y) / (lastPoint.timestamp - firstPoint.timestamp);
52426
+ eventManager.inertiaScroll.startInertia(vX, vY, 0.95);
52427
+ table.eventManager.inertiaScroll.setScrollHandle((dx, dy) => {
52428
+ handleWhell({ deltaX: -dx, deltaY: -dy }, table.stateManager);
52429
+ });
52363
52430
  }
52364
- eventManager.touchMovePoints.push({
52365
- x: e.changedTouches[0].pageX,
52366
- y: e.changedTouches[0].pageY,
52367
- timestamp: Date.now()
52368
- });
52369
- const firstPoint = eventManager.touchMovePoints[0];
52370
- const lastPoint = eventManager.touchMovePoints[eventManager.touchMovePoints?.length - 1];
52371
- const vX = (lastPoint.x - firstPoint.x) / (lastPoint.timestamp - firstPoint.timestamp);
52372
- const vY = (lastPoint.y - firstPoint.y) / (lastPoint.timestamp - firstPoint.timestamp);
52373
- eventManager.inertiaScroll.startInertia(vX, vY, 0.95);
52374
- table.eventManager.inertiaScroll.setScrollHandle((dx, dy) => {
52375
- handleWhell({ deltaX: -dx, deltaY: -dy }, table.stateManager);
52376
- });
52377
52431
  }
52378
52432
  eventManager.isTouchdown = false;
52379
52433
  eventManager.touchMovePoints = [];
@@ -52544,10 +52598,12 @@
52544
52598
  isDraging = false;
52545
52599
  scrollYSpeed;
52546
52600
  scrollXSpeed;
52601
+ downIcon;
52547
52602
  globalEventListeners = [];
52548
52603
  inertiaScroll;
52549
52604
  constructor(table) {
52550
52605
  this.table = table;
52606
+ this.handleTextStickBindId = [];
52551
52607
  this.inertiaScroll = new InertiaScroll(table.stateManager);
52552
52608
  if (Env.mode === 'node') {
52553
52609
  return;
@@ -52566,14 +52622,19 @@
52566
52622
  }
52567
52623
  updateEventBinder() {
52568
52624
  setTimeout(() => {
52569
- if (checkHaveTextStick(this.table) && !this.handleTextStickBindId) {
52570
- this.handleTextStickBindId = this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
52625
+ if (checkHaveTextStick(this.table) && this.handleTextStickBindId?.length === 0) {
52626
+ this.handleTextStickBindId.push(this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
52571
52627
  handleTextStick(this.table);
52572
- });
52628
+ }));
52629
+ this.handleTextStickBindId.push(this.table.on(TABLE_EVENT_TYPE.RESIZE_COLUMN_END, e => {
52630
+ handleTextStick(this.table);
52631
+ }));
52573
52632
  }
52574
52633
  else if (!checkHaveTextStick(this.table) && this.handleTextStickBindId) {
52575
- this.table.off(this.handleTextStickBindId);
52576
- this.handleTextStickBindId = undefined;
52634
+ this.handleTextStickBindId.forEach(id => {
52635
+ this.table.off(id);
52636
+ });
52637
+ this.handleTextStickBindId = [];
52577
52638
  }
52578
52639
  }, 0);
52579
52640
  }
@@ -52604,11 +52665,7 @@
52604
52665
  this.table.on(TABLE_EVENT_TYPE.DROPDOWN_MENU_CLICK, () => {
52605
52666
  stateManager.hideMenu();
52606
52667
  });
52607
- if (checkHaveTextStick(this.table)) {
52608
- this.handleTextStickBindId = this.table.on(TABLE_EVENT_TYPE.SCROLL, e => {
52609
- handleTextStick(this.table);
52610
- });
52611
- }
52668
+ this.updateEventBinder();
52612
52669
  bindMediaClick(this.table);
52613
52670
  this.table.on(TABLE_EVENT_TYPE.DBLCLICK_CELL, (e) => {
52614
52671
  if (e.federatedEvent) {
@@ -53160,7 +53217,7 @@
53160
53217
  return undefined;
53161
53218
  }
53162
53219
  getHierarchyIconWidth() {
53163
- return this.expandIcon.width + this.expandIcon.marginLeft + this.expandIcon.marginRight;
53220
+ return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);
53164
53221
  }
53165
53222
  }
53166
53223
 
@@ -54044,7 +54101,7 @@
54044
54101
  return undefined;
54045
54102
  }
54046
54103
  getHierarchyIconWidth() {
54047
- return this.expandIcon.width + this.expandIcon.marginLeft + this.expandIcon.marginRight;
54104
+ return this.expandIcon.width + (this.expandIcon.marginLeft ?? 0) + (this.expandIcon.marginRight ?? 0);
54048
54105
  }
54049
54106
  checkDropDownIcon(_table, col, row) {
54050
54107
  if (_table.isPivotTable()) {
@@ -54552,39 +54609,7 @@
54552
54609
  return;
54553
54610
  }
54554
54611
  const { col, row } = e;
54555
- let tooltipOption;
54556
- const headerDescription = table.getHeaderDescription(col, row);
54557
- if (headerDescription) {
54558
- const rect = table.getCellRangeRelativeRect({ col, row });
54559
- tooltipOption = {
54560
- content: headerDescription,
54561
- referencePosition: {
54562
- placement: Placement.bottom,
54563
- rect
54564
- },
54565
- style: { arrowMark: false }
54566
- };
54567
- }
54568
- else if (table.internalProps.tooltip?.isShowOverflowTextTooltip) {
54569
- const overflowText = table.getCellOverflowText(col, row);
54570
- const rect = table.getCellRangeRelativeRect({ col, row });
54571
- if (overflowText) {
54572
- tooltipOption = {
54573
- content: headerDescription
54574
- ? `${headerDescription}
54575
- ${overflowText}`
54576
- : overflowText,
54577
- referencePosition: {
54578
- placement: Placement.bottom,
54579
- rect
54580
- },
54581
- style: table.theme.tooltipStyle
54582
- };
54583
- }
54584
- }
54585
- if (tooltipOption) {
54586
- this._bindToCell(e.col, e.row, tooltipOption);
54587
- }
54612
+ this.showTooltip(col, row);
54588
54613
  });
54589
54614
  table.on(TABLE_EVENT_TYPE.MOUSEMOVE_CELL, e => {
54590
54615
  if (isMobile()) {
@@ -54622,6 +54647,45 @@
54622
54647
  this._unbindFromCell();
54623
54648
  });
54624
54649
  }
54650
+ showTooltip(col, row) {
54651
+ let tooltipOption;
54652
+ const table = this._table;
54653
+ const headerDescription = table.getHeaderDescription(col, row);
54654
+ if (headerDescription) {
54655
+ const rect = table.getCellRangeRelativeRect({ col, row });
54656
+ tooltipOption = {
54657
+ content: headerDescription,
54658
+ referencePosition: {
54659
+ placement: Placement.bottom,
54660
+ rect
54661
+ },
54662
+ style: { arrowMark: false }
54663
+ };
54664
+ }
54665
+ else if (table.internalProps.tooltip?.isShowOverflowTextTooltip) {
54666
+ const overflowText = table.getCellOverflowText(col, row);
54667
+ const rect = table.getCellRangeRelativeRect({ col, row });
54668
+ if (overflowText) {
54669
+ tooltipOption = {
54670
+ content: headerDescription
54671
+ ? `${headerDescription}
54672
+ ${overflowText}`
54673
+ : overflowText,
54674
+ referencePosition: {
54675
+ placement: Placement.bottom,
54676
+ rect
54677
+ },
54678
+ style: table.theme.tooltipStyle
54679
+ };
54680
+ }
54681
+ }
54682
+ if (tooltipOption) {
54683
+ this._bindToCell(col, row, tooltipOption);
54684
+ }
54685
+ else {
54686
+ this._unbindFromCell();
54687
+ }
54688
+ }
54625
54689
  _getTooltipInstanceInfo(col, row) {
54626
54690
  const table = this._table;
54627
54691
  const tooltipInstances = this._tooltipInstances;
@@ -56050,6 +56114,14 @@
56050
56114
  }
56051
56115
  this.table.scenegraph.updateNextFrame();
56052
56116
  }
56117
+ updateCustomCell(customCellStyle, customCellStyleArrangement) {
56118
+ customCellStyle.forEach((cellStyle) => {
56119
+ this.registerCustomCellStyle(cellStyle.id, cellStyle.style);
56120
+ });
56121
+ customCellStyleArrangement.forEach((cellStyle) => {
56122
+ this.arrangeCustomCellStyle(cellStyle.cellPosition, cellStyle.customStyleId);
56123
+ });
56124
+ }
56053
56125
  }
56054
56126
  function mergeStyle(cacheStyle, customCellStyle) {
56055
56127
  cacheStyle = cacheStyle.clone();
@@ -56080,6 +56152,8 @@
56080
56152
  _heightMode;
56081
56153
  _autoFillWidth;
56082
56154
  _autoFillHeight;
56155
+ _widthAdaptiveMode;
56156
+ _heightAdaptiveMode;
56083
56157
  customRender;
56084
56158
  canvasWidth;
56085
56159
  canvasHeight;
@@ -56092,7 +56166,7 @@
56092
56166
  return TABLE_EVENT_TYPE;
56093
56167
  }
56094
56168
  options;
56095
- version = "0.23.2";
56169
+ version = "0.23.4";
56096
56170
  pagination;
56097
56171
  id = `VTable${Date.now()}`;
56098
56172
  headerStyleCache;
@@ -56108,11 +56182,13 @@
56108
56182
  if (!container && options.mode !== 'node') {
56109
56183
  throw new Error("vtable's container is undefined");
56110
56184
  }
56111
- 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;
56185
+ const { frozenColCount = 0, defaultRowHeight = 40, defaultHeaderRowHeight, defaultColWidth = 80, defaultHeaderColWidth, widthMode = 'standard', heightMode = 'standard', autoFillWidth = false, autoFillHeight = false, widthAdaptiveMode = 'only-body', heightAdaptiveMode = 'only-body', keyboardOptions, eventOptions, rowSeriesNumber, columnResizeMode, dragHeaderMode, showFrozenIcon, allowFrozenColCount, padding, hover, menu, select: click, customRender, pixelRatio = defaultPixelRatio, renderChartAsync, renderChartAsyncBatchCount, mode, modeParams, canvasWidth, canvasHeight, overscrollBehavior, limitMinWidth } = options;
56112
56186
  this.container = container;
56113
56187
  this.options = options;
56114
56188
  this._widthMode = widthMode;
56115
56189
  this._heightMode = heightMode;
56190
+ this._widthAdaptiveMode = widthAdaptiveMode;
56191
+ this._heightAdaptiveMode = heightAdaptiveMode;
56116
56192
  this._autoFillWidth = autoFillWidth;
56117
56193
  this._autoFillHeight = autoFillHeight;
56118
56194
  this.customRender = customRender;
@@ -56448,6 +56524,22 @@
56448
56524
  this._autoFillHeight = autoFillHeight;
56449
56525
  }
56450
56526
  }
56527
+ get widthAdaptiveMode() {
56528
+ return this._widthAdaptiveMode;
56529
+ }
56530
+ set widthAdaptiveMode(widthAdaptiveMode) {
56531
+ if (widthAdaptiveMode !== this._widthAdaptiveMode) {
56532
+ this._widthAdaptiveMode = widthAdaptiveMode;
56533
+ }
56534
+ }
56535
+ get heightAdaptiveMode() {
56536
+ return this._heightAdaptiveMode;
56537
+ }
56538
+ set heightAdaptiveMode(heightAdaptiveMode) {
56539
+ if (heightAdaptiveMode !== this._heightAdaptiveMode) {
56540
+ this._heightAdaptiveMode = heightAdaptiveMode;
56541
+ }
56542
+ }
56451
56543
  _colWidthDefineToPxWidth(width) {
56452
56544
  if (width === 'auto') {
56453
56545
  return 0;
@@ -56586,12 +56678,12 @@
56586
56678
  return this.defaultColWidth;
56587
56679
  }
56588
56680
  getDefaultRowHeight(row) {
56589
- if (this.isColumnHeader(0, row) || this.isCornerHeader(0, row)) {
56681
+ if (this.isColumnHeader(0, row) || this.isCornerHeader(0, row) || this.isSeriesNumberInHeader(0, row)) {
56590
56682
  return Array.isArray(this.defaultHeaderRowHeight)
56591
56683
  ? this.defaultHeaderRowHeight[row] ?? this.internalProps.defaultRowHeight
56592
56684
  : this.defaultHeaderRowHeight;
56593
56685
  }
56594
- if (this.isBottomFrozenRow(this.rowHeaderLevelCount, row)) {
56686
+ if (this.isBottomFrozenRow(row)) {
56595
56687
  return Array.isArray(this.defaultHeaderRowHeight)
56596
56688
  ? this.defaultHeaderRowHeight[this.columnHeaderLevelCount > 0 ? this.columnHeaderLevelCount - this.bottomFrozenRowCount : 0] ?? this.internalProps.defaultRowHeight
56597
56689
  : this.defaultHeaderRowHeight;
@@ -57186,6 +57278,7 @@
57186
57278
  if (parentElement) {
57187
57279
  parentElement.removeChild(internalProps.element);
57188
57280
  }
57281
+ this.editorManager?.editingEditor?.onEnd?.();
57189
57282
  this.isReleased = true;
57190
57283
  }
57191
57284
  fireListeners(type, event) {
@@ -57193,7 +57286,7 @@
57193
57286
  }
57194
57287
  updateOption(options) {
57195
57288
  this.options = options;
57196
- 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;
57289
+ 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, widthAdaptiveMode, heightAdaptiveMode, customRender, renderChartAsync, renderChartAsyncBatchCount, overscrollBehavior, limitMinWidth } = options;
57197
57290
  if (pixelRatio && pixelRatio !== this.internalProps.pixelRatio) {
57198
57291
  this.internalProps.pixelRatio = pixelRatio;
57199
57292
  }
@@ -57217,6 +57310,8 @@
57217
57310
  }
57218
57311
  this.widthMode = widthMode ?? 'standard';
57219
57312
  this.heightMode = heightMode ?? 'standard';
57313
+ this._widthAdaptiveMode = widthAdaptiveMode ?? 'only-body';
57314
+ this._heightAdaptiveMode = heightAdaptiveMode ?? 'only-body';
57220
57315
  this.autoFillWidth = autoFillWidth ?? false;
57221
57316
  this.autoFillHeight = autoFillHeight ?? false;
57222
57317
  this.customRender = customRender;
@@ -57294,7 +57389,8 @@
57294
57389
  this.clearCellStyleCache();
57295
57390
  this.clearColWidthCache();
57296
57391
  this.clearRowHeightCache();
57297
- this.customCellStylePlugin = new CustomCellStylePlugin(this, options.customCellStyle ?? [], options.customCellStyleArrangement ?? []);
57392
+ internalProps.customMergeCell = options.customMergeCell;
57393
+ this.customCellStylePlugin.updateCustomCell(options.customCellStyle ?? [], options.customCellStyleArrangement ?? []);
57298
57394
  }
57299
57395
  renderWithRecreateCells() {
57300
57396
  const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
@@ -58388,6 +58484,9 @@
58388
58484
  measureText(text, font) {
58389
58485
  return textMeasure.measureText(text, font);
58390
58486
  }
58487
+ measureTextBounds(attribute) {
58488
+ return measureTextBounds(attribute);
58489
+ }
58391
58490
  getCustomRender(col, row) {
58392
58491
  let customRender;
58393
58492
  if (this.getCellLocation(col, row) !== 'body') {
@@ -58854,7 +58953,7 @@
58854
58953
  let chartSpec = layout.getRawChartSpec(col, row);
58855
58954
  if (chartSpec) {
58856
58955
  if (layout._table.isPivotChart()) {
58857
- chartSpec = cloneDeep(chartSpec);
58956
+ chartSpec = cloneDeepSpec(chartSpec);
58858
58957
  chartSpec.sortDataByAxis = true;
58859
58958
  if (isArray$3(chartSpec.series)) {
58860
58959
  chartSpec.series.forEach((serie) => {
@@ -61773,6 +61872,11 @@
61773
61872
  this.scenegraph.resize();
61774
61873
  }
61775
61874
  this.render();
61875
+ if (isValid$3(oldHoverState.col) && isValid$3(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0) {
61876
+ setTimeout(() => {
61877
+ this.internalProps.tooltipHandler.showTooltip(oldHoverState.col, oldHoverState.row);
61878
+ }, 0);
61879
+ }
61776
61880
  }
61777
61881
  setRecordChildren(records, col, row) {
61778
61882
  const record = this.getCellOriginRecord(col, row);
@@ -62516,14 +62620,17 @@
62516
62620
  this.hasTwoIndicatorAxes = this._indicators.some(indicatorObject => {
62517
62621
  if (indicatorObject.chartSpec &&
62518
62622
  indicatorObject.chartSpec.series &&
62519
- indicatorObject.chartSpec.series.length > 1 &&
62520
- indicatorObject.chartSpec.axes?.every((axis) => {
62521
- if (axis.orient === (this.indicatorsAsCol ? 'top' : 'right') && axis.visible === false) {
62522
- return false;
62523
- }
62623
+ indicatorObject.chartSpec.series.length > 1) {
62624
+ const axes = indicatorObject.chartSpec.axes ?? this._table.pivotChartAxes ?? [];
62625
+ if (!axes.length ||
62626
+ axes.every((axis) => {
62627
+ if (axis.orient === (this.indicatorsAsCol ? 'top' : 'right') && axis.visible === false) {
62628
+ return false;
62629
+ }
62630
+ return true;
62631
+ })) {
62524
62632
  return true;
62525
- })) {
62526
- return true;
62633
+ }
62527
62634
  }
62528
62635
  return false;
62529
62636
  });
@@ -68343,7 +68450,7 @@
68343
68450
  }
68344
68451
 
68345
68452
  registerForVrender();
68346
- const version = "0.23.2";
68453
+ const version = "0.23.4";
68347
68454
  function getIcons() {
68348
68455
  return get$2();
68349
68456
  }