@visactor/vtable 1.19.6 → 1.19.7

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 (91) hide show
  1. package/cjs/ListTable.js +11 -8
  2. package/cjs/ListTable.js.map +1 -1
  3. package/cjs/PivotChart.js +2 -2
  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/components/legend/discrete-legend/discrete-legend.js +6 -4
  8. package/cjs/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  9. package/cjs/components/menu/dom/MenuHandler.js +42 -4
  10. package/cjs/components/menu/dom/MenuHandler.js.map +1 -1
  11. package/cjs/components/menu/dom/logic/MenuElement.js +1 -0
  12. package/cjs/components/menu/dom/logic/MenuElement.js.map +1 -1
  13. package/cjs/core/BaseTable.d.ts +3 -1
  14. package/cjs/core/BaseTable.js +37 -7
  15. package/cjs/core/BaseTable.js.map +1 -1
  16. package/cjs/core/TABLE_EVENT_TYPE.d.ts +1 -0
  17. package/cjs/core/TABLE_EVENT_TYPE.js +1 -0
  18. package/cjs/core/TABLE_EVENT_TYPE.js.map +1 -1
  19. package/cjs/data/CachedDataSource.js +1 -1
  20. package/cjs/data/CachedDataSource.js.map +1 -1
  21. package/cjs/event/listener/table-group.js.map +1 -1
  22. package/cjs/index.d.ts +1 -1
  23. package/cjs/index.js +1 -1
  24. package/cjs/index.js.map +1 -1
  25. package/cjs/layout/simple-header-layout.js +1 -1
  26. package/cjs/layout/simple-header-layout.js.map +1 -1
  27. package/cjs/scenegraph/component/table-component.js +10 -8
  28. package/cjs/scenegraph/component/table-component.js.map +1 -1
  29. package/cjs/scenegraph/scenegraph.d.ts +1 -0
  30. package/cjs/scenegraph/scenegraph.js +17 -1
  31. package/cjs/scenegraph/scenegraph.js.map +1 -1
  32. package/cjs/state/resize/update-resize-column.js +1 -1
  33. package/cjs/state/resize/update-resize-column.js.map +1 -1
  34. package/cjs/state/resize/update-resize-row.js +1 -1
  35. package/cjs/state/resize/update-resize-row.js.map +1 -1
  36. package/cjs/themes/theme-define.js +4 -0
  37. package/cjs/themes/theme-define.js.map +1 -1
  38. package/cjs/ts-types/base-table.d.ts +2 -0
  39. package/cjs/ts-types/base-table.js.map +1 -1
  40. package/cjs/ts-types/events.d.ts +2 -0
  41. package/cjs/ts-types/events.js.map +1 -1
  42. package/cjs/ts-types/theme.d.ts +1 -0
  43. package/cjs/ts-types/theme.js.map +1 -1
  44. package/cjs/vrender.js.map +1 -1
  45. package/dist/vtable.js +160 -24
  46. package/dist/vtable.min.js +2 -2
  47. package/es/ListTable.js +11 -8
  48. package/es/ListTable.js.map +1 -1
  49. package/es/PivotChart.js +2 -2
  50. package/es/PivotChart.js.map +1 -1
  51. package/es/PivotTable.js +2 -2
  52. package/es/PivotTable.js.map +1 -1
  53. package/es/components/legend/discrete-legend/discrete-legend.js +6 -4
  54. package/es/components/legend/discrete-legend/discrete-legend.js.map +1 -1
  55. package/es/components/menu/dom/MenuHandler.js +42 -4
  56. package/es/components/menu/dom/MenuHandler.js.map +1 -1
  57. package/es/components/menu/dom/logic/MenuElement.js +1 -0
  58. package/es/components/menu/dom/logic/MenuElement.js.map +1 -1
  59. package/es/core/BaseTable.d.ts +3 -1
  60. package/es/core/BaseTable.js +37 -7
  61. package/es/core/BaseTable.js.map +1 -1
  62. package/es/core/TABLE_EVENT_TYPE.d.ts +1 -0
  63. package/es/core/TABLE_EVENT_TYPE.js +1 -0
  64. package/es/core/TABLE_EVENT_TYPE.js.map +1 -1
  65. package/es/data/CachedDataSource.js +1 -1
  66. package/es/data/CachedDataSource.js.map +1 -1
  67. package/es/event/listener/table-group.js.map +1 -1
  68. package/es/index.d.ts +1 -1
  69. package/es/index.js +1 -1
  70. package/es/index.js.map +1 -1
  71. package/es/layout/simple-header-layout.js +1 -1
  72. package/es/layout/simple-header-layout.js.map +1 -1
  73. package/es/scenegraph/component/table-component.js +10 -8
  74. package/es/scenegraph/component/table-component.js.map +1 -1
  75. package/es/scenegraph/scenegraph.d.ts +1 -0
  76. package/es/scenegraph/scenegraph.js +21 -1
  77. package/es/scenegraph/scenegraph.js.map +1 -1
  78. package/es/state/resize/update-resize-column.js +1 -1
  79. package/es/state/resize/update-resize-column.js.map +1 -1
  80. package/es/state/resize/update-resize-row.js +1 -1
  81. package/es/state/resize/update-resize-row.js.map +1 -1
  82. package/es/themes/theme-define.js +4 -0
  83. package/es/themes/theme-define.js.map +1 -1
  84. package/es/ts-types/base-table.d.ts +2 -0
  85. package/es/ts-types/base-table.js.map +1 -1
  86. package/es/ts-types/events.d.ts +2 -0
  87. package/es/ts-types/events.js.map +1 -1
  88. package/es/ts-types/theme.d.ts +1 -0
  89. package/es/ts-types/theme.js.map +1 -1
  90. package/es/vrender.js.map +1 -1
  91. package/package.json +3 -3
