import { ReactNode } from 'react'; import Table from './table'; import { Table as AntTable } from 'antd'; import { ColumnType } from 'antd/lib/table'; import { TableRowSelection as AntTableRowSelection } from 'antd/lib/table/interface'; import { ISummaryConfig as TableISummaryConfig } from './utils/getSummaryData'; import { IEditableConfig } from './table-enhance-cell'; export interface IValidate { /** 需要验证得key, 如果不传,组件会取当前列配置的dataIndex */ dataIndex?: string; /** 提示的列头,如果不传,组件会取当前列配置的title */ title?: string; /** * 验证方式 * required 如果只传入这个key 那么已这个为准 * validate 验证函数 返回一个promise对象 * 也可以传入一个对象,对象有两个key 一个pattern正则 一个message提示信息 */ required?: boolean; validate?: (value: any, record: any, index: any, title: any) => Promise | { pattern: any; message: string; }; /** 当前index位置 */ index?: number; } export interface IColumnType extends ColumnType { /**是否隐藏该列 可以传入一个返回boolean值得函数 */ hideColumn?: boolean | (() => boolean); /**是否增加必填title, 可以传入一个返回boolean值的函数 */ required?: boolean | (() => boolean); /**是否可以编辑 */ editable?: boolean; /**可编辑列配置 */ editableConfig?: IEditableConfig; /** 表格单元格验证逻辑 */ validate?: IValidate; /** 是否添加复制当前列功能 */ showCopy?: boolean; /**表头提示信息 */ headTooltip?: ReactNode; /**日期格式化 */ dateFormat?: string; /**精度 */ precision?: number; /**是否加上千分符 */ thousand?: boolean; /**是否右键显示菜单 */ isMenuShow?: boolean; } export interface IColumnGroupType extends Omit, ''> { children: ColumnsType; } export declare type ISummaryConfig = TableISummaryConfig; export declare type ColumnsTypeProp = IColumnGroupType | IColumnType; export declare type ColumnsType = ColumnsTypeProp[]; export declare type TableRowSelection = AntTableRowSelection; export declare const DIFF_CLASSNAME = "zt-table--diff-row"; export declare const ERROR_TD_CLASSNAME = "zt-error-validate-td"; export declare type ITableComponent = typeof Table & { SELECTION_ALL: typeof AntTable.SELECTION_ALL; SELECTION_INVERT: typeof AntTable.SELECTION_INVERT; SELECTION_NONE: typeof AntTable.SELECTION_NONE; Column: typeof AntTable.Column; ColumnGroup: typeof AntTable.ColumnGroup; Summary: typeof AntTable.Summary; DiffClassName: string; ErrorTdCallName: string; }; declare const TransTable: ITableComponent; export default TransTable;