@visactor/vtable-calendar 1.26.2 → 1.26.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.
@@ -39296,13 +39296,20 @@
39296
39296
  return parse$2(font);
39297
39297
  }
39298
39298
 
39299
- function getQuadProps(paddingOrigin) {
39299
+ function normalizeQuadArray(values) {
39300
+ return 0 === values.length ? [0, 0, 0, 0] : 1 === values.length ? [values[0], values[0], values[0], values[0]] : 2 === values.length ? [values[0], values[1], values[0], values[1]] : 3 === values.length ? [values[0], values[1], values[2], values[1]] : [values[0], values[1], values[2], values[3]];
39301
+ }
39302
+ function parseStringQuad(padding) {
39303
+ const tokens = padding.trim().split(/\s+/),
39304
+ values = tokens.map(token => Number.parseFloat(token)).filter(value => Number.isFinite(value));
39305
+ return values.length === tokens.length && values.length > 0 ? normalizeQuadArray(values) : [padding, padding, padding, padding];
39306
+ }
39307
+ function normalizePaddingObject(paddingOrigin) {
39300
39308
  var _a, _b, _c, _d;
39301
- if (isNumber$2(paddingOrigin) || isString$2(paddingOrigin) || isArray$5(paddingOrigin)) {
39302
- let padding = parsePadding(paddingOrigin);
39303
- return "number" == typeof padding || "string" == typeof padding ? padding = [padding, padding, padding, padding] : Array.isArray(padding) && (padding = padding.slice(0)), padding;
39304
- }
39305
- return paddingOrigin && (isFinite(paddingOrigin.bottom) || isFinite(paddingOrigin.left) || isFinite(paddingOrigin.right) || isFinite(paddingOrigin.top)) ? [null !== (_a = paddingOrigin.top) && void 0 !== _a ? _a : 0, null !== (_b = paddingOrigin.right) && void 0 !== _b ? _b : 0, null !== (_c = paddingOrigin.bottom) && void 0 !== _c ? _c : 0, null !== (_d = paddingOrigin.left) && void 0 !== _d ? _d : 0] : [0, 0, 0, 0];
39309
+ return Number.isFinite(paddingOrigin.bottom) || Number.isFinite(paddingOrigin.left) || Number.isFinite(paddingOrigin.right) || Number.isFinite(paddingOrigin.top) ? [null !== (_a = paddingOrigin.top) && void 0 !== _a ? _a : 0, null !== (_b = paddingOrigin.right) && void 0 !== _b ? _b : 0, null !== (_c = paddingOrigin.bottom) && void 0 !== _c ? _c : 0, null !== (_d = paddingOrigin.left) && void 0 !== _d ? _d : 0] : [0, 0, 0, 0];
39310
+ }
39311
+ function getQuadProps(paddingOrigin) {
39312
+ return Array.isArray(paddingOrigin) ? normalizeQuadArray(paddingOrigin.slice(0, 4)) : "number" == typeof paddingOrigin && Number.isFinite(paddingOrigin) ? [paddingOrigin, paddingOrigin, paddingOrigin, paddingOrigin] : "string" == typeof paddingOrigin ? parseStringQuad(paddingOrigin) : paddingOrigin && "object" == typeof paddingOrigin ? normalizePaddingObject(paddingOrigin) : [0, 0, 0, 0];
39306
39313
  }
39307
39314
 
39308
39315
  const TYPE_PAREN = 0,
@@ -40329,7 +40336,7 @@
40329
40336
  col: null !== (_b = null == range ? void 0 : range.start.col) && void 0 !== _b ? _b : col,
40330
40337
  row: null !== (_c = null == range ? void 0 : range.start.row) && void 0 !== _c ? _c : row,
40331
40338
  dataValue: table.getCellOriginValue(col, row),
40332
- value: table.getCellValue(col, row) || "",
40339
+ value: table.getCellValue(col, row),
40333
40340
  rect: {
40334
40341
  left: 0,
40335
40342
  top: 0,
@@ -40351,7 +40358,7 @@
40351
40358
  col: col,
40352
40359
  row: row,
40353
40360
  dataValue: table.getCellOriginValue(col, row),
40354
- value: table.getCellValue(col, row) || "",
40361
+ value: table.getCellValue(col, row),
40355
40362
  rect: {
40356
40363
  left: 0,
40357
40364
  top: 0,
@@ -42340,7 +42347,7 @@
42340
42347
  col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
42341
42348
  row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
42342
42349
  dataValue: table.getCellOriginValue(col, row),
42343
- value: table.getCellValue(col, row) || "",
42350
+ value: table.getCellValue(col, row),
42344
42351
  rect: getCellRect$1(col, row, table),
42345
42352
  table: table,
42346
42353
  originCol: col,
@@ -43249,6 +43256,17 @@
43249
43256
  }
43250
43257
  }
43251
43258
 
43259
+ function getBodyHorizontalScrollRange(table) {
43260
+ var _a, _b, _c, _d;
43261
+ const totalWidth = table.getAllColsWidth(),
43262
+ frozenColsWidth = table.getFrozenColsWidth(),
43263
+ rightFrozenColsWidth = table.getRightFrozenColsWidth(),
43264
+ frozenColsContentWidth = null !== (_b = null === (_a = table.getFrozenColsContentWidth) || void 0 === _a ? void 0 : _a.call(table)) && void 0 !== _b ? _b : frozenColsWidth,
43265
+ rightFrozenColsContentWidth = null !== (_d = null === (_c = table.getRightFrozenColsContentWidth) || void 0 === _c ? void 0 : _c.call(table)) && void 0 !== _d ? _d : rightFrozenColsWidth,
43266
+ bodyViewportWidth = table.tableNoFrameWidth - frozenColsWidth - rightFrozenColsWidth,
43267
+ bodyContentWidth = totalWidth - frozenColsContentWidth - rightFrozenColsContentWidth;
43268
+ return Math.max(0, bodyContentWidth - bodyViewportWidth);
43269
+ }
43252
43270
  function getColX(col, table, isRightFrozen) {
43253
43271
  var _a, _b, _c, _d, _e, _f;
43254
43272
  if (isRightFrozen) return Math.min(table.tableNoFrameWidth, table.getAllColsWidth()) - table.getColsWidth(col, table.colCount - 1) + (null !== (_b = null === (_a = table.getRightFrozenColsScrollLeft) || void 0 === _a ? void 0 : _a.call(table)) && void 0 !== _b ? _b : 0);
@@ -43541,17 +43559,18 @@
43541
43559
  rightFrozenColsWidth = this.table.getRightFrozenColsWidth(),
43542
43560
  rightFrozenColsContentWidth = null !== (_m = null === (_l = (_k = this.table).getRightFrozenColsContentWidth) || void 0 === _l ? void 0 : _l.call(_k)) && void 0 !== _m ? _m : rightFrozenColsWidth,
43543
43561
  hoverOn = this.table.theme.scrollStyle.hoverOn,
43544
- sizeTolerance = (null === (_o = this.table.options.customConfig) || void 0 === _o ? void 0 : _o._disableColumnAndRowSizeRound) ? 1 : 0;
43545
- if (totalWidth > tableWidth + sizeTolerance) {
43546
- const y = Math.min(tableHeight, totalHeight),
43547
- bodyViewportWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth,
43548
- bodyContentWidth = totalWidth - frozenColsContentWidth - rightFrozenColsContentWidth,
43562
+ sizeTolerance = (null === (_o = this.table.options.customConfig) || void 0 === _o ? void 0 : _o._disableColumnAndRowSizeRound) ? 1 : 0,
43563
+ bodyScrollRange = getBodyHorizontalScrollRange(this.table),
43564
+ y = Math.min(tableHeight, totalHeight);
43565
+ let attrY = 0;
43566
+ 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);
43567
+ const ignoreFrozenCols = null !== (_q = null === (_p = this.table.theme.scrollStyle) || void 0 === _p ? void 0 : _p.ignoreFrozenCols) && void 0 !== _q && _q;
43568
+ if (bodyScrollRange > sizeTolerance) {
43569
+ const bodyViewportWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth,
43570
+ bodyContentWidth = bodyViewportWidth + bodyScrollRange,
43549
43571
  rangeEnd = bodyContentWidth > 0 ? Math.max(.05, bodyViewportWidth / bodyContentWidth) : 1;
43550
- let attrY = 0;
43551
- 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);
43552
43572
  let hScrollBarx = frozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x),
43553
43573
  hScrollBarWidth = tableWidth - frozenColsWidth - rightFrozenColsWidth;
43554
- const ignoreFrozenCols = null !== (_q = null === (_p = this.table.theme.scrollStyle) || void 0 === _p ? void 0 : _p.ignoreFrozenCols) && void 0 !== _q && _q;
43555
43574
  ignoreFrozenCols ? (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({
43556
43575
  x: hScrollBarx,
43557
43576
  y: attrY,
@@ -43564,61 +43583,51 @@
43564
43583
  x: bounds.x1,
43565
43584
  y: bounds.y1
43566
43585
  }, "always" === horizontalVisible && this.hScrollBar.showAll();
43567
- const frozenScrollable = this.table.options.scrollFrozenCols && this.table.getFrozenColsOffset() > 0;
43568
- if (!ignoreFrozenCols && frozenScrollable) {
43569
- const frozenRangeEnd = Math.max(.05, frozenColsWidth / frozenColsContentWidth),
43570
- x = hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x;
43571
- this.frozenHScrollBar.setAttributes({
43572
- x: x,
43573
- y: attrY,
43574
- width: frozenColsWidth,
43575
- range: [0, frozenRangeEnd],
43576
- visible: "always" === horizontalVisible
43577
- });
43578
- const bounds = this.frozenHScrollBar.AABBBounds && this.frozenHScrollBar.globalAABBBounds;
43579
- this.frozenHScrollBar._viewPosition = {
43580
- x: bounds.x1,
43581
- y: bounds.y1
43582
- }, "always" === horizontalVisible && this.frozenHScrollBar.showAll();
43583
- } else this.frozenHScrollBar.setAttributes({
43584
- x: 2 * -this.table.tableNoFrameWidth,
43585
- y: 2 * -this.table.tableNoFrameHeight,
43586
- width: 0,
43587
- visible: !1
43588
- });
43589
- const rightFrozenScrollable = this.table.options.scrollRightFrozenCols && this.table.getRightFrozenColsOffset() > 0;
43590
- if (!ignoreFrozenCols && rightFrozenScrollable) {
43591
- const rightFrozenRangeEnd = Math.max(.05, rightFrozenColsWidth / rightFrozenColsContentWidth),
43592
- x = tableWidth - rightFrozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x);
43593
- this.rightFrozenHScrollBar.setAttributes({
43594
- x: x,
43595
- y: attrY,
43596
- width: rightFrozenColsWidth,
43597
- range: [0, rightFrozenRangeEnd],
43598
- visible: "always" === horizontalVisible
43599
- });
43600
- const bounds = this.rightFrozenHScrollBar.AABBBounds && this.rightFrozenHScrollBar.globalAABBBounds;
43601
- this.rightFrozenHScrollBar._viewPosition = {
43602
- x: bounds.x1,
43603
- y: bounds.y1
43604
- }, "always" === horizontalVisible && this.rightFrozenHScrollBar.showAll();
43605
- } else this.rightFrozenHScrollBar.setAttributes({
43606
- x: 2 * -this.table.tableNoFrameWidth,
43607
- y: 2 * -this.table.tableNoFrameHeight,
43608
- width: 0,
43609
- visible: !1
43610
- });
43611
43586
  } else this.hScrollBar.setAttributes({
43612
43587
  x: 2 * -this.table.tableNoFrameWidth,
43613
43588
  y: 2 * -this.table.tableNoFrameHeight,
43614
43589
  width: 0,
43615
43590
  visible: !1
43616
- }), this.frozenHScrollBar.setAttributes({
43591
+ });
43592
+ const frozenScrollable = this.table.options.scrollFrozenCols && this.table.getFrozenColsOffset() > 0;
43593
+ if (!ignoreFrozenCols && frozenScrollable) {
43594
+ const frozenRangeEnd = Math.max(.05, frozenColsWidth / frozenColsContentWidth),
43595
+ x = hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x;
43596
+ this.frozenHScrollBar.setAttributes({
43597
+ x: x,
43598
+ y: attrY,
43599
+ width: frozenColsWidth,
43600
+ range: [0, frozenRangeEnd],
43601
+ visible: "always" === horizontalVisible
43602
+ });
43603
+ const bounds = this.frozenHScrollBar.AABBBounds && this.frozenHScrollBar.globalAABBBounds;
43604
+ this.frozenHScrollBar._viewPosition = {
43605
+ x: bounds.x1,
43606
+ y: bounds.y1
43607
+ }, "always" === horizontalVisible && this.frozenHScrollBar.showAll();
43608
+ } else this.frozenHScrollBar.setAttributes({
43617
43609
  x: 2 * -this.table.tableNoFrameWidth,
43618
43610
  y: 2 * -this.table.tableNoFrameHeight,
43619
43611
  width: 0,
43620
43612
  visible: !1
43621
- }), this.rightFrozenHScrollBar.setAttributes({
43613
+ });
43614
+ const rightFrozenScrollable = this.table.options.scrollRightFrozenCols && this.table.getRightFrozenColsOffset() > 0;
43615
+ if (!ignoreFrozenCols && rightFrozenScrollable) {
43616
+ const rightFrozenRangeEnd = Math.max(.05, rightFrozenColsWidth / rightFrozenColsContentWidth),
43617
+ x = tableWidth - rightFrozenColsWidth + (hoverOn ? 0 : this.table.scenegraph.tableGroup.attribute.x);
43618
+ this.rightFrozenHScrollBar.setAttributes({
43619
+ x: x,
43620
+ y: attrY,
43621
+ width: rightFrozenColsWidth,
43622
+ range: [0, rightFrozenRangeEnd],
43623
+ visible: "always" === horizontalVisible
43624
+ });
43625
+ const bounds = this.rightFrozenHScrollBar.AABBBounds && this.rightFrozenHScrollBar.globalAABBBounds;
43626
+ this.rightFrozenHScrollBar._viewPosition = {
43627
+ x: bounds.x1,
43628
+ y: bounds.y1
43629
+ }, "always" === horizontalVisible && this.rightFrozenHScrollBar.showAll();
43630
+ } else this.rightFrozenHScrollBar.setAttributes({
43622
43631
  x: 2 * -this.table.tableNoFrameWidth,
43623
43632
  y: 2 * -this.table.tableNoFrameHeight,
43624
43633
  width: 0,
@@ -46519,7 +46528,7 @@
46519
46528
  col: null !== (_b = null == cellRange ? void 0 : cellRange.start.col) && void 0 !== _b ? _b : col,
46520
46529
  row: null !== (_c = null == cellRange ? void 0 : cellRange.start.row) && void 0 !== _c ? _c : row,
46521
46530
  dataValue: table.getCellOriginValue(col, row),
46522
- value: table.getCellValue(col, row) || "",
46531
+ value: table.getCellValue(col, row),
46523
46532
  rect: getCellRect(col, row, table),
46524
46533
  table: table,
46525
46534
  originCol: col,
@@ -48766,7 +48775,8 @@
48766
48775
  for (let col = table.colCount - currentRightFrozenCol - 1; col >= table.colCount - distRightFrozenCol; col--) {
48767
48776
  insertBefore(rightFrozenGroup, scene.getColGroup(col), rightFrozenGroup.firstChild);
48768
48777
  insertBefore(rightTopCornerGroup, scene.getColGroup(col, !0), rightTopCornerGroup.firstChild);
48769
- insertBefore(rightBottomCornerGroup, scene.getColGroupInBottom(col), rightBottomCornerGroup.firstChild);
48778
+ const bottomColGroup = scene.getColGroupInBottom(col);
48779
+ bottomColGroup && insertBefore(rightBottomCornerGroup, bottomColGroup, rightBottomCornerGroup.firstChild);
48770
48780
  }
48771
48781
  let x = 0;
48772
48782
  rightFrozenGroup.forEachChildren(columnGroup => {
@@ -48783,7 +48793,10 @@
48783
48793
  const headerColGroup = scene.getColGroupInRightTopCorner(col);
48784
48794
  headerColGroup.setAttribute("x", colHeaderGroup.lastChild.attribute.x + table.getColWidth(colHeaderGroup.lastChild.col)), colHeaderGroup.appendChild(headerColGroup);
48785
48795
  const bottomColGroup = scene.getColGroupInRightBottomCorner(col);
48786
- bottomColGroup.setAttribute("x", bottomFrozenGroup.lastChild.attribute.x + table.getColWidth(bottomFrozenGroup.lastChild.col)), bottomFrozenGroup.appendChild(bottomColGroup);
48796
+ if (bottomColGroup) {
48797
+ const lastBottomColGroup = bottomFrozenGroup.lastChild;
48798
+ bottomColGroup.setAttribute("x", lastBottomColGroup ? lastBottomColGroup.attribute.x + table.getColWidth(lastBottomColGroup.col) : 0), bottomFrozenGroup.appendChild(bottomColGroup);
48799
+ }
48787
48800
  }
48788
48801
  let x = 0;
48789
48802
  rightFrozenGroup.forEachChildren(columnGroup => {
@@ -50171,7 +50184,7 @@
50171
50184
  setBodyAndColHeaderX(x) {
50172
50185
  const firstBodyCol = this.bodyGroup.firstChild;
50173
50186
  let lastBodyCol = this.bodyGroup.lastChild;
50174
- lastBodyCol && "group" !== lastBodyCol.type && (lastBodyCol = lastBodyCol._prev), 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.bodySelectGroup.setAttribute("x", this.bodyGroup.attribute.x), this.colHeaderSelectGroup.setAttribute("x", this.colHeaderGroup.attribute.x), this.rowHeaderSelectGroup.setAttribute("x", this.rowHeaderGroup.attribute.x), this.cornerHeaderSelectGroup.setAttribute("x", this.cornerHeaderGroup.attribute.x), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bottomFrozenSelectGroup.setAttribute("x", this.bottomFrozenGroup.attribute.x), this.leftBottomCornerSelectGroup.setAttribute("x", this.leftBottomCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && (this.rightFrozenSelectGroup.setAttribute("x", this.rightFrozenGroup.attribute.x), this.rightTopCornerSelectGroup.setAttribute("x", this.rightTopCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0 && this.rightBottomCornerSelectGroup.setAttribute("x", this.rightBottomCornerGroup.attribute.x), this.updateNextFrame());
50187
+ lastBodyCol && "group" !== lastBodyCol.type && (lastBodyCol = lastBodyCol._prev), 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.options.scrollFrozenCols && x > 0 && (x = 0), 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.bodySelectGroup.setAttribute("x", this.bodyGroup.attribute.x), this.colHeaderSelectGroup.setAttribute("x", this.colHeaderGroup.attribute.x), this.rowHeaderSelectGroup.setAttribute("x", this.rowHeaderGroup.attribute.x), this.cornerHeaderSelectGroup.setAttribute("x", this.cornerHeaderGroup.attribute.x), this.table.bottomFrozenRowCount > 0 && (this.bottomFrozenGroup.setAttribute("x", this.table.getFrozenColsWidth() + x), this.bottomFrozenSelectGroup.setAttribute("x", this.bottomFrozenGroup.attribute.x), this.leftBottomCornerSelectGroup.setAttribute("x", this.leftBottomCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && (this.rightFrozenSelectGroup.setAttribute("x", this.rightFrozenGroup.attribute.x), this.rightTopCornerSelectGroup.setAttribute("x", this.rightTopCornerGroup.attribute.x)), this.table.rightFrozenColCount > 0 && this.table.bottomFrozenRowCount > 0 && this.rightBottomCornerSelectGroup.setAttribute("x", this.rightBottomCornerGroup.attribute.x), this.updateNextFrame());
50175
50188
  }
50176
50189
  afterScenegraphCreated() {
50177
50190
  var _a, _b;
@@ -50218,11 +50231,11 @@
50218
50231
  let rowHeaderWidth = 0;
50219
50232
  this.rowHeaderGroup.forEachChildrenSkipChild(column => {
50220
50233
  rowHeaderWidth += column.attribute.width;
50221
- }), this.rowHeaderGroup.setAttribute("width", rowHeaderWidth);
50234
+ }), table.options.scrollFrozenCols && (rowHeaderWidth = table.getFrozenColsWidth()), this.rowHeaderGroup.setAttribute("width", rowHeaderWidth);
50222
50235
  let cornerHeaderWidth = 0;
50223
50236
  this.cornerHeaderGroup.forEachChildrenSkipChild(column => {
50224
50237
  cornerHeaderWidth += column.attribute.width;
50225
- }), this.cornerHeaderGroup.setAttribute("width", cornerHeaderWidth), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width), this.rowHeaderGroup.setAttribute("y", this.cornerHeaderGroup.attribute.height), this.bodyGroup.setAttributes({
50238
+ }), table.options.scrollFrozenCols && (cornerHeaderWidth = table.getFrozenColsWidth()), this.cornerHeaderGroup.setAttribute("width", cornerHeaderWidth), this.colHeaderGroup.setAttribute("x", this.cornerHeaderGroup.attribute.width), this.rowHeaderGroup.setAttribute("y", this.cornerHeaderGroup.attribute.height), this.bodyGroup.setAttributes({
50226
50239
  x: this.rowHeaderGroup.attribute.width,
50227
50240
  y: this.colHeaderGroup.attribute.height
50228
50241
  });
@@ -52401,12 +52414,9 @@
52401
52414
  }), oldVerticalBarPos !== this.scroll.verticalBarPos && this.checkVerticalScrollBarEnd();
52402
52415
  }
52403
52416
  updateHorizontalScrollBar(xRatio) {
52404
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
52405
- const totalWidth = this.table.getAllColsWidth(),
52406
- oldHorizontalBarPos = this.scroll.horizontalBarPos,
52407
- frozenOffset = null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0,
52408
- rightFrozenOffset = null !== (_f = null === (_e = (_d = this.table).getRightFrozenColsOffset) || void 0 === _e ? void 0 : _e.call(_d)) && void 0 !== _f ? _f : 0,
52409
- scrollRange = Math.max(0, totalWidth - this.table.scenegraph.width - frozenOffset - rightFrozenOffset);
52417
+ var _a, _b, _c, _d;
52418
+ const oldHorizontalBarPos = this.scroll.horizontalBarPos,
52419
+ scrollRange = getBodyHorizontalScrollRange(this.table);
52410
52420
  let horizontalBarPos = Math.ceil(xRatio * scrollRange);
52411
52421
  isValid$1(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
52412
52422
  const dx = horizontalBarPos - this.table.scenegraph.proxy.deltaX - oldHorizontalBarPos;
@@ -52414,8 +52424,8 @@
52414
52424
  event: void 0,
52415
52425
  scrollTop: this.scroll.verticalBarPos,
52416
52426
  scrollLeft: horizontalBarPos - this.table.scenegraph.proxy.deltaX,
52417
- scrollHeight: null === (_g = this.table.theme.scrollStyle) || void 0 === _g ? void 0 : _g.width,
52418
- scrollWidth: null === (_h = this.table.theme.scrollStyle) || void 0 === _h ? void 0 : _h.width,
52427
+ scrollHeight: null === (_a = this.table.theme.scrollStyle) || void 0 === _a ? void 0 : _a.width,
52428
+ scrollWidth: null === (_b = this.table.theme.scrollStyle) || void 0 === _b ? void 0 : _b.width,
52419
52429
  viewHeight: this.table.tableNoFrameHeight,
52420
52430
  viewWidth: this.table.tableNoFrameWidth,
52421
52431
  scrollDirection: "horizontal",
@@ -52428,8 +52438,8 @@
52428
52438
  event: void 0,
52429
52439
  scrollTop: this.scroll.verticalBarPos,
52430
52440
  scrollLeft: this.scroll.horizontalBarPos,
52431
- scrollHeight: null === (_j = this.table.theme.scrollStyle) || void 0 === _j ? void 0 : _j.width,
52432
- scrollWidth: null === (_k = this.table.theme.scrollStyle) || void 0 === _k ? void 0 : _k.width,
52441
+ scrollHeight: null === (_c = this.table.theme.scrollStyle) || void 0 === _c ? void 0 : _c.width,
52442
+ scrollWidth: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
52433
52443
  viewHeight: this.table.tableNoFrameHeight,
52434
52444
  viewWidth: this.table.tableNoFrameWidth,
52435
52445
  scrollDirection: "horizontal",
@@ -52481,18 +52491,15 @@
52481
52491
  }), oldVerticalBarPos !== top && triggerEvent && this.checkVerticalScrollBarEnd();
52482
52492
  }
52483
52493
  setScrollLeft(left, event, triggerEvent = !0) {
52484
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
52494
+ var _a, _b, _c, _d, _e, _f, _g;
52485
52495
  if (!this.table || !this.table.scenegraph) return;
52486
52496
  this.table.scrollLeft;
52487
- const totalWidth = this.table.getAllColsWidth(),
52488
- frozenOffset = null !== (_c = null === (_b = (_a = this.table).getFrozenColsOffset) || void 0 === _b ? void 0 : _b.call(_a)) && void 0 !== _c ? _c : 0,
52489
- rightFrozenOffset = null !== (_f = null === (_e = (_d = this.table).getRightFrozenColsOffset) || void 0 === _e ? void 0 : _e.call(_d)) && void 0 !== _f ? _f : 0,
52490
- scrollRange = Math.max(0, totalWidth - this.table.scenegraph.width - frozenOffset - rightFrozenOffset),
52491
- sizeTolerance = (null === (_g = this.table.options.customConfig) || void 0 === _g ? void 0 : _g._disableColumnAndRowSizeRound) ? 1 : 0;
52497
+ const scrollRange = getBodyHorizontalScrollRange(this.table),
52498
+ sizeTolerance = (null === (_a = this.table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? 1 : 0;
52492
52499
  left = Math.max(0, Math.min(left, scrollRange - sizeTolerance)), left = Math.ceil(left);
52493
52500
  const oldHorizontalBarPos = this.scroll.horizontalBarPos,
52494
52501
  xRatio = scrollRange ? left / scrollRange : 0;
52495
- if ((oldHorizontalBarPos !== left || !0 === (null === (_j = null === (_h = this.table.options) || void 0 === _h ? void 0 : _h.customConfig) || void 0 === _j ? void 0 : _j.scrollEventAlwaysTrigger)) && triggerEvent) {
52502
+ 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) {
52496
52503
  let horizontalBarPos = left;
52497
52504
  isValid$1(horizontalBarPos) && !isNaN(horizontalBarPos) || (horizontalBarPos = 0);
52498
52505
  const dx = horizontalBarPos - oldHorizontalBarPos;
@@ -52500,8 +52507,8 @@
52500
52507
  event: null == event ? void 0 : event.nativeEvent,
52501
52508
  scrollTop: this.scroll.verticalBarPos,
52502
52509
  scrollLeft: horizontalBarPos,
52503
- scrollHeight: null === (_k = this.table.theme.scrollStyle) || void 0 === _k ? void 0 : _k.width,
52504
- scrollWidth: null === (_l = this.table.theme.scrollStyle) || void 0 === _l ? void 0 : _l.width,
52510
+ scrollHeight: null === (_d = this.table.theme.scrollStyle) || void 0 === _d ? void 0 : _d.width,
52511
+ scrollWidth: null === (_e = this.table.theme.scrollStyle) || void 0 === _e ? void 0 : _e.width,
52505
52512
  viewHeight: this.table.tableNoFrameHeight,
52506
52513
  viewWidth: this.table.tableNoFrameWidth,
52507
52514
  scrollDirection: "horizontal",
@@ -52518,8 +52525,8 @@
52518
52525
  event: null == event ? void 0 : event.nativeEvent,
52519
52526
  scrollTop: this.scroll.verticalBarPos,
52520
52527
  scrollLeft: this.scroll.horizontalBarPos,
52521
- scrollHeight: null === (_m = this.table.theme.scrollStyle) || void 0 === _m ? void 0 : _m.width,
52522
- scrollWidth: null === (_o = this.table.theme.scrollStyle) || void 0 === _o ? void 0 : _o.width,
52528
+ scrollHeight: null === (_f = this.table.theme.scrollStyle) || void 0 === _f ? void 0 : _f.width,
52529
+ scrollWidth: null === (_g = this.table.theme.scrollStyle) || void 0 === _g ? void 0 : _g.width,
52523
52530
  viewHeight: this.table.tableNoFrameHeight,
52524
52531
  viewWidth: this.table.tableNoFrameWidth,
52525
52532
  scrollDirection: "horizontal",
@@ -53278,70 +53285,73 @@
53278
53285
  });
53279
53286
  }), table.scenegraph.tableGroup.addEventListener("pointerup", e => {
53280
53287
  var _a, _b, _c, _d, _e, _f, _g, _h;
53281
- if (0 === e.button) {
53282
- if ("grabing" === stateManager.interactionState) {
53283
- if (stateManager.updateInteractionState(InteractionState.default), stateManager.isResizeCol()) endResizeCol(table);else if (stateManager.isResizeRow()) endResizeRow(table);else if (stateManager.isMoveCol()) {
53284
- const endMoveColSuccess = table.stateManager.endMoveCol();
53285
- fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
53286
- } else if (stateManager.isSelecting()) {
53287
- table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
53288
- const eventArgsSet = getEventArgsSet(e);
53289
- if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
53290
- const cellsEvent = {
53291
- event: e.nativeEvent,
53292
- cells: [],
53293
- col: eventArgsSet.eventArgs.target.col,
53294
- row: eventArgsSet.eventArgs.target.row,
53295
- scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
53296
- target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
53297
- mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
53298
- };
53299
- cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
53300
- }
53301
- }
53302
- } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
53303
- if (!table.eventManager.isDraging) {
53288
+ if (0 !== e.button) return;
53289
+ const endedResizeCol = stateManager.isResizeCol(),
53290
+ endedResizeRow = stateManager.isResizeRow(),
53291
+ endedMoveCol = stateManager.isMoveCol(),
53292
+ shouldSkipClickCell = endedResizeCol || endedResizeRow;
53293
+ if ("grabing" === stateManager.interactionState) {
53294
+ if (stateManager.updateInteractionState(InteractionState.default), endedResizeCol) endResizeCol(table);else if (endedResizeRow) endResizeRow(table);else if (endedMoveCol) {
53295
+ const endMoveColSuccess = table.stateManager.endMoveCol();
53296
+ fireMoveColEventListeners(table, endMoveColSuccess, e.nativeEvent);
53297
+ } else if (stateManager.isSelecting()) {
53298
+ table.stateManager.endSelectCells(), table.stateManager.isFillHandle() && table.stateManager.endFillSelect();
53304
53299
  const eventArgsSet = getEventArgsSet(e);
53305
- if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
53306
- const {
53307
- col: col,
53308
- row: row
53309
- } = eventArgsSet.eventArgs,
53310
- cellInfo = table.getCellInfo(col, row);
53311
- let icon, position;
53312
- if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
53313
- const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
53314
- iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
53315
- }
53316
- const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
53300
+ if (table.eventManager.isDraging && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END)) {
53301
+ const cellsEvent = {
53317
53302
  event: e.nativeEvent,
53318
- federatedEvent: e,
53319
53303
  cells: [],
53320
- targetIcon: icon ? {
53321
- name: icon.name,
53322
- position: position,
53323
- funcType: icon.attribute.funcType
53324
- } : void 0,
53325
- target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
53326
- mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
53327
- });
53328
- table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
53304
+ col: eventArgsSet.eventArgs.target.col,
53305
+ row: eventArgsSet.eventArgs.target.row,
53306
+ scaleRatio: table.canvas.getBoundingClientRect().width / table.canvas.offsetWidth,
53307
+ target: null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target,
53308
+ mergeCellInfo: null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.mergeInfo
53309
+ };
53310
+ cellsEvent.cells = table.getSelectedCellInfos(), table.fireListeners(TABLE_EVENT_TYPE.DRAG_SELECT_END, cellsEvent);
53329
53311
  }
53330
53312
  }
53331
- if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
53332
- const eventArgsSet = getEventArgsSet(e);
53333
- eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
53334
- col: eventArgsSet.eventArgs.col,
53335
- row: eventArgsSet.eventArgs.row,
53313
+ } else stateManager.interactionState === InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.default);
53314
+ if (!table.eventManager.isDraging && !shouldSkipClickCell) {
53315
+ const eventArgsSet = getEventArgsSet(e);
53316
+ if (!eventManager.isTouchMove && 0 === e.button && eventArgsSet.eventArgs && table.hasListeners(TABLE_EVENT_TYPE.CLICK_CELL)) {
53317
+ const {
53318
+ col: col,
53319
+ row: row
53320
+ } = eventArgsSet.eventArgs,
53321
+ cellInfo = table.getCellInfo(col, row);
53322
+ let icon, position;
53323
+ if (null === (_c = eventArgsSet.eventArgs) || void 0 === _c ? void 0 : _c.target) {
53324
+ const iconInfo = getIconAndPositionFromTarget(null === (_d = eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target);
53325
+ iconInfo && (icon = iconInfo.icon, position = iconInfo.position);
53326
+ }
53327
+ const cellsEvent = Object.assign(Object.assign({}, cellInfo), {
53336
53328
  event: e.nativeEvent,
53337
- target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
53338
- mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
53329
+ federatedEvent: e,
53330
+ cells: [],
53331
+ targetIcon: icon ? {
53332
+ name: icon.name,
53333
+ position: position,
53334
+ funcType: icon.attribute.funcType
53335
+ } : void 0,
53336
+ target: null === (_e = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _e ? void 0 : _e.target,
53337
+ mergeCellInfo: null === (_f = eventArgsSet.eventArgs) || void 0 === _f ? void 0 : _f.mergeInfo
53339
53338
  });
53339
+ table.fireListeners(TABLE_EVENT_TYPE.CLICK_CELL, cellsEvent);
53340
53340
  }
53341
- setTimeout(() => {
53342
- eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
53343
- }, 0);
53344
53341
  }
53342
+ if (table.hasListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL)) {
53343
+ const eventArgsSet = getEventArgsSet(e);
53344
+ eventArgsSet.eventArgs && table.fireListeners(TABLE_EVENT_TYPE.MOUSEUP_CELL, {
53345
+ col: eventArgsSet.eventArgs.col,
53346
+ row: eventArgsSet.eventArgs.row,
53347
+ event: e.nativeEvent,
53348
+ target: null === (_g = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _g ? void 0 : _g.target,
53349
+ mergeCellInfo: null === (_h = eventArgsSet.eventArgs) || void 0 === _h ? void 0 : _h.mergeInfo
53350
+ });
53351
+ }
53352
+ setTimeout(() => {
53353
+ eventManager.isDown = !1, eventManager.isTouchdown = !1, eventManager.isTouchMove = !1, eventManager.isDraging = !1, eventManager.touchMovePoints = [];
53354
+ }, 0);
53345
53355
  }), table.scenegraph.tableGroup.addEventListener("rightdown", e => {
53346
53356
  var _a, _b, _c, _d, _e, _f, _g, _h;
53347
53357
  const eventArgsSet = getEventArgsSet(e);
@@ -57159,7 +57169,7 @@
57159
57169
  }
57160
57170
  constructor(container, options = {}) {
57161
57171
  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;
57162
- if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.2", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
57172
+ if (super(), this.showFrozenIcon = !0, this._scrollToRowCorrectTimer = null, this._tableBorderWidth_left = 0, this._tableBorderWidth_right = 0, this._tableBorderWidth_top = 0, this._tableBorderWidth_bottom = 0, this.version = "1.26.3", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "undefined" != typeof window) {
57163
57173
  const g = window;
57164
57174
  g[this.id] = this;
57165
57175
  const registry = g.__vtable__ || (g.__vtable__ = {
@@ -59372,16 +59382,17 @@
59372
59382
  }
59373
59383
  scrollToRow(row, animationOption) {
59374
59384
  var _a;
59375
- const targetRow = Math.min(Math.max(Math.floor(row), 0), this.rowCount - 1);
59385
+ const targetRow = Math.min(Math.max(row, 0), this.rowCount - 1),
59386
+ targetRowInt = Math.floor(targetRow);
59376
59387
  if (this.clearCorrectTimer(), !animationOption) return this.scrollToCell({
59377
- row: targetRow
59378
- }), void this._scheduleScrollToRowCorrect(targetRow);
59388
+ row: targetRowInt
59389
+ }), void this._scheduleScrollToRowCorrect(targetRowInt);
59379
59390
  const duration = isBoolean$2(animationOption) ? 3e3 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3;
59380
59391
  this.animationManager.scrollTo({
59381
59392
  row: targetRow
59382
- }, animationOption), this._scrollToRowCorrectTimer = setTimeout(() => {
59383
- this.scrollToRow(targetRow, !1);
59384
- }, duration);
59393
+ }, animationOption), targetRowInt === targetRow && (this._scrollToRowCorrectTimer = setTimeout(() => {
59394
+ this.scrollToRow(targetRowInt, !1);
59395
+ }, duration));
59385
59396
  }
59386
59397
  scrollToCol(col, animationOption) {
59387
59398
  animationOption ? this.animationManager.scrollTo({