import React from 'react'; export interface TableDataItem { [key: string]: any; } declare type ActiveScrollElementType = 'scrollBar' | 'scrollContainer'; interface TableState { activeScrollElement: ActiveScrollElementType; columnsStyles: React.CSSProperties[]; columnHeaderRefs: React.RefObject[]; } export interface TableColumnConfig { /** Column ID */ id: string; /** Column name (header). By default: column ID */ name?: string | (() => React.ReactNode); /** CSS-class that will be added to all cells in the column. */ className?: string; /** Stub in the event there is no data in a cell. By default: — (—) */ placeholder?: string | ((item: I, index: number) => React.ReactNode); /** Cell contents. If you pass a row, the cell contents will be the value of the field named the same as this row. By default: The value of the field with the name equal to the column ID */ template?: string | ((item: I, index: number) => React.ReactNode); /** Content alignment. */ align?: 'left' | 'center' | 'right'; /** Sticky column. */ sticky?: 'left' | 'right'; /** Distinguishes a column among other. */ primary?: boolean; /** Column width in px or in %. Width can behave unexpectedly (it's more like min-width in block-elements). Sometimes you want to use `table-layout: fixed` */ width?: number | string; /** Various data, HOC settings. */ meta?: Record; } export interface TableProps { /** Data */ data: I[]; /** Column parameters */ columns: TableColumnConfig[]; /** Vertical alignment of contents */ verticalAlign?: 'top' | 'middle'; /** * Horizontal sticky scroll. * Note: table cannot be with fixed height and with sticky scroll at the same time. * Sticky scroll wont work if table has overflow. * * @default false */ stickyHorizontalScroll?: boolean; /** * Threshold when sticky scroll is enabled. * * @default 0 */ stickyHorizontalScrollBreakpoint?: number; /** * Row ID. * Used when selecting and sorting rows. If you pass a row, * its ID will be the value of the field in the row data named the same as the column ID. */ getRowId?: string | ((item: I, index: number) => string); /** Row CSS classes. */ getRowClassNames?: (item: I, index: number) => string[]; /** Condition for disabling columns. */ isRowDisabled?: (item: I, index: number) => boolean; /** Row click handler. When passed row's hover is visible. */ onRowClick?: (item: I, index: number, event: React.MouseEvent) => void; /** Message returned if data is missing. By default: "No data". */ emptyMessage?: string; /** Table CSS-class. */ className?: string; /** Adds horizontal padding for edge cells. */ edgePadding?: boolean; } interface TableDefaultProps { edgePadding: boolean; } export declare class Table> extends React.Component, TableState> { static defaultProps: TableDefaultProps; static getRowId(props: TableProps, item: I, rowIndex?: number): string; static getHeadCellContent(column: TableColumnConfig): React.ReactNode; static getBodyCellContent(column: TableColumnConfig, item: I, rowIndex: number): React.ReactNode; static getDerivedStateFromProps(props: Readonly>, state: Readonly): Partial | null; state: TableState; private tableRef; private scrollContainerRef; private horizontalScrollBarRef; private horizontalScrollBarInnerRef; private tableResizeObserver; private columnsResizeObserver; componentDidMount(): void; componentDidUpdate(prevProps: TableProps): void; componentWillUnmount(): void; render(): JSX.Element; private renderHead; private renderBody; private renderTable; private renderRow; private renderEmptyRow; private renderHorizontalScrollBar; private updateColumnStyles; private getColumnStyles; private handleScrollContainerMouseenter; private handleScrollContainerScroll; private handleHorizontalScrollBarMouseenter; private handleHorizontalScrollBarScroll; } export {};