import type { HTMLAttributes, ReactNode } from "react";
import { type PaginationMenuProps } from "../PaginationMenu/PaginationMenu.types";
import { type TableFieldConfig } from "./Table.types";
type SelectableTableRow- = {
index: number;
value: Item;
};
export interface TableProps
- extends HTMLAttributes {
items?: Item[];
fieldConfigurations: TableFieldConfig
- [];
emptyRowsText: string;
emptyFieldContentText?: string;
isLoading?: boolean;
showHeader?: boolean;
paginationMenuProps?: PaginationMenuProps;
onRowClick?: (item: Item) => void;
className?: string;
dataTestId?: string;
/**
* When `true`, will render checkboxes as the first column of each row,
* including the header. Allowing for multiple rows to be selected.
*
* Two callbacks can control this behavior:
* - The one for each row selected `onSelectedRow`,
* triggered by the checkbox in the table row.
* - The one for all rows selected `onSelectedAllRows`,
* triggered by the checkbox in the table header.
*
* Turning this configuration on also requires `selectedItems` to be passed as a prop,
* the shape of this prop is:
*
* `Array<{ index: number; value: Item }>` -> Where `Item` is the generic shape
* passed to the table, in the `props.items` list.
*
* Also gives access to the `onSelectedRowsChange` callback, if you need to use it.
*
*/
isSelectable?: boolean;
/**
* Used to render components on the header for when one or all
* rows are selected.
*
* Ideally this will be one or more buttons for specific actions.
*
*
*/
rowSelectionHeaderAccessories?: ReactNode;
selectedItems?: Array>;
onSelectedRowsChange?: (params: Array>) => void;
}
/**
* @deprecated Use `TableNew` instead.
*/
export declare function Table
- ({ items, fieldConfigurations, emptyRowsText, emptyFieldContentText, isLoading, showHeader, paginationMenuProps, onRowClick, className, dataTestId, isSelectable, selectedItems, onSelectedRowsChange, rowSelectionHeaderAccessories, ...otherAttributes }: TableProps
- ): import("react").JSX.Element;
export {};