tomtaw-vxe-table 3.25.18 → 3.25.19

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.
@@ -53,6 +53,7 @@ const sourceType = "table";
53
53
  const customStorageQueues = /* @__PURE__ */ new WeakMap();
54
54
  const pendingExpandOffsetUpdates = /* @__PURE__ */ new WeakMap();
55
55
  const expandHeightCaches = /* @__PURE__ */ new WeakMap();
56
+ const scrollYWindowLayouts = /* @__PURE__ */ new WeakMap();
56
57
  const rowOffsetIndexes = /* @__PURE__ */ new WeakMap();
57
58
  let crossTableDragRowObj = null;
58
59
  function eqCellValue(newRow, oldRow, field) {
@@ -4182,7 +4183,7 @@ function handleInitColumn($xeTable, collectColumn) {
4182
4183
  return buildColumnInfo($xeTable);
4183
4184
  });
4184
4185
  }
4185
- function loadScrollYData($xeTable) {
4186
+ function loadScrollYData($xeTable, fromScroll = false) {
4186
4187
  const reactData = $xeTable;
4187
4188
  const internalData = $xeTable;
4188
4189
  const { isAllOverflow, isScrollYBig } = reactData;
@@ -4204,7 +4205,7 @@ function loadScrollYData($xeTable) {
4204
4205
  if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
4205
4206
  scrollYStore.startIndex = offsetStartIndex;
4206
4207
  scrollYStore.endIndex = offsetEndIndex;
4207
- $xeTable.updateScrollYData();
4208
+ $xeTable.updateScrollYData(fromScroll);
4208
4209
  }
4209
4210
  }
4210
4211
  }
@@ -4265,12 +4266,12 @@ function lazyScrollYData($xeTable) {
4265
4266
  }
4266
4267
  if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
4267
4268
  internalData.lyRunTime = Date.now();
4268
- loadScrollYData($xeTable);
4269
+ loadScrollYData($xeTable, true);
4269
4270
  }
4270
4271
  internalData.lyTimeout = setTimeout(() => {
4271
4272
  internalData.lyTimeout = void 0;
4272
4273
  internalData.lyRunTime = void 0;
4273
- loadScrollYData($xeTable);
4274
+ loadScrollYData($xeTable, true);
4274
4275
  }, fpsTime);
4275
4276
  }
4276
4277
  function measureScrollRowOffsets($xeTable) {
@@ -12439,7 +12440,7 @@ const tableMethods = {
12439
12440
  const $xeTable = this;
12440
12441
  const virtualYOpts = $xeTable.computeVirtualYOpts;
12441
12442
  if (virtualYOpts.immediate) {
12442
- loadScrollYData($xeTable);
12443
+ loadScrollYData($xeTable, true);
12443
12444
  } else {
12444
12445
  lazyScrollYData($xeTable);
12445
12446
  }
@@ -12918,13 +12919,14 @@ const tableMethods = {
12918
12919
  });
12919
12920
  }
12920
12921
  },
