import { TableProps as RCTableProps } from '@weblif/rc-table'; import { PaginationProps } from 'antd'; import { CSSProperties, Key } from 'react'; import { MenuItemType } from 'rc-menu/lib/interface'; import { Column, RowClassNameParam, RowSelectType, SortDirection } from './type'; export interface InternalTableProps { /** 表格的宽度 */ width: number; /** 表格的高度信息 */ height: number; /** 表格的信息 */ table: RCTableProps['table']; /** 实际表格的内容信息 */ rows: T[]; /** 编辑模式 Cell 表示单元格编辑, Row 表示行编辑 */ mode?: 'cell' | 'row'; /** 是否加载中 */ loading?: boolean; /** 设置行的数据,表示将符合行的数据开启为编辑模式, mode 必须为 `row` 模式 */ rowEditKey?: string[]; /** 数据的唯一Key */ rowKey: string; /** 列信息 */ columns: Column[]; /** 选择配置 */ rowSelection?: RowSelectType; /** 设置行的 className */ rowClassName?: (param: RowClassNameParam) => string; /** 排序字段 */ sortColumns?: SortDirection[]; /** 当前选中的行信息 */ selectedRows?: Key[]; /** 当选中改变行的时候触发的事件 */ onSelectedRowsChange?: (selectedRows: Key[]) => void; /** 表格单击行触发的事件 */ onRowClick?: (row: T) => void; /** 右键行菜单的时候触发的事件 */ onRowContextMenu?: (row: T, e: React.MouseEvent) => void; /** 表格双击行触发的事件 */ onRowDoubleClick?: (row: T) => void; /** 改变表格数据触发的事件 */ onChange?: (rows: T[]) => void; /** 改变表格列信息触发的事件 */ onChangeColumns?: (cols: Column[]) => void; /** 排序字段改变触发的事件 */ onSortColumnsChange?: (change: SortDirection[]) => void; /** 渲染右键菜单 */ contextMenuRender?: (node: T | null) => MenuItemType[]; } export interface TableProps extends Omit, 'width' | 'height' | 'table'> { /** * 设置表格样式信息 */ className?: string; /** * CSSProperties */ style?: CSSProperties; /** * 如果存在,则添加对应的分页信息 */ pagination?: PaginationProps; } declare function Table({ className, style, pagination, ...restProps }: TableProps): JSX.Element; export default Table;