@visactor/vtable-calendar 1.17.3-alpha.7 → 1.17.3-alpha.8

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.
@@ -37406,12 +37406,12 @@
37406
37406
  isWidthNumber = !Array.isArray(strokeArrayWidth),
37407
37407
  isStrokeTrue = !Array.isArray(stroke),
37408
37408
  isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;
37409
- context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
37409
+ context.stroke(), context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);
37410
37410
  const {
37411
37411
  lineDash = groupAttribute.lineDash
37412
37412
  } = group.attribute;
37413
37413
  let isDash = !1;
37414
- lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.moveTo(x, y);
37414
+ lineDash.length && lineDash.some(dash => Array.isArray(dash)) && (isDash = !0), context.beginPath(), context.moveTo(x, y);
37415
37415
  const strokeTop = (isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0]),
37416
37416
  strokeRight = (isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1]),
37417
37417
  strokeBottom = (isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2]),
@@ -37432,7 +37432,7 @@
37432
37432
  isWidthNumber ? widthInfo.width : strokeArrayWidth[3], isWidthNumber ? widthInfo.width : strokeArrayWidth[3];
37433
37433
  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
37434
  } else 3 === i && context.moveTo(x, y);
37435
- isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.closePath();
37435
+ context.closePath(), isSplitDraw || isDash || (!isWidthNumber && widthInfo.width && (context.lineWidth = widthInfo.width), context.stroke()), context.lineDashOffset = 0, context.setLineDash([]), context.beginPath();
37436
37436
  }
37437
37437
 
37438
37438
  var __decorate$1 = undefined && undefined.__decorate || function (decorators, target, key, desc) {
@@ -38816,7 +38816,7 @@
38816
38816
  };
38817
38817
  class SceneProxy {
38818
38818
  constructor(table) {
38819
- this.isRelease = !1, this.mode = "column", this.rowLimit = 200, this.currentRow = 0, this.rowStart = 0, this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.deltaY = 0, this.deltaHeight = 0, this.colLimit = 100, this.screenLeftCol = 0, this.deltaX = 0, this.deltaWidth = 0, this.cellCache = new Map(), this.table = table, this.table.isPivotChart() ? (this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight)), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))) : this.table.isAutoRowHeight() ? this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight)) : ("autoWidth" === this.table.widthMode || (this.rowLimit = Math.max(200, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight))), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))), this.table.internalProps.transpose ? this.mode = "row" : this.table.isPivotTable() && (this.mode = "pivot"), this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount), this.table.options.maintainedColumnCount && (this.colLimit = this.table.options.maintainedColumnCount);
38819
+ this.isRelease = !1, this.mode = "column", this.rowLimit = 200, this.currentRow = 0, this.rowStart = 0, this.rowEnd = 0, this.referenceRow = 0, this.screenTopRow = 0, this.deltaY = 0, this.deltaHeight = 0, this.colLimit = 100, this.screenLeftCol = 0, this.deltaX = 0, this.deltaWidth = 0, this.cellCache = new Map(), this.table = table, this.table.isPivotChart() ? (this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight)), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))) : this.table.isAutoRowHeight() ? this.rowLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight)) : ("autoWidth" === this.table.widthMode || (this.rowLimit = Math.max(200, Math.ceil(2 * table.tableNoFrameHeight / table.defaultRowHeight))), this.colLimit = Math.max(100, Math.ceil(2 * table.tableNoFrameWidth / table.defaultColWidth))), this.table.internalProps.transpose ? this.mode = "row" : this.table.isPivotTable() && (this.mode = "pivot"), this.table.options.maintainedDataCount && (this.rowLimit = this.table.options.maintainedDataCount);
38820
38820
  }
38821
38821
  get bodyLeftCol() {
38822
38822
  return this.table.frozenColCount;
@@ -39413,7 +39413,7 @@
39413
39413
  }
39414
39414
 
39415
39415
  function createCellSelectBorder(scene, start_Col, start_Row, end_Col, end_Row, selectRangeType, selectId, strokes) {
39416
- var _a, _b, _c, _d, _e, _f, _g, _h;
39416
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
39417
39417
  let isHasFillHandleRect = !!(null === (_a = scene.table.options.excelOptions) || void 0 === _a ? void 0 : _a.fillHandle);
39418
39418
  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
39419
  const maxRow = Math.max(scene.table.stateManager.select.ranges[0].start.row, scene.table.stateManager.select.ranges[0].end.row),
@@ -39439,7 +39439,8 @@
39439
39439
  y: firstCellBound.y1 - scene.tableGroup.attribute.y,
39440
39440
  width: 0,
39441
39441
  height: 0,
39442
- visible: !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
39444
  });
39444
39445
  let fillhandle;
