import { ClassValue } from 'classnames/types'; import React, { ReactNode } from 'react'; /** 行render返回的obj接口类型 */ interface ColRenderProps { children: JSX.Element; /** 返回为对象时渲染内容 */ props?: { colSpan?: number; /** 表格内容当前列合并数量 */ className?: ClassValue; /** className */ }; } /** columns 列数据接口类型 */ export interface SpaceBetweenTableColProps { dataIndex?: keyof T; /** 当前列数据索引,key存在时可不设 */ key?: React.Key; /** 用于循环,唯一值,dataIndex唯一时可不设 */ colSpan?: number; /** 表头列合并数量 */ title?: string; /** 列标题 */ className?: ClassValue; /** className */ render?: (text: any, record: T, index: number) => ColRenderProps | ReactNode; /** 内容列渲染函数,支持列合并,暂不支持行合并 */ } export interface SpaceBetweenTableProps { columns: SpaceBetweenTableColProps[]; /** 表头数据 */ data: T[]; /** 内容数据 */ rowKey?: keyof T; /** 列表行key,请保持唯一性,一般取表格data中唯一值项 */ className?: ClassValue; /** class名 */ expandClassName?: ClassValue; /** 展开DIV class名 */ loading?: boolean; /** 表格是否加载中 */ plain?: boolean; /** 是否朴素表格,为ture,则不显示默认斑马线条纹及标题栏背景 */ bordered?: boolean; /** 是否展示外边框和列边框 */ showHeader?: boolean; /** 是否显示表头 */ expandable?: boolean; /** 是否可展开 */ defaultExpandAllRows?: boolean; /** 初始时,是否展开所有行,expandable===true有效 */ expandRowByClick?: boolean; /** 通过点击行来展开子行,expandable===true有效 */ defaultExpandedRowKeys?: number[]; /** 默认展开的行,数组单项为列表数字索引(0|1...),expandable===true有效 */ expandedRowKeys?: number[]; /** 展开的行,控制属性,数组单项为列表数字索引(0|1...),expandable===true有效 */ expandedRowRender?: (record: T) => JSX.Element; /** 行展开时渲染函数,record为当前data数据 */ onExpand?: (currentExpandKey: number) => void; /** 点击展开图标时触发,currentExpandKey为当前展开项数字索引 */ onExpandedRowsChange?: (expandedRowKeys: number[]) => void; /** 展开的行变化时触发,expandedRowKeys为所有展开项数字索引集合 */ emptyImgSrc?: string; /** 空图片地址 */ } export declare const SpaceBetweenTable: ({ columns, data, rowKey, className, expandClassName, loading, plain, bordered, showHeader, expandable, defaultExpandAllRows, expandRowByClick, defaultExpandedRowKeys, expandedRowKeys: controlExpandedRowKeys, expandedRowRender, onExpand, onExpandedRowsChange, emptyImgSrc }: SpaceBetweenTableProps) => JSX.Element; export {};