@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.d.cts
CHANGED
|
@@ -1128,6 +1128,8 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1128
1128
|
initialHide?: boolean;
|
|
1129
1129
|
/** 是否不在列设置中展示该列及其子列。 */
|
|
1130
1130
|
hideInSetting?: boolean;
|
|
1131
|
+
/** 是否参与文件导出;操作列默认不导出,可显式覆盖。 */
|
|
1132
|
+
exportable?: boolean;
|
|
1131
1133
|
/** 是否禁止用户通过列设置隐藏该列。 */
|
|
1132
1134
|
disableHide?: boolean;
|
|
1133
1135
|
ellipsis?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1128,6 +1128,8 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1128
1128
|
initialHide?: boolean;
|
|
1129
1129
|
/** 是否不在列设置中展示该列及其子列。 */
|
|
1130
1130
|
hideInSetting?: boolean;
|
|
1131
|
+
/** 是否参与文件导出;操作列默认不导出,可显式覆盖。 */
|
|
1132
|
+
exportable?: boolean;
|
|
1131
1133
|
/** 是否禁止用户通过列设置隐藏该列。 */
|
|
1132
1134
|
disableHide?: boolean;
|
|
1133
1135
|
ellipsis?: boolean;
|
package/dist/index.js
CHANGED
|
@@ -17968,9 +17968,7 @@ async function exportAllRowsTxtContent(params) {
|
|
|
17968
17968
|
});
|
|
17969
17969
|
}
|
|
17970
17970
|
async function exportAllRowsXlsxContent(params) {
|
|
17971
|
-
const columns = params.columns.filter(
|
|
17972
|
-
(column) => column.key !== ROW_SELECTION_COLUMN_KEY && column.key !== ROW_SELECTOR_COLUMN_KEY
|
|
17973
|
-
);
|
|
17971
|
+
const columns = params.columns.filter(isExportableColumn);
|
|
17974
17972
|
const footerRows = [];
|
|
17975
17973
|
if (params.includeSummary) {
|
|
17976
17974
|
const values = await computeSummaryValuesAsync({
|
|
@@ -18069,14 +18067,21 @@ function resolveProgressClipboardPercent(content) {
|
|
|
18069
18067
|
return Math.min(Math.max((content.value - min) / range * 100, 0), 100);
|
|
18070
18068
|
}
|
|
18071
18069
|
function buildExportColumns(columns) {
|
|
18072
|
-
return columns.filter(
|
|
18073
|
-
(column) => column.key !== ROW_SELECTION_COLUMN_KEY && column.key !== ROW_SELECTOR_COLUMN_KEY
|
|
18074
|
-
).map((column) => ({
|
|
18070
|
+
return columns.filter(isExportableColumn).map((column) => ({
|
|
18075
18071
|
key: column.key,
|
|
18076
18072
|
title: column.title ?? column.key,
|
|
18077
18073
|
value: (row, rowIndex) => getCellClipboardText(row, rowIndex, column)
|
|
18078
18074
|
}));
|
|
18079
18075
|
}
|
|
18076
|
+
function isExportableColumn(column) {
|
|
18077
|
+
if (column.key === ROW_SELECTION_COLUMN_KEY || column.key === ROW_SELECTOR_COLUMN_KEY || column.key === EXPAND_COLUMN_KEY) {
|
|
18078
|
+
return false;
|
|
18079
|
+
}
|
|
18080
|
+
if (column.exportable !== void 0) return column.exportable;
|
|
18081
|
+
return !(/^(?:action|actions|operate|operation|operations)$/i.test(column.key) || /^(?:操作|操作列|操作按钮|action|actions|operation|operations)$/i.test(
|
|
18082
|
+
column.title.trim()
|
|
18083
|
+
));
|
|
18084
|
+
}
|
|
18080
18085
|
function buildTableExportFileName(extension) {
|
|
18081
18086
|
const now2 = /* @__PURE__ */ new Date();
|
|
18082
18087
|
const stamp = [
|
|
@@ -18252,13 +18257,14 @@ var ListTableContentActionController = class {
|
|
|
18252
18257
|
* 异步导出全部原始数据为 XLSX。
|
|
18253
18258
|
*/
|
|
18254
18259
|
exportXlsx(options) {
|
|
18260
|
+
const includeSummary = options?.includeSummary ?? this.options.getSummaryVisible?.() ?? false;
|
|
18255
18261
|
options = { ...this.options.getOptions().exportOptions, ...options };
|
|
18256
18262
|
this.startExportTask(
|
|
18257
18263
|
(fileName) => exportAllRowsXlsxContent({
|
|
18258
18264
|
rows: this.options.getOptions().dataSource,
|
|
18259
18265
|
columns: this.options.getLeafColumns(),
|
|
18260
18266
|
...options,
|
|
18261
|
-
includeSummary
|
|
18267
|
+
includeSummary,
|
|
18262
18268
|
fileName: fileName ?? options?.fileName,
|
|
18263
18269
|
onProgress: (progress) => {
|
|
18264
18270
|
const fileLabel = progress.fileCount && progress.fileCount > 1 ? `\uFF08\u7B2C ${progress.fileIndex}/${progress.fileCount} \u4EFD\uFF09` : "";
|