@visactor/vtable-calendar 1.22.11-alpha.6 → 1.22.11-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.
@@ -44010,6 +44010,10 @@
44010
44010
  for (const col in chartInstanceListColumnByColumnDirection) clearChartInstanceListByColumnDirection(Number(col), void 0, table, forceRelease);
44011
44011
  for (const row in chartInstanceListRowByRowDirection) clearChartInstanceListByRowDirection(Number(row), void 0, table, forceRelease);
44012
44012
  }
44013
+ let disabledShowTooltipToAllChartInstances = !1;
44014
+ function isDisabledShowTooltipToAllChartInstances() {
44015
+ return disabledShowTooltipToAllChartInstances;
44016
+ }
44013
44017
 
44014
44018
  function isValidAlignDomain(domain) {
44015
44019
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -44763,6 +44767,8 @@
44763
44767
  generateChartInstanceListByViewRange(datum, table, !0);
44764
44768
  })), this.activeChartInstance.on("dimensionHover", params => {
44765
44769
  var _a, _b;
44770
+ if (isDisabledShowTooltipToAllChartInstances()) return;
44771
+ this.activeChartInstance.disableTooltip(!1);
44766
44772
  const dimensionInfo = null == params ? void 0 : params.dimensionInfo[0],
44767
44773
  canvasXY = null === (_a = null == params ? void 0 : params.event) || void 0 === _a ? void 0 : _a.canvas,
44768
44774
  viewport = null === (_b = null == params ? void 0 : params.event) || void 0 === _b ? void 0 : _b.viewport;
@@ -44779,11 +44785,11 @@
44779
44785
  prev_justShowMarkTooltip = this.justShowMarkTooltip;
44780
44786
  params.mark && params.datum && !Array.isArray(params.datum) ? (this.activeChartInstanceHoverOnMark = params.mark, justShowMarkTooltip = !0) : (this.activeChartInstanceHoverOnMark = null, justShowMarkTooltip = !1), this.justShowMarkTooltip = justShowMarkTooltip;
44781
44787
  let delayRunDimensionHover = !1;
44782
- if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
44788
+ if (!1 !== prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? (this.justShowMarkTooltipTimer = Date.now(), delayRunDimensionHover = !0) : !1 === prev_justShowMarkTooltip && !1 === justShowMarkTooltip ? delayRunDimensionHover = Date.now() - this.justShowMarkTooltipTimer < 100 : (!1 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip || !0 === prev_justShowMarkTooltip && !0 === justShowMarkTooltip) && (delayRunDimensionHover = !1, this.clearDelayRunDimensionHoverTimer()), "enter" === params.action || "move" === params.action || preMark !== this.activeChartInstanceHoverOnMark) {
44783
44789
  const dimensionValue = dimensionInfo.value,
44784
44790
  indicatorsAsCol = table.options.indicatorsAsCol;
44785
- if (delayRunDimensionHover ? (clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = setTimeout(() => {
44786
- indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1);
44791
+ if (delayRunDimensionHover ? (this.clearDelayRunDimensionHoverTimer(), this.delayRunDimensionHoverTimer = setTimeout(() => {
44792
+ isDisabledShowTooltipToAllChartInstances() || (indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1));
44787
44793
  }, 100)) : indicatorsAsCol ? generateChartInstanceListByRowDirection(row, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1) : generateChartInstanceListByColumnDirection(col, dimensionValue, null, canvasXY, table, justShowMarkTooltip, !1), indicatorsAsCol) {
44788
44794
  const series = dimensionInfo.data[0].series,
44789
44795
  width = "histogram" === this.attribute.spec.type || "line" === series.type || "area" === series.type ? 0 : series.getYAxisHelper().getBandwidth(0);
@@ -44824,7 +44830,10 @@
44824
44830
  }
44825
44831
  }
44826
44832
  }
44827
- })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance);
44833
+ })), null === (_j = (_h = table)._bindChartEvent) || void 0 === _j || _j.call(_h, this.activeChartInstance), isDisabledShowTooltipToAllChartInstances() && this.activeChartInstance.disableTooltip(!0);
44834
+ }
44835
+ clearDelayRunDimensionHoverTimer() {
44836
+ clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0;
44828
44837
  }
