import * as i2 from "@angular/cdk/overlay"; import { Overlay, OverlayRef } from "@angular/cdk/overlay"; import * as i0 from "@angular/core"; import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, Injector, OnDestroy, TemplateRef, Type, ViewContainerRef } 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"; /** * The horizontal alignment of the menu relative to its activator. * * - `after` lines the menu's left edge up with the activator's left edge. * - `before` lines the menu's right edge up with the activator's right edge. */ export type DaffMenuXPosition = 'before' | 'after'; /** * The vertical position of the menu relative to its activator. * * - `below` drops the menu down from the activator's bottom edge. * - `above` raises the menu up from the activator's top edge. */ export type DaffMenuYPosition = 'above' | 'below'; /** * Configuration for a menu instance. */ export interface DaffMenuConfig { /** * A unique identifier for the menu instance. */ menuId?: string; /** * The horizontal alignment of the menu relative to its activator. Defaults to `after`. */ xPosition?: DaffMenuXPosition; /** * The vertical position of the menu relative to its activator. Defaults to `below`. */ yPosition?: DaffMenuYPosition; } export type DaffMenuSlot = TemplateRef | DaffLazyComponent | Type; export 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 * * ``` */ export declare class DaffMenuActivatorDirective implements OnDestroy { private service; private viewContainerRef; private cdRef; private _destroyed$; private _defaultMenuId; protected _open: boolean; readonly isOpen: import("@angular/core").WritableSignal; /** * The menu content to display when activated. */ daffMenuActivator: import("@angular/core").InputSignal | TemplateRef>; /** * An optional ID for the activator. * When set, the menu's ID is derived as `${id}-menu`. */ id: import("@angular/core").InputSignal; /** * The horizontal alignment of the menu relative to the activator. Defaults to `after`. */ xPosition: import("@angular/core").InputSignal; /** * The vertical position of the menu relative to the activator. Defaults to `below`. */ yPosition: import("@angular/core").InputSignal; /** * The resolved menu ID. */ protected menuId: import("@angular/core").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 * * * ``` */ export 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 ` * ``` */ export 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 1.0.0. */ export declare class DaffMenuModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * @docs-private */ export declare const DAFF_MENU_COMPONENTS: readonly [typeof DaffMenuComponent, typeof DaffMenuActivatorDirective, typeof DaffMenuItemComponent, typeof DaffPrefixDirective]; /** * 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. */ export declare const DAFF_MENU_ITEM_TOKEN: import("@angular/core").InjectionToken, provideDaffMenuItemToken: (klass: import("@angular/core").Type) => import("@angular/core").ExistingProvider;