UNPKG

3.05 kBTypeScriptView Raw
1/**
2 * Feature:
3 * - fixed not need to set width
4 * - support `rowExpandable` to config row expand logic
5 * - add `summary` to support `() => ReactNode`
6 *
7 * Update:
8 * - `dataIndex` is `array[]` now
9 * - `expandable` wrap all the expand related props
10 *
11 * Removed:
12 * - expandIconAsCell
13 * - useFixedHeader
14 * - rowRef
15 * - columns[number].onCellClick
16 * - onRowClick
17 * - onRowDoubleClick
18 * - onRowMouseEnter
19 * - onRowMouseLeave
20 * - getBodyWrapper
21 * - bodyStyle
22 *
23 * Deprecated:
24 * - All expanded props, move into expandable
25 */
26import * as React from 'react';
27import { GetRowKey, ColumnsType, TableComponents, DefaultRecordType, GetComponentProps, ExpandableConfig, LegacyExpandableProps, PanelRender, TableLayout, RowClassName, ColumnType } from './interface';
28export declare const INTERNAL_HOOKS = "rc-table-internal-hook";
29export interface TableProps<RecordType = unknown> extends LegacyExpandableProps<RecordType> {
30 prefixCls?: string;
31 className?: string;
32 style?: React.CSSProperties;
33 children?: React.ReactNode;
34 data?: RecordType[];
35 columns?: ColumnsType<RecordType>;
36 rowKey?: string | GetRowKey<RecordType>;
37 tableLayout?: TableLayout;
38 scroll?: {
39 x?: number | true | string;
40 y?: number | string;
41 };
42 /** Config expand rows */
43 expandable?: ExpandableConfig<RecordType>;
44 indentSize?: number;
45 rowClassName?: string | RowClassName<RecordType>;
46 title?: PanelRender<RecordType>;
47 footer?: PanelRender<RecordType>;
48 summary?: (data: RecordType[]) => React.ReactNode;
49 id?: string;
50 showHeader?: boolean;
51 components?: TableComponents<RecordType>;
52 onRow?: GetComponentProps<RecordType>;
53 onHeaderRow?: GetComponentProps<ColumnType<RecordType>[]>;
54 emptyText?: React.ReactNode | (() => React.ReactNode);
55 direction?: 'ltr' | 'rtl';
56 /**
57 * @private Internal usage, may remove by refactor. Should always use `columns` instead.
58 *
59 * !!! DO NOT USE IN PRODUCTION ENVIRONMENT !!!
60 */
61 internalHooks?: string;
62 /**
63 * @private Internal usage, may remove by refactor. Should always use `columns` instead.
64 *
65 * !!! DO NOT USE IN PRODUCTION ENVIRONMENT !!!
66 */
67 transformColumns?: (columns: ColumnsType<RecordType>) => ColumnsType<RecordType>;
68 /**
69 * @private Internal usage, may remove by refactor.
70 *
71 * !!! DO NOT USE IN PRODUCTION ENVIRONMENT !!!
72 */
73 internalRefs?: {
74 body: React.MutableRefObject<HTMLDivElement>;
75 };
76}
77declare function Table<RecordType extends DefaultRecordType>(props: TableProps<RecordType>): JSX.Element;
78declare namespace Table {
79 var Column: typeof import("./sugar/Column").default;
80 var ColumnGroup: typeof import("./sugar/ColumnGroup").default;
81 var Summary: {
82 Cell: typeof import("./Footer/Cell").default;
83 Row: typeof import("./Footer/Row").default;
84 };
85 var defaultProps: {
86 rowKey: string;
87 prefixCls: string;
88 emptyText: () => string;
89 };
90}
91export default Table;