@nova-ui/bits
Version:
SolarWinds Nova Framework
61 lines (60 loc) • 3.23 kB
TypeScript
import { Overlay, OverlayConfig, OverlayRef, OverlaySizeConfig } from "@angular/cdk/overlay";
import { CdkPortal } from "@angular/cdk/portal";
import { AfterContentChecked, AfterViewInit, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
import { Subject } from "rxjs";
import { EventBusService } from "../../../services/event-bus.service";
import { OverlayPositionService } from "../overlay-position.service";
import { OverlayService } from "../overlay.service";
import { IOverlayComponent, OverlayContainerType } from "../types";
import * as i0 from "@angular/core";
export declare const POPUP_V2_VIEWPORT_MARGINS_DEFAULT = 30;
export declare class OverlayComponent implements OnDestroy, IOverlayComponent, AfterContentChecked, AfterViewInit, OnChanges {
overlayPositionService: OverlayPositionService;
protected overlayService: OverlayService;
protected cdkOverlay: Overlay;
private eventBusService;
/** Sets overlay config in accordance with [Material CDK]{@link https://material.angular.io/cdk/overlay/api#OverlayConfig} */
overlayConfig: OverlayConfig;
/** Element to which the Popup is attached */
toggleReference: HTMLElement;
/** Popup viewport margins */
viewportMargin: number;
/** Sets custom container for CDK Overlay. Selector OR ElementRef */
customContainer: OverlayContainerType;
/** Sets the role attribute */
roleAttr: string;
/** Emits MouseEvent when click occurs outside Select/Combobox */
readonly clickOutside: EventEmitter<MouseEvent>;
/** The place where the Popup will be attached */
contentTemplate: CdkPortal;
/** Emits on the Popup show */
readonly show$: Subject<void>;
/** Emits on the Popup hide */
readonly hide$: Subject<void>;
/** Emits when content of the Popup is empty */
readonly empty$: Subject<boolean>;
/** Indicates open/close state */
get showing(): boolean;
private positionStrategySubscription;
constructor(overlayPositionService: OverlayPositionService, overlayService: OverlayService, cdkOverlay: Overlay, eventBusService: EventBusService);
ngOnChanges(changes: SimpleChanges): void;
ngAfterViewInit(): void;
ngAfterContentChecked(): void;
ngOnDestroy(): void;
/** Shows Popup */
show(): void;
/** Hides Popup */
hide(): void;
/** Toggles Popup */
toggle(): void;
getOverlayRef(): OverlayRef;
updateSize(size: OverlaySizeConfig): void;
/** Stream of clicks outside. */
private overlayClickOutside;
private handleOutsideClicks;
private setOverlayConfig;
private getContentHeight;
private isPopupContentEmpty;
static ɵfac: i0.ɵɵFactoryDeclaration<OverlayComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<OverlayComponent, "nui-overlay", never, { "overlayConfig": { "alias": "overlayConfig"; "required": false; }; "toggleReference": { "alias": "toggleReference"; "required": false; }; "viewportMargin": { "alias": "viewportMargin"; "required": false; }; "customContainer": { "alias": "customContainer"; "required": false; }; "roleAttr": { "alias": "roleAttr"; "required": false; }; }, { "clickOutside": "clickOutside"; }, never, ["*"], false, never>;
}