vxe-table 4.17.1 → 4.17.3
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/custom/hook.js +2 -4
- package/es/table/module/custom/panel.js +3 -0
- package/es/table/module/menu/hook.js +7 -1
- package/es/table/src/cell.js +4 -5
- package/es/table/src/table.js +43 -9
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +54 -24
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/hook.js +2 -4
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +3 -0
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/menu/hook.js +7 -1
- package/lib/table/module/menu/hook.min.js +1 -1
- package/lib/table/src/cell.js +5 -7
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/table.js +35 -10
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/table/module/custom/hook.ts +2 -4
- package/packages/table/module/custom/panel.ts +3 -0
- package/packages/table/module/menu/hook.ts +8 -1
- package/packages/table/src/cell.ts +4 -5
- package/packages/table/src/table.ts +43 -9
- /package/es/{iconfont.1761181613193.ttf → iconfont.1761545730136.ttf} +0 -0
- /package/es/{iconfont.1761181613193.woff → iconfont.1761545730136.woff} +0 -0
- /package/es/{iconfont.1761181613193.woff2 → iconfont.1761545730136.woff2} +0 -0
- /package/lib/{iconfont.1761181613193.ttf → iconfont.1761545730136.ttf} +0 -0
- /package/lib/{iconfont.1761181613193.woff → iconfont.1761545730136.woff} +0 -0
- /package/lib/{iconfont.1761181613193.woff2 → iconfont.1761545730136.woff2} +0 -0
|
@@ -2,13 +2,12 @@ import { nextTick } from 'vue';
|
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
4
|
import { getColumnList } from '../../src/util';
|
|
5
|
-
const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
|
|
5
|
+
const tableCustomMethodKeys = ['openCustom', 'closeCustom', 'getCustomVisible', 'toggleCustom', 'saveCustom', 'cancelCustom', 'resetCustom', 'toggleCustomAllCheckbox', 'setCustomAllCheckbox'];
|
|
6
6
|
VxeUI.hooks.add('tableCustomModule', {
|
|
7
7
|
setupTable($xeTable) {
|
|
8
8
|
const { reactData, internalData } = $xeTable;
|
|
9
9
|
const { computeCustomOpts, computeRowGroupFields } = $xeTable.getComputeMaps();
|
|
10
10
|
const { refElem } = $xeTable.getRefMaps();
|
|
11
|
-
const $xeGrid = $xeTable.xeGrid;
|
|
12
11
|
const $xeGantt = $xeTable.xeGantt;
|
|
13
12
|
const calcMaxHeight = () => {
|
|
14
13
|
const { customStore } = reactData;
|
|
@@ -279,8 +278,7 @@ VxeUI.hooks.add('tableCustomModule', {
|
|
|
279
278
|
customStore.isIndeterminate = !customStore.isAll && collectColumn.some((column) => (!checkMethod || checkMethod({ $table: $xeTable, column })) && (column.renderVisible || column.halfVisible));
|
|
280
279
|
};
|
|
281
280
|
const emitCustomEvent = (type, evnt) => {
|
|
282
|
-
|
|
283
|
-
comp.dispatchEvent('custom', { type }, evnt);
|
|
281
|
+
$xeTable.dispatchEvent('custom', { type }, evnt);
|
|
284
282
|
};
|
|
285
283
|
const customPrivateMethods = {
|
|
286
284
|
checkCustomStatus,
|
|
@@ -73,6 +73,7 @@ export default defineVxeComponent({
|
|
|
73
73
|
$xeTable.saveCustom();
|
|
74
74
|
$xeTable.closeCustom();
|
|
75
75
|
$xeTable.emitCustomEvent('confirm', $event);
|
|
76
|
+
$xeTable.emitCustomEvent('close', $event);
|
|
76
77
|
};
|
|
77
78
|
const cancelCloseEvent = ({ $event }) => {
|
|
78
79
|
$xeTable.closeCustom();
|
|
@@ -82,11 +83,13 @@ export default defineVxeComponent({
|
|
|
82
83
|
$xeTable.cancelCustom();
|
|
83
84
|
$xeTable.closeCustom();
|
|
84
85
|
$xeTable.emitCustomEvent('cancel', $event);
|
|
86
|
+
$xeTable.emitCustomEvent('close', $event);
|
|
85
87
|
};
|
|
86
88
|
const handleResetCustomEvent = (evnt) => {
|
|
87
89
|
$xeTable.resetCustom(true);
|
|
88
90
|
$xeTable.closeCustom();
|
|
89
91
|
$xeTable.emitCustomEvent('reset', evnt);
|
|
92
|
+
$xeTable.emitCustomEvent('close', evnt);
|
|
90
93
|
};
|
|
91
94
|
const resetCustomEvent = ({ $event }) => {
|
|
92
95
|
if (VxeUI.modal) {
|
|
@@ -10,6 +10,9 @@ hooks.add('tableMenuModule', {
|
|
|
10
10
|
const { xID, props, reactData, internalData } = $xeTable;
|
|
11
11
|
const { refElem, refTableFilter, refTableMenu } = $xeTable.getRefMaps();
|
|
12
12
|
const { computeMouseOpts, computeIsContentMenu, computeMenuOpts } = $xeTable.getComputeMaps();
|
|
13
|
+
const $xeGrid = $xeTable.xeGrid;
|
|
14
|
+
const $xeGantt = $xeTable.xeGantt;
|
|
15
|
+
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
13
16
|
let menuMethods = {};
|
|
14
17
|
let menuPrivateMethods = {};
|
|
15
18
|
/**
|
|
@@ -32,7 +35,10 @@ hooks.add('tableMenuModule', {
|
|
|
32
35
|
if (!visibleMethod || visibleMethod(params)) {
|
|
33
36
|
evnt.preventDefault();
|
|
34
37
|
$xeTable.updateZindex();
|
|
35
|
-
const el = refElem.value;
|
|
38
|
+
const el = $xeGGWrapper ? $xeGGWrapper.getRefMaps().refElem.value : refElem.value;
|
|
39
|
+
if (!el) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
36
42
|
const tableRect = el.getBoundingClientRect();
|
|
37
43
|
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
|
|
38
44
|
let top = evnt.clientY - tableRect.y;
|
package/es/table/src/cell.js
CHANGED
|
@@ -382,11 +382,9 @@ export const Cell = {
|
|
|
382
382
|
const tableReactData = $table.reactData;
|
|
383
383
|
const tableInternalData = $table.internalData;
|
|
384
384
|
const { isRowGroupStatus } = tableReactData;
|
|
385
|
-
const { computeEditOpts } = $table.getComputeMaps();
|
|
386
385
|
const { editConfig } = tableProps;
|
|
387
|
-
const
|
|
388
|
-
const
|
|
389
|
-
const renderOpts = editConfig && isEnableConf(editOpts) && editRender ? editRender : cellRender;
|
|
386
|
+
const { field, slots, editRender, cellRender, rowGroupNode, aggFunc, formatter } = column;
|
|
387
|
+
const renderOpts = editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null);
|
|
390
388
|
const defaultSlot = slots ? slots.default : null;
|
|
391
389
|
const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
|
|
392
390
|
let cellValue = '';
|
|
@@ -448,7 +446,8 @@ export const Cell = {
|
|
|
448
446
|
if (defaultSlot) {
|
|
449
447
|
return renderCellBaseVNs(params, $table.callSlot(defaultSlot, params));
|
|
450
448
|
}
|
|
451
|
-
|
|
449
|
+
// formatter > (renderTableCell | renderTableDefault)
|
|
450
|
+
if (renderOpts && !formatter) {
|
|
452
451
|
const compConf = renderer.get(renderOpts.name);
|
|
453
452
|
if (compConf) {
|
|
454
453
|
const rtCell = compConf.renderTableCell || compConf.renderCell;
|
package/es/table/src/table.js
CHANGED
|
@@ -1510,7 +1510,7 @@ export default defineVxeComponent({
|
|
|
1510
1510
|
const customOpts = computeCustomOpts.value;
|
|
1511
1511
|
const { storage, storeOptions } = customOpts;
|
|
1512
1512
|
const isAllCustom = storage === true;
|
|
1513
|
-
const storageOpts = isAllCustom ? {} :
|
|
1513
|
+
const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
|
|
1514
1514
|
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
1515
1515
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
1516
1516
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
@@ -1603,7 +1603,7 @@ export default defineVxeComponent({
|
|
|
1603
1603
|
const customOpts = computeCustomOpts.value;
|
|
1604
1604
|
const { storage, restoreStore, storeOptions } = customOpts;
|
|
1605
1605
|
const isAllCustom = storage === true;
|
|
1606
|
-
const storageOpts = isAllCustom ? {} :
|
|
1606
|
+
const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
|
|
1607
1607
|
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
1608
1608
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
1609
1609
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
@@ -3245,6 +3245,9 @@ export default defineVxeComponent({
|
|
|
3245
3245
|
calcScrollbar();
|
|
3246
3246
|
updateStyle();
|
|
3247
3247
|
updateRowExpandStyle();
|
|
3248
|
+
if (reFull) {
|
|
3249
|
+
updateTreeLineStyle();
|
|
3250
|
+
}
|
|
3248
3251
|
return computeScrollLoad().then(() => {
|
|
3249
3252
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
3250
3253
|
if (reWidth) {
|
|
@@ -3262,6 +3265,9 @@ export default defineVxeComponent({
|
|
|
3262
3265
|
updateRowOffsetTop();
|
|
3263
3266
|
}
|
|
3264
3267
|
updateRowExpandStyle();
|
|
3268
|
+
if (reFull) {
|
|
3269
|
+
updateTreeLineStyle();
|
|
3270
|
+
}
|
|
3265
3271
|
if (reFull) {
|
|
3266
3272
|
return computeScrollLoad();
|
|
3267
3273
|
}
|
|
@@ -3979,6 +3985,7 @@ export default defineVxeComponent({
|
|
|
3979
3985
|
}
|
|
3980
3986
|
reactData.treeExpandedFlag++;
|
|
3981
3987
|
return Promise.all(result).then(() => {
|
|
3988
|
+
updateTreeLineStyle();
|
|
3982
3989
|
return $xeTable.recalculate();
|
|
3983
3990
|
});
|
|
3984
3991
|
};
|
|
@@ -4419,7 +4426,32 @@ export default defineVxeComponent({
|
|
|
4419
4426
|
* 更新树连接线样式
|
|
4420
4427
|
*/
|
|
4421
4428
|
const updateTreeLineStyle = () => {
|
|
4422
|
-
//
|
|
4429
|
+
// const { tableData } = reactData
|
|
4430
|
+
// const { rowExpandedMaps } = internalData
|
|
4431
|
+
// const treeOpts = computeTreeOpts.value
|
|
4432
|
+
// const { transform, mapChildrenField } = treeOpts
|
|
4433
|
+
// const childrenField = treeOpts.children || treeOpts.childrenField
|
|
4434
|
+
// const { handleGetRowId } = createHandleGetRowId($xeTable)
|
|
4435
|
+
// // 待优化
|
|
4436
|
+
// if (transform) {
|
|
4437
|
+
// // x
|
|
4438
|
+
// } else {
|
|
4439
|
+
// // x
|
|
4440
|
+
// }
|
|
4441
|
+
// const handleNodeRow = (row: any, parentRow: any) => {
|
|
4442
|
+
// const childList: any[] = row[transform ? mapChildrenField : childrenField]
|
|
4443
|
+
// if (childList && childList.length) {
|
|
4444
|
+
// childList.forEach(childRow => {
|
|
4445
|
+
// const childRowid = handleGetRowId(childRow)
|
|
4446
|
+
// if (rowExpandedMaps[childRowid]) {
|
|
4447
|
+
// handleNodeRow(childRow, row)
|
|
4448
|
+
// }
|
|
4449
|
+
// })
|
|
4450
|
+
// }
|
|
4451
|
+
// }
|
|
4452
|
+
// tableData.forEach(row => {
|
|
4453
|
+
// handleNodeRow(row, null)
|
|
4454
|
+
// })
|
|
4423
4455
|
};
|
|
4424
4456
|
const handleRowExpandScroll = () => {
|
|
4425
4457
|
const { elemStore } = internalData;
|
|
@@ -6841,6 +6873,7 @@ export default defineVxeComponent({
|
|
|
6841
6873
|
}
|
|
6842
6874
|
reactData.treeExpandedFlag++;
|
|
6843
6875
|
}).then(() => {
|
|
6876
|
+
updateTreeLineStyle();
|
|
6844
6877
|
if (expList.length) {
|
|
6845
6878
|
return $xeTable.recalculate();
|
|
6846
6879
|
}
|
|
@@ -7204,7 +7237,7 @@ export default defineVxeComponent({
|
|
|
7204
7237
|
const { fullColumnFieldData, collectColumn } = internalData;
|
|
7205
7238
|
const { storage, checkMethod, storeOptions } = customOpts;
|
|
7206
7239
|
const isAllCustom = storage === true;
|
|
7207
|
-
const storageOpts = isAllCustom ? {} :
|
|
7240
|
+
const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
|
|
7208
7241
|
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
7209
7242
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
7210
7243
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
@@ -7385,11 +7418,12 @@ export default defineVxeComponent({
|
|
|
7385
7418
|
}
|
|
7386
7419
|
else {
|
|
7387
7420
|
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
|
|
7388
|
-
|
|
7389
|
-
|
|
7421
|
+
if (customStore.visible && $xeTable.closeCustom) {
|
|
7422
|
+
tablePrivateMethods.preventEvent(evnt, 'event.clearCustom', {}, () => {
|
|
7390
7423
|
$xeTable.closeCustom();
|
|
7391
|
-
|
|
7392
|
-
|
|
7424
|
+
$xeTable.dispatchEvent('custom', { type: 'close' }, evnt);
|
|
7425
|
+
});
|
|
7426
|
+
}
|
|
7393
7427
|
}
|
|
7394
7428
|
}
|
|
7395
7429
|
}
|
|
@@ -8820,7 +8854,7 @@ export default defineVxeComponent({
|
|
|
8820
8854
|
const customOpts = computeCustomOpts.value;
|
|
8821
8855
|
const { updateStore, storage, storeOptions } = customOpts;
|
|
8822
8856
|
const isAllCustom = storage === true;
|
|
8823
|
-
const storageOpts = isAllCustom ? {} :
|
|
8857
|
+
const storageOpts = Object.assign({}, isAllCustom ? {} : storage || {}, storeOptions);
|
|
8824
8858
|
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
8825
8859
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
8826
8860
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED