@canvas-components/list-table 0.3.37 → 0.3.39
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 +570 -566
- package/dist/index.cjs +14221 -12526
- package/dist/index.d.cts +229 -35
- package/dist/index.d.ts +229 -35
- package/dist/index.js +14242 -12533
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _canvas_components_utils from '@canvas-components/utils';
|
|
2
2
|
import { XlsxExportOptions, CanvasScrollbarOptions } from '@canvas-components/utils';
|
|
3
3
|
export { CanvasScrollbarAxisOptions as ListTableScrollbarAxisOptions } from '@canvas-components/utils';
|
|
4
|
-
import
|
|
4
|
+
import { IconName } from '@canvas-components/icons';
|
|
5
5
|
import { CanvasChartPieOption, CanvasChartRadarOption, CanvasChartGaugeOption, CanvasChartSparklineOption } from '@canvas-components/chart';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -190,7 +190,7 @@ interface Rect {
|
|
|
190
190
|
* 命中结果。
|
|
191
191
|
*/
|
|
192
192
|
interface DebugHitTestResult {
|
|
193
|
-
area: "header" | "grouping-bar" | "grouping-tag" | "grouping-remove" | "body" | "body-content" | "body-control" | "expand-trigger" | "collapse-trigger" | "column-collapse-trigger" | "expanded-row" | "header-selection" | "sort-trigger" | "filter-trigger" | "fixed-trigger" | "resize-handle" | "horizontal-scrollbar" | "vertical-scrollbar" | "summary" | "summary" | "empty";
|
|
193
|
+
area: "header" | "grouping-bar" | "grouping-tag" | "grouping-remove" | "group-toggle" | "body" | "body-content" | "body-control" | "expand-trigger" | "collapse-trigger" | "column-collapse-trigger" | "expanded-row" | "header-selection" | "sort-trigger" | "filter-trigger" | "fixed-trigger" | "resize-handle" | "horizontal-scrollbar" | "vertical-scrollbar" | "summary" | "summary" | "empty";
|
|
194
194
|
scrollbarRole?: "thumb" | "track" | "decrease-button" | "increase-button";
|
|
195
195
|
columnKey?: string;
|
|
196
196
|
rowIndex?: number;
|
|
@@ -206,6 +206,8 @@ interface DebugHitTestResult {
|
|
|
206
206
|
resizeEdge?: "left" | "right";
|
|
207
207
|
cursor?: string;
|
|
208
208
|
rect?: Rect;
|
|
209
|
+
/** 错误提示所属单元格的矩形,独立于内容命中区域。 */
|
|
210
|
+
tooltipRect?: Rect;
|
|
209
211
|
tooltipText?: string;
|
|
210
212
|
tooltipVariant?: "default" | "error";
|
|
211
213
|
textSelectionText?: string;
|
|
@@ -230,7 +232,7 @@ type HeaderActionType = "sort" | "filter" | "fixed";
|
|
|
230
232
|
* 渲染矩形描述。
|
|
231
233
|
*/
|
|
232
234
|
interface RenderCellDescriptor {
|
|
233
|
-
kind: "header" | "grouping-bar" | "grouping-tag" | "grouping-remove" | "body" | "body-content" | "body-control" | "expand-trigger" | "collapse-trigger" | "column-collapse-trigger" | "expanded-row" | "header-selection" | "header-action" | "resize-handle" | "horizontal-scrollbar" | "vertical-scrollbar" | "summary";
|
|
235
|
+
kind: "header" | "grouping-bar" | "grouping-tag" | "grouping-remove" | "group-toggle" | "body" | "body-content" | "body-control" | "expand-trigger" | "collapse-trigger" | "column-collapse-trigger" | "expanded-row" | "header-selection" | "header-action" | "resize-handle" | "horizontal-scrollbar" | "vertical-scrollbar" | "summary";
|
|
234
236
|
rect: Rect;
|
|
235
237
|
columnKey?: string;
|
|
236
238
|
rowIndex?: number;
|
|
@@ -398,10 +400,21 @@ interface ListTableCellStyle {
|
|
|
398
400
|
borderColor?: string;
|
|
399
401
|
borderWidth?: number;
|
|
400
402
|
}
|
|
403
|
+
/** JSON 单元格的语法着色配置。 */
|
|
404
|
+
interface ListTableJsonTheme {
|
|
405
|
+
/** 对象 key 颜色。 */
|
|
406
|
+
keyColor?: string;
|
|
407
|
+
/** 字符串、数字、布尔值及 null 的颜色。 */
|
|
408
|
+
valueColor?: string;
|
|
409
|
+
/** 对象、数组及分隔符颜色。 */
|
|
410
|
+
symbolColor?: string;
|
|
411
|
+
}
|
|
401
412
|
/**
|
|
402
413
|
* 主题定义。
|
|
403
414
|
*/
|
|
404
415
|
interface ListTableTheme {
|
|
416
|
+
/** JSON 单元格语法颜色;列 jsonTheme 可逐项覆盖。 */
|
|
417
|
+
jsonTheme?: ListTableJsonTheme;
|
|
405
418
|
/** 活动单元格及活动行的 CSS 映射,由 styles 配置生成。 */
|
|
406
419
|
activeCellStyle?: ListTableCellStyle;
|
|
407
420
|
activeRowStyle?: ListTableCellStyle;
|
|
@@ -455,7 +468,7 @@ interface ListTableConditionalFormatRule {
|
|
|
455
468
|
/** 原有短名称,保留已经调整过的图形和评分外观。 */
|
|
456
469
|
declare const listTableBuiltinIconNames: readonly ["star", "sun", "moon", "check", "close", "circle", "check-circle", "close-circle", "clock-circle", "info-circle", "question-circle", "warning", "loading", "plus", "minus", "plus-circle", "minus-circle", "up", "down", "left", "right", "arrow-up", "arrow-down", "arrow-left", "arrow-right", "search", "edit", "delete", "copy", "save", "upload", "download", "reload", "ellipsis", "file", "file-text", "file-pdf", "folder", "folder-open", "picture", "user", "team", "calendar", "filter", "sort-ascending", "sort-descending", "link", "eye", "lock", "unlock", "home", "mail", "setting", "header-sort", "header-sort-ascending", "header-sort-descending", "header-filter", "header-fixed"];
|
|
457
470
|
/** 官方图标使用原始名称,例如 AccountBookOutlined、HeartFilled、SmileTwoTone。 */
|
|
458
|
-
type ListTableAntdIconName =
|
|
471
|
+
type ListTableAntdIconName = IconName;
|
|
459
472
|
type ListTableBuiltinIconName = (typeof listTableBuiltinIconNames)[number];
|
|
460
473
|
/** 全量官方图标定义为纯数据,不包含 React 运行时。 */
|
|
461
474
|
declare const listTableAntdIconNames: ListTableAntdIconName[];
|
|
@@ -636,6 +649,8 @@ interface ListTableBaseCellContent<RecordType = any> {
|
|
|
636
649
|
/** 在单元格右侧显示复制图标,点击后复制当前单元格的展示内容。 */
|
|
637
650
|
copyable?: boolean;
|
|
638
651
|
style?: ListTableContentStyle;
|
|
652
|
+
/** 在当前片段前开始新行。 */
|
|
653
|
+
lineBreakBefore?: boolean;
|
|
639
654
|
cursor?: string;
|
|
640
655
|
onClick?: (context: ListTableCellContentClickContext<RecordType>) => void;
|
|
641
656
|
}
|
|
@@ -648,6 +663,8 @@ interface ListTableTextCellContent<RecordType = any> extends ListTableBaseCellCo
|
|
|
648
663
|
color?: string;
|
|
649
664
|
fontSize?: number;
|
|
650
665
|
fontWeight?: string;
|
|
666
|
+
/** @internal JSON 语法 token 分类,用于套用表格主题颜色。 */
|
|
667
|
+
jsonTokenType?: "key" | "value" | "symbol";
|
|
651
668
|
}
|
|
652
669
|
/**
|
|
653
670
|
* 单元格金额片段。
|
|
@@ -1168,8 +1185,10 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1168
1185
|
* 用法参考 AntD Table 的 `onCell`。
|
|
1169
1186
|
*/
|
|
1170
1187
|
onCell?: (value: unknown, record: RecordType, rowIndex: number, column: ListTableColumn<RecordType>) => ListTableCellSpan | null | undefined;
|
|
1171
|
-
cellType?: "text" | "emoji" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "custom";
|
|
1188
|
+
cellType?: "text" | "emoji" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "json" | "custom";
|
|
1172
1189
|
cellStyle?: ListTableCellStyle;
|
|
1190
|
+
/** JSON 语法颜色;优先于表格组件级 `theme.jsonTheme`。 */
|
|
1191
|
+
jsonTheme?: ListTableJsonTheme;
|
|
1173
1192
|
/** 金额单元格格式配置,仅在 `cellType: "money"` 时生效。 */
|
|
1174
1193
|
moneyFormat?: ListTableMoneyFormatOptions;
|
|
1175
1194
|
/** 通过列设置覆盖的数据显示格式。 */
|
|
@@ -1192,6 +1211,27 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1192
1211
|
meta?: Record<string, unknown>;
|
|
1193
1212
|
}
|
|
1194
1213
|
|
|
1214
|
+
/**
|
|
1215
|
+
* 标准化列。
|
|
1216
|
+
*/
|
|
1217
|
+
interface NormalizedColumn<RecordType = Record<string, unknown>> extends Omit<ListTableColumn<RecordType>, "children"> {
|
|
1218
|
+
key: string;
|
|
1219
|
+
title: string;
|
|
1220
|
+
titleContent: ListTableHeaderContent[];
|
|
1221
|
+
width: number;
|
|
1222
|
+
minWidth: number;
|
|
1223
|
+
maxWidth: number;
|
|
1224
|
+
depth: number;
|
|
1225
|
+
parentKey: string | null;
|
|
1226
|
+
children?: NormalizedColumn<RecordType>[];
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* 叶子列。
|
|
1230
|
+
*/
|
|
1231
|
+
interface InternalLeafColumn<RecordType = Record<string, unknown>> extends NormalizedColumn<RecordType> {
|
|
1232
|
+
leafIndex: number;
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1195
1235
|
interface ListTableChartData {
|
|
1196
1236
|
labels: string[];
|
|
1197
1237
|
/** 与 labels 对齐的稳定类别标识,用于排序后的图形位置过渡。 */
|
|
@@ -1320,6 +1360,13 @@ interface ListTableTooltipRequest {
|
|
|
1320
1360
|
y: number;
|
|
1321
1361
|
content: string;
|
|
1322
1362
|
variant?: "default" | "error" | "resize";
|
|
1363
|
+
/** 视口坐标中的目标矩形;提供后 tooltip 围绕该区域自动选位。 */
|
|
1364
|
+
anchorRect?: {
|
|
1365
|
+
x: number;
|
|
1366
|
+
y: number;
|
|
1367
|
+
width: number;
|
|
1368
|
+
height: number;
|
|
1369
|
+
};
|
|
1323
1370
|
/**
|
|
1324
1371
|
* 表格内容缩放(1 = 100%),用于 tooltip 与画布视觉同步。
|
|
1325
1372
|
*/
|
|
@@ -1390,8 +1437,18 @@ interface HeaderContextMenuColumnDraft {
|
|
|
1390
1437
|
}
|
|
1391
1438
|
type HeaderContextMenuDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
|
|
1392
1439
|
interface HeaderContextMenuConfig {
|
|
1440
|
+
/** 重写右键菜单打印行为。配置后由适配层直接执行该回调。 */
|
|
1441
|
+
onPrint?: () => void;
|
|
1442
|
+
/** 自定义右键菜单项,支持多级菜单。 */
|
|
1443
|
+
customItems?: ListTableContextMenuItem[];
|
|
1393
1444
|
/** 按当前表格显示顺序读取打印数据。 */
|
|
1394
|
-
onGetPrintData?: (
|
|
1445
|
+
onGetPrintData?: (options?: {
|
|
1446
|
+
signal?: AbortSignal;
|
|
1447
|
+
onProgress?: (completed: number, total: number) => void;
|
|
1448
|
+
/** 设计器仅获取首屏样本;未传时读取全部行。 */
|
|
1449
|
+
rowLimit?: number;
|
|
1450
|
+
includeSummary?: boolean;
|
|
1451
|
+
}) => Promise<{
|
|
1395
1452
|
columns: Array<{
|
|
1396
1453
|
key: string;
|
|
1397
1454
|
title: string;
|
|
@@ -1615,6 +1672,8 @@ interface ListTableEditorTheme {
|
|
|
1615
1672
|
fontFamily: string;
|
|
1616
1673
|
textColor: string;
|
|
1617
1674
|
cellColor?: string;
|
|
1675
|
+
/** 编辑单元格的水平对齐方式。 */
|
|
1676
|
+
textAlign?: CanvasTextAlign;
|
|
1618
1677
|
/**
|
|
1619
1678
|
* 单元格水平内边距(已含缩放),用于编辑表单与画布内容对齐。
|
|
1620
1679
|
*/
|
|
@@ -1643,7 +1702,7 @@ interface ListTableEditorCommitOptions {
|
|
|
1643
1702
|
}
|
|
1644
1703
|
interface ListTableTooltipAdapter {
|
|
1645
1704
|
mount(parent?: HTMLElement): void;
|
|
1646
|
-
show(x: number, y: number, content: string, variant?: ListTableTooltipRequest["variant"]): void;
|
|
1705
|
+
show(x: number, y: number, content: string, variant?: ListTableTooltipRequest["variant"], anchorRect?: ListTableTooltipRequest["anchorRect"]): void;
|
|
1647
1706
|
hide(): void;
|
|
1648
1707
|
destroy(): void;
|
|
1649
1708
|
}
|
|
@@ -1709,6 +1768,8 @@ interface ListTableEditorRequest {
|
|
|
1709
1768
|
onCommit: (options?: ListTableEditorCommitOptions) => void;
|
|
1710
1769
|
onCancel: () => void;
|
|
1711
1770
|
onNavigate?: (direction: ListTableEditorNavigateDirection) => void;
|
|
1771
|
+
/** 将编辑浮层上的滚轮事件交给表格处理。 */
|
|
1772
|
+
onWheel?: (event: WheelEvent) => void;
|
|
1712
1773
|
}
|
|
1713
1774
|
interface ListTableEditorFactory {
|
|
1714
1775
|
createCellEditorSession(params: CreateCellEditorSessionParams): ListTableCellEditorSession | null;
|
|
@@ -1881,6 +1942,18 @@ interface ListTableContextMenuOptions {
|
|
|
1881
1942
|
* 禁用的功能列表,会从默认功能或 `features` 中排除。
|
|
1882
1943
|
*/
|
|
1883
1944
|
disabledFeatures?: ListTableContextMenuFeature[];
|
|
1945
|
+
/** 重写右键菜单打印行为。配置后直接显示一级“打印”菜单项。 */
|
|
1946
|
+
onPrint?: () => void;
|
|
1947
|
+
/** 自定义右键菜单项,支持通过 children 配置多级菜单。 */
|
|
1948
|
+
customItems?: ListTableContextMenuItem[];
|
|
1949
|
+
}
|
|
1950
|
+
/** 右键菜单扩展项。 */
|
|
1951
|
+
interface ListTableContextMenuItem {
|
|
1952
|
+
key: string;
|
|
1953
|
+
label: string;
|
|
1954
|
+
onClick?: () => void;
|
|
1955
|
+
children?: ListTableContextMenuItem[];
|
|
1956
|
+
disabled?: boolean;
|
|
1884
1957
|
}
|
|
1885
1958
|
/**
|
|
1886
1959
|
* 画布滚动条配置。
|
|
@@ -2360,6 +2433,43 @@ interface ListTableOptions<RecordType = Record<string, unknown>> {
|
|
|
2360
2433
|
ui?: ListTableUiOptions<RecordType>;
|
|
2361
2434
|
}
|
|
2362
2435
|
|
|
2436
|
+
interface ListTableValidationError<RecordType> {
|
|
2437
|
+
rowIndex: number;
|
|
2438
|
+
rowKey: string | number;
|
|
2439
|
+
columnKey: string;
|
|
2440
|
+
dataIndex?: TableColumnDataIndex;
|
|
2441
|
+
message: string;
|
|
2442
|
+
value: unknown;
|
|
2443
|
+
record: RecordType;
|
|
2444
|
+
}
|
|
2445
|
+
interface ListTableValidationErrorField<RecordType> {
|
|
2446
|
+
rowIndex: number;
|
|
2447
|
+
rowKey: string | number;
|
|
2448
|
+
columnKey: string;
|
|
2449
|
+
dataIndex?: TableColumnDataIndex;
|
|
2450
|
+
name: Array<string | number>;
|
|
2451
|
+
errors: string[];
|
|
2452
|
+
value: unknown;
|
|
2453
|
+
record: RecordType;
|
|
2454
|
+
}
|
|
2455
|
+
interface ListTableValidationFailure<RecordType> {
|
|
2456
|
+
values: RecordType[];
|
|
2457
|
+
errorFields: ListTableValidationErrorField<RecordType>[];
|
|
2458
|
+
outOfDate: boolean;
|
|
2459
|
+
}
|
|
2460
|
+
interface ListTableValidationTarget {
|
|
2461
|
+
rowIndex: number;
|
|
2462
|
+
columnKey: string;
|
|
2463
|
+
}
|
|
2464
|
+
/** 外部注入的单元格校验信息。使用行键而不是行索引,避免排序或筛选后错位。 */
|
|
2465
|
+
interface ListTableExternalValidationError {
|
|
2466
|
+
rowKey: string | number;
|
|
2467
|
+
columnKey: string;
|
|
2468
|
+
message: string;
|
|
2469
|
+
}
|
|
2470
|
+
/** 外部清除校验信息时使用的单元格定位。 */
|
|
2471
|
+
type ListTableValidationErrorTarget = Pick<ListTableExternalValidationError, "rowKey" | "columnKey">;
|
|
2472
|
+
|
|
2363
2473
|
/**
|
|
2364
2474
|
* ListTable 原生入口。
|
|
2365
2475
|
*/
|
|
@@ -2420,6 +2530,10 @@ declare class ListTable<RecordType = Record<string, unknown>> {
|
|
|
2420
2530
|
* 成功时返回当前表格数据,失败时抛出校验失败结果。
|
|
2421
2531
|
*/
|
|
2422
2532
|
validate(): Promise<RecordType[]>;
|
|
2533
|
+
/** 注入外部校验结果。 */
|
|
2534
|
+
setValidationErrors(errors: ListTableExternalValidationError[]): void;
|
|
2535
|
+
/** 清除指定或全部校验结果。 */
|
|
2536
|
+
clearValidationErrors(targets?: ListTableValidationErrorTarget[]): void;
|
|
2423
2537
|
/**
|
|
2424
2538
|
* 异步导出全部原始数据为 XLSX。
|
|
2425
2539
|
*/
|
|
@@ -2454,6 +2568,25 @@ declare class ListTable<RecordType = Record<string, unknown>> {
|
|
|
2454
2568
|
destroy(): void;
|
|
2455
2569
|
}
|
|
2456
2570
|
|
|
2571
|
+
/** 静态打印同步复用统计规则,确保导出时不依赖异步渲染帧。 */
|
|
2572
|
+
declare function computeSummaryValuesSync<RecordType>(rows: RecordType[], columns: InternalLeafColumn<RecordType>[], mergeCell?: ListTableMergeCellOptions): Map<string, string>;
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* 标准化列定义。
|
|
2576
|
+
*
|
|
2577
|
+
* @param columns 原始列。
|
|
2578
|
+
* @returns 标准化结果。
|
|
2579
|
+
*/
|
|
2580
|
+
declare function normalizeColumns<RecordType>(columns: ListTableColumn<RecordType>[]): NormalizedColumn<RecordType>[];
|
|
2581
|
+
|
|
2582
|
+
/**
|
|
2583
|
+
* 拍平叶子列。
|
|
2584
|
+
*
|
|
2585
|
+
* @param columns 标准化列。
|
|
2586
|
+
* @returns 叶子列。
|
|
2587
|
+
*/
|
|
2588
|
+
declare function flattenLeafColumns<RecordType>(columns: NormalizedColumn<RecordType>[]): InternalLeafColumn<RecordType>[];
|
|
2589
|
+
|
|
2457
2590
|
/** 在 columns 中声明独立展开列位置的占位符,使用方式与 AntD 一致。 */
|
|
2458
2591
|
declare const EXPAND_COLUMN: Readonly<{
|
|
2459
2592
|
key: "__row_expand__";
|
|
@@ -2488,36 +2621,97 @@ declare function resetListTableStoredColumnConfig<RecordType>(params: {
|
|
|
2488
2621
|
columns: ListTableOptions<RecordType>["columns"];
|
|
2489
2622
|
}): Promise<void>;
|
|
2490
2623
|
|
|
2624
|
+
/**
|
|
2625
|
+
* 列配置持久化数据结构。
|
|
2626
|
+
*/
|
|
2627
|
+
interface StoredColumnConfig {
|
|
2628
|
+
/** 自定义滚动条配置。 */
|
|
2629
|
+
scrollbar?: _canvas_components_utils.CanvasScrollbarOptions;
|
|
2630
|
+
/** 列设置是否缓存;关闭时不保存列宽、显隐、固定和顺序。 */
|
|
2631
|
+
cacheColumnSettings?: boolean;
|
|
2632
|
+
cachePreferences?: ListTableCachePreferences;
|
|
2633
|
+
/** 列树先序排列,各层只恢复同级列顺序。 */
|
|
2634
|
+
columnOrder?: string[];
|
|
2635
|
+
/** 各列的宽度与固定方向。 */
|
|
2636
|
+
columns: Record<string, {
|
|
2637
|
+
width?: number;
|
|
2638
|
+
userTitle?: string;
|
|
2639
|
+
userDefined?: boolean;
|
|
2640
|
+
parentKey?: string;
|
|
2641
|
+
title?: string;
|
|
2642
|
+
dataIndex?: string | number | Array<string | number>;
|
|
2643
|
+
minWidth?: number;
|
|
2644
|
+
maxWidth?: number;
|
|
2645
|
+
fixed?: "left" | "right";
|
|
2646
|
+
hidden?: boolean;
|
|
2647
|
+
align?: "left" | "center" | "right";
|
|
2648
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
2649
|
+
headerAlign?: "left" | "center" | "right";
|
|
2650
|
+
headerVerticalAlign?: "top" | "middle" | "bottom";
|
|
2651
|
+
dataFormat?: ListTableDataFormat;
|
|
2652
|
+
conditionalFormats?: ListTableConditionalFormatRule[];
|
|
2653
|
+
cacheConditionalFormats?: boolean;
|
|
2654
|
+
summaryTitle?: string;
|
|
2655
|
+
summary?: {
|
|
2656
|
+
type?: string;
|
|
2657
|
+
precision?: number;
|
|
2658
|
+
showTypePrefix?: boolean;
|
|
2659
|
+
roundingMode?: ListTableSummaryRoundingMode;
|
|
2660
|
+
preserveTrailingZeros?: boolean;
|
|
2661
|
+
} | false;
|
|
2662
|
+
}>;
|
|
2663
|
+
/** 排序状态。 */
|
|
2664
|
+
sort: ListTableSortState;
|
|
2665
|
+
/** 过滤状态。 */
|
|
2666
|
+
filters: Record<string, unknown>;
|
|
2667
|
+
/**
|
|
2668
|
+
* 表格内容缩放(1 = 100%)。
|
|
2669
|
+
*/
|
|
2670
|
+
zoom?: number;
|
|
2671
|
+
}
|
|
2672
|
+
/**
|
|
2673
|
+
* 保存列配置。
|
|
2674
|
+
*
|
|
2675
|
+
* @param key 存储键。
|
|
2676
|
+
* @param config 配置对象。
|
|
2677
|
+
*/
|
|
2678
|
+
declare function saveColumnConfig(key: string, config: StoredColumnConfig): Promise<void>;
|
|
2679
|
+
/**
|
|
2680
|
+
* 获取列配置。
|
|
2681
|
+
*
|
|
2682
|
+
* @param key 存储键。
|
|
2683
|
+
* @returns 配置对象。
|
|
2684
|
+
*/
|
|
2685
|
+
declare function getColumnConfig(key: string): Promise<StoredColumnConfig | undefined>;
|
|
2686
|
+
|
|
2491
2687
|
/** 同步读取分页尺寸,供表格初始化或外部远程请求使用;存储不可用时忽略缓存。 */
|
|
2492
2688
|
declare function getListTableStoredPageSize(storageKey?: string): number | undefined;
|
|
2493
2689
|
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
}
|
|
2518
|
-
interface ListTableValidationTarget {
|
|
2690
|
+
/** 静态绘制参数,使用 ListTable 原有列配置和逻辑像素尺寸。 */
|
|
2691
|
+
interface DrawListTableOptions<RecordType> {
|
|
2692
|
+
ctx: CanvasRenderingContext2D;
|
|
2693
|
+
width: number;
|
|
2694
|
+
height: number;
|
|
2695
|
+
options: ListTableOptions<RecordType>;
|
|
2696
|
+
/** 图片等异步资源就绪后通知宿主重绘。 */
|
|
2697
|
+
requestRender?: () => void;
|
|
2698
|
+
/** 按实际内容高度布局,汇总行紧接数据;超出传入高度的内容仍裁剪。 */
|
|
2699
|
+
fitContentHeight?: boolean;
|
|
2700
|
+
/** 绘制四边完整且不越过单元格范围的边框,适用于打印。 */
|
|
2701
|
+
completeBorders?: boolean;
|
|
2702
|
+
/** 汇总使用的真实记录,排除展示用占位行。 */
|
|
2703
|
+
summaryDataSource?: RecordType[];
|
|
2704
|
+
}
|
|
2705
|
+
/** 在现有上下文绘制静态表格,不创建 DOM 实例,不修改宿主缩放或画布尺寸。 */
|
|
2706
|
+
declare function drawListTableToCanvas<RecordType>({ ctx, width, height, options: source, requestRender, fitContentHeight, completeBorders, summaryDataSource, }: DrawListTableOptions<RecordType>): Array<{
|
|
2707
|
+
rect: {
|
|
2708
|
+
x: number;
|
|
2709
|
+
y: number;
|
|
2710
|
+
width: number;
|
|
2711
|
+
height: number;
|
|
2712
|
+
};
|
|
2519
2713
|
rowIndex: number;
|
|
2520
|
-
|
|
2521
|
-
}
|
|
2714
|
+
column: ListTableColumn<RecordType>;
|
|
2715
|
+
}>;
|
|
2522
2716
|
|
|
2523
|
-
export { type CreateCellEditorSessionParams, type DebugHitTestResult, EXPAND_COLUMN, type FilterPanelConfig, type FilterPanelOptionItem, type FilterPanelTexts, type FixedPopupConfig, type HeaderContextMenuColumnDraft, type HeaderContextMenuColumnItem, type HeaderContextMenuConfig, type HeaderContextMenuDensity, ListTable, type ListTableAntdIconName, type ListTableAutoMergeRule, type ListTableBarcodeCellContent, type ListTableBarcodeFormat, type ListTableBuiltinIconName, type ListTableButtonCellContent, type ListTableButtonPopconfirmOptions, type ListTableButtonSize, type ListTableButtonType, type ListTableCSSProperties, type ListTableCacheCategory, type ListTableCachePreferences, type ListTableCarouselScrollOptions, type ListTableCellContent, type ListTableCellContentClickContext, type ListTableCellEditorSession, type ListTableCellSpan, type ListTableCellStyle, type ListTableChartCellContent, type ListTableChartData, type ListTableChartSize, type ListTableChartType, type ListTableColorCellContent, type ListTableColumn, type ListTableConditionalFormatCondition, type ListTableConditionalFormatRule, type ListTableConditionalOperator, type ListTableContextMenuFeature, type ListTableContextMenuOptions, type ListTableCustomChartCellContent, type ListTableDangerConfirmRequest, type ListTableDataFormat, type ListTableDataFormatOptions, type ListTableDataFormatType, type ListTableDebugOptions, type ListTableDebugSnapshot, type ListTableDensity, type ListTableEditAutoCompleteEnter, type ListTableEditFilterOption, type ListTableEditOption, type ListTableEditValueType, type ListTableEditable, type ListTableEditorAutoCompleteEnter, type ListTableEditorConfig, type ListTableEditorFactory, type ListTableEditorFilterOption, type ListTableEditorNavigateDirection, type ListTableEditorOption, type ListTableEditorRect, type ListTableEditorRequest, type ListTableEditorTheme, type ListTableEditorValueType, type ListTableEmojiCellContent, type ListTableExperimentalOptions, type ListTableExportColumnChoice, type ListTableExportNameRequest, type ListTableExportSettings, type ListTableExportSummarySettings, type ListTableExportSummaryType, type ListTableExportXlsxOptions, type ListTableFilterCondition$1 as ListTableFilterCondition, type ListTableFilterConditionOperator, type ListTableFilterConditionRelation, type ListTableFilterMatchMode, type ListTableFilterOption, type ListTableFilterOptionValue, type ListTableFilterPanelAdapter, type ListTableFilterState, type ListTableFilterType, type ListTableFilterValue$1 as ListTableFilterValue, type ListTableFixedPopupAdapter, type ListTableFormItemProps, type ListTableFormItemPropsConfig, type ListTableFormRule, type ListTableFormRules, type ListTableGaugeChartCellContent, type ListTableGroupingOptions, type ListTableHeaderContextMenuAdapter, type ListTableHighlightMode, type ListTableHorizontalAlign, type ListTableIconCellContent, type ListTableImageCellContent, type ListTableImageObjectFit, type ListTableImagePreviewRequest, type ListTableKeyboardNavigationOptions, type ListTableLoadingAdapter, type ListTableLoadingRequest, type ListTableMergeCellOptions, type ListTableNestedTableCellContent, type ListTableNestedTableColumn, type ListTableOffscreenCanvasStatusInfo, type ListTableOptions, type ListTablePaginationAdapter, type ListTablePaginationCSSProperties, type ListTablePaginationOptions, type ListTablePaginationStyleSlot, type ListTablePaginationStyles, type ListTablePerformanceMetric, type ListTablePieChartCellContent, type ListTableProgressCellContent, type ListTableProgressShape, type ListTableProgressSize, type ListTableQrCodeCellContent, type ListTableQrCodeLevel, type ListTableQueryChange, type ListTableQueryChangeExtra, type ListTableQueryFilters, type ListTableQueryOptions, type ListTableQueryPagination, type ListTableQuerySorter, type ListTableRadarChartCellContent, type ListTableRateCellContent, type ListTableRateSize, type ListTableRateSymbolType, type ListTableRowDragMode, type ListTableRowDragOptions, type ListTableRowDragPayload, type ListTableRowDragSourceInfo, type ListTableRowDragZone, type ListTableRowEventProps, type ListTableRowSelectionChangeInfo, type ListTableRowSelectionOptions, type ListTableRowSelectorOptions, type ListTableScrollToOptions, type ListTableScrollbarCSSProperties, type ListTableScrollbarOptions, type ListTableSearchMode, type ListTableSearchOptions, type ListTableSearchRequest, type ListTableSelectionState, type ListTableServerSummaryValues, type ListTableSortItem, type ListTableSortState, type ListTableSorter, type ListTableSparklineChartCellContent, type ListTableSparklineSize, type ListTableStyles, type ListTableSummaryConfig, type ListTableSummaryRoundingMode, type ListTableSummaryType, type ListTableSymbolType, type ListTableTagCellContent, type ListTableTheme, type ListTableTimelineCellContent, type ListTableTimelineItem, type ListTableTooltipAdapter, type ListTableTooltipRequest, type ListTableTreeSelectNode, type ListTableUiOptions, type ListTableUploadConfig, type ListTableUploadFile, type ListTableUploadRequest, type ListTableValidationError, type ListTableValidationErrorField, type ListTableValidationFailure, type ListTableValidationTarget, type PaginationConfig, ROW_SELECTION_COLUMN, type RenderCellDescriptor, SELECTION_COLUMN, getListTableStoredPageSize, listTableAntdIconNames, listTableBuiltinIconNames, listTableIconNames, resetListTableStoredColumnConfig };
|
|
2717
|
+
export { type CreateCellEditorSessionParams, type DebugHitTestResult, type DrawListTableOptions, EXPAND_COLUMN, type FilterPanelConfig, type FilterPanelOptionItem, type FilterPanelTexts, type FixedPopupConfig, type HeaderContextMenuColumnDraft, type HeaderContextMenuColumnItem, type HeaderContextMenuConfig, type HeaderContextMenuDensity, ListTable, type ListTableAntdIconName, type ListTableAutoMergeRule, type ListTableBarcodeCellContent, type ListTableBarcodeFormat, type ListTableBuiltinIconName, type ListTableButtonCellContent, type ListTableButtonPopconfirmOptions, type ListTableButtonSize, type ListTableButtonType, type ListTableCSSProperties, type ListTableCacheCategory, type ListTableCachePreferences, type ListTableCarouselScrollOptions, type ListTableCellContent, type ListTableCellContentClickContext, type ListTableCellEditorSession, type ListTableCellSpan, type ListTableCellStyle, type ListTableChartCellContent, type ListTableChartData, type ListTableChartSize, type ListTableChartType, type ListTableColorCellContent, type ListTableColumn, type ListTableConditionalFormatCondition, type ListTableConditionalFormatRule, type ListTableConditionalOperator, type ListTableContextMenuFeature, type ListTableContextMenuItem, type ListTableContextMenuOptions, type ListTableCustomChartCellContent, type ListTableDangerConfirmRequest, type ListTableDataFormat, type ListTableDataFormatOptions, type ListTableDataFormatType, type ListTableDebugOptions, type ListTableDebugSnapshot, type ListTableDensity, type ListTableEditAutoCompleteEnter, type ListTableEditFilterOption, type ListTableEditOption, type ListTableEditValueType, type ListTableEditable, type ListTableEditorAutoCompleteEnter, type ListTableEditorConfig, type ListTableEditorFactory, type ListTableEditorFilterOption, type ListTableEditorNavigateDirection, type ListTableEditorOption, type ListTableEditorRect, type ListTableEditorRequest, type ListTableEditorTheme, type ListTableEditorValueType, type ListTableEmojiCellContent, type ListTableExperimentalOptions, type ListTableExportColumnChoice, type ListTableExportNameRequest, type ListTableExportSettings, type ListTableExportSummarySettings, type ListTableExportSummaryType, type ListTableExportXlsxOptions, type ListTableExternalValidationError, type ListTableFilterCondition$1 as ListTableFilterCondition, type ListTableFilterConditionOperator, type ListTableFilterConditionRelation, type ListTableFilterMatchMode, type ListTableFilterOption, type ListTableFilterOptionValue, type ListTableFilterPanelAdapter, type ListTableFilterState, type ListTableFilterType, type ListTableFilterValue$1 as ListTableFilterValue, type ListTableFixedPopupAdapter, type ListTableFormItemProps, type ListTableFormItemPropsConfig, type ListTableFormRule, type ListTableFormRules, type ListTableGaugeChartCellContent, type ListTableGroupingOptions, type ListTableHeaderContextMenuAdapter, type ListTableHighlightMode, type ListTableHorizontalAlign, type ListTableIconCellContent, type ListTableImageCellContent, type ListTableImageObjectFit, type ListTableImagePreviewRequest, type ListTableJsonTheme, type ListTableKeyboardNavigationOptions, type ListTableLoadingAdapter, type ListTableLoadingRequest, type ListTableMergeCellOptions, type ListTableNestedTableCellContent, type ListTableNestedTableColumn, type ListTableOffscreenCanvasStatusInfo, type ListTableOptions, type ListTablePaginationAdapter, type ListTablePaginationCSSProperties, type ListTablePaginationOptions, type ListTablePaginationStyleSlot, type ListTablePaginationStyles, type ListTablePerformanceMetric, type ListTablePieChartCellContent, type ListTableProgressCellContent, type ListTableProgressShape, type ListTableProgressSize, type ListTableQrCodeCellContent, type ListTableQrCodeLevel, type ListTableQueryChange, type ListTableQueryChangeExtra, type ListTableQueryFilters, type ListTableQueryOptions, type ListTableQueryPagination, type ListTableQuerySorter, type ListTableRadarChartCellContent, type ListTableRateCellContent, type ListTableRateSize, type ListTableRateSymbolType, type ListTableRowDragMode, type ListTableRowDragOptions, type ListTableRowDragPayload, type ListTableRowDragSourceInfo, type ListTableRowDragZone, type ListTableRowEventProps, type ListTableRowSelectionChangeInfo, type ListTableRowSelectionOptions, type ListTableRowSelectorOptions, type ListTableScrollToOptions, type ListTableScrollbarCSSProperties, type ListTableScrollbarOptions, type ListTableSearchMode, type ListTableSearchOptions, type ListTableSearchRequest, type ListTableSelectionState, type ListTableServerSummaryValues, type ListTableSortItem, type ListTableSortState, type ListTableSorter, type ListTableSparklineChartCellContent, type ListTableSparklineSize, type ListTableStyles, type ListTableSummaryConfig, type ListTableSummaryRoundingMode, type ListTableSummaryType, type ListTableSymbolType, type ListTableTagCellContent, type ListTableTheme, type ListTableTimelineCellContent, type ListTableTimelineItem, type ListTableTooltipAdapter, type ListTableTooltipRequest, type ListTableTreeSelectNode, type ListTableUiOptions, type ListTableUploadConfig, type ListTableUploadFile, type ListTableUploadRequest, type ListTableValidationError, type ListTableValidationErrorField, type ListTableValidationErrorTarget, type ListTableValidationFailure, type ListTableValidationTarget, type PaginationConfig, ROW_SELECTION_COLUMN, type RenderCellDescriptor, SELECTION_COLUMN, type StoredColumnConfig, computeSummaryValuesSync as computeListTableSummaryValues, drawListTableToCanvas, flattenLeafColumns as flattenListTableLeafColumns, getColumnConfig as getListTableStoredColumnConfig, getListTableStoredPageSize, listTableAntdIconNames, listTableBuiltinIconNames, listTableIconNames, normalizeColumns as normalizeListTableColumns, resetListTableStoredColumnConfig, saveColumnConfig as saveListTableStoredColumnConfig };
|