@cuvp1225/tango-mail
Version:
react mail components for tango
68 lines (67 loc) • 1.54 kB
TypeScript
import React from 'react';
import { Dict } from '@music163/tango-helpers';
interface TableColumnData {
/**
* 唯一标识符,如果没有提供该属性,则使用 `dataIndex` 作为唯一标识符
*/
key?: string;
/**
* 列标题
*/
title: string;
/**
* 单元格的数据源字段
*/
dataIndex: string;
/**
* 列宽
*/
width?: string;
/**
* 自定义渲染单元格
* @param cellData
* @param rowData
* @param rowIndex
* @returns
*/
render?: (cellData: React.ReactNode, rowData: any, rowIndex: number) => React.ReactNode;
}
export interface TableProps extends React.ComponentPropsWithoutRef<'table'> {
/**
* 标题
*/
caption?: string;
/**
* 表格列
*/
columns?: TableColumnData[];
/**
* 数据源
*/
dataSource?: Dict[];
/**
* 数据源的主键
*/
primaryKey?: string;
/**
* 设置行属性
* @param rowData
* @param rowIndex
* @returns
*/
getRowProps?: (rowData: any, rowIndex: number) => React.HTMLAttributes<HTMLTableRowElement>;
/**
* 表格布局算法
*/
tableLayout?: 'auto' | 'fixed';
/**
* 自定义表格类
*/
className?: string;
/**
* 自定义表格头类
*/
headClassName?: string;
}
export declare const Table: React.ForwardRefExoticComponent<TableProps & import("@music163/tango-boot").TangoComponentProps & React.RefAttributes<unknown>>;
export {};