@vectara/vectara-ui
Version:
Vectara's design system, codified as a React and Sass component library
46 lines (45 loc) • 1.88 kB
TypeScript
import React from "react";
import { TextInputProps } from "../form";
import { Props as TableRowActionsProps } from "./TableRowActions";
import { Pagination } from "../pagination/Pagination";
import { Pager } from "./TablePager";
import { Props as TableBulkActionProps } from "./TableBulkActions";
import { Column, OnSort, Row } from "./types";
type Props<T> = {
isLoading?: boolean;
idField: keyof T | ((row: T) => string);
rowDecorator?: (row: T) => React.HTMLAttributes<HTMLTableRowElement>;
columns: Column<T>[];
rows: T[];
actions?: TableRowActionsProps<T>["actions"];
actionsTestIdProvider?: (row: T) => string;
reloadTestId?: string;
pagination?: Pagination | Pager;
selection?: Selection<T>;
search?: Search;
customControls?: React.ReactNode;
onSort?: OnSort;
onReload?: () => void;
content?: React.ReactNode;
className?: string;
fluid?: boolean;
isDisabled?: boolean;
bodyStyle?: BodyStyle;
isHeaderSticky?: boolean;
isResponsive?: boolean;
collapsedContent?: (row: T) => React.ReactNode;
defaultSortColumn?: string;
defaultSortDirection?: "asc" | "desc";
};
type BodyStyle = {
verticalAlign?: "top" | "middle" | "bottom";
};
type Selection<T> = {
bulkActions?: TableBulkActionProps<T[]>["actions"];
isRowSelectable?: (row: T) => boolean;
onSelectRow?: (selectedRows: T[]) => void;
selectedRows?: T[];
};
type Search = TextInputProps;
export declare const VuiTable: <T extends Row>({ isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, reloadTestId, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled, bodyStyle, isHeaderSticky, isResponsive, collapsedContent, defaultSortColumn, defaultSortDirection, ...rest }: Props<T>) => import("react/jsx-runtime").JSX.Element;
export {};