@visactor/vtable 1.23.1-alpha.0 → 1.23.1-alpha.2

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/ListTable.js CHANGED
@@ -62,8 +62,8 @@ class ListTable extends core_1.BaseTable {
62
62
  const ListTreeStickCellPlugin = factory_1.Factory.getComponent("listTreeStickCellPlugin");
63
63
  this.listTreeStickCellPlugin = new ListTreeStickCellPlugin(this);
64
64
  }
65
- setTimeout((() => {
66
- this.isReleased || (this.resize(), this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null));
65
+ this.resize(), setTimeout((() => {
66
+ this.isReleased || this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.INITIALIZED, null);
67
67
  }), 0);
68
68
  }
69
69
  isListTable() {
@@ -336,13 +336,13 @@ class ListTable extends core_1.BaseTable {
336
336
  }) : (this.refreshRowColCount(), this._resetFrozenColCount(), this.scenegraph.createSceneGraph(),
337
337
  this.render()), options.title) {
338
338
  const Title = factory_1.Factory.getComponent("title");
339
- internalProps.title = new Title(options.title, this), this.scenegraph.resize();
339
+ internalProps.title = new Title(options.title, this);
340
340
  }
341
341
  if (this.options.emptyTip) if (this.internalProps.emptyTip) null === (_h = this.internalProps.emptyTip) || void 0 === _h || _h.resetVisible(); else {
342
342
  const EmptyTip = factory_1.Factory.getComponent("emptyTip");
343
343
  this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_j = this.internalProps.emptyTip) || void 0 === _j || _j.resetVisible();
344
344
  }
345
- return this.pluginManager.updatePlugins(options.plugins), setTimeout((() => {
345
+ return this.pluginManager.updatePlugins(options.plugins), this.resize(), setTimeout((() => {
346
346
  this.fireListeners(TABLE_EVENT_TYPE_1.TABLE_EVENT_TYPE.UPDATED, null);
347
347
  }), 0), new Promise((resolve => {
348
348
  setTimeout(resolve, 0);
@@ -622,7 +622,7 @@ class ListTable extends core_1.BaseTable {
622
622
  this.setCellCheckboxState(col, row, checked);
623
623
  }
624
624
  setRecords(records, option) {
625
- var _a, _b, _c, _d;
625
+ var _a, _b, _c, _d, _e;
626
626
  let sort;
627
627
  (0, chart_render_helper_1.clearChartRenderQueue)(), null === (_a = this.internalProps.dataSource) || void 0 === _a || _a.release(),
628
628
  this.internalProps.releaseList = null === (_b = this.internalProps.releaseList) || void 0 === _b ? void 0 : _b.filter((item => !item.dataSourceObj)),
@@ -649,12 +649,16 @@ class ListTable extends core_1.BaseTable {
649
649
  }
650
650
  this.refreshRowColCount();
651
651
  } else (0, tableHelper_1._setRecords)(this, records);
652
- if (this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(),
653
- this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize(),
654
- this.internalProps.title && !this.internalProps.title.isReleased && this.internalProps.title.resize(),
655
- this.scenegraph.resize(), this.options.emptyTip) if (this.internalProps.emptyTip) null === (_c = this.internalProps.emptyTip) || void 0 === _c || _c.resetVisible(); else {
652
+ this.stateManager.initCheckedState(records), this.clearCellStyleCache(), this.scenegraph.createSceneGraph(),
653
+ this.stateManager.updateHoverPos(oldHoverState.col, oldHoverState.row), this._updateSize();
654
+ if ((null !== (_c = this.options.componentLayoutOrder) && void 0 !== _c ? _c : [ "legend", "title" ]).forEach((component => {
655
+ var _a, _b;
656
+ "legend" === component ? null === (_a = this.internalProps.legends) || void 0 === _a || _a.forEach((legend => {
657
+ null == legend || legend.resize();
658
+ })) : "title" === component && (null === (_b = this.internalProps.title) || void 0 === _b || _b.resize());
659
+ })), this.scenegraph.resize(), this.options.emptyTip) if (this.internalProps.emptyTip) null === (_d = this.internalProps.emptyTip) || void 0 === _d || _d.resetVisible(); else {
656
660
  const EmptyTip = factory_1.Factory.getComponent("emptyTip");
657
- this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_d = this.internalProps.emptyTip) || void 0 === _d || _d.resetVisible();
661
+ this.internalProps.emptyTip = new EmptyTip(this.options.emptyTip, this), null === (_e = this.internalProps.emptyTip) || void 0 === _e || _e.resetVisible();
658
662
  }
659
663
  this.render(), (0, vutils_1.isValid)(oldHoverState.col) && (0, vutils_1.isValid)(oldHoverState.row) && oldHoverState.col >= 0 && oldHoverState.row >= 0 && setTimeout((() => {
660
664
  var _a;