import { ThfComponentInjectorService } from './../thf-component-injector/thf-component-injector.service'; import { ThfDialogBaseService } from '@totvs/thf-core/services/thf-dialog-base/thf-dialog-base.service'; import { ThfDialogConfirmOptions, ThfDialogAlertOptions } from '@totvs/thf-core/services/thf-dialog-base/thf-dialog.interface'; import { ThfDialogType } from '@totvs/thf-core/services/thf-dialog-base/thf-dialog.enum'; /** * @extends ThfDialogBaseService * * @example * * * * * * *

* * Opção selecionada: {{ choice }} * * *
* *
* * * * * * * * *
*
* * import { Component } from '@angular/core'; * * import { ThfModule } from '@totvs/thf-web'; * import { ThfDialogService } from '@totvs/thf-web/services/thf-dialog/thf-dialog.service'; * * @Component({ * selector: 'sample-thf-dialog-labs', * providers: [ThfDialogService], * templateUrl: './sample-thf-dialog-labs.component.html', * }) * * export class SampleThfDialogLabsComponent { * title = 'Confirmação'; * mensage = 'Você tem certeza que deseja efetuar o pedido número #42?'; * dialogType = 'confirm'; * * choice: string; * * dialogOptions: Array = [ * { label: 'Alert Dialog', value: 'alert' }, * { label: 'Confirm Dialog', value: 'confirm' } * ]; * * constructor(private thfAlert: ThfDialogService) { } * * openDialog() { * this.choice = ''; * if (this.dialogType === 'alert') { * this.alertDialog(); * } else if (this.dialogType === 'confirm') { * this.confirmDialog(); * } * } * * alertDialog() { * this.thfAlert.alert({ * title: this.title, * message: this.mensage, * ok: () => this.yourChoice('OK') * }); * } * * confirmDialog() { * this.thfAlert.confirm({ * title: this.title, * message: this.mensage, * confirm: () => this.yourChoice('CONFIRMAR'), * cancel: () => this.yourChoice('CANCELAR') * }); * } * * yourChoice(choice) { * this.choice = choice; * } * } * *
*/ export declare class ThfDialogService extends ThfDialogBaseService { private thfComponentInjector; constructor(thfComponentInjector: ThfComponentInjectorService); openDialog(dialogType: ThfDialogType, dialogOptions: ThfDialogAlertOptions | ThfDialogConfirmOptions): void; }