UNPKG

@stanfordspezi/spezi-web-design-system

Version:

Stanford Biodesign Digital Health Spezi Web Design System

29 lines (28 loc) 1.35 kB
import { MouseEvent } from 'react'; import { DataTableViewProps } from './DataTable'; export interface DataTableTableViewSpecificProps<Data> { /** * Row event click handler. Row is clicked only if it passes {@link DataTableTableViewSpecificProps#isRowClicked|isRowClicked} check. */ onRowClick?: (data: Data, event: MouseEvent) => void; /** * Determines whether a mouse event represents a valid row click. * * This function helps filter click events when table rows contain interactive elements * by allowing you to exclude clicks that have bubbled up from child elements. * * By default, it checks if the event's target is a "TD" HTML element. */ isRowClicked?: (event: MouseEvent) => boolean; } interface DataTableTableViewProps<Data> extends DataTableViewProps<Data>, DataTableTableViewSpecificProps<Data> { } /** * Regular DataTable's TableView. * If no custom `children` is provided, this component is rendered by default. * * Renders a fully-featured table with headers, sortable columns, and row click handling. * Automatically applies proper styling and accessibility attributes to the table elements. */ export declare const DataTableTableView: <Data>({ table, rows, onRowClick, isRowClicked, }: DataTableTableViewProps<Data>) => import("react").JSX.Element; export {};