import * as _angular_core from '@angular/core'; import { InjectionToken, Provider, Signal, WritableSignal } from '@angular/core'; import { NgpOrientation } from 'ng-primitives/common'; import { NgpPlacement, NgpOffset, NgpFlip, NgpShift, NgpOverlayContent, NgpOffsetInput, NgpFlipInput, NgpShiftInput } from 'ng-primitives/portal'; import { BooleanInput, NumberInput } from '@angular/cdk/coercion'; import * as ng_primitives_state from 'ng-primitives/state'; import { FocusOrigin } from '@angular/cdk/a11y'; interface NgpNavigationMenuConfig { /** * Define the orientation of the navigation menu. * @default 'horizontal' */ orientation: NgpOrientation; /** * Define the delay in milliseconds before the content is shown. * @default 200 */ showDelay: number; /** * Define the delay in milliseconds before the content is hidden. * @default 150 */ hideDelay: number; /** * Define the placement of the content relative to the trigger. * @default 'bottom-start' */ placement: NgpPlacement; /** * Define the offset of the content relative to the trigger. * Can be a number (applies to mainAxis) or an object with mainAxis, crossAxis, and alignmentAxis. * @default 4 */ offset: NgpOffset; /** * Define whether the content should flip when there is not enough space. * Can be a boolean to enable/disable, or an object with padding and fallbackPlacements options. * @default true */ flip: NgpFlip; /** * Configure shift behavior to keep the content 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; /** * Define the container element or selector in to which the content should be attached. * @default 'body' */ container: HTMLElement | string | null; /** * Whether focus should wrap around when reaching the end of the list. * @default true */ wrap: boolean; /** * Define the cooldown duration in milliseconds. * When moving from one navigation menu item to another within this duration, * the showDelay is skipped for the new item. * @default 300 */ cooldown: number; } declare const defaultNavigationMenuConfig: NgpNavigationMenuConfig; declare const NgpNavigationMenuConfigToken: InjectionToken; /** * Provide the default NavigationMenu configuration * @param config The NavigationMenu configuration * @returns The provider */ declare function provideNavigationMenuConfig(config: Partial): Provider[]; /** * Inject the NavigationMenu configuration * @returns The global NavigationMenu configuration */ declare function injectNavigationMenuConfig(): NgpNavigationMenuConfig; /** * The `NgpNavigationMenuContent` directive is the content panel displayed when a trigger is activated. * It has its own roving focus group for keyboard navigation within the content. */ declare class NgpNavigationMenuContent { /** * Access the global navigation menu configuration. */ private readonly config; /** * The orientation for keyboard navigation within the content. * Use 'vertical' for list layouts (default), 'horizontal' for grid layouts. * @default 'vertical' */ readonly orientation: _angular_core.InputSignal; /** * Whether focus should wrap around when reaching the end of the content. * @default true */ readonly wrap: _angular_core.InputSignalWithTransform; private readonly state; constructor(); /** * Close the content panel. */ close(): void; /** * Focus the first focusable item in the content. */ focusFirst(): void; /** * Focus the last focusable item in the content. */ focusLast(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The state for the NgpNavigationMenuContent directive. */ interface NgpNavigationMenuContentState { /** * The unique ID for this content panel. */ readonly id: string; /** * Whether the content is currently open. */ readonly open: Signal; /** * The orientation for keyboard navigation within the content. */ readonly orientation: Signal; /** * Close the content. * @param origin The focus origin */ close(origin?: FocusOrigin): void; /** * Focus the first focusable item in the content. */ focusFirst(): void; /** * Focus the last focusable item in the content. */ focusLast(): void; /** * Set the orientation for keyboard navigation within the content. * @param orientation The orientation ('vertical' for lists, 'horizontal' for grids) */ setOrientation(orientation: NgpOrientation): void; } /** * The props for the NgpNavigationMenuContent state. */ interface NgpNavigationMenuContentProps { /** * The orientation for keyboard navigation within the content. * Use 'horizontal' for grid layouts, 'vertical' for lists. */ readonly orientation?: Signal; } declare const NgpNavigationMenuContentStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{ id: string; open: Signal; orientation: Signal; close: (origin?: FocusOrigin) => void; focusFirst: () => void; focusLast: () => void; setOrientation: (value: NgpOrientation) => void; }>>; declare const ngpNavigationMenuContent: ({ orientation: _orientation }: NgpNavigationMenuContentProps) => { id: string; open: Signal; orientation: Signal; close: (origin?: FocusOrigin) => void; focusFirst: () => void; focusLast: () => void; setOrientation: (value: NgpOrientation) => void; }; declare const injectNavigationMenuContentState: { (): Signal<{ id: string; open: Signal; orientation: Signal; close: (origin?: FocusOrigin) => void; focusFirst: () => void; focusLast: () => void; setOrientation: (value: NgpOrientation) => void; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ id: string; open: Signal; orientation: Signal; close: (origin?: FocusOrigin) => void; focusFirst: () => void; focusLast: () => void; setOrientation: (value: NgpOrientation) => void; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ id: string; open: Signal; orientation: Signal; close: (origin?: FocusOrigin) => void; focusFirst: () => void; focusLast: () => void; setOrientation: (value: NgpOrientation) => void; }> | Signal<{ id: string; open: Signal; orientation: Signal; close: (origin?: FocusOrigin) => void; focusFirst: () => void; focusLast: () => void; setOrientation: (value: NgpOrientation) => void; } | null>; }; declare const provideNavigationMenuContentState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpNavigationMenuContentItem` directive represents an item inside navigation menu content. * It participates in roving focus navigation within the content panel. */ declare class NgpNavigationMenuContentItem { /** * Whether the item is disabled. * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The state for the NgpNavigationMenuContentItem directive. */ interface NgpNavigationMenuContentItemState { /** * Whether the item is disabled. */ readonly disabled: Signal; /** * Set whether the item is disabled. * @param isDisabled Whether the item is disabled */ setDisabled(isDisabled: boolean): void; } /** * The props for the NgpNavigationMenuContentItem state. */ interface NgpNavigationMenuContentItemProps { /** * Whether the item is disabled. */ readonly disabled?: Signal; } declare const NgpNavigationMenuContentItemStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{ disabled: Signal; setDisabled: (isDisabled: boolean) => void; }>>; declare const ngpNavigationMenuContentItem: ({ disabled: _disabled }: NgpNavigationMenuContentItemProps) => { disabled: Signal; setDisabled: (isDisabled: boolean) => void; }; declare const injectNavigationMenuContentItemState: { (): Signal<{ disabled: Signal; setDisabled: (isDisabled: boolean) => void; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ disabled: Signal; setDisabled: (isDisabled: boolean) => void; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ disabled: Signal; setDisabled: (isDisabled: boolean) => void; }> | Signal<{ disabled: Signal; setDisabled: (isDisabled: boolean) => void; } | null>; }; declare const provideNavigationMenuContentItemState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpNavigationMenuItem` directive is a container for a menu trigger and its content. * It manages the open/close state for this specific menu item. */ declare class NgpNavigationMenuItem { /** * A unique value identifying this menu item. * Used to track which item is currently active. */ readonly value: _angular_core.InputSignal; private readonly state; /** * Whether this menu item is currently active (open). */ readonly active: _angular_core.Signal; /** * Show the content for this menu item. */ show(): void; /** * Hide the content for this menu item. */ hide(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The state for the NgpNavigationMenuItem directive. */ interface NgpNavigationMenuItemState { /** * The unique value identifying this menu item. */ readonly value: Signal; /** * Whether this menu item is currently active (open). */ readonly active: Signal; /** * Show the content for this menu item. */ show(): void; /** * Hide the content for this menu item. */ hide(): void; /** * Set the value for this menu item. * @param value The new value */ setValue(value: string): void; } /** * The props for the NgpNavigationMenuItem state. */ interface NgpNavigationMenuItemProps { /** * The unique value identifying this menu item. */ readonly value?: Signal; } declare const NgpNavigationMenuItemStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{ value: Signal; active: Signal; show: () => void; hide: () => void; setValue: (newValue: string) => void; }>>; declare const ngpNavigationMenuItem: ({ value: _value }: NgpNavigationMenuItemProps) => { value: Signal; active: Signal; show: () => void; hide: () => void; setValue: (newValue: string) => void; }; declare const injectNavigationMenuItemState: { (): Signal<{ value: Signal; active: Signal; show: () => void; hide: () => void; setValue: (newValue: string) => void; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ value: Signal; active: Signal; show: () => void; hide: () => void; setValue: (newValue: string) => void; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ value: Signal; active: Signal; show: () => void; hide: () => void; setValue: (newValue: string) => void; }> | Signal<{ value: Signal; active: Signal; show: () => void; hide: () => void; setValue: (newValue: string) => void; } | null>; }; declare const provideNavigationMenuItemState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpNavigationMenuLink` directive is used for standalone navigation links * within the navigation menu list (links without dropdown content). */ declare class NgpNavigationMenuLink { /** * Whether the link is disabled. * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Whether the link is active (represents the current page). * @default false */ readonly active: _angular_core.InputSignalWithTransform; private readonly state; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The state for the NgpNavigationMenuLink directive. */ interface NgpNavigationMenuLinkState { /** * Whether the link is disabled. */ readonly disabled: Signal; /** * Whether the link is active (current page). */ readonly active: Signal; /** * Set whether the link is disabled. * @param isDisabled Whether the link is disabled */ setDisabled(isDisabled: boolean): void; /** * Set whether the link is active. * @param isActive Whether the link is active */ setActive(isActive: boolean): void; } /** * The props for the NgpNavigationMenuLink state. */ interface NgpNavigationMenuLinkProps { /** * Whether the link is disabled. */ readonly disabled?: Signal; /** * Whether the link is active (current page). */ readonly active?: Signal; } declare const NgpNavigationMenuLinkStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{ disabled: Signal; active: Signal; setDisabled: (isDisabled: boolean) => void; setActive: (isActive: boolean) => void; }>>; declare const ngpNavigationMenuLink: ({ disabled: _disabled, active: _active, }: NgpNavigationMenuLinkProps) => { disabled: Signal; active: Signal; setDisabled: (isDisabled: boolean) => void; setActive: (isActive: boolean) => void; }; declare const injectNavigationMenuLinkState: { (): Signal<{ disabled: Signal; active: Signal; setDisabled: (isDisabled: boolean) => void; setActive: (isActive: boolean) => void; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ disabled: Signal; active: Signal; setDisabled: (isDisabled: boolean) => void; setActive: (isActive: boolean) => void; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ disabled: Signal; active: Signal; setDisabled: (isDisabled: boolean) => void; setActive: (isActive: boolean) => void; }> | Signal<{ disabled: Signal; active: Signal; setDisabled: (isDisabled: boolean) => void; setActive: (isActive: boolean) => void; } | null>; }; declare const provideNavigationMenuLinkState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpNavigationMenuList` directive is a container for navigation menu items. * It manages roving focus between menu triggers and links. */ declare class NgpNavigationMenuList { /** * Access the global navigation menu configuration. */ private readonly config; /** * Access the parent navigation menu state. */ private readonly navigationMenuState; /** * Whether focus should wrap around when reaching the end of the list. * @default true */ readonly wrap: _angular_core.InputSignalWithTransform; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * The state for the NgpNavigationMenuList directive. */ interface NgpNavigationMenuListState { } /** * The props for the NgpNavigationMenuList state. */ interface NgpNavigationMenuListProps { } declare const NgpNavigationMenuListStateToken: _angular_core.InjectionToken<_angular_core.WritableSignal<{}>>; declare const ngpNavigationMenuList: ({}: NgpNavigationMenuListProps) => {}; declare const injectNavigationMenuListState: { (): _angular_core.Signal<{}>; (options: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{} | null>; (options?: ng_primitives_state.StateInjectionOptions): _angular_core.Signal<{}> | _angular_core.Signal<{} | null>; }; declare const provideNavigationMenuListState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpNavigationMenuTrigger` directive is a button that opens navigation menu content. * It supports hover and focus interactions with configurable delays. */ declare class NgpNavigationMenuTrigger { /** * Access the global navigation menu configuration. */ private readonly config; /** * The content template or component to display. */ readonly content: _angular_core.InputSignal | undefined>; /** * Whether the trigger is disabled. * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** * The placement of the content relative to the trigger. * @default 'bottom-start' */ readonly placement: _angular_core.InputSignal; /** * The offset of the content relative to the trigger. * @default 4 */ readonly offset: _angular_core.InputSignalWithTransform; /** * Whether the content should flip when there is not enough space. * 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 content in view. * @default undefined */ readonly shift: _angular_core.InputSignalWithTransform; /** * The container for the content. * @default 'body' */ readonly container: _angular_core.InputSignal; /** * The cooldown duration in milliseconds. * When moving from one navigation menu item to another within this duration, * the showDelay is skipped for the new item. * @default 300 */ readonly cooldown: _angular_core.InputSignalWithTransform; private readonly state; /** * Whether the content is currently open. */ readonly open: _angular_core.Signal; constructor(); /** * Show the content. */ show(): void; /** * Hide the content. */ hide(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpNavigationMenuTriggerState { /** * The content template or component. */ readonly content: Signal | undefined>; /** * Whether the trigger is disabled. */ readonly disabled: Signal; /** * The placement of the content. */ readonly placement: Signal; /** * The offset of the content. */ readonly offset: Signal; /** * Whether the content should flip when there is not enough space. */ readonly flip: Signal; /** * The shift configuration for the content. */ readonly shift: Signal; /** * The container for the content. */ readonly container: WritableSignal; /** * Whether the content is currently open. */ readonly open: Signal; /** * The unique ID for accessibility. */ readonly id: string; /** * The ID of the associated content panel. */ readonly contentId: Signal; /** * Show the content. */ show(): void; /** * Hide the content. * @param origin The focus origin */ hide(origin?: FocusOrigin): void; /** * Focus the first item in the content. */ focusFirstContentItem(): void; /** * Focus the last item in the content. */ focusLastContentItem(): void; /** * Set the content ID. * @param id The content ID */ setContentId(id: string): void; /** * Set the container in which the content should be attached. Takes effect the * next time the content is opened; it does not move content that is already * open. * @param container The new container */ setContainer(container: HTMLElement | string | null): void; /** * Update pointer over content state. * @param isOver Whether pointer is over content */ setPointerOverContent(isOver: boolean): void; /** * Update focus inside content state. * @param isFocused Whether focus is inside the content */ setFocusInsideContent(isFocused: boolean): void; /** * Register focus functions from content. * @param focusFirst Function to focus first item * @param focusLast Function to focus last item */ registerContentFocusFunctions(focusFirst: () => void, focusLast: () => void): void; } interface NgpNavigationMenuTriggerProps { /** * The content template or component. */ readonly content?: Signal | undefined>; /** * Whether the trigger is disabled. */ readonly disabled?: Signal; /** * The placement of the content. */ readonly placement?: Signal; /** * The offset of the content. */ readonly offset?: Signal; /** * Whether the content should flip. */ readonly flip?: Signal; /** * The shift configuration. */ readonly shift?: Signal; /** * The container for the content. */ readonly container?: Signal; /** * The cooldown duration in milliseconds. */ readonly cooldown?: Signal; } declare const NgpNavigationMenuTriggerStateToken: _angular_core.InjectionToken | undefined>; disabled: Signal; placement: Signal; offset: Signal; flip: Signal; shift: Signal; container: WritableSignal; open: Signal; id: string; contentId: Signal; show: () => Promise; hide: (origin?: FocusOrigin) => void; focusFirstContentItem: (retryCount?: number) => void; focusLastContentItem: (retryCount?: number) => void; setContentId: (newId: string) => void; setContainer: (newContainer: HTMLElement | string | null) => void; setPointerOverContent: (isOver: boolean) => void; setFocusInsideContent: (isFocused: boolean) => void; registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void; }>>; declare const ngpNavigationMenuTrigger: ({ content: _content, disabled: _disabled, placement: _placement, offset: _offset, flip: _flip, shift: _shift, container: _container, cooldown: _cooldown, }: NgpNavigationMenuTriggerProps) => { content: Signal | undefined>; disabled: Signal; placement: Signal; offset: Signal; flip: Signal; shift: Signal; container: WritableSignal; open: Signal; id: string; contentId: Signal; show: () => Promise; hide: (origin?: FocusOrigin) => void; focusFirstContentItem: (retryCount?: number) => void; focusLastContentItem: (retryCount?: number) => void; setContentId: (newId: string) => void; setContainer: (newContainer: HTMLElement | string | null) => void; setPointerOverContent: (isOver: boolean) => void; setFocusInsideContent: (isFocused: boolean) => void; registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void; }; declare const injectNavigationMenuTriggerState: { (): Signal<{ content: Signal | undefined>; disabled: Signal; placement: Signal; offset: Signal; flip: Signal; shift: Signal; container: WritableSignal; open: Signal; id: string; contentId: Signal; show: () => Promise; hide: (origin?: FocusOrigin) => void; focusFirstContentItem: (retryCount?: number) => void; focusLastContentItem: (retryCount?: number) => void; setContentId: (newId: string) => void; setContainer: (newContainer: HTMLElement | string | null) => void; setPointerOverContent: (isOver: boolean) => void; setFocusInsideContent: (isFocused: boolean) => void; registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void; }>; (options: ng_primitives_state.StateInjectionOptions): Signal<{ content: Signal | undefined>; disabled: Signal; placement: Signal; offset: Signal; flip: Signal; shift: Signal; container: WritableSignal; open: Signal; id: string; contentId: Signal; show: () => Promise; hide: (origin?: FocusOrigin) => void; focusFirstContentItem: (retryCount?: number) => void; focusLastContentItem: (retryCount?: number) => void; setContentId: (newId: string) => void; setContainer: (newContainer: HTMLElement | string | null) => void; setPointerOverContent: (isOver: boolean) => void; setFocusInsideContent: (isFocused: boolean) => void; registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void; } | null>; (options?: ng_primitives_state.StateInjectionOptions): Signal<{ content: Signal | undefined>; disabled: Signal; placement: Signal; offset: Signal; flip: Signal; shift: Signal; container: WritableSignal; open: Signal; id: string; contentId: Signal; show: () => Promise; hide: (origin?: FocusOrigin) => void; focusFirstContentItem: (retryCount?: number) => void; focusLastContentItem: (retryCount?: number) => void; setContentId: (newId: string) => void; setContainer: (newContainer: HTMLElement | string | null) => void; setPointerOverContent: (isOver: boolean) => void; setFocusInsideContent: (isFocused: boolean) => void; registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void; } | null> | Signal<{ content: Signal | undefined>; disabled: Signal; placement: Signal; offset: Signal; flip: Signal; shift: Signal; container: WritableSignal; open: Signal; id: string; contentId: Signal; show: () => Promise; hide: (origin?: FocusOrigin) => void; focusFirstContentItem: (retryCount?: number) => void; focusLastContentItem: (retryCount?: number) => void; setContentId: (newId: string) => void; setContainer: (newContainer: HTMLElement | string | null) => void; setPointerOverContent: (isOver: boolean) => void; setFocusInsideContent: (isFocused: boolean) => void; registerContentFocusFunctions: (focusFirst: () => void, focusLast: () => void) => void; }>; }; declare const provideNavigationMenuTriggerState: (opts?: { inherit?: boolean; }) => _angular_core.FactoryProvider; /** * The `NgpNavigationMenu` directive is the root container for a navigation menu. * Apply this to a `