vxe-table 4.20.5 → 4.20.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/dist/all.esm.js +77 -38
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +1 -1
- package/es/locale/lang/de-DE.js +1 -1
- package/es/locale/lang/en-US.js +1 -1
- package/es/locale/lang/es-ES.js +1 -1
- package/es/locale/lang/fr-FR.js +1 -1
- package/es/locale/lang/hu-HU.js +1 -1
- package/es/locale/lang/hy-AM.js +1 -1
- package/es/locale/lang/id-ID.js +1 -1
- package/es/locale/lang/it-IT.js +1 -1
- package/es/locale/lang/ja-JP.js +1 -1
- package/es/locale/lang/ko-KR.js +1 -1
- package/es/locale/lang/ms-MY.js +1 -1
- package/es/locale/lang/nb-NO.js +1 -1
- package/es/locale/lang/pt-BR.js +1 -1
- package/es/locale/lang/ru-RU.js +1 -1
- package/es/locale/lang/th-TH.js +1 -1
- package/es/locale/lang/ug-CN.js +1 -1
- package/es/locale/lang/uk-UA.js +1 -1
- package/es/locale/lang/uz-UZ.js +1 -1
- package/es/locale/lang/vi-VN.js +1 -1
- package/es/locale/lang/zh-CHT.js +1 -1
- package/es/locale/lang/zh-CN.js +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/export/hook.js +69 -31
- package/es/table/src/table.js +4 -3
- package/es/table/style.css +1 -1
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.js +3 -0
- package/es/ui/src/log.js +2 -2
- package/es/vxe-table/style.css +1 -1
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +85 -37
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +1 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +1 -1
- package/lib/locale/lang/de-DE.js +1 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +1 -1
- package/lib/locale/lang/en-US.js +1 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +1 -1
- package/lib/locale/lang/es-ES.js +1 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +1 -1
- package/lib/locale/lang/fr-FR.js +1 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +1 -1
- package/lib/locale/lang/hu-HU.js +1 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +1 -1
- package/lib/locale/lang/hy-AM.js +1 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +1 -1
- package/lib/locale/lang/id-ID.js +1 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +1 -1
- package/lib/locale/lang/it-IT.js +1 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +1 -1
- package/lib/locale/lang/ja-JP.js +1 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +1 -1
- package/lib/locale/lang/ko-KR.js +1 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +1 -1
- package/lib/locale/lang/ms-MY.js +1 -1
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +1 -1
- package/lib/locale/lang/nb-NO.js +1 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +1 -1
- package/lib/locale/lang/pt-BR.js +1 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +1 -1
- package/lib/locale/lang/ru-RU.js +1 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +1 -1
- package/lib/locale/lang/th-TH.js +1 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +1 -1
- package/lib/locale/lang/ug-CN.js +1 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +1 -1
- package/lib/locale/lang/uk-UA.js +1 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +1 -1
- package/lib/locale/lang/uz-UZ.js +1 -1
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +1 -1
- package/lib/locale/lang/vi-VN.js +1 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +1 -1
- package/lib/locale/lang/zh-CHT.js +1 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +1 -1
- package/lib/locale/lang/zh-CN.js +1 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/export/hook.js +75 -32
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/src/table.js +2 -1
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +1 -1
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/dom.js +4 -0
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +2 -2
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +1 -1
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +1 -1
- package/packages/locale/lang/de-DE.ts +1 -1
- package/packages/locale/lang/en-US.ts +1 -1
- package/packages/locale/lang/es-ES.ts +1 -1
- package/packages/locale/lang/fr-FR.ts +1 -1
- package/packages/locale/lang/hu-HU.ts +1 -1
- package/packages/locale/lang/hy-AM.ts +1 -1
- package/packages/locale/lang/id-ID.ts +1 -1
- package/packages/locale/lang/it-IT.ts +1 -1
- package/packages/locale/lang/ja-JP.ts +1 -1
- package/packages/locale/lang/ko-KR.ts +1 -1
- package/packages/locale/lang/ms-MY.ts +1 -1
- package/packages/locale/lang/nb-NO.ts +1 -1
- package/packages/locale/lang/pt-BR.ts +1 -1
- package/packages/locale/lang/ru-RU.ts +1 -1
- package/packages/locale/lang/th-TH.ts +1 -1
- package/packages/locale/lang/ug-CN.ts +1 -1
- package/packages/locale/lang/uk-UA.ts +1 -1
- package/packages/locale/lang/uz-UZ.ts +1 -1
- package/packages/locale/lang/vi-VN.ts +1 -1
- package/packages/locale/lang/zh-CHT.ts +1 -1
- package/packages/locale/lang/zh-CN.ts +1 -1
- package/packages/table/module/export/hook.ts +71 -31
- package/packages/table/src/table.ts +4 -3
- package/packages/ui/src/dom.ts +4 -0
- package/packages/ui/src/log.ts +1 -1
- package/styles/components/table.scss +1 -1
- package/styles/theme/base.scss +1 -0
- /package/es/{iconfont.1784367605558.ttf → iconfont.1784791298289.ttf} +0 -0
- /package/es/{iconfont.1784367605558.woff → iconfont.1784791298289.woff} +0 -0
- /package/es/{iconfont.1784367605558.woff2 → iconfont.1784791298289.woff2} +0 -0
- /package/lib/{iconfont.1784367605558.ttf → iconfont.1784791298289.ttf} +0 -0
- /package/lib/{iconfont.1784367605558.woff → iconfont.1784791298289.woff} +0 -0
- /package/lib/{iconfont.1784367605558.woff2 → iconfont.1784791298289.woff2} +0 -0
|
@@ -112,7 +112,7 @@ function toTxtCellLabel(val) {
|
|
|
112
112
|
if (/[",\s\n]/.test(val)) {
|
|
113
113
|
return `"${val.replace(/"/g, '""')}"`;
|
|
114
114
|
}
|
|
115
|
-
return val;
|
|
115
|
+
return XEUtils.eqNull(val) ? '' : val;
|
|
116
116
|
}
|
|
117
117
|
function getElementsByTagName(elem, qualifiedName) {
|
|
118
118
|
return elem.getElementsByTagName(qualifiedName);
|
|
@@ -1190,19 +1190,21 @@ hooks.add('tableExportModule', {
|
|
|
1190
1190
|
return false;
|
|
1191
1191
|
});
|
|
1192
1192
|
};
|
|
1193
|
-
const handleFilterFields = (exportOpts, column, includeFields,
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
}
|
|
1193
|
+
const handleFilterFields = (exportOpts, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps) => {
|
|
1194
|
+
const { field } = column;
|
|
1195
|
+
if (excludeFdMaps[field]) {
|
|
1196
|
+
return false;
|
|
1198
1197
|
}
|
|
1199
1198
|
if (includeFields) {
|
|
1200
|
-
if (
|
|
1199
|
+
if (includeFdMaps[field]) {
|
|
1201
1200
|
return true;
|
|
1202
1201
|
}
|
|
1203
1202
|
return false;
|
|
1204
1203
|
}
|
|
1205
|
-
|
|
1204
|
+
if (extraFdMaps[field]) {
|
|
1205
|
+
return true;
|
|
1206
|
+
}
|
|
1207
|
+
return exportOpts.original ? !!field : defaultFilterExportColumn(column);
|
|
1206
1208
|
};
|
|
1207
1209
|
const handleExportAndPrint = (options, isPrint) => {
|
|
1208
1210
|
const $xeGrid = $xeTable.xeGrid;
|
|
@@ -1239,7 +1241,7 @@ hooks.add('tableExportModule', {
|
|
|
1239
1241
|
const modes = defOpts.modes || [];
|
|
1240
1242
|
const checkMethod = customOpts.checkMethod;
|
|
1241
1243
|
const exportColumns = collectColumn.slice(0);
|
|
1242
|
-
const { columns, excludeFields, includeFields } = defOpts;
|
|
1244
|
+
const { columns, excludeFields, includeFields, extraFields } = defOpts;
|
|
1243
1245
|
// 处理类型
|
|
1244
1246
|
const typeList = types.map((value) => {
|
|
1245
1247
|
return {
|
|
@@ -1259,22 +1261,47 @@ hooks.add('tableExportModule', {
|
|
|
1259
1261
|
label: getI18n(`vxe.export.modes.${item}`)
|
|
1260
1262
|
};
|
|
1261
1263
|
});
|
|
1264
|
+
const excludeFdMaps = {};
|
|
1265
|
+
if (excludeFields && excludeFields.length) {
|
|
1266
|
+
excludeFields.forEach(field => {
|
|
1267
|
+
excludeFdMaps[field] = 1;
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
const includeFdMaps = {};
|
|
1271
|
+
if (includeFields && includeFields.length) {
|
|
1272
|
+
includeFields.forEach(field => {
|
|
1273
|
+
includeFdMaps[field] = 1;
|
|
1274
|
+
});
|
|
1275
|
+
}
|
|
1276
|
+
const extraFdMaps = {};
|
|
1277
|
+
if (extraFields) {
|
|
1278
|
+
extraFields.forEach(field => {
|
|
1279
|
+
extraFdMaps[field] = 1;
|
|
1280
|
+
});
|
|
1281
|
+
}
|
|
1262
1282
|
// 默认选中
|
|
1263
|
-
|
|
1283
|
+
// 优先级 columns > excludeFields > (includeFields || extraFields)
|
|
1284
|
+
XEUtils.eachTree(exportColumns, (column, index, items, path, parentColumn) => {
|
|
1264
1285
|
const isColGroup = column.children && column.children.length > 0;
|
|
1265
1286
|
let isChecked = false;
|
|
1287
|
+
const isExtraChecked = extraFdMaps[column.field];
|
|
1266
1288
|
if (columns && columns.length) {
|
|
1267
1289
|
isChecked = handleFilterColumns(defOpts, column, columns);
|
|
1268
1290
|
}
|
|
1269
1291
|
else if (excludeFields || includeFields) {
|
|
1270
|
-
isChecked = handleFilterFields(defOpts, column, includeFields,
|
|
1292
|
+
isChecked = handleFilterFields(defOpts, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps);
|
|
1271
1293
|
}
|
|
1272
1294
|
else {
|
|
1273
|
-
|
|
1295
|
+
if (isExtraChecked) {
|
|
1296
|
+
isChecked = true;
|
|
1297
|
+
}
|
|
1298
|
+
else {
|
|
1299
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
|
|
1300
|
+
}
|
|
1274
1301
|
}
|
|
1275
1302
|
column.checked = isChecked;
|
|
1276
1303
|
column.halfChecked = false;
|
|
1277
|
-
column.disabled = (
|
|
1304
|
+
column.disabled = (parentColumn && parentColumn.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false);
|
|
1278
1305
|
});
|
|
1279
1306
|
// 更新条件
|
|
1280
1307
|
exportStore.columns = exportColumns;
|
|
@@ -1385,30 +1412,54 @@ hooks.add('tableExportModule', {
|
|
|
1385
1412
|
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
|
|
1386
1413
|
opts.isTreeAllExpanded = opts.isAllExpand;
|
|
1387
1414
|
}
|
|
1388
|
-
let { filename, sheetName, type, mode, columns,
|
|
1415
|
+
let { filename, sheetName, type, mode, columns, columnFilterMethod, beforeExportMethod, includeFields, excludeFields, extraFields } = opts;
|
|
1389
1416
|
let groups = [];
|
|
1390
1417
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
1391
1418
|
if (!mode) {
|
|
1392
1419
|
mode = selectRecords.length ? 'selected' : 'current';
|
|
1393
1420
|
}
|
|
1421
|
+
const excludeFdMaps = {};
|
|
1422
|
+
if (excludeFields && excludeFields.length) {
|
|
1423
|
+
excludeFields.forEach(field => {
|
|
1424
|
+
excludeFdMaps[field] = 1;
|
|
1425
|
+
});
|
|
1426
|
+
}
|
|
1427
|
+
const includeFdMaps = {};
|
|
1428
|
+
if (includeFields && includeFields.length) {
|
|
1429
|
+
includeFields.forEach(field => {
|
|
1430
|
+
includeFdMaps[field] = 1;
|
|
1431
|
+
});
|
|
1432
|
+
}
|
|
1433
|
+
const extraFdMaps = {};
|
|
1434
|
+
if (extraFields) {
|
|
1435
|
+
extraFields.forEach(field => {
|
|
1436
|
+
extraFdMaps[field] = 1;
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1394
1439
|
let isCustomCol = false;
|
|
1395
1440
|
let customCols = [];
|
|
1396
1441
|
if (columns && columns.length) {
|
|
1397
1442
|
isCustomCol = true;
|
|
1398
|
-
customCols = columns;
|
|
1443
|
+
customCols = XEUtils.searchTree(columns, () => true, { children: 'children', mapChildren: 'childNodes', original: true });
|
|
1399
1444
|
}
|
|
1400
1445
|
else {
|
|
1401
1446
|
customCols = XEUtils.searchTree(collectColumn, column => {
|
|
1402
1447
|
const isColGroup = column.children && column.children.length > 0;
|
|
1403
1448
|
let isChecked = false;
|
|
1449
|
+
const isExtraChecked = extraFdMaps[column.field];
|
|
1404
1450
|
if (columns && columns.length) {
|
|
1405
1451
|
isChecked = handleFilterColumns(opts, column, columns);
|
|
1406
1452
|
}
|
|
1407
1453
|
else if (excludeFields || includeFields) {
|
|
1408
|
-
isChecked = handleFilterFields(opts, column, includeFields,
|
|
1454
|
+
isChecked = handleFilterFields(opts, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps);
|
|
1409
1455
|
}
|
|
1410
1456
|
else {
|
|
1411
|
-
|
|
1457
|
+
if (isExtraChecked) {
|
|
1458
|
+
isChecked = true;
|
|
1459
|
+
}
|
|
1460
|
+
else {
|
|
1461
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
|
|
1462
|
+
}
|
|
1412
1463
|
}
|
|
1413
1464
|
return isChecked;
|
|
1414
1465
|
}, { children: 'children', mapChildren: 'childNodes', original: true });
|
|
@@ -1416,20 +1467,7 @@ hooks.add('tableExportModule', {
|
|
|
1416
1467
|
const handleOptions = Object.assign({}, opts, { filename: '', sheetName: '', _columnConfs: columns });
|
|
1417
1468
|
// 如果设置源数据,则默认导出设置了字段的列
|
|
1418
1469
|
if (!isCustomCol && !columnFilterMethod) {
|
|
1419
|
-
columnFilterMethod = ({ column }) =>
|
|
1420
|
-
if (excludeFields) {
|
|
1421
|
-
if (XEUtils.includes(excludeFields, column.field)) {
|
|
1422
|
-
return false;
|
|
1423
|
-
}
|
|
1424
|
-
}
|
|
1425
|
-
if (includeFields) {
|
|
1426
|
-
if (XEUtils.includes(includeFields, column.field)) {
|
|
1427
|
-
return true;
|
|
1428
|
-
}
|
|
1429
|
-
return false;
|
|
1430
|
-
}
|
|
1431
|
-
return original ? !!column.field : defaultFilterExportColumn(column);
|
|
1432
|
-
};
|
|
1470
|
+
columnFilterMethod = ({ column }) => handleFilterFields(handleOptions, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps);
|
|
1433
1471
|
handleOptions.columnFilterMethod = columnFilterMethod;
|
|
1434
1472
|
}
|
|
1435
1473
|
if (customCols) {
|
package/es/table/src/table.js
CHANGED
|
@@ -590,15 +590,16 @@ export default defineVxeComponent({
|
|
|
590
590
|
const { extraFields, includeFields, excludeFields } = editDirtyOpts;
|
|
591
591
|
const kpFields = [];
|
|
592
592
|
if (updateColFlag) {
|
|
593
|
-
|
|
594
|
-
return includeFields;
|
|
595
|
-
}
|
|
593
|
+
// 优先级 excludeFields > (includeFields || extraFields)
|
|
596
594
|
const excludeFdMaps = {};
|
|
597
595
|
if (excludeFields && excludeFields.length) {
|
|
598
596
|
excludeFields.forEach(field => {
|
|
599
597
|
excludeFdMaps[field] = 1;
|
|
600
598
|
});
|
|
601
599
|
}
|
|
600
|
+
if (includeFields && includeFields.length) {
|
|
601
|
+
return excludeFields && excludeFields.length ? includeFields.filter(field => !excludeFdMaps[field]) : includeFields;
|
|
602
|
+
}
|
|
602
603
|
const addFdMaps = {};
|
|
603
604
|
if (extraFields && extraFields.length) {
|
|
604
605
|
extraFields.forEach(field => {
|
package/es/table/style.css
CHANGED