import { NgpOffset, NgpPlacement, NgpFlip, NgpShift, NgpOverlayContent, NgpOffsetInput, NgpFlipInput, NgpShiftInput } from 'ng-primitives/portal'; export { injectOverlayContext as injectMenuContext } from 'ng-primitives/portal'; import * as _angular_core from '@angular/core'; import { Provider, Signal, WritableSignal, ElementRef } from '@angular/core'; import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import * as ng_primitives_state from 'ng-primitives/state'; import { StateInjectionOptions } from 'ng-primitives/state'; import { Observable, Subject } from 'rxjs'; import { FocusOrigin } from '@angular/cdk/a11y'; import { HoverTransitTracker } from 'ng-primitives/internal'; type NgpMenuTriggerType = 'click' | 'hover' | 'focus' | 'enter' | 'arrowkey'; interface NgpMenuConfig { /** * Define the offset of the menu relative to the trigger. * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis. * @default 4 */ offset: NgpOffset; /** * Define the placement of the menu relative to the trigger. * @default 'bottom-start' */ placement: NgpPlacement; /** * Define whether the menu should flip when there is not enough space for the menu. * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. * @default true */ flip: NgpFlip; /** * Define the container element or selector in to which the menu should be attached. * @default 'body' */ container: HTMLElement | string | null; /** * Defines how the menu behaves when the window is scrolled. * @default scroll */ scrollBehavior: 'reposition' | 'block' | 'close'; /** * Configure shift behavior to keep the menu in view. * Can be a boolean to enable/disable, or an object with padding and limiter options. * @default undefined (enabled by default in overlay) */ shift: NgpShift; /** * Whether focus should wrap around when reaching the end of the menu. * @default true */ wrap: boolean; /** * Cooldown duration in milliseconds. * When moving from one menu to another within this duration, * the showDelay is skipped for the new menu. * @default 0 */ cooldown: number; /** * Define which trigger types are enabled for the menu. * @default ['click'] */ triggers: NgpMenuTriggerType[]; /** * Define the delay before the menu is displayed (hover/focus triggers). * @default 0 */ showDelay: number; /** * Define the delay before the menu is hidden (hover/focus triggers). * @default 0 */ hideDelay: number; } /** * Provide the default Menu configuration * @param config The Menu configuration * @returns The provider */ declare function provideMenuConfig(config: Partial): Provider[]; /** * The `NgpMenuItem` directive represents a menu item. */ declare class NgpMenuItem { /** Whether the menu item is disabled */ readonly disabled: _angular_core.InputSignalWithTransform; /** Whether the menu should close when this item is selected */ readonly closeOnSelect: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpMenuItemState { } interface NgpMenuItemProps { /** * Whether the menu item is disabled. */ readonly disabled?: Signal; /** * Whether the menu should close when this item is selected. * @default signal(true) */ readonly closeOnSelect?: Signal; /** * The ARIA role for the menu item. * @default 'menuitem' */ readonly role?: string; } declare const ngpMenuItem: ({ disabled, closeOnSelect, role, }: NgpMenuItemProps) => {}; declare const injectMenuItemState: { (): Signal<{}>; (options: ng_primitives_state.StateInjectionOptions): Signal<{} | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{}> | Signal<{} | null>; }; declare const provideMenuItemState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpMenuItemCheckbox` directive represents a menu item that can be toggled on and off. */ declare class NgpMenuItemCheckbox { /** Whether the checkbox is checked. When defined the checkbox is controlled. */ readonly checked: _angular_core.InputSignalWithTransform; /** The default checked state for uncontrolled usage */ readonly defaultChecked: _angular_core.InputSignalWithTransform; /** Event emitted when the checked state changes */ readonly checkedChange: _angular_core.OutputEmitterRef; /** Whether the menu item checkbox is disabled */ readonly disabled: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpMenuItemCheckboxState { /** * Whether the checkbox is checked. */ readonly checked: Signal; /** * Emits when the checked state changes. */ readonly checkedChange: Observable; /** * Toggle the checkbox value. */ toggle(): void; /** * Set the default checked state used in uncontrolled mode. */ setDefaultChecked(value: boolean): void; } interface NgpMenuItemCheckboxProps { /** * Whether the checkbox is checked. When defined the checkbox is controlled. */ readonly checked?: Signal; /** * The default checked state for uncontrolled usage. */ readonly defaultChecked?: Signal; /** * Whether the checkbox is disabled. */ readonly disabled?: Signal; /** * Callback fired when the checked state changes. */ readonly onCheckedChange?: (checked: boolean) => void; } declare const ngpMenuItemCheckbox: ({ checked: _checked, defaultChecked: _defaultChecked, disabled, onCheckedChange, }: NgpMenuItemCheckboxProps) => NgpMenuItemCheckboxState; declare const injectMenuItemCheckboxState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideMenuItemCheckboxState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpMenuItemIndicator` directive renders inside a checkbox or radio menu item * and exposes `data-checked` based on the parent item's checked state. */ declare class NgpMenuItemIndicator { constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The `NgpMenuItemRadioGroup` directive represents a group of radio menu items. */ declare class NgpMenuItemRadioGroup { /** The current value of the radio group. When defined the group is controlled. */ readonly value: _angular_core.InputSignal; /** The default value for uncontrolled usage */ readonly defaultValue: _angular_core.InputSignal; /** Event emitted when the value changes */ readonly valueChange: _angular_core.OutputEmitterRef; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpMenuItemRadioGroupState { /** * The current value of the radio group. */ readonly value: Signal; /** * Emits when the value changes. */ readonly valueChange: Observable; /** * Select a radio item by value. */ select(value: string): void; /** * Set the default value used in uncontrolled mode. */ setDefaultValue(value: string | null): void; } interface NgpMenuItemRadioGroupProps { /** * The current value of the radio group. When defined the group is controlled. */ readonly value?: Signal; /** * The default value for uncontrolled usage. */ readonly defaultValue?: Signal; /** * Callback fired when the value changes. */ readonly onValueChange?: (value: string) => void; } declare const ngpMenuItemRadioGroup: ({ value: _value, defaultValue: _defaultValue, onValueChange, }: NgpMenuItemRadioGroupProps) => NgpMenuItemRadioGroupState; declare const injectMenuItemRadioGroupState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideMenuItemRadioGroupState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpMenuItemRadio` directive represents a radio menu item within a radio group. */ declare class NgpMenuItemRadio { /** The value this radio item represents */ readonly value: _angular_core.InputSignal; /** Whether the radio item is disabled */ readonly disabled: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpMenuItemRadioState { /** * Whether the radio item is checked. */ readonly checked: Signal; } interface NgpMenuItemRadioProps { /** * The value this radio item represents. */ readonly value: Signal; /** * Whether the radio item is disabled. */ readonly disabled?: Signal; } declare const ngpMenuItemRadio: ({ value, disabled }: NgpMenuItemRadioProps) => NgpMenuItemRadioState; declare const injectMenuItemRadioState: { (): Signal; (options: ng_primitives_state.StateInjectionOptions): Signal; (options?: ng_primitives_state.StateInjectionOptions): Signal | Signal; }; declare const provideMenuItemRadioState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpMenuTrigger` directive allows you to turn an element into a menu trigger. */ declare class NgpMenuTrigger { /** * Access the global menu configuration. */ private readonly config; /** * Access the menu template ref or ComponentType. */ readonly menu: _angular_core.InputSignal | undefined>; /** * Define if the trigger should be disabled. * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Define the placement of the menu relative to the trigger. * @default 'bottom-start' */ readonly placement: _angular_core.InputSignal; /** * Define the offset of the menu relative to the trigger. * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis. * @default 4 */ readonly offset: _angular_core.InputSignalWithTransform; /** * Define whether the menu should flip when there is not enough space for the menu. * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. * @default true */ readonly flip: _angular_core.InputSignalWithTransform; /** * Configure shift behavior to keep the menu in view. * Can be a boolean to enable/disable, or an object with padding and limiter options. * @default undefined (enabled by default in overlay) */ readonly shift: _angular_core.InputSignalWithTransform; /** * Define the container in which the menu should be attached. * @default document.body */ readonly container: _angular_core.InputSignal; /** * Defines how the menu behaves when the window is scrolled. * @default 'block' */ readonly scrollBehavior: _angular_core.InputSignal<"reposition" | "block" | "close">; /** * Define the cooldown duration in milliseconds. * When moving from one menu to another within this duration, * the showDelay is skipped for the new menu. * @default 0 */ readonly cooldown: _angular_core.InputSignalWithTransform; /** * Provide context to the menu. This can be used to pass data to the menu content. */ readonly context: _angular_core.InputSignal; /** * Define an anchor element for positioning the menu. * If provided, the menu will be positioned relative to this element instead of the trigger. * * The anchor is live, so rebinding it moves an open menu. * * An input only reaches this directive on the next change detection pass, which a press * can outrun - use `setAnchor()` instead when the anchor is claimed during one. */ readonly anchor: _angular_core.InputSignal; /** * Define which trigger types are enabled for the menu. * @default ['click'] */ readonly triggers: _angular_core.InputSignal; /** * Define the delay before the menu is displayed (hover/focus triggers). * @default 0 */ readonly showDelay: _angular_core.InputSignalWithTransform; /** * Define the delay before the menu is hidden (hover/focus triggers). * @default 0 */ readonly hideDelay: _angular_core.InputSignalWithTransform; /** * The menu trigger state. */ private readonly state; /** * Show the menu. */ show(): void; /** * Hide the menu. * @param origin - The focus origin * @internal */ hide(origin?: FocusOrigin): void; /** * Toggle the menu. * @param event - The mouse event */ toggle(event: MouseEvent): void; /** * Set the anchor the menu is positioned against, taking effect immediately rather than * on the next change detection pass. * * Reach for this over `ngpMenuTriggerAnchor` when the anchor is claimed during a press. * Outside-press dismissal is decided on a capture-phase `mouseup`, which a fast tap can * deliver in the same frame as the `pointerdown` that claimed the anchor - before the * binding has reached this directive, so the press dismisses the menu instead of moving * it. Writing the anchor here is visible to that check straight away. * @param anchor - The new anchor element */ setAnchor(anchor: HTMLElement | null): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[ngpMenuTrigger]", ["ngpMenuTrigger"], { "menu": { "alias": "ngpMenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpMenuTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpMenuTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpMenuTriggerOffset"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpMenuTriggerFlip"; "required": false; "isSignal": true; }; "shift": { "alias": "ngpMenuTriggerShift"; "required": false; "isSignal": true; }; "container": { "alias": "ngpMenuTriggerContainer"; "required": false; "isSignal": true; }; "scrollBehavior": { "alias": "ngpMenuTriggerScrollBehavior"; "required": false; "isSignal": true; }; "cooldown": { "alias": "ngpMenuTriggerCooldown"; "required": false; "isSignal": true; }; "context": { "alias": "ngpMenuTriggerContext"; "required": false; "isSignal": true; }; "anchor": { "alias": "ngpMenuTriggerAnchor"; "required": false; "isSignal": true; }; "triggers": { "alias": "ngpMenuTriggerOpenTriggers"; "required": false; "isSignal": true; }; "showDelay": { "alias": "ngpMenuTriggerShowDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "ngpMenuTriggerHideDelay"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } /** * Where the menu is placed relative to its trigger. * @deprecated Identical to `NgpPlacement` from `ng-primitives/portal` - use that instead. * Will be removed in a future major. */ type NgpMenuPlacement = NgpPlacement; interface NgpMenuTriggerState { /** * The menu template or component. */ readonly menu: WritableSignal | undefined>; /** * The computed placement of the menu. */ readonly placement: WritableSignal; /** * Whether the menu is open. */ readonly open: Signal; /** * The offset of the menu. */ readonly offset: WritableSignal; /** * The disabled state of the trigger. */ readonly disabled: WritableSignal; /** * Whether the menu should flip when there is not enough space. */ readonly flip: WritableSignal; /** * The container in which the menu should be attached. * @default document.body */ readonly container: WritableSignal; /** * The context provided to the menu. */ readonly context: WritableSignal; /** * Define an anchor element for positioning the menu. * If provided, the menu will be positioned relative to this element instead of the trigger. */ readonly anchor: WritableSignal; /** * The focus origin that was used to open the menu. * @internal */ readonly openOrigin: Signal; /** * Set whether the trigger is disabled. * @param isDisabled - Whether the trigger is disabled */ setDisabled(isDisabled: boolean): void; /** * Set whether the menu should flip when there is not enough space. * @param shouldFlip - Whether the menu should flip */ setFlip(shouldFlip: NgpFlip): void; /** * Set the placement of the menu. * @param placement - The new placement */ setPlacement(placement: NgpPlacement): void; /** * Set the offset of the menu. * @param offset - The new offset */ setOffset(offset: NgpOffset): void; /** * Set the context provided to the menu. * @param context - The new context */ setContext(context: T): void; /** * Set the anchor element the menu is positioned against. An open menu moves to the * new anchor. * * When re-anchoring in response to a press, do it on `pointerdown` rather than `click`: * outside-press dismissal is decided on a capture-phase `mouseup`, which runs before * a bubbling `click`, so an anchor claimed there arrives too late and the press that * was meant to move the menu dismisses it instead. * @param anchor - The new anchor element */ setAnchor(anchor: HTMLElement | null): void; /** * Set the container in which the menu should be attached. Takes effect the * next time the menu is opened; it does not move a menu that is already open. * @param container - The new container */ setContainer(container: HTMLElement | string | null): void; /** * Show the menu. * @param origin - The focus origin */ show(origin?: FocusOrigin): void; /** * Hide the menu. * @param origin - The focus origin * @internal */ hide(origin?: FocusOrigin): void; /** * Toggle the menu. * @param event - The mouse event */ toggle(event: MouseEvent): void; /** * Set the menu content. * @param menu - The new menu */ setMenu(menu: NgpOverlayContent): void; /** * Set whether the pointer is over the menu content. * @param isOver - Whether the pointer is over the content * @internal */ setPointerOverContent(isOver: boolean): void; } interface NgpMenuTriggerProps { /** * Whether the trigger is disabled. */ readonly disabled?: Signal; /** * The menu template or component. */ readonly menu?: Signal | undefined>; /** * The placement of the menu. */ readonly placement?: Signal; /** * The offset of the menu. */ readonly offset?: Signal; /** * Whether the menu should flip when there is not enough space. */ readonly flip?: Signal; /** * The container in which the menu should be attached. */ readonly container?: Signal; /** * Configure shift behavior to keep the menu in view. */ readonly shift?: Signal; /** * How the menu behaves when the window is scrolled. */ readonly scrollBehavior?: Signal<'reposition' | 'block' | 'close'>; /** * Context to provide to the menu. */ readonly context?: Signal; /** * Define an anchor element for positioning the menu. * If provided, the menu will be positioned relative to this element instead of the trigger. */ readonly anchor?: Signal; /** * Cooldown duration in milliseconds. */ readonly cooldown?: Signal; /** * Which trigger types are enabled. */ readonly triggers?: Signal; /** * The delay before showing the menu. */ readonly showDelay?: Signal; /** * The delay before hiding the menu. */ readonly hideDelay?: Signal; } declare const NgpMenuTriggerStateToken: _angular_core.InjectionToken | undefined>; placement: WritableSignal; offset: WritableSignal; disabled: WritableSignal; context: WritableSignal; anchor: WritableSignal; open: Signal; openOrigin: WritableSignal; show: (origin?: FocusOrigin) => void; hide: (origin?: FocusOrigin) => void; toggle: (event: MouseEvent) => void; setDisabled: (isDisabled: boolean) => void; setMenu: (newMenu: NgpOverlayContent | undefined) => void; setFlip: (shouldFlip: NgpFlip) => void; setPlacement: (newPlacement: NgpPlacement) => void; setOffset: (newOffset: NgpOffset) => void; setContext: (newContext: unknown) => void; setAnchor: (newAnchor: HTMLElement | null) => void; setContainer: (newContainer: HTMLElement | string | null) => void; setPointerOverContent: (isOver: boolean) => void; flip: WritableSignal; container: WritableSignal; }>>; declare const ngpMenuTrigger: ({ disabled: _disabled, menu: _menu, placement: _placement, offset: _offset, flip: _flip, shift: _shift, context: _context, anchor: _anchor, container: _container, scrollBehavior, cooldown, triggers, showDelay, hideDelay, }: NgpMenuTriggerProps) => { menu: WritableSignal | undefined>; placement: WritableSignal; offset: WritableSignal; disabled: WritableSignal; context: WritableSignal; anchor: WritableSignal; open: Signal; openOrigin: WritableSignal; show: (origin?: FocusOrigin) => void; hide: (origin?: FocusOrigin) => void; toggle: (event: MouseEvent) => void; setDisabled: (isDisabled: boolean) => void; setMenu: (newMenu: NgpOverlayContent | undefined) => void; setFlip: (shouldFlip: NgpFlip) => void; setPlacement: (newPlacement: NgpPlacement) => void; setOffset: (newOffset: NgpOffset) => void; setContext: (newContext: T) => void; setAnchor: (newAnchor: HTMLElement | null) => void; setContainer: (newContainer: HTMLElement | string | null) => void; setPointerOverContent: (isOver: boolean) => void; flip: WritableSignal; container: WritableSignal; }; declare const provideMenuTriggerState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; declare function injectMenuTriggerState(options?: StateInjectionOptions): Signal>; /** * The `NgpMenu` is a container for menu items. */ declare class NgpMenu { private readonly config; /** * Whether focus should wrap around when reaching the end of the menu. * @default true */ readonly wrap: _angular_core.InputSignalWithTransform; private readonly state; constructor(); /** @internal Close the menu and any parent menus */ closeAllMenus(origin: FocusOrigin): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpMenuState extends HoverTransitTracker { /** * Close the menu and any parent menus. * @param origin - The focus origin */ closeAllMenus(origin: FocusOrigin): void; /** * Subject that emits when submenus should be closed. * @internal */ readonly closeSubmenus: Subject; /** * The panel's host element - the shared container a submenu trigger * suppresses pointer-events on while a sibling's hover-bridge is active. * @internal */ readonly element: ElementRef; } interface NgpMenuProps { } declare const ngpMenu: ({}: NgpMenuProps) => { setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; isTransitBlocked(trigger: HTMLElement): boolean; closeAllMenus: (origin: FocusOrigin) => void; closeSubmenus: Subject; element: ElementRef; }; declare const injectMenuState: { (): _angular_core.Signal<{ setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; isTransitBlocked(trigger: HTMLElement): boolean; closeAllMenus: (origin: FocusOrigin) => void; closeSubmenus: Subject; element: ElementRef; }>; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{ setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; isTransitBlocked(trigger: HTMLElement): boolean; closeAllMenus: (origin: FocusOrigin) => void; closeSubmenus: Subject; element: ElementRef; } | null>; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{ setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; isTransitBlocked(trigger: HTMLElement): boolean; closeAllMenus: (origin: FocusOrigin) => void; closeSubmenus: Subject; element: ElementRef; } | null> | _angular_core.Signal<{ setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; isTransitBlocked(trigger: HTMLElement): boolean; closeAllMenus: (origin: FocusOrigin) => void; closeSubmenus: Subject; element: ElementRef; }>; }; declare const provideMenuState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; declare class NgpSubmenuTrigger { /** * Access the submenu template ref. */ readonly menu: _angular_core.InputSignal | undefined>; /** * Define if the trigger should be disabled. * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Define the placement of the menu relative to the trigger. * @default 'right-start' */ readonly placement: _angular_core.InputSignal; /** * Define the offset of the menu relative to the trigger. * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis. * @default 0 */ readonly offset: _angular_core.InputSignalWithTransform; /** * Define whether the menu should flip when there is not enough space for the menu. * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. * @default true */ readonly flip: _angular_core.InputSignalWithTransform; /** * Define the container in which the menu should be attached. * @default document.body */ readonly container: _angular_core.InputSignal; /** * Access the menu trigger state. */ private readonly state; /** * Show the menu. */ show(): void; /** * Hide the menu. */ hide(origin?: FocusOrigin): void; /** * Toggle the menu. * @param event - The mouse event */ toggle(event: MouseEvent): void; /** * Focus the trigger element. * @param origin - The focus origin */ focus(origin?: FocusOrigin): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration, never>; static ɵdir: _angular_core.ɵɵDirectiveDeclaration, "[ngpSubmenuTrigger]", ["ngpSubmenuTrigger"], { "menu": { "alias": "ngpSubmenuTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "ngpSubmenuTriggerDisabled"; "required": false; "isSignal": true; }; "placement": { "alias": "ngpSubmenuTriggerPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "ngpSubmenuTriggerOffset"; "required": false; "isSignal": true; }; "flip": { "alias": "ngpSubmenuTriggerFlip"; "required": false; "isSignal": true; }; "container": { "alias": "ngpSubmenuTriggerContainer"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>; } interface NgpSubmenuTriggerState { /** * The menu template or component. */ readonly menu: WritableSignal | undefined>; /** * The computed placement of the menu. */ readonly placement: WritableSignal; /** * Whether the menu is open. */ readonly open: Signal; /** * The offset of the menu. */ readonly offset: WritableSignal; /** * The disabled state of the trigger. */ readonly disabled: WritableSignal; /** * Whether the menu should flip when there is not enough space. */ readonly flip: WritableSignal; /** * The container in which the menu should be attached. * @default document.body */ readonly container: WritableSignal; /** * The focus origin used to open the submenu. * Used by the submenu's focus trap for :focus-visible styling. * @internal */ readonly openOrigin: Signal; /** * Show the menu. * @param origin - The focus origin (keyboard, mouse, touch, or program) */ show(origin?: FocusOrigin): void; /** * Hide the menu. * @param origin - The focus origin */ hide(origin?: FocusOrigin): void; /** * Toggle the menu. * @param event - The mouse event */ toggle(event: MouseEvent): void; /** * Set whether the trigger is disabled. * @param isDisabled - Whether the trigger is disabled */ setDisabled(isDisabled: boolean): void; /** * Set the menu template or component. * @param menu - The menu content */ setMenu(menu: NgpOverlayContent | undefined): void; /** * Set the placement of the menu. * @param placement - The menu placement */ setPlacement(placement: NgpPlacement): void; /** * Set the offset of the menu. * @param offset - The menu offset */ setOffset(offset: NgpOffset): void; /** * Set whether the menu should flip when there is not enough space. * @param shouldFlip - Whether the menu should flip */ setFlip(shouldFlip: NgpFlip): void; /** * Set the container in which the menu should be attached. Takes effect the * next time the menu is opened; it does not move a menu that is already open. * @param container - The new container */ setContainer(container: HTMLElement | string | null): void; /** * Focus the trigger element. * @param origin - The focus origin */ focus(origin: FocusOrigin): void; /** * Set whether the pointer is over the submenu content. Entering the submenu * tears down the hover bridge (the pointer arrived safely). * @param isOver - Whether the pointer is over the content * @internal */ setPointerOverContent(isOver: boolean): void; } interface NgpSubmenuTriggerProps { /** * Whether the trigger is disabled. */ readonly disabled?: Signal; /** * The menu template or component. */ readonly menu?: Signal | undefined>; /** * The placement of the menu. */ readonly placement?: Signal; /** * The offset of the menu. */ readonly offset?: Signal; /** * Whether the menu should flip when there is not enough space. */ readonly flip?: Signal; /** * The container in which the menu should be attached. */ readonly container?: Signal; } declare const NgpSubmenuTriggerStateToken: _angular_core.InjectionToken; offset: WritableSignal; disabled: WritableSignal; menu: WritableSignal | undefined>; flip: WritableSignal; open: Signal; openOrigin: WritableSignal; show: (origin?: FocusOrigin) => void; hide: (origin?: FocusOrigin) => void; toggle: (event: MouseEvent) => void; setDisabled: (isDisabled: boolean) => void; setMenu: (newMenu: NgpOverlayContent | undefined) => void; setFlip: (shouldFlip: NgpFlip) => void; setPlacement: (newPlacement: NgpPlacement) => void; setOffset: (newOffset: NgpOffset) => void; setContainer: (newContainer: HTMLElement | string | null) => void; focus: (origin: FocusOrigin) => void; setPointerOverContent: (isOver: boolean) => void; container: WritableSignal; }>>; declare const ngpSubmenuTrigger: ({ disabled: _disabled, menu: _menu, placement: _placement, offset: _offset, flip: _flip, container: _container, }: NgpSubmenuTriggerProps) => { placement: WritableSignal; offset: WritableSignal; disabled: WritableSignal; menu: WritableSignal | undefined>; flip: WritableSignal; open: Signal; openOrigin: WritableSignal; show: (origin?: FocusOrigin) => void; hide: (origin?: FocusOrigin) => void; toggle: (event: MouseEvent) => void; setDisabled: (isDisabled: boolean) => void; setMenu: (newMenu: NgpOverlayContent | undefined) => void; setFlip: (shouldFlip: NgpFlip) => void; setPlacement: (newPlacement: NgpPlacement) => void; setOffset: (newOffset: NgpOffset) => void; setContainer: (newContainer: HTMLElement | string | null) => void; focus: (origin: FocusOrigin) => void; setPointerOverContent: (isOver: boolean) => void; container: WritableSignal; }; declare const injectSubmenuTriggerState: { (): Signal<{ placement: WritableSignal; offset: WritableSignal; disabled: WritableSignal; menu: WritableSignal | undefined>; flip: WritableSignal; open: Signal; openOrigin: WritableSignal; show: (origin?: FocusOrigin) => void; hide: (origin?: FocusOrigin) => void; toggle: (event: MouseEvent) => void; setDisabled: (isDisabled: boolean) => void; setMenu: (newMenu: NgpOverlayContent | undefined) => void; setFlip: (shouldFlip: NgpFlip) => void; setPlacement: (newPlacement: NgpPlacement) => void; setOffset: (newOffset: NgpOffset) => void; setContainer: (newContainer: HTMLElement | string | null) => void; focus: (origin: FocusOrigin) => void; setPointerOverContent: (isOver: boolean) => void; container: WritableSignal; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ placement: WritableSignal; offset: WritableSignal; disabled: WritableSignal; menu: WritableSignal | undefined>; flip: WritableSignal; open: Signal; openOrigin: WritableSignal; show: (origin?: FocusOrigin) => void; hide: (origin?: FocusOrigin) => void; toggle: (event: MouseEvent) => void; setDisabled: (isDisabled: boolean) => void; setMenu: (newMenu: NgpOverlayContent | undefined) => void; setFlip: (shouldFlip: NgpFlip) => void; setPlacement: (newPlacement: NgpPlacement) => void; setOffset: (newOffset: NgpOffset) => void; setContainer: (newContainer: HTMLElement | string | null) => void; focus: (origin: FocusOrigin) => void; setPointerOverContent: (isOver: boolean) => void; container: WritableSignal; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ placement: WritableSignal; offset: WritableSignal; disabled: WritableSignal; menu: WritableSignal | undefined>; flip: WritableSignal; open: Signal; openOrigin: WritableSignal; show: (origin?: FocusOrigin) => void; hide: (origin?: FocusOrigin) => void; toggle: (event: MouseEvent) => void; setDisabled: (isDisabled: boolean) => void; setMenu: (newMenu: NgpOverlayContent | undefined) => void; setFlip: (shouldFlip: NgpFlip) => void; setPlacement: (newPlacement: NgpPlacement) => void; setOffset: (newOffset: NgpOffset) => void; setContainer: (newContainer: HTMLElement | string | null) => void; focus: (origin: FocusOrigin) => void; setPointerOverContent: (isOver: boolean) => void; container: WritableSignal; }> | Signal<{ placement: WritableSignal; offset: WritableSignal; disabled: WritableSignal; menu: WritableSignal | undefined>; flip: WritableSignal; open: Signal; openOrigin: WritableSignal; show: (origin?: FocusOrigin) => void; hide: (origin?: FocusOrigin) => void; toggle: (event: MouseEvent) => void; setDisabled: (isDisabled: boolean) => void; setMenu: (newMenu: NgpOverlayContent | undefined) => void; setFlip: (shouldFlip: NgpFlip) => void; setPlacement: (newPlacement: NgpPlacement) => void; setOffset: (newOffset: NgpOffset) => void; setContainer: (newContainer: HTMLElement | string | null) => void; focus: (origin: FocusOrigin) => void; setPointerOverContent: (isOver: boolean) => void; container: WritableSignal; } | null>; }; declare const provideSubmenuTriggerState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpMenuTriggerGroup` directive wraps a set of sibling `NgpMenuTrigger` elements, * such as the items of a vertical navigation menu, so that moving the pointer from an * open menu's trigger toward the menu itself does not accidentally open a sibling * trigger it passes over on the way. */ declare class NgpMenuTriggerGroup { /** * Whether the group coordinates hover between its sibling triggers. Turn it off * when the siblings no longer sit between a trigger and its menu - a collapsed * icon rail, say, where the pointer reaches the panel without crossing anything, * so the coordination only costs the siblings their responsiveness. Takes effect * from the next transit; one already in flight finishes as it started. */ readonly siblingTracking: _angular_core.InputSignalWithTransform; protected readonly state: { isTransitBlocked: (trigger: HTMLElement) => boolean; setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; siblingContainer: _angular_core.Signal; }; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpMenuTriggerGroupState extends HoverTransitTracker { /** * The shared container a root NgpMenuTrigger suppresses pointer-events on * while its hover bridge is active, or null while sibling tracking is off. * @internal */ readonly siblingContainer: Signal; } interface NgpMenuTriggerGroupProps { /** Whether the group coordinates hover between its sibling triggers. */ siblingTracking?: Signal; } declare const NgpMenuTriggerGroupStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{ isTransitBlocked: (trigger: HTMLElement) => boolean; setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; siblingContainer: Signal; }>>; declare const ngpMenuTriggerGroup: ({ siblingTracking }: NgpMenuTriggerGroupProps) => { isTransitBlocked: (trigger: HTMLElement) => boolean; setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; siblingContainer: Signal; }; declare const injectMenuTriggerGroupState: { (): Signal<{ isTransitBlocked: (trigger: HTMLElement) => boolean; setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; siblingContainer: Signal; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ isTransitBlocked: (trigger: HTMLElement) => boolean; setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; siblingContainer: Signal; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ isTransitBlocked: (trigger: HTMLElement) => boolean; setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; siblingContainer: Signal; } | null> | Signal<{ isTransitBlocked: (trigger: HTMLElement) => boolean; setTransitSource(trigger: HTMLElement): void; clearTransitSource(trigger: HTMLElement): void; siblingContainer: Signal; }>; }; declare const provideMenuTriggerGroupState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; export { NgpMenu, NgpMenuItem, NgpMenuItemCheckbox, NgpMenuItemIndicator, NgpMenuItemRadio, NgpMenuItemRadioGroup, NgpMenuTrigger, NgpMenuTriggerGroup, NgpMenuTriggerGroupStateToken, NgpMenuTriggerStateToken, NgpSubmenuTrigger, NgpSubmenuTriggerStateToken, injectMenuItemCheckboxState, injectMenuItemRadioGroupState, injectMenuItemRadioState, injectMenuItemState, injectMenuState, injectMenuTriggerGroupState, injectMenuTriggerState, injectSubmenuTriggerState, ngpMenu, ngpMenuItem, ngpMenuItemCheckbox, ngpMenuItemRadio, ngpMenuItemRadioGroup, ngpMenuTrigger, ngpMenuTriggerGroup, ngpSubmenuTrigger, provideMenuConfig, provideMenuItemCheckboxState, provideMenuItemRadioGroupState, provideMenuItemRadioState, provideMenuItemState, provideMenuState, provideMenuTriggerGroupState, provideMenuTriggerState, provideSubmenuTriggerState }; export type { NgpMenuConfig, NgpMenuItemCheckboxProps, NgpMenuItemCheckboxState, NgpMenuItemProps, NgpMenuItemRadioGroupProps, NgpMenuItemRadioGroupState, NgpMenuItemRadioProps, NgpMenuItemRadioState, NgpMenuItemState, NgpMenuPlacement, NgpMenuProps, NgpMenuState, NgpMenuTriggerGroupProps, NgpMenuTriggerGroupState, NgpMenuTriggerProps, NgpMenuTriggerState, NgpMenuTriggerType, NgpSubmenuTriggerProps, NgpSubmenuTriggerState };