acud
Version:
acg react 组件库
51 lines (50 loc) • 2.33 kB
TypeScript
import * as React from 'react';
import { LoadingProps } from '../loading';
import RcTable, { Summary } from './baseTable';
import { TableProps as RcTableProps } from './baseTable/Table';
import Space from './Space';
import { TooltipProps } from '../tooltip';
import { TableRowSelection, ColumnsType, TableCurrentDataSource, SorterResult, GetPopupContainer, TablePaginationConfig, SortOrder, TableLocale, FilterValue } from './interface';
import { SELECTION_COLUMN } from './hooks/useSelection';
import { SizeType } from '../config-provider/SizeContext';
import Column from './Column';
import ColumnGroup from './ColumnGroup';
export { ColumnsType, TablePaginationConfig };
export interface TableProps<RecordType> extends Omit<RcTableProps<RecordType>, 'transformColumns' | 'internalHooks' | 'internalRefs' | 'data' | 'columns' | 'scroll' | 'emptyText'> {
dropdownPrefixCls?: string;
dataSource?: RcTableProps<RecordType>['data'];
columns?: ColumnsType<RecordType>;
pagination?: false | TablePaginationConfig;
loading?: boolean | LoadingProps;
size?: SizeType;
bordered?: boolean;
locale?: TableLocale;
onChange?: (pagination: TablePaginationConfig, filters: Record<string, FilterValue | null>, sorter: SorterResult<RecordType> | SorterResult<RecordType>[], extra: TableCurrentDataSource<RecordType>) => void;
rowSelection?: TableRowSelection<RecordType>;
getPopupContainer?: GetPopupContainer;
scroll?: RcTableProps<RecordType>['scroll'] & {
scrollToFirstRowOnChange?: boolean;
};
sortDirections?: SortOrder[];
showSorterTooltip?: boolean | TooltipProps;
expandIndex?: number;
}
declare const ForwardTable: <RecordType extends object = any>(props: TableProps<RecordType> & {
children?: React.ReactNode;
} & {
ref?: React.Ref<HTMLDivElement>;
}) => React.ReactElement;
type InternalTableType = typeof ForwardTable;
interface TableInterface extends InternalTableType {
SELECTION_COLUMN: typeof SELECTION_COLUMN;
EXPAND_COLUMN: typeof RcTable.EXPAND_COLUMN;
SELECTION_ALL: 'SELECT_ALL';
SELECTION_INVERT: 'SELECT_INVERT';
SELECTION_NONE: 'SELECT_NONE';
Column: typeof Column;
ColumnGroup: typeof ColumnGroup;
Summary: typeof Summary;
Space: typeof Space;
}
declare const Table: TableInterface;
export default Table;