@canvas-components/list-table 0.3.23 → 0.3.24
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/index.cjs +13 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -17990,9 +17990,7 @@ async function exportAllRowsTxtContent(params) {
|
|
|
17990
17990
|
});
|
|
17991
17991
|
}
|
|
17992
17992
|
async function exportAllRowsXlsxContent(params) {
|
|
17993
|
-
const columns = params.columns.filter(
|
|
17994
|
-
(column) => column.key !== ROW_SELECTION_COLUMN_KEY && column.key !== ROW_SELECTOR_COLUMN_KEY
|
|
17995
|
-
);
|
|
17993
|
+
const columns = params.columns.filter(isExportableColumn);
|
|
17996
17994
|
const footerRows = [];
|
|
17997
17995
|
if (params.includeSummary) {
|
|
17998
17996
|
const values = await computeSummaryValuesAsync({
|
|
@@ -18091,14 +18089,21 @@ function resolveProgressClipboardPercent(content) {
|
|
|
18091
18089
|
return Math.min(Math.max((content.value - min) / range * 100, 0), 100);
|
|
18092
18090
|
}
|
|
18093
18091
|
function buildExportColumns(columns) {
|
|
18094
|
-
return columns.filter(
|
|
18095
|
-
(column) => column.key !== ROW_SELECTION_COLUMN_KEY && column.key !== ROW_SELECTOR_COLUMN_KEY
|
|
18096
|
-
).map((column) => ({
|
|
18092
|
+
return columns.filter(isExportableColumn).map((column) => ({
|
|
18097
18093
|
key: column.key,
|
|
18098
18094
|
title: column.title ?? column.key,
|
|
18099
18095
|
value: (row, rowIndex) => getCellClipboardText(row, rowIndex, column)
|
|
18100
18096
|
}));
|
|
18101
18097
|
}
|
|
18098
|
+
function isExportableColumn(column) {
|
|
18099
|
+
if (column.key === ROW_SELECTION_COLUMN_KEY || column.key === ROW_SELECTOR_COLUMN_KEY || column.key === EXPAND_COLUMN_KEY) {
|
|
18100
|
+
return false;
|
|
18101
|
+
}
|
|
18102
|
+
if (column.exportable !== void 0) return column.exportable;
|
|
18103
|
+
return !(/^(?:action|actions|operate|operation|operations)$/i.test(column.key) || /^(?:操作|操作列|操作按钮|action|actions|operation|operations)$/i.test(
|
|
18104
|
+
column.title.trim()
|
|
18105
|
+
));
|
|
18106
|
+
}
|
|
18102
18107
|
function buildTableExportFileName(extension) {
|
|
18103
18108
|
const now2 = /* @__PURE__ */ new Date();
|
|
18104
18109
|
const stamp = [
|
|
@@ -18274,13 +18279,14 @@ var ListTableContentActionController = class {
|
|
|
18274
18279
|
* 异步导出全部原始数据为 XLSX。
|
|
18275
18280
|
*/
|
|
18276
18281
|
exportXlsx(options) {
|
|
18282
|
+
const includeSummary = options?.includeSummary ?? this.options.getSummaryVisible?.() ?? false;
|
|
18277
18283
|
options = { ...this.options.getOptions().exportOptions, ...options };
|
|
18278
18284
|
this.startExportTask(
|
|
18279
18285
|
(fileName) => exportAllRowsXlsxContent({
|
|
18280
18286
|
rows: this.options.getOptions().dataSource,
|
|
18281
18287
|
columns: this.options.getLeafColumns(),
|
|
18282
18288
|
...options,
|
|
18283
|
-
includeSummary
|
|
18289
|
+
includeSummary,
|
|
18284
18290
|
fileName: fileName ?? options?.fileName,
|
|
18285
18291
|
onProgress: (progress) => {
|
|
18286
18292
|
const fileLabel = progress.fileCount && progress.fileCount > 1 ? `\uFF08\u7B2C ${progress.fileIndex}/${progress.fileCount} \u4EFD\uFF09` : "";
|