44829
44838
  deactivate(table, {
44830
44839
  forceRelease = !1,
@@ -44834,7 +44843,7 @@
44834
44843
  releaseAllChartInstance = !1
44835
44844
  } = {}) {
44836
44845
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
44837
- if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
44846
+ if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), this.clearDelayRunDimensionHoverTimer(), releaseChartInstance) {
44838
44847
  !forceRelease && getBrushingChartInstance() && getBrushingChartInstance() === this.activeChartInstance || (null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
44839
44848
  x1: -1e3,
44840
44849
  x2: -800,
@@ -49394,14 +49403,17 @@
49394
49403
  if (-1 === col || -1 === row) {
49395
49404
  if (forceRelease) {
49396
49405
  const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
49397
- cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
49398
- (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (clearBrushingChartInstance(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
49399
- forceRelease: !0,
49400
- releaseChartInstance: !0,
49401
- releaseColumnChartInstance: !0,
49402
- releaseRowChartInstance: !0,
49403
- releaseAllChartInstance: !0
49404
- }));
49406
+ brushingChartInstance = getBrushingChartInstance();
49407
+ if (brushingChartInstanceCellPos && brushingChartInstance) {
49408
+ const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
49409
+ (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (clearBrushingChartInstance(), null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, this.table, {
49410
+ forceRelease: !0,
49411
+ releaseChartInstance: !0,
49412
+ releaseColumnChartInstance: !0,
49413
+ releaseRowChartInstance: !0,
49414
+ releaseAllChartInstance: !0
49415
+ }));
49416
+ }
49405
49417
  }
49406
49418
  return;
49407
49419
  }
@@ -52501,7 +52513,7 @@
52501
52513
  }, 0 !== e.button) return;
52502
52514
  const eventArgsSet = getCellEventArgsSet(e);
52503
52515
  if (eventManager.downIcon = void 0, stateManager.interactionState !== InteractionState.default) return;
52504
- if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && table.scenegraph.updateChartState(null, void 0), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
52516
+ if (table.isPivotChart() && "chart" !== (null === (_a = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _a ? void 0 : _a.target.type) && (table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0)), (null === (_b = eventArgsSet.eventArgs) || void 0 === _b ? void 0 : _b.target) !== (null === (_c = stateManager.residentHoverIcon) || void 0 === _c ? void 0 : _c.icon) && stateManager.hideMenu(), "chart" === (null === (_d = null == eventArgsSet ? void 0 : eventArgsSet.eventArgs) || void 0 === _d ? void 0 : _d.target.type)) return;
52505
52517
  const isCompleteEdit = null === (_e = table.editorManager) || void 0 === _e ? void 0 : _e.completeEdit(e.nativeEvent);
