UNPKG

@netgrif/components-core

Version:

Netgrif Application engine frontend core Angular library

47 lines (46 loc) 2.79 kB
import { ConfirmDialogComponent } from '../components/confirm-dialog/confirm-dialog.component'; import { AlertDialogComponent } from '../components/alert-dialog/alert-dialog.component'; import { PromptDialogComponent } from '../components/prompt-dialog/prompt-dialog.component'; import { DialogData } from '../models/DialogData'; import { DialogResult } from '../models/DialogResult'; import { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog'; import * as i0 from "@angular/core"; /** Service to open own modal interacting dialog components based on Material Design via [MatDialog]{@link MatDialog} service. */ export declare class DialogService { private dialog; /** * Only inject service. * @param dialog Service to open Material Design modal dialogs. */ constructor(dialog: MatDialog); /** * Open the alert modal dialog and show his content. * Alert dialog should be used to show the user a crucial message. * @param title Dialog title. * @param content Informs user about message. * @param configMatDialog Extra configuration options. * @returns Reference to the newly-opened alert dialog. When dialog closes an empty object is returned. */ openAlertDialog(title: string, content: string, configMatDialog?: MatDialogConfig<DialogData>): MatDialogRef<AlertDialogComponent, DialogResult>; /** * Open question model dialog with positive and negative answer button. * @param title Dialog title. * @param question Question forming the idea of the whole dialogue with the user. * @param negativeChoiceLabel Negative answer label * @param positiveChoiceLabel Positive answer label * @param configMatDialog Extra configuration options. * @returns Reference to the newly-opened question dialog. When dialog is closed made choice is returned. */ openConfirmDialog(title: string, question: string, negativeChoiceLabel: string, positiveChoiceLabel: string, configMatDialog?: MatDialogConfig<DialogData>): MatDialogRef<ConfirmDialogComponent, DialogResult>; /** * Open question model dialog with answer from user as message response. * @param title Dialog title. * @param question Question forming the idea of the whole dialogue with the user. * @param placeholder Label for answer input box. * @param configMatDialog Extra configuration options. * @returns Reference to the newly-opened question with answer dialog. */ openPromptDialog(title: string, question: string, placeholder: string, configMatDialog?: MatDialogConfig<DialogData>): MatDialogRef<PromptDialogComponent, any>; static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>; }