blob: 4f406f9a44be0c0f43b6b6fa8f3a1b859d89cc7b [file] [log] [blame]
{"version":3,"file":"covalent-core-side-sheet.js","sources":["../../../../src/platform/core/side-sheet/side-sheet.animation.ts","../../../../src/platform/core/side-sheet/side-sheet.config.ts","../../../../src/platform/core/side-sheet/side-sheet-container.ts","../../../../src/platform/core/side-sheet/side-sheet-ref.ts","../../../../src/platform/core/side-sheet/side-sheet.ts","../../../../src/platform/core/side-sheet/side-sheet.content-directives.ts","../../../../src/platform/core/side-sheet/side-sheet.module.ts"],"sourcesContent":["import { animate, state, style, transition, trigger, AnimationTriggerMetadata } from '@angular/animations';\nimport { AnimationCurves, AnimationDurations } from '@angular/material/core';\n\nexport const tdSideSheetAnimations: {\n readonly sideSheetContainer: AnimationTriggerMetadata;\n} = {\n /** Animation that is applied on the side-sheet container by default. */\n sideSheetContainer: trigger('sideSheetContainer', [\n state('void, exit', style({ transform: 'translateX(100%)' })),\n state('enter', style({ transform: 'translateX(0%)', opacity: 1 })),\n transition(\n '* => enter',\n animate(\n `${AnimationDurations.ENTERING} ${AnimationCurves.ACCELERATION_CURVE}`,\n style({ transform: 'translateX(0)', opacity: 1 }),\n ),\n ),\n transition(\n '* => void, * => exit',\n animate(\n `${AnimationDurations.EXITING} ${AnimationCurves.ACCELERATION_CURVE}`,\n style({ transform: 'translateX(100%)' }),\n ),\n ),\n ]),\n};\n","import { MatDialogConfig } from '@angular/material/dialog';\n\nexport class CovalentSideSheetConfig<D = any> extends MatDialogConfig<D> {}\n","/* tslint:disable */\nimport { AnimationEvent } from '@angular/animations';\nimport { FocusMonitor, FocusOrigin, FocusTrap, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, DomPortal, TemplatePortal } from '@angular/cdk/portal';\nimport { DOCUMENT } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ComponentRef,\n Directive,\n ElementRef,\n EmbeddedViewRef,\n EventEmitter,\n Inject,\n Optional,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { tdSideSheetAnimations } from './side-sheet.animation';\nimport { CovalentSideSheetConfig } from './side-sheet.config';\n\nexport function _getFocusedElementPierceShadowDom(): HTMLElement | null {\n let activeElement =\n typeof document !== 'undefined' && document ? (document.activeElement as HTMLElement | null) : null;\n\n while (activeElement && activeElement.shadowRoot) {\n const newActiveElement = activeElement.shadowRoot.activeElement as HTMLElement | null;\n if (newActiveElement === activeElement) {\n break;\n } else {\n activeElement = newActiveElement;\n }\n }\n\n return activeElement;\n}\n\n/**\n * Base class for the `CovalentSideSheetContainer`. The base class does not implement\n * animations as these are left to implementers of the side-sheet container.\n */\n@Directive()\nexport abstract class _CovalentSideSheetContainerBase extends BasePortalOutlet {\n protected _document: Document;\n\n /** The portal outlet inside of this container into which the side-sheet content will be loaded. */\n @ViewChild(CdkPortalOutlet, { static: true }) _portalOutlet: CdkPortalOutlet;\n\n /** The class that traps and manages focus within the side-sheet. */\n private _focusTrap: FocusTrap;\n\n /** Emits when an animation state changes. */\n _animationStateChanged = new EventEmitter<{\n state: 'opened' | 'opening' | 'closing' | 'closed';\n totalTime: number;\n }>();\n\n /** Element that was focused before the side-sheet was opened. Save this to restore upon close. */\n private _elementFocusedBeforeSideSheetWasOpened: HTMLElement | null = null;\n\n /**\n * Type of interaction that led to the side-sheet 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 side-sheet is closed.\n */\n _closeInteractionType: FocusOrigin | null = null;\n\n /** ID of the element that should be considered as the side-sheet's label. */\n _ariaLabelledBy: string | null;\n\n /** ID for the container DOM element. */\n _id: string;\n\n constructor(\n protected _elementRef: ElementRef,\n protected _focusTrapFactory: FocusTrapFactory,\n protected _changeDetectorRef: ChangeDetectorRef,\n @Optional() @Inject(DOCUMENT) _document: any,\n /** The side-sheet configuration. */\n public _config: CovalentSideSheetConfig,\n private _focusMonitor?: FocusMonitor,\n ) {\n super();\n this._ariaLabelledBy = _config.ariaLabelledBy || null;\n this._document = _document;\n }\n\n /** Starts the side-sheet exit animation. */\n abstract _startExitAnimation(): void;\n\n /** Initializes the side-sheet container with the attached content. */\n _initializeWithAttachedContent() {\n this._setupFocusTrap();\n // Save the previously focused element. This element will be re-focused\n // when the side-sheet closes.\n this._capturePreviouslyFocusedElement();\n }\n\n /**\n * Attach a ComponentPortal as content to this side-sheet container.\n * @param portal Portal to be attached as the side-sheet content.\n */\n attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\n return this._portalOutlet.attachComponentPortal(portal);\n }\n\n /**\n * Attach a TemplatePortal as content to this side-sheet container.\n * @param portal Portal to be attached as the side-sheet content.\n */\n attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C> {\n return this._portalOutlet.attachTemplatePortal(portal);\n }\n\n /**\n * Attaches a DOM portal to the side-sheet container.\n * @param portal Portal to be attached.\n * @deprecated To be turned into a method.\n */\n attachDomPortal = (portal: DomPortal) => {\n return this._portalOutlet.attachDomPortal(portal);\n };\n\n /** Moves focus back into the side-sheet if it was moved out. */\n _recaptureFocus() {\n if (!this._containsFocus()) {\n this._trapFocus();\n }\n }\n\n /**\n * Moves the focus inside the focus trap. When autoFocus is not set to 'side-sheet', if focus\n * cannot be moved then focus will go to the side-sheet container.\n */\n protected _trapFocus() {\n const element = this._elementRef.nativeElement;\n if (!this._config.autoFocus) {\n if (!this._containsFocus()) {\n element.focus();\n }\n } else {\n this._focusTrap.focusInitialElementWhenReady().then((focusedSuccessfully) => {\n // If we weren't able to find a focusable element in the side-sheet, then focus the side-sheet\n // container instead.\n if (!focusedSuccessfully) {\n this._focusSideSheetContainer();\n }\n });\n }\n }\n\n /** Restores focus to the element that was focused before the side-sheet opened. */\n protected _restoreFocus() {\n const previousElement = this._elementFocusedBeforeSideSheetWasOpened;\n\n // We need the extra check, because IE can set the `activeElement` to null in some cases.\n if (this._config.restoreFocus && previousElement && typeof previousElement.focus === 'function') {\n const activeElement = _getFocusedElementPierceShadowDom();\n const element = this._elementRef.nativeElement;\n\n // Make sure that focus is still inside the side-sheet 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(previousElement, this._closeInteractionType);\n this._closeInteractionType = null;\n } else {\n previousElement.focus();\n }\n }\n }\n\n if (this._focusTrap) {\n this._focusTrap.destroy();\n }\n }\n\n /** Sets up the focus trap. */\n private _setupFocusTrap() {\n this._focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement);\n }\n\n /** Captures the element that was focused before the side-sheet was opened. */\n private _capturePreviouslyFocusedElement() {\n if (this._document) {\n this._elementFocusedBeforeSideSheetWasOpened = _getFocusedElementPierceShadowDom();\n }\n }\n\n /** Focuses the side-sheet container. */\n private _focusSideSheetContainer() {\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 side-sheet. */\n private _containsFocus() {\n const element = this._elementRef.nativeElement;\n const activeElement = _getFocusedElementPierceShadowDom();\n return element === activeElement || element.contains(activeElement);\n }\n}\n\n/**\n * Internal component that wraps the generated side-sheet content.\n * This animation below is the only reason for duplicating most of the Material dialog code\n */\n@Component({\n selector: 'td-side-sheet-container',\n template: `\n <ng-template cdkPortalOutlet></ng-template>\n `,\n styleUrls: ['side-sheet.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.Default,\n animations: [tdSideSheetAnimations.sideSheetContainer],\n host: {\n 'class': 'td-side-sheet-container',\n 'tabindex': '-1',\n 'aria-modal': 'true',\n '[id]': '_id',\n '[attr.role]': '_config.role',\n '[attr.aria-labelledby]': '_config.ariaLabel ? null : _ariaLabelledBy',\n '[attr.aria-label]': '_config.ariaLabel',\n '[attr.aria-describedby]': '_config.ariaDescribedBy || null',\n '[@sideSheetContainer]': '_state',\n '(@sideSheetContainer.start)': '_onAnimationStart($event)',\n '(@sideSheetContainer.done)': '_onAnimationDone($event)',\n },\n})\nexport class CovalentSideSheetContainer extends _CovalentSideSheetContainerBase {\n /** State of the side-sheet animation. */\n _state: 'void' | 'enter' | 'exit' = 'enter';\n\n /** Callback, invoked whenever an animation on the host completes. */\n _onAnimationDone({ toState, totalTime }: AnimationEvent) {\n if (toState === 'enter') {\n this._trapFocus();\n this._animationStateChanged.next({ state: 'opened', totalTime });\n } else if (toState === 'exit') {\n this._restoreFocus();\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }\n\n /** Callback, invoked when an animation on the host starts. */\n _onAnimationStart({ toState, totalTime }: AnimationEvent) {\n if (toState === 'enter') {\n this._animationStateChanged.next({ state: 'opening', totalTime });\n } else if (toState === 'exit' || toState === 'void') {\n this._animationStateChanged.next({ state: 'closing', totalTime });\n }\n }\n\n /** Starts the side-sheet exit animation. */\n _startExitAnimation(): void {\n this._state = 'exit';\n this._changeDetectorRef.markForCheck();\n }\n}\n","/* tslint:disable */\nimport { FocusOrigin } from '@angular/cdk/a11y';\nimport { OverlayRef } from '@angular/cdk/overlay';\nimport { MatDialogRef, _MatDialogContainerBase } from '@angular/material/dialog';\n\n// Counter for unique dialog ids.\nlet uniqueId = 0;\n\n// Create a new side sheet ref to change the id of the ref\nexport class CovalentSideSheetRef<T, R = any> extends MatDialogRef<T, R> {\n constructor(\n public overlayRef: OverlayRef,\n public _containerInstance: _MatDialogContainerBase,\n readonly id: string = `td-side-sheet-${uniqueId++}`,\n ) {\n super(overlayRef, _containerInstance, id);\n }\n}\n\nexport function _closeSideSheetVia<R>(ref: CovalentSideSheetRef<R>, interactionType: FocusOrigin, result?: R) {\n // Some mock dialog ref instances in tests do not have the `_containerInstance` property.\n // For those, we keep the behavior as is and do not deal with the interaction type.\n if (ref._containerInstance !== undefined) {\n ref._containerInstance._closeInteractionType = interactionType;\n }\n return ref.close(result);\n}\n","/* tslint:disable */\nimport {\n Directive,\n Inject,\n Injectable,\n InjectFlags,\n InjectionToken,\n Injector,\n OnDestroy,\n Optional,\n SkipSelf,\n StaticProvider,\n TemplateRef,\n Type,\n} from '@angular/core';\nimport { Overlay, OverlayConfig, OverlayRef, GlobalPositionStrategy } from '@angular/cdk/overlay';\nimport { ComponentPortal, ComponentType, TemplatePortal } from '@angular/cdk/portal';\nimport { MAT_DIALOG_DATA, MAT_DIALOG_DEFAULT_OPTIONS, _MatDialogContainerBase } from '@angular/material/dialog';\nimport { AnimationCurves, AnimationDurations } from '@angular/material/core';\nimport { CovalentSideSheetContainer, _CovalentSideSheetContainerBase } from './side-sheet-container';\nimport { Subject, Subscription, of } from 'rxjs';\nimport { filter, take } from 'rxjs/operators';\nimport { Directionality } from '@angular/cdk/bidi';\n\nimport { CovalentSideSheetRef } from './side-sheet-ref';\nimport { CovalentSideSheetConfig } from './side-sheet.config';\n\n@Directive()\nexport class _CovalentSideSheetBase<C extends _CovalentSideSheetContainerBase> implements OnDestroy {\n private _openSideSheetsAtThisLevel: CovalentSideSheetRef<unknown>[] = [];\n private readonly _afterAllClosedAtThisLevel = new Subject<void>();\n private readonly _afterOpenedAtThisLevel = new Subject<CovalentSideSheetRef<unknown>>();\n private _animationStateSubscriptions: Subscription;\n\n private defaultSidebarConfig = {\n minWidth: '400px',\n maxWidth: '100vw',\n };\n\n constructor(\n private _overlay: Overlay,\n private _injector: Injector,\n private _defaultOptions: CovalentSideSheetConfig | undefined,\n private _parentSideSheet: _CovalentSideSheetBase<C> | undefined,\n private _sideSheetRefConstructor: Type<CovalentSideSheetRef<any>>,\n private _sideSheetContainerType: Type<C>,\n private _sideSheetDataToken: InjectionToken<unknown>,\n ) {}\n\n /** Keeps track of the currently-open side-sheets. */\n get openSideSheets(): CovalentSideSheetRef<unknown>[] {\n return this._parentSideSheet ? this._parentSideSheet.openSideSheets : this._openSideSheetsAtThisLevel;\n }\n\n open<T, D = unknown, R = unknown>(\n componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n config?: CovalentSideSheetConfig<D>,\n ): CovalentSideSheetRef<T, R> {\n config = { ...(this._defaultOptions || new CovalentSideSheetConfig()), ...this.defaultSidebarConfig, ...config };\n\n const overlayRef = this._createOverlay(config);\n const sideSheetContainer = this._attachSideSheetContainer(overlayRef, config);\n const sideSheetRef = this._attachSideSheetContent<T, R>(\n componentOrTemplateRef,\n sideSheetContainer,\n overlayRef,\n config,\n );\n const prevSideSheetRef: CovalentSideSheetRef<unknown> = this.openSideSheets.slice(-1)[0];\n const prevOverlayRef = prevSideSheetRef?.overlayRef;\n\n // Animate previous side sheet to full width\n if (prevOverlayRef?.overlayElement) {\n prevOverlayRef.overlayElement.style.transition = `${AnimationDurations.COMPLEX} ${AnimationCurves.DECELERATION_CURVE}`;\n prevOverlayRef.overlayElement.style.minWidth = `${(window as any).innerWidth}px`;\n }\n\n // Revert the previous side sheet config & size\n sideSheetRef._containerInstance._animationStateChanged\n .pipe(\n filter((event) => event.state === 'closing' && !!(prevSideSheetRef && prevOverlayRef)),\n take(1),\n )\n .subscribe(() => {\n prevOverlayRef.overlayElement.style.transition = `${AnimationDurations.EXITING} ${AnimationCurves.DECELERATION_CURVE}`;\n prevSideSheetRef.updateSize();\n });\n\n // Add new side sheet to open list\n this.openSideSheets.push(sideSheetRef);\n\n // Remove side sheet ref after closed\n sideSheetRef\n .afterClosed()\n .pipe(take(1))\n .subscribe(() => this._removeOpenSideSheet(sideSheetRef));\n\n // Notify the side-sheet container that the content has been attached.\n sideSheetContainer._initializeWithAttachedContent();\n\n return sideSheetRef;\n }\n\n ngOnDestroy() {\n // Only close the side-sheets at this level on destroy\n // since the parent service may still be active.\n this._closeSideSheets(this._openSideSheetsAtThisLevel);\n this._afterAllClosedAtThisLevel.complete();\n this._afterOpenedAtThisLevel.complete();\n // Clean up any subscriptions to side-sheet that never finished opening.\n if (this._animationStateSubscriptions) {\n this._animationStateSubscriptions.unsubscribe();\n }\n }\n\n /**\n * Closes all of the currently-open side-sheets.\n */\n closeAll(): void {\n this._closeSideSheets(this.openSideSheets);\n }\n\n private _createOverlay<T>(config): OverlayRef {\n const overlayConfig = new OverlayConfig({\n positionStrategy: this._overlay.position().global(),\n scrollStrategy: this._overlay.scrollStrategies.block(),\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 });\n const overlayRef = this._overlay.create(overlayConfig);\n const positionStrategy = overlayRef.getConfig().positionStrategy as GlobalPositionStrategy;\n positionStrategy.right('0px');\n\n return overlayRef;\n }\n\n /**\n * Attaches a container to a side-sheets's already-created overlay.\n * @param overlay Reference to the side-sheet's underlying overlay.\n * @param config The side-sheet configuration.\n * @returns A promise resolving to a ComponentRef for the attached container.\n */\n private _attachSideSheetContainer(overlay: OverlayRef, config: CovalentSideSheetConfig): C {\n const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;\n const injector = Injector.create({\n parent: userInjector || this._injector,\n providers: [{ provide: CovalentSideSheetConfig, useValue: config }],\n });\n\n const containerPortal = new ComponentPortal(\n this._sideSheetContainerType,\n config.viewContainerRef,\n injector,\n config.componentFactoryResolver,\n );\n const containerRef = overlay.attach<C>(containerPortal);\n\n return containerRef.instance;\n }\n\n /**\n * Attaches the user-provided component to the already-created side sheet container.\n * @param componentOrTemplateRef The type of component being loaded into the side-sheet,\n * or a TemplateRef to instantiate as the content.\n * @param dialogContainer Reference to the wrapping side-sheet container.\n * @param overlayRef Reference to the overlay in which the side-sheet resides.\n * @param config The side-sheet configuration.\n * @returns A promise resolving to the CovalentSideSheetRef that should be returned to the user.\n */\n private _attachSideSheetContent<T, R>(\n componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n sideSheetContainer: C,\n overlayRef: OverlayRef,\n config: CovalentSideSheetConfig,\n ): CovalentSideSheetRef<T, R> {\n // Create a reference to the side-sheet we're creating in order to give the user a handle\n // to modify and close it.\n const sideSheetRef = new this._sideSheetRefConstructor(overlayRef, sideSheetContainer, config.id);\n\n if (componentOrTemplateRef instanceof TemplateRef) {\n sideSheetContainer.attachTemplatePortal(\n new TemplatePortal<T>(componentOrTemplateRef, null!, <any>{\n $implicit: config.data,\n sideSheetRef,\n }),\n );\n } else {\n const injector = this._createInjector<T>(config, sideSheetRef, sideSheetContainer);\n const contentRef = sideSheetContainer.attach<T>(\n new ComponentPortal(componentOrTemplateRef, config.viewContainerRef, injector),\n );\n sideSheetRef.componentInstance = contentRef.instance;\n }\n\n sideSheetRef.updateSize(config.width, config.height);\n\n return sideSheetRef;\n }\n\n private _createInjector<T>(\n config: CovalentSideSheetConfig,\n sideSheetRef: CovalentSideSheetRef<T>,\n sideSheetContainer: C,\n ): Injector {\n const userInjector = config && config.viewContainerRef && config.viewContainerRef.injector;\n\n // The side-sheet container should be provided as the side-sheet container and the side-sheet's\n // content are created out of the same `ViewContainerRef` and as such, are siblings\n // for injector purposes. To allow the hierarchy that is expected, the side-sheet\n // container is explicitly provided in the injector.\n const providers: StaticProvider[] = [\n { provide: this._sideSheetContainerType, useValue: sideSheetContainer },\n { provide: this._sideSheetDataToken, useValue: config.data },\n { provide: this._sideSheetRefConstructor, useValue: sideSheetRef },\n ];\n\n if (\n config.direction &&\n (!userInjector || !userInjector.get<Directionality | null>(Directionality, null, InjectFlags.Optional))\n ) {\n providers.push({\n provide: Directionality,\n useValue: { value: config.direction, change: of() },\n });\n }\n\n return Injector.create({ parent: userInjector || this._injector, providers });\n }\n\n /**\n * Removes a side sheet from the array of open side sheets.\n * @param sideSheetRef Side Sheet to be removed.\n */\n private _removeOpenSideSheet(sideSheetRef: CovalentSideSheetRef<unknown>) {\n const index = this.openSideSheets.indexOf(sideSheetRef);\n\n if (index > -1) {\n this.openSideSheets.splice(index, 1);\n }\n }\n\n /** Closes all of the side-sheet in an array. */\n private _closeSideSheets(sideSheets: CovalentSideSheetRef<any>[]) {\n let i = sideSheets.length;\n\n while (i--) {\n sideSheets[i].close();\n }\n }\n}\n\n/**\n * Service to open Covalent Design side-sheet.\n */\n@Injectable()\nexport class CovalentSideSheet extends _CovalentSideSheetBase<CovalentSideSheetContainer> {\n constructor(\n overlay: Overlay,\n injector: Injector,\n @Optional() @Inject(MAT_DIALOG_DEFAULT_OPTIONS) defaultOptions: CovalentSideSheetConfig,\n @Optional() @SkipSelf() parentSideSheet: CovalentSideSheet,\n ) {\n super(\n overlay,\n injector,\n defaultOptions,\n parentSideSheet,\n CovalentSideSheetRef,\n CovalentSideSheetContainer,\n MAT_DIALOG_DATA,\n );\n }\n}\n","/* tslint:disable */\nimport { Directive, Input, OnChanges, OnInit, Optional, SimpleChanges, ElementRef } from '@angular/core';\nimport { CovalentSideSheet } from './side-sheet';\nimport { _closeSideSheetVia, CovalentSideSheetRef } from './side-sheet-ref';\n\n/** Counter used to generate unique IDs for dialog elements. */\nlet dialogElementUid = 0;\n\n/**\n * Button that will close the current dialog.\n */\n@Directive({\n selector: '[td-side-sheet-close], [CovalentSideSheetClose]',\n exportAs: 'CovalentSideSheetClose',\n host: {\n '(click)': '_onButtonClick($event)',\n '[attr.aria-label]': 'ariaLabel || null',\n '[attr.type]': 'type',\n },\n})\nexport class CovalentSideSheetClose implements OnInit, OnChanges {\n /** Screenreader label for the button. */\n @Input('aria-label') ariaLabel: string;\n\n /** Default to \"button\" to prevents accidental form submits. */\n @Input() type: 'submit' | 'button' | 'reset' = 'button';\n\n /** Dialog close input. */\n @Input('td-side-sheet-close') dialogResult: any;\n\n @Input('CovalentSideSheetClose') _CovalentSideSheetClose: any;\n\n constructor(\n @Optional() public dialogRef: CovalentSideSheetRef<any>,\n private _elementRef: ElementRef<HTMLElement>,\n private _dialog: CovalentSideSheet,\n ) {}\n\n ngOnInit(): void {\n if (!this.dialogRef) {\n // When this directive is included in a dialog via TemplateRef (rather than being\n // in a Component), the DialogRef isn't available via injection because embedded\n // views cannot be given a custom injector. Instead, we look up the DialogRef by\n // ID. This must occur in `onInit`, as the ID binding for the dialog container won't\n // be resolved at constructor time.\n this.dialogRef = getClosestDialog(this._elementRef, this._dialog.openSideSheets)!;\n }\n }\n\n ngOnChanges(changes: SimpleChanges) {\n const proxiedChange = changes['_CovalentSideSheetClose'] || changes['_CovalentSideSheetCloseResult'];\n\n if (proxiedChange) {\n this.dialogResult = proxiedChange.currentValue;\n }\n }\n\n _onButtonClick(event: MouseEvent) {\n // Determinate the focus origin using the click event, because using the FocusMonitor will\n // result in incorrect origins. Most of the time, close buttons will be auto focused in the\n // dialog, and therefore clicking the button won't result in a focus change. This means that\n // the FocusMonitor won't detect any origin change, and will always output `program`.\n _closeSideSheetVia(\n this.dialogRef,\n event.screenX === 0 && event.screenY === 0 ? 'keyboard' : 'mouse',\n this.dialogResult,\n );\n }\n}\n\n/**\n * Title of a side sheet element. Stays fixed to the top of the side sheet when scrolling.\n */\n@Directive({\n selector: '[td-side-sheet-title], [CovalentSideSheetTitle]',\n exportAs: 'CovalentSideSheetTitle',\n host: {\n 'class': 'td-side-sheet-title',\n '[id]': 'id',\n },\n})\nexport class CovalentSideSheetTitle implements OnInit {\n /** Unique id for the dialog title. If none is supplied, it will be auto-generated. */\n @Input() id: string = `td-side-sheet-title-${dialogElementUid++}`;\n\n constructor(\n // The dialog title directive is always used in combination with a `CovalentSideSheetRef`.\n // tslint:disable-next-line: lightweight-tokens\n @Optional() private _dialogRef: CovalentSideSheetRef<any>,\n private _elementRef: ElementRef<HTMLElement>,\n private _dialog: CovalentSideSheet,\n ) {}\n\n ngOnInit(): void {\n if (this._dialogRef) {\n Promise.resolve().then(() => {\n const container = this._dialogRef._containerInstance;\n\n if (container && !container._ariaLabelledBy) {\n container._ariaLabelledBy = this.id;\n }\n });\n } else {\n this._dialogRef = getClosestDialog(this._elementRef, this._dialog.openSideSheets)!;\n }\n }\n}\n\n/**\n * Scrollable content container of a dialog.\n */\n@Directive({\n selector: `[td-side-sheet-content], td-side-sheet-content, [CovalentSideSheetContent]`,\n host: { class: 'td-side-sheet-content' },\n})\nexport class CovalentSideSheetContent {}\n\n/**\n * Container for the bottom action buttons in a dialog.\n * Stays fixed to the bottom when scrolling.\n */\n@Directive({\n selector: `[td-side-sheet-actions], td-side-sheet-actions, [CovalentSideSheetActions]`,\n host: { class: 'td-side-sheet-actions' },\n})\nexport class CovalentSideSheetActions {}\n\n/**\n * Container for the wrapper part of the dialog\n */\n@Directive({\n selector: `[td-side-sheet-wrapper], td-side-sheet-wrapper, [CovalentSideSheetWrapper]`,\n host: { class: 'td-side-sheet-wrapper' },\n})\nexport class CovalentSideSheetWrapper {}\n\n/**\n * Finds the closest CovalentSideSheetRef to an element by looking at the DOM.\n * @param element Element relative to which to look for a dialog.\n * @param openDialogs References to the currently-open dialogs.\n */\nfunction getClosestDialog(element: ElementRef<HTMLElement>, openDialogs: CovalentSideSheetRef<any>[]) {\n let parent: HTMLElement | null = element.nativeElement.parentElement;\n\n while (parent && !parent.classList.contains('td-side-sheet-container')) {\n parent = parent.parentElement;\n }\n\n return parent ? openDialogs.find((dialog) => dialog.id === parent!.id) : null;\n}\n","import { NgModule } from '@angular/core';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { MatCommonModule } from '@angular/material/core';\nimport { MatDialogModule } from '@angular/material/dialog';\n\nimport { CovalentSideSheet } from './side-sheet';\nimport { CovalentSideSheetContainer } from './side-sheet-container';\nimport {\n CovalentSideSheetActions,\n CovalentSideSheetClose,\n CovalentSideSheetContent,\n CovalentSideSheetTitle,\n CovalentSideSheetWrapper,\n} from './side-sheet.content-directives';\n\n@NgModule({\n declarations: [\n CovalentSideSheetContainer,\n CovalentSideSheetActions,\n CovalentSideSheetClose,\n CovalentSideSheetContent,\n CovalentSideSheetTitle,\n CovalentSideSheetWrapper,\n ],\n exports: [\n CovalentSideSheetActions,\n CovalentSideSheetClose,\n CovalentSideSheetContent,\n CovalentSideSheetTitle,\n CovalentSideSheetWrapper,\n ],\n imports: [PortalModule, MatDialogModule, MatCommonModule],\n providers: [CovalentSideShe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