@visactor/vtable-gantt 1.22.6 → 1.22.7-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
@@ -6,5 +6,5 @@ import * as tools from './tools';
6
6
  import * as VRender from './vrender';
7
7
  import * as VTable from './vtable';
8
8
  import * as plugins from './plugins';
9
- export declare const version = "1.22.6";
9
+ export declare const version = "1.22.7-alpha.1";
10
10
  export { TYPES, GanttConstructorOptions, Gantt, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, tools, VRender, VTable, plugins };
package/cjs/index.js CHANGED
@@ -56,5 +56,5 @@ exports.VTable = VTable;
56
56
 
57
57
  const plugins = __importStar(require("./plugins"));
58
58
 
59
- exports.plugins = plugins, exports.version = "1.22.6";
59
+ exports.plugins = plugins, exports.version = "1.22.7-alpha.1";
60
60
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,QAAQ,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.22.6\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAoC;AAwBlC,sBAAK;AAVP,mCAAgC;AAY9B,sFAZO,aAAK,OAYP;AAXP,+CAAiC;AAuB/B,sBAAK;AAtBP,mDAAqC;AAuBnC,0BAAO;AAtBT,iDAAmC;AAuBjC,wBAAM;AAtBR,mDAAqC;AAuBnC,0BAAO;AAtBI,QAAA,OAAO,GAAG,gBAAgB,CAAC","file":"index.js","sourcesContent":["import type { GanttConstructorOptions } from './ts-types';\nimport * as TYPES from './ts-types';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType\n} from '@visactor/vtable';\nimport { Gantt } from './Gantt';\nimport * as tools from './tools';\nimport * as VRender from './vrender';\nimport * as VTable from './vtable';\nimport * as plugins from './plugins';\nexport const version = \"1.22.7-alpha.1\";\n/**\n * @namespace VTableGantt\n */\nexport {\n TYPES,\n GanttConstructorOptions,\n Gantt,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n tools,\n VRender,\n VTable,\n plugins\n};\n"]}
@@ -12,4 +12,5 @@ function getPixelRatio() {
12
12
  exports.defaultPixelRatio;
13
13
  }
14
14
 
15
- exports.defaultPixelRatio = 1, exports.getPixelRatio = getPixelRatio, getPixelRatio();
15
+ exports.defaultPixelRatio = 1, exports.getPixelRatio = getPixelRatio, getPixelRatio();
16
+ //# sourceMappingURL=pixel-ratio.js.map
@@ -324,5 +324,4 @@ class ZoomScaleManager {
324
324
  }
325
325
  }
326
326
 
327
- exports.ZoomScaleManager = ZoomScaleManager;
328
- //# sourceMappingURL=ZoomScaleManager.js.map
327
+ exports.ZoomScaleManager = ZoomScaleManager;
@@ -38768,7 +38768,9 @@
38768
38768
  DELETE_RECORD: "delete_record",
38769
38769
  UPDATE_RECORD: "update_record",
38770
38770
  ADD_COLUMN: "add_column",
38771
- DELETE_COLUMN: "delete_column"
38771
+ DELETE_COLUMN: "delete_column",
38772
+ FILTER_MENU_SHOW: "filter_menu_show",
38773
+ FILTER_MENU_HIDE: "filter_menu_hide"
38772
38774
  };
38773
38775
 
