vxe-table 3.11.12 → 3.11.14
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/locale/lang/ar-EG.js +678 -0
- package/es/locale/lang/de-DE.js +678 -0
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +678 -0
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +678 -0
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +678 -0
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +2 -1
- package/es/locale/lang/ug-CN.js +678 -0
- package/es/locale/lang/uk-UA.js +2 -1
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +27 -2
- package/es/table/module/edit/mixin.js +2 -2
- package/es/table/module/export/mixin.js +4 -1
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/src/body.js +15 -4
- package/es/table/src/methods.js +93 -13
- package/es/table/src/table.js +14 -6
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +191 -39
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +684 -0
- package/lib/locale/lang/ar-EG.min.js +1 -0
- package/lib/locale/lang/de-DE.js +684 -0
- package/lib/locale/lang/de-DE.min.js +1 -0
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +684 -0
- package/lib/locale/lang/fr-FR.min.js +1 -0
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +684 -0
- package/lib/locale/lang/hy-AM.min.js +1 -0
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +684 -0
- package/lib/locale/lang/nb-NO.min.js +1 -0
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +2 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -1
- package/lib/locale/lang/ug-CN.js +684 -0
- package/lib/locale/lang/ug-CN.min.js +1 -0
- package/lib/locale/lang/uk-UA.js +2 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -1
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +26 -1
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +2 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +4 -1
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/body.js +17 -4
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/methods.js +120 -16
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +16 -10
- 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/locale/lang/ar-EG.ts +678 -0
- package/packages/locale/lang/de-DE.ts +678 -0
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +678 -0
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +678 -0
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +678 -0
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +678 -0
- package/packages/locale/lang/uk-UA.ts +2 -1
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/custom/panel.ts +27 -2
- package/packages/table/module/edit/mixin.ts +2 -2
- package/packages/table/module/export/mixin.ts +4 -1
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/src/body.ts +14 -4
- package/packages/table/src/methods.ts +97 -14
- package/packages/table/src/table.ts +14 -6
- /package/es/{iconfont.1732797517080.ttf → iconfont.1733097092605.ttf} +0 -0
- /package/es/{iconfont.1732797517080.woff → iconfont.1733097092605.woff} +0 -0
- /package/es/{iconfont.1732797517080.woff2 → iconfont.1733097092605.woff2} +0 -0
- /package/lib/{iconfont.1732797517080.ttf → iconfont.1733097092605.ttf} +0 -0
- /package/lib/{iconfont.1732797517080.woff → iconfont.1733097092605.woff} +0 -0
- /package/lib/{iconfont.1732797517080.woff2 → iconfont.1733097092605.woff2} +0 -0
package/lib/table/src/methods.js
CHANGED
|
@@ -572,16 +572,15 @@ function handleRecalculateLayout($xeTable, reFull) {
|
|
|
572
572
|
}
|
|
573
573
|
$xeTable.calcCellWidth();
|
|
574
574
|
$xeTable.autoCellWidth();
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
575
|
+
return $xeTable.computeScrollLoad().then(() => {
|
|
576
|
+
if (reFull === true) {
|
|
577
|
+
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
578
578
|
calcCellHeight($xeTable);
|
|
579
579
|
$xeTable.calcCellWidth();
|
|
580
580
|
$xeTable.autoCellWidth();
|
|
581
581
|
return $xeTable.computeScrollLoad();
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
return $xeTable.computeScrollLoad();
|
|
582
|
+
}
|
|
583
|
+
});
|
|
585
584
|
}
|
|
586
585
|
function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
587
586
|
const reactData = $xeTable;
|
|
@@ -1950,6 +1949,11 @@ const Methods = {
|
|
|
1950
1949
|
* @returns
|
|
1951
1950
|
*/
|
|
1952
1951
|
handleVirtualTreeToList() {
|
|
1952
|
+
const $xeTable = this;
|
|
1953
|
+
const internalData = $xeTable;
|
|
1954
|
+
const {
|
|
1955
|
+
fullAllDataRowIdData
|
|
1956
|
+
} = internalData;
|
|
1953
1957
|
const {
|
|
1954
1958
|
treeOpts,
|
|
1955
1959
|
treeConfig,
|
|
@@ -1965,6 +1969,10 @@ const Methods = {
|
|
|
1965
1969
|
const rowid = (0, _util.getRowid)(this, row);
|
|
1966
1970
|
const parentRowid = (0, _util.getRowid)(this, parent);
|
|
1967
1971
|
if (!parent || expandMaps[parentRowid] && treeExpandedMaps[parentRowid]) {
|
|
1972
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
1973
|
+
if (rowRest) {
|
|
1974
|
+
rowRest._index = fullData.length;
|
|
1975
|
+
}
|
|
1968
1976
|
expandMaps[rowid] = 1;
|
|
1969
1977
|
fullData.push(row);
|
|
1970
1978
|
}
|
|
@@ -2188,24 +2196,69 @@ const Methods = {
|
|
|
2188
2196
|
this.afterTreeFullData = tableTree;
|
|
2189
2197
|
this.updateAfterDataIndex();
|
|
2190
2198
|
},
|
|
2199
|
+
updateTreeDataIndex() {
|
|
2200
|
+
const $xeTable = this;
|
|
2201
|
+
const props = $xeTable;
|
|
2202
|
+
const internalData = $xeTable;
|
|
2203
|
+
const {
|
|
2204
|
+
treeConfig
|
|
2205
|
+
} = props;
|
|
2206
|
+
const {
|
|
2207
|
+
afterFullData,
|
|
2208
|
+
fullDataRowIdData,
|
|
2209
|
+
fullAllDataRowIdData
|
|
2210
|
+
} = internalData;
|
|
2211
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
2212
|
+
if (treeConfig) {
|
|
2213
|
+
if (treeOpts.transform) {
|
|
2214
|
+
afterFullData.forEach((row, index) => {
|
|
2215
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
2216
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
2217
|
+
if (rowRest) {
|
|
2218
|
+
rowRest._index = index;
|
|
2219
|
+
} else {
|
|
2220
|
+
const rest = {
|
|
2221
|
+
row,
|
|
2222
|
+
rowid,
|
|
2223
|
+
seq: '-1',
|
|
2224
|
+
index: -1,
|
|
2225
|
+
$index: -1,
|
|
2226
|
+
_index: index,
|
|
2227
|
+
items: [],
|
|
2228
|
+
parent: null,
|
|
2229
|
+
level: 0,
|
|
2230
|
+
height: 0
|
|
2231
|
+
};
|
|
2232
|
+
fullAllDataRowIdData[rowid] = rest;
|
|
2233
|
+
fullDataRowIdData[rowid] = rest;
|
|
2234
|
+
}
|
|
2235
|
+
});
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
},
|
|
2191
2239
|
/**
|
|
2192
2240
|
* 预编译
|
|
2193
2241
|
* 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
|
|
2194
2242
|
*/
|
|
2195
2243
|
updateAfterDataIndex() {
|
|
2244
|
+
const $xeTable = this;
|
|
2245
|
+
const props = $xeTable;
|
|
2246
|
+
const internalData = $xeTable;
|
|
2247
|
+
const {
|
|
2248
|
+
treeConfig
|
|
2249
|
+
} = props;
|
|
2196
2250
|
const {
|
|
2197
|
-
treeConfig,
|
|
2198
2251
|
afterFullData,
|
|
2199
2252
|
fullDataRowIdData,
|
|
2200
2253
|
fullAllDataRowIdData,
|
|
2201
|
-
afterTreeFullData
|
|
2202
|
-
|
|
2203
|
-
|
|
2254
|
+
afterTreeFullData
|
|
2255
|
+
} = internalData;
|
|
2256
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
2204
2257
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2205
2258
|
const fullMaps = {};
|
|
2206
2259
|
if (treeConfig) {
|
|
2207
2260
|
_xeUtils.default.eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
2208
|
-
const rowid = (0, _util.getRowid)(
|
|
2261
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
2209
2262
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2210
2263
|
const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
|
|
2211
2264
|
if (rowRest) {
|
|
@@ -2231,9 +2284,10 @@ const Methods = {
|
|
|
2231
2284
|
}, {
|
|
2232
2285
|
children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
|
|
2233
2286
|
});
|
|
2287
|
+
$xeTable.updateTreeDataIndex();
|
|
2234
2288
|
} else {
|
|
2235
2289
|
afterFullData.forEach((row, index) => {
|
|
2236
|
-
const rowid = (0, _util.getRowid)(
|
|
2290
|
+
const rowid = (0, _util.getRowid)($xeTable, row);
|
|
2237
2291
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2238
2292
|
const seq = index + 1;
|
|
2239
2293
|
if (rowRest) {
|
|
@@ -2260,10 +2314,46 @@ const Methods = {
|
|
|
2260
2314
|
}
|
|
2261
2315
|
this.afterFullRowMaps = fullMaps;
|
|
2262
2316
|
},
|
|
2317
|
+
/**
|
|
2318
|
+
* 只对 tree-config 有效,获取行的子级
|
|
2319
|
+
*/
|
|
2320
|
+
getTreeRowChildren(rowOrRowid) {
|
|
2321
|
+
const $xeTable = this;
|
|
2322
|
+
const props = $xeTable;
|
|
2323
|
+
const internalData = $xeTable;
|
|
2324
|
+
const {
|
|
2325
|
+
treeConfig
|
|
2326
|
+
} = props;
|
|
2327
|
+
const {
|
|
2328
|
+
fullDataRowIdData
|
|
2329
|
+
} = internalData;
|
|
2330
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
2331
|
+
const {
|
|
2332
|
+
transform,
|
|
2333
|
+
mapChildrenField
|
|
2334
|
+
} = treeOpts;
|
|
2335
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
2336
|
+
if (rowOrRowid && treeConfig) {
|
|
2337
|
+
let rowid;
|
|
2338
|
+
if (_xeUtils.default.isString(rowOrRowid)) {
|
|
2339
|
+
rowid = rowOrRowid;
|
|
2340
|
+
} else {
|
|
2341
|
+
rowid = (0, _util.getRowid)($xeTable, rowOrRowid);
|
|
2342
|
+
}
|
|
2343
|
+
if (rowid) {
|
|
2344
|
+
const rest = fullDataRowIdData[rowid];
|
|
2345
|
+
const row = rest ? rest.row : null;
|
|
2346
|
+
if (row) {
|
|
2347
|
+
return row[transform ? mapChildrenField : childrenField] || [];
|
|
2348
|
+
}
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
return [];
|
|
2352
|
+
},
|
|
2263
2353
|
/**
|
|
2264
2354
|
* 只对 tree-config 有效,获取行的父级
|
|
2265
2355
|
*/
|
|
2266
|
-
|
|
2356
|
+
getTreeParentRow(rowOrRowid) {
|
|
2267
2357
|
const {
|
|
2268
2358
|
treeConfig,
|
|
2269
2359
|
fullDataRowIdData
|
|
@@ -2282,6 +2372,11 @@ const Methods = {
|
|
|
2282
2372
|
}
|
|
2283
2373
|
return null;
|
|
2284
2374
|
},
|
|
2375
|
+
getParentRow(rowOrRowid) {
|
|
2376
|
+
const $xeTable = this;
|
|
2377
|
+
(0, _log.warnLog)('vxe.error.delFunc', ['getParentRow', 'getTreeParentRow']);
|
|
2378
|
+
return $xeTable.getTreeParentRow(rowOrRowid);
|
|
2379
|
+
},
|
|
2285
2380
|
/**
|
|
2286
2381
|
* 根据行的唯一主键获取行
|
|
2287
2382
|
* @param {String/Number} rowid 行主键
|
|
@@ -6889,7 +6984,9 @@ const Methods = {
|
|
|
6889
6984
|
}
|
|
6890
6985
|
return this.$nextTick().then(() => {
|
|
6891
6986
|
if (transform) {
|
|
6892
|
-
|
|
6987
|
+
this.handleTableData();
|
|
6988
|
+
this.updateTreeDataIndex();
|
|
6989
|
+
return this.$nextTick();
|
|
6893
6990
|
}
|
|
6894
6991
|
});
|
|
6895
6992
|
});
|
|
@@ -7015,7 +7112,9 @@ const Methods = {
|
|
|
7015
7112
|
validRows.forEach(row => this.handleTreeExpandReserve(row, expanded));
|
|
7016
7113
|
}
|
|
7017
7114
|
this.treeExpandedMaps = treeTempExpandedMaps;
|
|
7018
|
-
return Promise.all(result).then(
|
|
7115
|
+
return Promise.all(result).then(() => {
|
|
7116
|
+
return this.recalculate();
|
|
7117
|
+
});
|
|
7019
7118
|
},
|
|
7020
7119
|
/**
|
|
7021
7120
|
* 虚拟树的展开与收起
|
|
@@ -7026,9 +7125,14 @@ const Methods = {
|
|
|
7026
7125
|
handleVirtualTreeExpand(rows, expanded) {
|
|
7027
7126
|
return this.handleBaseTreeExpand(rows, expanded).then(() => {
|
|
7028
7127
|
this.handleVirtualTreeToList();
|
|
7029
|
-
|
|
7128
|
+
this.handleTableData();
|
|
7129
|
+
this.updateTreeDataIndex();
|
|
7030
7130
|
}).then(() => {
|
|
7031
7131
|
return this.recalculate();
|
|
7132
|
+
}).then(() => {
|
|
7133
|
+
setTimeout(() => {
|
|
7134
|
+
this.updateCellAreas();
|
|
7135
|
+
}, 30);
|
|
7032
7136
|
});
|
|
7033
7137
|
},
|
|
7034
7138
|
/**
|