dialog.js 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210
  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. */
  8. import { animate, state, style, transition, trigger } from '@angular/animations';
  9. import { Component, ElementRef, EventEmitter, Inject, Optional, ChangeDetectorRef, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Injectable, InjectionToken, Injector, SkipSelf, TemplateRef, Directive, Input, NgModule } from '@angular/core';
  10. import { DOCUMENT, Location, CommonModule } from '@angular/common';
  11. import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, PortalInjector, TemplatePortal, PortalModule } from '@angular/cdk/portal';
  12. import { FocusTrapFactory } from '@angular/cdk/a11y';
  13. import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
  14. import { Subject, defer, of } from 'rxjs';
  15. import { filter, take, startWith } from 'rxjs/operators';
  16. import { Directionality } from '@angular/cdk/bidi';
  17. import { Overlay, OverlayConfig, OverlayContainer, OverlayModule } from '@angular/cdk/overlay';
  18. import { MatCommonModule } from '@angular/material/core';
  19. /**
  20. * @fileoverview added by tsickle
  21. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  22. */
  23. /**
  24. * Configuration for opening a modal dialog with the MatDialog service.
  25. * @template D
  26. */
  27. class MatDialogConfig {
  28. constructor() {
  29. /**
  30. * The ARIA role of the dialog element.
  31. */
  32. this.role = 'dialog';
  33. /**
  34. * Custom class for the overlay pane.
  35. */
  36. this.panelClass = '';
  37. /**
  38. * Whether the dialog has a backdrop.
  39. */
  40. this.hasBackdrop = true;
  41. /**
  42. * Custom class for the backdrop,
  43. */
  44. this.backdropClass = '';
  45. /**
  46. * Whether the user can use escape or clicking on the backdrop to close the modal.
  47. */
  48. this.disableClose = false;
  49. /**
  50. * Width of the dialog.
  51. */
  52. this.width = '';
  53. /**
  54. * Height of the dialog.
  55. */
  56. this.height = '';
  57. /**
  58. * Max-width of the dialog. If a number is provided, pixel units are assumed. Defaults to 80vw
  59. */
  60. this.maxWidth = '80vw';
  61. /**
  62. * Data being injected into the child component.
  63. */
  64. this.data = null;
  65. /**
  66. * ID of the element that describes the dialog.
  67. */
  68. this.ariaDescribedBy = null;
  69. /**
  70. * ID of the element that labels the dialog.
  71. */
  72. this.ariaLabelledBy = null;
  73. /**
  74. * Aria label to assign to the dialog element
  75. */
  76. this.ariaLabel = null;
  77. /**
  78. * Whether the dialog should focus the first focusable element on open.
  79. */
  80. this.autoFocus = true;
  81. /**
  82. * Whether the dialog should restore focus to the
  83. * previously-focused element, after it's closed.
  84. */
  85. this.restoreFocus = true;
  86. /**
  87. * Whether the dialog should close when the user goes backwards/forwards in history.
  88. * Note that this usually doesn't include clicking on links (unless the user is using
  89. * the `HashLocationStrategy`).
  90. */
  91. this.closeOnNavigation = true;
  92. // TODO(jelbourn): add configuration for lifecycle hooks, ARIA labelling.
  93. }
  94. }
  95. /**
  96. * @fileoverview added by tsickle
  97. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  98. */
  99. /** @type {?} */
  100. const animationBody = [
  101. // Note: The `enter` animation transitions to `transform: none`, because for some reason
  102. // specifying the transform explicitly, causes IE both to blur the dialog content and
  103. // decimate the animation performance. Leaving it as `none` solves both issues.
  104. state('void, exit', style({ opacity: 0, transform: 'scale(0.7)' })),
  105. state('enter', style({ transform: 'none' })),
  106. transition('* => enter', animate('150ms cubic-bezier(0, 0, 0.2, 1)', style({ transform: 'none', opacity: 1 }))),
  107. transition('* => void, * => exit', animate('75ms cubic-bezier(0.4, 0.0, 0.2, 1)', style({ opacity: 0 }))),
  108. ];
  109. /**
  110. * Animations used by MatDialog.
  111. * \@docs-private
  112. * @type {?}
  113. */
  114. const matDialogAnimations = {
  115. /**
  116. * Animation that is applied on the dialog container by defalt.
  117. */
  118. dialogContainer: trigger('dialogContainer', animationBody),
  119. /**
  120. * @deprecated \@breaking-change 8.0.0 Use `matDialogAnimations.dialogContainer` instead.
  121. */
  122. slideDialog: trigger('slideDialog', animationBody)
  123. };
  124. /**
  125. * @fileoverview added by tsickle
  126. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  127. */
  128. /**
  129. * Throws an exception for the case when a ComponentPortal is
  130. * attached to a DomPortalOutlet without an origin.
  131. * \@docs-private
  132. * @return {?}
  133. */
  134. function throwMatDialogContentAlreadyAttachedError() {
  135. throw Error('Attempting to attach dialog content after content is already attached');
  136. }
  137. /**
  138. * Internal component that wraps user-provided dialog content.
  139. * Animation is based on https://material.io/guidelines/motion/choreography.html.
  140. * \@docs-private
  141. */
  142. class MatDialogContainer extends BasePortalOutlet {
  143. /**
  144. * @param {?} _elementRef
  145. * @param {?} _focusTrapFactory
  146. * @param {?} _changeDetectorRef
  147. * @param {?} _document
  148. * @param {?} _config
  149. */
  150. constructor(_elementRef, _focusTrapFactory, _changeDetectorRef, _document, _config) {
  151. super();
  152. this._elementRef = _elementRef;
  153. this._focusTrapFactory = _focusTrapFactory;
  154. this._changeDetectorRef = _changeDetectorRef;
  155. this._document = _document;
  156. this._config = _config;
  157. /**
  158. * Element that was focused before the dialog was opened. Save this to restore upon close.
  159. */
  160. this._elementFocusedBeforeDialogWasOpened = null;
  161. /**
  162. * State of the dialog animation.
  163. */
  164. this._state = 'enter';
  165. /**
  166. * Emits when an animation state changes.
  167. */
  168. this._animationStateChanged = new EventEmitter();
  169. this._ariaLabelledBy = _config.ariaLabelledBy || null;
  170. }
  171. /**
  172. * Attach a ComponentPortal as content to this dialog container.
  173. * @template T
  174. * @param {?} portal Portal to be attached as the dialog content.
  175. * @return {?}
  176. */
  177. attachComponentPortal(portal) {
  178. if (this._portalOutlet.hasAttached()) {
  179. throwMatDialogContentAlreadyAttachedError();
  180. }
  181. this._savePreviouslyFocusedElement();
  182. return this._portalOutlet.attachComponentPortal(portal);
  183. }
  184. /**
  185. * Attach a TemplatePortal as content to this dialog container.
  186. * @template C
  187. * @param {?} portal Portal to be attached as the dialog content.
  188. * @return {?}
  189. */
  190. attachTemplatePortal(portal) {
  191. if (this._portalOutlet.hasAttached()) {
  192. throwMatDialogContentAlreadyAttachedError();
  193. }
  194. this._savePreviouslyFocusedElement();
  195. return this._portalOutlet.attachTemplatePortal(portal);
  196. }
  197. /**
  198. * Moves the focus inside the focus trap.
  199. * @private
  200. * @return {?}
  201. */
  202. _trapFocus() {
  203. /** @type {?} */
  204. const element = this._elementRef.nativeElement;
  205. if (!this._focusTrap) {
  206. this._focusTrap = this._focusTrapFactory.create(element);
  207. }
  208. // If we were to attempt to focus immediately, then the content of the dialog would not yet be
  209. // ready in instances where change detection has to run first. To deal with this, we simply
  210. // wait for the microtask queue to be empty.
  211. if (this._config.autoFocus) {
  212. this._focusTrap.focusInitialElementWhenReady();
  213. }
  214. else {
  215. /** @type {?} */
  216. const activeElement = this._document.activeElement;
  217. // Otherwise ensure that focus is on the dialog container. It's possible that a different
  218. // component tried to move focus while the open animation was running. See:
  219. // https://github.com/angular/components/issues/16215. Note that we only want to do this
  220. // if the focus isn't inside the dialog already, because it's possible that the consumer
  221. // turned off `autoFocus` in order to move focus themselves.
  222. if (activeElement !== element && !element.contains(activeElement)) {
  223. element.focus();
  224. }
  225. }
  226. }
  227. /**
  228. * Restores focus to the element that was focused before the dialog opened.
  229. * @private
  230. * @return {?}
  231. */
  232. _restoreFocus() {
  233. /** @type {?} */
  234. const toFocus = this._elementFocusedBeforeDialogWasOpened;
  235. // We need the extra check, because IE can set the `activeElement` to null in some cases.
  236. if (this._config.restoreFocus && toFocus && typeof toFocus.focus === 'function') {
  237. toFocus.focus();
  238. }
  239. if (this._focusTrap) {
  240. this._focusTrap.destroy();
  241. }
  242. }
  243. /**
  244. * Saves a reference to the element that was focused before the dialog was opened.
  245. * @private
  246. * @return {?}
  247. */
  248. _savePreviouslyFocusedElement() {
  249. if (this._document) {
  250. this._elementFocusedBeforeDialogWasOpened = (/** @type {?} */ (this._document.activeElement));
  251. // Note that there is no focus method when rendering on the server.
  252. if (this._elementRef.nativeElement.focus) {
  253. // Move focus onto the dialog immediately in order to prevent the user from accidentally
  254. // opening multiple dialogs at the same time. Needs to be async, because the element
  255. // may not be focusable immediately.
  256. Promise.resolve().then((/**
  257. * @return {?}
  258. */
  259. () => this._elementRef.nativeElement.focus()));
  260. }
  261. }
  262. }
  263. /**
  264. * Callback, invoked whenever an animation on the host completes.
  265. * @param {?} event
  266. * @return {?}
  267. */
  268. _onAnimationDone(event) {
  269. if (event.toState === 'enter') {
  270. this._trapFocus();
  271. }
  272. else if (event.toState === 'exit') {
  273. this._restoreFocus();
  274. }
  275. this._animationStateChanged.emit(event);
  276. }
  277. /**
  278. * Callback, invoked when an animation on the host starts.
  279. * @param {?} event
  280. * @return {?}
  281. */
  282. _onAnimationStart(event) {
  283. this._animationStateChanged.emit(event);
  284. }
  285. /**
  286. * Starts the dialog exit animation.
  287. * @return {?}
  288. */
  289. _startExitAnimation() {
  290. this._state = 'exit';
  291. // Mark the container for check so it can react if the
  292. // view container is using OnPush change detection.
  293. this._changeDetectorRef.markForCheck();
  294. }
  295. }
  296. MatDialogContainer.decorators = [
  297. { type: Component, args: [{selector: 'mat-dialog-container',
  298. template: "<ng-template cdkPortalOutlet></ng-template>",
  299. styles: [".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}@media (-ms-high-contrast:active){.mat-dialog-container{outline:solid 1px}}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base{margin-left:0;margin-right:8px}"],
  300. encapsulation: ViewEncapsulation.None,
  301. // Using OnPush for dialogs caused some G3 sync issues. Disabled until we can track them down.
  302. // tslint:disable-next-line:validate-decorators
  303. changeDetection: ChangeDetectionStrategy.Default,
  304. animations: [matDialogAnimations.dialogContainer],
  305. host: {
  306. 'class': 'mat-dialog-container',
  307. 'tabindex': '-1',
  308. 'aria-modal': 'true',
  309. '[attr.id]': '_id',
  310. '[attr.role]': '_config.role',
  311. '[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledBy',
  312. '[attr.aria-label]': '_config.ariaLabel',
  313. '[attr.aria-describedby]': '_config.ariaDescribedBy || null',
  314. '[@dialogContainer]': '_state',
  315. '(@dialogContainer.start)': '_onAnimationStart($event)',
  316. '(@dialogContainer.done)': '_onAnimationDone($event)',
  317. },
  318. },] },
  319. ];
  320. /** @nocollapse */
  321. MatDialogContainer.ctorParameters = () => [
  322. { type: ElementRef },
  323. { type: FocusTrapFactory },
  324. { type: ChangeDetectorRef },
  325. { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] },
  326. { type: MatDialogConfig }
  327. ];
  328. MatDialogContainer.propDecorators = {
  329. _portalOutlet: [{ type: ViewChild, args: [CdkPortalOutlet, { static: true },] }]
  330. };
  331. /**
  332. * @fileoverview added by tsickle
  333. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  334. */
  335. // TODO(jelbourn): resizing
  336. // Counter for unique dialog ids.
  337. /** @type {?} */
  338. let uniqueId = 0;
  339. /**
  340. * Reference to a dialog opened via the MatDialog service.
  341. * @template T, R
  342. */
  343. class MatDialogRef {
  344. /**
  345. * @param {?} _overlayRef
  346. * @param {?} _containerInstance
  347. * @param {?=} _location
  348. * @param {?=} id
  349. */
  350. constructor(_overlayRef, _containerInstance,
  351. // @breaking-change 8.0.0 `_location` parameter to be removed.
  352. _location, id = `mat-dialog-${uniqueId++}`) {
  353. this._overlayRef = _overlayRef;
  354. this._containerInstance = _containerInstance;
  355. this.id = id;
  356. /**
  357. * Whether the user is allowed to close the dialog.
  358. */
  359. this.disableClose = this._containerInstance._config.disableClose;
  360. /**
  361. * Subject for notifying the user that the dialog has finished opening.
  362. */
  363. this._afterOpened = new Subject();
  364. /**
  365. * Subject for notifying the user that the dialog has finished closing.
  366. */
  367. this._afterClosed = new Subject();
  368. /**
  369. * Subject for notifying the user that the dialog has started closing.
  370. */
  371. this._beforeClosed = new Subject();
  372. // Pass the id along to the container.
  373. _containerInstance._id = id;
  374. // Emit when opening animation completes
  375. _containerInstance._animationStateChanged.pipe(filter((/**
  376. * @param {?} event
  377. * @return {?}
  378. */
  379. event => event.phaseName === 'done' && event.toState === 'enter')), take(1))
  380. .subscribe((/**
  381. * @return {?}
  382. */
  383. () => {
  384. this._afterOpened.next();
  385. this._afterOpened.complete();
  386. }));
  387. // Dispose overlay when closing animation is complete
  388. _containerInstance._animationStateChanged.pipe(filter((/**
  389. * @param {?} event
  390. * @return {?}
  391. */
  392. event => event.phaseName === 'done' && event.toState === 'exit')), take(1)).subscribe((/**
  393. * @return {?}
  394. */
  395. () => {
  396. clearTimeout(this._closeFallbackTimeout);
  397. this._overlayRef.dispose();
  398. }));
  399. _overlayRef.detachments().subscribe((/**
  400. * @return {?}
  401. */
  402. () => {
  403. this._beforeClosed.next(this._result);
  404. this._beforeClosed.complete();
  405. this._afterClosed.next(this._result);
  406. this._afterClosed.complete();
  407. this.componentInstance = (/** @type {?} */ (null));
  408. this._overlayRef.dispose();
  409. }));
  410. _overlayRef.keydownEvents()
  411. .pipe(filter((/**
  412. * @param {?} event
  413. * @return {?}
  414. */
  415. event => {
  416. return event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event);
  417. })))
  418. .subscribe((/**
  419. * @param {?} event
  420. * @return {?}
  421. */
  422. event => {
  423. event.preventDefault();
  424. this.close();
  425. }));
  426. }
  427. /**
  428. * Close the dialog.
  429. * @param {?=} dialogResult Optional result to return to the dialog opener.
  430. * @return {?}
  431. */
  432. close(dialogResult) {
  433. this._result = dialogResult;
  434. // Transition the backdrop in parallel to the dialog.
  435. this._containerInstance._animationStateChanged.pipe(filter((/**
  436. * @param {?} event
  437. * @return {?}
  438. */
  439. event => event.phaseName === 'start')), take(1))
  440. .subscribe((/**
  441. * @param {?} event
  442. * @return {?}
  443. */
  444. event => {
  445. this._beforeClosed.next(dialogResult);
  446. this._beforeClosed.complete();
  447. this._overlayRef.detachBackdrop();
  448. // The logic that disposes of the overlay depends on the exit animation completing, however
  449. // it isn't guaranteed if the parent view is destroyed while it's running. Add a fallback
  450. // timeout which will clean everything up if the animation hasn't fired within the specified
  451. // amount of time plus 100ms. We don't need to run this outside the NgZone, because for the
  452. // vast majority of cases the timeout will have been cleared before it has the chance to fire.
  453. this._closeFallbackTimeout = setTimeout((/**
  454. * @return {?}
  455. */
  456. () => {
  457. this._overlayRef.dispose();
  458. }), event.totalTime + 100);
  459. }));
  460. this._containerInstance._startExitAnimation();
  461. }
  462. /**
  463. * Gets an observable that is notified when the dialog is finished opening.
  464. * @return {?}
  465. */
  466. afterOpened() {
  467. return this._afterOpened.asObservable();
  468. }
  469. /**
  470. * Gets an observable that is notified when the dialog is finished closing.
  471. * @return {?}
  472. */
  473. afterClosed() {
  474. return this._afterClosed.asObservable();
  475. }
  476. /**
  477. * Gets an observable that is notified when the dialog has started closing.
  478. * @return {?}
  479. */
  480. beforeClosed() {
  481. return this._beforeClosed.asObservable();
  482. }
  483. /**
  484. * Gets an observable that emits when the overlay's backdrop has been clicked.
  485. * @return {?}
  486. */
  487. backdropClick() {
  488. return this._overlayRef.backdropClick();
  489. }
  490. /**
  491. * Gets an observable that emits when keydown events are targeted on the overlay.
  492. * @return {?}
  493. */
  494. keydownEvents() {
  495. return this._overlayRef.keydownEvents();
  496. }
  497. /**
  498. * Updates the dialog's position.
  499. * @template THIS
  500. * @this {THIS}
  501. * @param {?=} position New dialog position.
  502. * @return {THIS}
  503. */
  504. updatePosition(position) {
  505. /** @type {?} */
  506. let strategy = (/** @type {?} */ (this))._getPositionStrategy();
  507. if (position && (position.left || position.right)) {
  508. position.left ? strategy.left(position.left) : strategy.right(position.right);
  509. }
  510. else {
  511. strategy.centerHorizontally();
  512. }
  513. if (position && (position.top || position.bottom)) {
  514. position.top ? strategy.top(position.top) : strategy.bottom(position.bottom);
  515. }
  516. else {
  517. strategy.centerVertically();
  518. }
  519. (/** @type {?} */ (this))._overlayRef.updatePosition();
  520. return (/** @type {?} */ (this));
  521. }
  522. /**
  523. * Updates the dialog's width and height.
  524. * @template THIS
  525. * @this {THIS}
  526. * @param {?=} width New width of the dialog.
  527. * @param {?=} height New height of the dialog.
  528. * @return {THIS}
  529. */
  530. updateSize(width = '', height = '') {
  531. (/** @type {?} */ (this))._getPositionStrategy().width(width).height(height);
  532. (/** @type {?} */ (this))._overlayRef.updatePosition();
  533. return (/** @type {?} */ (this));
  534. }
  535. /**
  536. * Add a CSS class or an array of classes to the overlay pane.
  537. * @template THIS
  538. * @this {THIS}
  539. * @param {?} classes
  540. * @return {THIS}
  541. */
  542. addPanelClass(classes) {
  543. (/** @type {?} */ (this))._overlayRef.addPanelClass(classes);
  544. return (/** @type {?} */ (this));
  545. }
  546. /**
  547. * Remove a CSS class or an array of classes from the overlay pane.
  548. * @template THIS
  549. * @this {THIS}
  550. * @param {?} classes
  551. * @return {THIS}
  552. */
  553. removePanelClass(classes) {
  554. (/** @type {?} */ (this))._overlayRef.removePanelClass(classes);
  555. return (/** @type {?} */ (this));
  556. }
  557. /**
  558. * Gets an observable that is notified when the dialog is finished opening.
  559. * @deprecated Use `afterOpened` instead.
  560. * \@breaking-change 8.0.0
  561. * @return {?}
  562. */
  563. afterOpen() {
  564. return this.afterOpened();
  565. }
  566. /**
  567. * Gets an observable that is notified when the dialog has started closing.
  568. * @deprecated Use `beforeClosed` instead.
  569. * \@breaking-change 8.0.0
  570. * @return {?}
  571. */
  572. beforeClose() {
  573. return this.beforeClosed();
  574. }
  575. /**
  576. * Fetches the position strategy object from the overlay ref.
  577. * @private
  578. * @return {?}
  579. */
  580. _getPositionStrategy() {
  581. return (/** @type {?} */ (this._overlayRef.getConfig().positionStrategy));
  582. }
  583. }
  584. /**
  585. * @fileoverview added by tsickle
  586. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  587. */
  588. /**
  589. * Injection token that can be used to access the data that was passed in to a dialog.
  590. * @type {?}
  591. */
  592. const MAT_DIALOG_DATA = new InjectionToken('MatDialogData');
  593. /**
  594. * Injection token that can be used to specify default dialog options.
  595. * @type {?}
  596. */
  597. const MAT_DIALOG_DEFAULT_OPTIONS = new InjectionToken('mat-dialog-default-options');
  598. /**
  599. * Injection token that determines the scroll handling while the dialog is open.
  600. * @type {?}
  601. */
  602. const MAT_DIALOG_SCROLL_STRATEGY = new InjectionToken('mat-dialog-scroll-strategy');
  603. /**
  604. * \@docs-private
  605. * @param {?} overlay
  606. * @return {?}
  607. */
  608. function MAT_DIALOG_SCROLL_STRATEGY_FACTORY(overlay) {
  609. return (/**
  610. * @return {?}
  611. */
  612. () => overlay.scrollStrategies.block());
  613. }
  614. /**
  615. * \@docs-private
  616. * @param {?} overlay
  617. * @return {?}
  618. */
  619. function MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
  620. return (/**
  621. * @return {?}
  622. */
  623. () => overlay.scrollStrategies.block());
  624. }
  625. /**
  626. * \@docs-private
  627. * @type {?}
  628. */
  629. const MAT_DIALOG_SCROLL_STRATEGY_PROVIDER = {
  630. provide: MAT_DIALOG_SCROLL_STRATEGY,
  631. deps: [Overlay],
  632. useFactory: MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY,
  633. };
  634. /**
  635. * Service to open Material Design modal dialogs.
  636. */
  637. class MatDialog {
  638. /**
  639. * @param {?} _overlay
  640. * @param {?} _injector
  641. * @param {?} _location
  642. * @param {?} _defaultOptions
  643. * @param {?} scrollStrategy
  644. * @param {?} _parentDialog
  645. * @param {?} _overlayContainer
  646. */
  647. constructor(_overlay, _injector, _location, _defaultOptions, scrollStrategy, _parentDialog, _overlayContainer) {
  648. this._overlay = _overlay;
  649. this._injector = _injector;
  650. this._location = _location;
  651. this._defaultOptions = _defaultOptions;
  652. this._parentDialog = _parentDialog;
  653. this._overlayContainer = _overlayContainer;
  654. this._openDialogsAtThisLevel = [];
  655. this._afterAllClosedAtThisLevel = new Subject();
  656. this._afterOpenedAtThisLevel = new Subject();
  657. this._ariaHiddenElements = new Map();
  658. // TODO (jelbourn): tighten the typing right-hand side of this expression.
  659. /**
  660. * Stream that emits when all open dialog have finished closing.
  661. * Will emit on subscribe if there are no open dialogs to begin with.
  662. */
  663. this.afterAllClosed = (/** @type {?} */ (defer((/**
  664. * @return {?}
  665. */
  666. () => this.openDialogs.length ?
  667. this._afterAllClosed :
  668. this._afterAllClosed.pipe(startWith(undefined))))));
  669. this._scrollStrategy = scrollStrategy;
  670. }
  671. /**
  672. * Keeps track of the currently-open dialogs.
  673. * @return {?}
  674. */
  675. get openDialogs() {
  676. return this._parentDialog ? this._parentDialog.openDialogs : this._openDialogsAtThisLevel;
  677. }
  678. /**
  679. * Stream that emits when a dialog has been opened.
  680. * @return {?}
  681. */
  682. get afterOpened() {
  683. return this._parentDialog ? this._parentDialog.afterOpened : this._afterOpenedAtThisLevel;
  684. }
  685. /**
  686. * Stream that emits when a dialog has been opened.
  687. * @deprecated Use `afterOpened` instead.
  688. * \@breaking-change 8.0.0
  689. * @return {?}
  690. */
  691. get afterOpen() {
  692. return this.afterOpened;
  693. }
  694. /**
  695. * @return {?}
  696. */
  697. get _afterAllClosed() {
  698. /** @type {?} */
  699. const parent = this._parentDialog;
  700. return parent ? parent._afterAllClosed : this._afterAllClosedAtThisLevel;
  701. }
  702. /**
  703. * Opens a modal dialog containing the given component.
  704. * @template T, D, R
  705. * @param {?} componentOrTemplateRef Type of the component to load into the dialog,
  706. * or a TemplateRef to instantiate as the dialog content.
  707. * @param {?=} config Extra configuration options.
  708. * @return {?} Reference to the newly-opened dialog.
  709. */
  710. open(componentOrTemplateRef, config) {
  711. config = _applyConfigDefaults(config, this._defaultOptions || new MatDialogConfig());
  712. if (config.id && this.getDialogById(config.id)) {
  713. throw Error(`Dialog with id "${config.id}" exists already. The dialog id must be unique.`);
  714. }
  715. /** @type {?} */
  716. const overlayRef = this._createOverlay(config);
  717. /** @type {?} */
  718. const dialogContainer = this._attachDialogContainer(overlayRef, config);
  719. /** @type {?} */
  720. const dialogRef = this._attachDialogContent(componentOrTemplateRef, dialogContainer, overlayRef, config);
  721. // If this is the first dialog that we're opening, hide all the non-overlay content.
  722. if (!this.openDialogs.length) {
  723. this._hideNonDialogContentFromAssistiveTechnology();
  724. }
  725. this.openDialogs.push(dialogRef);
  726. dialogRef.afterClosed().subscribe((/**
  727. * @return {?}
  728. */
  729. () => this._removeOpenDialog(dialogRef)));
  730. this.afterOpened.next(dialogRef);
  731. return dialogRef;
  732. }
  733. /**
  734. * Closes all of the currently-open dialogs.
  735. * @return {?}
  736. */
  737. closeAll() {
  738. this._closeDialogs(this.openDialogs);
  739. }
  740. /**
  741. * Finds an open dialog by its id.
  742. * @param {?} id ID to use when looking up the dialog.
  743. * @return {?}
  744. */
  745. getDialogById(id) {
  746. return this.openDialogs.find((/**
  747. * @param {?} dialog
  748. * @return {?}
  749. */
  750. dialog => dialog.id === id));
  751. }
  752. /**
  753. * @return {?}
  754. */
  755. ngOnDestroy() {
  756. // Only close the dialogs at this level on destroy
  757. // since the parent service may still be active.
  758. this._closeDialogs(this._openDialogsAtThisLevel);
  759. this._afterAllClosedAtThisLevel.complete();
  760. this._afterOpenedAtThisLevel.complete();
  761. }
  762. /**
  763. * Creates the overlay into which the dialog will be loaded.
  764. * @private
  765. * @param {?} config The dialog configuration.
  766. * @return {?} A promise resolving to the OverlayRef for the created overlay.
  767. */
  768. _createOverlay(config) {
  769. /** @type {?} */
  770. const overlayConfig = this._getOverlayConfig(config);
  771. return this._overlay.create(overlayConfig);
  772. }
  773. /**
  774. * Creates an overlay config from a dialog config.
  775. * @private
  776. * @param {?} dialogConfig The dialog configuration.
  777. * @return {?} The overlay configuration.
  778. */
  779. _getOverlayConfig(dialogConfig) {
  780. /** @type {?} */
  781. const state$$1 = new OverlayConfig({
  782. positionStrategy: this._overlay.position().global(),
  783. scrollStrategy: dialogConfig.scrollStrategy || this._scrollStrategy(),
  784. panelClass: dialogConfig.panelClass,
  785. hasBackdrop: dialogConfig.hasBackdrop,
  786. direction: dialogConfig.direction,
  787. minWidth: dialogConfig.minWidth,
  788. minHeight: dialogConfig.minHeight,
  789. maxWidth: dialogConfig.maxWidth,
  790. maxHeight: dialogConfig.maxHeight,
  791. disposeOnNavigation: dialogConfig.closeOnNavigation
  792. });
  793. if (dialogConfig.backdropClass) {
  794. state$$1.backdropClass = dialogConfig.backdropClass;
  795. }
  796. return state$$1;
  797. }
  798. /**
  799. * Attaches an MatDialogContainer to a dialog's already-created overlay.
  800. * @private
  801. * @param {?} overlay Reference to the dialog's underlying overlay.
  802. * @param {?} config The dialog configuration.
  803. * @return {?} A promise resolving to a ComponentRef for the attached container.
  804. */
  805. _attachDialogContainer(overlay, config) {
  806. /** @type {?} */
  807. const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
  808. /** @type {?} */
  809. const injector = new PortalInjector(userInjector || this._injector, new WeakMap([
  810. [MatDialogConfig, config]
  811. ]));
  812. /** @type {?} */
  813. const containerPortal = new ComponentPortal(MatDialogContainer, config.viewContainerRef, injector);
  814. /** @type {?} */
  815. const containerRef = overlay.attach(containerPortal);
  816. return containerRef.instance;
  817. }
  818. /**
  819. * Attaches the user-provided component to the already-created MatDialogContainer.
  820. * @private
  821. * @template T, R
  822. * @param {?} componentOrTemplateRef The type of component being loaded into the dialog,
  823. * or a TemplateRef to instantiate as the content.
  824. * @param {?} dialogContainer Reference to the wrapping MatDialogContainer.
  825. * @param {?} overlayRef Reference to the overlay in which the dialog resides.
  826. * @param {?} config The dialog configuration.
  827. * @return {?} A promise resolving to the MatDialogRef that should be returned to the user.
  828. */
  829. _attachDialogContent(componentOrTemplateRef, dialogContainer, overlayRef, config) {
  830. // Create a reference to the dialog we're creating in order to give the user a handle
  831. // to modify and close it.
  832. /** @type {?} */
  833. const dialogRef = new MatDialogRef(overlayRef, dialogContainer, this._location, config.id);
  834. // When the dialog backdrop is clicked, we want to close it.
  835. if (config.hasBackdrop) {
  836. overlayRef.backdropClick().subscribe((/**
  837. * @return {?}
  838. */
  839. () => {
  840. if (!dialogRef.disableClose) {
  841. dialogRef.close();
  842. }
  843. }));
  844. }
  845. if (componentOrTemplateRef instanceof TemplateRef) {
  846. dialogContainer.attachTemplatePortal(new TemplatePortal(componentOrTemplateRef, (/** @type {?} */ (null)), (/** @type {?} */ ({ $implicit: config.data, dialogRef }))));
  847. }
  848. else {
  849. /** @type {?} */
  850. const injector = this._createInjector(config, dialogRef, dialogContainer);
  851. /** @type {?} */
  852. const contentRef = dialogContainer.attachComponentPortal(new ComponentPortal(componentOrTemplateRef, undefined, injector));
  853. dialogRef.componentInstance = contentRef.instance;
  854. }
  855. dialogRef
  856. .updateSize(config.width, config.height)
  857. .updatePosition(config.position);
  858. return dialogRef;
  859. }
  860. /**
  861. * Creates a custom injector to be used inside the dialog. This allows a component loaded inside
  862. * of a dialog to close itself and, optionally, to return a value.
  863. * @private
  864. * @template T
  865. * @param {?} config Config object that is used to construct the dialog.
  866. * @param {?} dialogRef Reference to the dialog.
  867. * @param {?} dialogContainer
  868. * @return {?} The custom injector that can be used inside the dialog.
  869. */
  870. _createInjector(config, dialogRef, dialogContainer) {
  871. /** @type {?} */
  872. const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;
  873. // The MatDialogContainer is injected in the portal as the MatDialogContainer and the dialog's
  874. // content are created out of the same ViewContainerRef and as such, are siblings for injector
  875. // purposes. To allow the hierarchy that is expected, the MatDialogContainer is explicitly
  876. // added to the injection tokens.
  877. /** @type {?} */
  878. const injectionTokens = new WeakMap([
  879. [MatDialogContainer, dialogContainer],
  880. [MAT_DIALOG_DATA, config.data],
  881. [MatDialogRef, dialogRef]
  882. ]);
  883. if (config.direction &&
  884. (!userInjector || !userInjector.get(Directionality, null))) {
  885. injectionTokens.set(Directionality, {
  886. value: config.direction,
  887. change: of()
  888. });
  889. }
  890. return new PortalInjector(userInjector || this._injector, injectionTokens);
  891. }
  892. /**
  893. * Removes a dialog from the array of open dialogs.
  894. * @private
  895. * @param {?} dialogRef Dialog to be removed.
  896. * @return {?}
  897. */
  898. _removeOpenDialog(dialogRef) {
  899. /** @type {?} */
  900. const index = this.openDialogs.indexOf(dialogRef);
  901. if (index > -1) {
  902. this.openDialogs.splice(index, 1);
  903. // If all the dialogs were closed, remove/restore the `aria-hidden`
  904. // to a the siblings and emit to the `afterAllClosed` stream.
  905. if (!this.openDialogs.length) {
  906. this._ariaHiddenElements.forEach((/**
  907. * @param {?} previousValue
  908. * @param {?} element
  909. * @return {?}
  910. */
  911. (previousValue, element) => {
  912. if (previousValue) {
  913. element.setAttribute('aria-hidden', previousValue);
  914. }
  915. else {
  916. element.removeAttribute('aria-hidden');
  917. }
  918. }));
  919. this._ariaHiddenElements.clear();
  920. this._afterAllClosed.next();
  921. }
  922. }
  923. }
  924. /**
  925. * Hides all of the content that isn't an overlay from assistive technology.
  926. * @private
  927. * @return {?}
  928. */
  929. _hideNonDialogContentFromAssistiveTechnology() {
  930. /** @type {?} */
  931. const overlayContainer = this._overlayContainer.getContainerElement();
  932. // Ensure that the overlay container is attached to the DOM.
  933. if (overlayContainer.parentElement) {
  934. /** @type {?} */
  935. const siblings = overlayContainer.parentElement.children;
  936. for (let i = siblings.length - 1; i > -1; i--) {
  937. /** @type {?} */
  938. let sibling = siblings[i];
  939. if (sibling !== overlayContainer &&
  940. sibling.nodeName !== 'SCRIPT' &&
  941. sibling.nodeName !== 'STYLE' &&
  942. !sibling.hasAttribute('aria-live')) {
  943. this._ariaHiddenElements.set(sibling, sibling.getAttribute('aria-hidden'));
  944. sibling.setAttribute('aria-hidden', 'true');
  945. }
  946. }
  947. }
  948. }
  949. /**
  950. * Closes all of the dialogs in an array.
  951. * @private
  952. * @param {?} dialogs
  953. * @return {?}
  954. */
  955. _closeDialogs(dialogs) {
  956. /** @type {?} */
  957. let i = dialogs.length;
  958. while (i--) {
  959. // The `_openDialogs` property isn't updated after close until the rxjs subscription
  960. // runs on the next microtask, in addition to modifying the array as we're going
  961. // through it. We loop through all of them and call close without assuming that
  962. // they'll be removed from the list instantaneously.
  963. dialogs[i].close();
  964. }
  965. }
  966. }
  967. MatDialog.decorators = [
  968. { type: Injectable },
  969. ];
  970. /** @nocollapse */
  971. MatDialog.ctorParameters = () => [
  972. { type: Overlay },
  973. { type: Injector },
  974. { type: Location, decorators: [{ type: Optional }] },
  975. { type: MatDialogConfig, decorators: [{ type: Optional }, { type: Inject, args: [MAT_DIALOG_DEFAULT_OPTIONS,] }] },
  976. { type: undefined, decorators: [{ type: Inject, args: [MAT_DIALOG_SCROLL_STRATEGY,] }] },
  977. { type: MatDialog, decorators: [{ type: Optional }, { type: SkipSelf }] },
  978. { type: OverlayContainer }
  979. ];
  980. /**
  981. * Applies default options to the dialog config.
  982. * @param {?=} config Config to be modified.
  983. * @param {?=} defaultOptions Default options provided.
  984. * @return {?} The new configuration object.
  985. */
  986. function _applyConfigDefaults(config, defaultOptions) {
  987. return Object.assign({}, defaultOptions, config);
  988. }
  989. /**
  990. * @fileoverview added by tsickle
  991. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  992. */
  993. /**
  994. * Counter used to generate unique IDs for dialog elements.
  995. * @type {?}
  996. */
  997. let dialogElementUid = 0;
  998. /**
  999. * Button that will close the current dialog.
  1000. */
  1001. class MatDialogClose {
  1002. /**
  1003. * @param {?} dialogRef
  1004. * @param {?} _elementRef
  1005. * @param {?} _dialog
  1006. */
  1007. constructor(dialogRef, _elementRef, _dialog) {
  1008. this.dialogRef = dialogRef;
  1009. this._elementRef = _elementRef;
  1010. this._dialog = _dialog;
  1011. }
  1012. /**
  1013. * @return {?}
  1014. */
  1015. ngOnInit() {
  1016. if (!this.dialogRef) {
  1017. // When this directive is included in a dialog via TemplateRef (rather than being
  1018. // in a Component), the DialogRef isn't available via injection because embedded
  1019. // views cannot be given a custom injector. Instead, we look up the DialogRef by
  1020. // ID. This must occur in `onInit`, as the ID binding for the dialog container won't
  1021. // be resolved at constructor time.
  1022. this.dialogRef = (/** @type {?} */ (getClosestDialog(this._elementRef, this._dialog.openDialogs)));
  1023. }
  1024. }
  1025. /**
  1026. * @param {?} changes
  1027. * @return {?}
  1028. */
  1029. ngOnChanges(changes) {
  1030. /** @type {?} */
  1031. const proxiedChange = changes['_matDialogClose'] || changes['_matDialogCloseResult'];
  1032. if (proxiedChange) {
  1033. this.dialogResult = proxiedChange.currentValue;
  1034. }
  1035. }
  1036. }
  1037. MatDialogClose.decorators = [
  1038. { type: Directive, args: [{
  1039. selector: '[mat-dialog-close], [matDialogClose]',
  1040. exportAs: 'matDialogClose',
  1041. host: {
  1042. '(click)': 'dialogRef.close(dialogResult)',
  1043. '[attr.aria-label]': 'ariaLabel || null',
  1044. 'type': 'button',
  1045. }
  1046. },] },
  1047. ];
  1048. /** @nocollapse */
  1049. MatDialogClose.ctorParameters = () => [
  1050. { type: MatDialogRef, decorators: [{ type: Optional }] },
  1051. { type: ElementRef },
  1052. { type: MatDialog }
  1053. ];
  1054. MatDialogClose.propDecorators = {
  1055. ariaLabel: [{ type: Input, args: ['aria-label',] }],
  1056. dialogResult: [{ type: Input, args: ['mat-dialog-close',] }],
  1057. _matDialogClose: [{ type: Input, args: ['matDialogClose',] }]
  1058. };
  1059. /**
  1060. * Title of a dialog element. Stays fixed to the top of the dialog when scrolling.
  1061. */
  1062. class MatDialogTitle {
  1063. /**
  1064. * @param {?} _dialogRef
  1065. * @param {?} _elementRef
  1066. * @param {?} _dialog
  1067. */
  1068. constructor(_dialogRef, _elementRef, _dialog) {
  1069. this._dialogRef = _dialogRef;
  1070. this._elementRef = _elementRef;
  1071. this._dialog = _dialog;
  1072. this.id = `mat-dialog-title-${dialogElementUid++}`;
  1073. }
  1074. /**
  1075. * @return {?}
  1076. */
  1077. ngOnInit() {
  1078. if (!this._dialogRef) {
  1079. this._dialogRef = (/** @type {?} */ (getClosestDialog(this._elementRef, this._dialog.openDialogs)));
  1080. }
  1081. if (this._dialogRef) {
  1082. Promise.resolve().then((/**
  1083. * @return {?}
  1084. */
  1085. () => {
  1086. /** @type {?} */
  1087. const container = this._dialogRef._containerInstance;
  1088. if (container && !container._ariaLabelledBy) {
  1089. container._ariaLabelledBy = this.id;
  1090. }
  1091. }));
  1092. }
  1093. }
  1094. }
  1095. MatDialogTitle.decorators = [
  1096. { type: Directive, args: [{
  1097. selector: '[mat-dialog-title], [matDialogTitle]',
  1098. exportAs: 'matDialogTitle',
  1099. host: {
  1100. 'class': 'mat-dialog-title',
  1101. '[id]': 'id',
  1102. },
  1103. },] },
  1104. ];
  1105. /** @nocollapse */
  1106. MatDialogTitle.ctorParameters = () => [
  1107. { type: MatDialogRef, decorators: [{ type: Optional }] },
  1108. { type: ElementRef },
  1109. { type: MatDialog }
  1110. ];
  1111. MatDialogTitle.propDecorators = {
  1112. id: [{ type: Input }]
  1113. };
  1114. /**
  1115. * Scrollable content container of a dialog.
  1116. */
  1117. class MatDialogContent {
  1118. }
  1119. MatDialogContent.decorators = [
  1120. { type: Directive, args: [{
  1121. selector: `[mat-dialog-content], mat-dialog-content, [matDialogContent]`,
  1122. host: { 'class': 'mat-dialog-content' }
  1123. },] },
  1124. ];
  1125. /**
  1126. * Container for the bottom action buttons in a dialog.
  1127. * Stays fixed to the bottom when scrolling.
  1128. */
  1129. class MatDialogActions {
  1130. }
  1131. MatDialogActions.decorators = [
  1132. { type: Directive, args: [{
  1133. selector: `[mat-dialog-actions], mat-dialog-actions, [matDialogActions]`,
  1134. host: { 'class': 'mat-dialog-actions' }
  1135. },] },
  1136. ];
  1137. /**
  1138. * Finds the closest MatDialogRef to an element by looking at the DOM.
  1139. * @param {?} element Element relative to which to look for a dialog.
  1140. * @param {?} openDialogs References to the currently-open dialogs.
  1141. * @return {?}
  1142. */
  1143. function getClosestDialog(element, openDialogs) {
  1144. /** @type {?} */
  1145. let parent = element.nativeElement.parentElement;
  1146. while (parent && !parent.classList.contains('mat-dialog-container')) {
  1147. parent = parent.parentElement;
  1148. }
  1149. return parent ? openDialogs.find((/**
  1150. * @param {?} dialog
  1151. * @return {?}
  1152. */
  1153. dialog => dialog.id === (/** @type {?} */ (parent)).id)) : null;
  1154. }
  1155. /**
  1156. * @fileoverview added by tsickle
  1157. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1158. */
  1159. class MatDialogModule {
  1160. }
  1161. MatDialogModule.decorators = [
  1162. { type: NgModule, args: [{
  1163. imports: [
  1164. CommonModule,
  1165. OverlayModule,
  1166. PortalModule,
  1167. MatCommonModule,
  1168. ],
  1169. exports: [
  1170. MatDialogContainer,
  1171. MatDialogClose,
  1172. MatDialogTitle,
  1173. MatDialogContent,
  1174. MatDialogActions,
  1175. MatCommonModule,
  1176. ],
  1177. declarations: [
  1178. MatDialogContainer,
  1179. MatDialogClose,
  1180. MatDialogTitle,
  1181. MatDialogActions,
  1182. MatDialogContent,
  1183. ],
  1184. providers: [
  1185. MatDialog,
  1186. MAT_DIALOG_SCROLL_STRATEGY_PROVIDER,
  1187. ],
  1188. entryComponents: [MatDialogContainer],
  1189. },] },
  1190. ];
  1191. /**
  1192. * @fileoverview added by tsickle
  1193. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1194. */
  1195. /**
  1196. * @fileoverview added by tsickle
  1197. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1198. */
  1199. export { MatDialogModule, MAT_DIALOG_SCROLL_STRATEGY_FACTORY, MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY, MAT_DIALOG_DATA, MAT_DIALOG_DEFAULT_OPTIONS, MAT_DIALOG_SCROLL_STRATEGY, MAT_DIALOG_SCROLL_STRATEGY_PROVIDER, MatDialog, throwMatDialogContentAlreadyAttachedError, MatDialogContainer, MatDialogClose, MatDialogTitle, MatDialogContent, MatDialogActions, MatDialogConfig, MatDialogRef, matDialogAnimations };
  1200. //# sourceMappingURL=dialog.js.map