import * as i0 from '@angular/core'; import { TemplateRef, AfterViewInit, OnDestroy, EventEmitter, ElementRef, ViewContainerRef, NgZone, ChangeDetectorRef, InjectionToken, OnInit } from '@angular/core'; import { Subject } from 'rxjs'; import { ConfigurableFocusTrapFactory, FocusMonitor } from '@angular/cdk/a11y'; import { Directionality } from '@angular/cdk/bidi'; import { BooleanInput } from '@angular/cdk/coercion'; import * as i2 from '@angular/cdk/overlay'; import { Overlay, ScrollStrategy, OriginConnectionPosition, OverlayConnectionPosition } from '@angular/cdk/overlay'; import { Platform } from '@angular/cdk/platform'; import { EventManager } from '@angular/platform-browser'; import { NxTriggerButton } from '@aposin/ng-aquila/overlay'; import * as i1 from '@angular/common'; import * as i3 from '@aposin/ng-aquila/icon'; /** * Popover content that will be rendered lazily * after the popover is opened for the first time. */ declare class NxPopoverContentDirective { readonly _template: TemplateRef; constructor(_template: TemplateRef); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** Popover data that requires internationalization. */ declare class NxPopoverIntl { /** * Stream that emits whenever the labels here are changed. Use this to notify * components if the labels have changed after initialization. */ readonly changes: Subject; /** Aria-label for the delete icon. */ closeIconLabel: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare type PopoverVerticalDirection = 'top' | 'bottom'; declare type PopoverHorizontalDirection = 'left' | 'right'; declare type PopoverDirection = PopoverHorizontalDirection | PopoverVerticalDirection; declare type PopoverTriggerType = 'click' | 'hover' | 'manual'; declare type PopoverTriggerScrollStrategy = 'close' | 'reposition'; /** Injection token that determines the scroll handling while a popover is open. */ declare const NX_POPOVER_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>; /** * @docs-private * @deprecated No longer used. * @deletion-target 18.0.0 */ declare function NX_POPOVER_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay): () => ScrollStrategy; /** * @docs-private * @deprecated No longer used. * @deletion-target 18.0.0 */ declare const NX_POPOVER_SCROLL_STRATEGY_PROVIDER: { provide: InjectionToken<() => ScrollStrategy>; useFactory: typeof NX_POPOVER_SCROLL_STRATEGY_PROVIDER_FACTORY; deps: (typeof Overlay)[]; }; /** Default `nxPopover` options that can be overridden. */ interface PopoverDefaultOptions { /** Default width of popover */ popoverWidth?: string | undefined; /** Default max-width of popover */ popoverMaxWidth?: string | undefined; } /** Injection token to be used to override the default options for `nxPopover`. */ declare const POPOVER_DEFAULT_OPTIONS: InjectionToken; declare function POPOVER_DEFAULT_OPTIONS_FACTORY(): PopoverDefaultOptions; /** * Creates an error to be thrown if the user provided an invalid popover direction. * @docs-private */ declare function getNxPopoverInvalidDirectionError(direction: string): Error; declare class NxPopoverTriggerDirective implements AfterViewInit, OnDestroy { #private; private readonly overlay; private readonly elementRef; private readonly viewContainerRef; private readonly eventManager; private readonly _focusTrapFactory; private readonly _focusMonitor; private readonly _ngZone; private readonly _platform; private readonly _dir; private readonly _defaultOptions; private readonly _defaultScrollStrategyFactory; private readonly _cdr; private readonly _triggerButton; private overlayRef; private portal; private readonly _overlayDestroyed; private _positionStrategy; private _embeddedViewRef; /** The class that traps and manages focus within the popover. */ private _focusTrap; /** Element that was focused before the Popover was opened. Save this to restore upon close. */ private _elementFocusedBeforePopoverWasOpened; private readonly _manualListeners; private readonly _possiblePopoverDirections; closeOnLeftViewport: IntersectionObserver | undefined; /** @docs-private */ id: string; /** An event is emitted if the visibility status of the popover changes. */ readonly changeShow: EventEmitter; /** Whether to show or hide the popover. */ set show(value: BooleanInput); get show(): BooleanInput; private _show; /** Whether to show a close button. By default a close icon is only shown for trigger type click. Can't be used for trigger type hover. */ set closeable(value: BooleanInput); get closeable(): boolean; private _closeable; /** Whether the popover should be closed on click outside of the popover in the trigger modes 'manual' and 'click'. */ set closeOnClickOutside(value: BooleanInput); get closeOnClickOutside(): boolean; private _closeOnClickOutside; /** Whether to show the popover arrow. By default set to true */ set hidePopoverArrow(value: BooleanInput); get hidePopoverArrow(): boolean; private _hidearrow; /** Popover width */ set popoverWidth(value: string | undefined); get popoverWidth(): string | undefined; private _popoverWidth; /** Popover max-width */ set popoverMaxWidthh(value: string | undefined); get popoverMaxWidth(): string | undefined; private _popoverMaxWidth; /** Links the trigger with the popover to open. */ popover: NxPopoverComponent; /** Sets the desired direction to open the popover. E.g., right, left, bottom, top */ direction: PopoverDirection; /** Whether the popover will be opened automatically. */ popoverInitialVisible: boolean; /** An event is emitted when the visibility of the popopver changes. */ visibleChange: EventEmitter; /** Whether the popover opens in modal state. */ set modal(value: BooleanInput); get modal(): boolean; private _modal; /** Sets the way to trigger the popover. Options are hover, click, manual */ trigger: PopoverTriggerType; /** Sets the scroll strategy. 'close' closes the popover on scroll while 'reposition' scrolls the popover with the origin. */ set scrollStrategy(value: PopoverTriggerScrollStrategy | null | undefined); get scrollStrategy(): PopoverTriggerScrollStrategy | null | undefined; private readonly _destroyed; /** Strategy factory that will be used to handle scrolling while the popover panel is open. */ private _scrollStrategyFactory; constructor(overlay: Overlay, elementRef: ElementRef, viewContainerRef: ViewContainerRef, eventManager: EventManager, _focusTrapFactory: ConfigurableFocusTrapFactory, _focusMonitor: FocusMonitor, _ngZone: NgZone, _platform: Platform, _dir: Directionality | null, _defaultOptions: PopoverDefaultOptions | null, _defaultScrollStrategyFactory: () => ScrollStrategy, _cdr: ChangeDetectorRef, _triggerButton: NxTriggerButton | null); ngAfterViewInit(): void; ngOnDestroy(): void; /** @docs-private */ get isOpen(): boolean | null; /** @docs-private */ isCloseable(): boolean; /** Update the popover with the given position strategy. */ updatePosition(): void; /** @docs-private */ handleClick(): void; /** Open the popover instance. */ open(): void; /** Close the popover instance. */ close(): void; /** Toggle the popover instance. */ toggle(): void; private openPopover; /** Sets some popover component properties that are needed to render it properly. */ private setPopoverProperties; /** * Autofocus the first tabbable element inside of the popover, if there is not a tabbable element, * focus the popover instead. */ private _autoFocusFirstTabbableElement; private closePopover; private getScrollStrategyFactory; private createOverlay; private subscribeToPositions; private _subscribeToBackdropClick; private _subscribeToDetach; private _subscribeToAttach; private _subscribeToKeypress; private waitForClose; private positionOverlay; private positionArrow; private getPosition; /** Returns the focus to the element focused before the Popover was open. */ private _returnFocusAfterPopover; /** Returns the main popover container of the injected content. */ private getPopoverContainer; /** * Returns the origin position based on the user's direction preference. */ _getOrigin(direction: PopoverDirection): OriginConnectionPosition; /** Returns the overlay position based on the user's direction preference */ _getOverlayPosition(direction: PopoverDirection): OverlayConnectionPosition; /** Returns the overlay offset required by the user's direction preference */ private _getOffset; /** Returns the opposite direction, using aquila popover direction naming: top, right, bottom, left */ private _getInversePopoverDirection; /** Returns the opposite position, using angular position naming: top, bottom, start, end, center */ private _getInversePosition; /** * Returns an array of fallback positions for popover, following the algoritm: * 1) Slightly alternate preferred position if applicable. I.e. for 'top' try 'top-start' and 'top-end' positioning. * 2) Try the opposite position, i.e. for 'top' try 'bottom'. * 3) Slightly alternate opposite position, i.e. 'bottom-start', 'bottom-end'. * 4) All remaining positions from positions list. */ private _getFallbackPositions; /** Calculates fallbacks for vertical popover positioning */ private _getVerticalFallbackPositionPairs; /** Calculates fallbacks for horizontal popover positioning */ private _getHorizontalFallbackPositionPairs; private _dirChangeHandler; get isRtl(): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** Container for the header of a popover. */ declare class NxPopoverTitleDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** Scrollable container for the content of a popover. */ declare class NxPopoverMainContentDirective { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } /** Container for the action buttons in a popover. Has a fixed position at the bottom of the popover on scroll. */ declare class NxPopoverActionsDirective { alignment: i0.InputSignal<"left" | "right" | "center">; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NxPopoverComponent implements OnDestroy, OnInit { readonly _intl: NxPopoverIntl; private readonly _cdr; /** @docs-private */ templateRef: TemplateRef; /** Content that will be rendered lazily. */ _lazyContent?: NxPopoverContentDirective; /** Event emitted when the popover is closed. */ readonly closed: EventEmitter; /** @docs-private */ readonly closeButtonClick: Subject; /** @docs-private */ id: string; /** @docs-private */ direction: string; /** @docs-private */ hidePopoverArrow: boolean; /** @docs-private */ showCloseButton: boolean; /** @docs-private */ triggerType: PopoverTriggerType; /** Sets the tabIndex for the popover. Will only be considered if triggerType is 'manual' */ set tabIndex(value: number | null); /** * gets the tabindex for the popover * if triggerType='hover' -> null * if triggerType='click' -> 0 * if triggerType='manual' -> whatever is set on tabIndex. Defaults to 0 on 'manual' */ get tabIndex(): number | null; private _tabIndex; /** @docs-private */ arrowStyle: {}; private readonly _destroyed; constructor(_intl: NxPopoverIntl, _cdr: ChangeDetectorRef); ngOnInit(): void; ngOnDestroy(): void; /** * Emits event to notify the popover trigger directive that the close button was clicked. * @docs-private */ emitCloseButtonClick(): void; /** @docs-private */ _onCloseKeyup($event: KeyboardEvent): void; /** @docs-private */ _onCloseKeydown($event: KeyboardEvent): void; /** @docs-private */ emitClosedEvent(): void; /** @docs-private */ get classList(): string; /** Prevent the popover from closing when the user clicks on the popover content. */ _onClick(event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NxPopoverModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { NX_POPOVER_SCROLL_STRATEGY, NX_POPOVER_SCROLL_STRATEGY_PROVIDER, NX_POPOVER_SCROLL_STRATEGY_PROVIDER_FACTORY, NxPopoverActionsDirective, NxPopoverComponent, NxPopoverContentDirective, NxPopoverIntl, NxPopoverMainContentDirective, NxPopoverModule, NxPopoverTitleDirective, NxPopoverTriggerDirective, POPOVER_DEFAULT_OPTIONS, POPOVER_DEFAULT_OPTIONS_FACTORY, getNxPopoverInvalidDirectionError }; export type { PopoverDefaultOptions, PopoverDirection, PopoverHorizontalDirection, PopoverTriggerScrollStrategy, PopoverTriggerType, PopoverVerticalDirection };