vxe-table 3.12.10-beta.20 → 3.12.10-beta.21

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 (44) 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 +1 -1
  6. package/es/table/src/methods.js +149 -106
  7. package/es/table/style.css +2 -8
  8. package/es/table/style.min.css +1 -1
  9. package/es/ui/index.js +3 -3
  10. package/es/ui/src/log.js +1 -1
  11. package/es/vxe-table/style.css +2 -8
  12. package/es/vxe-table/style.min.css +1 -1
  13. package/lib/index.css +1 -1
  14. package/lib/index.min.css +1 -1
  15. package/lib/index.umd.js +164 -116
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/style.css +1 -1
  18. package/lib/style.min.css +1 -1
  19. package/lib/table/src/body.js +1 -1
  20. package/lib/table/src/body.min.js +1 -1
  21. package/lib/table/src/methods.js +159 -111
  22. package/lib/table/src/methods.min.js +1 -1
  23. package/lib/table/style/style.css +2 -8
  24. package/lib/table/style/style.min.css +1 -1
  25. package/lib/ui/index.js +3 -3
  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/lib/vxe-table/style/style.css +2 -8
  30. package/lib/vxe-table/style/style.min.css +1 -1
  31. package/package.json +1 -1
  32. package/packages/table/src/body.ts +1 -1
  33. package/packages/table/src/methods.ts +152 -106
  34. package/packages/ui/index.ts +2 -2
  35. package/styles/components/table.scss +2 -22
  36. package/styles/theme/dark.scss +1 -0
  37. package/styles/theme/light.scss +1 -0
  38. package/styles/variable.scss +1 -0
  39. /package/es/{iconfont.1737108347221.ttf → iconfont.1737182271148.ttf} +0 -0
  40. /package/es/{iconfont.1737108347221.woff → iconfont.1737182271148.woff} +0 -0
  41. /package/es/{iconfont.1737108347221.woff2 → iconfont.1737182271148.woff2} +0 -0
  42. /package/lib/{iconfont.1737108347221.ttf → iconfont.1737182271148.ttf} +0 -0
  43. /package/lib/{iconfont.1737108347221.woff → iconfont.1737182271148.woff} +0 -0
  44. /package/lib/{iconfont.1737108347221.woff2 → iconfont.1737182271148.woff2} +0 -0
