vxe-table 3.20.10 → 3.20.12
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/mixin.js +76 -5
- package/es/table/module/custom/panel.js +18 -12
- package/es/table/module/keyboard/mixin.js +1 -3
- package/es/table/src/body.js +4 -2
- package/es/table/src/footer.js +1 -0
- package/es/table/src/header.js +6 -2
- package/es/table/src/methods.js +67 -21
- package/es/table/src/table.js +19 -18
- package/es/table/src/util.js +6 -3
- package/es/table/style.css +14 -0
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +14 -0
- package/es/vxe-table/style.min.css +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +164 -73
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/custom/mixin.js +81 -5
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +20 -12
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +1 -4
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/body.js +8 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +4 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +13 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +17 -17
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +15 -16
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +6 -3
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +14 -0
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +14 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/mixin.ts +77 -6
- package/packages/table/module/custom/panel.ts +19 -13
- package/packages/table/module/keyboard/mixin.ts +1 -3
- package/packages/table/src/body.ts +10 -8
- package/packages/table/src/footer.ts +5 -4
- package/packages/table/src/header.ts +15 -10
- package/packages/table/src/methods.ts +71 -22
- package/packages/table/src/table.ts +19 -18
- package/packages/table/src/util.ts +7 -3
- package/styles/components/table-module/custom.scss +14 -0
- /package/es/{iconfont.1774663245801.ttf → iconfont.1776048358910.ttf} +0 -0
- /package/es/{iconfont.1774663245801.woff → iconfont.1776048358910.woff} +0 -0
- /package/es/{iconfont.1774663245801.woff2 → iconfont.1776048358910.woff2} +0 -0
- /package/lib/{iconfont.1774663245801.ttf → iconfont.1776048358910.ttf} +0 -0
- /package/lib/{iconfont.1774663245801.woff → iconfont.1776048358910.woff} +0 -0
- /package/lib/{iconfont.1774663245801.woff2 → iconfont.1776048358910.woff2} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { getColumnList } from '../../src/util';
|
|
3
|
+
import { toCssUnit } from '../../../ui/src/dom';
|
|
3
4
|
function updatePopupStyle($xeTable) {
|
|
4
5
|
const $xeGrid = $xeTable.$xeGrid;
|
|
5
6
|
const $xeGantt = $xeTable.$xeGantt;
|
|
@@ -7,20 +8,29 @@ function updatePopupStyle($xeTable) {
|
|
|
7
8
|
const reactData = $xeTable;
|
|
8
9
|
const { customStore } = reactData;
|
|
9
10
|
const customOpts = $xeTable.computeCustomOpts;
|
|
11
|
+
const { mode, placement, popupOptions } = customOpts;
|
|
12
|
+
const showSimple = !(mode === 'modal' || mode === 'drawer');
|
|
13
|
+
const { transfer, maxHeight } = popupOptions || {};
|
|
10
14
|
const customSimpleMode = $xeTable.computeCustomSimpleMode;
|
|
11
15
|
const showCustomSimpleOutside = customSimpleMode === 'outside';
|
|
12
|
-
const
|
|
13
|
-
const { maxHeight } = popupOptions || {};
|
|
16
|
+
const bodyEl = document.documentElement;
|
|
14
17
|
let wrapperEl = $xeTable.$refs.refElem;
|
|
15
18
|
let popupTop = 0;
|
|
16
19
|
let popupMaxHeight = 0;
|
|
20
|
+
const popupStys = {};
|
|
17
21
|
if ($xeGantt) {
|
|
18
22
|
const ganttContainerElem = $xeGantt.$refs.refGanttContainerElem;
|
|
19
23
|
if (ganttContainerElem) {
|
|
20
24
|
wrapperEl = ganttContainerElem;
|
|
21
25
|
}
|
|
22
26
|
}
|
|
23
|
-
|
|
27
|
+
const tableRect = wrapperEl.getBoundingClientRect();
|
|
28
|
+
// 多种模式,指定元素插入
|
|
29
|
+
if (showSimple && transfer) {
|
|
30
|
+
popupTop = tableRect.top + bodyEl.scrollTop;
|
|
31
|
+
popupMaxHeight = XEUtils.eqNull(maxHeight) ? 360 : maxHeight;
|
|
32
|
+
}
|
|
33
|
+
else if (showCustomSimpleOutside) {
|
|
24
34
|
if ($xeGGWrapper && wrapperEl) {
|
|
25
35
|
popupTop = wrapperEl.offsetTop;
|
|
26
36
|
}
|
|
@@ -33,8 +43,32 @@ function updatePopupStyle($xeTable) {
|
|
|
33
43
|
}
|
|
34
44
|
popupMaxHeight = Math.max(88, popupMaxHeight);
|
|
35
45
|
}
|
|
36
|
-
|
|
37
|
-
|
|
46
|
+
let popupMxHeight = 0;
|
|
47
|
+
if (!(placement === 'left' || placement === 'right')) {
|
|
48
|
+
popupMxHeight = XEUtils.eqNull(maxHeight) ? popupMaxHeight : maxHeight;
|
|
49
|
+
}
|
|
50
|
+
if (!placement || !(['left', 'right', 'bottom-left', 'bottom-right'].includes(placement))) {
|
|
51
|
+
if (popupTop) {
|
|
52
|
+
popupStys.top = toCssUnit(popupTop);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (showSimple && transfer) {
|
|
56
|
+
if (placement === 'bottom-left' || placement === 'bottom-right') {
|
|
57
|
+
popupStys.bottom = toCssUnit(bodyEl.scrollHeight - tableRect.top - tableRect.height + 1);
|
|
58
|
+
}
|
|
59
|
+
if (placement === 'top-left' || placement === 'bottom-left') {
|
|
60
|
+
popupStys.left = toCssUnit(tableRect.left);
|
|
61
|
+
}
|
|
62
|
+
else if (!placement || placement === 'top-right' || placement === 'bottom-right') {
|
|
63
|
+
popupStys.right = toCssUnit(bodyEl.scrollWidth - tableRect.left - tableRect.width + 1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (popupMxHeight) {
|
|
67
|
+
popupStys.maxHeight = toCssUnit(popupMxHeight);
|
|
68
|
+
}
|
|
69
|
+
customStore.popupStyle = popupStys;
|
|
70
|
+
customStore.maxHeight = popupMxHeight;
|
|
71
|
+
return $xeTable.$nextTick();
|
|
38
72
|
}
|
|
39
73
|
function emitCustomEvent($xeTable, type, evnt) {
|
|
40
74
|
const $xeGrid = $xeTable.$xeGrid;
|
|
@@ -53,7 +87,40 @@ export default {
|
|
|
53
87
|
_openCustom() {
|
|
54
88
|
const $xeTable = this;
|
|
55
89
|
const reactData = $xeTable;
|
|
90
|
+
const internalData = $xeTable;
|
|
91
|
+
const $xeGrid = $xeTable.$xeGrid;
|
|
92
|
+
const $xeGantt = $xeTable.$xeGantt;
|
|
93
|
+
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
56
94
|
const { initStore, customStore } = reactData;
|
|
95
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
96
|
+
const { mode, popupOptions } = customOpts;
|
|
97
|
+
const showSimple = !(mode === 'modal' || mode === 'drawer');
|
|
98
|
+
const { transfer } = popupOptions || {};
|
|
99
|
+
const customSimpleMode = $xeTable.computeCustomSimpleMode;
|
|
100
|
+
const showCustomSimpleOutside = customSimpleMode === 'outside';
|
|
101
|
+
let cpToElem = $xeTable.$refs.refCustomContainerElem;
|
|
102
|
+
// 多种模式,指定元素插入
|
|
103
|
+
if (showSimple && transfer) {
|
|
104
|
+
cpToElem = document.body;
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
if (showCustomSimpleOutside && $xeGGWrapper) {
|
|
108
|
+
const popupContainerElem = $xeGGWrapper.$refs.refPopupContainerElem;
|
|
109
|
+
if (popupContainerElem) {
|
|
110
|
+
cpToElem = popupContainerElem;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (cpToElem) {
|
|
115
|
+
const customPopupToElem = $xeTable.$refs.refCustomPopupToElem;
|
|
116
|
+
if (customPopupToElem && customPopupToElem.parentElement !== cpToElem) {
|
|
117
|
+
cpToElem.appendChild(customPopupToElem);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (internalData.customPopupToElem !== cpToElem) {
|
|
121
|
+
reactData.ctPopupFlag++;
|
|
122
|
+
}
|
|
123
|
+
internalData.customPopupToElem = cpToElem;
|
|
57
124
|
customStore.visible = true;
|
|
58
125
|
initStore.custom = true;
|
|
59
126
|
$xeTable.handleUpdateCustomColumn();
|
|
@@ -350,6 +417,10 @@ export default {
|
|
|
350
417
|
customStore.oldVisibleMaps = visibleMaps;
|
|
351
418
|
reactData.customColumnList = collectColumn.slice(0);
|
|
352
419
|
}
|
|
420
|
+
},
|
|
421
|
+
handleCustomStyle() {
|
|
422
|
+
const $xeTable = this;
|
|
423
|
+
return updatePopupStyle($xeTable);
|
|
353
424
|
}
|
|
354
425
|
}
|
|
355
426
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineVxeComponent } from '../../../ui/src/comp';
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
3
|
import { formatText } from '../../../ui/src/utils';
|
|
4
|
-
import { getTpImg, addClass, removeClass, hasControlKey
|
|
4
|
+
import { getTpImg, addClass, removeClass, hasControlKey } from '../../../ui/src/dom';
|
|
5
5
|
import { errLog } from '../../../ui/src/log';
|
|
6
6
|
import XEUtils from 'xe-utils';
|
|
7
7
|
const { getI18n, getIcon, renderEmptyElement } = VxeUI;
|
|
@@ -364,10 +364,17 @@ export default {
|
|
|
364
364
|
},
|
|
365
365
|
sortDragstartEvent(evnt) {
|
|
366
366
|
const $xeTableCustomPanel = this;
|
|
367
|
+
const $xeTable = $xeTableCustomPanel.$xeTable;
|
|
368
|
+
const tableReactData = $xeTable;
|
|
367
369
|
const customPanelInternalData = $xeTableCustomPanel.internalData;
|
|
370
|
+
const { customDragTime } = customPanelInternalData;
|
|
368
371
|
if (evnt.dataTransfer) {
|
|
369
372
|
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
|
|
370
373
|
}
|
|
374
|
+
if (customDragTime) {
|
|
375
|
+
clearTimeout(customDragTime);
|
|
376
|
+
}
|
|
377
|
+
tableReactData.isCustomDragStatus = true;
|
|
371
378
|
customPanelInternalData.prevDragGroupField = null;
|
|
372
379
|
customPanelInternalData.prevDragAggFnColid = null;
|
|
373
380
|
},
|
|
@@ -544,6 +551,10 @@ export default {
|
|
|
544
551
|
tableReactData.customColumnList = collectColumn.slice(0);
|
|
545
552
|
$xeTable.handleColDragSwapColumn();
|
|
546
553
|
}
|
|
554
|
+
customPanelInternalData.customDragTime = setTimeout(() => {
|
|
555
|
+
tableReactData.isCustomDragStatus = false;
|
|
556
|
+
customPanelInternalData.customDragTime = undefined;
|
|
557
|
+
}, 350);
|
|
547
558
|
}).catch(() => {
|
|
548
559
|
});
|
|
549
560
|
}
|
|
@@ -650,13 +661,14 @@ export default {
|
|
|
650
661
|
const $xeGantt = $xeTable.$xeGantt;
|
|
651
662
|
const { customStore } = props;
|
|
652
663
|
const { treeConfig, rowGroupConfig, aggregateConfig } = tableProps;
|
|
653
|
-
const { isCustomStatus, customColumnList } = tableReactData;
|
|
664
|
+
const { isCustomStatus, customColumnList, isCustomDragStatus } = tableReactData;
|
|
654
665
|
const customOpts = $xeTable.computeCustomOpts;
|
|
655
666
|
const { immediate } = customOpts;
|
|
656
667
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
657
|
-
const {
|
|
668
|
+
const { popupStyle } = customStore;
|
|
658
669
|
const { checkMethod, visibleMethod, allowVisible, allowSort, allowFixed, trigger, placement } = customOpts;
|
|
659
670
|
const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
|
|
671
|
+
const vSize = $xeTable.computeSize;
|
|
660
672
|
const { isCrossDrag } = columnDragOpts;
|
|
661
673
|
const slots = customOpts.slots || {};
|
|
662
674
|
const headerSlot = slots.header;
|
|
@@ -809,20 +821,14 @@ export default {
|
|
|
809
821
|
]));
|
|
810
822
|
}
|
|
811
823
|
});
|
|
812
|
-
const popupStys = {};
|
|
813
|
-
if (maxHeight && !['left', 'right'].includes(placement || '')) {
|
|
814
|
-
if (popupTop) {
|
|
815
|
-
popupStys.top = toCssUnit(popupTop);
|
|
816
|
-
}
|
|
817
|
-
popupStys.maxHeight = toCssUnit(maxHeight);
|
|
818
|
-
}
|
|
819
824
|
return h('div', {
|
|
820
825
|
ref: 'refElem',
|
|
821
826
|
key: 'simple',
|
|
822
827
|
class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
|
|
828
|
+
[`size--${vSize}`]: vSize,
|
|
823
829
|
'is--active': customStore.visible
|
|
824
830
|
}],
|
|
825
|
-
style:
|
|
831
|
+
style: popupStyle
|
|
826
832
|
}, customStore.visible
|
|
827
833
|
? [
|
|
828
834
|
h('div', {
|
|
@@ -892,7 +898,7 @@ export default {
|
|
|
892
898
|
: h('transition-group', {
|
|
893
899
|
class: 'vxe-table-custom--panel-list',
|
|
894
900
|
props: {
|
|
895
|
-
name: 'vxe-table-custom--list',
|
|
901
|
+
name: isCustomDragStatus ? 'vxe-table-custom--list' : '',
|
|
896
902
|
tag: 'ul'
|
|
897
903
|
},
|
|
898
904
|
on: customWrapperOns
|
|
@@ -376,11 +376,9 @@ export default {
|
|
|
376
376
|
moveCurrentRow(isUpArrow, isDwArrow, evnt) {
|
|
377
377
|
const $xeTable = this;
|
|
378
378
|
const props = $xeTable;
|
|
379
|
-
const reactData = $xeTable;
|
|
380
379
|
const internalData = $xeTable;
|
|
381
380
|
const { treeConfig } = props;
|
|
382
|
-
const { currentRow } =
|
|
383
|
-
const { afterFullData } = internalData;
|
|
381
|
+
const { afterFullData, currentRow } = internalData;
|
|
384
382
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
385
383
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
386
384
|
let targetRow;
|
package/es/table/src/body.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../ui';
|
|
3
|
+
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
4
|
import { isEnableConf, getClass } from '../../ui/src/utils';
|
|
4
5
|
import { getRowid, createHandleGetRowId, getCellRestHeight } from './util';
|
|
5
6
|
import { updateCellTitle } from '../../ui/src/dom';
|
|
@@ -441,7 +442,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
441
442
|
const $xeGantt = $xeTable.$xeGantt;
|
|
442
443
|
const { stripe, rowKey, highlightHoverRow, rowClassName, rowStyle, editConfig, treeConfig } = tableProps;
|
|
443
444
|
const { hasFixedColumn, treeExpandedFlag, scrollYLoad, isAllOverflow, rowExpandedFlag, expandColumn, selectRadioRow, pendingRowFlag, rowExpandHeightFlag, isRowGroupStatus } = tableReactData;
|
|
444
|
-
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps } = tableInternalData;
|
|
445
|
+
const { fullAllDataRowIdData, fullColumnIdData, treeExpandedMaps, pendingRowMaps, rowExpandedMaps, currentRow } = tableInternalData;
|
|
445
446
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
446
447
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
447
448
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -533,7 +534,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
533
534
|
'row--radio': radioOpts.highlight && selectRadioRow === row,
|
|
534
535
|
'row--checked': checkboxOpts.highlight && $xeTable.isCheckedByCheckboxRow(row),
|
|
535
536
|
'row--pending': !!pendingRowFlag && !!pendingRowMaps[rowid],
|
|
536
|
-
'row--group': hasRowGroupAggregate
|
|
537
|
+
'row--group': hasRowGroupAggregate,
|
|
538
|
+
'row--current': currentRow && rowid === getRowid($xeTable, currentRow)
|
|
537
539
|
},
|
|
538
540
|
rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : ''
|
|
539
541
|
];
|
package/es/table/src/footer.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../ui';
|
|
3
|
+
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
4
|
import { getClass } from '../../ui/src/utils';
|
|
4
5
|
import { updateCellTitle } from '../../ui/src/dom';
|
|
5
6
|
import { getCalcHeight } from './util';
|
package/es/table/src/header.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../ui';
|
|
3
|
+
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
4
|
import { isEnableConf, getClass } from '../../ui/src/utils';
|
|
4
5
|
import { getCalcHeight, convertHeaderColumnToRows, convertHeaderToGridRows } from './util';
|
|
5
6
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
@@ -348,8 +349,9 @@ export default {
|
|
|
348
349
|
}
|
|
349
350
|
},
|
|
350
351
|
data() {
|
|
352
|
+
const headerColumn = [];
|
|
351
353
|
return {
|
|
352
|
-
headerColumn
|
|
354
|
+
headerColumn
|
|
353
355
|
};
|
|
354
356
|
},
|
|
355
357
|
watch: {
|
|
@@ -559,7 +561,9 @@ export default {
|
|
|
559
561
|
spanColumns = visibleColgroups;
|
|
560
562
|
}
|
|
561
563
|
_vm.headerColumn = spanColumns;
|
|
562
|
-
$xeTable
|
|
564
|
+
$xeTable.$nextTick(() => {
|
|
565
|
+
$xeTable.dispatchEvent('columns-change', { visibleColgroups, collectColumn, visibleColumn }, null);
|
|
566
|
+
});
|
|
563
567
|
}
|
|
564
568
|
}
|
|
565
569
|
};
|
package/es/table/src/methods.js
CHANGED
|
@@ -960,8 +960,8 @@ function updateStyle($xeTable) {
|
|
|
960
960
|
const reactData = $xeTable;
|
|
961
961
|
const internalData = $xeTable;
|
|
962
962
|
const { mouseConfig } = props;
|
|
963
|
-
const { isGroup,
|
|
964
|
-
const { visibleColumn, tableHeight, elemStore, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
|
|
963
|
+
const { isGroup, tableColumn, overflowX, scrollbarWidth, overflowY, scrollbarHeight, scrollXWidth, columnStore, editStore, isColLoading } = reactData;
|
|
964
|
+
const { visibleColumn, tableHeight, elemStore, currentRow, customHeight, customMinHeight, customMaxHeight, tHeaderHeight, tFooterHeight } = internalData;
|
|
965
965
|
const $xeGanttView = internalData.xeGanttView;
|
|
966
966
|
const el = $xeTable.$refs.refElem;
|
|
967
967
|
if (!el || (internalData.tBodyHeight && !el.clientHeight)) {
|
|
@@ -1327,7 +1327,7 @@ function handleDefaultRadioChecked($xeTable) {
|
|
|
1327
1327
|
const { checkRowKey: rowid, reserve } = radioOpts;
|
|
1328
1328
|
if (rowid) {
|
|
1329
1329
|
if (fullDataRowIdData[rowid]) {
|
|
1330
|
-
handleCheckedRadioRow(fullDataRowIdData[rowid].row, true);
|
|
1330
|
+
handleCheckedRadioRow($xeTable, fullDataRowIdData[rowid].row, true);
|
|
1331
1331
|
}
|
|
1332
1332
|
if (reserve) {
|
|
1333
1333
|
const rowkey = getRowkey($xeTable);
|
|
@@ -1565,8 +1565,8 @@ function handleReserveStatus($xeTable) {
|
|
|
1565
1565
|
const reactData = $xeTable;
|
|
1566
1566
|
const internalData = $xeTable;
|
|
1567
1567
|
const { treeConfig } = props;
|
|
1568
|
-
const { expandColumn,
|
|
1569
|
-
const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps } = internalData;
|
|
1568
|
+
const { expandColumn, selectRadioRow } = reactData;
|
|
1569
|
+
const { fullDataRowIdData, fullAllDataRowIdData, radioReserveRow, selectCheckboxMaps, treeExpandedMaps, rowExpandedMaps, currentRow } = internalData;
|
|
1570
1570
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
1571
1571
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
1572
1572
|
const radioOpts = $xeTable.computeRadioOpts;
|
|
@@ -1590,7 +1590,7 @@ function handleReserveStatus($xeTable) {
|
|
|
1590
1590
|
handleCheckedCheckboxRow($xeTable, handleReserveRow($xeTable, internalData.checkboxReserveRowMap), true, true);
|
|
1591
1591
|
}
|
|
1592
1592
|
if (currentRow && !fullAllDataRowIdData[getRowid($xeTable, currentRow)]) {
|
|
1593
|
-
|
|
1593
|
+
internalData.currentRow = null; // 刷新当前行状态
|
|
1594
1594
|
}
|
|
1595
1595
|
// 行展开
|
|
1596
1596
|
internalData.rowExpandedMaps = expandColumn ? getRecoverRowMaps($xeTable, rowExpandedMaps) : {}; // 刷新行展开状态
|
|
@@ -2467,10 +2467,13 @@ const calcCellHeight = ($xeTable) => {
|
|
|
2467
2467
|
const { treeConfig } = props;
|
|
2468
2468
|
const { tableData, isAllOverflow, scrollYLoad, scrollXLoad } = reactData;
|
|
2469
2469
|
const { fullAllDataRowIdData } = internalData;
|
|
2470
|
+
const el = $xeTable.$refs.refElem;
|
|
2471
|
+
if (!el || !el.clientWidth) {
|
|
2472
|
+
return;
|
|
2473
|
+
}
|
|
2470
2474
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
2471
2475
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
2472
|
-
|
|
2473
|
-
if (el && !isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
|
|
2476
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
|
|
2474
2477
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
2475
2478
|
el.setAttribute('data-calc-row', 'Y');
|
|
2476
2479
|
tableData.forEach(row => {
|
|
@@ -2931,6 +2934,10 @@ function calcScrollbar($xeTable) {
|
|
|
2931
2934
|
const { scrollXWidth, scrollYHeight } = reactData;
|
|
2932
2935
|
const { elemStore } = internalData;
|
|
2933
2936
|
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
2937
|
+
const el = $xeTable.$refs.refElem;
|
|
2938
|
+
if (!el || !el.clientWidth) {
|
|
2939
|
+
return;
|
|
2940
|
+
}
|
|
2934
2941
|
const bodyWrapperElem = getRefElem(elemStore['main-body-wrapper']);
|
|
2935
2942
|
const headerTableElem = getRefElem(elemStore['main-header-table']);
|
|
2936
2943
|
const footerTableElem = getRefElem(elemStore['main-footer-table']);
|
|
@@ -3014,8 +3021,10 @@ function handleRecalculateStyle($xeTable, reFull, reWidth, reHeight) {
|
|
|
3014
3021
|
});
|
|
3015
3022
|
}
|
|
3016
3023
|
function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
|
|
3024
|
+
const reactData = $xeTable;
|
|
3017
3025
|
const internalData = $xeTable;
|
|
3018
3026
|
return new Promise(resolve => {
|
|
3027
|
+
const { customStore } = reactData;
|
|
3019
3028
|
const { rceTimeout, rceRunTime } = internalData;
|
|
3020
3029
|
const $xeGanttView = internalData.xeGanttView;
|
|
3021
3030
|
const resizeOpts = $xeTable.computeResizeOpts;
|
|
@@ -3025,6 +3034,9 @@ function handleLazyRecalculate($xeTable, reFull, reWidth, reHeight) {
|
|
|
3025
3034
|
autoCellWidth($xeTable);
|
|
3026
3035
|
updateRowExpandStyle($xeTable);
|
|
3027
3036
|
}
|
|
3037
|
+
if (customStore.visible && $xeTable.handleCustomStyle) {
|
|
3038
|
+
$xeTable.handleCustomStyle();
|
|
3039
|
+
}
|
|
3028
3040
|
if (rceTimeout) {
|
|
3029
3041
|
clearTimeout(rceTimeout);
|
|
3030
3042
|
if (rceRunTime && rceRunTime + (refreshDelay - 5) < Date.now()) {
|
|
@@ -4027,6 +4039,10 @@ function handleUpdateRowResize($xeTable, evnt, params) {
|
|
|
4027
4039
|
function updateColumnOffsetLeft($xeTable) {
|
|
4028
4040
|
const internalData = $xeTable;
|
|
4029
4041
|
const { visibleColumn, fullColumnIdData } = internalData;
|
|
4042
|
+
const el = $xeTable.$refs.refElem;
|
|
4043
|
+
if (!el || !el.clientWidth) {
|
|
4044
|
+
return;
|
|
4045
|
+
}
|
|
4030
4046
|
let offsetLeft = 0;
|
|
4031
4047
|
for (let cIndex = 0, rLen = visibleColumn.length; cIndex < rLen; cIndex++) {
|
|
4032
4048
|
const column = visibleColumn[cIndex];
|
|
@@ -4043,6 +4059,10 @@ function updateRowOffsetTop($xeTable) {
|
|
|
4043
4059
|
const internalData = $xeTable;
|
|
4044
4060
|
const { expandColumn } = reactData;
|
|
4045
4061
|
const { afterFullData, fullAllDataRowIdData, rowExpandedMaps } = internalData;
|
|
4062
|
+
const el = $xeTable.$refs.refElem;
|
|
4063
|
+
if (!el || !el.clientWidth) {
|
|
4064
|
+
return;
|
|
4065
|
+
}
|
|
4046
4066
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
4047
4067
|
const rowOpts = $xeTable.computeRowOpts;
|
|
4048
4068
|
const cellOpts = $xeTable.computeCellOpts;
|
|
@@ -4068,6 +4088,10 @@ function updateRowExpandStyle($xeTable) {
|
|
|
4068
4088
|
const reactData = $xeTable;
|
|
4069
4089
|
const internalData = $xeTable;
|
|
4070
4090
|
const { expandColumn, scrollYLoad, scrollYTop, isScrollYBig } = reactData;
|
|
4091
|
+
const el = $xeTable.$refs.refElem;
|
|
4092
|
+
if (!el || !el.clientWidth) {
|
|
4093
|
+
return;
|
|
4094
|
+
}
|
|
4071
4095
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
4072
4096
|
const rowOpts = $xeTable.computeRowOpts;
|
|
4073
4097
|
const cellOpts = $xeTable.computeCellOpts;
|
|
@@ -4134,6 +4158,10 @@ function updateTreeLineStyle($xeTable) {
|
|
|
4134
4158
|
}
|
|
4135
4159
|
const { tableData } = reactData;
|
|
4136
4160
|
const { fullAllDataRowIdData, treeExpandedMaps } = internalData;
|
|
4161
|
+
const el = $xeTable.$refs.refElem;
|
|
4162
|
+
if (!el || !el.clientWidth) {
|
|
4163
|
+
return;
|
|
4164
|
+
}
|
|
4137
4165
|
const cellOpts = $xeTable.computeCellOpts;
|
|
4138
4166
|
const rowOpts = $xeTable.computeRowOpts;
|
|
4139
4167
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
@@ -4250,6 +4278,21 @@ function handleColumnVisible(visible) {
|
|
|
4250
4278
|
return $xeTable.$nextTick();
|
|
4251
4279
|
};
|
|
4252
4280
|
}
|
|
4281
|
+
function reUpdateCustomStyleEvent($xeTable, evnt) {
|
|
4282
|
+
const reactData = $xeTable;
|
|
4283
|
+
const { customStore } = reactData;
|
|
4284
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
4285
|
+
const { popupOptions } = customOpts;
|
|
4286
|
+
const { transfer } = popupOptions || {};
|
|
4287
|
+
if (transfer && customStore.visible) {
|
|
4288
|
+
const tableCustom = $xeTable.$refs.refTableCustom;
|
|
4289
|
+
if (tableCustom && $xeTable.handleCustomStyle && !checkTargetElement(evnt.target, [tableCustom.$el], evnt.currentTarget)) {
|
|
4290
|
+
$xeTable.handleCustomStyle().then(() => {
|
|
4291
|
+
$xeTable.handleCustomStyle();
|
|
4292
|
+
});
|
|
4293
|
+
}
|
|
4294
|
+
}
|
|
4295
|
+
}
|
|
4253
4296
|
const tableMethods = {
|
|
4254
4297
|
callSlot(slotFunc, params, h, vNodes) {
|
|
4255
4298
|
const $xeTable = this;
|
|
@@ -6897,13 +6940,19 @@ const tableMethods = {
|
|
|
6897
6940
|
$xeTable.closeFilter();
|
|
6898
6941
|
$xeTable.closeMenu();
|
|
6899
6942
|
},
|
|
6943
|
+
handleGlobalScrollEvent(evnt) {
|
|
6944
|
+
const $xeTable = this;
|
|
6945
|
+
reUpdateCustomStyleEvent($xeTable, evnt);
|
|
6946
|
+
},
|
|
6900
6947
|
/**
|
|
6901
6948
|
* 全局滚动事件
|
|
6902
6949
|
*/
|
|
6903
6950
|
handleGlobalMousewheelEvent() {
|
|
6904
6951
|
const $xeTable = this;
|
|
6905
6952
|
$xeTable.closeTooltip();
|
|
6906
|
-
$xeTable.closeMenu
|
|
6953
|
+
if ($xeTable.closeMenu) {
|
|
6954
|
+
$xeTable.closeMenu();
|
|
6955
|
+
}
|
|
6907
6956
|
},
|
|
6908
6957
|
/**
|
|
6909
6958
|
* 表格键盘事件
|
|
@@ -6960,8 +7009,8 @@ const tableMethods = {
|
|
|
6960
7009
|
if (internalData.isActivated) {
|
|
6961
7010
|
$xeTable.preventEvent(evnt, 'event.keydown', null, () => {
|
|
6962
7011
|
const { mouseConfig, keyboardConfig, treeConfig, editConfig, highlightCurrentRow, highlightCurrentColumn } = props;
|
|
6963
|
-
const { ctxMenuStore, editStore
|
|
6964
|
-
const { afterFullData, visibleColumn } = internalData;
|
|
7012
|
+
const { ctxMenuStore, editStore } = reactData;
|
|
7013
|
+
const { afterFullData, visibleColumn, currentRow } = internalData;
|
|
6965
7014
|
const isContentMenu = $xeTable.computeIsContentMenu;
|
|
6966
7015
|
const bodyMenu = $xeTable.computeBodyMenu;
|
|
6967
7016
|
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
@@ -8357,7 +8406,7 @@ const tableMethods = {
|
|
|
8357
8406
|
let newValue = row;
|
|
8358
8407
|
let isChange = oldValue !== newValue;
|
|
8359
8408
|
if (strict) {
|
|
8360
|
-
handleCheckedRadioRow($xeTable, newValue);
|
|
8409
|
+
handleCheckedRadioRow($xeTable, newValue, false);
|
|
8361
8410
|
}
|
|
8362
8411
|
else {
|
|
8363
8412
|
if (oldValue === newValue) {
|
|
@@ -8365,7 +8414,7 @@ const tableMethods = {
|
|
|
8365
8414
|
}
|
|
8366
8415
|
isChange = oldValue !== newValue;
|
|
8367
8416
|
if (isChange && newValue) {
|
|
8368
|
-
handleCheckedRadioRow($xeTable, newValue);
|
|
8417
|
+
handleCheckedRadioRow($xeTable, newValue, false);
|
|
8369
8418
|
}
|
|
8370
8419
|
else {
|
|
8371
8420
|
newValue = null;
|
|
@@ -8417,8 +8466,8 @@ const tableMethods = {
|
|
|
8417
8466
|
},
|
|
8418
8467
|
triggerCurrentRowEvent(evnt, params) {
|
|
8419
8468
|
const $xeTable = this;
|
|
8420
|
-
const
|
|
8421
|
-
const { currentRow: oldValue } =
|
|
8469
|
+
const internalData = $xeTable;
|
|
8470
|
+
const { currentRow: oldValue } = internalData;
|
|
8422
8471
|
const rowOpts = $xeTable.computeRowOpts;
|
|
8423
8472
|
const currentRowOpts = $xeTable.computeCurrentRowOpts;
|
|
8424
8473
|
const beforeRowMethod = currentRowOpts.beforeSelectMethod || rowOpts.currentMethod;
|
|
@@ -8523,11 +8572,10 @@ const tableMethods = {
|
|
|
8523
8572
|
*/
|
|
8524
8573
|
clearCurrentRow() {
|
|
8525
8574
|
const $xeTable = this;
|
|
8526
|
-
const reactData = $xeTable;
|
|
8527
8575
|
const internalData = $xeTable;
|
|
8528
8576
|
const $xeGanttView = internalData.xeGanttView;
|
|
8529
8577
|
const el = $xeTable.$refs.refElem;
|
|
8530
|
-
|
|
8578
|
+
internalData.currentRow = null;
|
|
8531
8579
|
internalData.hoverRow = null;
|
|
8532
8580
|
if (el) {
|
|
8533
8581
|
XEUtils.arrayEach(el.querySelectorAll('.row--current'), elem => removeClass(elem, 'row--current'));
|
|
@@ -8550,10 +8598,8 @@ const tableMethods = {
|
|
|
8550
8598
|
getCurrentRecord(isFull) {
|
|
8551
8599
|
const $xeTable = this;
|
|
8552
8600
|
const props = $xeTable;
|
|
8553
|
-
const reactData = $xeTable;
|
|
8554
8601
|
const internalData = $xeTable;
|
|
8555
|
-
const { currentRow } =
|
|
8556
|
-
const { fullDataRowIdData, afterFullRowMaps } = internalData;
|
|
8602
|
+
const { fullDataRowIdData, afterFullRowMaps, currentRow } = internalData;
|
|
8557
8603
|
const rowOpts = $xeTable.computeRowOpts;
|
|
8558
8604
|
if (rowOpts.isCurrent || props.highlightCurrentRow) {
|
|
8559
8605
|
const rowid = getRowid($xeTable, currentRow);
|
|
@@ -11921,7 +11967,7 @@ const tableMethods = {
|
|
|
11921
11967
|
rowExpandYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
11922
11968
|
}
|
|
11923
11969
|
reactData.scrollYTop = scrollYTop;
|
|
11924
|
-
reactData.scrollYHeight = ySpaceHeight;
|
|
11970
|
+
reactData.scrollYHeight = isScrollYBig ? sYHeight : ySpaceHeight;
|
|
11925
11971
|
reactData.isScrollYBig = isScrollYBig;
|
|
11926
11972
|
calcScrollbar($xeTable);
|
|
11927
11973
|
if (isScrollYBig && mouseOpts.area) {
|
package/es/table/src/table.js
CHANGED
|
@@ -1811,6 +1811,7 @@ export default {
|
|
|
1811
1811
|
globalEvents.on($xeTable, 'mousewheel', this.handleGlobalMousewheelEvent);
|
|
1812
1812
|
globalEvents.on($xeTable, 'keydown', this.handleGlobalKeydownEvent);
|
|
1813
1813
|
globalEvents.on($xeTable, 'resize', this.handleGlobalResizeEvent);
|
|
1814
|
+
globalEvents.on($xeTable, 'scroll', this.handleGlobalScrollEvent);
|
|
1814
1815
|
globalEvents.on($xeTable, 'contextmenu', this.handleGlobalContextmenuEvent);
|
|
1815
1816
|
$xeTable.preventEvent(null, 'created');
|
|
1816
1817
|
},
|
|
@@ -1942,6 +1943,10 @@ export default {
|
|
|
1942
1943
|
if (popupWrapperEl && popupWrapperEl.parentElement) {
|
|
1943
1944
|
popupWrapperEl.parentElement.removeChild(popupWrapperEl);
|
|
1944
1945
|
}
|
|
1946
|
+
const customPopupToElem = $xeTable.$refs.refCustomPopupToElem;
|
|
1947
|
+
if (customPopupToElem && customPopupToElem.parentElement) {
|
|
1948
|
+
customPopupToElem.parentElement.removeChild(customPopupToElem);
|
|
1949
|
+
}
|
|
1945
1950
|
const tableViewportEl = $xeTable.$refs.refTableViewportElem;
|
|
1946
1951
|
if (tableViewportEl) {
|
|
1947
1952
|
tableViewportEl.removeEventListener('wheel', $xeTable.triggerBodyWheelEvent);
|
|
@@ -1960,6 +1965,7 @@ export default {
|
|
|
1960
1965
|
globalEvents.off($xeTable, 'mousewheel');
|
|
1961
1966
|
globalEvents.off($xeTable, 'keydown');
|
|
1962
1967
|
globalEvents.off($xeTable, 'resize');
|
|
1968
|
+
globalEvents.off($xeTable, 'scroll');
|
|
1963
1969
|
globalEvents.off($xeTable, 'contextmenu');
|
|
1964
1970
|
$xeTable.preventEvent(null, 'beforeDestroy');
|
|
1965
1971
|
XEUtils.assign(reactData, createReactData());
|
|
@@ -2011,8 +2017,6 @@ export default {
|
|
|
2011
2017
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
2012
2018
|
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
2013
2019
|
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
2014
|
-
const customSimpleMode = $xeTable.computeCustomSimpleMode;
|
|
2015
|
-
const showCustomSimpleOutside = customSimpleMode === 'outside';
|
|
2016
2020
|
const { isCrossTableDrag } = rowDragOpts;
|
|
2017
2021
|
const tbOns = {
|
|
2018
2022
|
contextmenu: this.contextMenuEvent,
|
|
@@ -2161,18 +2165,6 @@ export default {
|
|
|
2161
2165
|
})
|
|
2162
2166
|
]
|
|
2163
2167
|
: []),
|
|
2164
|
-
/**
|
|
2165
|
-
* 自定义列
|
|
2166
|
-
*/
|
|
2167
|
-
!showCustomSimpleOutside && initStore.custom
|
|
2168
|
-
? h(TableCustomPanelComponent, {
|
|
2169
|
-
key: 'cs',
|
|
2170
|
-
ref: 'refTableCustom',
|
|
2171
|
-
props: {
|
|
2172
|
-
customStore
|
|
2173
|
-
}
|
|
2174
|
-
})
|
|
2175
|
-
: renderEmptyElement($xeTable),
|
|
2176
2168
|
/**
|
|
2177
2169
|
* 加载中
|
|
2178
2170
|
*/
|
|
@@ -2205,15 +2197,16 @@ export default {
|
|
|
2205
2197
|
])
|
|
2206
2198
|
]),
|
|
2207
2199
|
h('div', {
|
|
2208
|
-
key: '
|
|
2200
|
+
key: 'fpw',
|
|
2201
|
+
ref: 'refCustomContainerElem'
|
|
2209
2202
|
}, [
|
|
2210
2203
|
h('div', {
|
|
2211
|
-
ref: '
|
|
2204
|
+
ref: 'refCustomPopupToElem'
|
|
2212
2205
|
}, [
|
|
2213
2206
|
/**
|
|
2214
2207
|
* 自定义列
|
|
2215
2208
|
*/
|
|
2216
|
-
|
|
2209
|
+
initStore.custom
|
|
2217
2210
|
? h(TableCustomPanelComponent, {
|
|
2218
2211
|
key: 'cs',
|
|
2219
2212
|
ref: 'refTableCustom',
|
|
@@ -2221,7 +2214,15 @@ export default {
|
|
|
2221
2214
|
customStore
|
|
2222
2215
|
}
|
|
2223
2216
|
})
|
|
2224
|
-
: renderEmptyElement($xeTable)
|
|
2217
|
+
: renderEmptyElement($xeTable)
|
|
2218
|
+
])
|
|
2219
|
+
]),
|
|
2220
|
+
h('div', {
|
|
2221
|
+
key: 'tpw'
|
|
2222
|
+
}, [
|
|
2223
|
+
h('div', {
|
|
2224
|
+
ref: 'refPopupWrapperElem'
|
|
2225
|
+
}, [
|
|
2225
2226
|
/**
|
|
2226
2227
|
* 筛选
|
|
2227
2228
|
*/
|
package/es/table/src/util.js
CHANGED
|
@@ -82,6 +82,8 @@ export function createInternalData() {
|
|
|
82
82
|
sourceDataRowIdData: {},
|
|
83
83
|
fullColumnIdData: {},
|
|
84
84
|
fullColumnFieldData: {},
|
|
85
|
+
// 当前行
|
|
86
|
+
currentRow: null,
|
|
85
87
|
// 合并表头单元格的数据
|
|
86
88
|
mergeHeaderList: [],
|
|
87
89
|
mergeHeaderMaps: {},
|
|
@@ -130,6 +132,7 @@ export function createInternalData() {
|
|
|
130
132
|
tFooterHeight: 0,
|
|
131
133
|
teleportToWrapperElem: null,
|
|
132
134
|
popupToWrapperElem: null,
|
|
135
|
+
customPopupToElem: null,
|
|
133
136
|
lastSTime: 0,
|
|
134
137
|
inited: false,
|
|
135
138
|
tooltipTimeout: null,
|
|
@@ -172,8 +175,6 @@ export function createReactData() {
|
|
|
172
175
|
isAllSelected: false,
|
|
173
176
|
// 复选框属性,有选中且非全选状态
|
|
174
177
|
isIndeterminate: false,
|
|
175
|
-
// 当前行
|
|
176
|
-
currentRow: null,
|
|
177
178
|
// 单选框属性,选中列
|
|
178
179
|
currentColumn: null,
|
|
179
180
|
// 单选框属性,选中行
|
|
@@ -209,7 +210,7 @@ export function createReactData() {
|
|
|
209
210
|
activeWrapper: false,
|
|
210
211
|
visible: false,
|
|
211
212
|
maxHeight: null,
|
|
212
|
-
|
|
213
|
+
popupStyle: {},
|
|
213
214
|
oldSortMaps: {},
|
|
214
215
|
oldFixedMaps: {},
|
|
215
216
|
oldVisibleMaps: {}
|
|
@@ -370,6 +371,8 @@ export function createReactData() {
|
|
|
370
371
|
resizeHeightFlag: 1,
|
|
371
372
|
resizeWidthFlag: 1,
|
|
372
373
|
isCustomStatus: false,
|
|
374
|
+
isCustomDragStatus: true,
|
|
375
|
+
ctPopupFlag: 1,
|
|
373
376
|
isCrossDragRow: false,
|
|
374
377
|
dragRow: null,
|
|
375
378
|
isCrossDragCol: false,
|