import { AnimationEvent } from '@angular/animations'; import { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y'; import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, TemplatePortal } from '@angular/cdk/portal'; import { ChangeDetectorRef, ComponentRef, ElementRef, EmbeddedViewRef, EventEmitter } from '@angular/core'; import { SbbDialogConfig } from '../dialog/dialog-config'; /** * Throws an exception for the case when a ComponentPortal is * attached to a DomPortalOutlet without an origin. * @docs-private */ export declare function throwDialogContentAlreadyAttachedError(): void; /** * Internal component that wraps user-provided dialog content. * @docs-private */ export declare class SbbDialogContainer extends BasePortalOutlet { private _elementRef; private _focusTrapFactory; private _changeDetectorRef; private _document; /** The dialog configuration. */ config: SbbDialogConfig; /** The portal outlet inside of this container into which the dialog content will be loaded. */ portalOutlet: CdkPortalOutlet; /** The class that traps and manages focus within the dialog. */ private _focusTrap; /** Element that was focused before the dialog was opened. Save this to restore upon close. */ private _elementFocusedBeforeDialogWasOpened; /** State of the dialog animation. */ _state: 'void' | 'enter' | 'exit'; /** Emits when an animation state changes. */ _animationStateChanged: EventEmitter; /** ID of the element that should be considered as the dialog's label. */ _ariaLabelledBy: string | null; /** ID for the container DOM element. */ _id: string; /** Whether the dialog has a header. */ _hasHeader: boolean | null; /** Whether the dialog has a footer. */ _hasFooter: boolean | null; constructor(_elementRef: ElementRef, _focusTrapFactory: ConfigurableFocusTrapFactory, _changeDetectorRef: ChangeDetectorRef, _document: any, /** The dialog configuration. */ config: SbbDialogConfig); /** * Attach a ComponentPortal as content to this dialog container. * @param portal Portal to be attached as the dialog content. */ attachComponentPortal(portal: ComponentPortal): ComponentRef; /** * Attach a TemplatePortal as content to this dialog container. * @param portal Portal to be attached as the dialog content. */ attachTemplatePortal(portal: TemplatePortal): EmbeddedViewRef; /** Moves the focus inside the focus trap. */ private _trapFocus; /** Restores focus to the element that was focused before the dialog opened. */ private _restoreFocus; /** Moves focus back into the dialog if it was moved out. */ _recaptureFocus(): void; /** * Sets up the focus trand and saves a reference to the * element that was focused before the dialog was opened. */ private _setupFocusTrap; /** Returns whether focus is inside the dialog. */ private _containsFocus; /** Callback, invoked whenever an animation on the host completes. */ _onAnimationDone(event: AnimationEvent): void; /** Callback, invoked when an animation on the host starts. */ _onAnimationStart(event: AnimationEvent): void; /** Starts the dialog exit animation. */ _startExitAnimation(): void; }