vxe-table 4.10.6-beta.7 → 4.10.6-beta.9

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.
Files changed (49) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.min.css +1 -1
  3. package/es/style.css +1 -1
  4. package/es/style.min.css +1 -1
  5. package/es/table/src/body.js +40 -27
  6. package/es/table/src/footer.js +4 -4
  7. package/es/table/src/header.js +11 -6
  8. package/es/table/src/table.js +298 -226
  9. package/es/table/style.css +128 -38
  10. package/es/table/style.min.css +1 -1
  11. package/es/ui/index.js +7 -5
  12. package/es/ui/src/log.js +1 -1
  13. package/es/vxe-table/style.css +128 -38
  14. package/es/vxe-table/style.min.css +1 -1
  15. package/lib/index.css +1 -1
  16. package/lib/index.min.css +1 -1
  17. package/lib/index.umd.js +347 -270
  18. package/lib/index.umd.min.js +1 -1
  19. package/lib/style.css +1 -1
  20. package/lib/style.min.css +1 -1
  21. package/lib/table/src/body.js +33 -25
  22. package/lib/table/src/body.min.js +1 -1
  23. package/lib/table/src/footer.js +4 -4
  24. package/lib/table/src/footer.min.js +1 -1
  25. package/lib/table/src/header.js +14 -6
  26. package/lib/table/src/header.min.js +1 -1
  27. package/lib/table/src/table.js +288 -229
  28. package/lib/table/src/table.min.js +1 -1
  29. package/lib/table/style/style.css +128 -38
  30. package/lib/table/style/style.min.css +1 -1
  31. package/lib/ui/index.js +7 -5
  32. package/lib/ui/index.min.js +1 -1
  33. package/lib/ui/src/log.js +1 -1
  34. package/lib/ui/src/log.min.js +1 -1
  35. package/lib/vxe-table/style/style.css +128 -38
  36. package/lib/vxe-table/style/style.min.css +1 -1
  37. package/package.json +1 -1
  38. package/packages/table/src/body.ts +40 -25
  39. package/packages/table/src/footer.ts +4 -4
  40. package/packages/table/src/header.ts +11 -6
  41. package/packages/table/src/table.ts +309 -236
  42. package/packages/ui/index.ts +6 -4
  43. package/styles/components/table.scss +158 -60
  44. /package/es/{iconfont.1736820154664.ttf → iconfont.1736854674495.ttf} +0 -0
  45. /package/es/{iconfont.1736820154664.woff → iconfont.1736854674495.woff} +0 -0
  46. /package/es/{iconfont.1736820154664.woff2 → iconfont.1736854674495.woff2} +0 -0
  47. /package/lib/{iconfont.1736820154664.ttf → iconfont.1736854674495.ttf} +0 -0
  48. /package/lib/{iconfont.1736820154664.woff → iconfont.1736854674495.woff} +0 -0
  49. /package/lib/{iconfont.1736820154664.woff2 → iconfont.1736854674495.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
3138
3138
  ;// ./packages/ui/index.ts
3139
3139
 
3140
3140
 
3141
- const version = "4.10.6-beta.7";
3141
+ const version = "4.10.6-beta.9";
3142
3142
  core_.VxeUI.version = version;
3143
3143
  core_.VxeUI.tableVersion = version;
3144
3144
  core_.VxeUI.setConfig({
@@ -3312,13 +3312,15 @@ core_.VxeUI.setConfig({
3312
3312
  },
3313
3313
  virtualXConfig: {
3314
3314
  // enabled: false,
3315
- gt: 60
3316
- // oSize: 0
3315
+ gt: 60,
3316
+ preSize: 0,
3317
+ oSize: 1
3317
3318
  },
3318
3319
  virtualYConfig: {
3319
3320
  // enabled: false,
3320
- gt: 100
3321
- // oSize: 0
3321
+ gt: 100,
3322
+ preSize: 1,
3323
+ oSize: 2
3322
3324
  },
3323
3325
  scrollbarConfig: {
3324
3326
  width: 10,
@@ -3568,7 +3570,7 @@ var esnext_iterator_some = __webpack_require__(7550);
3568
3570
  const {
3569
3571
  log: log_log
3570
3572
  } = core_.VxeUI;
3571
- const log_version = `table v${"4.10.6-beta.7"}`;
3573
+ const log_version = `table v${"4.10.6-beta.9"}`;
3572
3574
  const warnLog = log_log.create('warn', log_version);
3573
3575
  const errLog = log_log.create('error', log_version);
3574
3576
  ;// ./packages/table/src/columnInfo.ts
@@ -6449,6 +6451,26 @@ const renderType = 'body';
6449
6451
  if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
6450
6452
  isDirty = $xeTable.isUpdateByRow(row, column.field);
6451
6453
  }
6454
+ const isVNAutoHeight = scrollYLoad && !hasEllipsis;
6455
+ let cellHeight = 0;
6456
+ const vnHeight = isCalcCellHeight ? rest.height : 0;
6457
+ if (hasEllipsis) {
6458
+ if (customRHeight) {
6459
+ cellHeight = customRHeight;
6460
+ } else if (!isAllOverflow) {
6461
+ cellHeight = vnHeight || defaultRowHeight || 18;
6462
+ }
6463
+ } else {
6464
+ cellHeight = vnHeight || defaultRowHeight || 18;
6465
+ }
6466
+ const tcStyle = {};
6467
+ if (cellHeight) {
6468
+ if (hasEllipsis) {
6469
+ tcStyle.maxHeight = `${cellHeight}px`;
6470
+ } else if (isVNAutoHeight) {
6471
+ tcStyle.height = `${cellHeight}px`;
6472
+ }
6473
+ }
6452
6474
  const tdVNs = [];
6453
6475
  if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
6454
6476
  tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -6457,9 +6479,7 @@ const renderType = 'body';
6457
6479
  'c--tooltip': showTooltip,
6458
6480
  'c--ellipsis': showEllipsis
6459
6481
  }],
6460
- style: {
6461
- maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
6462
- }
6482
+ style: tcStyle
6463
6483
  }));
