tomtaw-vxe-table 3.25.18 → 3.25.20

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.
@@ -393,6 +393,7 @@ export declare const VxeGrid: import("vue/types/vue").ExtendedVue<import("vue").
393
393
  blur(): Promise<void>;
394
394
  setCustomStoreData(storeData: import("vxe-pc-ui/types/components/table").VxeTableDefines.CustomStoreData | null): Promise<void>;
395
395
  getCustomStoreData(): import("vxe-pc-ui/types/components/table").VxeTableDefines.CustomStoreData;
396
+ refreshRowContent(rows: any[]): Promise<void>;
396
397
  refreshRowExpandHeight(): Promise<void>;
397
398
  updateThumbSize(): void;
398
399
  updateThumbOffset(): void;
@@ -1024,6 +1025,7 @@ export declare const Grid: import("vue/types/vue").ExtendedVue<import("vue").def
1024
1025
  blur(): Promise<void>;
1025
1026
  setCustomStoreData(storeData: import("vxe-pc-ui/types/components/table").VxeTableDefines.CustomStoreData | null): Promise<void>;
1026
1027
  getCustomStoreData(): import("vxe-pc-ui/types/components/table").VxeTableDefines.CustomStoreData;
1028
+ refreshRowContent(rows: any[]): Promise<void>;
1027
1029
  refreshRowExpandHeight(): Promise<void>;
1028
1030
  updateThumbSize(): void;
1029
1031
  updateThumbOffset(): void;
@@ -406,6 +406,7 @@ declare const _default: import("vue/types/vue").ExtendedVue<import("vue").defaul
406
406
  blur(): Promise<void>;
407
407
  setCustomStoreData(storeData: VxeTableDefines.CustomStoreData | null): Promise<void>;
408
408
  getCustomStoreData(): VxeTableDefines.CustomStoreData;
409
+ refreshRowContent(rows: any[]): Promise<void>;
409
410
  refreshRowExpandHeight(): Promise<void>;
410
411
  updateThumbSize(): void;
411
412
  updateThumbOffset(): void;
@@ -74,7 +74,26 @@ function renderLine(h, $xeTable, rowid, params, cellHeight) {
74
74
  }
75
75
  return [];
76
76
  }
77
- function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
77
+ function getBodyCellOptions($xeTable) {
78
+ return {
79
+ cellOpts: $xeTable.computeCellOpts,
80
+ validOpts: $xeTable.computeValidOpts,
81
+ checkboxOpts: $xeTable.computeCheckboxOpts,
82
+ editOpts: $xeTable.computeEditOpts,
83
+ tooltipOpts: $xeTable.computeTooltipOpts,
84
+ virtualXOpts: $xeTable.computeVirtualXOpts,
85
+ virtualYOpts: $xeTable.computeVirtualYOpts,
86
+ rendererOpts: $xeTable.computeRendererOpts,
87
+ rowOpts: $xeTable.computeRowOpts,
88
+ rowDragOpts: $xeTable.computeRowDragOpts,
89
+ columnOpts: $xeTable.computeColumnOpts,
90
+ mouseOpts: $xeTable.computeMouseOpts,
91
+ areaOpts: $xeTable.computeAreaOpts,
92
+ defaultRowHeight: $xeTable.computeDefaultRowHeight,
93
+ cellOffsetWidth: $xeTable.computeCellOffsetWidth
94
+ };
95
+ }
96
+ function renderTdColumn(h, $xeTable, options, rowRest, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, columns, items) {
78
97
  const tableProps = $xeTable;
79
98
  const tableReactData = $xeTable;
80
99
  const tableInternalData = $xeTable;
@@ -83,29 +102,14 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
83
102
  const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
84
103
  const { tableData, tableColumn, dragRow, overflowX, overflowY, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps, currColFlag } = tableReactData;
85
104
  const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps, currentCol } = tableInternalData;
