export interface GroupChip { binding: string; header: string; sort: 'asc' | 'desc' | null; } /** * Toggles for the grouping bar. Everything defaults to enabled; set a field to * false to remove that capability. Passed via the grid's `groupPanel` option, * which also accepts `true` (all defaults) or `false` (no panel). * * Purely visual bits are not flags here — hide them with CSS instead: the bar * icon is `.apg-grouppanel-icon` and each chip's drag grip is * `.apg-group-chip-grip` (e.g. `.apg-group-chip-grip { display: none }`). */ export interface GroupPanelOptions { /** Text shown when no columns are grouped. */ placeholder?: string; /** Maximum number of grouping levels. Default 6. */ maxGroups?: number; /** Drag a column header into the bar to group by it. Default true. */ allowDragToGroup?: boolean; /** Drag chips to reorder grouping levels. Default true. */ allowReorder?: boolean; /** Click a chip (or use the menu) to sort the level. Default true. */ allowSort?: boolean; /** Remove a level with its ✕ (or the menu). Default true. */ allowRemove?: boolean; /** Right-click a chip for a menu of grouping actions. Default true. */ contextMenu?: boolean; } /** Fully-resolved {@link GroupPanelOptions}; every field is set. */ export interface ResolvedGroupPanel { placeholder: string; maxGroups: number; allowDragToGroup: boolean; allowReorder: boolean; allowSort: boolean; allowRemove: boolean; contextMenu: boolean; } export interface GroupPanelCallbacks { chips: () => GroupChip[]; onRemove: (binding: string) => void; onReorder: (from: number, to: number) => void; onToggleSort: (binding: string) => void; /** Set a level's sort explicitly: true = ascending, false = descending, null = clear. */ onSort: (binding: string, dir: boolean | null) => void; onExpandAll: () => void; onCollapseAll: () => void; } /** * The grouping bar. Shows a chip per active group level — each with a drag grip, * its sort direction, and a remove button — separated by chevrons to read as a * hierarchy. Users can reorder levels by dragging chips, toggle a level's sort * by clicking it, remove a level with its ✕, and right-click a chip for a menu * of grouping actions. Each of these is individually switchable through * {@link ResolvedGroupPanel}. Dropping a column header onto the bar is handled by * the header dragger, which uses {@link hostElement} as the drop zone and * {@link highlight} to show it. */ export declare class GroupPanel { private host; private cb; private opts; private list; private placeholderEl; private marker; private menu; private dragFrom; private dragging; private startX; private insertAt; constructor(host: HTMLElement, cb: GroupPanelCallbacks, opts: ResolvedGroupPanel); get hostElement(): HTMLElement; highlight(on: boolean): void; render(): void; dispose(): void; private readonly onContextMenu; private readonly onClick; private readonly onDown; private readonly onMove; private readonly onUp; }