@visactor/vtable-calendar 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.
@@ -33380,6 +33380,7 @@
33380
33380
  MOUSEENTER_CELL: "mouseenter_cell",
33381
33381
  MOUSELEAVE_CELL: "mouseleave_cell",
33382
33382
  CONTEXTMENU_CELL: "contextmenu_cell",
33383
+ CONTEXTMENU_CANVAS: "contextmenu_canvas",
33383
33384
  RESIZE_COLUMN: "resize_column",
33384
33385
  RESIZE_COLUMN_END: "resize_column_end",
33385
33386
  RESIZE_ROW: "resize_row",
@@ -34692,6 +34693,10 @@
34692
34693
  get verticalPadding() {
34693
34694
  var _a;
34694
34695
  return null !== (_a = scroll.verticalPadding) && void 0 !== _a ? _a : 0;
34696
+ },
34697
+ get ignoreFrozenCols() {
34698
+ var _a;
34699
+ return null !== (_a = scroll.ignoreFrozenCols) && void 0 !== _a && _a;
34695
34700
  }
34696
34701
  };
34697
34702
  }
@@ -37384,7 +37389,7 @@
37384
37389
  for (let i = 0; i < oldSource.length; i++) {
37385
37390
  const oldRecord = oldSource[i],
37386
37391
  newRecord = newSource[newGroupMap.get(oldRecord.vtableMergeName)];
37387
- isValid$3(newRecord) && (newRecord.hierarchyState = oldSource[i].hierarchyState), isArray$7(oldRecord.children) && isArray$7(newRecord.children) && 0 !== oldRecord.map.size && 0 !== newRecord.map.size && syncGroupCollapseState(oldRecord.children, newRecord.children, oldRecord.map, newRecord.map);
37392
+ isValid$3(newRecord) && (newRecord.hierarchyState = oldSource[i].hierarchyState), isArray$7(null == oldRecord ? void 0 : oldRecord.children) && isArray$7(null == newRecord ? void 0 : newRecord.children) && 0 !== oldRecord.map.size && 0 !== newRecord.map.size && syncGroupCollapseState(oldRecord.children, newRecord.children, oldRecord.map, newRecord.map);
37388
37393
  }
37389
37394
  }
37390
37395
 
@@ -41640,7 +41645,7 @@
41640
41645
  }), this.vScrollBar.render(), this.vScrollBar.hideAll();
41641
41646
  }
41642
41647
  updateScrollBar() {
41643
- var _a, _b, _c, _d, _e, _f, _g;
41648
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
41644
41649
  const oldHorizontalBarPos = this.table.stateManager.scroll.horizontalBarPos,
41645
41650
  oldVerticalBarPos = this.table.stateManager.scroll.verticalBarPos,
41646
41651
  theme = this.table.theme,
@@ -41648,24 +41653,27 @@
41648
41653
  visible1 = null === (_b = theme.scrollStyle) || void 0 === _b ? void 0 : _b.visible,
41649
41654
  horizontalVisible = null !== (_d = null === (_c = theme.scrollStyle) || void 0 === _c ? void 0 : _c.horizontalVisible) && void 0 !== _d ? _d : visible1,
41650
41655
  verticalVisible = null !== (_f = null === (_e = theme.scrollStyle) || void 0 === _e ? void 0 : _e.verticalVisible) && void 0 !== _f ? _f : visible1,
41651
- tableWidth = Math.ceil(this.table.scenegraph.tableGroup.attribute.width),
41652
- tableHeight = Math.ceil(this.table.scenegraph.tableGroup.attribute.height),
41656
+ tableWidth = Math.ceil(this.table.tableNoFrameWidth),
41657
+ tableHeight = Math.ceil(this.table.tableNoFrameHeight),
41653
41658
  totalHeight = this.table.getAllRowsHeight(),
41654
41659
  totalWidth = this.table.getAllColsWidth(),
41655
41660
  frozenRowsHeight = this.table.getFrozenRowsHeight(),
41656
41661
  frozenColsWidth = this.table.getFrozenColsWidth(),
41657
41662
  bottomFrozenRowsHeight = this.table.getBottomFrozenRowsHeight(),
41658
41663
  rightFrozenColsWidth = this.table.getRightFrozenColsWidth(),
41664
+ hoverOn = this.table.theme.scrollStyle.hoverOn,
41659
41665
  sizeTolerance = (null === (_g = this.table.options.customConfig) || void 0 === _g ? void 0 : _g._disableColumnAndRowSizeRound) ? 1 : 0;
41660
41666
  if (totalWidth > tableWidth + sizeTolerance) {
41661
41667
  const y = Math.min(tableHeight, totalHeight),
41662
- rangeEnd = Math.max(.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth)),
41663
- hoverOn = this.table.theme.scrollStyle.hoverOn;
41668
+ rangeEnd = Math.max(.05, (tableWidth - frozenColsWidth) / (totalWidth - frozenColsWidth));
41664
41669
  let attrY = 0;
41665
- attrY = this.table.theme.scrollStyle.barToSide ? this.table.tableNoFrameHeight - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) + this.table.tableY : y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y), this.hScrollBar.setAttributes({
41666
- x: frozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x),
41670
+ attrY = this.table.theme.scrollStyle.barToSide ? this.table.tableNoFrameHeight - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y) + this.table.tableY : y - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.y);
41671
+ let hScrollBarx = frozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x),
41672
+ hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
41673
+ null !== (_j = null === (_h = this.table.theme.scrollStyle) || void 0 === _h ? void 0 : _h.ignoreFrozenCols) && void 0 !== _j && _j ? (hScrollBarx = hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x, hScrollBarWidth = tableWidth) : (hScrollBarx = frozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x), hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth), this.hScrollBar.setAttributes({
41674
+ x: hScrollBarx,
41667
41675
  y: attrY,
41668
- width: tableWidth - frozenColsWidth - rightFrozenColsWidth,
41676
+ width: hScrollBarWidth,
41669
41677
  range: [0, rangeEnd],
41670
41678
  visible: "always" === horizontalVisible
41671
41679
  });
