UNPKG

@ng-matero/extensions

Version:
1 lines 31 kB
{"version":3,"file":"mtxDrawer.mjs","sources":["../../../projects/extensions/drawer/drawer-config.ts","../../../projects/extensions/drawer/drawer-container.ts","../../../projects/extensions/drawer/drawer-container.html","../../../projects/extensions/drawer/drawer-ref.ts","../../../projects/extensions/drawer/drawer.ts","../../../projects/extensions/drawer/drawer-module.ts","../../../projects/extensions/drawer/mtxDrawer.ts"],"sourcesContent":["import { Direction } from '@angular/cdk/bidi';\nimport { DialogRole } from '@angular/cdk/dialog';\nimport { ScrollStrategy } from '@angular/cdk/overlay';\nimport { ViewContainerRef } from '@angular/core';\n\n/** Options for where to set focus to automatically on dialog open. */\nexport type AutoFocusTarget = 'dialog' | 'first-tabbable' | 'first-heading';\n\n/** Possible overrides for a drawer's position. */\nexport type DrawerPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/**\n * Configuration used when opening a drawer.\n */\nexport class MtxDrawerConfig<D = any> {\n /** The view container to place the overlay for the drawer into. */\n viewContainerRef?: ViewContainerRef;\n\n /** ID for the drawer. If omitted, a unique one will be generated. */\n id?: string;\n\n /** The ARIA role of the dialog element. */\n role?: DialogRole = 'dialog';\n\n /** Extra CSS classes to be added to the drawer container. */\n panelClass?: string | string[];\n\n /** Text layout direction for the drawer. */\n direction?: Direction;\n\n /** Data being injected into the child component. */\n data?: D | null = null;\n\n /** Whether the drawer has a backdrop. */\n hasBackdrop?: boolean = true;\n\n /** Custom class for the backdrop. */\n backdropClass?: string;\n\n /** Whether the user can use escape or clicking outside to close the drawer. */\n disableClose?: boolean = false;\n\n /** Aria label to assign to the drawer element. */\n ariaLabel?: string | null = null;\n\n /**\n * Whether this is a modal dialog. Used to set the `aria-modal` attribute. Off by default,\n * because it can interfere with other overlay-based components (e.g. `mat-select`) and because\n * it is redundant since the dialog marks all outside content as `aria-hidden` anyway.\n */\n ariaModal?: boolean = false;\n\n /**\n * Whether the drawer should close when the user goes backwards/forwards in history.\n * Note that this usually doesn't include clicking on links (unless the user is using\n * the `HashLocationStrategy`).\n */\n closeOnNavigation?: boolean = true;\n\n /**\n * Where the drawer should focus on open.\n * @breaking-change 14.0.0 Remove boolean option from autoFocus. Use string or\n * AutoFocusTarget instead.\n */\n autoFocus?: AutoFocusTarget | string | boolean = 'first-tabbable';\n\n /**\n * Whether the drawer should restore focus to the\n * previously-focused element, after it's closed.\n */\n restoreFocus?: boolean = true;\n\n /** Scroll strategy to be used for the drawer. */\n scrollStrategy?: ScrollStrategy;\n\n /** Position of the drawer. */\n position?: DrawerPosition = 'right';\n\n /** Width of the drawer. */\n width?: string;\n\n /** Height of the drawer. */\n height?: string;\n\n /** Min-width of the drawer. If a number is provided, assumes pixel units. */\n minWidth?: number | string;\n\n /** Min-height of the drawer. If a number is provided, assumes pixel units. */\n minHeight?: number | string;\n\n /** Max-width of the drawer. If a number is provided, assumes pixel units. */\n maxWidth?: number | string;\n\n /** Max-height of the drawer. If a number is provided, assumes pixel units. */\n maxHeight?: number | string;\n}\n","import { CdkDialogContainer } from '@angular/cdk/dialog';\nimport { CdkPortalOutlet } from '@angular/cdk/portal';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n OnDestroy,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { _animationsDisabled } from '@angular/material/core';\nimport { MtxDrawerConfig } from './drawer-config';\n\nconst ENTER_ANIMATION = '_mtx-drawer-enter';\nconst EXIT_ANIMATION = '_mtx-drawer-exit';\n\n/**\n * Internal component that wraps user-provided drawer content.\n * @docs-private\n */\n@Component({\n selector: 'mtx-drawer-container',\n templateUrl: 'drawer-container.html',\n styleUrl: 'drawer-container.scss',\n // In Ivy embedded views will be change detected from their declaration place, rather than where\n // they were stamped out. This means that we can't have the drawer container be OnPush,\n // because it might cause the sheets that were opened from a template not to be out of date.\n changeDetection: ChangeDetectionStrategy.Default,\n encapsulation: ViewEncapsulation.None,\n host: {\n 'class': 'mtx-drawer-container',\n '[class]': '_drawerPosition',\n '[class.mtx-drawer-container-animations-enabled]': '!_animationsDisabled',\n '[class.mtx-drawer-container-enter]': '_animationState === \"visible\"',\n '[class.mtx-drawer-container-exit]': '_animationState === \"hidden\"',\n 'tabindex': '-1',\n '[id]': '_config.id',\n '[attr.role]': '_config.role',\n '[attr.aria-modal]': '_config.ariaModal',\n '[attr.aria-label]': '_config.ariaLabel',\n '(animationstart)': '_handleAnimationEvent(true, $event.animationName)',\n '(animationend)': '_handleAnimationEvent(false, $event.animationName)',\n '(animationcancel)': '_handleAnimationEvent(false, $event.animationName)',\n },\n imports: [CdkPortalOutlet],\n})\nexport class MtxDrawerContainer extends CdkDialogContainer<MtxDrawerConfig> implements OnDestroy {\n /** The portal outlet inside of this container into which the content will be loaded. */\n @ViewChild(CdkPortalOutlet, { static: true }) _portalOutlet!: CdkPortalOutlet;\n\n protected _animationsDisabled = _animationsDisabled();\n\n /** The state of the drawer animations. */\n _animationState: 'void' | 'visible' | 'hidden' = 'void';\n\n /** Emits whenever the state of the animation changes. */\n _animationStateChanged = new EventEmitter<{\n toState: 'visible' | 'hidden';\n phase: 'start' | 'done';\n }>();\n\n /** Whether the component has been destroyed. */\n private _destroyed = false;\n\n get _drawerPosition() {\n return `mtx-drawer-${this._config.position}`;\n }\n\n protected override _contentAttached(): void {\n // Delegate to the original dialog-container initialization (i.e. saving the\n // previous element, setting up the focus trap and moving focus to the container).\n super._contentAttached();\n\n this.enter();\n }\n\n /** Begin animation of bottom sheet entrance into view. */\n enter(): void {\n if (!this._destroyed) {\n this._animationState = 'visible';\n this._changeDetectorRef.markForCheck();\n this._changeDetectorRef.detectChanges();\n if (this._animationsDisabled) {\n this._simulateAnimation(ENTER_ANIMATION);\n }\n }\n }\n\n /** Begin animation of the bottom sheet exiting from view. */\n exit(): void {\n if (!this._destroyed) {\n this._animationState = 'hidden';\n this._changeDetectorRef.markForCheck();\n if (this._animationsDisabled) {\n this._simulateAnimation(EXIT_ANIMATION);\n }\n }\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n\n this._destroyed = true;\n }\n\n private _simulateAnimation(name: typeof ENTER_ANIMATION | typeof EXIT_ANIMATION) {\n this._ngZone.run(() => {\n this._handleAnimationEvent(true, name);\n setTimeout(() => this._handleAnimationEvent(false, name));\n });\n }\n\n protected _handleAnimationEvent(isStart: boolean, animationName: string) {\n const isEnter = animationName === ENTER_ANIMATION;\n const isExit = animationName === EXIT_ANIMATION;\n\n if (isEnter) {\n this._trapFocus();\n }\n\n if (isEnter || isExit) {\n this._animationStateChanged.emit({\n toState: isEnter ? 'visible' : 'hidden',\n phase: isStart ? 'start' : 'done',\n });\n }\n }\n\n protected override _captureInitialFocus(): void {}\n}\n","<ng-template cdkPortalOutlet></ng-template>\n","import { DialogRef } from '@angular/cdk/dialog';\nimport { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';\nimport { merge, Observable, Subject } from 'rxjs';\nimport { filter, take } from 'rxjs/operators';\nimport { MtxDrawerConfig } from './drawer-config';\nimport { MtxDrawerContainer } from './drawer-container';\nimport { ComponentRef } from '@angular/core';\n\n/**\n * Reference to a drawer dispatched from the drawer service.\n */\nexport class MtxDrawerRef<T = any, R = any> {\n /** Instance of the component making up the content of the drawer. */\n get instance(): T {\n return this._ref.componentInstance!;\n }\n\n /**\n * `ComponentRef` of the component opened into the drawer. Will be\n * null when the drawer is opened using a `TemplateRef`.\n */\n get componentRef(): ComponentRef<T> | null {\n return this._ref.componentRef;\n }\n\n /**\n * Instance of the component into which the drawer content is projected.\n * @docs-private\n */\n containerInstance: MtxDrawerContainer;\n\n /** Whether the user is allowed to close the drawer. */\n disableClose: boolean | undefined;\n\n /** Unique ID for the drawer. */\n id: string;\n\n /** Subject for notifying the user that the drawer has been dismissed. */\n private readonly _afterDismissed = new Subject<R | undefined>();\n\n /** Subject for notifying the user that the drawer has opened and appeared. */\n private readonly _afterOpened = new Subject<void>();\n\n /** Result to be passed down to the `afterDismissed` stream. */\n private _result: R | undefined;\n\n /** Handle to the timeout that's running as a fallback in case the exit animation doesn't fire. */\n private _closeFallbackTimeout: any;\n\n constructor(\n private _ref: DialogRef<R, T>,\n config: MtxDrawerConfig,\n containerInstance: MtxDrawerContainer\n ) {\n this.containerInstance = containerInstance;\n this.disableClose = config.disableClose;\n this.id = _ref.id;\n\n // Emit when opening animation completes\n containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'done' && event.toState === 'visible'),\n take(1)\n )\n .subscribe(() => {\n this._afterOpened.next();\n this._afterOpened.complete();\n });\n\n // Dispose overlay when closing animation is complete\n containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'done' && event.toState === 'hidden'),\n take(1)\n )\n .subscribe(() => {\n clearTimeout(this._closeFallbackTimeout);\n this._ref.close(this._result);\n });\n\n _ref.overlayRef.detachments().subscribe(() => {\n this._ref.close(this._result);\n });\n\n merge(\n this.backdropClick(),\n this.keydownEvents().pipe(filter(event => event.keyCode === ESCAPE))\n ).subscribe(event => {\n if (\n !this.disableClose &&\n (event.type !== 'keydown' || !hasModifierKey(event as KeyboardEvent))\n ) {\n event.preventDefault();\n this.dismiss();\n }\n });\n }\n\n /**\n * Dismisses the drawer.\n * @param result Data to be passed back to the drawer opener.\n */\n dismiss(result?: R): void {\n if (this.containerInstance && !this._afterDismissed.closed) {\n // Transition the backdrop in parallel to the drawer.\n this.containerInstance._animationStateChanged\n .pipe(\n filter(event => event.phase === 'start'),\n take(1)\n )\n .subscribe(event => {\n // The logic that disposes of the overlay depends on the exit animation completing, however\n // it isn't guaranteed if the parent view is destroyed while it's running. Add a fallback\n // timeout which will clean everything up if the animation hasn't fired within the specified\n // amount of time plus 100ms. We don't need to run this outside the NgZone, because for the\n // vast majority of cases the timeout will have been cleared before it has fired.\n\n this._closeFallbackTimeout = setTimeout(() => this._ref.close(this._result), 500);\n this._ref.overlayRef.detachBackdrop();\n });\n\n this._result = result;\n this.containerInstance.exit();\n this.containerInstance = null!;\n }\n }\n\n /** Gets an observable that is notified when the drawer is finished closing. */\n afterDismissed(): Observable<R | undefined> {\n return this._ref.closed;\n }\n\n /** Gets an observable that is notified when the drawer has opened and appeared. */\n afterOpened(): Observable<void> {\n return this._afterOpened;\n }\n\n /**\n * Gets an observable that emits when the overlay's backdrop has been clicked.\n */\n backdropClick(): Observable<MouseEvent> {\n return this._ref.backdropClick;\n }\n\n /**\n * Gets an observable that emits when keydown events are targeted on the overlay.\n */\n keydownEvents(): Observable<KeyboardEvent> {\n return this._ref.keydownEvents;\n }\n}\n","import { coerceCssPixelValue } from '@angular/cdk/coercion';\nimport { Dialog, DialogConfig } from '@angular/cdk/dialog';\nimport { Overlay } from '@angular/cdk/overlay';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { inject, Injectable, InjectionToken, OnDestroy, TemplateRef } from '@angular/core';\nimport { defer, Observable, Subject } from 'rxjs';\nimport { startWith } from 'rxjs/operators';\nimport { MtxDrawerConfig } from './drawer-config';\nimport { MtxDrawerContainer } from './drawer-container';\nimport { MtxDrawerRef } from './drawer-ref';\n\n/** Injection token that can be used to access the data that was passed in to a drawer. */\nexport const MTX_DRAWER_DATA = new InjectionToken<any>('MtxDrawerData');\n\n/** Injection token that can be used to specify default drawer options. */\nexport const MTX_DRAWER_DEFAULT_OPTIONS = new InjectionToken<MtxDrawerConfig>(\n 'mtx-drawer-default-options'\n);\n\n// Counter for unique drawer ids.\nlet uniqueId = 0;\n\n/**\n * Service to trigger Material Design bottom sheets.\n */\n@Injectable({ providedIn: 'root' })\nexport class MtxDrawer implements OnDestroy {\n private _overlay = inject(Overlay);\n private _parentDrawer = inject(MtxDrawer, { optional: true, skipSelf: true });\n private _defaultOptions = inject<MtxDrawerConfig>(MTX_DRAWER_DEFAULT_OPTIONS, { optional: true });\n\n private readonly _openDrawersAtThisLevel: MtxDrawerRef<any>[] = [];\n private readonly _afterAllDismissedAtThisLevel = new Subject<void>();\n private readonly _afterOpenedAtThisLevel = new Subject<MtxDrawerRef<any>>();\n private _dialog = inject(Dialog);\n\n /** Keeps track of the currently-open dialogs. */\n get openDrawers(): MtxDrawerRef<any>[] {\n return this._parentDrawer ? this._parentDrawer.openDrawers : this._openDrawersAtThisLevel;\n }\n\n /** Stream that emits when a drawer has been opened. */\n get afterOpened(): Subject<MtxDrawerRef<any>> {\n return this._parentDrawer ? this._parentDrawer.afterOpened : this._afterOpenedAtThisLevel;\n }\n\n private _getAfterAllDismissed(): Subject<void> {\n const parent = this._parentDrawer;\n return parent ? parent._getAfterAllDismissed() : this._afterAllDismissedAtThisLevel;\n }\n\n /**\n * Stream that emits when all open drawer have finished closing.\n * Will emit on subscribe if there are no open drawers to begin with.\n */\n readonly afterAllDismissed: Observable<void> = defer(() =>\n this.openDrawers.length\n ? this._getAfterAllDismissed()\n : this._getAfterAllDismissed().pipe(startWith(undefined))\n ) as Observable<any>;\n\n /**\n * Opens a drawer containing the given component.\n * @param component Type of the component to load into the drawer.\n * @param config Extra configuration options.\n * @returns Reference to the newly-opened drawer.\n */\n open<T, D = any, R = any>(\n component: ComponentType<T>,\n config?: MtxDrawerConfig<D>\n ): MtxDrawerRef<T, R>;\n\n /**\n * Opens a drawer containing the given template.\n * @param template TemplateRef to instantiate as the drawer content.\n * @param config Extra configuration options.\n * @returns Reference to the newly-opened drawer.\n */\n open<T, D = any, R = any>(\n template: TemplateRef<T>,\n config?: MtxDrawerConfig<D>\n ): MtxDrawerRef<T, R>;\n\n open<T, D = any, R = any>(\n componentOrTemplateRef: ComponentType<T> | TemplateRef<T>,\n config?: MtxDrawerConfig<D>\n ): MtxDrawerRef<T, R> {\n let drawerRef!: MtxDrawerRef<T, R>;\n\n const _config = { ...(this._defaultOptions || new MtxDrawerConfig()), ...config };\n _config.id = _config.id || `mtx-drawer-${uniqueId++}`;\n\n _config.width =\n _config.position === 'left' || _config.position === 'right'\n ? coerceCssPixelValue(_config.width)\n : '100vw';\n\n _config.height =\n _config.position === 'top' || _config.position === 'bottom'\n ? coerceCssPixelValue(_config.height)\n : '100vh';\n\n this._dialog.open<R, D, T>(componentOrTemplateRef, {\n ..._config,\n // Disable closing since we need to sync it up to the animation ourselves.\n disableClose: true,\n // Disable closing on detachments so that we can sync up the animation.\n closeOnOverlayDetachments: false,\n container: {\n type: MtxDrawerContainer,\n providers: () => [\n // Provide our config as the CDK config as well since it has the same interface as the\n // CDK one, but it contains the actual values passed in by the user for things like\n // `disableClose` which we disable for the CDK dialog since we handle it ourselves.\n { provide: MtxDrawerConfig, useValue: _config },\n { provide: DialogConfig, useValue: _config },\n ],\n },\n scrollStrategy: _config.scrollStrategy || this._overlay.scrollStrategies.block(),\n positionStrategy: this._overlay.position().global()[_config.position!]('0'),\n templateContext: () => ({ drawerRef }),\n providers: (cdkRef, _cdkConfig, container) => {\n drawerRef = new MtxDrawerRef(cdkRef, _config, container as MtxDrawerContainer);\n return [\n { provide: MtxDrawerRef, useValue: drawerRef },\n { provide: MTX_DRAWER_DATA, useValue: _config.data },\n ];\n },\n });\n\n this.openDrawers.push(drawerRef);\n this.afterOpened.next(drawerRef);\n\n drawerRef.afterDismissed().subscribe(() => {\n const index = this.openDrawers.indexOf(drawerRef);\n\n if (index > -1) {\n this.openDrawers.splice(index, 1);\n\n if (!this.openDrawers.length) {\n this._getAfterAllDismissed().next();\n }\n }\n });\n\n return drawerRef;\n }\n\n /**\n * Dismisses all of the currently-open drawers.\n */\n dismissAll(): void {\n this._dismissDrawers(this.openDrawers);\n }\n\n /**\n * Finds an open drawer by its id.\n * @param id ID to use when looking up the drawer.\n */\n getDrawerById(id: string): MtxDrawerRef<any> | undefined {\n return this.openDrawers.find(drawer => drawer.id === id);\n }\n\n ngOnDestroy() {\n // Only dismiss the drawers at this level on destroy\n // since the parent service may still be active.\n this._dismissDrawers(this._openDrawersAtThisLevel);\n this._afterAllDismissedAtThisLevel.complete();\n this._afterOpenedAtThisLevel.complete();\n }\n\n private _dismissDrawers(drawers: MtxDrawerRef<any>[]) {\n let i = drawers.length;\n\n while (i--) {\n drawers[i].dismiss();\n }\n }\n}\n","import { BidiModule } from '@angular/cdk/bidi';\nimport { DialogModule } from '@angular/cdk/dialog';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { NgModule } from '@angular/core';\nimport { MtxDrawer } from './drawer';\nimport { MtxDrawerContainer } from './drawer-container';\n\n@NgModule({\n imports: [DialogModule, PortalModule, MtxDrawerContainer],\n exports: [MtxDrawerContainer, BidiModule],\n providers: [MtxDrawer],\n})\nexport class MtxDrawerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAWA;;AAEG;MACU,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;;QAQE,IAAA,CAAA,IAAI,GAAgB,QAAQ;;QAS5B,IAAA,CAAA,IAAI,GAAc,IAAI;;QAGtB,IAAA,CAAA,WAAW,GAAa,IAAI;;QAM5B,IAAA,CAAA,YAAY,GAAa,KAAK;;QAG9B,IAAA,CAAA,SAAS,GAAmB,IAAI;AAEhC;;;;AAIG;QACH,IAAA,CAAA,SAAS,GAAa,KAAK;AAE3B;;;;AAIG;QACH,IAAA,CAAA,iBAAiB,GAAa,IAAI;AAElC;;;;AAIG;QACH,IAAA,CAAA,SAAS,GAAwC,gBAAgB;AAEjE;;;AAGG;QACH,IAAA,CAAA,YAAY,GAAa,IAAI;;QAM7B,IAAA,CAAA,QAAQ,GAAoB,OAAO;IAmBrC;AAAC;;AClFD,MAAM,eAAe,GAAG,mBAAmB;AAC3C,MAAM,cAAc,GAAG,kBAAkB;AAEzC;;;AAGG;AA2BG,MAAO,kBAAmB,SAAQ,kBAAmC,CAAA;AA1B3E,IAAA,WAAA,GAAA;;QA8BY,IAAA,CAAA,mBAAmB,GAAG,mBAAmB,EAAE;;QAGrD,IAAA,CAAA,eAAe,GAAkC,MAAM;;AAGvD,QAAA,IAAA,CAAA,sBAAsB,GAAG,IAAI,YAAY,EAGrC;;QAGI,IAAA,CAAA,UAAU,GAAG,KAAK;AAmE3B,IAAA;AAjEC,IAAA,IAAI,eAAe,GAAA;AACjB,QAAA,OAAO,cAAc,IAA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