/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes'; import { Subject } from 'rxjs'; /** * Reference to a dialog opened via the Dialog service. */ export class DialogRef { constructor(overlayRef, config) { this.overlayRef = overlayRef; this.config = config; /** Emits when the dialog has been closed. */ this.closed = new Subject(); this.disableClose = config.disableClose; this.backdropClick = overlayRef.backdropClick(); this.keydownEvents = overlayRef.keydownEvents(); this.outsidePointerEvents = overlayRef.outsidePointerEvents(); this.id = config.id; // By the time the dialog is created we are guaranteed to have an ID. this.keydownEvents.subscribe(event => { if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) { event.preventDefault(); this.close(undefined, { focusOrigin: 'keyboard' }); } }); this.backdropClick.subscribe(() => { if (!this.disableClose) { this.close(undefined, { focusOrigin: 'mouse' }); } }); this._detachSubscription = overlayRef.detachments().subscribe(() => { // Check specifically for `false`, because we want `undefined` to be treated like `true`. if (config.closeOnOverlayDetachments !== false) { this.close(); } }); } /** * Close the dialog. * @param result Optional result to return to the dialog opener. * @param options Additional options to customize the closing behavior. */ close(result, options) { if (this.containerInstance) { const closedSubject = this.closed; this.containerInstance._closeInteractionType = options?.focusOrigin || 'program'; // Drop the detach subscription first since it can be triggered by the // `dispose` call and override the result of this closing sequence. this._detachSubscription.unsubscribe(); this.overlayRef.dispose(); closedSubject.next(result); closedSubject.complete(); this.componentInstance = this.containerInstance = null; } } /** Updates the position of the dialog based on the current position strategy. */ updatePosition() { this.overlayRef.updatePosition(); return this; } /** * Updates the dialog's width and height. * @param width New width of the dialog. * @param height New height of the dialog. */ updateSize(width = '', height = '') { this.overlayRef.updateSize({ width, height }); return this; } /** Add a CSS class or an array of classes to the overlay pane. */ addPanelClass(classes) { this.overlayRef.addPanelClass(classes); return this; } /** Remove a CSS class or an array of classes from the overlay pane. */ removePanelClass(classes) { this.overlayRef.removePanelClass(classes); return this; } } //# sourceM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