import React from "react"; import type { DataTableColumn, DataTableRow, DataTableRowProps } from "./types"; import type { MQ } from "../../types"; export type DataTableProps = { /** Screen reader text for table caption */ caption: string; /** CSS table layout. In 'auto' layout, columns are sized according to content width. In 'fixed' layout, columns can be provided a fixed or percentage width. */ layout?: "auto" | "fixed"; /** Table width */ width?: string | MQ; /** Vertical padding on row cells to set table density, extra extra small (xxs), extra small (xs), condensed (s), default (m), comfortable (l) */ bodyCellVerticalPadding?: "xxs" | "xs" | "s" | "m" | "l" | MQ<"xxs" | "xs" | "s" | "m" | "l">; /** Height of empty/error or loading table content */ emptyTableContentHeight?: string | MQ; /** Footer element */ footer?: React.ReactElement; /** * Meta data for columns * @param DataTableColumn[].name - Column name * @param DataTableColumn[].label - Column label for display * @param DataTableColumn[].align - Align cell content, 'left' | 'right' | 'center' * @param DataTableColumn[].width - Column width * @param DataTableColumn[].toggletipContent - Content of right toggletip * @param DataTableColumn[].renderCell - Callback to render custom cell content. * @param DataTableColumn[].isSortable - Is table sortable by column * @param DataTableColumn[].sortDirection - Sorted as 'asc' | 'desc' */ columns: DataTableColumn[]; /** * Table content as an array of objects with values for each column * @param DataTableRow[].id - Unique id * @param DataTableRow[].isSelectable - Whether row can be selected */ rows?: DataTableRow[]; /** * Is loading data. You can display custom loading content with children prop. */ isLoading?: boolean; /** Screen reader text for loading spinner */ loadingStateScreenReaderText?: string; /** Is empty or in error state. You can display custom empty/error content with children prop. */ isEmpty?: boolean; /** * Is first column sticky on horizontal scroll */ isFirstColumnSticky?: boolean; /** * Is first column sticky on horizontal scroll */ isLastColumnSticky?: boolean; "data-e2e-test-id"?: string; /** Column most recently used to sort data */ currentlySortedByColumn?: string; /** * Empty cell content. */ emptyCellContent?: string; /** Define a vertically scrollable table with max height */ maxHeight?: string | MQ; /** Renders selectable rows */ isSelectable?: boolean; /** Array of selected row ids */ selectedRowIds?: DataTableRow["id"][]; /** Indicates that all rows are selected */ allRowsSelected?: boolean; selectAllRowsCheckboxAriaLabel?: string; /** Callback to handle selection change */ onRowSelectionChange?: (selectedRowIds: DataTableRow["id"][]) => void; /** Callback to handle all rows selection change */ onAllRowsSelectionChange?: (allRowsSelected: boolean) => void; /** * Callback to handle sorting by column */ onSort?: (columnName: string, desiredSortDirection: DataTableColumn["sortDirection"]) => void; /** Customize row */ getRowProps?: (row: DataTableRow) => DataTableRowProps; }; export declare function BaseDataTable({ caption, columns, rows, footer, currentlySortedByColumn, isFirstColumnSticky, isLastColumnSticky, "data-e2e-test-id": dataE2eTestId, isLoading, loadingStateScreenReaderText, isEmpty, children, emptyTableContentHeight, layout, width, bodyCellVerticalPadding, emptyCellContent, maxHeight, isSelectable, selectedRowIds, allRowsSelected, selectAllRowsCheckboxAriaLabel, getRowProps, onRowSelectionChange, onAllRowsSelectionChange, onSort, ...ariaAttributes }: React.PropsWithChildren): React.ReactElement; export declare function DataTable({ children, ...rest }: React.PropsWithChildren): React.ReactElement; export declare namespace DataTable { var sortCompareFn: (a: DataTableRow, b: DataTableRow, columnName: DataTableColumn["name"], desiredSortDirection: DataTableColumn["sortDirection"]) => number; }