import React, { RefAttributes } from 'react'; import { WithMargin } from '../Whitespace/utils'; import { Column, Footer, ActionIcon, ActionsListIcon, GroupBy, ExpandingRow, SelectAll, Selection, ColumnGroup, Settings, ColumnsSettings, GroupingSettings, ActionsColumn, InputFilter, SelectFilter, FilterState, TableService, TableServiceFactory, GroupTitleInterface, ColumnProps, TableHeaderProps } from './components'; import { TableState, SortDirection, TableSize, TableData, TableValign, ModuleName } from './types'; import { TableLocalizationProps } from './localization'; import { Wrapper, PropsWrapper, Empty } from './Table.styles'; import { BoxStyled } from '../Utils/styled'; import { Row, Td } from './components/TableBody/TableBody.styles'; import { DatePickerFilter } from './components/Filter/DatePickerFilter'; import { DatePickerRangeFilter } from './components/Filter/DatePickerRangeFilter'; import { AnyObject, OnChangeHandler, Pretty } from '../Utils'; export declare const defaultTableTestId: TableProps['testId']; export interface TableOnSelectData { item?: T | GroupTitleInterface | null; isChecked?: boolean; isRowIndeterminate?: boolean; isSelectedAll?: boolean; isSelectedFullData?: boolean; } export interface TableProps extends WithMargin, TableLocalizationProps, Omit, 'onSelect'> { data?: T[]; size?: TableSize; valign?: TableValign; noHeader?: boolean | undefined; noRowDivider?: boolean | undefined; maxHeight?: string | undefined; minHeight?: string | undefined; noOverflow?: boolean | undefined; disableSelectAll?: boolean | undefined; disableCheckboxSelectAll?: boolean | undefined; disableCheckboxes?: boolean | undefined; maxContent?: boolean | undefined; pinnableColumns?: boolean | undefined; selected?: T[]; sort?: { field: string; direction: SortDirection; } | undefined; filter?: FilterState | undefined; dataKey?: ((item: T, index: number) => string) | undefined; onRowClick?: OnChangeHandler, React.MouseEvent, null>; onRowItemClick?: OnChangeHandler, null>; onRowGroupClick?: OnChangeHandler, React.MouseEvent, null>; onRowDoubleClick?: OnChangeHandler, React.MouseEvent, null>; onRowRightClick?: OnChangeHandler, null>; onSort?: OnChangeHandler<{ field: string; direction: SortDirection; }, React.FormEvent | undefined, null>; onFilter?: ((data?: AnyObject) => void) | undefined; onSelect?: OnChangeHandler, React.FormEvent, null>; onScroll?: ((event: React.UIEvent) => void) | undefined; initState?: TableState | ((state: TableState) => TableState); state?: TableState; service?: TableServiceFactory; onUpdate?: (newState: TableState, id: ModuleName | string) => void; onInit?: ({ service, state }: { service: TableService; state: TableState; }) => void; expandedRow?: boolean | undefined; filterExpandingRow?: (item: T) => boolean; onExpand?: () => void | undefined; onClickShowAllColumns?: () => void | undefined; enableCancelSort?: boolean | undefined; noBorderBottom?: boolean | undefined; noBorderBottomForLastRow?: boolean | undefined; isError?: boolean | undefined; isLoading?: boolean | undefined; isEmpty?: boolean | undefined; indeterminate?: boolean | undefined; indeterminated?: T[]; disableCheckboxRow?: T[]; noWrap?: boolean; columns?: ColumnProps[]; showSettingsAlarm?: boolean; testId?: { container?: string; emptyState?: string; row?: (val: string) => string; cell?: (row: string, col: string) => string; tableHeader?: TableHeaderProps['testId']; }; currentPage?: number; pageSize?: number; } export interface TableParts { Column: typeof Column; Footer: typeof Footer; ActionIcon: typeof ActionIcon; ActionsListIcon: typeof ActionsListIcon; ExpandingRow: typeof ExpandingRow; SelectAll: typeof SelectAll; Selection: typeof Selection; ColumnGroup: typeof ColumnGroup; GroupBy: typeof GroupBy; Settings: typeof Settings; ColumnsSettings: typeof ColumnsSettings; GroupingSettings: typeof GroupingSettings; ActionsColumn: typeof ActionsColumn; InputFilter: typeof InputFilter; SelectFilter: typeof SelectFilter; SortDirection: typeof SortDirection; DatePickerFilter: typeof DatePickerFilter; DatePickerRangeFilter: typeof DatePickerRangeFilter; Row: typeof Row; Td: typeof Td; EmptyState: typeof Empty; } export declare namespace Table { type OnRowClick = Pretty.Func, React.MouseEvent, null>>; type onRowItemClick = Pretty.Func, null>>; type onRowGroupClick = Pretty.Func, React.MouseEvent, null>>; type OnRowDoubleClick = Pretty.Func, React.MouseEvent, null>>; type OnRowRightClick = Pretty.Func, null>>; type OnSort = Pretty.Func>; type OnFilter = Pretty.Func<((data?: T) => void) | undefined>; type OnSelect = Pretty.Func, React.FormEvent, null>>; } export declare const Table: ((props: TableProps & RefAttributes) => React.ReactElement) & { displayName?: string; } & TableParts;