vxe-table 4.11.0 → 4.11.2
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/module/export/hook.js +9 -6
- package/es/table/src/table.js +65 -27
- package/es/table/style.css +2 -0
- 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 -0
- 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 +77 -38
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/export/hook.js +10 -7
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/table.js +64 -27
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +2 -0
- 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 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/export/hook.ts +9 -6
- package/packages/table/src/table.ts +68 -31
- package/packages/ui/index.ts +2 -2
- package/styles/components/table.scss +2 -0
- /package/es/{iconfont.1739842441645.ttf → iconfont.1739871583820.ttf} +0 -0
- /package/es/{iconfont.1739842441645.woff → iconfont.1739871583820.woff} +0 -0
- /package/es/{iconfont.1739842441645.woff2 → iconfont.1739871583820.woff2} +0 -0
- /package/lib/{iconfont.1739842441645.ttf → iconfont.1739871583820.ttf} +0 -0
- /package/lib/{iconfont.1739842441645.woff → iconfont.1739871583820.woff} +0 -0
- /package/lib/{iconfont.1739842441645.woff2 → iconfont.1739871583820.woff2} +0 -0
|
@@ -3385,7 +3385,13 @@ export default defineComponent({
|
|
|
3385
3385
|
return multiple
|
|
3386
3386
|
}
|
|
3387
3387
|
|
|
3388
|
-
const
|
|
3388
|
+
const wheelScrollLeftTo = (scrollLeft: number, cb: (offsetLeft: number) => void) => {
|
|
3389
|
+
requestAnimationFrame(() => {
|
|
3390
|
+
cb(scrollLeft)
|
|
3391
|
+
})
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
const wheelScrollTopTo = (diffNum: number, cb: (progress: number) => void) => {
|
|
3389
3395
|
const duration = Math.abs(diffNum)
|
|
3390
3396
|
const startTime = performance.now()
|
|
3391
3397
|
let countTop = 0
|
|
@@ -8755,6 +8761,9 @@ export default defineComponent({
|
|
|
8755
8761
|
triggerBodyScrollEvent (evnt, fixedType) {
|
|
8756
8762
|
const { scrollYLoad, scrollXLoad } = reactData
|
|
8757
8763
|
const { elemStore, intoRunScroll, lastScrollTop, lastScrollLeft, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll, scrollRenderType, inFooterScroll } = internalData
|
|
8764
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
8765
|
+
return
|
|
8766
|
+
}
|
|
8758
8767
|
const xHandleEl = refScrollXHandleElem.value
|
|
8759
8768
|
const yHandleEl = refScrollYHandleElem.value
|
|
8760
8769
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
@@ -8763,9 +8772,6 @@ export default defineComponent({
|
|
|
8763
8772
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
|
|
8764
8773
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
|
|
8765
8774
|
const rowExpandEl = refRowExpandElem.value
|
|
8766
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
8767
|
-
return
|
|
8768
|
-
}
|
|
8769
8775
|
if (intoRunScroll) {
|
|
8770
8776
|
return
|
|
8771
8777
|
}
|
|
@@ -8783,6 +8789,7 @@ export default defineComponent({
|
|
|
8783
8789
|
return
|
|
8784
8790
|
}
|
|
8785
8791
|
}
|
|
8792
|
+
console.log('triggerBodyScrollEvent', 11)
|
|
8786
8793
|
let scrollTop = yHandleEl.scrollTop
|
|
8787
8794
|
let scrollLeft = xHandleEl.scrollLeft
|
|
8788
8795
|
if (leftScrollElem && fixedType === 'left') {
|
|
@@ -8830,14 +8837,14 @@ export default defineComponent({
|
|
|
8830
8837
|
triggerHeaderScrollEvent (evnt, fixedType) {
|
|
8831
8838
|
const { scrollXLoad } = reactData
|
|
8832
8839
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inBodyScroll, inFooterScroll } = internalData
|
|
8840
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
8841
|
+
return
|
|
8842
|
+
}
|
|
8833
8843
|
const yHandleEl = refScrollYHandleElem.value
|
|
8834
8844
|
const xHandleEl = refScrollXHandleElem.value
|
|
8835
8845
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
8836
8846
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
|
|
8837
8847
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
|
|
8838
|
-
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
8839
|
-
return
|
|
8840
|
-
}
|
|
8841
8848
|
if (intoRunScroll) {
|
|
8842
8849
|
return
|
|
8843
8850
|
}
|
|
@@ -8850,6 +8857,7 @@ export default defineComponent({
|
|
|
8850
8857
|
if (!yHandleEl) {
|
|
8851
8858
|
return
|
|
8852
8859
|
}
|
|
8860
|
+
console.log('triggerHeaderScrollEvent', 11)
|
|
8853
8861
|
const scrollTop = yHandleEl.scrollTop
|
|
8854
8862
|
const scrollLeft = headerScrollElem.scrollLeft
|
|
8855
8863
|
const isRollX = true
|
|
@@ -8869,14 +8877,14 @@ export default defineComponent({
|
|
|
8869
8877
|
triggerFooterScrollEvent (evnt, fixedType) {
|
|
8870
8878
|
const { scrollXLoad } = reactData
|
|
8871
8879
|
const { elemStore, intoRunScroll, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll } = internalData
|
|
8880
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
8881
|
+
return
|
|
8882
|
+
}
|
|
8872
8883
|
const yHandleEl = refScrollYHandleElem.value
|
|
8873
8884
|
const xHandleEl = refScrollXHandleElem.value
|
|
8874
8885
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
8875
8886
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
|
|
8876
8887
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
|
|
8877
|
-
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
8878
|
-
return
|
|
8879
|
-
}
|
|
8880
8888
|
if (intoRunScroll) {
|
|
8881
8889
|
return
|
|
8882
8890
|
}
|
|
@@ -8889,6 +8897,7 @@ export default defineComponent({
|
|
|
8889
8897
|
if (!yHandleEl) {
|
|
8890
8898
|
return
|
|
8891
8899
|
}
|
|
8900
|
+
console.log('triggerFooterScrollEvent')
|
|
8892
8901
|
const scrollTop = yHandleEl.scrollTop
|
|
8893
8902
|
const scrollLeft = footerScrollElem.scrollLeft
|
|
8894
8903
|
const isRollX = true
|
|
@@ -8910,17 +8919,25 @@ export default defineComponent({
|
|
|
8910
8919
|
if (target && /^textarea$/i.test((target as HTMLElement).tagName)) {
|
|
8911
8920
|
return
|
|
8912
8921
|
}
|
|
8922
|
+
|
|
8913
8923
|
const { highlightHoverRow } = tableProps
|
|
8914
|
-
const { scrollYLoad } = reactData
|
|
8924
|
+
const { scrollXLoad, scrollYLoad } = reactData
|
|
8925
|
+
const leftFixedWidth = computeLeftFixedWidth.value
|
|
8926
|
+
const rightFixedWidth = computeRightFixedWidth.value
|
|
8927
|
+
if (!(scrollYLoad || leftFixedWidth || rightFixedWidth)) {
|
|
8928
|
+
return
|
|
8929
|
+
}
|
|
8930
|
+
|
|
8915
8931
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData
|
|
8916
8932
|
const rowOpts = computeRowOpts.value
|
|
8917
8933
|
const xHandleEl = refScrollXHandleElem.value
|
|
8918
8934
|
const yHandleEl = refScrollYHandleElem.value
|
|
8919
8935
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
8936
|
+
const headerScrollElem = getRefElem(elemStore['main-header-scroll'])
|
|
8920
8937
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
8938
|
+
const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
|
|
8921
8939
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
|
|
8922
8940
|
const rowExpandEl = refRowExpandElem.value
|
|
8923
|
-
|
|
8924
8941
|
if (!xHandleEl) {
|
|
8925
8942
|
return
|
|
8926
8943
|
}
|
|
@@ -8930,9 +8947,10 @@ export default defineComponent({
|
|
|
8930
8947
|
if (!bodyScrollElem) {
|
|
8931
8948
|
return
|
|
8932
8949
|
}
|
|
8950
|
+
|
|
8933
8951
|
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime)
|
|
8934
|
-
const deltaTop = deltaY * wheelSpeed
|
|
8935
|
-
const deltaLeft = deltaX * wheelSpeed
|
|
8952
|
+
const deltaTop = Math.ceil(deltaY * wheelSpeed)
|
|
8953
|
+
const deltaLeft = Math.ceil(deltaX * wheelSpeed)
|
|
8936
8954
|
|
|
8937
8955
|
const isTopWheel = deltaTop < 0
|
|
8938
8956
|
const currScrollTop = bodyScrollElem.scrollTop
|
|
@@ -8941,19 +8959,36 @@ export default defineComponent({
|
|
|
8941
8959
|
return
|
|
8942
8960
|
}
|
|
8943
8961
|
|
|
8944
|
-
const scrollTop =
|
|
8962
|
+
const scrollTop = currScrollTop + deltaTop
|
|
8945
8963
|
const scrollLeft = bodyScrollElem.scrollLeft + deltaLeft
|
|
8946
8964
|
const isRollX = scrollLeft !== lastScrollLeft
|
|
8947
8965
|
const isRollY = scrollTop !== lastScrollTop
|
|
8948
8966
|
|
|
8967
|
+
if (rowOpts.isHover || highlightHoverRow) {
|
|
8968
|
+
$xeTable.clearHoverRow()
|
|
8969
|
+
}
|
|
8949
8970
|
// 用于鼠标纵向滚轮处理
|
|
8971
|
+
if (isRollX) {
|
|
8972
|
+
evnt.preventDefault()
|
|
8973
|
+
internalData.inWheelScroll = true
|
|
8974
|
+
wheelScrollLeftTo(scrollLeft, (offsetLeft: number) => {
|
|
8975
|
+
const currLeftNum = offsetLeft
|
|
8976
|
+
setScrollLeft(xHandleEl, currLeftNum)
|
|
8977
|
+
setScrollLeft(bodyScrollElem, currLeftNum)
|
|
8978
|
+
setScrollLeft(headerScrollElem, currLeftNum)
|
|
8979
|
+
setScrollLeft(footerScrollElem, currLeftNum)
|
|
8980
|
+
if (scrollXLoad) {
|
|
8981
|
+
$xeTable.triggerScrollXEvent(evnt)
|
|
8982
|
+
}
|
|
8983
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, bodyScrollElem.scrollTop, currLeftNum, {
|
|
8984
|
+
type: 'table',
|
|
8985
|
+
fixed: ''
|
|
8986
|
+
})
|
|
8987
|
+
})
|
|
8988
|
+
}
|
|
8950
8989
|
if (isRollY) {
|
|
8951
8990
|
evnt.preventDefault()
|
|
8952
|
-
|
|
8953
|
-
$xeTable.clearHoverRow()
|
|
8954
|
-
}
|
|
8955
|
-
|
|
8956
|
-
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, (offsetTop: number) => {
|
|
8991
|
+
wheelScrollTopTo(scrollTop - currScrollTop, (offsetTop: number) => {
|
|
8957
8992
|
const currTopNum = bodyScrollElem.scrollTop + offsetTop
|
|
8958
8993
|
internalData.inWheelScroll = true
|
|
8959
8994
|
setScrollTop(yHandleEl, currTopNum)
|
|
@@ -8964,7 +8999,7 @@ export default defineComponent({
|
|
|
8964
8999
|
if (scrollYLoad) {
|
|
8965
9000
|
$xeTable.triggerScrollYEvent(evnt)
|
|
8966
9001
|
}
|
|
8967
|
-
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
9002
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, bodyScrollElem.scrollLeft, {
|
|
8968
9003
|
type: 'table',
|
|
8969
9004
|
fixed: ''
|
|
8970
9005
|
})
|
|
@@ -9563,20 +9598,12 @@ export default defineComponent({
|
|
|
9563
9598
|
|
|
9564
9599
|
const renderViewport = () => {
|
|
9565
9600
|
const { showHeader, showFooter } = props
|
|
9566
|
-
const { overflowX,
|
|
9601
|
+
const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData
|
|
9567
9602
|
const { leftList, rightList } = columnStore
|
|
9568
|
-
const leftFixedWidth = computeLeftFixedWidth.value
|
|
9569
|
-
const rightFixedWidth = computeRightFixedWidth.value
|
|
9570
|
-
|
|
9571
|
-
const ons: Record<string, any> = {}
|
|
9572
|
-
if (scrollYLoad || leftFixedWidth || rightFixedWidth) {
|
|
9573
|
-
ons.onWheel = $xeTable.triggerBodyWheelEvent
|
|
9574
|
-
}
|
|
9575
9603
|
|
|
9576
9604
|
return h('div', {
|
|
9577
9605
|
ref: refTableViewportElem,
|
|
9578
|
-
class: 'vxe-table--viewport-wrapper'
|
|
9579
|
-
...ons
|
|
9606
|
+
class: 'vxe-table--viewport-wrapper'
|
|
9580
9607
|
}, [
|
|
9581
9608
|
h('div', {
|
|
9582
9609
|
class: 'vxe-table--main-wrapper'
|
|
@@ -10272,6 +10299,12 @@ export default defineComponent({
|
|
|
10272
10299
|
}
|
|
10273
10300
|
}
|
|
10274
10301
|
})
|
|
10302
|
+
|
|
10303
|
+
const tableViewportEl = refTableViewportElem.value
|
|
10304
|
+
if (tableViewportEl) {
|
|
10305
|
+
tableViewportEl.addEventListener('wheel', $xeTable.triggerBodyWheelEvent, { passive: false })
|
|
10306
|
+
}
|
|
10307
|
+
|
|
10275
10308
|
globalEvents.on($xeTable, 'paste', handleGlobalPasteEvent)
|
|
10276
10309
|
globalEvents.on($xeTable, 'copy', handleGlobalCopyEvent)
|
|
10277
10310
|
globalEvents.on($xeTable, 'cut', handleGlobalCutEvent)
|
|
@@ -10285,6 +10318,10 @@ export default defineComponent({
|
|
|
10285
10318
|
})
|
|
10286
10319
|
|
|
10287
10320
|
onBeforeUnmount(() => {
|
|
10321
|
+
const tableViewportEl = refTableViewportElem.value
|
|
10322
|
+
if (tableViewportEl) {
|
|
10323
|
+
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent)
|
|
10324
|
+
}
|
|
10288
10325
|
if (resizeObserver) {
|
|
10289
10326
|
resizeObserver.disconnect()
|
|
10290
10327
|
}
|
package/packages/ui/index.ts
CHANGED
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
overflow: hidden;
|
|
55
55
|
outline: 0;
|
|
56
56
|
scrollbar-width: none;
|
|
57
|
+
-webkit-overflow-scrolling: touch;
|
|
57
58
|
}
|
|
58
59
|
.vxe-table--header-inner-wrapper,
|
|
59
60
|
.vxe-table--body-inner-wrapper,
|
|
@@ -63,6 +64,7 @@
|
|
|
63
64
|
height: 100%;
|
|
64
65
|
scrollbar-width: none;
|
|
65
66
|
-ms-overflow-style: none;
|
|
67
|
+
-webkit-overflow-scrolling: touch;
|
|
66
68
|
&::-webkit-scrollbar {
|
|
67
69
|
display: none;
|
|
68
70
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|