ngwr 14.4.0 → 14.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -6
- package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +15 -3
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +18 -2
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +35 -3
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +30 -2
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +12 -1
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +2 -2
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +48 -2
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +22 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +243 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -0
- package/fesm2022/ngwr-graph.mjs +1112 -0
- package/fesm2022/ngwr-graph.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-ar.mjs +5 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +5 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +5 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +25 -5
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +5 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +5 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +5 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +5 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +5 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +5 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +5 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +5 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +5 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +5 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +5 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +5 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +5 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +5 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +5 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +5 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-TW.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +5 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +13 -0
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +25 -4
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +2 -2
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +18 -2
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +119 -4
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +19 -3
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +22 -5
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +215 -27
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +34 -1
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +15 -1
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +10 -2
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +19 -2
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +20 -6
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +9 -2
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +18 -1
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/graph/styles/_index.scss +113 -0
- package/i18n/ar.json +5 -0
- package/i18n/cs.json +5 -0
- package/i18n/de.json +5 -0
- package/i18n/en.json +5 -0
- package/i18n/es.json +5 -0
- package/i18n/fr.json +5 -0
- package/i18n/he.json +5 -0
- package/i18n/hi.json +5 -0
- package/i18n/id.json +5 -0
- package/i18n/it.json +5 -0
- package/i18n/ja.json +5 -0
- package/i18n/ko.json +5 -0
- package/i18n/nl.json +5 -0
- package/i18n/pl.json +5 -0
- package/i18n/pt.json +5 -0
- package/i18n/ru.json +5 -0
- package/i18n/sv.json +5 -0
- package/i18n/tr.json +5 -0
- package/i18n/uk.json +5 -0
- package/i18n/vi.json +5 -0
- package/i18n/zh-TW.json +5 -0
- package/i18n/zh.json +5 -0
- package/llms-full.txt +13 -3
- package/llms.txt +20 -9
- package/mcp/providers.js +8 -2
- package/package.json +10 -1
- package/schematics/migrations/v14/index.js +90 -34
- package/schematics/migrations/v7/index.js +15 -4
- package/schematics/migrations/v8/index.js +13 -2
- package/schematics/migrations/v9/index.js +19 -10
- package/schematics/use/symbol-map.json +2 -0
- package/segmented/styles/_index.scss +8 -0
- package/skills/ngwr/SKILL.md +10 -5
- package/skills/ngwr/references/catalog.md +2 -0
- package/skills/ngwr/references/setup.md +2 -2
- package/styles.scss +1 -0
- package/table/styles/_index.scss +39 -12
- package/theme/styles/_focus.scss +7 -0
- package/types/ngwr-cascader.d.ts +7 -0
- package/types/ngwr-color-picker.d.ts +8 -0
- package/types/ngwr-context-menu.d.ts +10 -0
- package/types/ngwr-date-picker.d.ts +16 -0
- package/types/ngwr-dialog.d.ts +1 -0
- package/types/ngwr-drawer.d.ts +28 -0
- package/types/ngwr-dropdown.d.ts +9 -0
- package/types/ngwr-graph-testing.d.ts +190 -0
- package/types/ngwr-graph.d.ts +203 -0
- package/types/ngwr-i18n-en.d.ts +16 -5
- package/types/ngwr-i18n.d.ts +13 -0
- package/types/ngwr-lightbox.d.ts +15 -0
- package/types/ngwr-mention.d.ts +7 -0
- package/types/ngwr-overlay.d.ts +62 -4
- package/types/ngwr-popconfirm.d.ts +1 -0
- package/types/ngwr-popover-testing.d.ts +22 -5
- package/types/ngwr-popover.d.ts +28 -8
- package/types/ngwr-segmented.d.ts +16 -0
- package/types/ngwr-select.d.ts +7 -0
- package/types/ngwr-table.d.ts +8 -0
- package/types/ngwr-toast.d.ts +2 -0
- package/types/ngwr-tour.d.ts +6 -0
- package/types/ngwr-tree.d.ts +2 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-drawer.mjs","sources":["../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/drawer.ts","../../../projects/lib/drawer/drawer.html","../../../projects/lib/drawer/drawer-ref.ts","../../../projects/lib/drawer/tokens/drawer-data.token.ts","../../../projects/lib/drawer/tokens/drawer-ref.token.ts","../../../projects/lib/drawer/drawer-manager.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 { 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 { 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 afterEveryRender,\n contentChild,\n effect,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY } from 'ngwr/overlay';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\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/reference/components/drawer\n */\n@Component({\n selector: 'wr-drawer',\n templateUrl: './drawer.html',\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\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 /**\n * Show a dismiss (×) button in the panel's top-right corner. Set `false` when\n * the projected content supplies its own close affordance. @default true\n */\n readonly closable = input(true, { transform: coerceBooleanProperty });\n\n /** Accessible name for the dismiss button. Falls back to `drawer.close`. */\n readonly closeLabel = input<string | null>(null);\n\n protected readonly resolvedCloseLabel = useI18nText(this.closeLabel, 'drawer.close', 'Close drawer');\n\n protected readonly panelTpl = viewChild.required(TemplateRef);\n\n /**\n * A projected `[wrDrawerTitle]`, if the consumer gave one.\n *\n * The dismiss button is corner chrome positioned at a fixed\n * `inset-block-start` chosen to centre it on the TITLE's first line. With no\n * title the content starts at the top of the panel and runs underneath it: on\n * a bare `<wr-drawer><nav /></wr-drawer>` the button covered the first menu\n * row by 24×16 px, and `elementFromPoint` at the button's centre returned the\n * button, so that corner of the first item was unclickable. The panel has to\n * know, because only the panel can reserve the space.\n */\n private readonly projectedTitle = contentChild(WrDrawerTitle);\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 if (this.closable()) parts.push('wr-drawer__panel--closable');\n // The handle sits on the LEADING edge, which for `left` / `right` is a\n // vertical rail rather than a row in the column — so it leaves the flow and\n // the panel has to reserve the gutter it floats over. Only the panel can do\n // that, and only if it knows the handle is there.\n if (this.showHandle()) parts.push('wr-drawer__panel--handle');\n // Only when there is something to collide with: a closable drawer with a\n // title already clears the button, and an unclosable one has no button.\n if (this.closable() && !this.projectedTitle()) parts.push('wr-drawer__panel--untitled');\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 // Pointer, not Touch. The handle has always advertised itself to a mouse with\n // `cursor: grab`, but the gesture was bound to touch events only, so on a\n // desktop it could not be dragged at all. Pointer Events cover touch, mouse and\n // pen through one path — the same idiom `wr-splitter` already uses.\n\n protected onSwipeStart(event: PointerEvent): void {\n // Ignore secondary contacts of a multi-touch gesture.\n if (!event.isPrimary) return;\n this.swipeStartX = event.clientX;\n this.swipeStartY = event.clientY;\n this.swiping = true;\n // Capture, so the drag keeps reporting once the cursor leaves the 2.5rem\n // grabber — without it a mouse drag dies the moment it slips off the handle.\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n protected onSwipeMove(event: PointerEvent, panel: HTMLElement): void {\n if (!this.swiping) return;\n const { axis, sign } = this.closeAxis();\n const delta = axis === 'y' ? event.clientY - this.swipeStartY : event.clientX - this.swipeStartX;\n // Only follow the pointer when dragging toward the closing edge.\n if (delta * sign <= 0) {\n panel.style.transform = '';\n return;\n }\n panel.style.transition = 'none';\n panel.style.transform = axis === 'y' ? `translateY(${delta}px)` : `translateX(${delta}px)`;\n }\n\n /**\n * A cancelled pointer is an ABANDONED swipe, not a completed one — the system\n * took the gesture away (a call, a system gesture, an orientation change) and\n * no `pointerup` ever arrives. Routing it through `onSwipeEnd` dismissed the\n * drawer on an interruption the user did not ask for and, because the overlay\n * is disposed with the dragged offset applied, could not take back. Same rule\n * `wr-pull-to-refresh` states for `touchcancel`.\n */\n protected onSwipeCancel(panel: HTMLElement): void {\n if (!this.swiping) return;\n this.swiping = false;\n panel.style.transition = '';\n panel.style.transform = '';\n }\n\n protected onSwipeEnd(event: PointerEvent, panel: HTMLElement): void {\n if (!this.swiping) return;\n this.swiping = false;\n const { axis, sign } = this.closeAxis();\n const delta = axis === 'y' ? event.clientY - this.swipeStartY : event.clientX - this.swipeStartX;\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 afterEveryRender(() => this.syncLabel());\n this.destroyRef.onDestroy(() => this.closeOverlay());\n }\n\n /**\n * Point the panel's `aria-labelledby` at the CURRENT `[wrDrawerTitle]`.\n *\n * Re-resolved after every render rather than once when the drawer opens,\n * because the title element is projected content and can come and go while\n * the drawer stays open — an `@if` around it, or a heading that only exists\n * once the data arrives. A one-shot lookup leaves the attribute naming an\n * element that has been removed or replaced, and a dangling reference is not\n * a name: the dialog is announced as unnamed, with nothing on screen to say\n * so. A missing title clears the attribute for the same reason.\n */\n private syncLabel(): void {\n const host = this.overlayRef?.overlayElement;\n if (!host) return;\n\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\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 ? undefined : 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 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 (pointerdown)=\"onSwipeStart($event)\"\n (pointermove)=\"onSwipeMove($event, panel)\"\n (pointerup)=\"onSwipeEnd($event, panel)\"\n (pointercancel)=\"onSwipeCancel(panel)\"\n >\n <span class=\"wr-drawer__grabber\"></span>\n </div>\n }\n @if (closable()) {\n <button type=\"button\" class=\"wr-drawer__close\" [attr.aria-label]=\"resolvedCloseLabel()\" (click)=\"open.set(false)\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\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 type { ConfigurableFocusTrap } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\n/**\n * Handle returned by `WrDrawerManager.open()`.\n *\n * Wraps the underlying `OverlayRef` and tracks the close result. It is also\n * provided inside the drawer's own injector, so the projected content can\n * inject it and close itself — the counterpart to `[wrDrawerClose]` when the\n * close is programmatic (after a save succeeds, say) rather than a click.\n *\n * @example\n * ```ts\n * // Caller side.\n * const ref = drawers.open<ChatComponent, boolean>(ChatComponent, { position: 'right' });\n * const result = await ref.awaitClose(); // boolean | undefined\n * ```\n *\n * @example\n * ```ts\n * // Content side — the drawer closes itself.\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject(WrDrawerRef);\n *\n * send(): void {\n * this.store.send(this.draft());\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport class WrDrawerRef<C, R = unknown> {\n /**\n * Emits the close result once and completes.\n *\n * A `ReplaySubject`, not a plain `Subject`, so the result survives a late\n * subscriber: content can close itself before `open()` has even returned, and\n * `awaitClose()` may be called long after the dismissal — both would otherwise\n * see only `complete` and resolve `undefined`.\n */\n readonly closed = new ReplaySubject<R | undefined>(1);\n\n /** @internal */\n componentRef: ComponentRef<C> | null = null;\n\n /** @internal */\n focusTrap: ConfigurableFocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n constructor(private readonly _overlayRef: OverlayRef) {}\n\n /** The instantiated drawer component. */\n get componentInstance(): C {\n if (!this.componentRef) {\n throw new Error('WrDrawerRef: component not yet attached');\n }\n return this.componentRef.instance;\n }\n\n private isClosed = false;\n\n /** Close the drawer, optionally returning a result. */\n close(result?: R): void {\n if (this.isClosed) return;\n this.isClosed = true;\n this.closed.next(result);\n this.closed.complete();\n // Content that closes itself while constructing gets here with\n // `OverlayRef.attach()` still on the stack — `componentRef` is assigned\n // only once attach returns. Disposing mid-attach leaves the CDK writing to\n // a detached host, so let the current task finish first.\n if (!this.componentRef) {\n queueMicrotask(() => this.teardown());\n return;\n }\n this.teardown();\n }\n\n private teardown(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this._overlayRef.dispose();\n // Drop the destroyed component so a retained ref doesn't pin its instance,\n // host element and view in memory.\n this.componentRef = null;\n // Restore focus after disposal so the trigger is reachable again.\n if (restore && typeof restore.focus === 'function') {\n restore.focus();\n }\n }\n\n /** Resolves with the close result when the drawer is dismissed. */\n awaitClose(): Promise<R | undefined> {\n return new Promise(resolve => {\n this.closed.subscribe({\n next: value => resolve(value),\n complete: () => resolve(undefined),\n });\n });\n }\n\n /** Underlying overlay ref — escape hatch for advanced cases. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\n }\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 { InjectionToken } from '@angular/core';\n\n/**\n * Token that exposes the `data` payload passed to `WrDrawerManager.open()`.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * readonly data = inject<ChatData>(WR_DRAWER_DATA);\n * }\n * ```\n */\nexport const WR_DRAWER_DATA = new InjectionToken<unknown>('WR_DRAWER_DATA');\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 { InjectionToken } from '@angular/core';\n\nimport type { WrDrawerRef } from '../drawer-ref';\n\n/**\n * Token exposing the open drawer's `WrDrawerRef` to components and\n * directives rendered inside it (e.g. `[wrDrawerClose]`).\n *\n * **Prefer `inject(WrDrawerRef)`** — the ref is provided under the class token\n * too, and the class path is the documented one. It already covers both cases\n * you might reach for a token for: `inject(WrDrawerRef, { optional: true })`\n * works for content that also renders outside a drawer, and\n * `inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef)` types the generics\n * without a cast.\n *\n * This token is the same object under a second key. It exists for the library's\n * own directives (`[wrDrawerClose]`) and for swapping the provider out — a test\n * stub, say — without touching the class.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef);\n *\n * dismiss(): void {\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport const WR_DRAWER_REF = new InjectionToken<WrDrawerRef<unknown, unknown>>('WR_DRAWER_REF');\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 { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal, type ComponentType } from '@angular/cdk/portal';\nimport { Location, isPlatformBrowser } from '@angular/common';\nimport { EnvironmentInjector, Injector, PLATFORM_ID, Service, afterEveryRender, inject } from '@angular/core';\n\nimport { WrI18n } from 'ngwr/i18n';\nimport { WR_OVERLAY, wrAppendOverlayClose } from 'ngwr/overlay';\n\nimport { WrDrawerRef } from './drawer-ref';\nimport type { WrDrawerOptions, WrDrawerPosition } from './interfaces';\nimport { WR_DRAWER_DATA, WR_DRAWER_REF } from './tokens';\n\nconst DEFAULT_POSITION: WrDrawerPosition = 'right';\nconst DEFAULT_WIDTH = '20rem';\nconst DEFAULT_HEIGHT = '16rem';\nconst BACKDROP_CLASS = 'wr-drawer-backdrop';\n\n/**\n * Opens drawer components in an isolated NGWR overlay — the programmatic\n * counterpart to `<wr-drawer [(open)]=\"…\">`.\n *\n * Use the component when the drawer is part of a template and its open state\n * is a signal you already own; use this service when the caller doesn't own\n * the markup (opening a chat panel from a toolbar action, from an effect, from\n * a route guard) or when you need the close result.\n *\n * Uses `WR_OVERLAY` so it composes cleanly with `provideWrOverlay()`\n * — drawers render into NGWR's own overlay container and never collide\n * with other CDK consumers (Material, NG-ZORRO, etc.).\n *\n * `showHandle` / swipe-to-dismiss is component-only: it needs the drawer's own\n * wrapper markup, which the service path replaces with your component.\n *\n * @example\n * ```ts\n * const drawers = inject(WrDrawerManager);\n *\n * const ref = drawers.open(ChatComponent, {\n * data: { threadId },\n * position: 'right',\n * width: '28rem',\n * });\n *\n * await ref.awaitClose();\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Service()\nexport class WrDrawerManager {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly i18n = inject(WrI18n);\n private readonly location = inject(Location);\n\n open<C, R = unknown, D = unknown>(component: ComponentType<C>, options: WrDrawerOptions<D> = {}): WrDrawerRef<C, R> {\n const position = options.position ?? DEFAULT_POSITION;\n const isHorizontal = position === 'left' || position === 'right';\n\n // The content component is attached straight into the overlay pane, so the\n // panel styles land on the pane rather than on an inner wrapper.\n const panelClasses = [\n 'wr-drawer-overlay',\n `wr-drawer-overlay--${position}`,\n 'wr-drawer__panel',\n `wr-drawer__panel--${position}`,\n ];\n if (options.rounded) panelClasses.push('wr-drawer__panel--rounded');\n if (options.safeArea) panelClasses.push('wr-drawer__panel--safe-area');\n const extra = options.panelClass;\n if (typeof extra === 'string') {\n panelClasses.push(extra);\n } else if (extra) {\n for (const cls of extra) panelClasses.push(cls);\n }\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [position === 'left' ? 'left' : position === 'right' ? 'right' : 'centerHorizontally']();\n\n if (position === 'top') positionStrategy.top();\n else if (position === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = options.maxHeight ?? null;\n\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.block(),\n hasBackdrop: options.hasBackdrop !== false,\n backdropClass: BACKDROP_CLASS,\n panelClass: panelClasses,\n width: isHorizontal ? (options.width ?? DEFAULT_WIDTH) : '100vw',\n height: isHorizontal ? undefined : (options.height ?? DEFAULT_HEIGHT),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n const drawerRef = new WrDrawerRef<C, R>(overlayRef);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n drawerRef.previouslyFocused = active instanceof HTMLElement ? active : null;\n }\n\n const injector = Injector.create({\n parent: this.parentInjector,\n providers: [\n { provide: WR_DRAWER_DATA, useValue: options.data },\n { provide: WR_DRAWER_REF, useValue: drawerRef },\n // Provided as its own token as well, so drawer content can reach for\n // the familiar `inject(WrDrawerRef)` and close itself.\n { provide: WrDrawerRef, useValue: drawerRef },\n ],\n });\n\n const portal = new ComponentPortal(component, null, injector);\n drawerRef.componentRef = overlayRef.attach(portal);\n\n // Wired BEFORE the panel is decorated, and the order is the fix: everything\n // below attaches attributes, a ✕ and a focus trap to an overlay that is\n // already on screen, so anything that throws in there used to leave an\n // `aria-modal` panel with no dismissal path at all — no ✕, no backdrop\n // handler, no Escape — over the whole application, and no ref for the caller\n // to close it with. A drawer that fails to finish opening must still be one\n // the user can get rid of. Overlay subscriptions complete when the overlay is\n // disposed, so no explicit teardown is required.\n if (options.closeOnBackdropClick !== false) {\n overlayRef.backdropClick().subscribe(() => drawerRef.close());\n }\n if (options.closeOnEscape !== false) {\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n drawerRef.close();\n }\n });\n }\n if (options.closeOnNavigation !== false) {\n this.watchNavigation(overlayRef, drawerRef);\n }\n\n if (this.isBrowser) {\n const host = overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n host.setAttribute('aria-modal', 'true');\n // Built-in dismiss, same contract as WrDialog's `closable`.\n if (options.closable !== false) {\n host.classList.add('wr-drawer__panel--closable');\n const label = options.closeLabel ?? this.closeLabel();\n wrAppendOverlayClose(host, 'wr-drawer__close', label, () => drawerRef.close());\n }\n // Wire aria-labelledby to wrDrawerTitle's auto-id once content is in DOM.\n // Has to wait for a render, not a microtask: attaching the portal only\n // schedules change detection, so under zoneless CD a microtask runs while\n // the content is still an empty view and the title id doesn't exist yet.\n //\n // And after EVERY render, not just the next one: the title belongs to the\n // caller's component, so an `@if` or a late-arriving heading can replace\n // or remove the element the attribute names. A reference to a node that is\n // no longer there is not a name — the dialog announces as unnamed — so a\n // missing title clears the attribute rather than leaving it dangling.\n const labelSync = afterEveryRender(\n () => {\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n },\n { injector: this.parentInjector }\n );\n // The hook is bound to the root injector, so it outlives the drawer unless\n // it is torn down with it. `detachments()` fires on dispose, which is the\n // one path every dismissal goes through.\n overlayRef.detachments().subscribe(() => labelSync.destroy());\n // Trap focus inside the drawer and move initial focus in.\n const trap = this.focusTrapFactory.create(host);\n drawerRef.focusTrap = trap;\n void trap.focusInitialElementWhenReady();\n }\n\n return drawerRef;\n }\n\n /**\n * Tie the drawer's lifetime to the URL it was opened on — the same treatment\n * `WrDialog` gets, and for the same reason.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape, the appended × or an explicit `close()`, so\n * navigating away left the panel, its backdrop, its focus trap and the\n * page-wide scroll block sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an in-app\n * `router.navigate()` left the drawer standing. And `drawerRef.close()` rather\n * than disposing the overlay behind the ref's back, which would never emit\n * `closed`, never destroy the focus trap, and leave `awaitClose()` pending.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, drawerRef: WrDrawerRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => drawerRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked drawer\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Resolved per open, not stored as a plain string at injection: this is a root\n * service, so a one-shot read — which is what `WrDialog` used to have, and moved\n * off for this reason — would run before an async catalog had loaded and then\n * freeze that answer for the life of the app. (`readI18nText` hands back a signal\n * now, so it would no longer freeze; the name still has to be pushed onto the\n * button per open either way.) `WrDialog.closeLabel()` is the matching precedent,\n * not the counter-example.\n *\n * The miss check is the point. `t()` hands back the KEY when the catalog has\n * no entry, and `WrI18n` is root-provided with an empty catalog by default —\n * so an app that never configured i18n got a button announced as\n * \"drawer.close, button\". A name WAS present, which is exactly why the axe\n * gate could not see it.\n */\n private closeLabel(): string {\n const resolved = this.i18n.t('drawer.close');\n return resolved === 'drawer.close' ? 'Close drawer' : resolved;\n }\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, input } from '@angular/core';\n\nimport { WrDrawer } from '../drawer';\nimport type { WrDrawerRef } from '../drawer-ref';\nimport { WR_DRAWER_REF } from '../tokens';\n\n/**\n * Closes the parent drawer on click. Attach to any clickable element.\n *\n * Works for both drawer flavours: inside `<wr-drawer>` it clears the\n * component's `open` model, and inside a `WrDrawerManager.open()` drawer it\n * closes the ref — optionally passing a `[wrDrawerClose]` value as the close\n * result (the component flavour has no result to carry, so the value is\n * ignored there).\n *\n * @example\n * ```html\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * <wr-btn color=\"primary\" [wrDrawerClose]=\"true\">Save</wr-btn>\n * ```\n */\n@Directive({\n selector: '[wrDrawerClose]',\n host: { '(click)': 'close()' },\n})\nexport class WrDrawerClose<R = unknown> {\n /**\n * Value to pass to `close()` for service-opened drawers. When unset — or\n * used as a bare attribute — the drawer closes with `undefined`.\n */\n readonly result = input<R | undefined, R | undefined | ''>(undefined, {\n alias: 'wrDrawerClose',\n // A bare `wrDrawerClose` attribute arrives as the empty string; that means\n // \"no result\", not a result of `''`.\n transform: value => (value === '' ? undefined : value),\n });\n\n private readonly drawer = inject(WrDrawer, { optional: true });\n private readonly ref = inject<WrDrawerRef<unknown, R>>(WR_DRAWER_REF, { optional: true });\n\n protected close(): void {\n // Element injectors win, so a surrounding `<wr-drawer>` is the nearer\n // owner even when a service-opened drawer sits further up the tree.\n if (this.drawer) {\n this.drawer.open.set(false);\n return;\n }\n this.ref?.close(this.result());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AA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Q,EAAE,IAAI,EAAE,CAAC;IAC7C,GAAG,GAAG,MAAM,CAA0B,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAE/E,KAAK,GAAA;;;AAGb,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAC3B;QACF;QACA,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChC;uGAvBW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;AAC/B,iBAAA;;;AC/BD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-drawer.mjs","sources":["../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/drawer.ts","../../../projects/lib/drawer/drawer.html","../../../projects/lib/drawer/drawer-ref.ts","../../../projects/lib/drawer/tokens/drawer-data.token.ts","../../../projects/lib/drawer/tokens/drawer-ref.token.ts","../../../projects/lib/drawer/drawer-manager.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 { 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 { type ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\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 EnvironmentInjector,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterEveryRender,\n contentChild,\n effect,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, wrFollowDirection } from 'ngwr/overlay';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\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/reference/components/drawer\n */\n@Component({\n selector: 'wr-drawer',\n templateUrl: './drawer.html',\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\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 /**\n * Show a dismiss (×) button in the panel's top-right corner. Set `false` when\n * the projected content supplies its own close affordance. @default true\n */\n readonly closable = input(true, { transform: coerceBooleanProperty });\n\n /** Accessible name for the dismiss button. Falls back to `drawer.close`. */\n readonly closeLabel = input<string | null>(null);\n\n protected readonly resolvedCloseLabel = useI18nText(this.closeLabel, 'drawer.close', 'Close drawer');\n\n protected readonly panelTpl = viewChild.required(TemplateRef);\n\n /**\n * A projected `[wrDrawerTitle]`, if the consumer gave one.\n *\n * The dismiss button is corner chrome positioned at a fixed\n * `inset-block-start` chosen to centre it on the TITLE's first line. With no\n * title the content starts at the top of the panel and runs underneath it: on\n * a bare `<wr-drawer><nav /></wr-drawer>` the button covered the first menu\n * row by 24×16 px, and `elementFromPoint` at the button's centre returned the\n * button, so that corner of the first item was unclickable. The panel has to\n * know, because only the panel can reserve the space.\n */\n private readonly projectedTitle = contentChild(WrDrawerTitle);\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 if (this.closable()) parts.push('wr-drawer__panel--closable');\n // The handle sits on the LEADING edge, which for `left` / `right` is a\n // vertical rail rather than a row in the column — so it leaves the flow and\n // the panel has to reserve the gutter it floats over. Only the panel can do\n // that, and only if it knows the handle is there.\n if (this.showHandle()) parts.push('wr-drawer__panel--handle');\n // Only when there is something to collide with: a closable drawer with a\n // title already clears the button, and an unclosable one has no button.\n if (this.closable() && !this.projectedTitle()) parts.push('wr-drawer__panel--untitled');\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 // Pointer, not Touch. The handle has always advertised itself to a mouse with\n // `cursor: grab`, but the gesture was bound to touch events only, so on a\n // desktop it could not be dragged at all. Pointer Events cover touch, mouse and\n // pen through one path — the same idiom `wr-splitter` already uses.\n\n protected onSwipeStart(event: PointerEvent): void {\n // Ignore secondary contacts of a multi-touch gesture.\n if (!event.isPrimary) return;\n this.swipeStartX = event.clientX;\n this.swipeStartY = event.clientY;\n this.swiping = true;\n // Capture, so the drag keeps reporting once the cursor leaves the 2.5rem\n // grabber — without it a mouse drag dies the moment it slips off the handle.\n (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);\n }\n\n protected onSwipeMove(event: PointerEvent, panel: HTMLElement): void {\n if (!this.swiping) return;\n const { axis, sign } = this.closeAxis();\n const delta = axis === 'y' ? event.clientY - this.swipeStartY : event.clientX - this.swipeStartX;\n // Only follow the pointer when dragging toward the closing edge.\n if (delta * sign <= 0) {\n panel.style.transform = '';\n return;\n }\n panel.style.transition = 'none';\n panel.style.transform = axis === 'y' ? `translateY(${delta}px)` : `translateX(${delta}px)`;\n }\n\n /**\n * A cancelled pointer is an ABANDONED swipe, not a completed one — the system\n * took the gesture away (a call, a system gesture, an orientation change) and\n * no `pointerup` ever arrives. Routing it through `onSwipeEnd` dismissed the\n * drawer on an interruption the user did not ask for and, because the overlay\n * is disposed with the dragged offset applied, could not take back. Same rule\n * `wr-pull-to-refresh` states for `touchcancel`.\n */\n protected onSwipeCancel(panel: HTMLElement): void {\n if (!this.swiping) return;\n this.swiping = false;\n panel.style.transition = '';\n panel.style.transform = '';\n }\n\n protected onSwipeEnd(event: PointerEvent, panel: HTMLElement): void {\n if (!this.swiping) return;\n this.swiping = false;\n const { axis, sign } = this.closeAxis();\n const delta = axis === 'y' ? event.clientY - this.swipeStartY : event.clientX - this.swipeStartX;\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 injector = inject(Injector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n /**\n * The reading direction the open drawer has to keep up with, resolved off the\n * ENVIRONMENT injector rather than this component's.\n *\n * That is where the CDK read it: `createOverlayRef` takes `Directionality`\n * from the `Overlay`'s own injector, which `provideWrOverlay()` parents to\n * the application's, so a node-level CDK `[dir]` is never in the chain. A\n * panel is not IN that island either — it is appended to the overlay\n * container on `<body>` — so following the node injector would not follow the\n * ref at all: it would rewrite a correctly-stamped panel to the island's\n * direction one pass after it opened, and `WrDrawerManager`, a root service\n * with no island to read, could never do the same. Two halves of one\n * component, same panel classes, same stylesheet, two answers.\n *\n * `null` never happens in an app — `Directionality` is root-provided — but a\n * bare `TestBed` should still get a drawer that opens, with nothing ambient\n * to follow.\n */\n private readonly dir = inject(EnvironmentInjector).get(Directionality, null);\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 afterEveryRender(() => this.syncLabel());\n this.destroyRef.onDestroy(() => this.closeOverlay());\n }\n\n /**\n * Point the panel's `aria-labelledby` at the CURRENT `[wrDrawerTitle]`.\n *\n * Re-resolved after every render rather than once when the drawer opens,\n * because the title element is projected content and can come and go while\n * the drawer stays open — an `@if` around it, or a heading that only exists\n * once the data arrives. A one-shot lookup leaves the attribute naming an\n * element that has been removed or replaced, and a dangling reference is not\n * a name: the dialog is announced as unnamed, with nothing on screen to say\n * so. A missing title clears the attribute for the same reason.\n */\n private syncLabel(): void {\n const host = this.overlayRef?.overlayElement;\n if (!host) return;\n\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\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 ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n // `position` is PHYSICAL — a `left` drawer is on the physical left in either\n // direction — and it takes BOTH halves of the follower to keep it that way.\n // The CDK places the panel with `justify-content` on a host it also writes\n // `dir` to, and that host is a flex row, so the attribute alone reverses the\n // main axis and slides a `left` drawer across to the right; `apply()`'s own\n // RTL branch swaps `flex-start` for `flex-end` to cancel exactly that. So\n // the `setDirection()` + `updatePosition()` pair leaves the panel where it\n // is and only re-resolves what the panel's own logical CSS reads — which is\n // the whole point, since the direction inside the drawer really did change.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\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 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 (pointerdown)=\"onSwipeStart($event)\"\n (pointermove)=\"onSwipeMove($event, panel)\"\n (pointerup)=\"onSwipeEnd($event, panel)\"\n (pointercancel)=\"onSwipeCancel(panel)\"\n >\n <span class=\"wr-drawer__grabber\"></span>\n </div>\n }\n @if (closable()) {\n <button type=\"button\" class=\"wr-drawer__close\" [attr.aria-label]=\"resolvedCloseLabel()\" (click)=\"open.set(false)\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\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 type { ConfigurableFocusTrap } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\n/**\n * Handle returned by `WrDrawerManager.open()`.\n *\n * Wraps the underlying `OverlayRef` and tracks the close result. It is also\n * provided inside the drawer's own injector, so the projected content can\n * inject it and close itself — the counterpart to `[wrDrawerClose]` when the\n * close is programmatic (after a save succeeds, say) rather than a click.\n *\n * @example\n * ```ts\n * // Caller side.\n * const ref = drawers.open<ChatComponent, boolean>(ChatComponent, { position: 'right' });\n * const result = await ref.awaitClose(); // boolean | undefined\n * ```\n *\n * @example\n * ```ts\n * // Content side — the drawer closes itself.\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject(WrDrawerRef);\n *\n * send(): void {\n * this.store.send(this.draft());\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport class WrDrawerRef<C, R = unknown> {\n /**\n * Emits the close result once and completes.\n *\n * A `ReplaySubject`, not a plain `Subject`, so the result survives a late\n * subscriber: content can close itself before `open()` has even returned, and\n * `awaitClose()` may be called long after the dismissal — both would otherwise\n * see only `complete` and resolve `undefined`.\n */\n readonly closed = new ReplaySubject<R | undefined>(1);\n\n /** @internal */\n componentRef: ComponentRef<C> | null = null;\n\n /** @internal */\n focusTrap: ConfigurableFocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n constructor(private readonly _overlayRef: OverlayRef) {}\n\n /** The instantiated drawer component. */\n get componentInstance(): C {\n if (!this.componentRef) {\n throw new Error('WrDrawerRef: component not yet attached');\n }\n return this.componentRef.instance;\n }\n\n private isClosed = false;\n\n /** Close the drawer, optionally returning a result. */\n close(result?: R): void {\n if (this.isClosed) return;\n this.isClosed = true;\n this.closed.next(result);\n this.closed.complete();\n // Content that closes itself while constructing gets here with\n // `OverlayRef.attach()` still on the stack — `componentRef` is assigned\n // only once attach returns. Disposing mid-attach leaves the CDK writing to\n // a detached host, so let the current task finish first.\n if (!this.componentRef) {\n queueMicrotask(() => this.teardown());\n return;\n }\n this.teardown();\n }\n\n private teardown(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this._overlayRef.dispose();\n // Drop the destroyed component so a retained ref doesn't pin its instance,\n // host element and view in memory.\n this.componentRef = null;\n // Restore focus after disposal so the trigger is reachable again.\n if (restore && typeof restore.focus === 'function') {\n restore.focus();\n }\n }\n\n /** Resolves with the close result when the drawer is dismissed. */\n awaitClose(): Promise<R | undefined> {\n return new Promise(resolve => {\n this.closed.subscribe({\n next: value => resolve(value),\n complete: () => resolve(undefined),\n });\n });\n }\n\n /** Underlying overlay ref — escape hatch for advanced cases. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\n }\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 { InjectionToken } from '@angular/core';\n\n/**\n * Token that exposes the `data` payload passed to `WrDrawerManager.open()`.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * readonly data = inject<ChatData>(WR_DRAWER_DATA);\n * }\n * ```\n */\nexport const WR_DRAWER_DATA = new InjectionToken<unknown>('WR_DRAWER_DATA');\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 { InjectionToken } from '@angular/core';\n\nimport type { WrDrawerRef } from '../drawer-ref';\n\n/**\n * Token exposing the open drawer's `WrDrawerRef` to components and\n * directives rendered inside it (e.g. `[wrDrawerClose]`).\n *\n * **Prefer `inject(WrDrawerRef)`** — the ref is provided under the class token\n * too, and the class path is the documented one. It already covers both cases\n * you might reach for a token for: `inject(WrDrawerRef, { optional: true })`\n * works for content that also renders outside a drawer, and\n * `inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef)` types the generics\n * without a cast.\n *\n * This token is the same object under a second key. It exists for the library's\n * own directives (`[wrDrawerClose]`) and for swapping the provider out — a test\n * stub, say — without touching the class.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef);\n *\n * dismiss(): void {\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport const WR_DRAWER_REF = new InjectionToken<WrDrawerRef<unknown, unknown>>('WR_DRAWER_REF');\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 { ConfigurableFocusTrapFactory } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal, type ComponentType } from '@angular/cdk/portal';\nimport { Location, isPlatformBrowser } from '@angular/common';\nimport { EnvironmentInjector, Injector, PLATFORM_ID, Service, afterEveryRender, inject } from '@angular/core';\n\nimport { WrI18n } from 'ngwr/i18n';\nimport { WR_OVERLAY, wrAppendOverlayClose, wrFollowDirection } from 'ngwr/overlay';\n\nimport { WrDrawerRef } from './drawer-ref';\nimport type { WrDrawerOptions, WrDrawerPosition } from './interfaces';\nimport { WR_DRAWER_DATA, WR_DRAWER_REF } from './tokens';\n\nconst DEFAULT_POSITION: WrDrawerPosition = 'right';\nconst DEFAULT_WIDTH = '20rem';\nconst DEFAULT_HEIGHT = '16rem';\nconst BACKDROP_CLASS = 'wr-drawer-backdrop';\n\n/**\n * Opens drawer components in an isolated NGWR overlay — the programmatic\n * counterpart to `<wr-drawer [(open)]=\"…\">`.\n *\n * Use the component when the drawer is part of a template and its open state\n * is a signal you already own; use this service when the caller doesn't own\n * the markup (opening a chat panel from a toolbar action, from an effect, from\n * a route guard) or when you need the close result.\n *\n * Uses `WR_OVERLAY` so it composes cleanly with `provideWrOverlay()`\n * — drawers render into NGWR's own overlay container and never collide\n * with other CDK consumers (Material, NG-ZORRO, etc.).\n *\n * `showHandle` / swipe-to-dismiss is component-only: it needs the drawer's own\n * wrapper markup, which the service path replaces with your component.\n *\n * @example\n * ```ts\n * const drawers = inject(WrDrawerManager);\n *\n * const ref = drawers.open(ChatComponent, {\n * data: { threadId },\n * position: 'right',\n * width: '28rem',\n * });\n *\n * await ref.awaitClose();\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Service()\nexport class WrDrawerManager {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly i18n = inject(WrI18n);\n private readonly location = inject(Location);\n /**\n * The application's reading direction — the instance the CDK itself read when\n * it stamped the overlay. A root service has no node injector above it, so a\n * plain `inject()` here already resolves the environment one; `<wr-drawer>`,\n * which does, spells that out and says why. The two halves of one component\n * must not answer differently about the same panel.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n open<C, R = unknown, D = unknown>(component: ComponentType<C>, options: WrDrawerOptions<D> = {}): WrDrawerRef<C, R> {\n const position = options.position ?? DEFAULT_POSITION;\n const isHorizontal = position === 'left' || position === 'right';\n\n // The content component is attached straight into the overlay pane, so the\n // panel styles land on the pane rather than on an inner wrapper.\n const panelClasses = [\n 'wr-drawer-overlay',\n `wr-drawer-overlay--${position}`,\n 'wr-drawer__panel',\n `wr-drawer__panel--${position}`,\n ];\n if (options.rounded) panelClasses.push('wr-drawer__panel--rounded');\n if (options.safeArea) panelClasses.push('wr-drawer__panel--safe-area');\n const extra = options.panelClass;\n if (typeof extra === 'string') {\n panelClasses.push(extra);\n } else if (extra) {\n for (const cls of extra) panelClasses.push(cls);\n }\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [position === 'left' ? 'left' : position === 'right' ? 'right' : 'centerHorizontally']();\n\n if (position === 'top') positionStrategy.top();\n else if (position === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = options.maxHeight ?? null;\n\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.scrollStrategies.block(),\n hasBackdrop: options.hasBackdrop !== false,\n backdropClass: BACKDROP_CLASS,\n panelClass: panelClasses,\n width: isHorizontal ? (options.width ?? DEFAULT_WIDTH) : '100vw',\n height: isHorizontal ? undefined : (options.height ?? DEFAULT_HEIGHT),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n // Same pair, same reason as `<wr-drawer>`: `position` is physical, the CDK\n // writes `dir` on the flex host that `justify-content` places the panel in,\n // so the attribute alone would slide a `left` drawer to the right and\n // re-applying the strategy is what cancels it. The follower ends on the\n // ref's own `detachments()`, which every dismissal goes through, and each\n // `open()` creates a fresh ref of its own.\n wrFollowDirection(overlayRef, this.dir, this.parentInjector);\n\n const drawerRef = new WrDrawerRef<C, R>(overlayRef);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n drawerRef.previouslyFocused = active instanceof HTMLElement ? active : null;\n }\n\n const injector = Injector.create({\n parent: this.parentInjector,\n providers: [\n { provide: WR_DRAWER_DATA, useValue: options.data },\n { provide: WR_DRAWER_REF, useValue: drawerRef },\n // Provided as its own token as well, so drawer content can reach for\n // the familiar `inject(WrDrawerRef)` and close itself.\n { provide: WrDrawerRef, useValue: drawerRef },\n ],\n });\n\n const portal = new ComponentPortal(component, null, injector);\n drawerRef.componentRef = overlayRef.attach(portal);\n\n // Wired BEFORE the panel is decorated, and the order is the fix: everything\n // below attaches attributes, a ✕ and a focus trap to an overlay that is\n // already on screen, so anything that throws in there used to leave an\n // `aria-modal` panel with no dismissal path at all — no ✕, no backdrop\n // handler, no Escape — over the whole application, and no ref for the caller\n // to close it with. A drawer that fails to finish opening must still be one\n // the user can get rid of. Overlay subscriptions complete when the overlay is\n // disposed, so no explicit teardown is required.\n if (options.closeOnBackdropClick !== false) {\n overlayRef.backdropClick().subscribe(() => drawerRef.close());\n }\n if (options.closeOnEscape !== false) {\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n drawerRef.close();\n }\n });\n }\n if (options.closeOnNavigation !== false) {\n this.watchNavigation(overlayRef, drawerRef);\n }\n\n if (this.isBrowser) {\n const host = overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n host.setAttribute('aria-modal', 'true');\n // Built-in dismiss, same contract as WrDialog's `closable`.\n if (options.closable !== false) {\n host.classList.add('wr-drawer__panel--closable');\n const label = options.closeLabel ?? this.closeLabel();\n wrAppendOverlayClose(host, 'wr-drawer__close', label, () => drawerRef.close());\n }\n // Wire aria-labelledby to wrDrawerTitle's auto-id once content is in DOM.\n // Has to wait for a render, not a microtask: attaching the portal only\n // schedules change detection, so under zoneless CD a microtask runs while\n // the content is still an empty view and the title id doesn't exist yet.\n //\n // And after EVERY render, not just the next one: the title belongs to the\n // caller's component, so an `@if` or a late-arriving heading can replace\n // or remove the element the attribute names. A reference to a node that is\n // no longer there is not a name — the dialog announces as unnamed — so a\n // missing title clears the attribute rather than leaving it dangling.\n const labelSync = afterEveryRender(\n () => {\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n },\n { injector: this.parentInjector }\n );\n // The hook is bound to the root injector, so it outlives the drawer unless\n // it is torn down with it. `detachments()` fires on dispose, which is the\n // one path every dismissal goes through.\n overlayRef.detachments().subscribe(() => labelSync.destroy());\n // Trap focus inside the drawer and move initial focus in.\n const trap = this.focusTrapFactory.create(host);\n drawerRef.focusTrap = trap;\n void trap.focusInitialElementWhenReady();\n }\n\n return drawerRef;\n }\n\n /**\n * Tie the drawer's lifetime to the URL it was opened on — the same treatment\n * `WrDialog` gets, and for the same reason.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape, the appended × or an explicit `close()`, so\n * navigating away left the panel, its backdrop, its focus trap and the\n * page-wide scroll block sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an in-app\n * `router.navigate()` left the drawer standing. And `drawerRef.close()` rather\n * than disposing the overlay behind the ref's back, which would never emit\n * `closed`, never destroy the focus trap, and leave `awaitClose()` pending.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, drawerRef: WrDrawerRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => drawerRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked drawer\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Resolved per open, not stored as a plain string at injection: this is a root\n * service, so a one-shot read — which is what `WrDialog` used to have, and moved\n * off for this reason — would run before an async catalog had loaded and then\n * freeze that answer for the life of the app. (`readI18nText` hands back a signal\n * now, so it would no longer freeze; the name still has to be pushed onto the\n * button per open either way.) `WrDialog.closeLabel()` is the matching precedent,\n * not the counter-example.\n *\n * The miss check is the point. `t()` hands back the KEY when the catalog has\n * no entry, and `WrI18n` is root-provided with an empty catalog by default —\n * so an app that never configured i18n got a button announced as\n * \"drawer.close, button\". A name WAS present, which is exactly why the axe\n * gate could not see it.\n */\n private closeLabel(): string {\n const resolved = this.i18n.t('drawer.close');\n return resolved === 'drawer.close' ? 'Close drawer' : resolved;\n }\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, input } from '@angular/core';\n\nimport { WrDrawer } from '../drawer';\nimport type { WrDrawerRef } from '../drawer-ref';\nimport { WR_DRAWER_REF } from '../tokens';\n\n/**\n * Closes the parent drawer on click. Attach to any clickable element.\n *\n * Works for both drawer flavours: inside `<wr-drawer>` it clears the\n * component's `open` model, and inside a `WrDrawerManager.open()` drawer it\n * closes the ref — optionally passing a `[wrDrawerClose]` value as the close\n * result (the component flavour has no result to carry, so the value is\n * ignored there).\n *\n * @example\n * ```html\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * <wr-btn color=\"primary\" [wrDrawerClose]=\"true\">Save</wr-btn>\n * ```\n */\n@Directive({\n selector: '[wrDrawerClose]',\n host: { '(click)': 'close()' },\n})\nexport class WrDrawerClose<R = unknown> {\n /**\n * Value to pass to `close()` for service-opened drawers. When unset — or\n * used as a bare attribute — the drawer closes with `undefined`.\n */\n readonly result = input<R | undefined, R | undefined | ''>(undefined, {\n alias: 'wrDrawerClose',\n // A bare `wrDrawerClose` attribute arrives as the empty string; that means\n // \"no result\", not a result of `''`.\n transform: value => (value === '' ? undefined : value),\n });\n\n private readonly drawer = inject(WrDrawer, { optional: true });\n private readonly ref = inject<WrDrawerRef<unknown, R>>(WR_DRAWER_REF, { optional: true });\n\n protected close(): void {\n // Element injectors win, so a surrounding `<wr-drawer>` is the nearer\n // owner even when a service-opened drawer sits further up the tree.\n if (this.drawer) {\n this.drawer.open.set(false);\n return;\n }\n this.ref?.close(this.result());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;AAKG;AAIH,IAAI,GAAG,GAAG,CAAC;AAEX;;;;;;;;;;;;;AAaG;MAKU,aAAa,CAAA;;AAEf,IAAA,EAAE,GAAG,CAAA,gBAAA,EAAmB,EAAE,GAAG,EAAE;uGAF7B,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,k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AG,KAAK,CAAC,GACtD;IAEe,MAAM,GAAG,MAAM,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7C,GAAG,GAAG,MAAM,CAA0B,aAAa,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAE/E,KAAK,GAAA;;;AAGb,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YAC3B;QACF;QACA,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;IAChC;uGAvBW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAb,aAAa,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,MAAA,EAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,UAAA,EAAA,eAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE;AAC/B,iBAAA;;;AC/BD;;AAEG;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Directionality } from '@angular/cdk/bidi';
|
|
1
2
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
3
|
import { ScrollStrategyOptions } from '@angular/cdk/overlay';
|
|
3
4
|
import { TemplatePortal } from '@angular/cdk/portal';
|
|
4
5
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { input, output, inject, ElementRef, ViewContainerRef, DestroyRef, signal, effect, Directive, viewChild, TemplateRef, ViewEncapsulation, Component, computed } from '@angular/core';
|
|
6
|
+
import { input, output, inject, ElementRef, ViewContainerRef, Injector, DestroyRef, signal, effect, Directive, viewChild, TemplateRef, ViewEncapsulation, Component, computed } from '@angular/core';
|
|
6
7
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
-
import { WR_OVERLAY, WrOutsideClick, WR_RESPONSIVE_OVERLAYS, wrPresentAsSheet } from 'ngwr/overlay';
|
|
8
|
+
import { WR_OVERLAY, WrOutsideClick, WR_RESPONSIVE_OVERLAYS, wrPresentAsSheet, wrFollowDirection } from 'ngwr/overlay';
|
|
8
9
|
import { WrIcon } from 'ngwr/icon';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -75,10 +76,19 @@ class WrDropdown {
|
|
|
75
76
|
closed = output();
|
|
76
77
|
host = inject(ElementRef);
|
|
77
78
|
overlay = inject(WR_OVERLAY);
|
|
79
|
+
/**
|
|
80
|
+
* The reading direction the open menu has to keep up with.
|
|
81
|
+
*
|
|
82
|
+
* Optional inject: `Directionality` is root-provided, so this is never null in
|
|
83
|
+
* an app — but a bare `TestBed` that provides nothing should still get a menu
|
|
84
|
+
* that opens, with simply nothing ambient to follow.
|
|
85
|
+
*/
|
|
86
|
+
dir = inject(Directionality, { optional: true });
|
|
78
87
|
outsideClick = inject(WrOutsideClick);
|
|
79
88
|
responsiveConfig = inject(WR_RESPONSIVE_OVERLAYS);
|
|
80
89
|
vcr = inject(ViewContainerRef);
|
|
81
90
|
scrollStrategies = inject(ScrollStrategyOptions);
|
|
91
|
+
injector = inject(Injector);
|
|
82
92
|
destroyRef = inject(DestroyRef);
|
|
83
93
|
/** @internal Public so host bindings can read it. */
|
|
84
94
|
isOpen = signal(false, /* @ts-ignore */
|
|
@@ -196,6 +206,16 @@ class WrDropdown {
|
|
|
196
206
|
? ['wr-dropdown-overlay', 'wr-overlay-sheet']
|
|
197
207
|
: ['wr-dropdown-overlay', `wr-dropdown-overlay--${this.position()}`],
|
|
198
208
|
});
|
|
209
|
+
// `create()` above froze the direction into the ref as a string, and nothing
|
|
210
|
+
// in the CDK ever revisits it. This menu is where it shows first: the docs
|
|
211
|
+
// site keeps its own LTR/RTL switch INSIDE a dropdown, so the flip is made
|
|
212
|
+
// from within the one panel that has to answer it.
|
|
213
|
+
//
|
|
214
|
+
// No callback — `WR_DROPDOWN_POSITIONS` anchors on `start` / `end` and
|
|
215
|
+
// carries no `offsetX`, so letting the CDK re-resolve those against the new
|
|
216
|
+
// direction is the whole job; the sheet has no anchor at all and only needs
|
|
217
|
+
// the `dir` on its host.
|
|
218
|
+
wrFollowDirection(this.overlayRef, this.dir, this.injector);
|
|
199
219
|
if (asSheet) {
|
|
200
220
|
this.overlayRef
|
|
201
221
|
.backdropClick()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-dropdown.mjs","sources":["../../../projects/lib/dropdown/interfaces/dropdown-position.ts","../../../projects/lib/dropdown/dropdown.ts","../../../projects/lib/dropdown/dropdown-menu.ts","../../../projects/lib/dropdown/dropdown-item.ts","../../../projects/lib/dropdown/dropdown-item.html","../../../projects/lib/dropdown/ngwr-dropdown.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 { ConnectedPosition } from '@angular/cdk/overlay';\n\n/**\n * Where the dropdown menu opens, relative to the trigger.\n */\nexport type WrDropdownPosition =\n 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right';\n\n/**\n * Maps friendly names to CDK ConnectedPosition fallback lists.\n *\n * @internal\n */\nexport const WR_DROPDOWN_POSITIONS: Record<WrDropdownPosition, ConnectedPosition[]> = {\n top: [{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' }],\n 'top-start': [{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }],\n 'top-end': [{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' }],\n bottom: [{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' }],\n 'bottom-start': [{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' }],\n 'bottom-end': [{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' }],\n left: [{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center' }],\n right: [{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center' }],\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 { type BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n ViewContainerRef,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WR_RESPONSIVE_OVERLAYS, WrOutsideClick, wrPresentAsSheet } from 'ngwr/overlay';\n\nimport type { WrDropdownMenu } from './dropdown-menu';\nimport { WR_DROPDOWN_POSITIONS, type WrDropdownPosition, type WrDropdownTrigger } from './interfaces';\n\n/**\n * Attach to any element to open a `<wr-dropdown-menu>` as a CDK overlay.\n *\n * @example\n * ```html\n * <button [wrDropdown]=\"menu\" position=\"bottom-start\" trigger=\"click\">\n * Actions\n * </button>\n *\n * <wr-dropdown-menu #menu>\n * <wr-dropdown-item icon=\"copy\" (click)=\"copy()\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\" (click)=\"remove()\">Delete</wr-dropdown-item>\n * </wr-dropdown-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/dropdown\n */\nlet triggerUid = 0;\n\n@Directive({\n selector: '[wrDropdown]',\n exportAs: 'wrDropdown',\n host: {\n class: 'wr-dropdown-trigger',\n '[attr.id]': 'triggerId',\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'isOpen() ? menu().menuId() : null',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeydown($event)',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave($event)',\n },\n})\nexport class WrDropdown {\n /** Menu to open. Pass a `<wr-dropdown-menu>` template reference. */\n readonly menu = input.required<WrDropdownMenu>({ alias: 'wrDropdown' });\n\n /** How the menu opens. @default 'click' */\n readonly trigger = input<WrDropdownTrigger>('click');\n\n /** Where the menu anchors relative to the trigger. @default 'bottom-start' */\n readonly position = input<WrDropdownPosition>('bottom-start');\n\n /**\n * Present the menu as a full-width bottom-sheet on small viewports instead\n * of an anchored panel. `undefined` follows the app-wide\n * `provideWrResponsiveOverlays()` setting; `true`/`false` overrides it.\n * @default undefined\n */\n readonly responsive = input<boolean | undefined, BooleanInput>(undefined, {\n transform: (v: BooleanInput): boolean | undefined => (v == null ? undefined : coerceBooleanProperty(v)),\n });\n\n /** Fires after the menu opens. */\n readonly opened = output<void>();\n\n /** Fires after the menu closes. */\n readonly closed = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly responsiveConfig = inject(WR_RESPONSIVE_OVERLAYS);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly destroyRef = inject(DestroyRef);\n\n /** @internal Public so host bindings can read it. */\n readonly isOpen = signal(false);\n\n /** The id used only when the consumer's element carries none of its own. */\n private readonly fallbackId = `wr-dropdown-trigger-${++triggerUid}`;\n\n /**\n * Id the menu names itself after. The trigger is the CONSUMER's own element, so\n * an `id` they already put there wins: overwriting it broke `<label for>`,\n * `document.getElementById` and any `aria-labelledby` aimed at that button from\n * elsewhere in their app. The generated one is only a fallback so the menu has\n * something to reference.\n *\n * A GETTER, read fresh by the host binding on every pass, rather than a field\n * resolved in the constructor. A static `id=\"…\"` is on the element before a\n * directive is instantiated and so was already honoured; a BOUND `[id]` is\n * not — it lands with the rest of the template's bindings, which run before\n * host bindings but after construction, so the constructor read an empty\n * string, fell through to the fallback, and the host binding then wrote that\n * fallback over the value the template had just set. Everything bound was\n * lost — `[id]`, `[attr.id]` and an interpolated `id=\"dd-{{ n }}\"` alike —\n * while the static form survived, which is the shape that makes it look like\n * a naming convention rather than a defect.\n *\n * `.id` rather than `getAttribute`: it is always a string, and an empty one is\n * no id at all, so it falls through to the fallback.\n */\n protected get triggerId(): string {\n return this.host.nativeElement.id || this.fallbackId;\n }\n\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n // The host view carrying `[wrDropdown]` can be destroyed while the menu is\n // open — a route change, or an `@if` around the trigger. The overlay lives\n // in the CDK container, not in that view, so nothing removes it unless we do.\n this.destroyRef.onDestroy(() => this.closeOverlay(false));\n\n effect(() => {\n if (this.isOpen()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n }\n\n /** Open the menu. */\n open(): void {\n this.isOpen.set(true);\n }\n\n /** Close the menu. */\n close(): void {\n this.isOpen.set(false);\n }\n\n /** Toggle the menu. */\n toggle(): void {\n this.isOpen.update(v => !v);\n }\n\n // Host listeners\n\n /** @internal */\n /**\n * Whether the pointer, rather than the keyboard, opened the current menu.\n *\n * A hover-opened menu must not take focus — the APG shows a menu on hover and\n * leaves the caret where it was — while a keyboard-opened one must. The\n * trigger MODE cannot answer that on its own: a `trigger=\"hover\"` menu is\n * still openable with Enter, and that open should focus the first item.\n */\n private openedByPointer = false;\n\n protected onClick(event: MouseEvent): void {\n if (this.trigger() !== 'click') return;\n event.stopPropagation();\n this.openedByPointer = false;\n this.toggle();\n }\n\n /** @internal */\n protected onMouseEnter(): void {\n if (this.trigger() !== 'hover') return;\n // A POINTER opened this, so the menu must not take the keyboard with it —\n // see `openedByPointer`.\n this.openedByPointer = true;\n this.isOpen.set(true);\n }\n\n /** @internal */\n protected onMouseLeave(event: MouseEvent): void {\n if (this.trigger() !== 'hover') return;\n const related = event.relatedTarget as Node | null;\n if (related && this.overlayRef?.overlayElement.contains(related)) return;\n this.isOpen.set(false);\n }\n\n // Overlay management\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n // On small viewports (when opted in) detach from the trigger and present\n // the menu as a full-width slide-up sheet pinned to the bottom edge.\n const asSheet = wrPresentAsSheet(this.responsive(), this.responsiveConfig);\n\n const positionStrategy = asSheet\n ? this.overlay.position().global().centerHorizontally().bottom('0')\n : this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(WR_DROPDOWN_POSITIONS[this.position()])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: asSheet ? this.scrollStrategies.block() : this.scrollStrategies.reposition(),\n width: asSheet ? '100%' : undefined,\n hasBackdrop: asSheet,\n backdropClass: asSheet ? 'wr-overlay-backdrop' : undefined,\n panelClass: asSheet\n ? ['wr-dropdown-overlay', 'wr-overlay-sheet']\n : ['wr-dropdown-overlay', `wr-dropdown-overlay--${this.position()}`],\n });\n\n if (asSheet) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.isOpen.set(false));\n }\n\n // Wire trigger id into menu so it can render aria-labelledby.\n this.menu().triggerId.set(this.triggerId);\n\n const portal = new TemplatePortal(this.menu().contentTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Focus the first menu item after the menu renders — unless a POINTER\n // opened it. This used to be unconditional, so merely sweeping the cursor\n // over a `trigger=\"hover\"` menu yanked the caret out of whatever the user\n // was typing; the APG's own rule is that hover shows a menu and does not\n // move focus into it. A keyboard open (Enter / Space / ArrowDown) still\n // focuses the first item, on a hover trigger too.\n if (!this.openedByPointer) queueMicrotask(() => this.focusItemAt(0));\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.isOpen.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n this.handleMenuKeydown(event);\n });\n\n if (this.trigger() === 'hover') {\n this.overlayRef.overlayElement.addEventListener('mouseleave', this.onOverlayMouseLeave);\n }\n\n this.opened.emit();\n }\n\n /**\n * Tear the overlay down, and tell the host — unless the host is going away\n * with it.\n *\n * `notify: false` is the DESTROY path, and it is not a nicety. An `output()`\n * belongs to the view that declares it, so emitting from `onDestroy` is\n * refused: Angular logs `NG0953: Unexpected emit for destroyed OutputRef` and\n * the listener never runs. Measured — a `(closed)` handler on a dropdown whose\n * host view is removed while the menu is open fired zero times and left a\n * console error behind. There is nobody to notify at that point, because the\n * consumer's own view is being torn down in the same pass; `wr-popconfirm`\n * already disposes without emitting, and this brings the other two into line.\n *\n * The focus hand-back is skipped for the same reason — the host element is on\n * its way out of the document.\n */\n private closeOverlay(notify = true): void {\n if (!this.overlayRef) return;\n if (this.trigger() === 'hover') {\n this.overlayRef.overlayElement.removeEventListener('mouseleave', this.onOverlayMouseLeave);\n }\n // Take the focus back before the pane goes, or it lands on `<body>` and the\n // next Tab starts from the top of the document. Only when focus is actually\n // inside the menu: closing a menu nobody was in must not steal the caret\n // from wherever the user has since moved.\n const active = document.activeElement;\n const focusWasInside = active instanceof Node && this.overlayRef.overlayElement.contains(active);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (notify) {\n if (focusWasInside) this.host.nativeElement.focus();\n this.closed.emit();\n }\n }\n\n // Keyboard handling\n\n /** @internal Trigger keydown — ArrowDown/Up/Enter/Space open the menu. */\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isOpen()) return;\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n // Opened from the keyboard — including on a `hover` trigger, which stays\n // keyboard-operable — so the first item SHOULD take focus.\n this.openedByPointer = false;\n this.open();\n }\n }\n\n private handleMenuKeydown(event: KeyboardEvent): void {\n const items = this.getItems();\n if (items.length === 0 && event.key !== 'Escape' && event.key !== 'Tab') return;\n const current = document.activeElement as HTMLElement | null;\n const idx = current ? items.indexOf(current) : -1;\n\n // CDK's keyboard dispatcher feeds this overlay EVERY document keydown, not\n // just the ones typed into it — and a `trigger=\"hover\"` menu is open with\n // the caret deliberately left wherever the user was (see `openedByPointer`).\n // So ownership is checked here rather than assumed: without it, ArrowDown /\n // ArrowUp / Home / End pressed in an unrelated field were `preventDefault`ed\n // and yanked focus into the menu. The trigger counts as ours — a hover menu\n // that the user has tabbed back to should still open to the keyboard.\n const typedIn = event.target;\n const ours =\n typedIn instanceof Node &&\n (this.host.nativeElement.contains(typedIn) || (this.overlayRef?.overlayElement.contains(typedIn) ?? false));\n // Escape (and Tab) still close from anywhere — routing to the topmost\n // overlay regardless of focus is the dispatcher's whole job. Escape just\n // must not drag the caret onto the trigger from a field the user is in.\n if (!ours && event.key !== 'Escape' && event.key !== 'Tab') return;\n\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n this.isOpen.set(false);\n if (ours) this.host.nativeElement.focus();\n break;\n case 'Tab':\n // Let focus leave naturally; close the menu.\n this.isOpen.set(false);\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.focusItemAt(idx < items.length - 1 ? idx + 1 : 0);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusItemAt(idx > 0 ? idx - 1 : items.length - 1);\n break;\n case 'Home':\n event.preventDefault();\n this.focusItemAt(0);\n break;\n case 'End':\n event.preventDefault();\n this.focusItemAt(items.length - 1);\n break;\n default:\n break;\n }\n }\n\n private getItems(): readonly HTMLElement[] {\n if (!this.overlayRef) return [];\n return Array.from(\n this.overlayRef.overlayElement.querySelectorAll<HTMLElement>('.wr-dropdown-item:not(.wr-dropdown-item--disabled)')\n );\n }\n\n private focusItemAt(index: number): void {\n const items = this.getItems();\n if (items.length === 0) return;\n const clamped = ((index % items.length) + items.length) % items.length;\n items[clamped]?.focus();\n }\n\n private readonly onOverlayMouseLeave = (event: MouseEvent): void => {\n const related = event.relatedTarget as Node | null;\n if (related && this.host.nativeElement.contains(related)) return;\n this.isOpen.set(false);\n };\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 { Component, TemplateRef, ViewEncapsulation, signal, viewChild } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Holds the menu content rendered when a {@link WrDropdown} opens.\n *\n * The component itself doesn't render anywhere — the directive grabs its\n * internal `<ng-template>` and portals it into an overlay.\n *\n * @example\n * ```html\n * <button [wrDropdown]=\"menu\">Actions</button>\n * <wr-dropdown-menu #menu>\n * <wr-dropdown-item icon=\"copy\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\">Delete</wr-dropdown-item>\n * </wr-dropdown-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/dropdown\n */\n@Component({\n selector: 'wr-dropdown-menu',\n template:\n '<ng-template><div class=\"wr-dropdown-menu\" role=\"menu\" [attr.id]=\"menuId()\" [attr.aria-labelledby]=\"triggerId() || null\"><ng-content /></div></ng-template>',\n exportAs: 'wrDropdownMenu',\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\n host: { '[style.display]': \"'none'\" },\n})\nexport class WrDropdownMenu {\n /** The internal template the directive portals into the overlay. @internal */\n readonly contentTpl = viewChild.required(TemplateRef);\n\n /** Stable id used on the menu element and referenced from the trigger's `aria-controls`. */\n readonly menuId = signal(`wr-dropdown-menu-${++uid}`);\n\n /** Trigger element id, set by the directive for `aria-labelledby` wiring. */\n readonly triggerId = signal<string | null>(null);\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ElementRef, ViewEncapsulation, computed, inject, input } from '@angular/core';\n\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\n\n/**\n * Single row inside a `<wr-dropdown-menu>`.\n *\n * @example\n * ```html\n * <wr-dropdown-item icon=\"copy\" (click)=\"copy()\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\" disabled>Delete</wr-dropdown-item>\n * ```\n */\n@Component({\n selector: 'wr-dropdown-item',\n templateUrl: './dropdown-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'menuitem',\n '[class]': 'classes()',\n '[attr.tabindex]': '-1',\n '[attr.aria-disabled]': 'disabled() ? true : null',\n '(keydown.enter)': 'activate($event)',\n '(keydown.space)': 'activate($event)',\n },\n imports: [WrIcon],\n})\nexport class WrDropdownItem {\n /** Optional leading icon name. @default null */\n readonly icon = input<WrIconName | null>(null);\n\n /** Disable interaction (suppresses pointer + keyboard). @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-dropdown-item'];\n if (this.disabled()) parts.push('wr-dropdown-item--disabled');\n return parts.join(' ');\n });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** @internal Keyboard activation — fires the same click consumers bind to. */\n protected activate(event: Event): void {\n if (this.disabled()) return;\n event.preventDefault();\n this.host.nativeElement.click();\n }\n}\n","@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n","/**\n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,OAAA,EACQ,CAAC,MAAM,CAAC,EAAA,QAAA,EAAA,mKAAA,EAAA;;;AEjCnB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-dropdown.mjs","sources":["../../../projects/lib/dropdown/interfaces/dropdown-position.ts","../../../projects/lib/dropdown/dropdown.ts","../../../projects/lib/dropdown/dropdown-menu.ts","../../../projects/lib/dropdown/dropdown-item.ts","../../../projects/lib/dropdown/dropdown-item.html","../../../projects/lib/dropdown/ngwr-dropdown.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 { ConnectedPosition } from '@angular/cdk/overlay';\n\n/**\n * Where the dropdown menu opens, relative to the trigger.\n */\nexport type WrDropdownPosition =\n 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right';\n\n/**\n * Maps friendly names to CDK ConnectedPosition fallback lists.\n *\n * @internal\n */\nexport const WR_DROPDOWN_POSITIONS: Record<WrDropdownPosition, ConnectedPosition[]> = {\n top: [{ originX: 'center', originY: 'top', overlayX: 'center', overlayY: 'bottom' }],\n 'top-start': [{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }],\n 'top-end': [{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' }],\n bottom: [{ originX: 'center', originY: 'bottom', overlayX: 'center', overlayY: 'top' }],\n 'bottom-start': [{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' }],\n 'bottom-end': [{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' }],\n left: [{ originX: 'start', originY: 'center', overlayX: 'end', overlayY: 'center' }],\n right: [{ originX: 'end', originY: 'center', overlayX: 'start', overlayY: 'center' }],\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 { Directionality } from '@angular/cdk/bidi';\nimport { type BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n Injector,\n ViewContainerRef,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { WR_OVERLAY, WR_RESPONSIVE_OVERLAYS, WrOutsideClick, wrFollowDirection, wrPresentAsSheet } from 'ngwr/overlay';\n\nimport type { WrDropdownMenu } from './dropdown-menu';\nimport { WR_DROPDOWN_POSITIONS, type WrDropdownPosition, type WrDropdownTrigger } from './interfaces';\n\n/**\n * Attach to any element to open a `<wr-dropdown-menu>` as a CDK overlay.\n *\n * @example\n * ```html\n * <button [wrDropdown]=\"menu\" position=\"bottom-start\" trigger=\"click\">\n * Actions\n * </button>\n *\n * <wr-dropdown-menu #menu>\n * <wr-dropdown-item icon=\"copy\" (click)=\"copy()\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\" (click)=\"remove()\">Delete</wr-dropdown-item>\n * </wr-dropdown-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/dropdown\n */\nlet triggerUid = 0;\n\n@Directive({\n selector: '[wrDropdown]',\n exportAs: 'wrDropdown',\n host: {\n class: 'wr-dropdown-trigger',\n '[attr.id]': 'triggerId',\n '[attr.aria-haspopup]': '\"menu\"',\n '[attr.aria-expanded]': 'isOpen()',\n '[attr.aria-controls]': 'isOpen() ? menu().menuId() : null',\n '(click)': 'onClick($event)',\n '(keydown)': 'onKeydown($event)',\n '(mouseenter)': 'onMouseEnter()',\n '(mouseleave)': 'onMouseLeave($event)',\n },\n})\nexport class WrDropdown {\n /** Menu to open. Pass a `<wr-dropdown-menu>` template reference. */\n readonly menu = input.required<WrDropdownMenu>({ alias: 'wrDropdown' });\n\n /** How the menu opens. @default 'click' */\n readonly trigger = input<WrDropdownTrigger>('click');\n\n /** Where the menu anchors relative to the trigger. @default 'bottom-start' */\n readonly position = input<WrDropdownPosition>('bottom-start');\n\n /**\n * Present the menu as a full-width bottom-sheet on small viewports instead\n * of an anchored panel. `undefined` follows the app-wide\n * `provideWrResponsiveOverlays()` setting; `true`/`false` overrides it.\n * @default undefined\n */\n readonly responsive = input<boolean | undefined, BooleanInput>(undefined, {\n transform: (v: BooleanInput): boolean | undefined => (v == null ? undefined : coerceBooleanProperty(v)),\n });\n\n /** Fires after the menu opens. */\n readonly opened = output<void>();\n\n /** Fires after the menu closes. */\n readonly closed = output<void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly overlay = inject(WR_OVERLAY);\n /**\n * The reading direction the open menu has to keep up with.\n *\n * Optional inject: `Directionality` is root-provided, so this is never null in\n * an app — but a bare `TestBed` that provides nothing should still get a menu\n * that opens, with simply nothing ambient to follow.\n */\n private readonly dir = inject(Directionality, { optional: true });\n private readonly outsideClick = inject(WrOutsideClick);\n private readonly responsiveConfig = inject(WR_RESPONSIVE_OVERLAYS);\n private readonly vcr = inject(ViewContainerRef);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n /** @internal Public so host bindings can read it. */\n readonly isOpen = signal(false);\n\n /** The id used only when the consumer's element carries none of its own. */\n private readonly fallbackId = `wr-dropdown-trigger-${++triggerUid}`;\n\n /**\n * Id the menu names itself after. The trigger is the CONSUMER's own element, so\n * an `id` they already put there wins: overwriting it broke `<label for>`,\n * `document.getElementById` and any `aria-labelledby` aimed at that button from\n * elsewhere in their app. The generated one is only a fallback so the menu has\n * something to reference.\n *\n * A GETTER, read fresh by the host binding on every pass, rather than a field\n * resolved in the constructor. A static `id=\"…\"` is on the element before a\n * directive is instantiated and so was already honoured; a BOUND `[id]` is\n * not — it lands with the rest of the template's bindings, which run before\n * host bindings but after construction, so the constructor read an empty\n * string, fell through to the fallback, and the host binding then wrote that\n * fallback over the value the template had just set. Everything bound was\n * lost — `[id]`, `[attr.id]` and an interpolated `id=\"dd-{{ n }}\"` alike —\n * while the static form survived, which is the shape that makes it look like\n * a naming convention rather than a defect.\n *\n * `.id` rather than `getAttribute`: it is always a string, and an empty one is\n * no id at all, so it falls through to the fallback.\n */\n protected get triggerId(): string {\n return this.host.nativeElement.id || this.fallbackId;\n }\n\n private overlayRef: OverlayRef | null = null;\n\n constructor() {\n // The host view carrying `[wrDropdown]` can be destroyed while the menu is\n // open — a route change, or an `@if` around the trigger. The overlay lives\n // in the CDK container, not in that view, so nothing removes it unless we do.\n this.destroyRef.onDestroy(() => this.closeOverlay(false));\n\n effect(() => {\n if (this.isOpen()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n }\n\n /** Open the menu. */\n open(): void {\n this.isOpen.set(true);\n }\n\n /** Close the menu. */\n close(): void {\n this.isOpen.set(false);\n }\n\n /** Toggle the menu. */\n toggle(): void {\n this.isOpen.update(v => !v);\n }\n\n // Host listeners\n\n /** @internal */\n /**\n * Whether the pointer, rather than the keyboard, opened the current menu.\n *\n * A hover-opened menu must not take focus — the APG shows a menu on hover and\n * leaves the caret where it was — while a keyboard-opened one must. The\n * trigger MODE cannot answer that on its own: a `trigger=\"hover\"` menu is\n * still openable with Enter, and that open should focus the first item.\n */\n private openedByPointer = false;\n\n protected onClick(event: MouseEvent): void {\n if (this.trigger() !== 'click') return;\n event.stopPropagation();\n this.openedByPointer = false;\n this.toggle();\n }\n\n /** @internal */\n protected onMouseEnter(): void {\n if (this.trigger() !== 'hover') return;\n // A POINTER opened this, so the menu must not take the keyboard with it —\n // see `openedByPointer`.\n this.openedByPointer = true;\n this.isOpen.set(true);\n }\n\n /** @internal */\n protected onMouseLeave(event: MouseEvent): void {\n if (this.trigger() !== 'hover') return;\n const related = event.relatedTarget as Node | null;\n if (related && this.overlayRef?.overlayElement.contains(related)) return;\n this.isOpen.set(false);\n }\n\n // Overlay management\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n // On small viewports (when opted in) detach from the trigger and present\n // the menu as a full-width slide-up sheet pinned to the bottom edge.\n const asSheet = wrPresentAsSheet(this.responsive(), this.responsiveConfig);\n\n const positionStrategy = asSheet\n ? this.overlay.position().global().centerHorizontally().bottom('0')\n : this.overlay\n .position()\n .flexibleConnectedTo(this.host)\n .withPositions(WR_DROPDOWN_POSITIONS[this.position()])\n .withPush(true);\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: asSheet ? this.scrollStrategies.block() : this.scrollStrategies.reposition(),\n width: asSheet ? '100%' : undefined,\n hasBackdrop: asSheet,\n backdropClass: asSheet ? 'wr-overlay-backdrop' : undefined,\n panelClass: asSheet\n ? ['wr-dropdown-overlay', 'wr-overlay-sheet']\n : ['wr-dropdown-overlay', `wr-dropdown-overlay--${this.position()}`],\n });\n\n // `create()` above froze the direction into the ref as a string, and nothing\n // in the CDK ever revisits it. This menu is where it shows first: the docs\n // site keeps its own LTR/RTL switch INSIDE a dropdown, so the flip is made\n // from within the one panel that has to answer it.\n //\n // No callback — `WR_DROPDOWN_POSITIONS` anchors on `start` / `end` and\n // carries no `offsetX`, so letting the CDK re-resolve those against the new\n // direction is the whole job; the sheet has no anchor at all and only needs\n // the `dir` on its host.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n if (asSheet) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.isOpen.set(false));\n }\n\n // Wire trigger id into menu so it can render aria-labelledby.\n this.menu().triggerId.set(this.triggerId);\n\n const portal = new TemplatePortal(this.menu().contentTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // Focus the first menu item after the menu renders — unless a POINTER\n // opened it. This used to be unconditional, so merely sweeping the cursor\n // over a `trigger=\"hover\"` menu yanked the caret out of whatever the user\n // was typing; the APG's own rule is that hover shows a menu and does not\n // move focus into it. A keyboard open (Enter / Space / ArrowDown) still\n // focuses the first item, on a hover trigger too.\n if (!this.openedByPointer) queueMicrotask(() => this.focusItemAt(0));\n\n this.outsideClick\n .outsidePointerEvents(this.overlayRef)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (this.host.nativeElement.contains(event.target as Node)) return;\n this.isOpen.set(false);\n });\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n this.handleMenuKeydown(event);\n });\n\n if (this.trigger() === 'hover') {\n this.overlayRef.overlayElement.addEventListener('mouseleave', this.onOverlayMouseLeave);\n }\n\n this.opened.emit();\n }\n\n /**\n * Tear the overlay down, and tell the host — unless the host is going away\n * with it.\n *\n * `notify: false` is the DESTROY path, and it is not a nicety. An `output()`\n * belongs to the view that declares it, so emitting from `onDestroy` is\n * refused: Angular logs `NG0953: Unexpected emit for destroyed OutputRef` and\n * the listener never runs. Measured — a `(closed)` handler on a dropdown whose\n * host view is removed while the menu is open fired zero times and left a\n * console error behind. There is nobody to notify at that point, because the\n * consumer's own view is being torn down in the same pass; `wr-popconfirm`\n * already disposes without emitting, and this brings the other two into line.\n *\n * The focus hand-back is skipped for the same reason — the host element is on\n * its way out of the document.\n */\n private closeOverlay(notify = true): void {\n if (!this.overlayRef) return;\n if (this.trigger() === 'hover') {\n this.overlayRef.overlayElement.removeEventListener('mouseleave', this.onOverlayMouseLeave);\n }\n // Take the focus back before the pane goes, or it lands on `<body>` and the\n // next Tab starts from the top of the document. Only when focus is actually\n // inside the menu: closing a menu nobody was in must not steal the caret\n // from wherever the user has since moved.\n const active = document.activeElement;\n const focusWasInside = active instanceof Node && this.overlayRef.overlayElement.contains(active);\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (notify) {\n if (focusWasInside) this.host.nativeElement.focus();\n this.closed.emit();\n }\n }\n\n // Keyboard handling\n\n /** @internal Trigger keydown — ArrowDown/Up/Enter/Space open the menu. */\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isOpen()) return;\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp' || event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n // Opened from the keyboard — including on a `hover` trigger, which stays\n // keyboard-operable — so the first item SHOULD take focus.\n this.openedByPointer = false;\n this.open();\n }\n }\n\n private handleMenuKeydown(event: KeyboardEvent): void {\n const items = this.getItems();\n if (items.length === 0 && event.key !== 'Escape' && event.key !== 'Tab') return;\n const current = document.activeElement as HTMLElement | null;\n const idx = current ? items.indexOf(current) : -1;\n\n // CDK's keyboard dispatcher feeds this overlay EVERY document keydown, not\n // just the ones typed into it — and a `trigger=\"hover\"` menu is open with\n // the caret deliberately left wherever the user was (see `openedByPointer`).\n // So ownership is checked here rather than assumed: without it, ArrowDown /\n // ArrowUp / Home / End pressed in an unrelated field were `preventDefault`ed\n // and yanked focus into the menu. The trigger counts as ours — a hover menu\n // that the user has tabbed back to should still open to the keyboard.\n const typedIn = event.target;\n const ours =\n typedIn instanceof Node &&\n (this.host.nativeElement.contains(typedIn) || (this.overlayRef?.overlayElement.contains(typedIn) ?? false));\n // Escape (and Tab) still close from anywhere — routing to the topmost\n // overlay regardless of focus is the dispatcher's whole job. Escape just\n // must not drag the caret onto the trigger from a field the user is in.\n if (!ours && event.key !== 'Escape' && event.key !== 'Tab') return;\n\n switch (event.key) {\n case 'Escape':\n event.preventDefault();\n this.isOpen.set(false);\n if (ours) this.host.nativeElement.focus();\n break;\n case 'Tab':\n // Let focus leave naturally; close the menu.\n this.isOpen.set(false);\n break;\n case 'ArrowDown':\n event.preventDefault();\n this.focusItemAt(idx < items.length - 1 ? idx + 1 : 0);\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.focusItemAt(idx > 0 ? idx - 1 : items.length - 1);\n break;\n case 'Home':\n event.preventDefault();\n this.focusItemAt(0);\n break;\n case 'End':\n event.preventDefault();\n this.focusItemAt(items.length - 1);\n break;\n default:\n break;\n }\n }\n\n private getItems(): readonly HTMLElement[] {\n if (!this.overlayRef) return [];\n return Array.from(\n this.overlayRef.overlayElement.querySelectorAll<HTMLElement>('.wr-dropdown-item:not(.wr-dropdown-item--disabled)')\n );\n }\n\n private focusItemAt(index: number): void {\n const items = this.getItems();\n if (items.length === 0) return;\n const clamped = ((index % items.length) + items.length) % items.length;\n items[clamped]?.focus();\n }\n\n private readonly onOverlayMouseLeave = (event: MouseEvent): void => {\n const related = event.relatedTarget as Node | null;\n if (related && this.host.nativeElement.contains(related)) return;\n this.isOpen.set(false);\n };\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 { Component, TemplateRef, ViewEncapsulation, signal, viewChild } from '@angular/core';\n\nlet uid = 0;\n\n/**\n * Holds the menu content rendered when a {@link WrDropdown} opens.\n *\n * The component itself doesn't render anywhere — the directive grabs its\n * internal `<ng-template>` and portals it into an overlay.\n *\n * @example\n * ```html\n * <button [wrDropdown]=\"menu\">Actions</button>\n * <wr-dropdown-menu #menu>\n * <wr-dropdown-item icon=\"copy\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\">Delete</wr-dropdown-item>\n * </wr-dropdown-menu>\n * ```\n *\n * @see https://ngwr.dev/reference/components/dropdown\n */\n@Component({\n selector: 'wr-dropdown-menu',\n template:\n '<ng-template><div class=\"wr-dropdown-menu\" role=\"menu\" [attr.id]=\"menuId()\" [attr.aria-labelledby]=\"triggerId() || null\"><ng-content /></div></ng-template>',\n exportAs: 'wrDropdownMenu',\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\n host: { '[style.display]': \"'none'\" },\n})\nexport class WrDropdownMenu {\n /** The internal template the directive portals into the overlay. @internal */\n readonly contentTpl = viewChild.required(TemplateRef);\n\n /** Stable id used on the menu element and referenced from the trigger's `aria-controls`. */\n readonly menuId = signal(`wr-dropdown-menu-${++uid}`);\n\n /** Trigger element id, set by the directive for `aria-labelledby` wiring. */\n readonly triggerId = signal<string | null>(null);\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ElementRef, ViewEncapsulation, computed, inject, input } from '@angular/core';\n\nimport { WrIcon, type WrIconName } from 'ngwr/icon';\n\n/**\n * Single row inside a `<wr-dropdown-menu>`.\n *\n * @example\n * ```html\n * <wr-dropdown-item icon=\"copy\" (click)=\"copy()\">Copy</wr-dropdown-item>\n * <wr-dropdown-item icon=\"trash\" disabled>Delete</wr-dropdown-item>\n * ```\n */\n@Component({\n selector: 'wr-dropdown-item',\n templateUrl: './dropdown-item.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'menuitem',\n '[class]': 'classes()',\n '[attr.tabindex]': '-1',\n '[attr.aria-disabled]': 'disabled() ? true : null',\n '(keydown.enter)': 'activate($event)',\n '(keydown.space)': 'activate($event)',\n },\n imports: [WrIcon],\n})\nexport class WrDropdownItem {\n /** Optional leading icon name. @default null */\n readonly icon = input<WrIconName | null>(null);\n\n /** Disable interaction (suppresses pointer + keyboard). @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-dropdown-item'];\n if (this.disabled()) parts.push('wr-dropdown-item--disabled');\n return parts.join(' ');\n });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** @internal Keyboard activation — fires the same click consumers bind to. */\n protected activate(event: Event): void {\n if (this.disabled()) return;\n event.preventDefault();\n this.host.nativeElement.click();\n }\n}\n","@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n","/**\n * Generated bundle index. Do not edit.\n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