vxe-table 4.14.0-beta.0 → 4.14.0-beta.10
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.en.md +1 -70
- package/README.ja-JP.md +1 -70
- package/README.md +9 -18
- package/README.zh-TW.md +1 -69
- package/es/grid/src/grid.js +129 -96
- package/es/index.css +1 -1
- package/es/index.esm.js +2 -2
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +4 -1
- package/es/locale/lang/de-DE.js +4 -1
- package/es/locale/lang/en-US.js +4 -1
- package/es/locale/lang/es-ES.js +4 -1
- package/es/locale/lang/fr-FR.js +4 -1
- package/es/locale/lang/hu-HU.js +4 -1
- package/es/locale/lang/hy-AM.js +4 -1
- package/es/locale/lang/id-ID.js +4 -1
- package/es/locale/lang/it-IT.js +4 -1
- package/es/locale/lang/ja-JP.js +4 -1
- package/es/locale/lang/ko-KR.js +4 -1
- package/es/locale/lang/ms-MY.js +4 -1
- package/es/locale/lang/nb-NO.js +4 -1
- package/es/locale/lang/pt-BR.js +4 -1
- package/es/locale/lang/ru-RU.js +4 -1
- package/es/locale/lang/th-TH.js +4 -1
- package/es/locale/lang/ug-CN.js +4 -1
- package/es/locale/lang/uk-UA.js +4 -1
- package/es/locale/lang/uz-UZ.js +4 -1
- package/es/locale/lang/vi-VN.js +4 -1
- package/es/locale/lang/zh-CHT.js +4 -1
- package/es/locale/lang/zh-CN.js +4 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/hook.js +0 -4
- package/es/table/module/custom/panel.js +0 -1
- package/es/table/module/edit/hook.js +31 -1
- package/es/table/module/filter/hook.js +1 -1
- package/es/table/module/keyboard/hook.js +2 -2
- package/es/table/src/anime.js +46 -0
- package/es/table/src/body.js +13 -27
- package/es/table/src/cell.js +1 -1
- package/es/table/src/columnInfo.js +5 -0
- package/es/table/src/footer.js +8 -25
- package/es/table/src/header.js +5 -22
- package/es/table/src/table.js +610 -382
- package/es/table/src/util.js +6 -2
- package/es/table/style.css +8 -8
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +8 -2
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +8 -8
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +145 -100
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.common.js +5 -5
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +325 -234
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +4 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +4 -1
- package/lib/locale/lang/de-DE.js +4 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +4 -1
- package/lib/locale/lang/en-US.js +4 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -1
- package/lib/locale/lang/es-ES.js +4 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +4 -1
- package/lib/locale/lang/fr-FR.js +4 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +4 -1
- package/lib/locale/lang/hu-HU.js +4 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +4 -1
- package/lib/locale/lang/hy-AM.js +4 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +4 -1
- package/lib/locale/lang/id-ID.js +4 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +4 -1
- package/lib/locale/lang/it-IT.js +4 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +4 -1
- package/lib/locale/lang/ja-JP.js +4 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +4 -1
- package/lib/locale/lang/ko-KR.js +4 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +4 -1
- package/lib/locale/lang/ms-MY.js +4 -1
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +4 -1
- package/lib/locale/lang/nb-NO.js +4 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +4 -1
- package/lib/locale/lang/pt-BR.js +4 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +4 -1
- package/lib/locale/lang/ru-RU.js +4 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -1
- package/lib/locale/lang/th-TH.js +4 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +4 -1
- package/lib/locale/lang/ug-CN.js +4 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +4 -1
- package/lib/locale/lang/uk-UA.js +4 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +4 -1
- package/lib/locale/lang/uz-UZ.js +4 -1
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +4 -1
- package/lib/locale/lang/vi-VN.js +4 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +4 -1
- package/lib/locale/lang/zh-CHT.js +4 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +4 -1
- package/lib/locale/lang/zh-CN.js +4 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +4 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/hook.js +0 -4
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +0 -1
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/hook.js +30 -1
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/filter/hook.js +1 -1
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +2 -2
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/anime.js +56 -0
- package/lib/table/src/anime.min.js +1 -0
- package/lib/table/src/body.js +6 -29
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +1 -1
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +5 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +6 -23
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +3 -20
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +57 -46
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +11 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +8 -8
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +8 -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/lib/vxe-table/style/style.css +8 -8
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +138 -103
- package/packages/index.ts +2 -2
- package/packages/locale/lang/ar-EG.ts +4 -1
- package/packages/locale/lang/de-DE.ts +4 -1
- package/packages/locale/lang/en-US.ts +4 -1
- package/packages/locale/lang/es-ES.ts +4 -1
- package/packages/locale/lang/fr-FR.ts +4 -1
- package/packages/locale/lang/hu-HU.ts +4 -1
- package/packages/locale/lang/hy-AM.ts +4 -1
- package/packages/locale/lang/id-ID.ts +4 -1
- package/packages/locale/lang/it-IT.ts +4 -1
- package/packages/locale/lang/ja-JP.ts +4 -1
- package/packages/locale/lang/ko-KR.ts +4 -1
- package/packages/locale/lang/ms-MY.ts +4 -1
- package/packages/locale/lang/nb-NO.ts +4 -1
- package/packages/locale/lang/pt-BR.ts +4 -1
- package/packages/locale/lang/ru-RU.ts +4 -1
- package/packages/locale/lang/th-TH.ts +4 -1
- package/packages/locale/lang/ug-CN.ts +4 -1
- package/packages/locale/lang/uk-UA.ts +4 -1
- package/packages/locale/lang/uz-UZ.ts +4 -1
- package/packages/locale/lang/vi-VN.ts +4 -1
- package/packages/locale/lang/zh-CHT.ts +4 -1
- package/packages/locale/lang/zh-CN.ts +4 -1
- package/packages/table/module/custom/hook.ts +0 -4
- package/packages/table/module/custom/panel.ts +0 -1
- package/packages/table/module/edit/hook.ts +29 -1
- package/packages/table/module/filter/hook.ts +1 -1
- package/packages/table/module/keyboard/hook.ts +2 -2
- package/packages/table/src/anime.ts +52 -0
- package/packages/table/src/body.ts +20 -41
- package/packages/table/src/cell.ts +1 -1
- package/packages/table/src/columnInfo.ts +5 -0
- package/packages/table/src/footer.ts +8 -25
- package/packages/table/src/header.ts +5 -22
- package/packages/table/src/table.ts +621 -385
- package/packages/table/src/util.ts +6 -2
- package/packages/ui/index.ts +7 -1
- package/styles/components/table.scss +9 -9
- package/types/all.d.ts +3 -18
- /package/es/{iconfont.1750770364548.ttf → iconfont.1751970630744.ttf} +0 -0
- /package/es/{iconfont.1750770364548.woff → iconfont.1751970630744.woff} +0 -0
- /package/es/{iconfont.1750770364548.woff2 → iconfont.1751970630744.woff2} +0 -0
- /package/lib/{iconfont.1750770364548.ttf → iconfont.1751970630744.ttf} +0 -0
- /package/lib/{iconfont.1750770364548.woff → iconfont.1751970630744.woff} +0 -0
- /package/lib/{iconfont.1750770364548.woff2 → iconfont.1751970630744.woff2} +0 -0
|
@@ -93,8 +93,11 @@ hooks.add('tableEditModule', {
|
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
|
+
// const insertGroupRow = (newRecords: any[], isAppend: boolean) => {
|
|
97
|
+
// }
|
|
96
98
|
const handleInsertRowAt = (records, targetRow, isInsertNextRow) => {
|
|
97
99
|
const { treeConfig } = props;
|
|
100
|
+
const { isRowGroupStatus } = reactData;
|
|
98
101
|
const { tableFullTreeData, afterFullData, mergeBodyList, tableFullData, fullDataRowIdData, fullAllDataRowIdData, insertRowMaps } = internalData;
|
|
99
102
|
const treeOpts = computeTreeOpts.value;
|
|
100
103
|
const { transform, rowField, mapChildrenField } = treeOpts;
|
|
@@ -108,6 +111,14 @@ hooks.add('tableEditModule', {
|
|
|
108
111
|
if (treeConfig && transform) {
|
|
109
112
|
insertTreeRow(newRecords, false);
|
|
110
113
|
}
|
|
114
|
+
else if (isRowGroupStatus) {
|
|
115
|
+
// 如果分组
|
|
116
|
+
if (treeConfig) {
|
|
117
|
+
throw new Error(getI18n('vxe.error.noTree', ['insert']));
|
|
118
|
+
}
|
|
119
|
+
warnLog(getI18n('vxe.error.noGroup', ['remove']));
|
|
120
|
+
// insertGroupRow(newRecords, false)
|
|
121
|
+
}
|
|
111
122
|
else {
|
|
112
123
|
newRecords.forEach(item => {
|
|
113
124
|
const rowid = getRowid($xeTable, item);
|
|
@@ -132,6 +143,14 @@ hooks.add('tableEditModule', {
|
|
|
132
143
|
if (treeConfig && transform) {
|
|
133
144
|
insertTreeRow(newRecords, true);
|
|
134
145
|
}
|
|
146
|
+
else if (isRowGroupStatus) {
|
|
147
|
+
// 如果分组
|
|
148
|
+
if (treeConfig) {
|
|
149
|
+
throw new Error(getI18n('vxe.error.noTree', ['insert']));
|
|
150
|
+
}
|
|
151
|
+
warnLog(getI18n('vxe.error.noGroup', ['remove']));
|
|
152
|
+
// insertGroupRow(newRecords, true)
|
|
153
|
+
}
|
|
135
154
|
else {
|
|
136
155
|
newRecords.forEach(item => {
|
|
137
156
|
const rowid = getRowid($xeTable, item);
|
|
@@ -196,6 +215,13 @@ hooks.add('tableEditModule', {
|
|
|
196
215
|
insertTreeRow(newRecords, true);
|
|
197
216
|
}
|
|
198
217
|
}
|
|
218
|
+
else if (isRowGroupStatus) {
|
|
219
|
+
// 如果分组
|
|
220
|
+
if (treeConfig) {
|
|
221
|
+
throw new Error(getI18n('vxe.error.noTree', ['insert']));
|
|
222
|
+
}
|
|
223
|
+
warnLog(getI18n('vxe.error.noGroup', ['remove']));
|
|
224
|
+
}
|
|
199
225
|
else {
|
|
200
226
|
if (treeConfig) {
|
|
201
227
|
throw new Error(getI18n('vxe.error.noTree', ['insert']));
|
|
@@ -481,7 +507,7 @@ hooks.add('tableEditModule', {
|
|
|
481
507
|
*/
|
|
482
508
|
remove(rows) {
|
|
483
509
|
const { treeConfig } = props;
|
|
484
|
-
const { editStore } = reactData;
|
|
510
|
+
const { editStore, isRowGroupStatus } = reactData;
|
|
485
511
|
const { tableFullTreeData, selectCheckboxMaps, afterFullData, mergeBodyList, tableFullData, pendingRowMaps, insertRowMaps, removeRowMaps } = internalData;
|
|
486
512
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
487
513
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -540,6 +566,10 @@ hooks.add('tableEditModule', {
|
|
|
540
566
|
}
|
|
541
567
|
});
|
|
542
568
|
}
|
|
569
|
+
else if (isRowGroupStatus) {
|
|
570
|
+
// 如果分组
|
|
571
|
+
warnLog(getI18n('vxe.error.noGroup', ['remove']));
|
|
572
|
+
}
|
|
543
573
|
else {
|
|
544
574
|
rows.forEach((row) => {
|
|
545
575
|
const tfIndex = $xeTable.findRowIndexOf(tableFullData, row);
|
|
@@ -5,7 +5,7 @@ import { toFilters, handleFieldOrColumn, getRefElem } from '../../src/util';
|
|
|
5
5
|
import { toCssUnit, triggerEvent, getDomNode } from '../../../ui/src/dom';
|
|
6
6
|
import { isEnableConf } from '../../../ui/src/utils';
|
|
7
7
|
const { renderer, hooks } = VxeUI;
|
|
8
|
-
const tableFilterMethodKeys = ['openFilter', 'setFilter', 'clearFilter', 'saveFilterPanel', 'resetFilterPanel', 'getCheckedFilters', 'updateFilterOptionStatus'];
|
|
8
|
+
const tableFilterMethodKeys = ['openFilter', 'setFilter', 'clearFilter', 'saveFilterPanel', 'saveFilterPanelByEvent', 'resetFilterPanel', 'resetFilterPanelByEvent', 'getCheckedFilters', 'updateFilterOptionStatus'];
|
|
9
9
|
hooks.add('tableFilterModule', {
|
|
10
10
|
setupTable($xeTable) {
|
|
11
11
|
const { props, reactData, internalData } = $xeTable;
|
|
@@ -272,8 +272,8 @@ hooks.add('tableKeyboardModule', {
|
|
|
272
272
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
273
273
|
const mouseOpts = computeMouseOpts.value;
|
|
274
274
|
const editOpts = computeEditOpts.value;
|
|
275
|
-
if (mouseConfig && mouseOpts.area && $xeTable.
|
|
276
|
-
return $xeTable.
|
|
275
|
+
if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaMousednEvent) {
|
|
276
|
+
return $xeTable.triggerCellAreaMousednEvent(evnt, params);
|
|
277
277
|
}
|
|
278
278
|
else {
|
|
279
279
|
if (checkboxConfig && checkboxOpts.range) {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import XEUtils from 'xe-utils';
|
|
2
|
+
import { addClass, removeClass } from '../../ui/src/dom';
|
|
3
|
+
const rowMoveCls = 'row--drag-move';
|
|
4
|
+
const colMoveClass = 'col--drag-move';
|
|
5
|
+
/**
|
|
6
|
+
* 上下拖拽
|
|
7
|
+
*/
|
|
8
|
+
export function moveRowAnimateToTb(elemList, offsetTop) {
|
|
9
|
+
XEUtils.arrayEach(elemList, trEl => {
|
|
10
|
+
trEl.style.transform = `translateY(${offsetTop}px)`;
|
|
11
|
+
});
|
|
12
|
+
requestAnimationFrame(() => {
|
|
13
|
+
XEUtils.arrayEach(elemList, trEl => {
|
|
14
|
+
addClass(trEl, rowMoveCls);
|
|
15
|
+
trEl.style.transform = '';
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export function clearRowAnimate(elem) {
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
if (elem) {
|
|
22
|
+
XEUtils.arrayEach(elem.querySelectorAll(`.vxe-body--row.${rowMoveCls}`), elem => removeClass(elem, rowMoveCls));
|
|
23
|
+
}
|
|
24
|
+
}, 500);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 左右拖拽
|
|
28
|
+
*/
|
|
29
|
+
export function moveColAnimateToLr(elemList, offsetLeft) {
|
|
30
|
+
XEUtils.arrayEach(elemList, trEl => {
|
|
31
|
+
trEl.style.transform = `translateX(${offsetLeft}px)`;
|
|
32
|
+
});
|
|
33
|
+
requestAnimationFrame(() => {
|
|
34
|
+
XEUtils.arrayEach(elemList, trEl => {
|
|
35
|
+
addClass(trEl, colMoveClass);
|
|
36
|
+
trEl.style.transform = '';
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export function clearColAnimate(elem) {
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
if (elem) {
|
|
43
|
+
XEUtils.arrayEach(elem.querySelectorAll(`.vxe-table--column.${colMoveClass}`), elem => removeClass(elem, colMoveClass));
|
|
44
|
+
}
|
|
45
|
+
}, 500);
|
|
46
|
+
}
|
package/es/table/src/body.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, ref, inject, nextTick, onMounted, onUnmounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
@@ -22,7 +22,7 @@ export default defineVxeComponent({
|
|
|
22
22
|
setup(props) {
|
|
23
23
|
const $xeTable = inject('$xeTable', {});
|
|
24
24
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
25
|
-
const { computeEditOpts, computeMouseOpts, computeCellOffsetWidth, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts,
|
|
25
|
+
const { computeEditOpts, computeMouseOpts, computeCellOffsetWidth, computeAreaOpts, computeDefaultRowHeight, computeEmptyOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeCellOpts, computeValidOpts, computeRowOpts, computeColumnOpts, computeRowDragOpts, computeResizableOpts, computeVirtualXOpts, computeVirtualYOpts } = $xeTable.getComputeMaps();
|
|
26
26
|
const refElem = ref();
|
|
27
27
|
const refBodyScroll = ref();
|
|
28
28
|
const refBodyTable = ref();
|
|
@@ -38,7 +38,7 @@ export default defineVxeComponent({
|
|
|
38
38
|
return !!(isDragResize || (lastScrollTime && Date.now() < lastScrollTime + delayHover));
|
|
39
39
|
};
|
|
40
40
|
const renderLine = (rowid, params, cellHeight) => {
|
|
41
|
-
const {
|
|
41
|
+
const { column } = params;
|
|
42
42
|
const { afterFullData } = tableInternalData;
|
|
43
43
|
const { treeConfig } = tableProps;
|
|
44
44
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -63,7 +63,7 @@ export default defineVxeComponent({
|
|
|
63
63
|
h('div', {
|
|
64
64
|
class: 'vxe-tree--line',
|
|
65
65
|
style: {
|
|
66
|
-
height: `${$xeTable
|
|
66
|
+
height: `${getRowid($xeTable, afterFullData[0]) === rowid ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
67
67
|
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
68
68
|
left: `${(rLevel * treeOpts.indent) + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
69
69
|
}
|
|
@@ -301,6 +301,7 @@ export default defineVxeComponent({
|
|
|
301
301
|
else {
|
|
302
302
|
tcStyle.minHeight = `${cellHeight}px`;
|
|
303
303
|
}
|
|
304
|
+
// console.log(lastScrollTime)
|
|
304
305
|
const tdVNs = [];
|
|
305
306
|
if (fixedHiddenColumn && isAllOverflow) {
|
|
306
307
|
tdVNs.push(h('div', {
|
|
@@ -333,7 +334,7 @@ export default defineVxeComponent({
|
|
|
333
334
|
h('div', {
|
|
334
335
|
colid,
|
|
335
336
|
rowid,
|
|
336
|
-
class: 'vxe-cell--wrapper'
|
|
337
|
+
class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
|
|
337
338
|
}, column.renderCell(cellParams))
|
|
338
339
|
]));
|
|
339
340
|
if (showValidTip && errorValidItem) {
|
|
@@ -389,7 +390,7 @@ export default defineVxeComponent({
|
|
|
389
390
|
}));
|
|
390
391
|
}
|
|
391
392
|
return h('td', Object.assign(Object.assign(Object.assign({ class: [
|
|
392
|
-
'vxe-body--column',
|
|
393
|
+
'vxe-table--column vxe-body--column',
|
|
393
394
|
colid,
|
|
394
395
|
cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '',
|
|
395
396
|
cellAlign ? `col--${cellAlign}` : '',
|
|
@@ -422,7 +423,7 @@ export default defineVxeComponent({
|
|
|
422
423
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
423
424
|
const $xeGrid = $xeTable.xeGrid;
|
|
424
425
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
425
|
-
const { hasFixedColumn, treeExpandedFlag,
|
|
426
|
+
const { hasFixedColumn, treeExpandedFlag, scrollXLoad, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData;
|
|
426
427
|
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData;
|
|
427
428
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
428
429
|
const radioOpts = computeRadioOpts.value;
|
|
@@ -430,7 +431,6 @@ export default defineVxeComponent({
|
|
|
430
431
|
const editOpts = computeEditOpts.value;
|
|
431
432
|
const rowOpts = computeRowOpts.value;
|
|
432
433
|
const columnOpts = computeColumnOpts.value;
|
|
433
|
-
const columnDragOpts = computeColumnDragOpts.value;
|
|
434
434
|
const { transform, seqMode } = treeOpts;
|
|
435
435
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
436
436
|
const rows = [];
|
|
@@ -510,11 +510,7 @@ export default defineVxeComponent({
|
|
|
510
510
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
511
511
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
512
512
|
});
|
|
513
|
-
rows.push(
|
|
514
|
-
? h(TransitionGroup, Object.assign({ name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`, tag: 'tr', class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex }, trOn), {
|
|
515
|
-
default: () => tdVNs
|
|
516
|
-
})
|
|
517
|
-
: h('tr', Object.assign({ class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex }, trOn), tdVNs));
|
|
513
|
+
rows.push(h('tr', Object.assign({ class: trClass, rowid: rowid, style: rowStyle ? (XEUtils.isFunction(rowStyle) ? rowStyle(params) : rowStyle) : null, key: rowKey || scrollXLoad || scrollYLoad || rowOpts.useKey || rowOpts.drag || columnOpts.drag || isRowGroupStatus || treeConfig ? rowid : $rowIndex }, trOn), tdVNs));
|
|
518
514
|
// 如果行被展开了
|
|
519
515
|
if (isExpandRow) {
|
|
520
516
|
const expandOpts = computeExpandOpts.value;
|
|
@@ -641,12 +637,10 @@ export default defineVxeComponent({
|
|
|
641
637
|
const $xeGrid = $xeTable.xeGrid;
|
|
642
638
|
const { fixedColumn, fixedType, tableColumn } = props;
|
|
643
639
|
const { spanMethod, footerSpanMethod, mouseConfig } = tableProps;
|
|
644
|
-
const { isGroup, tableData,
|
|
640
|
+
const { isGroup, tableData, isColLoading, overflowX, scrollXLoad, scrollYLoad, isAllOverflow, expandColumn, dragRow, dragCol } = tableReactData;
|
|
645
641
|
const { visibleColumn, fullAllDataRowIdData, fullColumnIdData } = tableInternalData;
|
|
646
|
-
const rowOpts = computeRowOpts.value;
|
|
647
642
|
const emptyOpts = computeEmptyOpts.value;
|
|
648
643
|
const mouseOpts = computeMouseOpts.value;
|
|
649
|
-
const rowDragOpts = computeRowDragOpts.value;
|
|
650
644
|
const expandOpts = computeExpandOpts.value;
|
|
651
645
|
let renderDataList = tableData;
|
|
652
646
|
let renderColumnList = tableColumn;
|
|
@@ -779,17 +773,9 @@ export default defineVxeComponent({
|
|
|
779
773
|
/**
|
|
780
774
|
* 内容
|
|
781
775
|
*/
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
786
|
-
tag: 'tbody'
|
|
787
|
-
}, {
|
|
788
|
-
default: () => renderRows(fixedType, isOptimizeMode, renderDataList, renderColumnList)
|
|
789
|
-
})
|
|
790
|
-
: h('tbody', {
|
|
791
|
-
ref: refBodyTBody
|
|
792
|
-
}, renderRows(fixedType, isOptimizeMode, renderDataList, renderColumnList))
|
|
776
|
+
h('tbody', {
|
|
777
|
+
ref: refBodyTBody
|
|
778
|
+
}, renderRows(fixedType, isOptimizeMode, renderDataList, renderColumnList))
|
|
793
779
|
]),
|
|
794
780
|
h('div', {
|
|
795
781
|
class: 'vxe-table--checkbox-range'
|
package/es/table/src/cell.js
CHANGED
|
@@ -167,7 +167,7 @@ function renderTitleContent(params, content) {
|
|
|
167
167
|
const { showHeaderOverflow } = column;
|
|
168
168
|
const tooltipOpts = computeTooltipOpts.value;
|
|
169
169
|
const showAllTip = tooltipOpts.showAll;
|
|
170
|
-
const headOverflow = XEUtils.
|
|
170
|
+
const headOverflow = XEUtils.eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
171
171
|
const showTitle = headOverflow === 'title';
|
|
172
172
|
const showTooltip = headOverflow === true || headOverflow === 'tooltip';
|
|
173
173
|
const ons = {};
|
|
@@ -43,6 +43,11 @@ export class ColumnInfo {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
if (_vm.aggFunc) {
|
|
47
|
+
if (!$xeTable.handlePivotTableAggregateData && _vm.aggFunc !== true) {
|
|
48
|
+
errLog('vxe.error.errProp', [`column.agg-func=${_vm.aggFunc}`, 'column.agg-func=true']);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
46
51
|
Object.assign(this, {
|
|
47
52
|
// 基本属性
|
|
48
53
|
type: _vm.type,
|
package/es/table/src/footer.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, ref, inject, nextTick, onMounted, onUnmounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
5
|
import { updateCellTitle, getPropClass } from '../../ui/src/dom';
|
|
6
|
-
import {
|
|
6
|
+
import { getCalcHeight } from './util';
|
|
7
7
|
const { renderer, renderEmptyElement } = VxeUI;
|
|
8
8
|
const renderType = 'footer';
|
|
9
9
|
export default defineVxeComponent({
|
|
@@ -29,7 +29,7 @@ export default defineVxeComponent({
|
|
|
29
29
|
setup(props) {
|
|
30
30
|
const $xeTable = inject('$xeTable', {});
|
|
31
31
|
const { xID, props: tableProps, reactData: tableReactData, internalData: tableInternalData } = $xeTable;
|
|
32
|
-
const { computeTooltipOpts, computeColumnOpts,
|
|
32
|
+
const { computeTooltipOpts, computeColumnOpts, computeCellOpts, computeFooterCellOpts, computeDefaultRowHeight, computeResizableOpts, computeVirtualXOpts } = $xeTable.getComputeMaps();
|
|
33
33
|
const refElem = ref();
|
|
34
34
|
const refFooterScroll = ref();
|
|
35
35
|
const refFooterTable = ref();
|
|
@@ -40,7 +40,7 @@ export default defineVxeComponent({
|
|
|
40
40
|
const $xeGrid = $xeTable.xeGrid;
|
|
41
41
|
const { fixedType } = props;
|
|
42
42
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps;
|
|
43
|
-
const { scrollXLoad, scrollYLoad, overflowX, currentColumn } = tableReactData;
|
|
43
|
+
const { scrollXLoad, scrollYLoad, overflowX, currentColumn, mergeFootFlag } = tableReactData;
|
|
44
44
|
const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore } = tableInternalData;
|
|
45
45
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
46
46
|
const tooltipOpts = computeTooltipOpts.value;
|
|
@@ -50,7 +50,7 @@ export default defineVxeComponent({
|
|
|
50
50
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
51
51
|
const cellOpts = computeCellOpts.value;
|
|
52
52
|
const footerCellOpts = computeFooterCellOpts.value;
|
|
53
|
-
const currCellHeight =
|
|
53
|
+
const currCellHeight = getCalcHeight(footerCellOpts.height) || defaultRowHeight;
|
|
54
54
|
return tableColumn.map((column, $columnIndex) => {
|
|
55
55
|
const { type, showFooterOverflow, footerAlign, align, footerClassName, editRender, cellRender } = column;
|
|
56
56
|
const colid = column.id;
|
|
@@ -115,7 +115,7 @@ export default defineVxeComponent({
|
|
|
115
115
|
};
|
|
116
116
|
let isMergeCell = false;
|
|
117
117
|
// 合并行或列
|
|
118
|
-
if (mergeFooterList.length) {
|
|
118
|
+
if (mergeFootFlag && mergeFooterList.length) {
|
|
119
119
|
const spanRest = mergeFooterCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
120
120
|
if (spanRest) {
|
|
121
121
|
const { rowspan, colspan } = spanRest;
|
|
@@ -160,7 +160,7 @@ export default defineVxeComponent({
|
|
|
160
160
|
else {
|
|
161
161
|
tcStyle.minHeight = `${currCellHeight}px`;
|
|
162
162
|
}
|
|
163
|
-
return h('td', Object.assign(Object.assign(Object.assign(Object.assign({ class: ['vxe-footer--column', column.id, {
|
|
163
|
+
return h('td', Object.assign(Object.assign(Object.assign(Object.assign({ class: ['vxe-table--column vxe-footer--column', column.id, {
|
|
164
164
|
[`col--${footAlign}`]: footAlign,
|
|
165
165
|
[`col--${type}`]: type,
|
|
166
166
|
'col--last': isLastColumn,
|
|
@@ -182,7 +182,7 @@ export default defineVxeComponent({
|
|
|
182
182
|
: [
|
|
183
183
|
h('div', {
|
|
184
184
|
colid,
|
|
185
|
-
class: 'vxe-cell--wrapper'
|
|
185
|
+
class: 'vxe-cell--wrapper vxe-footer-cell--wrapper'
|
|
186
186
|
}, column.renderFooter(cellParams))
|
|
187
187
|
]),
|
|
188
188
|
/**
|
|
@@ -203,26 +203,9 @@ export default defineVxeComponent({
|
|
|
203
203
|
const renderHeads = (isOptimizeMode, renderColumnList) => {
|
|
204
204
|
const { fixedType, footerTableData } = props;
|
|
205
205
|
const { footerRowClassName, footerRowStyle } = tableProps;
|
|
206
|
-
const { isColLoading, isDragColMove } = tableReactData;
|
|
207
|
-
const columnOpts = computeColumnOpts.value;
|
|
208
|
-
const columnDragOpts = computeColumnDragOpts.value;
|
|
209
206
|
return footerTableData.map((row, $rowIndex) => {
|
|
210
207
|
const _rowIndex = $rowIndex;
|
|
211
208
|
const rowParams = { $table: $xeTable, row, _rowIndex, $rowIndex, fixed: fixedType, type: renderType };
|
|
212
|
-
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
213
|
-
return h(TransitionGroup, {
|
|
214
|
-
key: $rowIndex,
|
|
215
|
-
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
216
|
-
tag: 'tr',
|
|
217
|
-
class: [
|
|
218
|
-
'vxe-footer--row',
|
|
219
|
-
footerRowClassName ? XEUtils.isFunction(footerRowClassName) ? footerRowClassName(rowParams) : footerRowClassName : ''
|
|
220
|
-
],
|
|
221
|
-
style: footerRowStyle ? (XEUtils.isFunction(footerRowStyle) ? footerRowStyle(rowParams) : footerRowStyle) : null
|
|
222
|
-
}, {
|
|
223
|
-
default: () => renderRows(isOptimizeMode, renderColumnList, footerTableData, row, $rowIndex, _rowIndex)
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
209
|
return h('tr', {
|
|
227
210
|
key: $rowIndex,
|
|
228
211
|
class: [
|
package/es/table/src/header.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h, ref, inject, nextTick, watch, onMounted, onUnmounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
|
-
import {
|
|
5
|
+
import { getCalcHeight, convertHeaderColumnToRows } from './util';
|
|
6
6
|
const { renderer, renderEmptyElement } = VxeUI;
|
|
7
7
|
const renderType = 'header';
|
|
8
8
|
export default defineVxeComponent({
|
|
@@ -45,7 +45,7 @@ export default defineVxeComponent({
|
|
|
45
45
|
const cellOpts = computeCellOpts.value;
|
|
46
46
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
47
47
|
const headerCellOpts = computeHeaderCellOpts.value;
|
|
48
|
-
const currCellHeight =
|
|
48
|
+
const currCellHeight = getCalcHeight(headerCellOpts.height) || defaultRowHeight;
|
|
49
49
|
const { disabledMethod: dragDisabledMethod, isCrossDrag, isPeerDrag } = columnDragOpts;
|
|
50
50
|
return cols.map((column, $columnIndex) => {
|
|
51
51
|
const { type, showHeaderOverflow, headerAlign, align, filters, headerClassName, editRender, cellRender } = column;
|
|
@@ -129,7 +129,7 @@ export default defineVxeComponent({
|
|
|
129
129
|
else {
|
|
130
130
|
tcStyle.minHeight = `${currCellHeight}px`;
|
|
131
131
|
}
|
|
132
|
-
return h('th', Object.assign(Object.assign(Object.assign({ class: ['vxe-header--column', colid, {
|
|
132
|
+
return h('th', Object.assign(Object.assign(Object.assign({ class: ['vxe-table--column vxe-header--column', colid, {
|
|
133
133
|
[`col--${headAlign}`]: headAlign,
|
|
134
134
|
[`col--${type}`]: type,
|
|
135
135
|
'col--last': isLastColumn,
|
|
@@ -161,7 +161,7 @@ export default defineVxeComponent({
|
|
|
161
161
|
: [
|
|
162
162
|
h('div', {
|
|
163
163
|
colid,
|
|
164
|
-
class: 'vxe-cell--wrapper'
|
|
164
|
+
class: 'vxe-cell--wrapper vxe-header-cell--wrapper'
|
|
165
165
|
}, column.renderHeader(cellParams))
|
|
166
166
|
]),
|
|
167
167
|
/**
|
|
@@ -180,25 +180,8 @@ export default defineVxeComponent({
|
|
|
180
180
|
const renderHeads = (isGroup, isOptimizeMode, headerGroups) => {
|
|
181
181
|
const { fixedType } = props;
|
|
182
182
|
const { headerRowClassName, headerRowStyle } = tableProps;
|
|
183
|
-
const { isColLoading, isDragColMove } = tableReactData;
|
|
184
|
-
const columnOpts = computeColumnOpts.value;
|
|
185
|
-
const columnDragOpts = computeColumnDragOpts.value;
|
|
186
183
|
return headerGroups.map((cols, $rowIndex) => {
|
|
187
184
|
const params = { $table: $xeTable, $rowIndex, fixed: fixedType, type: renderType };
|
|
188
|
-
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
189
|
-
return h(TransitionGroup, {
|
|
190
|
-
key: $rowIndex,
|
|
191
|
-
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
192
|
-
tag: 'tr',
|
|
193
|
-
class: [
|
|
194
|
-
'vxe-header--row',
|
|
195
|
-
headerRowClassName ? (XEUtils.isFunction(headerRowClassName) ? headerRowClassName(params) : headerRowClassName) : ''
|
|
196
|
-
],
|
|
197
|
-
style: headerRowStyle ? (XEUtils.isFunction(headerRowStyle) ? headerRowStyle(params) : headerRowStyle) : null
|
|
198
|
-
}, {
|
|
199
|
-
default: () => renderRows(isGroup, isOptimizeMode, cols, $rowIndex)
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
185
|
return h('tr', {
|
|
203
186
|
key: $rowIndex,
|
|
204
187
|
class: [
|