@visactor/vtable-calendar 1.17.3-alpha.2 → 1.17.3-alpha.3

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.
@@ -27715,6 +27715,7 @@
27715
27715
  RESIZE_COLUMN_END: "resize_column_end",
27716
27716
  RESIZE_ROW: "resize_row",
27717
27717
  RESIZE_ROW_END: "resize_row_end",
27718
+ RESIZE_TABLE: "resize_table",
27718
27719
  CHANGE_HEADER_POSITION_START: "change_header_position_start",
27719
27720
  CHANGE_HEADER_POSITION: "change_header_position",
27720
27721
  CHANGING_HEADER_POSITION: "changing_header_position",
@@ -37406,12 +37407,12 @@
37406
37407
  isWidthNumber = !Array.isArray(strokeArrayWidth),
37407
37408
  isStrokeTrue = !Array.isArray(stroke),
37408
37409
  isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;
37409
- context.stroke(), context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
37410
+ context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
37410
37411
  const {
37411
37412
  lineDash = groupAttribute.lineDash
37412
37413
  } = group.attribute;
37413
37414
  let isDash = !1;
37414
- lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.beginPath(), context.moveTo(x, y);
37415
+ lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.moveTo(x, y);
37415
37416
  const strokeTop = (isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0]),
37416
37417
  strokeRight = (isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1]),
37417
37418
  strokeBottom = (isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2]),
@@ -37432,7 +37433,7 @@
37432
37433
  isWidthNumber ? widthInfo.width : strokeArrayWidth[3], isWidthNumber ? widthInfo.width : strokeArrayWidth[3];
37433
37434
  context.moveTo(x1, y1), context.lineTo(x2, y2), (isSplitDraw || isDash) && (strokeArrayColor && strokeArrayColor[3] ? context.strokeStyle = strokeArrayColor[3] : strokeArrayColor && !strokeArrayColor[3] && (context.strokeStyle = "transparent"), isWidthNumber || (context.lineWidth = strokeArrayWidth[3]), context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d, isDash && context.setLineDash(null !== (_d = lineDash[3]) && void 0 !== _d ? _d : []), context.stroke(), context.beginPath(), context.moveTo(x, y));
37434
37435
  } else 3 === i && context.moveTo(x, y);
37435
- context.closePath(), isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.beginPath();
37436
+ isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.closePath();
37436
37437
  }
37437
37438
 
37438
37439
  var __decorate$1 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -39323,7 +39324,7 @@
39323
39324
  }
39324
39325
  isExtend && extendSelectRange();
39325
39326
  };
