@visactor/vtable-sheet 1.22.11-alpha.10 → 1.22.11-alpha.11

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.
package/cjs/index.d.ts CHANGED
@@ -2,5 +2,5 @@ import VTableSheet from './components/vtable-sheet';
2
2
  import type { ISheetDefine, IVTableSheetOptions } from './ts-types';
3
3
  import * as TYPES from './ts-types';
4
4
  import * as VTable from './vtable';
5
- export declare const version = "1.22.11-alpha.10";
5
+ export declare const version = "1.22.11-alpha.11";
6
6
  export { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };
package/cjs/index.js CHANGED
@@ -47,4 +47,4 @@ exports.VTable = VTable;
47
47
 
48
48
  const style_manager_1 = require("./styles/style-manager");
49
49
 
50
- exports.version = "1.22.11-alpha.10", (0, style_manager_1.importStyles)();
50
+ exports.version = "1.22.11-alpha.11", (0, style_manager_1.importStyles)();
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,kBAAkB,CAAC;AAE1C,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.22.11-alpha.10\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAAoD;AAW3C,sBAXF,sBAAW,CAWE;AATpB,kDAAoC;AASd,sBAAK;AAR3B,iDAAmC;AAQN,wBAAM;AAPnC,0DAAsD;AACzC,QAAA,OAAO,GAAG,kBAAkB,CAAC;AAE1C,IAAA,4BAAY,GAAE,CAAC","file":"index.js","sourcesContent":["import VTableSheet from './components/vtable-sheet';\nimport type { ISheetDefine, IVTableSheetOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport * as VTable from './vtable';\nimport { importStyles } from './styles/style-manager';\nexport const version = \"1.22.11-alpha.11\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
@@ -47733,8 +47733,17 @@
47733
47733
  row: row
47734
47734
  };
47735
47735
  }
47736
- function clearBrushingChartInstance() {
47737
- brushingChartInstance = void 0, brushingChartInstanceCellPos = {
47736
+ function clearAndReleaseBrushingChartInstance(scenegraph) {
47737
+ var _a, _b, _c;
47738
+ enableTooltipToAllChartInstances();
47739
+ const cellGroup = scenegraph.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
47740
+ (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (null === (_c = null === (_b = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _b ? void 0 : _b.deactivate) || void 0 === _c || _c.call(_b, scenegraph.table, {
47741
+ forceRelease: !0,
47742
+ releaseChartInstance: !0,
47743
+ releaseColumnChartInstance: !1,
47744
+ releaseRowChartInstance: !1,
47745
+ releaseAllChartInstance: !1
47746
+ })), isValid$2(chartInstanceListColumnByColumnDirection[brushingChartInstanceCellPos.col]) && delete chartInstanceListColumnByColumnDirection[brushingChartInstanceCellPos.col][brushingChartInstanceCellPos.row], isValid$2(chartInstanceListRowByRowDirection[brushingChartInstanceCellPos.row]) && delete chartInstanceListRowByRowDirection[brushingChartInstanceCellPos.row][brushingChartInstanceCellPos.col], brushingChartInstance = void 0, brushingChartInstanceCellPos = {
47738
47747
  col: -1,
47739
47748
  row: -1
47740
47749
  };
@@ -47747,10 +47756,12 @@
47747
47756
  }
47748
47757
  const chartInstanceListColumnByColumnDirection = {};
47749
47758
  const chartInstanceListRowByRowDirection = {};
47750
- const delayRunDimensionHoverTimer = [];
47759
+ const delayRunDimensionHoverTimerForColumnDirection = [],
47760
+ delayRunDimensionHoverTimerForRowDirection = [],
47761
+ delayRunDimensionHoverTimerForViewRange = [];
47751
47762
  function generateChartInstanceListByColumnDirection(col, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47752
47763
  var _a;
47753
- clearDelayRunDimensionHoverTimers(), isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47764
+ clearDelayRunDimensionHoverTimerForColumnDirection(), isValid$2(chartInstanceListColumnByColumnDirection[col]) || (chartInstanceListColumnByColumnDirection[col] = {});
47754
47765
  const {
47755
47766
  rowStart: rowStart
47756
47767
  } = table.getBodyVisibleRowRange();
@@ -47787,12 +47798,12 @@
47787
47798
  }
47788
47799
  }
47789
47800
  }, 0);
47790
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47801
+ delayRunDimensionHoverTimerForColumnDirection.push(timer), table.scenegraph.updateNextFrame();
47791
47802
  }
47792
47803
  }
47793
47804
  function generateChartInstanceListByRowDirection(row, dimensionValueOrXValue, positionValueOrYValue, canvasXY, table, hideTooltip = !1, isScatter = !1) {
47794
47805
  var _a;
47795
- clearDelayRunDimensionHoverTimers(), isValid$2(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47806
+ clearDelayRunDimensionHoverTimerForRowDirection(), isValid$2(chartInstanceListRowByRowDirection[row]) || (chartInstanceListRowByRowDirection[row] = {});
47796
47807
  const {
47797
47808
  colStart: colStart
47798
47809
  } = table.getBodyVisibleColRange();
@@ -47829,12 +47840,12 @@
47829
47840
  }
47830
47841
  }
