UNPKG

es-grid-template

Version:

es-grid-template

41 lines (40 loc) 2.03 kB
import type { ArtColumn } from '../../interfaces'; import type { TablePipeline } from '../pipeline'; export interface TreeSelectFeatureOptions { /** Full tree */ tree: any[]; /** Virtual root node value; when provided, treeSelect will add a parent above the tree */ rootKey?: string; /** Whether parent-child selection states are independent. When true, parent and child values are managed independently */ checkStrictly?: boolean; /** * Defines how selected values are returned. Options: * - 'all' (return all selected nodes) * - 'parent' (when parent and children are selected, return only parent) * - 'child' (when parent and children are selected, return only children) */ checkedStrategy?: 'all' | 'parent' | 'child'; /** Position of the checkbox column */ checkboxPlacement?: 'start' | 'end'; /** Column config for the checkbox column; can specify width, lock, title, align, features, etc. */ checkboxColumn?: Partial<ArtColumn>; /** Controlled usage: current selected values */ value?: string[]; /** Uncontrolled usage: default selected values */ defaultValue?: string[]; /** Controlled usage: change callback */ onChange?: (nextValue: string[], rowData: any, type: 'all' | 'rowSelected') => void; /** Area that responds to click events */ clickArea?: 'checkbox' | 'cell' | 'row'; /** Whether to call event.stopPropagation() for click events that trigger onChange */ stopClickEventPropagation?: boolean; /** Whether to highlight the whole row when selected */ highlightRowWhenSelected?: boolean; /** Whether to disable interaction for the node */ isDisabled?: (row: any) => boolean; /** Whether to detach the subtree of this node from its parent (disable linkage) */ isDetached?: (row: any) => boolean; mode?: 'checkbox' | 'radio'; type?: 'single' | 'multiple'; } export declare function treeSelect(opts: TreeSelectFeatureOptions): (pipeline: TablePipeline) => TablePipeline;