import * as _canvas_components_list_table from '@canvas-components/list-table'; import { ListTableExportSummarySettings, ListTableOptions, ListTableQueryChange, ListTableExportXlsxOptions, ListTableExternalValidationError, ListTableValidationErrorTarget, ListTableScrollToOptions, ListTable, ListTableColumn, ListTablePaginationOptions, ListTableQueryOptions, ListTableRowSelectionOptions, EXPAND_COLUMN, SELECTION_COLUMN, ROW_SELECTION_COLUMN, ListTableExportNameRequest } from '@canvas-components/list-table'; export { EXPAND_COLUMN, ListTableCSSProperties, ListTableCacheCategory, ListTableCachePreferences, ListTableConditionalFormatCondition, ListTableConditionalFormatRule, ListTableConditionalOperator, ListTableExternalValidationError, ListTablePaginationCSSProperties, ListTablePaginationStyleSlot, ListTablePaginationStyles, ListTableScrollbarCSSProperties, ListTableSorter, ListTableStyles, ListTableValidationErrorTarget, ROW_SELECTION_COLUMN, SELECTION_COLUMN, getListTableStoredPageSize } from '@canvas-components/list-table'; import * as react from 'react'; import { CSSProperties, ReactNode, ForwardedRef, PropsWithChildren } from 'react'; import { BrowserPrintColumn, BrowserPrintPaperSize } from '@canvas-components/print'; import { PrintDesignDocument } from '@canvas-components/print-design'; interface PrintColumn extends BrowserPrintColumn { summaryType?: ListTableExportSummarySettings["type"]; showTypePrefix?: "yes" | "no"; precision?: number; roundingMode?: ListTableExportSummarySettings["roundingMode"]; preserveTrailingZeros?: "yes" | "no"; summaryTitle?: string; } interface PrintSettings { version: 2; presetName?: string; title?: string; subtitle?: string; titleFontSize?: number; subtitleFontSize?: number; columns: PrintColumn[]; selectedKeys: string[]; rowsPerPage: number; rowHeight?: number; autoCalculateRowsPerPage?: boolean; autoCalculateColumnWidths?: boolean; includeSummary?: boolean; summaryPosition?: "every-page" | "last-page"; showPageNumbers?: boolean; pageNumberPosition?: "left" | "center" | "right"; showPrintTime?: boolean; printTimePosition?: "left" | "center" | "right"; pageMargins?: { top: number; right: number; bottom: number; left: number; }; paperSize?: BrowserPrintPaperSize; orientation?: "portrait" | "landscape"; useCellBorders?: boolean; borderColor?: string; textColor?: string; headerBackgroundColor?: string; summaryBackgroundColor?: string; showSectionDividers?: boolean; sectionDividerTopSpacing?: number; sectionDividerBottomSpacing?: number; formItemSpacing?: number; } /** 打印列预设只需指定列键;宽度、对齐和超宽处理均可选。 */ type ReactListTablePrintColumnConfig = Pick & Partial>; /** 打印预设的可配置项;未提供的字段使用打印默认值。 */ type ReactListTablePrintConfig = Partial> & { columns?: readonly ReactListTablePrintColumnConfig[]; selectedKeys?: readonly string[]; }; /** 供 ReactListTable 打印弹窗选择的命名预设。名称应保持唯一。 */ interface ReactListTablePrintPreset { name: string; config: ReactListTablePrintConfig; } interface ReactListTableScrollConfig { x?: number | string | true; y?: number | string; } interface ReactListTableLocale { emptyText?: string; } interface ReactListTableProps> extends Omit, "type" | "ui" | "width" | "height" | "emptyText"> { width?: number | string; height?: number | string; emptyText?: string; scroll?: ReactListTableScrollConfig; locale?: ReactListTableLocale; onChange?: ListTableQueryChange; className?: string; style?: CSSProperties; /** 表格标题栏左侧内容。 */ title?: ReactNode; /** 打印配置弹窗中可选择的命名预设。 */ printPresets?: readonly ReactListTablePrintPreset[]; /** 打印设计器中的只读默认模板,可复制为自定义模板。 */ printTemplates?: readonly PrintDesignDocument[]; /** 直接打印每批物理页数的默认值,开始前可修改。@default 50 */ directPrintPagesPerBatch?: number; /** 标题栏右侧工具配置,传入 false 时隐藏整个标题栏工具区。 */ toolbar?: false | ReactListTableToolbarOptions; } interface ReactListTableToolbarOptions { showRefresh?: boolean; showFullscreen?: boolean; showDensity?: boolean; showColumnSetting?: boolean; /** 列设置弹层宽度,数字值按像素处理。 */ columnSettingWidth?: number | string; /** 列设置标题栏中位于重置按钮前的扩展内容。 */ columnSettingHeaderExtra?: ReactNode; showExport?: boolean; /** 默认导出行为使用的文件名和汇总行配置。 */ exportOptions?: ListTableExportXlsxOptions; onRefresh?: () => void; /** 表格密度变化回调,支持超紧凑、紧凑、中等、宽松和自适应。 */ onDensityChange?: (density: _canvas_components_list_table.ListTableDensity) => void; /** 自定义导出行为;未配置时默认异步导出全量 XLSX 数据。 */ onExport?: () => void; /** 自定义全屏节点,默认使用表格根容器。 */ getFullscreenNode?: () => HTMLElement | null; extra?: ReactNode; } /** * React 表格实例透出方法。 */ interface ReactListTableRef> { validate: () => Promise; setValidationErrors: (errors: ListTableExternalValidationError[]) => void; clearValidationErrors: (targets?: ListTableValidationErrorTarget[]) => void; exportXlsx: (options?: ListTableExportXlsxOptions) => void; scrollTo: (options: ListTableScrollToOptions) => void; getDebugSnapshot: () => ReturnType["getDebugSnapshot"]>; resetSorter: () => void; resetFilter: () => void; /** 设置行勾选并触发 rowSelection.onChange,单选模式仅保留第一个 key。 */ setSelectedRowKeys: (keys: Array) => void; /** 清空行勾选并触发 rowSelection.onChange。 */ clearRowSelection: () => void; /** 人工重试最近一次仍有效的本地查询失败。 */ retryQuery: () => boolean; } /** * antd Table 风格的 props 类型别名。 */ type ReactListTableTableProps> = ReactListTableProps; /** * 单列类型。 */ type ReactListTableColumnType> = ListTableColumn; /** * 列数组类型。 */ type ReactListTableColumnsType> = Array>; /** * 行选择类型别名。 */ type ReactListTableRowSelection> = ListTableRowSelectionOptions; /** * 分页类型别名。 */ type ReactListTablePagination = ListTablePaginationOptions; /** * 查询类型别名。 */ type ReactListTableQuery> = ListTableQueryOptions; /** * ListTable 的 React 宿主组件。 */ declare function ReactListTableInner>(props: ReactListTableProps, ref: ForwardedRef>): react.JSX.Element; interface ReactListTableComponent { >(props: ReactListTableProps & { ref?: ForwardedRef>; }): ReturnType; EXPAND_COLUMN: typeof EXPAND_COLUMN; SELECTION_COLUMN: typeof SELECTION_COLUMN; ROW_SELECTION_COLUMN: typeof ROW_SELECTION_COLUMN; } declare const ReactListTable: ReactListTableComponent; interface ExportDialogRow { key: string; title: string; sortOrder: "default" | "ascend" | "descend"; sortIndex?: number; sortPriority?: number; summaryType: ListTableExportSummarySettings["type"]; showTypePrefix: "yes" | "no"; precision?: number; roundingMode: ListTableExportSummarySettings["roundingMode"]; preserveTrailingZeros: "yes" | "no"; } /** 使用 ReactListTable 承载大量导出列的弹窗。 */ declare function ReactListTableExportNameDialog({ request, onClose, renderTable, storageKey, }: { request: ListTableExportNameRequest; onClose?: () => void; /** 用于隔离不同表格的导出配置缓存。 */ storageKey?: string; renderTable: (props: ReactListTableProps) => ReactNode; }): react.JSX.Element; /** ReactListTable 调试模式上下文属性。 */ interface ReactListTableDebugProviderProps extends PropsWithChildren { enabled: boolean; } /** * 为后代 ReactListTable 统一切换核心调试模式。 * * @param props 上下文属性。 * @returns 调试模式上下文节点。 */ declare function ReactListTableDebugProvider(props: ReactListTableDebugProviderProps): react.JSX.Element; export { ReactListTable, type ReactListTableColumnType, type ReactListTableColumnsType, ReactListTableDebugProvider, type ReactListTableDebugProviderProps, ReactListTableExportNameDialog, type ReactListTableLocale, type ReactListTablePagination, type ReactListTablePrintColumnConfig, type ReactListTablePrintConfig, type ReactListTablePrintPreset, type ReactListTableProps, type ReactListTableQuery, type ReactListTableRef, type ReactListTableRowSelection, type ReactListTableScrollConfig, type ReactListTableTableProps, type ReactListTableToolbarOptions };