39445
39446
  isHasFillHandleRect && (fillhandle = createRect({
@@ -39457,6 +39458,15 @@
39457
39458
  role: selectRangeType
39458
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);
39459
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
+ }
39460
39470
 
39461
39471
  function moveSelectingRangeComponentsToSelectedRangeComponents(scene) {
39462
39472
  scene.selectingRangeComponents.forEach((rangeComponent, key) => {
@@ -39819,7 +39829,7 @@
39819
39829
  }
39820
39830
 
39821
39831
  function dealFrozen(scene) {
39822
- var _a, _b;
39832
+ var _a, _b, _c, _d;
39823
39833
  if (scene.table.frozenColCount > scene.table.rowHeaderLevelCount) {
39824
39834
  scene.rowHeaderGroup.setAttribute("height", scene.bodyGroup.attribute.height), scene.rowHeaderGroup.setAttribute("y", scene.bodyGroup.attribute.y), scene.cornerHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height);
39825
39835
  for (let i = 0; i < scene.table.frozenColCount - scene.table.rowHeaderLevelCount; i++) moveColumnFromBodyToRowHeader(scene), moveColumnFromColHeaderToCornerHeader(scene), moveColumnFromBottomToLeftBottomCorner(scene);
@@ -39827,10 +39837,10 @@
39827
39837
  scene.bodyGroup.setAttribute("height", scene.rowHeaderGroup.attribute.height), scene.bodyGroup.setAttribute("y", scene.rowHeaderGroup.attribute.y), scene.colHeaderGroup.setAttribute("height", scene.cornerHeaderGroup.attribute.height);
39828
39838
  for (let i = 0; i < scene.table.rowHeaderLevelCount - scene.table.frozenColCount; i++) moveColumnFromRowHeaderToBody(scene), moveColumnFromCornerHeaderToColHeader(scene), moveColumnFromLeftBottomCornerToBottom(scene);
39829
39839
  }
39830
- scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width), scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.table.transpose ? scene.table.options.frozenColCount ? scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1) : scene.table.options.frozenColCount && scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount) : (scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1), scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount)), scene.hasFrozen = !0, scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0;
39840
+ scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width), scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.table.transpose ? scene.table.options.frozenColCount ? scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1) : scene.table.options.frozenColCount && scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount) : (scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1), scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount)), scene.hasFrozen = !0, scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_d = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : null === (_c = scene.cornerHeaderGroup.firstChild) || void 0 === _c ? void 0 : _c.childrenCount) && void 0 !== _d ? _d : scene.table.frozenRowCount;
39831
39841
  }
39832
39842
  function resetFrozen(scene) {
39833
- var _a, _b, _c, _d;
39843
+ var _a, _b, _c, _d, _e, _f;
39834
39844
  if (scene.frozenColCount > scene.table.frozenColCount) {
39835
39845
  scene.bodyGroup.setAttribute("height", scene.rowHeaderGroup.attribute.height), scene.bodyGroup.setAttribute("y", scene.rowHeaderGroup.attribute.y), scene.colHeaderGroup.setAttribute("height", scene.cornerHeaderGroup.attribute.height);
39836
39846
  for (let i = 0; i < scene.frozenColCount - scene.table.frozenColCount; i++) moveColumnFromRowHeaderToBody(scene), moveColumnFromCornerHeaderToColHeader(scene), moveColumnFromLeftBottomCornerToBottom(scene);
@@ -39838,7 +39848,7 @@
39838
39848
  scene.rowHeaderGroup.setAttribute("height", scene.bodyGroup.attribute.height), scene.rowHeaderGroup.setAttribute("y", scene.bodyGroup.attribute.y), scene.cornerHeaderGroup.setAttribute("height", scene.colHeaderGroup.attribute.height);
39839
39849
  for (let i = 0; i < scene.table.frozenColCount - scene.frozenColCount; i++) moveColumnFromBodyToRowHeader(scene), moveColumnFromColHeaderToCornerHeader(scene), moveColumnFromBottomToLeftBottomCorner(scene);
39840
39850
  }
39841
- updateReactComponentContainer(scene), scene.recreateAllSelectRangeComponents(), scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : 0, scene.proxy.colStart = null !== (_d = null === (_c = scene.bodyGroup.firstChild) || void 0 === _c ? void 0 : _c.col) && void 0 !== _d ? _d : scene.table.frozenColCount, scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width), scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.table.transpose ? scene.table.options.frozenColCount ? scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1) : scene.table.options.rightFrozenColCount && scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount) : (scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1), scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount)), scene.hasFrozen = !0;
39851
+ updateReactComponentContainer(scene), scene.recreateAllSelectRangeComponents(), scene.frozenColCount = scene.table.frozenColCount, scene.frozenRowCount = null !== (_d = null !== (_b = null === (_a = scene.colHeaderGroup.firstChild) || void 0 === _a ? void 0 : _a.childrenCount) && void 0 !== _b ? _b : null === (_c = scene.cornerHeaderGroup.firstChild) || void 0 === _c ? void 0 : _c.childrenCount) && void 0 !== _d ? _d : scene.table.frozenRowCount, scene.proxy.colStart = null !== (_f = null === (_e = scene.bodyGroup.firstChild) || void 0 === _e ? void 0 : _e.col) && void 0 !== _f ? _f : scene.table.frozenColCount, scene.bodyGroup.setAttribute("x", scene.rowHeaderGroup.attribute.width), scene.colHeaderGroup.setAttribute("x", scene.cornerHeaderGroup.attribute.width), scene.updateContainer(), scene.updateBorderSizeAndPosition(), scene.isPivot || scene.table.transpose ? scene.table.options.frozenColCount ? scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1) : scene.table.options.rightFrozenColCount && scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount) : (scene.component.setFrozenColumnShadow(scene.table.frozenColCount - 1), scene.component.setRightFrozenColumnShadow(scene.table.colCount - scene.table.rightFrozenColCount)), scene.hasFrozen = !0;
39842
39852
  }