package/dist/vtable.js CHANGED
@@ -34905,6 +34905,7 @@
34905
34905
  MOUSEENTER_CELL: 'mouseenter_cell',
34906
34906
  MOUSELEAVE_CELL: 'mouseleave_cell',
34907
34907
  CONTEXTMENU_CELL: 'contextmenu_cell',
34908
+ CONTEXTMENU_CANVAS: 'contextmenu_canvas',
34908
34909
  RESIZE_COLUMN: 'resize_column',
34909
34910
  RESIZE_COLUMN_END: 'resize_column_end',
34910
34911
  RESIZE_ROW: 'resize_row',
@@ -36402,6 +36403,9 @@
36402
36403
  },
36403
36404
  get verticalPadding() {
36404
36405
  return scroll.verticalPadding ?? 0;
36406
+ },
36407
+ get ignoreFrozenCols() {
36408
+ return scroll.ignoreFrozenCols ?? false;
36405
36409
  }
36406
36410
  };
36407
36411
  }
@@ -39769,8 +39773,8 @@
39769
39773
  if (isValid$3(newRecord)) {
39770
39774
  newRecord.hierarchyState = oldSource[i].hierarchyState;
39771
39775
  }
39772
- if (isArray$7(oldRecord.children) &&
39773
- isArray$7(newRecord.children) &&
39776
+ if (isArray$7(oldRecord?.children) &&
39777
+ isArray$7(newRecord?.children) &&
39774
39778
  oldRecord.map.size !== 0 &&
39775
39779
  newRecord.map.size !== 0) {
39776
39780
  syncGroupCollapseState(oldRecord.children, newRecord.children, oldRecord.map, newRecord.map);
@@ -46422,19 +46426,19 @@
46422
46426
  const visible1 = theme.scrollStyle?.visible;
46423
46427
  const horizontalVisible = theme.scrollStyle?.horizontalVisible ?? visible1;
46424
46428
  const verticalVisible = theme.scrollStyle?.verticalVisible ?? visible1;
46425
- const tableWidth = Math.ceil(this.table.scenegraph.tableGroup.attribute.width);
46426
- const tableHeight = Math.ceil(this.table.scenegraph.tableGroup.attribute.height);
46429
+ const tableWidth = Math.ceil(this.table.tableNoFrameWidth);
46430
+ const tableHeight = Math.ceil(this.table.tableNoFrameHeight);
46427
46431
  const totalHeight = this.table.getAllRowsHeight();
46428
46432
  const totalWidth = this.table.getAllColsWidth();
46429
46433
  const frozenRowsHeight = this.table.getFrozenRowsHeight();
46430
46434
  const frozenColsWidth = this.table.getFrozenColsWidth();
46431
46435
  const bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight();
46432
46436
  const rightFrozenColsWidth = this.table.getRightFrozenColsWidth();
46437
+ const hoverOn = this.table.theme.scrollStyle.hoverOn;
46433
46438
  const sizeTolerance = this.table.options.customConfig?._disableColumnAndRowSizeRound ? 1 : 0;
46434
46439
  if (totalWidth > tableWidth + sizeTolerance) {
46435
46440
  const y = Math.min(tableHeight, totalHeight);
46436
46441
  const rangeEnd = Math.max(0.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth));
46437
- const hoverOn = this.table.theme.scrollStyle.hoverOn;
46438
46442
  let attrY = 0;
46439
46443
  if (this.table.theme.scrollStyle.barToSide) {
46440
46444
  attrY =
@@ -46445,10 +46449,21 @@
46445
46449
  else {
46446
46450
  attrY = y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
46447
46451
  }
46452
+ let hScrollBarx = frozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0);
46453
+ let hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
46454
+ const ignoreFrozenCols = this.table.theme.scrollStyle?.ignoreFrozenCols ?? false;
46455
+ if (ignoreFrozenCols) {
46456
+ hScrollBarx = !hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0;
46457
+ hScrollBarWidth = tableWidth;
46458
+ }
46459
+ else {
46460
+ hScrollBarx = frozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0);
46461
+ hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
46462
+ }
46448
46463
  this.hScrollBar.setAttributes({
46449
- x: frozenColsWidth + (!hoverOn ? this.table.scenegraph.tableGroup.attribute.x : 0),
46464
+ x: hScrollBarx,
46450
46465
  y: attrY,
46451
- width: tableWidth - frozenColsWidth - rightFrozenColsWidth,
46466
+ width: hScrollBarWidth,
46452
46467
  range: [0, rangeEnd],
46453
46468
  visible: horizontalVisible === 'always'
46454
46469
  });
@@ -46473,7 +46488,6 @@
46473
46488
  const x = Math.min(tableWidth, totalWidth);
46474
46489
  const rangeEnd = Math.max(0.05, (tableHeight - frozenRowsHeight) / (totalHeight - frozenRowsHeight));
46475
46490
  let attrX = 0;
46476
- const hoverOn = this.table.theme.scrollStyle.hoverOn;
46477
46491
  if (this.table.theme.scrollStyle.barToSide) {
46478
46492
  attrX =
46479
46493
  this.table.tableNoFrameWidth -
@@ -54789,6 +54803,22 @@
54789
54803
  this.isPivot = this.table.isPivotTable();
54790
54804
  initSceneGraph(this);
54791
54805
  }
54806
+ canvasShowMenu() {
54807
+ this.stage.addEventListener('rightdown', (e) => {
54808
+ const eventArgsSet = getCellEventArgsSet(e);
54809
+ if (!eventArgsSet.eventArgs) {
54810
+ this.table.stateManager.triggerContextMenu(-1, -1, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y);
54811
+ this.table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CANVAS, {
54812
+ event: e,
54813
+ x: eventArgsSet.abstractPos.x,
54814
+ y: eventArgsSet.abstractPos.y,
54815
+ col: -1,
54816
+ row: -1,
54817
+ target: undefined
54818
+ });
54819
+ }
54820
+ });
54821
+ }
54792
54822
  clearCells() {
54793
54823
  this.table.animationManager.clear();
54794
54824
  if (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) {
@@ -55635,6 +55665,9 @@
55635
55665
  if (this.table.options.animationAppear) {
55636
55666
  dealWithAnimationAppear(this.table);
55637
55667
  }
55668
+ if (this.table.options.menu?.contextMenuWorkOnlyCell === false) {
55669
+ this.canvasShowMenu();
55670
+ }
55638
55671
  this.updateNextFrame();
55639
55672
  }
55640
55673
  dealWidthMode() {
@@ -57485,6 +57518,7 @@
57485
57518
  }
57486
57519
  state.columnResize.x = xInTable;
57487
57520
  state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen);
