import { CellRenderContext, ColumnEditorContext } from '@toolbox-web/grid'; import { ReactNode } from 'react'; /** * Props for the GridColumn component. */ export interface GridColumnProps { /** Field key in the row object */ field: keyof TRow & string; /** Column header text (defaults to capitalized field) */ header?: string; /** Column data type */ type?: 'string' | 'number' | 'date' | 'boolean' | 'select' | 'typeahead'; /** Whether the column is editable */ editable?: boolean; /** Whether the column is sortable */ sortable?: boolean; /** Whether the column is resizable */ resizable?: boolean; /** Column width (e.g., "100px", "10%") */ width?: string | number; /** Minimum width for stretch mode */ minWidth?: number; /** Initial column display index */ order?: number; /** Whether the column is hidden */ hidden?: boolean; /** Prevent column from being hidden */ lockVisible?: boolean; /** * Custom cell renderer (render prop pattern). * Receives cell context and returns React node. * * @example * ```tsx * * {(ctx) => } * * ``` */ children?: (ctx: CellRenderContext) => ReactNode; /** * Custom cell editor. * Receives editor context with commit/cancel functions. * * @example * ```tsx * ( * ctx.commit(e.target.value)} * onKeyDown={(e) => e.key === 'Escape' && ctx.cancel()} * /> * )} * /> * ``` */ editor?: (ctx: ColumnEditorContext) => ReactNode; /** Select/typeahead options */ options?: Array<{ label: string; value: unknown; }>; /** Allow multiple selection (for select/typeahead) */ multi?: boolean; /** Custom formatter function */ format?: (value: TValue, row: TRow) => string; } /** * Column configuration component for use with DataGrid. * * Renders a `` custom element in the light DOM * and registers React renderers/editors with the adapter. * * ## Basic Usage * * ```tsx * * * * * ``` * * ## Custom Renderer * * ```tsx * * {(ctx) => ( * * {ctx.value} * * )} * * ``` * * ## Custom Editor * * ```tsx * ( * ctx.commit(Number(e.target.value))} * onKeyDown={(e) => { * if (e.key === 'Enter') ctx.commit(Number(e.currentTarget.value)); * if (e.key === 'Escape') ctx.cancel(); * }} * /> * )} * /> * ``` * * @category Component */ export declare function GridColumn(props: GridColumnProps): React.ReactElement; //# sourceMappingURL=grid-column.d.ts.map