47831
47842
  }, 0);
47832
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47843
+ delayRunDimensionHoverTimerForRowDirection.push(timer), table.scenegraph.updateNextFrame();
47833
47844
  }
47834
47845
  }
47835
47846
  function generateChartInstanceListByViewRange(datum, table, deactivate = !1) {
47836
47847
  var _a;
47837
- clearDelayRunDimensionHoverTimers();
47848
+ clearDelayRunDimensionHoverTimerForViewRange();
47838
47849
  const {
47839
47850
  rowStart: rowStart
47840
47851
  } = table.getBodyVisibleRowRange();
@@ -47861,7 +47872,7 @@
47861
47872
  })));
47862
47873
  }
47863
47874
  }, 0);
47864
- delayRunDimensionHoverTimer.push(timer), table.scenegraph.updateNextFrame();
47875
+ delayRunDimensionHoverTimerForViewRange.push(timer), table.scenegraph.updateNextFrame();
47865
47876
  }
47866
47877
  }
47867
47878
  }
@@ -47964,9 +47975,25 @@
47964
47975
  }
47965
47976
  delete chartInstanceListRowByRowDirection[row];
47966
47977
  }
47978
+ function clearDelayRunDimensionHoverTimerForColumnDirection() {
47979
+ for (const timer of delayRunDimensionHoverTimerForColumnDirection) clearTimeout(timer);
47980
+ delayRunDimensionHoverTimerForColumnDirection.length = 0;
47981
+ }
47982
+ function clearDelayRunDimensionHoverTimerForRowDirection() {
47983
+ for (const timer of delayRunDimensionHoverTimerForRowDirection) clearTimeout(timer);
47984
+ delayRunDimensionHoverTimerForRowDirection.length = 0;
47985
+ }
47986
+ function clearDelayRunDimensionHoverTimerForViewRange() {
47987
+ for (const timer of delayRunDimensionHoverTimerForViewRange) clearTimeout(timer);
47988
+ delayRunDimensionHoverTimerForViewRange.length = 0;
47989
+ }
47967
47990
  function clearDelayRunDimensionHoverTimers() {
47968
- for (const timer of delayRunDimensionHoverTimer) clearTimeout(timer);
47969
- delayRunDimensionHoverTimer.length = 0;
47991
+ for (const timer of delayRunDimensionHoverTimerForColumnDirection) clearTimeout(timer);
47992
+ delayRunDimensionHoverTimerForColumnDirection.length = 0;
47993
+ for (const timer of delayRunDimensionHoverTimerForRowDirection) clearTimeout(timer);
47994
+ delayRunDimensionHoverTimerForRowDirection.length = 0;
47995
+ for (const timer of delayRunDimensionHoverTimerForViewRange) clearTimeout(timer);
47996
+ delayRunDimensionHoverTimerForViewRange.length = 0;
47970
47997
  }