6464
6484
  } else {
6465
6485
  // 渲染单元格
@@ -6469,11 +6489,11 @@ const renderType = 'body';
6469
6489
  'c--tooltip': showTooltip,
6470
6490
  'c--ellipsis': showEllipsis
6471
6491
  }],
6472
- style: {
6473
- maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
6474
- },
6492
+ style: tcStyle,
6475
6493
  title: showTitle ? $xeTable.getCellLabel(row, column) : null
6476
- }, column.renderCell(params)));
6494
+ }, isVNAutoHeight ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
6495
+ class: 'vxe-cell--auto-wrapper'
6496
+ }, column.renderCell(params))] : column.renderCell(params)));
6477
6497
  if (showValidTip && errorValidItem) {
6478
6498
  const errRule = errorValidItem.rule;
6479
6499
  const validSlot = slots ? slots.valid : null;
@@ -6494,17 +6514,6 @@ const renderType = 'body';
6494
6514
  }, errorValidItem.content)]])]));
6495
6515
  }
6496
6516
  }
6497
- let cellHeight = '';
6498
- const vnHeight = isCalcCellHeight ? rest.height : 0;
6499
- if (hasEllipsis) {
6500
- if (customRHeight) {
6501
- cellHeight = `${customRHeight}px`;
6502
- } else if (!isAllOverflow) {
6503
- cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
6504
- }
6505
- } else {
6506
- cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
6507
- }
6508
6517
  if (mouseConfig && mouseOpts.area && selectCellToRow) {
6509
6518
  if (!$columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
6510
6519
  tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
@@ -6514,11 +6523,11 @@ const renderType = 'body';
6514
6523
  }
6515
6524
  const isLastColumn = $columnIndex === columns.length - 1;
6516
6525
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
6517
- let isPreLoadStatus = false;
6518
- if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex || _rowIndex > scrollYStore.visibleEndIndex)) {
6519
- isPreLoadStatus = true;
6520
- } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
6521
- isPreLoadStatus = true;
6526
+ let isVNPreEmptyStatus = false;
6527
+ if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
6528
+ isVNPreEmptyStatus = true;
6529
+ } else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
6530
+ isVNPreEmptyStatus = true;
6522
6531
  }
6523
6532
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
6524
6533
  class: ['vxe-body--column', colid, {
@@ -6529,6 +6538,7 @@ const renderType = 'body';
6529
6538
  'col--tree-node': treeNode,
6530
6539
  'col--edit': isEdit,
6531
6540
  'col--ellipsis': hasEllipsis,
6541
+ 'col--auto-height': isVNAutoHeight,
6532
6542
  'fixed--width': !isAutoCellWidth,
6533
6543
  'fixed--hidden': fixedHiddenColumn,
6534
6544
  'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
@@ -6541,10 +6551,10 @@ const renderType = 'body';
6541
6551
  key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
6542
6552
  ...attrs,
6543
6553
  style: Object.assign({
6544
- height: cellHeight
6554
+ height: cellHeight ? `${cellHeight}px` : ''
6545
6555
  }, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cellStyle) ? cellStyle(params) : cellStyle),
6546
6556
  ...tdOns
6547
- }, isPreLoadStatus || isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
6557
+ }, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
6548
6558
  };
6549
6559
  const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
6550
6560
  const {
@@ -7028,7 +7038,8 @@ const header_renderType = 'header';
7028
7038
  const {
7029
7039
  computeColumnOpts,
7030
7040
  computeColumnDragOpts,
7031
- computeResizableOpts
7041
+ computeResizableOpts,
7042
+ computeScrollbarXToTop
7032
7043
  } = $xeTable.getComputeMaps();
7033
7044
  const headerColumn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)([]);
7034
7045
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -7051,6 +7062,9 @@ const header_renderType = 'header';
7051
7062
  const {
7052
7063
  fixedType
7053
7064
  } = props;
7065
+ const {
7066
+ scrollbarHeight
7067
+ } = tableReactData;
7054
7068
  const {
7055
7069
  elemStore,
7056
7070
  visibleColumn
@@ -7061,6 +7075,7 @@ const header_renderType = 'header';
7061
7075
  const rightContainerElem = refRightContainer.value;
7062
7076
  const resizeBarElem = refCellResizeBar.value;
7063
7077
  const resizeTipElem = refCellResizeTip.value;
7078
+ const scrollbarXToTop = computeScrollbarXToTop.value;
7064
7079
  const {
7065
7080
  clientX: dragClientX
7066
7081
  } = evnt;
@@ -7112,6 +7127,7 @@ const header_renderType = 'header';
7112
7127
  const updateEvent = evnt => {
7113
7128
  evnt.stopPropagation();
7114
7129
  evnt.preventDefault();
7130
+ const tableHeight = tableEl.clientHeight;
7115
7131
  const offsetX = evnt.clientX - dragClientX;
7116
7132
  let left = dragPosLeft + offsetX;
7117
7133
  const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
@@ -7129,6 +7145,8 @@ const header_renderType = 'header';
7129
7145
  dragLeft = Math.max(left, dragMinLeft);
7130
7146
  const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
7131
7147
  resizeBarElem.style.left = `${resizeBarLeft}px`;
7148
+ resizeBarElem.style.top = `${scrollbarXToTop ? scrollbarHeight : 0}px`;
7149
+ resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - scrollbarHeight : tableHeight}px`;
7132
7150
  if (resizableOpts.showDragTip && resizeTipElem) {
7133
7151
  const tableWidth = tableEl.clientWidth;
7134
7152
  const wrapperRect = wrapperElem.getBoundingClientRect();
@@ -7142,7 +7160,7 @@ const header_renderType = 'header';
7142
7160
  resizeTipLeft += tableWidth - resizeBarLeft;
7143
7161
  }
7144
7162
  resizeTipElem.style.left = `${resizeTipLeft}px`;
7145
- resizeTipElem.style.top = `${Math.min(tableEl.clientHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
7163
+ resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
7146
7164
  resizeTipElem.textContent = header_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
7147
7165
  }
7148
7166
  };
@@ -7293,9 +7311,9 @@ const header_renderType = 'header';
7293
7311
  const isLastColumn = $columnIndex === cols.length - 1;
7294
7312
  const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
7295
7313
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
7296
- let isPreLoadStatus = false;
7297
- if (scrollXLoad && !isGroup && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
7298
- isPreLoadStatus = true;
7314
+ let isVNPreEmptyStatus = false;
7315
+ if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
7316
+ isVNPreEmptyStatus = true;
7299
7317
  }
7300
7318
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
7301
7319
  class: ['vxe-header--column', colid, {
@@ -7324,7 +7342,7 @@ const header_renderType = 'header';
7324
7342
  'c--tooltip': showTooltip,
7325
7343
  'c--ellipsis': showEllipsis
7326
7344
  }]
7327
- }, isPreLoadStatus || isOptimizeMode && fixedHiddenColumn ? [] : column.renderHeader(params)),
7345
+ }, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : column.renderHeader(params)),
7328
7346
  /**
7329
7347
  * 列宽拖动
7330
7348
  */
