@visactor/vtable-sheet 1.22.5 → 1.22.6-alpha.1

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.5";
5
+ export declare const version = "1.22.6-alpha.1";
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.5", (0, style_manager_1.importStyles)();
50
+ exports.version = "1.22.6-alpha.1", (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,QAAQ,CAAC;AAEhC,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.5\";\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,gBAAgB,CAAC;AAExC,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.6-alpha.1\";\n// 导入样式\nimportStyles();\n/**\n * @namespace VTableSheet\n */\nexport { VTableSheet, TYPES, VTable, ISheetDefine, IVTableSheetOptions };\n"]}
@@ -47903,8 +47903,11 @@
47903
47903
  }, axisOption, {
47904
47904
  orient: "left",
47905
47905
  type: null !== (_e = null == axisOption ? void 0 : axisOption.type) && void 0 !== _e ? _e : "band",
47906
- __vtableChartTheme: theme,
47906
+ label: {
47907
+ flush: !0
47908
+ },
47907
47909
  inverse: transformInverse(axisOption, "horizontal" === (null !== (_f = null == spec ? void 0 : spec.direction) && void 0 !== _f ? _f : "scatter" === chartType ? "vertical" : "horizontal")),
47910
+ __vtableChartTheme: theme,
47908
47911
  __vtableBodyChartCellPadding: bodyChartCellPadding
47909
47912
  });
47910
47913
  }
@@ -48031,6 +48034,9 @@
48031
48034
  }, axisOption, {
48032
48035
  orient: "bottom",
48033
48036
  type: null !== (_o = null == axisOption ? void 0 : axisOption.type) && void 0 !== _o ? _o : "band",
48037
+ label: {
48038
+ flush: !0
48039
+ },
48034
48040
  __vtableChartTheme: theme,
48035
48041
  __vtableBodyChartCellPadding: bodyChartCellPadding
48036
48042
  });
@@ -48395,7 +48401,7 @@
48395
48401
  releaseColumnChartInstance = !0,
48396
48402
  releaseRowChartInstance = !0
48397
48403
  } = {}) {
48398
- var _a, _b, _c, _d, _e, _f;
48404
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
48399
48405
  if (this.activeChartInstanceHoverOnMark = null, this.justShowMarkTooltip = void 0, this.justShowMarkTooltipTimer = Date.now(), clearTimeout(this.delayRunDimensionHoverTimer), this.delayRunDimensionHoverTimer = void 0, releaseChartInstance) {
48400
48406
  null === (_a = this.activeChartInstance) || void 0 === _a || _a.updateViewBox({
48401
48407
  x1: -1e3,
@@ -48404,11 +48410,16 @@
48404
48410
  y2: -800
48405
48411
  }, !1, !1), null === (_b = this.activeChartInstance) || void 0 === _b || _b.release(), this.activeChartInstance = null;
48406
48412
  const {
48407
- col: col,
48408
- row: row
48409
- } = this.parent,
48410
- table = this.stage.table;
48413
+ col: col,
48414
+ row: row
48415
+ } = this.parent;
48411
48416
  table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_d = (_c = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild).hideLabelHoverOnAxis) || void 0 === _d || _d.call(_c)), table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_f = (_e = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild).hideLabelHoverOnAxis) || void 0 === _f || _f.call(_e));
48417
+ } else {
48418
+ const {
48419
+ col: col,
48420
+ row: row
48421
+ } = this.parent;
48422
+ releaseColumnChartInstance && table.internalProps.layoutMap.isAxisCell(col, table.rowCount - table.bottomFrozenRowCount) && (null === (_h = (_g = table.scenegraph.getCell(col, table.rowCount - table.bottomFrozenRowCount).firstChild).hideLabelHoverOnAxis) || void 0 === _h || _h.call(_g)), releaseRowChartInstance && table.internalProps.layoutMap.isAxisCell(table.rowHeaderLevelCount - 1, row) && (null === (_k = (_j = table.scenegraph.getCell(table.rowHeaderLevelCount - 1, row).firstChild).hideLabelHoverOnAxis) || void 0 === _k || _k.call(_j));
48412
48423
  }
