source: trip-planner-front/node_modules/@angular/material/dialog/dialog-container.d.ts.__ivy_ngcc_bak@ 59329aa

Last change on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 4.8 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { AnimationEvent } from '@angular/animations';
9import { FocusMonitor, FocusOrigin, FocusTrapFactory } from '@angular/cdk/a11y';
10import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, DomPortal, TemplatePortal } from '@angular/cdk/portal';
11import { ChangeDetectorRef, ComponentRef, ElementRef, EmbeddedViewRef, EventEmitter } from '@angular/core';
12import { MatDialogConfig } from './dialog-config';
13/** Event that captures the state of dialog container animations. */
14interface DialogAnimationEvent {
15 state: 'opened' | 'opening' | 'closing' | 'closed';
16 totalTime: number;
17}
18/**
19 * Throws an exception for the case when a ComponentPortal is
20 * attached to a DomPortalOutlet without an origin.
21 * @docs-private
22 */
23export declare function throwMatDialogContentAlreadyAttachedError(): void;
24/**
25 * Base class for the `MatDialogContainer`. The base class does not implement
26 * animations as these are left to implementers of the dialog container.
27 */
28export declare abstract class _MatDialogContainerBase extends BasePortalOutlet {
29 protected _elementRef: ElementRef;
30 protected _focusTrapFactory: FocusTrapFactory;
31 protected _changeDetectorRef: ChangeDetectorRef;
32 /** The dialog configuration. */
33 _config: MatDialogConfig;
34 private _focusMonitor?;
35 protected _document: Document;
36 /** The portal outlet inside of this container into which the dialog content will be loaded. */
37 _portalOutlet: CdkPortalOutlet;
38 /** The class that traps and manages focus within the dialog. */
39 private _focusTrap;
40 /** Emits when an animation state changes. */
41 _animationStateChanged: EventEmitter<DialogAnimationEvent>;
42 /** Element that was focused before the dialog was opened. Save this to restore upon close. */
43 private _elementFocusedBeforeDialogWasOpened;
44 /**
45 * Type of interaction that led to the dialog being closed. This is used to determine
46 * whether the focus style will be applied when returning focus to its original location
47 * after the dialog is closed.
48 */
49 _closeInteractionType: FocusOrigin | null;
50 /** ID of the element that should be considered as the dialog's label. */
51 _ariaLabelledBy: string | null;
52 /** ID for the container DOM element. */
53 _id: string;
54 constructor(_elementRef: ElementRef, _focusTrapFactory: FocusTrapFactory, _changeDetectorRef: ChangeDetectorRef, _document: any,
55 /** The dialog configuration. */
56 _config: MatDialogConfig, _focusMonitor?: FocusMonitor | undefined);
57 /** Starts the dialog exit animation. */
58 abstract _startExitAnimation(): void;
59 /** Initializes the dialog container with the attached content. */
60 _initializeWithAttachedContent(): void;
61 /**
62 * Attach a ComponentPortal as content to this dialog container.
63 * @param portal Portal to be attached as the dialog content.
64 */
65 attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
66 /**
67 * Attach a TemplatePortal as content to this dialog container.
68 * @param portal Portal to be attached as the dialog content.
69 */
70 attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
71 /**
72 * Attaches a DOM portal to the dialog container.
73 * @param portal Portal to be attached.
74 * @deprecated To be turned into a method.
75 * @breaking-change 10.0.0
76 */
77 attachDomPortal: (portal: DomPortal) => void;
78 /** Moves focus back into the dialog if it was moved out. */
79 _recaptureFocus(): void;
80 /** Moves the focus inside the focus trap. */
81 protected _trapFocus(): void;
82 /** Restores focus to the element that was focused before the dialog opened. */
83 protected _restoreFocus(): void;
84 /** Sets up the focus trap. */
85 private _setupFocusTrap;
86 /** Captures the element that was focused before the dialog was opened. */
87 private _capturePreviouslyFocusedElement;
88 /** Focuses the dialog container. */
89 private _focusDialogContainer;
90 /** Returns whether focus is inside the dialog. */
91 private _containsFocus;
92}
93/**
94 * Internal component that wraps user-provided dialog content.
95 * Animation is based on https://material.io/guidelines/motion/choreography.html.
96 * @docs-private
97 */
98export declare class MatDialogContainer extends _MatDialogContainerBase {
99 /** State of the dialog animation. */
100 _state: 'void' | 'enter' | 'exit';
101 /** Callback, invoked whenever an animation on the host completes. */
102 _onAnimationDone({ toState, totalTime }: AnimationEvent): void;
103 /** Callback, invoked when an animation on the host starts. */
104 _onAnimationStart({ toState, totalTime }: AnimationEvent): void;
105 /** Starts the dialog exit animation. */
106 _startExitAnimation(): void;
107}
108export {};
Note: See TracBrowser for help on using the repository browser.