@@ -521,7 +521,9 @@ function updateStyle($xeTable) {
521
521
  tableColumn,
522
522
  scrollXLoad,
523
523
  scrollYLoad,
524
+ overflowX,
524
525
  scrollbarWidth,
526
+ overflowY,
525
527
  scrollbarHeight,
526
528
  columnStore,
527
529
  editStore,
@@ -545,6 +547,8 @@ function updateStyle($xeTable) {
545
547
  return;
546
548
  }
547
549
  const containerList = ['main', 'left', 'right'];
550
+ const osbWidth = overflowY ? scrollbarWidth : 0;
551
+ const osbHeight = overflowX ? scrollbarHeight : 0;
548
552
  const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
549
553
  const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
550
554
  const mouseOpts = $xeTable.computeMouseOpts;
@@ -552,16 +556,16 @@ function updateStyle($xeTable) {
552
556
  const bodyTableElem = (0, _util.getRefElem)(elemStore['main-body-table']);
553
557
  if (emptyPlaceholderElem) {
554
558
  emptyPlaceholderElem.style.top = `${headerHeight}px`;
555
- emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - scrollbarHeight}px` : '';
559
+ emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
556
560
  }
557
561
  let bodyHeight = 0;
558
562
  let bodyMaxHeight = 0;
559
- const bodyMinHeight = customMinHeight - headerHeight - footerHeight - scrollbarHeight;
563
+ const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
560
564
  if (customMaxHeight) {
561
- bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - scrollbarHeight);
565
+ bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
562
566
  }
563
567
  if (customHeight) {
564
- bodyHeight = customHeight - headerHeight - footerHeight - scrollbarHeight;
568
+ bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
565
569
  }
566
570
  if (!bodyHeight) {
567
571
  if (bodyTableElem) {
@@ -579,27 +583,27 @@ function updateStyle($xeTable) {
579
583
  const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
580
584
  const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem;
581
585
  if (scrollXVirtualEl) {
582
- scrollXVirtualEl.style.height = `${scrollbarHeight}px`;
583
- scrollXVirtualEl.style.visibility = scrollbarHeight ? 'visible' : 'hidden';
586
+ scrollXVirtualEl.style.height = `${osbHeight}px`;
587
+ scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
584
588
  }
585
589
  const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem;
586
590
  if (xWrapperEl) {
587
- xWrapperEl.style.left = scrollbarXToTop ? `${scrollbarWidth}px` : '';
588
- xWrapperEl.style.width = `${el.clientWidth - scrollbarWidth}px`;
591
+ xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
592
+ xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
589
593
  }
590
594
  if (xLeftCornerEl) {
591
- xLeftCornerEl.style.width = scrollbarXToTop ? `${scrollbarWidth}px` : '';
592
- xLeftCornerEl.style.display = scrollbarXToTop ? scrollbarWidth && scrollbarHeight ? 'block' : '' : '';
595
+ xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
596
+ xLeftCornerEl.style.display = scrollbarXToTop ? osbWidth && osbHeight ? 'block' : '' : '';
593
597
  }
594
598
  if (xRightCornerEl) {
595
- xRightCornerEl.style.width = scrollbarXToTop ? '' : `${scrollbarWidth}px`;
596
- xRightCornerEl.style.display = scrollbarXToTop ? '' : scrollbarWidth && scrollbarHeight ? 'block' : '';
599
+ xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
600
+ xRightCornerEl.style.display = scrollbarXToTop ? '' : osbWidth && osbHeight ? 'block' : '';
597
601
  }
598
602
  const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
599
603
  if (scrollYVirtualEl) {
600
- scrollYVirtualEl.style.width = `${scrollbarWidth}px`;
604
+ scrollYVirtualEl.style.width = `${osbWidth}px`;
601
605
  scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
602
- scrollYVirtualEl.style.visibility = scrollbarWidth ? 'visible' : 'hidden';
606
+ scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
603
607
  }
604
608
  const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
605
609
  if (yTopCornerEl) {
@@ -718,7 +722,7 @@ function updateStyle($xeTable) {
718
722
  if (wrapperElem) {
719
723
  wrapperElem.style.top = `${headerHeight}px`;
720
724
  }
721
- fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + scrollbarHeight}px`;
725
+ fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + osbHeight}px`;
722
726
  fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
723
727
  }
724
728
  let tWidth = tableWidth;
@@ -747,7 +751,7 @@ function updateStyle($xeTable) {
747
751
  if (tableElem) {
748
752
  tableElem.style.width = tWidth ? `${tWidth}px` : '';
749
753
  // 兼容性处理
750
- tableElem.style.paddingRight = scrollbarWidth && fixedType && (_dom.browse['-moz'] || _dom.browse.safari) ? `${scrollbarWidth}px` : '';
754
+ tableElem.style.paddingRight = osbWidth && fixedType && (_dom.browse['-moz'] || _dom.browse.safari) ? `${osbWidth}px` : '';
751
755
  }
752
756
  const emptyBlockElem = (0, _util.getRefElem)(elemStore[`${name}-${layout}-emptyBlock`]);
753
757
  if (emptyBlockElem) {
@@ -782,7 +786,7 @@ function updateStyle($xeTable) {
782
786
  // 如果是固定列
783
787
  if (fixedWrapperElem) {
784
788
  if (wrapperElem) {
785
- wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - scrollbarHeight : tableHeight + headerHeight}px`;
789
+ wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
786
790
  }
787
791
  }
788
792
  }
@@ -1203,7 +1207,7 @@ function autoCellWidth($xeTable) {
1203
1207
  }
1204
1208
  const tableHeight = bodyElem.offsetHeight;
1205
1209
  const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
1206
- reactData.scrollbarWidth = overflowY ? Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth) : 0;
1210
+ reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
1207
1211
  reactData.overflowY = overflowY;
1208
1212
  internalData.tableWidth = tableWidth;
1209
1213
  internalData.tableHeight = tableHeight;
@@ -1212,7 +1216,7 @@ function autoCellWidth($xeTable) {
1212
1216
  const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
1213
1217
  const overflowX = tableWidth > bodyWidth;
1214
1218
  const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
1215
- reactData.scrollbarHeight = overflowX ? Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight) : 0;
1219
+ reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
1216
1220
  internalData.headerHeight = headerHeight;