57521
+ state.table._updateSize();
57488
57522
  if (state.columnResize.col < state.table.frozenColCount &&
57489
57523
  !state.table.isPivotTable() &&
57490
57524
  !state.table.transpose) {
@@ -58143,6 +58177,7 @@
58143
58177
  }
58144
58178
  state.rowResize.y = yInTable;
58145
58179
  state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen);
58180
+ state.table._updateSize();
58146
58181
  state.table.scenegraph.updateNextFrame();
58147
58182
  }
58148
58183
  function updateResizeColForRow(detaY, state) {
@@ -63337,6 +63372,9 @@
63337
63372
  const rect = table.getCellRangeRelativeRect({ col, row });
63338
63373
  const element = table.internalProps.menu.parentElement ?? table.getElement();
63339
63374
  const { top, bottom, left, right } = rect;
63375
+ if (col === -1 && row === -1) {
63376
+ return true;
63377
+ }
63340
63378
  if (table.isFrozenCell(col, row)) {
63341
63379
  return true;
63342
63380
  }
@@ -67226,7 +67264,7 @@
67226
67264
  return TABLE_EVENT_TYPE;
67227
67265
  }
67228
67266
  options;
67229
- version = "1.19.6";
67267
+ version = "1.19.7";
67230
67268
  pagination;
