vxe-table 4.10.6-beta.4 → 4.10.6-beta.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/es/style.css +1 -1
- package/es/table/module/edit/hook.js +5 -5
- package/es/table/src/body.js +1 -1
- package/es/table/src/table.js +34 -23
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +59 -34
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +5 -0
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/body.js +1 -1
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +51 -31
- 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 +1 -1
- package/packages/table/module/edit/hook.ts +5 -5
- package/packages/table/src/body.ts +1 -1
- package/packages/table/src/table.ts +34 -22
- /package/es/{iconfont.1736759340059.ttf → iconfont.1736779080510.ttf} +0 -0
- /package/es/{iconfont.1736759340059.woff → iconfont.1736779080510.woff} +0 -0
- /package/es/{iconfont.1736759340059.woff2 → iconfont.1736779080510.woff2} +0 -0
- /package/lib/{iconfont.1736759340059.ttf → iconfont.1736779080510.ttf} +0 -0
- /package/lib/{iconfont.1736759340059.woff → iconfont.1736779080510.woff} +0 -0
- /package/lib/{iconfont.1736759340059.woff2 → iconfont.1736779080510.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -1443,14 +1443,35 @@ export default defineComponent({
|
|
|
1443
1443
|
return cellValue;
|
|
1444
1444
|
};
|
|
1445
1445
|
};
|
|
1446
|
+
const updateAfterListIndex = () => {
|
|
1447
|
+
const { afterFullData, fullDataRowIdData, fullAllDataRowIdData } = internalData;
|
|
1448
|
+
const fullMaps = {};
|
|
1449
|
+
afterFullData.forEach((row, index) => {
|
|
1450
|
+
const rowid = getRowid($xeTable, row);
|
|
1451
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
1452
|
+
const seq = index + 1;
|
|
1453
|
+
if (rowRest) {
|
|
1454
|
+
rowRest.seq = seq;
|
|
1455
|
+
rowRest._index = index;
|
|
1456
|
+
}
|
|
1457
|
+
else {
|
|
1458
|
+
const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, treeIndex: -1, items: [], parent: null, level: 0, height: 0, oTop: 0 };
|
|
1459
|
+
fullAllDataRowIdData[rowid] = rest;
|
|
1460
|
+
fullDataRowIdData[rowid] = rest;
|
|
1461
|
+
}
|
|
1462
|
+
fullMaps[rowid] = row;
|
|
1463
|
+
});
|
|
1464
|
+
internalData.afterFullRowMaps = fullMaps;
|
|
1465
|
+
};
|
|
1446
1466
|
/**
|
|
1447
1467
|
* 预编译
|
|
1448
1468
|
* 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
|
|
1449
1469
|
*/
|
|
1450
1470
|
const updateAfterDataIndex = () => {
|
|
1451
1471
|
const { treeConfig } = props;
|
|
1452
|
-
const {
|
|
1472
|
+
const { fullDataRowIdData, fullAllDataRowIdData, afterTreeFullData } = internalData;
|
|
1453
1473
|
const treeOpts = computeTreeOpts.value;
|
|
1474
|
+
const { transform } = treeOpts;
|
|
1454
1475
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
1455
1476
|
const fullMaps = {};
|
|
1456
1477
|
if (treeConfig) {
|
|
@@ -1460,34 +1481,21 @@ export default defineComponent({
|
|
|
1460
1481
|
const seq = path.map((num, i) => i % 2 === 0 ? (Number(num) + 1) : '.').join('');
|
|
1461
1482
|
if (rowRest) {
|
|
1462
1483
|
rowRest.seq = seq;
|
|
1463
|
-
rowRest.
|
|
1484
|
+
rowRest.treeIndex = index;
|
|
1464
1485
|
}
|
|
1465
1486
|
else {
|
|
1466
|
-
const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, items: [], parent: null, level: 0, height: 0, oTop: 0 };
|
|
1487
|
+
const rest = { row, rowid, seq, index: -1, $index: -1, _index: -1, treeIndex: -1, items: [], parent: null, level: 0, height: 0, oTop: 0 };
|
|
1467
1488
|
fullAllDataRowIdData[rowid] = rest;
|
|
1468
1489
|
fullDataRowIdData[rowid] = rest;
|
|
1469
1490
|
}
|
|
1470
1491
|
fullMaps[rowid] = row;
|
|
1471
|
-
}, { children:
|
|
1492
|
+
}, { children: transform ? treeOpts.mapChildrenField : childrenField });
|
|
1493
|
+
internalData.afterFullRowMaps = fullMaps;
|
|
1494
|
+
updateAfterListIndex();
|
|
1472
1495
|
}
|
|
1473
1496
|
else {
|
|
1474
|
-
|
|
1475
|
-
const rowid = getRowid($xeTable, row);
|
|
1476
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
1477
|
-
const seq = index + 1;
|
|
1478
|
-
if (rowRest) {
|
|
1479
|
-
rowRest.seq = seq;
|
|
1480
|
-
rowRest._index = index;
|
|
1481
|
-
}
|
|
1482
|
-
else {
|
|
1483
|
-
const rest = { row, rowid, seq, index: -1, $index: -1, _index: index, items: [], parent: null, level: 0, height: 0, oTop: 0 };
|
|
1484
|
-
fullAllDataRowIdData[rowid] = rest;
|
|
1485
|
-
fullDataRowIdData[rowid] = rest;
|
|
1486
|
-
}
|
|
1487
|
-
fullMaps[rowid] = row;
|
|
1488
|
-
});
|
|
1497
|
+
updateAfterListIndex();
|
|
1489
1498
|
}
|
|
1490
|
-
internalData.afterFullRowMaps = fullMaps;
|
|
1491
1499
|
};
|
|
1492
1500
|
/**
|
|
1493
1501
|
* 如果为虚拟树,将树结构拍平
|
|
@@ -2501,12 +2509,14 @@ export default defineComponent({
|
|
|
2501
2509
|
}
|
|
2502
2510
|
calcCellWidth();
|
|
2503
2511
|
autoCellWidth();
|
|
2512
|
+
updateStyle();
|
|
2504
2513
|
return computeScrollLoad().then(() => {
|
|
2505
2514
|
if (reFull === true) {
|
|
2506
2515
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
2507
2516
|
calcCellHeight();
|
|
2508
2517
|
calcCellWidth();
|
|
2509
2518
|
autoCellWidth();
|
|
2519
|
+
updateStyle();
|
|
2510
2520
|
return computeScrollLoad();
|
|
2511
2521
|
}
|
|
2512
2522
|
});
|
|
@@ -2993,8 +3003,9 @@ export default defineComponent({
|
|
|
2993
3003
|
handleVirtualTreeToList();
|
|
2994
3004
|
tablePrivateMethods.handleTableData();
|
|
2995
3005
|
updateAfterDataIndex();
|
|
3006
|
+
return nextTick();
|
|
2996
3007
|
}).then(() => {
|
|
2997
|
-
return tableMethods.recalculate();
|
|
3008
|
+
return tableMethods.recalculate(true);
|
|
2998
3009
|
}).then(() => {
|
|
2999
3010
|
setTimeout(() => {
|
|
3000
3011
|
tableMethods.updateCellAreas();
|
|
@@ -3362,7 +3373,7 @@ export default defineComponent({
|
|
|
3362
3373
|
XEUtils.eachTree(rows, (childRow, index, items, path, parentItem, nodes) => {
|
|
3363
3374
|
const rowid = getRowid($xeTable, childRow);
|
|
3364
3375
|
const parentRow = parentItem || parentRest.row;
|
|
3365
|
-
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, oTop: 0 };
|
|
3376
|
+
const rest = { row: childRow, rowid, seq: -1, index, _index: -1, $index: -1, treeIndex: -1, items, parent: parentRow, level: parentLevel + nodes.length, height: 0, oTop: 0 };
|
|
3366
3377
|
fullDataRowIdData[rowid] = rest;
|
|
3367
3378
|
fullAllDataRowIdData[rowid] = rest;
|
|
3368
3379
|
}, { children: childrenField });
|
|
@@ -6414,7 +6425,7 @@ export default defineComponent({
|
|
|
6414
6425
|
}
|
|
6415
6426
|
let cacheItem = fullAllDataRowIdData[rowid];
|
|
6416
6427
|
if (!cacheItem) {
|
|
6417
|
-
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, items, parent: parentRow, level, height: 0, oTop: 0 };
|
|
6428
|
+
cacheItem = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, oTop: 0 };
|
|
6418
6429
|
}
|
|
6419
6430
|
cacheItem.row = row;
|
|
6420
6431
|
cacheItem.items = items;
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.10.6-beta.
|
|
3141
|
+
const version = "4.10.6-beta.6";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3568,7 +3568,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3568
3568
|
const {
|
|
3569
3569
|
log: log_log
|
|
3570
3570
|
} = core_.VxeUI;
|
|
3571
|
-
const log_version = `table v${"4.10.6-beta.
|
|
3571
|
+
const log_version = `table v${"4.10.6-beta.6"}`;
|
|
3572
3572
|
const warnLog = log_log.create('warn', log_version);
|
|
3573
3573
|
const errLog = log_log.create('error', log_version);
|
|
3574
3574
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -6210,7 +6210,7 @@ const renderType = 'body';
|
|
|
6210
6210
|
let prevRow = null;
|
|
6211
6211
|
if (rest) {
|
|
6212
6212
|
rLevel = rest.level;
|
|
6213
|
-
prevRow = rest.items[rest.
|
|
6213
|
+
prevRow = rest.items[rest.treeIndex - 1];
|
|
6214
6214
|
}
|
|
6215
6215
|
const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
|
|
6216
6216
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
@@ -11900,6 +11900,42 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11900
11900
|
return cellValue;
|
|
11901
11901
|
};
|
|
11902
11902
|
};
|
|
11903
|
+
const updateAfterListIndex = () => {
|
|
11904
|
+
const {
|
|
11905
|
+
afterFullData,
|
|
11906
|
+
fullDataRowIdData,
|
|
11907
|
+
fullAllDataRowIdData
|
|
11908
|
+
} = internalData;
|
|
11909
|
+
const fullMaps = {};
|
|
11910
|
+
afterFullData.forEach((row, index) => {
|
|
11911
|
+
const rowid = getRowid($xeTable, row);
|
|
11912
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
11913
|
+
const seq = index + 1;
|
|
11914
|
+
if (rowRest) {
|
|
11915
|
+
rowRest.seq = seq;
|
|
11916
|
+
rowRest._index = index;
|
|
11917
|
+
} else {
|
|
11918
|
+
const rest = {
|
|
11919
|
+
row,
|
|
11920
|
+
rowid,
|
|
11921
|
+
seq,
|
|
11922
|
+
index: -1,
|
|
11923
|
+
$index: -1,
|
|
11924
|
+
_index: index,
|
|
11925
|
+
treeIndex: -1,
|
|
11926
|
+
items: [],
|
|
11927
|
+
parent: null,
|
|
11928
|
+
level: 0,
|
|
11929
|
+
height: 0,
|
|
11930
|
+
oTop: 0
|
|
11931
|
+
};
|
|
11932
|
+
fullAllDataRowIdData[rowid] = rest;
|
|
11933
|
+
fullDataRowIdData[rowid] = rest;
|
|
11934
|
+
}
|
|
11935
|
+
fullMaps[rowid] = row;
|
|
11936
|
+
});
|
|
11937
|
+
internalData.afterFullRowMaps = fullMaps;
|
|
11938
|
+
};
|
|
11903
11939
|
/**
|
|
11904
11940
|
* 预编译
|
|
11905
11941
|
* 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
|
|
@@ -11909,12 +11945,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11909
11945
|
treeConfig
|
|
11910
11946
|
} = props;
|
|
11911
11947
|
const {
|
|
11912
|
-
afterFullData,
|
|
11913
11948
|
fullDataRowIdData,
|
|
11914
11949
|
fullAllDataRowIdData,
|
|
11915
11950
|
afterTreeFullData
|
|
11916
11951
|
} = internalData;
|
|
11917
11952
|
const treeOpts = computeTreeOpts.value;
|
|
11953
|
+
const {
|
|
11954
|
+
transform
|
|
11955
|
+
} = treeOpts;
|
|
11918
11956
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
11919
11957
|
const fullMaps = {};
|
|
11920
11958
|
if (treeConfig) {
|
|
@@ -11924,7 +11962,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11924
11962
|
const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
|
|
11925
11963
|
if (rowRest) {
|
|
11926
11964
|
rowRest.seq = seq;
|
|
11927
|
-
rowRest.
|
|
11965
|
+
rowRest.treeIndex = index;
|
|
11928
11966
|
} else {
|
|
11929
11967
|
const rest = {
|
|
11930
11968
|
row,
|
|
@@ -11933,6 +11971,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11933
11971
|
index: -1,
|
|
11934
11972
|
$index: -1,
|
|
11935
11973
|
_index: -1,
|
|
11974
|
+
treeIndex: -1,
|
|
11936
11975
|
items: [],
|
|
11937
11976
|
parent: null,
|
|
11938
11977
|
level: 0,
|
|
@@ -11944,37 +11983,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11944
11983
|
}
|
|
11945
11984
|
fullMaps[rowid] = row;
|
|
11946
11985
|
}, {
|
|
11947
|
-
children:
|
|
11986
|
+
children: transform ? treeOpts.mapChildrenField : childrenField
|
|
11948
11987
|
});
|
|
11988
|
+
internalData.afterFullRowMaps = fullMaps;
|
|
11989
|
+
updateAfterListIndex();
|
|
11949
11990
|
} else {
|
|
11950
|
-
|
|
11951
|
-
const rowid = getRowid($xeTable, row);
|
|
11952
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
11953
|
-
const seq = index + 1;
|
|
11954
|
-
if (rowRest) {
|
|
11955
|
-
rowRest.seq = seq;
|
|
11956
|
-
rowRest._index = index;
|
|
11957
|
-
} else {
|
|
11958
|
-
const rest = {
|
|
11959
|
-
row,
|
|
11960
|
-
rowid,
|
|
11961
|
-
seq,
|
|
11962
|
-
index: -1,
|
|
11963
|
-
$index: -1,
|
|
11964
|
-
_index: index,
|
|
11965
|
-
items: [],
|
|
11966
|
-
parent: null,
|
|
11967
|
-
level: 0,
|
|
11968
|
-
height: 0,
|
|
11969
|
-
oTop: 0
|
|
11970
|
-
};
|
|
11971
|
-
fullAllDataRowIdData[rowid] = rest;
|
|
11972
|
-
fullDataRowIdData[rowid] = rest;
|
|
11973
|
-
}
|
|
11974
|
-
fullMaps[rowid] = row;
|
|
11975
|
-
});
|
|
11991
|
+
updateAfterListIndex();
|
|
11976
11992
|
}
|
|
11977
|
-
internalData.afterFullRowMaps = fullMaps;
|
|
11978
11993
|
};
|
|
11979
11994
|
/**
|
|
11980
11995
|
* 如果为虚拟树,将树结构拍平
|
|
@@ -13210,12 +13225,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13210
13225
|
}
|
|
13211
13226
|
calcCellWidth();
|
|
13212
13227
|
autoCellWidth();
|
|
13228
|
+
updateStyle();
|
|
13213
13229
|
return computeScrollLoad().then(() => {
|
|
13214
13230
|
if (reFull === true) {
|
|
13215
13231
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
13216
13232
|
calcCellHeight();
|
|
13217
13233
|
calcCellWidth();
|
|
13218
13234
|
autoCellWidth();
|
|
13235
|
+
updateStyle();
|
|
13219
13236
|
return computeScrollLoad();
|
|
13220
13237
|
}
|
|
13221
13238
|
});
|
|
@@ -13767,8 +13784,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13767
13784
|
handleVirtualTreeToList();
|
|
13768
13785
|
tablePrivateMethods.handleTableData();
|
|
13769
13786
|
updateAfterDataIndex();
|
|
13787
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
13770
13788
|
}).then(() => {
|
|
13771
|
-
return tableMethods.recalculate();
|
|
13789
|
+
return tableMethods.recalculate(true);
|
|
13772
13790
|
}).then(() => {
|
|
13773
13791
|
setTimeout(() => {
|
|
13774
13792
|
tableMethods.updateCellAreas();
|
|
@@ -14226,6 +14244,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14226
14244
|
index,
|
|
14227
14245
|
_index: -1,
|
|
14228
14246
|
$index: -1,
|
|
14247
|
+
treeIndex: -1,
|
|
14229
14248
|
items,
|
|
14230
14249
|
parent: parentRow,
|
|
14231
14250
|
level: parentLevel + nodes.length,
|
|
@@ -17683,6 +17702,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17683
17702
|
index: -1,
|
|
17684
17703
|
_index: -1,
|
|
17685
17704
|
$index: -1,
|
|
17705
|
+
treeIndex: index,
|
|
17686
17706
|
items,
|
|
17687
17707
|
parent: parentRow,
|
|
17688
17708
|
level,
|
|
@@ -22031,6 +22051,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22031
22051
|
index: -1,
|
|
22032
22052
|
_index: -1,
|
|
22033
22053
|
$index: -1,
|
|
22054
|
+
treeIndex: -1,
|
|
22034
22055
|
items: parentChilds,
|
|
22035
22056
|
parent: parentRow,
|
|
22036
22057
|
level: parentLevel + 1,
|
|
@@ -22054,6 +22075,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22054
22075
|
index: -1,
|
|
22055
22076
|
_index: -1,
|
|
22056
22077
|
$index: -1,
|
|
22078
|
+
treeIndex: -1,
|
|
22057
22079
|
items: tableFullTreeData,
|
|
22058
22080
|
parent: null,
|
|
22059
22081
|
level: 0,
|
|
@@ -22108,6 +22130,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22108
22130
|
index: -1,
|
|
22109
22131
|
_index: -1,
|
|
22110
22132
|
$index: -1,
|
|
22133
|
+
treeIndex: -1,
|
|
22111
22134
|
items: afterFullData,
|
|
22112
22135
|
parent: null,
|
|
22113
22136
|
level: 0,
|
|
@@ -22143,6 +22166,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22143
22166
|
seq: -1,
|
|
22144
22167
|
index: -1,
|
|
22145
22168
|
_index: -1,
|
|
22169
|
+
treeIndex: -1,
|
|
22146
22170
|
$index: -1,
|
|
22147
22171
|
items: afterFullData,
|
|
22148
22172
|
parent: null,
|
|
@@ -22203,6 +22227,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22203
22227
|
index: -1,
|
|
22204
22228
|
_index: -1,
|
|
22205
22229
|
$index: -1,
|
|
22230
|
+
treeIndex: -1,
|
|
22206
22231
|
items: parentMapChilds,
|
|
22207
22232
|
parent: parentRow,
|
|
22208
22233
|
level: parentLevel + 1,
|