vxe-table 3.19.6 → 3.19.7

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 (42) hide show
  1. package/es/style.css +1 -1
  2. package/es/table/src/body.js +9 -19
  3. package/es/table/src/cell.js +47 -40
  4. package/es/table/src/footer.js +2 -12
  5. package/es/table/src/header.js +3 -11
  6. package/es/table/src/methods.js +29 -48
  7. package/es/table/src/table.js +89 -6
  8. package/es/ui/index.js +2 -2
  9. package/es/ui/src/log.js +1 -1
  10. package/lib/index.umd.js +177 -113
  11. package/lib/index.umd.min.js +1 -1
  12. package/lib/style.css +1 -1
  13. package/lib/table/src/body.js +7 -20
  14. package/lib/table/src/body.min.js +1 -1
  15. package/lib/table/src/cell.js +12 -5
  16. package/lib/table/src/cell.min.js +1 -1
  17. package/lib/table/src/footer.js +2 -15
  18. package/lib/table/src/footer.min.js +1 -1
  19. package/lib/table/src/header.js +3 -13
  20. package/lib/table/src/header.min.js +1 -1
  21. package/lib/table/src/methods.js +32 -51
  22. package/lib/table/src/methods.min.js +1 -1
  23. package/lib/table/src/table.js +118 -6
  24. package/lib/table/src/table.min.js +1 -1
  25. package/lib/ui/index.js +2 -2
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/package.json +1 -1
  30. package/packages/table/src/body.ts +9 -19
  31. package/packages/table/src/cell.ts +49 -42
  32. package/packages/table/src/footer.ts +2 -11
  33. package/packages/table/src/header.ts +3 -11
  34. package/packages/table/src/methods.ts +29 -47
  35. package/packages/table/src/table.ts +89 -6
  36. package/packages/ui/index.ts +1 -1
  37. /package/es/{iconfont.1761877353318.ttf → iconfont.1762136064244.ttf} +0 -0
  38. /package/es/{iconfont.1761877353318.woff → iconfont.1762136064244.woff} +0 -0
  39. /package/es/{iconfont.1761877353318.woff2 → iconfont.1762136064244.woff2} +0 -0
  40. /package/lib/{iconfont.1761877353318.ttf → iconfont.1762136064244.ttf} +0 -0
  41. /package/lib/{iconfont.1761877353318.woff → iconfont.1762136064244.woff} +0 -0
  42. /package/lib/{iconfont.1761877353318.woff2 → iconfont.1762136064244.woff2} +0 -0
