vxe-table 3.13.4 → 3.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/methods.js +40 -37
- package/es/table/src/table.js +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +46 -44
- 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/methods.js +41 -39
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +1 -1
- package/lib/table/src/table.min.js +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/package.json +2 -2
- package/packages/table/src/methods.ts +42 -39
- package/packages/table/src/table.ts +1 -1
- package/styles/theme/base.scss +1 -1
- /package/es/{iconfont.1740013687420.ttf → iconfont.1740038065641.ttf} +0 -0
- /package/es/{iconfont.1740013687420.woff → iconfont.1740038065641.woff} +0 -0
- /package/es/{iconfont.1740013687420.woff2 → iconfont.1740038065641.woff2} +0 -0
- /package/lib/{iconfont.1740013687420.ttf → iconfont.1740038065641.ttf} +0 -0
- /package/lib/{iconfont.1740013687420.woff → iconfont.1740038065641.woff} +0 -0
- /package/lib/{iconfont.1740013687420.woff2 → iconfont.1740038065641.woff2} +0 -0
package/lib/table/src/methods.js
CHANGED
|
@@ -2462,15 +2462,11 @@ const Methods = {
|
|
|
2462
2462
|
internalData.tableFullData = fullData;
|
|
2463
2463
|
internalData.tableFullTreeData = treeData;
|
|
2464
2464
|
// 缓存数据
|
|
2465
|
-
$xeTable.cacheRowMap(true
|
|
2465
|
+
$xeTable.cacheRowMap(true);
|
|
2466
2466
|
// 原始数据
|
|
2467
2467
|
internalData.tableSynchData = datas;
|
|
2468
2468
|
if (isReset) {
|
|
2469
2469
|
internalData.isResizeCellHeight = false;
|
|
2470
|
-
reactData.rowExpandedMaps = {};
|
|
2471
|
-
reactData.rowExpandLazyLoadedMaps = {};
|
|
2472
|
-
reactData.treeExpandedMaps = {};
|
|
2473
|
-
reactData.treeExpandLazyLoadedMaps = {};
|
|
2474
2470
|
}
|
|
2475
2471
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
2476
2472
|
if (keepSource) {
|
|
@@ -2653,22 +2649,27 @@ const Methods = {
|
|
|
2653
2649
|
/**
|
|
2654
2650
|
* 更新数据行的 Map
|
|
2655
2651
|
*/
|
|
2656
|
-
cacheRowMap(
|
|
2652
|
+
cacheRowMap() {
|
|
2653
|
+
const $xeTable = this;
|
|
2654
|
+
const props = $xeTable;
|
|
2655
|
+
const internalData = $xeTable;
|
|
2656
|
+
const {
|
|
2657
|
+
treeConfig
|
|
2658
|
+
} = props;
|
|
2659
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
2657
2660
|
const {
|
|
2658
|
-
treeConfig,
|
|
2659
|
-
treeOpts,
|
|
2660
|
-
tableFullData,
|
|
2661
2661
|
fullAllDataRowIdData,
|
|
2662
|
+
tableFullData,
|
|
2662
2663
|
tableFullTreeData
|
|
2663
|
-
} =
|
|
2664
|
+
} = internalData;
|
|
2664
2665
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2665
2666
|
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
2666
|
-
const rowkey = (0, _util.getRowkey)(
|
|
2667
|
+
const rowkey = (0, _util.getRowkey)($xeTable);
|
|
2667
2668
|
const isLazy = treeConfig && treeOpts.lazy;
|
|
2668
2669
|
const fullAllDataRowIdMaps = {};
|
|
2669
2670
|
const fullDataRowIdMaps = {};
|
|
2670
|
-
const
|
|
2671
|
-
let rowid = (0, _util.getRowid)(
|
|
2671
|
+
const handleRow = (row, index, items, path, parentRow, nodes) => {
|
|
2672
|
+
let rowid = (0, _util.getRowid)($xeTable, row);
|
|
2672
2673
|
const seq = treeConfig && path ? (0, _util.toTreePathSeq)(path) : index + 1;
|
|
2673
2674
|
const level = nodes ? nodes.length - 1 : 0;
|
|
2674
2675
|
if ((0, _utils.eqEmptyValue)(rowid)) {
|
|
@@ -2678,9 +2679,9 @@ const Methods = {
|
|
|
2678
2679
|
if (isLazy && row[hasChildField] && _xeUtils.default.isUndefined(row[childrenField])) {
|
|
2679
2680
|
row[childrenField] = null;
|
|
2680
2681
|
}
|
|
2681
|
-
let
|
|
2682
|
-
if (
|
|
2683
|
-
|
|
2682
|
+
let rowRest = fullAllDataRowIdData[rowid];
|
|
2683
|
+
if (!rowRest) {
|
|
2684
|
+
rowRest = {
|
|
2684
2685
|
row,
|
|
2685
2686
|
rowid,
|
|
2686
2687
|
seq,
|
|
@@ -2697,26 +2698,22 @@ const Methods = {
|
|
|
2697
2698
|
expandHeight: 0
|
|
2698
2699
|
};
|
|
2699
2700
|
}
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
}
|
|
2708
|
-
fullAllDataRowIdMaps[rowid] = cacheItem;
|
|
2701
|
+
rowRest.row = row;
|
|
2702
|
+
rowRest.items = items;
|
|
2703
|
+
rowRest.parent = parentRow;
|
|
2704
|
+
rowRest.level = level;
|
|
2705
|
+
rowRest.index = treeConfig && parentRow ? -1 : index;
|
|
2706
|
+
fullDataRowIdMaps[rowid] = rowRest;
|
|
2707
|
+
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
2709
2708
|
};
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
}
|
|
2713
|
-
this.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
2709
|
+
internalData.fullDataRowIdData = fullDataRowIdMaps;
|
|
2710
|
+
internalData.fullAllDataRowIdData = fullAllDataRowIdMaps;
|
|
2714
2711
|
if (treeConfig) {
|
|
2715
|
-
_xeUtils.default.eachTree(tableFullTreeData,
|
|
2712
|
+
_xeUtils.default.eachTree(tableFullTreeData, handleRow, {
|
|
2716
2713
|
children: childrenField
|
|
2717
2714
|
});
|
|
2718
2715
|
} else {
|
|
2719
|
-
tableFullData.forEach(
|
|
2716
|
+
tableFullData.forEach(handleRow);
|
|
2720
2717
|
}
|
|
2721
2718
|
},
|
|
2722
2719
|
cacheSourceMap(fullData) {
|
|
@@ -3721,7 +3718,7 @@ const Methods = {
|
|
|
3721
3718
|
treeConfig
|
|
3722
3719
|
} = props;
|
|
3723
3720
|
const {
|
|
3724
|
-
|
|
3721
|
+
fullAllDataRowIdData
|
|
3725
3722
|
} = internalData;
|
|
3726
3723
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
3727
3724
|
const {
|
|
@@ -3737,7 +3734,7 @@ const Methods = {
|
|
|
3737
3734
|
rowid = (0, _util.getRowid)($xeTable, rowOrRowid);
|
|
3738
3735
|
}
|
|
3739
3736
|
if (rowid) {
|
|
3740
|
-
const rest =
|
|
3737
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
3741
3738
|
const row = rest ? rest.row : null;
|
|
3742
3739
|
if (row) {
|
|
3743
3740
|
return row[transform ? mapChildrenField : childrenField] || [];
|
|
@@ -3757,7 +3754,7 @@ const Methods = {
|
|
|
3757
3754
|
treeConfig
|
|
3758
3755
|
} = props;
|
|
3759
3756
|
const {
|
|
3760
|
-
|
|
3757
|
+
fullAllDataRowIdData
|
|
3761
3758
|
} = internalData;
|
|
3762
3759
|
if (rowOrRowid && treeConfig) {
|
|
3763
3760
|
let rowid;
|
|
@@ -3767,7 +3764,7 @@ const Methods = {
|
|
|
3767
3764
|
rowid = (0, _util.getRowid)($xeTable, rowOrRowid);
|
|
3768
3765
|
}
|
|
3769
3766
|
if (rowid) {
|
|
3770
|
-
const rest =
|
|
3767
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
3771
3768
|
return rest ? rest.parent : null;
|
|
3772
3769
|
}
|
|
3773
3770
|
}
|
|
@@ -3786,10 +3783,10 @@ const Methods = {
|
|
|
3786
3783
|
const $xeTable = this;
|
|
3787
3784
|
const internalData = $xeTable;
|
|
3788
3785
|
const {
|
|
3789
|
-
|
|
3786
|
+
fullAllDataRowIdData
|
|
3790
3787
|
} = internalData;
|
|
3791
3788
|
const rowid = _xeUtils.default.eqNull(cellValue) ? '' : encodeURIComponent(cellValue);
|
|
3792
|
-
return
|
|
3789
|
+
return fullAllDataRowIdData[rowid] ? fullAllDataRowIdData[rowid].row : null;
|
|
3793
3790
|
},
|
|
3794
3791
|
/**
|
|
3795
3792
|
* 根据行获取行的唯一主键
|
|
@@ -8752,7 +8749,6 @@ const Methods = {
|
|
|
8752
8749
|
const $xeTable = this;
|
|
8753
8750
|
const reactData = $xeTable;
|
|
8754
8751
|
const internalData = $xeTable;
|
|
8755
|
-
const tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
|
|
8756
8752
|
const {
|
|
8757
8753
|
fullAllDataRowIdData
|
|
8758
8754
|
} = internalData;
|
|
@@ -8760,7 +8756,9 @@ const Methods = {
|
|
|
8760
8756
|
const {
|
|
8761
8757
|
transform
|
|
8762
8758
|
} = treeOpts;
|
|
8759
|
+
let tExpandedMaps = {};
|
|
8763
8760
|
if (rows) {
|
|
8761
|
+
tExpandedMaps = Object.assign({}, reactData.treeExpandedMaps);
|
|
8764
8762
|
if (!_xeUtils.default.isArray(rows)) {
|
|
8765
8763
|
rows = [rows];
|
|
8766
8764
|
}
|
|
@@ -8774,8 +8772,12 @@ const Methods = {
|
|
|
8774
8772
|
}
|
|
8775
8773
|
}
|
|
8776
8774
|
});
|
|
8775
|
+
} else {
|
|
8776
|
+
_xeUtils.default.each(fullAllDataRowIdData, rowRest => {
|
|
8777
|
+
rowRest.treeLoaded = false;
|
|
8778
|
+
});
|
|
8777
8779
|
}
|
|
8778
|
-
reactData.treeExpandedMaps =
|
|
8780
|
+
reactData.treeExpandedMaps = {};
|
|
8779
8781
|
if (transform) {
|
|
8780
8782
|
handleVirtualTreeToList($xeTable);
|
|
8781
8783
|
return $xeTable.handleTableData();
|