@@ -41684,7 +41692,6 @@
41684
41692
  const x = Math.min(tableWidth, totalWidth),
41685
41693
  rangeEnd = Math.max(.05, (tableHeight - frozenRowsHeight) / (totalHeight - frozenRowsHeight));
41686
41694
  let attrX = 0;
41687
- const hoverOn = this.table.theme.scrollStyle.hoverOn;
41688
41695
  attrX = this.table.theme.scrollStyle.barToSide ? this.table.tableNoFrameWidth - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x) + this.table.tableX : x - (hoverOn ? width : -this.table.scenegraph.tableGroup.attribute.x), this.vScrollBar.setAttributes({
41689
41696
  x: attrX,
41690
41697
  y: frozenRowsHeight + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.y),
@@ -46591,6 +46598,19 @@
46591
46598
  initSceneGraph() {
46592
46599
  this.isPivot = this.table.isPivotTable(), initSceneGraph(this);
46593
46600
  }
46601
+ canvasShowMenu() {
46602
+ this.stage.addEventListener("rightdown", e => {
46603
+ const eventArgsSet = getCellEventArgsSet(e);
46604
+ eventArgsSet.eventArgs || (this.table.stateManager.triggerContextMenu(-1, -1, eventArgsSet.abstractPos.x, eventArgsSet.abstractPos.y), this.table.fireListeners(TABLE_EVENT_TYPE.CONTEXTMENU_CANVAS, {
46605
+ event: e,
46606
+ x: eventArgsSet.abstractPos.x,
46607
+ y: eventArgsSet.abstractPos.y,
46608
+ col: -1,
46609
+ row: -1,
46610
+ target: void 0
46611
+ }));
46612
+ });
46613
+ }
46594
46614
  clearCells() {
46595
46615
  var _a, _b;
46596
46616
  this.table.animationManager.clear(), (this.table.isPivotChart() || this.table._hasCustomRenderOrLayout()) && this.stage.pluginService.findPluginsByName("poptipForText").forEach(plugin => {
@@ -46984,7 +47004,8 @@
46984
47004
  0 === x && firstBodyCol && firstBodyCol.col === this.table.frozenColCount && firstBodyCol.attribute.x + x < 0 ? x = -firstBodyCol.attribute.x : lastBodyCol && this.table.tableNoFrameWidth < this.table.getAllColsWidth() && lastBodyCol.col === this.table.colCount - this.table.rightFrozenColCount - 1 && lastBodyCol.attribute.x + lastBodyCol.attribute.width + x < this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() && (x = this.table.tableNoFrameWidth - this.table.getFrozenColsWidth() - this.table.getRightFrozenColsWidth() - lastBodyCol.attribute.x - lastBodyCol.attribute.width), this.table.getFrozenColsWidth() + x !== this.bodyGroup.attribute.x && (this.bodyGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.colHeaderGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.table.bottomFrozenRowCount > 0 && this.bottomFrozenGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.updateNextFrame());
46985
47005
  }
46986
47006
  afterScenegraphCreated() {
46987
- this.isPivot || this.table.transpose ? this.table.options.frozenColCount ? this.component.setFrozenColumnShadow(this.table.frozenColCount - 1) : this.table.options.rightFrozenColCount ? this.component.setRightFrozenColumnShadow(this.table.colCount - this.table.rightFrozenColCount) : this.component.setFrozenColumnShadow(-1) : (this.component.setFrozenColumnShadow(this.table.frozenColCount - 1), this.component.setRightFrozenColumnShadow(this.table.colCount - this.table.rightFrozenColCount)), this.table.stateManager.checkFrozen(), this.updateContainer(), this.createFrameBorder(), this.updateBorderSizeAndPosition(), this.component.updateScrollBar(), handleTextStick(this.table), this.table.options.animationAppear && dealWithAnimationAppear(this.table), this.updateNextFrame();
47007
+ var _a;
47008
+ this.isPivot || this.table.transpose ? this.table.options.frozenColCount ? this.component.setFrozenColumnShadow(this.table.frozenColCount - 1) : this.table.options.rightFrozenColCount ? this.component.setRightFrozenColumnShadow(this.table.colCount - this.table.rightFrozenColCount) : this.component.setFrozenColumnShadow(-1) : (this.component.setFrozenColumnShadow(this.table.frozenColCount - 1), this.component.setRightFrozenColumnShadow(this.table.colCount - this.table.rightFrozenColCount)), this.table.stateManager.checkFrozen(), this.updateContainer(), this.createFrameBorder(), this.updateBorderSizeAndPosition(), this.component.updateScrollBar(), handleTextStick(this.table), this.table.options.animationAppear && dealWithAnimationAppear(this.table), !1 === (null === (_a = this.table.options.menu) || void 0 === _a ? void 0 : _a.contextMenuWorkOnlyCell) && this.canvasShowMenu(), this.updateNextFrame();
46988
47009
  }
46989
47010
  dealWidthMode() {
46990
47011
  const table = this.table;
@@ -48122,7 +48143,7 @@
48122
48143
  }
48123
48144
  rightColWidth - detaX < state.table.internalProps.limitMinWidth && (detaX = rightColWidth - state.table.internalProps.limitMinWidth);
48124
48145
  }
48125
- detaX = Math.ceil(detaX), state.columnResize.col < state.table.rowHeaderLevelCount || state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount ? updateResizeColForColumn(detaX, state) : "indicator" === state.table.internalProps.columnResizeType ? updateResizeColForIndicator$1(detaX, state) : "indicatorGroup" === state.table.internalProps.columnResizeType ? updateResizeColForIndicatorGroup$1(detaX, state) : "all" === state.table.internalProps.columnResizeType ? updateResizeColForAll$1(detaX, state) : updateResizeColForColumn(detaX, state), state.columnResize.x = xInTable, state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen) : state.table.options.frozenColCount && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1), (state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount && !state.table.isPivotTable() && !state.table.transpose || state.table.options.rightFrozenColCount) && state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount), state.table.scenegraph.updateNextFrame();
48146
+ detaX = Math.ceil(detaX), state.columnResize.col < state.table.rowHeaderLevelCount || state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount ? updateResizeColForColumn(detaX, state) : "indicator" === state.table.internalProps.columnResizeType ? updateResizeColForIndicator$1(detaX, state) : "indicatorGroup" === state.table.internalProps.columnResizeType ? updateResizeColForIndicatorGroup$1(detaX, state) : "all" === state.table.internalProps.columnResizeType ? updateResizeColForAll$1(detaX, state) : updateResizeColForColumn(detaX, state), state.columnResize.x = xInTable, state.table.scenegraph.component.updateResizeCol(state.columnResize.col, yInTable, state.columnResize.isRightFrozen), state.table._updateSize(), state.columnResize.col < state.table.frozenColCount && !state.table.isPivotTable() && !state.table.transpose ? state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1, state.columnResize.isRightFrozen) : state.table.options.frozenColCount && state.table.scenegraph.component.setFrozenColumnShadow(state.table.frozenColCount - 1), (state.columnResize.col >= state.table.colCount - state.table.rightFrozenColCount && !state.table.isPivotTable() && !state.table.transpose || state.table.options.rightFrozenColCount) && state.table.scenegraph.component.setRightFrozenColumnShadow(state.table.colCount - state.table.rightFrozenColCount), state.table.scenegraph.updateNextFrame();
48126
48147
  }
