UNPKG

@nova-ui/bits

Version:

SolarWinds Nova Framework

151 lines (150 loc) 6.41 kB
import { Overlay, OverlayConfig } from "@angular/cdk/overlay"; import { ChangeDetectorRef, ComponentFactoryResolver, ComponentRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewContainerRef } from "@angular/core"; import { Subject } from "rxjs"; import { PopoverModalComponent } from "./popover-modal.component"; import { PopoverPositionService } from "./popover-position.service"; import { PopoverOverlayPosition, PopoverPlacement, PopoverTrigger } from "./public-api"; import { EventBusService } from "../../services/event-bus.service"; import { OverlayComponent } from "../overlay/overlay-component/overlay.component"; import * as i0 from "@angular/core"; export declare class PopoverComponent implements OnDestroy, OnInit, OnChanges { host: ElementRef; private componentFactoryResolver; private viewContainerRef; private overlay; private cdRef; private eventBusService; private popoverPositionService; static getHostView(componentInstance: ComponentRef<PopoverModalComponent>): HTMLElement; displayed: boolean; /** * Popover listens to this stream and closes when the stream emits */ closePopover: Subject<void>; /** * Popover listens to this stream and opens when the stream emits */ openPopover: Subject<void>; /** * Should popover be disabled, which prevents it from showing */ disabled: boolean; /** * Events that trigger the popover: 'click' | 'mouseenter' | 'mouseleave' | 'focus' | 'openPopoverSubject' */ trigger: PopoverTrigger; /** * TemplateRef instance that represents content of popover */ template: TemplateRef<string>; /** * Placement of the popover: 'left' | 'right' | 'top' | 'bottom' */ placement: PopoverPlacement; /** * Title text of the popover. To prevent rendering of the popover's title section, * simply leave this attribute unspecified. */ popoverTitle: string; /** * Name of icon to display */ icon: string; /** * Enable modal mode (dark background) */ modal: boolean; /** * Container for the popover */ container: HTMLElement; /** * Specify whether the popover body has any padding. * Setting this to false will remove all padding from the popover body. */ hasPadding: boolean; /** * Prevent closing popover when clicking itself. */ preventClosing: boolean; /** * Specifies whether the default width and height constraints are in effect for the popover */ unlimited: boolean; /** * Specifies the timeout in ms after which the tooltip is displayed */ delay: number; /** * Sets whether the overlay can grow after the initial open via flexible width/height. */ withGrowAfterOpen: boolean; popoverOverlayPosition: PopoverOverlayPosition[]; /** * Emits an event upon display of the popover */ shown: EventEmitter<any>; /** * Emits an event upon disappearance of the popover */ hidden: EventEmitter<any>; myTemplate: any; renderContainer: TemplateRef<ElementRef>; modalContainer: ViewContainerRef; overlayComponent: OverlayComponent; overlayConfig: OverlayConfig; containerElementRef: ElementRef; private popover?; private position; private arrowMarginTop; private popoverDisplaySubject; private popoverBeforeHiddenSubject; private popoverAfterHiddenSubject; private popoverModalEventSubject; private closePopoverSubscription; private openPopoverSubscription; private popoverModalSubscriptions; private popoverOpenedProgrammatically; private mouseLeaveTimeout?; private mouseEnterTimeout?; private hidingAnimationInProgress; private positionStrategySubscriptions; private overlayUtilitiesService; private resizeObserver; onClick(event: MouseEvent): void; onMouseEnter(): void; onMouseLeave(): void; onFocusIn(): void; onFocusOut(): void; constructor(host: ElementRef, componentFactoryResolver: ComponentFactoryResolver, viewContainerRef: ViewContainerRef, overlay: Overlay, cdRef: ChangeDetectorRef, eventBusService: EventBusService, popoverPositionService: PopoverPositionService); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; ngOnDestroy(): void; onBackdropClick(): void; showPopover(): void; /** * Updates the position of the popup based on its overlay's current position strategy. * This method is currently used in Charts by the ChartPopoverComponent. */ updatePosition(): void; /** * Resets the size of the popover. */ resetSize(): void; private onTrigger; private activatePopover; private initializePopover; private cleanUp; private hidePopover; private getContext; private mouseEnterResolver; private mouseLeaveResolver; private isTriggerPresent; private getIcon; private setPositionStrategy; private getPopoverConnectedPosition; private clearPositionStrategySubscriptions; private initializeResizeObserver; static ɵfac: i0.ɵɵFactoryDeclaration<PopoverComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PopoverComponent, "nui-popover", never, { "closePopover": { "alias": "closePopover"; "required": false; }; "openPopover": { "alias": "openPopover"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "trigger": { "alias": "trigger"; "required": false; }; "template": { "alias": "template"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "popoverTitle": { "alias": "popoverTitle"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "modal": { "alias": "modal"; "required": false; }; "container": { "alias": "container"; "required": false; }; "hasPadding": { "alias": "hasPadding"; "required": false; }; "preventClosing": { "alias": "preventClosing"; "required": false; }; "unlimited": { "alias": "unlimited"; "required": false; }; "delay": { "alias": "delay"; "required": false; }; "withGrowAfterOpen": { "alias": "withGrowAfterOpen"; "required": false; }; "popoverOverlayPosition": { "alias": "popoverOverlayPosition"; "required": false; }; }, { "shown": "shown"; "hidden": "hidden"; }, ["myTemplate"], ["*"], false, never>; }