vxe-table 4.21.4 → 4.21.6
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.md +23 -16
- package/dist/all.esm.js +274 -88
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- 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/filter/hook.js +67 -56
- package/es/table/module/keyboard/hook.js +3 -4
- package/es/table/src/body.js +3 -3
- package/es/table/src/footer.js +3 -3
- package/es/table/src/header.js +6 -6
- package/es/table/src/table.js +24 -11
- package/es/table/src/util.js +6 -5
- package/es/table/style.css +1 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +162 -0
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +1 -1
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +272 -96
- 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/filter/hook.js +65 -58
- package/lib/table/module/filter/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +3 -5
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +5 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/footer.js +5 -4
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +10 -8
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +11 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +6 -5
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- 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/dom.js +167 -0
- package/lib/ui/src/dom.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 +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/table/module/custom/hook.ts +1 -1
- package/packages/table/module/filter/hook.ts +67 -53
- package/packages/table/module/keyboard/hook.ts +3 -4
- package/packages/table/src/body.ts +3 -3
- package/packages/table/src/footer.ts +3 -3
- package/packages/table/src/header.ts +6 -6
- package/packages/table/src/table.ts +24 -11
- package/packages/table/src/util.ts +9 -6
- package/packages/ui/src/dom.ts +176 -0
- package/styles/components/table-module/filter.scss +1 -1
- package/styles/theme/base.scss +2 -0
- package/styles/theme/dark.scss +4 -4
- package/styles/theme/light.scss +4 -4
- package/styles/variable.scss +4 -4
- /package/es/{iconfont.1788399047071.ttf → iconfont.1788695187811.ttf} +0 -0
- /package/es/{iconfont.1788399047071.woff → iconfont.1788695187811.woff} +0 -0
- /package/es/{iconfont.1788399047071.woff2 → iconfont.1788695187811.woff2} +0 -0
- /package/lib/{iconfont.1788399047071.ttf → iconfont.1788695187811.ttf} +0 -0
- /package/lib/{iconfont.1788399047071.woff → iconfont.1788695187811.woff} +0 -0
- /package/lib/{iconfont.1788399047071.woff2 → iconfont.1788695187811.woff2} +0 -0
|
@@ -2,7 +2,7 @@ import { nextTick } from 'vue';
|
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
3
|
import { VxeUI } from '../../../ui';
|
|
4
4
|
import { toFilters, handleFieldOrColumn, getRefElem } from '../../src/util';
|
|
5
|
-
import { toCssUnit, triggerEvent,
|
|
5
|
+
import { toCssUnit, triggerEvent, updatePanelPlacement } from '../../../ui/src/dom';
|
|
6
6
|
import { isEnableConf } from '../../../ui/src/utils';
|
|
7
7
|
const { renderer, hooks } = VxeUI;
|
|
8
8
|
const tableFilterMethodKeys = ['openFilter', 'setFilter', 'clearFilter', 'saveFilter', 'saveFilterByEvent', 'saveFilterPanel', 'saveFilterPanelByEvent', 'resetFilter', 'resetFilterByEvent', 'resetFilterPanel', 'resetFilterPanelByEvent', 'getCheckedFilters', 'updateFilterOptionStatus'];
|
|
@@ -19,15 +19,12 @@ hooks.add('tableFilterModule', {
|
|
|
19
19
|
const { filterStore } = reactData;
|
|
20
20
|
const { elemStore } = internalData;
|
|
21
21
|
const { column, targetEl } = filterStore;
|
|
22
|
-
if (!column
|
|
22
|
+
if (!column) {
|
|
23
23
|
return nextTick();
|
|
24
24
|
}
|
|
25
25
|
const tableEl = refElem.value;
|
|
26
|
-
const { scrollTop, scrollLeft, visibleHeight, visibleWidth } = getDomNode();
|
|
27
26
|
const filterOpts = computeFilterOpts.value;
|
|
28
27
|
const { maxHeight: customMaxHeight, transfer, zIndex } = filterOpts;
|
|
29
|
-
const currEl = targetEl;
|
|
30
|
-
const tableRect = tableEl.getBoundingClientRect();
|
|
31
28
|
const filterRender = column ? column.filterRender : null;
|
|
32
29
|
const compConf = filterRender && isEnableConf(filterRender) ? renderer.get(filterRender.name) : null;
|
|
33
30
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
@@ -39,67 +36,82 @@ hooks.add('tableFilterModule', {
|
|
|
39
36
|
if (!filterWrapperElem) {
|
|
40
37
|
return nextTick();
|
|
41
38
|
}
|
|
42
|
-
const btnRect = currEl.getBoundingClientRect();
|
|
43
39
|
const filterHeadElem = filterWrapperElem.querySelector('.vxe-table--filter-header');
|
|
44
40
|
const filterFootElem = filterWrapperElem.querySelector('.vxe-table--filter-footer');
|
|
45
|
-
const filterWidth = filterWrapperElem.offsetWidth;
|
|
46
|
-
const centerWidth = currEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2);
|
|
47
|
-
let left = 0;
|
|
48
|
-
let top = 0;
|
|
49
|
-
let maxHeight = 0;
|
|
50
41
|
/**
|
|
51
42
|
* 是否显示筛选按钮图标
|
|
52
43
|
* 如果不存在图标,则相对单元格居中显示
|
|
53
44
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
45
|
+
const handleStyle = () => {
|
|
46
|
+
let currEl = targetEl;
|
|
47
|
+
if (!targetEl) {
|
|
48
|
+
const headerWrapperElem = getRefElem(elemStore[`${column.fixed || 'main'}-header-wrapper`] || elemStore['main-header-wrapper']);
|
|
49
|
+
const colEl = headerWrapperElem ? headerWrapperElem.querySelector(`.vxe-header--column.${column.id}`) : null;
|
|
50
|
+
if (colEl) {
|
|
51
|
+
currEl = colEl;
|
|
52
|
+
}
|
|
60
53
|
}
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
if (!currEl) {
|
|
55
|
+
return nextTick();
|
|
63
56
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
left =
|
|
67
|
-
top =
|
|
68
|
-
maxHeight =
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
const btnRect = currEl.getBoundingClientRect();
|
|
58
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
59
|
+
let left = 0;
|
|
60
|
+
let top = 0;
|
|
61
|
+
let maxHeight = 0;
|
|
62
|
+
let panelStyle = {};
|
|
63
|
+
if (transfer) {
|
|
64
|
+
const ppObj = updatePanelPlacement(currEl, filterWrapperElem, {
|
|
65
|
+
defaultPlacement: 'bottom',
|
|
66
|
+
isMinWidth: false,
|
|
67
|
+
teleportTo: transfer
|
|
68
|
+
});
|
|
69
|
+
panelStyle = ppObj.style;
|
|
71
70
|
}
|
|
72
|
-
else
|
|
73
|
-
|
|
71
|
+
else {
|
|
72
|
+
const filterWidth = filterWrapperElem.offsetWidth;
|
|
73
|
+
const centerWidth = targetEl ? filterWidth / 2 : ((filterWidth - column.renderWidth) / 2);
|
|
74
|
+
left = btnRect.left - tableRect.left - centerWidth;
|
|
75
|
+
top = btnRect.top - tableRect.top + currEl.clientHeight;
|
|
76
|
+
maxHeight = Math.max(40, tableEl.clientHeight - top - (filterHeadElem ? filterHeadElem.clientHeight : 0) - (filterFootElem ? filterFootElem.clientHeight : 0) - 14);
|
|
77
|
+
if (left < 1) {
|
|
78
|
+
left = 1;
|
|
79
|
+
}
|
|
80
|
+
else if (left > (tableEl.clientWidth - filterWidth - 1)) {
|
|
81
|
+
left = tableEl.clientWidth - filterWidth - 1;
|
|
82
|
+
}
|
|
83
|
+
if ($xeGGWrapper) {
|
|
84
|
+
const wrapperEl = $xeGGWrapper.getRefMaps().refElem.value;
|
|
85
|
+
if (wrapperEl) {
|
|
86
|
+
const wrapperRect = wrapperEl.getBoundingClientRect();
|
|
87
|
+
top += tableRect.top - wrapperRect.top;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
panelStyle = {
|
|
91
|
+
top: toCssUnit(top),
|
|
92
|
+
left: toCssUnit(left)
|
|
93
|
+
};
|
|
74
94
|
}
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
if (zIndex) {
|
|
96
|
+
panelStyle.zIndex = zIndex;
|
|
97
|
+
}
|
|
98
|
+
filterStore.style = panelStyle;
|
|
99
|
+
// 筛选面板是自适应表格高度
|
|
100
|
+
if (compConf ? !compConf.tableFilterAutoHeight : false) {
|
|
101
|
+
maxHeight = 0;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
if (customMaxHeight) {
|
|
105
|
+
maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
|
|
80
106
|
}
|
|
81
107
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
top: toCssUnit(top),
|
|
85
|
-
left: toCssUnit(left)
|
|
108
|
+
// 判断面板不能大于表格高度
|
|
109
|
+
filterStore.maxHeight = maxHeight;
|
|
86
110
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// 筛选面板是自适应表格高度
|
|
92
|
-
if (compConf ? !compConf.tableFilterAutoHeight : false) {
|
|
93
|
-
maxHeight = 0;
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
if (customMaxHeight) {
|
|
97
|
-
maxHeight = customMaxHeight > maxHeight ? maxHeight : customMaxHeight;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
// 判断面板不能大于表格高度
|
|
101
|
-
filterStore.maxHeight = maxHeight;
|
|
102
|
-
return nextTick();
|
|
111
|
+
handleStyle();
|
|
112
|
+
return nextTick().then(() => {
|
|
113
|
+
handleStyle();
|
|
114
|
+
});
|
|
103
115
|
};
|
|
104
116
|
const filterPrivateMethods = {
|
|
105
117
|
checkFilterOptions() {
|
|
@@ -117,15 +129,14 @@ hooks.add('tableFilterModule', {
|
|
|
117
129
|
filterStore.visible = false;
|
|
118
130
|
}
|
|
119
131
|
else {
|
|
120
|
-
const currEl = btnEl || colEl;
|
|
121
132
|
$xeTable.handleFilterOptions(column);
|
|
122
133
|
internalData._currFilterParams = params;
|
|
123
|
-
filterStore.targetEl =
|
|
134
|
+
filterStore.targetEl = btnEl;
|
|
124
135
|
filterStore.style = null;
|
|
125
136
|
filterStore.visible = true;
|
|
126
137
|
initStore.filter = true;
|
|
127
138
|
}
|
|
128
|
-
nextTick(() => {
|
|
139
|
+
nextTick().then(() => {
|
|
129
140
|
updatePopupStyle();
|
|
130
141
|
});
|
|
131
142
|
$xeTable.dispatchEvent('filter-visible', { column, field: column.field, property: column.field, filterList: $xeTable.getCheckedFilters(), visible: filterStore.visible }, evnt);
|
|
@@ -433,11 +433,10 @@ hooks.add('tableKeyboardModule', {
|
|
|
433
433
|
},
|
|
434
434
|
// 处理当前列方向键移动
|
|
435
435
|
moveCurrentColumn(isLeftArrow, isRightArrow, evnt) {
|
|
436
|
-
const {
|
|
437
|
-
const { visibleColumn } = internalData;
|
|
436
|
+
const { currentCol, visibleColumn } = internalData;
|
|
438
437
|
let targetCol = null;
|
|
439
|
-
if (
|
|
440
|
-
const _columnIndex = $xeTable.getVTColumnIndex(
|
|
438
|
+
if (currentCol) {
|
|
439
|
+
const _columnIndex = $xeTable.getVTColumnIndex(currentCol);
|
|
441
440
|
if (isLeftArrow && _columnIndex > 0) {
|
|
442
441
|
targetCol = visibleColumn[_columnIndex - 1];
|
|
443
442
|
}
|
package/es/table/src/body.js
CHANGED
|
@@ -98,8 +98,8 @@ export default defineVxeComponent({
|
|
|
98
98
|
const $xeGrid = $xeTable.xeGrid;
|
|
99
99
|
const $xeGantt = $xeTable.xeGantt;
|
|
100
100
|
const { columnKey, resizable: allResizable, showOverflow: allShowOverflow, border, height, treeConfig, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig, padding: allPadding } = tableProps;
|
|
101
|
-
const { tableData, tableColumn, dragRow, overflowX, overflowY,
|
|
102
|
-
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps } = tableInternalData;
|
|
101
|
+
const { tableData, tableColumn, dragRow, overflowX, overflowY, scrollXLoad, scrollYLoad, mergeBodyFlag, calcCellHeightFlag, resizeHeightFlag, resizeWidthFlag, editStore, isAllOverflow, validErrorMaps, currColFlag } = tableReactData;
|
|
102
|
+
const { fullAllDataRowIdData, fullColumnIdData, mergeBodyCellMaps, visibleColumn, afterFullData, mergeBodyList, scrollXStore, scrollYStore, keepUpdateFieldMaps, currentCol } = tableInternalData;
|
|
103
103
|
const cellOpts = computeCellOpts.value;
|
|
104
104
|
const validOpts = computeValidOpts.value;
|
|
105
105
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
@@ -444,7 +444,7 @@ export default defineVxeComponent({
|
|
|
444
444
|
'col--active': editConfig && isEdit && (actived.row === row && (actived.column === column || editOpts.mode === 'row')),
|
|
445
445
|
'col--valid-error': !!errorValidItem,
|
|
446
446
|
'show--valid-bg': errorValidItem && validOpts.showErrorBackground,
|
|
447
|
-
'col--current':
|
|
447
|
+
'col--current': currColFlag && currentCol === column
|
|
448
448
|
},
|
|
449
449
|
getPropClass(compCellClassName, cellParams),
|
|
450
450
|
getPropClass(className, cellParams),
|
package/es/table/src/footer.js
CHANGED
|
@@ -43,8 +43,8 @@ export default defineVxeComponent({
|
|
|
43
43
|
const $xeGantt = $xeTable.xeGantt;
|
|
44
44
|
const { fixedType } = props;
|
|
45
45
|
const { resizable: allResizable, border, footerCellClassName, footerCellStyle, footerAlign: allFooterAlign, footerSpanMethod, align: allAlign, columnKey, showFooterOverflow: allColumnFooterOverflow } = tableProps;
|
|
46
|
-
const { scrollXLoad, scrollYLoad, overflowX,
|
|
47
|
-
const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore } = tableInternalData;
|
|
46
|
+
const { scrollXLoad, scrollYLoad, overflowX, mergeFootFlag, currColFlag } = tableReactData;
|
|
47
|
+
const { fullColumnIdData, mergeFooterList, mergeFooterCellMaps, scrollXStore, currentCol } = tableInternalData;
|
|
48
48
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
49
49
|
const footerTooltipOpts = computeFooterTooltipOpts.value;
|
|
50
50
|
const resizableOpts = computeResizableOpts.value;
|
|
@@ -180,7 +180,7 @@ export default defineVxeComponent({
|
|
|
180
180
|
'is--pg-left': isCellPaddingLeft,
|
|
181
181
|
'is--pg-right': isCellPaddingRight,
|
|
182
182
|
'col--ellipsis': hasEllipsis,
|
|
183
|
-
'col--current':
|
|
183
|
+
'col--current': currColFlag && currentCol === column
|
|
184
184
|
}, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)] }, attrs), { style: footerCellStyle ? (XEUtils.isFunction(footerCellStyle) ? footerCellStyle(cellParams) : footerCellStyle) : null }), tfOns), { key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag ? column.id : $columnIndex }), [
|
|
185
185
|
h('div', {
|
|
186
186
|
class: ['vxe-cell', {
|
package/es/table/src/header.js
CHANGED
|
@@ -53,8 +53,8 @@ export default defineVxeComponent({
|
|
|
53
53
|
const $xeGantt = $xeTable.xeGantt;
|
|
54
54
|
const { fixedType } = props;
|
|
55
55
|
const { resizable: allResizable, columnKey, showCustomHeader, headerCellClassName, headerCellStyle, showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign, mouseConfig } = tableProps;
|
|
56
|
-
const {
|
|
57
|
-
const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps } = tableInternalData;
|
|
56
|
+
const { dragCol, scrollXLoad, scrollYLoad, overflowX, mergeHeadFlag, tableColumn, currColFlag } = tableReactData;
|
|
57
|
+
const { fullColumnIdData, scrollXStore, mergeHeaderList, mergeHeaderCellMaps, currentCol } = tableInternalData;
|
|
58
58
|
const virtualXOpts = computeVirtualXOpts.value;
|
|
59
59
|
const columnOpts = computeColumnOpts.value;
|
|
60
60
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
@@ -206,7 +206,7 @@ export default defineVxeComponent({
|
|
|
206
206
|
'is--filter-active': hasFilter,
|
|
207
207
|
'is--drag-active': columnOpts.drag && !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
208
208
|
'is--drag-disabled': columnOpts.drag && isDisabledDrag,
|
|
209
|
-
'col--current':
|
|
209
|
+
'col--current': currColFlag && currentCol === column
|
|
210
210
|
},
|
|
211
211
|
headerClassName ? (XEUtils.isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName) : '',
|
|
212
212
|
headerCellClassName ? (XEUtils.isFunction(headerCellClassName) ? headerCellClassName(cellParams) : headerCellClassName) : ''
|
|
@@ -244,8 +244,8 @@ export default defineVxeComponent({
|
|
|
244
244
|
const $xeGantt = $xeTable.xeGantt;
|
|
245
245
|
const { fixedType } = props;
|
|
246
246
|
const { showHeaderOverflow: allColumnHeaderOverflow, headerAlign: allHeaderAlign, align: allAlign } = tableProps;
|
|
247
|
-
const {
|
|
248
|
-
const { fullColumnIdData } = tableInternalData;
|
|
247
|
+
const { overflowX, currColFlag } = tableReactData;
|
|
248
|
+
const { fullColumnIdData, currentCol } = tableInternalData;
|
|
249
249
|
const headerTooltipOpts = computeHeaderTooltipOpts.value;
|
|
250
250
|
const cellOpts = computeCellOpts.value;
|
|
251
251
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
@@ -314,7 +314,7 @@ export default defineVxeComponent({
|
|
|
314
314
|
'fixed--width': !isAutoCellWidth,
|
|
315
315
|
'is--padding': isPadding,
|
|
316
316
|
'is--sortable': column.sortable,
|
|
317
|
-
'col--current':
|
|
317
|
+
'col--current': currColFlag && currentCol === column
|
|
318
318
|
}
|
|
319
319
|
], key: colid }, thAttrs), [
|
|
320
320
|
h('div', {
|
package/es/table/src/table.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, reactive, ref, provide, inject, nextTick, Teleport, onActivated, onDeactivated, onBeforeUnmount, onUnmounted, watch, computed, onMounted } from 'vue';
|
|
2
2
|
import { defineVxeComponent } from '../../ui/src/comp';
|
|
3
3
|
import XEUtils from 'xe-utils';
|
|
4
|
-
import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollTopTo, wheelScrollLeftTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement,
|
|
4
|
+
import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollTopTo, wheelScrollLeftTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasAxternalInputTarget } from '../../ui/src/dom';
|
|
5
5
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
6
6
|
import { VxeUI } from '../../ui';
|
|
7
7
|
import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight, handleCustomStoreConfig, encodeRowid } from './util';
|
|
@@ -298,10 +298,18 @@ export default defineVxeComponent({
|
|
|
298
298
|
return Object.assign({}, getConfig().tooltip, getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
299
299
|
});
|
|
300
300
|
const computeHeaderTooltipOpts = computed(() => {
|
|
301
|
-
|
|
301
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
302
|
+
return Object.assign({}, getConfig().tooltip, {
|
|
303
|
+
enterable: tooltipOpts.enterable,
|
|
304
|
+
defaultPlacement: tooltipOpts.defaultPlacement
|
|
305
|
+
}, getConfig().table.headerTooltipConfig, props.headerTooltipConfig);
|
|
302
306
|
});
|
|
303
307
|
const computeFooterTooltipOpts = computed(() => {
|
|
304
|
-
|
|
308
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
309
|
+
return Object.assign({}, getConfig().tooltip, {
|
|
310
|
+
enterable: tooltipOpts.enterable,
|
|
311
|
+
defaultPlacement: tooltipOpts.defaultPlacement
|
|
312
|
+
}, getConfig().table.footerTooltipConfig, props.footerTooltipConfig);
|
|
305
313
|
});
|
|
306
314
|
const computeTableTipConfig = computed(() => {
|
|
307
315
|
const { tooltipStore } = reactData;
|
|
@@ -6747,7 +6755,7 @@ export default defineVxeComponent({
|
|
|
6747
6755
|
},
|
|
6748
6756
|
getCurrentColumn() {
|
|
6749
6757
|
const columnOpts = computeColumnOpts.value;
|
|
6750
|
-
return columnOpts.isCurrent || props.highlightCurrentColumn ?
|
|
6758
|
+
return columnOpts.isCurrent || props.highlightCurrentColumn ? internalData.currentCol : null;
|
|
6751
6759
|
},
|
|
6752
6760
|
/**
|
|
6753
6761
|
* 用于当前列,设置某列行为高亮状态
|
|
@@ -6759,7 +6767,8 @@ export default defineVxeComponent({
|
|
|
6759
6767
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
6760
6768
|
if (column) {
|
|
6761
6769
|
$xeTable.clearCurrentColumn();
|
|
6762
|
-
|
|
6770
|
+
internalData.currentCol = column;
|
|
6771
|
+
reactData.currColFlag++; // 刷新当前列状态
|
|
6763
6772
|
}
|
|
6764
6773
|
return nextTick().then(() => {
|
|
6765
6774
|
// 更新状选中态
|
|
@@ -6772,7 +6781,8 @@ export default defineVxeComponent({
|
|
|
6772
6781
|
* 用于当前列,手动清空当前高亮的状态
|
|
6773
6782
|
*/
|
|
6774
6783
|
clearCurrentColumn() {
|
|
6775
|
-
|
|
6784
|
+
internalData.currentCol = null;
|
|
6785
|
+
reactData.currColFlag++; // 刷新当前列状态
|
|
6776
6786
|
return nextTick();
|
|
6777
6787
|
},
|
|
6778
6788
|
setPendingRow(rows, status) {
|
|
@@ -8415,8 +8425,7 @@ export default defineVxeComponent({
|
|
|
8415
8425
|
};
|
|
8416
8426
|
const handleGlobalScrollEvent = (evnt) => {
|
|
8417
8427
|
const { filterStore } = reactData;
|
|
8418
|
-
|
|
8419
|
-
if (filterStore.visible && filterOpts.transfer) {
|
|
8428
|
+
if (filterStore.visible) {
|
|
8420
8429
|
$xeTable.handleFilterStyle();
|
|
8421
8430
|
}
|
|
8422
8431
|
reUpdateCustomStyleEvent(evnt);
|
|
@@ -8856,7 +8865,7 @@ export default defineVxeComponent({
|
|
|
8856
8865
|
.then(() => $xeTable.triggerCurrentRowEvent(evnt, params));
|
|
8857
8866
|
}
|
|
8858
8867
|
}
|
|
8859
|
-
else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !
|
|
8868
|
+
else if (keyboardConfig && keyboardOpts.isUndoRedo && isControlKey && (isZ || isY) && !hasAxternalInputTarget(evnt.target)) {
|
|
8860
8869
|
if (evnt.target) {
|
|
8861
8870
|
if (isY || (hasShiftKey && isZ)) {
|
|
8862
8871
|
// 恢复被撤销的操作:Ctrl + Y 或 Ctrl + Shift + Z
|
|
@@ -8962,6 +8971,10 @@ export default defineVxeComponent({
|
|
|
8962
8971
|
}
|
|
8963
8972
|
};
|
|
8964
8973
|
const handleGlobalResizeEvent = () => {
|
|
8974
|
+
const { filterStore } = reactData;
|
|
8975
|
+
if (filterStore.visible) {
|
|
8976
|
+
$xeTable.handleFilterStyle();
|
|
8977
|
+
}
|
|
8965
8978
|
if ($xeTable.closeMenu) {
|
|
8966
8979
|
$xeTable.closeMenu();
|
|
8967
8980
|
}
|
|
@@ -11152,7 +11165,7 @@ export default defineVxeComponent({
|
|
|
11152
11165
|
}
|
|
11153
11166
|
},
|
|
11154
11167
|
triggerCurrentColumnEvent(evnt, params) {
|
|
11155
|
-
const {
|
|
11168
|
+
const { currentCol: oldValue } = internalData;
|
|
11156
11169
|
const columnOpts = computeColumnOpts.value;
|
|
11157
11170
|
const currentColumnOpts = computeCurrentColumnOpts.value;
|
|
11158
11171
|
const beforeRowMethod = currentColumnOpts.beforeSelectMethod || columnOpts.currentMethod;
|
|
@@ -13352,9 +13365,9 @@ export default defineVxeComponent({
|
|
|
13352
13365
|
},
|
|
13353
13366
|
setHoverRow(row) {
|
|
13354
13367
|
const $xeGanttView = internalData.xeGanttView;
|
|
13368
|
+
$xeTable.clearHoverRow();
|
|
13355
13369
|
const rowid = getRowid($xeTable, row);
|
|
13356
13370
|
const el = refElem.value;
|
|
13357
|
-
$xeTable.clearHoverRow();
|
|
13358
13371
|
if (el) {
|
|
13359
13372
|
XEUtils.arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`), elem => addClass(elem, 'row--hover'));
|
|
13360
13373
|
}
|
package/es/table/src/util.js
CHANGED
|
@@ -38,6 +38,10 @@ export function createInternalData() {
|
|
|
38
38
|
customMaxHeight: 0,
|
|
39
39
|
// 当前 hover 行
|
|
40
40
|
hoverRow: null,
|
|
41
|
+
hoverCol: null,
|
|
42
|
+
// 当前行
|
|
43
|
+
currentRow: null,
|
|
44
|
+
currentCol: null,
|
|
41
45
|
// 最后滚动位置
|
|
42
46
|
lastScrollLeft: 0,
|
|
43
47
|
lastScrollTop: 0,
|
|
@@ -85,8 +89,6 @@ export function createInternalData() {
|
|
|
85
89
|
fullColumnFieldData: {},
|
|
86
90
|
fullCellHeightMaps: {},
|
|
87
91
|
fullCellStoreMaps: {},
|
|
88
|
-
// 当前行
|
|
89
|
-
currentRow: null,
|
|
90
92
|
// 合并表头单元格的数据
|
|
91
93
|
mergeHeaderList: [],
|
|
92
94
|
mergeHeaderMaps: {},
|
|
@@ -186,8 +188,6 @@ export function createReactData() {
|
|
|
186
188
|
isAllSelected: false,
|
|
187
189
|
// 复选框属性,有选中且非全选状态
|
|
188
190
|
isIndeterminate: false,
|
|
189
|
-
// 单选框属性,选中列
|
|
190
|
-
currentColumn: null,
|
|
191
191
|
// 单选框属性,选中行
|
|
192
192
|
selectRadioRow: null,
|
|
193
193
|
// 表尾合计数据
|
|
@@ -396,7 +396,8 @@ export function createReactData() {
|
|
|
396
396
|
dragTipText: '',
|
|
397
397
|
isDragResize: false,
|
|
398
398
|
isRowLoading: false,
|
|
399
|
-
isColLoading: false
|
|
399
|
+
isColLoading: false,
|
|
400
|
+
currColFlag: 1
|
|
400
401
|
};
|
|
401
402
|
}
|
|
402
403
|
const maxKey = '__max';
|
package/es/table/style.css
CHANGED
|
@@ -1644,7 +1644,7 @@
|
|
|
1644
1644
|
padding-top: 0.2em;
|
|
1645
1645
|
}
|
|
1646
1646
|
.vxe-table--filter-wrapper .vxe-table--filter-body {
|
|
1647
|
-
max-height:
|
|
1647
|
+
max-height: var(--vxe-ui-vxe-table-filter-default-max-height);
|
|
1648
1648
|
padding-bottom: 0.2em;
|
|
1649
1649
|
}
|
|
1650
1650
|
.vxe-table--filter-wrapper > ul {
|