@canvas-components/list-table 0.3.36 → 0.3.37

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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _canvas_components_utils from '@canvas-components/utils';
2
- import { CanvasScrollbarOptions, XlsxExportOptions } from '@canvas-components/utils';
2
+ import { XlsxExportOptions, CanvasScrollbarOptions } from '@canvas-components/utils';
3
3
  export { CanvasScrollbarAxisOptions as ListTableScrollbarAxisOptions } from '@canvas-components/utils';
4
4
  import * as antDesignIcons from '@ant-design/icons-svg';
5
5
  import { CanvasChartPieOption, CanvasChartRadarOption, CanvasChartGaugeOption, CanvasChartSparklineOption } from '@canvas-components/chart';
@@ -633,6 +633,8 @@ interface ListTableBaseCellContent<RecordType = any> {
633
633
  key?: string;
634
634
  /** 是否展示内容,默认展示。 */
635
635
  visible?: boolean;
636
+ /** 在单元格右侧显示复制图标,点击后复制当前单元格的展示内容。 */
637
+ copyable?: boolean;
636
638
  style?: ListTableContentStyle;
637
639
  cursor?: string;
638
640
  onClick?: (context: ListTableCellContentClickContext<RecordType>) => void;
@@ -1206,6 +1208,38 @@ interface ListTableSearchOptions {
1206
1208
  caseSensitive: boolean;
1207
1209
  }
1208
1210
 
1211
+ /** 导出弹窗的逐列汇总选择;title 表示保留原汇总标题。 */
1212
+ type ListTableExportSummaryType = _canvas_components_utils.TableExportSummaryType;
1213
+ /** 本次导出的逐列汇总展示配置。 */
1214
+ type ListTableExportSummarySettings = _canvas_components_utils.TableExportSummarySettings;
1215
+ /** 仅作用于本次文件导出的列与汇总配置。 */
1216
+ type ListTableExportSettings = _canvas_components_utils.TableExportSettings;
1217
+ /**
1218
+ * 表格实例滚动参数。
1219
+ */
1220
+ interface ListTableScrollToOptions {
1221
+ rowIndex?: number;
1222
+ colIndex?: number;
1223
+ behavior?: "auto" | "smooth";
1224
+ }
1225
+ /** ListTable 内置表格密度对应的行高或自适应模式。 */
1226
+ type ListTableDensity = 26 | 32 | 48 | 56 | "auto";
1227
+ /**
1228
+ * XLSX 导出参数。
1229
+ */
1230
+ interface ListTableExportXlsxOptions extends XlsxExportOptions {
1231
+ /** 导出前输入文件名称,默认 true。 */
1232
+ promptFileName?: boolean;
1233
+ /** 导出文件名,可省略 `.xlsx` 扩展名。 */
1234
+ fileName?: string;
1235
+ /** 是否在数据末尾追加按当前列配置计算的汇总行,默认跟随表格汇总行的显示状态。 */
1236
+ includeSummary?: boolean;
1237
+ /** 本次导出的列顺序、逐列汇总方式和汇总行开关。 */
1238
+ settings?: ListTableExportSettings;
1239
+ /** 导出失败通知;已保存的分文件不会撤回,取消不触发此回调。 */
1240
+ onError?: (error: unknown) => void;
1241
+ }
1242
+
1209
1243
  type ListTableFilterMatchMode = "fuzzy" | "exact";
1210
1244
  type ListTableFilterType = "value" | "condition";
1211
1245
  type ListTableFilterConditionRelation = "and" | "or";
@@ -1356,6 +1390,18 @@ interface HeaderContextMenuColumnDraft {
1356
1390
  }
1357
1391
  type HeaderContextMenuDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
1358
1392
  interface HeaderContextMenuConfig {
1393
+ /** 按当前表格显示顺序读取打印数据。 */
1394
+ onGetPrintData?: () => Promise<{
1395
+ columns: Array<{
1396
+ key: string;
1397
+ title: string;
1398
+ width: number;
1399
+ }>;
1400
+ rows: string[][];
1401
+ summaryRow?: string[];
1402
+ summaryColumns?: ListTableExportColumnChoice[];
1403
+ getSummaryRow?: (settings: ListTableExportSettings) => Promise<string[]>;
1404
+ }>;
1359
1405
  /** 右键命中滚动条时仅展示滚动条相关操作。 */
1360
1406
  scrollbarArea?: boolean;
1361
1407
  scrollbarRowCount?: number;
@@ -1810,7 +1856,7 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
1810
1856
  /**
1811
1857
  * 右键菜单功能项。
1812
1858
  */
1813
- type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
1859
+ type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "print" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
1814
1860
  /**
1815
1861
  * 数据分组配置。
1816
1862
  */
@@ -2314,38 +2360,6 @@ interface ListTableOptions<RecordType = Record<string, unknown>> {
2314
2360
  ui?: ListTableUiOptions<RecordType>;
2315
2361
  }
2316
2362
 
2317
- /** 导出弹窗的逐列汇总选择;title 表示保留原汇总标题。 */
2318
- type ListTableExportSummaryType = _canvas_components_utils.TableExportSummaryType;
2319
- /** 本次导出的逐列汇总展示配置。 */
2320
- type ListTableExportSummarySettings = _canvas_components_utils.TableExportSummarySettings;
2321
- /** 仅作用于本次文件导出的列与汇总配置。 */
2322
- type ListTableExportSettings = _canvas_components_utils.TableExportSettings;
2323
- /**
2324
- * 表格实例滚动参数。
2325
- */
2326
- interface ListTableScrollToOptions {
2327
- rowIndex?: number;
2328
- colIndex?: number;
2329
- behavior?: "auto" | "smooth";
2330
- }
2331
- /** ListTable 内置表格密度对应的行高或自适应模式。 */
2332
- type ListTableDensity = 26 | 32 | 48 | 56 | "auto";
2333
- /**
2334
- * XLSX 导出参数。
2335
- */
2336
- interface ListTableExportXlsxOptions extends XlsxExportOptions {
2337
- /** 导出前输入文件名称,默认 true。 */
2338
- promptFileName?: boolean;
2339
- /** 导出文件名,可省略 `.xlsx` 扩展名。 */
2340
- fileName?: string;
2341
- /** 是否在数据末尾追加按当前列配置计算的汇总行,默认跟随表格汇总行的显示状态。 */
2342
- includeSummary?: boolean;
2343
- /** 本次导出的列顺序、逐列汇总方式和汇总行开关。 */
2344
- settings?: ListTableExportSettings;
2345
- /** 导出失败通知;已保存的分文件不会撤回,取消不触发此回调。 */
2346
- onError?: (error: unknown) => void;
2347
- }
2348
-
2349
2363
  /**
2350
2364
  * ListTable 原生入口。
2351
2365
  */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _canvas_components_utils from '@canvas-components/utils';
2
- import { CanvasScrollbarOptions, XlsxExportOptions } from '@canvas-components/utils';
2
+ import { XlsxExportOptions, CanvasScrollbarOptions } from '@canvas-components/utils';
3
3
  export { CanvasScrollbarAxisOptions as ListTableScrollbarAxisOptions } from '@canvas-components/utils';
4
4
  import * as antDesignIcons from '@ant-design/icons-svg';
5
5
  import { CanvasChartPieOption, CanvasChartRadarOption, CanvasChartGaugeOption, CanvasChartSparklineOption } from '@canvas-components/chart';
@@ -633,6 +633,8 @@ interface ListTableBaseCellContent<RecordType = any> {
633
633
  key?: string;
634
634
  /** 是否展示内容,默认展示。 */
635
635
  visible?: boolean;
636
+ /** 在单元格右侧显示复制图标,点击后复制当前单元格的展示内容。 */
637
+ copyable?: boolean;
636
638
  style?: ListTableContentStyle;
637
639
  cursor?: string;
638
640
  onClick?: (context: ListTableCellContentClickContext<RecordType>) => void;
@@ -1206,6 +1208,38 @@ interface ListTableSearchOptions {
1206
1208
  caseSensitive: boolean;
1207
1209
  }
1208
1210
 
1211
+ /** 导出弹窗的逐列汇总选择;title 表示保留原汇总标题。 */
1212
+ type ListTableExportSummaryType = _canvas_components_utils.TableExportSummaryType;
1213
+ /** 本次导出的逐列汇总展示配置。 */
1214
+ type ListTableExportSummarySettings = _canvas_components_utils.TableExportSummarySettings;
1215
+ /** 仅作用于本次文件导出的列与汇总配置。 */
1216
+ type ListTableExportSettings = _canvas_components_utils.TableExportSettings;
1217
+ /**
1218
+ * 表格实例滚动参数。
1219
+ */
1220
+ interface ListTableScrollToOptions {
1221
+ rowIndex?: number;
1222
+ colIndex?: number;
1223
+ behavior?: "auto" | "smooth";
1224
+ }
1225
+ /** ListTable 内置表格密度对应的行高或自适应模式。 */
1226
+ type ListTableDensity = 26 | 32 | 48 | 56 | "auto";
1227
+ /**
1228
+ * XLSX 导出参数。
1229
+ */
1230
+ interface ListTableExportXlsxOptions extends XlsxExportOptions {
1231
+ /** 导出前输入文件名称,默认 true。 */
1232
+ promptFileName?: boolean;
1233
+ /** 导出文件名,可省略 `.xlsx` 扩展名。 */
1234
+ fileName?: string;
1235
+ /** 是否在数据末尾追加按当前列配置计算的汇总行,默认跟随表格汇总行的显示状态。 */
1236
+ includeSummary?: boolean;
1237
+ /** 本次导出的列顺序、逐列汇总方式和汇总行开关。 */
1238
+ settings?: ListTableExportSettings;
1239
+ /** 导出失败通知;已保存的分文件不会撤回,取消不触发此回调。 */
1240
+ onError?: (error: unknown) => void;
1241
+ }
1242
+
1209
1243
  type ListTableFilterMatchMode = "fuzzy" | "exact";
1210
1244
  type ListTableFilterType = "value" | "condition";
1211
1245
  type ListTableFilterConditionRelation = "and" | "or";
@@ -1356,6 +1390,18 @@ interface HeaderContextMenuColumnDraft {
1356
1390
  }
1357
1391
  type HeaderContextMenuDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
1358
1392
  interface HeaderContextMenuConfig {
1393
+ /** 按当前表格显示顺序读取打印数据。 */
1394
+ onGetPrintData?: () => Promise<{
1395
+ columns: Array<{
1396
+ key: string;
1397
+ title: string;
1398
+ width: number;
1399
+ }>;
1400
+ rows: string[][];
1401
+ summaryRow?: string[];
1402
+ summaryColumns?: ListTableExportColumnChoice[];
1403
+ getSummaryRow?: (settings: ListTableExportSettings) => Promise<string[]>;
1404
+ }>;
1359
1405
  /** 右键命中滚动条时仅展示滚动条相关操作。 */
1360
1406
  scrollbarArea?: boolean;
1361
1407
  scrollbarRowCount?: number;
@@ -1810,7 +1856,7 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
1810
1856
  /**
1811
1857
  * 右键菜单功能项。
1812
1858
  */
1813
- type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
1859
+ type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "print" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
1814
1860
  /**
1815
1861
  * 数据分组配置。
1816
1862
  */
@@ -2314,38 +2360,6 @@ interface ListTableOptions<RecordType = Record<string, unknown>> {
2314
2360
  ui?: ListTableUiOptions<RecordType>;
2315
2361
  }
2316
2362
 
2317
- /** 导出弹窗的逐列汇总选择;title 表示保留原汇总标题。 */
2318
- type ListTableExportSummaryType = _canvas_components_utils.TableExportSummaryType;
2319
- /** 本次导出的逐列汇总展示配置。 */
2320
- type ListTableExportSummarySettings = _canvas_components_utils.TableExportSummarySettings;
2321
- /** 仅作用于本次文件导出的列与汇总配置。 */
2322
- type ListTableExportSettings = _canvas_components_utils.TableExportSettings;
2323
- /**
2324
- * 表格实例滚动参数。
2325
- */
2326
- interface ListTableScrollToOptions {
2327
- rowIndex?: number;
2328
- colIndex?: number;
2329
- behavior?: "auto" | "smooth";
2330
- }
2331
- /** ListTable 内置表格密度对应的行高或自适应模式。 */
2332
- type ListTableDensity = 26 | 32 | 48 | 56 | "auto";
2333
- /**
2334
- * XLSX 导出参数。
2335
- */
2336
- interface ListTableExportXlsxOptions extends XlsxExportOptions {
2337
- /** 导出前输入文件名称,默认 true。 */
2338
- promptFileName?: boolean;
2339
- /** 导出文件名,可省略 `.xlsx` 扩展名。 */
2340
- fileName?: string;
2341
- /** 是否在数据末尾追加按当前列配置计算的汇总行,默认跟随表格汇总行的显示状态。 */
2342
- includeSummary?: boolean;
2343
- /** 本次导出的列顺序、逐列汇总方式和汇总行开关。 */
2344
- settings?: ListTableExportSettings;
2345
- /** 导出失败通知;已保存的分文件不会撤回,取消不触发此回调。 */
2346
- onError?: (error: unknown) => void;
2347
- }
2348
-
2349
2363
  /**
2350
2364
  * ListTable 原生入口。
2351
2365
  */