39843
39853
  function moveColumnFromBodyToRowHeader(scene) {
39844
39854
  const column = scene.bodyGroup.firstChild instanceof Group ? scene.bodyGroup.firstChild : null;
@@ -42951,76 +42961,108 @@
42951
42961
  var _a, _b;
42952
42962
  const totalHeight = this.table.getAllRowsHeight(),
42953
42963
  oldVerticalBarPos = this.scroll.verticalBarPos;
42954
- 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, {
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
42968
  event: void 0,
42956
- scrollTop: this.scroll.verticalBarPos,
42969
+ scrollTop: verticalBarPos - this.table.scenegraph.proxy.deltaY,
42957
42970
  scrollLeft: this.scroll.horizontalBarPos,
42958
42971
  scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
42959
42972
  scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
42960
42973
  viewHeight: this.table.tableNoFrameHeight,
42961
42974
  viewWidth: this.table.tableNoFrameWidth,
42962
42975
  scrollDirection: "vertical",
42963
- scrollRatioY: yRatio
42964
- }), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
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();
42965
42982
  }
42966
42983
  updateHorizontalScrollBar(xRatio) {
42967
42984
  var _a, _b;
42968
42985
  const totalWidth = this.table.getAllColsWidth(),
42969
42986
  oldHorizontalBarPos = this.scroll.horizontalBarPos;
42970
- 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, {
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
42991
  event: void 0,
42972
42992
  scrollTop: this.scroll.verticalBarPos,
42973
- scrollLeft: this.scroll.horizontalBarPos,
42993
+ scrollLeft: horizontalBarPos - this.table.scenegraph.proxy.deltaX,
42974
42994
  scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
42975
42995
  scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
42976
42996
  viewHeight: this.table.tableNoFrameHeight,
42977
42997
  viewWidth: this.table.tableNoFrameWidth,
42978
42998
  scrollDirection: "horizontal",
42979
- scrollRatioX: xRatio
42980
- }), oldHorizontalBarPos !== this.scroll.horizontalBarPos && this.checkHorizontalScrollBarEnd();
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();
42981
43005
  }
42982
43006
  setScrollTop(top, event) {
42983
43007
  let triggerEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
42984
- var _a, _b, _c;
43008
+ var _a, _b, _c, _d, _e;
42985
43009
  const totalHeight = this.table.getAllRowsHeight(),
42986
43010
  sizeTolerance = (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0;
42987
- 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);
42988
- const oldVerticalBarPos = this.scroll.verticalBarPos;
42989
- this.scroll.verticalBarPos = top, isValid$3(this.scroll.verticalBarPos) && !isNaN(this.scroll.verticalBarPos) || (this.scroll.verticalBarPos = 0), this.table.scenegraph.setY(-top);
42990
- const yRatio = top / (totalHeight - this.table.scenegraph.height);
42991
- this.table.scenegraph.component.updateVerticalScrollBarPos(yRatio), oldVerticalBarPos !== top && triggerEvent && (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
42992
- event: null == event ? void 0 : event.nativeEvent,
42993
- scrollTop: this.scroll.verticalBarPos,
42994
- scrollLeft: this.scroll.horizontalBarPos,
42995
- scrollHeight: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
42996
- scrollWidth: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
42997
- viewHeight: this.table.tableNoFrameHeight,
42998
- viewWidth: this.table.tableNoFrameWidth,
42999
- scrollDirection: "vertical",
43000
- scrollRatioY: yRatio
43001
- }), this.checkVerticalScrollBarEnd());
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();
43002
43035
  }
