@canvas-components/list-table 0.3.21 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +652 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -5
- package/dist/index.d.ts +64 -5
- package/dist/index.js +652 -59
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -827,6 +827,13 @@ interface ListTableIconCellContent<RecordType = any> extends ListTableBaseCellCo
|
|
|
827
827
|
color?: string;
|
|
828
828
|
size?: number;
|
|
829
829
|
}
|
|
830
|
+
/** 单元格 Unicode 表情片段,使用系统彩色表情字体绘制。 */
|
|
831
|
+
interface ListTableEmojiCellContent<RecordType = any> extends ListTableBaseCellContent<RecordType> {
|
|
832
|
+
type: "emoji";
|
|
833
|
+
emoji: string;
|
|
834
|
+
/** 表情字号,默认 20px;`style.fontSize` 优先。 */
|
|
835
|
+
size?: number;
|
|
836
|
+
}
|
|
830
837
|
/**
|
|
831
838
|
* 单元格按钮片段。
|
|
832
839
|
*/
|
|
@@ -989,7 +996,7 @@ interface ListTableNestedTableCellContent<RecordType = any> extends ListTableBas
|
|
|
989
996
|
/**
|
|
990
997
|
* 单元格内容定义。
|
|
991
998
|
*/
|
|
992
|
-
type ListTableCellContent<RecordType = any> = ListTableArrowCellContent<RecordType> | ListTableIconCellContent<RecordType> | ListTableTextCellContent<RecordType> | ListTableMoneyCellContent<RecordType> | ListTableLinkCellContent<RecordType> | ListTableImageCellContent<RecordType> | ListTableProgressCellContent<RecordType> | ListTableTimelineCellContent<RecordType> | ListTableChartCellContent<RecordType> | ListTableRateCellContent<RecordType> | ListTableButtonCellContent<RecordType> | ListTableQrCodeCellContent<RecordType> | ListTableBarcodeCellContent<RecordType> | ListTableColorCellContent<RecordType> | ListTableTagCellContent<RecordType> | ListTableSelectionCellContent<RecordType> | ListTableSwitchCellContent<RecordType> | ListTableNestedTableCellContent<RecordType>;
|
|
999
|
+
type ListTableCellContent<RecordType = any> = ListTableArrowCellContent<RecordType> | ListTableIconCellContent<RecordType> | ListTableEmojiCellContent<RecordType> | ListTableTextCellContent<RecordType> | ListTableMoneyCellContent<RecordType> | ListTableLinkCellContent<RecordType> | ListTableImageCellContent<RecordType> | ListTableProgressCellContent<RecordType> | ListTableTimelineCellContent<RecordType> | ListTableChartCellContent<RecordType> | ListTableRateCellContent<RecordType> | ListTableButtonCellContent<RecordType> | ListTableQrCodeCellContent<RecordType> | ListTableBarcodeCellContent<RecordType> | ListTableColorCellContent<RecordType> | ListTableTagCellContent<RecordType> | ListTableSelectionCellContent<RecordType> | ListTableSwitchCellContent<RecordType> | ListTableNestedTableCellContent<RecordType>;
|
|
993
1000
|
/**
|
|
994
1001
|
* 单元格跨度配置。
|
|
995
1002
|
*
|
|
@@ -1113,6 +1120,10 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1113
1120
|
showExpandIcon?: boolean;
|
|
1114
1121
|
/** 列设置中使用的标题,未传时使用 `title`。 */
|
|
1115
1122
|
settingTitle?: string;
|
|
1123
|
+
/** 列显示菜单中由用户添加的列;代码传入的列不会设置此标记。 */
|
|
1124
|
+
userDefined?: boolean;
|
|
1125
|
+
/** 用户在列显示菜单中修改的标题,用于恢复缓存时覆盖初始标题。 */
|
|
1126
|
+
userTitle?: string;
|
|
1116
1127
|
/** 首次创建表格时是否默认隐藏。显式传入 `hidden` 时以 `hidden` 为准。 */
|
|
1117
1128
|
initialHide?: boolean;
|
|
1118
1129
|
/** 是否不在列设置中展示该列及其子列。 */
|
|
@@ -1146,7 +1157,7 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1146
1157
|
* 用法参考 AntD Table 的 `onCell`。
|
|
1147
1158
|
*/
|
|
1148
1159
|
onCell?: (value: unknown, record: RecordType, rowIndex: number, column: ListTableColumn<RecordType>) => ListTableCellSpan | null | undefined;
|
|
1149
|
-
cellType?: "text" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "custom";
|
|
1160
|
+
cellType?: "text" | "emoji" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "custom";
|
|
1150
1161
|
cellStyle?: ListTableCellStyle;
|
|
1151
1162
|
/** 金额单元格格式配置,仅在 `cellType: "money"` 时生效。 */
|
|
1152
1163
|
moneyFormat?: ListTableMoneyFormatOptions;
|
|
@@ -1166,6 +1177,20 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1166
1177
|
meta?: Record<string, unknown>;
|
|
1167
1178
|
}
|
|
1168
1179
|
|
|
1180
|
+
interface ListTableChartData {
|
|
1181
|
+
labels: string[];
|
|
1182
|
+
series: Array<{
|
|
1183
|
+
name: string;
|
|
1184
|
+
data: number[];
|
|
1185
|
+
}>;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
type ListTableSearchMode = "fuzzy" | "exact" | "wildcard" | "regex";
|
|
1189
|
+
interface ListTableSearchOptions {
|
|
1190
|
+
mode: ListTableSearchMode;
|
|
1191
|
+
caseSensitive: boolean;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1169
1194
|
type ListTableFilterMatchMode = "fuzzy" | "exact";
|
|
1170
1195
|
type ListTableFilterType = "value" | "condition";
|
|
1171
1196
|
type ListTableFilterConditionRelation = "and" | "or";
|
|
@@ -1288,13 +1313,35 @@ interface ListTableExportNameRequest {
|
|
|
1288
1313
|
interface HeaderContextMenuColumnItem {
|
|
1289
1314
|
key: string;
|
|
1290
1315
|
title: string;
|
|
1316
|
+
dataIndex?: string;
|
|
1317
|
+
userDefined?: boolean;
|
|
1318
|
+
width?: number;
|
|
1319
|
+
minWidth?: number;
|
|
1320
|
+
maxWidth?: number;
|
|
1321
|
+
fixed?: "left" | "right";
|
|
1322
|
+
order?: number;
|
|
1323
|
+
siblingCount?: number;
|
|
1291
1324
|
checked: boolean;
|
|
1292
1325
|
indeterminate?: boolean;
|
|
1293
1326
|
disabled?: boolean;
|
|
1294
1327
|
children?: HeaderContextMenuColumnItem[];
|
|
1295
1328
|
}
|
|
1329
|
+
/** 列显示菜单新增或编辑列时提交的字段。 */
|
|
1330
|
+
interface HeaderContextMenuColumnDraft {
|
|
1331
|
+
key?: string;
|
|
1332
|
+
parentKey?: string;
|
|
1333
|
+
title: string;
|
|
1334
|
+
dataIndex?: string;
|
|
1335
|
+
width?: number;
|
|
1336
|
+
minWidth?: number;
|
|
1337
|
+
maxWidth?: number;
|
|
1338
|
+
fixed?: "left" | "right";
|
|
1339
|
+
order?: number;
|
|
1340
|
+
}
|
|
1296
1341
|
type HeaderContextMenuDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
|
|
1297
1342
|
interface HeaderContextMenuConfig {
|
|
1343
|
+
/** 根据当前选区创建图表。 */
|
|
1344
|
+
onCreateChart?: () => ListTableChartData | null;
|
|
1298
1345
|
conditionalFormats?: ListTableConditionalFormatRule[];
|
|
1299
1346
|
cacheConditionalFormats?: boolean;
|
|
1300
1347
|
/** 是否已配置持久化存储标识。 */
|
|
@@ -1303,6 +1350,11 @@ interface HeaderContextMenuConfig {
|
|
|
1303
1350
|
x: number;
|
|
1304
1351
|
y: number;
|
|
1305
1352
|
columns?: HeaderContextMenuColumnItem[];
|
|
1353
|
+
dataIndexOptions?: Array<{
|
|
1354
|
+
value: string;
|
|
1355
|
+
disabled: boolean;
|
|
1356
|
+
label?: string;
|
|
1357
|
+
}>;
|
|
1306
1358
|
density?: HeaderContextMenuDensity;
|
|
1307
1359
|
/**
|
|
1308
1360
|
* 当前表格缩放比例(1 = 100%)。
|
|
@@ -1362,6 +1414,7 @@ interface HeaderContextMenuConfig {
|
|
|
1362
1414
|
onResetDataFormat?: () => void;
|
|
1363
1415
|
onAutoFitCurrentColumn?: () => void;
|
|
1364
1416
|
onAutoFitAllColumns?: () => void;
|
|
1417
|
+
onAutoFitFillContainer?: () => void;
|
|
1365
1418
|
groupingBarVisible?: boolean;
|
|
1366
1419
|
onToggleGroupingBar?: () => void;
|
|
1367
1420
|
onChangeDensity?: (density: HeaderContextMenuDensity) => void;
|
|
@@ -1370,6 +1423,9 @@ interface HeaderContextMenuConfig {
|
|
|
1370
1423
|
*/
|
|
1371
1424
|
onChangeZoom?: (zoom: number) => void;
|
|
1372
1425
|
onToggleColumn?: (columnKey: string, visible: boolean) => void;
|
|
1426
|
+
/** 成功返回 null;失败返回可直接展示的错误提示。 */
|
|
1427
|
+
onSaveColumn?: (draft: HeaderContextMenuColumnDraft) => string | null;
|
|
1428
|
+
onDeleteColumn?: (columnKey: string) => boolean;
|
|
1373
1429
|
cacheColumnSettings?: boolean;
|
|
1374
1430
|
columnSettingsCacheAvailable?: boolean;
|
|
1375
1431
|
onChangeColumnSettingsCache?: (enabled: boolean) => void;
|
|
@@ -1404,10 +1460,13 @@ interface HeaderContextMenuConfig {
|
|
|
1404
1460
|
}
|
|
1405
1461
|
interface ListTableSearchRequest {
|
|
1406
1462
|
keyword: string;
|
|
1463
|
+
mode: ListTableSearchOptions["mode"];
|
|
1464
|
+
caseSensitive: boolean;
|
|
1465
|
+
error: string | null;
|
|
1407
1466
|
matchCount: number;
|
|
1408
1467
|
currentIndex: number;
|
|
1409
1468
|
/** 提交关键词并重新计算匹配项。 */
|
|
1410
|
-
onSubmit: (keyword: string) => void;
|
|
1469
|
+
onSubmit: (keyword: string, options: ListTableSearchOptions) => void;
|
|
1411
1470
|
onNavigate: (direction: "previous" | "next") => void;
|
|
1412
1471
|
onClose: () => void;
|
|
1413
1472
|
}
|
|
@@ -1725,7 +1784,7 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
|
|
|
1725
1784
|
/**
|
|
1726
1785
|
* 右键菜单功能项。
|
|
1727
1786
|
*/
|
|
1728
|
-
type ListTableContextMenuFeature = "copy" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1787
|
+
type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1729
1788
|
/**
|
|
1730
1789
|
* 数据分组配置。
|
|
1731
1790
|
*/
|
|
@@ -2379,4 +2438,4 @@ interface ListTableValidationTarget {
|
|
|
2379
2438
|
columnKey: string;
|
|
2380
2439
|
}
|
|
2381
2440
|
|
|
2382
|
-
export { type CreateCellEditorSessionParams, type DebugHitTestResult, EXPAND_COLUMN, type FilterPanelConfig, type FilterPanelOptionItem, type FilterPanelTexts, type FixedPopupConfig, 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 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 ListTableExperimentalOptions, type ListTableExportNameRequest, 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 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 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 };
|
|
2441
|
+
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 ListTableExportNameRequest, 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 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -827,6 +827,13 @@ interface ListTableIconCellContent<RecordType = any> extends ListTableBaseCellCo
|
|
|
827
827
|
color?: string;
|
|
828
828
|
size?: number;
|
|
829
829
|
}
|
|
830
|
+
/** 单元格 Unicode 表情片段,使用系统彩色表情字体绘制。 */
|
|
831
|
+
interface ListTableEmojiCellContent<RecordType = any> extends ListTableBaseCellContent<RecordType> {
|
|
832
|
+
type: "emoji";
|
|
833
|
+
emoji: string;
|
|
834
|
+
/** 表情字号,默认 20px;`style.fontSize` 优先。 */
|
|
835
|
+
size?: number;
|
|
836
|
+
}
|
|
830
837
|
/**
|
|
831
838
|
* 单元格按钮片段。
|
|
832
839
|
*/
|
|
@@ -989,7 +996,7 @@ interface ListTableNestedTableCellContent<RecordType = any> extends ListTableBas
|
|
|
989
996
|
/**
|
|
990
997
|
* 单元格内容定义。
|
|
991
998
|
*/
|
|
992
|
-
type ListTableCellContent<RecordType = any> = ListTableArrowCellContent<RecordType> | ListTableIconCellContent<RecordType> | ListTableTextCellContent<RecordType> | ListTableMoneyCellContent<RecordType> | ListTableLinkCellContent<RecordType> | ListTableImageCellContent<RecordType> | ListTableProgressCellContent<RecordType> | ListTableTimelineCellContent<RecordType> | ListTableChartCellContent<RecordType> | ListTableRateCellContent<RecordType> | ListTableButtonCellContent<RecordType> | ListTableQrCodeCellContent<RecordType> | ListTableBarcodeCellContent<RecordType> | ListTableColorCellContent<RecordType> | ListTableTagCellContent<RecordType> | ListTableSelectionCellContent<RecordType> | ListTableSwitchCellContent<RecordType> | ListTableNestedTableCellContent<RecordType>;
|
|
999
|
+
type ListTableCellContent<RecordType = any> = ListTableArrowCellContent<RecordType> | ListTableIconCellContent<RecordType> | ListTableEmojiCellContent<RecordType> | ListTableTextCellContent<RecordType> | ListTableMoneyCellContent<RecordType> | ListTableLinkCellContent<RecordType> | ListTableImageCellContent<RecordType> | ListTableProgressCellContent<RecordType> | ListTableTimelineCellContent<RecordType> | ListTableChartCellContent<RecordType> | ListTableRateCellContent<RecordType> | ListTableButtonCellContent<RecordType> | ListTableQrCodeCellContent<RecordType> | ListTableBarcodeCellContent<RecordType> | ListTableColorCellContent<RecordType> | ListTableTagCellContent<RecordType> | ListTableSelectionCellContent<RecordType> | ListTableSwitchCellContent<RecordType> | ListTableNestedTableCellContent<RecordType>;
|
|
993
1000
|
/**
|
|
994
1001
|
* 单元格跨度配置。
|
|
995
1002
|
*
|
|
@@ -1113,6 +1120,10 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1113
1120
|
showExpandIcon?: boolean;
|
|
1114
1121
|
/** 列设置中使用的标题,未传时使用 `title`。 */
|
|
1115
1122
|
settingTitle?: string;
|
|
1123
|
+
/** 列显示菜单中由用户添加的列;代码传入的列不会设置此标记。 */
|
|
1124
|
+
userDefined?: boolean;
|
|
1125
|
+
/** 用户在列显示菜单中修改的标题,用于恢复缓存时覆盖初始标题。 */
|
|
1126
|
+
userTitle?: string;
|
|
1116
1127
|
/** 首次创建表格时是否默认隐藏。显式传入 `hidden` 时以 `hidden` 为准。 */
|
|
1117
1128
|
initialHide?: boolean;
|
|
1118
1129
|
/** 是否不在列设置中展示该列及其子列。 */
|
|
@@ -1146,7 +1157,7 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1146
1157
|
* 用法参考 AntD Table 的 `onCell`。
|
|
1147
1158
|
*/
|
|
1148
1159
|
onCell?: (value: unknown, record: RecordType, rowIndex: number, column: ListTableColumn<RecordType>) => ListTableCellSpan | null | undefined;
|
|
1149
|
-
cellType?: "text" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "custom";
|
|
1160
|
+
cellType?: "text" | "emoji" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "custom";
|
|
1150
1161
|
cellStyle?: ListTableCellStyle;
|
|
1151
1162
|
/** 金额单元格格式配置,仅在 `cellType: "money"` 时生效。 */
|
|
1152
1163
|
moneyFormat?: ListTableMoneyFormatOptions;
|
|
@@ -1166,6 +1177,20 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1166
1177
|
meta?: Record<string, unknown>;
|
|
1167
1178
|
}
|
|
1168
1179
|
|
|
1180
|
+
interface ListTableChartData {
|
|
1181
|
+
labels: string[];
|
|
1182
|
+
series: Array<{
|
|
1183
|
+
name: string;
|
|
1184
|
+
data: number[];
|
|
1185
|
+
}>;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
type ListTableSearchMode = "fuzzy" | "exact" | "wildcard" | "regex";
|
|
1189
|
+
interface ListTableSearchOptions {
|
|
1190
|
+
mode: ListTableSearchMode;
|
|
1191
|
+
caseSensitive: boolean;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1169
1194
|
type ListTableFilterMatchMode = "fuzzy" | "exact";
|
|
1170
1195
|
type ListTableFilterType = "value" | "condition";
|
|
1171
1196
|
type ListTableFilterConditionRelation = "and" | "or";
|
|
@@ -1288,13 +1313,35 @@ interface ListTableExportNameRequest {
|
|
|
1288
1313
|
interface HeaderContextMenuColumnItem {
|
|
1289
1314
|
key: string;
|
|
1290
1315
|
title: string;
|
|
1316
|
+
dataIndex?: string;
|
|
1317
|
+
userDefined?: boolean;
|
|
1318
|
+
width?: number;
|
|
1319
|
+
minWidth?: number;
|
|
1320
|
+
maxWidth?: number;
|
|
1321
|
+
fixed?: "left" | "right";
|
|
1322
|
+
order?: number;
|
|
1323
|
+
siblingCount?: number;
|
|
1291
1324
|
checked: boolean;
|
|
1292
1325
|
indeterminate?: boolean;
|
|
1293
1326
|
disabled?: boolean;
|
|
1294
1327
|
children?: HeaderContextMenuColumnItem[];
|
|
1295
1328
|
}
|
|
1329
|
+
/** 列显示菜单新增或编辑列时提交的字段。 */
|
|
1330
|
+
interface HeaderContextMenuColumnDraft {
|
|
1331
|
+
key?: string;
|
|
1332
|
+
parentKey?: string;
|
|
1333
|
+
title: string;
|
|
1334
|
+
dataIndex?: string;
|
|
1335
|
+
width?: number;
|
|
1336
|
+
minWidth?: number;
|
|
1337
|
+
maxWidth?: number;
|
|
1338
|
+
fixed?: "left" | "right";
|
|
1339
|
+
order?: number;
|
|
1340
|
+
}
|
|
1296
1341
|
type HeaderContextMenuDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
|
|
1297
1342
|
interface HeaderContextMenuConfig {
|
|
1343
|
+
/** 根据当前选区创建图表。 */
|
|
1344
|
+
onCreateChart?: () => ListTableChartData | null;
|
|
1298
1345
|
conditionalFormats?: ListTableConditionalFormatRule[];
|
|
1299
1346
|
cacheConditionalFormats?: boolean;
|
|
1300
1347
|
/** 是否已配置持久化存储标识。 */
|
|
@@ -1303,6 +1350,11 @@ interface HeaderContextMenuConfig {
|
|
|
1303
1350
|
x: number;
|
|
1304
1351
|
y: number;
|
|
1305
1352
|
columns?: HeaderContextMenuColumnItem[];
|
|
1353
|
+
dataIndexOptions?: Array<{
|
|
1354
|
+
value: string;
|
|
1355
|
+
disabled: boolean;
|
|
1356
|
+
label?: string;
|
|
1357
|
+
}>;
|
|
1306
1358
|
density?: HeaderContextMenuDensity;
|
|
1307
1359
|
/**
|
|
1308
1360
|
* 当前表格缩放比例(1 = 100%)。
|
|
@@ -1362,6 +1414,7 @@ interface HeaderContextMenuConfig {
|
|
|
1362
1414
|
onResetDataFormat?: () => void;
|
|
1363
1415
|
onAutoFitCurrentColumn?: () => void;
|
|
1364
1416
|
onAutoFitAllColumns?: () => void;
|
|
1417
|
+
onAutoFitFillContainer?: () => void;
|
|
1365
1418
|
groupingBarVisible?: boolean;
|
|
1366
1419
|
onToggleGroupingBar?: () => void;
|
|
1367
1420
|
onChangeDensity?: (density: HeaderContextMenuDensity) => void;
|
|
@@ -1370,6 +1423,9 @@ interface HeaderContextMenuConfig {
|
|
|
1370
1423
|
*/
|
|
1371
1424
|
onChangeZoom?: (zoom: number) => void;
|
|
1372
1425
|
onToggleColumn?: (columnKey: string, visible: boolean) => void;
|
|
1426
|
+
/** 成功返回 null;失败返回可直接展示的错误提示。 */
|
|
1427
|
+
onSaveColumn?: (draft: HeaderContextMenuColumnDraft) => string | null;
|
|
1428
|
+
onDeleteColumn?: (columnKey: string) => boolean;
|
|
1373
1429
|
cacheColumnSettings?: boolean;
|
|
1374
1430
|
columnSettingsCacheAvailable?: boolean;
|
|
1375
1431
|
onChangeColumnSettingsCache?: (enabled: boolean) => void;
|
|
@@ -1404,10 +1460,13 @@ interface HeaderContextMenuConfig {
|
|
|
1404
1460
|
}
|
|
1405
1461
|
interface ListTableSearchRequest {
|
|
1406
1462
|
keyword: string;
|
|
1463
|
+
mode: ListTableSearchOptions["mode"];
|
|
1464
|
+
caseSensitive: boolean;
|
|
1465
|
+
error: string | null;
|
|
1407
1466
|
matchCount: number;
|
|
1408
1467
|
currentIndex: number;
|
|
1409
1468
|
/** 提交关键词并重新计算匹配项。 */
|
|
1410
|
-
onSubmit: (keyword: string) => void;
|
|
1469
|
+
onSubmit: (keyword: string, options: ListTableSearchOptions) => void;
|
|
1411
1470
|
onNavigate: (direction: "previous" | "next") => void;
|
|
1412
1471
|
onClose: () => void;
|
|
1413
1472
|
}
|
|
@@ -1725,7 +1784,7 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
|
|
|
1725
1784
|
/**
|
|
1726
1785
|
* 右键菜单功能项。
|
|
1727
1786
|
*/
|
|
1728
|
-
type ListTableContextMenuFeature = "copy" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1787
|
+
type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1729
1788
|
/**
|
|
1730
1789
|
* 数据分组配置。
|
|
1731
1790
|
*/
|
|
@@ -2379,4 +2438,4 @@ interface ListTableValidationTarget {
|
|
|
2379
2438
|
columnKey: string;
|
|
2380
2439
|
}
|
|
2381
2440
|
|
|
2382
|
-
export { type CreateCellEditorSessionParams, type DebugHitTestResult, EXPAND_COLUMN, type FilterPanelConfig, type FilterPanelOptionItem, type FilterPanelTexts, type FixedPopupConfig, 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 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 ListTableExperimentalOptions, type ListTableExportNameRequest, 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 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 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 };
|
|
2441
|
+
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 ListTableExportNameRequest, 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 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 };
|