vxe-table 4.23.0-beta.1 → 4.23.0-beta.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/README.md +2 -2
- package/dist/all.esm.js +499 -87
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- 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/props.js +6 -2
- package/es/table/src/scrollbar.js +54 -0
- package/es/table/src/table.js +427 -81
- package/es/table/src/util.js +11 -2
- package/es/table/style.css +30 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +30 -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 +106 -28
- 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/props.js +6 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/scrollbar.js +63 -0
- package/lib/table/src/scrollbar.min.js +1 -0
- package/lib/table/src/table.js +32 -22
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +11 -2
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +30 -0
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- 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 +30 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/src/props.ts +6 -2
- package/packages/table/src/scrollbar.ts +57 -0
- package/packages/table/src/table.ts +459 -83
- package/packages/table/src/util.ts +15 -2
- package/styles/components/table.scss +65 -0
- /package/es/{iconfont.1791954193706.ttf → iconfont.1792035024476.ttf} +0 -0
- /package/es/{iconfont.1791954193706.woff → iconfont.1792035024476.woff} +0 -0
- /package/es/{iconfont.1791954193706.woff2 → iconfont.1792035024476.woff2} +0 -0
- /package/lib/{iconfont.1791954193706.ttf → iconfont.1792035024476.ttf} +0 -0
- /package/lib/{iconfont.1791954193706.woff → iconfont.1792035024476.woff} +0 -0
- /package/lib/{iconfont.1791954193706.woff2 → iconfont.1792035024476.woff2} +0 -0
|
@@ -7,6 +7,7 @@ import { VxeUI } from '../../ui'
|
|
|
7
7
|
import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util'
|
|
8
8
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
9
9
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime'
|
|
10
|
+
import { getThumbOffsetSize, getThumbSize, getScrollFromClick, getScrollFromDrag } from './scrollbar'
|
|
10
11
|
import { createComponentLog } from '../../ui/src/log'
|
|
11
12
|
import { getCrossTableDragRowInfo } from './store'
|
|
12
13
|
import Cell from './cell'
|
|
@@ -35,7 +36,7 @@ import type { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, Vx
|
|
|
35
36
|
|
|
36
37
|
const { warnLog, errLog } = createComponentLog('table')
|
|
37
38
|
|
|
38
|
-
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
|
|
39
|
+
const { getConfig, getIcon, getI18n, renderer, formats, createEvent, globalResize, interceptor, hooks, domUtils, globalEvents, GLOBAL_EVENT_KEYS, useFns, renderEmptyElement } = VxeUI
|
|
39
40
|
|
|
40
41
|
const supportMaxRow = 5e6
|
|
41
42
|
const customStorageKey = 'VXE_CUSTOM_STORE'
|
|
@@ -135,6 +136,11 @@ export default defineVxeComponent({
|
|
|
135
136
|
const refScrollXSpaceElem = ref<HTMLDivElement>()
|
|
136
137
|
const refScrollYSpaceElem = ref<HTMLDivElement>()
|
|
137
138
|
|
|
139
|
+
const refTrackXElem = ref<HTMLDivElement>()
|
|
140
|
+
const refTrackYElem = ref<HTMLDivElement>()
|
|
141
|
+
const refThumbXElem = ref<HTMLDivElement>()
|
|
142
|
+
const refThumbYElem = ref<HTMLDivElement>()
|
|
143
|
+
|
|
138
144
|
let $xeToolbar: VxeToolbarConstructor
|
|
139
145
|
|
|
140
146
|
const computeTableId = computed(() => {
|
|
@@ -237,6 +243,42 @@ export default defineVxeComponent({
|
|
|
237
243
|
return scrollbarOpts.y ? Object.assign({}, scrollbarOpts.y, scrollbarOpts.yConfig) : (scrollbarOpts.yConfig || {})
|
|
238
244
|
})
|
|
239
245
|
|
|
246
|
+
const computeScrollXHeight = computed(() => {
|
|
247
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
248
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
249
|
+
return XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height))
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
const computeScrollYWidth = computed(() => {
|
|
253
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
254
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
255
|
+
return XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width))
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
const computeScrollXVisible = computed(() => {
|
|
259
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
260
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
261
|
+
return getDefaultConfig(scrollbarXOpts.visible, scrollbarOpts.visible)
|
|
262
|
+
})
|
|
263
|
+
|
|
264
|
+
const computeScrollYVisible = computed(() => {
|
|
265
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
266
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
267
|
+
return getDefaultConfig(scrollbarYOpts.visible, scrollbarOpts.visible)
|
|
268
|
+
})
|
|
269
|
+
|
|
270
|
+
const computeScrollXAutoHide = computed(() => {
|
|
271
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
272
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
273
|
+
return getDefaultConfig(getDefaultConfig(scrollbarXOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide)
|
|
274
|
+
})
|
|
275
|
+
|
|
276
|
+
const computeScrollYAutoHide = computed(() => {
|
|
277
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
278
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
279
|
+
return getDefaultConfig(getDefaultConfig(scrollbarYOpts.autoHide, scrollbarOpts.autoHide), scrollDefaultConf.autoHide)
|
|
280
|
+
})
|
|
281
|
+
|
|
240
282
|
const computeScrollbarXToTop = computed(() => {
|
|
241
283
|
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
242
284
|
return scrollbarXOpts.position === 'top'
|
|
@@ -247,6 +289,24 @@ export default defineVxeComponent({
|
|
|
247
289
|
return scrollbarYOpts.position === 'left'
|
|
248
290
|
})
|
|
249
291
|
|
|
292
|
+
const computeScrollbarWrapperClss = computed(() => {
|
|
293
|
+
const { yThumbHeight, xThumbWidth } = reactData
|
|
294
|
+
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
295
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
296
|
+
const scrollXVisible = computeScrollXVisible.value
|
|
297
|
+
const scrollYVisible = computeScrollYVisible.value
|
|
298
|
+
return domUtils.buildClass([
|
|
299
|
+
'vxe-scrollbar is--virtual',
|
|
300
|
+
`ov-x--${scrollXVisible === false ? 'hidden' : 'visible'}`,
|
|
301
|
+
`ov-y--${scrollYVisible === false ? 'hidden' : 'visible'}`,
|
|
302
|
+
`sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`,
|
|
303
|
+
`sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`
|
|
304
|
+
], {
|
|
305
|
+
'overflow-y': yThumbHeight,
|
|
306
|
+
'overflow-x': xThumbWidth
|
|
307
|
+
})
|
|
308
|
+
})
|
|
309
|
+
|
|
250
310
|
const computeScrollYThreshold = computed(() => {
|
|
251
311
|
const virtualYOpts = computeVirtualYOpts.value
|
|
252
312
|
const { threshold } = virtualYOpts
|
|
@@ -282,6 +342,11 @@ export default defineVxeComponent({
|
|
|
282
342
|
return cellOpts
|
|
283
343
|
})
|
|
284
344
|
|
|
345
|
+
const computeCellHeitht = computed(() => {
|
|
346
|
+
const cellOpts = computeCellOpts.value
|
|
347
|
+
return cellOpts.height
|
|
348
|
+
})
|
|
349
|
+
|
|
285
350
|
const computeHeaderCellOpts = computed(() => {
|
|
286
351
|
const headerCellOpts = Object.assign({}, getConfig().table.headerCellConfig, props.headerCellConfig)
|
|
287
352
|
const defaultRowHeight = computeDefaultRowHeight.value
|
|
@@ -639,11 +704,8 @@ export default defineVxeComponent({
|
|
|
639
704
|
})
|
|
640
705
|
|
|
641
706
|
const computeTableStyle = computed(() => {
|
|
642
|
-
const
|
|
643
|
-
const
|
|
644
|
-
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
645
|
-
const barWidth = getDefaultConfig(getDefaultConfig(scrollbarYOpts.width, scrollbarOpts.width), scrollDefaultConf.width)
|
|
646
|
-
const barHeight = getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height)
|
|
707
|
+
const barWidth = computeScrollYWidth.value
|
|
708
|
+
const barHeight = computeScrollXHeight.value
|
|
647
709
|
const stys: VxeComponentStyleType = {}
|
|
648
710
|
if (barWidth || barHeight) {
|
|
649
711
|
stys['--vxe-ui-table-view-scrollbar-width'] = toCssUnit(barWidth || barHeight)
|
|
@@ -859,8 +921,15 @@ export default defineVxeComponent({
|
|
|
859
921
|
computeScrollbarOpts,
|
|
860
922
|
computeScrollbarXOpts,
|
|
861
923
|
computeScrollbarYOpts,
|
|
924
|
+
computeScrollXHeight,
|
|
925
|
+
computeScrollYWidth,
|
|
926
|
+
computeScrollXVisible,
|
|
927
|
+
computeScrollYVisible,
|
|
928
|
+
computeScrollXAutoHide,
|
|
929
|
+
computeScrollYAutoHide,
|
|
862
930
|
computeScrollbarXToTop,
|
|
863
931
|
computeScrollbarYToLeft,
|
|
932
|
+
computeScrollbarWrapperClss,
|
|
864
933
|
computeColumnOpts,
|
|
865
934
|
computeCurrentColumnOpts,
|
|
866
935
|
computeScrollXThreshold,
|
|
@@ -2005,14 +2074,6 @@ export default defineVxeComponent({
|
|
|
2005
2074
|
if (!bodyWrapperElem) {
|
|
2006
2075
|
return
|
|
2007
2076
|
}
|
|
2008
|
-
const yHandleEl = refScrollYHandleElem.value
|
|
2009
|
-
if (!yHandleEl) {
|
|
2010
|
-
return
|
|
2011
|
-
}
|
|
2012
|
-
const xHandleEl = refScrollXHandleElem.value
|
|
2013
|
-
if (!xHandleEl) {
|
|
2014
|
-
return
|
|
2015
|
-
}
|
|
2016
2077
|
const columnOpts = computeColumnOpts.value
|
|
2017
2078
|
let tWidth = 0
|
|
2018
2079
|
const minCellWidth = 40 // 列宽最少限制 40px
|
|
@@ -2613,13 +2674,13 @@ export default defineVxeComponent({
|
|
|
2613
2674
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : ''
|
|
2614
2675
|
}
|
|
2615
2676
|
|
|
2616
|
-
const
|
|
2617
|
-
const
|
|
2677
|
+
const scrollXVisible = computeScrollXVisible.value
|
|
2678
|
+
const scrollYVisible = computeScrollYVisible.value
|
|
2618
2679
|
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
2619
2680
|
|
|
2620
2681
|
let xScrollbarVisible = overflowX ? 'visible' : 'hidden'
|
|
2621
|
-
const hideXScroll =
|
|
2622
|
-
if (
|
|
2682
|
+
const hideXScroll = scrollXVisible === false || scrollXVisible === 'hidden'
|
|
2683
|
+
if (scrollXVisible === 'visible' || $xeGanttView) {
|
|
2623
2684
|
osbHeight = scrollbarHeight
|
|
2624
2685
|
xScrollbarVisible = 'visible'
|
|
2625
2686
|
} else if (hideXScroll) {
|
|
@@ -2628,11 +2689,11 @@ export default defineVxeComponent({
|
|
|
2628
2689
|
}
|
|
2629
2690
|
|
|
2630
2691
|
let yScrollbarVisible = overflowY ? 'visible' : 'hidden'
|
|
2631
|
-
const
|
|
2632
|
-
if (
|
|
2692
|
+
const hideYScroll = scrollYVisible === false || scrollYVisible === 'hidden'
|
|
2693
|
+
if (hideYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)) {
|
|
2633
2694
|
osbWidth = 0
|
|
2634
2695
|
yScrollbarVisible = 'hidden'
|
|
2635
|
-
} else if (
|
|
2696
|
+
} else if (scrollYVisible === 'visible') {
|
|
2636
2697
|
osbWidth = scrollbarWidth
|
|
2637
2698
|
yScrollbarVisible = 'visible'
|
|
2638
2699
|
}
|
|
@@ -3462,7 +3523,6 @@ export default defineVxeComponent({
|
|
|
3462
3523
|
const calcScrollbar = () => {
|
|
3463
3524
|
const { scrollXWidth, scrollYHeight } = reactData
|
|
3464
3525
|
const { elemStore } = internalData
|
|
3465
|
-
const scrollbarOpts = computeScrollbarOpts.value
|
|
3466
3526
|
const el = refElem.value
|
|
3467
3527
|
if (!el || !el.clientWidth) {
|
|
3468
3528
|
return
|
|
@@ -3472,21 +3532,28 @@ export default defineVxeComponent({
|
|
|
3472
3532
|
const footerTableElem = getRefElem(elemStore['main-footer-table'])
|
|
3473
3533
|
const xHandleEl = refScrollXHandleElem.value
|
|
3474
3534
|
const yHandleEl = refScrollYHandleElem.value
|
|
3535
|
+
const thumbXElem = refThumbXElem.value
|
|
3536
|
+
const thumbYElem = refThumbYElem.value
|
|
3475
3537
|
let overflowY = false
|
|
3476
3538
|
let overflowX = false
|
|
3477
3539
|
if (bodyWrapperElem) {
|
|
3478
|
-
const
|
|
3479
|
-
const
|
|
3480
|
-
const
|
|
3481
|
-
const barHeight = XEUtils.toNumber(getDefaultConfig(getDefaultConfig(scrollbarXOpts.height, scrollbarOpts.height), scrollDefaultConf.height))
|
|
3540
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
3541
|
+
const barWidth = computeScrollYWidth.value
|
|
3542
|
+
const barHeight = computeScrollXHeight.value
|
|
3482
3543
|
overflowY = scrollYHeight > bodyWrapperElem.clientHeight
|
|
3483
|
-
|
|
3544
|
+
// 如果是虚拟滚动条
|
|
3545
|
+
if (thumbYElem) {
|
|
3546
|
+
reactData.scrollbarHeight = scrollbarOpts.padding ? thumbYElem.offsetWidth : 0
|
|
3547
|
+
} else if (yHandleEl) {
|
|
3484
3548
|
reactData.scrollbarWidth = (barWidth || barHeight) || (yHandleEl.offsetWidth - yHandleEl.clientWidth) || 14
|
|
3485
3549
|
}
|
|
3486
3550
|
reactData.overflowY = overflowY
|
|
3487
3551
|
|
|
3488
3552
|
overflowX = scrollXWidth > bodyWrapperElem.clientWidth
|
|
3489
|
-
|
|
3553
|
+
// 如果是虚拟滚动条
|
|
3554
|
+
if (thumbXElem) {
|
|
3555
|
+
reactData.scrollbarHeight = scrollbarOpts.padding ? thumbXElem.offsetHeight : 0
|
|
3556
|
+
} else if (xHandleEl) {
|
|
3490
3557
|
reactData.scrollbarHeight = (barHeight || barWidth) || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14
|
|
3491
3558
|
}
|
|
3492
3559
|
|
|
@@ -3556,6 +3623,11 @@ export default defineVxeComponent({
|
|
|
3556
3623
|
})
|
|
3557
3624
|
}
|
|
3558
3625
|
|
|
3626
|
+
const updateScrollbar = () => {
|
|
3627
|
+
updateThumbSize()
|
|
3628
|
+
updateThumbOffset()
|
|
3629
|
+
}
|
|
3630
|
+
|
|
3559
3631
|
const defaultMinRunDelay = 50
|
|
3560
3632
|
|
|
3561
3633
|
const handleLazyRecalculate = (reFull: boolean, reWidth: boolean, reHeight: boolean, options?: {
|
|
@@ -3578,6 +3650,7 @@ export default defineVxeComponent({
|
|
|
3578
3650
|
const refreshDelay = resizeOpts.refreshDelay || 30
|
|
3579
3651
|
const reDelay = rceDelay + refreshDelay
|
|
3580
3652
|
const el = refElem.value
|
|
3653
|
+
updateScrollbar()
|
|
3581
3654
|
if (el && el.clientWidth) {
|
|
3582
3655
|
autoCellWidth()
|
|
3583
3656
|
updateRowExpandStyle()
|
|
@@ -11575,6 +11648,18 @@ export default defineVxeComponent({
|
|
|
11575
11648
|
}
|
|
11576
11649
|
return nextTick()
|
|
11577
11650
|
},
|
|
11651
|
+
/**
|
|
11652
|
+
* @private
|
|
11653
|
+
*/
|
|
11654
|
+
updateScrollbar () {
|
|
11655
|
+
return updateScrollbar()
|
|
11656
|
+
},
|
|
11657
|
+
/**
|
|
11658
|
+
* @private
|
|
11659
|
+
*/
|
|
11660
|
+
updateThumbOffset () {
|
|
11661
|
+
return updateThumbOffset()
|
|
11662
|
+
},
|
|
11578
11663
|
/**
|
|
11579
11664
|
* 表头单元格按下事件
|
|
11580
11665
|
*/
|
|
@@ -12749,19 +12834,18 @@ export default defineVxeComponent({
|
|
|
12749
12834
|
},
|
|
12750
12835
|
handleScrollEvent (evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
12751
12836
|
const { highlightHoverRow } = props
|
|
12752
|
-
const { lastScrollLeft, lastScrollTop } = internalData
|
|
12753
|
-
const
|
|
12754
|
-
|
|
12755
|
-
if (!xHandleEl || !yHandleEl) {
|
|
12837
|
+
const { elemStore, lastScrollLeft, lastScrollTop } = internalData
|
|
12838
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
12839
|
+
if (!bodyScrollElem) {
|
|
12756
12840
|
return
|
|
12757
12841
|
}
|
|
12758
12842
|
const rowOpts = computeRowOpts.value
|
|
12759
12843
|
const validTip = refValidTooltip.value
|
|
12760
12844
|
const tooltip = refTooltip.value
|
|
12761
|
-
const bodyHeight =
|
|
12762
|
-
const bodyWidth =
|
|
12763
|
-
const scrollHeight =
|
|
12764
|
-
const scrollWidth =
|
|
12845
|
+
const bodyHeight = bodyScrollElem.clientHeight
|
|
12846
|
+
const bodyWidth = bodyScrollElem.clientWidth
|
|
12847
|
+
const scrollHeight = bodyScrollElem.scrollHeight
|
|
12848
|
+
const scrollWidth = bodyScrollElem.scrollWidth
|
|
12765
12849
|
let isTop = false
|
|
12766
12850
|
let isBottom = false
|
|
12767
12851
|
let isLeft = false
|
|
@@ -12828,6 +12912,7 @@ export default defineVxeComponent({
|
|
|
12828
12912
|
direction,
|
|
12829
12913
|
...params
|
|
12830
12914
|
}
|
|
12915
|
+
updateThumbOffset()
|
|
12831
12916
|
updateRowExpandStyle()
|
|
12832
12917
|
checkLastSyncScroll(isRollX, isRollY)
|
|
12833
12918
|
if (isRollX) {
|
|
@@ -12870,6 +12955,7 @@ export default defineVxeComponent({
|
|
|
12870
12955
|
}
|
|
12871
12956
|
},
|
|
12872
12957
|
triggerBodyScrollEvent (evnt, fixedType) {
|
|
12958
|
+
const { useScrollbar } = props
|
|
12873
12959
|
const { scrollYLoad, scrollXLoad } = reactData
|
|
12874
12960
|
const { elemStore, intoRunScroll, lastScrollTop, lastScrollLeft, inWheelScroll, inVirtualScroll, inHeaderScroll, inBodyScroll, scrollRenderType, inFooterScroll } = internalData
|
|
12875
12961
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
@@ -12889,20 +12975,21 @@ export default defineVxeComponent({
|
|
|
12889
12975
|
if (!bodyScrollElem) {
|
|
12890
12976
|
return
|
|
12891
12977
|
}
|
|
12892
|
-
if (!
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12978
|
+
if (!useScrollbar) {
|
|
12979
|
+
if (!xHandleEl) {
|
|
12980
|
+
return
|
|
12981
|
+
}
|
|
12982
|
+
if (!yHandleEl) {
|
|
12983
|
+
return
|
|
12984
|
+
}
|
|
12897
12985
|
}
|
|
12898
12986
|
if (inBodyScroll) {
|
|
12899
12987
|
if (scrollRenderType !== fixedType) {
|
|
12900
12988
|
return
|
|
12901
12989
|
}
|
|
12902
12990
|
}
|
|
12903
|
-
|
|
12904
|
-
let
|
|
12905
|
-
let scrollLeft = xHandleEl.scrollLeft
|
|
12991
|
+
let scrollTop = 0
|
|
12992
|
+
let scrollLeft = 0
|
|
12906
12993
|
if (leftScrollElem && fixedType === 'left') {
|
|
12907
12994
|
scrollTop = leftScrollElem.scrollTop
|
|
12908
12995
|
} else if (rightScrollElem && fixedType === 'right') {
|
|
@@ -13041,8 +13128,8 @@ export default defineVxeComponent({
|
|
|
13041
13128
|
|
|
13042
13129
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData
|
|
13043
13130
|
const rowOpts = computeRowOpts.value
|
|
13044
|
-
const
|
|
13045
|
-
const
|
|
13131
|
+
const scrollXVisible = computeScrollXVisible.value
|
|
13132
|
+
const scrollYVisible = computeScrollYVisible.value
|
|
13046
13133
|
const xHandleEl = refScrollXHandleElem.value
|
|
13047
13134
|
const yHandleEl = refScrollYHandleElem.value
|
|
13048
13135
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
@@ -13069,14 +13156,14 @@ export default defineVxeComponent({
|
|
|
13069
13156
|
|
|
13070
13157
|
if (isRollX) {
|
|
13071
13158
|
// 如果禁用滚动
|
|
13072
|
-
if (
|
|
13159
|
+
if (scrollXVisible === false || scrollXVisible === 'hidden') {
|
|
13073
13160
|
evnt.preventDefault()
|
|
13074
13161
|
return
|
|
13075
13162
|
}
|
|
13076
13163
|
}
|
|
13077
13164
|
if (isRollY) {
|
|
13078
13165
|
// 如果禁用滚动
|
|
13079
|
-
if (
|
|
13166
|
+
if (scrollYVisible === false || scrollYVisible === 'hidden') {
|
|
13080
13167
|
evnt.preventDefault()
|
|
13081
13168
|
return
|
|
13082
13169
|
}
|
|
@@ -13650,6 +13737,188 @@ export default defineVxeComponent({
|
|
|
13650
13737
|
}
|
|
13651
13738
|
}
|
|
13652
13739
|
|
|
13740
|
+
const updateThumbSize = () => {
|
|
13741
|
+
const { elemStore } = internalData
|
|
13742
|
+
|
|
13743
|
+
const viewEl = getRefElem(elemStore['main-body-scroll'])
|
|
13744
|
+
if (!viewEl) {
|
|
13745
|
+
return
|
|
13746
|
+
}
|
|
13747
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
13748
|
+
return
|
|
13749
|
+
}
|
|
13750
|
+
const trackXEl = refTrackXElem.value
|
|
13751
|
+
const xThumbWidth = trackXEl ? getThumbSize(viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth) : 0
|
|
13752
|
+
const thumbXElem = refThumbXElem.value
|
|
13753
|
+
if (thumbXElem) {
|
|
13754
|
+
thumbXElem.style.width = xThumbWidth + 'px'
|
|
13755
|
+
}
|
|
13756
|
+
reactData.xThumbWidth = xThumbWidth
|
|
13757
|
+
|
|
13758
|
+
const trackYEl = refTrackYElem.value
|
|
13759
|
+
|
|
13760
|
+
const yThumbHeight = trackYEl ? getThumbSize(viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight) : 0
|
|
13761
|
+
const thumbYElem = refThumbYElem.value
|
|
13762
|
+
if (thumbYElem) {
|
|
13763
|
+
thumbYElem.style.height = yThumbHeight + 'px'
|
|
13764
|
+
}
|
|
13765
|
+
reactData.yThumbHeight = yThumbHeight
|
|
13766
|
+
}
|
|
13767
|
+
|
|
13768
|
+
const updateThumbOffset = () => {
|
|
13769
|
+
const { elemStore } = internalData
|
|
13770
|
+
|
|
13771
|
+
const viewEl = getRefElem(elemStore['main-body-scroll'])
|
|
13772
|
+
if (!viewEl) {
|
|
13773
|
+
return
|
|
13774
|
+
}
|
|
13775
|
+
if (!viewEl.clientHeight || !viewEl.clientHeight) {
|
|
13776
|
+
return
|
|
13777
|
+
}
|
|
13778
|
+
const { xThumbWidth, yThumbHeight } = reactData
|
|
13779
|
+
const trackXEl = refTrackXElem.value
|
|
13780
|
+
const thumbXElem = refThumbXElem.value
|
|
13781
|
+
const xThumbLeft = trackXEl && xThumbWidth ? getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackXEl.clientWidth, xThumbWidth) : 0
|
|
13782
|
+
internalData.xThumbLeft = xThumbLeft
|
|
13783
|
+
if (thumbXElem && xThumbWidth) {
|
|
13784
|
+
thumbXElem.style.width = xThumbWidth + 'px'
|
|
13785
|
+
thumbXElem.style.transform = `translateX(${xThumbLeft}px)`
|
|
13786
|
+
}
|
|
13787
|
+
|
|
13788
|
+
const trackYEl = refTrackYElem.value
|
|
13789
|
+
const thumbYElem = refThumbYElem.value
|
|
13790
|
+
const yThumbTop = trackYEl && yThumbHeight ? getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackYEl.clientHeight, yThumbHeight) : 0
|
|
13791
|
+
internalData.yThumbTop = yThumbTop
|
|
13792
|
+
if (thumbYElem && yThumbHeight) {
|
|
13793
|
+
thumbYElem.style.height = yThumbHeight + 'px'
|
|
13794
|
+
thumbYElem.style.transform = `translateY(${yThumbTop}px)`
|
|
13795
|
+
}
|
|
13796
|
+
}
|
|
13797
|
+
|
|
13798
|
+
const clickTrackXEvent = (evnt: MouseEvent) => {
|
|
13799
|
+
const { elemStore } = internalData
|
|
13800
|
+
|
|
13801
|
+
const trackEl = evnt.currentTarget as HTMLDivElement
|
|
13802
|
+
if (trackEl !== evnt.target) {
|
|
13803
|
+
return
|
|
13804
|
+
}
|
|
13805
|
+
const viewEl = getRefElem(elemStore['main-body-scroll'])
|
|
13806
|
+
if (!viewEl) {
|
|
13807
|
+
return
|
|
13808
|
+
}
|
|
13809
|
+
const { xThumbWidth } = reactData
|
|
13810
|
+
const trackRect = trackEl.getBoundingClientRect()
|
|
13811
|
+
viewEl.scrollTo({
|
|
13812
|
+
left: getScrollFromClick(evnt.clientX - trackRect.left, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth),
|
|
13813
|
+
behavior: 'auto'
|
|
13814
|
+
})
|
|
13815
|
+
}
|
|
13816
|
+
|
|
13817
|
+
const clickTrackYEvent = (evnt: MouseEvent) => {
|
|
13818
|
+
const { elemStore } = internalData
|
|
13819
|
+
|
|
13820
|
+
const trackEl = evnt.currentTarget as HTMLDivElement
|
|
13821
|
+
if (trackEl !== evnt.target) {
|
|
13822
|
+
return
|
|
13823
|
+
}
|
|
13824
|
+
const viewEl = getRefElem(elemStore['main-body-scroll'])
|
|
13825
|
+
if (!viewEl) {
|
|
13826
|
+
return
|
|
13827
|
+
}
|
|
13828
|
+
const { yThumbHeight } = reactData
|
|
13829
|
+
const trackRect = trackEl.getBoundingClientRect()
|
|
13830
|
+
viewEl.scrollTo({
|
|
13831
|
+
top: getScrollFromClick(evnt.clientY - trackRect.top, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight),
|
|
13832
|
+
behavior: 'auto'
|
|
13833
|
+
})
|
|
13834
|
+
}
|
|
13835
|
+
|
|
13836
|
+
const pointerdownThumbXEvent = (evnt: PointerEvent) => {
|
|
13837
|
+
const { elemStore } = internalData
|
|
13838
|
+
|
|
13839
|
+
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
13840
|
+
internalData.isThumbDrag = true
|
|
13841
|
+
thumbEl.setPointerCapture(evnt.pointerId)
|
|
13842
|
+
|
|
13843
|
+
const viewEl = getRefElem(elemStore['main-body-scroll'])
|
|
13844
|
+
if (!viewEl) {
|
|
13845
|
+
return
|
|
13846
|
+
}
|
|
13847
|
+
const { xThumbWidth } = reactData
|
|
13848
|
+
const trackEl = thumbEl.parentElement as HTMLDivElement
|
|
13849
|
+
const trackRect = trackEl.getBoundingClientRect()
|
|
13850
|
+
const pointerPosition = evnt.clientX - trackRect.left
|
|
13851
|
+
// 记录 thumb 的偏移
|
|
13852
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollLeft, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth)
|
|
13853
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset
|
|
13854
|
+
}
|
|
13855
|
+
|
|
13856
|
+
const pointermoveThumbXEvent = (evnt: PointerEvent) => {
|
|
13857
|
+
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
13858
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
13859
|
+
return
|
|
13860
|
+
}
|
|
13861
|
+
const { elemStore, isThumbDrag, thumbDragOffset } = internalData
|
|
13862
|
+
if (isThumbDrag) {
|
|
13863
|
+
const viewEl = getRefElem(elemStore['main-body-scroll'])
|
|
13864
|
+
if (!viewEl) {
|
|
13865
|
+
return
|
|
13866
|
+
}
|
|
13867
|
+
const { xThumbWidth } = reactData
|
|
13868
|
+
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
13869
|
+
const trackEl = thumbEl.parentElement as HTMLDivElement
|
|
13870
|
+
const trackRect = trackEl.getBoundingClientRect()
|
|
13871
|
+
// 更新偏移
|
|
13872
|
+
viewEl.scrollLeft = getScrollFromDrag(evnt.clientX - trackRect.left, thumbDragOffset, viewEl.clientWidth, viewEl.scrollWidth, trackEl.clientWidth, xThumbWidth)
|
|
13873
|
+
}
|
|
13874
|
+
}
|
|
13875
|
+
|
|
13876
|
+
const cleatPointerThumbEvent = (evnt: PointerEvent) => {
|
|
13877
|
+
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
13878
|
+
thumbEl.releasePointerCapture(evnt.pointerId)
|
|
13879
|
+
internalData.isThumbDrag = false
|
|
13880
|
+
}
|
|
13881
|
+
|
|
13882
|
+
const pointerdownThumbYEvent = (evnt: PointerEvent) => {
|
|
13883
|
+
const { elemStore } = internalData
|
|
13884
|
+
|
|
13885
|
+
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
13886
|
+
internalData.isThumbDrag = true
|
|
13887
|
+
thumbEl.setPointerCapture(evnt.pointerId)
|
|
13888
|
+
|
|
13889
|
+
const viewEl = getRefElem(elemStore['main-body-scroll'])
|
|
13890
|
+
if (!viewEl) {
|
|
13891
|
+
return
|
|
13892
|
+
}
|
|
13893
|
+
const { yThumbHeight } = reactData
|
|
13894
|
+
const trackEl = thumbEl.parentElement as HTMLDivElement
|
|
13895
|
+
const trackRect = trackEl.getBoundingClientRect()
|
|
13896
|
+
const pointerPosition = evnt.clientY - trackRect.top
|
|
13897
|
+
// 记录 thumb 的偏移
|
|
13898
|
+
const thumbOffset = getThumbOffsetSize(viewEl.scrollTop, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight)
|
|
13899
|
+
internalData.thumbDragOffset = pointerPosition - thumbOffset
|
|
13900
|
+
}
|
|
13901
|
+
|
|
13902
|
+
const pointermoveThumbYEvent = (evnt: PointerEvent) => {
|
|
13903
|
+
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
13904
|
+
if (!thumbEl.hasPointerCapture(evnt.pointerId)) {
|
|
13905
|
+
return
|
|
13906
|
+
}
|
|
13907
|
+
const { elemStore, isThumbDrag, thumbDragOffset } = internalData
|
|
13908
|
+
if (isThumbDrag) {
|
|
13909
|
+
const viewEl = getRefElem(elemStore['main-body-scroll'])
|
|
13910
|
+
if (!viewEl) {
|
|
13911
|
+
return
|
|
13912
|
+
}
|
|
13913
|
+
const { yThumbHeight } = reactData
|
|
13914
|
+
const thumbEl = evnt.currentTarget as HTMLDivElement
|
|
13915
|
+
const trackEl = thumbEl.parentElement as HTMLDivElement
|
|
13916
|
+
const trackRect = trackEl.getBoundingClientRect()
|
|
13917
|
+
// 更新偏移
|
|
13918
|
+
viewEl.scrollTop = getScrollFromDrag(evnt.clientY - trackRect.top, thumbDragOffset, viewEl.clientHeight, viewEl.scrollHeight, trackEl.clientHeight, yThumbHeight)
|
|
13919
|
+
}
|
|
13920
|
+
}
|
|
13921
|
+
|
|
13653
13922
|
// 检测对应模块是否安装
|
|
13654
13923
|
// 'openExport,openPrint,exportData,openImport,importData,saveFile,readFile,importByFile,print'.split(',').forEach(name => {
|
|
13655
13924
|
// ($xeTable as any)[name] = function () {
|
|
@@ -13676,6 +13945,8 @@ export default defineVxeComponent({
|
|
|
13676
13945
|
const scrollbarOpts = computeScrollbarOpts.value
|
|
13677
13946
|
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
13678
13947
|
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
13948
|
+
const scrollXVisible = computeScrollXVisible.value
|
|
13949
|
+
const scrollYVisible = computeScrollYVisible.value
|
|
13679
13950
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts
|
|
13680
13951
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts
|
|
13681
13952
|
const isFixedLeft = fixedType === 'left'
|
|
@@ -13686,8 +13957,8 @@ export default defineVxeComponent({
|
|
|
13686
13957
|
ref: isFixedLeft ? refLeftContainer : refRightContainer,
|
|
13687
13958
|
class: [
|
|
13688
13959
|
`vxe-table--fixed-${fixedType}-wrapper`,
|
|
13689
|
-
`sx--${(
|
|
13690
|
-
`sy--${(
|
|
13960
|
+
`sx--${(scrollXVisible === false || scrollXVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
13961
|
+
`sy--${(scrollYVisible === false || scrollYVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
13691
13962
|
{
|
|
13692
13963
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
13693
13964
|
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
@@ -13960,6 +14231,7 @@ export default defineVxeComponent({
|
|
|
13960
14231
|
|
|
13961
14232
|
const renderScrollY = () => {
|
|
13962
14233
|
return h('div', {
|
|
14234
|
+
key: 'vsy',
|
|
13963
14235
|
ref: refScrollYVirtualElem,
|
|
13964
14236
|
class: 'vxe-table--scroll-y-virtual'
|
|
13965
14237
|
}, [
|
|
@@ -13998,6 +14270,8 @@ export default defineVxeComponent({
|
|
|
13998
14270
|
const scrollbarOpts = computeScrollbarOpts.value
|
|
13999
14271
|
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
14000
14272
|
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
14273
|
+
const scrollXVisible = computeScrollXVisible.value
|
|
14274
|
+
const scrollYVisible = computeScrollYVisible.value
|
|
14001
14275
|
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts
|
|
14002
14276
|
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts
|
|
14003
14277
|
const { leftList, rightList } = columnStore
|
|
@@ -14005,6 +14279,7 @@ export default defineVxeComponent({
|
|
|
14005
14279
|
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
|
|
14006
14280
|
|
|
14007
14281
|
return h('div', {
|
|
14282
|
+
key: 'tvw',
|
|
14008
14283
|
ref: refTableViewportElem,
|
|
14009
14284
|
class: ['vxe-table--viewport-wrapper', {
|
|
14010
14285
|
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
@@ -14014,8 +14289,8 @@ export default defineVxeComponent({
|
|
|
14014
14289
|
h('div', {
|
|
14015
14290
|
class: [
|
|
14016
14291
|
'vxe-table--main-wrapper',
|
|
14017
|
-
`sx--${(
|
|
14018
|
-
`sy--${(
|
|
14292
|
+
`sx--${(scrollXVisible === false || scrollXVisible === 'hidden') ? 'hidden' : 'visible'}`,
|
|
14293
|
+
`sy--${(scrollYVisible === false || scrollYVisible === 'hidden') ? 'hidden' : 'visible'}`
|
|
14019
14294
|
]
|
|
14020
14295
|
}, [
|
|
14021
14296
|
/**
|
|
@@ -14058,9 +14333,10 @@ export default defineVxeComponent({
|
|
|
14058
14333
|
])
|
|
14059
14334
|
}
|
|
14060
14335
|
|
|
14061
|
-
const
|
|
14336
|
+
const renderNativeBody = () => {
|
|
14062
14337
|
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
14063
14338
|
return h('div', {
|
|
14339
|
+
key: 'lnb',
|
|
14064
14340
|
class: 'vxe-table--layout-wrapper'
|
|
14065
14341
|
}, scrollbarYToLeft
|
|
14066
14342
|
? [
|
|
@@ -14073,6 +14349,75 @@ export default defineVxeComponent({
|
|
|
14073
14349
|
])
|
|
14074
14350
|
}
|
|
14075
14351
|
|
|
14352
|
+
const renderVirtualBody = () => {
|
|
14353
|
+
const $xeGanttView = internalData.xeGanttView
|
|
14354
|
+
|
|
14355
|
+
const { useScrollbar } = props
|
|
14356
|
+
const { xThumbWidth, yThumbHeight } = reactData
|
|
14357
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
14358
|
+
const scrollXAutoHide = computeScrollXAutoHide.value
|
|
14359
|
+
const scrollYAutoHide = computeScrollYAutoHide.value
|
|
14360
|
+
const scrollXVisible = computeScrollXVisible.value
|
|
14361
|
+
const scrollYVisible = computeScrollYVisible.value
|
|
14362
|
+
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
14363
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
14364
|
+
const scrollbarWrapperClss = computeScrollbarWrapperClss.value
|
|
14365
|
+
const hideXScroll = scrollXVisible === false || scrollXVisible === 'hidden'
|
|
14366
|
+
const hideYScroll = scrollYVisible === false || scrollYVisible === 'hidden'
|
|
14367
|
+
|
|
14368
|
+
return h('div', {
|
|
14369
|
+
key: 'lvb',
|
|
14370
|
+
class: ['vxe-table--layout-wrapper', `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
14371
|
+
'is--virtual-scrollbar': useScrollbar,
|
|
14372
|
+
'ov-padding': useScrollbar && scrollbarOpts.padding,
|
|
14373
|
+
'ov-x--auto-hide': useScrollbar && scrollXAutoHide,
|
|
14374
|
+
'ov-y--auto-hide': useScrollbar && scrollYAutoHide,
|
|
14375
|
+
'overflow-y': yThumbHeight,
|
|
14376
|
+
'overflow-x': xThumbWidth
|
|
14377
|
+
}]
|
|
14378
|
+
}, [
|
|
14379
|
+
renderViewport(),
|
|
14380
|
+
h('div', {
|
|
14381
|
+
class: scrollbarWrapperClss
|
|
14382
|
+
}, [
|
|
14383
|
+
hideXScroll
|
|
14384
|
+
? renderEmptyElement($xeTable)
|
|
14385
|
+
: h('div', {
|
|
14386
|
+
ref: refTrackXElem,
|
|
14387
|
+
class: 'vxe-scrollbar--track-x',
|
|
14388
|
+
onClick: clickTrackXEvent
|
|
14389
|
+
}, [
|
|
14390
|
+
h('div', {
|
|
14391
|
+
ref: refThumbXElem,
|
|
14392
|
+
class: 'vxe-scrollbar--thumb-x',
|
|
14393
|
+
onPointerdown: pointerdownThumbXEvent,
|
|
14394
|
+
onPointermove: pointermoveThumbXEvent,
|
|
14395
|
+
onPointerup: cleatPointerThumbEvent,
|
|
14396
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
14397
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
14398
|
+
})
|
|
14399
|
+
]),
|
|
14400
|
+
hideYScroll || (($xeGantt && $xeGanttView && $xeGantt.reactData.showRightView) && !scrollbarYToLeft)
|
|
14401
|
+
? renderEmptyElement($xeTable)
|
|
14402
|
+
: h('div', {
|
|
14403
|
+
ref: refTrackYElem,
|
|
14404
|
+
class: 'vxe-scrollbar--track-y',
|
|
14405
|
+
onClick: clickTrackYEvent
|
|
14406
|
+
}, [
|
|
14407
|
+
h('div', {
|
|
14408
|
+
ref: refThumbYElem,
|
|
14409
|
+
class: 'vxe-scrollbar--thumb-y',
|
|
14410
|
+
onPointerdown: pointerdownThumbYEvent,
|
|
14411
|
+
onPointermove: pointermoveThumbYEvent,
|
|
14412
|
+
onPointerup: cleatPointerThumbEvent,
|
|
14413
|
+
onPointercancel: cleatPointerThumbEvent,
|
|
14414
|
+
onLostpointercapture: cleatPointerThumbEvent
|
|
14415
|
+
})
|
|
14416
|
+
])
|
|
14417
|
+
])
|
|
14418
|
+
])
|
|
14419
|
+
}
|
|
14420
|
+
|
|
14076
14421
|
const renderVN = () => {
|
|
14077
14422
|
const { loading, stripe, useScrollbar, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules, importConfig, exportConfig, printConfig } = props
|
|
14078
14423
|
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, tableData, initStore, isRowGroupStatus, columnStore, filterStore, customStore, tooltipStore } = reactData
|
|
@@ -14188,15 +14533,17 @@ export default defineVxeComponent({
|
|
|
14188
14533
|
h('div', {
|
|
14189
14534
|
key: 'tw',
|
|
14190
14535
|
class: 'vxe-table--render-wrapper'
|
|
14191
|
-
},
|
|
14192
|
-
? [
|
|
14193
|
-
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14198
|
-
|
|
14199
|
-
|
|
14536
|
+
}, useScrollbar
|
|
14537
|
+
? [renderVirtualBody()]
|
|
14538
|
+
: (scrollbarXToTop
|
|
14539
|
+
? [
|
|
14540
|
+
renderScrollX(),
|
|
14541
|
+
renderNativeBody()
|
|
14542
|
+
]
|
|
14543
|
+
: [
|
|
14544
|
+
renderNativeBody(),
|
|
14545
|
+
renderScrollX()
|
|
14546
|
+
])),
|
|
14200
14547
|
/**
|
|
14201
14548
|
* 空数据
|
|
14202
14549
|
*/
|
|
@@ -14509,6 +14856,7 @@ export default defineVxeComponent({
|
|
|
14509
14856
|
})
|
|
14510
14857
|
})
|
|
14511
14858
|
|
|
14859
|
+
const reScrollFlag = ref(0)
|
|
14512
14860
|
const reLayoutFlag = ref(0)
|
|
14513
14861
|
watch(computeSize, () => {
|
|
14514
14862
|
reLayoutFlag.value++
|
|
@@ -14541,37 +14889,49 @@ export default defineVxeComponent({
|
|
|
14541
14889
|
watch(() => props.maxHeight, () => {
|
|
14542
14890
|
reLayoutFlag.value++
|
|
14543
14891
|
})
|
|
14892
|
+
watch(() => VxeUI.getLanguage(), () => {
|
|
14893
|
+
reLayoutFlag.value++
|
|
14894
|
+
})
|
|
14544
14895
|
watch(computeScrollbarXToTop, () => {
|
|
14896
|
+
reScrollFlag.value++
|
|
14545
14897
|
reLayoutFlag.value++
|
|
14546
14898
|
})
|
|
14547
14899
|
watch(computeScrollbarYToLeft, () => {
|
|
14900
|
+
reScrollFlag.value++
|
|
14548
14901
|
reLayoutFlag.value++
|
|
14549
14902
|
})
|
|
14550
|
-
watch(
|
|
14903
|
+
watch(computeScrollXVisible, () => {
|
|
14904
|
+
reScrollFlag.value++
|
|
14551
14905
|
reLayoutFlag.value++
|
|
14552
14906
|
})
|
|
14553
|
-
watch(() => {
|
|
14554
|
-
|
|
14555
|
-
return scrollbarXOpts.visible
|
|
14556
|
-
}, () => {
|
|
14907
|
+
watch(computeScrollYVisible, () => {
|
|
14908
|
+
reScrollFlag.value++
|
|
14557
14909
|
reLayoutFlag.value++
|
|
14558
14910
|
})
|
|
14559
|
-
watch(() => {
|
|
14560
|
-
|
|
14561
|
-
return scrollbarYOpts.visible
|
|
14562
|
-
}, () => {
|
|
14911
|
+
watch(computeScrollXHeight, () => {
|
|
14912
|
+
reScrollFlag.value++
|
|
14563
14913
|
reLayoutFlag.value++
|
|
14564
14914
|
})
|
|
14565
|
-
watch(() => {
|
|
14566
|
-
|
|
14567
|
-
|
|
14568
|
-
}
|
|
14915
|
+
watch(computeScrollYWidth, () => {
|
|
14916
|
+
reScrollFlag.value++
|
|
14917
|
+
reLayoutFlag.value++
|
|
14918
|
+
})
|
|
14919
|
+
watch(computeCellHeitht, () => {
|
|
14569
14920
|
reLayoutFlag.value++
|
|
14570
14921
|
})
|
|
14571
14922
|
watch(reLayoutFlag, () => {
|
|
14572
14923
|
$xeTable.recalculate(true)
|
|
14573
14924
|
})
|
|
14574
14925
|
|
|
14926
|
+
watch(reScrollFlag, () => {
|
|
14927
|
+
nextTick(() => {
|
|
14928
|
+
$xeTable.updateScrollbar()
|
|
14929
|
+
nextTick(() => {
|
|
14930
|
+
$xeTable.updateScrollbar()
|
|
14931
|
+
})
|
|
14932
|
+
})
|
|
14933
|
+
})
|
|
14934
|
+
|
|
14575
14935
|
const footFlag = ref(0)
|
|
14576
14936
|
watch(() => props.footerData ? props.footerData.length : -1, () => {
|
|
14577
14937
|
footFlag.value++
|
|
@@ -14700,8 +15060,6 @@ export default defineVxeComponent({
|
|
|
14700
15060
|
|
|
14701
15061
|
$xeTable.preventEvent(null, 'created', { $table: $xeTable })
|
|
14702
15062
|
|
|
14703
|
-
let resizeObserver: ResizeObserver
|
|
14704
|
-
|
|
14705
15063
|
onActivated(() => {
|
|
14706
15064
|
$xeTable.recalculate().then(() => $xeTable.refreshScroll())
|
|
14707
15065
|
$xeTable.preventEvent(null, 'activated', { $table: $xeTable })
|
|
@@ -14719,7 +15077,7 @@ export default defineVxeComponent({
|
|
|
14719
15077
|
|
|
14720
15078
|
onMounted(() => {
|
|
14721
15079
|
const { editConfig, exportConfig, importConfig, treeConfig, minHeight, keepSource, areaConfig } = props
|
|
14722
|
-
const { scrollXStore, scrollYStore } = internalData
|
|
15080
|
+
const { elemStore, scrollXStore, scrollYStore } = internalData
|
|
14723
15081
|
const columnOpts = computeColumnOpts.value
|
|
14724
15082
|
const columnDragOpts = computeColumnDragOpts.value
|
|
14725
15083
|
const aggregateOpts = computeAggregateOpts.value
|
|
@@ -15006,12 +15364,26 @@ export default defineVxeComponent({
|
|
|
15006
15364
|
initData()
|
|
15007
15365
|
|
|
15008
15366
|
nextTick(() => {
|
|
15009
|
-
|
|
15010
|
-
|
|
15367
|
+
const { useScrollbar, autoResize } = props
|
|
15368
|
+
const el = refElem.value
|
|
15369
|
+
if (useScrollbar) {
|
|
15370
|
+
const viewInnerEl = getRefElem(elemStore['main-body-table'])
|
|
15371
|
+
const scrollObserver = globalResize.create(() => {
|
|
15372
|
+
reScrollFlag.value++
|
|
15373
|
+
})
|
|
15374
|
+
if (el) {
|
|
15375
|
+
scrollObserver.observe(el)
|
|
15376
|
+
}
|
|
15377
|
+
if (viewInnerEl) {
|
|
15378
|
+
scrollObserver.observe(viewInnerEl)
|
|
15379
|
+
}
|
|
15380
|
+
internalData.scrollObserver = scrollObserver
|
|
15381
|
+
}
|
|
15382
|
+
if (autoResize) {
|
|
15011
15383
|
const parentEl = $xeTable.getParentElem()
|
|
15012
|
-
resizeObserver = globalResize.create(() => {
|
|
15384
|
+
const resizeObserver = globalResize.create(() => {
|
|
15013
15385
|
if (props.autoResize) {
|
|
15014
|
-
|
|
15386
|
+
handleResizeEvent()
|
|
15015
15387
|
}
|
|
15016
15388
|
})
|
|
15017
15389
|
if (el) {
|
|
@@ -15020,6 +15392,7 @@ export default defineVxeComponent({
|
|
|
15020
15392
|
if (parentEl) {
|
|
15021
15393
|
resizeObserver.observe(parentEl)
|
|
15022
15394
|
}
|
|
15395
|
+
internalData.resizeObserver = resizeObserver
|
|
15023
15396
|
}
|
|
15024
15397
|
})
|
|
15025
15398
|
|
|
@@ -15044,7 +15417,7 @@ export default defineVxeComponent({
|
|
|
15044
15417
|
})
|
|
15045
15418
|
|
|
15046
15419
|
onBeforeUnmount(() => {
|
|
15047
|
-
const { _sToTime } = internalData
|
|
15420
|
+
const { resizeObserver, scrollObserver, _sToTime } = internalData
|
|
15048
15421
|
if (_sToTime) {
|
|
15049
15422
|
clearTimeout(_sToTime)
|
|
15050
15423
|
}
|
|
@@ -15058,6 +15431,9 @@ export default defineVxeComponent({
|
|
|
15058
15431
|
internalData.prevDragRow = null
|
|
15059
15432
|
internalData.prevDragCol = null
|
|
15060
15433
|
|
|
15434
|
+
if (scrollObserver) {
|
|
15435
|
+
scrollObserver.disconnect()
|
|
15436
|
+
}
|
|
15061
15437
|
if (resizeObserver) {
|
|
15062
15438
|
resizeObserver.disconnect()
|
|
15063
15439
|
}
|