UNPKG

@spaced-out/ui-design-system

Version:
65 lines 2.08 kB
import * as React from 'react'; import type { TableRow } from '../../components/Table/DefaultRow'; import type { GenericHeaderItems } from '../../components/Table/DefaultTableHeader'; import type { SortDirection } from '../../components/Table/hooks'; export interface GenericObject { [key: string]: unknown; } export type TableClassNames = Readonly<{ wrapper?: string; table?: string; tableHeader?: string; tableBody?: string; tableRow?: string; checkbox?: string; }>; interface VirtualizationOptions { rowsCount: number; rowHeight?: string; onEndReached?: () => void; isEndLoading?: boolean; isAllDataFetched?: boolean; } export interface TableProps<T, U> { classNames?: TableClassNames; className?: string; TableRow?: TableRow<T, U>; headers: GenericHeaderItems<T, U>; entries: Array<T>; extras?: U; sortable?: boolean; showHeader?: boolean; tableHeaderClassName?: string; headerIconClassName?: string; defaultSortKey?: string; defaultSortDirection?: 'asc' | 'desc' | 'original'; enableInternalSorting?: boolean; selectedKeys?: string[]; disabledKeys?: string[]; onSelect?: (keys: string[]) => unknown; idName?: keyof T; onSort?: (key: keyof T, direction: SortDirection) => void; isLoading?: boolean; emptyText?: React.ReactNode; disabled?: boolean; customLoader?: React.ReactNode; borderRadius?: string; stickyHeader?: boolean; virtualizationOptions?: VirtualizationOptions; testId?: string; } /** * Table * @param {React.ComponentType} Row - React.ComponentType<{data: Data, extras?: Extras, sortedKeys?: string[]}> * @param {string} className - string * **/ /** * Table * @param {React.ComponentType} Row - React.ComponentType<{data: Data, extras?: Extras, sortedKeys?: string[]}> * @param {string} className - string * */ export declare function Table<Data extends GenericObject, Extras extends GenericObject>(props: TableProps<Data, Extras>): React.JSX.Element; export {}; //# sourceMappingURL=Table.d.ts.map