39326
- ifExtendSelectRange && extendSelectRange(), scene.selectingRangeComponents.forEach((selectComp, key) => {
39327
+ ifExtendSelectRange && (extendSelectRange(), selectRange.start.col > selectRange.end.col ? (selectRange.start.col = Math.max(startCol, endCol), selectRange.end.col = Math.min(startCol, endCol)) : (selectRange.start.col = Math.min(startCol, endCol), selectRange.end.col = Math.max(startCol, endCol)), selectRange.start.row > selectRange.end.row ? (selectRange.start.row = Math.max(startRow, endRow), selectRange.end.row = Math.min(startRow, endRow)) : (selectRange.start.row = Math.min(startRow, endRow), selectRange.end.row = Math.max(startRow, endRow))), scene.selectingRangeComponents.forEach((selectComp, key) => {
39327
39328
  var _a;
39328
39329
  selectComp.rect.delete(), null === (_a = selectComp.fillhandle) || void 0 === _a || _a.delete();
39329
39330
  }), scene.selectingRangeComponents = new Map();
@@ -39413,7 +39414,7 @@
39413
39414
  }
39414
39415
 
39415
39416
  function createCellSelectBorder(scene, start_Col, start_Row, end_Col, end_Row, selectRangeType, selectId, strokes) {
39416
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39417
+ var _a, _b, _c, _d, _e, _f, _g, _h;
39417
39418
  let isHasFillHandleRect = !!(null === (_a = scene.table.options.excelOptions) || void 0 === _a ? void 0 : _a.fillHandle);
39418
39419
  if ((null === (_b = scene.table.stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length) > 1) isHasFillHandleRect = !1, scene.removeFillHandleFromSelectComponents();else if (1 === (null === (_c = scene.table.stateManager.select.ranges) || void 0 === _c ? void 0 : _c.length)) {
39419
39420
  const maxRow = Math.max(scene.table.stateManager.select.ranges[0].start.row, scene.table.stateManager.select.ranges[0].end.row),
@@ -39439,8 +39440,7 @@
39439
39440
  y: firstCellBound.y1 - scene.tableGroup.attribute.y,
39440
39441
  width: 0,
39441
39442
  height: 0,
39442
- visible: !0,
39443
- cornerRadius: getCornerRadius(selectRangeType, null === (_j = scene.table.theme.frameStyle) || void 0 === _j ? void 0 : _j.cornerRadius, start_Col, start_Row, end_Col, end_Row, scene.table)
39443
+ visible: !0
39444
39444
  });
39445
39445
  let fillhandle;
39446
39446
  isHasFillHandleRect && (fillhandle = createRect({
@@ -39458,15 +39458,6 @@
39458
39458
  role: selectRangeType
39459
39459
  }), scene.tableGroup.insertAfter(rect, "body" === selectRangeType ? scene.bodyGroup : "columnHeader" === selectRangeType ? scene.colHeaderGroup : "rowHeader" === selectRangeType ? scene.rowHeaderGroup : "cornerHeader" === selectRangeType ? scene.cornerHeaderGroup : "rightTopCorner" === selectRangeType ? scene.rightTopCornerGroup : "rightFrozen" === selectRangeType ? scene.rightFrozenGroup : "leftBottomCorner" === selectRangeType ? scene.leftBottomCornerGroup : "bottomFrozen" === selectRangeType ? scene.bottomFrozenGroup : scene.rightBottomCornerGroup), isHasFillHandleRect && scene.tableGroup.insertAfter(fillhandle, "body" === selectRangeType ? scene.bodyGroup : "columnHeader" === selectRangeType ? scene.colHeaderGroup : "rowHeader" === selectRangeType ? scene.rowHeaderGroup : "cornerHeader" === selectRangeType ? scene.cornerHeaderGroup : "rightTopCorner" === selectRangeType ? scene.rightTopCornerGroup : "rightFrozen" === selectRangeType ? scene.rightFrozenGroup : "leftBottomCorner" === selectRangeType ? scene.leftBottomCornerGroup : "bottomFrozen" === selectRangeType ? scene.bottomFrozenGroup : scene.rightBottomCornerGroup);
39460
39460
  }
39461
- function getCornerRadius(selectRangeType, cornerRadius, start_Col, start_Row, end_Col, end_Row, table) {
39462
- if (!cornerRadius) return;
39463
- const cornerRadiusArray = Array.isArray(cornerRadius) ? cornerRadius : [cornerRadius, cornerRadius, cornerRadius, cornerRadius],
39464
- tableEndCol = table.colCount - 1,
39465
- tableEndRow = table.rowCount - 1,
39466
- result = [0, 0, 0, 0];
39467
- let changed = !1;
39468
- return 0 === start_Col && 0 === start_Row ? (result[0] = cornerRadiusArray[0], changed = !0) : end_Col === tableEndCol && end_Row === tableEndRow ? (result[2] = cornerRadiusArray[2], changed = !0) : 0 === start_Col && end_Row === tableEndRow ? (result[3] = cornerRadiusArray[3], changed = !0) : end_Col === tableEndCol && 0 === start_Row && (result[1] = cornerRadiusArray[1], changed = !0), changed ? result : void 0;
39469
- }
39470
39461
 
39471
39462
  function moveSelectingRangeComponentsToSelectedRangeComponents(scene) {
39472
39463
  scene.selectingRangeComponents.forEach((rangeComponent, key) => {
@@ -41700,7 +41691,7 @@
41700
41691
  } : table.getCellRange(col, row);
41701
41692
  currentRange.start.col < cellRange.end.col ? currentRange.end.col = cellRange.end.col : currentRange.start.col > cellRange.start.col && (currentRange.end.col = cellRange.start.col), currentRange.start.row < cellRange.end.row ? currentRange.end.row = cellRange.end.row : currentRange.start.row > cellRange.start.row && (currentRange.end.row = cellRange.start.row), "body" === state.select.headerSelectMode && (table.isRowHeader(col, row) ? (currentRange.start.col = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, currentRange.end.col = table.colCount - 1) : table.isColumnHeader(col, row) ? (currentRange.start.row = table.columnHeaderLevelCount, currentRange.end.row = table.rowCount - 1) : table.internalProps.layoutMap.isSeriesNumberInBody(col, row) ? (currentRange.start.col = table.leftRowSeriesNumberCount, currentRange.end.col = table.colCount - 1) : table.isCornerHeader(col, row) ? (currentRange.start.col = table.rowHeaderLevelCount + table.leftRowSeriesNumberCount, currentRange.start.row = table.columnHeaderLevelCount, currentRange.end.col = table.colCount - 1, currentRange.end.row = table.rowCount - 1) : table.isSeriesNumber(col, row) && (currentRange.start.col = table.leftRowSeriesNumberCount, currentRange.start.row = table.columnHeaderLevelCount, currentRange.end.col = table.colCount - 1, currentRange.end.row = table.rowCount - 1)), skipBodyMerge && (currentRange.skipBodyMerge = !0);
41702
41693
  }
41703
- scenegraph.updateCellSelectBorder(currentRange, extendSelectRange);
41694
+ currentRange && currentRange.start.row <= table.rowCount - 1 && currentRange.end.row <= table.rowCount - 1 && currentRange.start.col <= table.colCount - 1 && currentRange.end.col <= table.colCount - 1 && scenegraph.updateCellSelectBorder(currentRange, extendSelectRange);
41704
41695
  }
41705
41696
  }
41706
41697
  } else {
@@ -41898,7 +41889,7 @@
41898
41889
  }
