vxe-table 3.11.18 → 3.11.21
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/panel.js +3 -0
- package/es/table/src/body.js +2 -1
- package/es/table/src/methods.js +64 -33
- package/es/table/src/table.js +7 -2
- package/es/ui/index.js +8 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +93 -42
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +3 -0
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/body.js +2 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +71 -37
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +7 -2
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +8 -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/panel.ts +3 -0
- package/packages/table/src/body.ts +2 -1
- package/packages/table/src/methods.ts +74 -38
- package/packages/table/src/table.ts +7 -2
- package/packages/ui/index.ts +7 -0
- /package/es/{iconfont.1733356525791.ttf → iconfont.1733469864818.ttf} +0 -0
- /package/es/{iconfont.1733356525791.woff → iconfont.1733469864818.woff} +0 -0
- /package/es/{iconfont.1733356525791.woff2 → iconfont.1733469864818.woff2} +0 -0
- /package/lib/{iconfont.1733356525791.ttf → iconfont.1733469864818.ttf} +0 -0
- /package/lib/{iconfont.1733356525791.woff → iconfont.1733469864818.woff} +0 -0
- /package/lib/{iconfont.1733356525791.woff2 → iconfont.1733469864818.woff2} +0 -0
package/es/table/src/methods.js
CHANGED
|
@@ -634,8 +634,10 @@ const Methods = {
|
|
|
634
634
|
* @param {Array} datas 数据
|
|
635
635
|
*/
|
|
636
636
|
loadTableData(datas) {
|
|
637
|
+
const $xeTable = this;
|
|
637
638
|
const { keepSource, showOverflow, treeConfig, treeOpts, editStore, scrollYStore, scrollXStore, lastScrollLeft, lastScrollTop, scrollYLoad: oldScrollYLoad, sXOpts, sYOpts } = this;
|
|
638
639
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
640
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
639
641
|
let treeData = [];
|
|
640
642
|
let fullData = datas ? datas.slice(0) : [];
|
|
641
643
|
if (treeConfig) {
|
|
@@ -698,9 +700,11 @@ const Methods = {
|
|
|
698
700
|
}
|
|
699
701
|
if (sYLoad) {
|
|
700
702
|
if (showOverflow) {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
703
|
+
if (!rowOpts.height) {
|
|
704
|
+
const errColumn = this.tableFullColumn.find((column) => column.showOverflow === false);
|
|
705
|
+
if (errColumn) {
|
|
706
|
+
errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
|
|
707
|
+
}
|
|
704
708
|
}
|
|
705
709
|
}
|
|
706
710
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -2237,7 +2241,7 @@ const Methods = {
|
|
|
2237
2241
|
const isCustomVisible = isAllCustom || storageOpts.visible;
|
|
2238
2242
|
const isCustomFixed = isAllCustom || storageOpts.fixed;
|
|
2239
2243
|
const isCustomSort = isAllCustom || storageOpts.sort;
|
|
2240
|
-
if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
2244
|
+
if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
2241
2245
|
if (!tableId) {
|
|
2242
2246
|
errLog('vxe.error.reqProp', ['id']);
|
|
2243
2247
|
return;
|
|
@@ -2334,7 +2338,11 @@ const Methods = {
|
|
|
2334
2338
|
return storeData;
|
|
2335
2339
|
},
|
|
2336
2340
|
saveCustomStore(type) {
|
|
2337
|
-
const
|
|
2341
|
+
const $xeTable = this;
|
|
2342
|
+
const props = $xeTable;
|
|
2343
|
+
const { customConfig } = props;
|
|
2344
|
+
const tableId = $xeTable.computeTableId;
|
|
2345
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
2338
2346
|
const { updateStore, storage } = customOpts;
|
|
2339
2347
|
const isAllCustom = storage === true;
|
|
2340
2348
|
const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {});
|
|
@@ -2342,7 +2350,7 @@ const Methods = {
|
|
|
2342
2350
|
const isCustomVisible = isAllCustom || storageOpts.visible;
|
|
2343
2351
|
const isCustomFixed = isAllCustom || storageOpts.fixed;
|
|
2344
2352
|
const isCustomSort = isAllCustom || storageOpts.sort;
|
|
2345
|
-
if (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort) {
|
|
2353
|
+
if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
2346
2354
|
if (!tableId) {
|
|
2347
2355
|
errLog('vxe.error.reqProp', ['id']);
|
|
2348
2356
|
return this.$nextTick();
|
|
@@ -2396,6 +2404,11 @@ const Methods = {
|
|
|
2396
2404
|
* 将固定的列左边、右边分别靠边
|
|
2397
2405
|
*/
|
|
2398
2406
|
parseColumns() {
|
|
2407
|
+
const $xeTable = this;
|
|
2408
|
+
const props = $xeTable;
|
|
2409
|
+
const internalData = $xeTable;
|
|
2410
|
+
const { showOverflow } = props;
|
|
2411
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
2399
2412
|
const leftList = [];
|
|
2400
2413
|
const centerList = [];
|
|
2401
2414
|
const rightList = [];
|
|
@@ -2466,6 +2479,14 @@ const Methods = {
|
|
|
2466
2479
|
this.hasFixedColumn = leftList.length > 0 || rightList.length > 0;
|
|
2467
2480
|
Object.assign(columnStore, { leftList, centerList, rightList });
|
|
2468
2481
|
if (scrollXLoad) {
|
|
2482
|
+
if (showOverflow) {
|
|
2483
|
+
if (!rowOpts.height) {
|
|
2484
|
+
const errColumn = internalData.tableFullColumn.find((column) => column.showOverflow === false);
|
|
2485
|
+
if (errColumn) {
|
|
2486
|
+
errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
|
|
2487
|
+
}
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2469
2490
|
if (process.env.NODE_ENV === 'development') {
|
|
2470
2491
|
// if (this.showHeader && !this.showHeaderOverflow) {
|
|
2471
2492
|
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
@@ -2612,11 +2633,7 @@ const Methods = {
|
|
|
2612
2633
|
},
|
|
2613
2634
|
calcCellWidth() {
|
|
2614
2635
|
const $xeTable = this;
|
|
2615
|
-
const { autoWidthColumnList
|
|
2616
|
-
if (!tableData.length || !autoWidthColumnList.length) {
|
|
2617
|
-
this.isCalcColumn = false;
|
|
2618
|
-
return this.$nextTick();
|
|
2619
|
-
}
|
|
2636
|
+
const { autoWidthColumnList } = this;
|
|
2620
2637
|
this.isCalcColumn = true;
|
|
2621
2638
|
return this.$nextTick().then(() => {
|
|
2622
2639
|
const internalData = $xeTable;
|
|
@@ -3440,30 +3457,32 @@ const Methods = {
|
|
|
3440
3457
|
else {
|
|
3441
3458
|
// 如果是激活状态,退则出到上一行/下一行
|
|
3442
3459
|
if (selected.row || actived.row) {
|
|
3443
|
-
const
|
|
3460
|
+
const activeParams = selected.row ? selected.args : actived.args;
|
|
3444
3461
|
if (hasShiftKey) {
|
|
3445
3462
|
if (keyboardOpts.enterToTab) {
|
|
3446
|
-
this.moveTabSelected(
|
|
3463
|
+
this.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
3447
3464
|
}
|
|
3448
3465
|
else {
|
|
3449
|
-
this.moveSelected(
|
|
3466
|
+
this.moveSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
3450
3467
|
}
|
|
3451
3468
|
}
|
|
3452
3469
|
else {
|
|
3453
3470
|
if (keyboardOpts.enterToTab) {
|
|
3454
|
-
this.moveTabSelected(
|
|
3471
|
+
this.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
3455
3472
|
}
|
|
3456
3473
|
else {
|
|
3457
|
-
const
|
|
3474
|
+
const activeRow = selected.row || actived.row;
|
|
3475
|
+
const activeColumn = selected.column || actived.column;
|
|
3476
|
+
const _rowIndex = $xeTable.getVTRowIndex(activeRow);
|
|
3458
3477
|
const etrParams = {
|
|
3459
|
-
row:
|
|
3460
|
-
rowIndex: $xeTable.getRowIndex(
|
|
3461
|
-
$rowIndex: $xeTable.getVMRowIndex(
|
|
3478
|
+
row: activeRow,
|
|
3479
|
+
rowIndex: $xeTable.getRowIndex(activeRow),
|
|
3480
|
+
$rowIndex: $xeTable.getVMRowIndex(activeRow),
|
|
3462
3481
|
_rowIndex,
|
|
3463
|
-
column:
|
|
3464
|
-
columnIndex: $xeTable.getColumnIndex(
|
|
3465
|
-
$columnIndex: $xeTable.getVMColumnIndex(
|
|
3466
|
-
_columnIndex: $xeTable.getVTColumnIndex(
|
|
3482
|
+
column: activeColumn,
|
|
3483
|
+
columnIndex: $xeTable.getColumnIndex(activeColumn),
|
|
3484
|
+
$columnIndex: $xeTable.getVMColumnIndex(activeColumn),
|
|
3485
|
+
_columnIndex: $xeTable.getVTColumnIndex(activeColumn),
|
|
3467
3486
|
$table: $xeTable
|
|
3468
3487
|
};
|
|
3469
3488
|
if (!beforeEnterMethod || beforeEnterMethod(etrParams) !== false) {
|
|
@@ -3472,13 +3491,13 @@ const Methods = {
|
|
|
3472
3491
|
if (_rowIndex >= afterFullData.length - 1) {
|
|
3473
3492
|
$xeTable.insertAt({}, -1).then(({ row: newRow }) => {
|
|
3474
3493
|
$xeTable.scrollToRow(newRow, selected.column);
|
|
3475
|
-
$xeTable.
|
|
3494
|
+
$xeTable.handleSelected(Object.assign(Object.assign({}, activeParams), { row: newRow }), evnt);
|
|
3476
3495
|
});
|
|
3477
3496
|
$xeTable.dispatchEvent('enter-append-row', etrParams, evnt);
|
|
3478
3497
|
return;
|
|
3479
3498
|
}
|
|
3480
3499
|
}
|
|
3481
|
-
this.moveSelected(
|
|
3500
|
+
this.moveSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
3482
3501
|
if (enterMethod) {
|
|
3483
3502
|
enterMethod(etrParams);
|
|
3484
3503
|
}
|
|
@@ -6197,7 +6216,7 @@ const Methods = {
|
|
|
6197
6216
|
$xeTable.checkScrolling();
|
|
6198
6217
|
internalData.lastScrollLeft = scrollLeft;
|
|
6199
6218
|
}
|
|
6200
|
-
|
|
6219
|
+
if (isRollY) {
|
|
6201
6220
|
const yThreshold = $xeTable.computeScrollYThreshold;
|
|
6202
6221
|
isTop = scrollTop <= 0;
|
|
6203
6222
|
if (!isTop) {
|
|
@@ -6310,7 +6329,7 @@ const Methods = {
|
|
|
6310
6329
|
scrollXEvent(evnt) {
|
|
6311
6330
|
const $xeTable = this;
|
|
6312
6331
|
const internalData = $xeTable;
|
|
6313
|
-
const { inFooterScroll, inBodyScroll } = internalData;
|
|
6332
|
+
const { inFooterScroll, inBodyScroll, lastScrollTop } = internalData;
|
|
6314
6333
|
if (inFooterScroll) {
|
|
6315
6334
|
return;
|
|
6316
6335
|
}
|
|
@@ -6323,10 +6342,16 @@ const Methods = {
|
|
|
6323
6342
|
const bodyElem = tableBody.$el;
|
|
6324
6343
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
6325
6344
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
6345
|
+
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
6326
6346
|
const wrapperEl = evnt.currentTarget;
|
|
6327
|
-
const {
|
|
6347
|
+
const { scrollLeft } = wrapperEl;
|
|
6348
|
+
const yBodyEl = yHandleEl || bodyElem;
|
|
6349
|
+
let scrollTop = 0;
|
|
6350
|
+
if (yBodyEl) {
|
|
6351
|
+
scrollTop = yBodyEl.scrollTop;
|
|
6352
|
+
}
|
|
6328
6353
|
const isRollX = true;
|
|
6329
|
-
const isRollY =
|
|
6354
|
+
const isRollY = scrollTop !== lastScrollTop;
|
|
6330
6355
|
internalData.inVirtualScroll = true;
|
|
6331
6356
|
setScrollLeft(bodyElem, scrollLeft);
|
|
6332
6357
|
setScrollLeft(headerElem, scrollLeft);
|
|
@@ -6340,7 +6365,7 @@ const Methods = {
|
|
|
6340
6365
|
scrollYEvent(evnt) {
|
|
6341
6366
|
const $xeTable = this;
|
|
6342
6367
|
const internalData = $xeTable;
|
|
6343
|
-
const { inFooterScroll, inBodyScroll } = internalData;
|
|
6368
|
+
const { inFooterScroll, inBodyScroll, lastScrollLeft } = internalData;
|
|
6344
6369
|
if (inFooterScroll) {
|
|
6345
6370
|
return;
|
|
6346
6371
|
}
|
|
@@ -6353,9 +6378,15 @@ const Methods = {
|
|
|
6353
6378
|
const bodyElem = tableBody.$el;
|
|
6354
6379
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
6355
6380
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
6381
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
6356
6382
|
const wrapperEl = evnt.currentTarget;
|
|
6357
|
-
const { scrollTop
|
|
6358
|
-
const
|
|
6383
|
+
const { scrollTop } = wrapperEl;
|
|
6384
|
+
const xBodyEl = xHandleEl || bodyElem;
|
|
6385
|
+
let scrollLeft = 0;
|
|
6386
|
+
if (xBodyEl) {
|
|
6387
|
+
scrollLeft = xBodyEl.scrollLeft;
|
|
6388
|
+
}
|
|
6389
|
+
const isRollX = scrollLeft !== lastScrollLeft;
|
|
6359
6390
|
const isRollY = true;
|
|
6360
6391
|
internalData.inVirtualScroll = true;
|
|
6361
6392
|
setScrollTop(bodyElem, scrollTop);
|
|
@@ -6599,7 +6630,7 @@ const Methods = {
|
|
|
6599
6630
|
}
|
|
6600
6631
|
}
|
|
6601
6632
|
if (this.scrollXLoad || this.scrollYLoad) {
|
|
6602
|
-
return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()),
|
|
6633
|
+
return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 30));
|
|
6603
6634
|
}
|
|
6604
6635
|
return this.$nextTick();
|
|
6605
6636
|
},
|
package/es/table/src/table.js
CHANGED
|
@@ -397,6 +397,9 @@ export default {
|
|
|
397
397
|
};
|
|
398
398
|
},
|
|
399
399
|
computed: Object.assign(Object.assign({}, {}), { tableId() {
|
|
400
|
+
return this.computeTableId;
|
|
401
|
+
},
|
|
402
|
+
computeTableId() {
|
|
400
403
|
const { id } = this;
|
|
401
404
|
if (id) {
|
|
402
405
|
if (XEUtils.isFunction(id)) {
|
|
@@ -878,8 +881,10 @@ export default {
|
|
|
878
881
|
}
|
|
879
882
|
if (process.env.NODE_ENV === 'development') {
|
|
880
883
|
const customOpts = this.customOpts;
|
|
881
|
-
if (!this.id
|
|
882
|
-
|
|
884
|
+
if (!this.id) {
|
|
885
|
+
if ((this.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
886
|
+
errLog('vxe.error.reqProp', ['id']);
|
|
887
|
+
}
|
|
883
888
|
}
|
|
884
889
|
if (this.treeConfig && this.checkboxOpts.range) {
|
|
885
890
|
errLog('vxe.error.noTree', ['checkbox-config.range']);
|
package/es/ui/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VxeUI } from '@vxe-ui/core';
|
|
2
2
|
import { getFuncText } from './src/utils';
|
|
3
|
-
export const version = "3.11.
|
|
3
|
+
export const version = "3.11.21";
|
|
4
4
|
VxeUI.version = version;
|
|
5
5
|
VxeUI.tableVersion = version;
|
|
6
6
|
VxeUI.setConfig({
|
|
@@ -69,6 +69,7 @@ VxeUI.setConfig({
|
|
|
69
69
|
// visibleMethod () {}
|
|
70
70
|
// },
|
|
71
71
|
customConfig: {
|
|
72
|
+
// enabled: false,
|
|
72
73
|
allowVisible: true,
|
|
73
74
|
allowResizable: true,
|
|
74
75
|
allowFixed: true,
|
|
@@ -83,6 +84,12 @@ VxeUI.setConfig({
|
|
|
83
84
|
lockView: true,
|
|
84
85
|
resize: true,
|
|
85
86
|
escClosable: true
|
|
87
|
+
},
|
|
88
|
+
drawerOptions: {
|
|
89
|
+
mask: true,
|
|
90
|
+
lockView: true,
|
|
91
|
+
escClosable: true,
|
|
92
|
+
resize: true
|
|
86
93
|
}
|
|
87
94
|
},
|
|
88
95
|
sortConfig: {
|
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.11.
|
|
2223
|
+
const version = "3.11.21";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2289,6 +2289,7 @@ core_.VxeUI.setConfig({
|
|
|
2289
2289
|
// visibleMethod () {}
|
|
2290
2290
|
// },
|
|
2291
2291
|
customConfig: {
|
|
2292
|
+
// enabled: false,
|
|
2292
2293
|
allowVisible: true,
|
|
2293
2294
|
allowResizable: true,
|
|
2294
2295
|
allowFixed: true,
|
|
@@ -2303,6 +2304,12 @@ core_.VxeUI.setConfig({
|
|
|
2303
2304
|
lockView: true,
|
|
2304
2305
|
resize: true,
|
|
2305
2306
|
escClosable: true
|
|
2307
|
+
},
|
|
2308
|
+
drawerOptions: {
|
|
2309
|
+
mask: true,
|
|
2310
|
+
lockView: true,
|
|
2311
|
+
escClosable: true,
|
|
2312
|
+
resize: true
|
|
2306
2313
|
}
|
|
2307
2314
|
},
|
|
2308
2315
|
sortConfig: {
|
|
@@ -2778,7 +2785,7 @@ function isNodeElement(elem) {
|
|
|
2778
2785
|
const {
|
|
2779
2786
|
log: log_log
|
|
2780
2787
|
} = core_.VxeUI;
|
|
2781
|
-
const log_version = `table v${"3.11.
|
|
2788
|
+
const log_version = `table v${"3.11.21"}`;
|
|
2782
2789
|
const warnLog = log_log.create('warn', log_version);
|
|
2783
2790
|
const errLog = log_log.create('error', log_version);
|
|
2784
2791
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -5587,6 +5594,7 @@ const Methods = {
|
|
|
5587
5594
|
* @param {Array} datas 数据
|
|
5588
5595
|
*/
|
|
5589
5596
|
loadTableData(datas) {
|
|
5597
|
+
const $xeTable = this;
|
|
5590
5598
|
const {
|
|
5591
5599
|
keepSource,
|
|
5592
5600
|
showOverflow,
|
|
@@ -5602,6 +5610,7 @@ const Methods = {
|
|
|
5602
5610
|
sYOpts
|
|
5603
5611
|
} = this;
|
|
5604
5612
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5613
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
5605
5614
|
let treeData = [];
|
|
5606
5615
|
let fullData = datas ? datas.slice(0) : [];
|
|
5607
5616
|
if (treeConfig) {
|
|
@@ -5663,9 +5672,11 @@ const Methods = {
|
|
|
5663
5672
|
}
|
|
5664
5673
|
if (sYLoad) {
|
|
5665
5674
|
if (showOverflow) {
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5675
|
+
if (!rowOpts.height) {
|
|
5676
|
+
const errColumn = this.tableFullColumn.find(column => column.showOverflow === false);
|
|
5677
|
+
if (errColumn) {
|
|
5678
|
+
errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
|
|
5679
|
+
}
|
|
5669
5680
|
}
|
|
5670
5681
|
}
|
|
5671
5682
|
if (true) {
|
|
@@ -7513,7 +7524,7 @@ const Methods = {
|
|
|
7513
7524
|
const isCustomVisible = isAllCustom || storageOpts.visible;
|
|
7514
7525
|
const isCustomFixed = isAllCustom || storageOpts.fixed;
|
|
7515
7526
|
const isCustomSort = isAllCustom || storageOpts.sort;
|
|
7516
|
-
if (customConfig && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
7527
|
+
if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
7517
7528
|
if (!tableId) {
|
|
7518
7529
|
errLog('vxe.error.reqProp', ['id']);
|
|
7519
7530
|
return;
|
|
@@ -7620,10 +7631,13 @@ const Methods = {
|
|
|
7620
7631
|
return storeData;
|
|
7621
7632
|
},
|
|
7622
7633
|
saveCustomStore(type) {
|
|
7634
|
+
const $xeTable = this;
|
|
7635
|
+
const props = $xeTable;
|
|
7623
7636
|
const {
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7637
|
+
customConfig
|
|
7638
|
+
} = props;
|
|
7639
|
+
const tableId = $xeTable.computeTableId;
|
|
7640
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
7627
7641
|
const {
|
|
7628
7642
|
updateStore,
|
|
7629
7643
|
storage
|
|
@@ -7634,7 +7648,7 @@ const Methods = {
|
|
|
7634
7648
|
const isCustomVisible = isAllCustom || storageOpts.visible;
|
|
7635
7649
|
const isCustomFixed = isAllCustom || storageOpts.fixed;
|
|
7636
7650
|
const isCustomSort = isAllCustom || storageOpts.sort;
|
|
7637
|
-
if (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort) {
|
|
7651
|
+
if ((customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
7638
7652
|
if (!tableId) {
|
|
7639
7653
|
errLog('vxe.error.reqProp', ['id']);
|
|
7640
7654
|
return this.$nextTick();
|
|
@@ -7685,6 +7699,13 @@ const Methods = {
|
|
|
7685
7699
|
* 将固定的列左边、右边分别靠边
|
|
7686
7700
|
*/
|
|
7687
7701
|
parseColumns() {
|
|
7702
|
+
const $xeTable = this;
|
|
7703
|
+
const props = $xeTable;
|
|
7704
|
+
const internalData = $xeTable;
|
|
7705
|
+
const {
|
|
7706
|
+
showOverflow
|
|
7707
|
+
} = props;
|
|
7708
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
7688
7709
|
const leftList = [];
|
|
7689
7710
|
const centerList = [];
|
|
7690
7711
|
const rightList = [];
|
|
@@ -7759,6 +7780,14 @@ const Methods = {
|
|
|
7759
7780
|
rightList
|
|
7760
7781
|
});
|
|
7761
7782
|
if (scrollXLoad) {
|
|
7783
|
+
if (showOverflow) {
|
|
7784
|
+
if (!rowOpts.height) {
|
|
7785
|
+
const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false);
|
|
7786
|
+
if (errColumn) {
|
|
7787
|
+
errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
|
|
7788
|
+
}
|
|
7789
|
+
}
|
|
7790
|
+
}
|
|
7762
7791
|
if (true) {
|
|
7763
7792
|
// if (this.showHeader && !this.showHeaderOverflow) {
|
|
7764
7793
|
// warnLog('vxe.error.reqProp', ['show-header-overflow'])
|
|
@@ -7926,13 +7955,8 @@ const Methods = {
|
|
|
7926
7955
|
calcCellWidth() {
|
|
7927
7956
|
const $xeTable = this;
|
|
7928
7957
|
const {
|
|
7929
|
-
autoWidthColumnList
|
|
7930
|
-
tableData
|
|
7958
|
+
autoWidthColumnList
|
|
7931
7959
|
} = this;
|
|
7932
|
-
if (!tableData.length || !autoWidthColumnList.length) {
|
|
7933
|
-
this.isCalcColumn = false;
|
|
7934
|
-
return this.$nextTick();
|
|
7935
|
-
}
|
|
7936
7960
|
this.isCalcColumn = true;
|
|
7937
7961
|
return this.$nextTick().then(() => {
|
|
7938
7962
|
const internalData = $xeTable;
|
|
@@ -8865,27 +8889,29 @@ const Methods = {
|
|
|
8865
8889
|
} else {
|
|
8866
8890
|
// 如果是激活状态,退则出到上一行/下一行
|
|
8867
8891
|
if (selected.row || actived.row) {
|
|
8868
|
-
const
|
|
8892
|
+
const activeParams = selected.row ? selected.args : actived.args;
|
|
8869
8893
|
if (hasShiftKey) {
|
|
8870
8894
|
if (keyboardOpts.enterToTab) {
|
|
8871
|
-
this.moveTabSelected(
|
|
8895
|
+
this.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
8872
8896
|
} else {
|
|
8873
|
-
this.moveSelected(
|
|
8897
|
+
this.moveSelected(activeParams, isLeftArrow, true, isRightArrow, false, evnt);
|
|
8874
8898
|
}
|
|
8875
8899
|
} else {
|
|
8876
8900
|
if (keyboardOpts.enterToTab) {
|
|
8877
|
-
this.moveTabSelected(
|
|
8901
|
+
this.moveTabSelected(activeParams, hasShiftKey, evnt);
|
|
8878
8902
|
} else {
|
|
8879
|
-
const
|
|
8903
|
+
const activeRow = selected.row || actived.row;
|
|
8904
|
+
const activeColumn = selected.column || actived.column;
|
|
8905
|
+
const _rowIndex = $xeTable.getVTRowIndex(activeRow);
|
|
8880
8906
|
const etrParams = {
|
|
8881
|
-
row:
|
|
8882
|
-
rowIndex: $xeTable.getRowIndex(
|
|
8883
|
-
$rowIndex: $xeTable.getVMRowIndex(
|
|
8907
|
+
row: activeRow,
|
|
8908
|
+
rowIndex: $xeTable.getRowIndex(activeRow),
|
|
8909
|
+
$rowIndex: $xeTable.getVMRowIndex(activeRow),
|
|
8884
8910
|
_rowIndex,
|
|
8885
|
-
column:
|
|
8886
|
-
columnIndex: $xeTable.getColumnIndex(
|
|
8887
|
-
$columnIndex: $xeTable.getVMColumnIndex(
|
|
8888
|
-
_columnIndex: $xeTable.getVTColumnIndex(
|
|
8911
|
+
column: activeColumn,
|
|
8912
|
+
columnIndex: $xeTable.getColumnIndex(activeColumn),
|
|
8913
|
+
$columnIndex: $xeTable.getVMColumnIndex(activeColumn),
|
|
8914
|
+
_columnIndex: $xeTable.getVTColumnIndex(activeColumn),
|
|
8889
8915
|
$table: $xeTable
|
|
8890
8916
|
};
|
|
8891
8917
|
if (!beforeEnterMethod || beforeEnterMethod(etrParams) !== false) {
|
|
@@ -8896,13 +8922,16 @@ const Methods = {
|
|
|
8896
8922
|
row: newRow
|
|
8897
8923
|
}) => {
|
|
8898
8924
|
$xeTable.scrollToRow(newRow, selected.column);
|
|
8899
|
-
$xeTable.
|
|
8925
|
+
$xeTable.handleSelected({
|
|
8926
|
+
...activeParams,
|
|
8927
|
+
row: newRow
|
|
8928
|
+
}, evnt);
|
|
8900
8929
|
});
|
|
8901
8930
|
$xeTable.dispatchEvent('enter-append-row', etrParams, evnt);
|
|
8902
8931
|
return;
|
|
8903
8932
|
}
|
|
8904
8933
|
}
|
|
8905
|
-
this.moveSelected(
|
|
8934
|
+
this.moveSelected(activeParams, isLeftArrow, false, isRightArrow, true, evnt);
|
|
8906
8935
|
if (enterMethod) {
|
|
8907
8936
|
enterMethod(etrParams);
|
|
8908
8937
|
}
|
|
@@ -12221,7 +12250,8 @@ const Methods = {
|
|
|
12221
12250
|
}
|
|
12222
12251
|
$xeTable.checkScrolling();
|
|
12223
12252
|
internalData.lastScrollLeft = scrollLeft;
|
|
12224
|
-
}
|
|
12253
|
+
}
|
|
12254
|
+
if (isRollY) {
|
|
12225
12255
|
const yThreshold = $xeTable.computeScrollYThreshold;
|
|
12226
12256
|
isTop = scrollTop <= 0;
|
|
12227
12257
|
if (!isTop) {
|
|
@@ -12351,7 +12381,8 @@ const Methods = {
|
|
|
12351
12381
|
const internalData = $xeTable;
|
|
12352
12382
|
const {
|
|
12353
12383
|
inFooterScroll,
|
|
12354
|
-
inBodyScroll
|
|
12384
|
+
inBodyScroll,
|
|
12385
|
+
lastScrollTop
|
|
12355
12386
|
} = internalData;
|
|
12356
12387
|
if (inFooterScroll) {
|
|
12357
12388
|
return;
|
|
@@ -12365,13 +12396,18 @@ const Methods = {
|
|
|
12365
12396
|
const bodyElem = tableBody.$el;
|
|
12366
12397
|
const headerElem = tableHeader ? tableHeader.$el : null;
|
|
12367
12398
|
const footerElem = tableFooter ? tableFooter.$el : null;
|
|
12399
|
+
const yHandleEl = $xeTable.$refs.refScrollYHandleElem;
|
|
12368
12400
|
const wrapperEl = evnt.currentTarget;
|
|
12369
12401
|
const {
|
|
12370
|
-
scrollTop,
|
|
12371
12402
|
scrollLeft
|
|
12372
12403
|
} = wrapperEl;
|
|
12404
|
+
const yBodyEl = yHandleEl || bodyElem;
|
|
12405
|
+
let scrollTop = 0;
|
|
12406
|
+
if (yBodyEl) {
|
|
12407
|
+
scrollTop = yBodyEl.scrollTop;
|
|
12408
|
+
}
|
|
12373
12409
|
const isRollX = true;
|
|
12374
|
-
const isRollY =
|
|
12410
|
+
const isRollY = scrollTop !== lastScrollTop;
|
|
12375
12411
|
internalData.inVirtualScroll = true;
|
|
12376
12412
|
setScrollLeft(bodyElem, scrollLeft);
|
|
12377
12413
|
setScrollLeft(headerElem, scrollLeft);
|
|
@@ -12387,7 +12423,8 @@ const Methods = {
|
|
|
12387
12423
|
const internalData = $xeTable;
|
|
12388
12424
|
const {
|
|
12389
12425
|
inFooterScroll,
|
|
12390
|
-
inBodyScroll
|
|
12426
|
+
inBodyScroll,
|
|
12427
|
+
lastScrollLeft
|
|
12391
12428
|
} = internalData;
|
|
12392
12429
|
if (inFooterScroll) {
|
|
12393
12430
|
return;
|
|
@@ -12401,12 +12438,17 @@ const Methods = {
|
|
|
12401
12438
|
const bodyElem = tableBody.$el;
|
|
12402
12439
|
const leftElem = leftBody ? leftBody.$el : null;
|
|
12403
12440
|
const rightElem = rightBody ? rightBody.$el : null;
|
|
12441
|
+
const xHandleEl = $xeTable.$refs.refScrollXHandleElem;
|
|
12404
12442
|
const wrapperEl = evnt.currentTarget;
|
|
12405
12443
|
const {
|
|
12406
|
-
scrollTop
|
|
12407
|
-
scrollLeft
|
|
12444
|
+
scrollTop
|
|
12408
12445
|
} = wrapperEl;
|
|
12409
|
-
const
|
|
12446
|
+
const xBodyEl = xHandleEl || bodyElem;
|
|
12447
|
+
let scrollLeft = 0;
|
|
12448
|
+
if (xBodyEl) {
|
|
12449
|
+
scrollLeft = xBodyEl.scrollLeft;
|
|
12450
|
+
}
|
|
12451
|
+
const isRollX = scrollLeft !== lastScrollLeft;
|
|
12410
12452
|
const isRollY = true;
|
|
12411
12453
|
internalData.inVirtualScroll = true;
|
|
12412
12454
|
setScrollTop(bodyElem, scrollTop);
|
|
@@ -12711,7 +12753,7 @@ const Methods = {
|
|
|
12711
12753
|
}
|
|
12712
12754
|
}
|
|
12713
12755
|
if (this.scrollXLoad || this.scrollYLoad) {
|
|
12714
|
-
return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()),
|
|
12756
|
+
return new Promise(resolve => setTimeout(() => resolve(this.$nextTick()), 30));
|
|
12715
12757
|
}
|
|
12716
12758
|
return this.$nextTick();
|
|
12717
12759
|
},
|
|
@@ -13222,7 +13264,8 @@ function renderColumn(h, _vm, $xetable, seq, rowid, fixedType, rowLevel, row, ro
|
|
|
13222
13264
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
13223
13265
|
const showTitle = cellOverflow === 'title';
|
|
13224
13266
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
13225
|
-
|
|
13267
|
+
// 如果表格加上 showOverflow 则不再支持列单独设置
|
|
13268
|
+
const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis;
|
|
13226
13269
|
let isDirty;
|
|
13227
13270
|
const tdOns = {};
|
|
13228
13271
|
const rest = fullAllDataRowIdData[rowid];
|
|
@@ -15739,7 +15782,9 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
15739
15782
|
title: drawerOpts.title || panel_getI18n('vxe.custom.cstmTitle'),
|
|
15740
15783
|
width: drawerOpts.width || Math.min(880, Math.floor(document.documentElement.clientWidth * 0.6)),
|
|
15741
15784
|
position: drawerOpts.position,
|
|
15785
|
+
resize: !!drawerOpts.resize,
|
|
15742
15786
|
escClosable: !!drawerOpts.escClosable,
|
|
15787
|
+
maskClosable: !!drawerOpts.maskClosable,
|
|
15743
15788
|
destroyOnClose: true,
|
|
15744
15789
|
showFooter: true
|
|
15745
15790
|
},
|
|
@@ -15768,6 +15813,7 @@ const renderPopupPanel = (h, _vm) => {
|
|
|
15768
15813
|
lockView: modalOpts.lockView,
|
|
15769
15814
|
resize: modalOpts.resize,
|
|
15770
15815
|
escClosable: !!modalOpts.escClosable,
|
|
15816
|
+
maskClosable: !!modalOpts.maskClosable,
|
|
15771
15817
|
destroyOnClose: true,
|
|
15772
15818
|
showFooter: true
|
|
15773
15819
|
},
|
|
@@ -22555,6 +22601,9 @@ function handleUupdateResize(_vm) {
|
|
|
22555
22601
|
computed: {
|
|
22556
22602
|
...{},
|
|
22557
22603
|
tableId() {
|
|
22604
|
+
return this.computeTableId;
|
|
22605
|
+
},
|
|
22606
|
+
computeTableId() {
|
|
22558
22607
|
const {
|
|
22559
22608
|
id
|
|
22560
22609
|
} = this;
|
|
@@ -23097,8 +23146,10 @@ function handleUupdateResize(_vm) {
|
|
|
23097
23146
|
}
|
|
23098
23147
|
if (true) {
|
|
23099
23148
|
const customOpts = this.customOpts;
|
|
23100
|
-
if (!this.id
|
|
23101
|
-
|
|
23149
|
+
if (!this.id) {
|
|
23150
|
+
if ((this.customConfig ? isEnableConf(customOpts) : customOpts.enabled) && customOpts.storage) {
|
|
23151
|
+
errLog('vxe.error.reqProp', ['id']);
|
|
23152
|
+
}
|
|
23102
23153
|
}
|
|
23103
23154
|
if (this.treeConfig && this.checkboxOpts.range) {
|
|
23104
23155
|
errLog('vxe.error.noTree', ['checkbox-config.range']);
|