UNPKG

61 kBSource Map (JSON)View Raw
1{"version":3,"file":"dialog.mjs","sources":["../../../../../../src/cdk/dialog/dialog-config.ts","../../../../../../src/cdk/dialog/dialog-container.ts","../../../../../../src/cdk/dialog/dialog-container.html","../../../../../../src/cdk/dialog/dialog-ref.ts","../../../../../../src/cdk/dialog/dialog-injectors.ts","../../../../../../src/cdk/dialog/dialog.ts","../../../../../../src/cdk/dialog/dialog-module.ts","../../../../../../src/cdk/dialog/dialog_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n ViewContainerRef,\n ComponentFactoryResolver,\n Injector,\n StaticProvider,\n Type,\n} from '@angular/core';\nimport {Direction} from '@angular/cdk/bidi';\nimport {PositionStrategy, ScrollStrategy} from '@angular/cdk/overlay';\nimport {BasePortalOutlet} from '@angular/cdk/portal';\n\n/** Options for where to set focus to automatically on dialog open */\nexport type AutoFocusTarget = 'dialog' | 'first-tabbable' | 'first-heading';\n\n/** Valid ARIA roles for a dialog. */\nexport type DialogRole = 'dialog' | 'alertdialog';\n\n/** Configuration for opening a modal dialog. */\nexport class DialogConfig<D = unknown, R = unknown, C extends BasePortalOutlet = BasePortalOutlet> {\n /**\n * Where the attached component should live in Angular's *logical* component tree.\n * This affects what is available for injection and the change detection order for the\n * component instantiated inside of the dialog. This does not affect where the dialog\n * content will be rendered.\n */\n viewContainerRef?: ViewContainerRef;\n\n /**\n * Injector used for the instantiation of the component to be attached. If provided,\n * takes precedence over the injector indirectly provided by `ViewContainerRef`.\n */\n injector?: Injector;\n\n /** ID for the dialog. If omitted, a unique one will be generated. */\n id?: string;\n\n /** The ARIA role of the dialog element. */\n role?: DialogRole = 'dialog';\n\n /** Optional CSS class or classes applied to the overlay panel. */\n panelClass?: string | string[] = '';\n\n /** Whether the dialog has a backdrop. */\n hasBackdrop?: boolean = true;\n\n /** Optional CSS class or classes applied to the overlay backdrop. */\n backdropClass?: string | string[] = '';\n\n /** Whether the dialog closes with the escape key or pointer events outside the panel element. */\n disableClose?: boolean = false;\n\n /** Width of the dialog. */\n width?: string = '';\n\n /** Height of the dialog. */\n height?: string = '';\n\n /** Min-width of the dialog. If a number is provided, assumes pixel units. */\n minWidth?: number | string;\n\n /** Min-height of the dialog. If a number is provided, assumes pixel units. */\n minHeight?: number | string;\n\n /** Max-width of the dialog. If a number is provided, assumes pixel units. Defaults to 80vw. */\n maxWidth?: number | string;\n\n /** Max-height of the dialog. If a number is provided, assumes pixel units. */\n maxHeight?: number | string;\n\n /** Strategy to use when positioning the dialog. Defaults to centering it on the page. */\n positionStrategy?: PositionStrategy;\n\n /** Data being injected into the child component. */\n data?: D | null = null;\n\n /** Layout direction for the dialog's content. */\n direction?: Direction;\n\n /** ID of the element that describes the dialog. */\n ariaDescribedBy?: string | null = null;\n\n /** ID of the element that labels the dialog. */\n ariaLabelledBy?: string | null = null;\n\n /** Dialog label applied via `aria-label` */\n ariaLabel?: string | null = null;\n\n /** Whether this is a modal dialog. Used to set the `aria-modal` attribute. */\n ariaModal?: boolean = true;\n\n /**\n * Where the dialog should focus on open.\n * @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or\n * AutoFocusTarget instead.\n */\n autoFocus?: AutoFocusTarget | string | boolean = 'first-tabbable';\n\n /**\n * Whether the dialog should restore focus to the previously-focused element upon closing.\n * Has the following behavior based on the type that is passed in:\n * - `boolean` - when true, will return focus to the element that was focused before the dialog\n * was opened, otherwise won't restore focus at all.\n * - `string` - focus will be restored to the first element that matches the CSS selector.\n * - `HTMLElement` - focus will be restored to the specific element.\n */\n restoreFocus?: boolean | string | HTMLElement = true;\n\n /**\n * Scroll strategy to be used for the dialog. This determines how\n * the dialog responds to scrolling underneath the panel element.\n */\n scrollStrategy?: ScrollStrategy;\n\n /**\n * Whether the dialog should close when the user navigates backwards or forwards through browser\n * history. This does not apply to navigation via anchor element unless using URL-hash based\n * routing (`HashLocationStrategy` in the Angular router).\n */\n closeOnNavigation?: boolean = true;\n\n /**\n * Whether the dialog should close when the dialog service is destroyed. This is useful if\n * another service is wrapping the dialog and is managing the destruction instead.\n */\n closeOnDestroy?: boolean = true;\n\n /**\n * Whether the dialog should close when the underlying overlay is detached. This is useful if\n * another service is wrapping the dialog and is managing the destruction instead. E.g. an\n * external detachment can happen as a result of a scroll strategy triggering it or when the\n * browser location changes.\n */\n closeOnOverlayDetachments?: boolean = true;\n\n /** Alternate `ComponentFactoryResolver` to use when resolving the associated component. */\n componentFactoryResolver?: ComponentFactoryResolver;\n\n /**\n * Providers that will be exposed to the contents of the dialog. Can also\n * be provided as a function in order to generate the providers lazily.\n */\n providers?:\n | StaticProvider[]\n | ((dialogRef: R, config: DialogConfig<D, R, C>, container: C) => StaticProvider[]);\n\n /**\n * Component into which the dialog content will be rendered. Defaults to `CdkDialogContainer`.\n * A configuration object can be passed in to customize the providers that will be exposed\n * to the dialog container.\n */\n container?:\n | Type<C>\n | {\n type: Type<C>;\n providers: (config: DialogConfig<D, R, C>) => StaticProvider[];\n };\n\n /**\n * Context that will be passed to template-based dialogs.\n * A function can be passed in to resolve the context lazily.\n */\n templateContext?: Record<string, any> | (() => Record<string, any>);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n FocusMonitor,\n FocusOrigin,\n FocusTrap,\n FocusTrapFactory,\n InteractivityChecker,\n} from '@angular/cdk/a11y';\nimport {OverlayRef} from '@angular/cdk/overlay';\nimport {_getFocusedElementPierceShadowDom} from '@angular/cdk/platform';\nimport {\n BasePortalOutlet,\n CdkPortalOutlet,\n ComponentPortal,\n DomPortal,\n TemplatePortal,\n} from '@angular/cdk/portal';\nimport {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n ElementRef,\n EmbeddedViewRef,\n Inject,\n NgZone,\n OnDestroy,\n Optional,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {DialogConfig} from './dialog-config';\n\nexport function throwDialogContentAlreadyAttachedError() {\n throw Error('Attempting to attach dialog content after content is already attached');\n}\n\n/**\n * Internal component that wraps user-provided dialog content.\n * @docs-private\n */\n@Component({\n selector: 'cdk-dialog-container',\n templateUrl: './dialog-container.html',\n styleUrls: ['dialog-container.css'],\n encapsulation: ViewEncapsulation.None,\n // Using OnPush for dialogs caused some G3 sync issues. Disabled until we can track them down.\n // tslint:disable-next-line:validate-decorators\n changeDetection: ChangeDetectionStrategy.Default,\n host: {\n 'class': 'cdk-dialog-container',\n 'tabindex': '-1',\n '[attr.id]': '_config.id || null',\n '[attr.role]': '_config.role',\n '[attr.aria-modal]': '_config.ariaModal',\n '[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledBy',\n '[attr.aria-label]': '_config.ariaLabel',\n '[attr.aria-describedby]': '_config.ariaDescribedBy || null',\n },\n})\nexport class CdkDialogContainer<C extends DialogConfig = DialogConfig>\n extends BasePortalOutlet\n implements OnDestroy\n{\n protected _document: Document;\n\n /** The portal outlet inside of this container into which the dialog content will be loaded. */\n @ViewChild(CdkPortalOutlet, {static: true}) _portalOutlet: CdkPortalOutlet;\n\n /** The class that traps and manages focus within the dialog. */\n private _focusTrap: FocusTrap;\n\n /** Element that was focused before the dialog was opened. Save this to restore upon close. */\n private _elementFocusedBeforeDialogWasOpened: HTMLElement | null = null;\n\n /**\n * Type of interaction that led to the dialog being closed. This is used to determine\n * whether the focus style will be applied when returning focus to its original location\n * after the dialog is closed.\n */\n _closeInteractionType: FocusOrigin | null = null;\n\n /** ID of the element that should be considered as the dialog's label. */\n _ariaLabelledBy: string | null;\n\n constructor(\n protected _elementRef: ElementRef,\n protected _focusTrapFactory: FocusTrapFactory,\n @Optional() @Inject(DOCUMENT) _document: any,\n @Inject(DialogConfig) readonly _config: C,\n private _interactivityChecker: InteractivityChecker,\n protected _ngZone: NgZone,\n private _overlayRef: OverlayRef,\n private _focusMonitor?: FocusMonitor,\n ) {\n super();\n this._ariaLabelledBy = this._config.ariaLabelledBy || null;\n this._document = _document;\n }\n\n protected _contentAttached() {\n this._initializeFocusTrap();\n this._handleBackdropClicks();\n this._captureInitialFocus();\n }\n\n /**\n * Can be used by child classes to customize the initial focus\n * capturing behavior (e.g. if it's tied to an animation).\n */\n protected _captureInitialFocus() {\n this._trapFocus();\n }\n\n ngOnDestroy() {\n this._restoreFocus();\n }\n\n /**\n * Attach a ComponentPortal as content to this dialog container.\n * @param portal Portal to be attached as the dialog content.\n */\n attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\n if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throwDialogContentAlreadyAttachedError();\n }\n\n const result = this._portalOutlet.attachComponentPortal(portal);\n this._contentAttached();\n return result;\n }\n\n /**\n * Attach a TemplatePortal as content to this dialog container.\n * @param portal Portal to be attached as the dialog content.\n */\n attachTemplatePortal<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T> {\n if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throwDialogContentAlreadyAttachedError();\n }\n\n const result = this._portalOutlet.attachTemplatePortal(portal);\n this._contentAttached();\n return result;\n }\n\n /**\n * Attaches a DOM portal to the dialog container.\n * @param portal Portal to be attached.\n * @deprecated To be turned into a method.\n * @breaking-change 10.0.0\n */\n override attachDomPortal = (portal: DomPortal) => {\n if (this._portalOutlet.hasAttached() && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throwDialogContentAlreadyAttachedError();\n }\n\n const result = this._portalOutlet.attachDomPortal(portal);\n this._contentAttached();\n return result;\n };\n\n // TODO(crisbeto): this shouldn't be exposed, but there are internal references to it.\n /** Captures focus if it isn't already inside the dialog. */\n _recaptureFocus() {\n if (!this._containsFocus()) {\n this._trapFocus();\n }\n }\n\n /**\n * Focuses the provided element. If the element is not focusable, it will add a tabIndex\n * attribute to forcefully focus it. The attribute is removed after focus is moved.\n * @param element The element to focus.\n */\n private _forceFocus(element: HTMLElement, options?: FocusOptions) {\n if (!this._interactivityChecker.isFocusable(element)) {\n element.tabIndex = -1;\n // The tabindex attribute should be removed to avoid navigating to that element again\n this._ngZone.runOutsideAngular(() => {\n const callback = () => {\n element.removeEventListener('blur', callback);\n element.removeEventListener('mousedown', callback);\n element.removeAttribute('tabindex');\n };\n\n element.addEventListener('blur', callback);\n element.addEventListener('mousedown', callback);\n });\n }\n element.focus(options);\n }\n\n /**\n * Focuses the first element that matches the given selector within the focus trap.\n * @param selector The CSS selector for the element to set focus to.\n */\n private _focusByCssSelector(selector: string, options?: FocusOptions) {\n let elementToFocus = this._elementRef.nativeElement.querySelector(\n selector,\n ) as HTMLElement | null;\n if (elementToFocus) {\n this._forceFocus(elementToFocus, options);\n }\n }\n\n /**\n * Moves the focus inside the focus trap. When autoFocus is not set to 'dialog', if focus\n * cannot be moved then focus will go to the dialog container.\n */\n protected _trapFocus() {\n const element = this._elementRef.nativeElement;\n // If were to attempt to focus immediately, then the content of the dialog would not yet be\n // ready in instances where change detection has to run first. To deal with this, we simply\n // wait for the microtask queue to be empty when setting focus when autoFocus isn't set to\n // dialog. If the element inside the dialog can't be focused, then the container is focused\n // so the user can't tab into other elements behind it.\n switch (this._config.autoFocus) {\n case false:\n case 'dialog':\n // Ensure that focus is on the dialog container. It's possible that a different\n // component tried to move focus while the open animation was running. See:\n // https://github.com/angular/components/issues/16215. Note that we only want to do this\n // if the focus isn't inside the dialog already, because it's possible that the consumer\n // turned off `autoFocus` in order to move focus themselves.\n if (!this._containsFocus()) {\n element.focus();\n }\n break;\n case true:\n case 'first-tabbable':\n this._focusTrap.focusInitialElementWhenReady().then(focusedSuccessfully => {\n // If we weren't able to find a focusable element in the dialog, then focus the dialog\n // container instead.\n if (!focusedSuccessfully) {\n this._focusDialogContainer();\n }\n });\n break;\n case 'first-heading':\n this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role=\"heading\"]');\n break;\n default:\n this._focusByCssSelector(this._config.autoFocus!);\n break;\n }\n }\n\n /** Restores focus to the element that was focused before the dialog opened. */\n private _restoreFocus() {\n const focusConfig = this._config.restoreFocus;\n let focusTargetElement: HTMLElement | null = null;\n\n if (typeof focusConfig === 'string') {\n focusTargetElement = this._document.querySelector(focusConfig);\n } else if (typeof focusConfig === 'boolean') {\n focusTargetElement = focusConfig ? this._elementFocusedBeforeDialogWasOpened : null;\n } else if (focusConfig) {\n focusTargetElement = focusConfig;\n }\n\n // We need the extra check, because IE can set the `activeElement` to null in some cases.\n if (\n this._config.restoreFocus &&\n focusTargetElement &&\n typeof focusTargetElement.focus === 'function'\n ) {\n const activeElement = _getFocusedElementPierceShadowDom();\n const element = this._elementRef.nativeElement;\n\n // Make sure that focus is still inside the dialog or is on the body (usually because a\n // non-focusable element like the backdrop was clicked) before moving it. It's possible that\n // the consumer moved it themselves before the animation was done, in which case we shouldn't\n // do anything.\n if (\n !activeElement ||\n activeElement === this._document.body ||\n activeElement === element ||\n element.contains(activeElement)\n ) {\n if (this._focusMonitor) {\n this._focusMonitor.focusVia(focusTargetElement, this._closeInteractionType);\n this._closeInteractionType = null;\n } else {\n focusTargetElement.focus();\n }\n }\n }\n\n if (this._focusTrap) {\n this._focusTrap.destroy();\n }\n }\n\n /** Focuses the dialog container. */\n private _focusDialogContainer() {\n // Note that there is no focus method when rendering on the server.\n if (this._elementRef.nativeElement.focus) {\n this._elementRef.nativeElement.focus();\n }\n }\n\n /** Returns whether focus is inside the dialog. */\n private _containsFocus() {\n const element = this._elementRef.nativeElement;\n const activeElement = _getFocusedElementPierceShadowDom();\n return element === activeElement || element.contains(activeElement);\n }\n\n /** Sets up the focus trap. */\n private _initializeFocusTrap() {\n this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);\n\n // Save the previously focused element. This element will be re-focused\n // when the dialog closes.\n if (this._document) {\n this._elementFocusedBeforeDialogWasOpened = _getFocusedElementPierceShadowDom();\n }\n }\n\n /** Sets up the listener that handles clicks on the dialog backdrop. */\n private _handleBackdropClicks() {\n // Clicking on the backdrop will move focus out of dialog.\n // Recapture it if closing via the backdrop is disabled.\n this._overlayRef.backdropClick().subscribe(() => {\n if (this._config.disableClose) {\n this._recaptureFocus();\n }\n });\n }\n}\n","<ng-template cdkPortalOutlet></ng-template>\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {OverlayRef} from '@angular/cdk/overlay';\nimport {ESCAPE, hasModifierKey} from '@angular/cdk/keycodes';\nimport {Observable, Subject, Subscription} from 'rxjs';\nimport {DialogConfig} from './dialog-config';\nimport {FocusOrigin} from '@angular/cdk/a11y';\nimport {BasePortalOutlet} from '@angular/cdk/portal';\n\n/** Additional options that can be passed in when closing a dialog. */\nexport interface DialogCloseOptions {\n /** Focus original to use when restoring focus. */\n focusOrigin?: FocusOrigin;\n}\n\n/**\n * Reference to a dialog opened via the Dialog service.\n */\nexport class DialogRef<R = unknown, C = unknown> {\n /**\n * Instance of component opened into the dialog. Will be\n * null when the dialog is opened using a `TemplateRef`.\n */\n readonly componentInstance: C | null;\n\n /** Instance of the container that is rendering out the dialog content. */\n readonly containerInstance: BasePortalOutlet & {_closeInteractionType?: FocusOrigin};\n\n /** Whether the user is allowed to close the dialog. */\n disableClose: boolean | undefined;\n\n /** Emits when the dialog has been closed. */\n readonly closed: Observable<R | undefined> = new Subject<R | undefined>();\n\n /** Emits when the backdrop of the dialog is clicked. */\n readonly backdropClick: Observable<MouseEvent>;\n\n /** Emits when on keyboard events within the dialog. */\n readonly keydownEvents: Observable<KeyboardEvent>;\n\n /** Emits on pointer events that happen outside of the dialog. */\n readonly outsidePointerEvents: Observable<MouseEvent>;\n\n /** Unique ID for the dialog. */\n readonly id: string;\n\n /** Subscription to external detachments of the dialog. */\n private _detachSubscription: Subscription;\n\n constructor(\n readonly overlayRef: OverlayRef,\n readonly config: DialogConfig<any, DialogRef<R, C>, BasePortalOutlet>,\n ) {\n this.disableClose = config.disableClose;\n this.backdropClick = overlayRef.backdropClick();\n this.keydownEvents = overlayRef.keydownEvents();\n this.outsidePointerEvents = overlayRef.outsidePointerEvents();\n this.id = config.id!; // By the time the dialog is created we are guaranteed to have an ID.\n\n this.keydownEvents.subscribe(event => {\n if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) {\n event.preventDefault();\n this.close(undefined, {focusOrigin: 'keyboard'});\n }\n });\n\n this.backdropClick.subscribe(() => {\n if (!this.disableClose) {\n this.close(undefined, {focusOrigin: 'mouse'});\n }\n });\n\n this._detachSubscription = overlayRef.detachments().subscribe(() => {\n // Check specifically for `false`, because we want `undefined` to be treated like `true`.\n if (config.closeOnOverlayDetachments !== false) {\n this.close();\n }\n });\n }\n\n /**\n * Close the dialog.\n * @param result Optional result to return to the dialog opener.\n * @param options Additional options to customize the closing behavior.\n */\n close(result?: R, options?: DialogCloseOptions): void {\n if (this.containerInstance) {\n const closedSubject = this.closed as Subject<R | undefined>;\n this.containerInstance._closeInteractionType = options?.focusOrigin || 'program';\n // Drop the detach subscription first since it can be triggered by the\n // `dispose` call and override the result of this closing sequence.\n this._detachSubscription.unsubscribe();\n this.overlayRef.dispose();\n closedSubject.next(result);\n closedSubject.complete();\n (this as {componentInstance: C}).componentInstance = (\n this as {containerInstance: BasePortalOutlet}\n ).containerInstance = null!;\n }\n }\n\n /** Updates the position of the dialog based on the current position strategy. */\n updatePosition(): this {\n this.overlayRef.updatePosition();\n return this;\n }\n\n /**\n * Updates the dialog's width and height.\n * @param width New width of the dialog.\n * @param height New height of the dialog.\n */\n updateSize(width: string | number = '', height: string | number = ''): this {\n this.overlayRef.updateSize({width, height});\n return this;\n }\n\n /** Add a CSS class or an array of classes to the overlay pane. */\n addPanelClass(classes: string | string[]): this {\n this.overlayRef.addPanelClass(classes);\n return this;\n }\n\n /** Remove a CSS class or an array of classes from the overlay pane. */\n removePanelClass(classes: string | string[]): this {\n this.overlayRef.removePanelClass(classes);\n return this;\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {InjectionToken} from '@angular/core';\nimport {Overlay, ScrollStrategy} from '@angular/cdk/overlay';\nimport {DialogConfig} from './dialog-config';\n\n/** Injection token for the Dialog's ScrollStrategy. */\nexport const DIALOG_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>(\n 'DialogScrollStrategy',\n);\n\n/** Injection token for the Dialog's Data. */\nexport const DIALOG_DATA = new InjectionToken<any>('DialogData');\n\n/** Injection token that can be used to provide default options for the dialog module. */\nexport const DEFAULT_DIALOG_CONFIG = new InjectionToken<DialogConfig>('DefaultDialogConfig');\n\n/** @docs-private */\nexport function DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay: Overlay): () => ScrollStrategy {\n return () => overlay.scrollStrategies.block();\n}\n\n/** @docs-private */\nexport const DIALOG_SCROLL_STRATEGY_PROVIDER = {\n provide: DIALOG_SCROLL_STRATEGY,\n deps: [Overlay],\n useFactory: DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,\n};\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {\n TemplateRef,\n Injectable,\n Injector,\n OnDestroy,\n Type,\n StaticProvider,\n Inject,\n Optional,\n SkipSelf,\n} from '@angular/core';\nimport {BasePortalOutlet, ComponentPortal, TemplatePortal} from '@angular/cdk/portal';\nimport {of as observableOf, Observable, Subject, defer} from 'rxjs';\nimport {DialogRef} from './dialog-ref';\nimport {DialogConfig} from './dialog-config';\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n ComponentType,\n Overlay,\n OverlayRef,\n OverlayConfig,\n ScrollStrategy,\n OverlayContainer,\n} from '@angular/cdk/overlay';\nimport {startWith} from 'rxjs/operators';\n\nimport {DEFAULT_DIALOG_CONFIG, DIALOG_DATA, DIALOG_SCROLL_STRATEGY} from './dialog-injectors';\nimport {CdkDialogContainer} from './dialog-container';\n\n/** Unique id for the created dialog. */\nlet uniqueId = 0;\n\n@Injectable()\nexport class Dialog implements OnDestroy {\n private _openDialogsAtThisLevel: DialogRef<any, any>[] = [];\n private readonly _afterAllClosedAtThisLevel = new Subject<void>();\n private readonly _afterOpenedAtThisLevel = new Subject<DialogRef>();\n private _ariaHiddenElements = new Map<Element, string | null>();\n private _scrollStrategy: () => ScrollStrategy;\n\n /** Keeps track of the currently-open dialogs. */\n get openDialogs(): readonly DialogRef<any, any>[] {\n return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;\n }\n\n /** Stream that emits when a dialog has been opened. */\n get afterOpened(): Subject<DialogRef<any, any>> {\n return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;\n }\n\n /**\n * Stream that emits when all open dialog have finished closing.\n * Will emit on subscribe if there are no open dialogs to begin with.\n */\n readonly afterAllClosed: Observable<void> = defer(() =>\n this.openDialogs.length\n ? this._getAfterAllClosed()\n : this._getAfterAllClosed().pipe(startWith(undefined)),\n );\n\n constructor(\n private _overlay: Overlay,\n private _injector: Injector,\n @Optional() @Inject(DEFAULT_DIALOG_CONFIG) private _defaultOptions: DialogConfig,\n @Optional() @SkipSelf() private _parentDialog: Dialog,\n private _overlayContainer: OverlayContainer,\n @Inject(DIALOG_SCROLL_STRATEGY) scrollStrategy: any,\n ) {\n this._scrollStrategy = scrollStrategy;\n }\n\n /**\n * Opens a modal dialog containing the given component.\n * @param component Type of the component to load into the dialog.\n * @param config Extra configuration options.\n * @returns Reference to the newly-opened dialog.\n */\n open<R = unknown, D = unknown, C = unknown>(\n component: ComponentType<C>,\n config?: DialogConfig<D, DialogRef<R, C>>,\n ): DialogRef<R, C>;\n\n /**\n * Opens a modal dialog containing the given template.\n * @param template TemplateRef to instantiate as the dialog content.\n * @param config Extra configuration options.\n * @returns Reference to the newly-opened dialog.\n */\n open<R = unknown, D = unknown, C = unknown>(\n template: TemplateRef<C>,\n config?: DialogConfig<D, DialogRef<R, C>>,\n ): DialogRef<R, C>;\n\n open<R = unknown, D = unknown, C = unknown>(\n componentOrTemplateRef: ComponentType<C> | TemplateRef<C>,\n config?: DialogConfig<D, DialogRef<R, C>>,\n ): DialogRef<R, C>;\n\n open<R = unknown, D = unknown, C = unknown>(\n componentOrTemplateRef: ComponentType<C> | TemplateRef<C>,\n config?: DialogConfig<D, DialogRef<R, C>>,\n ): DialogRef<R, C> {\n const defaults = (this._defaultOptions || new DialogConfig()) as DialogConfig<\n D,\n DialogRef<R, C>\n >;\n config = {...defaults, ...config};\n config.id = config.id || `cdk-dialog-${uniqueId++}`;\n\n if (\n config.id &&\n this.getDialogById(config.id) &&\n (typeof ngDevMode === 'undefined' || ngDevMode)\n ) {\n throw Error(`Dialog with id \"${config.id}\" exists already. The dialog id must be unique.`);\n }\n\n const overlayConfig = this._getOverlayConfig(config);\n const overlayRef = this._overlay.create(overlayConfig);\n const dialogRef = new DialogRef(overlayRef, config);\n const dialogContainer = this._attachContainer(overlayRef, dialogRef, config);\n\n (dialogRef as {containerInstance: BasePortalOutlet}).containerInstance = dialogContainer;\n this._attachDialogContent(componentOrTemplateRef, dialogRef, dialogContainer, config);\n\n // If this is the first dialog that we're opening, hide all the non-overlay content.\n if (!this.openDialogs.length) {\n this._hideNonDialogContentFromAssistiveTechnology();\n }\n\n (this.openDialogs as DialogRef<R, C>[]).push(dialogRef);\n dialogRef.closed.subscribe(() => this._removeOpenDialog(dialogRef, true));\n this.afterOpened.next(dialogRef);\n\n return dialogRef;\n }\n\n /**\n * Closes all of the currently-open dialogs.\n */\n closeAll(): void {\n reverseForEach(this.openDialogs, dialog => dialog.close());\n }\n\n /**\n * Finds an open dialog by its id.\n * @param id ID to use when looking up the dialog.\n */\n getDialogById<R, C>(id: string): DialogRef<R, C> | undefined {\n return this.openDialogs.find(dialog => dialog.id === id);\n }\n\n ngOnDestroy() {\n // Make one pass over all the dialogs that need to be untracked, but should not be closed. We\n // want to stop tracking the open dialog even if it hasn't been closed, because the tracking\n // determines when `aria-hidden` is removed from elements outside the dialog.\n reverseForEach(this._openDialogsAtThisLevel, dialog => {\n // Check for `false` specifically since we want `undefined` to be interpreted as `true`.\n if (dialog.config.closeOnDestroy === false) {\n this._removeOpenDialog(dialog, false);\n }\n });\n\n // Make a second pass and close the remaining dialogs. We do this second pass in order to\n // correctly dispatch the `afterAllClosed` event in case we have a mixed array of dialogs\n // that should be closed and dialogs that should not.\n reverseForEach(this._openDialogsAtThisLevel, dialog => dialog.close());\n\n this._afterAllClosedAtThisLevel.complete();\n this._afterOpenedAtThisLevel.complete();\n this._openDialogsAtThisLevel = [];\n }\n\n /**\n * Creates an overlay config from a dialog config.\n * @param config The dialog configuration.\n * @returns The overlay configuration.\n */\n private _getOverlayConfig<D, R>(config: DialogConfig<D, R>): OverlayConfig {\n const state = new OverlayConfig({\n positionStrategy:\n config.positionStrategy ||\n this._overlay.position().global().centerHorizontally().centerVertically(),\n scrollStrategy: config.scrollStrategy || this._scrollStrategy(),\n panelClass: config.panelClass,\n hasBackdrop: config.hasBackdrop,\n direction: config.direction,\n minWidth: config.minWidth,\n minHeight: config.minHeight,\n maxWidth: config.maxWidth,\n maxHeight: config.maxHeight,\n width: config.width,\n height: config.height,\n disposeOnNavigation: config.closeOnNavigation,\n });\n\n if (config.backdropClass) {\n state.backdropClass = config.backdropClass;\n }\n\n return state;\n }\n\n /**\n * Attaches a dialog container to a dialog's already-created overlay.\n * @param overlay Reference to the dialog's underlying overlay.\n * @param config The dialog configuration.\n * @returns A promise resolving to a ComponentRef for the attached container.\n */\n private _attachContainer<R, D, C>(\n overlay: OverlayRef,\n dialogRef: DialogRef<R, C>,\n config: DialogConfig<D, DialogRef<R, C>>,\n ): BasePortalOutlet {\n const userInjector = config.injector || config.viewContainerRef?.injector;\n const providers: StaticProvider[] = [\n {provide: DialogConfig, useValue: config},\n {provide: DialogRef, useValue: dialogRef},\n {provide: OverlayRef, useValue: overlay},\n ];\n let containerType: Type<BasePortalOutlet>;\n\n if (config.container) {\n if (typeof config.container === 'function') {\n containerType = config.container;\n } else {\n containerType = config.container.type;\n providers.push(...config.container.providers(config));\n }\n } else {\n containerType = CdkDialogContainer;\n }\n\n const containerPortal = new ComponentPortal(\n containerType,\n config.viewContainerRef,\n Injector.create({parent: userInjector || this._injector, providers}),\n config.componentFactoryResolver,\n );\n const containerRef = overlay.attach(containerPortal);\n\n return containerRef.instance;\n }\n\n /**\n * Attaches the user-provided component to the already-created dialog container.\n * @param componentOrTemplateRef The type of component being loaded into the dialog,\n * or a TemplateRef to instantiate as the content.\n * @param dialogRef Reference to the dialog being opened.\n * @param dialogContainer Component that is going to wrap the dialog content.\n * @param config Configuration used to open the dialog.\n */\n private _attachDialogContent<R, D, C>(\n componentOrTemplateRef: ComponentType<C> | TemplateRef<C>,\n dialogRef: DialogRef<R, C>,\n dialogContainer: BasePortalOutlet,\n config: DialogConfig<D, DialogRef<R, C>>,\n ) {\n if (componentOrTemplateRef instanceof TemplateRef) {\n const injector = this._createInjector(config, dialogRef, dialogContainer, undefined);\n let context: any = {$implicit: config.data, dialogRef};\n\n if (config.templateContext) {\n context = {\n ...context,\n ...(typeof config.templateContext === 'function'\n ? config.templateContext()\n : config.templateContext),\n };\n }\n\n dialogContainer.attachTemplatePortal(\n new TemplatePortal<C>(componentOrTemplateRef, null!, context, injector),\n );\n } else {\n const injector = this._createInjector(config, dialogRef, dialogContainer, this._injector);\n const contentRef = dialogContainer.attachComponentPortal<C>(\n new ComponentPortal(\n componentOrTemplateRef,\n config.viewContainerRef,\n injector,\n config.componentFactoryResolver,\n ),\n );\n (dialogRef as {componentInstance: C}).componentInstance = contentRef.instance;\n }\n }\n\n /**\n * Creates a custom injector to be used inside the dialog. This allows a component loaded inside\n * of a dialog to close itself and, optionally, to return a value.\n * @param config Config object that is used to construct the dialog.\n * @param dialogRef Reference to the dialog being opened.\n * @param dialogContainer Component that is going to wrap the dialog content.\n * @param fallbackInjector Injector to use as a fallback when a lookup fails in the custom\n * dialog injector, if the user didn't provide a custom one.\n * @returns The custom injector that can be used inside the dialog.\n */\n private _createInjector<R, D, C>(\n config: DialogConfig<D, DialogRef<R, C>>,\n dialogRef: DialogRef<R, C>,\n dialogContainer: BasePortalOutlet,\n fallbackInjector: Injector | undefined,\n ): Injector {\n const userInjector = config.injector || config.viewContainerRef?.injector;\n const providers: StaticProvider[] = [\n {provide: DIALOG_DATA, useValue: config.data},\n {provide: DialogRef, useValue: dialogRef},\n ];\n\n if (config.providers) {\n if (typeof config.providers === 'function') {\n providers.push(...config.providers(dialogRef, config, dialogContainer));\n } else {\n providers.push(...config.providers);\n }\n }\n\n if (\n config.direction &&\n (!userInjector ||\n !userInjector.get<Directionality | null>(Directionality, null, {optional: true}))\n ) {\n providers.push({\n provide: Directionality,\n useValue: {value: config.direction, change: observableOf()},\n });\n }\n\n return Injector.create({parent: userInjector || fallbackInjector, providers});\n }\n\n /**\n * Removes a dialog from the array of open dialogs.\n * @param dialogRef Dialog to be removed.\n * @param emitEvent Whether to emit an event if this is the last dialog.\n */\n private _removeOpenDialog<R, C>(dialogRef: DialogRef<R, C>, emitEvent: boolean) {\n const index = this.openDialogs.indexOf(dialogRef);\n\n if (index > -1) {\n (this.openDialogs as DialogRef<R, C>[]).splice(index, 1);\n\n // If all the dialogs were closed, remove/restore the `aria-hidden`\n // to a the siblings and emit to the `afterAllClosed` stream.\n if (!this.openDialogs.length) {\n this._ariaHiddenElements.forEach((previousValue, element) => {\n if (previousValue) {\n element.setAttribute('aria-hidden', previousValue);\n } else {\n element.removeAttribute('aria-hidden');\n }\n });\n\n this._ariaHiddenElements.clear();\n\n if (emitEvent) {\n this._getAfterAllClosed().next();\n }\n }\n }\n }\n\n /** Hides all of the content that isn't an overlay from assistive technology. */\n private _hideNonDialogContentFromAssistiveTechnology() {\n const overlayContainer = this._overlayContainer.getContainerElement();\n\n // Ensure that the overlay container is attached to the DOM.\n if (overlayContainer.parentElement) {\n const siblings = overlayContainer.parentElement.children;\n\n for (let i = siblings.length - 1; i > -1; i--) {\n const sibling = siblings[i];\n\n if (\n sibling !== overlayContainer &&\n sibling.nodeName !== 'SCRIPT' &&\n sibling.nodeName !== 'STYLE' &&\n !sibling.hasAttribute('aria-live')\n ) {\n this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));\n sibling.setAttribute('aria-hidden', 'true');\n }\n }\n }\n }\n\n private _getAfterAllClosed(): Subject<void> {\n const parent = this._parentDialog;\n return parent ? parent._getAfterAllClosed() : this._afterAllClosedAtThisLevel;\n }\n}\n\n/**\n * Executes a callback against all elements in an array while iterating in reverse.\n * Useful if the array is being modified as it is being iterated.\n */\nfunction reverseForEach<T>(items: T[] | readonly T[], callback: (current: T) => void) {\n let i = items.length;\n\n while (i--) {\n callback(items[i]);\n }\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {NgModule} from '@angular/core';\nimport {OverlayModule} from '@angular/cdk/overlay';\nimport {PortalModule} from '@angular/cdk/portal';\nimport {A11yModule} from '@angular/cdk/a11y';\nimport {Dialog} from './dialog';\nimport {CdkDialogContainer} from './dialog-container';\nimport {DIALOG_SCROLL_STRATEGY_PROVIDER} from './dialog-injectors';\n\n@NgModule({\n imports: [OverlayModule, PortalModule, A11yModule],\n exports: [\n // Re-export the PortalModule so that people extending the `CdkDialogContainer`\n // don't have to remember to import it or be faced with an unhelpful error.\n PortalModule,\n CdkDialogContainer,\n ],\n declarations: [CdkDialogContainer],\n providers: [Dialog, DIALOG_SCROLL_STRATEGY_PROVIDER],\n})\nexport class DialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i2","observableOf","i1"],"mappings":";;;;;;;;;;;;;;;AAyBA;MACa,YAAY,CAAA;AAAzB,IAAA,WAA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