/** * DataTableTabs — saved-filter folder tabs for any kit DataTable. * ---------------------------------------------------------------------------- * A folder-tab strip attached above a table region. Each tab captures and * restores its own AG Grid filter model (tabs are LIVE views — any filter * edit rewrites the active tab); a "+" button saves the current filter as a * new tab; tabs rename via double-click / F2 and remove via Delete/Backspace * or the pointer-only ✕. * * ARIA: a real APG tablist built on Radix Tabs primitives with * `activationMode="manual"` (arrow keys rove without applying filter models; * Enter/Space activates). Every trigger points at ONE stable hand-rolled * tabpanel that wraps `children` — the grid never remounts on tab switch and * no dangling ARIA refs exist. The "+" button and the rename editor are * SIBLINGS of the tablist (tablist purity). * * Grid wiring rides the narrow `DataTableTabsGridSeam` resolved at call time * (`getTable={() => tableRef.current}`) — see use-data-table-filter-tabs.ts * for the sync engine. Works against any `DataTableHandle`-shaped ref, * including `PatientTableHandle`. */ import { type ReactNode } from 'react'; import { type VariantProps } from 'class-variance-authority'; import { type DataTableTabsGridSeam, type SavedTab } from './use-data-table-filter-tabs'; export declare const dataTableTabsListVariants: (props?: ({ size?: "md" | "lg" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; export declare const dataTableTabsTriggerVariants: (props?: ({ size?: "md" | "lg" | null | undefined; } & import("class-variance-authority/types").ClassProp) | undefined) => string; /** Curated imperative handle — also the agent-adapter surface. */ export interface DataTableTabsHandle { getTabs: () => SavedTab[]; getActiveTabId: () => string | null; /** Snapshots the outgoing tab, applies the incoming tab's filter model. */ selectTab: (id: string) => void; /** Default model = a copy of the current live model (grid view unchanged). */ addTab: (label?: string, filterModel?: Record) => string; /** No-op on locked tabs and empty/whitespace labels. */ renameTab: (id: string, label: string) => void; /** No-op on locked tabs and the last remaining tab. */ removeTab: (id: string) => void; } export interface DataTableTabsProps extends VariantProps { /** * Resolve the grid seam at call time — `undefined` until the grid is ready * (same convention as `ToolbarProvider.getApi`). Any `DataTableHandle` * satisfies it: `getTable={() => tableRef.current}`. */ getTable: () => DataTableTabsGridSeam | null | undefined; /** Controlled tabs — pair with `onTabsChange`. */ tabs?: SavedTab[]; /** Uncontrolled seed. Default: one unfiltered tab. */ defaultTabs?: SavedTab[]; onTabsChange?: (tabs: SavedTab[]) => void; activeTabId?: string; defaultActiveTabId?: string; onActiveTabChange?: (id: string) => void; /** * Opt-in localStorage persistence under `data-table-tabs:`. * Ignored (with a DEV warning) while `tabs` is controlled. The active tab * id is deliberately not persisted. */ persistKey?: string; /** Persist the active tab id too (needs `persistKey`). Default `false`. */ persistActiveTab?: boolean; /** Capture/restore the quick-filter text alongside the model. Default false. */ captureQuickFilter?: boolean; /** Apply the active tab's model on mount + switch. Default true. */ applyOnActivate?: boolean; /** Show the "+" button. Default true. */ allowAdd?: boolean; /** Allow rename (double-click / F2 / popover editor). Default true. */ allowRename?: boolean; /** Allow removal (Delete/Backspace / ✕). Default true. */ allowRemove?: boolean; /** Tab cap — "+" disables at the cap. Default 8. */ maxTabs?: number; /** Factory for new tabs; `index` is 1-based. */ createTab?: (index: number) => SavedTab; /** Id factory — default `crypto.randomUUID()`. */ makeTabId?: () => string; /** Open the rename editor on a freshly-added tab. Default true. */ renameOnAdd?: boolean; /** `data-component-id` + agent instance id. */ id?: string; className?: string; /** Accessible tablist name — defaults to the localised "Saved views". */ 'aria-label'?: string; /** The table region — rendered inside the single stable tabpanel. */ children: ReactNode; } export declare const DataTableTabs: import("react").ForwardRefExoticComponent>; export type { SavedTab, DataTableTabsGridSeam }; //# sourceMappingURL=data-table-tabs.d.ts.map