@visactor/vtable-calendar 1.16.3-alpha.3 → 1.17.0-alpha.4

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.
@@ -32760,24 +32760,6 @@
32760
32760
  cursor: "pointer"
32761
32761
  };
32762
32762
  },
32763
- get loading() {
32764
- return {
32765
- type: "image",
32766
- src: "https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/VTable/media/loading-circle.gif",
32767
- width: collapse_size,
32768
- height: collapse_size,
32769
- name: "loading",
32770
- positionType: IconPosition.contentLeft,
32771
- marginLeft: 0,
32772
- marginRight: 4,
32773
- hover: {
32774
- width: collapse_size_2,
32775
- height: collapse_size_2,
32776
- bgColor: "rgba(101, 117, 168, 0.1)"
32777
- },
32778
- isGif: !0
32779
- };
32780
- },
32781
32763
  get drillDown() {
32782
32764
  return {
32783
32765
  name: "drillDown",
@@ -41073,7 +41055,7 @@
41073
41055
  const iconGraphic = this.getCell(col, row).getChildByName("collapse", !0);
41074
41056
  if (iconGraphic) {
41075
41057
  const loadingIcon = get$2()[InternalIconName.loadingIconName];
41076
- dealWithIcon(loadingIcon, iconGraphic, col, row);
41058
+ loadingIcon && dealWithIcon(loadingIcon, iconGraphic, col, row);
41077
41059
  }
41078
41060
  }
41079
41061
  temporarilyUpdateSelectRectStyle(rectAttribute) {
@@ -43831,7 +43813,7 @@
43831
43813
  !1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu) && e.preventDefault();
43832
43814
  }), table.options.canvas || handler.on(table.getContainer(), "resize", e => {
43833
43815
  var _a;
43834
- table.isReleased || 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio()), e.windowSizeNotChange || table.resize());
43816
+ 0 === e.width && 0 === e.height || ((table.autoFillWidth || table.autoFillHeight) && (null === (_a = table.editorManager) || void 0 === _a || _a.completeEdit()), isValid$3(table.options.pixelRatio) || table.setPixelRatio(getPixelRatio()), e.windowSizeNotChange || table.resize());
43835
43817
  });
43836
43818
  const regex = /<tr[^>]*>([\s\S]*?)<\/tr>/g,
43837
43819
  cellRegex = /<td[^>]*>([\s\S]*?)<\/td>/g;
@@ -46047,13 +46029,15 @@
46047
46029
  })(candCol, right);
46048
46030
  }