47971
47998
  function clearAllChartInstanceList(table, forceRelease = !1) {
47972
47999
  clearDelayRunDimensionHoverTimers();
@@ -47977,6 +48004,11 @@
47977
48004
  function isDisabledTooltipToAllChartInstances() {
47978
48005
  return disabledTooltipToAllChartInstances;
47979
48006
  }
48007
+ function enableTooltipToAllChartInstances() {
48008
+ disabledTooltipToAllChartInstances = !1;
48009
+ for (const col in chartInstanceListColumnByColumnDirection) for (const row in chartInstanceListColumnByColumnDirection[col]) chartInstanceListColumnByColumnDirection[col][row].disableTooltip(!1);
48010
+ for (const row in chartInstanceListRowByRowDirection) for (const col in chartInstanceListRowByRowDirection[row]) chartInstanceListRowByRowDirection[row][col].disableTooltip(!1);
48011
+ }
47980
48012
 
47981
48013
  function isValidAlignDomain(domain) {
47982
48014
  return 2 === domain.length && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
@@ -48703,9 +48735,8 @@
48703
48735
  var _a;
48704
48736
  brushChangeThrottle.throttled(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush");
48705
48737
  })), this.activeChartInstance.on("brushStart", params => {
48706
- var _a;
48707
48738
  const brushingChartInstance = getBrushingChartInstance();
48708
- brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && (null === (_a = brushingChartInstance.getChart()) || void 0 === _a || _a.getComponentsByKey("brush")[0].clearBrushStateAndMask()), setBrushingChartInstance(this.activeChartInstance, col, row));
48739
+ brushingChartInstance !== this.activeChartInstance && (brushingChartInstance && clearAndReleaseBrushingChartInstance(table.scenegraph), setBrushingChartInstance(this.activeChartInstance, col, row));
48709
48740
  }), this.activeChartInstance.on("brushEnd", params => {
48710
48741
  var _a;
48711
48742
  null == brushChangeThrottle || brushChangeThrottle.cancel(), table.scenegraph.updateChartState(null === (_a = null == params ? void 0 : params.value) || void 0 === _a ? void 0 : _a.inBrushData, "brush"), Chart.temp = 0, setTimeout(() => {
@@ -53369,25 +53400,16 @@
53369
53400
  resetResidentHoverIcon(col, row, this);
53370
53401
  }
53371
53402
  deactivateChart(col, row, forceRelease = !1) {
53372
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
53403
+ var _a, _b, _c, _d, _e, _f;
53373
53404
  if (forceRelease) {
53374
53405
  const brushingChartInstanceCellPos = getBrushingChartInstanceCellPos(),
53375
53406
  brushingChartInstance = getBrushingChartInstance();
53376
- if (brushingChartInstanceCellPos && brushingChartInstance) {
53377
- const cellGroup = this.getCell(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row);
53378
- (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) && (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, {
53379
- forceRelease: !0,
53380
- releaseChartInstance: !0,
53381
- releaseColumnChartInstance: !0,
53382
- releaseRowChartInstance: !0,
53383
- releaseAllChartInstance: !0
53384
- })), clearCellChartCacheImage(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row, this), clearBrushingChartInstance();
53385
- }
53407
+ brushingChartInstanceCellPos && brushingChartInstance && (clearAndReleaseBrushingChartInstance(this), clearCellChartCacheImage(brushingChartInstanceCellPos.col, brushingChartInstanceCellPos.row, this));
53386
53408
  }
53387
53409
  if (-1 === col || -1 === row) return;
53388
53410
  const cellGroup = this.getCell(col, row);
53389
- if (null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) {
53390
- if (forceRelease) return void (null === (_f = null === (_e = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _e ? void 0 : _e.deactivate) || void 0 === _f || _f.call(_e, this.table, {
53411
+ if (null === (_a = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _a ? void 0 : _a.deactivate) {
53412
+ if (forceRelease) return void (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, {
53391
53413
  forceRelease: !0,
53392
53414
  releaseChartInstance: !0,
53393
53415
  releaseColumnChartInstance: !0,
@@ -53395,7 +53417,7 @@
53395
53417
  releaseAllChartInstance: !0
53396
53418
  }));
53397
53419
  const chartType = (null == cellGroup ? void 0 : cellGroup.firstChild).attribute.spec.type;
53398
- null === (_h = null === (_g = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _g ? void 0 : _g.deactivate) || void 0 === _h || _h.call(_g, this.table, (null === (_j = this.table.options.chartDimensionLinkage) || void 0 === _j ? void 0 : _j.showTooltip) ? {
53420
+ null === (_e = null === (_d = null == cellGroup ? void 0 : cellGroup.firstChild) || void 0 === _d ? void 0 : _d.deactivate) || void 0 === _e || _e.call(_d, this.table, (null === (_f = this.table.options.chartDimensionLinkage) || void 0 === _f ? void 0 : _f.showTooltip) ? {
53399
53421
  releaseChartInstance: "pie" !== chartType && ("scatter" === chartType ? col !== this.table.stateManager.hover.cellPos.col && row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : this.table.options.indicatorsAsCol ? row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount : col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
53400
53422
  releaseColumnChartInstance: "pie" !== chartType && (col !== this.table.stateManager.hover.cellPos.col || this.table.stateManager.hover.cellPos.row < this.table.frozenRowCount || this.table.stateManager.hover.cellPos.row > this.table.rowCount - 1 - this.table.bottomFrozenRowCount),
53401
53423
  releaseRowChartInstance: "pie" !== chartType && (row !== this.table.stateManager.hover.cellPos.row || this.table.stateManager.hover.cellPos.col < this.table.frozenColCount || this.table.stateManager.hover.cellPos.col > this.table.colCount - 1 - this.table.rightFrozenColCount)
@@ -60220,7 +60242,7 @@
60220
60242
  }
60221
60243
  constructor(container, options = {}) {
60222
60244
  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;
60223
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.10", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
60245
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.11-alpha.11", this.id = `VTable${Date.now()}`, this.isReleased = !1, this._chartEventMap = {}, this.throttleInvalidate = throttle2(this.render.bind(this), 200), "node" === Env$1.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");
60224
60246
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
60225
60247
  options: options,
60226
60248
  container: container
@@ -91205,7 +91227,7 @@
91205
91227
  importStyle();
91206
91228
  }
91207
91229
 
91208
- const version = "1.22.11-alpha.10";
91230
+ const version = "1.22.11-alpha.11";
91209
91231
  importStyles();
91210
91232
 
91211
91233
  exports.TYPES = index;