48127
48148
  function updateResizeColForColumn(detaX, state) {
48128
48149
  "adaptive" === state.table.widthMode && state.columnResize.col < state.table.colCount - 1 ? (state.table.scenegraph.updateColWidth(state.columnResize.col, detaX), state.table.scenegraph.updateColWidth(state.columnResize.col + 1, -detaX), state.table.internalProps._widthResizedColMap.add(state.columnResize.col), state.table.internalProps._widthResizedColMap.add(state.columnResize.col + 1)) : (state.table.scenegraph.updateColWidth(state.columnResize.col, detaX), state.table.internalProps._widthResizedColMap.add(state.columnResize.col));
@@ -48445,7 +48466,7 @@
48445
48466
  let bottomRowHeight = state.table.getRowHeight(state.rowResize.row + 1);
48446
48467
  bottomRowHeight -= detaY, bottomRowHeight - detaY < state.table.internalProps.limitMinHeight && (detaY = bottomRowHeight - state.table.internalProps.limitMinHeight);
48447
48468
  }
48448
- detaY = Math.ceil(detaY), state.rowResize.row < state.table.columnHeaderLevelCount || state.rowResize.row >= state.table.rowCount - state.table.bottomFrozenRowCount ? updateResizeColForRow(detaY, state) : "indicator" === state.table.internalProps.rowResizeType ? updateResizeColForIndicator(detaY, state) : "indicatorGroup" === state.table.internalProps.rowResizeType ? updateResizeColForIndicatorGroup(detaY, state) : "all" === state.table.internalProps.rowResizeType ? updateResizeColForAll(detaY, state) : updateResizeColForRow(detaY, state), state.rowResize.y = yInTable, state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen), state.table.scenegraph.updateNextFrame();
48469
+ detaY = Math.ceil(detaY), state.rowResize.row < state.table.columnHeaderLevelCount || state.rowResize.row >= state.table.rowCount - state.table.bottomFrozenRowCount ? updateResizeColForRow(detaY, state) : "indicator" === state.table.internalProps.rowResizeType ? updateResizeColForIndicator(detaY, state) : "indicatorGroup" === state.table.internalProps.rowResizeType ? updateResizeColForIndicatorGroup(detaY, state) : "all" === state.table.internalProps.rowResizeType ? updateResizeColForAll(detaY, state) : updateResizeColForRow(detaY, state), state.rowResize.y = yInTable, state.table.scenegraph.component.updateResizeRow(state.rowResize.row, xInTable, state.rowResize.isBottomFrozen), state.table._updateSize(), state.table.scenegraph.updateNextFrame();
48449
48470
  }
