@canvas-components/list-table 0.3.36 → 0.3.38
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 +12668 -11434
- package/dist/index.d.cts +253 -62
- package/dist/index.d.ts +253 -62
- package/dist/index.js +12664 -11416
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _canvas_components_utils from '@canvas-components/utils';
|
|
2
|
-
import {
|
|
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
|
/**
|
|
@@ -398,10 +398,21 @@ interface ListTableCellStyle {
|
|
|
398
398
|
borderColor?: string;
|
|
399
399
|
borderWidth?: number;
|
|
400
400
|
}
|
|
401
|
+
/** JSON 单元格的语法着色配置。 */
|
|
402
|
+
interface ListTableJsonTheme {
|
|
403
|
+
/** 对象 key 颜色。 */
|
|
404
|
+
keyColor?: string;
|
|
405
|
+
/** 字符串、数字、布尔值及 null 的颜色。 */
|
|
406
|
+
valueColor?: string;
|
|
407
|
+
/** 对象、数组及分隔符颜色。 */
|
|
408
|
+
symbolColor?: string;
|
|
409
|
+
}
|
|
401
410
|
/**
|
|
402
411
|
* 主题定义。
|
|
403
412
|
*/
|
|
404
413
|
interface ListTableTheme {
|
|
414
|
+
/** JSON 单元格语法颜色;列 jsonTheme 可逐项覆盖。 */
|
|
415
|
+
jsonTheme?: ListTableJsonTheme;
|
|
405
416
|
/** 活动单元格及活动行的 CSS 映射,由 styles 配置生成。 */
|
|
406
417
|
activeCellStyle?: ListTableCellStyle;
|
|
407
418
|
activeRowStyle?: ListTableCellStyle;
|
|
@@ -455,7 +466,7 @@ interface ListTableConditionalFormatRule {
|
|
|
455
466
|
/** 原有短名称,保留已经调整过的图形和评分外观。 */
|
|
456
467
|
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
468
|
/** 官方图标使用原始名称,例如 AccountBookOutlined、HeartFilled、SmileTwoTone。 */
|
|
458
|
-
type ListTableAntdIconName =
|
|
469
|
+
type ListTableAntdIconName = IconName;
|
|
459
470
|
type ListTableBuiltinIconName = (typeof listTableBuiltinIconNames)[number];
|
|
460
471
|
/** 全量官方图标定义为纯数据,不包含 React 运行时。 */
|
|
461
472
|
declare const listTableAntdIconNames: ListTableAntdIconName[];
|
|
@@ -633,7 +644,11 @@ interface ListTableBaseCellContent<RecordType = any> {
|
|
|
633
644
|
key?: string;
|
|
634
645
|
/** 是否展示内容,默认展示。 */
|
|
635
646
|
visible?: boolean;
|
|
647
|
+
/** 在单元格右侧显示复制图标,点击后复制当前单元格的展示内容。 */
|
|
648
|
+
copyable?: boolean;
|
|
636
649
|
style?: ListTableContentStyle;
|
|
650
|
+
/** 在当前片段前开始新行。 */
|
|
651
|
+
lineBreakBefore?: boolean;
|
|
637
652
|
cursor?: string;
|
|
638
653
|
onClick?: (context: ListTableCellContentClickContext<RecordType>) => void;
|
|
639
654
|
}
|
|
@@ -646,6 +661,8 @@ interface ListTableTextCellContent<RecordType = any> extends ListTableBaseCellCo
|
|
|
646
661
|
color?: string;
|
|
647
662
|
fontSize?: number;
|
|
648
663
|
fontWeight?: string;
|
|
664
|
+
/** @internal JSON 语法 token 分类,用于套用表格主题颜色。 */
|
|
665
|
+
jsonTokenType?: "key" | "value" | "symbol";
|
|
649
666
|
}
|
|
650
667
|
/**
|
|
651
668
|
* 单元格金额片段。
|
|
@@ -1166,8 +1183,10 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1166
1183
|
* 用法参考 AntD Table 的 `onCell`。
|
|
1167
1184
|
*/
|
|
1168
1185
|
onCell?: (value: unknown, record: RecordType, rowIndex: number, column: ListTableColumn<RecordType>) => ListTableCellSpan | null | undefined;
|
|
1169
|
-
cellType?: "text" | "emoji" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "custom";
|
|
1186
|
+
cellType?: "text" | "emoji" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "json" | "custom";
|
|
1170
1187
|
cellStyle?: ListTableCellStyle;
|
|
1188
|
+
/** JSON 语法颜色;优先于表格组件级 `theme.jsonTheme`。 */
|
|
1189
|
+
jsonTheme?: ListTableJsonTheme;
|
|
1171
1190
|
/** 金额单元格格式配置,仅在 `cellType: "money"` 时生效。 */
|
|
1172
1191
|
moneyFormat?: ListTableMoneyFormatOptions;
|
|
1173
1192
|
/** 通过列设置覆盖的数据显示格式。 */
|
|
@@ -1190,6 +1209,27 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1190
1209
|
meta?: Record<string, unknown>;
|
|
1191
1210
|
}
|
|
1192
1211
|
|
|
1212
|
+
/**
|
|
1213
|
+
* 标准化列。
|
|
1214
|
+
*/
|
|
1215
|
+
interface NormalizedColumn<RecordType = Record<string, unknown>> extends Omit<ListTableColumn<RecordType>, "children"> {
|
|
1216
|
+
key: string;
|
|
1217
|
+
title: string;
|
|
1218
|
+
titleContent: ListTableHeaderContent[];
|
|
1219
|
+
width: number;
|
|
1220
|
+
minWidth: number;
|
|
1221
|
+
maxWidth: number;
|
|
1222
|
+
depth: number;
|
|
1223
|
+
parentKey: string | null;
|
|
1224
|
+
children?: NormalizedColumn<RecordType>[];
|
|
1225
|
+
}
|
|
1226
|
+
/**
|
|
1227
|
+
* 叶子列。
|
|
1228
|
+
*/
|
|
1229
|
+
interface InternalLeafColumn<RecordType = Record<string, unknown>> extends NormalizedColumn<RecordType> {
|
|
1230
|
+
leafIndex: number;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1193
1233
|
interface ListTableChartData {
|
|
1194
1234
|
labels: string[];
|
|
1195
1235
|
/** 与 labels 对齐的稳定类别标识,用于排序后的图形位置过渡。 */
|
|
@@ -1206,6 +1246,38 @@ interface ListTableSearchOptions {
|
|
|
1206
1246
|
caseSensitive: boolean;
|
|
1207
1247
|
}
|
|
1208
1248
|
|
|
1249
|
+
/** 导出弹窗的逐列汇总选择;title 表示保留原汇总标题。 */
|
|
1250
|
+
type ListTableExportSummaryType = _canvas_components_utils.TableExportSummaryType;
|
|
1251
|
+
/** 本次导出的逐列汇总展示配置。 */
|
|
1252
|
+
type ListTableExportSummarySettings = _canvas_components_utils.TableExportSummarySettings;
|
|
1253
|
+
/** 仅作用于本次文件导出的列与汇总配置。 */
|
|
1254
|
+
type ListTableExportSettings = _canvas_components_utils.TableExportSettings;
|
|
1255
|
+
/**
|
|
1256
|
+
* 表格实例滚动参数。
|
|
1257
|
+
*/
|
|
1258
|
+
interface ListTableScrollToOptions {
|
|
1259
|
+
rowIndex?: number;
|
|
1260
|
+
colIndex?: number;
|
|
1261
|
+
behavior?: "auto" | "smooth";
|
|
1262
|
+
}
|
|
1263
|
+
/** ListTable 内置表格密度对应的行高或自适应模式。 */
|
|
1264
|
+
type ListTableDensity = 26 | 32 | 48 | 56 | "auto";
|
|
1265
|
+
/**
|
|
1266
|
+
* XLSX 导出参数。
|
|
1267
|
+
*/
|
|
1268
|
+
interface ListTableExportXlsxOptions extends XlsxExportOptions {
|
|
1269
|
+
/** 导出前输入文件名称,默认 true。 */
|
|
1270
|
+
promptFileName?: boolean;
|
|
1271
|
+
/** 导出文件名,可省略 `.xlsx` 扩展名。 */
|
|
1272
|
+
fileName?: string;
|
|
1273
|
+
/** 是否在数据末尾追加按当前列配置计算的汇总行,默认跟随表格汇总行的显示状态。 */
|
|
1274
|
+
includeSummary?: boolean;
|
|
1275
|
+
/** 本次导出的列顺序、逐列汇总方式和汇总行开关。 */
|
|
1276
|
+
settings?: ListTableExportSettings;
|
|
1277
|
+
/** 导出失败通知;已保存的分文件不会撤回,取消不触发此回调。 */
|
|
1278
|
+
onError?: (error: unknown) => void;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1209
1281
|
type ListTableFilterMatchMode = "fuzzy" | "exact";
|
|
1210
1282
|
type ListTableFilterType = "value" | "condition";
|
|
1211
1283
|
type ListTableFilterConditionRelation = "and" | "or";
|
|
@@ -1356,6 +1428,22 @@ interface HeaderContextMenuColumnDraft {
|
|
|
1356
1428
|
}
|
|
1357
1429
|
type HeaderContextMenuDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
|
|
1358
1430
|
interface HeaderContextMenuConfig {
|
|
1431
|
+
/** 重写右键菜单打印行为。配置后由适配层直接执行该回调。 */
|
|
1432
|
+
onPrint?: () => void;
|
|
1433
|
+
/** 自定义右键菜单项,支持多级菜单。 */
|
|
1434
|
+
customItems?: ListTableContextMenuItem[];
|
|
1435
|
+
/** 按当前表格显示顺序读取打印数据。 */
|
|
1436
|
+
onGetPrintData?: () => Promise<{
|
|
1437
|
+
columns: Array<{
|
|
1438
|
+
key: string;
|
|
1439
|
+
title: string;
|
|
1440
|
+
width: number;
|
|
1441
|
+
}>;
|
|
1442
|
+
rows: string[][];
|
|
1443
|
+
summaryRow?: string[];
|
|
1444
|
+
summaryColumns?: ListTableExportColumnChoice[];
|
|
1445
|
+
getSummaryRow?: (settings: ListTableExportSettings) => Promise<string[]>;
|
|
1446
|
+
}>;
|
|
1359
1447
|
/** 右键命中滚动条时仅展示滚动条相关操作。 */
|
|
1360
1448
|
scrollbarArea?: boolean;
|
|
1361
1449
|
scrollbarRowCount?: number;
|
|
@@ -1663,6 +1751,8 @@ interface ListTableEditorRequest {
|
|
|
1663
1751
|
onCommit: (options?: ListTableEditorCommitOptions) => void;
|
|
1664
1752
|
onCancel: () => void;
|
|
1665
1753
|
onNavigate?: (direction: ListTableEditorNavigateDirection) => void;
|
|
1754
|
+
/** 将编辑浮层上的滚轮事件交给表格处理。 */
|
|
1755
|
+
onWheel?: (event: WheelEvent) => void;
|
|
1666
1756
|
}
|
|
1667
1757
|
interface ListTableEditorFactory {
|
|
1668
1758
|
createCellEditorSession(params: CreateCellEditorSessionParams): ListTableCellEditorSession | null;
|
|
@@ -1810,7 +1900,7 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
|
|
|
1810
1900
|
/**
|
|
1811
1901
|
* 右键菜单功能项。
|
|
1812
1902
|
*/
|
|
1813
|
-
type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1903
|
+
type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "print" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1814
1904
|
/**
|
|
1815
1905
|
* 数据分组配置。
|
|
1816
1906
|
*/
|
|
@@ -1835,6 +1925,18 @@ interface ListTableContextMenuOptions {
|
|
|
1835
1925
|
* 禁用的功能列表,会从默认功能或 `features` 中排除。
|
|
1836
1926
|
*/
|
|
1837
1927
|
disabledFeatures?: ListTableContextMenuFeature[];
|
|
1928
|
+
/** 重写右键菜单打印行为。配置后直接显示一级“打印”菜单项。 */
|
|
1929
|
+
onPrint?: () => void;
|
|
1930
|
+
/** 自定义右键菜单项,支持通过 children 配置多级菜单。 */
|
|
1931
|
+
customItems?: ListTableContextMenuItem[];
|
|
1932
|
+
}
|
|
1933
|
+
/** 右键菜单扩展项。 */
|
|
1934
|
+
interface ListTableContextMenuItem {
|
|
1935
|
+
key: string;
|
|
1936
|
+
label: string;
|
|
1937
|
+
onClick?: () => void;
|
|
1938
|
+
children?: ListTableContextMenuItem[];
|
|
1939
|
+
disabled?: boolean;
|
|
1838
1940
|
}
|
|
1839
1941
|
/**
|
|
1840
1942
|
* 画布滚动条配置。
|
|
@@ -2314,37 +2416,42 @@ interface ListTableOptions<RecordType = Record<string, unknown>> {
|
|
|
2314
2416
|
ui?: ListTableUiOptions<RecordType>;
|
|
2315
2417
|
}
|
|
2316
2418
|
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
*/
|
|
2326
|
-
interface ListTableScrollToOptions {
|
|
2327
|
-
rowIndex?: number;
|
|
2328
|
-
colIndex?: number;
|
|
2329
|
-
behavior?: "auto" | "smooth";
|
|
2419
|
+
interface ListTableValidationError<RecordType> {
|
|
2420
|
+
rowIndex: number;
|
|
2421
|
+
rowKey: string | number;
|
|
2422
|
+
columnKey: string;
|
|
2423
|
+
dataIndex?: TableColumnDataIndex;
|
|
2424
|
+
message: string;
|
|
2425
|
+
value: unknown;
|
|
2426
|
+
record: RecordType;
|
|
2330
2427
|
}
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2428
|
+
interface ListTableValidationErrorField<RecordType> {
|
|
2429
|
+
rowIndex: number;
|
|
2430
|
+
rowKey: string | number;
|
|
2431
|
+
columnKey: string;
|
|
2432
|
+
dataIndex?: TableColumnDataIndex;
|
|
2433
|
+
name: Array<string | number>;
|
|
2434
|
+
errors: string[];
|
|
2435
|
+
value: unknown;
|
|
2436
|
+
record: RecordType;
|
|
2437
|
+
}
|
|
2438
|
+
interface ListTableValidationFailure<RecordType> {
|
|
2439
|
+
values: RecordType[];
|
|
2440
|
+
errorFields: ListTableValidationErrorField<RecordType>[];
|
|
2441
|
+
outOfDate: boolean;
|
|
2442
|
+
}
|
|
2443
|
+
interface ListTableValidationTarget {
|
|
2444
|
+
rowIndex: number;
|
|
2445
|
+
columnKey: string;
|
|
2446
|
+
}
|
|
2447
|
+
/** 外部注入的单元格校验信息。使用行键而不是行索引,避免排序或筛选后错位。 */
|
|
2448
|
+
interface ListTableExternalValidationError {
|
|
2449
|
+
rowKey: string | number;
|
|
2450
|
+
columnKey: string;
|
|
2451
|
+
message: string;
|
|
2347
2452
|
}
|
|
2453
|
+
/** 外部清除校验信息时使用的单元格定位。 */
|
|
2454
|
+
type ListTableValidationErrorTarget = Pick<ListTableExternalValidationError, "rowKey" | "columnKey">;
|
|
2348
2455
|
|
|
2349
2456
|
/**
|
|
2350
2457
|
* ListTable 原生入口。
|
|
@@ -2406,6 +2513,10 @@ declare class ListTable<RecordType = Record<string, unknown>> {
|
|
|
2406
2513
|
* 成功时返回当前表格数据,失败时抛出校验失败结果。
|
|
2407
2514
|
*/
|
|
2408
2515
|
validate(): Promise<RecordType[]>;
|
|
2516
|
+
/** 注入外部校验结果。 */
|
|
2517
|
+
setValidationErrors(errors: ListTableExternalValidationError[]): void;
|
|
2518
|
+
/** 清除指定或全部校验结果。 */
|
|
2519
|
+
clearValidationErrors(targets?: ListTableValidationErrorTarget[]): void;
|
|
2409
2520
|
/**
|
|
2410
2521
|
* 异步导出全部原始数据为 XLSX。
|
|
2411
2522
|
*/
|
|
@@ -2440,6 +2551,25 @@ declare class ListTable<RecordType = Record<string, unknown>> {
|
|
|
2440
2551
|
destroy(): void;
|
|
2441
2552
|
}
|
|
2442
2553
|
|
|
2554
|
+
/** 静态打印同步复用统计规则,确保导出时不依赖异步渲染帧。 */
|
|
2555
|
+
declare function computeSummaryValuesSync<RecordType>(rows: RecordType[], columns: InternalLeafColumn<RecordType>[], mergeCell?: ListTableMergeCellOptions): Map<string, string>;
|
|
2556
|
+
|
|
2557
|
+
/**
|
|
2558
|
+
* 标准化列定义。
|
|
2559
|
+
*
|
|
2560
|
+
* @param columns 原始列。
|
|
2561
|
+
* @returns 标准化结果。
|
|
2562
|
+
*/
|
|
2563
|
+
declare function normalizeColumns<RecordType>(columns: ListTableColumn<RecordType>[]): NormalizedColumn<RecordType>[];
|
|
2564
|
+
|
|
2565
|
+
/**
|
|
2566
|
+
* 拍平叶子列。
|
|
2567
|
+
*
|
|
2568
|
+
* @param columns 标准化列。
|
|
2569
|
+
* @returns 叶子列。
|
|
2570
|
+
*/
|
|
2571
|
+
declare function flattenLeafColumns<RecordType>(columns: NormalizedColumn<RecordType>[]): InternalLeafColumn<RecordType>[];
|
|
2572
|
+
|
|
2443
2573
|
/** 在 columns 中声明独立展开列位置的占位符,使用方式与 AntD 一致。 */
|
|
2444
2574
|
declare const EXPAND_COLUMN: Readonly<{
|
|
2445
2575
|
key: "__row_expand__";
|
|
@@ -2474,36 +2604,97 @@ declare function resetListTableStoredColumnConfig<RecordType>(params: {
|
|
|
2474
2604
|
columns: ListTableOptions<RecordType>["columns"];
|
|
2475
2605
|
}): Promise<void>;
|
|
2476
2606
|
|
|
2607
|
+
/**
|
|
2608
|
+
* 列配置持久化数据结构。
|
|
2609
|
+
*/
|
|
2610
|
+
interface StoredColumnConfig {
|
|
2611
|
+
/** 自定义滚动条配置。 */
|
|
2612
|
+
scrollbar?: _canvas_components_utils.CanvasScrollbarOptions;
|
|
2613
|
+
/** 列设置是否缓存;关闭时不保存列宽、显隐、固定和顺序。 */
|
|
2614
|
+
cacheColumnSettings?: boolean;
|
|
2615
|
+
cachePreferences?: ListTableCachePreferences;
|
|
2616
|
+
/** 列树先序排列,各层只恢复同级列顺序。 */
|
|
2617
|
+
columnOrder?: string[];
|
|
2618
|
+
/** 各列的宽度与固定方向。 */
|
|
2619
|
+
columns: Record<string, {
|
|
2620
|
+
width?: number;
|
|
2621
|
+
userTitle?: string;
|
|
2622
|
+
userDefined?: boolean;
|
|
2623
|
+
parentKey?: string;
|
|
2624
|
+
title?: string;
|
|
2625
|
+
dataIndex?: string | number | Array<string | number>;
|
|
2626
|
+
minWidth?: number;
|
|
2627
|
+
maxWidth?: number;
|
|
2628
|
+
fixed?: "left" | "right";
|
|
2629
|
+
hidden?: boolean;
|
|
2630
|
+
align?: "left" | "center" | "right";
|
|
2631
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
2632
|
+
headerAlign?: "left" | "center" | "right";
|
|
2633
|
+
headerVerticalAlign?: "top" | "middle" | "bottom";
|
|
2634
|
+
dataFormat?: ListTableDataFormat;
|
|
2635
|
+
conditionalFormats?: ListTableConditionalFormatRule[];
|
|
2636
|
+
cacheConditionalFormats?: boolean;
|
|
2637
|
+
summaryTitle?: string;
|
|
2638
|
+
summary?: {
|
|
2639
|
+
type?: string;
|
|
2640
|
+
precision?: number;
|
|
2641
|
+
showTypePrefix?: boolean;
|
|
2642
|
+
roundingMode?: ListTableSummaryRoundingMode;
|
|
2643
|
+
preserveTrailingZeros?: boolean;
|
|
2644
|
+
} | false;
|
|
2645
|
+
}>;
|
|
2646
|
+
/** 排序状态。 */
|
|
2647
|
+
sort: ListTableSortState;
|
|
2648
|
+
/** 过滤状态。 */
|
|
2649
|
+
filters: Record<string, unknown>;
|
|
2650
|
+
/**
|
|
2651
|
+
* 表格内容缩放(1 = 100%)。
|
|
2652
|
+
*/
|
|
2653
|
+
zoom?: number;
|
|
2654
|
+
}
|
|
2655
|
+
/**
|
|
2656
|
+
* 保存列配置。
|
|
2657
|
+
*
|
|
2658
|
+
* @param key 存储键。
|
|
2659
|
+
* @param config 配置对象。
|
|
2660
|
+
*/
|
|
2661
|
+
declare function saveColumnConfig(key: string, config: StoredColumnConfig): Promise<void>;
|
|
2662
|
+
/**
|
|
2663
|
+
* 获取列配置。
|
|
2664
|
+
*
|
|
2665
|
+
* @param key 存储键。
|
|
2666
|
+
* @returns 配置对象。
|
|
2667
|
+
*/
|
|
2668
|
+
declare function getColumnConfig(key: string): Promise<StoredColumnConfig | undefined>;
|
|
2669
|
+
|
|
2477
2670
|
/** 同步读取分页尺寸,供表格初始化或外部远程请求使用;存储不可用时忽略缓存。 */
|
|
2478
2671
|
declare function getListTableStoredPageSize(storageKey?: string): number | undefined;
|
|
2479
2672
|
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
}
|
|
2504
|
-
interface ListTableValidationTarget {
|
|
2673
|
+
/** 静态绘制参数,使用 ListTable 原有列配置和逻辑像素尺寸。 */
|
|
2674
|
+
interface DrawListTableOptions<RecordType> {
|
|
2675
|
+
ctx: CanvasRenderingContext2D;
|
|
2676
|
+
width: number;
|
|
2677
|
+
height: number;
|
|
2678
|
+
options: ListTableOptions<RecordType>;
|
|
2679
|
+
/** 图片等异步资源就绪后通知宿主重绘。 */
|
|
2680
|
+
requestRender?: () => void;
|
|
2681
|
+
/** 按实际内容高度布局,汇总行紧接数据;超出传入高度的内容仍裁剪。 */
|
|
2682
|
+
fitContentHeight?: boolean;
|
|
2683
|
+
/** 绘制四边完整且不越过单元格范围的边框,适用于打印。 */
|
|
2684
|
+
completeBorders?: boolean;
|
|
2685
|
+
/** 汇总使用的真实记录,排除展示用占位行。 */
|
|
2686
|
+
summaryDataSource?: RecordType[];
|
|
2687
|
+
}
|
|
2688
|
+
/** 在现有上下文绘制静态表格,不创建 DOM 实例,不修改宿主缩放或画布尺寸。 */
|
|
2689
|
+
declare function drawListTableToCanvas<RecordType>({ ctx, width, height, options: source, requestRender, fitContentHeight, completeBorders, summaryDataSource, }: DrawListTableOptions<RecordType>): Array<{
|
|
2690
|
+
rect: {
|
|
2691
|
+
x: number;
|
|
2692
|
+
y: number;
|
|
2693
|
+
width: number;
|
|
2694
|
+
height: number;
|
|
2695
|
+
};
|
|
2505
2696
|
rowIndex: number;
|
|
2506
|
-
|
|
2507
|
-
}
|
|
2697
|
+
column: ListTableColumn<RecordType>;
|
|
2698
|
+
}>;
|
|
2508
2699
|
|
|
2509
|
-
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 };
|
|
2700
|
+
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 };
|