38774
38776
  const judgeType$1 = value => {
@@ -59827,7 +59829,7 @@
59827
59829
  let PluginManager$1 = class PluginManager {
59828
59830
  constructor(table, options) {
59829
59831
  var _a;
59830
- this.plugins = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.map(plugin => {
59832
+ this.plugins = new Map(), this.pluginEventMap = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.map(plugin => {
59831
59833
  this.register(plugin), this._bindTableEventForPlugin(plugin);
59832
59834
  });
59833
59835
  }
@@ -59846,23 +59848,30 @@
59846
59848
  _bindTableEventForPlugin(plugin) {
59847
59849
  var _a;
59848
59850
  null === (_a = plugin.runTime) || void 0 === _a || _a.forEach(runTime => {
59849
- this.table.on(runTime, (...args) => {
59851
+ const id = this.table.on(runTime, (...args) => {
59850
59852
  var _a;
59851
59853
  null === (_a = plugin.run) || void 0 === _a || _a.call(plugin, ...args, runTime, this.table);
59852
59854
  });
59855
+ this.pluginEventMap.set(plugin.id, [...(this.pluginEventMap.get(plugin.id) || []), id]);
59853
59856
  });
59854
59857
  }
59855
- updatePlugins(plugins) {
59858
+ removeOrAddPlugins(plugins) {
59856
59859
  Array.from(this.plugins.values()).filter(plugin => !(null == plugins ? void 0 : plugins.some(p => p.id === plugin.id))).forEach(plugin => {
59857
- this.release(), this.plugins.delete(plugin.id);
59858
- }), this.plugins.forEach(plugin => {
59859
- plugin.update && plugin.update();
59860
+ var _a;
59861
+ null === (_a = this.pluginEventMap.get(plugin.id)) || void 0 === _a || _a.forEach(id => {
59862
+ this.table.off(id);
59863
+ }), this.release(), this.plugins.delete(plugin.id);
59860
59864
  });
59861
59865
  const addedPlugins = null == plugins ? void 0 : plugins.filter(plugin => !this.plugins.has(plugin.id));
59862
59866
  null == addedPlugins || addedPlugins.forEach(plugin => {
59863
59867
  this.register(plugin), this._bindTableEventForPlugin(plugin);
59864
59868
  });
59865
59869
  }
59870
+ updatePlugins() {
59871
+ this.plugins.forEach(plugin => {
59872
+ plugin.update && plugin.update();
59873
+ });
59874
+ }
59866
59875
  release() {
59867
59876
  this.plugins.forEach(plugin => {
59868
59877
  var _a;
@@ -59885,7 +59894,7 @@
59885
59894
  }
59886
59895
  constructor(container, options = {}) {
59887
59896
  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;
59888
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.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");
59897
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.7-alpha.1", 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");
59889
59898
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
59890
59899
  options: options,
59891
59900
  container: container
@@ -60501,11 +60510,13 @@
60501
60510
  this.colContentWidthsMap.put(col, width);
60502
60511
  }
60503
60512
  getAllRowsHeight() {
60504
- if (this.internalProps.rowCount <= 0) return 0;
60513
+ var _a;
60514
+ if (!(null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.rowCount) || this.internalProps.rowCount <= 0) return 0;
60505
60515
  return this.getRowsHeight(0, this.internalProps.rowCount - 1);
60506
60516
  }
60507
60517
  getAllColsWidth() {
60508
- if (this.internalProps.colCount <= 0) return 0;
60518
+ var _a;
60519
+ if (!(null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.colCount) || this.internalProps.colCount <= 0) return 0;
60509
60520
  return this.getColsWidth(0, this.internalProps.colCount - 1);
60510
60521
  }
60511
60522
  getColsWidths() {
@@ -65353,7 +65364,7 @@
65353
65364
  }) {
65354
65365
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
65355
65366
  const internalProps = this.internalProps;
65356
- if (super.updateOption(options, updateConfig), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = this.internalProps.groupBy ? getGroupByDataConfig(this.internalProps.groupBy, options.addRecordRule) : {
65367
+ if (this.pluginManager.removeOrAddPlugins(options.plugins), super.updateOption(options, updateConfig), internalProps.frozenColDragHeaderMode = null !== (_b = null === (_a = options.dragOrder) || void 0 === _a ? void 0 : _a.frozenColDragHeaderMode) && void 0 !== _b ? _b : options.frozenColDragHeaderMode, this.pagination = options.pagination, internalProps.sortState = options.sortState, internalProps.dataConfig = this.internalProps.groupBy ? getGroupByDataConfig(this.internalProps.groupBy, options.addRecordRule) : {
65357
65368
  addRecordRule: options.addRecordRule
65358
65369
  }, this.showHeader = null === (_c = options.showHeader) || void 0 === _c || _c, internalProps.columns = options.columns ? cloneDeepSpec(options.columns, ["children"]) : options.header ? cloneDeepSpec(options.header, ["children"]) : [], generateAggregationForColumn(this), internalProps.enableTreeNodeMerge = null !== (_e = null !== (_d = options.enableTreeNodeMerge) && void 0 !== _d ? _d : isValid$3(this.internalProps.groupBy)) && void 0 !== _e && _e, this.internalProps.headerHelper.setTableColumnsEditor(), this.transpose = null !== (_f = options.transpose) && void 0 !== _f && _f, this.refreshHeader(), this.internalProps.useOneRowHeightFillAll = !1, this.internalProps.columnWidthConfig = options.columnWidthConfig, this.internalProps.rowHeightConfig = options.rowHeightConfig, internalProps.releaseList) for (let i = internalProps.releaseList.length - 1; i >= 0; i--) {
65359
65370
  const releaseObj = internalProps.releaseList[i];
@@ -65369,7 +65380,7 @@
65369
65380
  const EmptyTip = Factory.getComponent("emptyTip");
65370
65381
  this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_j = this.internalProps.emptyTip) || void 0 === _j || _j.resetVisible();
65371
65382
  }
65372
- return this.pluginManager.updatePlugins(options.plugins), setTimeout(() => {
65383
+ return this.pluginManager.updatePlugins(), setTimeout(() => {
65373
65384
  this.fireListeners(TABLE_EVENT_TYPE.UPDATED, null);
65374
65385
  }, 0), new Promise(resolve => {
65375
65386
  setTimeout(resolve, 0);
@@ -65599,7 +65610,7 @@
65599
65610
  }).map(key => this.stateManager.checkedState.get(key));
65600
65611
  return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), Array.from(stateArr, state => state && state[field]);
65601
65612
  }
65602
- return new Array(...this.stateManager.checkedState.values());
65613
+ return [...this.stateManager.checkedState.values()];
65603
65614
  }
65604
65615
  getCellCheckboxState(col, row) {
65605
65616
  var _a;
@@ -77812,7 +77823,7 @@
77812
77823
  PluginManager: PluginManager
77813
77824
  });
77814
77825
 
77815
- const version = "1.22.6";
77826
+ const version = "1.22.7-alpha.1";
77816
77827
 
77817
77828
  exports.Gantt = Gantt;
77818
77829
  exports.TYPES = index$4;