import { ReactNode, ReactElement } from 'react'; /** * Context object passed to the detail panel render function. */ export interface DetailPanelContext { /** The row data for this detail panel */ row: TRow; /** The row index */ rowIndex: number; } /** * Get the detail renderer for a grid element. * @internal */ export declare function getDetailRenderer(gridElement: HTMLElement): ((ctx: DetailPanelContext) => ReactNode) | undefined; /** * Props for the GridDetailPanel component. */ export interface GridDetailPanelProps { /** * Render function for the detail panel content. * Receives the row data and row index. * * @example * ```tsx * * {({ row }) => } * * ``` */ children: (ctx: DetailPanelContext) => ReactNode; /** * Whether to show the expand/collapse column. * @default true */ showExpandColumn?: boolean; /** * Animation style for expand/collapse. * - 'slide': Smooth height animation (default) * - 'fade': Opacity transition * - false: No animation * @default 'slide' */ animation?: 'slide' | 'fade' | false; } /** * Component for defining a master-detail panel within a DataGrid. * * Renders a `` custom element in the light DOM that the * MasterDetailPlugin picks up to render expandable row details. * * ## Usage * * ```tsx * import { DataGrid, GridDetailPanel } from '@toolbox-web/grid-react'; * import { MasterDetailPlugin } from '@toolbox-web/grid/all'; * * function EmployeeGrid() { * const config = { * plugins: [new MasterDetailPlugin()], * // ... other config * }; * * return ( * * * {({ row }) => ( *
*

{row.firstName} {row.lastName}

*

Department: {row.department}

*

Email: {row.email}

*
* )} *
*
* ); * } * ``` * * ## How it works * * 1. This component renders a `` element in the grid's light DOM * 2. The ReactGridAdapter detects this element and creates a detail renderer * 3. When a row is expanded, the adapter calls your render function * 4. The React component is rendered into the detail row container * * @category Component */ export declare function GridDetailPanel(props: GridDetailPanelProps): ReactElement; export declare namespace GridDetailPanel { var displayName: string; } //# sourceMappingURL=grid-detail-panel.d.ts.map