vxe-table 3.15.28 → 3.15.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid/src/grid.js +39 -42
- 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/edit/mixin.js +11 -27
- package/es/table/module/export/mixin.js +65 -139
- package/es/table/module/filter/mixin.js +1 -0
- package/es/table/module/menu/mixin.js +2 -6
- package/es/table/module/validator/mixin.js +99 -41
- package/es/table/src/methods.js +110 -89
- package/es/table/src/table.js +6 -8
- package/es/table/style.css +6 -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 +6 -0
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +24 -26
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +358 -615
- 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/edit/mixin.js +11 -27
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +78 -168
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/filter/mixin.js +1 -0
- package/lib/table/module/menu/mixin.js +2 -6
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/validator/mixin.js +97 -40
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/src/methods.js +121 -95
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +8 -10
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +6 -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 +6 -0
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +39 -41
- package/packages/table/module/edit/mixin.ts +11 -27
- package/packages/table/module/export/mixin.ts +96 -158
- package/packages/table/module/filter/mixin.ts +1 -0
- package/packages/table/module/menu/mixin.ts +2 -6
- package/packages/table/module/validator/mixin.ts +101 -40
- package/packages/table/src/methods.ts +115 -90
- package/packages/table/src/table.ts +6 -8
- package/styles/components/table.scss +14 -0
- /package/es/{iconfont.1747176212818.ttf → iconfont.1747357311626.ttf} +0 -0
- /package/es/{iconfont.1747176212818.woff → iconfont.1747357311626.woff} +0 -0
- /package/es/{iconfont.1747176212818.woff2 → iconfont.1747357311626.woff2} +0 -0
- /package/lib/{iconfont.1747176212818.ttf → iconfont.1747357311626.ttf} +0 -0
- /package/lib/{iconfont.1747176212818.woff → iconfont.1747357311626.woff} +0 -0
- /package/lib/{iconfont.1747176212818.woff2 → iconfont.1747357311626.woff2} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import { VxeUI } from '../../../ui';
|
|
3
|
-
import { getFuncText
|
|
3
|
+
import { getFuncText } from '../../../ui/src/utils';
|
|
4
4
|
import { scrollToView } from '../../../ui/src/dom';
|
|
5
5
|
import { handleFieldOrColumn, getRowid } from '../../src/util';
|
|
6
6
|
import { warnLog, errLog } from '../../../ui/src/log';
|
|
@@ -39,27 +39,103 @@ class Rule {
|
|
|
39
39
|
return this.content;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
// 如果存在 pattern,判断正则
|
|
43
|
+
function validREValue(pattern, val) {
|
|
44
|
+
if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
// 如果存在 max,判断最大值
|
|
50
|
+
function validMaxValue(max, num) {
|
|
51
|
+
if (!XEUtils.eqNull(max) && num > XEUtils.toNumber(max)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
// 如果存在 min,判断最小值
|
|
57
|
+
function validMinValue(min, num) {
|
|
58
|
+
if (!XEUtils.eqNull(min) && num < XEUtils.toNumber(min)) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
function validRuleValue(rule, val, required) {
|
|
43
64
|
const { type, min, max, pattern } = rule;
|
|
65
|
+
const isArrType = type === 'array';
|
|
44
66
|
const isNumType = type === 'number';
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
67
|
+
const isStrType = type === 'string';
|
|
68
|
+
const strVal = `${val}`;
|
|
69
|
+
if (!validREValue(pattern, strVal)) {
|
|
70
|
+
return false;
|
|
49
71
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
72
|
+
if (isArrType) {
|
|
73
|
+
if (!XEUtils.isArray(val)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
if (required) {
|
|
77
|
+
if (!val.length) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!validMinValue(min, val.length)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (!validMaxValue(max, val.length)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
53
87
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
88
|
+
else if (isNumType) {
|
|
89
|
+
const numVal = Number(val);
|
|
90
|
+
if (isNaN(numVal)) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
if (!validMinValue(min, numVal)) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
if (!validMaxValue(max, numVal)) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
57
99
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
100
|
+
else {
|
|
101
|
+
if (isStrType) {
|
|
102
|
+
if (!XEUtils.isString(val)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (required) {
|
|
107
|
+
if (!strVal) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (!validMinValue(min, strVal.length)) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
if (!validMaxValue(max, strVal.length)) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
function checkRuleStatus(rule, val) {
|
|
121
|
+
const { required } = rule;
|
|
122
|
+
const isEmptyVal = XEUtils.eqNull(val);
|
|
123
|
+
if (required) {
|
|
124
|
+
if (isEmptyVal) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
if (!validRuleValue(rule, val, required)) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
if (!isEmptyVal) {
|
|
133
|
+
if (!validRuleValue(rule, val, required)) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
61
137
|
}
|
|
62
|
-
return
|
|
138
|
+
return true;
|
|
63
139
|
}
|
|
64
140
|
export default {
|
|
65
141
|
methods: {
|
|
@@ -67,10 +143,8 @@ export default {
|
|
|
67
143
|
* 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
|
|
68
144
|
*/
|
|
69
145
|
_fullValidate(rows, cb) {
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
|
|
73
|
-
}
|
|
146
|
+
if (XEUtils.isFunction(cb)) {
|
|
147
|
+
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)']);
|
|
74
148
|
}
|
|
75
149
|
return this.beginValidate(rows, null, cb, true);
|
|
76
150
|
},
|
|
@@ -78,10 +152,8 @@ export default {
|
|
|
78
152
|
* 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
|
|
79
153
|
*/
|
|
80
154
|
_validate(rows, cb) {
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
|
|
84
|
-
}
|
|
155
|
+
if (XEUtils.isFunction(cb)) {
|
|
156
|
+
warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)']);
|
|
85
157
|
}
|
|
86
158
|
return this.beginValidate(rows, null, cb);
|
|
87
159
|
},
|
|
@@ -323,7 +395,7 @@ export default {
|
|
|
323
395
|
if (rules) {
|
|
324
396
|
const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, property) : val;
|
|
325
397
|
rules.forEach((rule) => {
|
|
326
|
-
const {
|
|
398
|
+
const { trigger, validator } = rule;
|
|
327
399
|
if (validType === 'all' || !trigger || validType === trigger) {
|
|
328
400
|
if (validator) {
|
|
329
401
|
const validParams = {
|
|
@@ -346,9 +418,7 @@ export default {
|
|
|
346
418
|
customValid = tcvMethod(validParams);
|
|
347
419
|
}
|
|
348
420
|
else {
|
|
349
|
-
|
|
350
|
-
warnLog('vxe.error.notValidators', [validator]);
|
|
351
|
-
}
|
|
421
|
+
errLog('vxe.error.notValidators', [validator]);
|
|
352
422
|
}
|
|
353
423
|
}
|
|
354
424
|
else {
|
|
@@ -373,19 +443,7 @@ export default {
|
|
|
373
443
|
}
|
|
374
444
|
}
|
|
375
445
|
else {
|
|
376
|
-
|
|
377
|
-
const isArrVal = XEUtils.isArray(cellValue);
|
|
378
|
-
let hasEmpty = true;
|
|
379
|
-
if (isArrType || isArrVal) {
|
|
380
|
-
hasEmpty = !isArrVal || !cellValue.length;
|
|
381
|
-
}
|
|
382
|
-
else if (XEUtils.isString(cellValue)) {
|
|
383
|
-
hasEmpty = eqEmptyValue(cellValue.trim());
|
|
384
|
-
}
|
|
385
|
-
else {
|
|
386
|
-
hasEmpty = eqEmptyValue(cellValue);
|
|
387
|
-
}
|
|
388
|
-
if (required ? (hasEmpty || validErrorRuleValue(rule, cellValue)) : (!hasEmpty && validErrorRuleValue(rule, cellValue))) {
|
|
446
|
+
if (!checkRuleStatus(rule, cellValue)) {
|
|
389
447
|
this.validRuleErr = true;
|
|
390
448
|
errorRules.push(new Rule(rule));
|
|
391
449
|
}
|
package/es/table/src/methods.js
CHANGED
|
@@ -3,7 +3,7 @@ import { getTpImg, isPx, isScale, hasClass, addClass, removeClass, getEventTarge
|
|
|
3
3
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils';
|
|
4
4
|
import { VxeUI } from '../../ui';
|
|
5
5
|
import Cell from './cell';
|
|
6
|
-
import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem } from './util';
|
|
6
|
+
import { getRowUniqueId, clearTableAllStatus, toFilters, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getColReMinWidth, createHandleUpdateRowId, createHandleGetRowId, getRefElem } from './util';
|
|
7
7
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
8
8
|
import { warnLog, errLog } from '../../ui/src/log';
|
|
9
9
|
const { getConfig, getI18n, renderer, formats, interceptor, createEvent } = VxeUI;
|
|
@@ -23,8 +23,9 @@ function eqCellValue(row1, row2, field) {
|
|
|
23
23
|
}
|
|
24
24
|
return XEUtils.isEqual(val1, val2);
|
|
25
25
|
}
|
|
26
|
-
function getNextSortOrder(
|
|
27
|
-
const
|
|
26
|
+
function getNextSortOrder($xeTable, column) {
|
|
27
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
28
|
+
const { orders = [] } = sortOpts;
|
|
28
29
|
const currOrder = column.order || null;
|
|
29
30
|
const oIndex = orders.indexOf(currOrder) + 1;
|
|
30
31
|
return orders[oIndex < orders.length ? oIndex : 0];
|
|
@@ -1949,8 +1950,57 @@ function removeFooterMerges($xeTable, merges) {
|
|
|
1949
1950
|
}
|
|
1950
1951
|
return rest;
|
|
1951
1952
|
}
|
|
1952
|
-
function
|
|
1953
|
-
|
|
1953
|
+
function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
|
|
1954
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
1955
|
+
const { multiple, remote, orders } = sortOpts;
|
|
1956
|
+
if (!XEUtils.isArray(sortConfs)) {
|
|
1957
|
+
sortConfs = [sortConfs];
|
|
1958
|
+
}
|
|
1959
|
+
if (sortConfs && sortConfs.length) {
|
|
1960
|
+
if (!multiple) {
|
|
1961
|
+
sortConfs = [sortConfs[0]];
|
|
1962
|
+
clearAllSort($xeTable);
|
|
1963
|
+
}
|
|
1964
|
+
let firstColumn = null;
|
|
1965
|
+
sortConfs.forEach((confs, index) => {
|
|
1966
|
+
let { field, order } = confs;
|
|
1967
|
+
let column = field;
|
|
1968
|
+
if (XEUtils.isString(field)) {
|
|
1969
|
+
column = $xeTable.getColumnByField(field);
|
|
1970
|
+
}
|
|
1971
|
+
if (!firstColumn) {
|
|
1972
|
+
firstColumn = column;
|
|
1973
|
+
}
|
|
1974
|
+
if (column && column.sortable) {
|
|
1975
|
+
if (orders && orders.indexOf(order) === -1) {
|
|
1976
|
+
order = getNextSortOrder($xeTable, column);
|
|
1977
|
+
}
|
|
1978
|
+
if (column.order !== order) {
|
|
1979
|
+
column.order = order;
|
|
1980
|
+
}
|
|
1981
|
+
column.sortTime = Date.now() + index;
|
|
1982
|
+
}
|
|
1983
|
+
});
|
|
1984
|
+
if (isUpdate) {
|
|
1985
|
+
if (!remote) {
|
|
1986
|
+
$xeTable.handleTableData(true);
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
if (evnt) {
|
|
1990
|
+
$xeTable.handleColumnSortEvent(evnt, firstColumn);
|
|
1991
|
+
}
|
|
1992
|
+
return $xeTable.$nextTick().then(() => {
|
|
1993
|
+
updateRowOffsetTop($xeTable);
|
|
1994
|
+
$xeTable.updateCellAreas();
|
|
1995
|
+
return updateStyle($xeTable);
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
return $xeTable.$nextTick();
|
|
1999
|
+
}
|
|
2000
|
+
function clearAllSort($xeTable) {
|
|
2001
|
+
const internalData = $xeTable;
|
|
2002
|
+
const { tableFullColumn } = internalData;
|
|
2003
|
+
tableFullColumn.forEach((column) => {
|
|
1954
2004
|
column.order = null;
|
|
1955
2005
|
});
|
|
1956
2006
|
}
|
|
@@ -2969,7 +3019,6 @@ function parseColumns($xeTable, isReset) {
|
|
|
2969
3019
|
// }
|
|
2970
3020
|
// }
|
|
2971
3021
|
// }
|
|
2972
|
-
// if (process.env.NODE_ENV === 'development') {
|
|
2973
3022
|
// if (props.showHeader && !props.showHeaderOverflow) {
|
|
2974
3023
|
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
2975
3024
|
// }
|
|
@@ -2982,7 +3031,6 @@ function parseColumns($xeTable, isReset) {
|
|
|
2982
3031
|
if (props.footerSpanMethod) {
|
|
2983
3032
|
warnLog('vxe.error.scrollErrProp', ['footer-span-method']);
|
|
2984
3033
|
}
|
|
2985
|
-
// }
|
|
2986
3034
|
if (isReset) {
|
|
2987
3035
|
const { visibleSize } = handleVirtualXVisible($xeTable);
|
|
2988
3036
|
scrollXStore.startIndex = 0;
|
|
@@ -3162,7 +3210,7 @@ function lazyScrollYData($xeTable) {
|
|
|
3162
3210
|
function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
3163
3211
|
const reactData = $xeTable;
|
|
3164
3212
|
const internalData = $xeTable;
|
|
3165
|
-
const { scrollXLoad, scrollYLoad } = reactData;
|
|
3213
|
+
const { scrollXLoad, scrollYLoad, isAllOverflow } = reactData;
|
|
3166
3214
|
const { lcsTimeout } = internalData;
|
|
3167
3215
|
if (lcsTimeout) {
|
|
3168
3216
|
clearTimeout(lcsTimeout);
|
|
@@ -3177,13 +3225,19 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
|
3177
3225
|
internalData.inBodyScroll = false;
|
|
3178
3226
|
internalData.inFooterScroll = false;
|
|
3179
3227
|
internalData.scrollRenderType = '';
|
|
3180
|
-
|
|
3228
|
+
if (!isAllOverflow) {
|
|
3229
|
+
calcCellHeight($xeTable);
|
|
3230
|
+
updateRowOffsetTop($xeTable);
|
|
3231
|
+
}
|
|
3181
3232
|
if (isRollX && scrollXLoad) {
|
|
3182
3233
|
$xeTable.updateScrollXData();
|
|
3183
3234
|
}
|
|
3184
3235
|
if (isRollY && scrollYLoad) {
|
|
3185
3236
|
$xeTable.updateScrollYData().then(() => {
|
|
3186
|
-
|
|
3237
|
+
if (!isAllOverflow) {
|
|
3238
|
+
calcCellHeight($xeTable);
|
|
3239
|
+
updateRowOffsetTop($xeTable);
|
|
3240
|
+
}
|
|
3187
3241
|
$xeTable.updateScrollYSpace();
|
|
3188
3242
|
});
|
|
3189
3243
|
}
|
|
@@ -3630,9 +3684,7 @@ const Methods = {
|
|
|
3630
3684
|
this.tableData = tableData.slice(0);
|
|
3631
3685
|
}
|
|
3632
3686
|
else {
|
|
3633
|
-
|
|
3634
|
-
warnLog('vxe.error.reqProp', ['keep-source']);
|
|
3635
|
-
}
|
|
3687
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
3636
3688
|
}
|
|
3637
3689
|
return this.$nextTick();
|
|
3638
3690
|
},
|
|
@@ -3866,16 +3918,12 @@ const Methods = {
|
|
|
3866
3918
|
getVMRowIndex: createGetRowCacheProp('$index'),
|
|
3867
3919
|
// 在 v3 中废弃
|
|
3868
3920
|
_getRowIndex(row) {
|
|
3869
|
-
|
|
3870
|
-
warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
|
|
3871
|
-
}
|
|
3921
|
+
warnLog('vxe.error.delFunc', ['_getRowIndex', 'getVTRowIndex']);
|
|
3872
3922
|
return this.getVTRowIndex(row);
|
|
3873
3923
|
},
|
|
3874
3924
|
// 在 v3 中废弃
|
|
3875
3925
|
$getRowIndex(row) {
|
|
3876
|
-
|
|
3877
|
-
warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
|
|
3878
|
-
}
|
|
3926
|
+
warnLog('vxe.error.delFunc', ['$getRowIndex', 'getVMRowIndex']);
|
|
3879
3927
|
return this.getVMRowIndex(row);
|
|
3880
3928
|
},
|
|
3881
3929
|
/**
|
|
@@ -3895,16 +3943,12 @@ const Methods = {
|
|
|
3895
3943
|
getVMColumnIndex: createGetColumnCacheProp('$index'),
|
|
3896
3944
|
// 在 v3 中废弃
|
|
3897
3945
|
_getColumnIndex(column) {
|
|
3898
|
-
|
|
3899
|
-
warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
|
|
3900
|
-
}
|
|
3946
|
+
warnLog('vxe.error.delFunc', ['_getColumnIndex', 'getVTColumnIndex']);
|
|
3901
3947
|
return this.getVTColumnIndex(column);
|
|
3902
3948
|
},
|
|
3903
3949
|
// 在 v3 中废弃
|
|
3904
3950
|
$getColumnIndex(column) {
|
|
3905
|
-
|
|
3906
|
-
warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
|
|
3907
|
-
}
|
|
3951
|
+
warnLog('vxe.error.delFunc', ['$getColumnIndex', 'getVMColumnIndex']);
|
|
3908
3952
|
return this.getVMColumnIndex(column);
|
|
3909
3953
|
},
|
|
3910
3954
|
/**
|
|
@@ -4007,9 +4051,7 @@ const Methods = {
|
|
|
4007
4051
|
const { transform } = treeOpts;
|
|
4008
4052
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
4009
4053
|
if (!keepSource) {
|
|
4010
|
-
|
|
4011
|
-
errLog('vxe.error.reqProp', ['keep-source']);
|
|
4012
|
-
}
|
|
4054
|
+
errLog('vxe.error.reqProp', ['keep-source']);
|
|
4013
4055
|
return $xeTable.$nextTick();
|
|
4014
4056
|
}
|
|
4015
4057
|
let targetRows = rows;
|
|
@@ -4624,6 +4666,7 @@ const Methods = {
|
|
|
4624
4666
|
}
|
|
4625
4667
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4626
4668
|
column.fixed = fixed;
|
|
4669
|
+
column.renderFixed = fixed;
|
|
4627
4670
|
});
|
|
4628
4671
|
$xeTable.saveCustomStore('update:fixed');
|
|
4629
4672
|
if (!status) {
|
|
@@ -4649,6 +4692,7 @@ const Methods = {
|
|
|
4649
4692
|
if (targetColumn && targetColumn.fixed) {
|
|
4650
4693
|
XEUtils.eachTree([targetColumn], (column) => {
|
|
4651
4694
|
column.fixed = null;
|
|
4695
|
+
column.renderFixed = null;
|
|
4652
4696
|
});
|
|
4653
4697
|
$xeTable.saveCustomStore('update:fixed');
|
|
4654
4698
|
if (!status) {
|
|
@@ -5544,10 +5588,8 @@ const Methods = {
|
|
|
5544
5588
|
// 兼容老版本
|
|
5545
5589
|
if (!evntList.length && type === 'event.clearEdit') {
|
|
5546
5590
|
evntList = interceptor.get('event.clearActived');
|
|
5547
|
-
if (
|
|
5548
|
-
|
|
5549
|
-
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit']);
|
|
5550
|
-
}
|
|
5591
|
+
if (evntList.length) {
|
|
5592
|
+
warnLog('vxe.error.delEvent', ['event.clearActived', 'event.clearEdit']);
|
|
5551
5593
|
}
|
|
5552
5594
|
}
|
|
5553
5595
|
// 兼容老版本
|
|
@@ -6233,10 +6275,14 @@ const Methods = {
|
|
|
6233
6275
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
6234
6276
|
const ctEl = tdEl.querySelector('.vxe-cell--wrapper');
|
|
6235
6277
|
let ovEl = null;
|
|
6278
|
+
let tipEl = tdEl.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
6236
6279
|
if (column.treeNode) {
|
|
6237
6280
|
ovEl = tdEl.querySelector('.vxe-tree-cell');
|
|
6238
6281
|
}
|
|
6239
|
-
|
|
6282
|
+
if (!tipEl) {
|
|
6283
|
+
tipEl = ctEl;
|
|
6284
|
+
}
|
|
6285
|
+
handleTooltip($xeTable, evnt, tdEl, ovEl || ctEl, tipEl, params);
|
|
6240
6286
|
}
|
|
6241
6287
|
},
|
|
6242
6288
|
/**
|
|
@@ -6250,7 +6296,16 @@ const Methods = {
|
|
|
6250
6296
|
const tdEl = evnt.currentTarget;
|
|
6251
6297
|
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row);
|
|
6252
6298
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
6253
|
-
|
|
6299
|
+
const ctEl = tdEl.querySelector('.vxe-cell--wrapper');
|
|
6300
|
+
let ovEl = null;
|
|
6301
|
+
let tipEl = tdEl.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
6302
|
+
if (column.type === 'html') {
|
|
6303
|
+
ovEl = tdEl.querySelector('.vxe-cell--html');
|
|
6304
|
+
}
|
|
6305
|
+
if (!tipEl) {
|
|
6306
|
+
tipEl = ctEl;
|
|
6307
|
+
}
|
|
6308
|
+
handleTooltip($xeTable, evnt, tdEl, ovEl || ctEl, tipEl, params);
|
|
6254
6309
|
}
|
|
6255
6310
|
},
|
|
6256
6311
|
openTooltip(target, content) {
|
|
@@ -8267,49 +8322,12 @@ const Methods = {
|
|
|
8267
8322
|
},
|
|
8268
8323
|
setSort(sortConfs, isUpdate) {
|
|
8269
8324
|
const $xeTable = this;
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8275
|
-
|
|
8276
|
-
if (!multiple) {
|
|
8277
|
-
sortConfs = [sortConfs[0]];
|
|
8278
|
-
clearAllSort($xeTable);
|
|
8279
|
-
}
|
|
8280
|
-
let firstColumn = null;
|
|
8281
|
-
sortConfs.forEach((confs, index) => {
|
|
8282
|
-
let { field, order } = confs;
|
|
8283
|
-
let column = field;
|
|
8284
|
-
if (XEUtils.isString(field)) {
|
|
8285
|
-
column = $xeTable.getColumnByField(field);
|
|
8286
|
-
}
|
|
8287
|
-
if (!firstColumn) {
|
|
8288
|
-
firstColumn = column;
|
|
8289
|
-
}
|
|
8290
|
-
if (column && column.sortable) {
|
|
8291
|
-
if (orders && orders.indexOf(order) === -1) {
|
|
8292
|
-
order = getNextSortOrder($xeTable, column);
|
|
8293
|
-
}
|
|
8294
|
-
if (column.order !== order) {
|
|
8295
|
-
column.order = order;
|
|
8296
|
-
}
|
|
8297
|
-
column.sortTime = Date.now() + index;
|
|
8298
|
-
}
|
|
8299
|
-
});
|
|
8300
|
-
if (isUpdate) {
|
|
8301
|
-
if (!remote) {
|
|
8302
|
-
$xeTable.handleTableData(true);
|
|
8303
|
-
}
|
|
8304
|
-
$xeTable.handleColumnSortEvent(new Event('click'), firstColumn);
|
|
8305
|
-
}
|
|
8306
|
-
return $xeTable.$nextTick().then(() => {
|
|
8307
|
-
updateRowOffsetTop($xeTable);
|
|
8308
|
-
$xeTable.updateCellAreas();
|
|
8309
|
-
return updateStyle($xeTable);
|
|
8310
|
-
});
|
|
8311
|
-
}
|
|
8312
|
-
return $xeTable.$nextTick();
|
|
8325
|
+
// 已废弃,即将去掉事件触发 new Event('click') -> null
|
|
8326
|
+
return handleSortEvent($xeTable, new Event('click'), sortConfs, isUpdate);
|
|
8327
|
+
},
|
|
8328
|
+
setSortByEvent(evnt, sortConfs, isUpdate) {
|
|
8329
|
+
const $xeTable = this;
|
|
8330
|
+
return handleSortEvent($xeTable, evnt, sortConfs, isUpdate);
|
|
8313
8331
|
},
|
|
8314
8332
|
/**
|
|
8315
8333
|
* 清空指定列的排序条件
|
|
@@ -8376,9 +8394,7 @@ const Methods = {
|
|
|
8376
8394
|
},
|
|
8377
8395
|
// 在 v3 中废弃
|
|
8378
8396
|
getSortColumn() {
|
|
8379
|
-
|
|
8380
|
-
warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns']);
|
|
8381
|
-
}
|
|
8397
|
+
warnLog('vxe.error.delFunc', ['getSortColumn', 'getSortColumns']);
|
|
8382
8398
|
return XEUtils.find(this.tableFullColumn, column => (column.sortable || column.remoteSort) && column.order);
|
|
8383
8399
|
},
|
|
8384
8400
|
isSort(fieldOrColumn) {
|
|
@@ -8402,6 +8418,17 @@ const Methods = {
|
|
|
8402
8418
|
}
|
|
8403
8419
|
return sortList;
|
|
8404
8420
|
},
|
|
8421
|
+
setFilterByEvent(evnt, fieldOrColumn, options, isUpdate) {
|
|
8422
|
+
const $xeTable = this;
|
|
8423
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
8424
|
+
if (column && column.filters) {
|
|
8425
|
+
column.filters = toFilters(options || []);
|
|
8426
|
+
if (isUpdate) {
|
|
8427
|
+
return $xeTable.handleColumnConfirmFilter(column, evnt);
|
|
8428
|
+
}
|
|
8429
|
+
}
|
|
8430
|
+
return $xeTable.$nextTick();
|
|
8431
|
+
},
|
|
8405
8432
|
/**
|
|
8406
8433
|
* 关闭筛选
|
|
8407
8434
|
* @param {Event} evnt 事件
|
|
@@ -8531,9 +8558,7 @@ const Methods = {
|
|
|
8531
8558
|
return $xeTable.$nextTick();
|
|
8532
8559
|
},
|
|
8533
8560
|
reloadExpandContent(row) {
|
|
8534
|
-
|
|
8535
|
-
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand']);
|
|
8536
|
-
}
|
|
8561
|
+
warnLog('vxe.error.delFunc', ['reloadExpandContent', 'reloadRowExpand']);
|
|
8537
8562
|
// 即将废弃
|
|
8538
8563
|
return this.reloadRowExpand(row);
|
|
8539
8564
|
},
|
|
@@ -8676,9 +8701,7 @@ const Methods = {
|
|
|
8676
8701
|
return !!rowExpandedFlag && !!rowExpandedMaps[rowid];
|
|
8677
8702
|
},
|
|
8678
8703
|
isExpandByRow(row) {
|
|
8679
|
-
|
|
8680
|
-
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
|
|
8681
|
-
}
|
|
8704
|
+
warnLog('vxe.error.delFunc', ['isExpandByRow', 'isRowExpandByRow']);
|
|
8682
8705
|
// 即将废弃
|
|
8683
8706
|
return this.isRowExpandByRow(row);
|
|
8684
8707
|
},
|
|
@@ -8906,9 +8929,7 @@ const Methods = {
|
|
|
8906
8929
|
},
|
|
8907
8930
|
reloadTreeChilds(row) {
|
|
8908
8931
|
const $xeTable = this;
|
|
8909
|
-
|
|
8910
|
-
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
|
|
8911
|
-
}
|
|
8932
|
+
warnLog('vxe.error.delFunc', ['reloadTreeChilds', 'reloadTreeExpand']);
|
|
8912
8933
|
// 即将废弃
|
|
8913
8934
|
return $xeTable.reloadTreeExpand(row);
|
|
8914
8935
|
},
|
package/es/table/src/table.js
CHANGED
|
@@ -1686,14 +1686,12 @@ export default {
|
|
|
1686
1686
|
if (columnOpts.drag || rowOpts.drag || customOpts.allowSort) {
|
|
1687
1687
|
initTpImg();
|
|
1688
1688
|
}
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
warnLog('vxe.error.reqProp', ['tooltip-config']);
|
|
1696
|
-
}
|
|
1689
|
+
const { $listeners } = this;
|
|
1690
|
+
if (!this.menuConfig && ($listeners['menu-click'] || $listeners['cell-menu'] || $listeners['header-cell-menu'] || $listeners['footer-cell-menu'])) {
|
|
1691
|
+
warnLog('vxe.error.reqProp', ['menu-config']);
|
|
1692
|
+
}
|
|
1693
|
+
if (!this.tooltipConfig && ($listeners['cell-mouseenter'] || $listeners['cell-mouseleave'])) {
|
|
1694
|
+
warnLog('vxe.error.reqProp', ['tooltip-config']);
|
|
1697
1695
|
}
|
|
1698
1696
|
// 使用已安装的组件,如果未安装则不渲染
|
|
1699
1697
|
const VxeUILoadingComponent = VxeUI.getComponent('VxeLoading');
|
package/es/table/style.css
CHANGED
|
@@ -2550,6 +2550,12 @@
|
|
|
2550
2550
|
.vxe-table--render-default .vxe-footer--column.col--right > .vxe-cell {
|
|
2551
2551
|
justify-content: right;
|
|
2552
2552
|
}
|
|
2553
|
+
.vxe-table--render-default .vxe-header--column.col--ellipsis.col--center .vxe-cell--wrapper {
|
|
2554
|
+
justify-content: center;
|
|
2555
|
+
}
|
|
2556
|
+
.vxe-table--render-default .vxe-header--column.col--ellipsis.col--right .vxe-cell--wrapper {
|
|
2557
|
+
justify-content: right;
|
|
2558
|
+
}
|
|
2553
2559
|
.vxe-table--render-default .vxe-header--column.col--ellipsis.col--center .vxe-cell,
|
|
2554
2560
|
.vxe-table--render-default .vxe-footer--column.col--ellipsis.col--center .vxe-cell {
|
|
2555
2561
|
justify-content: center;
|