import { AnimationTriggerMetadata } from '@angular/animations'; import * as i0 from '@angular/core'; import { TemplateRef, OnDestroy, EventEmitter, ElementRef, ViewContainerRef, AfterViewInit } from '@angular/core'; import { OverlayRef, HorizontalConnectionPos, VerticalConnectionPos, Overlay, OverlayConfig, FlexibleConnectedPositionStrategy } from '@angular/cdk/overlay'; import { Observable, Subscription, Subject } from 'rxjs'; import { Direction } from '@angular/cdk/bidi'; import { TemplatePortal, ComponentPortal } from '@angular/cdk/portal'; declare const luTransformPopover: AnimationTriggerMetadata; type LuPopoverScrollStrategy = 'reposition' | 'block' | 'close'; declare interface ILuPopoverPanel { scrollStrategy: LuPopoverScrollStrategy; closeOnClick: boolean; panelId?: string; triggerId?: string; templateRef?: TemplateRef; overlayRef: OverlayRef; /** will emit when the panel wants to close */ close: Observable; /** will emit when the panel wants to open */ open: Observable; /** will emit when the panel is hovered */ hovered: Observable; /** classes to apply to the panel, uses ' ' for separating values */ panelClasses: string; /** class to apply to the panel content, uses ' ' for separating values */ contentClasses: string; keydownEvents$: Observable; setPositionClasses: (posX: HorizontalConnectionPos, posY: VerticalConnectionPos) => void; /** method called by the trigger when it opens the popover */ onOpen(): void; /** method called by the trigger when it closes the popover */ onClose(): void; } /** * abstract class for basic implementation of a popover panel */ declare abstract class ALuPopoverPanel implements ILuPopoverPanel { panelId: string; triggerId: string; protected _isOpen: boolean; get isOpen(): boolean; protected _closeOnClick: boolean; get closeOnClick(): boolean; set closeOnClick(coc: boolean); protected _trapFocus: boolean; get trapFocus(): boolean; set trapFocus(tf: boolean); protected _scrollStrategy: LuPopoverScrollStrategy; get scrollStrategy(): LuPopoverScrollStrategy; set scrollStrategy(ss: LuPopoverScrollStrategy); protected _templateRef: TemplateRef; get templateRef(): TemplateRef; set templateRef(tr: TemplateRef); protected _positionClassesMap: Record; protected _panelClasses: string; get panelClasses(): string; set panelClasses(cl: string); get panelClassesMap(): Record; protected _contentClasses: string; get contentClasses(): string; set contentClasses(cl: string); get contentClassesMap(): Record; overlayRef: OverlayRef; /** Classes to be passed into the popover's overlay */ protected _overlayPaneClass: string | string[]; get overlayPaneClass(): string | string[]; set overlayPaneClass(opc: string | string[]); protected _keydownEventsSub: Subscription; set keydownEvents$(evt$: Observable); close: Observable; open: Observable; hovered: Observable; abstract _emitCloseEvent(): void; abstract _emitOpenEvent(): void; abstract _emitHoveredEvent(hovered: boolean): void; setPositionClasses(posX: HorizontalConnectionPos, posY: VerticalConnectionPos): void; onClick(): void; onOpen(): void; onClose(): void; /** * TODO: Refactor when @angular/cdk includes feature I mentioned on github see link below. * https://github.com/angular/material2/pull/5493#issuecomment-313085323 */ /** Disables close of popover when leaving trigger element and mouse over the popover */ onMouseOver(): void; /** Enables close of popover when mouse leaving popover element */ onMouseLeave(): void; /** does nothing but must be overridable */ onMouseDown(): void; _handleKeydown(event: KeyboardEvent): void; } declare class LuPopoverPanelComponent extends ALuPopoverPanel implements ILuPopoverPanel, OnDestroy { protected _template: TemplateRef; protected _templateContext: unknown; /** Template to Use for the popover */ get template(): TemplateRef; set template(value: TemplateRef); /** Template context to use for the popover when created using a template */ get templateContext(): unknown; set templateContext(value: unknown); /** * Popover container close on click * default: false */ set inputCloseOnClick(v: boolean); /** * Popover focus trap using cdkTrapFocus * default: false */ set inputTrapFocus(v: boolean); /** * Popover scrollStrategy * default: reposition */ set inputScrollStrategy(v: LuPopoverScrollStrategy); /** * This method takes classes set on the host lu-popover element and applies them on the * popover template that displays in the overlay container. Otherwise, it's difficult * to style the containing popover from outside the component. * @param classes list of class names */ set inputPanelClasses(classes: string); /** * This method takes classes set on the host lu-popover element and applies them on the * popover template that displays in the overlay container. Otherwise, it's difficult * to style the containing popover from outside the component. * @param classes list of class names */ set inputContentClasses(classes: string); /** Event emitted when the popover is closed. */ close: EventEmitter; open: EventEmitter; hovered: EventEmitter; set vcTemplateRef(tr: TemplateRef); constructor(); ngOnDestroy(): void; _emitCloseEvent(): void; _emitOpenEvent(): void; _emitHoveredEvent(hovered: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * @deprecated use `LuPopoverPanelComponent` instead */ declare class LuPopoverPanelModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } type LuPopoverPosition = 'above' | 'below' | 'before' | 'after'; type LuPopoverAlignment = 'top' | 'bottom' | 'left' | 'right' | 'center'; /** * anchor for a popover panel */ interface ILuPopoverTarget { /** how the panel will be align with the target, allowed values: top, bottom, left, right */ alignment: LuPopoverAlignment; /** the element used to position the panel */ elementRef: ElementRef; overlap: boolean; /** how you want to position the panel relative to the target, allowed values: above, below, before, after */ position: LuPopoverPosition; offsetX: number; offsetY: number; } declare abstract class ALuPopoverTarget implements ILuPopoverTarget { protected _elementRef: ElementRef; /** the element used to position the panel */ get elementRef(): ElementRef; set elementRef(ref: ElementRef); protected _position: LuPopoverPosition; /** how you want to position the panel relative to the target, allowed values: above, below, before, after */ get position(): LuPopoverPosition; set position(position: LuPopoverPosition | string); protected _alignment: LuPopoverAlignment; /** how the panel will be align with the target, allowed values: top, bottom, left, right */ get alignment(): LuPopoverAlignment; set alignment(alignment: LuPopoverAlignment | string); protected _overlap: boolean; /** set to true if you want the panel to appear on top of the target */ get overlap(): boolean; set overlap(ot: boolean); protected _offsetX: number; get offsetX(): number; set offsetX(ox: number); protected _offsetY: number; get offsetY(): number; set offsetY(oy: number); } declare class LuPopoverTarget extends ALuPopoverTarget { constructor(); } declare class LuPopoverTargetDirective extends ALuPopoverTarget { constructor(ref: ElementRef); /** how you want to position the panel relative to the target, allowed values: above, below, before, after */ set inputPosition(pos: LuPopoverPosition); /** how the panel will be align with the target, allowed values: top, bottom, left, right */ set inputAlignment(al: LuPopoverAlignment); /** set to true if you want the panel to appear on top of the target */ set inputOverlap(ov: boolean); set inputOffsetX(ox: number); set inputOffsetY(oy: number); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } type LuPopoverTriggerEvent = 'click' | 'hover' | 'none' | 'focus'; /** * component that will decide when to show the popover and attach it to the target */ declare interface ILuPopoverTrigger { /** the popover panel to display */ panel: TPanel; /** the popover target to attach the panel */ target: TTarget; /** when to display the popover */ triggerEvent: LuPopoverTriggerEvent; /** delay before popover apparition when trigger is 'hover' */ enterDelay: number; /** delay before popover disparition when trigger is 'hover' */ leaveDelay: number; /** disable popover apparition */ disabled: boolean; /** Event emitted when the associated popover is opened. */ onOpen: Observable; /** Event emitted when the associated popover is closed. */ onClose: Observable; openPopover(): any; closePopover(): any; togglePopover(): any; destroyPopover(): any; } declare abstract class ALuPopoverTrigger implements ILuPopoverTrigger { protected _overlay: Overlay; protected _elementRef: ElementRef; protected _viewContainerRef: ViewContainerRef; protected _portal: TemplatePortal | ComponentPortal; protected _overlayRef: OverlayRef | null; protected _popoverOpen: boolean; protected _backdropSubscription: Subscription; protected _positionSubscription: Subscription; protected _mouseoverTimer: unknown; protected _hovered$: Subject; protected _hoveredSubscription: Subscription; protected _panelEventsSubscriptions: Subscription; protected _overlayDetachmentsSubscription: Subscription; protected _openedByMouse: boolean; protected _panel: TPanel; /** References the popover instance that the trigger is associated with. */ get panel(): TPanel; set panel(p: TPanel); protected _target: TTarget; /** References the popover target instance that the trigger is associated with. */ get target(): TTarget; set target(t: TTarget); protected _triggerEvent: LuPopoverTriggerEvent; get triggerEvent(): LuPopoverTriggerEvent; set triggerEvent(te: LuPopoverTriggerEvent); protected _enterDelay: number; get enterDelay(): number; set enterDelay(d: number); protected _leaveDelay: number; get leaveDelay(): number; set leaveDelay(d: number); protected _disabled: boolean; get disabled(): boolean; set disabled(d: boolean); protected _whenEllipsis: boolean; get whenEllipsis(): boolean; set whenEllipsis(we: boolean); protected _triggerId: string; protected _panelId: string; /** Event emitted when the associated popover is opened. */ abstract onOpen: Observable; /** Event emitted when the associated popover is closed. */ abstract onClose: Observable; protected abstract _emitOpen(): void; protected abstract _emitClose(): void; constructor(_overlay: Overlay, _elementRef: ElementRef, _viewContainerRef: ViewContainerRef); onClick(): void; onMouseEnter(): void; onMouseLeave(): void; onFocus(): void; onBlur(): void; /** Toggles the popover between the open and closed states. */ togglePopover(): void; /** Opens the popover. */ openPopover(): void; /** Closes the popover. */ closePopover(): void; /** Removes the popover from the DOM. */ destroyPopover(): void; /** Focuses the popover trigger. */ focus(): void; _handleMousedown(event: MouseEvent): void; /** The text direction of the containing app. */ get dir(): Direction; /** Return if the popover main positionning is vertical */ get isVerticallyPositionned(): boolean; protected _attachPortalToOverlay(): void; protected _getPanelScrollStrategy(): LuPopoverScrollStrategy; /** * This method ensures that the popover */ protected _subscribeToPanelEvents(): void; /** * This method ensures that the popover closes when the overlay has been detached * Detach can occur if we scroll while popover is opened */ protected _subscribeToOverlayDetachments(): void; /** * This method ensures that the popover closes when the overlay backdrop is clicked. * We do not use first() here because doing so would not catch clicks from within * the popover, and it would fail to unsubscribe properly. Instead, we unsubscribe * explicitly when the popover is closed or destroyed. */ protected _subscribeToBackdrop(): void; /** * This method sets the popover state to open and focuses the first item if * the popover was opened via the keyboard. */ protected _initPopover(): void; /** * This method resets the popover when it's closed, most importantly restoring * focus to the popover trigger if the popover was opened via the keyboard. */ protected _resetPopover(): void; /** set state rather than toggle to support triggers sharing a popover */ protected _setIsPopoverOpen(isOpen: boolean): void; /** * This method checks that a valid instance of MdPopover has been passed into * mdPopoverTriggerFor. If not, an exception is thrown. */ protected _checkPanel(): void; protected _checkTarget(): void; /** * This method creates the overlay from the provided popover's template and saves its * OverlayRef so that it can be attached to the DOM when openPopover is called. */ protected _createOverlay(): OverlayRef; /** * This method builds the configuration object needed to create the overlay, the OverlayConfig. * @returns OverlayConfig */ protected _getOverlayConfig(): OverlayConfig; /** * Listens to changes in the position of the overlay and sets the correct classes * on the popover based on the new position. This ensures the animation origin is always * correct, even if a fallback position is used for the overlay. */ protected _subscribeToPositions(position: FlexibleConnectedPositionStrategy): void; /** * This method builds the position strategy for the overlay, so the popover is properly connected * to the trigger. * @returns FlexibleConnectedPositionStrategy */ protected _getPosition(): FlexibleConnectedPositionStrategy; protected _invertVerticalPos(y: VerticalConnectionPos): VerticalConnectionPos; protected _invertHorizontalPos(x: HorizontalConnectionPos): HorizontalConnectionPos; protected _cleanUpSubscriptions(): void; protected _hasEllipsis(): boolean; } declare class LuPopoverTriggerDirective extends ALuPopoverTrigger implements ILuPopoverTrigger, AfterViewInit, OnDestroy { protected _overlay: Overlay; protected _elementRef: ElementRef; protected _viewContainerRef: ViewContainerRef; /** References the popover instance that the trigger is associated with. */ set inputPanel(p: TPanel); /** References the popover target instance that the trigger is associated with. */ set inputTarget(t: TTarget); /** References the popover target instance that the trigger is associated with. */ set inputTriggerEvent(te: LuPopoverTriggerEvent); /** Event emitted when the associated popover is opened. */ onOpen: EventEmitter; /** Event emitted when the associated popover is closed. */ onClose: EventEmitter; /** how you want to position the panel relative to the target, allowed values: above, below, before, after */ set inputPosition(pos: LuPopoverPosition); /** how the panel will be align with the target, allowed values: top, bottom, left, right */ set inputAlignment(al: LuPopoverAlignment); /** when trigger = hover, delay before the popover panel appears */ set inputEnterDelay(d: number); /** when trigger = hover, delay before the popover panel disappears */ set inputLeaveDelay(d: number); /** disable popover apparition */ set inputDisabled(d: boolean); /** set to true if you want the panel to appear on top of the target */ set inputOverlap(ov: boolean); set inputOffsetX(ox: number); set inputOffsetY(oy: number); /** accessibility attribute - dont override */ get _attrAriaExpanded(): boolean; /** accessibility attribute - dont override */ get _attrId(): string; /** accessibility attribute - dont override */ get _attrAriaControls(): string; constructor(_overlay: Overlay, _elementRef: ElementRef, _viewContainerRef: ViewContainerRef); onClick(): void; onMouseEnter(): void; onMouseLeave(): void; onFocus(): void; onBlur(): void; ngAfterViewInit(): void; ngOnDestroy(): void; protected _emitOpen(): void; protected _emitClose(): void; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "[luPopover]", ["LuPopoverTrigger"], { "inputPanel": { "alias": "luPopover"; "required": false; }; "inputTarget": { "alias": "luPopoverTarget"; "required": false; }; "inputTriggerEvent": { "alias": "luPopoverTrigger"; "required": false; }; "inputPosition": { "alias": "luPopoverPosition"; "required": false; }; "inputAlignment": { "alias": "luPopoverAlignment"; "required": false; }; "inputEnterDelay": { "alias": "luPopoverEnterDelay"; "required": false; }; "inputLeaveDelay": { "alias": "luPopoverLeaveDelay"; "required": false; }; "inputDisabled": { "alias": "luPopoverDisabled"; "required": false; }; "inputOverlap": { "alias": "luPopoverOverlap"; "required": false; }; "inputOffsetX": { "alias": "luPopoverOffsetX"; "required": false; }; "inputOffsetY": { "alias": "luPopoverOffsetY"; "required": false; }; }, { "onOpen": "luPopoverOnOpen"; "onClose": "luPopoverOnClose"; }, never, never, true, never>; } /** * @deprecated use `LuPopoverPanelComponent, LuPopoverTargetDirective, LuPopoverTriggerDirective` instead */ declare class LuPopoverModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { ALuPopoverPanel, ALuPopoverTarget, ALuPopoverTrigger, LuPopoverModule, LuPopoverPanelComponent, LuPopoverPanelModule, LuPopoverTarget, LuPopoverTargetDirective, LuPopoverTriggerDirective, luTransformPopover }; export type { ILuPopoverPanel, ILuPopoverTarget, ILuPopoverTrigger, LuPopoverAlignment, LuPopoverPosition, LuPopoverScrollStrategy, LuPopoverTriggerEvent };