52506
52518
  getPromiseValue(isCompleteEdit, isCompleteEdit => {
52507
52519
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
@@ -52529,7 +52541,7 @@
52529
52541
  }
52530
52542
  eventManager.dealTableHover(eventArgsSet);
52531
52543
  } else {
52532
- if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), void stateManager.updateInteractionState(InteractionState.grabing);
52544
+ if (!eventManager.checkCellFillhandle(eventArgsSet) && (eventManager.checkColumnResize(eventArgsSet, !0) || eventManager.checkRowResize(eventArgsSet, !0))) return table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), void stateManager.updateInteractionState(InteractionState.grabing);
52533
52545
  if (eventManager.checkColumnMover(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52534
52546
  if (eventManager.checkCellFillhandle(eventArgsSet, !0) && eventManager.dealFillSelect(eventArgsSet)) return void stateManager.updateInteractionState(InteractionState.grabing);
52535
52547
  eventManager.dealTableSelect(eventArgsSet) && stateManager.updateInteractionState(InteractionState.grabing);
@@ -52681,7 +52693,7 @@
52681
52693
  if (!(null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a.selectCellWhenCellEditorNotExists) && !1 === isCompleteEdit) return;
52682
52694
  const hitIcon = (null === (_b = e.target.role) || void 0 === _b ? void 0 : _b.startsWith("icon")) ? e.target : void 0;
52683
52695
  if (eventManager.downIcon = hitIcon, "touch" === e.pointerType || hitIcon || eventManager.checkCellFillhandle(eventArgsSet) || stateManager.columnResize.resizing || !eventManager.checkColumnResize(eventArgsSet, !0)) ;else {
52684
- table.scenegraph.updateChartState(null, void 0), stateManager.updateInteractionState(InteractionState.grabing);
52696
+ table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0), stateManager.updateInteractionState(InteractionState.grabing);
52685
52697
  const {
52686
52698
  eventArgs: eventArgs
52687
52699
  } = eventArgsSet;
@@ -52700,7 +52712,7 @@
52700
52712
  if (table.eventManager.isDraging || !target || !target.isDescendantsOf(table.scenegraph.stage) && target.stage !== target || target.isDescendantsOf(table.scenegraph.tableGroup)) table.eventManager.isDraging && stateManager.isSelecting() && stateManager.endSelectCells();else {
52701
52713
  stateManager.updateInteractionState(InteractionState.default), eventManager.dealTableHover();
52702
52714
  const isHasSelected = !!(null === (_a = stateManager.select.ranges) || void 0 === _a ? void 0 : _a.length);
52703
- (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null, void 0);
52715
+ (null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b.cancelSelectCellHook) ? (null === (_c = table.options.customConfig) || void 0 === _c ? void 0 : _c.cancelSelectCellHook(e)) && eventManager.dealTableSelect() : (null === (_e = null === (_d = table.options.select) || void 0 === _d ? void 0 : _d.blankAreaClickDeselect) || void 0 === _e || _e) && eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected), stateManager.updateCursor(), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
52704
52716
  }
52705
52717
  }), table.scenegraph.stage.addEventListener("pointermove", e => {
52706
52718
  var _a, _b, _c;
@@ -52941,11 +52953,13 @@
52941
52953
  const throttleVerticalWheel = throttle(stateManager.updateVerticalScrollBar, 20),
52942
52954
  throttleHorizontalWheel = throttle(stateManager.updateHorizontalScrollBar, 20);
52943
52955
  scenegraph.component.vScrollBar.addEventListener("scrollDrag", e => {
52944
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
52956
+ var _a;
52957
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
52945
52958
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
52946
52959
  throttleVerticalWheel(ratio, e);
52947
52960
  }), scenegraph.component.hScrollBar.addEventListener("scrollDrag", e => {
52948
- scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling);
52961
+ var _a;
52962
+ scenegraph.table.eventManager.isDown && (scenegraph.table.eventManager.isDraging = !0), stateManager.fastScrolling = !0, stateManager.interactionState !== InteractionState.scrolling && stateManager.updateInteractionState(InteractionState.scrolling), scenegraph.table.stateManager.hideMenu(), null === (_a = scenegraph.table.editorManager) || void 0 === _a || _a.completeEdit(), table.scenegraph.deactivateChart(-1, -1, !0);
52949
52963
  const ratio = e.detail.value[0] / (1 - e.detail.value[1] + e.detail.value[0]);
52950
52964
  throttleHorizontalWheel(ratio);
52951
52965
  });
@@ -53095,7 +53109,7 @@
53095
53109
  const isHasSelected = !!(null === (_b = stateManager.select.ranges) || void 0 === _b ? void 0 : _b.length);
53096
53110
  eventManager.dealTableSelect(), stateManager.endSelectCells(!0, isHasSelected);
53097
53111
  }
53098
- });
53112
+ }), table.scenegraph.updateChartState(null, void 0), table.scenegraph.deactivateChart(-1, -1, !0);
53099
53113
  }
53100
53114
  };
53101
53115
  eventManager.globalEventListeners.push({
@@ -56238,7 +56252,7 @@
56238
56252
  }
56239
56253
  constructor(container, options = {}) {
56240
56254
  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;
56241
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.6", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
56255
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.8", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env.mode ? (options = container, container = null) : container instanceof HTMLElement || (options = container, container = container.container ? container.container : null), !container && "node" !== options.mode && !options.canvas) throw new Error("vtable's container is undefined");
56242
56256
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
56243
56257
  options: options,
56244
56258
  container: container