41899
41890
  cellPos.col = col, cellPos.row = row;
41900
41891
  const currentRange = null === (_b = state.select.ranges) || void 0 === _b ? void 0 : _b[state.select.ranges.length - 1];
41901
- currentRange && scenegraph.updateCellSelectBorder(currentRange, extendSelectRange);
41892
+ currentRange && currentRange.start.row <= table.rowCount - 1 && currentRange.end.row <= table.rowCount - 1 && currentRange.start.col <= table.colCount - 1 && currentRange.end.col <= table.colCount - 1 && scenegraph.updateCellSelectBorder(currentRange, extendSelectRange);
41902
41893
  }
41903
41894
  }
41904
41895
  } else cellPos.col = -1, cellPos.row = -1, state.select.ranges = [], scenegraph.deleteAllSelectBorder();
@@ -42961,108 +42952,76 @@
42961
42952
  var _a, _b;
42962
42953
  const totalHeight = this.table.getAllRowsHeight(),
42963
42954
  oldVerticalBarPos = this.scroll.verticalBarPos;
42964
- let verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height));
42965
- isValid$3(verticalBarPos) && !isNaN(verticalBarPos) || (verticalBarPos = 0);
42966
- const dy = verticalBarPos - this.table.scenegraph.proxy.deltaY - oldVerticalBarPos;
42967
- if (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
42955
+ this.scroll.verticalBarPos = Math.ceil(yRatio * (totalHeight - this.table.scenegraph.height)), isValid$3(this.scroll.verticalBarPos) && !isNaN(this.scroll.verticalBarPos) || (this.scroll.verticalBarPos = 0), this.table.scenegraph.setY(-this.scroll.verticalBarPos, 1 === yRatio), this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY, this.table.scenegraph.proxy.deltaY = 0, this.updateHoverPos(-1, -1), this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
42968
42956
  event: void 0,
42969
- scrollTop: verticalBarPos - this.table.scenegraph.proxy.deltaY,
42957
+ scrollTop: this.scroll.verticalBarPos,
42970
42958
  scrollLeft: this.scroll.horizontalBarPos,
42971
42959
  scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
42972
42960
  scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
42973
42961
  viewHeight: this.table.tableNoFrameHeight,
42974
42962
  viewWidth: this.table.tableNoFrameWidth,
42975
42963
  scrollDirection: "vertical",
42976
- scrollRatioY: yRatio,
42977
- dy: dy
42978
- }).some(value => !1 === value)) {
42979
- const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
42980
- this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
42981
- } else this.scroll.verticalBarPos = verticalBarPos, this.table.scenegraph.setY(-this.scroll.verticalBarPos, 1 === yRatio), this.scroll.verticalBarPos -= this.table.scenegraph.proxy.deltaY, this.table.scenegraph.proxy.deltaY = 0, this.updateHoverPos(-1, -1), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
42964
+ scrollRatioY: yRatio
42965
+ }), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
42982
42966
  }
