UNPKG

1.78 kBTypeScriptView Raw
1import { ToastContainerDirective } from '../toastr/toast.directive';
2import { OverlayRef } from './overlay-ref';
3import * as i0 from "@angular/core";
4/**
5 * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
6 * used as a low-level building building block for other components. Dialogs, tooltips, menus,
7 * selects, etc. can all be built using overlays. The service should primarily be used by authors
8 * of re-usable components rather than developers building end-user applications.
9 *
10 * An overlay *is* a PortalHost, so any kind of Portal can be loaded into one.
11 */
12export declare class Overlay {
13 private _overlayContainer;
14 private _componentFactoryResolver;
15 private _appRef;
16 private _document;
17 private _paneElements;
18 /**
19 * Creates an overlay.
20 * @returns A reference to the created overlay.
21 */
22 create(positionClass?: string, overlayContainer?: ToastContainerDirective): OverlayRef;
23 getPaneElement(positionClass?: string, overlayContainer?: ToastContainerDirective): HTMLElement;
24 /**
25 * Creates the DOM element for an overlay and appends it to the overlay container.
26 * @returns Newly-created pane element
27 */
28 private _createPaneElement;
29 /**
30 * Create a DomPortalHost into which the overlay content can be loaded.
31 * @param pane The DOM element to turn into a portal host.
32 * @returns A portal host for the given DOM element.
33 */
34 private _createPortalHost;
35 /**
36 * Creates an OverlayRef for an overlay in the given DOM element.
37 * @param pane DOM element for the overlay
38 */
39 private _createOverlayRef;
40 static ɵfac: i0.ɵɵFactoryDeclaration<Overlay, never>;
41 static ɵprov: i0.ɵɵInjectableDeclaration<Overlay>;
42}