67231
67269
  id = `VTable${Date.now()}`;
67232
67270
  headerStyleCache;
@@ -67918,8 +67956,17 @@
67918
67956
  widthP = this.canvasWidth - 1;
67919
67957
  heightP = this.canvasHeight - 1;
67920
67958
  }
67921
- const width = Math.floor(widthP - getVerticalScrollBarSize(this.getTheme().scrollStyle));
67922
- const height = Math.floor(heightP - getHorizontalScrollBarSize(this.getTheme().scrollStyle));
67959
+ const scrollStyle = this.getTheme().scrollStyle;
67960
+ let vScrollBarWidth = 0;
67961
+ let hScrollBarWidth = 0;
67962
+ vScrollBarWidth = this.shouldVScrollBarWidthShow(widthP, heightP, scrollStyle)
67963
+ ? getVerticalScrollBarSize(scrollStyle)
67964
+ : 0;
67965
+ hScrollBarWidth = this.shouldHScrollBarWidthShow(widthP, heightP, scrollStyle)
67966
+ ? getHorizontalScrollBarSize(scrollStyle)
67967
+ : 0;
67968
+ const width = Math.floor(widthP - vScrollBarWidth);
67969
+ const height = Math.floor(heightP - hScrollBarWidth);
67923
67970
  if (this.internalProps.theme?.frameStyle) {
67924
67971
  const lineWidths = toBoxArray(this.internalProps.theme.frameStyle?.borderLineWidth ?? [null]);
67925
67972
  const shadowWidths = toBoxArray(this.internalProps.theme.frameStyle?.shadowBlur ?? [0]);
@@ -67932,15 +67979,67 @@
67932
67979
  else {
67933
67980
  this.tableX = (lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0);
67934
67981
  this.tableY = (lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0);
67982
+ const rightBorder = (lineWidths[1] ?? 0) + (shadowWidths[1] ?? 0);
67935
67983
  this.tableNoFrameWidth =
67936
- width - ((lineWidths[1] ?? 0) + (shadowWidths[1] ?? 0)) - ((lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0));
67984
+ width -
67985
+ (rightBorder > vScrollBarWidth ? rightBorder - vScrollBarWidth : 0) -
67986
+ ((lineWidths[3] ?? 0) + (shadowWidths[3] ?? 0));
67987
+ const bottomBorder = (lineWidths[2] ?? 0) + (shadowWidths[2] ?? 0);
67937
67988
  this.tableNoFrameHeight =
67938
- height - ((lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0)) - ((lineWidths[2] ?? 0) + (shadowWidths[2] ?? 0));
67989
+ height -
67990
+ (bottomBorder > hScrollBarWidth ? bottomBorder - hScrollBarWidth : 0) -
67991
+ ((lineWidths[0] ?? 0) + (shadowWidths[0] ?? 0));
67939
67992
  }
67940
67993
  }