42983
42967
  updateHorizontalScrollBar(xRatio) {
42984
42968
  var _a, _b;
42985
42969
  const totalWidth = this.table.getAllColsWidth(),
42986
42970
  oldHorizontalBarPos = this.scroll.horizontalBarPos;
42987
- let horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width));
42988
- isValid$3(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
42989
- const dx = horizontalBarPos - this.table.scenegraph.proxy.deltaX - oldHorizontalBarPos;
42990
- if (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
42971
+ this.scroll.horizontalBarPos = Math.ceil(xRatio * (totalWidth - this.table.scenegraph.width)), isValid$3(this.scroll.horizontalBarPos) && !isNaN(this.scroll.horizontalBarPos) || (this.scroll.horizontalBarPos = 0), this.table.scenegraph.setX(-this.scroll.horizontalBarPos, 1 === xRatio), this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX, this.table.scenegraph.proxy.deltaX = 0, this.updateHoverPos(-1, -1), this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
42991
42972
  event: void 0,
42992
42973
  scrollTop: this.scroll.verticalBarPos,
42993
- scrollLeft: horizontalBarPos - this.table.scenegraph.proxy.deltaX,
42974
+ scrollLeft: this.scroll.horizontalBarPos,
42994
42975
  scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
42995
42976
  scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
42996
42977
  viewHeight: this.table.tableNoFrameHeight,
42997
42978
  viewWidth: this.table.tableNoFrameWidth,
42998
42979
  scrollDirection: "horizontal",
42999
- scrollRatioX: xRatio,
43000
- dx: dx
43001
- }).some(value => !1 === value)) {
43002
- const xRatio = this.scroll.horizontalBarPos / (totalWidth - this.table.scenegraph.width);
43003
- this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
43004
- } else this.scroll.horizontalBarPos = horizontalBarPos, this.table.scenegraph.setX(-this.scroll.horizontalBarPos, 1 === xRatio), this.scroll.horizontalBarPos -= this.table.scenegraph.proxy.deltaX, this.table.scenegraph.proxy.deltaX = 0, this.updateHoverPos(-1, -1), oldHorizontalBarPos !== this.scroll.horizontalBarPos && this.checkHorizontalScrollBarEnd();
42980
+ scrollRatioX: xRatio
42981
+ }), oldHorizontalBarPos !== this.scroll.horizontalBarPos && this.checkHorizontalScrollBarEnd();
43005
42982
  }
43006
42983
  setScrollTop(top, event) {
43007
42984
  let triggerEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
43008
- var _a, _b, _c, _d, _e;
42985
+ var _a, _b, _c;
43009
42986
  const totalHeight = this.table.getAllRowsHeight(),
43010
42987
  sizeTolerance = (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0;
43011
- top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance)), top = Math.ceil(top);
43012
- const oldVerticalBarPos = this.scroll.verticalBarPos,
43013
- yRatio = top / (totalHeight - this.table.scenegraph.height);
43014
- if ((oldVerticalBarPos !== top || !0 === (null === (_c = null === (_b = this.table.options) || void 0 === _b ? void 0 : _b.customConfig) || void 0 === _c ? void 0 : _c.scrollEventAlwaysTrigger)) && triggerEvent) {
43015
- let verticalBarPos = top;
43016
- isValid$3(verticalBarPos) && !isNaN(verticalBarPos) || (verticalBarPos = 0);
43017
- const dy = verticalBarPos - oldVerticalBarPos;
43018
- if (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
43019
- event: null == event ? void 0 : event.nativeEvent,
43020
- scrollTop: verticalBarPos,
43021
- scrollLeft: this.scroll.horizontalBarPos,
43022
- scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
43023
- scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
43024
- viewHeight: this.table.tableNoFrameHeight,
43025
- viewWidth: this.table.tableNoFrameWidth,
43026
- scrollDirection: "vertical",
43027
- scrollRatioY: yRatio,
43028
- dy: dy
43029
- }).some(value => !1 === value)) {
43030
- const yRatio = this.scroll.verticalBarPos / (totalHeight - this.table.scenegraph.height);
43031
- return void this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio);
43032
- }
43033
- }
43034
- (top !== this.scroll.verticalBarPos || this.table.isPivotChart()) && this.updateHoverPos(-1, -1), this.scroll.verticalBarPos = top, isValid$3(this.scroll.verticalBarPos) && !isNaN(this.scroll.verticalBarPos) || (this.scroll.verticalBarPos = 0), this.table.scenegraph.setY(-top), this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio), oldVerticalBarPos !== top && triggerEvent && this.checkVerticalScrollBarEnd();
42988
+ top = Math.max(0, Math.min(top, totalHeight - this.table.scenegraph.height - sizeTolerance)), ((top = Math.ceil(top)) !== this.scroll.verticalBarPos || this.table.isPivotChart()) && this.updateHoverPos(-1, -1);
42989
+ const oldVerticalBarPos = this.scroll.verticalBarPos;
42990
+ this.scroll.verticalBarPos = top, isValid$3(this.scroll.verticalBarPos) && !isNaN(this.scroll.verticalBarPos) || (this.scroll.verticalBarPos = 0), this.table.scenegraph.setY(-top);
42991
+ const yRatio = top / (totalHeight - this.table.scenegraph.height);
42992
+ this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio), oldVerticalBarPos !== top && triggerEvent && (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
42993
+ event: null == event ? void 0 : event.nativeEvent,
42994
+ scrollTop: this.scroll.verticalBarPos,
42995
+ scrollLeft: this.scroll.horizontalBarPos,
42996
+ scrollHeight: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
42997
+ scrollWidth: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
42998
+ viewHeight: this.table.tableNoFrameHeight,
42999
+ viewWidth: this.table.tableNoFrameWidth,
43000
+ scrollDirection: "vertical",
43001
+ scrollRatioY: yRatio
43002
+ }), this.checkVerticalScrollBarEnd());
43035
43003
  }
