vxe-table 3.17.6 → 3.17.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/grid/src/grid.js +47 -29
- package/es/style.css +1 -1
- package/es/table/module/export/mixin.js +3 -1
- package/es/table/src/methods.js +147 -48
- package/es/table/src/props.js +1 -1
- package/es/table/src/table.js +12 -12
- package/es/table/src/util.js +0 -4
- package/es/toolbar/src/toolbar.js +2 -2
- package/es/ui/index.js +13 -4
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +49 -26
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +13627 -13483
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/export/mixin.js +5 -1
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/methods.js +158 -49
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +13 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +0 -4
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +2 -0
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +12 -3
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +49 -30
- package/packages/table/module/export/mixin.ts +5 -3
- package/packages/table/src/methods.ts +157 -52
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +12 -14
- package/packages/table/src/util.ts +0 -4
- package/packages/toolbar/src/toolbar.ts +2 -2
- package/packages/ui/index.ts +12 -2
- package/packages/ui/src/dom.ts +1 -1
- package/styles/cssvar.scss +0 -2
- /package/es/{iconfont.1754534807189.ttf → iconfont.1754905462391.ttf} +0 -0
- /package/es/{iconfont.1754534807189.woff → iconfont.1754905462391.woff} +0 -0
- /package/es/{iconfont.1754534807189.woff2 → iconfont.1754905462391.woff2} +0 -0
- /package/lib/{iconfont.1754534807189.ttf → iconfont.1754905462391.ttf} +0 -0
- /package/lib/{iconfont.1754534807189.woff → iconfont.1754905462391.woff} +0 -0
- /package/lib/{iconfont.1754534807189.woff2 → iconfont.1754905462391.woff2} +0 -0
|
@@ -1110,6 +1110,7 @@ export default {
|
|
|
1110
1110
|
const reactData = $xeTable;
|
|
1111
1111
|
const internalData = $xeTable;
|
|
1112
1112
|
const $xeGrid = $xeTable.$xeGrid;
|
|
1113
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
1113
1114
|
const { treeConfig, showHeader, showFooter } = props;
|
|
1114
1115
|
const { isGroup } = reactData;
|
|
1115
1116
|
const { tableFullColumn, afterFullData, afterTreeFullData, collectColumn, mergeBodyList, mergeFooterList } = internalData;
|
|
@@ -1316,6 +1317,7 @@ export default {
|
|
|
1316
1317
|
const params = {
|
|
1317
1318
|
$table: $xeTable,
|
|
1318
1319
|
$grid: $xeGrid,
|
|
1320
|
+
$gantt: $xeGantt,
|
|
1319
1321
|
sort: sortData.length ? sortData[0] : {},
|
|
1320
1322
|
sorts: sortData,
|
|
1321
1323
|
filters: gridReactData.filterData,
|
|
@@ -1325,7 +1327,7 @@ export default {
|
|
|
1325
1327
|
return Promise.resolve((beforeQueryAll || ajaxMethods)(params))
|
|
1326
1328
|
.then(rest => {
|
|
1327
1329
|
const listProp = resConfigs.list;
|
|
1328
|
-
handleOptions.data = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: $xeGrid }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
1330
|
+
handleOptions.data = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
1329
1331
|
if (afterQueryAll) {
|
|
1330
1332
|
afterQueryAll(params);
|
|
1331
1333
|
}
|
package/es/table/src/methods.js
CHANGED
|
@@ -931,14 +931,15 @@ function updateStyle($xeTable) {
|
|
|
931
931
|
const reactData = $xeTable;
|
|
932
932
|
const internalData = $xeTable;
|
|
933
933
|
const { showHeaderOverflow: allColumnHeaderOverflow, showFooterOverflow: allColumnFooterOverflow, mouseConfig, spanMethod, footerSpanMethod } = props;
|
|
934
|
-
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading } = reactData;
|
|
935
|
-
const { visibleColumn, tableHeight,
|
|
934
|
+
const { isGroup, currentRow, tableColumn, scrollXLoad, scrollYLoad, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isAllOverflow, expandColumn, isColLoading, tHeaderHeight, tFooterHeight } = reactData;
|
|
935
|
+
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight } = internalData;
|
|
936
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
936
937
|
const el = $xeTable.$refs.refElem;
|
|
937
|
-
if (!el) {
|
|
938
|
+
if (!el || !el.clientHeight) {
|
|
938
939
|
return;
|
|
939
940
|
}
|
|
940
941
|
const containerList = ['main', 'left', 'right'];
|
|
941
|
-
|
|
942
|
+
let osbWidth = overflowY ? scrollbarWidth : 0;
|
|
942
943
|
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
943
944
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
|
|
944
945
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
@@ -946,36 +947,45 @@ function updateStyle($xeTable) {
|
|
|
946
947
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
947
948
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
948
949
|
if (emptyPlaceholderElem) {
|
|
949
|
-
emptyPlaceholderElem.style.top = `${
|
|
950
|
+
emptyPlaceholderElem.style.top = `${tHeaderHeight}px`;
|
|
950
951
|
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
951
952
|
}
|
|
952
|
-
|
|
953
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
954
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
955
|
+
const xScrollbarVisible = overflowX ? 'visible' : 'hidden';
|
|
956
|
+
let yScrollbarVisible = overflowY ? 'visible' : 'hidden';
|
|
957
|
+
if ($xeGanttView) {
|
|
958
|
+
if (!scrollbarYToLeft) {
|
|
959
|
+
osbWidth = 0;
|
|
960
|
+
yScrollbarVisible = 'hidden';
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
let tbHeight = 0;
|
|
953
964
|
let bodyMaxHeight = 0;
|
|
954
|
-
const bodyMinHeight = customMinHeight -
|
|
965
|
+
const bodyMinHeight = customMinHeight - tHeaderHeight - tFooterHeight - osbHeight;
|
|
955
966
|
if (customMaxHeight) {
|
|
956
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight -
|
|
967
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - tHeaderHeight - tFooterHeight - osbHeight);
|
|
957
968
|
}
|
|
958
969
|
if (customHeight) {
|
|
959
|
-
|
|
970
|
+
tbHeight = customHeight - tHeaderHeight - tFooterHeight - osbHeight;
|
|
960
971
|
}
|
|
961
|
-
if (!
|
|
972
|
+
if (!tbHeight) {
|
|
962
973
|
if (bodyTableElem) {
|
|
963
|
-
|
|
974
|
+
tbHeight = bodyTableElem.clientHeight;
|
|
964
975
|
}
|
|
965
976
|
}
|
|
966
|
-
if (
|
|
977
|
+
if (tbHeight) {
|
|
967
978
|
if (bodyMaxHeight) {
|
|
968
|
-
|
|
979
|
+
tbHeight = Math.min(bodyMaxHeight, tbHeight);
|
|
969
980
|
}
|
|
970
|
-
|
|
981
|
+
tbHeight = Math.max(bodyMinHeight, tbHeight);
|
|
971
982
|
}
|
|
972
|
-
const scrollbarXToTop = $xeTable.$refs.computeScrollbarXToTop;
|
|
973
983
|
const xLeftCornerEl = $xeTable.$refs.refScrollXLeftCornerElem;
|
|
974
984
|
const xRightCornerEl = $xeTable.$refs.refScrollXRightCornerElem;
|
|
975
985
|
const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem;
|
|
976
986
|
if (scrollXVirtualEl) {
|
|
977
987
|
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
978
|
-
scrollXVirtualEl.style.visibility =
|
|
988
|
+
scrollXVirtualEl.style.visibility = xScrollbarVisible;
|
|
979
989
|
}
|
|
980
990
|
const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem;
|
|
981
991
|
if (xWrapperEl) {
|
|
@@ -993,30 +1003,31 @@ function updateStyle($xeTable) {
|
|
|
993
1003
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
|
|
994
1004
|
if (scrollYVirtualEl) {
|
|
995
1005
|
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
996
|
-
scrollYVirtualEl.style.height = `${
|
|
997
|
-
scrollYVirtualEl.style.visibility =
|
|
1006
|
+
scrollYVirtualEl.style.height = `${tbHeight + tHeaderHeight + tFooterHeight}px`;
|
|
1007
|
+
scrollYVirtualEl.style.visibility = yScrollbarVisible;
|
|
998
1008
|
}
|
|
999
1009
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
|
|
1000
1010
|
if (yTopCornerEl) {
|
|
1001
|
-
yTopCornerEl.style.height = `${
|
|
1002
|
-
yTopCornerEl.style.display = overflowY &&
|
|
1011
|
+
yTopCornerEl.style.height = `${tHeaderHeight}px`;
|
|
1012
|
+
yTopCornerEl.style.display = overflowY && tHeaderHeight ? 'block' : '';
|
|
1003
1013
|
}
|
|
1004
1014
|
const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem;
|
|
1005
1015
|
if (yWrapperEl) {
|
|
1006
|
-
yWrapperEl.style.height = `${
|
|
1007
|
-
yWrapperEl.style.top = `${
|
|
1016
|
+
yWrapperEl.style.height = `${tbHeight}px`;
|
|
1017
|
+
yWrapperEl.style.top = `${tHeaderHeight}px`;
|
|
1008
1018
|
}
|
|
1009
1019
|
const yBottomCornerEl = $xeTable.$refs.refScrollYBottomCornerElem;
|
|
1010
1020
|
if (yBottomCornerEl) {
|
|
1011
|
-
yBottomCornerEl.style.height = `${
|
|
1012
|
-
yBottomCornerEl.style.top = `${
|
|
1013
|
-
yBottomCornerEl.style.display = overflowY &&
|
|
1021
|
+
yBottomCornerEl.style.height = `${tFooterHeight}px`;
|
|
1022
|
+
yBottomCornerEl.style.top = `${tHeaderHeight + tbHeight}px`;
|
|
1023
|
+
yBottomCornerEl.style.display = overflowY && tFooterHeight ? 'block' : '';
|
|
1014
1024
|
}
|
|
1015
1025
|
const rowExpandEl = $xeTable.$refs.refRowExpandElem;
|
|
1016
1026
|
if (rowExpandEl) {
|
|
1017
|
-
rowExpandEl.style.height = `${
|
|
1018
|
-
rowExpandEl.style.top = `${
|
|
1027
|
+
rowExpandEl.style.height = `${tbHeight}px`;
|
|
1028
|
+
rowExpandEl.style.top = `${tHeaderHeight}px`;
|
|
1019
1029
|
}
|
|
1030
|
+
reactData.tBodyHeight = tbHeight;
|
|
1020
1031
|
containerList.forEach((name, index) => {
|
|
1021
1032
|
const fixedType = index > 0 ? name : '';
|
|
1022
1033
|
const layoutList = ['header', 'body', 'footer'];
|
|
@@ -1080,7 +1091,7 @@ function updateStyle($xeTable) {
|
|
|
1080
1091
|
}
|
|
1081
1092
|
}
|
|
1082
1093
|
if (currScrollElem) {
|
|
1083
|
-
currScrollElem.style.height = `${
|
|
1094
|
+
currScrollElem.style.height = `${tHeaderHeight}px`;
|
|
1084
1095
|
}
|
|
1085
1096
|
if (tableElem) {
|
|
1086
1097
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
@@ -1089,15 +1100,15 @@ function updateStyle($xeTable) {
|
|
|
1089
1100
|
else if (layout === 'body') {
|
|
1090
1101
|
if (currScrollElem) {
|
|
1091
1102
|
currScrollElem.style.maxHeight = customMaxHeight ? `${bodyMaxHeight}px` : '';
|
|
1092
|
-
currScrollElem.style.height = customHeight ? `${
|
|
1103
|
+
currScrollElem.style.height = customHeight ? `${tbHeight}px` : '';
|
|
1093
1104
|
currScrollElem.style.minHeight = `${bodyMinHeight}px`;
|
|
1094
1105
|
}
|
|
1095
1106
|
// 如果是固定列
|
|
1096
1107
|
if (fixedWrapperElem) {
|
|
1097
1108
|
if (wrapperElem) {
|
|
1098
|
-
wrapperElem.style.top = `${
|
|
1109
|
+
wrapperElem.style.top = `${tHeaderHeight}px`;
|
|
1099
1110
|
}
|
|
1100
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight +
|
|
1111
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : (tableHeight + tHeaderHeight + tFooterHeight + osbHeight)}px`;
|
|
1101
1112
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
1102
1113
|
}
|
|
1103
1114
|
let renderColumnList = tableColumn;
|
|
@@ -1174,11 +1185,11 @@ function updateStyle($xeTable) {
|
|
|
1174
1185
|
}
|
|
1175
1186
|
}
|
|
1176
1187
|
if (currScrollElem) {
|
|
1177
|
-
currScrollElem.style.height = `${
|
|
1188
|
+
currScrollElem.style.height = `${tFooterHeight}px`;
|
|
1178
1189
|
// 如果是固定列
|
|
1179
1190
|
if (fixedWrapperElem) {
|
|
1180
1191
|
if (wrapperElem) {
|
|
1181
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight -
|
|
1192
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - tFooterHeight - osbHeight : tableHeight + tHeaderHeight}px`;
|
|
1182
1193
|
}
|
|
1183
1194
|
}
|
|
1184
1195
|
}
|
|
@@ -1194,6 +1205,9 @@ function updateStyle($xeTable) {
|
|
|
1194
1205
|
if (mouseConfig && mouseOpts.selected && editStore.selected.row && editStore.selected.column) {
|
|
1195
1206
|
$xeTable.addCellSelectedClass();
|
|
1196
1207
|
}
|
|
1208
|
+
if ($xeGanttView) {
|
|
1209
|
+
$xeGanttView.handleUpdateStyle();
|
|
1210
|
+
}
|
|
1197
1211
|
return $xeTable.$nextTick();
|
|
1198
1212
|
}
|
|
1199
1213
|
function checkValidate($xeTable, type) {
|
|
@@ -2249,12 +2263,17 @@ function autoCellWidth($xeTable) {
|
|
|
2249
2263
|
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
2250
2264
|
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
2251
2265
|
let colHeight = rowRest.height;
|
|
2266
|
+
let firstCellStyle = null;
|
|
2267
|
+
let topBottomPadding = 0;
|
|
2252
2268
|
for (let i = 0; i < cellElemList.length; i++) {
|
|
2253
|
-
const
|
|
2254
|
-
const
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2269
|
+
const wrapperElem = cellElemList[i];
|
|
2270
|
+
const cellElem = wrapperElem.parentElement;
|
|
2271
|
+
if (!firstCellStyle) {
|
|
2272
|
+
firstCellStyle = getComputedStyle(cellElem);
|
|
2273
|
+
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
2274
|
+
}
|
|
2275
|
+
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
|
|
2276
|
+
colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
|
|
2258
2277
|
}
|
|
2259
2278
|
return colHeight;
|
|
2260
2279
|
};
|
|
@@ -2651,12 +2670,13 @@ function calcScrollbar($xeTable) {
|
|
|
2651
2670
|
reactData.scrollbarHeight = scrollbarOpts.height || (xHandleEl.offsetHeight - xHandleEl.clientHeight) || 14;
|
|
2652
2671
|
}
|
|
2653
2672
|
reactData.overflowX = overflowX;
|
|
2654
|
-
const
|
|
2655
|
-
const
|
|
2673
|
+
const hHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
2674
|
+
const fHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
2656
2675
|
internalData.tableHeight = bodyWrapperElem.offsetHeight;
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
reactData.
|
|
2676
|
+
reactData.tHeaderHeight = hHeight;
|
|
2677
|
+
reactData.tFooterHeight = fHeight;
|
|
2678
|
+
reactData.overflowX = overflowX;
|
|
2679
|
+
reactData.parentHeight = Math.max(hHeight + fHeight + 20, $xeTable.getParentHeight());
|
|
2660
2680
|
}
|
|
2661
2681
|
if (overflowX) {
|
|
2662
2682
|
$xeTable.checkScrolling();
|
|
@@ -2712,6 +2732,7 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
|
|
|
2712
2732
|
const internalData = $xeTable;
|
|
2713
2733
|
return new Promise(resolve => {
|
|
2714
2734
|
const { rceTimeout, rceRunTime } = internalData;
|
|
2735
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
2715
2736
|
const resizeOpts = $xeTable.computeResizeOpts;
|
|
2716
2737
|
const refreshDelay = resizeOpts.refreshDelay || 20;
|
|
2717
2738
|
const el = $xeTable.$refs.refElem;
|
|
@@ -2733,6 +2754,9 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
|
|
|
2733
2754
|
else {
|
|
2734
2755
|
resolve(handleRecalculateStyle($xeTable, reFull, reWidth, reHeight));
|
|
2735
2756
|
}
|
|
2757
|
+
if ($xeGanttView) {
|
|
2758
|
+
$xeGanttView.handleLazyRecalculate();
|
|
2759
|
+
}
|
|
2736
2760
|
internalData.rceTimeout = setTimeout(() => {
|
|
2737
2761
|
internalData.rceTimeout = undefined;
|
|
2738
2762
|
handleRecalculateStyle($xeTable, reFull, reWidth, reHeight);
|
|
@@ -3510,6 +3534,18 @@ const wheelScrollTopTo = (diffNum, cb) => {
|
|
|
3510
3534
|
};
|
|
3511
3535
|
requestAnimationFrame(step);
|
|
3512
3536
|
};
|
|
3537
|
+
const syncGanttScrollTop = ($xeTable, scrollTop) => {
|
|
3538
|
+
const internalData = $xeTable;
|
|
3539
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
3540
|
+
if ($xeGanttView) {
|
|
3541
|
+
const ganttInternalData = $xeGanttView.internalData;
|
|
3542
|
+
const { elemStore: ganttElemStore } = ganttInternalData;
|
|
3543
|
+
const ganttBodyScrollElem = getRefElem(ganttElemStore['main-body-scroll']);
|
|
3544
|
+
if (ganttBodyScrollElem) {
|
|
3545
|
+
ganttBodyScrollElem.scrollTop = scrollTop;
|
|
3546
|
+
}
|
|
3547
|
+
}
|
|
3548
|
+
};
|
|
3513
3549
|
function updateHeight($xeTable) {
|
|
3514
3550
|
const reactData = $xeTable;
|
|
3515
3551
|
const internalData = $xeTable;
|
|
@@ -3816,6 +3852,7 @@ const Methods = {
|
|
|
3816
3852
|
const internalData = $xeTable;
|
|
3817
3853
|
const { scrollYLoad } = reactData;
|
|
3818
3854
|
const { scrollYStore, fullDataRowIdData } = internalData;
|
|
3855
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
3819
3856
|
let fullList = internalData.afterFullData;
|
|
3820
3857
|
// 是否进行数据处理
|
|
3821
3858
|
if (force) {
|
|
@@ -3836,6 +3873,9 @@ const Methods = {
|
|
|
3836
3873
|
});
|
|
3837
3874
|
reactData.tableData = tableData;
|
|
3838
3875
|
internalData.visibleDataRowIdData = visibleDataRowIdMaps;
|
|
3876
|
+
if ($xeGanttView) {
|
|
3877
|
+
$xeGanttView.updateViewData();
|
|
3878
|
+
}
|
|
3839
3879
|
return $xeTable.$nextTick();
|
|
3840
3880
|
},
|
|
3841
3881
|
/**
|
|
@@ -5569,11 +5609,13 @@ const Methods = {
|
|
|
5569
5609
|
},
|
|
5570
5610
|
handleRowResizeMousedownEvent(evnt, params) {
|
|
5571
5611
|
const $xeTable = this;
|
|
5612
|
+
const props = $xeTable;
|
|
5572
5613
|
const reactData = $xeTable;
|
|
5573
5614
|
const internalData = $xeTable;
|
|
5574
5615
|
evnt.stopPropagation();
|
|
5575
5616
|
evnt.preventDefault();
|
|
5576
5617
|
const { row } = params;
|
|
5618
|
+
const { showOverflow } = props;
|
|
5577
5619
|
const { overflowX, scrollbarWidth, overflowY, scrollbarHeight } = reactData;
|
|
5578
5620
|
const { elemStore, fullAllDataRowIdData } = internalData;
|
|
5579
5621
|
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
@@ -5602,7 +5644,10 @@ const Methods = {
|
|
|
5602
5644
|
return;
|
|
5603
5645
|
}
|
|
5604
5646
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
5605
|
-
|
|
5647
|
+
let currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
5648
|
+
if (!showOverflow) {
|
|
5649
|
+
currCellHeight = tdEl.clientHeight;
|
|
5650
|
+
}
|
|
5606
5651
|
const tableRect = tableEl.getBoundingClientRect();
|
|
5607
5652
|
const trRect = trEl.getBoundingClientRect();
|
|
5608
5653
|
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
|
|
@@ -5766,6 +5811,28 @@ const Methods = {
|
|
|
5766
5811
|
});
|
|
5767
5812
|
return rest;
|
|
5768
5813
|
},
|
|
5814
|
+
recalcRowHeight(rowOrId) {
|
|
5815
|
+
const $xeTable = this;
|
|
5816
|
+
const reactData = $xeTable;
|
|
5817
|
+
const internalData = $xeTable;
|
|
5818
|
+
const { fullAllDataRowIdData } = internalData;
|
|
5819
|
+
const rows = XEUtils.isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
5820
|
+
const el = $xeTable.$refs.refElem;
|
|
5821
|
+
if (el) {
|
|
5822
|
+
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
5823
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
5824
|
+
rows.forEach(row => {
|
|
5825
|
+
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
5826
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
5827
|
+
if (rowRest) {
|
|
5828
|
+
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
5829
|
+
}
|
|
5830
|
+
el.removeAttribute('data-calc-row');
|
|
5831
|
+
});
|
|
5832
|
+
reactData.calcCellHeightFlag++;
|
|
5833
|
+
}
|
|
5834
|
+
return $xeTable.$nextTick();
|
|
5835
|
+
},
|
|
5769
5836
|
setRowHeight(rowOrId, height) {
|
|
5770
5837
|
const $xeTable = this;
|
|
5771
5838
|
const reactData = $xeTable;
|
|
@@ -9934,6 +10001,7 @@ const Methods = {
|
|
|
9934
10001
|
}
|
|
9935
10002
|
setScrollTop(yHandleEl, scrollTop);
|
|
9936
10003
|
setScrollTop(rowExpandEl, scrollTop);
|
|
10004
|
+
syncGanttScrollTop($xeTable, scrollTop);
|
|
9937
10005
|
if (scrollYLoad) {
|
|
9938
10006
|
$xeTable.triggerScrollYEvent(evnt);
|
|
9939
10007
|
}
|
|
@@ -10130,6 +10198,7 @@ const Methods = {
|
|
|
10130
10198
|
setScrollTop(leftScrollElem, currTopNum);
|
|
10131
10199
|
setScrollTop(rightScrollElem, currTopNum);
|
|
10132
10200
|
setScrollTop(rowExpandEl, currTopNum);
|
|
10201
|
+
syncGanttScrollTop($xeTable, currTopNum);
|
|
10133
10202
|
if (scrollYLoad) {
|
|
10134
10203
|
$xeTable.triggerScrollYEvent(evnt);
|
|
10135
10204
|
}
|
|
@@ -10147,6 +10216,7 @@ const Methods = {
|
|
|
10147
10216
|
setScrollTop(leftScrollElem, currTopNum);
|
|
10148
10217
|
setScrollTop(rightScrollElem, currTopNum);
|
|
10149
10218
|
setScrollTop(rowExpandEl, currTopNum);
|
|
10219
|
+
syncGanttScrollTop($xeTable, currTopNum);
|
|
10150
10220
|
if (scrollYLoad) {
|
|
10151
10221
|
$xeTable.triggerScrollYEvent(evnt);
|
|
10152
10222
|
}
|
|
@@ -10226,6 +10296,7 @@ const Methods = {
|
|
|
10226
10296
|
setScrollTop(leftScrollElem, scrollTop);
|
|
10227
10297
|
setScrollTop(rightScrollElem, scrollTop);
|
|
10228
10298
|
setScrollTop(rowExpandEl, scrollTop);
|
|
10299
|
+
syncGanttScrollTop($xeTable, scrollTop);
|
|
10229
10300
|
if (scrollYLoad) {
|
|
10230
10301
|
$xeTable.triggerScrollYEvent(evnt);
|
|
10231
10302
|
}
|
|
@@ -10255,6 +10326,7 @@ const Methods = {
|
|
|
10255
10326
|
const internalData = $xeTable;
|
|
10256
10327
|
const { scrollXLoad, overflowX, scrollXWidth } = reactData;
|
|
10257
10328
|
const { visibleColumn, scrollXStore, elemStore, fullColumnIdData } = internalData;
|
|
10329
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
10258
10330
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
10259
10331
|
const tableBody = $xeTable.$refs.refTableBody;
|
|
10260
10332
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
@@ -10316,10 +10388,13 @@ const Methods = {
|
|
|
10316
10388
|
if (scrollXSpaceEl) {
|
|
10317
10389
|
scrollXSpaceEl.style.width = `${ySpaceWidth}px`;
|
|
10318
10390
|
}
|
|
10391
|
+
calcScrollbar($xeTable);
|
|
10319
10392
|
if (isScrollXBig && mouseOpts.area) {
|
|
10320
10393
|
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
10321
10394
|
}
|
|
10322
|
-
|
|
10395
|
+
if ($xeGanttView) {
|
|
10396
|
+
$xeGanttView.updateScrollXSpace();
|
|
10397
|
+
}
|
|
10323
10398
|
return $xeTable.$nextTick(() => {
|
|
10324
10399
|
updateStyle($xeTable);
|
|
10325
10400
|
});
|
|
@@ -10341,6 +10416,7 @@ const Methods = {
|
|
|
10341
10416
|
const internalData = $xeTable;
|
|
10342
10417
|
const { isAllOverflow, scrollYLoad, expandColumn } = reactData;
|
|
10343
10418
|
const { scrollYStore, elemStore, isResizeCellHeight, afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData;
|
|
10419
|
+
const $xeGanttView = internalData.xeGanttView;
|
|
10344
10420
|
const { startIndex } = scrollYStore;
|
|
10345
10421
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
10346
10422
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
@@ -10433,10 +10509,13 @@ const Methods = {
|
|
|
10433
10509
|
reactData.scrollYTop = scrollYTop;
|
|
10434
10510
|
reactData.scrollYHeight = scrollYHeight;
|
|
10435
10511
|
reactData.isScrollYBig = isScrollYBig;
|
|
10512
|
+
calcScrollbar($xeTable);
|
|
10436
10513
|
if (isScrollYBig && mouseOpts.area) {
|
|
10437
10514
|
errLog('vxe.error.notProp', ['mouse-config.area']);
|
|
10438
10515
|
}
|
|
10439
|
-
|
|
10516
|
+
if ($xeGanttView) {
|
|
10517
|
+
$xeGanttView.updateScrollYSpace();
|
|
10518
|
+
}
|
|
10440
10519
|
return $xeTable.$nextTick().then(() => {
|
|
10441
10520
|
updateStyle($xeTable);
|
|
10442
10521
|
});
|
|
@@ -10792,10 +10871,21 @@ const Methods = {
|
|
|
10792
10871
|
this.isActivated = false;
|
|
10793
10872
|
return this.$nextTick();
|
|
10794
10873
|
},
|
|
10795
|
-
|
|
10874
|
+
/**
|
|
10875
|
+
* 已废弃,被 connectToolbar 替换
|
|
10876
|
+
* @deprecated
|
|
10877
|
+
*/
|
|
10796
10878
|
connect($toolbar) {
|
|
10879
|
+
return this.connectToolbar($toolbar);
|
|
10880
|
+
},
|
|
10881
|
+
/**
|
|
10882
|
+
* 连接工具栏
|
|
10883
|
+
* @param $toolbar
|
|
10884
|
+
*/
|
|
10885
|
+
connectToolbar($toolbar) {
|
|
10886
|
+
const $xeTable = this;
|
|
10797
10887
|
if ($toolbar && $toolbar.syncUpdate) {
|
|
10798
|
-
$toolbar.syncUpdate({ collectColumn: this.collectColumn, $table:
|
|
10888
|
+
$toolbar.syncUpdate({ collectColumn: this.collectColumn, $table: $xeTable });
|
|
10799
10889
|
this.$toolbar = $toolbar;
|
|
10800
10890
|
}
|
|
10801
10891
|
else {
|
|
@@ -10803,6 +10893,15 @@ const Methods = {
|
|
|
10803
10893
|
}
|
|
10804
10894
|
return this.$nextTick();
|
|
10805
10895
|
},
|
|
10896
|
+
handleConnectGanttView($ganttView) {
|
|
10897
|
+
const $xeTable = this;
|
|
10898
|
+
const internalData = $xeTable;
|
|
10899
|
+
if ($ganttView && $ganttView.connectUpdate) {
|
|
10900
|
+
$ganttView.connectUpdate({ $table: $xeTable });
|
|
10901
|
+
internalData.xeGanttView = $ganttView;
|
|
10902
|
+
}
|
|
10903
|
+
return $xeTable.$nextTick();
|
|
10904
|
+
},
|
|
10806
10905
|
/*************************
|
|
10807
10906
|
* Publish methods
|
|
10808
10907
|
*************************/
|
package/es/table/src/props.js
CHANGED
package/es/table/src/table.js
CHANGED
|
@@ -7,7 +7,7 @@ import methods from './methods';
|
|
|
7
7
|
import TableBodyComponent from './body';
|
|
8
8
|
import TableHeaderComponent from './header';
|
|
9
9
|
import TableFooterComponent from './footer';
|
|
10
|
-
import tableProps from './props';
|
|
10
|
+
import { tableProps } from './props';
|
|
11
11
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
12
12
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
13
13
|
import TableCustomPanelComponent from '../module/custom/panel';
|
|
@@ -489,6 +489,12 @@ export default {
|
|
|
489
489
|
scrollbarHeight: 0,
|
|
490
490
|
// 行高
|
|
491
491
|
rowHeight: 0,
|
|
492
|
+
// 表头高度
|
|
493
|
+
tHeaderHeight: 0,
|
|
494
|
+
// 表体高度
|
|
495
|
+
tBodyHeight: 0,
|
|
496
|
+
// 表尾高度
|
|
497
|
+
tFooterHeight: 0,
|
|
492
498
|
// 表格父容器的高度
|
|
493
499
|
parentHeight: 0,
|
|
494
500
|
// 是否使用分组表头
|
|
@@ -1313,25 +1319,19 @@ export default {
|
|
|
1313
1319
|
this.$nextTick().then(() => this.refreshColumn());
|
|
1314
1320
|
},
|
|
1315
1321
|
computeSize() {
|
|
1316
|
-
this.
|
|
1322
|
+
this.reLayoutFlag++;
|
|
1317
1323
|
},
|
|
1318
1324
|
showHeader() {
|
|
1319
|
-
this.
|
|
1325
|
+
this.reLayoutFlag++;
|
|
1320
1326
|
},
|
|
1321
1327
|
showFooter() {
|
|
1322
|
-
this.
|
|
1328
|
+
this.reLayoutFlag++;
|
|
1323
1329
|
},
|
|
1324
1330
|
overflowX() {
|
|
1325
|
-
this.
|
|
1331
|
+
this.reLayoutFlag++;
|
|
1326
1332
|
},
|
|
1327
1333
|
overflowY() {
|
|
1328
|
-
this.
|
|
1329
|
-
},
|
|
1330
|
-
reScrollFlag() {
|
|
1331
|
-
const $xeTable = this;
|
|
1332
|
-
$xeTable.$nextTick(() => {
|
|
1333
|
-
$xeTable.recalculate(true).then(() => $xeTable.refreshScroll());
|
|
1334
|
-
});
|
|
1334
|
+
this.reLayoutFlag++;
|
|
1335
1335
|
},
|
|
1336
1336
|
height() {
|
|
1337
1337
|
this.reLayoutFlag++;
|
package/es/table/src/util.js
CHANGED
|
@@ -332,7 +332,7 @@ export default {
|
|
|
332
332
|
}
|
|
333
333
|
else {
|
|
334
334
|
const gCommandOpts = commands.get(code);
|
|
335
|
-
const params = { code, button: item, $table: $table, $grid: $xeGrid, $event };
|
|
335
|
+
const params = { code, button: item, $table: $table, $grid: $xeGrid, $gantt: null, $event };
|
|
336
336
|
if (gCommandOpts) {
|
|
337
337
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
338
338
|
if (tCommandMethod) {
|
|
@@ -362,7 +362,7 @@ export default {
|
|
|
362
362
|
}
|
|
363
363
|
else {
|
|
364
364
|
const gCommandOpts = commands.get(code);
|
|
365
|
-
const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $event };
|
|
365
|
+
const params = { code, button: null, tool: item, $table: $table, $grid: $xeGrid, $gantt: null, $event };
|
|
366
366
|
if (gCommandOpts) {
|
|
367
367
|
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
368
368
|
if (tCommandMethod) {
|
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.17.
|
|
3
|
+
export const version = "3.17.8";
|
|
4
4
|
VxeUI.version = version;
|
|
5
5
|
VxeUI.tableVersion = version;
|
|
6
6
|
VxeUI.setConfig({
|
|
@@ -227,8 +227,16 @@ VxeUI.setConfig({
|
|
|
227
227
|
oSize: 0
|
|
228
228
|
},
|
|
229
229
|
scrollbarConfig: {
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
// width: 14,
|
|
231
|
+
// height: 14,
|
|
232
|
+
x: {
|
|
233
|
+
// position: 'bottom',
|
|
234
|
+
visible: true
|
|
235
|
+
},
|
|
236
|
+
y: {
|
|
237
|
+
// position: 'right',
|
|
238
|
+
visible: true
|
|
239
|
+
}
|
|
232
240
|
}
|
|
233
241
|
},
|
|
234
242
|
// export: {
|
|
@@ -281,7 +289,8 @@ VxeUI.setConfig({
|
|
|
281
289
|
// types: ['csv', 'html', 'xml', 'txt']
|
|
282
290
|
// },
|
|
283
291
|
// buttons: []
|
|
284
|
-
}
|
|
292
|
+
},
|
|
293
|
+
gantt: {}
|
|
285
294
|
});
|
|
286
295
|
const iconPrefix = 'vxe-table-icon-';
|
|
287
296
|
VxeUI.setIcon({
|
package/es/ui/src/log.js
CHANGED