43003
43036
  setScrollLeft(left, event) {
43004
43037
  let triggerEvent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
43005
- var _a, _b, _c;
43038
+ var _a, _b, _c, _d, _e;
43006
43039
  this.table.scrollLeft;
43007
43040
  const totalWidth = this.table.getAllColsWidth(),
43008
43041
  sizeTolerance = (this.table.getFrozenColsWidth(), (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0);
43009
- left = Math.max(0, Math.min(left, totalWidth - this.table.scenegraph.width - sizeTolerance)), (left = Math.ceil(left)) !== this.scroll.horizontalBarPos && this.updateHoverPos(-1, -1);
43010
- const oldHorizontalBarPos = this.scroll.horizontalBarPos;
43011
- this.scroll.horizontalBarPos = left, isValid$3(this.scroll.horizontalBarPos) && !isNaN(this.scroll.horizontalBarPos) || (this.scroll.horizontalBarPos = 0), this.table.scenegraph.setX(-left);
43012
- const xRatio = left / (totalWidth - this.table.scenegraph.width);
43013
- this.table.scenegraph.component.updateHorizontalScrollBarPos(xRatio), oldHorizontalBarPos !== left && triggerEvent && (this.table.fireListeners(TABLE_EVENT_TYPE.SCROLL, {
43014
- event: null == event ? void 0 : event.nativeEvent,
43015
- scrollTop: this.scroll.verticalBarPos,
43016
- scrollLeft: this.scroll.horizontalBarPos,
43017
- scrollHeight: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
43018
- scrollWidth: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
43019
- viewHeight: this.table.tableNoFrameHeight,
43020
- viewWidth: this.table.tableNoFrameWidth,
43021
- scrollDirection: "horizontal",
43022
- scrollRatioX: xRatio
43023
- }), this.checkHorizontalScrollBarEnd());
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();
43024
43066
  }
43025
43067
  hideVerticalScrollBar() {
43026
43068
  this.table.scenegraph.component.hideVerticalScrollBar();
@@ -47481,7 +47523,7 @@
47481
47523
  constructor(container) {
47482
47524
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
47483
47525
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
47484
- if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.7", 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");
47526
+ if (super(), this.showFrozenIcon = !0, this.version = "1.17.3-alpha.8", 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
47527
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
47486
47528
  const {
47487
47529
  frozenColCount = 0,
@@ -47836,7 +47878,7 @@
47836
47878
  }
47837
47879
  }
47838
47880
  _updateSize() {
47839
- 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;
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, _4, _5;
47840
47882
  const {
47841
47883
  padding: padding
47842
47884
  } = this;
@@ -47854,20 +47896,20 @@
47854
47896
  const {
47855
47897
  canvas: canvas
47856
47898
  } = this.internalProps;
47857
- 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`);
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) ? (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));
47858
47900
  } else "node" === Env.mode && (widthP = this.canvasWidth - 1, heightP = this.canvasHeight - 1);
47859
47901
  const width = Math.floor(widthP - getVerticalScrollBarSize(this.getTheme().scrollStyle)),
47860
47902
  height = Math.floor(heightP - getHorizontalScrollBarSize(this.getTheme().scrollStyle));
47861
- if (null === (_g = this.internalProps.theme) || void 0 === _g ? void 0 : _g.frameStyle) {
47862
- const lineWidths = toBoxArray(null !== (_j = null === (_h = this.internalProps.theme.frameStyle) || void 0 === _h ? void 0 : _h.borderLineWidth) && void 0 !== _j ? _j : [null]),
47863
- shadowWidths = toBoxArray(null !== (_l = null === (_k = this.internalProps.theme.frameStyle) || void 0 === _k ? void 0 : _k.shadowBlur) && void 0 !== _l ? _l : [0]);
47864
- (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)));
47903
+ if (null === (_l = this.internalProps.theme) || void 0 === _l ? void 0 : _l.frameStyle) {
47904
+ const lineWidths = toBoxArray(null !== (_o = null === (_m = this.internalProps.theme.frameStyle) || void 0 === _m ? void 0 : _m.borderLineWidth) && void 0 !== _o ? _o : [null]),
47905
+ shadowWidths = toBoxArray(null !== (_q = null === (_p = this.internalProps.theme.frameStyle) || void 0 === _p ? void 0 : _p.shadowBlur) && void 0 !== _q ? _q : [0]);
47906
+ (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)));
47865
47907
  }
47866
47908
  }
47867
47909
  updateViewBox(newViewBox) {
47868
- var _a, _b, _c, _d, _e, _f, _g, _h;
47869
- 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,
47870
- 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,
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),
47871
47913
  newWidth = newViewBox.x2 - newViewBox.x1,
47872
47914
  newHeight = newViewBox.y2 - newViewBox.y1;
47873
47915
  this.options.viewBox = newViewBox, oldWidth !== newWidth || oldHeight !== newHeight ? this.resize() : this.scenegraph.stage.setViewBox(this.options.viewBox, !0);