1217
1221
  internalData.footerHeight = footerHeight;
1218
1222
  reactData.overflowX = overflowX;
@@ -1414,13 +1418,17 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
1414
1418
  return;
1415
1419
  }
1416
1420
  const {
1421
+ overflowX,
1417
1422
  scrollbarWidth,
1423
+ overflowY,
1418
1424
  scrollbarHeight
1419
1425
  } = reactData;
1420
1426
  const {
1421
1427
  prevDragToChild
1422
1428
  } = internalData;
1423
1429
  const wrapperRect = el.getBoundingClientRect();
1430
+ const osbWidth = overflowY ? scrollbarWidth : 0;
1431
+ const osbHeight = overflowX ? scrollbarHeight : 0;
1424
1432
  const tableWidth = el.clientWidth;
1425
1433
  const tableHeight = el.clientHeight;
1426
1434
  if (trEl) {
@@ -1431,14 +1439,14 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
1431
1439
  const trRect = trEl.getBoundingClientRect();
1432
1440
  let trHeight = trEl.clientHeight;
1433
1441
  const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
1434
- if (offsetTop + trHeight > tableHeight - scrollbarHeight) {
1435
- trHeight = tableHeight - offsetTop - scrollbarHeight;
1442
+ if (offsetTop + trHeight > tableHeight - osbHeight) {
1443
+ trHeight = tableHeight - offsetTop - osbHeight;
1436
1444
  }
1437
1445
  rdLineEl.style.display = 'block';
1438
- rdLineEl.style.left = `${scrollbarYToLeft ? scrollbarWidth : 0}px`;
1446
+ rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
1439
1447
  rdLineEl.style.top = `${offsetTop}px`;
1440
1448
  rdLineEl.style.height = `${trHeight}px`;
1441
- rdLineEl.style.width = `${tableWidth - scrollbarWidth}px`;
1449
+ rdLineEl.style.width = `${tableWidth - osbWidth}px`;
1442
1450
  rdLineEl.setAttribute('drag-pos', dragPos);
1443
1451
  rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
1444
1452
  } else {
@@ -1463,7 +1471,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
1463
1471
  thWidth -= startX - offsetLeft;
1464
1472
  offsetLeft = startX;
1465
1473
  }
1466
- const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : scrollbarWidth);
1474
+ const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
1467
1475
  if (offsetLeft + thWidth > endX) {
1468
1476
  thWidth = endX - offsetLeft;
1469
1477
  }
