import React from 'react'; import { ViewProps } from 'remax/one'; import { Props as ShadowProps } from '../shadow'; export type DataSource = T[]; export declare const ColumnType: ({}: Column) => void; export interface Column { /** * 列的title */ title: React.ReactNode; /** * 列的数据索引 */ dataIndex: keyof T; /** * 列的宽度 * @default flex: 1 */ width?: number; /** * 自定义渲染 */ render?: (value: T[keyof T], data: T, index: number) => React.ReactNode; } interface Props extends ViewProps { /** * 表格数据 */ dataSource?: DataSource; /** * 表格列 */ columns?: Column[]; /** * 头部类名 */ headerCls?: string; /** * 头部样式 */ headerStyle?: React.CSSProperties; /** * 单元格类名 */ itemCls?: string; /** * 单元格样式 */ itemStyle?: React.CSSProperties; /** * body里的行类名 */ rowCls?: string; /** * body里的行样式 */ rowStyle?: React.CSSProperties; /** * body类名 */ bodyCls?: string; /** * body样式 */ bodyStyle?: React.CSSProperties; /** * noData组件类名 */ noDataCls?: string; /** * noData组件样式 */ noDataStyle?: React.CSSProperties; /** * 是否加载中 */ loading?: boolean; /** * 阴影props,设置为false不显示 */ shadow?: false | ShadowProps; /** * 双行的高亮颜色 */ doubleColor?: string; /** * 文字对齐 */ align?: 'center' | 'between'; /** * 每一行的点击回调 */ onRowTap?: (data: T) => void; } declare const _default: ({ dataSource, columns, bodyStyle, bodyCls, rowStyle, rowCls, headerStyle, headerCls, itemStyle, itemCls, className, noDataStyle, noDataCls, loading, doubleColor, shadow, align, onRowTap, ...props }: Props) => React.JSX.Element; export default _default;