@visactor/vtable-calendar 1.16.3-alpha.0 → 1.16.3-alpha.2

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.
@@ -43831,7 +43831,7 @@
43831
43831
  !1 !== (null === (_a = table.eventOptions) || void 0 === _a ? void 0 : _a.preventDefaultContextMenu) && e.preventDefault();
43832
43832
  }), table.options.canvas || handler.on(table.getContainer(), "resize", e => {
43833
43833
  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());
43834
+ 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
43835
  });
43836
43836
  const regex = /<tr[^>]*>([\s\S]*?)<\/tr>/g,
43837
43837
  cellRegex = /<td[^>]*>([\s\S]*?)<\/td>/g;
@@ -46047,13 +46047,15 @@
46047
46047
  })(candCol, right);
46048
46048
  }
46049
46049
  function getTargetRowAt(absoluteY, _this) {
46050
+ var _a;
46050
46051
  if (0 === absoluteY) return {
46051
46052
  top: 0,
46052
46053
  row: 0,
46053
46054
  bottom: 0,
46054
46055
  height: 0
46055
46056
  };
46056
- const candRow = computeTargetRowByY(absoluteY, _this),
46057
+ const floorOrRound = !0 === (null === (_a = _this.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) ? Math.floor : Math.round,
46058
+ candRow = computeTargetRowByY(absoluteY, _this),
46057
46059
  bottom = _this.getRowsHeight(0, candRow);
46058
46060
  return absoluteY >= bottom ? ((startRow, startBottom) => {
46059
46061
  let top = startBottom - _this.getRowHeight(startRow);
@@ -46063,7 +46065,7 @@
46063
46065
  for (let row = startRow; row < rowCount; row++) {
46064
46066
  const height = _this.getRowHeight(row),
46065
46067
  bottom = top + height;
46066
- if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) return {
46068
+ if (floorOrRound(top) <= floorOrRound(absoluteY) && floorOrRound(absoluteY) < floorOrRound(bottom)) return {
46067
46069
  top: top,
46068
46070
  row: row,
46069
46071
  bottom: bottom,
@@ -46077,7 +46079,7 @@
46077
46079
  for (let row = startRow; row >= 0; row--) {
46078
46080
  const height = _this.getRowHeight(row),
46079
46081
  top = bottom - height;
46080
- if (Math.round(top) <= Math.round(absoluteY) && Math.round(absoluteY) < Math.round(bottom)) return {
46082
+ if (floorOrRound(top) <= floorOrRound(absoluteY) && floorOrRound(absoluteY) < floorOrRound(bottom)) return {
46081
46083
  top: top,
46082
46084
  row: row,
46083
46085
  bottom: bottom,
@@ -46930,6 +46932,9 @@
46930
46932
  })), isFunction$5(style) || (layoutMap.isBottomFrozenRow(row) ? table.bodyBottomStyleCache.set(cacheKey, cacheStyle) : table.bodyStyleCache.set(cacheKey, cacheStyle)), customCellStyle ? mergeStyle(cacheStyle, customCellStyle) : cacheStyle;
46931
46933
  }
46932
46934
 
46935
+ function isInteger(value) {
46936
+ return Math.floor(value) === value;
46937
+ }
46933
46938
  class Animateaaa extends ACustomAnimate {
46934
46939
  onUpdate(end, ratio, out) {
46935
46940
  if (this.from.x !== this.to.x) {
@@ -46948,18 +46953,32 @@
46948
46953
  this.ticker.setFPS(60), this.tempGraphic = createRect({});
46949
46954
  }
46950
46955
  scrollTo(position, animationOption) {
46951
- var _a, _b, _c, _d;
46956
+ var _a, _b;
46952
46957
  const from = {
46953
46958
  x: this.table.scrollLeft,
46954
46959
  y: this.table.scrollTop
46955
46960
  },
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
46961
+ {
46962
+ col: col,
46963
+ row: row
46964
+ } = position;
46965
+ let colDecimal,
46966
+ rowDecimal,
46967
+ colInt = col,
46968
+ rowInt = row;
46969
+ isNumber$4(col) && !isInteger(col) && (colInt = Math.floor(col), colDecimal = col - colInt), isNumber$4(row) && !isInteger(row) && (rowInt = Math.floor(row), rowDecimal = row - rowInt);
46970
+ const cellRect = this.table.getCellRect(null != colInt ? colInt : 0, null != rowInt ? rowInt : 0);
46971
+ let {
46972
+ left: left,
46973
+ top: top
46974
+ } = cellRect;
46975
+ colDecimal && (left += colDecimal * cellRect.width), rowDecimal && (top += rowDecimal * cellRect.height);
46976
+ const to = {
46977
+ x: isNumber$4(col) ? left - this.table.getFrozenColsWidth() : this.table.scrollLeft,
46978
+ y: isNumber$4(row) ? top - this.table.getFrozenRowsHeight() : this.table.scrollTop
46960
46979
  },
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";
46980
+ duration = isBoolean$4(animationOption) ? animationOption ? 3e3 : 0 : null !== (_a = null == animationOption ? void 0 : animationOption.duration) && void 0 !== _a ? _a : 3e3,
46981
+ easing = isBoolean$4(animationOption) ? animationOption ? "linear" : "" : null !== (_b = null == animationOption ? void 0 : animationOption.easing) && void 0 !== _b ? _b : "linear";
46963
46982
  new Animate(Generator.GenAutoIncrementId(), this.timeline).bind(this.tempGraphic).play(new Animateaaa(from, to, duration, easing, {
46964
46983
  graphic: this.tempGraphic,
46965
46984
  table: this.table
@@ -46990,7 +47009,7 @@
46990
47009
  constructor(container) {
46991
47010
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
46992
47011
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
46993
- if (super(), this.showFrozenIcon = !0, this.version = "1.16.3-alpha.0", 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");
47012
+ if (super(), this.showFrozenIcon = !0, this.version = "1.16.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");
46994
47013
  !1 === (null === (_a = options.customConfig) || void 0 === _a ? void 0 : _a.imageAnonymous) && (vglobal.isImageAnonymous = !1);
46995
47014
  const {
46996
47015
  frozenColCount = 0,
@@ -47329,8 +47348,7 @@
47329
47348
  return this.internalProps.pixelRatio;
47330
47349
  }
47331
47350
  setPixelRatio(pixelRatio) {
47332
- var _a;
47333
- if (pixelRatio !== (null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.pixelRatio)) {
47351
+ if (pixelRatio !== this.internalProps.pixelRatio) {
47334
47352
  this.internalProps.pixelRatio = pixelRatio;
47335
47353
  const canvasWidth = this.canvasWidth;
47336
47354
  this.internalProps.calcWidthContext = {