import * as i2 from '@angular/cdk/overlay'; import { Overlay, OverlayRef } from '@angular/cdk/overlay'; import * as i0 from '@angular/core'; import { Injector, ViewContainerRef, TemplateRef, Type, OnDestroy, ChangeDetectorRef, AfterContentInit, AfterViewInit, ElementRef } from '@angular/core'; import { Observable } from 'rxjs'; import * as i6 from '@daffodil/design'; import { DaffLazyComponent, DaffPrefixDirective } from '@daffodil/design'; import * as i1 from '@angular/common'; import { ConfigurableFocusTrapFactory, FocusableOption } from '@angular/cdk/a11y'; /** * Configuration for a menu instance. */ interface DaffMenuConfig { /** * A unique identifier for the menu instance. */ menuId?: string; } type DaffMenuSlot = TemplateRef | DaffLazyComponent | Type; declare class DaffMenuService { protected overlay: Overlay; private injector; protected _overlay: OverlayRef | null; private _activator; private $_open; open$: Observable; constructor(overlay: Overlay, injector: Injector); /** * @docs-private */ protected _createOverlay(activatorElement: ViewContainerRef, component: DaffMenuSlot, config?: DaffMenuConfig): Promise; /** * @docs-private */ protected _destroyOverlay(): void; close(): void; open(activator: ViewContainerRef, component: DaffMenuSlot, config?: DaffMenuConfig): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Directive that triggers the menu to open/close. Applied to the button that activates the menu. The selector doubles as an input for the menu content to display. * * @example * ```html * * ``` */ declare class DaffMenuActivatorDirective implements OnDestroy { private service; private viewContainerRef; private cdRef; private _destroyed$; private _defaultMenuId; protected _open: boolean; readonly isOpen: i0.WritableSignal; /** * The menu content to display when activated. */ daffMenuActivator: Type | TemplateRef; /** * An optional ID for the activator. * When set, the menu's ID is derived as `${id}-menu`. */ id: i0.InputSignal; /** * The resolved menu ID. */ protected menuId: i0.Signal; /** * @docs-private */ get ariaExpanded(): "true" | "false"; constructor(service: DaffMenuService, viewContainerRef: ViewContainerRef, cdRef: ChangeDetectorRef); /** * @docs-private */ ngOnDestroy(): void; /** * @docs-private */ focus(): void; /** * @docs-private */ onClick(event: MouseEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * The floating panel that contains menu items. * * @example * ```html * * * * * * Settings * * * ``` */ declare class DaffMenuComponent implements AfterContentInit, AfterViewInit { private _focusTrapFactory; private _elementRef; private menuService; /** * @docs-private */ readonly config: DaffMenuConfig; private _focusTrap; private _keyManager; /** * @docs-private * * Content children that provide `DAFF_MENU_ITEM_TOKEN` are treated as menu items. * This includes both `daff-menu-item` components and any custom directives that also provide the token. */ private _items; constructor(_focusTrapFactory: ConfigurableFocusTrapFactory, _elementRef: ElementRef, menuService: DaffMenuService, /** * @docs-private */ config: DaffMenuConfig); /** * @docs-private * * Handles keyboard navigation. */ handleKeydown(event: KeyboardEvent): void; /** * @docs-private */ ngAfterContentInit(): void; /** * @docs-private */ ngAfterViewInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Individual clickable items within the menu. Applied to ` * ``` */ declare class DaffMenuItemComponent implements FocusableOption { private _elementRef; private _menuService; /** * @docs-private */ _prefix: DaffPrefixDirective; constructor(_elementRef: ElementRef, _menuService: DaffMenuService); /** * @docs-private */ onClick(): void; /** * Focus the menu item. */ focus(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * @deprecated in favor of {@link DAFF_MENU_COMPONENTS} Deprecated in version 0.92.0. Will be removed in version 0.95.0. */ declare class DaffMenuModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * @docs-private */ declare const DAFF_MENU_COMPONENTS: readonly [typeof DaffMenuComponent, typeof DaffMenuActivatorDirective, typeof DaffMenuItemComponent]; /** * Injection token/provider pair used to identify menu items. * * `DaffMenuComponent` uses `@ContentChildren(DAFF_MENU_ITEM_TOKEN)` to discover * its menu items. Use `provideDaffMenuItemToken` in component providers to register * custom directives and components as menu items alongside native `daff-menu-item` elements. */ declare const DAFF_MENU_ITEM_TOKEN: i0.InjectionToken; declare const provideDaffMenuItemToken: (klass: i0.Type) => i0.ExistingProvider; export { DAFF_MENU_COMPONENTS, DAFF_MENU_ITEM_TOKEN, DaffMenuActivatorDirective, DaffMenuComponent, DaffMenuItemComponent, DaffMenuModule, DaffMenuService, provideDaffMenuItemToken }; export type { DaffMenuConfig, DaffMenuSlot };