import * as i2 from '@angular/cdk/overlay'; import { Overlay, OverlayRef } from '@angular/cdk/overlay'; import * as _angular_core 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'; /** * 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. */ 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. */ type DaffMenuYPosition = 'above' | 'below'; /** * Configuration for a menu instance. */ 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; } 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: _angular_core.ɵɵFactoryDeclaration; static ɵprov: _angular_core.ɵɵ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: _angular_core.WritableSignal; /** * The menu content to display when activated. */ daffMenuActivator: _angular_core.InputSignal | TemplateRef>; /** * An optional ID for the activator. * When set, the menu's ID is derived as `${id}-menu`. */ id: _angular_core.InputSignal; /** * The horizontal alignment of the menu relative to the activator. Defaults to `after`. */ xPosition: _angular_core.InputSignal; /** * The vertical position of the menu relative to the activator. Defaults to `below`. */ yPosition: _angular_core.InputSignal; /** * The resolved menu ID. */ protected menuId: _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: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵ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: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵ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: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵ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: _angular_core.ɵɵFactoryDeclaration; static ɵmod: _angular_core.ɵɵNgModuleDeclaration; static ɵinj: _angular_core.ɵɵInjectorDeclaration; } /** * @docs-private */ 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. */ declare const DAFF_MENU_ITEM_TOKEN: _angular_core.InjectionToken; declare const provideDaffMenuItemToken: (klass: _angular_core.Type) => _angular_core.ExistingProvider; export { DAFF_MENU_COMPONENTS, DAFF_MENU_ITEM_TOKEN, DaffMenuActivatorDirective, DaffMenuComponent, DaffMenuItemComponent, DaffMenuModule, DaffMenuService, provideDaffMenuItemToken }; export type { DaffMenuConfig, DaffMenuSlot, DaffMenuXPosition, DaffMenuYPosition };