@juzhenfe/page-model 3.21.2 → 3.21.3

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.
@@ -240,6 +240,8 @@ export default class TableManager extends IManager {
240
240
  * 识别数据标识,如果没有携带标志,自动生成
241
241
  */
242
242
  setTableDataRowKey(data: any[]): any[];
243
+ updateDataCallbacks: (() => void)[];
244
+ addUpdateDataCallback(callback: () => void): void;
243
245
  /**
244
246
  * 更新表格数据源
245
247
  * @param data
@@ -1,2 +1,4 @@
1
1
  import { Ref } from 'vue';
2
- export declare const useVirtualTableHeight: (tableWrapRef: Ref<any>, currentTableHeight: Ref<string>) => void;
2
+ export declare const useVirtualTableHeight: (tableWrapRef: Ref<any>, currentTableHeight: Ref<string>) => {
3
+ updateHeight: () => void;
4
+ };
package/dist/index.es.js CHANGED
@@ -4702,6 +4702,7 @@ class TableManager extends IManager {
4702
4702
  __publicField(this, "focusCellKey");
4703
4703
  __publicField(this, "focusEl");
4704
4704
  __publicField(this, "documentClickHandler");
4705
+ __publicField(this, "updateDataCallbacks", []);
4705
4706
  __publicField(this, "radioData", null);
4706
4707
  __publicField(this, "currentFilterTableEls", []);
4707
4708
  __publicField(this, "currentRenderTableEls");
@@ -5193,6 +5194,9 @@ class TableManager extends IManager {
5193
5194
  return item;
5194
5195
  });
5195
5196
  }
5197
+ addUpdateDataCallback(callback) {
5198
+ this.updateDataCallbacks.push(callback);
5199
+ }
5196
5200
  updateData(data4) {
5197
5201
  this.isDataUpdating = true;
5198
5202
  this.tableData = this.setTableDataRowKey(data4);
@@ -5204,6 +5208,9 @@ class TableManager extends IManager {
5204
5208
  }
5205
5209
  setTimeout(() => {
5206
5210
  this.isDataUpdating = false;
5211
+ this.updateDataCallbacks.forEach((callback) => {
5212
+ callback();
5213
+ });
5207
5214
  }, 0);
5208
5215
  }
5209
5216
  clearElTableSelection() {
@@ -5511,6 +5518,7 @@ class TableManager extends IManager {
5511
5518
  }
5512
5519
  destroy() {
5513
5520
  this.removeCellOutClickEvent();
5521
+ this.updateDataCallbacks = [];
5514
5522
  }
5515
5523
  }
5516
5524
  const _sfc_main$B = defineComponent({
@@ -10739,6 +10747,9 @@ const useVirtualTableHeight = function(tableWrapRef, currentTableHeight) {
10739
10747
  onUnmounted(() => {
10740
10748
  windowResize.remove("resize", updateHeight);
10741
10749
  });
10750
+ return {
10751
+ updateHeight
10752
+ };
10742
10753
  };
10743
10754
  var index_vue_vue_type_style_index_0_lang$5 = "";
10744
10755
  const __default__$a = {
@@ -10930,7 +10941,8 @@ const _sfc_main$l = defineComponent({
10930
10941
  });
10931
10942
  }
10932
10943
  if (table.value.virtual) {
10933
- useVirtualTableHeight(tableWrapRef, currentTableHeight);
10944
+ const { updateHeight } = useVirtualTableHeight(tableWrapRef, currentTableHeight);
10945
+ tableManager.addUpdateDataCallback(updateHeight);
10934
10946
  }
10935
10947
  setTimeout(() => {
10936
10948
  doTableLayout();
@@ -15759,7 +15771,7 @@ const defineEditableTable = function(config) {
15759
15771
  };
15760
15772
  var iconfont = "";
15761
15773
  const name = "@juzhenfe/page-model";
15762
- const version = "3.21.2";
15774
+ const version = "3.21.3";
15763
15775
  const types = "dist/main.d.ts";
15764
15776
  const main = "dist/index.umd.js";
15765
15777
  const keywords = [