@visactor/vtable-gantt 1.22.4-alpha.1 → 1.22.4-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
@@ -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.4-alpha.1";
9
+ export declare const version = "1.22.4-alpha.11";
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.4-alpha.1";
59
+ exports.plugins = plugins, exports.version = "1.22.4-alpha.11";
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,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.4-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"]}
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,iBAAiB,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.4-alpha.11\";\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"]}
@@ -38639,7 +38639,9 @@
38639
38639
  DELETE_RECORD: "delete_record",
38640
38640
  UPDATE_RECORD: "update_record",
38641
38641
  ADD_COLUMN: "add_column",
38642
- DELETE_COLUMN: "delete_column"
38642
+ DELETE_COLUMN: "delete_column",
38643
+ FILTER_MENU_SHOW: "filter_menu_show",
38644
+ FILTER_MENU_HIDE: "filter_menu_hide"
38643
38645
  };
38644
38646
 
38645
38647
  const judgeType$1 = value => {
@@ -59384,7 +59386,7 @@
59384
59386
  let PluginManager$1 = class PluginManager {
59385
59387
  constructor(table, options) {
59386
59388
  var _a;
59387
- this.plugins = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.map(plugin => {
59389
+ this.plugins = new Map(), this.pluginEventMap = new Map(), this.table = table, null === (_a = options.plugins) || void 0 === _a || _a.map(plugin => {
59388
59390
  this.register(plugin), this._bindTableEventForPlugin(plugin);
59389
59391
  });
59390
59392
  }
@@ -59403,23 +59405,30 @@
59403
59405
  _bindTableEventForPlugin(plugin) {
59404
59406
  var _a;
59405
59407
  null === (_a = plugin.runTime) || void 0 === _a || _a.forEach(runTime => {
59406
- this.table.on(runTime, (...args) => {
59408
+ const id = this.table.on(runTime, (...args) => {
59407
59409
  var _a;
59408
59410
  null === (_a = plugin.run) || void 0 === _a || _a.call(plugin, ...args, runTime, this.table);
59409
59411
  });
59412
+ this.pluginEventMap.set(plugin.id, [...(this.pluginEventMap.get(plugin.id) || []), id]);
59410
59413
  });
59411
59414
  }
59412
- updatePlugins(plugins) {
59415
+ removeOrAddPlugins(plugins) {
59413
59416
  Array.from(this.plugins.values()).filter(plugin => !(null == plugins ? void 0 : plugins.some(p => p.id === plugin.id))).forEach(plugin => {
59414
- this.release(), this.plugins.delete(plugin.id);
59415
- }), this.plugins.forEach(plugin => {
59416
- plugin.update && plugin.update();
59417
+ var _a;
59418
+ null === (_a = this.pluginEventMap.get(plugin.id)) || void 0 === _a || _a.forEach(id => {
59419
+ this.table.off(id);
59420
+ }), this.release(), this.plugins.delete(plugin.id);
59417
59421
  });
59418
59422
  const addedPlugins = null == plugins ? void 0 : plugins.filter(plugin => !this.plugins.has(plugin.id));
59419
59423
  null == addedPlugins || addedPlugins.forEach(plugin => {
59420
59424
  this.register(plugin), this._bindTableEventForPlugin(plugin);
59421
59425
  });
59422
59426
  }
59427
+ updatePlugins() {
59428
+ this.plugins.forEach(plugin => {
59429
+ plugin.update && plugin.update();
59430
+ });
59431
+ }
59423
59432
  release() {
59424
59433
  this.plugins.forEach(plugin => {
59425
59434
  var _a;
@@ -59442,7 +59451,7 @@
59442
59451
  }
59443
59452
  constructor(container, options = {}) {
59444
59453
  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;
59445
- if (super(), this.showFrozenIcon = !0, this.version = "1.22.4-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");
59454
+ if (super(), this.showFrozenIcon = !0, this.version = "1.22.4-alpha.11", 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");
59446
59455
  this.pluginManager = new PluginManager$1(this, options), this.fireListeners(TABLE_EVENT_TYPE.BEFORE_INIT, {
59447
59456
  options: options,
59448
59457
  container: container
@@ -60058,11 +60067,13 @@
60058
60067
  this.colContentWidthsMap.put(col, width);
60059
60068
  }
60060
60069
  getAllRowsHeight() {
60061
- if (this.internalProps.rowCount <= 0) return 0;
60070
+ var _a;
60071
+ if (!(null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.rowCount) || this.internalProps.rowCount <= 0) return 0;
60062
60072
  return this.getRowsHeight(0, this.internalProps.rowCount - 1);
60063
60073
  }
60064
60074
  getAllColsWidth() {
60065
- if (this.internalProps.colCount <= 0) return 0;
60075
+ var _a;
60076
+ if (!(null === (_a = this.internalProps) || void 0 === _a ? void 0 : _a.colCount) || this.internalProps.colCount <= 0) return 0;
60066
60077
  return this.getColsWidth(0, this.internalProps.colCount - 1);
60067
60078
  }
60068
60079
  getColsWidths() {
@@ -64907,7 +64918,7 @@
64907
64918
  }) {
64908
64919
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
64909
64920
  const internalProps = this.internalProps;
64910
- 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) : {
64921
+ 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) : {
64911
64922
  addRecordRule: options.addRecordRule
64912
64923
  }, 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--) {
64913
64924
  const releaseObj = internalProps.releaseList[i];
@@ -64923,7 +64934,7 @@
64923
64934
  const EmptyTip = Factory.getComponent("emptyTip");
64924
64935
  this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_j = this.internalProps.emptyTip) || void 0 === _j || _j.resetVisible();
64925
64936
  }
64926
- return this.pluginManager.updatePlugins(options.plugins), setTimeout(() => {
64937
+ return this.pluginManager.updatePlugins(), setTimeout(() => {
64927
64938
  this.fireListeners(TABLE_EVENT_TYPE.UPDATED, null);
64928
64939
  }, 0), new Promise(resolve => {
64929
64940
  setTimeout(resolve, 0);
@@ -65153,7 +65164,7 @@
65153
65164
  }).map(key => this.stateManager.checkedState.get(key));
65154
65165
  return this.options.groupBy && (stateArr = getGroupCheckboxState(this)), Array.from(stateArr, state => state && state[field]);
65155
65166
  }
65156
- return new Array(...this.stateManager.checkedState.values());
65167
+ return [...this.stateManager.checkedState.values()];
65157
65168
  }
65158
65169
  getCellCheckboxState(col, row) {
65159
65170
  var _a;
@@ -77361,7 +77372,7 @@
77361
77372
  PluginManager: PluginManager
77362
77373
  });
77363
77374
 
77364
- const version = "1.22.4-alpha.1";
77375
+ const version = "1.22.4-alpha.11";
77365
77376
 
77366
77377
  exports.Gantt = Gantt;
77367
77378
  exports.TYPES = index$4;