UNPKG

@fluent-windows/core

Version:

React components that inspired by Microsoft's Fluent Design System.

29 lines (28 loc) 1.25 kB
import * as React from 'react'; import * as PropTypes from 'prop-types'; import { StandardProps } from '..'; export declare type TableClassProps = 'root' | 'headRoot' | 'bodyRoot' | 'footRoot' | 'rowRoot' | 'rowBody' | 'cellRoot' | 'headCellRoot' | 'cellTextAlignLeft' | 'cellTextAlignRight' | 'cellTextAlignCenter' | 'cellTextAlignJustify'; export interface DataType { key: string; [name: string]: React.ReactText; } export interface ColumnsType<T> { field: string; title: string; render?: (text: React.ReactText, record?: T, index?: number) => React.ReactElement; } export interface TableProps<T> extends StandardProps<React.TableHTMLAttributes<HTMLTableElement>, HTMLTableElement> { data?: T[]; columns?: ColumnsType<T>[]; children?: React.ReactElement | React.ReactElement[]; } export declare type TextAlign = 'inherit' | 'left' | 'center' | 'right' | 'justify'; export interface TableCellProps extends StandardProps<React.TableHTMLAttributes<HTMLTableCellElement>, HTMLTableCellElement> { textAlign?: TextAlign; children: React.ReactChild; } export declare const TablePropTypes: { data: PropTypes.Requireable<any[]>; columns: PropTypes.Requireable<any[]>; children: PropTypes.Requireable<any>; };