48450
48471
  function updateResizeColForRow(detaY, state) {
48451
48472
  "adaptive" === state.table.heightMode && state.rowResize.row < state.table.rowCount - 1 ? (state.table.scenegraph.updateRowHeight(state.rowResize.row, detaY), state.table.scenegraph.updateRowHeight(state.rowResize.row + 1, -detaY), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row + 1)) : (state.table.scenegraph.updateRowHeight(state.rowResize.row, detaY), state.table.internalProps._heightResizedRowMap.add(state.rowResize.row));
@@ -51573,6 +51594,7 @@
51573
51594
  left: left,
51574
51595
  right: right
51575
51596
  } = rect;
51597
+ if (-1 === col && -1 === row) return !0;
51576
51598
  if (table.isFrozenCell(col, row)) return !0;
51577
51599
  if (bottom < table.getFrozenRowsHeight() || right < table.getFrozenColsWidth() || left > table.tableNoFrameWidth - table.getRightFrozenColsWidth() || top > table.tableNoFrameHeight - table.getBottomFrozenRowsHeight()) return !1;
51578
51600
  const {
@@ -53768,7 +53790,7 @@
53768
53790
  }
53769
53791
  constructor(container, options = {}) {
53770
53792
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
53771
- if (super(), this.showFrozenIcon = !0, this.version = "1.19.6", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
53793
+ if (super(), this.showFrozenIcon = !0, this.version = "1.19.7", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
53772
53794
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
53773
53795
  options: options,
53774
53796
  container: container
@@ -54171,15 +54193,51 @@
54171
54193
  } = this.internalProps;
54172
54194
  widthP = (null !== (_c = null === (_b = canvas.parentElement) || void 0 === _b ? void 0 : _b.offsetWidth) && void 0 !== _c ? _c : 1) - (this.options.tableSizeAntiJitter ? 1 : 0), heightP = (null !== (_e = null === (_d = canvas.parentElement) || void 0 === _d ? void 0 : _d.offsetHeight) && void 0 !== _e ? _e : 1) - (this.options.tableSizeAntiJitter ? 1 : 0), (null === (_f = null == this ? void 0 : this.scenegraph) || void 0 === _f ? void 0 : _f.stage) ? (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox) && !(null === (_h = this.options) || void 0 === _h ? void 0 : _h.canvas) && this.scenegraph.stage.resize(widthP, heightP) : (canvas.style.width = "", canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`, canvas.style.height = `${heightP}px`), (null === (_j = this.options) || void 0 === _j ? void 0 : _j.viewBox) && (widthP = this.options.viewBox.x2 - this.options.viewBox.x1, heightP = this.options.viewBox.y2 - this.options.viewBox.y1), (null === (_k = null == this ? void 0 : this.scenegraph) || void 0 === _k ? void 0 : _k.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP));
54173
54195
  } else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
54174
- const width = Math.floor(widthP - getVerticalScrollBarSize(this.getTheme().scrollStyle)),
54175
- height = Math.floor(heightP - getHorizontalScrollBarSize(this.getTheme().scrollStyle));
54196
+ const scrollStyle = this.getTheme().scrollStyle;
54197
+ let vScrollBarWidth = 0,
54198
+ hScrollBarWidth = 0;
54199
+ vScrollBarWidth = this.shouldVScrollBarWidthShow(widthP, heightP, scrollStyle) ? getVerticalScrollBarSize(scrollStyle) : 0, hScrollBarWidth = this.shouldHScrollBarWidthShow(widthP, heightP, scrollStyle) ? getHorizontalScrollBarSize(scrollStyle) : 0;
54200
+ const width = Math.floor(widthP - vScrollBarWidth),
54201
+ height = Math.floor(heightP - hScrollBarWidth);
54176
54202
  if (null === (_l = this.internalProps.theme) || void 0 === _l ? void 0 : _l.frameStyle) {
54177
54203
  const lineWidths = toBoxArray(null !== (_o = null === (_m = this.internalProps.theme.frameStyle) || void 0 === _m ? void 0 : _m.borderLineWidth) && void 0 !== _o ? _o : [null]),
54178
54204
  shadowWidths = toBoxArray(null !== (_q = null === (_p = this.internalProps.theme.frameStyle) || void 0 === _p ? void 0 : _p.shadowBlur) && void 0 !== _q ? _q : [0]);
54179
- (null === (_r = this.theme.frameStyle) || void 0 === _r ? void 0 : _r.innerBorder) ? (this.tableX = 0, this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_s = shadowWidths[1]) && void 0 !== _s ? _s : 0), this.tableNoFrameHeight = height - (null !== (_t = shadowWidths[2]) && void 0 !== _t ? _t : 0)) : (this.tableX = (null !== (_u = lineWidths[3]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[3]) && void 0 !== _v ? _v : 0), this.tableY = (null !== (_w = lineWidths[0]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[0]) && void 0 !== _x ? _x : 0), this.tableNoFrameWidth = width - ((null !== (_y = lineWidths[1]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[1]) && void 0 !== _z ? _z : 0)) - ((null !== (_0 = lineWidths[3]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[3]) && void 0 !== _1 ? _1 : 0)), this.tableNoFrameHeight = height - ((null !== (_2 = lineWidths[0]) && void 0 !== _2 ? _2 : 0) + (null !== (_3 = shadowWidths[0]) && void 0 !== _3 ? _3 : 0)) - ((null !== (_4 = lineWidths[2]) && void 0 !== _4 ? _4 : 0) + (null !== (_5 = shadowWidths[2]) && void 0 !== _5 ? _5 : 0)));
54205
+ if (null === (_r = this.theme.frameStyle) || void 0 === _r ? void 0 : _r.innerBorder) this.tableX = 0, this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_s = shadowWidths[1]) && void 0 !== _s ? _s : 0), this.tableNoFrameHeight = height - (null !== (_t = shadowWidths[2]) && void 0 !== _t ? _t : 0);else {
54206
+ this.tableX = (null !== (_u = lineWidths[3]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[3]) && void 0 !== _v ? _v : 0), this.tableY = (null !== (_w = lineWidths[0]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[0]) && void 0 !== _x ? _x : 0);
54207
+ const rightBorder = (null !== (_y = lineWidths[1]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[1]) && void 0 !== _z ? _z : 0);
54208
+ this.tableNoFrameWidth = width - (rightBorder > vScrollBarWidth ? rightBorder - vScrollBarWidth : 0) - ((null !== (_0 = lineWidths[3]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[3]) && void 0 !== _1 ? _1 : 0));
54209
+ const bottomBorder = (null !== (_2 = lineWidths[2]) && void 0 !== _2 ? _2 : 0) + (null !== (_3 = shadowWidths[2]) && void 0 !== _3 ? _3 : 0);
54210
+ this.tableNoFrameHeight = height - (bottomBorder > hScrollBarWidth ? bottomBorder - hScrollBarWidth : 0) - ((null !== (_4 = lineWidths[0]) && void 0 !== _4 ? _4 : 0) + (null !== (_5 = shadowWidths[0]) && void 0 !== _5 ? _5 : 0));
54211
+ }
54180
54212
  }
54181
54213
  this._clearColRangeWidthsMap(), this._clearRowRangeHeightsMap();
54182
54214
  }
54215
+ shouldVScrollBarWidthShow(tableWidth, tableHeight, scrollStyle) {
54216
+ if (scrollStyle.hoverOn || "none" === scrollStyle.visible) return !1;
54217
+ const totalHeight = this.getAllRowsHeight(),
54218
+ sizeTolerance = scrollStyle.visible ? getHorizontalScrollBarSize(scrollStyle) : 0;
54219
+ if (totalHeight > tableHeight - sizeTolerance && totalHeight <= tableHeight) {
54220
+ const totalWidth = this.getAllColsWidth(),
54221
+ sizeTolerance = scrollStyle.visible ? getVerticalScrollBarSize(scrollStyle) : 0;
54222
+ if (totalWidth > tableWidth - sizeTolerance && totalWidth <= tableWidth) return !1;
54223
+ if (totalWidth > tableWidth) return !0;
54224
+ if (totalWidth <= tableWidth - sizeTolerance) return !1;
54225
+ }
54226
+ return !(totalHeight <= tableHeight - sizeTolerance);
54227
+ }
54228
+ shouldHScrollBarWidthShow(tableWidth, tableHeight, scrollStyle) {
54229
+ if (scrollStyle.hoverOn || "none" === scrollStyle.visible) return !1;
54230
+ const totalWidth = this.getAllColsWidth(),
54231
+ sizeTolerance = scrollStyle.visible ? getVerticalScrollBarSize(scrollStyle) : 0;
54232
+ if (totalWidth > tableWidth - sizeTolerance && totalWidth <= tableWidth) {
54233
+ const totalHeight = this.getAllRowsHeight(),
54234
+ sizeTolerance = scrollStyle.visible ? getHorizontalScrollBarSize(scrollStyle) : 0;
54235
+ if (totalHeight > tableHeight - sizeTolerance && totalHeight <= tableHeight) return !1;
54236
+ if (totalHeight > tableHeight) return !0;
54237
+ if (totalHeight <= tableHeight - sizeTolerance) return !1;
54238
+ }
54239
+ return !(totalWidth <= tableWidth - sizeTolerance);
54240
+ }
54183
54241
  updateViewBox(newViewBox) {
54184
54242
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
54185
54243
  const oldWidth = (null !== (_c = null === (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox) || void 0 === _b ? void 0 : _b.x2) && void 0 !== _c ? _c : 0) - (null !== (_f = null === (_e = null === (_d = this.options) || void 0 === _d ? void 0 : _d.viewBox) || void 0 === _e ? void 0 : _e.x1) && void 0 !== _f ? _f : 0),
@@ -57693,7 +57751,7 @@
57693
57751
  hideColumnsSubHeader ? this._headerCellIds[row - 1] && void 0 !== this._headerCellIds[row - 1][col] && (rowCells[col] = this._headerCellIds[row - 1][col]) : rowCells[col] = id;
57694
57752
  const expand = !hd.hierarchyState || hd.hierarchyState === HierarchyState.expand;
57695
57753
  if (hd.columns && expand) {
57696
- !hd.columns.every(c => c.hide) && this._addHeaders(maxRow + 1, hd.columns, [...roots, id], hd.hideColumnsSubHeader || hideColumnsSubHeader, hd.levelSpan).forEach(c => results.push(c));
57754
+ !(hd.columns.every(c => c.hide) || hd.hide) && this._addHeaders(maxRow + 1, hd.columns, [...roots, id], hd.hideColumnsSubHeader || hideColumnsSubHeader, hd.levelSpan).forEach(c => results.push(c));
57697
57755
  } else {
57698
57756
  const colDef = {
57699
57757
  id: this.seqId++,
@@ -58723,7 +58781,7 @@
58723
58781
  sortState: internalProps.sortState
58724
58782
  }) : this.setRecords([]), options.title) {
58725
58783
  const Title = Factory.getComponent("title");
58726
- internalProps.title = new Title(options.title, this), this.scenegraph.resize();
58784
+ internalProps.title = new Title(options.title, this);
58727
58785
  }
58728
58786
  if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_g = this.internalProps.emptyTip) || void 0 === _g || _g.resetVisible();else {
58729
58787
  const EmptyTip = Factory.getComponent("emptyTip");
@@ -58734,7 +58792,7 @@
58734
58792
  this.listTreeStickCellPlugin = new ListTreeStickCellPlugin(this);
58735
58793
  }
58736
58794
  setTimeout(() => {
58737
- this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
58795
+ this.resize(), this.fireListeners(TABLE_EVENT_TYPE.INITIALIZED, null);
58738
58796
  }, 0);
58739
58797
  }
58740
58798
  isListTable() {
@@ -58772,7 +58830,7 @@
58772
58830
  col: this.stateManager.hover.cellPos.col,
58773
58831
  row: this.stateManager.hover.cellPos.row
58774
58832
  };
58775
- this._hasAutoImageColumn = void 0, this.refreshHeader(), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_b = null === (_a = this.dataSource.dataSourceObj) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
58833
+ this._hasAutoImageColumn = void 0, this.refreshHeader(), this.records && checkHasAggregationOnColumnDefine(this.internalProps.columns) && this.dataSource.processRecords(null !== (_b = null === (_a = this.dataSource.dataSourceObj) || void 0 === _a ? void 0 : _a.records) && void 0 !== _b ? _b : this.dataSource.dataSourceObj), this.internalProps.useOneRowHeightFillAll = !1, this.headerStyleCache = new Map(), this.bodyStyleCache = new Map(), this.bodyBottomStyleCache = new Map(), this._updateSize(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.renderAsync(), this.eventManager.updateEventBinder();
58776
58834
  }
58777
58835
  addColumn(column) {
58778
58836
  const columns = this.options.columns;
@@ -58986,7 +59044,7 @@
58986
59044
  } = table.internalProps;
58987
59045
  if (!layoutMap) return;
58988
59046
  const dataCount = null !== (_b = null === (_a = table.internalProps.dataSource) || void 0 === _a ? void 0 : _a.length) && void 0 !== _b ? _b : 0;
58989
- layoutMap.recordsCount = dataCount + (dataCount > 0 || this.options.showAggregationWhenEmpty ? layoutMap.hasAggregationOnTopCount + layoutMap.hasAggregationOnBottomCount : 0), table.transpose ? (table.rowCount = null !== (_c = layoutMap.rowCount) && void 0 !== _c ? _c : 0, table.colCount = null !== (_d = layoutMap.colCount) && void 0 !== _d ? _d : 0, this.internalProps.frozenColCount = Math.max((null !== (_e = layoutMap.headerLevelCount) && void 0 !== _e ? _e : 0) + layoutMap.leftRowSeriesNumberColumnCount, null !== (_f = this.options.frozenColCount) && void 0 !== _f ? _f : 0), this.internalProps.frozenRowCount = null !== (_g = this.options.frozenRowCount) && void 0 !== _g ? _g : 0, table.bottomFrozenRowCount !== (null !== (_h = this.options.bottomFrozenRowCount) && void 0 !== _h ? _h : 0) && (table.bottomFrozenRowCount = null !== (_j = this.options.bottomFrozenRowCount) && void 0 !== _j ? _j : 0), table.rightFrozenColCount !== (null !== (_k = this.options.rightFrozenColCount) && void 0 !== _k ? _k : 0) && (table.rightFrozenColCount = null !== (_l = this.options.rightFrozenColCount) && void 0 !== _l ? _l : 0)) : (table.colCount = null !== (_m = layoutMap.colCount) && void 0 !== _m ? _m : 0, table.rowCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount, this.internalProps.frozenColCount = null !== (_o = this.options.frozenColCount) && void 0 !== _o ? _o : 0, table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_p = this.options.frozenRowCount) && void 0 !== _p ? _p : 0), table.bottomFrozenRowCount !== (null !== (_q = this.options.bottomFrozenRowCount) && void 0 !== _q ? _q : 0) && (table.bottomFrozenRowCount = null !== (_r = this.options.bottomFrozenRowCount) && void 0 !== _r ? _r : 0), table.rightFrozenColCount !== (null !== (_s = this.options.rightFrozenColCount) && void 0 !== _s ? _s : 0) && (table.rightFrozenColCount = null !== (_t = this.options.rightFrozenColCount) && void 0 !== _t ? _t : 0)), this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
59047
+ layoutMap.recordsCount = dataCount + (dataCount > 0 || this.options.showAggregationWhenEmpty ? layoutMap.hasAggregationOnTopCount + layoutMap.hasAggregationOnBottomCount : 0), table.transpose ? (table.rowCount = null !== (_c = layoutMap.rowCount) && void 0 !== _c ? _c : 0, table.colCount = null !== (_d = layoutMap.colCount) && void 0 !== _d ? _d : 0, this.internalProps.frozenColCount = Math.max((null !== (_e = layoutMap.headerLevelCount) && void 0 !== _e ? _e : 0) + layoutMap.leftRowSeriesNumberColumnCount, null !== (_f = this.options.frozenColCount) && void 0 !== _f ? _f : 0), this.internalProps.frozenRowCount = null !== (_g = this.options.frozenRowCount) && void 0 !== _g ? _g : 0, table.bottomFrozenRowCount !== (null !== (_h = this.options.bottomFrozenRowCount) && void 0 !== _h ? _h : 0) && (table.bottomFrozenRowCount = null !== (_j = this.options.bottomFrozenRowCount) && void 0 !== _j ? _j : 0), table.rightFrozenColCount !== (null !== (_k = this.options.rightFrozenColCount) && void 0 !== _k ? _k : 0) && (table.rightFrozenColCount = null !== (_l = this.options.rightFrozenColCount) && void 0 !== _l ? _l : 0)) : (table.colCount = null !== (_m = layoutMap.colCount) && void 0 !== _m ? _m : 0, table.rowCount = layoutMap.recordsCount * layoutMap.bodyRowSpanCount + layoutMap.headerLevelCount, this.internalProps.frozenColCount = null !== (_o = this.options.frozenColCount) && void 0 !== _o ? _o : 0, this.options.frozenColCount >= this.colCount && (this.internalProps.frozenColCount = 0), table.frozenRowCount = Math.max(layoutMap.headerLevelCount, null !== (_p = this.options.frozenRowCount) && void 0 !== _p ? _p : 0), table.bottomFrozenRowCount !== (null !== (_q = this.options.bottomFrozenRowCount) && void 0 !== _q ? _q : 0) && (table.bottomFrozenRowCount = null !== (_r = this.options.bottomFrozenRowCount) && void 0 !== _r ? _r : 0), table.rightFrozenColCount !== (null !== (_s = this.options.rightFrozenColCount) && void 0 !== _s ? _s : 0) && (table.rightFrozenColCount = null !== (_t = this.options.rightFrozenColCount) && void 0 !== _t ? _t : 0)), this.stateManager.setFrozenCol(this.internalProps.frozenColCount);
58990
59048
  }
58991
59049
  getFieldData(field, col, row) {
58992
59050
  if (null === field) return null;
@@ -59169,7 +59227,7 @@
59169
59227
  })), this.internalProps.layoutMap.clearCellRangeMap(), this.internalProps.useOneRowHeightFillAll = !1, this.scenegraph.sortCell()), sortState.length && this.stateManager.updateSortState(sortState);
59170
59228
  }
59171
59229
  updateFilterRules(filterRules) {
59172
- this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph();
59230
+ this.scenegraph.clearCells(), this.sortState ? (this.dataSource.updateFilterRulesForSorted(filterRules), sortRecords(this)) : this.dataSource.updateFilterRules(filterRules), this.refreshRowColCount(), this.stateManager.initCheckedState(this.records), this.scenegraph.createSceneGraph(), this.resize();
59173
59231
  }
59174
59232
  getCheckboxState(field) {
59175
59233
  if (this.stateManager.checkedState.size < this.rowCount - this.columnHeaderLevelCount && this.stateManager.initLeftRecordsCheckState(this.records), isValid$3(field)) {
@@ -59244,7 +59302,7 @@
59244
59302
  }
59245
59303
  this.refreshRowColCount();
59246
59304
  } else _setRecords(this, records);
59247
- if (this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this.internalProps.title && !this.internalProps.title.isReleased && (this._updateSize(), this.internalProps.title.resize(), this.scenegraph.resize()), this.options.emptyTip) if (this.internalProps.emptyTip) null === (_c = this.internalProps.emptyTip) || void 0 === _c || _c.resetVisible();else {
59305
+ if (this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(), this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize(), this.internalProps.title && !this.internalProps.title.isReleased && this.internalProps.title.resize(), this.scenegraph.resize(), this.options.emptyTip) if (this.internalProps.emptyTip) null === (_c = this.internalProps.emptyTip) || void 0 === _c || _c.resetVisible();else {
59248
59306
  const EmptyTip = Factory.getComponent("emptyTip");
59249
59307
  this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_d = this.internalProps.emptyTip) || void 0 === _d || _d.resetVisible();
59250
59308
  }
@@ -61125,10 +61183,12 @@
61125
61183
  }), legend.hideAll()), this.table.scenegraph.stage.defaultLayer.appendChild(legend), this.adjustTableSize(attrs);
61126
61184
  }
61127
61185
  resize() {
61128
- this.legendComponent && !1 !== this.visible && (this.legendComponent.setAttributes({
61129
- maxWidth: this.table.tableNoFrameWidth,
61130
- maxHeight: this.table.tableNoFrameHeight
61131
- }), this.adjustTableSize(this.legendComponent.attribute));
61186
+ if (!this.legendComponent || !1 === this.visible) return;
61187
+ const attrs = this.getLegendAttributes({
61188
+ width: this.table.tableNoFrameWidth,
61189
+ height: this.table.tableNoFrameHeight
61190
+ });
61191
+ this.legendComponent.setAttributes(attrs), this.adjustTableSize(this.legendComponent.attribute);
61132
61192
  }
61133
61193
  adjustTableSize(attrs) {
61134
61194
  var _a, _b;
@@ -61607,7 +61667,22 @@
61607
61667
  container: table => new Container(table)
61608
61668
  };
61609
61669
  function getMenuInstanceInfo(table, col, row, type, dropDownMenuOptions) {
61610
- var _a, _b;
61670
+ var _a, _b, _c;
61671
+ if (-1 === col && -1 === row && "context-menu" === type) return (null == dropDownMenuOptions ? void 0 : dropDownMenuOptions.content) ? {
61672
+ type: type,
61673
+ position: dropDownMenuOptions.position,
61674
+ referencePosition: null !== (_a = dropDownMenuOptions.referencePosition) && void 0 !== _a ? _a : {
61675
+ rect: {
61676
+ left: 0,
61677
+ right: 0,
61678
+ top: 0,
61679
+ bottom: 0,
61680
+ width: 0,
61681
+ height: 0
61682
+ }
61683
+ },
61684
+ content: dropDownMenuOptions.content
61685
+ } : null;
61611
61686
  const {
61612
61687
  lineHeight: lineHeight,
61613
61688
  textBaseline: textBaseline,
@@ -61636,7 +61711,7 @@
61636
61711
  } = table.internalProps.headerHelper.getDropDownIconRect(rect, lineHeight, textBaseline || "middle")), null == dropDownMenuOptions ? void 0 : dropDownMenuOptions.content) return {
61637
61712
  type: type,
61638
61713
  position: dropDownMenuOptions.position,
61639
- referencePosition: null !== (_a = dropDownMenuOptions.referencePosition) && void 0 !== _a ? _a : {
61714
+ referencePosition: null !== (_b = dropDownMenuOptions.referencePosition) && void 0 !== _b ? _b : {
61640
61715
  rect: {
61641
61716
  left: left,
61642
61717
  right: right,
@@ -61651,7 +61726,7 @@
61651
61726
  if ("dropdown-menu" === type) {
61652
61727
  let dropDownMenu = table.globalDropDownMenu;
61653
61728
  const headerData = table._getHeaderLayoutMap(col, row);
61654
- dropDownMenu = null !== (_b = headerData.dropDownMenu) && void 0 !== _b ? _b : dropDownMenu;
61729
+ dropDownMenu = null !== (_c = headerData.dropDownMenu) && void 0 !== _c ? _c : dropDownMenu;
61655
61730
  const pivotInfo = headerData.pivotInfo;
61656
61731
  return "function" == typeof dropDownMenu && (dropDownMenu = dropDownMenu({
61657
61732
  row: row,
@@ -61694,7 +61769,16 @@
61694
61769
  info: menuInstanceInfo
61695
61770
  } = instanceInfo;
61696
61771
  if (instance && instance.bindMenuElement(col, row, menuInstanceInfo)) {
61697
- const range = this._table.getCellRange(col, row);
61772
+ const range = -1 === col && -1 === row ? {
61773
+ start: {
61774
+ col: -1,
61775
+ row: -1
61776
+ },
61777
+ end: {
61778
+ col: -1,
61779
+ row: -1
61780
+ }
61781
+ } : this._table.getCellRange(col, row);
61698
61782
  this._attachInfo = {
61699
61783
  range: range,
61700
61784
  instance: instance
@@ -61739,6 +61823,19 @@
61739
61823
  }
61740
61824
  });
61741
61825
  }
61826
+ }), table.on(TABLE_EVENT_TYPE.CONTEXTMENU_CANVAS, e => {
61827
+ var _a, _b, _c, _d;
61828
+ if ("html" === (null === (_a = table.internalProps.menu) || void 0 === _a ? void 0 : _a.renderMode)) {
61829
+ const abstractPos = table._getMouseAbstractPoint(e.event);
61830
+ let menu = null;
61831
+ abstractPos.inTable && "function" == typeof (null === (_b = table.internalProps.menu) || void 0 === _b ? void 0 : _b.contextMenuItems) ? menu = table.internalProps.menu.contextMenuItems(table.getHeaderField(e.col, e.row), e.row, e.col, table) : abstractPos.inTable && Array.isArray(null === (_c = table.internalProps.menu) || void 0 === _c ? void 0 : _c.contextMenuItems) && (menu = null === (_d = table.internalProps.menu) || void 0 === _d ? void 0 : _d.contextMenuItems), this._bindToCell(-1, -1, "context-menu", {
61832
+ content: menu,
61833
+ position: {
61834
+ x: abstractPos.x,
61835
+ y: abstractPos.y
61836
+ }
61837
+ });
61838
+ }
61742
61839
  });
61743
61840
  }
61744
61841
  _getMenuInstanceInfo(col, row, type, dropDownMenuOptions) {