{"version":3,"file":"ngwr-drawer.mjs","sources":["../../../projects/lib/drawer/drawer.ts","../../../projects/lib/drawer/drawer.html","../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/directives/drawer-content.ts","../../../projects/lib/drawer/directives/drawer-footer.ts","../../../projects/lib/drawer/directives/drawer-close.ts","../../../projects/lib/drawer/ngwr-drawer.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n  Component,\n  DestroyRef,\n  PLATFORM_ID,\n  TemplateRef,\n  ViewContainerRef,\n  ViewEncapsulation,\n  effect,\n  inject,\n  input,\n  model,\n  viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY } from 'ngwr/overlay';\n\nimport type { WrDrawerPosition } from './interfaces';\n\n/**\n * Side panel that slides in from an edge of the viewport. Two-way binds\n * `open` and renders into a CDK overlay so it sits above page content.\n *\n * Compose the body with `<wrDrawerTitle>`, `<wrDrawerContent>`, and\n * `<wrDrawerFooter>` directives.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"settingsOpen\" position=\"right\" width=\"24rem\">\n *   <h2 wrDrawerTitle>Settings</h2>\n *   <div wrDrawerContent>...</div>\n *   <div wrDrawerFooter>\n *     <wr-btn wrDrawerClose>Close</wr-btn>\n *   </div>\n * </wr-drawer>\n * ```\n *\n * @see https://ngwr.dev/components/drawer\n */\n@Component({\n  selector: 'wr-drawer',\n  templateUrl: './drawer.html',\n  encapsulation: ViewEncapsulation.None,\n  host: { style: 'display:none' },\n})\nexport class WrDrawer {\n  /** Two-way bindable open state. */\n  readonly open = model<boolean>(false);\n\n  /** Side the drawer slides in from. @default 'right' */\n  readonly position = input<WrDrawerPosition>('right');\n\n  /** Width when position is left/right. Any CSS length. @default '20rem' */\n  readonly width = input<string>('20rem');\n\n  /** Height when position is top/bottom. Any CSS length. @default '16rem' */\n  readonly height = input<string>('16rem');\n\n  /**\n   * Upper cap on height (top/bottom positions). Useful for bottom sheets\n   * that should grow with content up to a viewport-relative max.\n   * Any CSS length. @default null (no cap)\n   */\n  readonly maxHeight = input<string | null>(null);\n\n  /**\n   * Round the leading corners — the edge facing the viewport interior.\n   * Common bottom-sheet styling. @default false\n   */\n  readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n  /**\n   * Render a grab handle at the leading edge and enable swipe-to-dismiss:\n   * drag the handle toward the drawer's edge (down for `bottom`, left for\n   * `left`, …) and release past ~30% of the panel to close. @default false\n   */\n  readonly showHandle = input(false, { transform: coerceBooleanProperty });\n\n  /**\n   * Pad the trailing edge with `env(safe-area-inset-*)` so content\n   * doesn't sit under the iOS home indicator. @default false\n   */\n  readonly safeArea = input(false, { transform: coerceBooleanProperty });\n\n  /** Show the dimming backdrop. @default true */\n  readonly hasBackdrop = input(true, { transform: coerceBooleanProperty });\n\n  /** Close when the backdrop is clicked. @default true */\n  readonly closeOnBackdropClick = input(true, { transform: coerceBooleanProperty });\n\n  /** Close on Escape. @default true */\n  readonly closeOnEscape = input(true, { transform: coerceBooleanProperty });\n\n  protected readonly panelTpl = viewChild.required(TemplateRef);\n\n  protected panelClass(): string {\n    const parts = ['wr-drawer__panel', `wr-drawer__panel--${this.position()}`];\n    if (this.rounded()) parts.push('wr-drawer__panel--rounded');\n    if (this.safeArea()) parts.push('wr-drawer__panel--safe-area');\n    return parts.join(' ');\n  }\n\n  // Swipe-to-dismiss — gated to the grab handle, so it never fights the\n  // panel's own scrolling. The panel follows the finger toward the closing\n  // edge and closes past ~30% of its size, otherwise snaps back.\n\n  private swipeStartX = 0;\n  private swipeStartY = 0;\n  private swiping = false;\n\n  protected onSwipeStart(event: TouchEvent): void {\n    const touch = event.touches[0];\n    if (!touch) return;\n    this.swipeStartX = touch.clientX;\n    this.swipeStartY = touch.clientY;\n    this.swiping = true;\n  }\n\n  protected onSwipeMove(event: TouchEvent, panel: HTMLElement): void {\n    if (!this.swiping) return;\n    const touch = event.touches[0];\n    if (!touch) return;\n    const { axis, sign } = this.closeAxis();\n    const delta = axis === 'y' ? touch.clientY - this.swipeStartY : touch.clientX - this.swipeStartX;\n    // Only follow the finger when dragging toward the closing edge.\n    if (delta * sign <= 0) {\n      panel.style.transform = '';\n      return;\n    }\n    event.preventDefault();\n    panel.style.transition = 'none';\n    panel.style.transform = axis === 'y' ? `translateY(${delta}px)` : `translateX(${delta}px)`;\n  }\n\n  protected onSwipeEnd(event: TouchEvent, panel: HTMLElement): void {\n    if (!this.swiping) return;\n    this.swiping = false;\n    const touch = event.changedTouches[0];\n    const { axis, sign } = this.closeAxis();\n    const delta = touch ? (axis === 'y' ? touch.clientY - this.swipeStartY : touch.clientX - this.swipeStartX) : 0;\n    const panelSize = axis === 'y' ? panel.offsetHeight : panel.offsetWidth;\n    if (delta * sign > panelSize * 0.3) {\n      this.open.set(false); // keep the dragged offset as the overlay disposes\n    } else {\n      panel.style.transition = '';\n      panel.style.transform = '';\n    }\n  }\n\n  /** Axis + sign of the closing direction for the current position. */\n  private closeAxis(): { axis: 'x' | 'y'; sign: number } {\n    switch (this.position()) {\n      case 'bottom':\n        return { axis: 'y', sign: 1 };\n      case 'top':\n        return { axis: 'y', sign: -1 };\n      case 'left':\n        return { axis: 'x', sign: -1 };\n      case 'right':\n      default:\n        return { axis: 'x', sign: 1 };\n    }\n  }\n\n  private readonly overlay = inject(WR_OVERLAY);\n  private readonly vcr = inject(ViewContainerRef);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n  private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n  private overlayRef: OverlayRef | null = null;\n  private focusTrap: ConfigurableFocusTrap | null = null;\n  private previouslyFocused: HTMLElement | null = null;\n\n  constructor() {\n    effect(() => {\n      if (this.open()) {\n        this.openOverlay();\n      } else {\n        this.closeOverlay();\n      }\n    });\n    this.destroyRef.onDestroy(() => this.closeOverlay());\n  }\n\n  private openOverlay(): void {\n    if (this.overlayRef) return;\n\n    const pos = this.position();\n    const isHorizontal = pos === 'left' || pos === 'right';\n\n    const positionStrategy = this.overlay\n      .position()\n      .global()\n      [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n    if (pos === 'top') positionStrategy.top();\n    else if (pos === 'bottom') positionStrategy.bottom();\n    else positionStrategy.centerVertically();\n\n    const cap = this.maxHeight();\n\n    this.overlayRef = this.overlay.create({\n      positionStrategy,\n      hasBackdrop: this.hasBackdrop(),\n      backdropClass: 'wr-drawer-backdrop',\n      panelClass: ['wr-drawer-overlay', `wr-drawer-overlay--${pos}`],\n      scrollStrategy: this.overlay.scrollStrategies.block(),\n      width: isHorizontal ? this.width() : '100vw',\n      height: isHorizontal ? '100vh' : this.height(),\n      maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n    });\n\n    const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n    this.overlayRef.attach(portal);\n\n    if (this.isBrowser) {\n      const active = document.activeElement;\n      this.previouslyFocused = active instanceof HTMLElement ? active : null;\n      const host = this.overlayRef.overlayElement;\n      host.setAttribute('role', 'dialog');\n      host.setAttribute('aria-modal', 'true');\n      queueMicrotask(() => {\n        const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n        if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n      });\n      this.focusTrap = this.focusTrapFactory.create(host);\n      void this.focusTrap.focusInitialElementWhenReady();\n    }\n\n    if (this.closeOnBackdropClick()) {\n      this.overlayRef\n        .backdropClick()\n        .pipe(takeUntilDestroyed(this.destroyRef))\n        .subscribe(() => this.open.set(false));\n    }\n\n    if (this.closeOnEscape()) {\n      this.overlayRef\n        .keydownEvents()\n        .pipe(takeUntilDestroyed(this.destroyRef))\n        .subscribe(event => {\n          if (event.key === 'Escape') {\n            event.preventDefault();\n            this.open.set(false);\n          }\n        });\n    }\n  }\n\n  private closeOverlay(): void {\n    if (!this.overlayRef) return;\n    this.focusTrap?.destroy();\n    this.focusTrap = null;\n    const restore = this.previouslyFocused;\n    this.previouslyFocused = null;\n    this.overlayRef.dispose();\n    this.overlayRef = null;\n    if (restore && typeof restore.focus === 'function') {\n      restore.focus();\n    }\n  }\n}\n","<ng-template>\n  <div #panel [class]=\"panelClass()\">\n    @if (showHandle()) {\n      <div\n        class=\"wr-drawer__handle\"\n        aria-hidden=\"true\"\n        (touchstart)=\"onSwipeStart($event)\"\n        (touchmove)=\"onSwipeMove($event, panel)\"\n        (touchend)=\"onSwipeEnd($event, panel)\"\n        (touchcancel)=\"onSwipeEnd($event, panel)\"\n      >\n        <span class=\"wr-drawer__grabber\"></span>\n      </div>\n    }\n    <ng-content />\n  </div>\n</ng-template>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Marks an element as the drawer's title row. Applies the `wr-drawer__title`\n * class so the drawer's stylesheet can lay it out alongside content and\n * footer slots. Auto-assigns an `id` so the drawer panel references it via\n * `aria-labelledby`.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"open\">\n *   <h2 wrDrawerTitle>Settings</h2>\n *   <div wrDrawerContent>…</div>\n * </wr-drawer>\n * ```\n */\n@Directive({\n  selector: '[wrDrawerTitle]',\n  host: { class: 'wr-drawer__title', '[attr.id]': 'id' },\n})\nexport class WrDrawerTitle {\n  /** Generated id used by the drawer panel for `aria-labelledby`. */\n  readonly id = `wr-drawer-title-${++uid}`;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n/**\n * Marks the scrollable body of the drawer. Applies the `wr-drawer__content`\n * class so the panel's flex layout can stretch it between the title and the\n * footer.\n */\n@Directive({\n  selector: '[wrDrawerContent]',\n  host: { class: 'wr-drawer__content' },\n})\nexport class WrDrawerContent {}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, computed, input } from '@angular/core';\n\n/**\n * Marks the action row pinned to the bottom of the drawer. Adds the\n * `wr-drawer__footer` class plus an alignment modifier so action buttons\n * can sit at the start, center, or end of the row.\n *\n * @example\n * ```html\n * <div wrDrawerFooter align=\"end\">\n *   <wr-btn wrDrawerClose>Cancel</wr-btn>\n *   <wr-btn color=\"primary\" (click)=\"save()\">Save</wr-btn>\n * </div>\n * ```\n */\n@Directive({\n  selector: '[wrDrawerFooter]',\n  host: { '[class]': 'classes()' },\n})\nexport class WrDrawerFooter {\n  /** Horizontal alignment of footer content. @default 'end' */\n  readonly align = input<'start' | 'center' | 'end'>('end');\n\n  protected readonly classes = computed(() => `wr-drawer__footer wr-drawer__footer--${this.align()}`);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, inject } from '@angular/core';\n\nimport { WrDrawer } from '../drawer';\n\n/**\n * Closes the parent drawer on click. Attach to any clickable element.\n *\n * @example\n * ```html\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * ```\n */\n@Directive({\n  selector: '[wrDrawerClose]',\n  host: { '(click)': 'close()' },\n})\nexport class WrDrawerClose {\n  private readonly drawer = inject(WrDrawer, { optional: true });\n\n  protected close(): void {\n    this.drawer?.open.set(false);\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\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