import { ReactNode, ReactElement } from 'react'; /** * Context object passed to the responsive card render function. */ export interface ResponsiveCardContext { /** The row data for this card */ row: TRow; /** The row index (zero-based) */ index: number; } /** * Get the responsive card renderer for a grid element. * @internal */ export declare function getResponsiveCardRenderer(gridElement: HTMLElement): ((ctx: ResponsiveCardContext) => ReactNode) | undefined; /** * Props for the GridResponsiveCard component. */ export interface GridResponsiveCardProps { /** * Render function for the card content. * Receives the row data and row index. * * @example * ```tsx * * {({ row, index }) => ( *
* {row.name} * {row.name} *
* )} *
* ``` */ children: (ctx: ResponsiveCardContext) => ReactNode; /** * Card row height in pixels. * Use 'auto' for dynamic height based on content. * @default 'auto' */ cardRowHeight?: number | 'auto'; } /** * Component for defining custom card layouts in responsive mode. * * Renders a `` custom element in the light DOM that * the ResponsivePlugin picks up to render custom cards in mobile/narrow layouts. * * ## Usage * * ```tsx * import { DataGrid, GridResponsiveCard } from '@toolbox-web/grid-react'; * import { ResponsivePlugin } from '@toolbox-web/grid/all'; * * function EmployeeGrid() { * const config = { * plugins: [new ResponsivePlugin({ breakpoint: 500 })], * // ... other config * }; * * return ( * * * {({ row, index }) => ( *
* *
* {row.name} * {row.department} *
*
* )} *
*
* ); * } * ``` * * ## How it works * * 1. This component renders a `` element in the grid's light DOM * 2. The ReactGridAdapter detects this element and creates a card renderer * 3. When the grid enters responsive mode, the plugin calls your render function for each row * 4. The React component is rendered into the card container * * @category Component */ export declare function GridResponsiveCard(props: GridResponsiveCardProps): ReactElement; export declare namespace GridResponsiveCard { var displayName: string; } //# sourceMappingURL=grid-responsive-card.d.ts.map