import { ThfComponentInjectorService } from './../thf-component-injector/thf-component-injector.service'; import { ThfNotificationBaseService } from '@totvs/thf-core/services/thf-notification-base/thf-notification-base.service'; import { ThfToaster } from '@totvs/thf-core/services/thf-notification-base/thf-toaster-base/thf-toaster.interface'; /** * @extends ThfNotificationBaseService * * @example * * * * * *
* * * * * * * * * * * * *
* * * Ação chamada! * *
* * import { Component, ViewChild } from '@angular/core'; * * import { ThfCheckboxGroupOption } * from '@totvs/thf-core/components/thf-field-base/thf-checkbox-group-base/thf-checkbox-group.interface'; * import { ThfModalAction } from '@totvs/thf-core/components/thf-modal-base/thf-modal-action.interface'; * import { ThfModalComponent } from '@totvs/thf-web/components/thf-modal/thf-modal.component'; * import { ThfNotification } from '@totvs/thf-core/services/thf-notification-base/thf-notification.interface'; * import { ThfNotificationService } from '@totvs/thf-web/services/thf-notification/thf-notification.service'; * import { ThfRadioGroupOption } from '@totvs/thf-core/components/thf-field-base/thf-radio-group-base/thf-radio-group.interface'; * import { ThfToasterOrientation } from '@totvs/thf-core/services/thf-notification-base/thf-toaster-base/thf-toaster-orientation.enum'; * import { ThfToasterType } from '@totvs/thf-core/services/thf-notification-base/thf-toaster-base/thf-toaster-type.enum'; * * @Component({ * selector: 'sample-thf-notification-labs', * templateUrl: './sample-thf-notification-labs.component.html', * providers: [ThfNotificationService] * }) * export class SampleThfNotificationLabsComponent { * * text: string = 'Exemplo de notificação!'; * * @ViewChild(ThfModalComponent) thfModal: ThfModalComponent; * * notificationType: number = ThfToasterType.Success; * notificationTypeOptions: Array = [ * { label: 'Sucesso', value: ThfToasterType.Success }, * { label: 'Erro', value: ThfToasterType.Error }, * { label: 'Atenção', value: ThfToasterType.Warning }, * { label: 'Informação', value: ThfToasterType.Information } * ]; * * orientationType: number = ThfToasterOrientation.Top; * orientationTypeOptions: Array = [ * { label: 'Superior', value: ThfToasterOrientation.Top }, * { label: 'Inferior', value: ThfToasterOrientation.Bottom } * ]; * * notificationAction: ThfModalAction = { * label: 'ok', * action: () => this.thfModal.close() * }; * * action: Array; * actionValue: Array = []; * * constructor(private thfNotification: ThfNotificationService) { * this.action = [{ * value: 'action', * label: 'Adicionar ação na notificação' * }]; * } * * myFunction() { * const thfNotification: ThfNotification = { * message: this.text, * orientation: this.orientationType, * action: undefined, * actionLabel: 'Abrir Modal' * }; * * if (this.actionValue.length > 0) { * thfNotification.action = () => { * this.thfModal.open(); * }; * } * * if (this.notificationType === ThfToasterType.Success) { * this.thfNotification.success(thfNotification); * } else if (this.notificationType === ThfToasterType.Error) { * this.thfNotification.error(thfNotification); * } else if (this.notificationType === ThfToasterType.Warning) { * this.thfNotification.warning(thfNotification); * } else if (this.notificationType === ThfToasterType.Information) { * this.thfNotification.information(thfNotification); * } * } * } * *
*/ export declare class ThfNotificationService extends ThfNotificationBaseService { private thfComponentInjector; constructor(thfComponentInjector: ThfComponentInjectorService); createToaster(toaster: ThfToaster): void; destroyToaster(toaster: any): void; }