@canvas-components/list-table 0.2.3 → 0.2.5
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 +229 -222
- package/dist/index.cjs +7083 -2759
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +157 -11
- package/dist/index.d.ts +157 -11
- package/dist/index.js +7084 -2760
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -58,6 +58,28 @@ type ListTableFilterState = Record<string, ListTableFilterValue$1>;
|
|
|
58
58
|
interface ListTableSelectionState {
|
|
59
59
|
rowIndex: number | null;
|
|
60
60
|
columnKey: string | null;
|
|
61
|
+
/** 当前活动单元格内模拟的文本选区。 */
|
|
62
|
+
textSelection?: ListTableTextSelectionState | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Canvas 文本选区状态。
|
|
66
|
+
*/
|
|
67
|
+
interface ListTableTextSelectionState {
|
|
68
|
+
fragments: ListTableTextSelectionFragment[];
|
|
69
|
+
anchorFragmentIndex: number;
|
|
70
|
+
focusFragmentIndex: number;
|
|
71
|
+
anchorOffset: number;
|
|
72
|
+
focusOffset: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 单元格内一个可选择的可视文本片段。
|
|
76
|
+
*/
|
|
77
|
+
interface ListTableTextSelectionFragment {
|
|
78
|
+
rowIndex?: number;
|
|
79
|
+
columnKey?: string;
|
|
80
|
+
contentIndex: number;
|
|
81
|
+
fragmentKey: string;
|
|
82
|
+
text: string;
|
|
61
83
|
}
|
|
62
84
|
/**
|
|
63
85
|
* 表头 action 显隐状态。
|
|
@@ -82,6 +104,26 @@ interface ListTableDebugOptions {
|
|
|
82
104
|
showHeaderActionOverlay?: boolean;
|
|
83
105
|
logDrawCalls?: boolean;
|
|
84
106
|
logStateChanges?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* 性能阶段埋点回调。仅在配置后执行,不影响默认渲染路径。
|
|
109
|
+
*/
|
|
110
|
+
onPerformance?: (metric: ListTablePerformanceMetric) => void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* 列表表格性能阶段指标。
|
|
114
|
+
*/
|
|
115
|
+
interface ListTablePerformanceMetric {
|
|
116
|
+
phase: "grouping" | "snapshot" | "render";
|
|
117
|
+
durationMs: number;
|
|
118
|
+
inputRowCount: number;
|
|
119
|
+
outputRowCount: number;
|
|
120
|
+
cacheHit?: boolean;
|
|
121
|
+
groupedRowCount?: number;
|
|
122
|
+
scrollOnly?: boolean;
|
|
123
|
+
batchCount?: number;
|
|
124
|
+
indexNodeCount?: number;
|
|
125
|
+
cancelledCount?: number;
|
|
126
|
+
status?: "ready" | "cancelled" | "error";
|
|
85
127
|
}
|
|
86
128
|
/**
|
|
87
129
|
* 查询回调扩展参数。
|
|
@@ -110,7 +152,7 @@ interface Rect {
|
|
|
110
152
|
* 命中结果。
|
|
111
153
|
*/
|
|
112
154
|
interface DebugHitTestResult {
|
|
113
|
-
area: "header" | "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";
|
|
155
|
+
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";
|
|
114
156
|
scrollbarRole?: "thumb" | "track" | "decrease-button" | "increase-button";
|
|
115
157
|
columnKey?: string;
|
|
116
158
|
rowIndex?: number;
|
|
@@ -128,6 +170,13 @@ interface DebugHitTestResult {
|
|
|
128
170
|
rect?: Rect;
|
|
129
171
|
tooltipText?: string;
|
|
130
172
|
tooltipVariant?: "default" | "error";
|
|
173
|
+
textSelectionText?: string;
|
|
174
|
+
textSelectionFont?: string;
|
|
175
|
+
textSelectionFragmentKey?: string;
|
|
176
|
+
textSelectionOriginX?: number;
|
|
177
|
+
/** 表头文本所属层级,用于跨层拖选时区分行。 */
|
|
178
|
+
textSelectionRowIndex?: number;
|
|
179
|
+
textSelectionRect?: Rect;
|
|
131
180
|
}
|
|
132
181
|
/**
|
|
133
182
|
* action 类型。
|
|
@@ -137,7 +186,7 @@ type HeaderActionType = "sort" | "filter" | "fixed";
|
|
|
137
186
|
* 渲染矩形描述。
|
|
138
187
|
*/
|
|
139
188
|
interface RenderCellDescriptor {
|
|
140
|
-
kind: "header" | "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";
|
|
189
|
+
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";
|
|
141
190
|
rect: Rect;
|
|
142
191
|
columnKey?: string;
|
|
143
192
|
rowIndex?: number;
|
|
@@ -153,6 +202,17 @@ interface RenderCellDescriptor {
|
|
|
153
202
|
cursor?: string;
|
|
154
203
|
tooltipText?: string;
|
|
155
204
|
tooltipVariant?: "default" | "error";
|
|
205
|
+
/** 可参与 Canvas 文本选择的实际绘制文本。 */
|
|
206
|
+
textSelectionText?: string;
|
|
207
|
+
/** 文本命中时使用的 Canvas 字体。 */
|
|
208
|
+
textSelectionFont?: string;
|
|
209
|
+
/** 同一单元格内文本布局片段的稳定标识。 */
|
|
210
|
+
textSelectionFragmentKey?: string;
|
|
211
|
+
/** 文本未裁剪前的绘制起点。 */
|
|
212
|
+
textSelectionOriginX?: number;
|
|
213
|
+
/** 表头文本所属层级,用于跨层拖选时区分行。 */
|
|
214
|
+
textSelectionRowIndex?: number;
|
|
215
|
+
textSelectionRect?: Rect;
|
|
156
216
|
actionType?: HeaderActionType;
|
|
157
217
|
scrollbarRole?: "thumb" | "track" | "decrease-button" | "increase-button";
|
|
158
218
|
visibilityState?: HeaderActionVisibilityState;
|
|
@@ -213,6 +273,7 @@ interface ListTableTheme {
|
|
|
213
273
|
frozenRowBackgroundColor: string;
|
|
214
274
|
hoverBackgroundColor: string;
|
|
215
275
|
selectionBackgroundColor: string;
|
|
276
|
+
textSelectionBackgroundColor?: string;
|
|
216
277
|
emptyBackgroundColor: string;
|
|
217
278
|
emptyTextColor: string;
|
|
218
279
|
debugStrokeColor: string;
|
|
@@ -234,8 +295,25 @@ interface ListTableTheme {
|
|
|
234
295
|
* - `max`:取当前列最大值
|
|
235
296
|
*/
|
|
236
297
|
type ListTableSummaryType = "sum" | "avg" | "count" | "unionCount" | "rowCount" | "mergedRowCount" | "min" | "max";
|
|
298
|
+
/** 汇总结果的小数取整方式。 */
|
|
299
|
+
type ListTableSummaryRoundingMode = "round" | "floor" | "ceil" | "truncate";
|
|
237
300
|
type ListTableHorizontalAlign = "left" | "center" | "right";
|
|
238
|
-
type ListTableDataFormatType = "default" | "number" | "thousands" | "money";
|
|
301
|
+
type ListTableDataFormatType = "default" | "text" | "number" | "thousands" | "decimal" | "percent" | "percentDecimal" | "scientific" | "numberToChineseUpper" | "chineseUpperToNumber" | "cny" | "cnyDecimal" | "usd" | "usdDecimal" | "dateSlash" | "dateDash" | "dateFullCN" | "dateYearMonthCN" | "dateMonthDayCN" | "dateSlashWeek" | "dateDashWeek" | "dateWeekdayCNFull" | "dateWeekdayCNShort" | "time" | "timeShort" | "time12" | "time12Seconds" | "timeMillisecond" | "time12Millisecond" | "timeChineseHour" | "timeChineseSecond" | "time12ChineseHour" | "time12ChineseSecond" | "datetime" | "datetime12" | "datetime12Seconds" | "custom" | "money";
|
|
302
|
+
/** 可持久化的数据显示格式配置。 */
|
|
303
|
+
interface ListTableDataFormatOptions {
|
|
304
|
+
/** 基础格式类型。 */
|
|
305
|
+
type: ListTableDataFormatType;
|
|
306
|
+
/** 小数位数,支持 0 到 20。 */
|
|
307
|
+
decimalPlaces?: number;
|
|
308
|
+
/** 是否显示千分位分隔符。 */
|
|
309
|
+
useGrouping?: boolean;
|
|
310
|
+
/** 货币符号。 */
|
|
311
|
+
symbol?: string;
|
|
312
|
+
/** 日期、时间或自定义格式模式。 */
|
|
313
|
+
pattern?: string;
|
|
314
|
+
}
|
|
315
|
+
/** 数据显示格式,字符串用于快捷格式,对象用于精确格式配置。 */
|
|
316
|
+
type ListTableDataFormat = ListTableDataFormatType | ListTableDataFormatOptions;
|
|
239
317
|
type ListTableFilterOptionValue = string | number | null;
|
|
240
318
|
interface ListTableFilterOption {
|
|
241
319
|
label: string;
|
|
@@ -251,8 +329,12 @@ interface ListTableSummaryConfig<RecordType = Record<string, unknown>> {
|
|
|
251
329
|
valueGetter?: (record: RecordType) => string | number | null | undefined;
|
|
252
330
|
/** 值格式化函数。 */
|
|
253
331
|
formatter?: (value: string | number, records: RecordType[], column: ListTableColumn<RecordType>) => string;
|
|
254
|
-
/**
|
|
332
|
+
/** 小数精度,不传则整数不保留小数、非整数保留两位。 */
|
|
255
333
|
precision?: number;
|
|
334
|
+
/** 小数取整方式,默认四舍五入。 */
|
|
335
|
+
roundingMode?: ListTableSummaryRoundingMode;
|
|
336
|
+
/** 是否保留精度补齐产生的无效零,默认不保留。 */
|
|
337
|
+
preserveTrailingZeros?: boolean;
|
|
256
338
|
}
|
|
257
339
|
/**
|
|
258
340
|
* 路径索引定义。
|
|
@@ -329,7 +411,7 @@ type ListTableFormRules<RecordType = Record<string, unknown>> = ListTableFormRul
|
|
|
329
411
|
* 单元格内容片段样式。
|
|
330
412
|
*/
|
|
331
413
|
interface ListTableContentStyle {
|
|
332
|
-
display?: "block" | "inline-block";
|
|
414
|
+
display?: "none" | "block" | "inline-block";
|
|
333
415
|
textAlign?: CanvasTextAlign;
|
|
334
416
|
fontSize?: number;
|
|
335
417
|
fontWeight?: string;
|
|
@@ -348,6 +430,8 @@ interface ListTableContentStyle {
|
|
|
348
430
|
*/
|
|
349
431
|
interface ListTableBaseCellContent<RecordType = any> {
|
|
350
432
|
key?: string;
|
|
433
|
+
/** 是否展示内容,默认展示。 */
|
|
434
|
+
visible?: boolean;
|
|
351
435
|
style?: ListTableContentStyle;
|
|
352
436
|
cursor?: string;
|
|
353
437
|
onClick?: (context: ListTableCellContentClickContext<RecordType>) => void;
|
|
@@ -777,7 +861,7 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
777
861
|
/** 金额单元格格式配置,仅在 `cellType: "money"` 时生效。 */
|
|
778
862
|
moneyFormat?: ListTableMoneyFormatOptions;
|
|
779
863
|
/** 通过列设置覆盖的数据显示格式。 */
|
|
780
|
-
dataFormat?:
|
|
864
|
+
dataFormat?: ListTableDataFormat;
|
|
781
865
|
headerStyle?: ListTableCellStyle;
|
|
782
866
|
/** 汇总行配置。设为 `true` 等效于 `{ type: "sum" }`。 */
|
|
783
867
|
summary?: boolean | ListTableSummaryConfig<RecordType>;
|
|
@@ -917,6 +1001,7 @@ interface HeaderContextMenuConfig {
|
|
|
917
1001
|
onCopyRowText?: () => void;
|
|
918
1002
|
onCopyRowJson?: () => void;
|
|
919
1003
|
onCopySelection?: () => void;
|
|
1004
|
+
onOpenSearch?: () => void;
|
|
920
1005
|
customSelection?: {
|
|
921
1006
|
startRow: number;
|
|
922
1007
|
startColumn: number;
|
|
@@ -948,7 +1033,21 @@ interface HeaderContextMenuConfig {
|
|
|
948
1033
|
onUnfreezeRow?: () => void;
|
|
949
1034
|
onResetFilter?: () => void;
|
|
950
1035
|
onResetSort?: () => void;
|
|
1036
|
+
onSortAscend?: () => void;
|
|
1037
|
+
onSortDescend?: () => void;
|
|
1038
|
+
onClearSort?: () => void;
|
|
1039
|
+
onFixLeft?: () => void;
|
|
1040
|
+
onFixRight?: () => void;
|
|
1041
|
+
onUnfix?: () => void;
|
|
951
1042
|
onResetHeader?: () => void;
|
|
1043
|
+
onResetGrouping?: () => void;
|
|
1044
|
+
onResetSummary?: () => void;
|
|
1045
|
+
onResetAlignment?: () => void;
|
|
1046
|
+
onResetDataFormat?: () => void;
|
|
1047
|
+
onAutoFitCurrentColumn?: () => void;
|
|
1048
|
+
onAutoFitAllColumns?: () => void;
|
|
1049
|
+
groupingBarVisible?: boolean;
|
|
1050
|
+
onToggleGroupingBar?: () => void;
|
|
952
1051
|
onChangeDensity?: (density: HeaderContextMenuDensity) => void;
|
|
953
1052
|
/**
|
|
954
1053
|
* 调整表格缩放。
|
|
@@ -962,15 +1061,28 @@ interface HeaderContextMenuConfig {
|
|
|
962
1061
|
bodyVertical: "top" | "middle" | "bottom";
|
|
963
1062
|
};
|
|
964
1063
|
onChangeAlignment?: (area: "header" | "body", axis: "horizontal" | "vertical", value: ListTableHorizontalAlign | "top" | "middle" | "bottom") => void;
|
|
965
|
-
dataFormat?:
|
|
966
|
-
onChangeDataFormat?: (dataFormat:
|
|
1064
|
+
dataFormat?: ListTableDataFormat;
|
|
1065
|
+
onChangeDataFormat?: (dataFormat: ListTableDataFormat) => void;
|
|
967
1066
|
summaryVisible?: boolean;
|
|
968
1067
|
summaryColumnKey?: string;
|
|
969
1068
|
summaryType?: ListTableSummaryType;
|
|
970
1069
|
summaryPrecision?: number;
|
|
1070
|
+
summaryRoundingMode?: ListTableSummaryRoundingMode;
|
|
1071
|
+
summaryPreserveTrailingZeros?: boolean;
|
|
971
1072
|
onToggleSummary?: () => void;
|
|
972
1073
|
onChangeSummaryType?: (type: ListTableSummaryType) => void;
|
|
973
1074
|
onChangeSummaryPrecision?: (precision: number | undefined) => void;
|
|
1075
|
+
onChangeSummaryRoundingMode?: (mode: ListTableSummaryRoundingMode) => void;
|
|
1076
|
+
onChangeSummaryPreserveTrailingZeros?: (value: boolean) => void;
|
|
1077
|
+
onClose: () => void;
|
|
1078
|
+
}
|
|
1079
|
+
interface ListTableSearchRequest {
|
|
1080
|
+
keyword: string;
|
|
1081
|
+
matchCount: number;
|
|
1082
|
+
currentIndex: number;
|
|
1083
|
+
/** 提交关键词并重新计算匹配项。 */
|
|
1084
|
+
onSubmit: (keyword: string) => void;
|
|
1085
|
+
onNavigate: (direction: "previous" | "next") => void;
|
|
974
1086
|
onClose: () => void;
|
|
975
1087
|
}
|
|
976
1088
|
interface PaginationConfig {
|
|
@@ -1259,7 +1371,18 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
|
|
|
1259
1371
|
/**
|
|
1260
1372
|
* 右键菜单功能项。
|
|
1261
1373
|
*/
|
|
1262
|
-
type ListTableContextMenuFeature = "copy" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "density" | "zoom" | "alignment" | "dataFormat" | "columnVisibility";
|
|
1374
|
+
type ListTableContextMenuFeature = "copy" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "grouping" | "columnVisibility";
|
|
1375
|
+
/**
|
|
1376
|
+
* 数据分组配置。
|
|
1377
|
+
*/
|
|
1378
|
+
interface ListTableGroupingOptions {
|
|
1379
|
+
/** 是否初始显示顶部的分组栏,默认 false。 */
|
|
1380
|
+
visible?: boolean;
|
|
1381
|
+
/** 初始分组列 key,顺序表示分组层级。 */
|
|
1382
|
+
columnKeys?: string[];
|
|
1383
|
+
/** 分组列变化回调。 */
|
|
1384
|
+
onChange?: (columnKeys: string[]) => void;
|
|
1385
|
+
}
|
|
1263
1386
|
/**
|
|
1264
1387
|
* 右键菜单配置。
|
|
1265
1388
|
*/
|
|
@@ -1432,7 +1555,7 @@ interface ListTableRowSelectionOptions<RecordType> {
|
|
|
1432
1555
|
/**
|
|
1433
1556
|
* 点击普通表体区域时是否切换当前行选择状态。
|
|
1434
1557
|
*
|
|
1435
|
-
* @default
|
|
1558
|
+
* @default true
|
|
1436
1559
|
*/
|
|
1437
1560
|
selectRowByClick?: boolean;
|
|
1438
1561
|
selectedRowKeys?: Array<string | number>;
|
|
@@ -1494,9 +1617,23 @@ interface ListTableUiOptions {
|
|
|
1494
1617
|
onFilterPanelRequest?: (request: FilterPanelConfig | null) => void;
|
|
1495
1618
|
onFixedPopupRequest?: (request: FixedPopupConfig | null) => void;
|
|
1496
1619
|
onHeaderContextMenuRequest?: (request: HeaderContextMenuConfig | null) => void;
|
|
1620
|
+
onSearchRequest?: (request: ListTableSearchRequest | null) => void;
|
|
1497
1621
|
onImagePreviewRequest?: (request: ListTableImagePreviewRequest | null) => void;
|
|
1498
1622
|
onDangerConfirmRequest?: (request: ListTableDangerConfirmRequest | null) => void;
|
|
1499
1623
|
}
|
|
1624
|
+
/**
|
|
1625
|
+
* 行选择器配置。
|
|
1626
|
+
*
|
|
1627
|
+
* 行选择器是位于表格最左侧的空白系统列,仅用于快速选中整行,
|
|
1628
|
+
* 不参与 checkbox/radio 行数据选择。
|
|
1629
|
+
*/
|
|
1630
|
+
interface ListTableRowSelectorOptions {
|
|
1631
|
+
/**
|
|
1632
|
+
* 选择器列宽度。
|
|
1633
|
+
* @default 12
|
|
1634
|
+
*/
|
|
1635
|
+
width?: number;
|
|
1636
|
+
}
|
|
1500
1637
|
interface ListTableImagePreviewRequest {
|
|
1501
1638
|
src: string;
|
|
1502
1639
|
alt?: string;
|
|
@@ -1519,6 +1656,9 @@ interface ListTableOptions<RecordType = Record<string, unknown>> {
|
|
|
1519
1656
|
height?: number | string;
|
|
1520
1657
|
columns: ListTableColumn<RecordType>[];
|
|
1521
1658
|
dataSource: RecordType[];
|
|
1659
|
+
/** 顶部分组栏与数据分组配置。 */
|
|
1660
|
+
/** 数据分组配置;不传时不启用分组功能。 */
|
|
1661
|
+
grouping?: ListTableGroupingOptions;
|
|
1522
1662
|
/** AntD Table 风格的行事件配置。 */
|
|
1523
1663
|
onRow?: (record: RecordType, rowIndex: number) => ListTableRowEventProps | null | undefined;
|
|
1524
1664
|
emptyText?: string;
|
|
@@ -1552,6 +1692,12 @@ interface ListTableOptions<RecordType = Record<string, unknown>> {
|
|
|
1552
1692
|
summaryRowHeight?: number;
|
|
1553
1693
|
overscanRowCount?: number;
|
|
1554
1694
|
query?: ListTableQueryOptions<RecordType>;
|
|
1695
|
+
/**
|
|
1696
|
+
* 是否展示最左侧的空白行选择器列。
|
|
1697
|
+
* 传入对象时可配置列宽,默认宽度为 `12px`。
|
|
1698
|
+
* @default false
|
|
1699
|
+
*/
|
|
1700
|
+
rowSelector?: boolean | ListTableRowSelectorOptions;
|
|
1555
1701
|
rowSelection?: ListTableRowSelectionOptions<RecordType>;
|
|
1556
1702
|
expandable?: ListTableExpandableOptions<RecordType>;
|
|
1557
1703
|
pagination?: false | ListTablePaginationOptions;
|
|
@@ -1696,4 +1842,4 @@ interface ListTableValidationTarget {
|
|
|
1696
1842
|
columnKey: string;
|
|
1697
1843
|
}
|
|
1698
1844
|
|
|
1699
|
-
export { type CreateCellEditorSessionParams, type DebugHitTestResult, type FilterPanelConfig, type FilterPanelOptionItem, type FilterPanelTexts, type FixedPopupConfig, type HeaderContextMenuColumnItem, type HeaderContextMenuConfig, type HeaderContextMenuDensity, ListTable, type ListTableAutoMergeRule, type ListTableBarcodeCellContent, type ListTableBarcodeFormat, type ListTableButtonCellContent, type ListTableButtonPopconfirmOptions, type ListTableButtonSize, type ListTableButtonType, type ListTableCarouselScrollOptions, type ListTableCellContent, type ListTableCellContentClickContext, type ListTableCellEditorSession, type ListTableCellSpan, type ListTableCellStyle, type ListTableChartCellContent, type ListTableChartSize, type ListTableChartType, type ListTableColorCellContent, type ListTableColumn, type ListTableContextMenuFeature, type ListTableContextMenuOptions, type ListTableCustomChartCellContent, type ListTableDangerConfirmRequest, type ListTableDataFormatType, type ListTableDebugOptions, type ListTableDebugSnapshot, 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 ListTableExportXlsxOptions, 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 ListTableHeaderContextMenuAdapter, type ListTableHighlightMode, type ListTableHorizontalAlign, type ListTableIconCellContent, type ListTableImageCellContent, type ListTableImageObjectFit, type ListTableImagePreviewRequest, type ListTableLoadingAdapter, type ListTableLoadingRequest, type ListTableMergeCellOptions, type ListTableNestedTableCellContent, type ListTableNestedTableColumn, type ListTableOptions, type ListTablePaginationAdapter, type ListTablePaginationOptions, type ListTableProgressCellContent, type ListTableProgressShape, type ListTableProgressSize, type ListTableQrCodeCellContent, type ListTableQrCodeLevel, type ListTableQueryChange, type ListTableQueryChangeExtra, type ListTableQueryFilters, type ListTableQueryOptions, type ListTableQueryPagination, type ListTableQuerySorter, type ListTableRateCellContent, type ListTableRateSize, type ListTableRowDragMode, type ListTableRowDragOptions, type ListTableRowDragPayload, type ListTableRowDragSourceInfo, type ListTableRowDragZone, type ListTableRowEventProps, type ListTableRowSelectionChangeInfo, type ListTableRowSelectionOptions, type ListTableScrollToOptions, type ListTableScrollbarOptions, type ListTableSelectionState, type ListTableSortItem, type ListTableSortState, type ListTableSparklineChartCellContent, type ListTableSparklineSize, type ListTableSymbolType, type ListTableTagCellContent, type ListTableTheme, type ListTableTooltipAdapter, type ListTableTooltipRequest, type ListTableUiOptions, type ListTableValidationError, type ListTableValidationErrorField, type ListTableValidationFailure, type ListTableValidationTarget, type PaginationConfig, type RenderCellDescriptor };
|
|
1845
|
+
export { type CreateCellEditorSessionParams, type DebugHitTestResult, type FilterPanelConfig, type FilterPanelOptionItem, type FilterPanelTexts, type FixedPopupConfig, type HeaderContextMenuColumnItem, type HeaderContextMenuConfig, type HeaderContextMenuDensity, ListTable, type ListTableAutoMergeRule, type ListTableBarcodeCellContent, type ListTableBarcodeFormat, type ListTableButtonCellContent, type ListTableButtonPopconfirmOptions, type ListTableButtonSize, type ListTableButtonType, type ListTableCarouselScrollOptions, type ListTableCellContent, type ListTableCellContentClickContext, type ListTableCellEditorSession, type ListTableCellSpan, type ListTableCellStyle, type ListTableChartCellContent, type ListTableChartSize, type ListTableChartType, type ListTableColorCellContent, type ListTableColumn, type ListTableContextMenuFeature, type ListTableContextMenuOptions, type ListTableCustomChartCellContent, type ListTableDangerConfirmRequest, type ListTableDataFormat, type ListTableDataFormatOptions, type ListTableDataFormatType, type ListTableDebugOptions, type ListTableDebugSnapshot, 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 ListTableExportXlsxOptions, 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 ListTableGroupingOptions, type ListTableHeaderContextMenuAdapter, type ListTableHighlightMode, type ListTableHorizontalAlign, type ListTableIconCellContent, type ListTableImageCellContent, type ListTableImageObjectFit, type ListTableImagePreviewRequest, type ListTableLoadingAdapter, type ListTableLoadingRequest, type ListTableMergeCellOptions, type ListTableNestedTableCellContent, type ListTableNestedTableColumn, type ListTableOptions, type ListTablePaginationAdapter, type ListTablePaginationOptions, type ListTablePerformanceMetric, type ListTableProgressCellContent, type ListTableProgressShape, type ListTableProgressSize, type ListTableQrCodeCellContent, type ListTableQrCodeLevel, type ListTableQueryChange, type ListTableQueryChangeExtra, type ListTableQueryFilters, type ListTableQueryOptions, type ListTableQueryPagination, type ListTableQuerySorter, type ListTableRateCellContent, type ListTableRateSize, type ListTableRowDragMode, type ListTableRowDragOptions, type ListTableRowDragPayload, type ListTableRowDragSourceInfo, type ListTableRowDragZone, type ListTableRowEventProps, type ListTableRowSelectionChangeInfo, type ListTableRowSelectionOptions, type ListTableRowSelectorOptions, type ListTableScrollToOptions, type ListTableScrollbarOptions, type ListTableSearchRequest, type ListTableSelectionState, type ListTableSortItem, type ListTableSortState, type ListTableSparklineChartCellContent, type ListTableSparklineSize, type ListTableSummaryConfig, type ListTableSummaryRoundingMode, type ListTableSummaryType, type ListTableSymbolType, type ListTableTagCellContent, type ListTableTheme, type ListTableTooltipAdapter, type ListTableTooltipRequest, type ListTableUiOptions, type ListTableValidationError, type ListTableValidationErrorField, type ListTableValidationFailure, type ListTableValidationTarget, type PaginationConfig, type RenderCellDescriptor };
|
package/dist/index.d.ts
CHANGED
|
@@ -58,6 +58,28 @@ type ListTableFilterState = Record<string, ListTableFilterValue$1>;
|
|
|
58
58
|
interface ListTableSelectionState {
|
|
59
59
|
rowIndex: number | null;
|
|
60
60
|
columnKey: string | null;
|
|
61
|
+
/** 当前活动单元格内模拟的文本选区。 */
|
|
62
|
+
textSelection?: ListTableTextSelectionState | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Canvas 文本选区状态。
|
|
66
|
+
*/
|
|
67
|
+
interface ListTableTextSelectionState {
|
|
68
|
+
fragments: ListTableTextSelectionFragment[];
|
|
69
|
+
anchorFragmentIndex: number;
|
|
70
|
+
focusFragmentIndex: number;
|
|
71
|
+
anchorOffset: number;
|
|
72
|
+
focusOffset: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 单元格内一个可选择的可视文本片段。
|
|
76
|
+
*/
|
|
77
|
+
interface ListTableTextSelectionFragment {
|
|
78
|
+
rowIndex?: number;
|
|
79
|
+
columnKey?: string;
|
|
80
|
+
contentIndex: number;
|
|
81
|
+
fragmentKey: string;
|
|
82
|
+
text: string;
|
|
61
83
|
}
|
|
62
84
|
/**
|
|
63
85
|
* 表头 action 显隐状态。
|
|
@@ -82,6 +104,26 @@ interface ListTableDebugOptions {
|
|
|
82
104
|
showHeaderActionOverlay?: boolean;
|
|
83
105
|
logDrawCalls?: boolean;
|
|
84
106
|
logStateChanges?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* 性能阶段埋点回调。仅在配置后执行,不影响默认渲染路径。
|
|
109
|
+
*/
|
|
110
|
+
onPerformance?: (metric: ListTablePerformanceMetric) => void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* 列表表格性能阶段指标。
|
|
114
|
+
*/
|
|
115
|
+
interface ListTablePerformanceMetric {
|
|
116
|
+
phase: "grouping" | "snapshot" | "render";
|
|
117
|
+
durationMs: number;
|
|
118
|
+
inputRowCount: number;
|
|
119
|
+
outputRowCount: number;
|
|
120
|
+
cacheHit?: boolean;
|
|
121
|
+
groupedRowCount?: number;
|
|
122
|
+
scrollOnly?: boolean;
|
|
123
|
+
batchCount?: number;
|
|
124
|
+
indexNodeCount?: number;
|
|
125
|
+
cancelledCount?: number;
|
|
126
|
+
status?: "ready" | "cancelled" | "error";
|
|
85
127
|
}
|
|
86
128
|
/**
|
|
87
129
|
* 查询回调扩展参数。
|
|
@@ -110,7 +152,7 @@ interface Rect {
|
|
|
110
152
|
* 命中结果。
|
|
111
153
|
*/
|
|
112
154
|
interface DebugHitTestResult {
|
|
113
|
-
area: "header" | "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";
|
|
155
|
+
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";
|
|
114
156
|
scrollbarRole?: "thumb" | "track" | "decrease-button" | "increase-button";
|
|
115
157
|
columnKey?: string;
|
|
116
158
|
rowIndex?: number;
|
|
@@ -128,6 +170,13 @@ interface DebugHitTestResult {
|
|
|
128
170
|
rect?: Rect;
|
|
129
171
|
tooltipText?: string;
|
|
130
172
|
tooltipVariant?: "default" | "error";
|
|
173
|
+
textSelectionText?: string;
|
|
174
|
+
textSelectionFont?: string;
|
|
175
|
+
textSelectionFragmentKey?: string;
|
|
176
|
+
textSelectionOriginX?: number;
|
|
177
|
+
/** 表头文本所属层级,用于跨层拖选时区分行。 */
|
|
178
|
+
textSelectionRowIndex?: number;
|
|
179
|
+
textSelectionRect?: Rect;
|
|
131
180
|
}
|
|
132
181
|
/**
|
|
133
182
|
* action 类型。
|
|
@@ -137,7 +186,7 @@ type HeaderActionType = "sort" | "filter" | "fixed";
|
|
|
137
186
|
* 渲染矩形描述。
|
|
138
187
|
*/
|
|
139
188
|
interface RenderCellDescriptor {
|
|
140
|
-
kind: "header" | "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";
|
|
189
|
+
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";
|
|
141
190
|
rect: Rect;
|
|
142
191
|
columnKey?: string;
|
|
143
192
|
rowIndex?: number;
|
|
@@ -153,6 +202,17 @@ interface RenderCellDescriptor {
|
|
|
153
202
|
cursor?: string;
|
|
154
203
|
tooltipText?: string;
|
|
155
204
|
tooltipVariant?: "default" | "error";
|
|
205
|
+
/** 可参与 Canvas 文本选择的实际绘制文本。 */
|
|
206
|
+
textSelectionText?: string;
|
|
207
|
+
/** 文本命中时使用的 Canvas 字体。 */
|
|
208
|
+
textSelectionFont?: string;
|
|
209
|
+
/** 同一单元格内文本布局片段的稳定标识。 */
|
|
210
|
+
textSelectionFragmentKey?: string;
|
|
211
|
+
/** 文本未裁剪前的绘制起点。 */
|
|
212
|
+
textSelectionOriginX?: number;
|
|
213
|
+
/** 表头文本所属层级,用于跨层拖选时区分行。 */
|
|
214
|
+
textSelectionRowIndex?: number;
|
|
215
|
+
textSelectionRect?: Rect;
|
|
156
216
|
actionType?: HeaderActionType;
|
|
157
217
|
scrollbarRole?: "thumb" | "track" | "decrease-button" | "increase-button";
|
|
158
218
|
visibilityState?: HeaderActionVisibilityState;
|
|
@@ -213,6 +273,7 @@ interface ListTableTheme {
|
|
|
213
273
|
frozenRowBackgroundColor: string;
|
|
214
274
|
hoverBackgroundColor: string;
|
|
215
275
|
selectionBackgroundColor: string;
|
|
276
|
+
textSelectionBackgroundColor?: string;
|
|
216
277
|
emptyBackgroundColor: string;
|
|
217
278
|
emptyTextColor: string;
|
|
218
279
|
debugStrokeColor: string;
|
|
@@ -234,8 +295,25 @@ interface ListTableTheme {
|
|
|
234
295
|
* - `max`:取当前列最大值
|
|
235
296
|
*/
|
|
236
297
|
type ListTableSummaryType = "sum" | "avg" | "count" | "unionCount" | "rowCount" | "mergedRowCount" | "min" | "max";
|
|
298
|
+
/** 汇总结果的小数取整方式。 */
|
|
299
|
+
type ListTableSummaryRoundingMode = "round" | "floor" | "ceil" | "truncate";
|
|
237
300
|
type ListTableHorizontalAlign = "left" | "center" | "right";
|
|
238
|
-
type ListTableDataFormatType = "default" | "number" | "thousands" | "money";
|
|
301
|
+
type ListTableDataFormatType = "default" | "text" | "number" | "thousands" | "decimal" | "percent" | "percentDecimal" | "scientific" | "numberToChineseUpper" | "chineseUpperToNumber" | "cny" | "cnyDecimal" | "usd" | "usdDecimal" | "dateSlash" | "dateDash" | "dateFullCN" | "dateYearMonthCN" | "dateMonthDayCN" | "dateSlashWeek" | "dateDashWeek" | "dateWeekdayCNFull" | "dateWeekdayCNShort" | "time" | "timeShort" | "time12" | "time12Seconds" | "timeMillisecond" | "time12Millisecond" | "timeChineseHour" | "timeChineseSecond" | "time12ChineseHour" | "time12ChineseSecond" | "datetime" | "datetime12" | "datetime12Seconds" | "custom" | "money";
|
|
302
|
+
/** 可持久化的数据显示格式配置。 */
|
|
303
|
+
interface ListTableDataFormatOptions {
|
|
304
|
+
/** 基础格式类型。 */
|
|
305
|
+
type: ListTableDataFormatType;
|
|
306
|
+
/** 小数位数,支持 0 到 20。 */
|
|
307
|
+
decimalPlaces?: number;
|
|
308
|
+
/** 是否显示千分位分隔符。 */
|
|
309
|
+
useGrouping?: boolean;
|
|
310
|
+
/** 货币符号。 */
|
|
311
|
+
symbol?: string;
|
|
312
|
+
/** 日期、时间或自定义格式模式。 */
|
|
313
|
+
pattern?: string;
|
|
314
|
+
}
|
|
315
|
+
/** 数据显示格式,字符串用于快捷格式,对象用于精确格式配置。 */
|
|
316
|
+
type ListTableDataFormat = ListTableDataFormatType | ListTableDataFormatOptions;
|
|
239
317
|
type ListTableFilterOptionValue = string | number | null;
|
|
240
318
|
interface ListTableFilterOption {
|
|
241
319
|
label: string;
|
|
@@ -251,8 +329,12 @@ interface ListTableSummaryConfig<RecordType = Record<string, unknown>> {
|
|
|
251
329
|
valueGetter?: (record: RecordType) => string | number | null | undefined;
|
|
252
330
|
/** 值格式化函数。 */
|
|
253
331
|
formatter?: (value: string | number, records: RecordType[], column: ListTableColumn<RecordType>) => string;
|
|
254
|
-
/**
|
|
332
|
+
/** 小数精度,不传则整数不保留小数、非整数保留两位。 */
|
|
255
333
|
precision?: number;
|
|
334
|
+
/** 小数取整方式,默认四舍五入。 */
|
|
335
|
+
roundingMode?: ListTableSummaryRoundingMode;
|
|
336
|
+
/** 是否保留精度补齐产生的无效零,默认不保留。 */
|
|
337
|
+
preserveTrailingZeros?: boolean;
|
|
256
338
|
}
|
|
257
339
|
/**
|
|
258
340
|
* 路径索引定义。
|
|
@@ -329,7 +411,7 @@ type ListTableFormRules<RecordType = Record<string, unknown>> = ListTableFormRul
|
|
|
329
411
|
* 单元格内容片段样式。
|
|
330
412
|
*/
|
|
331
413
|
interface ListTableContentStyle {
|
|
332
|
-
display?: "block" | "inline-block";
|
|
414
|
+
display?: "none" | "block" | "inline-block";
|
|
333
415
|
textAlign?: CanvasTextAlign;
|
|
334
416
|
fontSize?: number;
|
|
335
417
|
fontWeight?: string;
|
|
@@ -348,6 +430,8 @@ interface ListTableContentStyle {
|
|
|
348
430
|
*/
|
|
349
431
|
interface ListTableBaseCellContent<RecordType = any> {
|
|
350
432
|
key?: string;
|
|
433
|
+
/** 是否展示内容,默认展示。 */
|
|
434
|
+
visible?: boolean;
|
|
351
435
|
style?: ListTableContentStyle;
|
|
352
436
|
cursor?: string;
|
|
353
437
|
onClick?: (context: ListTableCellContentClickContext<RecordType>) => void;
|
|
@@ -777,7 +861,7 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
777
861
|
/** 金额单元格格式配置,仅在 `cellType: "money"` 时生效。 */
|
|
778
862
|
moneyFormat?: ListTableMoneyFormatOptions;
|
|
779
863
|
/** 通过列设置覆盖的数据显示格式。 */
|
|
780
|
-
dataFormat?:
|
|
864
|
+
dataFormat?: ListTableDataFormat;
|
|
781
865
|
headerStyle?: ListTableCellStyle;
|
|
782
866
|
/** 汇总行配置。设为 `true` 等效于 `{ type: "sum" }`。 */
|
|
783
867
|
summary?: boolean | ListTableSummaryConfig<RecordType>;
|
|
@@ -917,6 +1001,7 @@ interface HeaderContextMenuConfig {
|
|
|
917
1001
|
onCopyRowText?: () => void;
|
|
918
1002
|
onCopyRowJson?: () => void;
|
|
919
1003
|
onCopySelection?: () => void;
|
|
1004
|
+
onOpenSearch?: () => void;
|
|
920
1005
|
customSelection?: {
|
|
921
1006
|
startRow: number;
|
|
922
1007
|
startColumn: number;
|
|
@@ -948,7 +1033,21 @@ interface HeaderContextMenuConfig {
|
|
|
948
1033
|
onUnfreezeRow?: () => void;
|
|
949
1034
|
onResetFilter?: () => void;
|
|
950
1035
|
onResetSort?: () => void;
|
|
1036
|
+
onSortAscend?: () => void;
|
|
1037
|
+
onSortDescend?: () => void;
|
|
1038
|
+
onClearSort?: () => void;
|
|
1039
|
+
onFixLeft?: () => void;
|
|
1040
|
+
onFixRight?: () => void;
|
|
1041
|
+
onUnfix?: () => void;
|
|
951
1042
|
onResetHeader?: () => void;
|
|
1043
|
+
onResetGrouping?: () => void;
|
|
1044
|
+
onResetSummary?: () => void;
|
|
1045
|
+
onResetAlignment?: () => void;
|
|
1046
|
+
onResetDataFormat?: () => void;
|
|
1047
|
+
onAutoFitCurrentColumn?: () => void;
|
|
1048
|
+
onAutoFitAllColumns?: () => void;
|
|
1049
|
+
groupingBarVisible?: boolean;
|
|
1050
|
+
onToggleGroupingBar?: () => void;
|
|
952
1051
|
onChangeDensity?: (density: HeaderContextMenuDensity) => void;
|
|
953
1052
|
/**
|
|
954
1053
|
* 调整表格缩放。
|
|
@@ -962,15 +1061,28 @@ interface HeaderContextMenuConfig {
|
|
|
962
1061
|
bodyVertical: "top" | "middle" | "bottom";
|
|
963
1062
|
};
|
|
964
1063
|
onChangeAlignment?: (area: "header" | "body", axis: "horizontal" | "vertical", value: ListTableHorizontalAlign | "top" | "middle" | "bottom") => void;
|
|
965
|
-
dataFormat?:
|
|
966
|
-
onChangeDataFormat?: (dataFormat:
|
|
1064
|
+
dataFormat?: ListTableDataFormat;
|
|
1065
|
+
onChangeDataFormat?: (dataFormat: ListTableDataFormat) => void;
|
|
967
1066
|
summaryVisible?: boolean;
|
|
968
1067
|
summaryColumnKey?: string;
|
|
969
1068
|
summaryType?: ListTableSummaryType;
|
|
970
1069
|
summaryPrecision?: number;
|
|
1070
|
+
summaryRoundingMode?: ListTableSummaryRoundingMode;
|
|
1071
|
+
summaryPreserveTrailingZeros?: boolean;
|
|
971
1072
|
onToggleSummary?: () => void;
|
|
972
1073
|
onChangeSummaryType?: (type: ListTableSummaryType) => void;
|
|
973
1074
|
onChangeSummaryPrecision?: (precision: number | undefined) => void;
|
|
1075
|
+
onChangeSummaryRoundingMode?: (mode: ListTableSummaryRoundingMode) => void;
|
|
1076
|
+
onChangeSummaryPreserveTrailingZeros?: (value: boolean) => void;
|
|
1077
|
+
onClose: () => void;
|
|
1078
|
+
}
|
|
1079
|
+
interface ListTableSearchRequest {
|
|
1080
|
+
keyword: string;
|
|
1081
|
+
matchCount: number;
|
|
1082
|
+
currentIndex: number;
|
|
1083
|
+
/** 提交关键词并重新计算匹配项。 */
|
|
1084
|
+
onSubmit: (keyword: string) => void;
|
|
1085
|
+
onNavigate: (direction: "previous" | "next") => void;
|
|
974
1086
|
onClose: () => void;
|
|
975
1087
|
}
|
|
976
1088
|
interface PaginationConfig {
|
|
@@ -1259,7 +1371,18 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
|
|
|
1259
1371
|
/**
|
|
1260
1372
|
* 右键菜单功能项。
|
|
1261
1373
|
*/
|
|
1262
|
-
type ListTableContextMenuFeature = "copy" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "density" | "zoom" | "alignment" | "dataFormat" | "columnVisibility";
|
|
1374
|
+
type ListTableContextMenuFeature = "copy" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "grouping" | "columnVisibility";
|
|
1375
|
+
/**
|
|
1376
|
+
* 数据分组配置。
|
|
1377
|
+
*/
|
|
1378
|
+
interface ListTableGroupingOptions {
|
|
1379
|
+
/** 是否初始显示顶部的分组栏,默认 false。 */
|
|
1380
|
+
visible?: boolean;
|
|
1381
|
+
/** 初始分组列 key,顺序表示分组层级。 */
|
|
1382
|
+
columnKeys?: string[];
|
|
1383
|
+
/** 分组列变化回调。 */
|
|
1384
|
+
onChange?: (columnKeys: string[]) => void;
|
|
1385
|
+
}
|
|
1263
1386
|
/**
|
|
1264
1387
|
* 右键菜单配置。
|
|
1265
1388
|
*/
|
|
@@ -1432,7 +1555,7 @@ interface ListTableRowSelectionOptions<RecordType> {
|
|
|
1432
1555
|
/**
|
|
1433
1556
|
* 点击普通表体区域时是否切换当前行选择状态。
|
|
1434
1557
|
*
|
|
1435
|
-
* @default
|
|
1558
|
+
* @default true
|
|
1436
1559
|
*/
|
|
1437
1560
|
selectRowByClick?: boolean;
|
|
1438
1561
|
selectedRowKeys?: Array<string | number>;
|
|
@@ -1494,9 +1617,23 @@ interface ListTableUiOptions {
|
|
|
1494
1617
|
onFilterPanelRequest?: (request: FilterPanelConfig | null) => void;
|
|
1495
1618
|
onFixedPopupRequest?: (request: FixedPopupConfig | null) => void;
|
|
1496
1619
|
onHeaderContextMenuRequest?: (request: HeaderContextMenuConfig | null) => void;
|
|
1620
|
+
onSearchRequest?: (request: ListTableSearchRequest | null) => void;
|
|
1497
1621
|
onImagePreviewRequest?: (request: ListTableImagePreviewRequest | null) => void;
|
|
1498
1622
|
onDangerConfirmRequest?: (request: ListTableDangerConfirmRequest | null) => void;
|
|
1499
1623
|
}
|
|
1624
|
+
/**
|
|
1625
|
+
* 行选择器配置。
|
|
1626
|
+
*
|
|
1627
|
+
* 行选择器是位于表格最左侧的空白系统列,仅用于快速选中整行,
|
|
1628
|
+
* 不参与 checkbox/radio 行数据选择。
|
|
1629
|
+
*/
|
|
1630
|
+
interface ListTableRowSelectorOptions {
|
|
1631
|
+
/**
|
|
1632
|
+
* 选择器列宽度。
|
|
1633
|
+
* @default 12
|
|
1634
|
+
*/
|
|
1635
|
+
width?: number;
|
|
1636
|
+
}
|
|
1500
1637
|
interface ListTableImagePreviewRequest {
|
|
1501
1638
|
src: string;
|
|
1502
1639
|
alt?: string;
|
|
@@ -1519,6 +1656,9 @@ interface ListTableOptions<RecordType = Record<string, unknown>> {
|
|
|
1519
1656
|
height?: number | string;
|
|
1520
1657
|
columns: ListTableColumn<RecordType>[];
|
|
1521
1658
|
dataSource: RecordType[];
|
|
1659
|
+
/** 顶部分组栏与数据分组配置。 */
|
|
1660
|
+
/** 数据分组配置;不传时不启用分组功能。 */
|
|
1661
|
+
grouping?: ListTableGroupingOptions;
|
|
1522
1662
|
/** AntD Table 风格的行事件配置。 */
|
|
1523
1663
|
onRow?: (record: RecordType, rowIndex: number) => ListTableRowEventProps | null | undefined;
|
|
1524
1664
|
emptyText?: string;
|
|
@@ -1552,6 +1692,12 @@ interface ListTableOptions<RecordType = Record<string, unknown>> {
|
|
|
1552
1692
|
summaryRowHeight?: number;
|
|
1553
1693
|
overscanRowCount?: number;
|
|
1554
1694
|
query?: ListTableQueryOptions<RecordType>;
|
|
1695
|
+
/**
|
|
1696
|
+
* 是否展示最左侧的空白行选择器列。
|
|
1697
|
+
* 传入对象时可配置列宽,默认宽度为 `12px`。
|
|
1698
|
+
* @default false
|
|
1699
|
+
*/
|
|
1700
|
+
rowSelector?: boolean | ListTableRowSelectorOptions;
|
|
1555
1701
|
rowSelection?: ListTableRowSelectionOptions<RecordType>;
|
|
1556
1702
|
expandable?: ListTableExpandableOptions<RecordType>;
|
|
1557
1703
|
pagination?: false | ListTablePaginationOptions;
|
|
@@ -1696,4 +1842,4 @@ interface ListTableValidationTarget {
|
|
|
1696
1842
|
columnKey: string;
|
|
1697
1843
|
}
|
|
1698
1844
|
|
|
1699
|
-
export { type CreateCellEditorSessionParams, type DebugHitTestResult, type FilterPanelConfig, type FilterPanelOptionItem, type FilterPanelTexts, type FixedPopupConfig, type HeaderContextMenuColumnItem, type HeaderContextMenuConfig, type HeaderContextMenuDensity, ListTable, type ListTableAutoMergeRule, type ListTableBarcodeCellContent, type ListTableBarcodeFormat, type ListTableButtonCellContent, type ListTableButtonPopconfirmOptions, type ListTableButtonSize, type ListTableButtonType, type ListTableCarouselScrollOptions, type ListTableCellContent, type ListTableCellContentClickContext, type ListTableCellEditorSession, type ListTableCellSpan, type ListTableCellStyle, type ListTableChartCellContent, type ListTableChartSize, type ListTableChartType, type ListTableColorCellContent, type ListTableColumn, type ListTableContextMenuFeature, type ListTableContextMenuOptions, type ListTableCustomChartCellContent, type ListTableDangerConfirmRequest, type ListTableDataFormatType, type ListTableDebugOptions, type ListTableDebugSnapshot, 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 ListTableExportXlsxOptions, 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 ListTableHeaderContextMenuAdapter, type ListTableHighlightMode, type ListTableHorizontalAlign, type ListTableIconCellContent, type ListTableImageCellContent, type ListTableImageObjectFit, type ListTableImagePreviewRequest, type ListTableLoadingAdapter, type ListTableLoadingRequest, type ListTableMergeCellOptions, type ListTableNestedTableCellContent, type ListTableNestedTableColumn, type ListTableOptions, type ListTablePaginationAdapter, type ListTablePaginationOptions, type ListTableProgressCellContent, type ListTableProgressShape, type ListTableProgressSize, type ListTableQrCodeCellContent, type ListTableQrCodeLevel, type ListTableQueryChange, type ListTableQueryChangeExtra, type ListTableQueryFilters, type ListTableQueryOptions, type ListTableQueryPagination, type ListTableQuerySorter, type ListTableRateCellContent, type ListTableRateSize, type ListTableRowDragMode, type ListTableRowDragOptions, type ListTableRowDragPayload, type ListTableRowDragSourceInfo, type ListTableRowDragZone, type ListTableRowEventProps, type ListTableRowSelectionChangeInfo, type ListTableRowSelectionOptions, type ListTableScrollToOptions, type ListTableScrollbarOptions, type ListTableSelectionState, type ListTableSortItem, type ListTableSortState, type ListTableSparklineChartCellContent, type ListTableSparklineSize, type ListTableSymbolType, type ListTableTagCellContent, type ListTableTheme, type ListTableTooltipAdapter, type ListTableTooltipRequest, type ListTableUiOptions, type ListTableValidationError, type ListTableValidationErrorField, type ListTableValidationFailure, type ListTableValidationTarget, type PaginationConfig, type RenderCellDescriptor };
|
|
1845
|
+
export { type CreateCellEditorSessionParams, type DebugHitTestResult, type FilterPanelConfig, type FilterPanelOptionItem, type FilterPanelTexts, type FixedPopupConfig, type HeaderContextMenuColumnItem, type HeaderContextMenuConfig, type HeaderContextMenuDensity, ListTable, type ListTableAutoMergeRule, type ListTableBarcodeCellContent, type ListTableBarcodeFormat, type ListTableButtonCellContent, type ListTableButtonPopconfirmOptions, type ListTableButtonSize, type ListTableButtonType, type ListTableCarouselScrollOptions, type ListTableCellContent, type ListTableCellContentClickContext, type ListTableCellEditorSession, type ListTableCellSpan, type ListTableCellStyle, type ListTableChartCellContent, type ListTableChartSize, type ListTableChartType, type ListTableColorCellContent, type ListTableColumn, type ListTableContextMenuFeature, type ListTableContextMenuOptions, type ListTableCustomChartCellContent, type ListTableDangerConfirmRequest, type ListTableDataFormat, type ListTableDataFormatOptions, type ListTableDataFormatType, type ListTableDebugOptions, type ListTableDebugSnapshot, 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 ListTableExportXlsxOptions, 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 ListTableGroupingOptions, type ListTableHeaderContextMenuAdapter, type ListTableHighlightMode, type ListTableHorizontalAlign, type ListTableIconCellContent, type ListTableImageCellContent, type ListTableImageObjectFit, type ListTableImagePreviewRequest, type ListTableLoadingAdapter, type ListTableLoadingRequest, type ListTableMergeCellOptions, type ListTableNestedTableCellContent, type ListTableNestedTableColumn, type ListTableOptions, type ListTablePaginationAdapter, type ListTablePaginationOptions, type ListTablePerformanceMetric, type ListTableProgressCellContent, type ListTableProgressShape, type ListTableProgressSize, type ListTableQrCodeCellContent, type ListTableQrCodeLevel, type ListTableQueryChange, type ListTableQueryChangeExtra, type ListTableQueryFilters, type ListTableQueryOptions, type ListTableQueryPagination, type ListTableQuerySorter, type ListTableRateCellContent, type ListTableRateSize, type ListTableRowDragMode, type ListTableRowDragOptions, type ListTableRowDragPayload, type ListTableRowDragSourceInfo, type ListTableRowDragZone, type ListTableRowEventProps, type ListTableRowSelectionChangeInfo, type ListTableRowSelectionOptions, type ListTableRowSelectorOptions, type ListTableScrollToOptions, type ListTableScrollbarOptions, type ListTableSearchRequest, type ListTableSelectionState, type ListTableSortItem, type ListTableSortState, type ListTableSparklineChartCellContent, type ListTableSparklineSize, type ListTableSummaryConfig, type ListTableSummaryRoundingMode, type ListTableSummaryType, type ListTableSymbolType, type ListTableTagCellContent, type ListTableTheme, type ListTableTooltipAdapter, type ListTableTooltipRequest, type ListTableUiOptions, type ListTableValidationError, type ListTableValidationErrorField, type ListTableValidationFailure, type ListTableValidationTarget, type PaginationConfig, type RenderCellDescriptor };
|