43036
43004
  setScrollLeft(left, event) {
43037
43005
  let triggerEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
43038
- var _a, _b, _c, _d, _e;
43006
+ var _a, _b, _c;
43039
43007
  this.table.scrollLeft;
43040
43008
  const totalWidth = this.table.getAllColsWidth(),
43041
43009
  sizeTolerance = (this.table.getFrozenColsWidth(), (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0);
43042
- left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width - sizeTolerance)), left = Math.ceil(left);
43043
- const oldHorizontalBarPos = this.scroll.horizontalBarPos,
43044
- xRatio = left / (totalWidth - this.table.scenegraph.width);
43045
- if ((oldHorizontalBarPos !== left || !0 === (null === (_c = null === (_b = this.table.options) || void 0 === _b ? void 0 : _b.customConfig) || void 0 === _c ? void 0 : _c.scrollEventAlwaysTrigger)) && triggerEvent) {
43046
- let horizontalBarPos = left;
43047
- isValid$3(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
43048
- const dx = horizontalBarPos - oldHorizontalBarPos;
43049
- if (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
43050
- event: null == event ? void 0 : event.nativeEvent,
43051
- scrollTop: this.scroll.verticalBarPos,
43052
- scrollLeft: horizontalBarPos,
43053
- scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
43054
- scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
43055
- viewHeight: this.table.tableNoFrameHeight,
43056
- viewWidth: this.table.tableNoFrameWidth,
43057
- scrollDirection: "horizontal",
43058
- scrollRatioX: xRatio,
43059
- dx: dx
43060
- }).some(value => !1 === value)) {
43061
- const xRatio = this.scroll.horizontalBarPos / (totalWidth - this.table.scenegraph.width);
43062
- return void this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio);
43063
- }
43064
- }
43065
- left !== this.scroll.horizontalBarPos && this.updateHoverPos(-1, -1), this.scroll.horizontalBarPos = left, isValid$3(this.scroll.horizontalBarPos) && !isNaN(this.scroll.horizontalBarPos) || (this.scroll.horizontalBarPos = 0), this.table.scenegraph.setX(-left), this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio), oldHorizontalBarPos !== left && triggerEvent && this.checkHorizontalScrollBarEnd();
43010
+ left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width - sizeTolerance)), (left = Math.ceil(left)) !== this.scroll.horizontalBarPos && this.updateHoverPos(-1, -1);
43011
+ const oldHorizontalBarPos = this.scroll.horizontalBarPos;
43012
+ this.scroll.horizontalBarPos = left, isValid$3(this.scroll.horizontalBarPos) && !isNaN(this.scroll.horizontalBarPos) || (this.scroll.horizontalBarPos = 0), this.table.scenegraph.setX(-left);
43013
+ const xRatio = left / (totalWidth - this.table.scenegraph.width);
43014
+ this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio), oldHorizontalBarPos !== left && triggerEvent && (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
43015
+ event: null == event ? void 0 : event.nativeEvent,
43016
+ scrollTop: this.scroll.verticalBarPos,
43017
+ scrollLeft: this.scroll.horizontalBarPos,
43018
+ scrollHeight: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
43019
+ scrollWidth: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
43020
+ viewHeight: this.table.tableNoFrameHeight,
43021
+ viewWidth: this.table.tableNoFrameWidth,
43022
+ scrollDirection: "horizontal",
43023
+ scrollRatioX: xRatio
43024
+ }), this.checkHorizontalScrollBarEnd());
43066
43025
  }
