vxe-table 3.22.5 → 3.22.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/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/mixin.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 +7 -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 +91 -39
- 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/mixin.js +75 -32
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/src/table.js +4 -3
- 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 +8 -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/mixin.ts +71 -31
- package/packages/table/src/table.ts +4 -3
- package/packages/ui/src/dom.ts +8 -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.1784367592827.ttf → iconfont.1784791284635.ttf} +0 -0
- /package/es/{iconfont.1784367592827.woff → iconfont.1784791284635.woff} +0 -0
- /package/es/{iconfont.1784367592827.woff2 → iconfont.1784791284635.woff2} +0 -0
- /package/lib/{iconfont.1784367592827.ttf → iconfont.1784791284635.ttf} +0 -0
- /package/lib/{iconfont.1784367592827.woff → iconfont.1784791284635.woff} +0 -0
- /package/lib/{iconfont.1784367592827.woff2 → iconfont.1784791284635.woff2} +0 -0
|
@@ -420,7 +420,7 @@ function toTxtCellLabel(val) {
|
|
|
420
420
|
if (/[",\s\n]/.test(val)) {
|
|
421
421
|
return `"${val.replace(/"/g, '""')}"`;
|
|
422
422
|
}
|
|
423
|
-
return val;
|
|
423
|
+
return XEUtils.eqNull(val) ? '' : val;
|
|
424
424
|
}
|
|
425
425
|
function toCsv($xeTable, opts, columns, datas) {
|
|
426
426
|
const reactData = $xeTable;
|
|
@@ -1154,19 +1154,21 @@ function handleFilterColumns(exportOpts, column, columns) {
|
|
|
1154
1154
|
return false;
|
|
1155
1155
|
});
|
|
1156
1156
|
}
|
|
1157
|
-
function handleFilterFields(exportOpts, column, includeFields,
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
}
|
|
1157
|
+
function handleFilterFields(exportOpts, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps) {
|
|
1158
|
+
const { field } = column;
|
|
1159
|
+
if (excludeFdMaps[field]) {
|
|
1160
|
+
return false;
|
|
1162
1161
|
}
|
|
1163
1162
|
if (includeFields) {
|
|
1164
|
-
if (
|
|
1163
|
+
if (includeFdMaps[field]) {
|
|
1165
1164
|
return true;
|
|
1166
1165
|
}
|
|
1167
1166
|
return false;
|
|
1168
1167
|
}
|
|
1169
|
-
|
|
1168
|
+
if (extraFdMaps[field]) {
|
|
1169
|
+
return true;
|
|
1170
|
+
}
|
|
1171
|
+
return exportOpts.original ? !!field : defaultFilterExportColumn(column);
|
|
1170
1172
|
}
|
|
1171
1173
|
function handleExportAndPrint($xeTable, options, isPrint) {
|
|
1172
1174
|
const props = $xeTable;
|
|
@@ -1206,7 +1208,7 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
1206
1208
|
const modes = defOpts.modes || [];
|
|
1207
1209
|
const checkMethod = customOpts.checkMethod;
|
|
1208
1210
|
const exportColumns = collectColumn.slice(0);
|
|
1209
|
-
const { columns, excludeFields, includeFields } = defOpts;
|
|
1211
|
+
const { columns, excludeFields, includeFields, extraFields } = defOpts;
|
|
1210
1212
|
// 处理类型
|
|
1211
1213
|
const typeList = types.map((value) => {
|
|
1212
1214
|
return {
|
|
@@ -1226,22 +1228,47 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
1226
1228
|
label: getI18n(`vxe.export.modes.${item}`)
|
|
1227
1229
|
};
|
|
1228
1230
|
});
|
|
1231
|
+
const excludeFdMaps = {};
|
|
1232
|
+
if (excludeFields && excludeFields.length) {
|
|
1233
|
+
excludeFields.forEach(field => {
|
|
1234
|
+
excludeFdMaps[field] = 1;
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
const includeFdMaps = {};
|
|
1238
|
+
if (includeFields && includeFields.length) {
|
|
1239
|
+
includeFields.forEach(field => {
|
|
1240
|
+
includeFdMaps[field] = 1;
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
const extraFdMaps = {};
|
|
1244
|
+
if (extraFields) {
|
|
1245
|
+
extraFields.forEach(field => {
|
|
1246
|
+
extraFdMaps[field] = 1;
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1229
1249
|
// 默认选中
|
|
1230
|
-
|
|
1250
|
+
// 优先级 columns > excludeFields > (includeFields || extraFields)
|
|
1251
|
+
XEUtils.eachTree(exportColumns, (column, index, items, path, parentColumn) => {
|
|
1231
1252
|
const isColGroup = column.children && column.children.length > 0;
|
|
1232
1253
|
let isChecked = false;
|
|
1254
|
+
const isExtraChecked = extraFdMaps[column.field];
|
|
1233
1255
|
if (columns && columns.length) {
|
|
1234
1256
|
isChecked = handleFilterColumns(defOpts, column, columns);
|
|
1235
1257
|
}
|
|
1236
1258
|
else if (excludeFields || includeFields) {
|
|
1237
|
-
isChecked = handleFilterFields(defOpts, column, includeFields,
|
|
1259
|
+
isChecked = handleFilterFields(defOpts, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps);
|
|
1238
1260
|
}
|
|
1239
1261
|
else {
|
|
1240
|
-
|
|
1262
|
+
if (isExtraChecked) {
|
|
1263
|
+
isChecked = true;
|
|
1264
|
+
}
|
|
1265
|
+
else {
|
|
1266
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
|
|
1267
|
+
}
|
|
1241
1268
|
}
|
|
1242
1269
|
column.checked = isChecked;
|
|
1243
1270
|
column.halfChecked = false;
|
|
1244
|
-
column.disabled = (
|
|
1271
|
+
column.disabled = (parentColumn && parentColumn.disabled) || (checkMethod ? !checkMethod({ $table: $xeTable, column }) : false);
|
|
1245
1272
|
});
|
|
1246
1273
|
// 更新条件
|
|
1247
1274
|
exportStore.columns = exportColumns;
|
|
@@ -1405,30 +1432,54 @@ export default {
|
|
|
1405
1432
|
warnLog('vxe.error.delProp', ['isAllExpand', 'isTreeAllExpanded']);
|
|
1406
1433
|
opts.isTreeAllExpanded = opts.isAllExpand;
|
|
1407
1434
|
}
|
|
1408
|
-
let { filename, sheetName, type, mode, columns,
|
|
1435
|
+
let { filename, sheetName, type, mode, columns, columnFilterMethod, beforeExportMethod, includeFields, excludeFields, extraFields } = opts;
|
|
1409
1436
|
let groups = [];
|
|
1410
1437
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
1411
1438
|
if (!mode) {
|
|
1412
1439
|
mode = selectRecords.length ? 'selected' : 'current';
|
|
1413
1440
|
}
|
|
1441
|
+
const excludeFdMaps = {};
|
|
1442
|
+
if (excludeFields && excludeFields.length) {
|
|
1443
|
+
excludeFields.forEach(field => {
|
|
1444
|
+
excludeFdMaps[field] = 1;
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
const includeFdMaps = {};
|
|
1448
|
+
if (includeFields && includeFields.length) {
|
|
1449
|
+
includeFields.forEach(field => {
|
|
1450
|
+
includeFdMaps[field] = 1;
|
|
1451
|
+
});
|
|
1452
|
+
}
|
|
1453
|
+
const extraFdMaps = {};
|
|
1454
|
+
if (extraFields) {
|
|
1455
|
+
extraFields.forEach(field => {
|
|
1456
|
+
extraFdMaps[field] = 1;
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1414
1459
|
let isCustomCol = false;
|
|
1415
1460
|
let customCols = [];
|
|
1416
1461
|
if (columns && columns.length) {
|
|
1417
1462
|
isCustomCol = true;
|
|
1418
|
-
customCols = columns;
|
|
1463
|
+
customCols = XEUtils.searchTree(columns, () => true, { children: 'children', mapChildren: 'childNodes', original: true });
|
|
1419
1464
|
}
|
|
1420
1465
|
else {
|
|
1421
1466
|
customCols = XEUtils.searchTree(collectColumn, column => {
|
|
1422
1467
|
const isColGroup = column.children && column.children.length > 0;
|
|
1423
1468
|
let isChecked = false;
|
|
1469
|
+
const isExtraChecked = extraFdMaps[column.field];
|
|
1424
1470
|
if (columns && columns.length) {
|
|
1425
1471
|
isChecked = handleFilterColumns(opts, column, columns);
|
|
1426
1472
|
}
|
|
1427
1473
|
else if (excludeFields || includeFields) {
|
|
1428
|
-
isChecked = handleFilterFields(opts, column, includeFields,
|
|
1474
|
+
isChecked = handleFilterFields(opts, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps);
|
|
1429
1475
|
}
|
|
1430
1476
|
else {
|
|
1431
|
-
|
|
1477
|
+
if (isExtraChecked) {
|
|
1478
|
+
isChecked = true;
|
|
1479
|
+
}
|
|
1480
|
+
else {
|
|
1481
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
|
|
1482
|
+
}
|
|
1432
1483
|
}
|
|
1433
1484
|
return isChecked;
|
|
1434
1485
|
}, { children: 'children', mapChildren: 'childNodes', original: true });
|
|
@@ -1436,20 +1487,7 @@ export default {
|
|
|
1436
1487
|
const handleOptions = Object.assign({}, opts, { filename: '', sheetName: '', _columnConfs: columns });
|
|
1437
1488
|
// 如果设置源数据,则默认导出设置了字段的列
|
|
1438
1489
|
if (!isCustomCol && !columnFilterMethod) {
|
|
1439
|
-
columnFilterMethod = ({ column }) =>
|
|
1440
|
-
if (excludeFields) {
|
|
1441
|
-
if (XEUtils.includes(excludeFields, column.field)) {
|
|
1442
|
-
return false;
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
if (includeFields) {
|
|
1446
|
-
if (XEUtils.includes(includeFields, column.field)) {
|
|
1447
|
-
return true;
|
|
1448
|
-
}
|
|
1449
|
-
return false;
|
|
1450
|
-
}
|
|
1451
|
-
return original ? !!column.field : defaultFilterExportColumn(column);
|
|
1452
|
-
};
|
|
1490
|
+
columnFilterMethod = ({ column }) => handleFilterFields(handleOptions, column, includeFields, includeFdMaps, excludeFdMaps, extraFdMaps);
|
|
1453
1491
|
handleOptions.columnFilterMethod = columnFilterMethod;
|
|
1454
1492
|
}
|
|
1455
1493
|
if (customCols) {
|
package/es/table/src/table.js
CHANGED
|
@@ -1252,15 +1252,16 @@ export default {
|
|
|
1252
1252
|
const { extraFields, includeFields, excludeFields } = editDirtyOpts;
|
|
1253
1253
|
const kpFields = [];
|
|
1254
1254
|
if (updateColFlag) {
|
|
1255
|
-
|
|
1256
|
-
return includeFields;
|
|
1257
|
-
}
|
|
1255
|
+
// 优先级 excludeFields > (includeFields || extraFields)
|
|
1258
1256
|
const excludeFdMaps = {};
|
|
1259
1257
|
if (excludeFields && excludeFields.length) {
|
|
1260
1258
|
excludeFields.forEach(field => {
|
|
1261
1259
|
excludeFdMaps[field] = 1;
|
|
1262
1260
|
});
|
|
1263
1261
|
}
|
|
1262
|
+
if (includeFields && includeFields.length) {
|
|
1263
|
+
return excludeFields && excludeFields.length ? includeFields.filter(field => !excludeFdMaps[field]) : includeFields;
|
|
1264
|
+
}
|
|
1264
1265
|
const addFdMaps = {};
|
|
1265
1266
|
if (extraFields && extraFields.length) {
|
|
1266
1267
|
extraFields.forEach(field => {
|
package/es/table/style.css
CHANGED