import { ClipboardConfig, ColumnVirtualizationConfig, ContextMenuConfig, FilterConfig as CoreFilterConfig, GroupingColumnsConfig as CoreGroupingColumnsConfig, GroupingRowsConfig as CoreGroupingRowsConfig, MasterDetailConfig as CoreMasterDetailConfig, PinnedRowsConfig as CorePinnedRowsConfig, ResponsivePluginConfig as CoreResponsivePluginConfig, ExportConfig, MultiSortConfig, PivotConfig, PrintConfig, ReorderConfig, RowDragDropConfig, SelectionConfig, ServerSideConfig, StickyRowsConfig, TooltipConfig, TreeConfig, UndoRedoConfig, VisibilityConfig } from '@toolbox-web/grid/all'; import { EditingConfig } from '@toolbox-web/grid/plugins/editing'; import { FilterPanelParams } from '@toolbox-web/grid/plugins/filtering'; import { ColumnGroupDefinition as CoreColumnGroupDefinition } from '@toolbox-web/grid/plugins/grouping-columns'; import { GroupRowRenderParams } from '@toolbox-web/grid/plugins/grouping-rows'; import { AggregationSlot, PanelZone, PinnedRowsContext } from '@toolbox-web/grid/plugins/pinned-rows'; import { ShellConfig } from '@toolbox-web/grid/plugins/shell'; import { ReactNode } from 'react'; /** * Filter config widened to accept a React render function as `filterPanelRenderer`. * * Extends the core `FilterConfig` so consumers can return a `ReactNode` * `(params: FilterPanelParams) => ReactNode` in addition to the vanilla * `(container: HTMLElement, params: FilterPanelParams) => void` signature. */ export type FilterConfig = Omit, 'filterPanelRenderer'> & { filterPanelRenderer?: CoreFilterConfig['filterPanelRenderer'] | ((params: FilterPanelParams) => ReactNode); }; /** * Column group definition widened to accept a React `renderer`. */ export type ColumnGroupDefinition = Omit & { renderer?: CoreColumnGroupDefinition['renderer'] | ((...args: Parameters>) => ReactNode); }; /** * Grouping-columns config widened to accept React render functions for * `groupHeaderRenderer` and per-group `renderer` entries in `columnGroups`. */ export type GroupingColumnsConfig = Omit & { columnGroups?: ColumnGroupDefinition[]; groupHeaderRenderer?: CoreGroupingColumnsConfig['groupHeaderRenderer'] | ((...args: Parameters>) => ReactNode); }; /** * Grouping-rows config widened to accept a React `groupRowRenderer` * `(params: GroupRowRenderParams) => ReactNode` in addition to the vanilla * `(params) => HTMLElement | string | void` signature. * * @since 1.8.0 */ export type GroupingRowsConfig = Omit & { groupRowRenderer?: CoreGroupingRowsConfig['groupRowRenderer'] | ((params: GroupRowRenderParams) => ReactNode); }; /** * React-typed render function for a pinned-row panel slot. * * Mirrors the vanilla `PanelRender` signature but returns a `ReactNode` * instead of `HTMLElement | null`. The React adapter (see * `features/pinned-rows.ts`) wraps the returned node in a portal so the * pinned-rows plugin can keep its host-element reference stable across * grid re-renders. * * @since 1.8.2 */ export type PanelRender = (ctx: PinnedRowsContext) => ReactNode; /** * React-typed zoned panel render entry. * * @since 1.8.2 */ export interface ZonedPanelRender { zone?: PanelZone; render: PanelRender; } /** * React-typed panel slot — same shape as the vanilla `PanelSlot` but with * `ReactNode` render returns. * * @since 1.8.2 */ export interface PanelSlot { id?: string; position?: 'top' | 'bottom'; render: PanelRender | ZonedPanelRender[]; } /** * React-typed pinned-rows slot — either a panel slot (with React renderers) * or a passthrough aggregation slot. * * @since 1.8.2 */ export type PinnedRowSlot = PanelSlot | AggregationSlot; /** * Pinned-rows config widened to accept React components as panel * `render` functions inside `slots[]`. * * Extends the core `PinnedRowsConfig` to accept React render functions * returning `ReactNode` instead of only `HTMLElement | null`. Bridging to * vanilla DOM is handled by the side-effect import * `@toolbox-web/grid-react/features/pinned-rows`. * * @since 1.8.2 */ export type PinnedRowsConfig = Omit & { slots?: PinnedRowSlot[]; }; /** * Master-detail config widened to accept a React `detailRenderer` * `(row, rowIndex) => ReactNode` in addition to the vanilla * `(row, rowIndex) => HTMLElement | string` signature. Bridging to vanilla * DOM is handled by the side-effect import * `@toolbox-web/grid-react/features/master-detail`. * * Re-exported under the same name as the core type so React users see a * single canonical `MasterDetailConfig` from `@toolbox-web/grid-react`. * * @since 1.8.2 */ export type MasterDetailConfig = Omit & { detailRenderer?: CoreMasterDetailConfig['detailRenderer'] | ((row: Record, rowIndex: number) => ReactNode); }; /** * Responsive config widened to accept a React `cardRenderer` * `(row, rowIndex, column?) => ReactNode` in addition to the vanilla * `(row, rowIndex, column?) => HTMLElement` signature. Bridging to vanilla * DOM is handled by the side-effect import * `@toolbox-web/grid-react/features/responsive`. * * Re-exported under the same name as the core type so React users see a * single canonical `ResponsivePluginConfig` from `@toolbox-web/grid-react`. * * @since 1.8.2 */ export type ResponsivePluginConfig = Omit, 'cardRenderer'> & { cardRenderer?: CoreResponsivePluginConfig['cardRenderer'] | ((row: TRow, rowIndex: number, column?: Parameters['cardRenderer']>>[2]) => ReactNode); }; /** * Feature props for declarative plugin configuration. * Each prop lazily loads its corresponding plugin when used. * * @template TRow - The row data type * @since 0.7.0 */ export interface FeatureProps { /** * Enable cell/row/range selection. * * @requires `import '@toolbox-web/grid-react/features/selection';` * * @example * ```tsx * // Shorthand - just the mode * * * // Full config * * ``` */ selection?: 'cell' | 'row' | 'range' | SelectionConfig; /** * Enable inline cell editing. * * @requires `import '@toolbox-web/grid-react/features/editing';` * * @example * ```tsx * // Enable with default trigger (dblclick) * * * // Specify trigger * * * * * // Full config with callbacks * * ``` */ editing?: boolean | 'click' | 'dblclick' | 'manual' | EditingConfig; /** * Enable clipboard copy/paste. * Requires selection to be enabled (will be auto-added). * * @requires `import '@toolbox-web/grid-react/features/clipboard';` * * @example * ```tsx * * ``` */ clipboard?: boolean | ClipboardConfig; /** * Enable right-click context menu. * * @requires `import '@toolbox-web/grid-react/features/context-menu';` * * @example * ```tsx * * * ``` */ contextMenu?: boolean | ContextMenuConfig; /** * Enable multi-column sorting. * * Multi-sort allows users to sort by multiple columns simultaneously. * For basic single-column sorting, columns with `sortable: true` work without this plugin. * Use the `sortable` prop to disable all sorting grid-wide. * * @requires `import '@toolbox-web/grid-react/features/multi-sort';` * * @example * ```tsx * // Enable multi-column sorting * * * // Limit to single column (uses plugin but restricts to 1) * * * // Full config * * ``` */ multiSort?: boolean | 'single' | 'multi' | MultiSortConfig; /** * Enable column filtering. * * @requires `import '@toolbox-web/grid-react/features/filtering';` * * @example * ```tsx * * * ``` */ filtering?: boolean | FilterConfig; /** * Enable column drag-to-reorder. * * @requires `import '@toolbox-web/grid-react/features/reorder-columns';` * * @example * ```tsx * * ``` */ reorderColumns?: boolean | ReorderConfig; /** * Enable column visibility toggle panel. * * @requires `import '@toolbox-web/grid-react/features/visibility';` * * @example * ```tsx * * ``` */ visibility?: boolean | VisibilityConfig; /** * Enable pinned/sticky columns. * Columns are pinned via the `sticky` column property. * * @requires `import '@toolbox-web/grid-react/features/pinned-columns';` * * @example * ```tsx * * ``` */ pinnedColumns?: boolean; /** * Enable multi-level column headers (column groups). * * @requires `import '@toolbox-web/grid-react/features/grouping-columns';` * * @example * ```tsx * * ``` */ groupingColumns?: boolean | GroupingColumnsConfig; /** * Enable horizontal column virtualization for wide grids. * * @requires `import '@toolbox-web/grid-react/features/column-virtualization';` * * @example * ```tsx * * ``` */ columnVirtualization?: boolean | ColumnVirtualizationConfig; /** * Enable row drag-and-drop, both within a single grid (reorder) and * across grids that share a `dropZone`. * * @requires `import '@toolbox-web/grid-react/features/row-drag-drop';` * * @example * ```tsx * // Intra-grid reorder * * * // Cross-grid transfer * * ``` */ rowDragDrop?: boolean | RowDragDropConfig; /** * Enable row grouping by field values. * * @requires `import '@toolbox-web/grid-react/features/grouping-rows';` * * @example * ```tsx * [row.department, row.team], * defaultExpanded: true, * }} /> * ``` * * @example Custom group row renderer (React JSX) * * To keep mouse-toggle behavior, either add the `group-toggle` class to a * clickable element (the plugin delegates clicks via `closest('.group-toggle')`) * or call `params.toggleExpand()` from your own handler. * * ```tsx * row.department, * groupRowRenderer: (params) => ( * * ), * }} /> * ``` */ groupingRows?: GroupingRowsConfig; /** * Enable pinned rows (aggregation/status bar). * * @requires `import '@toolbox-web/grid-react/features/pinned-rows';` * * @example * ```tsx * * ``` * * @example React JSX in panel slots * ```tsx * }, * ], * }} /> * ``` */ pinnedRows?: boolean | PinnedRowsConfig; /** * Pin selected data rows below the header as the user scrolls past them. * * @requires `import '@toolbox-web/grid-react/features/sticky-rows';` * * @example * ```tsx * // Field-name shorthand * * * // Predicate + stack mode * row.kind === 'section', * mode: 'stack', * maxStacked: 3, * }} /> * ``` */ stickyRows?: StickyRowsConfig; /** * Enable hierarchical tree view. * * @requires `import '@toolbox-web/grid-react/features/tree';` * * @example * ```tsx * * ``` */ tree?: boolean | TreeConfig; /** * Enable master-detail expandable rows. * * @requires `import '@toolbox-web/grid-react/features/master-detail';` * * @example * ```tsx * , * }} /> * ``` */ masterDetail?: MasterDetailConfig; /** * Enable responsive card layout for narrow viewports. * * @requires `import '@toolbox-web/grid-react/features/responsive';` * * @example * ```tsx * , * }} /> * ``` */ responsive?: boolean | ResponsivePluginConfig; /** * Enable undo/redo for cell edits. * Requires editing to be enabled (will be auto-added). * * @requires `import '@toolbox-web/grid-react/features/undo-redo';` * * @example * ```tsx * * ``` */ undoRedo?: boolean | UndoRedoConfig; /** * Enable CSV/JSON export functionality. * * @requires `import '@toolbox-web/grid-react/features/export';` * * @example * ```tsx * * * ``` */ export?: boolean | ExportConfig; /** * Enable print functionality. * * @requires `import '@toolbox-web/grid-react/features/print';` * * @example * ```tsx * * ``` */ print?: boolean | PrintConfig; /** * Enable pivot table functionality. * * @requires `import '@toolbox-web/grid-react/features/pivot';` * * @example * ```tsx * * ``` */ pivot?: PivotConfig; /** * Enable server-side data operations. * * @requires `import '@toolbox-web/grid-react/features/server-side';` * * @example * ```tsx * fetchData(params), * }} /> * ``` */ serverSide?: ServerSideConfig; /** * Enable styled popover tooltips on overflowing cells and headers. * * @requires `import '@toolbox-web/grid-react/features/tooltip';` * * @example * ```tsx * * * ``` */ tooltip?: boolean | TooltipConfig; /** * Enable the grid shell (header bar + collapsible tool panels). * * Config-driven: set shape via `gridConfig.features.shell` or use the * `` / `` / `` * wrappers. The shell also auto-registers in v2.x; this opt-in import * makes it explicit and tree-shakeable for v3. * * @requires `import '@toolbox-web/grid-react/features/shell';` */ shell?: boolean | ShellConfig; } /** * All feature-related props combined. * @since 0.7.0 */ export type AllFeatureProps = FeatureProps; //# sourceMappingURL=feature-props.d.ts.map