46049
46031
  function getTargetRowAt(absoluteY, _this) {
46032
+ var _a;
46050
46033
  if (0 === absoluteY) return {
46051
46034
  top: 0,
46052
46035
  row: 0,
46053
46036
  bottom: 0,
46054
46037
  height: 0
46055
46038
  };
46056
- const candRow = computeTargetRowByY(absoluteY, _this),
46039
+ const floorOrRound = !0 === (null === (_a = _this.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? Math.floor : Math.round,
46040
+ candRow = computeTargetRowByY(absoluteY, _this),
46057
46041
  bottom = _this.getRowsHeight(0, candRow);
46058
46042
  return absoluteY >= bottom ? ((startRow, startBottom) => {
46059
46043
  let top = startBottom - _this.getRowHeight(startRow);
@@ -46063,7 +46047,7 @@
46063
46047
  for (let row = startRow; row < rowCount; row++) {
46064
46048
  const height = _this.getRowHeight(row),
46065
46049
  bottom = top + height;
46066
- if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) return {
46050
+ if (floorOrRound(top) <= floorOrRound(absoluteY) && floorOrRound(absoluteY) < floorOrRound(bottom)) return {
46067
46051
  top: top,
46068
46052
  row: row,
46069
46053
  bottom: bottom,
@@ -46077,7 +46061,7 @@
46077
46061
  for (let row = startRow; row >= 0; row--) {
46078
46062
  const height = _this.getRowHeight(row),
46079
46063
  top = bottom - height;
46080
- if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) return {
46064
+ if (floorOrRound(top) <= floorOrRound(absoluteY) && floorOrRound(absoluteY) < floorOrRound(bottom)) return {
46081
46065
  top: top,
46082
46066
  row: row,
46083
46067
  bottom: bottom,
@@ -46095,7 +46079,7 @@
46095
46079
  right: 0,
46096
46080
  width: 0
46097
46081
  };
46098
- if (absoluteX -= _this.tableX, isConsider && absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && absoluteX < _this.tableNoFrameWidth && absoluteX <= _this.getAllColsWidth()) for (let i = 0; i < _this.rightFrozenColCount; i++) if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) return {
46082
+ if (isConsider && absoluteX > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && absoluteX < _this.tableNoFrameWidth && absoluteX <= _this.getAllColsWidth()) for (let i = 0; i < _this.rightFrozenColCount; i++) if (absoluteX > _this.tableNoFrameWidth - _this.getColsWidth(_this.colCount - i - 1, _this.colCount - 1)) return {
46099
46083
  col: _this.colCount - i - 1,
46100
46084
  left: void 0,
46101
46085
  right: void 0,
@@ -46147,8 +46131,8 @@
46147
46131
  y > _this.tableNoFrameHeight - _this.getBottomFrozenRowsHeight() && y < _this.tableNoFrameHeight && y <= _this.getAllRowsHeight() && (bottomFrozen = !0);
46148
46132
  let rightFrozen = !1;
46149
46133
  x > _this.tableNoFrameWidth - _this.getRightFrozenColsWidth() && x < _this.tableNoFrameWidth && x <= _this.getAllColsWidth() && (rightFrozen = !0);
46150
- const colInfo = getTargetColAtConsiderRightFrozen((leftFrozen || rightFrozen ? x : x + _this.scrollLeft) + _this.tableX, rightFrozen, _this),
46151
- rowInfo = getTargetRowAtConsiderBottomFrozen((topFrozen || bottomFrozen ? y : y + _this.scrollTop) + _this.tableY, bottomFrozen, _this);
46134
+ const colInfo = getTargetColAtConsiderRightFrozen(leftFrozen || rightFrozen ? x : x + _this.scrollLeft, rightFrozen, _this),
46135
+ rowInfo = getTargetRowAtConsiderBottomFrozen(topFrozen || bottomFrozen ? y : y + _this.scrollTop, bottomFrozen, _this);
46152
46136
  if (colInfo && rowInfo) {
46153
46137
  const {
46154
46138
  row: row,
@@ -46930,6 +46914,9 @@
46930
46914
  })), isFunction$5(style) || (layoutMap.isBottomFrozenRow(row) ? table.bodyBottomStyleCache.set(cacheKey, cacheStyle) : table.bodyStyleCache.set(cacheKey, cacheStyle)), customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
46931
46915
  }
46932
46916
 
46917
+ function isInteger(value) {
46918
+ return Math.floor(value) === value;
46919
+ }
46933
46920
  class Animateaaa extends ACustomAnimate {
46934
46921
  onUpdate(end, ratio, out) {
46935
46922
  if (this.from.x !== this.to.x) {
@@ -46948,18 +46935,32 @@
46948
46935
  this.ticker.setFPS(60), this.tempGraphic = createRect({});
46949
46936
  }
46950
46937
  scrollTo(position, animationOption) {
46951
- var _a, _b, _c, _d;
46938
+ var _a, _b;
46952
46939
  const from = {
46953
46940
  x: this.table.scrollLeft,
46954
46941
  y: this.table.scrollTop
46955
46942
  },
46956
- cellRect = this.table.getCellRect(null !== (_a = position.col) && void 0 !== _a ? _a : 0, null !== (_b = position.row) && void 0 !== _b ? _b : 0),
46957
- to = {
46958
- x: isNumber$4(position.col) ? cellRect.left - this.table.getFrozenColsWidth() : this.table.scrollLeft,
46959
- y: isNumber$4(position.row) ? cellRect.top - this.table.getFrozenRowsHeight() : this.table.scrollTop
46943
+ {
46944
+ col: col,
46945
+ row: row
46946
+ } = position;
46947
+ let colDecimal,
46948
+ rowDecimal,
46949
+ colInt = col,
46950
+ rowInt = row;
46951
+ isNumber$4(col) && !isInteger(col) && (colInt = Math.floor(col), colDecimal = col - colInt), isNumber$4(row) && !isInteger(row) && (rowInt = Math.floor(row), rowDecimal = row - rowInt);
46952
+ const cellRect = this.table.getCellRect(null != colInt ? colInt : 0, null != rowInt ? rowInt : 0);
46953
+ let {
46954
+ left: left,
46955
+ top: top
46956
+ } = cellRect;
46957
+ colDecimal && (left += colDecimal * cellRect.width), rowDecimal && (top += rowDecimal * cellRect.height);
46958
+ const to = {
46959
+ x: isNumber$4(col) ? left - this.table.getFrozenColsWidth() : this.table.scrollLeft,
46960
+ y: isNumber$4(row) ? top - this.table.getFrozenRowsHeight() : this.table.scrollTop
46960
46961
  },
46961
- duration = isBoolean$4(animationOption) ? animationOption ? 3e3 : 0 : null !== (_c = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _c ? _c : 3e3,
46962
- easing = isBoolean$4(animationOption) ? animationOption ? "linear" : "" : null !== (_d = null == animationOption ? void 0 : animationOption.easing) && void 0 !== _d ? _d : "linear";
46962
+ duration = isBoolean$4(animationOption) ? animationOption ? 3e3 : 0 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3,
46963
+ easing = isBoolean$4(animationOption) ? animationOption ? "linear" : "" : null !== (_b = null == animationOption ? void 0 : animationOption.easing) && void 0 !== _b ? _b : "linear";
46963
46964
  new Animate(Generator.GenAutoIncrementId(), this.timeline).bind(this.tempGraphic).play(new Animateaaa(from, to, duration, easing, {
46964
46965
  graphic: this.tempGraphic,
46965
46966
  table: this.table
@@ -46990,7 +46991,7 @@
46990
46991
  constructor(container) {
46991
46992
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46992
46993
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
46993
- if (super(), this.showFrozenIcon = !0, this.version = "1.16.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");
46994
+ if (super(), this.showFrozenIcon = !0, this.version = "1.17.0-alpha.4", 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");
46994
46995
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
46995
46996
  const {
46996
46997
  frozenColCount = 0,
@@ -47329,8 +47330,7 @@
47329
47330
  return this.internalProps.pixelRatio;
47330
47331
  }
47331
47332
  setPixelRatio(pixelRatio) {
47332
- var _a;
47333
- if (pixelRatio !== (null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.pixelRatio)) {
47333
+ if (pixelRatio !== this.internalProps.pixelRatio) {
47334
47334
  this.internalProps.pixelRatio = pixelRatio;
47335
47335
  const canvasWidth = this.canvasWidth;
47336
47336
  this.internalProps.calcWidthContext = {