vxe-table 3.19.6 → 3.19.8
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/src/body.js +9 -19
- package/es/table/src/cell.js +47 -40
- package/es/table/src/footer.js +2 -12
- package/es/table/src/header.js +3 -11
- package/es/table/src/methods.js +51 -56
- package/es/table/src/table.js +89 -6
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +201 -121
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +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 +12 -5
- 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 +56 -59
- 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/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/src/body.ts +9 -19
- package/packages/table/src/cell.ts +49 -42
- package/packages/table/src/footer.ts +2 -11
- package/packages/table/src/header.ts +3 -11
- package/packages/table/src/methods.ts +52 -55
- package/packages/table/src/table.ts +89 -6
- package/packages/ui/index.ts +1 -1
- /package/es/{iconfont.1761877353318.ttf → iconfont.1762324067655.ttf} +0 -0
- /package/es/{iconfont.1761877353318.woff → iconfont.1762324067655.woff} +0 -0
- /package/es/{iconfont.1761877353318.woff2 → iconfont.1762324067655.woff2} +0 -0
- /package/lib/{iconfont.1761877353318.ttf → iconfont.1762324067655.ttf} +0 -0
- /package/lib/{iconfont.1761877353318.woff → iconfont.1762324067655.woff} +0 -0
- /package/lib/{iconfont.1761877353318.woff2 → iconfont.1762324067655.woff2} +0 -0
package/es/table/src/body.js
CHANGED
|
@@ -702,24 +702,15 @@ export default {
|
|
|
702
702
|
const slots = $xeTable.$scopedSlots;
|
|
703
703
|
const { xID } = $xeTable;
|
|
704
704
|
const { fixedColumn, fixedType, tableColumn } = props;
|
|
705
|
-
const {
|
|
706
|
-
const { isGroup, tableData, isColLoading, overflowX, scrollXLoad, scrollYLoad,
|
|
705
|
+
const { mouseConfig } = tableProps;
|
|
706
|
+
const { isGroup, tableData, isColLoading, overflowX, scrollXLoad, scrollYLoad, dragRow, dragCol } = tableReactData;
|
|
707
707
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
|
|
708
708
|
const emptyOpts = $xeTable.computeEmptyOpts;
|
|
709
709
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
710
|
-
const
|
|
710
|
+
const isBodyRenderOptimize = $xeTable.computeIsBodyRenderOptimize;
|
|
711
711
|
let renderDataList = tableData;
|
|
712
712
|
let renderColumnList = tableColumn;
|
|
713
|
-
|
|
714
|
-
// 如果是使用优化模式
|
|
715
|
-
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
716
|
-
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
717
|
-
// 如果不支持优化模式
|
|
718
|
-
}
|
|
719
|
-
else {
|
|
720
|
-
isOptimizeMode = true;
|
|
721
|
-
}
|
|
722
|
-
}
|
|
713
|
+
const isOptimizeMode = isBodyRenderOptimize;
|
|
723
714
|
if (!isColLoading && (fixedType || !overflowX)) {
|
|
724
715
|
renderColumnList = visibleColumn;
|
|
725
716
|
}
|
|
@@ -792,11 +783,6 @@ export default {
|
|
|
792
783
|
emptyContent = tableProps.emptyText || getI18n('vxe.table.emptyText');
|
|
793
784
|
}
|
|
794
785
|
}
|
|
795
|
-
const ons = {
|
|
796
|
-
scroll(evnt) {
|
|
797
|
-
$xeTable.triggerBodyScrollEvent(evnt, fixedType);
|
|
798
|
-
}
|
|
799
|
-
};
|
|
800
786
|
return h('div', {
|
|
801
787
|
ref: 'refElem',
|
|
802
788
|
class: ['vxe-table--body-wrapper', fixedType ? `fixed-${fixedType}--wrapper` : 'body--wrapper'],
|
|
@@ -807,7 +793,11 @@ export default {
|
|
|
807
793
|
h('div', {
|
|
808
794
|
ref: 'refBodyScroll',
|
|
809
795
|
class: 'vxe-table--body-inner-wrapper',
|
|
810
|
-
on:
|
|
796
|
+
on: {
|
|
797
|
+
scroll(evnt) {
|
|
798
|
+
$xeTable.triggerBodyScrollEvent(evnt, fixedType);
|
|
799
|
+
}
|
|
800
|
+
}
|
|
811
801
|
}, [
|
|
812
802
|
fixedType
|
|
813
803
|
? renderEmptyElement($xeTable)
|
package/es/table/src/cell.js
CHANGED
|
@@ -170,7 +170,8 @@ function renderTitleContent(h, params, content) {
|
|
|
170
170
|
const tableReactData = $table;
|
|
171
171
|
const { showHeaderOverflow: allColumnHeaderOverflow } = tableProps;
|
|
172
172
|
const { isRowGroupStatus } = tableReactData;
|
|
173
|
-
const { showHeaderOverflow } = column;
|
|
173
|
+
const { showHeaderOverflow, slots } = column;
|
|
174
|
+
const titleSlot = slots ? slots.title : null;
|
|
174
175
|
const headerTooltipOpts = $table.computeHeaderTooltipOpts;
|
|
175
176
|
const showAllTip = headerTooltipOpts.showAll;
|
|
176
177
|
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
@@ -207,9 +208,11 @@ function renderTitleContent(h, params, content) {
|
|
|
207
208
|
on: ons
|
|
208
209
|
}, isRowGroupStatus && column.aggFunc && $table.getPivotTableAggregateRenderColTitles
|
|
209
210
|
? $table.getPivotTableAggregateRenderColTitles(h, column, titleVN)
|
|
210
|
-
:
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
: titleSlot
|
|
212
|
+
? $table.callSlot(titleSlot, params, h)
|
|
213
|
+
: [
|
|
214
|
+
titleVN
|
|
215
|
+
])
|
|
213
216
|
];
|
|
214
217
|
}
|
|
215
218
|
function getFooterContent(h, params) {
|
|
@@ -1001,45 +1004,49 @@ export const Cell = {
|
|
|
1001
1004
|
const { $table, column } = params;
|
|
1002
1005
|
const sortOpts = $table.computeSortOpts;
|
|
1003
1006
|
const { showIcon, allowBtn, ascTitle, descTitle, iconLayout, iconAsc, iconDesc, iconVisibleMethod } = sortOpts;
|
|
1007
|
+
const { order, slots } = column;
|
|
1004
1008
|
if (showIcon && (!iconVisibleMethod || iconVisibleMethod(params))) {
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
h('
|
|
1010
|
-
class: ['vxe-sort
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1009
|
+
const sortSlot = slots ? slots.sort : null;
|
|
1010
|
+
return sortSlot
|
|
1011
|
+
? getSlotVNs($table.callSlot(sortSlot, params, h))
|
|
1012
|
+
: [
|
|
1013
|
+
h('span', {
|
|
1014
|
+
class: ['vxe-cell--sort', `vxe-cell--sort-${iconLayout}-layout`]
|
|
1015
|
+
}, [
|
|
1016
|
+
h('i', {
|
|
1017
|
+
class: ['vxe-sort--asc-btn', iconAsc || getIcon().TABLE_SORT_ASC, {
|
|
1018
|
+
'sort--active': order === 'asc'
|
|
1019
|
+
}],
|
|
1020
|
+
attrs: {
|
|
1021
|
+
title: XEUtils.eqNull(ascTitle) ? getI18n('vxe.table.sortAsc') : `${ascTitle || ''}`
|
|
1022
|
+
},
|
|
1023
|
+
on: allowBtn
|
|
1024
|
+
? {
|
|
1025
|
+
click(evnt) {
|
|
1026
|
+
evnt.stopPropagation();
|
|
1027
|
+
$table.triggerSortEvent(evnt, column, 'asc');
|
|
1028
|
+
}
|
|
1021
1029
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1030
|
+
: undefined
|
|
1031
|
+
}),
|
|
1032
|
+
h('i', {
|
|
1033
|
+
class: ['vxe-sort--desc-btn', iconDesc || getIcon().TABLE_SORT_DESC, {
|
|
1034
|
+
'sort--active': order === 'desc'
|
|
1035
|
+
}],
|
|
1036
|
+
attrs: {
|
|
1037
|
+
title: XEUtils.eqNull(descTitle) ? getI18n('vxe.table.sortDesc') : `${descTitle || ''}`
|
|
1038
|
+
},
|
|
1039
|
+
on: allowBtn
|
|
1040
|
+
? {
|
|
1041
|
+
click(evnt) {
|
|
1042
|
+
evnt.stopPropagation();
|
|
1043
|
+
$table.triggerSortEvent(evnt, column, 'desc');
|
|
1044
|
+
}
|
|
1037
1045
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
]
|
|
1042
|
-
];
|
|
1046
|
+
: undefined
|
|
1047
|
+
})
|
|
1048
|
+
])
|
|
1049
|
+
];
|
|
1043
1050
|
}
|
|
1044
1051
|
return [];
|
|
1045
1052
|
},
|
package/es/table/src/footer.js
CHANGED
|
@@ -260,25 +260,15 @@ export default {
|
|
|
260
260
|
const _vm = this;
|
|
261
261
|
const props = _vm;
|
|
262
262
|
const $xeTable = _vm.$parent;
|
|
263
|
-
const tableProps = $xeTable;
|
|
264
263
|
const tableReactData = $xeTable;
|
|
265
264
|
const tableInternalData = $xeTable;
|
|
266
265
|
const { xID } = $xeTable;
|
|
267
266
|
const { fixedType, fixedColumn, tableColumn } = props;
|
|
268
|
-
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = tableProps;
|
|
269
267
|
const { visibleColumn, fullColumnIdData } = tableInternalData;
|
|
270
268
|
const { isGroup, isColLoading, overflowX, scrollXLoad, dragCol } = tableReactData;
|
|
269
|
+
const isFooterRenderOptimize = $xeTable.computeIsFooterRenderOptimize;
|
|
271
270
|
let renderColumnList = tableColumn;
|
|
272
|
-
|
|
273
|
-
// 如果是使用优化模式
|
|
274
|
-
if (scrollXLoad && allColumnFooterOverflow) {
|
|
275
|
-
if (spanMethod || footerSpanMethod) {
|
|
276
|
-
// 如果不支持优化模式
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
isOptimizeMode = true;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
271
|
+
const isOptimizeMode = isFooterRenderOptimize;
|
|
282
272
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
283
273
|
renderColumnList = visibleColumn;
|
|
284
274
|
}
|
package/es/table/src/header.js
CHANGED
|
@@ -428,26 +428,18 @@ export default {
|
|
|
428
428
|
const { xID } = $xeTable;
|
|
429
429
|
const { fixedType, fixedColumn, tableColumn } = props;
|
|
430
430
|
const { headerColumn } = _vm;
|
|
431
|
-
const { mouseConfig
|
|
431
|
+
const { mouseConfig } = tableProps;
|
|
432
432
|
const { isGroup, isColLoading, overflowX, scrollXLoad, dragCol } = tableReactData;
|
|
433
433
|
const { visibleColumn, fullColumnIdData } = tableInternalData;
|
|
434
434
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
435
|
+
const isHeaderRenderOptimize = $xeTable.computeIsHeaderRenderOptimize;
|
|
435
436
|
let renderHeaderList = headerColumn;
|
|
436
437
|
let renderColumnList = tableColumn;
|
|
437
|
-
|
|
438
|
+
const isOptimizeMode = isHeaderRenderOptimize;
|
|
438
439
|
if (isGroup) {
|
|
439
440
|
renderColumnList = visibleColumn;
|
|
440
441
|
}
|
|
441
442
|
else {
|
|
442
|
-
// 如果是使用优化模式
|
|
443
|
-
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
444
|
-
if (spanMethod || footerSpanMethod) {
|
|
445
|
-
// 如果不支持优化模式
|
|
446
|
-
}
|
|
447
|
-
else {
|
|
448
|
-
isOptimizeMode = true;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
443
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
452
444
|
renderColumnList = visibleColumn;
|
|
453
445
|
}
|
package/es/table/src/methods.js
CHANGED
|
@@ -493,8 +493,7 @@ function handleVirtualTreeExpand($xeTable, rows, expanded) {
|
|
|
493
493
|
updateAfterDataIndex($xeTable);
|
|
494
494
|
return $xeTable.$nextTick();
|
|
495
495
|
}).then(() => {
|
|
496
|
-
|
|
497
|
-
return handleLazyRecalculate($xeTable, true, true, true);
|
|
496
|
+
return handleRecalculateStyle($xeTable, true, true, true);
|
|
498
497
|
}).then(() => {
|
|
499
498
|
updateTreeLineStyle($xeTable);
|
|
500
499
|
setTimeout(() => {
|
|
@@ -953,8 +952,8 @@ function updateStyle($xeTable) {
|
|
|
953
952
|
const props = $xeTable;
|
|
954
953
|
const reactData = $xeTable;
|
|
955
954
|
const internalData = $xeTable;
|
|
956
|
-
const {
|
|
957
|
-
const { isGroup, currentRow, tableColumn,
|
|
955
|
+
const { mouseConfig } = props;
|
|
956
|
+
const { isGroup, currentRow, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData;
|
|
958
957
|
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
|
|
959
958
|
const $xeGanttView = internalData.xeGanttView;
|
|
960
959
|
const el = $xeTable.$refs.refElem;
|
|
@@ -962,12 +961,15 @@ function updateStyle($xeTable) {
|
|
|
962
961
|
return;
|
|
963
962
|
}
|
|
964
963
|
const containerList = ['main', 'left', 'right'];
|
|
964
|
+
const { leftList, rightList } = columnStore;
|
|
965
965
|
let osbWidth = overflowY ? scrollbarWidth : 0;
|
|
966
966
|
let osbHeight = overflowX ? scrollbarHeight : 0;
|
|
967
967
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
|
|
968
|
+
const isHeaderRenderOptimize = $xeTable.computeIsHeaderRenderOptimize;
|
|
969
|
+
const isBodyRenderOptimize = $xeTable.computeIsBodyRenderOptimize;
|
|
970
|
+
const isFooterRenderOptimize = $xeTable.computeIsFooterRenderOptimize;
|
|
968
971
|
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
969
972
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
970
|
-
const expandOpts = $xeTable.computeExpandOpts;
|
|
971
973
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
972
974
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
973
975
|
if (emptyPlaceholderElem) {
|
|
@@ -1085,7 +1087,7 @@ function updateStyle($xeTable) {
|
|
|
1085
1087
|
let fixedColumn = [];
|
|
1086
1088
|
let fixedWrapperElem;
|
|
1087
1089
|
if (fixedType) {
|
|
1088
|
-
fixedColumn = isFixedLeft ?
|
|
1090
|
+
fixedColumn = isFixedLeft ? leftList : rightList;
|
|
1089
1091
|
fixedWrapperElem = (isFixedLeft ? $xeTable.$refs.refLeftContainer : $xeTable.$refs.refRightContainer);
|
|
1090
1092
|
}
|
|
1091
1093
|
layoutList.forEach(layout => {
|
|
@@ -1096,20 +1098,11 @@ function updateStyle($xeTable) {
|
|
|
1096
1098
|
// 表头体样式处理
|
|
1097
1099
|
// 横向滚动渲染
|
|
1098
1100
|
let renderColumnList = tableColumn;
|
|
1099
|
-
|
|
1101
|
+
const isOptimizeMode = isHeaderRenderOptimize;
|
|
1100
1102
|
if (isGroup) {
|
|
1101
1103
|
renderColumnList = visibleColumn;
|
|
1102
1104
|
}
|
|
1103
1105
|
else {
|
|
1104
|
-
// 如果是使用优化模式
|
|
1105
|
-
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
1106
|
-
if (spanMethod || footerSpanMethod) {
|
|
1107
|
-
// 如果不支持优化模式
|
|
1108
|
-
}
|
|
1109
|
-
else {
|
|
1110
|
-
isOptimizeMode = true;
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
1106
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
1114
1107
|
renderColumnList = visibleColumn;
|
|
1115
1108
|
}
|
|
@@ -1162,16 +1155,7 @@ function updateStyle($xeTable) {
|
|
|
1162
1155
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
1163
1156
|
}
|
|
1164
1157
|
let renderColumnList = tableColumn;
|
|
1165
|
-
|
|
1166
|
-
// 如果是使用优化模式
|
|
1167
|
-
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
1168
|
-
if ((expandColumn && expandOpts.mode !== 'fixed') || spanMethod || footerSpanMethod) {
|
|
1169
|
-
// 如果不支持优化模式
|
|
1170
|
-
}
|
|
1171
|
-
else {
|
|
1172
|
-
isOptimizeMode = true;
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1158
|
+
const isOptimizeMode = isBodyRenderOptimize;
|
|
1175
1159
|
if (fixedType) {
|
|
1176
1160
|
renderColumnList = visibleColumn;
|
|
1177
1161
|
if (isOptimizeMode) {
|
|
@@ -1203,16 +1187,7 @@ function updateStyle($xeTable) {
|
|
|
1203
1187
|
}
|
|
1204
1188
|
else if (layout === 'footer') {
|
|
1205
1189
|
let renderColumnList = tableColumn;
|
|
1206
|
-
|
|
1207
|
-
// 如果是使用优化模式
|
|
1208
|
-
if (scrollXLoad && allColumnFooterOverflow) {
|
|
1209
|
-
if (spanMethod || footerSpanMethod) {
|
|
1210
|
-
// 如果不支持优化模式
|
|
1211
|
-
}
|
|
1212
|
-
else {
|
|
1213
|
-
isOptimizeMode = true;
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1190
|
+
const isOptimizeMode = isFooterRenderOptimize;
|
|
1216
1191
|
if (!isOptimizeMode || (!isColLoading && (fixedType || !overflowX))) {
|
|
1217
1192
|
renderColumnList = visibleColumn;
|
|
1218
1193
|
}
|
|
@@ -2427,20 +2402,30 @@ function autoCellWidth($xeTable) {
|
|
|
2427
2402
|
/**
|
|
2428
2403
|
* 计算自适应行高
|
|
2429
2404
|
*/
|
|
2430
|
-
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
2431
|
-
const
|
|
2405
|
+
const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
|
|
2406
|
+
const reactData = $xeTable;
|
|
2407
|
+
const { scrollXLoad } = reactData;
|
|
2408
|
+
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
2432
2409
|
let colHeight = rowRest.height;
|
|
2433
2410
|
let firstCellStyle = null;
|
|
2434
2411
|
let topBottomPadding = 0;
|
|
2435
|
-
for (let i = 0; i <
|
|
2436
|
-
const wrapperElem =
|
|
2412
|
+
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
2413
|
+
const wrapperElem = wrapperElemList[i];
|
|
2437
2414
|
const cellElem = wrapperElem.parentElement;
|
|
2438
2415
|
if (!firstCellStyle) {
|
|
2416
|
+
const cellStyle = cellElem.style;
|
|
2417
|
+
const orHeight = cellStyle.height;
|
|
2418
|
+
if (!scrollXLoad) {
|
|
2419
|
+
cellStyle.height = '';
|
|
2420
|
+
}
|
|
2439
2421
|
firstCellStyle = getComputedStyle(cellElem);
|
|
2440
2422
|
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
2423
|
+
if (!scrollXLoad) {
|
|
2424
|
+
cellStyle.height = orHeight;
|
|
2425
|
+
}
|
|
2441
2426
|
}
|
|
2442
2427
|
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
|
|
2443
|
-
colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
|
|
2428
|
+
colHeight = scrollXLoad ? Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding)) : Math.ceil(cellHeight + topBottomPadding);
|
|
2444
2429
|
}
|
|
2445
2430
|
return colHeight;
|
|
2446
2431
|
};
|
|
@@ -2459,13 +2444,15 @@ const calcCellHeight = ($xeTable) => {
|
|
|
2459
2444
|
const el = $xeTable.$refs.refElem;
|
|
2460
2445
|
if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine)) && el) {
|
|
2461
2446
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
2447
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
2462
2448
|
tableData.forEach(row => {
|
|
2463
2449
|
const rowid = handleGetRowId(row);
|
|
2464
2450
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2465
2451
|
if (rowRest) {
|
|
2466
|
-
const height = calcCellAutoHeight(rowRest, el);
|
|
2452
|
+
const height = calcCellAutoHeight($xeTable, rowRest, el);
|
|
2467
2453
|
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
|
|
2468
2454
|
}
|
|
2455
|
+
el.removeAttribute('data-calc-row');
|
|
2469
2456
|
});
|
|
2470
2457
|
reactData.calcCellHeightFlag++;
|
|
2471
2458
|
}
|
|
@@ -6131,7 +6118,9 @@ const Methods = {
|
|
|
6131
6118
|
return;
|
|
6132
6119
|
}
|
|
6133
6120
|
const handleRsHeight = () => {
|
|
6134
|
-
|
|
6121
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
6122
|
+
const resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
|
|
6123
|
+
el.removeAttribute('data-calc-row');
|
|
6135
6124
|
const resizeParams = Object.assign(Object.assign({}, params), { resizeHeight, resizeRow: row });
|
|
6136
6125
|
reactData.isDragResize = false;
|
|
6137
6126
|
internalData._lastResizeTime = Date.now();
|
|
@@ -6216,7 +6205,7 @@ const Methods = {
|
|
|
6216
6205
|
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
6217
6206
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6218
6207
|
if (rowRest) {
|
|
6219
|
-
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
6208
|
+
rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
|
|
6220
6209
|
}
|
|
6221
6210
|
el.removeAttribute('data-calc-row');
|
|
6222
6211
|
});
|
|
@@ -11273,7 +11262,7 @@ const Methods = {
|
|
|
11273
11262
|
const $xeTable = this;
|
|
11274
11263
|
const reactData = $xeTable;
|
|
11275
11264
|
const internalData = $xeTable;
|
|
11276
|
-
const { isAllOverflow, scrollYLoad, expandColumn } = reactData;
|
|
11265
|
+
const { isAllOverflow, overflowY, scrollYLoad, scrollYHeight, expandColumn } = reactData;
|
|
11277
11266
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData;
|
|
11278
11267
|
const $xeGanttView = internalData.xeGanttView;
|
|
11279
11268
|
const { startIndex } = scrollYStore;
|
|
@@ -11288,13 +11277,13 @@ const Methods = {
|
|
|
11288
11277
|
const rightbodyTableElem = getRefElem(elemStore['right-body-table']);
|
|
11289
11278
|
const containerList = ['main', 'left', 'right'];
|
|
11290
11279
|
let ySpaceTop = 0;
|
|
11291
|
-
let
|
|
11280
|
+
let sYHeight = scrollYHeight;
|
|
11292
11281
|
let isScrollYBig = false;
|
|
11293
11282
|
if (scrollYLoad) {
|
|
11294
11283
|
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
11295
11284
|
if (!isCustomCellHeight && !expandColumn && isAllOverflow) {
|
|
11296
|
-
|
|
11297
|
-
if (
|
|
11285
|
+
sYHeight = afterFullData.length * defaultRowHeight;
|
|
11286
|
+
if (sYHeight > maxYHeight) {
|
|
11298
11287
|
isScrollYBig = true;
|
|
11299
11288
|
}
|
|
11300
11289
|
ySpaceTop = Math.max(0, startIndex * defaultRowHeight);
|
|
@@ -11307,19 +11296,22 @@ const Methods = {
|
|
|
11307
11296
|
const lastRow = afterFullData[afterFullData.length - 1];
|
|
11308
11297
|
rowid = getRowid($xeTable, lastRow);
|
|
11309
11298
|
rowRest = fullAllDataRowIdData[rowid] || {};
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11299
|
+
// 如果为空时还没计算完数据,保持原高度不变
|
|
11300
|
+
if (rowRest.oTop) {
|
|
11301
|
+
sYHeight = (rowRest.oTop || 0) + (rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight);
|
|
11302
|
+
// 是否展开行
|
|
11303
|
+
if (expandColumn && rowExpandedMaps[rowid]) {
|
|
11304
|
+
sYHeight += rowRest.expandHeight || expandOpts.height || 0;
|
|
11305
|
+
}
|
|
11314
11306
|
}
|
|
11315
|
-
if (
|
|
11307
|
+
if (sYHeight > maxYHeight) {
|
|
11316
11308
|
isScrollYBig = true;
|
|
11317
11309
|
}
|
|
11318
11310
|
}
|
|
11319
11311
|
}
|
|
11320
11312
|
else {
|
|
11321
11313
|
if (bodyTableElem) {
|
|
11322
|
-
|
|
11314
|
+
sYHeight = bodyTableElem.clientHeight;
|
|
11323
11315
|
}
|
|
11324
11316
|
}
|
|
11325
11317
|
let clientHeight = 0;
|
|
@@ -11327,7 +11319,7 @@ const Methods = {
|
|
|
11327
11319
|
clientHeight = bodyScrollElem.clientHeight;
|
|
11328
11320
|
}
|
|
11329
11321
|
// 虚拟渲染
|
|
11330
|
-
let ySpaceHeight =
|
|
11322
|
+
let ySpaceHeight = sYHeight;
|
|
11331
11323
|
let scrollYTop = ySpaceTop;
|
|
11332
11324
|
if (isScrollYBig) {
|
|
11333
11325
|
// 触底
|
|
@@ -11339,6 +11331,9 @@ const Methods = {
|
|
|
11339
11331
|
}
|
|
11340
11332
|
ySpaceHeight = maxYHeight;
|
|
11341
11333
|
}
|
|
11334
|
+
if (!(scrollYLoad && overflowY)) {
|
|
11335
|
+
scrollYTop = 0;
|
|
11336
|
+
}
|
|
11342
11337
|
if (leftBodyTableElem) {
|
|
11343
11338
|
leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
|
|
11344
11339
|
}
|
|
@@ -11366,7 +11361,7 @@ const Methods = {
|
|
|
11366
11361
|
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
11367
11362
|
}
|
|
11368
11363
|
reactData.scrollYTop = scrollYTop;
|
|
11369
|
-
reactData.scrollYHeight =
|
|
11364
|
+
reactData.scrollYHeight = ySpaceHeight;
|
|
11370
11365
|
reactData.isScrollYBig = isScrollYBig;
|
|
11371
11366
|
calcScrollbar($xeTable);
|
|
11372
11367
|
if (isScrollYBig && mouseOpts.area) {
|
package/es/table/src/table.js
CHANGED
|
@@ -1197,6 +1197,89 @@ export default {
|
|
|
1197
1197
|
}
|
|
1198
1198
|
return leftWidth;
|
|
1199
1199
|
},
|
|
1200
|
+
computeBodyMergeCoverFixed() {
|
|
1201
|
+
const $xeTable = this;
|
|
1202
|
+
const reactData = $xeTable;
|
|
1203
|
+
const internalData = $xeTable;
|
|
1204
|
+
const { columnStore, mergeBodyFlag } = reactData;
|
|
1205
|
+
const { mergeBodyList, visibleColumn } = internalData;
|
|
1206
|
+
const { leftList, rightList } = columnStore;
|
|
1207
|
+
const rscIndex = visibleColumn.length - rightList.length;
|
|
1208
|
+
if (mergeBodyFlag && (leftList.length || rightList.length)) {
|
|
1209
|
+
const lecIndex = leftList.length;
|
|
1210
|
+
for (let i = 0; i < mergeBodyList.length; i++) {
|
|
1211
|
+
const { col, colspan } = mergeBodyList[i];
|
|
1212
|
+
if (col < lecIndex || (col + colspan) > rscIndex) {
|
|
1213
|
+
return true;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
return false;
|
|
1218
|
+
},
|
|
1219
|
+
computeIsHeaderRenderOptimize() {
|
|
1220
|
+
const $xeTable = this;
|
|
1221
|
+
const props = $xeTable;
|
|
1222
|
+
const reactData = $xeTable;
|
|
1223
|
+
const { spanMethod, footerSpanMethod, showHeaderOverflow: allColumnHeaderOverflow } = props;
|
|
1224
|
+
const { isGroup, scrollXLoad } = reactData;
|
|
1225
|
+
let isOptimizeMode = false;
|
|
1226
|
+
if (isGroup) {
|
|
1227
|
+
// 分组表头
|
|
1228
|
+
}
|
|
1229
|
+
else {
|
|
1230
|
+
// 如果是使用优化模式
|
|
1231
|
+
if (scrollXLoad && allColumnHeaderOverflow) {
|
|
1232
|
+
if (spanMethod || footerSpanMethod) {
|
|
1233
|
+
// 如果不支持优化模式
|
|
1234
|
+
}
|
|
1235
|
+
else {
|
|
1236
|
+
isOptimizeMode = true;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
return isOptimizeMode;
|
|
1241
|
+
},
|
|
1242
|
+
computeIsBodyRenderOptimize() {
|
|
1243
|
+
const $xeTable = this;
|
|
1244
|
+
const props = $xeTable;
|
|
1245
|
+
const reactData = $xeTable;
|
|
1246
|
+
const { spanMethod, footerSpanMethod } = props;
|
|
1247
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow, expandColumn } = reactData;
|
|
1248
|
+
const bodyMergeCoverFixed = $xeTable.computeBodyMergeCoverFixed;
|
|
1249
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
1250
|
+
let isOptimizeMode = false;
|
|
1251
|
+
// 如果是使用优化模式
|
|
1252
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
1253
|
+
// 如果是展开行,内联模式,不支持优化
|
|
1254
|
+
// 如果是方法合并,不支持优化
|
|
1255
|
+
// 如果固定列且配置式合并,不支持优化
|
|
1256
|
+
if ((expandColumn && expandOpts.mode !== 'fixed') || bodyMergeCoverFixed || spanMethod || footerSpanMethod) {
|
|
1257
|
+
// 如果不支持优化模式
|
|
1258
|
+
}
|
|
1259
|
+
else {
|
|
1260
|
+
isOptimizeMode = true;
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
return isOptimizeMode;
|
|
1264
|
+
},
|
|
1265
|
+
computeIsFooterRenderOptimize() {
|
|
1266
|
+
const $xeTable = this;
|
|
1267
|
+
const props = $xeTable;
|
|
1268
|
+
const reactData = $xeTable;
|
|
1269
|
+
const { spanMethod, footerSpanMethod, showFooterOverflow: allColumnFooterOverflow } = props;
|
|
1270
|
+
const { scrollXLoad } = reactData;
|
|
1271
|
+
let isOptimizeMode = false;
|
|
1272
|
+
// 如果是使用优化模式
|
|
1273
|
+
if (scrollXLoad && allColumnFooterOverflow) {
|
|
1274
|
+
if (spanMethod || footerSpanMethod) {
|
|
1275
|
+
// 如果不支持优化模式
|
|
1276
|
+
}
|
|
1277
|
+
else {
|
|
1278
|
+
isOptimizeMode = true;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
return isOptimizeMode;
|
|
1282
|
+
},
|
|
1200
1283
|
exportOpts() {
|
|
1201
1284
|
return this.computeExportOpts;
|
|
1202
1285
|
},
|
|
@@ -1579,12 +1662,12 @@ export default {
|
|
|
1579
1662
|
if (props.resizable) {
|
|
1580
1663
|
warnLog('vxe.error.delProp', ['resizable', 'column-config.resizable']);
|
|
1581
1664
|
}
|
|
1582
|
-
if (props.virtualXConfig && props.scrollX) {
|
|
1583
|
-
|
|
1584
|
-
}
|
|
1585
|
-
if (props.virtualYConfig && props.scrollY) {
|
|
1586
|
-
|
|
1587
|
-
}
|
|
1665
|
+
// if (props.virtualXConfig && props.scrollX) {
|
|
1666
|
+
// warnLog('vxe.error.notSupportProp', ['virtual-x-config', 'scroll-x', 'scroll-x=null'])
|
|
1667
|
+
// }
|
|
1668
|
+
// if (props.virtualYConfig && props.scrollY) {
|
|
1669
|
+
// warnLog('vxe.error.notSupportProp', ['virtual-y-config', 'scroll-y', 'scroll-y=null'])
|
|
1670
|
+
// }
|
|
1588
1671
|
if (props.aggregateConfig && props.rowGroupConfig) {
|
|
1589
1672
|
warnLog('vxe.error.notSupportProp', ['aggregate-config', 'row-group-config', 'row-group-config=null']);
|
|
1590
1673
|
}
|
package/es/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
import { getFuncText } from './src/utils';
|
|
3
|
-
export const version = "3.19.
|
|
3
|
+
export const version = "3.19.8";
|
|
4
4
|
VxeUI.version = version;
|
|
5
5
|
VxeUI.tableVersion = version;
|
|
6
6
|
VxeUI.setConfig({
|
|
@@ -12,7 +12,7 @@ VxeUI.setConfig({
|
|
|
12
12
|
delayHover: 250,
|
|
13
13
|
autoResize: true,
|
|
14
14
|
padding: true,
|
|
15
|
-
minHeight:
|
|
15
|
+
// minHeight: null,
|
|
16
16
|
// keepSource: false,
|
|
17
17
|
// showOverflow: null,
|
|
18
18
|
// showHeaderOverflow: null,
|
package/es/ui/src/log.js
CHANGED