43067
43026
  hideVerticalScrollBar() {
43068
43027
  this.table.scenegraph.component.hideVerticalScrollBar();
@@ -47523,7 +47482,7 @@
47523
47482
  constructor(container) {
47524
47483
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47525
47484
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
47526
- if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
47485
+ if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.3", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
47527
47486
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
47528
47487
  const {
47529
47488
  frozenColCount = 0,
@@ -47662,7 +47621,14 @@
47662
47621
  var _a;
47663
47622
  this._updateSize(), null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach(legend => {
47664
47623
  null == legend || legend.resize();
47665
- }), this.internalProps.title && this.internalProps.title.resize(), this.internalProps.emptyTip && this.internalProps.emptyTip.resize(), this.scenegraph.resize();
47624
+ }), this.internalProps.title && this.internalProps.title.resize(), this.internalProps.emptyTip && this.internalProps.emptyTip.resize(), this.scenegraph.resize(), setTimeout(() => {
47625
+ this.fireListeners(TABLE_EVENT_TYPE.RESIZE_TABLE, {
47626
+ tableX: this.tableX,
47627
+ tableY: this.tableY,
47628
+ tableWidth: this.tableNoFrameWidth,
47629
+ tableHeight: this.tableNoFrameHeight
47630
+ });
47631
+ }, 0);
47666
47632
  }
47667
47633
  get rowCount() {
47668
47634
  return this.internalProps.rowCount;
@@ -47878,7 +47844,7 @@
47878
47844
  }
47879
47845
  }