@@ -7746,9 +7764,9 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
7746
7764
  }
7747
7765
  const isLastColumn = $columnIndex === tableColumn.length - 1;
7748
7766
  const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
7749
- let isPreLoadStatus = false;
7750
- if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
7751
- isPreLoadStatus = true;
7767
+ let isVNPreEmptyStatus = false;
7768
+ if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
7769
+ isVNPreEmptyStatus = true;
7752
7770
  }
7753
7771
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
7754
7772
  class: ['vxe-footer--column', column.id, {
@@ -7770,7 +7788,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
7770
7788
  'c--tooltip': showTooltip,
7771
7789
  'c--ellipsis': showEllipsis
7772
7790
  }]
7773
- }, isPreLoadStatus ? [] : column.renderFooter(cellParams))]);
7791
+ }, isVNPreEmptyStatus ? [] : column.renderFooter(cellParams))]);
7774
7792
  });
7775
7793
  };
7776
7794
  const renderHeads = renderColumnList => {
@@ -10659,9 +10677,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10659
10677
  const refScrollXVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10660
10678
  const refScrollYVirtualElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10661
10679
  const refScrollXHandleElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10680
+ const refScrollXLeftCornerElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10662
10681
  const refScrollXRightCornerElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10663
10682
  const refScrollYHandleElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10664
10683
  const refScrollYTopCornerElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10684
+ const refScrollXWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10685
+ const refScrollYWrapperElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10665
10686
  const refScrollYBottomCornerElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10666
10687
  const refScrollXSpaceElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
10667
10688
  const refScrollYSpaceElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -10718,6 +10739,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
10718
10739
  const computeScrollbarOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
10719
10740
  return Object.assign({}, table_getConfig().table.scrollbarConfig, props.scrollbarConfig);
10720
10741
  });
10742
+ const computeScrollbarXToTop = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
10743
+ const scrollbarOpts = computeScrollbarOpts.value;
10744
+ return !!(scrollbarOpts.x && scrollbarOpts.x.position === 'top');
10745
+ });
10746
+ const computeScrollbarYToLeft = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
10747
+ const scrollbarOpts = computeScrollbarOpts.value;
10748
+ return !!(scrollbarOpts.y && scrollbarOpts.y.position === 'left');
10749
+ });
10721
10750
  const computeScrollYThreshold = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
10722
10751
  const sYOpts = computeSYOpts.value;
10723
10752
  const {
@@ -11022,6 +11051,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11022
11051
  computeVirtualXOpts,
11023
11052
  computeVirtualYOpts,
11024
11053
  computeScrollbarOpts,
11054
+ computeScrollbarXToTop,
11055
+ computeScrollbarYToLeft,
11025
11056
  computeColumnOpts,
11026
11057
  computeScrollXThreshold,
11027
11058
  computeScrollYThreshold,
@@ -11177,29 +11208,36 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11177
11208
  };
11178
11209
  };