86
- const cellOpts = $xeTable.computeCellOpts;
87
- const validOpts = $xeTable.computeValidOpts;
88
- const checkboxOpts = $xeTable.computeCheckboxOpts;
89
- const editOpts = $xeTable.computeEditOpts;
90
- const tooltipOpts = $xeTable.computeTooltipOpts;
91
- const virtualXOpts = $xeTable.computeVirtualXOpts;
92
- const virtualYOpts = $xeTable.computeVirtualYOpts;
93
- const rendererOpts = $xeTable.computeRendererOpts;
105
+ const { cellOpts, validOpts, checkboxOpts, editOpts, tooltipOpts, virtualXOpts, virtualYOpts, rendererOpts, rowOpts, rowDragOpts, columnOpts, mouseOpts, areaOpts, defaultRowHeight, cellOffsetWidth } = options;
94
106
  const { isAllColumnDrag, isAllRowDrag } = $xeTable.resizableOpts;
95
- const rowOpts = $xeTable.computeRowOpts;
96
- const rowDragOpts = $xeTable.computeRowDragOpts;
97
- const defaultRowHeight = $xeTable.computeDefaultRowHeight;
98
107
  const customCellHeight = calcCellHeightFlag ? cellOpts.height || rowOpts.height : 0;
99
108
  const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = rowDragOpts;
100
- const columnOpts = $xeTable.computeColumnOpts;
101
- const mouseOpts = $xeTable.computeMouseOpts;
102
- const areaOpts = $xeTable.computeAreaOpts;
103
- const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
104
109
  const { selectCellToRow } = areaOpts;
105
110
  const { field, type, cellRender, editRender, align, showOverflow, className, treeNode, rowResize, padding, verticalAlign, slots } = column;
106
111
  const { verticalAlign: allVerticalAlign, minHeight, maxHeight } = cellOpts;
107
112
  const { actived } = editStore;
108
- const rowRest = fullAllDataRowIdData[rowid] || {};
109
113
  const colid = column.id;
110
114
  const colRest = fullColumnIdData[colid] || {};
111
115
  const renderOpts = editRender || cellRender;
@@ -487,12 +491,11 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
487
491
  const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
488
492
  const { hasFixedColumn, treeExpandedFlag, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData;
489
493
  const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps, currentRow } = tableInternalData;
490
- const checkboxOpts = $xeTable.computeCheckboxOpts;
494
+ const options = getBodyCellOptions($xeTable);
495
+ const { checkboxOpts, editOpts, rowOpts, columnOpts } = options;
491
496
  const radioOpts = $xeTable.computeRadioOpts;
492
497
  const treeOpts = $xeTable.computeTreeOpts;
493
- const editOpts = $xeTable.computeEditOpts;
494
- const rowOpts = $xeTable.computeRowOpts;
495
- const columnOpts = $xeTable.computeColumnOpts;
498
+ const currentRowId = currentRow && (rowOpts.isCurrent || tableProps.highlightCurrentRow) ? getRowid($xeTable, currentRow) : null;
496
499
  const { transform, seqMode } = treeOpts;
497
500
  const childrenField = treeOpts.children || treeOpts.childrenField;
498
501
  const rows = [];
@@ -573,12 +576,12 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
573
576
  "row--checked": checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
574
577
  "row--pending": !!pendingRowFlag && !!pendingRowMaps[rowid],
575
578
  "row--group": hasRowGroupAggregate,
576
- "row--current": currentRow && rowid === getRowid($xeTable, currentRow)
579
+ "row--current": rowid === currentRowId
577
580
  },
578
581
  rowClassName ? XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName : ""
579
582
  ];
