@canvas-components/list-table 0.3.22 → 0.3.24
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 +573 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -5
- package/dist/index.d.ts +65 -5
- package/dist/index.js +573 -53
- 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,10 +1120,16 @@ 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
|
/** 是否不在列设置中展示该列及其子列。 */
|
|
1119
1130
|
hideInSetting?: boolean;
|
|
1131
|
+
/** 是否参与文件导出;操作列默认不导出,可显式覆盖。 */
|
|
1132
|
+
exportable?: boolean;
|
|
1120
1133
|
/** 是否禁止用户通过列设置隐藏该列。 */
|
|
1121
1134
|
disableHide?: boolean;
|
|
1122
1135
|
ellipsis?: boolean;
|
|
@@ -1146,7 +1159,7 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1146
1159
|
* 用法参考 AntD Table 的 `onCell`。
|
|
1147
1160
|
*/
|
|
1148
1161
|
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";
|
|
1162
|
+
cellType?: "text" | "emoji" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "custom";
|
|
1150
1163
|
cellStyle?: ListTableCellStyle;
|
|
1151
1164
|
/** 金额单元格格式配置,仅在 `cellType: "money"` 时生效。 */
|
|
1152
1165
|
moneyFormat?: ListTableMoneyFormatOptions;
|
|
@@ -1166,6 +1179,20 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1166
1179
|
meta?: Record<string, unknown>;
|
|
1167
1180
|
}
|
|
1168
1181
|
|
|
1182
|
+
interface ListTableChartData {
|
|
1183
|
+
labels: string[];
|
|
1184
|
+
series: Array<{
|
|
1185
|
+
name: string;
|
|
1186
|
+
data: number[];
|
|
1187
|
+
}>;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
type ListTableSearchMode = "fuzzy" | "exact" | "wildcard" | "regex";
|
|
1191
|
+
interface ListTableSearchOptions {
|
|
1192
|
+
mode: ListTableSearchMode;
|
|
1193
|
+
caseSensitive: boolean;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1169
1196
|
type ListTableFilterMatchMode = "fuzzy" | "exact";
|
|
1170
1197
|
type ListTableFilterType = "value" | "condition";
|
|
1171
1198
|
type ListTableFilterConditionRelation = "and" | "or";
|
|
@@ -1288,13 +1315,35 @@ interface ListTableExportNameRequest {
|
|
|
1288
1315
|
interface HeaderContextMenuColumnItem {
|
|
1289
1316
|
key: string;
|
|
1290
1317
|
title: string;
|
|
1318
|
+
dataIndex?: string;
|
|
1319
|
+
userDefined?: boolean;
|
|
1320
|
+
width?: number;
|
|
1321
|
+
minWidth?: number;
|
|
1322
|
+
maxWidth?: number;
|
|
1323
|
+
fixed?: "left" | "right";
|
|
1324
|
+
order?: number;
|
|
1325
|
+
siblingCount?: number;
|
|
1291
1326
|
checked: boolean;
|
|
1292
1327
|
indeterminate?: boolean;
|
|
1293
1328
|
disabled?: boolean;
|
|
1294
1329
|
children?: HeaderContextMenuColumnItem[];
|
|
1295
1330
|
}
|
|
1331
|
+
/** 列显示菜单新增或编辑列时提交的字段。 */
|
|
1332
|
+
interface HeaderContextMenuColumnDraft {
|
|
1333
|
+
key?: string;
|
|
1334
|
+
parentKey?: string;
|
|
1335
|
+
title: string;
|
|
1336
|
+
dataIndex?: string;
|
|
1337
|
+
width?: number;
|
|
1338
|
+
minWidth?: number;
|
|
1339
|
+
maxWidth?: number;
|
|
1340
|
+
fixed?: "left" | "right";
|
|
1341
|
+
order?: number;
|
|
1342
|
+
}
|
|
1296
1343
|
type HeaderContextMenuDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
|
|
1297
1344
|
interface HeaderContextMenuConfig {
|
|
1345
|
+
/** 根据当前选区创建图表。 */
|
|
1346
|
+
onCreateChart?: () => ListTableChartData | null;
|
|
1298
1347
|
conditionalFormats?: ListTableConditionalFormatRule[];
|
|
1299
1348
|
cacheConditionalFormats?: boolean;
|
|
1300
1349
|
/** 是否已配置持久化存储标识。 */
|
|
@@ -1303,6 +1352,11 @@ interface HeaderContextMenuConfig {
|
|
|
1303
1352
|
x: number;
|
|
1304
1353
|
y: number;
|
|
1305
1354
|
columns?: HeaderContextMenuColumnItem[];
|
|
1355
|
+
dataIndexOptions?: Array<{
|
|
1356
|
+
value: string;
|
|
1357
|
+
disabled: boolean;
|
|
1358
|
+
label?: string;
|
|
1359
|
+
}>;
|
|
1306
1360
|
density?: HeaderContextMenuDensity;
|
|
1307
1361
|
/**
|
|
1308
1362
|
* 当前表格缩放比例(1 = 100%)。
|
|
@@ -1371,6 +1425,9 @@ interface HeaderContextMenuConfig {
|
|
|
1371
1425
|
*/
|
|
1372
1426
|
onChangeZoom?: (zoom: number) => void;
|
|
1373
1427
|
onToggleColumn?: (columnKey: string, visible: boolean) => void;
|
|
1428
|
+
/** 成功返回 null;失败返回可直接展示的错误提示。 */
|
|
1429
|
+
onSaveColumn?: (draft: HeaderContextMenuColumnDraft) => string | null;
|
|
1430
|
+
onDeleteColumn?: (columnKey: string) => boolean;
|
|
1374
1431
|
cacheColumnSettings?: boolean;
|
|
1375
1432
|
columnSettingsCacheAvailable?: boolean;
|
|
1376
1433
|
onChangeColumnSettingsCache?: (enabled: boolean) => void;
|
|
@@ -1405,10 +1462,13 @@ interface HeaderContextMenuConfig {
|
|
|
1405
1462
|
}
|
|
1406
1463
|
interface ListTableSearchRequest {
|
|
1407
1464
|
keyword: string;
|
|
1465
|
+
mode: ListTableSearchOptions["mode"];
|
|
1466
|
+
caseSensitive: boolean;
|
|
1467
|
+
error: string | null;
|
|
1408
1468
|
matchCount: number;
|
|
1409
1469
|
currentIndex: number;
|
|
1410
1470
|
/** 提交关键词并重新计算匹配项。 */
|
|
1411
|
-
onSubmit: (keyword: string) => void;
|
|
1471
|
+
onSubmit: (keyword: string, options: ListTableSearchOptions) => void;
|
|
1412
1472
|
onNavigate: (direction: "previous" | "next") => void;
|
|
1413
1473
|
onClose: () => void;
|
|
1414
1474
|
}
|
|
@@ -1726,7 +1786,7 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
|
|
|
1726
1786
|
/**
|
|
1727
1787
|
* 右键菜单功能项。
|
|
1728
1788
|
*/
|
|
1729
|
-
type ListTableContextMenuFeature = "copy" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1789
|
+
type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1730
1790
|
/**
|
|
1731
1791
|
* 数据分组配置。
|
|
1732
1792
|
*/
|
|
@@ -2380,4 +2440,4 @@ interface ListTableValidationTarget {
|
|
|
2380
2440
|
columnKey: string;
|
|
2381
2441
|
}
|
|
2382
2442
|
|
|
2383
|
-
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 };
|
|
2443
|
+
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,10 +1120,16 @@ 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
|
/** 是否不在列设置中展示该列及其子列。 */
|
|
1119
1130
|
hideInSetting?: boolean;
|
|
1131
|
+
/** 是否参与文件导出;操作列默认不导出,可显式覆盖。 */
|
|
1132
|
+
exportable?: boolean;
|
|
1120
1133
|
/** 是否禁止用户通过列设置隐藏该列。 */
|
|
1121
1134
|
disableHide?: boolean;
|
|
1122
1135
|
ellipsis?: boolean;
|
|
@@ -1146,7 +1159,7 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1146
1159
|
* 用法参考 AntD Table 的 `onCell`。
|
|
1147
1160
|
*/
|
|
1148
1161
|
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";
|
|
1162
|
+
cellType?: "text" | "emoji" | "money" | "link" | "image" | "qrcode" | "barcode" | "color" | "progress" | "timeline" | "chart" | "rate" | "checkbox" | "radio" | "switch" | "tag" | "button" | "custom";
|
|
1150
1163
|
cellStyle?: ListTableCellStyle;
|
|
1151
1164
|
/** 金额单元格格式配置,仅在 `cellType: "money"` 时生效。 */
|
|
1152
1165
|
moneyFormat?: ListTableMoneyFormatOptions;
|
|
@@ -1166,6 +1179,20 @@ interface ListTableColumn<RecordType = Record<string, unknown>> {
|
|
|
1166
1179
|
meta?: Record<string, unknown>;
|
|
1167
1180
|
}
|
|
1168
1181
|
|
|
1182
|
+
interface ListTableChartData {
|
|
1183
|
+
labels: string[];
|
|
1184
|
+
series: Array<{
|
|
1185
|
+
name: string;
|
|
1186
|
+
data: number[];
|
|
1187
|
+
}>;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
type ListTableSearchMode = "fuzzy" | "exact" | "wildcard" | "regex";
|
|
1191
|
+
interface ListTableSearchOptions {
|
|
1192
|
+
mode: ListTableSearchMode;
|
|
1193
|
+
caseSensitive: boolean;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1169
1196
|
type ListTableFilterMatchMode = "fuzzy" | "exact";
|
|
1170
1197
|
type ListTableFilterType = "value" | "condition";
|
|
1171
1198
|
type ListTableFilterConditionRelation = "and" | "or";
|
|
@@ -1288,13 +1315,35 @@ interface ListTableExportNameRequest {
|
|
|
1288
1315
|
interface HeaderContextMenuColumnItem {
|
|
1289
1316
|
key: string;
|
|
1290
1317
|
title: string;
|
|
1318
|
+
dataIndex?: string;
|
|
1319
|
+
userDefined?: boolean;
|
|
1320
|
+
width?: number;
|
|
1321
|
+
minWidth?: number;
|
|
1322
|
+
maxWidth?: number;
|
|
1323
|
+
fixed?: "left" | "right";
|
|
1324
|
+
order?: number;
|
|
1325
|
+
siblingCount?: number;
|
|
1291
1326
|
checked: boolean;
|
|
1292
1327
|
indeterminate?: boolean;
|
|
1293
1328
|
disabled?: boolean;
|
|
1294
1329
|
children?: HeaderContextMenuColumnItem[];
|
|
1295
1330
|
}
|
|
1331
|
+
/** 列显示菜单新增或编辑列时提交的字段。 */
|
|
1332
|
+
interface HeaderContextMenuColumnDraft {
|
|
1333
|
+
key?: string;
|
|
1334
|
+
parentKey?: string;
|
|
1335
|
+
title: string;
|
|
1336
|
+
dataIndex?: string;
|
|
1337
|
+
width?: number;
|
|
1338
|
+
minWidth?: number;
|
|
1339
|
+
maxWidth?: number;
|
|
1340
|
+
fixed?: "left" | "right";
|
|
1341
|
+
order?: number;
|
|
1342
|
+
}
|
|
1296
1343
|
type HeaderContextMenuDensity = "comfortable" | "middle" | "compact" | "ultra-compact" | "auto";
|
|
1297
1344
|
interface HeaderContextMenuConfig {
|
|
1345
|
+
/** 根据当前选区创建图表。 */
|
|
1346
|
+
onCreateChart?: () => ListTableChartData | null;
|
|
1298
1347
|
conditionalFormats?: ListTableConditionalFormatRule[];
|
|
1299
1348
|
cacheConditionalFormats?: boolean;
|
|
1300
1349
|
/** 是否已配置持久化存储标识。 */
|
|
@@ -1303,6 +1352,11 @@ interface HeaderContextMenuConfig {
|
|
|
1303
1352
|
x: number;
|
|
1304
1353
|
y: number;
|
|
1305
1354
|
columns?: HeaderContextMenuColumnItem[];
|
|
1355
|
+
dataIndexOptions?: Array<{
|
|
1356
|
+
value: string;
|
|
1357
|
+
disabled: boolean;
|
|
1358
|
+
label?: string;
|
|
1359
|
+
}>;
|
|
1306
1360
|
density?: HeaderContextMenuDensity;
|
|
1307
1361
|
/**
|
|
1308
1362
|
* 当前表格缩放比例(1 = 100%)。
|
|
@@ -1371,6 +1425,9 @@ interface HeaderContextMenuConfig {
|
|
|
1371
1425
|
*/
|
|
1372
1426
|
onChangeZoom?: (zoom: number) => void;
|
|
1373
1427
|
onToggleColumn?: (columnKey: string, visible: boolean) => void;
|
|
1428
|
+
/** 成功返回 null;失败返回可直接展示的错误提示。 */
|
|
1429
|
+
onSaveColumn?: (draft: HeaderContextMenuColumnDraft) => string | null;
|
|
1430
|
+
onDeleteColumn?: (columnKey: string) => boolean;
|
|
1374
1431
|
cacheColumnSettings?: boolean;
|
|
1375
1432
|
columnSettingsCacheAvailable?: boolean;
|
|
1376
1433
|
onChangeColumnSettingsCache?: (enabled: boolean) => void;
|
|
@@ -1405,10 +1462,13 @@ interface HeaderContextMenuConfig {
|
|
|
1405
1462
|
}
|
|
1406
1463
|
interface ListTableSearchRequest {
|
|
1407
1464
|
keyword: string;
|
|
1465
|
+
mode: ListTableSearchOptions["mode"];
|
|
1466
|
+
caseSensitive: boolean;
|
|
1467
|
+
error: string | null;
|
|
1408
1468
|
matchCount: number;
|
|
1409
1469
|
currentIndex: number;
|
|
1410
1470
|
/** 提交关键词并重新计算匹配项。 */
|
|
1411
|
-
onSubmit: (keyword: string) => void;
|
|
1471
|
+
onSubmit: (keyword: string, options: ListTableSearchOptions) => void;
|
|
1412
1472
|
onNavigate: (direction: "previous" | "next") => void;
|
|
1413
1473
|
onClose: () => void;
|
|
1414
1474
|
}
|
|
@@ -1726,7 +1786,7 @@ type ListTableHighlightMode = "cell" | "row" | "column" | "cross";
|
|
|
1726
1786
|
/**
|
|
1727
1787
|
* 右键菜单功能项。
|
|
1728
1788
|
*/
|
|
1729
|
-
type ListTableContextMenuFeature = "copy" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1789
|
+
type ListTableContextMenuFeature = "copy" | "chart" | "search" | "export" | "downloadContent" | "rowCollapse" | "columnCollapse" | "freeze" | "reset" | "sort" | "density" | "zoom" | "columnWidth" | "alignment" | "dataFormat" | "conditionalFormat" | "cache" | "grouping" | "columnVisibility";
|
|
1730
1790
|
/**
|
|
1731
1791
|
* 数据分组配置。
|
|
1732
1792
|
*/
|
|
@@ -2380,4 +2440,4 @@ interface ListTableValidationTarget {
|
|
|
2380
2440
|
columnKey: string;
|
|
2381
2441
|
}
|
|
2382
2442
|
|
|
2383
|
-
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 };
|
|
2443
|
+
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 };
|