/// import { ColumnDef, FilterFns, Row, SortingFns, TableOptions } from '@tanstack/react-table'; import { FlexProps } from '../Flex'; import { ExtendedFlexComponent, ExtendedFlexProps } from '../types'; type TableColumnDef> = ColumnDef & { getCellWidthText?: (row: D) => string; }; interface Props> { /** * The table column definitions */ readonly columns: TableColumnDef[]; /** * The table data array */ readonly data: D[]; /** * Event called when a row is clicked. * @param row: The row data. */ readonly onRowClick?: (row: Row) => void; /** * Number of total rows that are available in the table. This prop should only be used when using manualPagination as true. * Without it, the table will show an approximated total results value based on pageCount and pageSize. */ readonly rowsCount?: number; /** * The table options. */ readonly tableOptions?: Omit, 'data' | 'columns' | 'getCoreRowModel' | 'filterFns' | 'sortingFns'> & { getCoreRowModel?: TableOptions['getCoreRowModel']; filterFns?: TableOptions['filterFns']; sortingFns?: TableOptions['sortingFns']; }; } type TableFilterFns = FilterFns; type TableSortingFns = SortingFns; type TableProps, T extends React.ElementType = 'div'> = ExtendedFlexProps, T>; type TableComponent> = ExtendedFlexComponent>; type StyledTableWrapperProps = FlexProps; export { TableComponent, TableProps, TableColumnDef, TableFilterFns, TableSortingFns, Row, StyledTableWrapperProps };