48413
48424
  releaseColumnChartInstance && clearChartInstanceListByColumnDirection(this.parent.col, "scatter" === this.attribute.spec.type ? this.parent.row : void 0, table), releaseRowChartInstance && clearChartInstanceListByRowDirection(this.parent.row, "scatter" === this.attribute.spec.type ? this.parent.col : void 0, table);
48414
48425
  }
@@ -48533,7 +48544,7 @@
48533
48544
  tickMode: null === (_e = axis.tick) || void 0 === _e ? void 0 : _e.tickMode
48534
48545
  }
48535
48546
  }, !0);
48536
- }), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId) chartInstance.getChart().setLayoutTag(!0), chartInstance.updateDataSync(dataId, null != data ? data : []);else {
48547
+ }), null === (_c = null === (_b = table.internalProps.layoutMap) || void 0 === _b ? void 0 : _b.updateDataStateToActiveChartInstance) || void 0 === _c || _c.call(_b, chartInstance), "string" == typeof dataId || "number" == typeof dataId) chartInstance.getChart().setLayoutTag(!0), chartInstance.updateDataSync(dataId, null != data ? data : []);else {
48537
48548
  const dataBatch = [];
48538
48549
  for (const dataIdStr in dataId) {
48539
48550
  const dataIdAndField = dataId[dataIdStr],
@@ -48685,7 +48696,7 @@
48685
48696
  chartStage.needRender = !0;
48686
48697
  const matrix = chart.globalTransMatrix.clone(),
48687
48698
  stageMatrix = chart.stage.window.getViewBoxTransform().clone();
48688
- if (stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), "string" == typeof dataId) activeChartInstance.updateDataSync(dataId, null != data ? data : []);else {
48699
+ if (stageMatrix.multiply(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f), chartStage.window.setViewBoxTransform(stageMatrix.a, stageMatrix.b, stageMatrix.c, stageMatrix.d, stageMatrix.e, stageMatrix.f), "string" == typeof dataId || "number" == typeof dataId) activeChartInstance.updateDataSync(dataId, null != data ? data : []);else {
48689
48700
  const dataBatch = [];
48690
48701
  for (const dataIdStr in dataId) {
48691
48702
  const dataIdAndField = dataId[dataIdStr],
@@ -59664,7 +59675,7 @@
59664
59675
  }
59665
59676
  constructor(container, options = {}) {
59666
59677
  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;
59667
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.5", 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");
59678
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.6-alpha.1", 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");
59668
59679
  this.pluginManager = new PluginManager(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
59669
59680
  options: options,
59670
59681
  container: container
@@ -72650,15 +72661,15 @@
72650
72661
  this.getActiveFilterFields().length > 0 && this.applyFilters();
72651
72662
  }
72652
72663
  dispatch(action) {
72653
- this.state = this.reduce(this.state, action), this.shouldApplyFilter(action) && this.applyFilters(), this.notifyListeners();
72664
+ this.state = this.reduce(this.state, action), this.shouldApplyFilter(action) && this.applyFilters(), this.notifyListeners(action);
72654
72665
  }
72655
72666
  subscribe(listener) {
72656
72667
  return this.listeners.push(listener), () => {
72657
72668
  this.listeners = this.listeners.filter(l => l !== listener);
72658
72669
  };
72659
72670
  }
72660
- notifyListeners() {
72661
- this.listeners.forEach(listener => listener(this.state));
72671
+ notifyListeners(action) {
72672
+ this.listeners.forEach(listener => listener(this.state, action));
72662
72673
  }
72663
72674
  reduce(state, action) {
72664
72675
  const {
@@ -73112,6 +73123,9 @@
73112
73123
  hide() {
73113
73124
  this.filterByValuePanel.style.display = "none";
73114
73125
  }
73126
+ clearSearchInputValue() {
73127
+ this.filterByValueSearchInput.value = "";
73128
+ }
73115
73129
  }
73116
73130
 
73117
73131
  class ConditionFilter {
@@ -73407,7 +73421,7 @@
73407
73421
  cell.right < this.filterMenuWidth ? (left = cell.left + canvasBounds.left, top = cell.bottom + canvasBounds.top) : (left = cell.right + canvasBounds.left - this.filterMenuWidth, top = cell.bottom + canvasBounds.top), this.filterMenu.style.display = this.isVisible ? "block" : "none", this.filterMenu.style.left = `${left}px`, this.filterMenu.style.top = `${top}px`;
73408
73422
  }
73409
73423
  show(col, row, filterModes) {
73410
- this.filterModes = filterModes, this.filterModes.includes("byValue") ? this.filterModes.includes("byCondition") || (this.filterTabByCondition.style.display = "none", this.onTabSwitch("byValue")) : (this.filterTabByValue.style.display = "none", this.onTabSwitch("byCondition")), this.adjustMenuPosition(col, row), this.filterMenu.style.display = "block";
73424
+ this.valueFilter.clearSearchInputValue(), this.filterModes = filterModes, this.filterModes.includes("byValue") ? this.filterModes.includes("byCondition") || (this.filterTabByCondition.style.display = "none", this.onTabSwitch("byValue")) : (this.filterTabByValue.style.display = "none", this.onTabSwitch("byCondition")), this.adjustMenuPosition(col, row), this.filterMenu.style.display = "block";
73411
73425
  const field = this.table.internalProps.layoutMap.getHeaderField(col, row);
73412
73426
  this.updateSelectedField(field);
73413
73427
  const currentFilter = this.filterStateManager.getFilterState(field);
@@ -73446,10 +73460,10 @@
73446
73460
  const eventArgs = args[0],
73447
73461
  runtime = args[1],
73448
73462
  table = args[2];
73449
- if (this.table = table, runtime === TABLE_EVENT_TYPE.BEFORE_INIT) this.filterEngine = new FilterEngine(), this.filterStateManager = new FilterStateManager(this.table, this.filterEngine), this.filterToolbar = new FilterToolbar(this.table, this.filterStateManager), this.columns = eventArgs.options.columns, this.filterToolbar.render(document.body), this.updateFilterIcons(this.columns), this.filterStateManager.subscribe(() => {
73450
- this.updateFilterIcons(this.columns), this.table.updateColumns(this.columns, {
73463
+ if (this.table = table, runtime === TABLE_EVENT_TYPE.BEFORE_INIT) this.filterEngine = new FilterEngine(), this.filterStateManager = new FilterStateManager(this.table, this.filterEngine), this.filterToolbar = new FilterToolbar(this.table, this.filterStateManager), this.columns = eventArgs.options.columns, this.filterToolbar.render(document.body), this.updateFilterIcons(this.columns), this.filterStateManager.subscribe((_, action) => {
73464
+ (null == action ? void 0 : action.type) !== FilterActionType.ADD_FILTER && (this.updateFilterIcons(this.columns), this.table.updateColumns(this.columns, {
73451
73465
  clearRowHeightCache: !1
73452
- });
73466
+ }));
73453
73467
  });else if (runtime === TABLE_EVENT_TYPE.BEFORE_UPDATE_OPTION) this.pluginOptions = Object.assign(Object.assign({}, this.pluginOptions), eventArgs.options.plugins.find(plugin => plugin.id === this.id).pluginOptions), this.columns = eventArgs.options.columns, this.handleOptionUpdate(eventArgs.options);else if (runtime === TABLE_EVENT_TYPE.ICON_CLICK && "filter-icon" === eventArgs.name || "filtering-icon" === eventArgs.name) {
73454
73468
  if (3 === (null === (_a = eventArgs.event) || void 0 === _a ? void 0 : _a.which) || 2 === (null === (_b = eventArgs.event) || void 0 === _b ? void 0 : _b.button) || 2 == (2 & (null === (_c = eventArgs.event) || void 0 === _c ? void 0 : _c.buttons))) return;
73455
73469
  const col = eventArgs.col,
@@ -80847,7 +80861,7 @@
80847
80861
  importStyle();
80848
80862
  }
80849
80863
 
80850
- const version = "1.22.5";
80864
+ const version = "1.22.6-alpha.1";
80851
80865
  importStyles();
80852
80866
 
80853
80867
  exports.TYPES = index;