UNPKG

@vectara/vectara-ui

Version:

Vectara's design system, codified as a React and Sass component library

47 lines (46 loc) 1.76 kB
import React from "react"; import { TextInputProps } from "../form"; import { Props as TableRowActionsProps } from "./TableRowActions"; import { Props as TableHeaderCellProps } from "./TableHeaderCell"; import { Pagination } from "./TablePagination"; import { Pager } from "./TablePager"; import { Props as TableBulkActionProps } from "./TableBulkActions"; import { Row } from "./types"; type Column<T> = { name: string; width?: string; header: TableHeaderCellProps["header"]; render?: (row: T, rowIndex: number) => React.ReactNode; className?: string; }; type Props<T> = { isLoading?: boolean; idField: keyof T | ((row: T) => string); rowDecorator?: (row: T) => Record<string, string>; columns: Column<T>[]; rows: T[]; actions?: TableRowActionsProps<T>["actions"]; actionsTestIdProvider?: (row: T) => string; pagination?: Pagination | Pager; selection?: Selection<T>; search?: Search; customControls?: React.ReactNode; onSort?: TableHeaderCellProps["onSort"]; onReload?: () => void; content?: React.ReactNode; className?: string; fluid?: boolean; isDisabled?: boolean; bodyStyle?: BodyStyle; }; type BodyStyle = { verticalAlign?: "top" | "middle" | "bottom"; }; type Selection<T> = { bulkActions?: TableBulkActionProps<T[]>["actions"]; onSelectRow?: (selectedRows: T[]) => void; selectedRows?: T[]; }; type Search = TextInputProps; export declare const VuiTable: <T extends Row>({ isLoading, idField, rowDecorator, columns, rows, actions, actionsTestIdProvider, pagination, selection, search, customControls, onSort, onReload, content, className, fluid, isDisabled, bodyStyle, ...rest }: Props<T>) => import("react/jsx-runtime").JSX.Element; export {};