vxe-table 4.17.0-beta.9 → 4.17.1
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 +3 -4
- package/README.zh-TW.md +1 -1
- package/es/grid/src/grid.js +13 -5
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/en-US.js +22 -22
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/menu/hook.js +2 -2
- package/es/table/src/body.js +3 -0
- package/es/table/src/footer.js +2 -0
- package/es/table/src/header.js +3 -0
- package/es/table/src/table.js +146 -35
- package/es/table/src/util.js +22 -19
- package/es/table/style.css +48 -2
- 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 +48 -2
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/grid/src/grid.js +12 -4
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +59 -41
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +22 -22
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +22 -22
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/menu/hook.js +2 -0
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/src/body.js +3 -0
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +2 -0
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +3 -0
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +25 -16
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +10 -19
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +48 -2
- 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 +48 -2
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +53 -45
- package/packages/locale/lang/en-US.ts +22 -22
- package/packages/table/module/menu/hook.ts +2 -2
- package/packages/table/src/body.ts +3 -0
- package/packages/table/src/footer.ts +2 -0
- package/packages/table/src/header.ts +3 -0
- package/packages/table/src/table.ts +147 -35
- package/packages/table/src/util.ts +30 -19
- package/styles/components/table.scss +90 -2
- /package/es/{iconfont.1760602279303.ttf → iconfont.1761181613193.ttf} +0 -0
- /package/es/{iconfont.1760602279303.woff → iconfont.1761181613193.woff} +0 -0
- /package/es/{iconfont.1760602279303.woff2 → iconfont.1761181613193.woff2} +0 -0
- /package/lib/{iconfont.1760602279303.ttf → iconfont.1761181613193.ttf} +0 -0
- /package/lib/{iconfont.1760602279303.woff → iconfont.1761181613193.woff} +0 -0
- /package/lib/{iconfont.1760602279303.woff2 → iconfont.1761181613193.woff2} +0 -0
|
@@ -463,14 +463,24 @@ export default defineVxeComponent({
|
|
|
463
463
|
return Object.assign({}, getConfig().table.scrollbarConfig, props.scrollbarConfig)
|
|
464
464
|
})
|
|
465
465
|
|
|
466
|
-
const
|
|
466
|
+
const computeScrollbarXOpts = computed(() => {
|
|
467
467
|
const scrollbarOpts = computeScrollbarOpts.value
|
|
468
|
-
return
|
|
468
|
+
return Object.assign({}, scrollbarOpts.x, props.scrollbarConfig?.x || {})
|
|
469
469
|
})
|
|
470
470
|
|
|
471
|
-
const
|
|
471
|
+
const computeScrollbarYOpts = computed(() => {
|
|
472
472
|
const scrollbarOpts = computeScrollbarOpts.value
|
|
473
|
-
return
|
|
473
|
+
return Object.assign({}, scrollbarOpts.y, props.scrollbarConfig?.y || {})
|
|
474
|
+
})
|
|
475
|
+
|
|
476
|
+
const computeScrollbarXToTop = computed(() => {
|
|
477
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
478
|
+
return scrollbarXOpts.position === 'top'
|
|
479
|
+
})
|
|
480
|
+
|
|
481
|
+
const computeScrollbarYToLeft = computed(() => {
|
|
482
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
483
|
+
return scrollbarYOpts.position === 'left'
|
|
474
484
|
})
|
|
475
485
|
|
|
476
486
|
const computeScrollYThreshold = computed(() => {
|
|
@@ -884,6 +894,8 @@ export default defineVxeComponent({
|
|
|
884
894
|
computeVirtualXOpts,
|
|
885
895
|
computeVirtualYOpts,
|
|
886
896
|
computeScrollbarOpts,
|
|
897
|
+
computeScrollbarXOpts,
|
|
898
|
+
computeScrollbarYOpts,
|
|
887
899
|
computeScrollbarXToTop,
|
|
888
900
|
computeScrollbarYToLeft,
|
|
889
901
|
computeColumnOpts,
|
|
@@ -1586,7 +1598,7 @@ export default defineVxeComponent({
|
|
|
1586
1598
|
}
|
|
1587
1599
|
|
|
1588
1600
|
const calcTableHeight = (key: 'height' | 'minHeight' | 'maxHeight') => {
|
|
1589
|
-
const { editConfig } = props
|
|
1601
|
+
const { editConfig, editRules } = props
|
|
1590
1602
|
const { parentHeight } = reactData
|
|
1591
1603
|
let val = props[key]
|
|
1592
1604
|
if (key === 'minHeight') {
|
|
@@ -1594,7 +1606,7 @@ export default defineVxeComponent({
|
|
|
1594
1606
|
if (XEUtils.eqNull(val)) {
|
|
1595
1607
|
if (eqEmptyValue(defMinHeight)) {
|
|
1596
1608
|
// 编辑模式默认最小高度
|
|
1597
|
-
if (isEnableConf(editConfig)) {
|
|
1609
|
+
if (editRules && isEnableConf(editConfig)) {
|
|
1598
1610
|
val = 144
|
|
1599
1611
|
}
|
|
1600
1612
|
} else {
|
|
@@ -2452,7 +2464,7 @@ export default defineVxeComponent({
|
|
|
2452
2464
|
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
|
|
2453
2465
|
const $xeGanttView = internalData.xeGanttView
|
|
2454
2466
|
const el = refElem.value
|
|
2455
|
-
if (!el || !el.clientHeight) {
|
|
2467
|
+
if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
|
|
2456
2468
|
return
|
|
2457
2469
|
}
|
|
2458
2470
|
const containerList = ['main', 'left', 'right']
|
|
@@ -2470,7 +2482,6 @@ export default defineVxeComponent({
|
|
|
2470
2482
|
}
|
|
2471
2483
|
|
|
2472
2484
|
const scrollbarXConf = scrollbarOpts.x || {}
|
|
2473
|
-
const scrollbarXToTop = computeScrollbarXToTop.value
|
|
2474
2485
|
const scrollbarYConf = scrollbarOpts.y || {}
|
|
2475
2486
|
const scrollbarYToLeft = computeScrollbarYToLeft.value
|
|
2476
2487
|
|
|
@@ -2522,16 +2533,28 @@ export default defineVxeComponent({
|
|
|
2522
2533
|
}
|
|
2523
2534
|
const xWrapperEl = refScrollXWrapperElem.value
|
|
2524
2535
|
if (xWrapperEl) {
|
|
2525
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : ''
|
|
2526
2536
|
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`
|
|
2537
|
+
if (scrollbarYToLeft) {
|
|
2538
|
+
xWrapperEl.style.left = `${osbWidth}px`
|
|
2539
|
+
} else {
|
|
2540
|
+
xWrapperEl.style.left = ''
|
|
2541
|
+
}
|
|
2527
2542
|
}
|
|
2528
2543
|
if (xLeftCornerEl) {
|
|
2529
|
-
|
|
2530
|
-
|
|
2544
|
+
if (scrollbarYToLeft) {
|
|
2545
|
+
xLeftCornerEl.style.width = `${osbWidth}px`
|
|
2546
|
+
xLeftCornerEl.style.display = overflowY && osbWidth ? 'block' : ''
|
|
2547
|
+
} else {
|
|
2548
|
+
xLeftCornerEl.style.display = ''
|
|
2549
|
+
}
|
|
2531
2550
|
}
|
|
2532
2551
|
if (xRightCornerEl) {
|
|
2533
|
-
|
|
2534
|
-
|
|
2552
|
+
if (scrollbarYToLeft) {
|
|
2553
|
+
xRightCornerEl.style.display = ''
|
|
2554
|
+
} else {
|
|
2555
|
+
xRightCornerEl.style.width = `${osbWidth}px`
|
|
2556
|
+
xRightCornerEl.style.display = xScrollbarVisible === 'visible' ? 'block' : ''
|
|
2557
|
+
}
|
|
2535
2558
|
}
|
|
2536
2559
|
|
|
2537
2560
|
const scrollYVirtualEl = refScrollYVirtualElem.value
|
|
@@ -4149,8 +4172,10 @@ export default defineVxeComponent({
|
|
|
4149
4172
|
updateAfterDataIndex()
|
|
4150
4173
|
return nextTick()
|
|
4151
4174
|
}).then(() => {
|
|
4175
|
+
updateTreeLineStyle()
|
|
4152
4176
|
return handleLazyRecalculate(true, true, true)
|
|
4153
4177
|
}).then(() => {
|
|
4178
|
+
updateTreeLineStyle()
|
|
4154
4179
|
setTimeout(() => {
|
|
4155
4180
|
$xeTable.updateCellAreas()
|
|
4156
4181
|
}, 30)
|
|
@@ -4523,6 +4548,9 @@ export default defineVxeComponent({
|
|
|
4523
4548
|
}
|
|
4524
4549
|
}
|
|
4525
4550
|
|
|
4551
|
+
/**
|
|
4552
|
+
* 更新展开行样式
|
|
4553
|
+
*/
|
|
4526
4554
|
const updateRowExpandStyle = () => {
|
|
4527
4555
|
const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData
|
|
4528
4556
|
const expandOpts = computeExpandOpts.value
|
|
@@ -4578,6 +4606,13 @@ export default defineVxeComponent({
|
|
|
4578
4606
|
}
|
|
4579
4607
|
}
|
|
4580
4608
|
|
|
4609
|
+
/**
|
|
4610
|
+
* 更新树连接线样式
|
|
4611
|
+
*/
|
|
4612
|
+
const updateTreeLineStyle = () => {
|
|
4613
|
+
// 待优化
|
|
4614
|
+
}
|
|
4615
|
+
|
|
4581
4616
|
const handleRowExpandScroll = () => {
|
|
4582
4617
|
const { elemStore } = internalData
|
|
4583
4618
|
const rowExpandEl = refRowExpandElem.value
|
|
@@ -6992,14 +7027,40 @@ export default defineVxeComponent({
|
|
|
6992
7027
|
* 获取表格的滚动状态
|
|
6993
7028
|
*/
|
|
6994
7029
|
getScroll () {
|
|
6995
|
-
|
|
7030
|
+
return $xeTable.getScrollData()
|
|
7031
|
+
},
|
|
7032
|
+
/**
|
|
7033
|
+
* 获取表格的滚动数据
|
|
7034
|
+
*/
|
|
7035
|
+
getScrollData () {
|
|
7036
|
+
const { scrollXLoad, scrollYLoad, scrollbarHeight, scrollbarWidth } = reactData
|
|
6996
7037
|
const { elemStore } = internalData
|
|
6997
7038
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll'])
|
|
7039
|
+
const scrollTop = bodyScrollElem ? bodyScrollElem.scrollTop : 0
|
|
7040
|
+
const scrollLeft = bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
7041
|
+
const clientHeight = bodyScrollElem ? bodyScrollElem.clientHeight : 0
|
|
7042
|
+
const clientWidth = bodyScrollElem ? bodyScrollElem.clientWidth : 0
|
|
7043
|
+
const scrollHeight = bodyScrollElem ? bodyScrollElem.scrollHeight : 0
|
|
7044
|
+
const scrollWidth = bodyScrollElem ? bodyScrollElem.scrollWidth : 0
|
|
7045
|
+
const isTop = scrollTop <= 0
|
|
7046
|
+
const isBottom = scrollTop + clientHeight >= scrollHeight
|
|
7047
|
+
const isLeft = scrollLeft <= 0
|
|
7048
|
+
const isRight = scrollLeft + clientWidth >= scrollWidth
|
|
6998
7049
|
return {
|
|
6999
7050
|
virtualX: scrollXLoad,
|
|
7000
7051
|
virtualY: scrollYLoad,
|
|
7001
|
-
|
|
7002
|
-
|
|
7052
|
+
isTop,
|
|
7053
|
+
isBottom,
|
|
7054
|
+
isLeft,
|
|
7055
|
+
isRight,
|
|
7056
|
+
scrollbarHeight,
|
|
7057
|
+
scrollbarWidth,
|
|
7058
|
+
scrollTop,
|
|
7059
|
+
scrollLeft,
|
|
7060
|
+
scrollHeight,
|
|
7061
|
+
scrollWidth,
|
|
7062
|
+
clientHeight,
|
|
7063
|
+
clientWidth
|
|
7003
7064
|
}
|
|
7004
7065
|
},
|
|
7005
7066
|
/**
|
|
@@ -7123,7 +7184,10 @@ export default defineVxeComponent({
|
|
|
7123
7184
|
scrollYStore.visibleStartIndex = 0
|
|
7124
7185
|
scrollYStore.endIndex = scrollYStore.visibleSize
|
|
7125
7186
|
scrollYStore.visibleEndIndex = scrollYStore.visibleSize
|
|
7187
|
+
|
|
7126
7188
|
return nextTick().then(() => {
|
|
7189
|
+
internalData.lastScrollLeft = 0
|
|
7190
|
+
internalData.lastScrollTop = 0
|
|
7127
7191
|
internalData.intoRunScroll = false
|
|
7128
7192
|
})
|
|
7129
7193
|
},
|
|
@@ -8329,7 +8393,7 @@ export default defineVxeComponent({
|
|
|
8329
8393
|
const el = refElem.value
|
|
8330
8394
|
if (el) {
|
|
8331
8395
|
const parentElem = el.parentNode as HTMLElement
|
|
8332
|
-
|
|
8396
|
+
let parentPaddingSize = 0
|
|
8333
8397
|
let parentWrapperHeight = 0
|
|
8334
8398
|
if (parentElem) {
|
|
8335
8399
|
if ($xeGantt && hasClass(parentElem, 'vxe-gantt--table-wrapper')) {
|
|
@@ -8338,6 +8402,7 @@ export default defineVxeComponent({
|
|
|
8338
8402
|
parentWrapperHeight = $xeGrid.getParentHeight()
|
|
8339
8403
|
} else {
|
|
8340
8404
|
parentWrapperHeight = parentElem.clientHeight
|
|
8405
|
+
parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0
|
|
8341
8406
|
}
|
|
8342
8407
|
}
|
|
8343
8408
|
return Math.floor(parentWrapperHeight - parentPaddingSize)
|
|
@@ -11369,12 +11434,11 @@ export default defineVxeComponent({
|
|
|
11369
11434
|
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
11370
11435
|
const leftFixedWidth = computeLeftFixedWidth.value
|
|
11371
11436
|
const rightFixedWidth = computeRightFixedWidth.value
|
|
11372
|
-
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
11373
|
-
return
|
|
11374
|
-
}
|
|
11375
11437
|
|
|
11376
11438
|
const { elemStore, lastScrollTop, lastScrollLeft } = internalData
|
|
11377
11439
|
const rowOpts = computeRowOpts.value
|
|
11440
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
11441
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
11378
11442
|
const xHandleEl = refScrollXHandleElem.value
|
|
11379
11443
|
const yHandleEl = refScrollYHandleElem.value
|
|
11380
11444
|
const leftScrollElem = getRefElem(elemStore['left-body-scroll'])
|
|
@@ -11383,12 +11447,6 @@ export default defineVxeComponent({
|
|
|
11383
11447
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll'])
|
|
11384
11448
|
const rightScrollElem = getRefElem(elemStore['right-body-scroll'])
|
|
11385
11449
|
const rowExpandEl = refRowExpandElem.value
|
|
11386
|
-
if (!xHandleEl) {
|
|
11387
|
-
return
|
|
11388
|
-
}
|
|
11389
|
-
if (!yHandleEl) {
|
|
11390
|
-
return
|
|
11391
|
-
}
|
|
11392
11450
|
if (!bodyScrollElem) {
|
|
11393
11451
|
return
|
|
11394
11452
|
}
|
|
@@ -11405,7 +11463,19 @@ export default defineVxeComponent({
|
|
|
11405
11463
|
const isRollX = scrollLeft !== lastScrollLeft
|
|
11406
11464
|
const isRollY = scrollTop !== lastScrollTop
|
|
11407
11465
|
|
|
11466
|
+
if (isRollX) {
|
|
11467
|
+
// 如果禁用滚动
|
|
11468
|
+
if (scrollbarXOpts.visible === 'hidden') {
|
|
11469
|
+
evnt.preventDefault()
|
|
11470
|
+
return
|
|
11471
|
+
}
|
|
11472
|
+
}
|
|
11408
11473
|
if (isRollY) {
|
|
11474
|
+
// 如果禁用滚动
|
|
11475
|
+
if (scrollbarYOpts.visible === 'hidden') {
|
|
11476
|
+
evnt.preventDefault()
|
|
11477
|
+
return
|
|
11478
|
+
}
|
|
11409
11479
|
const isTopWheel = deltaTop < 0
|
|
11410
11480
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
11411
11481
|
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
@@ -11413,9 +11483,14 @@ export default defineVxeComponent({
|
|
|
11413
11483
|
}
|
|
11414
11484
|
}
|
|
11415
11485
|
|
|
11486
|
+
if (!(leftFixedWidth || rightFixedWidth || expandColumn)) {
|
|
11487
|
+
return
|
|
11488
|
+
}
|
|
11489
|
+
|
|
11416
11490
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
11417
11491
|
$xeTable.clearHoverRow()
|
|
11418
11492
|
}
|
|
11493
|
+
|
|
11419
11494
|
// 用于鼠标纵向滚轮处理
|
|
11420
11495
|
if (isRollX) {
|
|
11421
11496
|
evnt.preventDefault()
|
|
@@ -11923,14 +11998,24 @@ export default defineVxeComponent({
|
|
|
11923
11998
|
* 如果宽度足够情况下,则不需要渲染固定列
|
|
11924
11999
|
* @param {String} fixedType 固定列类型
|
|
11925
12000
|
*/
|
|
11926
|
-
const
|
|
12001
|
+
const renderViewFixed = (fixedType: 'left' | 'right') => {
|
|
11927
12002
|
const { showHeader, showFooter } = props
|
|
11928
12003
|
const { tableData, tableColumn, tableGroupColumn, columnStore, footerTableData } = reactData
|
|
12004
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
12005
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
12006
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
12007
|
+
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts
|
|
12008
|
+
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts
|
|
11929
12009
|
const isFixedLeft = fixedType === 'left'
|
|
11930
12010
|
const fixedColumn = isFixedLeft ? columnStore.leftList : columnStore.rightList
|
|
12011
|
+
const osXBehavior = XEUtils.eqNull(overscrollXBehavior) ? scrollbarOpts.overscrollBehavior : overscrollXBehavior
|
|
12012
|
+
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
|
|
11931
12013
|
return h('div', {
|
|
11932
12014
|
ref: isFixedLeft ? refLeftContainer : refRightContainer,
|
|
11933
|
-
class: `vxe-table--fixed-${fixedType}-wrapper`
|
|
12015
|
+
class: [`vxe-table--fixed-${fixedType}-wrapper`, `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`, {
|
|
12016
|
+
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
12017
|
+
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
12018
|
+
}]
|
|
11934
12019
|
}, [
|
|
11935
12020
|
showHeader
|
|
11936
12021
|
? h(TableHeaderComponent, {
|
|
@@ -12122,6 +12207,7 @@ export default defineVxeComponent({
|
|
|
12122
12207
|
$columnIndex,
|
|
12123
12208
|
_columnIndex,
|
|
12124
12209
|
fixed: '',
|
|
12210
|
+
source: 'table',
|
|
12125
12211
|
type: 'body',
|
|
12126
12212
|
level: rowLevel,
|
|
12127
12213
|
rowid,
|
|
@@ -12227,14 +12313,24 @@ export default defineVxeComponent({
|
|
|
12227
12313
|
const renderViewport = () => {
|
|
12228
12314
|
const { showHeader, showFooter } = props
|
|
12229
12315
|
const { overflowX, tableData, tableColumn, tableGroupColumn, footerTableData, columnStore } = reactData
|
|
12316
|
+
const scrollbarOpts = computeScrollbarOpts.value
|
|
12317
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
12318
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
12319
|
+
const { overscrollBehavior: overscrollXBehavior } = scrollbarXOpts
|
|
12320
|
+
const { overscrollBehavior: overscrollYBehavior } = scrollbarYOpts
|
|
12230
12321
|
const { leftList, rightList } = columnStore
|
|
12322
|
+
const osXBehavior = XEUtils.eqNull(overscrollXBehavior) ? scrollbarOpts.overscrollBehavior : overscrollXBehavior
|
|
12323
|
+
const osYBehavior = XEUtils.eqNull(overscrollYBehavior) ? scrollbarOpts.overscrollBehavior : overscrollYBehavior
|
|
12231
12324
|
|
|
12232
12325
|
return h('div', {
|
|
12233
12326
|
ref: refTableViewportElem,
|
|
12234
|
-
class: 'vxe-table--viewport-wrapper'
|
|
12327
|
+
class: ['vxe-table--viewport-wrapper', {
|
|
12328
|
+
[`x-ob--${osXBehavior}`]: osXBehavior,
|
|
12329
|
+
[`y-ob--${osYBehavior}`]: osYBehavior
|
|
12330
|
+
}]
|
|
12235
12331
|
}, [
|
|
12236
12332
|
h('div', {
|
|
12237
|
-
class: 'vxe-table--main-wrapper'
|
|
12333
|
+
class: ['vxe-table--main-wrapper', `sx--${scrollbarXOpts.visible}`, `sy--${scrollbarYOpts.visible}`]
|
|
12238
12334
|
}, [
|
|
12239
12335
|
/**
|
|
12240
12336
|
* 表头
|
|
@@ -12269,8 +12365,8 @@ export default defineVxeComponent({
|
|
|
12269
12365
|
h('div', {
|
|
12270
12366
|
class: 'vxe-table--fixed-wrapper'
|
|
12271
12367
|
}, [
|
|
12272
|
-
leftList && leftList.length && overflowX ?
|
|
12273
|
-
rightList && rightList.length && overflowX ?
|
|
12368
|
+
leftList && leftList.length && overflowX ? renderViewFixed('left') : renderEmptyElement($xeTable),
|
|
12369
|
+
rightList && rightList.length && overflowX ? renderViewFixed('right') : renderEmptyElement($xeTable)
|
|
12274
12370
|
]),
|
|
12275
12371
|
renderRowExpandedVNs()
|
|
12276
12372
|
])
|
|
@@ -12410,11 +12506,15 @@ export default defineVxeComponent({
|
|
|
12410
12506
|
h('div', {
|
|
12411
12507
|
key: 'tn',
|
|
12412
12508
|
ref: refEmptyPlaceholder,
|
|
12413
|
-
class: 'vxe-table--empty-
|
|
12509
|
+
class: 'vxe-table--empty-place-wrapper'
|
|
12414
12510
|
}, [
|
|
12415
12511
|
h('div', {
|
|
12416
|
-
class: 'vxe-table--empty-
|
|
12417
|
-
},
|
|
12512
|
+
class: 'vxe-table--empty-placeholder'
|
|
12513
|
+
}, [
|
|
12514
|
+
h('div', {
|
|
12515
|
+
class: 'vxe-table--empty-content'
|
|
12516
|
+
}, renderEmptyBody())
|
|
12517
|
+
])
|
|
12418
12518
|
]),
|
|
12419
12519
|
/**
|
|
12420
12520
|
* 边框线
|
|
@@ -12727,6 +12827,18 @@ export default defineVxeComponent({
|
|
|
12727
12827
|
watch(() => VxeUI.getLanguage(), () => {
|
|
12728
12828
|
reLayoutFlag.value++
|
|
12729
12829
|
})
|
|
12830
|
+
watch(() => {
|
|
12831
|
+
const scrollbarXOpts = computeScrollbarXOpts.value
|
|
12832
|
+
return scrollbarXOpts.visible
|
|
12833
|
+
}, () => {
|
|
12834
|
+
reLayoutFlag.value++
|
|
12835
|
+
})
|
|
12836
|
+
watch(() => {
|
|
12837
|
+
const scrollbarYOpts = computeScrollbarYOpts.value
|
|
12838
|
+
return scrollbarYOpts.visible
|
|
12839
|
+
}, () => {
|
|
12840
|
+
reLayoutFlag.value++
|
|
12841
|
+
})
|
|
12730
12842
|
watch(reLayoutFlag, () => {
|
|
12731
12843
|
$xeTable.recalculate(true)
|
|
12732
12844
|
})
|
|
@@ -638,7 +638,7 @@ const lineOffsetSizes = {
|
|
|
638
638
|
large: 0
|
|
639
639
|
}
|
|
640
640
|
|
|
641
|
-
function
|
|
641
|
+
function countTreeExpandSize (prevRow: any, params: VxeTableDefines.CellRenderBodyParams) {
|
|
642
642
|
let count = 1
|
|
643
643
|
if (!prevRow) {
|
|
644
644
|
return count
|
|
@@ -655,7 +655,7 @@ function countTreeExpand (prevRow: any, params: VxeTableDefines.CellRenderBodyPa
|
|
|
655
655
|
const rowChildren = prevRow[transform ? mapChildrenField : childrenField]
|
|
656
656
|
if (rowChildren && treeExpandedFlag && treeExpandedMaps[getRowid($table, prevRow)]) {
|
|
657
657
|
for (let index = 0; index < rowChildren.length; index++) {
|
|
658
|
-
count +=
|
|
658
|
+
count += countTreeExpandSize(rowChildren[index], params)
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
661
|
return count
|
|
@@ -688,7 +688,7 @@ export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prev
|
|
|
688
688
|
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight
|
|
689
689
|
let expandSize = 1
|
|
690
690
|
if (prevRow) {
|
|
691
|
-
expandSize =
|
|
691
|
+
expandSize = countTreeExpandSize(prevRow, params)
|
|
692
692
|
}
|
|
693
693
|
let cellHeight = currCellHeight
|
|
694
694
|
const vnHeight = rowRest.height
|
|
@@ -702,29 +702,40 @@ export function calcTreeLine (params: VxeTableDefines.CellRenderBodyParams, prev
|
|
|
702
702
|
|
|
703
703
|
export function clearTableDefaultStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
704
704
|
const { props, internalData } = $xeTable
|
|
705
|
+
|
|
705
706
|
internalData.initStatus = false
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
707
|
+
const actionList = [
|
|
708
|
+
$xeTable.clearSort(),
|
|
709
|
+
$xeTable.clearCurrentRow(),
|
|
710
|
+
$xeTable.clearCurrentColumn(),
|
|
711
|
+
$xeTable.clearRadioRow(),
|
|
712
|
+
$xeTable.clearRadioReserve(),
|
|
713
|
+
$xeTable.clearCheckboxRow(),
|
|
714
|
+
$xeTable.clearCheckboxReserve(),
|
|
715
|
+
$xeTable.clearRowExpand(),
|
|
716
|
+
$xeTable.clearTreeExpand(),
|
|
717
|
+
$xeTable.clearTreeExpandReserve(),
|
|
718
|
+
$xeTable.clearPendingRow()
|
|
719
|
+
]
|
|
717
720
|
if ($xeTable.clearFilter) {
|
|
718
|
-
|
|
721
|
+
actionList.push(
|
|
722
|
+
$xeTable.clearFilter()
|
|
723
|
+
)
|
|
719
724
|
}
|
|
720
725
|
if ($xeTable.clearSelected && (props.keyboardConfig || props.mouseConfig)) {
|
|
721
|
-
|
|
726
|
+
actionList.push(
|
|
727
|
+
$xeTable.clearSelected()
|
|
728
|
+
)
|
|
722
729
|
}
|
|
723
730
|
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
724
|
-
|
|
725
|
-
|
|
731
|
+
actionList.push(
|
|
732
|
+
$xeTable.clearCellAreas(),
|
|
733
|
+
$xeTable.clearCopyCellArea()
|
|
734
|
+
)
|
|
726
735
|
}
|
|
727
|
-
return
|
|
736
|
+
return Promise.all(actionList).then(() => {
|
|
737
|
+
return $xeTable.clearScroll()
|
|
738
|
+
})
|
|
728
739
|
}
|
|
729
740
|
|
|
730
741
|
export function clearTableAllStatus ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
@@ -74,6 +74,34 @@ $btnThemeList: (
|
|
|
74
74
|
position: relative;
|
|
75
75
|
overflow: hidden;
|
|
76
76
|
flex-grow: 1;
|
|
77
|
+
&.x-ob--contain {
|
|
78
|
+
& > .vxe-table--main-wrapper {
|
|
79
|
+
& > .vxe-table--header-wrapper {
|
|
80
|
+
& > .vxe-table--header-inner-wrapper {
|
|
81
|
+
overscroll-behavior-x: contain;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
& > .vxe-table--body-wrapper {
|
|
85
|
+
& > .vxe-table--body-inner-wrapper {
|
|
86
|
+
overscroll-behavior-x: contain;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
& > .vxe-table--footer-wrapper {
|
|
90
|
+
& > .vxe-table--footer-inner-wrapper {
|
|
91
|
+
overscroll-behavior-x: contain;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
&.y-ob--contain {
|
|
97
|
+
& > .vxe-table--main-wrapper {
|
|
98
|
+
& > .vxe-table--body-wrapper {
|
|
99
|
+
& > .vxe-table--body-inner-wrapper {
|
|
100
|
+
overscroll-behavior-y: contain;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
77
105
|
}
|
|
78
106
|
.vxe-table--header-wrapper,
|
|
79
107
|
.vxe-table--body-wrapper,
|
|
@@ -108,6 +136,51 @@ $btnThemeList: (
|
|
|
108
136
|
overflow-x: scroll;
|
|
109
137
|
}
|
|
110
138
|
|
|
139
|
+
// 禁用滚动条
|
|
140
|
+
.vxe-table--main-wrapper {
|
|
141
|
+
&.sx--hidden {
|
|
142
|
+
& > .vxe-table--header-wrapper {
|
|
143
|
+
& > .vxe-table--header-inner-wrapper {
|
|
144
|
+
overflow-x: hidden;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
& > .vxe-table--body-wrapper {
|
|
148
|
+
& > .vxe-table--body-inner-wrapper {
|
|
149
|
+
overflow-x: hidden;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
& > .vxe-table--footer-wrapper {
|
|
153
|
+
& > .vxe-table--footer-inner-wrapper {
|
|
154
|
+
overflow-x: hidden;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
&.sy--hidden {
|
|
159
|
+
& > .vxe-table--body-wrapper {
|
|
160
|
+
& > .vxe-table--body-inner-wrapper {
|
|
161
|
+
overflow-y: hidden;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
.vxe-table--fixed-left-wrapper,
|
|
167
|
+
.vxe-table--fixed-right-wrapper {
|
|
168
|
+
&.sx--hidden {
|
|
169
|
+
& > .vxe-table--body-wrapper {
|
|
170
|
+
& > .vxe-table--body-inner-wrapper {
|
|
171
|
+
overflow-x: hidden;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
&.sy--hidden {
|
|
176
|
+
& > .vxe-table--body-wrapper {
|
|
177
|
+
& > .vxe-table--body-inner-wrapper {
|
|
178
|
+
overflow-y: hidden;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
111
184
|
.vxe-loading--custom-wrapper {
|
|
112
185
|
display: none;
|
|
113
186
|
position: absolute;
|
|
@@ -640,6 +713,9 @@ $btnThemeList: (
|
|
|
640
713
|
left: 0;
|
|
641
714
|
bottom: 0;
|
|
642
715
|
}
|
|
716
|
+
.vxe-table--scroll-x-wrapper {
|
|
717
|
+
height: 100%;
|
|
718
|
+
}
|
|
643
719
|
.vxe-table--scroll-x-handle {
|
|
644
720
|
overflow-y: hidden;
|
|
645
721
|
overflow-x: scroll;
|
|
@@ -1702,6 +1778,13 @@ $btnThemeList: (
|
|
|
1702
1778
|
transition: 0.3s box-shadow;
|
|
1703
1779
|
outline: 0;
|
|
1704
1780
|
background-color: var(--vxe-ui-layout-background-color);
|
|
1781
|
+
&.y-ob--contain {
|
|
1782
|
+
& > .vxe-table--body-wrapper {
|
|
1783
|
+
& > .vxe-table--body-inner-wrapper {
|
|
1784
|
+
overscroll-behavior-y: contain;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1705
1788
|
.vxe-table--body-wrapper {
|
|
1706
1789
|
outline: 0;
|
|
1707
1790
|
}
|
|
@@ -2103,11 +2186,16 @@ $btnThemeList: (
|
|
|
2103
2186
|
display: none;
|
|
2104
2187
|
visibility: hidden;
|
|
2105
2188
|
}
|
|
2106
|
-
.vxe-table--empty-
|
|
2189
|
+
.vxe-table--empty-place-wrapper {
|
|
2107
2190
|
display: none;
|
|
2108
2191
|
position: absolute;
|
|
2192
|
+
width: 100%;
|
|
2109
2193
|
top: 0;
|
|
2110
2194
|
z-index: 5;
|
|
2195
|
+
overflow: hidden;
|
|
2196
|
+
}
|
|
2197
|
+
.vxe-table--empty-placeholder {
|
|
2198
|
+
display: flex;
|
|
2111
2199
|
}
|
|
2112
2200
|
.vxe-table--empty-content {
|
|
2113
2201
|
display: block;
|
|
@@ -2116,7 +2204,7 @@ $btnThemeList: (
|
|
|
2116
2204
|
}
|
|
2117
2205
|
&.is--empty {
|
|
2118
2206
|
.vxe-table--empty-block,
|
|
2119
|
-
.vxe-table--empty-
|
|
2207
|
+
.vxe-table--empty-place-wrapper{
|
|
2120
2208
|
display: flex;
|
|
2121
2209
|
}
|
|
2122
2210
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|