UNPKG

@1771technologies/lytenyte-pro

Version:

Blazingly fast headless React data grid with 100s of features.

38 lines (37 loc) 1.66 kB
import { type ReactNode } from "react"; import { type RowGroup, type RowLeaf, type RowSelectionLinked } from "@1771technologies/lytenyte-shared"; import type { TreeViewChildParams, TreeViewItem, TreeViewSelectAllParams } from "./types.js"; export interface TreeViewProps<T extends TreeViewItem> { readonly items: T[]; readonly children?: (props: TreeViewChildParams<T>) => ReactNode; readonly selectAllSlot?: (params: TreeViewSelectAllParams) => ReactNode; readonly rowHeight?: number; readonly defaultExpansion?: boolean | number; readonly branchJoinSeparator?: string; readonly rowSelectAllShow?: boolean; readonly rowSelectionEnabled?: boolean; readonly rowSelection?: RowSelectionLinked; readonly onRowSelectionChange?: (selection: RowSelectionLinked) => void; readonly rowGroupExpansions?: Record<string, boolean | undefined>; readonly onRowGroupExpansionChange?: (change: Record<string, boolean | undefined>) => void; /** * @alpha * @internal * * Do not use this property unless you know what you are doing. Support for tree view drag * and drag is still being prototyped. */ readonly draggable?: boolean; /** * @alpha * @internal * * Do not use this property unless you know what you are doing. Support for tree view drag * and drag is still being prototyped. */ readonly onItemsReordered?: (items: T[]) => void; } export interface TreeViewApi<T extends TreeViewItem> { readonly rowsSelected: () => (RowLeaf<T> | RowGroup)[]; } export declare const TreeView: <T extends TreeViewItem>(props: TreeViewProps<T>) => ReactNode;