UNPKG

@versatiledatakit/shared

Version:

Versatile Data Kit Shared library enables reusability of shared features like: NgRx Redux, Error Handlers, Utils, Generic Components, etc.

63 lines (62 loc) 2.55 kB
import { OnDestroy } from '@angular/core'; import { TaurusObject } from '../../../common'; import { DynamicComponentsService } from '../../dynamic-components'; import { ConfirmationInputModel, ConfirmationOutputModel } from '../model'; import * as i0 from "@angular/core"; /** * ** Confirmation Service that create confirmation view for every confirm request, * and upon User action Confirm/Reject returns flow to the Invoker. * * - Utilizes <code>Promise<ConfirmationOutputModel></code> for communication. */ export declare class ConfirmationService extends TaurusObject implements OnDestroy { private readonly dynamicComponentsService; /** * @inheritDoc */ static readonly CLASS_NAME: string; /** * ** Acquired ViewContainerRef from {@link DynamicComponentsService}, * where Confirmation Container {@link ConfirmationContainerComponent} will be inserted. * @private */ private _acquiredViewContainerRef; /** * ** Confirmation Container reference {@link ConfirmationContainerComponent}, * where all contextual Confirmation components {@link ConfirmationComponent} will be inserted. * @private */ private _confirmationContainerRef; /** * ** Constructor. */ constructor(dynamicComponentsService: DynamicComponentsService); /** * ** Show confirm view according the provided model instructions, and return flow to the invoker upon User action Confirm/Reject. * * - Utilizes <b><code>Promise<ConfirmationOutputModel></code></b> for communication. * - Sets some default values if model instructions are incomplete because most of them are optional. */ confirm(model: ConfirmationInputModel): Promise<ConfirmationOutputModel>; /** * ** Initialize service. * * - Should be invoked only once. * - Ideal place for invoking is <code>AppComponent.ngOnInit()</code>. */ initialize(): void; /** * @inheritDoc */ ngOnDestroy(): void; private _acquireDynamicViewContainerRef; private _createConfirmationContainerComponent; private _createConfirmationComponent; private _isAcquiredViewContainerRefUnhealthy; private _refineConfirmationContainerVisibility; private _clearSingleConfirmationResources; private _clearResources; private static _assignMessageAndModel; static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmationService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<ConfirmationService>; }