11179
11210
  const computeRowHeight = () => {
11211
+ const {
11212
+ showOverflow
11213
+ } = props;
11180
11214
  const tableHeader = refTableHeader.value;
11181
11215
  const tableBody = refTableBody.value;
11182
11216
  const tableBodyElem = tableBody ? tableBody.$el : null;
11183
11217
  const defaultRowHeight = computeDefaultRowHeight.value;
11184
11218
  let rowHeight = 0;
11185
- if (tableBodyElem) {
11186
- const tableHeaderElem = tableHeader ? tableHeader.$el : null;
11187
- let firstTrElem;
11188
- firstTrElem = tableBodyElem.querySelector('tr');
11189
- if (!firstTrElem && tableHeaderElem) {
11190
- firstTrElem = tableHeaderElem.querySelector('tr');
11219
+ if (showOverflow) {
11220
+ if (tableBodyElem) {
11221
+ const tableHeaderElem = tableHeader ? tableHeader.$el : null;
11222
+ let firstTrElem;
11223
+ firstTrElem = tableBodyElem.querySelector('tr');
11224
+ if (!firstTrElem && tableHeaderElem) {
11225
+ firstTrElem = tableHeaderElem.querySelector('tr');
11226
+ }
11227
+ if (firstTrElem) {
11228
+ rowHeight = firstTrElem.clientHeight;
11229
+ }
11191
11230
  }
11192
- if (firstTrElem) {
11193
- rowHeight = firstTrElem.clientHeight;
11231
+ if (!rowHeight) {
11232
+ rowHeight = defaultRowHeight;
11194
11233
  }
11195
- }
11196
- if (!rowHeight) {
11234
+ } else {
11197
11235
  rowHeight = defaultRowHeight;
11198
11236
  }
11199
11237
  // 最低支持 18px 行高
11200
11238
  return Math.max(18, rowHeight);
11201
11239
  };
11202
- const handleVirtualYVisible = () => {
11240
+ const handleVirtualYVisible = currScrollTop => {
11203
11241
  const {
11204
11242
  showOverflow
11205
11243
  } = props;
@@ -11213,10 +11251,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11213
11251
  } = internalData;
11214
11252
  const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
11215
11253
  if (bodyScrollElem) {
11216
- const {
11217
- scrollTop,
11218
- clientHeight
11219
- } = bodyScrollElem;
11254
+ const clientHeight = bodyScrollElem.clientHeight;
11255
+ const scrollTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(currScrollTop) ? currScrollTop : bodyScrollElem.scrollTop;
11220
11256
  const endHeight = scrollTop + clientHeight;
11221
11257
  let toVisibleIndex = -1;
11222
11258
  let offsetTop = 0;
@@ -11848,7 +11884,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
11848
11884
  tableData.forEach(row => {
11849
11885
  const rowid = getRowid($xeTable, row);
11850
11886
  const rowRest = fullAllDataRowIdData[rowid];
11851
- const cellList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]>.vxe-body--column>.vxe-cell`);
11887
+ const cellList = el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]>.vxe-body--column>.vxe-cell>.vxe-cell--auto-wrapper`);
11852
11888
  if (rowRest && cellList.length) {
11853
11889
  let height = 0;
11854
11890
  for (let i = 0; i < cellList.length; i++) {
@@ -12311,19 +12347,26 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
12311
12347
  }
12312
12348
  bodyHeight = Math.max(bodyMinHeight, bodyHeight);
12313
12349
  }
12350
+ const xLeftCornerEl = refScrollXLeftCornerElem.value;
12351
+ const xRightCornerEl = refScrollXRightCornerElem.value;
12352
+ const scrollbarXToTop = computeScrollbarXToTop.value;
12314
12353
  const scrollXVirtualEl = refScrollXVirtualElem.value;
12315
12354
  if (scrollXVirtualEl) {
12316
12355
  scrollXVirtualEl.style.height = `${scrollbarHeight}px`;
12317
12356
  scrollXVirtualEl.style.visibility = scrollbarHeight ? 'visible' : 'hidden';
12318
12357
  }
12319
- const xHandleEl = refScrollXHandleElem.value;
12320
- if (xHandleEl) {
12321
- xHandleEl.style.width = `${el.clientWidth - scrollbarWidth}px`;
12358
+ const xWrapperEl = refScrollXWrapperElem.value;
12359
+ if (xWrapperEl) {
12360
+ xWrapperEl.style.left = scrollbarXToTop ? `${scrollbarWidth}px` : '';
12361
+ xWrapperEl.style.width = `${el.clientWidth - scrollbarWidth}px`;
12362
+ }
12363
+ if (xLeftCornerEl) {
12364
+ xLeftCornerEl.style.width = scrollbarXToTop ? `${scrollbarWidth}px` : '';
12365
+ xLeftCornerEl.style.display = scrollbarXToTop ? scrollbarWidth && scrollbarHeight ? 'block' : '' : '';
12322
12366
  }
12323
- const xRightCornerEl = refScrollXRightCornerElem.value;
12324
12367
  if (xRightCornerEl) {
12325
- xRightCornerEl.style.width = `${scrollbarWidth}px`;
12326
- xRightCornerEl.style.display = scrollbarWidth && scrollbarHeight ? 'block' : '';
12368
+ xRightCornerEl.style.width = scrollbarXToTop ? '' : `${scrollbarWidth}px`;
12369
+ xRightCornerEl.style.display = scrollbarXToTop ? '' : scrollbarWidth && scrollbarHeight ? 'block' : '';
12327
12370
  }
12328
12371
  const scrollYVirtualEl = refScrollYVirtualElem.value;
12329
12372
  if (scrollYVirtualEl) {
@@ -12336,10 +12379,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
12336
12379
  yTopCornerEl.style.height = `${headerHeight}px`;
12337
12380
  yTopCornerEl.style.display = headerHeight ? 'block' : '';
12338
12381
  }
12339
- const yHandleEl = refScrollYHandleElem.value;
12340
- if (yHandleEl) {
12341
- yHandleEl.style.height = `${bodyHeight}px`;
12342
- yHandleEl.style.top = `${headerHeight}px`;
12382
+ const yWrapperEl = refScrollYWrapperElem.value;
12383
+ if (yWrapperEl) {
12384
+ yWrapperEl.style.height = `${bodyHeight}px`;
12385
+ yWrapperEl.style.top = `${headerHeight}px`;
12343
12386
  }
12344
12387
  const yBottomCornerEl = refScrollYBottomCornerElem.value;
12345
12388
  if (yBottomCornerEl) {
@@ -13168,16 +13211,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13168
13211
  scrollXStore,
13169
13212
  scrollYStore
13170
13213
  } = internalData;
13171
- const sYOpts = computeSYOpts.value;
13172
- const sXOpts = computeSXOpts.value;
13214
+ const virtualYOpts = computeVirtualYOpts.value;
13215
+ const virtualXOpts = computeVirtualXOpts.value;
13173
13216
  // 计算 X 逻辑
13174
13217
  if (scrollXLoad) {
13175
13218
  const {
13176
13219
  toVisibleIndex: toXVisibleIndex,
13177
13220
  visibleSize: visibleXSize
13178
13221
  } = handleVirtualXVisible();
13179
- const offsetXSize = Math.max(0, sXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sXOpts.oSize) : 0);
13180
- scrollXStore.preloadSize = 4;
13222
+ const offsetXSize = Math.max(0, virtualXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize) : 0);
13223
+ scrollXStore.preloadSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);
13181
13224
  scrollXStore.offsetSize = offsetXSize;
13182
13225
  scrollXStore.visibleSize = visibleXSize;
13183
13226
  scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
@@ -13189,7 +13232,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13189
13232
  } else {
13190
13233
  $xeTable.updateScrollXSpace();
13191
13234
  }
13192
- calcCellHeight();
13193
13235
  // 计算 Y 逻辑
13194
13236
  const rowHeight = computeRowHeight();
13195
13237
  scrollYStore.rowHeight = rowHeight;
@@ -13199,8 +13241,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13199
13241
  visibleSize: visibleYSize
13200
13242
  } = handleVirtualYVisible();
13201
13243
  if (scrollYLoad) {
13202
- const offsetYSize = Math.max(0, sYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(sYOpts.oSize) : 0);
13203
- scrollYStore.preloadSize = 2;
13244
+ const offsetYSize = Math.max(0, virtualYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize) : 0);
13245
+ scrollYStore.preloadSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);
13204
13246
  scrollYStore.offsetSize = offsetYSize;
13205
13247
  scrollYStore.visibleSize = visibleYSize;
13206
13248
  scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
@@ -13229,7 +13271,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13229
13271
  return computeScrollLoad().then(() => {
13230
13272
  if (reFull === true) {
13231
13273
  // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
13232
- calcCellHeight();
13233
13274
  calcCellWidth();
13234
13275
  autoCellWidth();
13235
13276
  updateStyle();
@@ -13375,6 +13416,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13375
13416
  if (sYOpts.scrollToTopOnChange) {
13376
13417
  targetScrollTop = 0;
13377
13418
  }
13419
+ calcCellHeight();
13378
13420
  // 是否变更虚拟滚动
13379
13421
  if (oldScrollYLoad === sYLoad) {
13380
13422
  restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
@@ -13807,7 +13849,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13807
13849
  /**
13808
13850
  * 纵向 Y 可视渲染处理
13809
13851
  */
13810
- const loadScrollYData = () => {
13852
+ const loadScrollYData = scrollTop => {
13811
13853
  const {
13812
13854
  showOverflow
13813
13855
  } = props;
@@ -13827,7 +13869,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13827
13869
  const {
13828
13870
  toVisibleIndex,
13829
13871
  visibleSize
13830
- } = handleVirtualYVisible();
13872
+ } = handleVirtualYVisible(scrollTop);
13831
13873
  const offsetItem = {
13832
13874
  startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
13833
13875
  endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
@@ -13900,18 +13942,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13900
13942
  }, fpsTime);
13901
13943
  };
13902
13944
  const lazyScrollYData = () => {
13903
- const {
13904
- showOverflow
13905
- } = props;
13906
13945
  const {
13907
13946
  lyTimeout,
13908
- lyRunTime,
13909
- scrollYStore
13947
+ lyRunTime
13910
13948
  } = internalData;
13911
- const {
13912
- visibleSize
13913
- } = scrollYStore;
13914
- const fpsTime = showOverflow ? 5 : Math.max(5, Math.min(80, Math.floor(visibleSize / 2)));
13949
+ const fpsTime = Math.floor(Math.max(4, Math.min(10, 20 / 3)));
13915
13950
  if (lyTimeout) {
13916
13951
  clearTimeout(lyTimeout);
13917
13952
  }
@@ -13925,86 +13960,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13925
13960
  loadScrollYData();
13926
13961
  }, fpsTime);
13927
13962
  };
13928
- const scrollXEvent = evnt => {
13929
- const {
13930
- elemStore,
13931
- inWheelScroll,
13932
- lastScrollTop,
13933
- inHeaderScroll,
13934
- inBodyScroll,
13935
- inFooterScroll
13936
- } = internalData;
13937
- if (inHeaderScroll || inBodyScroll || inFooterScroll) {
13938
- return;
13939
- }
13940
- if (inWheelScroll) {
13941
- return;
13942
- }
13943
- const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
13944
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
13945
- const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
13946
- const yHandleEl = refScrollYHandleElem.value;
13947
- const wrapperEl = evnt.currentTarget;
13948
- const {
13949
- scrollLeft
13950
- } = wrapperEl;
13951
- const yBodyEl = yHandleEl || bodyScrollElem;
13952
- let scrollTop = 0;
13953
- if (yBodyEl) {
13954
- scrollTop = yBodyEl.scrollTop;
13955
- }
13956
- const isRollX = true;
13957
- const isRollY = scrollTop !== lastScrollTop;
13958
- internalData.inVirtualScroll = true;
13959
- setScrollLeft(bodyScrollElem, scrollLeft);
13960
- setScrollLeft(headerScrollElem, scrollLeft);
13961
- setScrollLeft(footerScrollElem, scrollLeft);
13962
- $xeTable.triggerScrollXEvent(evnt);
13963
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
13964
- type: 'table',
13965
- fixed: ''
13966
- });
13967
- };
13968
- const scrollYEvent = evnt => {
13969
- const {
13970
- elemStore,
13971
- inWheelScroll,
13972
- lastScrollLeft,
13973
- inHeaderScroll,
13974
- inBodyScroll,
13975
- inFooterScroll
13976
- } = internalData;
13977
- if (inHeaderScroll || inBodyScroll || inFooterScroll) {
13978
- return;
13979
- }
13980
- if (inWheelScroll) {
13981
- return;
13982
- }
13983
- const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
13984
- const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
13985
- const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
13986
- const xHandleEl = refScrollXHandleElem.value;
13987
- const wrapperEl = evnt.currentTarget;
13988
- const {
13989
- scrollTop
13990
- } = wrapperEl;
13991
- const xBodyEl = xHandleEl || bodyScrollElem;
13992
- let scrollLeft = 0;
13993
- if (xBodyEl) {
13994
- scrollLeft = xBodyEl.scrollLeft;
13995
- }
13996
- const isRollX = scrollLeft !== lastScrollLeft;
13997
- const isRollY = true;
13998
- internalData.inVirtualScroll = true;
13999
- setScrollTop(bodyScrollElem, scrollTop);
14000
- setScrollTop(leftScrollElem, scrollTop);
14001
- setScrollTop(rightScrollElem, scrollTop);
14002
- $xeTable.triggerScrollYEvent(evnt);
14003
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
14004
- type: 'table',
14005
- fixed: ''
14006
- });
14007
- };
14008
13963
  const checkLastSyncScroll = (isRollX, isRollY) => {
14009
13964
  const {
14010
13965
  scrollXLoad,
@@ -14025,16 +13980,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14025
13980
  internalData.inBodyScroll = false;
14026
13981
  internalData.inFooterScroll = false;
14027
13982
  internalData.scrollRenderType = '';
13983
+ calcCellHeight();
14028
13984
  if (isRollX && scrollXLoad) {
14029
- $xeTable.updateScrollXData().then(() => {
14030
- calcCellHeight();
14031
- loadScrollXData();
14032
- });
13985
+ $xeTable.updateScrollXData();
14033
13986
  }
14034
13987
  if (isRollY && scrollYLoad) {
14035
13988
  $xeTable.updateScrollYData().then(() => {
14036
13989
  calcCellHeight();
14037
- loadScrollYData();
13990
+ $xeTable.updateScrollYSpace();
14038
13991
  });
14039
13992
  }
14040
13993
  $xeTable.updateCellAreas();
@@ -14056,6 +14009,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14056
14009
  }
14057
14010
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
14058
14011
  };