@@ -617,8 +617,7 @@ function handleVirtualTreeExpand($xeTable, rows, expanded) {
617
617
  updateAfterDataIndex($xeTable);
618
618
  return $xeTable.$nextTick();
619
619
  }).then(() => {
620
- updateTreeLineStyle($xeTable);
621
- return handleLazyRecalculate($xeTable, true, true, true);
620
+ return handleRecalculateStyle($xeTable, true, true, true);
622
621
  }).then(() => {
623
622
  updateTreeLineStyle($xeTable);
624
623
  setTimeout(() => {
@@ -1240,18 +1239,12 @@ function updateStyle($xeTable) {
1240
1239
  const reactData = $xeTable;
1241
1240
  const internalData = $xeTable;
1242
1241
  const {
1243
- showHeaderOverflow: allColumnHeaderOverflow,
1244
- showFooterOverflow: allColumnFooterOverflow,
1245
- mouseConfig,
1246
- spanMethod,
1247
- footerSpanMethod
1242
+ mouseConfig
1248
1243
  } = props;
1249
1244
  const {
1250
1245
  isGroup,
1251
1246
  currentRow,
1252
1247
  tableColumn,
1253
- scrollXLoad,
1254
- scrollYLoad,
1255
1248
  overflowX,
1256
1249
  scrollbarWidth,
1257
1250
  overflowY,
@@ -1259,8 +1252,6 @@ function updateStyle($xeTable) {
1259
1252
  scrollXWidth,
1260
1253
  columnStore,
1261
1254
  editStore,
1262
- isAllOverflow,
1263
- expandColumn,
1264
1255
  isColLoading
1265
1256
  } = reactData;
1266
1257
  const {
@@ -1279,12 +1270,18 @@ function updateStyle($xeTable) {
1279
1270
  return;
1280
1271
  }
1281
1272
  const containerList = ['main', 'left', 'right'];
1273
+ const {
1274
+ leftList,
1275
+ rightList
1276
+ } = columnStore;
1282
1277
  let osbWidth = overflowY ? scrollbarWidth : 0;
1283
1278
  let osbHeight = overflowX ? scrollbarHeight : 0;
1284
1279
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
1280
+ const isHeaderRenderOptimize = $xeTable.computeIsHeaderRenderOptimize;
1281
+ const isBodyRenderOptimize = $xeTable.computeIsBodyRenderOptimize;
1282
+ const isFooterRenderOptimize = $xeTable.computeIsFooterRenderOptimize;
1285
1283
  const scrollbarOpts = $xeTable.computeScrollbarOpts;
1286
1284
  const mouseOpts = $xeTable.computeMouseOpts;
1287
- const expandOpts = $xeTable.computeExpandOpts;
1288
1285
  const bodyWrapperElem = (0, _util.getRefElem)(elemStore['main-body-wrapper']);
1289
1286
  const bodyTableElem = (0, _util.getRefElem)(elemStore['main-body-table']);
1290
1287
  if (emptyPlaceholderElem) {
@@ -1397,7 +1394,7 @@ function updateStyle($xeTable) {
1397
1394
  let fixedColumn = [];
1398
1395
  let fixedWrapperElem;
1399
1396
  if (fixedType) {
1400
- fixedColumn = isFixedLeft ? columnStore.leftList : columnStore.rightList;
1397
+ fixedColumn = isFixedLeft ? leftList : rightList;
1401
1398
  fixedWrapperElem = isFixedLeft ? $xeTable.$refs.refLeftContainer : $xeTable.$refs.refRightContainer;
1402
1399
  }
1403
1400
  layoutList.forEach(layout => {
@@ -1408,18 +1405,10 @@ function updateStyle($xeTable) {
1408
1405
  // 表头体样式处理
1409
1406
  // 横向滚动渲染
1410
1407
  let renderColumnList = tableColumn;
1411
- let isOptimizeMode = false;
1408
+ const isOptimizeMode = isHeaderRenderOptimize;
1412
1409
  if (isGroup) {
1413
1410
  renderColumnList = visibleColumn;
1414
1411
  } else {
1415
- // 如果是使用优化模式
1416
- if (scrollXLoad && allColumnHeaderOverflow) {
1417
- if (spanMethod || footerSpanMethod) {
1418
- // 如果不支持优化模式
1419
- } else {
1420
- isOptimizeMode = true;
1421
- }
1422
- }
1423
1412
  if (!isOptimizeMode || !isColLoading && (fixedType || !overflowX)) {
1424
1413
  renderColumnList = visibleColumn;
1425
1414
  }
@@ -1469,15 +1458,7 @@ function updateStyle($xeTable) {
1469
1458
  fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
1470
1459
  }
1471
1460
  let renderColumnList = tableColumn;
1472
- let isOptimizeMode = false;
1473
- // 如果是使用优化模式
1474
- if (scrollXLoad || scrollYLoad || isAllOverflow) {
1475
- if (expandColumn && expandOpts.mode !== 'fixed' || spanMethod || footerSpanMethod) {
1476
- // 如果不支持优化模式
1477
- } else {
1478
- isOptimizeMode = true;
1479
- }
1480
- }
1461
+ const isOptimizeMode = isBodyRenderOptimize;
1481
1462
  if (fixedType) {
1482
1463
  renderColumnList = visibleColumn;
1483
1464
  if (isOptimizeMode) {
@@ -1507,15 +1488,7 @@ function updateStyle($xeTable) {
1507
1488
  }
1508
1489
  } else if (layout === 'footer') {
1509
1490
  let renderColumnList = tableColumn;
1510
- let isOptimizeMode = false;
1511
- // 如果是使用优化模式
1512
- if (scrollXLoad && allColumnFooterOverflow) {
1513
- if (spanMethod || footerSpanMethod) {
1514
- // 如果不支持优化模式
1515
- } else {
1516
- isOptimizeMode = true;
1517
- }
1518
- }
1491
+ const isOptimizeMode = isFooterRenderOptimize;
1519
1492
  if (!isOptimizeMode || !isColLoading && (fixedType || !overflowX)) {
1520
1493
  renderColumnList = visibleColumn;
1521
1494
  }
@@ -13157,7 +13130,9 @@ const Methods = {
13157
13130
  const internalData = $xeTable;
13158
13131
  const {
13159
13132
  isAllOverflow,
13133
+ overflowY,
13160
13134
  scrollYLoad,
13135
+ scrollYHeight,
13161
13136
  expandColumn
13162
13137
  } = reactData;
13163
13138
  const {
@@ -13183,13 +13158,13 @@ const Methods = {
13183
13158
  const rightbodyTableElem = (0, _util.getRefElem)(elemStore['right-body-table']);
13184
13159
  const containerList = ['main', 'left', 'right'];
13185
13160
  let ySpaceTop = 0;
13186
- let scrollYHeight = 0;
13161
+ let sYHeight = scrollYHeight;
13187
13162
  let isScrollYBig = false;
13188
13163
  if (scrollYLoad) {
13189
13164
  const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
13190
13165
  if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
13191
- scrollYHeight = afterFullData.length * defaultRowHeight;
13192
- if (scrollYHeight > maxYHeight) {
13166
+ sYHeight = afterFullData.length * defaultRowHeight;
13167
+ if (sYHeight > maxYHeight) {
13193
13168
  isScrollYBig = true;
13194
13169
  }
13195
13170
  ySpaceTop = Math.max(0, startIndex * defaultRowHeight);
@@ -13201,18 +13176,21 @@ const Methods = {
13201
13176
  const lastRow = afterFullData[afterFullData.length - 1];
13202
13177
  rowid = (0, _util.getRowid)($xeTable, lastRow);
13203
13178
  rowRest = fullAllDataRowIdData[rowid] || {};
13204
- scrollYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
13205
- // 是否展开行
13206
- if (expandColumn && rowExpandedMaps[rowid]) {
13207
- scrollYHeight += rowRest.expandHeight || expandOpts.height || 0;
13179
+ // 如果为空时还没计算完数据,保持原高度不变
13180
+ if (rowRest.oTop) {
13181
+ sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
13182
+ // 是否展开行
13183
+ if (expandColumn && rowExpandedMaps[rowid]) {
13184
+ sYHeight += rowRest.expandHeight || expandOpts.height || 0;
13185
+ }
13208
13186
  }
13209
- if (scrollYHeight > maxYHeight) {
13187
+ if (sYHeight > maxYHeight) {
13210
13188
  isScrollYBig = true;
13211
13189
  }
13212
13190
  }
13213
13191
  } else {
13214
13192
  if (bodyTableElem) {
13215
- scrollYHeight = bodyTableElem.clientHeight;
13193
+ sYHeight = bodyTableElem.clientHeight;
13216
13194
  }
13217
13195
  }
13218
13196
  let clientHeight = 0;
@@ -13220,7 +13198,7 @@ const Methods = {
13220
13198
  clientHeight = bodyScrollElem.clientHeight;
13221
13199
  }
13222
13200
  // 虚拟渲染
13223
- let ySpaceHeight = scrollYHeight;
13201
+ let ySpaceHeight = sYHeight;
13224
13202
  let scrollYTop = ySpaceTop;
13225
13203
  if (isScrollYBig) {
13226
13204
  // 触底
@@ -13231,6 +13209,9 @@ const Methods = {
13231
13209
  }
13232
13210
  ySpaceHeight = maxYHeight;
13233
13211
  }
13212
+ if (!(scrollYLoad && overflowY)) {
13213
+ scrollYTop = 0;
13214
+ }
13234
13215
  if (leftBodyTableElem) {
13235
13216
  leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
13236
13217
  }
@@ -13258,7 +13239,7 @@ const Methods = {
13258
13239
  rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
13259
13240
  }
13260
13241
  reactData.scrollYTop = scrollYTop;
13261
- reactData.scrollYHeight = scrollYHeight;
13242
+ reactData.scrollYHeight = ySpaceHeight;
13262
13243
  reactData.isScrollYBig = isScrollYBig;
13263
13244
  calcScrollbar($xeTable);
13264
13245
  if (isScrollYBig && mouseOpts.area) {