@visactor/vtable-calendar 1.16.3-alpha.1 → 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.
@@ -36132,7 +36132,7 @@
36132
36132
  }
36133
36133
  }
36134
36134
  activate(table) {
36135
- var _a, _b, _c, _d, _e;
36135
+ var _a, _b, _c, _d;
36136
36136
  this.active = !0;
36137
36137
  const {
36138
36138
  col: col,
@@ -36150,7 +36150,7 @@
36150
36150
  y1: y1 - table.scrollTop,
36151
36151
  y2: y2 - table.scrollTop
36152
36152
  });
36153
- null === (_a = this.activeChartInstance) || void 0 === _a || _a.release(), this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge$1({}, this.attribute.tableChartOption, {
36153
+ this.activeChartInstance = new this.attribute.ClassType(this.attribute.spec, merge$1({}, this.attribute.tableChartOption, {
36154
36154
  renderCanvas: this.attribute.canvas,
36155
36155
  mode: "desktop-browser",
36156
36156
  canvasControled: !1,
@@ -36178,7 +36178,7 @@
36178
36178
  const chartStage = this.activeChartInstance.getStage(),
36179
36179
  matrix = this.globalTransMatrix.clone(),
36180
36180
  stageMatrix = this.stage.window.getViewBoxTransform();
36181
- matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), this.activeChartInstance.renderSync(), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, this.activeChartInstance), this.activeChartInstance.on("click", params => {
36181
+ matrix.multiply(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), chartStage.window.setViewBoxTransform && chartStage.window.setViewBoxTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), this.activeChartInstance.renderSync(), null === (_b = null === (_a = table.internalProps.layoutMap) || void 0 === _a ? void 0 : _a.updateDataStateToActiveChartInstance) || void 0 === _b || _b.call(_a, this.activeChartInstance), this.activeChartInstance.on("click", params => {
36182
36182
  var _a;
36183
36183
  !1 === (null === (_a = this.attribute.spec.select) || void 0 === _a ? void 0 : _a.enable) ? table.scenegraph.updateChartState(null) : Chart.temp && table.scenegraph.updateChartState(null == params ? void 0 : params.datum);
36184
36184
  }), this.activeChartInstance.on("brushEnd", params => {
@@ -36186,7 +36186,7 @@
36186
36186
  table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData), Chart.temp = 0, setTimeout(() => {
36187
36187
  Chart.temp = 1;
36188
36188
  }, 0);
36189
- }), null === (_e = (_d = table)._bindChartEvent) || void 0 === _e || _e.call(_d, this.activeChartInstance);
36189
+ }), null === (_d = (_c = table)._bindChartEvent) || void 0 === _d || _d.call(_c, this.activeChartInstance);
36190
36190
  }
36191
36191
  deactivate() {
36192
36192
  var _a, _b;
@@ -40589,10 +40589,10 @@
40589
40589
  null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) || void 0 === _b || _b.call(_a);
40590
40590
  }
40591
40591
  activateChart(col, row) {
40592
- var _a, _b, _c;
40592
+ var _a, _b;
40593
40593
  if (-1 === col || -1 === row) return;
40594
40594
  const cellGroup = this.getCell(col, row);
40595
- return null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.activate) || void 0 === _b || _b.call(_a, this.table), null === (_c = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _c ? void 0 : _c.activeChartInstance;
40595
+ null === (_b = null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.activate) || void 0 === _b || _b.call(_a, this.table);
40596
40596
  }
40597
40597
  removeInteractionBorder(col, row) {
40598
40598
  const cellGroup = this.getCell(col, row);
@@ -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.1", 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,