14012
+ function handleUupdateResize() {
14013
+ const el = refElem.value;
14014
+ if (el && el.clientWidth && el.clientHeight) {
14015
+ tableMethods.recalculate();
14016
+ }
14017
+ }
14059
14018
  tableMethods = {
14060
14019
  dispatchEvent,
14061
14020
  /**
@@ -17408,6 +17367,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17408
17367
  const rdLineEl = refDragRowLineElem.value;
17409
17368
  if (rdLineEl) {
17410
17369
  if (showLine) {
17370
+ const scrollbarYToLeft = computeScrollbarYToLeft.value;
17411
17371
  const trRect = trEl.getBoundingClientRect();
17412
17372
  let trHeight = trEl.clientHeight;
17413
17373
  const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
@@ -17415,6 +17375,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17415
17375
  trHeight = tableHeight - offsetTop - scrollbarHeight;
17416
17376
  }
17417
17377
  rdLineEl.style.display = 'block';
17378
+ rdLineEl.style.left = `${scrollbarYToLeft ? scrollbarWidth : 0}px`;
17418
17379
  rdLineEl.style.top = `${offsetTop}px`;
17419
17380
  rdLineEl.style.height = `${trHeight}px`;
17420
17381
  rdLineEl.style.width = `${tableWidth - scrollbarWidth}px`;
@@ -17428,6 +17389,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17428
17389
  const cdLineEl = refDragColLineElem.value;
17429
17390
  if (cdLineEl) {
17430
17391
  if (showLine) {
17392
+ const scrollbarXToTop = computeScrollbarXToTop.value;
17431
17393
  const leftContainerElem = refLeftContainer.value;
17432
17394
  const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
17433
17395
  const rightContainerElem = refRightContainer.value;
@@ -17452,7 +17414,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17452
17414
  if (prevDragToChild) {
17453
17415
  cdLineEl.style.height = `${thRect.height}px`;
17454
17416
  } else {
17455
- cdLineEl.style.height = `${tableHeight - offsetTop - scrollbarHeight}px`;
17417
+ cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : scrollbarHeight)}px`;
17456
17418
  }
17457
17419
  cdLineEl.setAttribute('drag-pos', dragPos);
17458
17420
  cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
@@ -19912,13 +19874,93 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
19912
19874
  setScrollTop(bodyScrollElem, scrollTop);
19913
19875
  setScrollTop(leftScrollElem, scrollTop);
19914
19876
  setScrollTop(rightScrollElem, scrollTop);
19915
- $xeTable.triggerScrollYEvent(evnt);
19877
+ loadScrollYData(scrollTop);
19916
19878
  $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
19917
- type: 'footer',
19879
+ type: 'table',
19918
19880
  fixed: ''
19919
19881
  });
19920
19882
  }
19921
19883
  },
19884
+ triggerVirtualScrollXEvent(evnt) {
19885
+ const {
19886
+ elemStore,
19887
+ inWheelScroll,
19888
+ lastScrollTop,
19889
+ inHeaderScroll,
19890
+ inBodyScroll,
19891
+ inFooterScroll
19892
+ } = internalData;
19893
+ if (inHeaderScroll || inBodyScroll || inFooterScroll) {
19894
+ return;
19895
+ }
19896
+ if (inWheelScroll) {
19897
+ return;
19898
+ }
19899
+ const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
19900
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
19901
+ const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
19902
+ const yHandleEl = refScrollYHandleElem.value;
19903
+ const wrapperEl = evnt.currentTarget;
19904
+ const {
19905
+ scrollLeft
19906
+ } = wrapperEl;
19907
+ const yBodyEl = yHandleEl || bodyScrollElem;
19908
+ let scrollTop = 0;
19909
+ if (yBodyEl) {
19910
+ scrollTop = yBodyEl.scrollTop;
19911
+ }
19912
+ const isRollX = true;
19913
+ const isRollY = scrollTop !== lastScrollTop;
19914
+ internalData.inVirtualScroll = true;
19915
+ setScrollLeft(bodyScrollElem, scrollLeft);
19916
+ setScrollLeft(headerScrollElem, scrollLeft);
19917
+ setScrollLeft(footerScrollElem, scrollLeft);
19918
+ $xeTable.triggerScrollXEvent(evnt);
19919
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
19920
+ type: 'table',
19921
+ fixed: ''
19922
+ });
19923
+ },
19924
+ triggerVirtualScrollYEvent(evnt) {
19925
+ const {
19926
+ elemStore,
19927
+ inWheelScroll,
19928
+ lastScrollLeft,
19929
+ inHeaderScroll,
19930
+ inBodyScroll,
19931
+ inFooterScroll
19932
+ } = internalData;
19933
+ if (inHeaderScroll || inBodyScroll || inFooterScroll) {
19934
+ return;
19935
+ }
19936
+ if (inWheelScroll) {
19937
+ return;
19938
+ }
19939
+ const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
19940
+ const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
19941
+ const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
19942
+ const xHandleEl = refScrollXHandleElem.value;
19943
+ const wrapperEl = evnt.currentTarget;
19944
+ const {
19945
+ scrollTop
19946
+ } = wrapperEl;
19947
+ const xBodyEl = xHandleEl || bodyScrollElem;
19948
+ let scrollLeft = 0;
19949
+ if (xBodyEl) {
19950
+ scrollLeft = xBodyEl.scrollLeft;
19951
+ }
19952
+ const isRollX = scrollLeft !== lastScrollLeft;
19953
+ const isRollY = true;
19954
+ internalData.inVirtualScroll = true;
19955
+ setScrollTop(bodyScrollElem, scrollTop);
19956
+ setScrollTop(leftScrollElem, scrollTop);
19957
+ setScrollTop(rightScrollElem, scrollTop);
19958
+ $xeTable.triggerScrollYEvent(evnt);
19959
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
19960
+ type: 'table',
19961
+ fixed: ''
19962
+ });
19963
+ },
19922
19964
  /**
19923
19965
  * 对于树形结构中,可以直接滚动到指定深层节点中
19924
19966
  * 对于某些特定的场景可能会用到,比如定位到某一节点
@@ -20078,9 +20120,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20078
20120
  showOverflow
20079
20121
  } = props;
20080
20122
  handleTableColumn();
20081
- // calcCellHeight()
20082
20123
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
20083
- // calcCellHeight()
20084
20124
  handleTableColumn();
20085
20125
  $xeTable.updateScrollXSpace();
20086
20126
  if (!showOverflow) {
@@ -20090,9 +20130,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20090
20130
  },
20091
20131
  updateScrollYData() {
20092
20132
  $xeTable.handleTableData();
20093
- // calcCellHeight()
20094
20133
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
20095
- // calcCellHeight()
20096
20134
  $xeTable.handleTableData();
20097
20135
  $xeTable.updateScrollYSpace();
20098
20136
  });
@@ -20319,12 +20357,108 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20319
20357
  }
20320
20358
  return table_renderEmptyElement($xeTable);
20321
20359
  };
20322
- function handleUupdateResize() {
20323
- const el = refElem.value;
20324
- if (el && el.clientWidth && el.clientHeight) {
20325
- tableMethods.recalculate();
20326
- }
20327
- }
20360
+ const renderScrollX = () => {
20361
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20362
+ key: 'vsx',
20363
+ ref: refScrollXVirtualElem,
20364
+ class: 'vxe-table--scroll-x-virtual'
20365
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20366
+ ref: refScrollXLeftCornerElem,
20367
+ class: 'vxe-table--scroll-x-left-corner'
20368
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20369
+ ref: refScrollXWrapperElem,
20370
+ class: 'vxe-table--scroll-x-wrapper'
20371
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20372
+ ref: refScrollXHandleElem,
20373
+ class: 'vxe-table--scroll-x-handle',
20374
+ onScroll: $xeTable.triggerVirtualScrollXEvent
20375
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20376
+ ref: refScrollXSpaceElem,
20377
+ class: 'vxe-table--scroll-x-space'
20378
+ })])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20379
+ ref: refScrollXRightCornerElem,
20380
+ class: 'vxe-table--scroll-x-right-corner'
20381
+ })]);
20382
+ };
20383
+ const renderScrollY = () => {
20384
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20385
+ ref: refScrollYVirtualElem,
20386
+ class: 'vxe-table--scroll-y-virtual'
20387
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20388
+ ref: refScrollYTopCornerElem,
20389
+ class: 'vxe-table--scroll-y-top-corner'
20390
+ }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20391
+ ref: refScrollYWrapperElem,
20392
+ class: 'vxe-table--scroll-y-wrapper'
20393
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20394
+ ref: refScrollYHandleElem,
20395
+ class: 'vxe-table--scroll-y-handle',
20396
+ onScroll: $xeTable.triggerVirtualScrollYEvent
20397
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20398
+ ref: refScrollYSpaceElem,
20399
+ class: 'vxe-table--scroll-y-space'
20400
+ })])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20401
+ ref: refScrollYBottomCornerElem,
20402
+ class: 'vxe-table--scroll-y-bottom-corner'
20403
+ })]);
20404
+ };
20405
+ const renderViewport = () => {
20406
+ const {
20407
+ showHeader,
20408
+ showFooter
20409
+ } = props;
20410
+ const {
20411
+ overflowX,
20412
+ tableData,
20413
+ tableColumn,
20414
+ tableGroupColumn,
20415
+ footerTableData,
20416
+ columnStore
20417
+ } = reactData;
20418
+ const {
20419
+ leftList,
20420
+ rightList
20421
+ } = columnStore;
20422
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20423
+ ref: refTableViewportElem,
20424
+ class: 'vxe-table--viewport-wrapper'
20425
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20426
+ class: 'vxe-table--main-wrapper'
20427
+ }, [
20428
+ /**
20429
+ * 表头
20430
+ */
20431
+ showHeader ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(header, {
20432
+ ref: refTableHeader,
20433
+ tableData,
20434
+ tableColumn,
20435
+ tableGroupColumn
20436
+ }) : table_renderEmptyElement($xeTable),
20437
+ /**
20438
+ * 表体
20439
+ */
20440
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(body, {
20441
+ ref: refTableBody,
20442
+ tableData,
20443
+ tableColumn
20444
+ }),
20445
+ /**
20446
+ * 表尾
20447
+ */
20448
+ showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(footer, {
20449
+ ref: refTableFooter,
20450
+ footerTableData,
20451
+ tableColumn
20452
+ }) : table_renderEmptyElement($xeTable)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20453
+ class: 'vxe-table--fixed-wrapper'
20454
+ }, [leftList && leftList.length && overflowX ? renderFixed('left') : table_renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed('right') : table_renderEmptyElement($xeTable)])]);
20455
+ };
20456
+ const renderBody = () => {
20457
+ const scrollbarYToLeft = computeScrollbarYToLeft.value;
20458
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20459
+ class: 'vxe-table--layout-wrapper'
20460
+ }, scrollbarYToLeft ? [renderScrollY(), renderViewport()] : [renderViewport(), renderScrollY()]);
20461
+ };
20328
20462
  const renderVN = () => {
20329
20463
  const {
20330
20464
  loading,
@@ -20347,11 +20481,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20347
20481
  overflowY,
20348
20482
  scrollXLoad,
20349
20483
  scrollYLoad,
20350
- scrollbarHeight,
20351
20484
  tableData,
20352
- tableColumn,
20353
- tableGroupColumn,
20354
- footerTableData,
20355
20485
  initStore,
20356
20486
  columnStore,
20357
20487
  filterStore,
@@ -20379,9 +20509,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20379
20509
  const resizableOpts = computeResizableOpts.value;
20380
20510
  const isArea = mouseConfig && mouseOpts.area;
20381
20511
  const columnDragOpts = computeColumnDragOpts.value;
20512
+ const scrollbarXToTop = computeScrollbarXToTop.value;
20513
+ const scrollbarYToLeft = computeScrollbarYToLeft.value;
20382
20514
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20383
20515
  ref: refElem,
20384
- class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, {
20516
+ class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
20385
20517
  [`size--${vSize}`]: vSize,
20386
20518
  [`valid-msg--${validOpts.msgMode}`]: !!editRules,
20387
20519
  'vxe-editable': !!editConfig,
@@ -20424,69 +20556,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20424
20556
  }, slots.default ? slots.default({}) : []), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20425
20557
  key: 'tw',
20426
20558
  class: 'vxe-table--render-wrapper'
20427
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20428
- ref: refTableViewportElem,
20429
- class: 'vxe-table--viewport-wrapper'
20430
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20431
- class: 'vxe-table--main-wrapper'
20432
- }, [
20433
- /**
20434
- * 表头
20435
- */
20436
- showHeader ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(header, {
20437
- ref: refTableHeader,
20438
- tableData,
20439
- tableColumn,
20440
- tableGroupColumn
20441
- }) : table_renderEmptyElement($xeTable),
20442
- /**
20443
- * 表体
20444
- */
20445
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(body, {
20446
- ref: refTableBody,
20447
- tableData,
20448
- tableColumn
20449
- }),
20450
- /**
20451
- * 表尾
20452
- */
20453
- showFooter ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(footer, {
20454
- ref: refTableFooter,
20455
- footerTableData,
20456
- tableColumn
20457
- }) : table_renderEmptyElement($xeTable)]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20458
- class: 'vxe-table--fixed-wrapper'
20459
- }, [leftList && leftList.length && overflowX ? renderFixed('left') : table_renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed('right') : table_renderEmptyElement($xeTable)])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20460
- ref: refScrollYVirtualElem,
20461
- class: 'vxe-table--scroll-y-virtual'
20462
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20463
- ref: refScrollYTopCornerElem,
20464
- class: 'vxe-table--scroll-y-top-corner'
20465
- }), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20466
- ref: refScrollYHandleElem,
20467
- class: 'vxe-table--scroll-y-handle',
20468
- onScroll: scrollYEvent
20469
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20470
- ref: refScrollYSpaceElem,
20471
- class: 'vxe-table--scroll-y-space'
20472
- })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20473
- ref: refScrollYBottomCornerElem,
20474
- class: 'vxe-table--scroll-y-bottom-corner'
20475
- })])]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20476
- key: 'vx',
20477
- ref: refScrollXVirtualElem,
20478
- class: 'vxe-table--scroll-x-virtual'
20479
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20480
- ref: refScrollXHandleElem,
20481
- class: 'vxe-table--scroll-x-handle',
20482
- onScroll: scrollXEvent
20483
- }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20484
- ref: refScrollXSpaceElem,
20485
- class: 'vxe-table--scroll-x-space'
20486
- })]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20487
- ref: refScrollXRightCornerElem,
20488
- class: 'vxe-table--scroll-x-right-corner'
20489
- })]),
20559
+ }, scrollbarXToTop ? [renderScrollX(), renderBody()] : [renderBody(), renderScrollX()]),
20490
20560
  /**
20491
20561
  * 空数据
20492
20562
  */