67941
67994
  this._clearColRangeWidthsMap();
67942
67995
  this._clearRowRangeHeightsMap();
67943
67996
  }
67997
+ shouldVScrollBarWidthShow(tableWidth, tableHeight, scrollStyle) {
67998
+ if (scrollStyle.hoverOn || scrollStyle.visible === 'none') {
67999
+ return false;
68000
+ }
68001
+ const totalHeight = this.getAllRowsHeight();
68002
+ const sizeTolerance = scrollStyle.visible ? getHorizontalScrollBarSize(scrollStyle) : 0;
68003
+ const isHScrollBarDecideVScrollBar = totalHeight > tableHeight - sizeTolerance && totalHeight <= tableHeight;
68004
+ if (isHScrollBarDecideVScrollBar) {
68005
+ const totalWidth = this.getAllColsWidth();
68006
+ const sizeTolerance = scrollStyle.visible ? getVerticalScrollBarSize(scrollStyle) : 0;
68007
+ const isVScrollBarDecideHScrollBar = totalWidth > tableWidth - sizeTolerance && totalWidth <= tableWidth;
68008
+ if (isVScrollBarDecideHScrollBar) {
68009
+ return false;
68010
+ }
68011
+ if (totalWidth > tableWidth) {
68012
+ return true;
68013
+ }
68014
+ if (totalWidth <= tableWidth - sizeTolerance) {
68015
+ return false;
68016
+ }
68017
+ }
68018
+ return !(totalHeight <= tableHeight - sizeTolerance);
68019
+ }
68020
+ shouldHScrollBarWidthShow(tableWidth, tableHeight, scrollStyle) {
68021
+ if (scrollStyle.hoverOn || scrollStyle.visible === 'none') {
68022
+ return false;
68023
+ }
68024
+ const totalWidth = this.getAllColsWidth();
68025
+ const sizeTolerance = scrollStyle.visible ? getVerticalScrollBarSize(scrollStyle) : 0;
68026
+ const isVScrollBarDecideHScrollBar = totalWidth > tableWidth - sizeTolerance && totalWidth <= tableWidth;
68027
+ if (isVScrollBarDecideHScrollBar) {
68028
+ const totalHeight = this.getAllRowsHeight();
68029
+ const sizeTolerance = scrollStyle.visible ? getHorizontalScrollBarSize(scrollStyle) : 0;
68030
+ const isHScrollBarDecideVScrollBar = totalHeight > tableHeight - sizeTolerance && totalHeight <= tableHeight;
68031
+ if (isHScrollBarDecideVScrollBar) {
68032
+ return false;
68033
+ }
68034
+ if (totalHeight > tableHeight) {
68035
+ return true;
68036
+ }
68037
+ if (totalHeight <= tableHeight - sizeTolerance) {
68038
+ return false;
68039
+ }
68040
+ }
68041
+ return !(totalWidth <= tableWidth - sizeTolerance);
68042
+ }
67944
68043
  updateViewBox(newViewBox) {
67945
68044
  const oldWidth = (this.options?.viewBox?.x2 ?? 0) - (this.options?.viewBox?.x1 ?? 0);
67946
68045
  const oldHeight = (this.options?.viewBox?.y2 ?? 0) - (this.options?.viewBox?.y1 ?? 0);
@@ -73075,7 +73174,7 @@
73075
73174
  }
73076
73175
  const expand = !hd.hierarchyState || hd.hierarchyState === HierarchyState.expand;
73077
73176
  if (!!hd.columns && !!expand) {
73078
- const isAllHided = hd.columns.every((c) => c.hide);
73177
+ const isAllHided = hd.columns.every((c) => c.hide) || hd.hide;
73079
73178
  !isAllHided &&
73080
73179
  this._addHeaders(maxRow + 1, hd.columns, [...roots, id], hd.hideColumnsSubHeader || hideColumnsSubHeader, hd.levelSpan).forEach(c => results.push(c));
73081
73180
  }
