/** * The **Import Menu** — a floating *Import ▾* launcher button anchored to the * grid's top-right corner that opens a dropdown of import sources (Excel / CSV / * TSV / Paste From Clipboard). * * It is a **pure UI** component in the same mould as * {@link import('./filters-tool-panel').FiltersToolPanel}: it owns no import * logic and never touches grid data. Choosing a file-based source opens a * hidden `` (so no browser-default file control is ever * visible) and forwards the picked {@link File} to its host via * {@link ImportMenuDeps.onSelectFile}; the clipboard item calls * {@link ImportMenuDeps.onSelectClipboard}. The host (the grid) runs the actual * import through the {@link import('../engines/import/import-engine').ImportEngine}. * * Every visual is class-driven — all colors, spacing, radii and typography come * from theme CSS variables (see `import-menu.css.ts`); the component sets no * inline styles. * * @packageDocumentation */ import type { IconRenderer } from '../icons/icon-renderer'; import { ImportSourceType } from '../types/import.types'; /** Collaborators the {@link ImportMenu} needs from the grid, injected as a DI bag. */ export interface ImportMenuDeps { /** Renders themed, registry-backed icons. */ readonly iconRenderer: IconRenderer; /** The sources to offer, in order (from `GridOptions.import.formats`). */ readonly getFormats: () => ImportSourceType[]; /** Invoked with the picked file for a file-based source (Excel/CSV/TSV). */ readonly onSelectFile: (source: ImportSourceType, file: File) => void; /** Invoked when the user chooses *Paste From Clipboard*. */ readonly onSelectClipboard: () => void; } /** Floating Import launcher + dropdown. Opt-in via `GridOptions.import.enabled`. */ export declare class ImportMenu { private readonly deps; private wrapperEl; private launcherEl; private menuEl; private fileInputEl; private itemEls; private isOpen; /** Source awaiting a file selection from the hidden input. */ private pendingSource; private readonly boundOutsideDown; private readonly boundKeydown; constructor(deps: ImportMenuDeps); /** * Builds the launcher, dropdown and hidden file input and appends them to the * grid wrapper. Call once per grid instance. * * @param wrapperEl - The `.pg-grid` root element the dropdown floats over. * @param toolsBarEl - The shared `.pg-grid__tools` bar the launcher docks into * so it lays out beside other launchers instead of stacking. */ mount(wrapperEl: HTMLElement, toolsBarEl: HTMLElement): void; /** Opens the dropdown. Idempotent. */ open(): void; /** Closes the dropdown. Idempotent. */ close(): void; /** Toggles the dropdown. */ toggle(): void; /** Tears down DOM and listeners. */ destroy(): void; private buildLauncher; private buildMenu; private buildFileInput; private onItemActivated; private onKeydown; } //# sourceMappingURL=import-menu.d.ts.map