import { ElementRef, EventEmitter, TemplateRef, OnDestroy, OnInit } from '@angular/core'; import { AnimationEvent } from '@angular/animations'; import { FocusTrapFactory } from '@angular/cdk/a11y'; import { PopoverNotificationService } from './notification.service'; import { HcPopoverScrollStrategy, HcPopoverHorizontalAlign, HcPopoverVerticalAlign, HcPopoverOpenOptions } from './types'; import { OverlayRef } from '@angular/cdk/overlay'; export declare class HcPopComponent implements OnInit, OnDestroy { _elementRef: ElementRef; private _focusTrapFactory; private _document; /** Whether or not to disable default popover container styles. *Defaults to `false`.* */ disableStyle: boolean; /** Whether or not to show a connection arrow when possible. *Defaults to `true`.* */ showArrow: boolean; /** Alignment of the popover on the horizontal axis. Can be `before`, `start`, `center`, `end`, `after`, or `mouse`. * *Defaults to `center`.* */ horizontalAlign: HcPopoverHorizontalAlign; private _horizontalAlign; /** Alignment of the popover on the x axis. Alias for `horizontalAlign`. *Defaults to `"center"`.* */ xAlign: HcPopoverHorizontalAlign; /** Alignment of the popover on the vertical axis. Can be `above`, `start`, `center`, `end`, `below`, or `mouse`. * *Defaults to `"below"`.* */ verticalAlign: HcPopoverVerticalAlign; private _verticalAlign; /** Alignment of the popover on the y axis. Alias for `verticalAlign`. *Defaults to `"below"`.* */ yAlign: HcPopoverVerticalAlign; /** Whether the popover always opens with the specified alignment. *Defaults to `false`.* */ forceAlignment: boolean; private _forceAlignment; /** * Whether the popover's alignment is locked after opening. This prevents the popover * from changing its alignement when scrolling or changing the size of the viewport. * *Defaults to `false`.* */ lockAlignment: boolean; private _lockAlignment; /** Whether the first focusable element should be focused on open. *Defaults to `false`.* */ autoFocus: boolean; private _autoFocus; _autoFocusOverride: boolean; /** Whether the popover should return focus to the previously focused element after closing. *Defaults to `true`.* */ restoreFocus: boolean; private _restoreFocus; _restoreFocusOverride: boolean; /** How the popover should handle scrolling. *Defaults to `"reposition"`.* */ scrollStrategy: HcPopoverScrollStrategy; private _scrollStrategy; /** Whether the popover should have a backdrop (includes closing on click). *Defaults to `true`.* */ hasBackdrop: boolean; private _hasBackdrop; /** Whether the popover should close when the user clicks the backdrop or presses ESC. *Defaults to `true`.* */ interactiveClose: boolean; private _interactiveClose; /** Custom transition to use while opening. *Defaults to `'200ms cubic-bezier(0.25, 0.8, 0.25, 1)'`.* */ openTransition: string; private _openTransition; /** Custom transition to use while closing. *Defaults to `'200ms cubic-bezier(0.25, 0.8, 0.25, 1)'`.* */ closeTransition: string; private _closeTransition; /** Should the popover animate? *Defaults to `true`.* */ shouldAnimate: boolean; /** Optional backdrop class. *Defaults to `''`.* */ backdropClass: string; /** Set to true if clicking anywhere inside the popover should close it. *Defaults to `false`.* */ autoCloseOnContentClick: boolean; /** Emits when the popover is opened. If `context` was set on the anchor, it will be emitted with this event. */ opened: EventEmitter; /** Emits when the popover is closed. */ closed: EventEmitter; /** Emits when the popover has finished opening. */ afterOpen: EventEmitter; /** Emits when the popover has finished closing. */ afterClose: EventEmitter; /** Emits when the backdrop is clicked. */ backdropClicked: EventEmitter; /** Emits when a keydown event is targeted to this popover's overlay. */ overlayKeydown: EventEmitter; /** Reference to template so it can be placed within a portal. */ _templateRef: TemplateRef; /** Stores the click coordinates for mouse-based positioning */ _offsetPos: number[]; /** Stores a reference to the associated overlay */ _componentOverlay: OverlayRef; /** Classes to be added to the popover for setting the correct transform origin. */ _classList: any; _yAlignClass: string; _xAlignClass: string; /** Whether the popover is presently open. */ _open: boolean; /** Instance of notification service. Will be undefined until attached to an anchor. */ _notifications: PopoverNotificationService; /** Reference to the element to build a focus trap around. */ private _focusTrapElement; /** Reference to the element that was focused before opening. */ private _previouslyFocusedElement; /** Reference to a focus trap around the popover. */ private _focusTrap; constructor(_elementRef: ElementRef, _focusTrapFactory: FocusTrapFactory, _document: any); ngOnInit(): void; ngOnDestroy(): void; popContainerClicked(): void; /** Open this popover. */ open(options?: HcPopoverOpenOptions): void; /** Close this popover. */ close(value?: any): void; /** Toggle this popover open or closed. */ toggle(): void; /** Realign the popover to the anchor. */ realign(): void; /** Gets whether the popover is presently open. */ isOpen(): boolean; /** Gets an animation config with customized (or default) transition values. */ _getAnimation(): { value: any; params: any; }; /** Callback for when the popover is finished animating in or out. */ _onAnimationDone(event: AnimationEvent): void; /** Apply alignment classes based on alignment inputs. */ _setAlignmentClasses(horizAlign?: HcPopoverHorizontalAlign, vertAlign?: HcPopoverVerticalAlign): void; _setAlignmentClassesForAnimation(horizAlign?: HcPopoverHorizontalAlign, vertAlign?: HcPopoverVerticalAlign): void; _setAlignmentClassesForArrow(xAlign?: HcPopoverHorizontalAlign, yAlign?: HcPopoverVerticalAlign): void; /** Move the focus inside the focus trap and remember where to return later. */ private _trapFocus; /** Restore focus to the element focused before the popover opened. Also destroy trap. */ private _restoreFocusAndDestroyTrap; /** Save a reference to the element focused before the popover was opened. */ private _savePreviouslyFocusedElement; /** Dispatch a notification to the notification service, if possible. */ private _dispatchConfigNotification; /** Dispatch a notification to the notification service and throw if unable to. */ private _dispatchActionNotification; /** Throws an error if the alignment is not a valid horizontalAlign. */ private _validateHorizontalAlign; /** Throws an error if the alignment is not a valid verticalAlign. */ private _validateVerticalAlign; /** Throws an error if the scroll strategy is not a valid strategy. */ private _validateScrollStrategy; }