vxe-table 3.19.5 → 3.19.7
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/style.css +1 -1
- package/es/table/module/export/mixin.js +5 -3
- package/es/table/src/body.js +9 -19
- package/es/table/src/cell.js +49 -42
- package/es/table/src/footer.js +2 -12
- package/es/table/src/header.js +3 -11
- package/es/table/src/methods.js +29 -48
- package/es/table/src/table.js +89 -6
- package/es/toolbar/src/toolbar.js +3 -3
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +187 -121
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/mixin.js +5 -3
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/body.js +7 -20
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +14 -7
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +2 -15
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +3 -13
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +32 -51
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +118 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +3 -3
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +2 -2
- 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/package.json +1 -1
- package/packages/table/module/export/mixin.ts +5 -3
- package/packages/table/src/body.ts +9 -19
- package/packages/table/src/cell.ts +51 -44
- package/packages/table/src/footer.ts +2 -11
- package/packages/table/src/header.ts +3 -11
- package/packages/table/src/methods.ts +29 -47
- package/packages/table/src/table.ts +89 -6
- package/packages/toolbar/src/toolbar.ts +3 -3
- package/packages/ui/index.ts +1 -1
- /package/es/{iconfont.1761784799557.ttf → iconfont.1762136064244.ttf} +0 -0
- /package/es/{iconfont.1761784799557.woff → iconfont.1762136064244.woff} +0 -0
- /package/es/{iconfont.1761784799557.woff2 → iconfont.1762136064244.woff2} +0 -0
- /package/lib/{iconfont.1761784799557.ttf → iconfont.1762136064244.ttf} +0 -0
- /package/lib/{iconfont.1761784799557.woff → iconfont.1762136064244.woff} +0 -0
- /package/lib/{iconfont.1761784799557.woff2 → iconfont.1762136064244.woff2} +0 -0
|
@@ -185,7 +185,8 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
185
185
|
const tableReactData = $table as unknown as TableReactData
|
|
186
186
|
const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps
|
|
187
187
|
const { isRowGroupStatus } = tableReactData
|
|
188
|
-
const { showHeaderOverflow } = column
|
|
188
|
+
const { showHeaderOverflow, slots } = column
|
|
189
|
+
const titleSlot = slots ? slots.title : null
|
|
189
190
|
const headerTooltipOpts = $table.computeHeaderTooltipOpts
|
|
190
191
|
const showAllTip = headerTooltipOpts.showAll
|
|
191
192
|
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow
|
|
@@ -221,9 +222,11 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
221
222
|
on: ons
|
|
222
223
|
}, isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles
|
|
223
224
|
? $table.getPivotTableAggregateRenderColTitles(h, column, titleVN)
|
|
224
|
-
:
|
|
225
|
-
|
|
226
|
-
|
|
225
|
+
: titleSlot
|
|
226
|
+
? $table.callSlot(titleSlot, params, h)
|
|
227
|
+
: [
|
|
228
|
+
titleVN
|
|
229
|
+
])
|
|
227
230
|
]
|
|
228
231
|
}
|
|
229
232
|
|
|
@@ -633,9 +636,9 @@ export const Cell = {
|
|
|
633
636
|
return renderCellBaseVNs(h, params, $table.callSlot(slots.default, params, h))
|
|
634
637
|
}
|
|
635
638
|
const { seq } = params
|
|
636
|
-
const
|
|
639
|
+
const seqMd = seqOpts.seqMethod
|
|
637
640
|
return renderCellBaseVNs(h, params, [
|
|
638
|
-
h('span', `${formatText(
|
|
641
|
+
h('span', `${formatText(seqMd ? seqMd(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + (seq as number), 1)}`)
|
|
639
642
|
])
|
|
640
643
|
},
|
|
641
644
|
renderDeepIndexCell (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
@@ -1049,45 +1052,49 @@ export const Cell = {
|
|
|
1049
1052
|
const { $table, column } = params
|
|
1050
1053
|
const sortOpts = $table.computeSortOpts
|
|
1051
1054
|
const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts
|
|
1055
|
+
const { order, slots } = column
|
|
1052
1056
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1057
|
+
const sortSlot = slots ? slots.sort : null
|
|
1058
|
+
return sortSlot
|
|
1059
|
+
? getSlotVNs($table.callSlot(sortSlot, params, h)) as VNode[]
|
|
1060
|
+
: [
|
|
1061
|
+
h('span', {
|
|
1062
|
+
class: ['vxe-cell--sort', `vxe-cell--sort-${iconLayout}-layout`]
|
|
1063
|
+
}, [
|
|
1064
|
+
h('i', {
|
|
1065
|
+
class: ['vxe-sort--asc-btn', iconAsc || getIcon().TABLE_SORT_ASC, {
|
|
1066
|
+
'sort--active': order === 'asc'
|
|
1067
|
+
}],
|
|
1068
|
+
attrs: {
|
|
1069
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
|
|
1070
|
+
},
|
|
1071
|
+
on: allowBtn
|
|
1072
|
+
? {
|
|
1073
|
+
click (evnt: any) {
|
|
1074
|
+
evnt.stopPropagation()
|
|
1075
|
+
$table.triggerSortEvent(evnt, column, 'asc')
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
: undefined
|
|
1079
|
+
}),
|
|
1080
|
+
h('i', {
|
|
1081
|
+
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
1082
|
+
'sort--active': order === 'desc'
|
|
1083
|
+
}],
|
|
1084
|
+
attrs: {
|
|
1085
|
+
title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
|
|
1086
|
+
},
|
|
1087
|
+
on: allowBtn
|
|
1088
|
+
? {
|
|
1089
|
+
click (evnt: any) {
|
|
1090
|
+
evnt.stopPropagation()
|
|
1091
|
+
$table.triggerSortEvent(evnt, column, 'desc')
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
: undefined
|
|
1095
|
+
})
|
|
1096
|
+
])
|
|
1097
|
+
]
|
|
1091
1098
|
}
|
|
1092
1099
|
return []
|
|
1093
1100
|
},
|
|
@@ -278,27 +278,18 @@ export default {
|
|
|
278
278
|
const _vm = this as any
|
|
279
279
|
const props = _vm
|
|
280
280
|
const $xeTable = _vm.$parent as VxeTableConstructor & VxeTablePrivateMethods
|
|
281
|
-
const tableProps = $xeTable
|
|
282
281
|
const tableReactData = $xeTable as unknown as TableReactData
|
|
283
282
|
const tableInternalData = $xeTable as unknown as TableInternalData
|
|
284
283
|
|
|
285
284
|
const { xID } = $xeTable
|
|
286
285
|
|
|
287
286
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
288
|
-
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps
|
|
289
287
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
290
288
|
const { isGroup, isColLoading, overflowX, scrollXLoad, dragCol } = tableReactData
|
|
289
|
+
const isFooterRenderOptimize = $xeTable.computeIsFooterRenderOptimize
|
|
291
290
|
|
|
292
291
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
293
|
-
|
|
294
|
-
// 如果是使用优化模式
|
|
295
|
-
if (scrollXLoad && allColumnFooterOverflow) {
|
|
296
|
-
if (spanMethod || footerSpanMethod) {
|
|
297
|
-
// 如果不支持优化模式
|
|
298
|
-
} else {
|
|
299
|
-
isOptimizeMode = true
|
|
300
|
-
}
|
|
301
|
-
}
|
|
292
|
+
const isOptimizeMode = isFooterRenderOptimize
|
|
302
293
|
|
|
303
294
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
304
295
|
renderColumnList = visibleColumn
|
|
@@ -462,27 +462,19 @@ export default {
|
|
|
462
462
|
const { fixedType, fixedColumn, tableColumn } = props
|
|
463
463
|
const { headerColumn } = _vm
|
|
464
464
|
|
|
465
|
-
const { mouseConfig
|
|
465
|
+
const { mouseConfig } = tableProps
|
|
466
466
|
const { isGroup, isColLoading, overflowX, scrollXLoad, dragCol } = tableReactData
|
|
467
467
|
const { visibleColumn, fullColumnIdData } = tableInternalData
|
|
468
468
|
|
|
469
469
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
470
|
+
const isHeaderRenderOptimize = $xeTable.computeIsHeaderRenderOptimize
|
|
470
471
|
let renderHeaderList = headerColumn as VxeTableDefines.ColumnInfo[][]
|
|
471
472
|
let renderColumnList = tableColumn as VxeTableDefines.ColumnInfo[]
|
|
472
|
-
|
|
473
|
+
const isOptimizeMode = isHeaderRenderOptimize
|
|
473
474
|
|
|
474
475
|
if (isGroup) {
|
|
475
476
|
renderColumnList = visibleColumn
|
|
476
477
|
} else {
|
|
477
|
-
// 如果是使用优化模式
|
|
478
|
-
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
479
|
-
if (spanMethod || footerSpanMethod) {
|
|
480
|
-
// 如果不支持优化模式
|
|
481
|
-
} else {
|
|
482
|
-
isOptimizeMode = true
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
|
|
486
478
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
487
479
|
renderColumnList = visibleColumn
|
|
488
480
|
}
|
|
@@ -530,8 +530,7 @@ function handleVirtualTreeExpand ($xeTable: VxeTableConstructor & VxeTablePrivat
|
|
|
530
530
|
updateAfterDataIndex($xeTable)
|
|
531
531
|
return $xeTable.$nextTick()
|
|
532
532
|
}).then(() => {
|
|
533
|
-
|
|
534
|
-
return handleLazyRecalculate($xeTable, true, true, true)
|
|
533
|
+
return handleRecalculateStyle($xeTable, true, true, true)
|
|
535
534
|
}).then(() => {
|
|
536
535
|
updateTreeLineStyle($xeTable)
|
|
537
536
|
setTimeout(() => {
|
|
@@ -998,8 +997,8 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
998
997
|
const reactData = $xeTable as unknown as TableReactData
|
|
999
998
|
const internalData = $xeTable as unknown as TableInternalData
|
|
1000
999
|
|
|
1001
|
-
const {
|
|
1002
|
-
const { isGroup, currentRow, tableColumn,
|
|
1000
|
+
const { mouseConfig } = props
|
|
1001
|
+
const { isGroup, currentRow, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData
|
|
1003
1002
|
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData
|
|
1004
1003
|
const $xeGanttView = internalData.xeGanttView
|
|
1005
1004
|
const el = $xeTable.$refs.refElem as HTMLDivElement
|
|
@@ -1007,12 +1006,15 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1007
1006
|
return
|
|
1008
1007
|
}
|
|
1009
1008
|
const containerList = ['main', 'left', 'right']
|
|
1009
|
+
const { leftList, rightList } = columnStore
|
|
1010
1010
|
let osbWidth = overflowY ? scrollbarWidth : 0
|
|
1011
1011
|
let osbHeight = overflowX ? scrollbarHeight : 0
|
|
1012
1012
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder as HTMLDivElement
|
|
1013
|
+
const isHeaderRenderOptimize = $xeTable.computeIsHeaderRenderOptimize
|
|
1014
|
+
const isBodyRenderOptimize = $xeTable.computeIsBodyRenderOptimize
|
|
1015
|
+
const isFooterRenderOptimize = $xeTable.computeIsFooterRenderOptimize
|
|
1013
1016
|
const scrollbarOpts = $xeTable.computeScrollbarOpts
|
|
1014
1017
|
const mouseOpts = $xeTable.computeMouseOpts
|
|
1015
|
-
const expandOpts = $xeTable.computeExpandOpts
|
|
1016
1018
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper'])
|
|
1017
1019
|
const bodyTableElem = getRefElem(elemStore['main-body-table'])
|
|
1018
1020
|
if (emptyPlaceholderElem) {
|
|
@@ -1134,7 +1136,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1134
1136
|
let fixedColumn: VxeTableDefines.ColumnInfo[] = []
|
|
1135
1137
|
let fixedWrapperElem: HTMLDivElement
|
|
1136
1138
|
if (fixedType) {
|
|
1137
|
-
fixedColumn = isFixedLeft ?
|
|
1139
|
+
fixedColumn = isFixedLeft ? leftList : rightList
|
|
1138
1140
|
fixedWrapperElem = (isFixedLeft ? $xeTable.$refs.refLeftContainer : $xeTable.$refs.refRightContainer) as HTMLDivElement
|
|
1139
1141
|
}
|
|
1140
1142
|
layoutList.forEach(layout => {
|
|
@@ -1145,20 +1147,11 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1145
1147
|
// 表头体样式处理
|
|
1146
1148
|
// 横向滚动渲染
|
|
1147
1149
|
let renderColumnList = tableColumn
|
|
1148
|
-
|
|
1150
|
+
const isOptimizeMode = isHeaderRenderOptimize
|
|
1149
1151
|
|
|
1150
1152
|
if (isGroup) {
|
|
1151
1153
|
renderColumnList = visibleColumn
|
|
1152
1154
|
} else {
|
|
1153
|
-
// 如果是使用优化模式
|
|
1154
|
-
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
1155
|
-
if (spanMethod || footerSpanMethod) {
|
|
1156
|
-
// 如果不支持优化模式
|
|
1157
|
-
} else {
|
|
1158
|
-
isOptimizeMode = true
|
|
1159
|
-
}
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
1155
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
1163
1156
|
renderColumnList = visibleColumn
|
|
1164
1157
|
}
|
|
@@ -1215,16 +1208,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1215
1208
|
}
|
|
1216
1209
|
|
|
1217
1210
|
let renderColumnList = tableColumn
|
|
1218
|
-
|
|
1219
|
-
let isOptimizeMode = false
|
|
1220
|
-
// 如果是使用优化模式
|
|
1221
|
-
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
1222
|
-
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
1223
|
-
// 如果不支持优化模式
|
|
1224
|
-
} else {
|
|
1225
|
-
isOptimizeMode = true
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1211
|
+
const isOptimizeMode = isBodyRenderOptimize
|
|
1228
1212
|
|
|
1229
1213
|
if (fixedType) {
|
|
1230
1214
|
renderColumnList = visibleColumn
|
|
@@ -1258,15 +1242,7 @@ function updateStyle ($xeTable: VxeTableConstructor & VxeTablePrivateMethods) {
|
|
|
1258
1242
|
}
|
|
1259
1243
|
} else if (layout === 'footer') {
|
|
1260
1244
|
let renderColumnList = tableColumn
|
|
1261
|
-
|
|
1262
|
-
// 如果是使用优化模式
|
|
1263
|
-
if (scrollXLoad && allColumnFooterOverflow) {
|
|
1264
|
-
if (spanMethod || footerSpanMethod) {
|
|
1265
|
-
// 如果不支持优化模式
|
|
1266
|
-
} else {
|
|
1267
|
-
isOptimizeMode = true
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1245
|
+
const isOptimizeMode = isFooterRenderOptimize
|
|
1270
1246
|
|
|
1271
1247
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
1272
1248
|
renderColumnList = visibleColumn
|
|
@@ -11648,7 +11624,7 @@ const Methods = {
|
|
|
11648
11624
|
const reactData = $xeTable as unknown as TableReactData
|
|
11649
11625
|
const internalData = $xeTable as unknown as TableInternalData
|
|
11650
11626
|
|
|
11651
|
-
const { isAllOverflow, scrollYLoad, expandColumn } = reactData
|
|
11627
|
+
const { isAllOverflow, overflowY, scrollYLoad, scrollYHeight, expandColumn } = reactData
|
|
11652
11628
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData
|
|
11653
11629
|
const $xeGanttView = internalData.xeGanttView
|
|
11654
11630
|
const { startIndex } = scrollYStore
|
|
@@ -11663,13 +11639,13 @@ const Methods = {
|
|
|
11663
11639
|
const rightbodyTableElem = getRefElem(elemStore['right-body-table'])
|
|
11664
11640
|
const containerList = ['main', 'left', 'right']
|
|
11665
11641
|
let ySpaceTop = 0
|
|
11666
|
-
let
|
|
11642
|
+
let sYHeight = scrollYHeight
|
|
11667
11643
|
let isScrollYBig = false
|
|
11668
11644
|
if (scrollYLoad) {
|
|
11669
11645
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height
|
|
11670
11646
|
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
11671
|
-
|
|
11672
|
-
if (
|
|
11647
|
+
sYHeight = afterFullData.length * defaultRowHeight
|
|
11648
|
+
if (sYHeight > maxYHeight) {
|
|
11673
11649
|
isScrollYBig = true
|
|
11674
11650
|
}
|
|
11675
11651
|
ySpaceTop = Math.max(0, startIndex * defaultRowHeight)
|
|
@@ -11682,18 +11658,21 @@ const Methods = {
|
|
|
11682
11658
|
const lastRow = afterFullData[afterFullData.length - 1]
|
|
11683
11659
|
rowid = getRowid($xeTable, lastRow)
|
|
11684
11660
|
rowRest = fullAllDataRowIdData[rowid] || {}
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11661
|
+
// 如果为空时还没计算完数据,保持原高度不变
|
|
11662
|
+
if (rowRest.oTop) {
|
|
11663
|
+
sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight)
|
|
11664
|
+
// 是否展开行
|
|
11665
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
11666
|
+
sYHeight += rowRest.expandHeight || expandOpts.height || 0
|
|
11667
|
+
}
|
|
11689
11668
|
}
|
|
11690
|
-
if (
|
|
11669
|
+
if (sYHeight > maxYHeight) {
|
|
11691
11670
|
isScrollYBig = true
|
|
11692
11671
|
}
|
|
11693
11672
|
}
|
|
11694
11673
|
} else {
|
|
11695
11674
|
if (bodyTableElem) {
|
|
11696
|
-
|
|
11675
|
+
sYHeight = bodyTableElem.clientHeight
|
|
11697
11676
|
}
|
|
11698
11677
|
}
|
|
11699
11678
|
let clientHeight = 0
|
|
@@ -11701,7 +11680,7 @@ const Methods = {
|
|
|
11701
11680
|
clientHeight = bodyScrollElem.clientHeight
|
|
11702
11681
|
}
|
|
11703
11682
|
// 虚拟渲染
|
|
11704
|
-
let ySpaceHeight =
|
|
11683
|
+
let ySpaceHeight = sYHeight
|
|
11705
11684
|
let scrollYTop = ySpaceTop
|
|
11706
11685
|
if (isScrollYBig) {
|
|
11707
11686
|
// 触底
|
|
@@ -11712,6 +11691,9 @@ const Methods = {
|
|
|
11712
11691
|
}
|
|
11713
11692
|
ySpaceHeight = maxYHeight
|
|
11714
11693
|
}
|
|
11694
|
+
if (!(scrollYLoad && overflowY)) {
|
|
11695
|
+
scrollYTop = 0
|
|
11696
|
+
}
|
|
11715
11697
|
|
|
11716
11698
|
if (leftBodyTableElem) {
|
|
11717
11699
|
leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`
|
|
@@ -11742,7 +11724,7 @@ const Methods = {
|
|
|
11742
11724
|
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : ''
|
|
11743
11725
|
}
|
|
11744
11726
|
reactData.scrollYTop = scrollYTop
|
|
11745
|
-
reactData.scrollYHeight =
|
|
11727
|
+
reactData.scrollYHeight = ySpaceHeight
|
|
11746
11728
|
reactData.isScrollYBig = isScrollYBig
|
|
11747
11729
|
|
|
11748
11730
|
calcScrollbar($xeTable)
|
|
@@ -1299,6 +1299,89 @@ export default {
|
|
|
1299
1299
|
}
|
|
1300
1300
|
return leftWidth
|
|
1301
1301
|
},
|
|
1302
|
+
computeBodyMergeCoverFixed () {
|
|
1303
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1304
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1305
|
+
const internalData = $xeTable as unknown as TableInternalData
|
|
1306
|
+
|
|
1307
|
+
const { columnStore, mergeBodyFlag } = reactData
|
|
1308
|
+
const { mergeBodyList, visibleColumn } = internalData
|
|
1309
|
+
const { leftList, rightList } = columnStore
|
|
1310
|
+
const rscIndex = visibleColumn.length - rightList.length
|
|
1311
|
+
if (mergeBodyFlag && (leftList.length || rightList.length)) {
|
|
1312
|
+
const lecIndex = leftList.length
|
|
1313
|
+
for (let i = 0; i < mergeBodyList.length; i++) {
|
|
1314
|
+
const { col, colspan } = mergeBodyList[i]
|
|
1315
|
+
if (col < lecIndex || (col + colspan) > rscIndex) {
|
|
1316
|
+
return true
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
return false
|
|
1321
|
+
},
|
|
1322
|
+
computeIsHeaderRenderOptimize () {
|
|
1323
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1324
|
+
const props = $xeTable
|
|
1325
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1326
|
+
|
|
1327
|
+
const { spanMethod, footerSpanMethod, showHeaderOverflow: allColumnHeaderOverflow } = props
|
|
1328
|
+
const { isGroup, scrollXLoad } = reactData
|
|
1329
|
+
let isOptimizeMode = false
|
|
1330
|
+
if (isGroup) {
|
|
1331
|
+
// 分组表头
|
|
1332
|
+
} else {
|
|
1333
|
+
// 如果是使用优化模式
|
|
1334
|
+
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
1335
|
+
if (spanMethod || footerSpanMethod) {
|
|
1336
|
+
// 如果不支持优化模式
|
|
1337
|
+
} else {
|
|
1338
|
+
isOptimizeMode = true
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
return isOptimizeMode
|
|
1343
|
+
},
|
|
1344
|
+
computeIsBodyRenderOptimize () {
|
|
1345
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1346
|
+
const props = $xeTable
|
|
1347
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1348
|
+
|
|
1349
|
+
const { spanMethod, footerSpanMethod } = props
|
|
1350
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow, expandColumn } = reactData
|
|
1351
|
+
const bodyMergeCoverFixed = $xeTable.computeBodyMergeCoverFixed
|
|
1352
|
+
const expandOpts = $xeTable.computeExpandOpts
|
|
1353
|
+
let isOptimizeMode = false
|
|
1354
|
+
// 如果是使用优化模式
|
|
1355
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
1356
|
+
// 如果是展开行,内联模式,不支持优化
|
|
1357
|
+
// 如果是方法合并,不支持优化
|
|
1358
|
+
// 如果固定列且配置式合并,不支持优化
|
|
1359
|
+
if ((expandColumn && expandOpts.mode !== 'fixed') || bodyMergeCoverFixed || spanMethod || footerSpanMethod) {
|
|
1360
|
+
// 如果不支持优化模式
|
|
1361
|
+
} else {
|
|
1362
|
+
isOptimizeMode = true
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
return isOptimizeMode
|
|
1366
|
+
},
|
|
1367
|
+
computeIsFooterRenderOptimize () {
|
|
1368
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1369
|
+
const props = $xeTable
|
|
1370
|
+
const reactData = $xeTable as unknown as TableReactData
|
|
1371
|
+
|
|
1372
|
+
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = props
|
|
1373
|
+
const { scrollXLoad } = reactData
|
|
1374
|
+
let isOptimizeMode = false
|
|
1375
|
+
// 如果是使用优化模式
|
|
1376
|
+
if (scrollXLoad && allColumnFooterOverflow) {
|
|
1377
|
+
if (spanMethod || footerSpanMethod) {
|
|
1378
|
+
// 如果不支持优化模式
|
|
1379
|
+
} else {
|
|
1380
|
+
isOptimizeMode = true
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
return isOptimizeMode
|
|
1384
|
+
},
|
|
1302
1385
|
exportOpts () {
|
|
1303
1386
|
return this.computeExportOpts
|
|
1304
1387
|
},
|
|
@@ -1709,12 +1792,12 @@ export default {
|
|
|
1709
1792
|
if (props.resizable) {
|
|
1710
1793
|
warnLog('vxe.error.delProp', ['resizable', 'column-config.resizable'])
|
|
1711
1794
|
}
|
|
1712
|
-
if (props.virtualXConfig && props.scrollX) {
|
|
1713
|
-
|
|
1714
|
-
}
|
|
1715
|
-
if (props.virtualYConfig && props.scrollY) {
|
|
1716
|
-
|
|
1717
|
-
}
|
|
1795
|
+
// if (props.virtualXConfig && props.scrollX) {
|
|
1796
|
+
// warnLog('vxe.error.notSupportProp', ['virtual-x-config', 'scroll-x', 'scroll-x=null'])
|
|
1797
|
+
// }
|
|
1798
|
+
// if (props.virtualYConfig && props.scrollY) {
|
|
1799
|
+
// warnLog('vxe.error.notSupportProp', ['virtual-y-config', 'scroll-y', 'scroll-y=null'])
|
|
1800
|
+
// }
|
|
1718
1801
|
if (props.aggregateConfig && props.rowGroupConfig) {
|
|
1719
1802
|
warnLog('vxe.error.notSupportProp', ['aggregate-config', 'row-group-config', 'row-group-config=null'])
|
|
1720
1803
|
}
|
|
@@ -443,7 +443,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
443
443
|
? h(VxeUIButtonComponent, {
|
|
444
444
|
key: index,
|
|
445
445
|
props: Object.assign({}, child, {
|
|
446
|
-
content: child.name,
|
|
446
|
+
content: child.content || child.name,
|
|
447
447
|
options: undefined
|
|
448
448
|
}),
|
|
449
449
|
on: {
|
|
@@ -496,7 +496,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
496
496
|
btnVNs.push(
|
|
497
497
|
h(VxeUIButtonComponent, {
|
|
498
498
|
props: Object.assign({}, item, {
|
|
499
|
-
content: item.name,
|
|
499
|
+
content: item.content || item.name,
|
|
500
500
|
options: undefined
|
|
501
501
|
}),
|
|
502
502
|
on: {
|
|
@@ -563,7 +563,7 @@ export default /* define-vxe-component start */ defineVxeComponent({
|
|
|
563
563
|
h(VxeUIButtonComponent, {
|
|
564
564
|
key: tIndex,
|
|
565
565
|
props: Object.assign({}, item, {
|
|
566
|
-
content: item.name,
|
|
566
|
+
content: item.content || item.name,
|
|
567
567
|
options: undefined
|
|
568
568
|
}),
|
|
569
569
|
on: {
|
package/packages/ui/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|