/** * @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 { Directionality } from '@angular/cdk/bidi'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes'; import { TemplatePortal } from '@angular/cdk/portal'; import { Directive, ElementRef, EventEmitter, Inject, InjectionToken, Input, Optional, Output, TemplateRef, ViewContainerRef, } from '@angular/core'; import { Subscription } from 'rxjs'; import { takeWhile } from 'rxjs/operators'; import { Overlay } from './overlay'; import { OverlayConfig } from './overlay-config'; import { FlexibleConnectedPositionStrategy, } from './position/flexible-connected-position-strategy'; import * as i0 from "@angular/core"; import * as i1 from "./overlay"; import * as i2 from "@angular/cdk/bidi"; /** Default set of positions for the overlay. Follows the behavior of a dropdown. */ const defaultPositionList = [ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', }, { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', }, { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', }, { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', }, ]; /** Injection token that determines the scroll handling while the connected overlay is open. */ export const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new InjectionToken('cdk-connected-overlay-scroll-strategy'); /** * Directive applied to an element to make it usable as an origin for an Overlay using a * ConnectedPositionStrategy. */ export class CdkOverlayOrigin { constructor( /** Reference to the element on which the directive is applied. */ elementRef) { this.elementRef = elementRef; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkOverlayOrigin, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: CdkOverlayOrigin, isStandalone: true, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkOverlayOrigin, decorators: [{ type: Directive, args: [{ selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]', exportAs: 'cdkOverlayOrigin', standalone: true, }] }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } }); /** * Directive to facilitate declarative creation of an * Overlay using a FlexibleConnectedPositionStrategy. */ export class CdkConnectedOverlay { /** The offset in pixels for the overlay connection point on the x-axis */ get offsetX() { return this._offsetX; } set offsetX(offsetX) { this._offsetX = offsetX; if (this._position) { this._updatePositionStrategy(this._position); } } /** The offset in pixels for the overlay connection point on the y-axis */ get offsetY() { return this._offsetY; } set offsetY(offsetY) { this._offsetY = offsetY; if (this._position) { this._updatePositionStrategy(this._position); } } /** Whether or not the overlay should attach a backdrop. */ get hasBackdrop() { return this._hasBackdrop; } set hasBackdrop(value) { this._hasBackdrop = coerceBooleanProperty(value); } /** Whether or not the overlay should be locked when scrolling. */ get lockPosition() { return this._lockPosition; } set lockPosition(value) { this._lockPosition = coerceBooleanProperty(value); } /** Whether the overlay's width and height can be constrained to fit within the viewport. */ get flexibleDimensions() { return this._flexibleDimensions; } set flexibleDimensions(value) { this._flexibleDimensions = coerceBooleanProperty(value); } /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */ get growAfterOpen() { return this._growAfterOpen; } set growAfterOpen(value) { this._growAfterOpen = coerceBooleanProperty(value); } /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */ get push() { return this._push; } set push(value) { this._push = coerceBooleanProperty(value); } // TODO(jelbourn): inputs for size, scroll behavior, animation, etc. constructor(_overlay, templateRef, viewContainerRef, scrollStrategyFactory, _dir) { this._overlay = _overlay; this._dir = _dir; this._hasBackdrop = false; this._lockPosition = false; this._growAfterOpen = false; this._flexibleDimensions = false; this._push = false; this._backdropSubscription = Subscription.EMPTY; this._attachSubscription = Subscription.EMPTY; this._detachSubscription = Subscription.EMPTY; this._positionSubscription = Subscription.EMPTY; /** Margin between the overlay and the viewport edges. */ this.viewportMargin = 0; /** Whether the overlay is open. */ this.open = false; /** Whether the overlay can be closed by user interaction. */ this.disableClose = false; /** Event emitted when the backdrop is clicked. */ this.backdropClick = new EventEmitter(); /** Event emitted when the position has changed. */ this.positionChange = new EventEmitter(); /** Event emitted when the overlay has been attached. */ this.attach = new EventEmitter(); /** Event emitted when the overlay has been detached. */ this.detach = new EventEmitter(); /** Emits when there are keyboard events that are targeted at the overlay. */ this.overlayKeydown = new EventEmitter(); /** Emits when there are mouse outside click events that are targeted at the overlay. */ this.overlayOutsideClick = new EventEmitter(); this._templatePortal = new TemplatePortal(templateRef, viewContainerRef); this._scrollStrategyFactory = scrollStrategyFactory; this.scrollStrategy = this._scrollStrategyFactory(); } /** The associated overlay reference. */ get overlayRef() { return this._overlayRef; } /** The element's layout direction. */ get dir() { return this._dir ? this._dir.value : 'ltr'; } ngOnDestroy() { this._attachSubscription.unsubscribe(); this._detachSubscription.unsubscribe(); this._backdropSubscription.unsubscribe(); this._positionSubscription.unsubscribe(); if (this._overlayRef) { this._overlayRef.dispose(); } } ngOnChanges(changes) { if (this._position) { this._updatePositionStrategy(this._position); this._overlayRef.updateSize({ width: this.width, minWidth: this.minWidth, height: this.height, minHeight: this.minHeight, }); if (changes['origin'] && this.open) { this._position.apply(); } } if (changes['open']) { this.open ? this._attachOverlay() : this._detachOverlay(); } } /** Creates an overlay */ _createOverlay() { if (!this.positions || !this.positions.length) { this.positions = defaultPositionList; } const overlayRef = (this._overlayRef = this._overlay.create(this._buildConfig())); this._attachSubscription = overlayRef.attachments().subscribe(() => this.attach.emit()); this._detachSubscription = overlayRef.detachments().subscribe(() => this.detach.emit()); overlayRef.keydownEvents().subscribe((event) => { this.overlayKeydown.next(event); if (event.keyCode === ESCAPE && !this.disableClose && !hasModifierKey(event)) { event.preventDefault(); this._detachOverlay(); } }); this._overlayRef.outsidePointerEvents().subscribe((event) => { this.overlayOutsideClick.next(event); }); } /** Builds the overlay config based on the directive's inputs */ _buildConfig() { const positionStrategy = (this._position = this.positionStrategy || this._createPositionStrategy()); const overlayConfig = new OverlayConfig({ direction: this._dir, positionStrategy, scrollStrategy: this.scrollStrategy, hasBackdrop: this.hasBackdrop, }); if (this.width || this.width === 0) { overlayConfig.width = this.width; } if (this.height || this.height === 0) { overlayConfig.height = this.height; } if (this.minWidth || this.minWidth === 0) { overlayConfig.minWidth = this.minWidth; } if (this.minHeight || this.minHeight === 0) { overlayConfig.minHeight = this.minHeight; } if (this.backdropClass) { overlayConfig.backdropClass = this.backdropClass; } if (this.panelClass) { overlayConfig.panelClass = this.panelClass; } return overlayConfig; } /** Updates the state of a position strategy, based on the values of the directive inputs. */ _updatePositionStrategy(positionStrategy) { const positions = this.positions.map(currentPosition => ({ originX: currentPosition.originX, originY: currentPosition.originY, overlayX: currentPosition.overlayX, overlayY: currentPosition.overlayY, offsetX: currentPosition.offsetX || this.offsetX, offsetY: currentPosition.offsetY || this.offsetY, panelClass: currentPosition.panelClass || undefined, })); return positionStrategy .setOrigin(this._getFlexibleConnectedPositionStrategyOrigin()) .withPositions(positions) .withFlexibleDimensions(this.flexibleDimensions) .withPush(this.push) .withGrowAfterOpen(this.growAfterOpen) .withViewportMargin(this.viewportMargin) .withLockedPosition(this.lockPosition) .withTransformOriginOn(this.transformOriginSelector); } /** Returns the position strategy of the overlay to be set on the overlay config */ _createPositionStrategy() { const strategy = this._overlay .position() .flexibleConnectedTo(this._getFlexibleConnectedPositionStrategyOrigin()); this._updatePositionStrategy(strategy); return strategy; } _getFlexibleConnectedPositionStrategyOrigin() { if (this.origin instanceof CdkOverlayOrigin) { return this.origin.elementRef; } else { return this.origin; } } /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */ _attachOverlay() { if (!this._overlayRef) { this._createOverlay(); } else { // Update the overlay size, in case the directive's inputs have changed this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop; } if (!this._overlayRef.hasAttached()) { this._overlayRef.attach(this._templatePortal); } if (this.hasBackdrop) { this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => { this.backdropClick.emit(event); }); } else { this._backdropSubscription.unsubscribe(); } this._positionSubscription.unsubscribe(); // Only subscribe to `positionChanges` if requested, because putting // together all the information for it can be expensive. if (this.positionChange.observers.length > 0) { this._positionSubscription = this._position.positionChanges .pipe(takeWhile(() => this.positionChange.observers.length > 0)) .subscribe(position => { this.positionChange.emit(position); if (this.positionChange.observers.length === 0) { this._positionSubscription.unsubscribe(); } }); } } /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */ _detachOverlay() { if (this._overlayRef) { this._overlayRef.detach(); } this._backdropSubscription.unsubscribe(); this._positionSubscription.unsubscribe(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkConnectedOverlay, deps: [{ token: i1.Overlay }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: CdkConnectedOverlay, isStandalone: true, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: { origin: ["cdkConnectedOverlayOrigin", "origin"], positions: ["cdkConnectedOverlayPositions", "positions"], positionStrategy: ["cdkConnectedOverlayPositionStrategy", "positionStrategy"], offsetX: ["cdkConnectedOverlayOffsetX", "offsetX"], offsetY: ["cdkConnectedOverlayOffsetY", "offsetY"], width: ["cdkConnectedOverlayWidth", "width"], height: ["cdkConnectedOverlayHeight", "height"], minWidth: ["cdkConnectedOverlayMinWidth", "minWidth"], minHeight: ["cdkConnectedOverlayMinHeight", "minHeight"], backdropClass: ["cdkConnectedOverlayBackdropClass", "backdropClass"], panelClass: ["cdkConnectedOverlayPanelClass", "panelClass"], viewportMargin: ["cdkConnectedOverlayViewportMargin", "viewportMargin"], scrollStrategy: ["cdkConnectedOverlayScrollStrategy", "scrollStrategy"], open: ["cdkConnectedOverlayOpen", "open"], disableClose: ["cdkConnectedOverlayDisableClose", "disableClose"], transformOriginSelector: ["cdkConnectedOverlayTransformOriginOn", "transformOriginSelector"], hasBackdrop: ["cdkConnectedOverlayHasBackdrop", "hasBackdrop"], lockPosition: ["cdkConnectedOverlayLockPosition", "lockPosition"], flexibleDimensions: ["cdkConnectedOverlayFlexibleDimensions", "flexibleDimensions"], growAfterOpen: ["cdkConnectedOverlayGrowAfterOpen", "growAfterOpen"], push: ["cdkConnectedOverlayPush", "push"] }, outputs: { backdropClick: "backdropClick", positionChange: "positionChange", attach: "attach", detach: "detach", overlayKeydown: "overlayKeydown", overlayOutsideClick: "overlayOutsideClick" }, exportAs: ["cdkConnectedOverlay"], usesOnChanges: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkConnectedOverlay, decorators: [{ type: Directive, args: [{ selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]', exportAs: 'cdkConnectedOverlay', standalone: true, }] }], ctorParameters: function () { return [{ type: i1.Overlay }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: undefined, decorators: [{ type: Inject, args: [CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY] }] }, { type: i2.Directionality, decorators: [{ type: Optional }] }]; }, propDecorators: { origin: [{ type: Input, args: ['cdkConnectedOverlayOrigin'] }], positions: [{ type: Input, args: ['cdkConnectedOverlayPositions'] }], positionStrategy: [{ type: Input, args: ['cdkConnectedOverlayPositionStrategy'] }], offsetX: [{ type: Input, args: ['cdkConnectedOverlayOffsetX'] }], offsetY: [{ type: Input, args: ['cdkConnectedOverlayOffsetY'] }], width: [{ type: Input, args: ['cdkConnectedOverlayWidth'] }], height: [{ type: Input, args: ['cdkConnectedOverlayHeight'] }], minWidth: [{ type: Input, args: ['cdkConnectedOverlayMinWidth'] }], minHeight: [{ type: Input, args: ['cdkConnectedOverlayMinHeight'] }], backdropClass: [{ type: Input, args: ['cdkConnectedOverlayBackdropClass'] }], panelClass: [{ type: Input, args: ['cdkConnectedOverlayPanelClass'] }], viewportMargin: [{ type: Input, args: ['cdkConnectedOverlayViewportMargin'] }], scrollStrategy: [{ type: Input, args: ['cdkConnectedOverlayScrollStrategy'] }], open: [{ type: Input, args: ['cdkConnectedOverlayOpen'] }], disableClose: [{ type: Input, args: ['cdkConnectedOverlayDisableClose'] }], transformOriginSelector: [{ type: Input, args: ['cdkConnectedOverlayTransformOriginOn'] }], hasBackdrop: [{ type: Input, args: ['cdkConnectedOverlayHasBackdrop'] }], lockPosition: [{ type: Input, args: ['cdkConnectedOverlayLockPosition'] }], flexibleDimensions: [{ type: Input, args: ['cdkConnectedOverlayFlexibleDimensions'] }], growAfterOpen: [{ type: Input, args: ['cdkConnectedOverlayGrowAfterOpen'] }], push: [{ type: Input, args: ['cdkConnectedOverlayPush'] }], backdropClick: [{ type: Output }], positionChange: [{ type: Output }], attach: [{ type: Output }], detach: [{ type: Output }], overlayKeydown: [{ type: Output }], overlayOutsideClick: [{ type: Output }] } }); /** @docs-private */ export function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) { return () => overlay.scrollStrategies.reposition(); } /** @docs-private */ export const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = { provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY, deps: [Overlay], useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY, }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3ZlcmxheS1kaXJlY3RpdmVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2Nkay9vdmVybGF5L292ZXJsYXktZGlyZWN0aXZlcy50cyJdLCJu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