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.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +1 -1
- package/es/table/src/methods.js +149 -106
- package/es/table/style.css +2 -8
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +3 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +2 -8
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +164 -116
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +1 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +159 -111
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/style/style.css +2 -8
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +3 -3
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +2 -8
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/src/body.ts +1 -1
- package/packages/table/src/methods.ts +152 -106
- package/packages/ui/index.ts +2 -2
- package/styles/components/table.scss +2 -22
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -0
- /package/es/{iconfont.1737108347221.ttf → iconfont.1737182271148.ttf} +0 -0
- /package/es/{iconfont.1737108347221.woff → iconfont.1737182271148.woff} +0 -0
- /package/es/{iconfont.1737108347221.woff2 → iconfont.1737182271148.woff2} +0 -0
- /package/lib/{iconfont.1737108347221.ttf → iconfont.1737182271148.ttf} +0 -0
- /package/lib/{iconfont.1737108347221.woff → iconfont.1737182271148.woff} +0 -0
- /package/lib/{iconfont.1737108347221.woff2 → iconfont.1737182271148.woff2} +0 -0
|
@@ -418,13 +418,15 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
418
418
|
const internalData = $xeTable as unknown as TableInternalData
|
|
419
419
|
|
|
420
420
|
const { border, showOverflow: allColumnOverflow, showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props
|
|
421
|
-
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, scrollbarWidth, scrollbarHeight, columnStore, editStore, isAllOverflow, expandColumn } = reactData
|
|
421
|
+
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, columnStore, editStore, isAllOverflow, expandColumn } = reactData
|
|
422
422
|
const { visibleColumn, fullColumnIdData, tableHeight, tableWidth, headerHeight, footerHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData
|
|
423
423
|
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
424
424
|
if (!el) {
|
|
425
425
|
return
|
|
426
426
|
}
|
|
427
427
|
const containerList = ['main', 'left', 'right']
|
|
428
|
+
const osbWidth = overflowY ? scrollbarWidth : 0
|
|
429
|
+
const osbHeight = overflowX ? scrollbarHeight : 0
|
|
428
430
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder as HTMLDivElement
|
|
429
431
|
const cellOffsetWidth = $xeTable.computeCellOffsetWidth
|
|
430
432
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
@@ -432,17 +434,17 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
432
434
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
433
435
|
if (emptyPlaceholderElem) {
|
|
434
436
|
emptyPlaceholderElem.style.top = `${headerHeight}px`
|
|
435
|
-
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight -
|
|
437
|
+
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : ''
|
|
436
438
|
}
|
|
437
439
|
|
|
438
440
|
let bodyHeight = 0
|
|
439
441
|
let bodyMaxHeight = 0
|
|
440
|
-
const bodyMinHeight = customMinHeight - headerHeight - footerHeight -
|
|
442
|
+
const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight
|
|
441
443
|
if (customMaxHeight) {
|
|
442
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight -
|
|
444
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight)
|
|
443
445
|
}
|
|
444
446
|
if (customHeight) {
|
|
445
|
-
bodyHeight = customHeight - headerHeight - footerHeight -
|
|
447
|
+
bodyHeight = customHeight - headerHeight - footerHeight - osbHeight
|
|
446
448
|
}
|
|
447
449
|
if (!bodyHeight) {
|
|
448
450
|
if (bodyTableElem) {
|
|
@@ -461,28 +463,28 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
461
463
|
const scrollbarXToTop = $xeTable.computeScrollbarXToTop
|
|
462
464
|
const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem as HTMLDivElement
|
|
463
465
|
if (scrollXVirtualEl) {
|
|
464
|
-
scrollXVirtualEl.style.height = `${
|
|
465
|
-
scrollXVirtualEl.style.visibility =
|
|
466
|
+
scrollXVirtualEl.style.height = `${osbHeight}px`
|
|
467
|
+
scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden'
|
|
466
468
|
}
|
|
467
469
|
const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem as HTMLDivElement
|
|
468
470
|
if (xWrapperEl) {
|
|
469
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${
|
|
470
|
-
xWrapperEl.style.width = `${el.clientWidth -
|
|
471
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : ''
|
|
472
|
+
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`
|
|
471
473
|
}
|
|
472
474
|
if (xLeftCornerEl) {
|
|
473
|
-
xLeftCornerEl.style.width = scrollbarXToTop ? `${
|
|
474
|
-
xLeftCornerEl.style.display = scrollbarXToTop ? (
|
|
475
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : ''
|
|
476
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? (osbWidth && osbHeight ? 'block' : '') : ''
|
|
475
477
|
}
|
|
476
478
|
if (xRightCornerEl) {
|
|
477
|
-
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${
|
|
478
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' : (
|
|
479
|
+
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`
|
|
480
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : (osbWidth && osbHeight ? 'block' : '')
|
|
479
481
|
}
|
|
480
482
|
|
|
481
483
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem as HTMLDivElement
|
|
482
484
|
if (scrollYVirtualEl) {
|
|
483
|
-
scrollYVirtualEl.style.width = `${
|
|
485
|
+
scrollYVirtualEl.style.width = `${osbWidth}px`
|
|
484
486
|
scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`
|
|
485
|
-
scrollYVirtualEl.style.visibility =
|
|
487
|
+
scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden'
|
|
486
488
|
}
|
|
487
489
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem as HTMLDivElement
|
|
488
490
|
if (yTopCornerEl) {
|
|
@@ -608,7 +610,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
608
610
|
if (wrapperElem) {
|
|
609
611
|
wrapperElem.style.top = `${headerHeight}px`
|
|
610
612
|
}
|
|
611
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + headerHeight + footerHeight +
|
|
613
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + headerHeight + footerHeight + osbHeight)}px`
|
|
612
614
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`
|
|
613
615
|
}
|
|
614
616
|
|
|
@@ -643,7 +645,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
643
645
|
if (tableElem) {
|
|
644
646
|
tableElem.style.width = tWidth ? `${tWidth}px` : ''
|
|
645
647
|
// 兼容性处理
|
|
646
|
-
tableElem.style.paddingRight =
|
|
648
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browse['-moz'] || browse.safari) ? `${osbWidth}px` : ''
|
|
647
649
|
}
|
|
648
650
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`])
|
|
649
651
|
if (emptyBlockElem) {
|
|
@@ -683,7 +685,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
683
685
|
// 如果是固定列
|
|
684
686
|
if (fixedWrapperElem) {
|
|
685
687
|
if (wrapperElem) {
|
|
686
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight -
|
|
688
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`
|
|
687
689
|
}
|
|
688
690
|
}
|
|
689
691
|
}
|
|
@@ -1063,7 +1065,7 @@ function autoCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
|
|
|
1063
1065
|
}
|
|
1064
1066
|
const tableHeight = bodyElem.offsetHeight
|
|
1065
1067
|
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight
|
|
1066
|
-
reactData.scrollbarWidth =
|
|
1068
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth)
|
|
1067
1069
|
reactData.overflowY = overflowY
|
|
1068
1070
|
internalData.tableWidth = tableWidth
|
|
1069
1071
|
internalData.tableHeight = tableHeight
|
|
@@ -1073,7 +1075,7 @@ function autoCellWidth ($xeTable: VxeTableConstructor & VxeTablePrivateMethods)
|
|
|
1073
1075
|
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0
|
|
1074
1076
|
const overflowX = tableWidth > bodyWidth
|
|
1075
1077
|
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0
|
|
1076
|
-
reactData.scrollbarHeight =
|
|
1078
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight)
|
|
1077
1079
|
internalData.headerHeight = headerHeight
|
|
1078
1080
|
internalData.footerHeight = footerHeight
|
|
1079
1081
|
reactData.overflowX = overflowX
|
|
@@ -1265,9 +1267,11 @@ function showDropTip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, ev
|
|
|
1265
1267
|
if (!el) {
|
|
1266
1268
|
return
|
|
1267
1269
|
}
|
|
1268
|
-
const { scrollbarWidth, scrollbarHeight } = reactData
|
|
1270
|
+
const { overflowX, scrollbarWidth, overflowY, scrollbarHeight } = reactData
|
|
1269
1271
|
const { prevDragToChild } = internalData
|
|
1270
1272
|
const wrapperRect = el.getBoundingClientRect()
|
|
1273
|
+
const osbWidth = overflowY ? scrollbarWidth : 0
|
|
1274
|
+
const osbHeight = overflowX ? scrollbarHeight : 0
|
|
1271
1275
|
const tableWidth = el.clientWidth
|
|
1272
1276
|
const tableHeight = el.clientHeight
|
|
1273
1277
|
if (trEl) {
|
|
@@ -1278,14 +1282,14 @@ function showDropTip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, ev
|
|
|
1278
1282
|
const trRect = trEl.getBoundingClientRect()
|
|
1279
1283
|
let trHeight = trEl.clientHeight
|
|
1280
1284
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y)
|
|
1281
|
-
if (offsetTop + trHeight > tableHeight -
|
|
1282
|
-
trHeight = tableHeight - offsetTop -
|
|
1285
|
+
if (offsetTop + trHeight > tableHeight - osbHeight) {
|
|
1286
|
+
trHeight = tableHeight - offsetTop - osbHeight
|
|
1283
1287
|
}
|
|
1284
1288
|
rdLineEl.style.display = 'block'
|
|
1285
|
-
rdLineEl.style.left = `${scrollbarYToLeft ?
|
|
1289
|
+
rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`
|
|
1286
1290
|
rdLineEl.style.top = `${offsetTop}px`
|
|
1287
1291
|
rdLineEl.style.height = `${trHeight}px`
|
|
1288
|
-
rdLineEl.style.width = `${tableWidth -
|
|
1292
|
+
rdLineEl.style.width = `${tableWidth - osbWidth}px`
|
|
1289
1293
|
rdLineEl.setAttribute('drag-pos', dragPos)
|
|
1290
1294
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n')
|
|
1291
1295
|
} else {
|
|
@@ -1310,7 +1314,7 @@ function showDropTip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, ev
|
|
|
1310
1314
|
thWidth -= startX - offsetLeft
|
|
1311
1315
|
offsetLeft = startX
|
|
1312
1316
|
}
|
|
1313
|
-
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 :
|
|
1317
|
+
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth)
|
|
1314
1318
|
if (offsetLeft + thWidth > endX) {
|
|
1315
1319
|
thWidth = endX - offsetLeft
|
|
1316
1320
|
}
|
|
@@ -1321,7 +1325,7 @@ function showDropTip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, ev
|
|
|
1321
1325
|
if (prevDragToChild) {
|
|
1322
1326
|
cdLineEl.style.height = `${thRect.height}px`
|
|
1323
1327
|
} else {
|
|
1324
|
-
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 :
|
|
1328
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`
|
|
1325
1329
|
}
|
|
1326
1330
|
cdLineEl.setAttribute('drag-pos', dragPos)
|
|
1327
1331
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n')
|
|
@@ -1362,6 +1366,9 @@ function hideDropTip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1362
1366
|
function handleTooltip ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, evnt: MouseEvent, tdEl: HTMLTableCellElement, overflowElem: HTMLElement, tipElem: HTMLElement | null, params: any) {
|
|
1363
1367
|
const reactData = $xeTable as unknown as TableReactData
|
|
1364
1368
|
|
|
1369
|
+
if (!overflowElem) {
|
|
1370
|
+
return $xeTable.$nextTick()
|
|
1371
|
+
}
|
|
1365
1372
|
params.cell = tdEl
|
|
1366
1373
|
const { tooltipStore } = reactData
|
|
1367
1374
|
const tooltipOpts = $xeTable.computeTooltipOpts
|
|
@@ -1750,6 +1757,46 @@ function loadScrollYData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods
|
|
|
1750
1757
|
}
|
|
1751
1758
|
}
|
|
1752
1759
|
|
|
1760
|
+
function lazyScrollXData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
1761
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
1762
|
+
|
|
1763
|
+
const { lxTimeout, lxRunTime, scrollXStore } = internalData
|
|
1764
|
+
const { visibleSize } = scrollXStore
|
|
1765
|
+
const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)))
|
|
1766
|
+
if (lxTimeout) {
|
|
1767
|
+
clearTimeout(lxTimeout)
|
|
1768
|
+
}
|
|
1769
|
+
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
1770
|
+
internalData.lxRunTime = Date.now()
|
|
1771
|
+
loadScrollXData($xeTable)
|
|
1772
|
+
}
|
|
1773
|
+
internalData.lxTimeout = setTimeout(() => {
|
|
1774
|
+
internalData.lxTimeout = undefined
|
|
1775
|
+
internalData.lxRunTime = undefined
|
|
1776
|
+
loadScrollXData($xeTable)
|
|
1777
|
+
}, fpsTime)
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
function lazyScrollYData ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
1781
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
1782
|
+
|
|
1783
|
+
const { lyTimeout, lyRunTime, scrollYStore } = internalData
|
|
1784
|
+
const { visibleSize } = scrollYStore
|
|
1785
|
+
const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)))
|
|
1786
|
+
if (lyTimeout) {
|
|
1787
|
+
clearTimeout(lyTimeout)
|
|
1788
|
+
}
|
|
1789
|
+
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
1790
|
+
internalData.lyRunTime = Date.now()
|
|
1791
|
+
loadScrollYData($xeTable)
|
|
1792
|
+
}
|
|
1793
|
+
internalData.lyTimeout = setTimeout(() => {
|
|
1794
|
+
internalData.lyTimeout = undefined
|
|
1795
|
+
internalData.lyRunTime = undefined
|
|
1796
|
+
loadScrollYData($xeTable)
|
|
1797
|
+
}, fpsTime)
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1753
1800
|
function checkLastSyncScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMethods, isRollX: boolean, isRollY: boolean) {
|
|
1754
1801
|
const reactData = $xeTable as unknown as TableReactData
|
|
1755
1802
|
const internalData = $xeTable as unknown as TableInternalData
|
|
@@ -1783,6 +1830,45 @@ function checkLastSyncScroll ($xeTable: VxeTableConstructor & VxeTablePrivateMet
|
|
|
1783
1830
|
}, 200)
|
|
1784
1831
|
}
|
|
1785
1832
|
|
|
1833
|
+
const getWheelSpeed = (lastScrollTime: number) => {
|
|
1834
|
+
let multiple = 1
|
|
1835
|
+
const currTime = Date.now()
|
|
1836
|
+
if (lastScrollTime + 25 > currTime) {
|
|
1837
|
+
multiple = 1.18
|
|
1838
|
+
} else if (lastScrollTime + 30 > currTime) {
|
|
1839
|
+
multiple = 1.15
|
|
1840
|
+
} else if (lastScrollTime + 40 > currTime) {
|
|
1841
|
+
multiple = 1.12
|
|
1842
|
+
} else if (lastScrollTime + 55 > currTime) {
|
|
1843
|
+
multiple = 1.09
|
|
1844
|
+
} else if (lastScrollTime + 75 > currTime) {
|
|
1845
|
+
multiple = 1.06
|
|
1846
|
+
} else if (lastScrollTime + 100 > currTime) {
|
|
1847
|
+
multiple = 1.03
|
|
1848
|
+
}
|
|
1849
|
+
return multiple
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
const wheelScrollTo = (diffNum: number, cb: (progress: number) => void) => {
|
|
1853
|
+
const duration = Math.abs(diffNum)
|
|
1854
|
+
const startTime = performance.now()
|
|
1855
|
+
let countTop = 0
|
|
1856
|
+
const step = (timestamp: number) => {
|
|
1857
|
+
let progress = (timestamp - startTime) / duration
|
|
1858
|
+
if (progress > 1) {
|
|
1859
|
+
progress = 1
|
|
1860
|
+
}
|
|
1861
|
+
const easedProgress = Math.pow(progress, 2)
|
|
1862
|
+
const offsetTop = Math.floor((diffNum * easedProgress)) - countTop
|
|
1863
|
+
countTop += offsetTop
|
|
1864
|
+
cb(offsetTop)
|
|
1865
|
+
if (progress < 1) {
|
|
1866
|
+
requestAnimationFrame(step)
|
|
1867
|
+
}
|
|
1868
|
+
}
|
|
1869
|
+
requestAnimationFrame(step)
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1786
1872
|
function updateHeight ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
1787
1873
|
const internalData = $xeTable as unknown as TableInternalData
|
|
1788
1874
|
|
|
@@ -3610,9 +3696,10 @@ const Methods = {
|
|
|
3610
3696
|
evnt.stopPropagation()
|
|
3611
3697
|
evnt.preventDefault()
|
|
3612
3698
|
const { column } = params
|
|
3613
|
-
const { scrollbarHeight } = reactData
|
|
3699
|
+
const { overflowX, scrollbarHeight } = reactData
|
|
3614
3700
|
const { elemStore, visibleColumn } = internalData
|
|
3615
3701
|
const resizableOpts = $xeTable.computeResizableOpts
|
|
3702
|
+
const osbHeight = overflowX ? scrollbarHeight : 0
|
|
3616
3703
|
const tableEl = $xeTable.$refs.refElem as HTMLDivElement
|
|
3617
3704
|
const leftContainerElem = $xeTable.$refs.refLeftContainer as HTMLDivElement
|
|
3618
3705
|
const rightContainerElem = $xeTable.$refs.refRightContainer as HTMLDivElement
|
|
@@ -3687,8 +3774,8 @@ const Methods = {
|
|
|
3687
3774
|
dragLeft = Math.max(left, dragMinLeft)
|
|
3688
3775
|
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft)
|
|
3689
3776
|
resizeBarElem.style.left = `${resizeBarLeft}px`
|
|
3690
|
-
resizeBarElem.style.top = `${scrollbarXToTop ?
|
|
3691
|
-
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight -
|
|
3777
|
+
resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`
|
|
3778
|
+
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`
|
|
3692
3779
|
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
3693
3780
|
resizeTipElem.textContent = getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)])
|
|
3694
3781
|
const tableWidth = tableEl.clientWidth
|
|
@@ -3794,8 +3881,10 @@ const Methods = {
|
|
|
3794
3881
|
evnt.stopPropagation()
|
|
3795
3882
|
evnt.preventDefault()
|
|
3796
3883
|
const { row } = params
|
|
3797
|
-
const { scrollbarWidth, scrollbarHeight } = reactData
|
|
3884
|
+
const { overflowX, scrollbarWidth, overflowY, scrollbarHeight } = reactData
|
|
3798
3885
|
const { elemStore, fullAllDataRowIdData } = internalData
|
|
3886
|
+
const osbWidth = overflowY ? scrollbarWidth : 0
|
|
3887
|
+
const osbHeight = overflowX ? scrollbarHeight : 0
|
|
3799
3888
|
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft
|
|
3800
3889
|
const resizableOpts = $xeTable.computeResizableOpts
|
|
3801
3890
|
const rowOpts = $xeTable.computeRowOpts
|
|
@@ -3836,15 +3925,15 @@ const Methods = {
|
|
|
3836
3925
|
const updateEvent = (evnt: MouseEvent) => {
|
|
3837
3926
|
evnt.stopPropagation()
|
|
3838
3927
|
evnt.preventDefault()
|
|
3839
|
-
const tableWidth = tableEl.clientWidth -
|
|
3840
|
-
const tableHeight = tableEl.clientHeight -
|
|
3928
|
+
const tableWidth = tableEl.clientWidth - osbWidth
|
|
3929
|
+
const tableHeight = tableEl.clientHeight - osbHeight
|
|
3841
3930
|
let dragTop = evnt.clientY - tableRect.y - targetOffsetY
|
|
3842
3931
|
if (dragTop < minTop) {
|
|
3843
3932
|
dragTop = minTop
|
|
3844
3933
|
} else {
|
|
3845
3934
|
resizeHeight = Math.max(cellMinHeight, currCellHeight + evnt.clientY - dragClientY)
|
|
3846
3935
|
}
|
|
3847
|
-
resizeBarElem.style.left = `${scrollbarYToLeft ?
|
|
3936
|
+
resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`
|
|
3848
3937
|
resizeBarElem.style.top = `${dragTop}px`
|
|
3849
3938
|
resizeBarElem.style.width = `${tableWidth}px`
|
|
3850
3939
|
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
@@ -7701,48 +7790,6 @@ const Methods = {
|
|
|
7701
7790
|
}
|
|
7702
7791
|
$xeTable.dispatchEvent('scroll', evntParams, evnt)
|
|
7703
7792
|
},
|
|
7704
|
-
lazyScrollXData () {
|
|
7705
|
-
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
7706
|
-
const internalData = $xeTable as unknown as TableInternalData
|
|
7707
|
-
|
|
7708
|
-
const { lxTimeout, lxRunTime, scrollXStore } = internalData
|
|
7709
|
-
const { visibleSize } = scrollXStore
|
|
7710
|
-
const fpsTime = Math.max(5, Math.min(80, Math.floor(visibleSize * 3)))
|
|
7711
|
-
if (lxTimeout) {
|
|
7712
|
-
clearTimeout(lxTimeout)
|
|
7713
|
-
}
|
|
7714
|
-
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
7715
|
-
internalData.lxRunTime = Date.now()
|
|
7716
|
-
loadScrollXData($xeTable)
|
|
7717
|
-
}
|
|
7718
|
-
internalData.lxTimeout = setTimeout(() => {
|
|
7719
|
-
internalData.lxTimeout = undefined
|
|
7720
|
-
internalData.lxRunTime = undefined
|
|
7721
|
-
loadScrollXData($xeTable)
|
|
7722
|
-
}, fpsTime)
|
|
7723
|
-
},
|
|
7724
|
-
lazyScrollYData () {
|
|
7725
|
-
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
7726
|
-
const props = $xeTable
|
|
7727
|
-
const internalData = $xeTable as unknown as TableInternalData
|
|
7728
|
-
|
|
7729
|
-
const { showOverflow } = props
|
|
7730
|
-
const { lyTimeout, lyRunTime, scrollYStore } = internalData
|
|
7731
|
-
const { visibleSize } = scrollYStore
|
|
7732
|
-
const fpsTime = showOverflow ? 5 : Math.max(5, Math.min(80, Math.floor(visibleSize / 2)))
|
|
7733
|
-
if (lyTimeout) {
|
|
7734
|
-
clearTimeout(lyTimeout)
|
|
7735
|
-
}
|
|
7736
|
-
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
7737
|
-
internalData.lyRunTime = Date.now()
|
|
7738
|
-
loadScrollYData($xeTable)
|
|
7739
|
-
}
|
|
7740
|
-
internalData.lyTimeout = setTimeout(() => {
|
|
7741
|
-
internalData.lyTimeout = undefined
|
|
7742
|
-
internalData.lyRunTime = undefined
|
|
7743
|
-
loadScrollYData($xeTable)
|
|
7744
|
-
}, fpsTime)
|
|
7745
|
-
},
|
|
7746
7793
|
/**
|
|
7747
7794
|
* 横向 X 可视渲染事件处理
|
|
7748
7795
|
*/
|
|
@@ -7753,7 +7800,7 @@ const Methods = {
|
|
|
7753
7800
|
if (sXOpts.immediate) {
|
|
7754
7801
|
loadScrollXData($xeTable)
|
|
7755
7802
|
} else {
|
|
7756
|
-
$xeTable
|
|
7803
|
+
lazyScrollXData($xeTable)
|
|
7757
7804
|
}
|
|
7758
7805
|
},
|
|
7759
7806
|
/**
|
|
@@ -7766,7 +7813,7 @@ const Methods = {
|
|
|
7766
7813
|
if (sYOpts.immediate) {
|
|
7767
7814
|
loadScrollYData($xeTable)
|
|
7768
7815
|
} else {
|
|
7769
|
-
$xeTable
|
|
7816
|
+
lazyScrollYData($xeTable)
|
|
7770
7817
|
}
|
|
7771
7818
|
},
|
|
7772
7819
|
triggerBodyScrollEvent (evnt: Event, fixedType: '' | 'left' | 'right') {
|
|
@@ -7944,24 +7991,9 @@ const Methods = {
|
|
|
7944
7991
|
return
|
|
7945
7992
|
}
|
|
7946
7993
|
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
multiple = 1.18
|
|
7951
|
-
} else if (reactData.lastScrollTime + 30 > Date.now()) {
|
|
7952
|
-
multiple = 1.15
|
|
7953
|
-
} else if (reactData.lastScrollTime + 40 > Date.now()) {
|
|
7954
|
-
multiple = 1.12
|
|
7955
|
-
} else if (reactData.lastScrollTime + 55 > Date.now()) {
|
|
7956
|
-
multiple = 1.09
|
|
7957
|
-
} else if (reactData.lastScrollTime + 75 > Date.now()) {
|
|
7958
|
-
multiple = 1.06
|
|
7959
|
-
} else if (reactData.lastScrollTime + 100 > Date.now()) {
|
|
7960
|
-
multiple = 1.03
|
|
7961
|
-
}
|
|
7962
|
-
|
|
7963
|
-
const deltaTop = deltaY * multiple
|
|
7964
|
-
const deltaLeft = deltaX * multiple
|
|
7994
|
+
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime)
|
|
7995
|
+
const deltaTop = deltaY * wheelSpeed
|
|
7996
|
+
const deltaLeft = deltaX * wheelSpeed
|
|
7965
7997
|
|
|
7966
7998
|
const isTopWheel = deltaTop < 0
|
|
7967
7999
|
const currScrollTop = bodyScrollElem.scrollTop
|
|
@@ -7982,17 +8014,31 @@ const Methods = {
|
|
|
7982
8014
|
$xeTable.clearHoverRow()
|
|
7983
8015
|
}
|
|
7984
8016
|
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
8017
|
+
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, (offsetTop: number) => {
|
|
8018
|
+
const currTopNum = bodyScrollElem.scrollTop + offsetTop
|
|
8019
|
+
internalData.inWheelScroll = true
|
|
8020
|
+
setScrollTop(yHandleEl, currTopNum)
|
|
8021
|
+
setScrollTop(bodyScrollElem, currTopNum)
|
|
8022
|
+
setScrollTop(leftScrollElem, currTopNum)
|
|
8023
|
+
setScrollTop(rightScrollElem, currTopNum)
|
|
8024
|
+
$xeTable.triggerScrollYEvent(evnt)
|
|
8025
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
8026
|
+
type: 'table',
|
|
8027
|
+
fixed: ''
|
|
8028
|
+
})
|
|
7995
8029
|
})
|
|
8030
|
+
|
|
8031
|
+
// internalData.inWheelScroll = true
|
|
8032
|
+
// setScrollTop(yHandleEl, scrollTop)
|
|
8033
|
+
// setScrollTop(bodyScrollElem, scrollTop)
|
|
8034
|
+
// setScrollTop(leftScrollElem, scrollTop)
|
|
8035
|
+
// setScrollTop(rightScrollElem, scrollTop)
|
|
8036
|
+
|
|
8037
|
+
// loadScrollYData($xeTable, scrollTop)
|
|
8038
|
+
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
8039
|
+
// type: 'footer',
|
|
8040
|
+
// fixed: ''
|
|
8041
|
+
// })
|
|
7996
8042
|
}
|
|
7997
8043
|
},
|
|
7998
8044
|
triggerVirtualScrollXEvent (evnt: Event) {
|
package/packages/ui/index.ts
CHANGED
|
@@ -457,26 +457,6 @@
|
|
|
457
457
|
|
|
458
458
|
/*scroll*/
|
|
459
459
|
.vxe-table {
|
|
460
|
-
&.is--scroll-x {
|
|
461
|
-
&:hover {
|
|
462
|
-
& > .vxe-table--scroll-x-virtual {
|
|
463
|
-
.vxe-table--scroll-x-handle {
|
|
464
|
-
overflow-x: scroll;
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
&.is--scroll-y {
|
|
470
|
-
&:hover {
|
|
471
|
-
& > .vxe-table--layout-wrapper {
|
|
472
|
-
& > .vxe-table--scroll-y-virtual {
|
|
473
|
-
.vxe-table--scroll-y-handle {
|
|
474
|
-
overflow-y: scroll;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
460
|
&.is--loading {
|
|
481
461
|
& > .vxe-table--scroll-x-virtual {
|
|
482
462
|
visibility: hidden;
|
|
@@ -518,7 +498,7 @@
|
|
|
518
498
|
}
|
|
519
499
|
.vxe-table--scroll-x-handle {
|
|
520
500
|
overflow-y: hidden;
|
|
521
|
-
overflow-x:
|
|
501
|
+
overflow-x: scroll;
|
|
522
502
|
height: 18px;
|
|
523
503
|
}
|
|
524
504
|
.vxe-table--scroll-x-wrapper {
|
|
@@ -532,7 +512,7 @@
|
|
|
532
512
|
top: 0;
|
|
533
513
|
}
|
|
534
514
|
.vxe-table--scroll-y-handle {
|
|
535
|
-
overflow-y:
|
|
515
|
+
overflow-y: scroll;
|
|
536
516
|
overflow-x: hidden;
|
|
537
517
|
width: 18px;
|
|
538
518
|
height: 100%;
|
package/styles/theme/dark.scss
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
/*table*/
|
|
32
32
|
--vxe-ui-table-header-background-color: #28282a;
|
|
33
|
+
--vxe-ui-table-column-to-row-background-color: #28282a;
|
|
33
34
|
--vxe-ui-table-border-color: #37373a;
|
|
34
35
|
--vxe-ui-table-row-hover-background-color: #262727;
|
|
35
36
|
--vxe-ui-table-row-striped-background-color: #1D1D1D;
|
package/styles/theme/light.scss
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
/*table*/
|
|
28
28
|
--vxe-ui-table-header-background-color: #{light_variable.$vxe-ui-table-header-background-color};
|
|
29
|
+
--vxe-ui-table-column-to-row-background-color: #{light_variable.$vxe-ui-table-column-to-row-background-color};
|
|
29
30
|
--vxe-ui-table-border-color: #{light_variable.$vxe-ui-table-border-color};
|
|
30
31
|
--vxe-ui-table-row-hover-background-color: #{light_variable.$vxe-ui-table-row-hover-background-color};
|
|
31
32
|
--vxe-ui-table-row-striped-background-color: #{light_variable.$vxe-ui-table-row-striped-background-color};
|
package/styles/variable.scss
CHANGED
|
@@ -25,6 +25,7 @@ $vxe-ui-loading-background-color: rgba(255, 255, 255, 0.5) !default;
|
|
|
25
25
|
|
|
26
26
|
/*table*/
|
|
27
27
|
$vxe-ui-table-header-background-color: #f8f8f9 !default;
|
|
28
|
+
$vxe-ui-table-column-to-row-background-color: #f8f8f9 !default;
|
|
28
29
|
$vxe-ui-table-border-color: #e8eaec !default;
|
|
29
30
|
$vxe-ui-table-row-hover-background-color: #f5f7fa !default;
|
|
30
31
|
$vxe-ui-table-row-striped-background-color: #fafafa !default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|