UNPKG

3.12 kBTypeScriptView Raw
1import { ComponentFactoryResolver, ComponentRef, NgZone, Type } from '@angular/core';
2import { Subject, BehaviorSubject, Observable } from 'rxjs';
3import { NbAdjustableConnectedPositionStrategy, NbPosition } from '../overlay-position';
4import { NbRenderableContainer } from '../overlay-container';
5import { NbOverlayContent, NbOverlayService } from '../overlay-service';
6import { NbOverlayRef, NbOverlayContainer, NbOverlayConfig } from '../mapping';
7import * as i0 from "@angular/core";
8export interface NbDynamicOverlayController {
9 show(): any;
10 hide(): any;
11 toggle(): any;
12 rebuild(): any;
13}
14export declare class NbDynamicOverlay {
15 protected overlay: NbOverlayService;
16 protected componentFactoryResolver: ComponentFactoryResolver;
17 protected zone: NgZone;
18 protected overlayContainer: NbOverlayContainer;
19 protected ref: NbOverlayRef;
20 protected container: ComponentRef<NbRenderableContainer>;
21 protected componentType: Type<NbRenderableContainer>;
22 protected context: Object;
23 protected content: NbOverlayContent;
24 protected positionStrategy: NbAdjustableConnectedPositionStrategy;
25 protected overlayConfig: NbOverlayConfig;
26 protected lastAppliedPosition: NbPosition;
27 protected disabled: boolean;
28 protected positionStrategyChange$: Subject<void>;
29 protected isShown$: BehaviorSubject<boolean>;
30 protected destroy$: Subject<void>;
31 protected overlayDestroy$: Subject<import("@angular/cdk/overlay").OverlayRef>;
32 get isAttached(): boolean;
33 get isShown(): Observable<boolean>;
34 constructor(overlay: NbOverlayService, componentFactoryResolver: ComponentFactoryResolver, zone: NgZone, overlayContainer: NbOverlayContainer);
35 create(componentType: Type<NbRenderableContainer>, content: NbOverlayContent, context: Object, positionStrategy: NbAdjustableConnectedPositionStrategy, overlayConfig?: NbOverlayConfig, disabled?: boolean): this;
36 setContent(content: NbOverlayContent): void;
37 setContext(context: Object): void;
38 setContentAndContext(content: NbOverlayContent, context: Object): void;
39 setComponent(componentType: Type<NbRenderableContainer>): void;
40 setPositionStrategy(positionStrategy: NbAdjustableConnectedPositionStrategy): void;
41 setOverlayConfig(overlayConfig: NbOverlayConfig): void;
42 setDisabled(disabled: boolean): void;
43 show(): any;
44 hide(): void;
45 toggle(): void;
46 dispose(): void;
47 getContainer(): ComponentRef<NbRenderableContainer>;
48 protected createOverlay(): void;
49 protected renderContainer(): void;
50 protected updateContext(): void;
51 protected createContainerContext(): Object;
52 /**
53 * Dimensions of the container may change after content update. So we listen to zone.stable event to
54 * reposition the container.
55 */
56 protected updatePositionWhenStable(overlay: NbOverlayRef): void;
57 protected updatePosition(): void;
58 protected hasOverlayInContainer(): boolean;
59 protected disposeOverlayRef(): void;
60 static ɵfac: i0.ɵɵFactoryDeclaration<NbDynamicOverlay, never>;
61 static ɵprov: i0.ɵɵInjectableDeclaration<NbDynamicOverlay>;
62}