UNPKG

@aliretail/react-materials-components

Version:
87 lines (86 loc) 2.37 kB
import * as React from 'react'; import { TableProps } from '@alifd/next/types/table'; export interface IColumnItem { /** * 动态调整宽度,优先级高于 width,不可传入 */ resizeWidth?: string | number; /** * 指定列对应的字段,支持a.b形式的快速取值 */ dataIndex?: string; /** * 行渲染的逻辑 */ cell?: ((value: any, index: number, record: any) => void) | React.ReactNode; /** * 表头显示的内容 */ title?: React.ReactNode; /** * 当设定 group,表明此为父子表头的父表头,值会作为父表头标题存在 */ group?: React.ReactNode; /** * 设定 group 后,children作为子表头的值存在 */ children?: IColumnItem[]; /** * 写到 header 单元格上的title属性 */ htmlTitle?: string; /** * 列宽,注意在锁列的情况下一定需要配置宽度 */ width?: number | string; /** * header cell 横跨的格数,设置为0表示不出现此 th */ colSpan?: number; /** * 单元格的对齐方式 */ align?: 'left' | 'center' | 'right'; /** * 单元格标题的对齐方式, 不配置默认读取align值 */ alignHeader?: 'left' | 'center' | 'right'; /** * 生成标题过滤的菜单, 格式为`[{label:'xxx', value:'xxx'}]` */ filters?: any[]; /** * 过滤的模式是单选还是多选 */ filterMode?: 'single' | 'multiple'; /** * 是否支持锁列,可选值为`left`,`right`, `true` */ lock?: boolean | string; /** * 是否支持排序 */ sortable?: boolean; /** * 预制的一些常见配置 */ type?: 'id' | 'amount' | 'money' | 'currency' | 'datetime' | 'date' | 'phone' | 'ou' | 'bankCard'; /** * 预置配置的特殊设置 */ formatConfig?: Record<string, any>; i18nBundle?: any; } export interface IAliretailTableProps extends TableProps { columns?: IColumnItem[]; bakColumns?: IColumnItem[]; tableStateChange: (config: any) => void; resizable?: boolean; groupHeader?: any; groupFooter?: any; emptyContent?: React.ReactNode; stickyLock?: boolean; i18nBundle?: any; } declare const _default: (props: any) => JSX.Element; export default _default;