vxe-table 4.7.86 → 4.7.88
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 +60 -17
- package/es/grid/src/grid.js +4 -4
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/table.js +67 -42
- package/es/table/src/util.js +22 -12
- package/es/ui/index.js +2 -2
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +4 -4
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +104 -75
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/table.js +77 -59
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +25 -11
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -2
- 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/grid/src/grid.ts +4 -4
- package/packages/table/src/table.ts +67 -42
- package/packages/table/src/util.ts +22 -12
- package/styles/theme/base.scss +1 -0
- /package/es/{iconfont.1728357720671.ttf → iconfont.1729047473391.ttf} +0 -0
- /package/es/{iconfont.1728357720671.woff → iconfont.1729047473391.woff} +0 -0
- /package/es/{iconfont.1728357720671.woff2 → iconfont.1729047473391.woff2} +0 -0
- /package/lib/{iconfont.1728357720671.ttf → iconfont.1729047473391.ttf} +0 -0
- /package/lib/{iconfont.1728357720671.woff → iconfont.1729047473391.woff} +0 -0
- /package/lib/{iconfont.1728357720671.woff2 → iconfont.1729047473391.woff2} +0 -0
package/lib/table/src/table.js
CHANGED
|
@@ -391,13 +391,13 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
391
391
|
return '';
|
|
392
392
|
});
|
|
393
393
|
const computeValidOpts = (0, _vue.computed)(() => {
|
|
394
|
-
return Object.assign({},
|
|
394
|
+
return Object.assign({}, getConfig().table.validConfig, props.validConfig);
|
|
395
395
|
});
|
|
396
396
|
const computeSXOpts = (0, _vue.computed)(() => {
|
|
397
|
-
return Object.assign({},
|
|
397
|
+
return Object.assign({}, getConfig().table.scrollX, props.scrollX);
|
|
398
398
|
});
|
|
399
399
|
const computeSYOpts = (0, _vue.computed)(() => {
|
|
400
|
-
return Object.assign({},
|
|
400
|
+
return Object.assign({}, getConfig().table.scrollY, props.scrollY);
|
|
401
401
|
});
|
|
402
402
|
const computeRowHeightMaps = (0, _vue.computed)(() => {
|
|
403
403
|
return {
|
|
@@ -408,31 +408,31 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
408
408
|
};
|
|
409
409
|
});
|
|
410
410
|
const computeColumnOpts = (0, _vue.computed)(() => {
|
|
411
|
-
return Object.assign({},
|
|
411
|
+
return Object.assign({}, getConfig().table.columnConfig, props.columnConfig);
|
|
412
412
|
});
|
|
413
413
|
const computeRowOpts = (0, _vue.computed)(() => {
|
|
414
|
-
return Object.assign({},
|
|
414
|
+
return Object.assign({}, getConfig().table.rowConfig, props.rowConfig);
|
|
415
415
|
});
|
|
416
416
|
const computeResizeOpts = (0, _vue.computed)(() => {
|
|
417
|
-
return Object.assign({},
|
|
417
|
+
return Object.assign({}, getConfig().table.resizeConfig, props.resizeConfig);
|
|
418
418
|
});
|
|
419
419
|
const computeResizableOpts = (0, _vue.computed)(() => {
|
|
420
|
-
return Object.assign({},
|
|
420
|
+
return Object.assign({}, getConfig().table.resizableConfig, props.resizableConfig);
|
|
421
421
|
});
|
|
422
422
|
const computeSeqOpts = (0, _vue.computed)(() => {
|
|
423
423
|
return Object.assign({
|
|
424
424
|
startIndex: 0
|
|
425
|
-
},
|
|
425
|
+
}, getConfig().table.seqConfig, props.seqConfig);
|
|
426
426
|
});
|
|
427
427
|
const computeRadioOpts = (0, _vue.computed)(() => {
|
|
428
|
-
return Object.assign({},
|
|
428
|
+
return Object.assign({}, getConfig().table.radioConfig, props.radioConfig);
|
|
429
429
|
});
|
|
430
430
|
const computeCheckboxOpts = (0, _vue.computed)(() => {
|
|
431
|
-
return Object.assign({},
|
|
431
|
+
return Object.assign({}, getConfig().table.checkboxConfig, props.checkboxConfig);
|
|
432
432
|
});
|
|
433
433
|
let computeTooltipOpts = (0, _vue.ref)();
|
|
434
434
|
computeTooltipOpts = (0, _vue.computed)(() => {
|
|
435
|
-
return Object.assign({},
|
|
435
|
+
return Object.assign({}, getConfig().tooltip, getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
436
436
|
});
|
|
437
437
|
const computeTipConfig = (0, _vue.computed)(() => {
|
|
438
438
|
const tooltipOpts = computeTooltipOpts.value;
|
|
@@ -445,33 +445,33 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
445
445
|
}, tooltipOpts);
|
|
446
446
|
});
|
|
447
447
|
const computeEditOpts = (0, _vue.computed)(() => {
|
|
448
|
-
return Object.assign({},
|
|
448
|
+
return Object.assign({}, getConfig().table.editConfig, props.editConfig);
|
|
449
449
|
});
|
|
450
450
|
const computeSortOpts = (0, _vue.computed)(() => {
|
|
451
451
|
return Object.assign({
|
|
452
452
|
orders: ['asc', 'desc', null]
|
|
453
|
-
},
|
|
453
|
+
}, getConfig().table.sortConfig, props.sortConfig);
|
|
454
454
|
});
|
|
455
455
|
const computeFilterOpts = (0, _vue.computed)(() => {
|
|
456
|
-
return Object.assign({},
|
|
456
|
+
return Object.assign({}, getConfig().table.filterConfig, props.filterConfig);
|
|
457
457
|
});
|
|
458
458
|
const computeMouseOpts = (0, _vue.computed)(() => {
|
|
459
|
-
return Object.assign({},
|
|
459
|
+
return Object.assign({}, getConfig().table.mouseConfig, props.mouseConfig);
|
|
460
460
|
});
|
|
461
461
|
const computeAreaOpts = (0, _vue.computed)(() => {
|
|
462
|
-
return Object.assign({},
|
|
462
|
+
return Object.assign({}, getConfig().table.areaConfig, props.areaConfig);
|
|
463
463
|
});
|
|
464
464
|
const computeKeyboardOpts = (0, _vue.computed)(() => {
|
|
465
|
-
return Object.assign({},
|
|
465
|
+
return Object.assign({}, getConfig().table.keyboardConfig, props.keyboardConfig);
|
|
466
466
|
});
|
|
467
467
|
const computeClipOpts = (0, _vue.computed)(() => {
|
|
468
|
-
return Object.assign({},
|
|
468
|
+
return Object.assign({}, getConfig().table.clipConfig, props.clipConfig);
|
|
469
469
|
});
|
|
470
470
|
const computeFNROpts = (0, _vue.computed)(() => {
|
|
471
|
-
return Object.assign({},
|
|
471
|
+
return Object.assign({}, getConfig().table.fnrConfig, props.fnrConfig);
|
|
472
472
|
});
|
|
473
473
|
const computeMenuOpts = (0, _vue.computed)(() => {
|
|
474
|
-
return Object.assign({},
|
|
474
|
+
return Object.assign({}, getConfig().table.menuConfig, props.menuConfig);
|
|
475
475
|
});
|
|
476
476
|
const computeHeaderMenu = (0, _vue.computed)(() => {
|
|
477
477
|
const menuOpts = computeMenuOpts.value;
|
|
@@ -508,31 +508,31 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
508
508
|
return rest;
|
|
509
509
|
});
|
|
510
510
|
const computeExportOpts = (0, _vue.computed)(() => {
|
|
511
|
-
return Object.assign({},
|
|
511
|
+
return Object.assign({}, getConfig().table.exportConfig, props.exportConfig);
|
|
512
512
|
});
|
|
513
513
|
const computeImportOpts = (0, _vue.computed)(() => {
|
|
514
|
-
return Object.assign({},
|
|
514
|
+
return Object.assign({}, getConfig().table.importConfig, props.importConfig);
|
|
515
515
|
});
|
|
516
516
|
const computePrintOpts = (0, _vue.computed)(() => {
|
|
517
|
-
return Object.assign({},
|
|
517
|
+
return Object.assign({}, getConfig().table.printConfig, props.printConfig);
|
|
518
518
|
});
|
|
519
519
|
const computeExpandOpts = (0, _vue.computed)(() => {
|
|
520
|
-
return Object.assign({},
|
|
520
|
+
return Object.assign({}, getConfig().table.expandConfig, props.expandConfig);
|
|
521
521
|
});
|
|
522
522
|
const computeTreeOpts = (0, _vue.computed)(() => {
|
|
523
|
-
return Object.assign({},
|
|
523
|
+
return Object.assign({}, getConfig().table.treeConfig, props.treeConfig);
|
|
524
524
|
});
|
|
525
525
|
const computeEmptyOpts = (0, _vue.computed)(() => {
|
|
526
|
-
return Object.assign({},
|
|
526
|
+
return Object.assign({}, getConfig().table.emptyRender, props.emptyRender);
|
|
527
527
|
});
|
|
528
528
|
const computeLoadingOpts = (0, _vue.computed)(() => {
|
|
529
|
-
return Object.assign({},
|
|
529
|
+
return Object.assign({}, getConfig().table.loadingConfig, props.loadingConfig);
|
|
530
530
|
});
|
|
531
531
|
const computeCellOffsetWidth = (0, _vue.computed)(() => {
|
|
532
532
|
return props.border ? Math.max(2, Math.ceil(reactData.scrollbarWidth / reactData.tableColumn.length)) : 1;
|
|
533
533
|
});
|
|
534
534
|
const computeCustomOpts = (0, _vue.computed)(() => {
|
|
535
|
-
return Object.assign({},
|
|
535
|
+
return Object.assign({}, getConfig().table.customConfig, props.customConfig);
|
|
536
536
|
});
|
|
537
537
|
const computeAutoWidthColumnList = (0, _vue.computed)(() => {
|
|
538
538
|
const {
|
|
@@ -807,7 +807,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
807
807
|
visibleSize: 8
|
|
808
808
|
};
|
|
809
809
|
};
|
|
810
|
-
const
|
|
810
|
+
const calculateMergerOffsetIndex = (list, offsetItem, type) => {
|
|
811
811
|
for (let mcIndex = 0, len = list.length; mcIndex < len; mcIndex++) {
|
|
812
812
|
const mergeItem = list[mcIndex];
|
|
813
813
|
const {
|
|
@@ -1190,7 +1190,9 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1190
1190
|
});
|
|
1191
1191
|
} else {
|
|
1192
1192
|
const labelEl = cellEl.firstChild;
|
|
1193
|
-
|
|
1193
|
+
if (labelEl) {
|
|
1194
|
+
titleWidth = labelEl.offsetWidth;
|
|
1195
|
+
}
|
|
1194
1196
|
}
|
|
1195
1197
|
if (titleWidth) {
|
|
1196
1198
|
colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
|
|
@@ -1470,6 +1472,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1470
1472
|
treeExpandedMaps
|
|
1471
1473
|
} = reactData;
|
|
1472
1474
|
const treeOpts = computeTreeOpts.value;
|
|
1475
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
1473
1476
|
if (treeConfig && treeOpts.transform) {
|
|
1474
1477
|
const fullData = [];
|
|
1475
1478
|
const expandMaps = {};
|
|
@@ -1481,7 +1484,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1481
1484
|
fullData.push(row);
|
|
1482
1485
|
}
|
|
1483
1486
|
}, {
|
|
1484
|
-
children:
|
|
1487
|
+
children: childrenField
|
|
1485
1488
|
});
|
|
1486
1489
|
internalData.afterFullData = fullData;
|
|
1487
1490
|
updateScrollYStatus(fullData);
|
|
@@ -1505,6 +1508,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1505
1508
|
const filterOpts = computeFilterOpts.value;
|
|
1506
1509
|
const sortOpts = computeSortOpts.value;
|
|
1507
1510
|
const treeOpts = computeTreeOpts.value;
|
|
1511
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
1508
1512
|
const {
|
|
1509
1513
|
transform
|
|
1510
1514
|
} = treeOpts;
|
|
@@ -1619,9 +1623,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1619
1623
|
};
|
|
1620
1624
|
if (treeConfig && transform) {
|
|
1621
1625
|
// 筛选虚拟树
|
|
1622
|
-
tableTree = _xeUtils.default.searchTree(tableFullTreeData, handleFilter,
|
|
1623
|
-
original: true
|
|
1624
|
-
|
|
1626
|
+
tableTree = _xeUtils.default.searchTree(tableFullTreeData, handleFilter, {
|
|
1627
|
+
original: true,
|
|
1628
|
+
isEvery: true,
|
|
1629
|
+
children: treeOpts.mapChildrenField,
|
|
1630
|
+
mapChildren: childrenField
|
|
1631
|
+
});
|
|
1625
1632
|
tableData = tableTree;
|
|
1626
1633
|
} else {
|
|
1627
1634
|
tableData = treeConfig ? tableFullTreeData.filter(handleFilter) : tableFullData.filter(handleFilter);
|
|
@@ -1630,9 +1637,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1630
1637
|
} else {
|
|
1631
1638
|
if (treeConfig && transform) {
|
|
1632
1639
|
// 还原虚拟树
|
|
1633
|
-
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true,
|
|
1634
|
-
original: true
|
|
1635
|
-
|
|
1640
|
+
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true, {
|
|
1641
|
+
original: true,
|
|
1642
|
+
isEvery: true,
|
|
1643
|
+
children: treeOpts.mapChildrenField,
|
|
1644
|
+
mapChildren: childrenField
|
|
1645
|
+
});
|
|
1636
1646
|
tableData = tableTree;
|
|
1637
1647
|
} else {
|
|
1638
1648
|
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
|
|
@@ -1678,9 +1688,12 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
1678
1688
|
} else {
|
|
1679
1689
|
if (treeConfig && transform) {
|
|
1680
1690
|
// 还原虚拟树
|
|
1681
|
-
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true,
|
|
1682
|
-
original: true
|
|
1683
|
-
|
|
1691
|
+
tableTree = _xeUtils.default.searchTree(tableFullTreeData, () => true, {
|
|
1692
|
+
original: true,
|
|
1693
|
+
isEvery: true,
|
|
1694
|
+
children: treeOpts.mapChildrenField,
|
|
1695
|
+
mapChildren: childrenField
|
|
1696
|
+
});
|
|
1684
1697
|
tableData = tableTree;
|
|
1685
1698
|
} else {
|
|
1686
1699
|
tableData = treeConfig ? tableFullTreeData.slice(0) : tableFullData.slice(0);
|
|
@@ -2779,7 +2792,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
2779
2792
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
|
|
2780
2793
|
endIndex: toVisibleIndex + visibleSize + offsetSize
|
|
2781
2794
|
};
|
|
2782
|
-
|
|
2795
|
+
calculateMergerOffsetIndex(mergeList.concat(mergeFooterList), offsetItem, 'col');
|
|
2783
2796
|
const {
|
|
2784
2797
|
startIndex: offsetStartIndex,
|
|
2785
2798
|
endIndex: offsetEndIndex
|
|
@@ -3113,7 +3126,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
3113
3126
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize),
|
|
3114
3127
|
endIndex: toVisibleIndex + visibleSize + offsetSize
|
|
3115
3128
|
};
|
|
3116
|
-
|
|
3129
|
+
calculateMergerOffsetIndex(mergeList, offsetItem, 'row');
|
|
3117
3130
|
const {
|
|
3118
3131
|
startIndex: offsetStartIndex,
|
|
3119
3132
|
endIndex: offsetEndIndex
|
|
@@ -6249,8 +6262,7 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
6249
6262
|
treeConfig
|
|
6250
6263
|
} = props;
|
|
6251
6264
|
const treeOpts = computeTreeOpts.value;
|
|
6252
|
-
|
|
6253
|
-
fullDataRowIdData,
|
|
6265
|
+
const {
|
|
6254
6266
|
fullAllDataRowIdData,
|
|
6255
6267
|
tableFullData,
|
|
6256
6268
|
tableFullTreeData
|
|
@@ -6259,6 +6271,8 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
6259
6271
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
6260
6272
|
const rowkey = (0, _util.getRowkey)($xeTable);
|
|
6261
6273
|
const isLazy = treeConfig && treeOpts.lazy;
|
|
6274
|
+
const fullAllDataRowIdMaps = {};
|
|
6275
|
+
const fullDataRowIdMaps = {};
|
|
6262
6276
|
const handleRow = (row, index, items, path, parent, nodes) => {
|
|
6263
6277
|
let rowid = (0, _util.getRowid)($xeTable, row);
|
|
6264
6278
|
const seq = treeConfig && path ? (0, _util.toTreePathSeq)(path) : index + 1;
|
|
@@ -6270,26 +6284,30 @@ var _default = exports.default = (0, _vue.defineComponent)({
|
|
|
6270
6284
|
if (isLazy && row[hasChildField] && _xeUtils.default.isUndefined(row[childrenField])) {
|
|
6271
6285
|
row[childrenField] = null;
|
|
6272
6286
|
}
|
|
6273
|
-
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6287
|
+
let cacheItem = fullAllDataRowIdData[rowid];
|
|
6288
|
+
if (!cacheItem) {
|
|
6289
|
+
cacheItem = {
|
|
6290
|
+
row,
|
|
6291
|
+
rowid,
|
|
6292
|
+
seq,
|
|
6293
|
+
index: -1,
|
|
6294
|
+
_index: -1,
|
|
6295
|
+
$index: -1,
|
|
6296
|
+
items,
|
|
6297
|
+
parent,
|
|
6298
|
+
level
|
|
6299
|
+
};
|
|
6300
|
+
}
|
|
6284
6301
|
if (isSource) {
|
|
6285
|
-
|
|
6302
|
+
cacheItem.index = treeConfig && parent ? -1 : index;
|
|
6303
|
+
fullDataRowIdMaps[rowid] = cacheItem;
|
|
6286
6304
|
}
|
|
6287
|
-
|
|
6305
|
+
fullAllDataRowIdMaps[rowid] = cacheItem;
|
|
6288
6306
|
};
|
|
6289
6307
|
if (isSource) {
|
|
6290
|
-
|
|
6308
|
+
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
6291
6309
|
}
|
|
6292
|
-
|
|
6310
|
+
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
6293
6311
|
if (treeConfig) {
|
|
6294
6312
|
_xeUtils.default.eachTree(tableFullTreeData, handleRow, {
|
|
6295
6313
|
children: childrenField
|