import { PropsWithChildren } from 'react'; import { DataGridProps, DataGridResolveValue, DataGridCellKey } from '../DataGrid'; import { DataGridDisabled, DataGridSelection } from './types'; import { Grid } from '@vega-ui/utils'; export interface DataGridSelectableProps extends DataGridProps { /** * Selection mode. * - `'single'` — only one cell can be selected at a time * - `'multiple'` — independent multi-selection (toggle per cell) * - `'range'` — range selection between two points (Shift + arrows or pointer drag) * * @default 'single' */ selection?: S; /** * Predicate or map of disabled cells. * Can be: * - a function `(key) => boolean` * - an array of disabled keys * - a single key * * Disabled cells cannot be selected or focused. */ disabled?: DataGridDisabled; excludeDisabled?: boolean; /** * Enables expanding selection ranges (Shift + Arrow or mouse drag). * * @default true */ expandable?: boolean; /** * Uncontrolled initial active cell. */ defaultActive?: K; /** * Controlled active cell. */ active?: K; /** * Controlled selected cells. */ selected?: (S extends 'single' ? K : K[]) | undefined; /** * Uncontrolled initial selected cells. */ defaultSelected?: (S extends 'single' ? K : K[]) | undefined; /** * Range boundaries. * If provided, limits selection to cells between `from` and `to` * based on the `compare` function. */ from?: K; to?: K; /** * Custom range resolution logic for `selection="range"`. * Given start and end values, returns the list of keys forming the range. */ resolveRange?(start: DataGridResolveValue, end: DataGridResolveValue, grid: Grid): K[]; /** * Custom equality comparator for comparing two cell keys. * Defaults to strict equality (`===`). */ equals?(start: K | undefined, end: K | undefined): boolean; /** * Custom ordering comparator for comparing two cell keys. * Should return `-1`, `0`, or `1`. */ compare?(a: K, b: K): -1 | 0 | 1; /** * Fires when the user selects cell. * Receives the list of selected cell keys. */ onSelectCell?(value: S extends 'single' ? K : K[]): void; /** * Fires when the active (focused) cell changes. */ onChangeActive?(active: K): void; } /** * DataGridSelectable extends `DataGrid` with a complete selection system. * It supports single, multiple, and range-based selections, keyboard * and pointer interactions, and integration with the low-level `Grid` * matrix via `apiRef`. */ export declare const DataGridSelectable: ({ to, from, children, disabled, expandable, exclude, excludeDisabled, selection, apiRef: _apiRef, resolveRange: _resolveRange, equals: _equals, compare: _compare, defaultActive, selected: _selected, defaultSelected, onSelectCell, onPointerDown: _onPointerDown, onPointerMove: _onPointerMove, onArrow: _onArrow, ...props }: PropsWithChildren>) => import("react/jsx-runtime").JSX.Element;