47880
47846
  _updateSize() {
47881
- 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, _0, _1, _2, _3;
47847
+ 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, _0, _1;
47882
47848
  const {
47883
47849
  padding: padding
47884
47850
  } = this;
@@ -47896,20 +47862,20 @@
47896
47862
  const {
47897
47863
  canvas: canvas
47898
47864
  } = this.internalProps;
47899
- 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) || (canvas.style.width = "", canvas.style.height = "", canvas.width = widthP, canvas.height = heightP, canvas.style.width = `${widthP}px`, canvas.style.height = `${heightP}px`), (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox) && (widthP = this.options.viewBox.x2 - this.options.viewBox.x1, heightP = this.options.viewBox.y2 - this.options.viewBox.y1), (null === (_h = null == this ? void 0 : this.scenegraph) || void 0 === _h ? void 0 : _h.stage) && (this.options.viewBox ? this.scenegraph.stage.setViewBox(this.options.viewBox, !1) : this.scenegraph.stage.resize(widthP, heightP));
47865
+ 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) ? 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`);
47900
47866
  } else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
47901
47867
  const width = Math.floor(widthP - getVerticalScrollBarSize(this.getTheme().scrollStyle)),
47902
47868
  height = Math.floor(heightP - getHorizontalScrollBarSize(this.getTheme().scrollStyle));
47903
- if (null === (_j = this.internalProps.theme) || void 0 === _j ? void 0 : _j.frameStyle) {
47904
- const lineWidths = toBoxArray(null !== (_l = null === (_k = this.internalProps.theme.frameStyle) || void 0 === _k ? void 0 : _k.borderLineWidth) && void 0 !== _l ? _l : [null]),
47905
- shadowWidths = toBoxArray(null !== (_o = null === (_m = this.internalProps.theme.frameStyle) || void 0 === _m ? void 0 : _m.shadowBlur) && void 0 !== _o ? _o : [0]);
47906
- (null === (_p = this.theme.frameStyle) || void 0 === _p ? void 0 : _p.innerBorder) ? (this.tableX = 0, this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_q = shadowWidths[1]) && void 0 !== _q ? _q : 0), this.tableNoFrameHeight = height - (null !== (_r = shadowWidths[2]) && void 0 !== _r ? _r : 0)) : (this.tableX = (null !== (_s = lineWidths[3]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[3]) && void 0 !== _t ? _t : 0), this.tableY = (null !== (_u = lineWidths[0]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[0]) && void 0 !== _v ? _v : 0), this.tableNoFrameWidth = width - ((null !== (_w = lineWidths[1]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[1]) && void 0 !== _x ? _x : 0)) - ((null !== (_y = lineWidths[3]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[3]) && void 0 !== _z ? _z : 0)), this.tableNoFrameHeight = height - ((null !== (_0 = lineWidths[0]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[0]) && void 0 !== _1 ? _1 : 0)) - ((null !== (_2 = lineWidths[2]) && void 0 !== _2 ? _2 : 0) + (null !== (_3 = shadowWidths[2]) && void 0 !== _3 ? _3 : 0)));
47869
+ if (null === (_g = this.internalProps.theme) || void 0 === _g ? void 0 : _g.frameStyle) {
47870
+ const lineWidths = toBoxArray(null !== (_j = null === (_h = this.internalProps.theme.frameStyle) || void 0 === _h ? void 0 : _h.borderLineWidth) && void 0 !== _j ? _j : [null]),
47871
+ shadowWidths = toBoxArray(null !== (_l = null === (_k = this.internalProps.theme.frameStyle) || void 0 === _k ? void 0 : _k.shadowBlur) && void 0 !== _l ? _l : [0]);
47872
+ (null === (_m = this.theme.frameStyle) || void 0 === _m ? void 0 : _m.innerBorder) ? (this.tableX = 0, this.tableY = 0, this.tableNoFrameWidth = width - (null !== (_o = shadowWidths[1]) && void 0 !== _o ? _o : 0), this.tableNoFrameHeight = height - (null !== (_p = shadowWidths[2]) && void 0 !== _p ? _p : 0)) : (this.tableX = (null !== (_q = lineWidths[3]) && void 0 !== _q ? _q : 0) + (null !== (_r = shadowWidths[3]) && void 0 !== _r ? _r : 0), this.tableY = (null !== (_s = lineWidths[0]) && void 0 !== _s ? _s : 0) + (null !== (_t = shadowWidths[0]) && void 0 !== _t ? _t : 0), this.tableNoFrameWidth = width - ((null !== (_u = lineWidths[1]) && void 0 !== _u ? _u : 0) + (null !== (_v = shadowWidths[1]) && void 0 !== _v ? _v : 0)) - ((null !== (_w = lineWidths[3]) && void 0 !== _w ? _w : 0) + (null !== (_x = shadowWidths[3]) && void 0 !== _x ? _x : 0)), this.tableNoFrameHeight = height - ((null !== (_y = lineWidths[0]) && void 0 !== _y ? _y : 0) + (null !== (_z = shadowWidths[0]) && void 0 !== _z ? _z : 0)) - ((null !== (_0 = lineWidths[2]) && void 0 !== _0 ? _0 : 0) + (null !== (_1 = shadowWidths[2]) && void 0 !== _1 ? _1 : 0)));
47907
47873
  }
47908
47874
  }
47909
47875
  updateViewBox(newViewBox) {
47910
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
47911
- 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),
47912
- oldHeight = (null !== (_j = null === (_h = null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox) || void 0 === _h ? void 0 : _h.y2) && void 0 !== _j ? _j : 0) - (null !== (_m = null === (_l = null === (_k = this.options) || void 0 === _k ? void 0 : _k.viewBox) || void 0 === _l ? void 0 : _l.y1) && void 0 !== _m ? _m : 0),
47876
+ var _a, _b, _c, _d, _e, _f, _g, _h;
47877
+ const oldWidth = null !== (_d = null !== (_b = null === (_a = this.options) || void 0 === _a ? void 0 : _a.viewBox.x2) && void 0 !== _b ? _b : 0 - (null === (_c = this.options) || void 0 === _c ? void 0 : _c.viewBox.x1)) && void 0 !== _d ? _d : 0,
47878
+ oldHeight = null !== (_h = null !== (_f = null === (_e = this.options) || void 0 === _e ? void 0 : _e.viewBox.y2) && void 0 !== _f ? _f : 0 - (null === (_g = this.options) || void 0 === _g ? void 0 : _g.viewBox.y1)) && void 0 !== _h ? _h : 0,
47913
47879
  newWidth = newViewBox.x2 - newViewBox.x1,
47914
47880
  newHeight = newViewBox.y2 - newViewBox.y1;
47915
47881
  this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);