import { FocusMonitor, FocusOrigin, ConfigurableFocusTrapFactory, InteractivityChecker } from '@angular/cdk/a11y'; import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal'; import { ChangeDetectorRef, ComponentRef, ElementRef, EmbeddedViewRef, EventEmitter, NgZone } from '@angular/core'; import { BaoModalInitialConfig } from './modal-config'; import * as i0 from "@angular/core"; /** Event that captures the state of modal container animations. */ interface DialogAnimationEvent { state: 'opened' | 'opening' | 'closing' | 'closed'; totalTime: number; } /** * Throws an exception for the case when a ComponentPortal is * attached to a DomPortalOutlet without an origin. * @docs-private */ export declare function throwBaoModalContentAlreadyAttachedError(): void; /** * Base class for the `BaoModalContainer`. The base class does not implement * animations as these are left to implementers of the modal container. */ export declare abstract class _BaoModalContainerBase extends BasePortalOutlet { protected _elementRef: ElementRef; protected _focusTrapFactory: ConfigurableFocusTrapFactory; protected _changeDetectorRef: ChangeDetectorRef; /** The modal configuration. */ _config: BaoModalInitialConfig; private readonly _interactivityChecker; private readonly _ngZone; private _focusMonitor?; /** The portal outlet inside of this container into which the modal content will be loaded. */ _portalOutlet: CdkPortalOutlet; /** Emits when an animation state changes. */ _animationStateChanged: EventEmitter; /** * Type of interaction that led to the modal being closed. This is used to determine * whether the focus style will be applied when returning focus to its original location * after the modal is closed. */ _closeInteractionType: FocusOrigin | null; /** ID of the element that should be considered as the modal's label. */ _ariaLabelledBy: string | null; /** ID for the container DOM element. */ _id: string; protected _document: Document; /** The class that traps and manages focus within the modal. */ private _focusTrap; /** Element that was focused before the modal was opened. Save this to restore upon close. */ private _elementFocusedBeforeDialogWasOpened; constructor(_elementRef: ElementRef, _focusTrapFactory: ConfigurableFocusTrapFactory, _changeDetectorRef: ChangeDetectorRef, _document: any, /** The modal configuration. */ _config: BaoModalInitialConfig, _interactivityChecker: InteractivityChecker, _ngZone: NgZone, _focusMonitor?: FocusMonitor); /** Initializes the modal container with the attached content. */ _initializeWithAttachedContent(): void; /** * Attach a ComponentPortal as content to this modal container. */ attachComponentPortal(portal: ComponentPortal): ComponentRef; /** * Attach a TemplatePortal as content to this modal container. */ attachTemplatePortal(portal: TemplatePortal): EmbeddedViewRef; /** Moves focus back into the modal if it was moved out. */ _recaptureFocus(): Promise; /** * Moves the focus inside the focus trap. When autoFocus is not set to 'modal', if focus * cannot be moved then focus will go to the modal container. */ protected _trapFocus(): Promise; /** Restores focus to the element that was focused before the modal opened. */ protected _restoreFocus(): void; /** * Focuses the provided element. If the element is not focusable, it will add a tabIndex * attribute to forcefully focus it. The attribute is removed after focus is moved. */ private _forceFocus; /** * Focuses the first element that matches the given selector within the focus trap. */ private _focusByCssSelector; /** Sets up the focus trap. */ private _setupFocusTrap; /** Captures the element that was focused before the modal was opened. */ private _capturePreviouslyFocusedElement; /** Focuses the modal container. */ private _focusDialogContainer; /** Returns whether focus is inside the modal. */ private _containsFocus; /** Starts the modal exit animation. */ abstract _startExitAnimation(): void; abstract _startOpenAnimation(): void; static ɵfac: i0.ɵɵFactoryDeclaration<_BaoModalContainerBase, [null, null, null, { optional: true; }, null, null, null, null]>; static ɵdir: i0.ɵɵDirectiveDeclaration<_BaoModalContainerBase, never, never, {}, {}, never, never, false, never>; } export declare class BaoModalContainer extends _BaoModalContainerBase { /** State of the modal animation. */ _state: 'void' | 'enter' | 'exit'; _startOpenAnimation(): void; /** Starts the modal exit animation. */ _startExitAnimation(): void; private _finishDialogOpen; private _openAnimationDone; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};