@@ -1474,7 +1482,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
1474
1482
  if (prevDragToChild) {
1475
1483
  cdLineEl.style.height = `${thRect.height}px`;
1476
1484
  } else {
1477
- cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : scrollbarHeight)}px`;
1485
+ cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
1478
1486
  }
1479
1487
  cdLineEl.setAttribute('drag-pos', dragPos);
1480
1488
  cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
@@ -1512,6 +1520,9 @@ function hideDropTip($xeTable) {
1512
1520
  */
1513
1521
  function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
1514
1522
  const reactData = $xeTable;
1523
+ if (!overflowElem) {
1524
+ return $xeTable.$nextTick();
1525
+ }
1515
1526
  params.cell = tdEl;
1516
1527
  const {
1517
1528
  tooltipStore
@@ -1955,6 +1966,54 @@ function loadScrollYData($xeTable, scrollTop) {
1955
1966
  }
1956
1967
  }
1957
1968
  }
1969
+ function lazyScrollXData($xeTable) {
1970
+ const internalData = $xeTable;
1971
+ const {
1972
+ lxTimeout,
1973
+ lxRunTime,
1974
+ scrollXStore
1975
+ } = internalData;
1976
+ const {
1977
+ visibleSize
1978
+ } = scrollXStore;
1979
+ const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)));
1980
+ if (lxTimeout) {
1981
+ clearTimeout(lxTimeout);
1982
+ }
1983
+ if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
1984
+ internalData.lxRunTime = Date.now();
1985
+ loadScrollXData($xeTable);
1986
+ }
1987
+ internalData.lxTimeout = setTimeout(() => {
1988
+ internalData.lxTimeout = undefined;
1989
+ internalData.lxRunTime = undefined;
1990
+ loadScrollXData($xeTable);
1991
+ }, fpsTime);
1992
+ }
1993
+ function lazyScrollYData($xeTable) {
1994
+ const internalData = $xeTable;
1995
+ const {
1996
+ lyTimeout,
1997
+ lyRunTime,
1998
+ scrollYStore
1999
+ } = internalData;
2000
+ const {
2001
+ visibleSize
2002
+ } = scrollYStore;
2003
+ const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)));
2004
+ if (lyTimeout) {
2005
+ clearTimeout(lyTimeout);
2006
+ }
2007
+ if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
2008
+ internalData.lyRunTime = Date.now();
2009
+ loadScrollYData($xeTable);
2010
+ }
2011
+ internalData.lyTimeout = setTimeout(() => {
2012
+ internalData.lyTimeout = undefined;
2013
+ internalData.lyRunTime = undefined;
2014
+ loadScrollYData($xeTable);
2015
+ }, fpsTime);
2016
+ }
1958
2017
  function checkLastSyncScroll($xeTable, isRollX, isRollY) {
1959
2018
  const reactData = $xeTable;
1960
2019
  const internalData = $xeTable;
@@ -1991,6 +2050,43 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
1991
2050
  $xeTable.updateCellAreas();
1992
2051
  }, 200);
1993
2052
  }
2053
+ const getWheelSpeed = lastScrollTime => {
2054
+ let multiple = 1;
2055
+ const currTime = Date.now();
2056
+ if (lastScrollTime + 25 > currTime) {
2057
+ multiple = 1.18;
2058
+ } else if (lastScrollTime + 30 > currTime) {
2059
+ multiple = 1.15;
2060
+ } else if (lastScrollTime + 40 > currTime) {
2061
+ multiple = 1.12;
2062
+ } else if (lastScrollTime + 55 > currTime) {
2063
+ multiple = 1.09;
2064
+ } else if (lastScrollTime + 75 > currTime) {
2065
+ multiple = 1.06;
2066
+ } else if (lastScrollTime + 100 > currTime) {
2067
+ multiple = 1.03;
2068
+ }
2069
+ return multiple;
2070
+ };
2071
+ const wheelScrollTo = (diffNum, cb) => {
2072
+ const duration = Math.abs(diffNum);
2073
+ const startTime = performance.now();
2074
+ let countTop = 0;
2075
+ const step = timestamp => {
2076
+ let progress = (timestamp - startTime) / duration;
2077
+ if (progress > 1) {
2078
+ progress = 1;
2079
+ }
2080
+ const easedProgress = Math.pow(progress, 2);
2081
+ const offsetTop = Math.floor(diffNum * easedProgress) - countTop;
2082
+ countTop += offsetTop;
2083
+ cb(offsetTop);
2084
+ if (progress < 1) {
2085
+ requestAnimationFrame(step);
2086
+ }
2087
+ };
2088
+ requestAnimationFrame(step);
2089
+ };
1994
2090
  function updateHeight($xeTable) {
1995
2091
  const internalData = $xeTable;
1996
2092
  internalData.customHeight = calcTableHeight($xeTable, 'height');
@@ -4121,6 +4217,7 @@ const Methods = {
4121
4217
  column
4122
4218
  } = params;
4123
4219
  const {
4220
+ overflowX,
4124
4221
  scrollbarHeight
4125
4222
  } = reactData;
4126
4223
  const {
@@ -4128,6 +4225,7 @@ const Methods = {
4128
4225
  visibleColumn
4129
4226
  } = internalData;
4130
4227
  const resizableOpts = $xeTable.computeResizableOpts;
4228
+ const osbHeight = overflowX ? scrollbarHeight : 0;
4131
4229
  const tableEl = $xeTable.$refs.refElem;
4132
4230
  const leftContainerElem = $xeTable.$refs.refLeftContainer;
4133
4231
  const rightContainerElem = $xeTable.$refs.refRightContainer;
@@ -4204,8 +4302,8 @@ const Methods = {
4204
4302
  dragLeft = Math.max(left, dragMinLeft);
4205
4303
  const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
4206
4304
  resizeBarElem.style.left = `${resizeBarLeft}px`;
4207
- resizeBarElem.style.top = `${scrollbarXToTop ? scrollbarHeight : 0}px`;
4208
- resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - scrollbarHeight : tableHeight}px`;
4305
+ resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`;
4306
+ resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
4209
4307
  if (resizableOpts.showDragTip && resizeTipElem) {
4210
4308
  resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
4211
4309
  const tableWidth = tableEl.clientWidth;
@@ -4321,13 +4419,17 @@ const Methods = {
4321
4419
  row
4322
4420
  } = params;
4323
4421
  const {
4422
+ overflowX,
4324
4423
  scrollbarWidth,
4424
+ overflowY,
4325
4425
  scrollbarHeight
4326
4426
  } = reactData;
4327
4427
  const {
4328
4428
  elemStore,
4329
4429
  fullAllDataRowIdData
4330
4430
  } = internalData;
4431
+ const osbWidth = overflowY ? scrollbarWidth : 0;
4432
+ const osbHeight = overflowX ? scrollbarHeight : 0;
4331
4433
  const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
4332
4434
  const resizableOpts = $xeTable.computeResizableOpts;
4333
4435
  const rowOpts = $xeTable.computeRowOpts;
@@ -4370,15 +4472,15 @@ const Methods = {
4370
4472
  const updateEvent = evnt => {
4371
4473
  evnt.stopPropagation();
4372
4474
  evnt.preventDefault();
4373
- const tableWidth = tableEl.clientWidth - scrollbarWidth;
4374
- const tableHeight = tableEl.clientHeight - scrollbarHeight;
4475
+ const tableWidth = tableEl.clientWidth - osbWidth;
4476
+ const tableHeight = tableEl.clientHeight - osbHeight;
4375
4477
  let dragTop = evnt.clientY - tableRect.y - targetOffsetY;
4376
4478
  if (dragTop < minTop) {
4377
4479
  dragTop = minTop;
4378
4480
  } else {
4379
4481
  resizeHeight = Math.max(cellMinHeight, currCellHeight + evnt.clientY - dragClientY);
4380
4482
  }
4381
- resizeBarElem.style.left = `${scrollbarYToLeft ? scrollbarWidth : 0}px`;
4483
+ resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
4382
4484
  resizeBarElem.style.top = `${dragTop}px`;
4383
4485
  resizeBarElem.style.width = `${tableWidth}px`;
4384
4486
  if (resizableOpts.showDragTip && resizeTipElem) {
@@ -8938,60 +9040,6 @@ const Methods = {
8938
9040
  }
8939
9041
  $xeTable.dispatchEvent('scroll', evntParams, evnt);
8940
9042
  },
8941
- lazyScrollXData() {
8942
- const $xeTable = this;
8943
- const internalData = $xeTable;
8944
- const {
8945
- lxTimeout,
8946
- lxRunTime,
8947
- scrollXStore
8948
- } = internalData;
8949
- const {
8950
- visibleSize
8951
- } = scrollXStore;
8952
- const fpsTime = Math.max(5, Math.min(80, Math.floor(visibleSize * 3)));
8953
- if (lxTimeout) {
8954
- clearTimeout(lxTimeout);
8955
- }
8956
- if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
8957
- internalData.lxRunTime = Date.now();
8958
- loadScrollXData($xeTable);
8959
- }
8960
- internalData.lxTimeout = setTimeout(() => {
8961
- internalData.lxTimeout = undefined;
8962
- internalData.lxRunTime = undefined;
8963
- loadScrollXData($xeTable);
8964
- }, fpsTime);
8965
- },
8966
- lazyScrollYData() {
8967
- const $xeTable = this;
8968
- const props = $xeTable;
8969
- const internalData = $xeTable;
8970
- const {
8971
- showOverflow
8972
- } = props;
8973
- const {
8974
- lyTimeout,
8975
- lyRunTime,
8976
- scrollYStore
8977
- } = internalData;
8978
- const {
8979
- visibleSize
8980
- } = scrollYStore;
8981
- const fpsTime = showOverflow ? 5 : Math.max(5, Math.min(80, Math.floor(visibleSize / 2)));
8982
- if (lyTimeout) {
8983
- clearTimeout(lyTimeout);
8984
- }
8985
- if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
8986
- internalData.lyRunTime = Date.now();
8987
- loadScrollYData($xeTable);
8988
- }
8989
- internalData.lyTimeout = setTimeout(() => {
8990
- internalData.lyTimeout = undefined;
8991
- internalData.lyRunTime = undefined;
8992
- loadScrollYData($xeTable);
8993
- }, fpsTime);
8994
- },
8995
9043
  /**
8996
9044
  * 横向 X 可视渲染事件处理
8997
9045
  */
@@ -9001,7 +9049,7 @@ const Methods = {
9001
9049
  if (sXOpts.immediate) {
9002
9050
  loadScrollXData($xeTable);
9003
9051
  } else {
9004
- $xeTable.lazyScrollXData();
9052
+ lazyScrollXData($xeTable);
9005
9053
  }
9006
9054
  },
9007
9055
  /**
@@ -9013,7 +9061,7 @@ const Methods = {
9013
9061
  if (sYOpts.immediate) {
9014
9062
  loadScrollYData($xeTable);
9015
9063
  } else {
9016
- $xeTable.lazyScrollYData();
9064
+ lazyScrollYData($xeTable);
9017
9065
  }
9018
9066
  },
9019
9067
  triggerBodyScrollEvent(evnt, fixedType) {
@@ -9219,22 +9267,9 @@ const Methods = {
9219
9267
  if (!bodyScrollElem) {
9220
9268
  return;
9221
9269
  }
9222
- let multiple = 1;
9223
- if (reactData.lastScrollTime + 25 > Date.now()) {
9224
- multiple = 1.18;
9225
- } else if (reactData.lastScrollTime + 30 > Date.now()) {
9226
- multiple = 1.15;
9227
- } else if (reactData.lastScrollTime + 40 > Date.now()) {
9228
- multiple = 1.12;
9229
- } else if (reactData.lastScrollTime + 55 > Date.now()) {
9230
- multiple = 1.09;
9231
- } else if (reactData.lastScrollTime + 75 > Date.now()) {
9232
- multiple = 1.06;
9233
- } else if (reactData.lastScrollTime + 100 > Date.now()) {
9234
- multiple = 1.03;
9235
- }
9236
- const deltaTop = deltaY * multiple;
9237
- const deltaLeft = deltaX * multiple;
9270
+ const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
9271
+ const deltaTop = deltaY * wheelSpeed;
9272
+ const deltaLeft = deltaX * wheelSpeed;
9238
9273
  const isTopWheel = deltaTop < 0;
9239
9274
  const currScrollTop = bodyScrollElem.scrollTop;
9240
9275
  // 如果滚动位置已经是顶部或底部,则不需要触发
@@ -9251,16 +9286,29 @@ const Methods = {
9251
9286
  if (rowOpts.isHover || highlightHoverRow) {
9252
9287
  $xeTable.clearHoverRow();
9253
9288
  }
9254
- internalData.inWheelScroll = true;
9255
- (0, _dom.setScrollTop)(yHandleEl, scrollTop);
9256
- (0, _dom.setScrollTop)(bodyScrollElem, scrollTop);
9257
- (0, _dom.setScrollTop)(leftScrollElem, scrollTop);
9258
- (0, _dom.setScrollTop)(rightScrollElem, scrollTop);
9259
- loadScrollYData($xeTable, scrollTop);
9260
- $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
9261
- type: 'footer',
9262
- fixed: ''
9289
+ wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
9290
+ const currTopNum = bodyScrollElem.scrollTop + offsetTop;
9291
+ internalData.inWheelScroll = true;
9292
+ (0, _dom.setScrollTop)(yHandleEl, currTopNum);
9293
+ (0, _dom.setScrollTop)(bodyScrollElem, currTopNum);
9294
+ (0, _dom.setScrollTop)(leftScrollElem, currTopNum);
9295
+ (0, _dom.setScrollTop)(rightScrollElem, currTopNum);
9296
+ $xeTable.triggerScrollYEvent(evnt);
9297
+ $xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
9298
+ type: 'table',
9299
+ fixed: ''
9300
+ });
9263
9301
  });
9302
+ // internalData.inWheelScroll = true
9303
+ // setScrollTop(yHandleEl, scrollTop)
9304
+ // setScrollTop(bodyScrollElem, scrollTop)
9305
+ // setScrollTop(leftScrollElem, scrollTop)
9306
+ // setScrollTop(rightScrollElem, scrollTop)
9307
+ // loadScrollYData($xeTable, scrollTop)
9308
+ // $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
9309
+ // type: 'footer',
9310
+ // fixed: ''
9311
+ // })
9264
9312
  }
9265
9313
  },
9266
9314
  triggerVirtualScrollXEvent(evnt) {