UNPKG

@angular-mdl/core

Version:

Angular components, directives and styles based on material design lite https://getmdl.io.

69 lines (68 loc) 3.24 kB
import { ComponentFactoryResolver, EventEmitter, Injector, TemplateRef } from "@angular/core"; import { Observable } from "rxjs"; import { IMdlCustomDialogConfiguration, IMdlDialogConfiguration, IMdlSimpleDialogConfiguration } from "./mdl-dialog-configuration"; import { MdlDialogOutletService } from "../dialog-outlet/mdl-dialog-outlet.service"; import { MdlDialogReference } from "./mdl-dialog-reference"; import * as i0 from "@angular/core"; /** * The MdlDialogService is used to open different kind of dialogs. SimpleDialogs and Custom Dialogs. * * @experimental */ export declare class MdlDialogService { private componentFactoryResolver; private mdlDialogOutletService; private injector; /** * Emits an event when either all modals are closed, or one gets opened. * * @returns A subscribable event emitter that provides a boolean indicating whether a modal is open or not. */ onDialogsOpenChanged: EventEmitter<boolean>; private openDialogs; constructor(componentFactoryResolver: ComponentFactoryResolver, mdlDialogOutletService: MdlDialogOutletService, injector: Injector); /** * Shows a dialog that is just an alert - e.g. with one button. * * @param alertMessage The message that should be displayed. * @param okText The text that the button should have * @param title The optional title of the dialog * returns An Observable that is called if the user hits the Ok button. */ alert(alertMessage: string, okText?: string, title?: string): Observable<void>; /** * Shows a dialog that is just a confirm message - e.g. with two button. * * @param question The question that should be displayed. * @param title The title that should be displayed on top of Question. * @param declineText The text for decline button. defaults to Cancel * @param confirmText The text for the confirm button . defaults to Ok * returns An Observable that is called if the user hits the Ok button. */ confirm(question: string, declineText?: string, confirmText?: string, title?: string): Observable<void>; /** * Shows a dialog that is specified by the provided configuration. * * @param config The simple dialog configuration. * returns An Observable that returns the MdlDialogReference. */ showDialog(config: IMdlSimpleDialogConfiguration): Observable<MdlDialogReference>; /** * Shows a dialog that is specified by the provided configuration. * * @param config The custom dialog configuration. * returns An Observable that returns the MdlDialogReference. */ showCustomDialog(config: IMdlCustomDialogConfiguration): Observable<MdlDialogReference>; showDialogTemplate(template: TemplateRef<unknown>, config: IMdlDialogConfiguration): Observable<MdlDialogReference>; private showHostDialog; private createHostDialog; private pushDialog; private popDialog; private orderDialogStack; private getTopMostInternalDialogRef; private onBackdropClick; private createComponentInstance; static ɵfac: i0.ɵɵFactoryDeclaration<MdlDialogService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<MdlDialogService>; }