import React, { JSX } from 'react'; import { TableProps } from '@mui/material/Table'; import { TableCellProps } from '@mui/material/TableCell'; import GrepTableRow from './components/grep-table-row'; import { DropdownMenuItem } from '../DropdownMenu'; export interface TableColumn extends Pick { label?: string | JSX.Element; width?: number | string; colDef?: string; sortable?: boolean; forceTooltip?: boolean; getTooltip?: (row: T) => string; getCell: (row: T) => string | number | boolean | JSX.Element; lines?: (row: T) => number; lang?: string | ((row: T) => string); } export interface GrepTableProps extends Pick { data: T[]; columns: Array>; sortBy?: string; header?: boolean; outlined?: boolean; rowsPerPage?: number; rowsPerPageOptions?: number[]; pagination?: boolean; /** * @deprecated No longer in use. */ clickableRows?: boolean; placeholderText?: string; dropdownItems?: Array>; style?: React.CSSProperties; sortDirection?: 'desc' | 'asc'; isRowDisabled?: (row: T) => boolean; onSelectedRowChange?: (row: T | null) => void; onRowClick?: (row: T, mouseEvent?: React.MouseEvent) => void; menuTooltip?: (row: T) => string; menuDisabled?: (row: T) => boolean; onContextIdChanged?: (row: T) => void; onSortBy?: (col: TableColumn) => void; caption?: React.ReactNode; menuButtonLabel?: string; /** * @deprecated No longer in use. */ rowHeight?: number; rowStyle?: React.CSSProperties | ((data: T, index: number) => React.CSSProperties); disableSelectOnClick?: boolean; underlineOnFocus?: boolean; rowTabIndex?: number; } interface StyleProps { outlined?: boolean; showHeader?: boolean; } export declare const useStyles: (params: StyleProps, muiStyleOverridesParams?: { props: Record; ownerState?: Record | undefined; } | undefined) => { classes: Record<"body" | "header" | "table", string>; theme: import("@mui/material").Theme; css: import("tss-react").Css; cx: import("tss-react").Cx; }; /** * Since Grep-Table is so tightly intregrated into LPU and Admin some core logic could not be fixed * Still works but still messy * * @todo enhance page handling * */ export declare const GrepTable: ({ placeholderText, dropdownItems, isRowDisabled, pagination, outlined, columns, header, data, onSelectedRowChange, sortBy, sortDirection, onSortBy, onRowClick, size, caption, stickyHeader, padding, disableSelectOnClick, menuButtonLabel, underlineOnFocus, rowTabIndex, rowStyle, rowsPerPageOptions, ...props }: GrepTableProps) => JSX.Element; export { GrepTableRow }; export default GrepTable;