import { FocusOrigin } from '@angular/cdk/a11y'; import { AfterContentInit, ElementRef, EventEmitter, InjectionToken, NgZone, OnDestroy, TemplateRef, QueryList, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { OuiMenuContent } from './menu-content'; import { OuiMenuItem } from './menu-item'; import { OuiMenuPanel } from './menu-panel'; import { MenuPositionX, MenuPositionY } from './menu-positions'; import * as i0 from "@angular/core"; /** Default `oui-menu` options that can be overridden. */ export interface OuiMenuDefaultOptions { /** The x-axis position of the menu. */ xPosition: MenuPositionX; /** The y-axis position of the menu. */ yPosition: MenuPositionY; /** Whether the menu should overlap the menu trigger. */ overlapTrigger: boolean; /** Class to be applied to the menu's backdrop. */ backdropClass: string; /** Whether the menu has a backdrop. */ hasBackdrop?: boolean; } /** Injection token to be used to override the default options for `oui-menu`. */ export declare const OUI_MENU_DEFAULT_OPTIONS: InjectionToken; /** @docs-private */ export declare function OUI_MENU_DEFAULT_OPTIONS_FACTORY(): OuiMenuDefaultOptions; export declare class OuiMenu implements AfterContentInit, OuiMenuPanel, OnInit, OnDestroy { private _elementRef; private _ngZone; private _defaultOptions; private _keyManager; private _xPosition; private _yPosition; /** Menu items inside the current menu. */ private _items; /** Emits whenever the amount of menu items changes. */ private _itemChanges; /** Subscription to tab events on the menu panel */ private _tabSubscription; /** Config object to be passed into the menu's ngClass */ _classList: { [key: string]: boolean; }; /** Parent menu of the current menu panel. */ parentMenu: OuiMenuPanel | undefined; /** Class to be added to the backdrop element. */ backdropClass: string; /** Whether the menu has a backdrop. */ get hasBackdrop(): boolean | undefined; set hasBackdrop(value: boolean | undefined); private _hasBackdrop; /** Position of the menu in the X axis. */ get xPosition(): MenuPositionX; set xPosition(value: MenuPositionX); /** Position of the menu in the Y axis. */ get yPosition(): MenuPositionY; set yPosition(value: MenuPositionY); /** @docs-private */ templateRef: TemplateRef; /** * List of the items inside of a menu. * * @deprecated * @breaking-change 8.0.0 */ items: QueryList; /** * Menu content that will be rendered lazily. * * @docs-private */ lazyContent: OuiMenuContent; /** Whether the menu should overlap its trigger. */ get overlapTrigger(): boolean; set overlapTrigger(value: boolean); private _overlapTrigger; /** * This method takes classes set on the host oui-menu element and applies them on the * menu template that displays in the overlay container. Otherwise, it's difficult * to style the containing menu from outside the component. * * @param classes list of class names */ set panelClass(classes: string); /** Event emitted when the menu is closed. */ readonly closed: EventEmitter; /** * Event emitted when the menu is closed. * * @deprecated Switch to `closed` instead * @breaking-change 8.0.0 */ close: EventEmitter; constructor(_elementRef: ElementRef, _ngZone: NgZone, _defaultOptions: OuiMenuDefaultOptions); ngOnInit(): void; ngAfterContentInit(): void; ngOnDestroy(): void; /** Stream that emits whenever the hovered menu item changes. */ _hovered(): Observable; /** Handle a keyboard event from the menu, delegating to the appropriate action. */ _handleKeydown(event: KeyboardEvent): void; /** * Focus the first item in the menu. * * @param origin Action from which the focus originated. Used to set the correct styling. */ focusFirstItem(origin?: FocusOrigin): void; /** * Resets the active item in the menu. This is used when the menu is opened, allowing * the user to start from the first option when pressing the down arrow. */ resetActiveItem(): void; /** * Registers a menu item with the menu. * * @docs-private */ addItem(item: OuiMenuItem): void; /** * Removes an item from the menu. * * @docs-private */ removeItem(item: OuiMenuItem): void; /** * Adds classes to the menu panel based on its position. Can be used by * consumers to add specific styling based on the position. * * @param posX Position of the menu along the x axis. * @param posY Position of the menu along the y axis. * @docs-private */ setPositionClasses(posX?: MenuPositionX, posY?: MenuPositionY): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } //# sourceMappingURL=menu-directive.d.ts.map