UNPKG

@adaptabletools/adaptable

Version:

Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

69 lines (68 loc) 3.26 kB
import * as React from 'react'; import { type CollapsibleWizardCardSurface } from '../../Utilities/wizardSelection'; export interface CollapsibleWizardCardProps { title: React.ReactNode; /** Help text in the header when expanded. */ help?: React.ReactNode; /** * Help text in the header when collapsed. Uses `help` when omitted. * Pass `false` to hide collapsed header help. */ collapsedHelp?: React.ReactNode | false; /** Shown in the card body while collapsed — typically tags or a short value summary. */ summary: React.ReactNode; /** One-line value shown in the header when another card in the accordion is expanded. */ compactSummary?: React.ReactNode; /** When true, `compactSummary` remains interactive (e.g. toggle buttons). */ compactSummaryInteractive?: boolean; /** Full-opacity visual in the header row (all states) — e.g. a live badge preview. */ headerVisual?: React.ReactNode; /** Trailing header controls (all states) — e.g. delete. Clicks do not toggle expand. */ headerActions?: React.ReactNode; children: React.ReactNode; defaultExpanded?: boolean; expanded?: boolean; /** When true, only the header row is shown (another card in the accordion is expanded). */ compact?: boolean; /** When true, the expanded card grows to fill remaining section height (for scrollable lists). */ fillAvailable?: boolean; onExpandedChange?: (expanded: boolean) => void; className?: string; bodyClassName?: string; /** `panel` = Layout wizard (same bg as parent); `popup` = module popups (Dashboard). */ surface?: CollapsibleWizardCardSurface; 'data-name'?: string; } export type WizardCardAccordionBinding = { expanded: boolean; compact: boolean; fillAvailable: boolean; onExpandedChange: (expanded: boolean) => void; }; export type WizardCardAccordionBindCardOptions = { /** When expanded, grow to fill remaining section height. Default: false. */ fillAvailable?: boolean; }; export type WizardCardAccordionOptions = { /** Section default for `fillAvailable` when not set per card. Default: false. */ fillExpandedCard?: boolean; }; export type WizardCardAccordionBindCard = (id: string, options?: WizardCardAccordionBindCardOptions) => WizardCardAccordionBinding; export declare function getWizardAccordionSectionClassName(hasExpandedCard: boolean, fillExpandedCard?: boolean): string; export declare function renderCompactColumnTags(columnIds: string[], getFriendlyName: (columnId: string) => string, options?: { maxVisible?: number; emptyLabel?: string; }): React.ReactNode; export declare const CollapsibleWizardCard: React.FC<CollapsibleWizardCardProps>; export declare function useWizardCardAccordion(initialExpandedId: string | null, options?: WizardCardAccordionOptions): { expandedId: string; hasExpandedCard: boolean; expandedFillsSpace: boolean; bindCard: WizardCardAccordionBindCard; fillExpandedCard: boolean; setExpandedId: React.Dispatch<React.SetStateAction<string>>; }; /** Collapsed card body: selected value tag(s) only — no description text. */ export declare const CollapsibleWizardValueSummary: React.FC<{ value: React.ReactNode; }>;