@@ -74649,7 +74748,6 @@
74649
74748
  if (options.title) {
74650
74749
  const Title = Factory.getComponent('title');
74651
74750
  internalProps.title = new Title(options.title, this);
74652
- this.scenegraph.resize();
74653
74751
  }
74654
74752
  if (this.options.emptyTip) {
74655
74753
  if (this.internalProps.emptyTip) {
@@ -74666,6 +74764,7 @@
74666
74764
  this.listTreeStickCellPlugin = new ListTreeStickCellPlugin(this);
74667
74765
  }
74668
74766
  setTimeout(() => {
74767
+ this.resize();
74669
74768
  this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
74670
74769
  }, 0);
74671
74770
  }
@@ -74724,6 +74823,7 @@
74724
74823
  this.headerStyleCache = new Map();
74725
74824
  this.bodyStyleCache = new Map();
74726
74825
  this.bodyBottomStyleCache = new Map();
74826
+ this._updateSize();
74727
74827
  this.scenegraph.createSceneGraph();
74728
74828
  this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
74729
74829
  this.renderAsync();
@@ -75055,6 +75155,9 @@
75055
75155
  table.colCount = layoutMap.colCount ?? 0;
75056
75156
  table.rowCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount;
75057
75157
  this.internalProps.frozenColCount = this.options.frozenColCount ?? 0;
75158
+ if (this.options.frozenColCount >= this.colCount) {
75159
+ this.internalProps.frozenColCount = 0;
75160
+ }
75058
75161
  table.frozenRowCount = Math.max(layoutMap.headerLevelCount, this.options.frozenRowCount ?? 0);
75059
75162
  if (table.bottomFrozenRowCount !== (this.options.bottomFrozenRowCount ?? 0)) {
75060
75163
  table.bottomFrozenRowCount = this.options.bottomFrozenRowCount ?? 0;
@@ -75385,6 +75488,7 @@
75385
75488
  this.refreshRowColCount();
75386
75489
  this.stateManager.initCheckedState(this.records);
75387
75490
  this.scenegraph.createSceneGraph();
75491
+ this.resize();
75388
75492
  }
75389
75493
  getCheckboxState(field) {
75390
75494
  if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount) {
@@ -75499,11 +75603,11 @@
75499
75603
  this.clearCellStyleCache();
75500
75604
  this.scenegraph.createSceneGraph();
75501
75605
  this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row);
75606
+ this._updateSize();
75502
75607
  if (this.internalProps.title && !this.internalProps.title.isReleased) {
75503
- this._updateSize();
75504
75608
  this.internalProps.title.resize();
75505
- this.scenegraph.resize();
75506
75609
  }
