import * as React from "react"; import { ListRowProps } from "react-virtualized"; import DataTable, { DataTableProps } from "../DataTable"; interface RowRendererProps extends ListRowProps { checkBox: React.ReactNode; } export interface DataTableSelectableProps extends Pick> { /** Action to take when the button is clicked */ mainAction?: (evt: { allSelected: boolean; invertSelection: boolean; selectedItems: number[]; unselectedItems: number[]; }) => void; /** Text to go on the main action button */ mainActionText?: string; /** * an array representing the columns that should be rendered in this table. each entry in the array contains a header renderer and a cell renderer. * eg. { headerRenderer: () => , cellRenderer: () => Row cell } */ columns?: DataTableColumn[]; /** A mapping of row numbers to id. Usually this takes the form of the function row => data[row].id */ mapRowToId?: (row: number) => number; rowRenderer?: (props: RowRendererProps) => React.ReactNode; disabled?: boolean; mainIconName?: never; prefixRow?: (SelectedCount: number, SelectedData: { selectedItems: number[]; unselectedItems: number[]; allSelected: boolean; invertSelection: boolean; totalResults: number; }, clearSelection: () => void) => React.ReactNode; } export interface DataTableColumn { cellRenderer: any; headerRenderer: any; } interface State { allSelected: boolean; invertSelection: boolean; selectedItems: Set; unselectedItems: Set; } /** * This component extends the Data Table component to add the ability to select rows. */ declare class DataTableSelectable extends React.Component { static defaultProps: { mapRowToId: (row: number) => number; }; ref: React.RefObject; get header(): HTMLElement; constructor(props: any); getSelectAllHeader(): JSX.Element; getCheckboxTD(props: any): JSX.Element; isThisRowSelected(index: number): boolean; enhanceColumns(columns: any, highlight: string): any; enhancedCellRender(cellRenderer: any, highlight: string): (args: any) => any; rowRenderer(highlight: string): (props: ListRowProps) => React.ReactNode; resetChecked(): void; updateRows(evt: { target: { name: string; checked: boolean; }; }): void; clearSelection(): void; resetTableData(reload?: boolean): void; onAllSelectChange(): void; render(): JSX.Element; } export default DataTableSelectable;