/** * Generated bundle index. Do not edit. */ import { FocusMonitor, FocusOrigin } from "@angular/cdk/a11y"; import { Direction, Directionality } from "@angular/cdk/bidi"; import * as i0 from "@angular/core"; import { AfterContentInit, AfterViewInit, AnimationCallbackEvent, ApplicationRef, ChangeDetectorRef, ElementRef, EventEmitter, InjectionToken, Injector, OnDestroy, QueryList, TemplateRef, ViewContainerRef } from "@angular/core"; import { Observable, Subject } from "rxjs"; import { NxCheckboxComponent } from "@allianz/ng-aquila/checkbox"; import { BooleanInput } from "@angular/cdk/coercion"; import * as i1 from "@angular/common"; import * as i2 from "@angular/cdk/overlay"; import { Overlay, ScrollStrategy } from "@angular/cdk/overlay"; import * as i3 from "@allianz/ng-aquila/icon"; import { NxTriggerButton } from "@allianz/ng-aquila/overlay"; import * as i10 from "@allianz/ng-aquila/divider"; /** * Context menu content that will be rendered lazily once the menu is opened. */ export declare class NxContextMenuContentDirective implements OnDestroy { private readonly _template; private readonly _appRef; private readonly _injector; private readonly _viewContainerRef; private readonly _document; private _portal; private _outlet; /** Emits when the menu content has been attached. */ readonly _attached: Subject; constructor(_template: TemplateRef, _appRef: ApplicationRef, _injector: Injector, _viewContainerRef: ViewContainerRef, _document: Document); /** * Attaches the content with a particular context. * @docs-private */ attach(context?: any): void; /** * Detaches the content. * @docs-private */ detach(): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * Base for Context Menu Item Wrapper. * Solely for resolving circular dependency between the Item Wrap and the Context Menu itself */ declare abstract class NxContextMenuItemWrapBase { abstract _items: QueryList; } /** * Base for Context Menu Item. * Solely for resolving circular dependency between the Menu Item and the Context Menu itself */ declare abstract class NxContextMenuItemBase { abstract get parentMenu(): NxContextMenuComponent | null; abstract focus(): void; } export type NxContextMenuItemSelectable = 'single' | 'multi' | boolean | null; /** * This directive is intended to be used inside an nx-context-menu tag. * It exists mostly to set the role attribute, disabled state and styling. */ export declare class NxContextMenuItemComponent extends NxContextMenuItemBase implements OnDestroy, AfterViewInit { private readonly _elementRef; private readonly _document; private readonly _cdr; private readonly _focusMonitor; private readonly _parentMenu; /** Stream that emits when the context menu item is hovered. */ readonly _hovered: Subject; private readonly _allianzOneOptions; protected readonly _isAllianzOne: import("@angular/core").Signal; /** * Unique name for the radio indicator. Plain `nx-radio` share `name=null` and the * radio's app-wide `UniqueSelectionDispatcher` would uncheck radios in other items/groups. */ protected readonly _radioItemName: string; /** * - `'single'` : renders a built-in radio indicator and sets `role="menuitemradio"`. * - `'multi'` : renders a built-in checkbox indicator and sets `role="menuitemcheckbox"`. * - `true` : legacy passive mode, reserves indicator space for the consumer's own content. Consumers must bind their own role. * - `null` / `false` : disables built-in selection. */ set selectable(value: NxContextMenuItemSelectable | ''); get selectable(): NxContextMenuItemSelectable; protected readonly _selectable: import("@angular/core").WritableSignal; /** Whether this item is currently selected. Only meaningful when `selectable` is set. */ readonly selected: import("@angular/core").InputSignalWithTransform; /** * Role the consumer set statically on the host. Used as the fallback so a consumer-provided * role survives in plain mode instead of being overwritten by the `[attr.role]` host binding. */ private readonly _userRole; /** Resolved ARIA role based on the selection mode. */ protected readonly _role: import("@angular/core").Signal; /** Whether the context menu item is disabled. */ set disabled(value: BooleanInput); get disabled(): boolean; private _disabled; /** Whether the context menu close on select. */ set disableCloseOnSelect(value: BooleanInput); get disableCloseOnSelect(): boolean; private _disableCloseOnSelect; /** Whether the context menu item is highlighted. */ _highlighted: boolean; /** Whether the context menu item acts as a trigger for a sub-menu. */ _triggersSubmenu: boolean; protected readonly _hasLeadingIcon: import("@angular/core").WritableSignal; private _updateHasLeadingIcon; constructor(_elementRef: ElementRef, _document: Document | null, _cdr: ChangeDetectorRef, _focusMonitor: FocusMonitor, _parentMenu: NxContextMenuComponent | null); /** Focuses this context menu item. */ focus(origin?: FocusOrigin): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** Returns the host DOM element. */ _getHostElement(): HTMLElement; /** * Blocks the click event from propagating to the origin component if this is disabled. * If not disabled it has no effect * @param event The MouseEvent that happened on click */ _handleClick(event: MouseEvent): void; /** Prevents the default element actions if it is disabled. */ _checkDisabled(event: Event): void; /** Emits to the hover stream. */ _handleMouseEnter(): void; /** Gets the label to be used when determining whether the option should be focused. */ getLabel(): string; get parentMenu(): NxContextMenuComponent | null; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class NxContextMenuItemCheckboxDirective { checkbox: NxCheckboxComponent; onKeyDown(event: KeyboardEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** * This directive is need when [nx-context-menu-item] is not directly under [nx-context-menu]. * @example * * // blocker * // come to rescue * * * * * */ export declare class NxContextMenuItemWrapComponent extends NxContextMenuItemWrapBase { _items: QueryList; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class NxContextMenuComponent implements AfterContentInit, OnDestroy { private _keyManager; private _items; private readonly _wrap; private readonly _init; private readonly _injector; private _firstItemFocusRef?; /** Config object to be passed into the menu's ngClass */ _classList: { [key: string]: boolean; }; /** Current state of the panel animation. */ /** Emits whenever an animation on the menu completes. */ readonly _animationDone: Subject; /** Whether the menu is animating. */ _isAnimating: boolean; /** Parent menu of the current menu panel. */ parentMenu?: NxContextMenuComponent; /** * Layout direction of the menu. * @docs-private */ direction: Direction; /** @docs-private */ templateRef: TemplateRef; /** * Menu content that will be rendered lazily. * @docs-private */ lazyContent: NxContextMenuContentDirective; /** Event emitted when the menu is closed. */ readonly closed: EventEmitter; private readonly _destroyed; protected _onClick(event: Event): void; constructor(); 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. */ 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; onAnimationEnter(event: AnimationCallbackEvent): void; onAnimationLeave(event: AnimationCallbackEvent): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** Default top padding of the menu panel. */ export declare const MENU_PANEL_TOP_PADDING = 8; export declare const MENU_PANEL_OFFSET_Y = 8; export declare const MENU_PANEL_OFFSET_X = 8; export type NxContextMenuScrollStrategy = 'close' | 'reposition'; export type NxContextMenuMode = 'button' | 'cursor'; /** Injection token that determines the scroll handling while a context-menu is open. */ export declare const NX_CONTEXT_MENU_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>; /** * @docs-private * @deprecated No longer used. * @deletion-target 18.0.0 */ export declare function NX_CONTEXT_MENU_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay): () => ScrollStrategy; /** * @docs-private * @deprecated No longer used. * @deletion-target 18.0.0 */ export declare const NX_CONTEXT_MENU_SCROLL_STRATEGY_PROVIDER: { provide: InjectionToken<() => ScrollStrategy>; useFactory: typeof NX_CONTEXT_MENU_SCROLL_STRATEGY_PROVIDER_FACTORY; deps: (typeof Overlay)[]; }; interface Point { x: number; y: number; } /** * This directive is intended to be used in conjunction with an nx-context-menu tag. * It is responsible for toggling the display of the provided context menu instance. */ export declare class NxContextMenuTriggerDirective implements AfterContentInit, OnDestroy { #private; private readonly _overlay; private readonly _element; private readonly _viewContainerRef; private readonly _parentMenu; private readonly _contextMenuItemInstance; private readonly _dir; private readonly _triggerButton; private readonly _defaultScrollStrategyFactory; private readonly _cdr; private readonly _focusMonitor; private _portal; private _overlayRef; private _contextMenuOpen; private _closingActionsSubscription; private _contextMenuCloseSubscription; private readonly _document; private readonly _documentClickObservable; /** Strategy factory that will be used to handle scrolling while the context-menu panel is open. */ private _scrollStrategyFactory; /** References the context menu instance that the trigger is associated with. */ set contextMenu(contextMenu: NxContextMenuComponent); get contextMenu(): NxContextMenuComponent; private _contextMenu; set scrollStrategy(value: NxContextMenuScrollStrategy | null | undefined); get scrollStrategy(): NxContextMenuScrollStrategy | null | undefined; /** Whether the context menu is open. */ get contextMenuOpen(): boolean; /** The text direction of the containing app. */ private get dir(); /** Data to be passed along to any lazily-rendered content. */ contextMenuData: object; /** * Sets the mode of this context menu trigger. * 'button' (default): Opens by clicking the trigger * 'cursor': Opens at the cursor position by right clicking anywhere on the trigger. */ readonly mode: import("@angular/core").InputSignal; /** Event emitted when the associated context menu is opened. */ readonly contextMenuOpened: EventEmitter; /** Event emitted when the associated context menu is closed. */ readonly contextMenuClosed: EventEmitter; private readonly _destroyed; private _rightClicked; /** The focus origin the context menu was last opened with, used to restore focus on close. */ private _openedBy; constructor(_overlay: Overlay, _element: ElementRef, _viewContainerRef: ViewContainerRef, _parentMenu: NxContextMenuComponent | null, _contextMenuItemInstance: NxContextMenuItemComponent | null, _dir: Directionality | null, _triggerButton: NxTriggerButton | null, _defaultScrollStrategyFactory: () => ScrollStrategy, _cdr: ChangeDetectorRef, _focusMonitor: FocusMonitor); ngAfterContentInit(): void; ngOnDestroy(): void; /** Whether the context menu triggers a sub-menu or a top-level one. */ triggersSubmenu(): boolean; /** Toggles the context menu between the open and closed states. */ toggleContextMenu(origin?: FocusOrigin): void; /** Opens the context menu. */ openContextMenu(origin?: FocusOrigin, position?: Point): void; /** Closes the context menu. */ closeContextMenu(): void; private getScrollStrtegyFactory; /** Closes the context menu and does the necessary cleanup. */ private _destroyMenu; /** * This method sets the context menu state to open and focuses the first item if * the context menu was opened via the keyboard. */ private _initContextMenu; /** * Focuses the context menu trigger. * * When an origin is provided, focus is restored through the `FocusMonitor` so the * trigger reflects the correct focus origin (e.g. shows the keyboard focus indicator). * Relying on the browser/`FocusMonitor` heuristic alone is unreliable here because * SPACE activates a menu item on `keyup` and the menu closes after an exit animation, * by which point the keyboard interaction is no longer detected. */ focus(origin?: FocusOrigin): void; /** * This method resets the context menu when it's closed, most importantly restoring * focus to the context menu trigger if the context menu was opened via the keyboard. */ private _resetContextMenu; /** Set state rather than toggle to support triggers sharing a menu. */ private _setIsContextMenuOpen; /** * This method checks that a valid instance of NxContextMenuComponent has been passed into * nxContextMenuTriggerFor. If not, an exception is thrown. */ private _checkContextMenu; /** * This method creates the overlay from the provided menu's template and saves its * OverlayRef so that it can be attached to the DOM when openContextMenu is called. */ private _createOverlay; /** * This method builds the configuration object needed to create the overlay, the OverlayState. */ private _getOverlayConfig; /** * Sets the position on a position strategy so the overlay is placed at the cursor. * @param positionStrategy Strategy whose position to update. * @param cursorPosition Position of the cursor. */ private _setPositionToCursor; /** * Sets the appropriate positions on a position strategy * so the overlay connects with the trigger correctly. * @param positionStrategy Strategy whose position to update. */ private _setPosition; /** * Returns a stream that emits whenever an action that should close the context menu occurs. */ private _contextMenuClosingActions; /** Handles mouse presses on the trigger. */ _handleMousedown(event: MouseEvent): void; _handleRightClick(event: MouseEvent): void; /** Handles key presses on the trigger. */ _handleKeydown(event: KeyboardEvent): void; /** Handles click events on the trigger. */ _handleClick(event: MouseEvent): void; private _waitForClose; /** Handles the cases where the user hovers over the trigger. */ private _handleHover; /** Gets the portal that should be attached to the overlay. */ private _getPortal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export declare class NxContextMenuHeaderComponent { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class NxContextMenuGroupComponent { private readonly _idService; readonly label: import("@angular/core").InputSignal; readonly labelId: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export declare class NxContextMenuModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export {};