75610
+ this.scenegraph.resize();
75507
75611
  if (this.options.emptyTip) {
75508
75612
  if (this.internalProps.emptyTip) {
75509
75613
  this.internalProps.emptyTip?.resetVisible();
@@ -77802,10 +77906,11 @@
77802
77906
  if (!this.legendComponent || this.visible === false) {
77803
77907
  return;
77804
77908
  }
77805
- this.legendComponent.setAttributes({
77806
- maxWidth: this.table.tableNoFrameWidth,
77807
- maxHeight: this.table.tableNoFrameHeight
77909
+ const attrs = this.getLegendAttributes({
77910
+ width: this.table.tableNoFrameWidth,
77911
+ height: this.table.tableNoFrameHeight
77808
77912
  });
77913
+ this.legendComponent.setAttributes(attrs);
77809
77914
  this.adjustTableSize(this.legendComponent.attribute);
77810
77915
  }
77811
77916
  adjustTableSize(attrs) {
@@ -78495,6 +78600,19 @@
78495
78600
  }
78496
78601
  };
78497
78602
  function getMenuInstanceInfo(table, col, row, type, dropDownMenuOptions) {
78603
+ if (col === -1 && row === -1 && type === 'context-menu') {
78604
+ if (dropDownMenuOptions?.content) {
78605
+ return {
78606
+ type,
78607
+ position: dropDownMenuOptions.position,
78608
+ referencePosition: dropDownMenuOptions.referencePosition ?? {
78609
+ rect: { left: 0, right: 0, top: 0, bottom: 0, width: 0, height: 0 }
78610
+ },
78611
+ content: dropDownMenuOptions.content
78612
+ };
78613
+ }
78614
+ return null;
78615
+ }
78498
78616
  const { lineHeight, textBaseline, textStick } = table._getCellStyle(col, row);
78499
78617
  let rect = table.getCellRangeRelativeRect(table.getCellRange(col, row));
78500
78618
  if (textStick) {
@@ -78577,7 +78695,9 @@
78577
78695
  const { instance, info: menuInstanceInfo } = instanceInfo;
78578
78696
  const attach = instance && instance.bindMenuElement(col, row, menuInstanceInfo);
78579
78697
  if (attach) {
78580
- const range = this._table.getCellRange(col, row);
78698
+ const range = col === -1 && row === -1
78699
+ ? { start: { col: -1, row: -1 }, end: { col: -1, row: -1 } }
78700
+ : this._table.getCellRange(col, row);
78581
78701
  this._attachInfo = { range, instance };
78582
78702
  }
78583
78703
  }
@@ -78638,6 +78758,22 @@
78638
78758
  });
78639
78759
  }
78640
78760
  });
78761
+ table.on(TABLE_EVENT_TYPE.CONTEXTMENU_CANVAS, e => {
78762
+ if (table.internalProps.menu?.renderMode === 'html') {
78763
+ const abstractPos = table._getMouseAbstractPoint(e.event);
78764
+ let menu = null;
78765
+ if (abstractPos.inTable && typeof table.internalProps.menu?.contextMenuItems === 'function') {
78766
+ menu = table.internalProps.menu.contextMenuItems(table.getHeaderField(e.col, e.row), e.row, e.col, table);
78767
+ }
78768
+ else if (abstractPos.inTable && Array.isArray(table.internalProps.menu?.contextMenuItems)) {
78769
+ menu = table.internalProps.menu?.contextMenuItems;
78770
+ }
78771
+ this._bindToCell(-1, -1, 'context-menu', {
78772
+ content: menu,
78773
+ position: { x: abstractPos.x, y: abstractPos.y }
78774
+ });
78775
+ }
78776
+ });
78641
78777
  }
78642
78778
  _getMenuInstanceInfo(col, row, type, dropDownMenuOptions) {
78643
78779
  const table = this._table;
@@ -87789,7 +87925,6 @@
87789
87925
  if (options.title) {
87790
87926
  const Title = Factory.getComponent('title');
87791
87927
  this.internalProps.title = new Title(options.title, this);
87792
- this.scenegraph.resize();
87793
87928
  }
87794
87929
  if (this.options.emptyTip) {
87795
87930
  if (this.internalProps.emptyTip) {
@@ -87802,6 +87937,7 @@
87802
87937
  }
87803
87938
  }
87804
87939
  setTimeout(() => {
87940
+ this.resize();
87805
87941
  this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
87806
87942
  }, 0);
87807
87943
  }
@@ -89479,7 +89615,6 @@
89479
89615
  if (options.title) {
89480
89616
  const Title = Factory.getComponent('title');
89481
89617
  this.internalProps.title = new Title(options.title, this);
89482
- this.scenegraph.resize();
89483
89618
  }
89484
89619
  if (this.options.emptyTip) {
89485
89620
  if (this.internalProps.emptyTip) {
@@ -89492,6 +89627,7 @@
89492
89627
  }
89493
89628
  }
89494
89629
  setTimeout(() => {
89630
+ this.resize();
89495
89631
  this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
89496
89632
  }, 0);
89497
89633
  }
@@ -91050,7 +91186,7 @@
91050
91186
  }
91051
91187
 
91052
91188
  registerForVrender();
91053
- const version = "1.19.6";
91189
+ const version = "1.19.7";
91054
91190
  function getIcons() {
91055
91191
  return get$2();
91056
91192
  }