12921
- updateScrollYData() {
12922
+ updateScrollYData(fromScroll = false) {
12922
12923
  const $xeTable = this;
12923
12924
  $xeTable.handleTableData();
12924
12925
  $xeTable.updateScrollYSpace(true);
12925
12926
  return $xeTable.$nextTick().then(() => {
12927
+ if (isTableDestroyed($xeTable)) return;
12926
12928
  $xeTable.handleTableData(false, true);
12927
- $xeTable.updateScrollYSpace();
12929
+ $xeTable.updateScrollYSpace(false, fromScroll);
12928
12930
  });
12929
12931
  },
12930
12932
  handleSyncScrollTop(params) {
@@ -12938,7 +12940,7 @@ const tableMethods = {
12938
12940
  }
12939
12941
  },
12940
12942
  // 更新纵向 Y 可视渲染上下剩余空间大小
12941
- updateScrollYSpace(beforeWindowCommit = false) {
12943
+ updateScrollYSpace(beforeWindowCommit = false, fromScroll = false) {
12942
12944
  const $xeTable = this;
12943
12945
  const reactData = $xeTable;
12944
12946
  const internalData = $xeTable;
@@ -13034,10 +13036,47 @@ const tableMethods = {
13034
13036
  rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
13035
13037
  }
13036
13038
  }
13037
- if (beforeWindowCommit && scrollYLoad && overflowY && isAllOverflow && !expandColumn && !isResizeCellHeight && !$xeTable.treeConfig && !$xeGanttView && !isScrollYBig && !reactData.isScrollYBig && scrollYHeight === ySpaceHeight && bodyTableElem && clientHeight > 0 && sYHeight > clientHeight) {
13039
+ const stableSpace = scrollYLoad && overflowY && isAllOverflow && !expandColumn && !isResizeCellHeight && !$xeTable.treeConfig && !$xeGanttView && !isScrollYBig && !reactData.isScrollYBig && scrollYHeight === ySpaceHeight && bodyTableElem && clientHeight > 0 && sYHeight > clientHeight;
13040
+ if (stableSpace && beforeWindowCommit) {
13038
13041
  reactData.scrollYTop = scrollYTop;
13039
13042
  return;
13040
13043
  }
13044
+ const root = $xeTable.$refs.refElem;
13045
+ if (stableSpace && fromScroll && root && bodyScrollElem && (cellOpts.height || rowOpts.height) && internalData.customHeight > 0 && !$xeTable.computeAutoWidthColumnList.length && !$xeTable.spanMethod && !internalData.mergeBodyList.length && !internalData.currentRow && !($xeTable.mouseConfig && mouseOpts.selected)) {
13046
+ const header = getRefElem(elemStore["main-header-table"]);
13047
+ const footer = getRefElem(elemStore["main-footer-table"]);
13048
+ const layout = [
13049
+ afterFullData,
13050
+ afterFullData.length,
13051
+ ySpaceHeight,
13052
+ cellOpts.height || rowOpts.height,
13053
+ reactData.tableColumn,
13054
+ reactData.updateColFlag,
13055
+ reactData.resizeWidthFlag,
13056
+ reactData.scrollXWidth,
13057
+ bodyTableElem,
13058
+ leftBodyTableElem,
13059
+ rightbodyTableElem,
13060
+ bodyScrollElem.clientWidth,
13061
+ clientHeight,
13062
+ root.clientWidth,
13063
+ root.clientHeight,
13064
+ header && header.clientHeight,
13065
+ footer && footer.clientHeight,
13066
+ internalData.customHeight,
13067
+ $xeTable.computeScrollbarOpts,
13068
+ reactData.scrollbarWidth,
13069
+ reactData.scrollbarHeight
13070
+ ];
13071
+ const previous = scrollYWindowLayouts.get($xeTable);
13072
+ if (previous && layout.every((value, index) => value === previous[index])) {
13073
+ reactData.scrollYTop = scrollYTop;
13074
+ return;
13075
+ }
13076
+ scrollYWindowLayouts.set($xeTable, layout);
13077
+ } else {
13078
+ scrollYWindowLayouts.delete($xeTable);
13079
+ }
13041
13080
  containerList.forEach((name) => {
13042
13081
  const layoutList = ["header", "body", "footer"];
13043
13082
  layoutList.forEach((layout) => {
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from "@vxe-ui/core";
2
2
  import { getFuncText } from "./src/utils";
3
- const version = "3.25.18";
3
+ const version = "3.25.19";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from "@vxe-ui/core";
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"3.25.18"}`;
3
+ const tableVersion = `table v${"3.25.19"}`;
4
4
  function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : "";
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : "";
package/lib/index.umd.js CHANGED
@@ -323,7 +323,7 @@ function getDefaultConfig(val1, def1) {
323
323
  }
324
324
 
325
325
  // packages_temp/ui/index.ts
326
- var version = "3.25.18";
326
+ var version = "3.25.19";
327
327
  import_core2.VxeUI.version = version;
328
328
  import_core2.VxeUI.tableVersion = version;
329
329
  import_core2.VxeUI.setConfig({
@@ -1167,7 +1167,7 @@ function getPopupAppendElement(appendTo) {
1167
1167
  // packages_temp/ui/src/log.ts
1168
1168
  var import_core3 = require("@vxe-ui/core");
1169
1169
  var { log } = import_core3.VxeUI;
1170
- var tableVersion = `table v${"3.25.18"}`;
1170
+ var tableVersion = `table v${"3.25.19"}`;
1171
1171
  function createComponentLog(name) {
1172
1172
  const uiVersion = import_core3.VxeUI.uiVersion ? `ui v${import_core3.VxeUI.uiVersion}` : "";
1173
1173
  const ganttVersion = import_core3.VxeUI.ganttVersion ? `gantt v${import_core3.VxeUI.ganttVersion}` : "";
@@ -4950,6 +4950,7 @@ var sourceType = "table";
4950
4950
  var customStorageQueues = /* @__PURE__ */ new WeakMap();
4951
4951
  var pendingExpandOffsetUpdates = /* @__PURE__ */ new WeakMap();
4952
4952
  var expandHeightCaches = /* @__PURE__ */ new WeakMap();
4953
+ var scrollYWindowLayouts = /* @__PURE__ */ new WeakMap();
4953
4954
  var rowOffsetIndexes = /* @__PURE__ */ new WeakMap();
4954
4955
  var crossTableDragRowObj = null;
4955
4956
  function eqCellValue(newRow, oldRow, field) {
@@ -9079,7 +9080,7 @@ function handleInitColumn($xeTable, collectColumn) {
9079
9080
  return buildColumnInfo($xeTable);
9080
9081
  });
9081
9082
  }
9082
- function loadScrollYData($xeTable) {
9083
+ function loadScrollYData($xeTable, fromScroll = false) {
9083
9084
  const reactData = $xeTable;
9084
9085
  const internalData = $xeTable;
9085
9086
  const { isAllOverflow, isScrollYBig } = reactData;
@@ -9101,7 +9102,7 @@ function loadScrollYData($xeTable) {
9101
9102
  if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
9102
9103
  scrollYStore.startIndex = offsetStartIndex;
9103
9104
  scrollYStore.endIndex = offsetEndIndex;
9104
- $xeTable.updateScrollYData();
9105
+ $xeTable.updateScrollYData(fromScroll);
9105
9106
  }
9106
9107
  }
9107
9108
  }
@@ -9162,12 +9163,12 @@ function lazyScrollYData($xeTable) {
9162
9163
  }
9163
9164
  if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
9164
9165
  internalData.lyRunTime = Date.now();
9165
- loadScrollYData($xeTable);
9166
+ loadScrollYData($xeTable, true);
9166
9167
  }
9167
9168
  internalData.lyTimeout = setTimeout(() => {
9168
9169
  internalData.lyTimeout = void 0;
9169
9170
  internalData.lyRunTime = void 0;
9170
- loadScrollYData($xeTable);
9171
+ loadScrollYData($xeTable, true);
9171
9172
  }, fpsTime);
9172
9173
  }
9173
9174
  function measureScrollRowOffsets($xeTable) {
@@ -17336,7 +17337,7 @@ var tableMethods = {
17336
17337
  const $xeTable = this;
17337
17338
  const virtualYOpts = $xeTable.computeVirtualYOpts;
17338
17339
  if (virtualYOpts.immediate) {
17339
- loadScrollYData($xeTable);
17340
+ loadScrollYData($xeTable, true);
17340
17341
  } else {
17341
17342
  lazyScrollYData($xeTable);
17342
17343
  }
@@ -17815,13 +17816,14 @@ var tableMethods = {
17815
17816
  });
17816
17817
  }
17817
17818
  },
17818
- updateScrollYData() {
17819
+ updateScrollYData(fromScroll = false) {
17819
17820
  const $xeTable = this;
17820
17821
  $xeTable.handleTableData();
17821
17822
  $xeTable.updateScrollYSpace(true);
17822
17823
  return $xeTable.$nextTick().then(() => {
17824
+ if (isTableDestroyed($xeTable)) return;
17823
17825
  $xeTable.handleTableData(false, true);
17824
- $xeTable.updateScrollYSpace();
17826
+ $xeTable.updateScrollYSpace(false, fromScroll);
17825
17827
  });
17826
17828
  },
17827
17829
  handleSyncScrollTop(params) {
@@ -17835,7 +17837,7 @@ var tableMethods = {
17835
17837
  }
17836
17838
  },
17837
17839
  // 更新纵向 Y 可视渲染上下剩余空间大小
17838
- updateScrollYSpace(beforeWindowCommit = false) {
17840
+ updateScrollYSpace(beforeWindowCommit = false, fromScroll = false) {
17839
17841
  const $xeTable = this;
17840
17842
  const reactData = $xeTable;
17841
17843
  const internalData = $xeTable;
@@ -17931,10 +17933,47 @@ var tableMethods = {
17931
17933
  rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
17932
17934
  }
17933
17935
  }
17934
- if (beforeWindowCommit && scrollYLoad && overflowY && isAllOverflow && !expandColumn && !isResizeCellHeight && !$xeTable.treeConfig && !$xeGanttView && !isScrollYBig && !reactData.isScrollYBig && scrollYHeight === ySpaceHeight && bodyTableElem && clientHeight > 0 && sYHeight > clientHeight) {
17936
+ const stableSpace = scrollYLoad && overflowY && isAllOverflow && !expandColumn && !isResizeCellHeight && !$xeTable.treeConfig && !$xeGanttView && !isScrollYBig && !reactData.isScrollYBig && scrollYHeight === ySpaceHeight && bodyTableElem && clientHeight > 0 && sYHeight > clientHeight;
17937
+ if (stableSpace && beforeWindowCommit) {
17935
17938
  reactData.scrollYTop = scrollYTop;
17936
17939
  return;
17937
17940
  }
17941
+ const root = $xeTable.$refs.refElem;
17942
+ if (stableSpace && fromScroll && root && bodyScrollElem && (cellOpts.height || rowOpts.height) && internalData.customHeight > 0 && !$xeTable.computeAutoWidthColumnList.length && !$xeTable.spanMethod && !internalData.mergeBodyList.length && !internalData.currentRow && !($xeTable.mouseConfig && mouseOpts.selected)) {
17943
+ const header = getRefElem(elemStore["main-header-table"]);
17944
+ const footer = getRefElem(elemStore["main-footer-table"]);
17945
+ const layout = [
17946
+ afterFullData,
17947
+ afterFullData.length,
17948
+ ySpaceHeight,
17949
+ cellOpts.height || rowOpts.height,
17950
+ reactData.tableColumn,
17951
+ reactData.updateColFlag,
17952
+ reactData.resizeWidthFlag,
17953
+ reactData.scrollXWidth,
17954
+ bodyTableElem,
17955
+ leftBodyTableElem,
17956
+ rightbodyTableElem,
17957
+ bodyScrollElem.clientWidth,
17958
+ clientHeight,
17959
+ root.clientWidth,
17960
+ root.clientHeight,
17961
+ header && header.clientHeight,
17962
+ footer && footer.clientHeight,
17963
+ internalData.customHeight,
17964
+ $xeTable.computeScrollbarOpts,
17965
+ reactData.scrollbarWidth,
17966
+ reactData.scrollbarHeight
17967
+ ];
17968
+ const previous = scrollYWindowLayouts.get($xeTable);
17969
+ if (previous && layout.every((value, index) => value === previous[index])) {
17970
+ reactData.scrollYTop = scrollYTop;
17971
+ return;
17972
+ }
17973
+ scrollYWindowLayouts.set($xeTable, layout);
17974
+ } else {
17975
+ scrollYWindowLayouts.delete($xeTable);
17976
+ }
17938
17977
  containerList.forEach((name) => {
17939
17978
  const layoutList = ["header", "body", "footer"];
17940
17979
  layoutList.forEach((layout) => {