580
583
  const tdVNs = tableColumn.map((column, $columnIndex) => {
581
- return renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
584
+ return renderTdColumn(h, $xeTable, options, rowRest, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
582
585
  });
583
586
  rows.push(
584
587
  h(
@@ -26,6 +26,8 @@ import {
26
26
  createHandleGetRowId,
27
27
  getRefElem,
28
28
  getCellRestHeight,
29
+ getUniformRowHeight,
30
+ maxYHeight,
29
31
  getLastChildColumn,
30
32
  getRowMaxHeight,
31
33
  handleCustomStoreConfig,
@@ -47,12 +49,12 @@ function isTableDestroyed($xeTable) {
47
49
  const { getConfig, getI18n, renderer, formats, interceptor, createEvent, globalEvents, GLOBAL_EVENT_KEYS } = VxeUI;
48
50
  const supportMaxRow = 5e6;
49
51
  const customStorageKey = "VXE_CUSTOM_STORE";
50
- const maxYHeight = 5e6;
51
52
  const maxXWidth = 5e6;
52
53
  const sourceType = "table";
53
54
  const customStorageQueues = /* @__PURE__ */ new WeakMap();
54
55
  const pendingExpandOffsetUpdates = /* @__PURE__ */ new WeakMap();
55
56
  const expandHeightCaches = /* @__PURE__ */ new WeakMap();
57
+ const scrollYWindowLayouts = /* @__PURE__ */ new WeakMap();
56
58
  const rowOffsetIndexes = /* @__PURE__ */ new WeakMap();
57
59
  let crossTableDragRowObj = null;
58
60
  function eqCellValue(newRow, oldRow, field) {
@@ -951,6 +953,18 @@ function updateAfterFullData($xeTable) {
951
953
  internalData.afterGroupFullData = tableTree;
952
954
  updateAfterDataIndex($xeTable);
953
955
  }
956
+ function syncReusedCurrentRows($xeTable, root, currentRow) {
957
+ const internalData = $xeTable;
958
+ const rowid = $xeTable.computeRowOpts.isCurrent || $xeTable.highlightCurrentRow ? getRowid($xeTable, currentRow) : null;
959
+ const marked = root.querySelectorAll(".row--current[rowid]");
960
+ for (let i = 0; i < marked.length; i++) {
961
+ if (marked[i].getAttribute("rowid") !== rowid) removeClass(marked[i], "row--current");
962
+ }
963
+ if (rowid !== null && internalData.visibleDataRowIdData[rowid]) {
964
+ const matches = root.querySelectorAll(`[rowid="${rowid}"]`);
965
+ for (let i = 0; i < matches.length; i++) addClass(matches[i], "row--current");
966
+ }
967
+ }
954
968
  function updateStyle($xeTable) {
955
969
  const props = $xeTable;
956
970
  const reactData = $xeTable;
@@ -2109,11 +2123,8 @@ function computeRowHeight($xeTable) {
2109
2123
  function handleVirtualYVisible($xeTable) {
2110
2124
  const reactData = $xeTable;
2111
2125
  const internalData = $xeTable;
2112
- const { isAllOverflow, expandColumn, isScrollYBig, scrollYHeight } = reactData;
2113
- const { elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData } = internalData;
2114
- const rowOpts = $xeTable.computeRowOpts;
2115
- const cellOpts = $xeTable.computeCellOpts;
2116
- const defaultRowHeight = $xeTable.computeDefaultRowHeight;
2126
+ const { isScrollYBig, scrollYHeight } = reactData;
2127
+ const { elemStore, afterFullData, fullAllDataRowIdData } = internalData;
2117
2128
  const bodyScrollElem = getRefElem(elemStore["main-body-scroll"]);
2118
2129
  if (bodyScrollElem) {
2119
2130
  const clientHeight = bodyScrollElem.clientHeight;
@@ -2125,10 +2136,10 @@ function handleVirtualYVisible($xeTable) {
2125
2136
  const endTop = scrollTop + clientHeight;
2126
2137
  let toVisibleIndex = -1;
2127
2138
  let visibleSize = 0;
2128
- const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
2129
- if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
2130
- toVisibleIndex = Math.floor(startTop / defaultRowHeight) - 1;
2131
- visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
2139
+ const uniformHeight = getUniformRowHeight($xeTable);
2140
+ if (uniformHeight) {
2141
+ toVisibleIndex = Math.max(0, Math.floor(startTop / uniformHeight) - 1);
2142
+ visibleSize = $xeTable.computeCellOpts.height || $xeTable.computeRowOpts.height ? Math.min(afterFullData.length - toVisibleIndex, Math.floor(endTop / uniformHeight) + 2 - toVisibleIndex) : Math.ceil(clientHeight / uniformHeight) + 1;
2132
2143
  } else {
2133
2144
  const { handleGetRowId } = createHandleGetRowId($xeTable);
2134
2145
  let leftIndex = 0;
@@ -4182,7 +4193,7 @@ function handleInitColumn($xeTable, collectColumn) {
4182
4193
  return buildColumnInfo($xeTable);
4183
4194
  });
4184
4195
  }
4185
- function loadScrollYData($xeTable) {
4196
+ function loadScrollYData($xeTable, fromScroll = false) {
4186
4197
  const reactData = $xeTable;
4187
4198
  const internalData = $xeTable;
4188
4199
  const { isAllOverflow, isScrollYBig } = reactData;
@@ -4204,7 +4215,7 @@ function loadScrollYData($xeTable) {
4204
4215
  if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
4205
4216
  scrollYStore.startIndex = offsetStartIndex;
4206
4217
  scrollYStore.endIndex = offsetEndIndex;
4207
- $xeTable.updateScrollYData();
4218
+ $xeTable.updateScrollYData(fromScroll);
4208
4219
  }
4209
4220
  }
4210
4221
  }
@@ -4265,12 +4276,12 @@ function lazyScrollYData($xeTable) {
4265
4276
  }
4266
4277
  if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
4267
4278
  internalData.lyRunTime = Date.now();
4268
- loadScrollYData($xeTable);
4279
+ loadScrollYData($xeTable, true);
4269
4280
  }
4270
4281
  internalData.lyTimeout = setTimeout(() => {
4271
4282
  internalData.lyTimeout = void 0;
4272
4283
  internalData.lyRunTime = void 0;
4273
- loadScrollYData($xeTable);
4284
+ loadScrollYData($xeTable, true);
4274
4285
  }, fpsTime);
4275
4286
  }
4276
4287
  function measureScrollRowOffsets($xeTable) {
@@ -5109,6 +5120,39 @@ const tableMethods = {
5109
5120
  return $xeTable.$nextTick().then(() => loadTableData($xeTable, internalData.tableFullData, true, true));
5110
5121
  });
5111
5122
  },
5123
+ /** 只改变现有行的展示内容。数据模型或尺寸依赖行值时,沿用完整更新。 */
5124
+ refreshRowContent(rows) {
5125
+ const $xeTable = this;
5126
+ const internalData = $xeTable;
5127
+ const reactData = $xeTable;
5128
+ if (!rows.length) return $xeTable.$nextTick();
5129
+ const { fullDataRowIdData, visibleDataRowIdData, tableFullColumn } = internalData;
5130
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
5131
+ let hasVisibleRow = false;
5132
+ let staleRow = false;
5133
+ for (const row of rows) {
5134
+ const id = handleGetRowId(row);
5135
+ const rest = fullDataRowIdData[id];
5136
+ if (rest && rest.row === row) {
5137
+ rest.formatData = void 0;
5138
+ if (visibleDataRowIdData[id] === row) hasVisibleRow = true;
5139
+ } else {
5140
+ staleRow = true;
5141
+ }
5142
+ }
5143
+ const remoteFilter = $xeTable.computeFilterOpts.remote;
5144
+ const remoteSort = $xeTable.computeSortOpts.remote;
5145
+ if (staleRow || !reactData.isAllOverflow || internalData.isResizeCellHeight || $xeTable.treeConfig || reactData.isRowGroupStatus || reactData.expandColumn || $xeTable.showFooter || $xeTable.spanMethod || internalData.mergeBodyList.length || internalData.xeGanttView || $xeTable.computeAutoWidthColumnList.length || tableFullColumn.some((column) => !remoteSort && column.sortable && column.order || !remoteFilter && column.filters && column.filters.some((item) => item.checked))) {
5146
+ return $xeTable.updateData();
5147
+ }
5148
+ if (hasVisibleRow) {
5149
+ for (const ref of ["refTableBody", "leftBody", "rightBody"]) {
5150
+ const body = $xeTable.$refs[ref];
5151
+ if (body) body.$forceUpdate();
5152
+ }
5153
+ }
5154
+ return $xeTable.$nextTick();
5155
+ },
5112
5156
  /**
5113
5157
  * 手动处理数据,用于手动排序与筛选
5114
5158
  * 对于手动更改了排序、筛选...等条件后需要重新处理数据时可能会用到
@@ -12439,7 +12483,7 @@ const tableMethods = {
12439
12483
  const $xeTable = this;
12440
12484
  const virtualYOpts = $xeTable.computeVirtualYOpts;
12441
12485
  if (virtualYOpts.immediate) {
12442
- loadScrollYData($xeTable);
12486
+ loadScrollYData($xeTable, true);
12443
12487
  } else {
12444
12488
  lazyScrollYData($xeTable);
12445
12489
  }
@@ -12918,13 +12962,14 @@ const tableMethods = {
12918
12962
  });
12919
12963
  }
12920
12964
  },
12921
- updateScrollYData() {
12965
+ updateScrollYData(fromScroll = false) {
12922
12966
  const $xeTable = this;
12923
12967
  $xeTable.handleTableData();
12924
12968
  $xeTable.updateScrollYSpace(true);
12925
12969
  return $xeTable.$nextTick().then(() => {
12970
+ if (isTableDestroyed($xeTable)) return;
12926
12971
  $xeTable.handleTableData(false, true);
12927
- $xeTable.updateScrollYSpace();
12972
+ $xeTable.updateScrollYSpace(false, fromScroll);
12928
12973
  });
12929
12974
  },
12930
12975
  handleSyncScrollTop(params) {
@@ -12938,7 +12983,7 @@ const tableMethods = {
12938
12983
  }
12939
12984
  },
12940
12985
  // 更新纵向 Y 可视渲染上下剩余空间大小
12941
- updateScrollYSpace(beforeWindowCommit = false) {
12986
+ updateScrollYSpace(beforeWindowCommit = false, fromScroll = false) {
12942
12987
  const $xeTable = this;
12943
12988
  const reactData = $xeTable;
12944
12989
  const internalData = $xeTable;
@@ -12959,13 +13004,13 @@ const tableMethods = {
12959
13004
  let sYHeight = scrollYHeight;
12960
13005
  let isScrollYBig = false;
12961
13006
  if (scrollYLoad) {
12962
- const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
12963
- if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
12964
- sYHeight = afterFullData.length * defaultRowHeight;
13007
+ const uniformHeight = getUniformRowHeight($xeTable);
13008
+ if (uniformHeight) {
13009
+ sYHeight = afterFullData.length * uniformHeight;
12965
13010
  if (sYHeight > maxYHeight) {
12966
13011
  isScrollYBig = true;
12967
13012
  }
12968
- ySpaceTop = Math.max(0, startIndex * defaultRowHeight);
13013
+ ySpaceTop = Math.max(0, startIndex * uniformHeight);
12969
13014
  } else {
12970
13015
  const firstRow = afterFullData[startIndex];
12971
13016
  if (firstRow) {
@@ -13034,10 +13079,50 @@ const tableMethods = {
13034
13079
  rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
13035
13080
  }
13036
13081
  }
13037
- if (beforeWindowCommit && scrollYLoad && overflowY && isAllOverflow && !expandColumn && !isResizeCellHeight && !$xeTable.treeConfig && !$xeGanttView && !isScrollYBig && !reactData.isScrollYBig && scrollYHeight === ySpaceHeight && bodyTableElem && clientHeight > 0 && sYHeight > clientHeight) {
13082
+ const stableSpace = scrollYLoad && overflowY && isAllOverflow && !expandColumn && !isResizeCellHeight && !$xeTable.treeConfig && !$xeGanttView && !isScrollYBig && !reactData.isScrollYBig && scrollYHeight === ySpaceHeight && bodyTableElem && clientHeight > 0 && sYHeight > clientHeight;
13083
+ if (stableSpace && beforeWindowCommit) {
13038
13084
  reactData.scrollYTop = scrollYTop;
13039
13085
  return;
13040
13086
  }
13087
+ const root = $xeTable.$refs.refElem;
13088
+ if (stableSpace && fromScroll && root && bodyScrollElem && (cellOpts.height || rowOpts.height) && internalData.customHeight > 0 && !$xeTable.computeAutoWidthColumnList.length && !$xeTable.spanMethod && !internalData.mergeBodyList.length && !($xeTable.mouseConfig && mouseOpts.selected)) {
13089
+ const header = getRefElem(elemStore["main-header-table"]);
13090
+ const footer = getRefElem(elemStore["main-footer-table"]);
13091
+ const layout = [
13092
+ afterFullData,
13093
+ afterFullData.length,
13094
+ ySpaceHeight,
13095
+ cellOpts.height || rowOpts.height,
13096
+ reactData.tableColumn,
13097
+ reactData.updateColFlag,
13098
+ reactData.resizeWidthFlag,
13099
+ reactData.scrollXWidth,
13100
+ bodyTableElem,
13101
+ leftBodyTableElem,
13102
+ rightbodyTableElem,
13103
+ bodyScrollElem.clientWidth,
13104
+ clientHeight,
13105
+ root.clientWidth,
13106
+ root.clientHeight,
13107
+ header && header.clientHeight,
13108
+ footer && footer.clientHeight,
13109
+ internalData.customHeight,
13110
+ $xeTable.computeScrollbarOpts,
13111
+ reactData.scrollbarWidth,
13112
+ reactData.scrollbarHeight
13113
+ ];
13114
+ const previous = scrollYWindowLayouts.get($xeTable);
13115
+ if (previous && layout.every((value, index) => value === previous[index])) {
13116
+ if (internalData.currentRow && !$xeTable.rowKey && !rowOpts.useKey) {
13117
+ syncReusedCurrentRows($xeTable, root, internalData.currentRow);
13118
+ }
13119
+ reactData.scrollYTop = scrollYTop;
13120
+ return;
13121
+ }
13122
+ scrollYWindowLayouts.set($xeTable, layout);
13123
+ } else {
13124
+ scrollYWindowLayouts.delete($xeTable);
13125
+ }
13041
13126
  containerList.forEach((name) => {
13042
13127
  const layoutList = ["header", "body", "footer"];
13043
13128
  layoutList.forEach((layout) => {
@@ -1345,13 +1345,13 @@ var table_default = {
1345
1345
  const $xeTable = this;
1346
1346
  const props = $xeTable;
1347
1347
  const reactData = $xeTable;
1348
- const { spanMethod, footerSpanMethod } = props;
1348
+ const { spanMethod } = props;
1349
1349
  const { scrollXLoad, scrollYLoad, isAllOverflow, expandColumn } = reactData;
1350
1350
  const bodyMergeCoverFixed = $xeTable.computeBodyMergeCoverFixed;
1351
1351
  const expandOpts = $xeTable.computeExpandOpts;
1352
1352
  let isOptimizeMode = false;
1353
1353
  if (scrollXLoad || scrollYLoad || isAllOverflow) {
1354
- if (expandColumn && expandOpts.mode !== "fixed" || bodyMergeCoverFixed || spanMethod || footerSpanMethod) {
1354
+ if (expandColumn && expandOpts.mode !== "fixed" || bodyMergeCoverFixed || spanMethod) {
1355
1355
  } else {
1356
1356
  isOptimizeMode = true;
1357
1357
  }
@@ -27,7 +27,9 @@ export declare function encodeRowid(rowVal: string | number): string;
27
27
  export declare function getCalcHeight(height: number | 'unset' | undefined | null): number;
28
28
  export declare function handleFieldOrColumn($xeTable: VxeTableConstructor, fieldOrColumn: any): any;
29
29
  export declare function handleRowidOrRow($xeTable: VxeTableConstructor, rowidOrRow: any): any;
30
- export declare function getCellRestHeight(rowRest: VxeTableDefines.RowCacheItem, cellOpts: VxeTablePropTypes.CellConfig, rowOpts: VxeTablePropTypes.RowConfig, defaultRowHeight: number): number;
30
+ export declare function getCellRestHeight(rowRest: Pick<VxeTableDefines.RowCacheItem, 'height' | 'resizeHeight'>, cellOpts: VxeTablePropTypes.CellConfig, rowOpts: VxeTablePropTypes.RowConfig, defaultRowHeight: number): number;
31
+ export declare const maxYHeight = 5000000;
32
+ export declare function getUniformRowHeight($xeTable: VxeTableConstructor): number;
31
33
  export declare function assembleColumn(_vm: any): void;
32
34
  export declare function destroyColumn(_vm: any): void;
33
35
  export declare function getRootColumn($xeTable: VxeTableConstructor & VxeTablePrivateMethods, column: any): any;
@@ -704,6 +704,14 @@ function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
704
704
  }
705
705
  return cellHeight;
706
706
  }
707
+ const maxYHeight = 5e6;
708
+ function getUniformRowHeight($xeTable) {
709
+ const reactData = $xeTable;
710
+ const internalData = $xeTable;
711
+ if (!reactData.isAllOverflow || reactData.expandColumn || internalData.isResizeCellHeight) return 0;
712
+ const height = getCellRestHeight({ height: 0, resizeHeight: 0 }, $xeTable.computeCellOpts, $xeTable.computeRowOpts, $xeTable.computeDefaultRowHeight);
713
+ return Number.isFinite(height) && height > 0 ? height : 0;
714
+ }
707
715
  function assembleColumn(_vm) {
708
716
  const $xeTable = _vm.$xeTable;
709
717
  const reactData = $xeTable;
@@ -929,8 +937,8 @@ function createColumn($xeTable, options, renderOptions) {
929
937
  function rowToVisible($xeTable, row) {
930
938
  const reactData = $xeTable;
931
939
  const internalData = $xeTable;
932
- const { scrollYLoad, scrollYTop, isAllOverflow } = reactData;
933
- const { elemStore, afterFullData, fullAllDataRowIdData, isResizeCellHeight } = internalData;
940
+ const { scrollYLoad, scrollYTop, isScrollYBig, scrollYHeight } = reactData;
941
+ const { elemStore, afterFullData, fullAllDataRowIdData } = internalData;
934
942
  const rowOpts = $xeTable.computeRowOpts;
935
943
  const cellOpts = $xeTable.computeCellOpts;
936
944
  const defaultRowHeight = $xeTable.computeDefaultRowHeight;
@@ -952,17 +960,21 @@ function rowToVisible($xeTable, row) {
952
960
  }
953
961
  } else {
954
962
  if (scrollYLoad) {
955
- const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
956
- if (!isCustomCellHeight && isAllOverflow) {
957
- return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
958
- }
959
- const rowRest = fullAllDataRowIdData[rowid] || {};
960
- const rHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
961
- const scrollTop = rowRest.oTop;
962
- if (scrollTop < bodyScrollTop) {
963
- return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
963
+ const rowRest = fullAllDataRowIdData[rowid];
964
+ if (!rowRest) return Promise.resolve();
965
+ const uniformHeight = getUniformRowHeight($xeTable);
966
+ const rHeight = uniformHeight || getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
967
+ const index = rowRest._index;
968
+ if (uniformHeight && afterFullData[index] !== rowRest.row) return Promise.resolve();
969
+ const rowTop = uniformHeight ? index * rHeight : rowRest.oTop;
970
+ const scale = isScrollYBig ? (maxYHeight - bodyHeight) / (scrollYHeight - bodyHeight) : 1;
971
+ let target = rowTop + rHeight - (bodyHeight - rightFixedWidth - 1);
972
+ if (uniformHeight && !cellOpts.height && !rowOpts.height) {
973
+ target = rowTop - rHeight;
974
+ } else if (rowTop < bodyScrollTop / scale) {
975
+ target = rowTop - leftFixedWidth - 1;
964
976
  }
965
- return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight - rightFixedWidth - 1));
977
+ return $xeTable.scrollTo(null, isScrollYBig ? Math.round(target * scale) : target);
966
978
  }
967
979
  }
968
980
  }
@@ -1082,11 +1094,13 @@ export {
1082
1094
  getRowUniqueId,
1083
1095
  getRowid,
1084
1096
  getRowkey,
1097
+ getUniformRowHeight,
1085
1098
  handleCustomStoreConfig,
1086
1099
  handleFieldOrColumn,
1087
1100
  handleRowidOrRow,
1088
1101
  hasDeepKey,
1089
1102
  isColumnInfo,
1103
+ maxYHeight,
1090
1104
  restoreScrollLocation,
1091
1105
  rowToVisible,
1092
1106
  setCellValue,
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.20";
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.20"}`;
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}` : "";