@@ -20510,10 +20580,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20510
20580
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20511
20581
  key: 'cl',
20512
20582
  ref: refCellResizeBar,
20513
- class: 'vxe-table--resizable-bar',
20514
- style: overflowX ? {
20515
- 'padding-bottom': `${scrollbarHeight}px`
20516
- } : null
20583
+ class: 'vxe-table--resizable-bar'
20517
20584
  }, resizableOpts.showDragTip ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
20518
20585
  ref: refCellResizeTip,
20519
20586
  class: 'vxe-table--resizable-number-tip'
@@ -20686,16 +20753,37 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20686
20753
  tableMethods.refreshColumn();
20687
20754
  });
20688
20755
  });
20756
+ const reScrollFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
20757
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeSize, () => {
20758
+ reScrollFlag.value++;
20759
+ });
20689
20760
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.showHeader, () => {
20690
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
20691
- tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
20692
- });
20761
+ reScrollFlag.value++;
20693
20762
  });
20694
20763
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.showFooter, () => {
20764
+ reScrollFlag.value++;
20765
+ });
20766
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(reScrollFlag, () => {
20695
20767
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
20696
20768
  tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
20697
20769
  });
20698
20770
  });
20771
+ const reLayoutFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
20772
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.height, () => {
20773
+ reLayoutFlag.value++;
20774
+ });
20775
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.maxHeight, () => {
20776
+ reLayoutFlag.value++;
20777
+ });
20778
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeScrollbarXToTop, () => {
20779
+ reLayoutFlag.value++;
20780
+ });
20781
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeScrollbarYToLeft, () => {
20782
+ reLayoutFlag.value++;
20783
+ });
20784
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(reLayoutFlag, () => {
20785
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => tableMethods.recalculate(true));
20786
+ });
20699
20787
  const footFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
20700
20788
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.footerData ? props.footerData.length : -1, () => {
20701
20789
  footFlag.value++;
@@ -20706,17 +20794,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
20706
20794
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(footFlag, () => {
20707
20795
  tableMethods.updateFooter();
20708
20796
  });
20709
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.height, () => {
20710
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => tableMethods.recalculate(true));
20711
- });
20712
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.maxHeight, () => {
20713
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => tableMethods.recalculate(true));
20714
- });
20715
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeSize, () => {
20716
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
20717
- tableMethods.recalculate(true).then(() => tableMethods.refreshScroll());
20718
- });
20719
- });
20720
20797
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.syncResize, value => {
20721
20798
  if (value) {
20722
20799
  handleUupdateResize();