@canvas-components/react-list-table 0.3.42 → 0.3.44
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/README.md +36 -0
- package/dist/index.cjs +1674 -5
- package/dist/index.d.cts +63 -2
- package/dist/index.d.ts +63 -2
- package/dist/index.js +1675 -6
- package/package.json +4 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,67 @@
|
|
|
1
1
|
import * as _canvas_components_list_table from '@canvas-components/list-table';
|
|
2
|
-
import { ListTableOptions, ListTableQueryChange, ListTableExportXlsxOptions, ListTableScrollToOptions, ListTable, ListTableColumn, ListTablePaginationOptions, ListTableQueryOptions, ListTableRowSelectionOptions, EXPAND_COLUMN, SELECTION_COLUMN, ROW_SELECTION_COLUMN, ListTableExportNameRequest
|
|
2
|
+
import { ListTableExportSummarySettings, ListTableOptions, ListTableQueryChange, ListTableExportXlsxOptions, ListTableScrollToOptions, ListTable, ListTableColumn, ListTablePaginationOptions, ListTableQueryOptions, ListTableRowSelectionOptions, EXPAND_COLUMN, SELECTION_COLUMN, ROW_SELECTION_COLUMN, ListTableExportNameRequest } from '@canvas-components/list-table';
|
|
3
3
|
export { EXPAND_COLUMN, ListTableCSSProperties, ListTableCacheCategory, ListTableCachePreferences, ListTableConditionalFormatCondition, ListTableConditionalFormatRule, ListTableConditionalOperator, ListTablePaginationCSSProperties, ListTablePaginationStyleSlot, ListTablePaginationStyles, ListTableScrollbarCSSProperties, ListTableSorter, ListTableStyles, ROW_SELECTION_COLUMN, SELECTION_COLUMN, getListTableStoredPageSize } from '@canvas-components/list-table';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { CSSProperties, ReactNode, ForwardedRef, PropsWithChildren } from 'react';
|
|
6
|
+
import { BrowserPrintColumn, BrowserPrintPaperSize } from '@canvas-components/print';
|
|
7
|
+
|
|
8
|
+
interface PrintColumn extends BrowserPrintColumn {
|
|
9
|
+
summaryType?: ListTableExportSummarySettings["type"];
|
|
10
|
+
showTypePrefix?: "yes" | "no";
|
|
11
|
+
precision?: number;
|
|
12
|
+
roundingMode?: ListTableExportSummarySettings["roundingMode"];
|
|
13
|
+
preserveTrailingZeros?: "yes" | "no";
|
|
14
|
+
summaryTitle?: string;
|
|
15
|
+
}
|
|
16
|
+
interface PrintSettings {
|
|
17
|
+
version: 2;
|
|
18
|
+
presetName?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
subtitle?: string;
|
|
21
|
+
titleFontSize?: number;
|
|
22
|
+
subtitleFontSize?: number;
|
|
23
|
+
columns: PrintColumn[];
|
|
24
|
+
selectedKeys: string[];
|
|
25
|
+
rowsPerPage: number;
|
|
26
|
+
rowHeight?: number;
|
|
27
|
+
autoCalculateRowsPerPage?: boolean;
|
|
28
|
+
autoCalculateColumnWidths?: boolean;
|
|
29
|
+
includeSummary?: boolean;
|
|
30
|
+
summaryPosition?: "every-page" | "last-page";
|
|
31
|
+
showPageNumbers?: boolean;
|
|
32
|
+
pageNumberPosition?: "left" | "center" | "right";
|
|
33
|
+
showPrintTime?: boolean;
|
|
34
|
+
printTimePosition?: "left" | "center" | "right";
|
|
35
|
+
pageMargins?: {
|
|
36
|
+
top: number;
|
|
37
|
+
right: number;
|
|
38
|
+
bottom: number;
|
|
39
|
+
left: number;
|
|
40
|
+
};
|
|
41
|
+
paperSize?: BrowserPrintPaperSize;
|
|
42
|
+
orientation?: "portrait" | "landscape";
|
|
43
|
+
useCellBorders?: boolean;
|
|
44
|
+
borderColor?: string;
|
|
45
|
+
textColor?: string;
|
|
46
|
+
headerBackgroundColor?: string;
|
|
47
|
+
summaryBackgroundColor?: string;
|
|
48
|
+
showSectionDividers?: boolean;
|
|
49
|
+
sectionDividerTopSpacing?: number;
|
|
50
|
+
sectionDividerBottomSpacing?: number;
|
|
51
|
+
formItemSpacing?: number;
|
|
52
|
+
}
|
|
53
|
+
/** 打印列预设只需指定列键;宽度、对齐和超宽处理均可选。 */
|
|
54
|
+
type ReactListTablePrintColumnConfig = Pick<BrowserPrintColumn, "key"> & Partial<Omit<PrintColumn, "key">>;
|
|
55
|
+
/** 打印预设的可配置项;未提供的字段使用打印默认值。 */
|
|
56
|
+
type ReactListTablePrintConfig = Partial<Omit<PrintSettings, "version" | "presetName" | "columns" | "selectedKeys">> & {
|
|
57
|
+
columns?: readonly ReactListTablePrintColumnConfig[];
|
|
58
|
+
selectedKeys?: readonly string[];
|
|
59
|
+
};
|
|
60
|
+
/** 供 ReactListTable 打印弹窗选择的命名预设。名称应保持唯一。 */
|
|
61
|
+
interface ReactListTablePrintPreset {
|
|
62
|
+
name: string;
|
|
63
|
+
config: ReactListTablePrintConfig;
|
|
64
|
+
}
|
|
6
65
|
|
|
7
66
|
interface ReactListTableScrollConfig {
|
|
8
67
|
x?: number | string | true;
|
|
@@ -22,6 +81,8 @@ interface ReactListTableProps<RecordType = Record<string, unknown>> extends Omit
|
|
|
22
81
|
style?: CSSProperties;
|
|
23
82
|
/** 表格标题栏左侧内容。 */
|
|
24
83
|
title?: ReactNode;
|
|
84
|
+
/** 打印配置弹窗中可选择的命名预设。 */
|
|
85
|
+
printPresets?: readonly ReactListTablePrintPreset[];
|
|
25
86
|
/** 标题栏右侧工具配置,传入 false 时隐藏整个标题栏工具区。 */
|
|
26
87
|
toolbar?: false | ReactListTableToolbarOptions;
|
|
27
88
|
}
|
|
@@ -131,4 +192,4 @@ interface ReactListTableDebugProviderProps extends PropsWithChildren {
|
|
|
131
192
|
*/
|
|
132
193
|
declare function ReactListTableDebugProvider(props: ReactListTableDebugProviderProps): react.JSX.Element;
|
|
133
194
|
|
|
134
|
-
export { ReactListTable, type ReactListTableColumnType, type ReactListTableColumnsType, ReactListTableDebugProvider, type ReactListTableDebugProviderProps, ReactListTableExportNameDialog, type ReactListTableLocale, type ReactListTablePagination, type ReactListTableProps, type ReactListTableQuery, type ReactListTableRef, type ReactListTableRowSelection, type ReactListTableScrollConfig, type ReactListTableTableProps, type ReactListTableToolbarOptions };
|
|
195
|
+
export { ReactListTable, type ReactListTableColumnType, type ReactListTableColumnsType, ReactListTableDebugProvider, type ReactListTableDebugProviderProps, ReactListTableExportNameDialog, type ReactListTableLocale, type ReactListTablePagination, type ReactListTablePrintColumnConfig, type ReactListTablePrintConfig, type ReactListTablePrintPreset, type ReactListTableProps, type ReactListTableQuery, type ReactListTableRef, type ReactListTableRowSelection, type ReactListTableScrollConfig, type ReactListTableTableProps, type ReactListTableToolbarOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,67 @@
|
|
|
1
1
|
import * as _canvas_components_list_table from '@canvas-components/list-table';
|
|
2
|
-
import { ListTableOptions, ListTableQueryChange, ListTableExportXlsxOptions, ListTableScrollToOptions, ListTable, ListTableColumn, ListTablePaginationOptions, ListTableQueryOptions, ListTableRowSelectionOptions, EXPAND_COLUMN, SELECTION_COLUMN, ROW_SELECTION_COLUMN, ListTableExportNameRequest
|
|
2
|
+
import { ListTableExportSummarySettings, ListTableOptions, ListTableQueryChange, ListTableExportXlsxOptions, ListTableScrollToOptions, ListTable, ListTableColumn, ListTablePaginationOptions, ListTableQueryOptions, ListTableRowSelectionOptions, EXPAND_COLUMN, SELECTION_COLUMN, ROW_SELECTION_COLUMN, ListTableExportNameRequest } from '@canvas-components/list-table';
|
|
3
3
|
export { EXPAND_COLUMN, ListTableCSSProperties, ListTableCacheCategory, ListTableCachePreferences, ListTableConditionalFormatCondition, ListTableConditionalFormatRule, ListTableConditionalOperator, ListTablePaginationCSSProperties, ListTablePaginationStyleSlot, ListTablePaginationStyles, ListTableScrollbarCSSProperties, ListTableSorter, ListTableStyles, ROW_SELECTION_COLUMN, SELECTION_COLUMN, getListTableStoredPageSize } from '@canvas-components/list-table';
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
import { CSSProperties, ReactNode, ForwardedRef, PropsWithChildren } from 'react';
|
|
6
|
+
import { BrowserPrintColumn, BrowserPrintPaperSize } from '@canvas-components/print';
|
|
7
|
+
|
|
8
|
+
interface PrintColumn extends BrowserPrintColumn {
|
|
9
|
+
summaryType?: ListTableExportSummarySettings["type"];
|
|
10
|
+
showTypePrefix?: "yes" | "no";
|
|
11
|
+
precision?: number;
|
|
12
|
+
roundingMode?: ListTableExportSummarySettings["roundingMode"];
|
|
13
|
+
preserveTrailingZeros?: "yes" | "no";
|
|
14
|
+
summaryTitle?: string;
|
|
15
|
+
}
|
|
16
|
+
interface PrintSettings {
|
|
17
|
+
version: 2;
|
|
18
|
+
presetName?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
subtitle?: string;
|
|
21
|
+
titleFontSize?: number;
|
|
22
|
+
subtitleFontSize?: number;
|
|
23
|
+
columns: PrintColumn[];
|
|
24
|
+
selectedKeys: string[];
|
|
25
|
+
rowsPerPage: number;
|
|
26
|
+
rowHeight?: number;
|
|
27
|
+
autoCalculateRowsPerPage?: boolean;
|
|
28
|
+
autoCalculateColumnWidths?: boolean;
|
|
29
|
+
includeSummary?: boolean;
|
|
30
|
+
summaryPosition?: "every-page" | "last-page";
|
|
31
|
+
showPageNumbers?: boolean;
|
|
32
|
+
pageNumberPosition?: "left" | "center" | "right";
|
|
33
|
+
showPrintTime?: boolean;
|
|
34
|
+
printTimePosition?: "left" | "center" | "right";
|
|
35
|
+
pageMargins?: {
|
|
36
|
+
top: number;
|
|
37
|
+
right: number;
|
|
38
|
+
bottom: number;
|
|
39
|
+
left: number;
|
|
40
|
+
};
|
|
41
|
+
paperSize?: BrowserPrintPaperSize;
|
|
42
|
+
orientation?: "portrait" | "landscape";
|
|
43
|
+
useCellBorders?: boolean;
|
|
44
|
+
borderColor?: string;
|
|
45
|
+
textColor?: string;
|
|
46
|
+
headerBackgroundColor?: string;
|
|
47
|
+
summaryBackgroundColor?: string;
|
|
48
|
+
showSectionDividers?: boolean;
|
|
49
|
+
sectionDividerTopSpacing?: number;
|
|
50
|
+
sectionDividerBottomSpacing?: number;
|
|
51
|
+
formItemSpacing?: number;
|
|
52
|
+
}
|
|
53
|
+
/** 打印列预设只需指定列键;宽度、对齐和超宽处理均可选。 */
|
|
54
|
+
type ReactListTablePrintColumnConfig = Pick<BrowserPrintColumn, "key"> & Partial<Omit<PrintColumn, "key">>;
|
|
55
|
+
/** 打印预设的可配置项;未提供的字段使用打印默认值。 */
|
|
56
|
+
type ReactListTablePrintConfig = Partial<Omit<PrintSettings, "version" | "presetName" | "columns" | "selectedKeys">> & {
|
|
57
|
+
columns?: readonly ReactListTablePrintColumnConfig[];
|
|
58
|
+
selectedKeys?: readonly string[];
|
|
59
|
+
};
|
|
60
|
+
/** 供 ReactListTable 打印弹窗选择的命名预设。名称应保持唯一。 */
|
|
61
|
+
interface ReactListTablePrintPreset {
|
|
62
|
+
name: string;
|
|
63
|
+
config: ReactListTablePrintConfig;
|
|
64
|
+
}
|
|
6
65
|
|
|
7
66
|
interface ReactListTableScrollConfig {
|
|
8
67
|
x?: number | string | true;
|
|
@@ -22,6 +81,8 @@ interface ReactListTableProps<RecordType = Record<string, unknown>> extends Omit
|
|
|
22
81
|
style?: CSSProperties;
|
|
23
82
|
/** 表格标题栏左侧内容。 */
|
|
24
83
|
title?: ReactNode;
|
|
84
|
+
/** 打印配置弹窗中可选择的命名预设。 */
|
|
85
|
+
printPresets?: readonly ReactListTablePrintPreset[];
|
|
25
86
|
/** 标题栏右侧工具配置,传入 false 时隐藏整个标题栏工具区。 */
|
|
26
87
|
toolbar?: false | ReactListTableToolbarOptions;
|
|
27
88
|
}
|
|
@@ -131,4 +192,4 @@ interface ReactListTableDebugProviderProps extends PropsWithChildren {
|
|
|
131
192
|
*/
|
|
132
193
|
declare function ReactListTableDebugProvider(props: ReactListTableDebugProviderProps): react.JSX.Element;
|
|
133
194
|
|
|
134
|
-
export { ReactListTable, type ReactListTableColumnType, type ReactListTableColumnsType, ReactListTableDebugProvider, type ReactListTableDebugProviderProps, ReactListTableExportNameDialog, type ReactListTableLocale, type ReactListTablePagination, type ReactListTableProps, type ReactListTableQuery, type ReactListTableRef, type ReactListTableRowSelection, type ReactListTableScrollConfig, type ReactListTableTableProps, type ReactListTableToolbarOptions };
|
|
195
|
+
export { ReactListTable, type ReactListTableColumnType, type ReactListTableColumnsType, ReactListTableDebugProvider, type ReactListTableDebugProviderProps, ReactListTableExportNameDialog, type ReactListTableLocale, type ReactListTablePagination, type ReactListTablePrintColumnConfig, type ReactListTablePrintConfig, type ReactListTablePrintPreset, type ReactListTableProps, type ReactListTableQuery, type ReactListTableRef, type ReactListTableRowSelection, type ReactListTableScrollConfig, type ReactListTableTableProps, type ReactListTableToolbarOptions };
|