ngwr 16.7.1 → 16.9.0
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/charts/donut-chart/styles/_index.scss +9 -3
- package/charts/meter-group/styles/_index.scss +8 -1
- package/charts/sparkline/styles/_index.scss +6 -3
- package/command-palette/styles/_index.scss +10 -0
- package/descriptions/styles/_index.scss +91 -0
- package/fesm2022/ngwr-anchor.mjs +48 -10
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +3 -2
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +17 -0
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart-testing.mjs +27 -0
- package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +54 -6
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group-testing.mjs +27 -0
- package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +54 -6
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline-testing.mjs +27 -0
- package/fesm2022/ngwr-charts-sparkline-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +45 -4
- package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +38 -3
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +4 -3
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +39 -19
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +4 -0
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +7 -2
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +6 -3
- package/fesm2022/ngwr-cookie.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp-testing.mjs +3 -0
- package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +81 -4
- package/fesm2022/ngwr-date-stamp.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +16 -2
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +4 -3
- package/fesm2022/ngwr-density.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +77 -20
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +10 -7
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +12 -0
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +14 -8
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +1 -0
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +4 -5
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +10 -5
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +18 -5
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +18 -5
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +18 -5
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +18 -5
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +18 -5
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +18 -5
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +18 -5
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +18 -5
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +18 -5
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +18 -5
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +18 -5
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-kk.mjs +18 -5
- package/fesm2022/ngwr-i18n-kk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +18 -5
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +18 -5
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +18 -5
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +18 -5
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +18 -5
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +18 -5
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +18 -5
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +18 -5
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +18 -5
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +18 -5
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +18 -5
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +7 -6
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper-testing.mjs +33 -0
- package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +536 -30
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +33 -10
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +24 -10
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +2 -2
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +5 -0
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +5 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +2 -0
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +43 -8
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +51 -2
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +1 -1
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +160 -8
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +2 -2
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +65 -7
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +2 -2
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +1 -2
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +22 -17
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +30 -1
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +1 -1
- package/fesm2022/ngwr-stepper-testing.mjs +7 -1
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +55 -4
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +33 -3
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +4 -0
- package/fesm2022/ngwr-timeline.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +171 -16
- package/fesm2022/ngwr-toolbar.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +8 -3
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +3 -2
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +1 -1
- package/fesm2022/ngwr-utils.mjs +46 -8
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/i18n/ar.json +18 -5
- package/i18n/cs.json +18 -5
- package/i18n/de.json +18 -5
- package/i18n/en.json +18 -5
- package/i18n/es.json +18 -5
- package/i18n/fr.json +18 -5
- package/i18n/he.json +18 -5
- package/i18n/hi.json +18 -5
- package/i18n/id.json +18 -5
- package/i18n/it.json +18 -5
- package/i18n/ja.json +18 -5
- package/i18n/kk.json +18 -5
- package/i18n/ko.json +18 -5
- package/i18n/nl.json +18 -5
- package/i18n/pl.json +18 -5
- package/i18n/pt.json +18 -5
- package/i18n/ru.json +18 -5
- package/i18n/sv.json +18 -5
- package/i18n/tr.json +18 -5
- package/i18n/uk.json +18 -5
- package/i18n/vi.json +18 -5
- package/i18n/zh-TW.json +18 -5
- package/i18n/zh.json +18 -5
- package/image-cropper/styles/_index.scss +30 -1
- package/llms-full.txt +9 -9
- package/package.json +1 -1
- package/schematics/use/rule.js +1 -0
- package/schematics/use/symbol-map.json +2 -0
- package/skills/ngwr/SKILL.md +2 -2
- package/stepper/styles/_index.scss +33 -0
- package/tour/styles/_index.scss +11 -7
- package/types/ngwr-anchor.d.ts +14 -1
- package/types/ngwr-charts-donut-chart-testing.d.ts +32 -3
- package/types/ngwr-charts-donut-chart.d.ts +45 -6
- package/types/ngwr-charts-meter-group-testing.d.ts +29 -1
- package/types/ngwr-charts-meter-group.d.ts +43 -4
- package/types/ngwr-charts-sparkline-testing.d.ts +32 -2
- package/types/ngwr-charts-sparkline.d.ts +42 -3
- package/types/ngwr-checkbox.d.ts +14 -0
- package/types/ngwr-color-picker-testing.d.ts +1 -1
- package/types/ngwr-command-palette.d.ts +2 -1
- package/types/ngwr-date-stamp-testing.d.ts +2 -0
- package/types/ngwr-date-stamp.d.ts +41 -2
- package/types/ngwr-date.d.ts +3 -1
- package/types/ngwr-descriptions.d.ts +33 -5
- package/types/ngwr-dialog.d.ts +11 -6
- package/types/ngwr-directives.d.ts +1 -0
- package/types/ngwr-drawer.d.ts +12 -4
- package/types/ngwr-file-upload.d.ts +1 -1
- package/types/ngwr-form.d.ts +4 -0
- package/types/ngwr-hotkey.d.ts +2 -0
- package/types/ngwr-image-cropper-testing.d.ts +33 -1
- package/types/ngwr-image-cropper.d.ts +214 -6
- package/types/ngwr-input-number.d.ts +14 -2
- package/types/ngwr-input-otp.d.ts +2 -0
- package/types/ngwr-lightbox.d.ts +1 -0
- package/types/ngwr-meta.d.ts +13 -1
- package/types/ngwr-overlay.d.ts +20 -1
- package/types/ngwr-pipes.d.ts +125 -1
- package/types/ngwr-qr.d.ts +17 -0
- package/types/ngwr-slider.d.ts +3 -1
- package/types/ngwr-speed-dial.d.ts +10 -0
- package/types/ngwr-stepper-testing.d.ts +10 -0
- package/types/ngwr-stepper.d.ts +47 -1
- package/types/ngwr-switch.d.ts +13 -0
- package/types/ngwr-toolbar.d.ts +27 -0
- package/types/ngwr-transfer.d.ts +2 -0
- package/types/ngwr-utils.d.ts +61 -2
- package/types/ngwr-version.d.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-directives.mjs","names":["DOCUMENT","DOCUMENT"],"sources":["../../../projects/lib/directives/autofocus.ts","../../../projects/lib/directives/autosize.ts","../../../projects/lib/directives/click-outside.ts","../../../projects/lib/directives/copy-to-clipboard.ts","../../../projects/lib/directives/fit-text.ts","../../../projects/lib/directives/in-view.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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, Injector, afterNextRender, effect, inject, input } from '@angular/core';\n\nimport { wrGetFocusableElements } from 'ngwr/utils';\n\n/**\n * Focus the host element after the first render, or whenever the bound\n * expression turns truthy. `\"first\"` focuses the first focusable element\n * inside the host instead: the control of a form, a card or a dialog body.\n * Disabled and hidden elements are skipped.\n *\n * @example\n * ```html\n * <input wrAutofocus />\n * <input [wrAutofocus]=\"shouldFocus()\" />\n * <form wrAutofocus=\"first\">…</form>\n * <form [wrAutofocus]=\"editing() && 'first'\">…</form>\n * ```\n */\n@Directive({ selector: '[wrAutofocus]' })\nexport class WrAutofocus {\n /**\n * Truthy = focus the host, `'first'` = focus the first focusable element\n * inside it. Defaults to `true` so bare `wrAutofocus` works.\n */\n readonly wrAutofocus = input(true, {\n transform: (value: unknown): boolean | 'first' => (value === 'first' ? value : coerceBooleanProperty(value)),\n });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n constructor() {\n effect(() => {\n const mode = this.wrAutofocus();\n if (!mode) return;\n // After the render, so what the same change drew is there to take focus.\n afterNextRender(\n () => {\n const host = this.el.nativeElement;\n // An explicit negative `tabindex` takes an element out of the Tab order;\n // an editing host with none still reads `tabIndex` -1 and stays eligible.\n const reachable = (el: HTMLElement): boolean => Number(el.getAttribute('tabindex') ?? 0) >= 0;\n (mode === 'first' ? wrGetFocusableElements(host).find(reachable) : host)?.focus();\n },\n { injector: this.injector }\n );\n });\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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport { Directive, ElementRef, PLATFORM_ID, afterEveryRender, effect, inject, input } from '@angular/core';\n\n/**\n * Auto-grow a `<textarea>` to fit its content. Optional `minRows` /\n * `maxRows` bounds the height in rendered rows.\n *\n * @example\n * ```html\n * <textarea wrAutosize minRows=\"2\" maxRows=\"8\" [(ngModel)]=\"text\"></textarea>\n * ```\n */\n@Directive({\n selector: 'textarea[wrAutosize]',\n // Bound rather than a static `style` attribute: a real attribute is refused\n // under `style-src 'self'`, and the textarea then keeps the native resize\n // grip, which fights the directive's own height management.\n host: { '[style.overflow]': \"'hidden'\", '[style.resize]': \"'none'\", '(input)': 'onInput()' },\n})\nexport class WrAutosize {\n /**\n * Smallest height, in rendered rows. The textarea never shrinks below it,\n * so a field that starts empty still reserves the room.\n */\n readonly minRows = input(1, { transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 1)) });\n /**\n * Largest height, in rendered rows. `0` — the default — lets it grow without\n * a ceiling; any other value caps the height and the textarea scrolls past it.\n */\n readonly maxRows = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n private readonly el = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private lastValue: string | null = null;\n\n constructor() {\n // Typing fires `input`, but `[(ngModel)]` / `setValue` write the value\n // without one — a cheap per-render value check catches both, including\n // the initial write that lands after the first render.\n afterEveryRender(() => {\n const value = this.el.nativeElement.value;\n if (value !== this.lastValue) {\n this.lastValue = value;\n this.resize();\n }\n });\n // Resize when `minRows` / `maxRows` change. Read the inputs before the\n // platform check so the effect still tracks them; the measurement itself\n // needs a real layout, which the server has none of (`afterEveryRender`\n // above is browser-only already, so it needs no guard).\n effect(() => {\n this.minRows();\n this.maxRows();\n if (!this.isBrowser) return;\n this.resize();\n });\n }\n\n /** @internal */\n protected onInput(): void {\n this.lastValue = this.el.nativeElement.value;\n this.resize();\n }\n\n /** Recompute height from `scrollHeight`, clamped to min/max rows. */\n private resize(): void {\n const node = this.el.nativeElement;\n const styles = getComputedStyle(node);\n // `line-height: normal` computes to the literal string — derive the\n // row height from the font size instead of guessing a fixed 20px.\n const lineHeight = parseFloat(styles.lineHeight) || parseFloat(styles.fontSize) * 1.25 || 20;\n const paddingY = parseFloat(styles.paddingTop) + parseFloat(styles.paddingBottom);\n const border = (parseFloat(styles.borderTopWidth) || 0) + (parseFloat(styles.borderBottomWidth) || 0);\n\n // Reset to a single row first so `scrollHeight` shrinks as well as grows.\n node.style.height = 'auto';\n const min = this.minRows() * lineHeight + paddingY + border;\n const max = this.maxRows() > 0 ? this.maxRows() * lineHeight + paddingY + border : Infinity;\n const next = Math.min(Math.max(node.scrollHeight + border, min), max);\n node.style.height = `${next}px`;\n node.style.overflowY = node.scrollHeight + border > max ? 'auto' : 'hidden';\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 { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, NgZone, inject, output } from '@angular/core';\n\n/**\n * Fires `(wrClickOutside)` when a pointer event lands outside the host\n * element. Useful for closing custom poppers / menus.\n *\n * @example\n * ```html\n * <div class=\"popup\" (wrClickOutside)=\"close()\"> … </div>\n * ```\n */\n@Directive({ selector: '[wrClickOutside]' })\nexport class WrClickOutside {\n /**\n * Fires on a pointer press that landed outside the host element. Close a\n * menu or commit an inline edit with it; the event is the original click.\n */\n readonly wrClickOutside = output<MouseEvent>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n // Listen outside Angular to avoid CD on every page click; re-enter\n // only when the event lands outside the host.\n this.zone.runOutsideAngular(() => {\n const handler = (event: MouseEvent): void => {\n const target = event.target as Node | null;\n if (target && !this.host.nativeElement.contains(target)) {\n this.zone.run(() => this.wrClickOutside.emit(event));\n }\n };\n this.doc.addEventListener('mousedown', handler, true);\n this.destroyRef.onDestroy(() => {\n this.doc.removeEventListener('mousedown', handler, true);\n });\n });\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 { FocusMonitor, LiveAnnouncer } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, Injector, inject, input, output, signal } from '@angular/core';\n\nimport { WR_COPIED_DURATION } from 'ngwr/clipboard';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrPopover, wrUseTextTooltip } from 'ngwr/popover';\nimport { WrToast } from 'ngwr/toast';\nimport { wrRestoreFocus } from 'ngwr/utils';\n\n/**\n * Copy `wrCopyToClipboard` to the system clipboard on host click.\n *\n * Uses `navigator.clipboard.writeText` when available, with a hidden\n * `<textarea>` + `document.execCommand('copy')` fallback for older browsers\n * and non-secure contexts.\n *\n * After a successful copy the host carries `wr-copy-to-clipboard--copied` for\n * a moment, a tooltip over it reads \"Copied\" and the same text is announced\n * politely. `wrCopyToClipboardToast` shows a toast instead of the tooltip and\n * the announcement. A refused write changes nothing and emits `copyFailed`.\n *\n * @example\n * ```html\n * <button [wrCopyToClipboard]=\"value\">Copy</button>\n * <button [wrCopyToClipboard]=\"rows\" wrCopyToClipboardToast copiedLabel=\"Copied to clipboard\">Copy all</button>\n * ```\n */\n@Directive({\n selector: '[wrCopyToClipboard]',\n exportAs: 'wrCopyToClipboard',\n host: {\n class: 'wr-copy-to-clipboard',\n '[class.wr-copy-to-clipboard--copied]': 'justCopied()',\n '(click)': 'copy()',\n },\n})\nexport class WrCopyToClipboard {\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.clearTimer();\n });\n }\n\n /** The text to copy. */\n readonly wrCopyToClipboard = input.required<string>();\n\n /**\n * Confirm a copy with a toast instead of the tooltip and the announcement.\n *\n * @default false\n */\n readonly wrCopyToClipboardToast = input(false, { transform: coerceBooleanProperty });\n\n /** Text of the tooltip, the announcement and the toast. Falls back to `copyToClipboard.copied`, then `'Copied'`. */\n readonly copiedLabel = input<string | null>(null);\n\n /** Emitted with the copied text once the write succeeds. */\n readonly copied = output<string>();\n\n /** Emitted if the copy fails (denied permission, no clipboard, …). */\n readonly copyFailed = output<unknown>();\n\n /** True for a moment after a successful copy. */\n protected readonly justCopied = signal(false);\n\n private readonly resolvedCopiedLabel = useI18nText(this.copiedLabel, 'copyToClipboard.copied', 'Copied');\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private readonly tooltip = wrUseTextTooltip();\n private readonly hostPopover = inject(WrPopover, { self: true, optional: true });\n private destroyed = false;\n private timer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * Copies the bound text, as a click does: `(copied)` or `(copyFailed)` fires\n * either way. Resolves `true` once the text is on the clipboard and `false`\n * when neither path could write it. It never rejects.\n */\n async copy(): Promise<boolean> {\n const text = this.wrCopyToClipboard();\n const async = this.doc.defaultView?.navigator?.clipboard;\n\n try {\n if (async) {\n try {\n await async.writeText(text);\n } catch {\n // The legacy path is a RECOVERY from the async one, so it only runs\n // when there was an async attempt to recover from. Reached from the\n // fallback's own failure it just repeated the same refused write —\n // two selections and two focus jumps for one press.\n this.fallback(text);\n }\n } else {\n this.fallback(text);\n }\n } catch (error) {\n this.copyFailed.emit(error);\n return false;\n }\n\n // Outside the try because the try's job is the WRITE. The shape this\n // replaced emitted inside it and recovered by calling `fallback` again, so\n // one refused write became two selections, two focus jumps and two `copied`\n // emissions. (A consumer's own `(copied)` handler cannot reach this frame\n // either way: `OutputEmitterRef.emit` catches what a listener throws and\n // hands it to the `ErrorHandler`.)\n // An output refuses to emit once its directive is gone.\n if (this.destroyed) return true;\n this.confirm();\n this.copied.emit(text);\n return true;\n }\n\n private confirm(): void {\n const label = this.resolvedCopiedLabel();\n this.clearTimer();\n this.justCopied.set(true);\n\n if (this.wrCopyToClipboardToast()) {\n this.injector.get(WrToast).show({ type: 'success', message: label, showCopy: false });\n } else {\n // The host's own hover tooltip would sit under this one, in the same place.\n if (this.hostPopover?.mode() === 'tooltip') this.hostPopover.close();\n this.tooltip.show(label);\n void this.injector.get(LiveAnnouncer).announce(label, 'polite', WR_COPIED_DURATION);\n }\n\n this.timer = setTimeout(() => {\n this.justCopied.set(false);\n this.tooltip.hide();\n }, WR_COPIED_DURATION);\n }\n\n private clearTimer(): void {\n if (this.timer !== null) clearTimeout(this.timer);\n this.timer = null;\n }\n\n /**\n * Legacy clipboard write — hidden textarea + `execCommand('copy')`.\n *\n * Two things this has to get right beyond writing the text. `execCommand`\n * REPORTS refusal rather than throwing it: a document without focus hands back\n * `false` and copies nothing, so ignoring the return value shows a \"Copied!\"\n * toast over an unchanged clipboard. And selecting the textarea moves focus\n * into it, so removing the node afterwards drops focus on `<body>` — the user's\n * next Tab restarts from the top of the page, on every copy.\n */\n private fallback(text: string): void {\n const node = this.doc.createElement('textarea');\n node.value = text;\n node.setAttribute('readonly', '');\n node.style.position = 'fixed';\n node.style.top = '0';\n node.style.left = '0';\n node.style.opacity = '0';\n node.style.pointerEvents = 'none';\n\n const previous = this.doc.activeElement;\n this.doc.body.appendChild(node);\n node.select();\n\n try {\n if (!this.doc.execCommand('copy')) throw new Error('The copy command was refused.');\n } finally {\n this.doc.body.removeChild(node);\n if (previous instanceof HTMLElement) wrRestoreFocus(previous, this.focusMonitor);\n }\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DestroyRef, Directive, ElementRef, afterNextRender, effect, inject, input } from '@angular/core';\n\n/**\n * Shrink a block whose text wraps to the width of its longest line.\n *\n * A wrapped block keeps the width it was offered, so a tinted pill with three\n * lines of text carries an empty band of background beside them, and CSS has\n * no way to take it back. The lines are measured and the host's inline `width`\n * is set to the widest one, padding and border included as its `box-sizing`\n * needs. Every line already fits that width, so the line breaks stay where\n * they were. It is measured again when the text changes and when the parent is\n * resized; a block on one line is left alone.\n *\n * The host needs a box that takes a width (block, inline-block, a flex or grid\n * item) and holds text and inline content.\n *\n * @example\n * ```html\n * <wr-tag wrFitText>A label long enough to wrap onto a second line</wr-tag>\n * <p [wrFitText]=\"fit()\">…</p>\n * ```\n */\n@Directive({ selector: '[wrFitText]' })\nexport class WrFitText {\n /** `false` switches the fitting off and removes the width it wrote. Bare `wrFitText` is on. */\n readonly wrFitText = input(true, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private frame = 0;\n private started = false;\n /** The width this directive wrote, so switching off removes that and nothing else. */\n private written = '';\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n const host = this.el.nativeElement;\n // The parent's height follows the host's, and in a shrink-to-fit parent so\n // does its width: only a new inline size can move a line break.\n let offered = -1;\n const resize =\n typeof ResizeObserver === 'undefined'\n ? null\n : new ResizeObserver(([entry]) => {\n if (entry.contentRect.width === offered) return;\n offered = entry.contentRect.width;\n this.schedule();\n });\n const text = new MutationObserver(() => this.schedule());\n\n if (host.parentElement) resize?.observe(host.parentElement);\n // No `attributes`: the width written below must not call the measure back.\n text.observe(host, { characterData: true, childList: true, subtree: true });\n\n this.started = true;\n this.fit();\n\n destroyRef.onDestroy(() => {\n cancelAnimationFrame(this.frame);\n resize?.disconnect();\n text.disconnect();\n });\n });\n\n effect(() => {\n this.wrFitText();\n if (this.started) this.schedule();\n });\n }\n\n private schedule(): void {\n cancelAnimationFrame(this.frame);\n this.frame = requestAnimationFrame(() => this.fit());\n }\n\n private fit(): void {\n const host = this.el.nativeElement;\n\n if (!this.wrFitText()) {\n if (this.written && host.style.width === this.written) host.style.width = '';\n this.written = '';\n return;\n }\n\n // Cleared first, so a parent that grew can take words back onto a line.\n host.style.width = '';\n this.written = '';\n\n const range = host.ownerDocument.createRange();\n range.selectNodeContents(host);\n const rects = Array.from(range.getClientRects()).filter(rect => rect.width > 0);\n if (!rects.length) return;\n\n // Inline children give several rects to one line, so a count says nothing.\n const firstLineEnd = rects[0].bottom;\n if (!rects.some(rect => rect.top >= firstLineEnd)) return;\n\n const start = Math.min(...rects.map(rect => rect.left));\n const end = Math.max(...rects.map(rect => rect.right));\n const style = getComputedStyle(host);\n const px = (value: string): number => parseFloat(value) || 0;\n const box =\n style.boxSizing === 'border-box'\n ? px(style.paddingLeft) + px(style.paddingRight) + px(style.borderLeftWidth) + px(style.borderRightWidth)\n : 0;\n\n // One pixel over: at the exact width, subpixel rounding wraps the longest line again.\n this.written = `${Math.ceil(end - start + box) + 1}px`;\n host.style.width = this.written;\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 { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { DestroyRef, Directive, ElementRef, Service, afterNextRender, inject, input, output } from '@angular/core';\n\ntype ViewCallback = (inView: boolean) => void;\n\ninterface Pool {\n readonly observer: IntersectionObserver;\n readonly targets: Map<Element, Set<ViewCallback>>;\n}\n\n/**\n * One `IntersectionObserver` per distinct `threshold`, shared by every element\n * watched with it. The observer is created with the first element and\n * disconnected with the last. Browser only: call it from `afterNextRender`.\n */\n@Service()\nexport class WrInViewObserver {\n private readonly pools = new Map<number, Pool>();\n\n /**\n * Watch `el` and call `callback` on every change with whether at least `threshold`\n * of it shows: `isIntersecting` alone is true for any sliver. Returns the stop function.\n */\n observe(el: Element, threshold: number, callback: ViewCallback): () => void {\n let pool = this.pools.get(threshold);\n if (!pool) {\n const targets = new Map<Element, Set<ViewCallback>>();\n const observer = new IntersectionObserver(\n entries => {\n for (const entry of entries) {\n // A copy: a callback may stop itself while the set is walked.\n // A fully shown host can report a hair under 1 from subpixel rounding;\n // any lower threshold is compared as it is.\n const inView = entry.isIntersecting && entry.intersectionRatio >= (threshold >= 1 ? 0.999 : threshold);\n for (const cb of [...(targets.get(entry.target) ?? [])]) cb(inView);\n }\n },\n { threshold }\n );\n pool = { observer, targets };\n this.pools.set(threshold, pool);\n }\n\n const { observer, targets } = pool;\n let callbacks = targets.get(el);\n if (!callbacks) {\n callbacks = new Set();\n targets.set(el, callbacks);\n observer.observe(el);\n }\n callbacks.add(callback);\n\n return () => {\n const set = targets.get(el);\n if (!set?.delete(callback) || set.size) return;\n targets.delete(el);\n observer.unobserve(el);\n if (!targets.size) {\n observer.disconnect();\n if (this.pools.get(threshold) === pool) this.pools.delete(threshold);\n }\n };\n }\n}\n\n/**\n * Emits when the host enters or leaves the viewport.\n *\n * `(wrInView)` carries `true` on entering and `false` on leaving, and only on a\n * change: an element that starts out of view emits nothing until it shows up.\n * `wrInViewOnce` stops after the first entry. Every instance with the same\n * `wrInViewThreshold` shares one `IntersectionObserver`. Nothing is observed on\n * the server.\n *\n * @example\n * ```html\n * <section (wrInView)=\"seen.set($event)\" [wrInViewThreshold]=\"0.5\"> … </section>\n * <img wrInViewOnce (wrInView)=\"load()\" />\n * ```\n */\n@Directive({ selector: '[wrInView]' })\nexport class WrInView {\n /** Fires with `true` when the host enters the viewport and `false` when it leaves. */\n readonly wrInView = output<boolean>();\n\n /**\n * The share of the host, from 0 to 1, that must be visible to count as in view.\n * Read once, when the host first renders. A host taller than the viewport never\n * reaches a threshold of 1.\n */\n readonly wrInViewThreshold = input(0, {\n transform: (value: unknown) => Math.min(1, Math.max(0, coerceNumberProperty(value, 0))),\n });\n\n /** Stop watching after the first entry. Bare `wrInViewOnce` is on. */\n readonly wrInViewOnce = input(false, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<Element>>(ElementRef);\n private readonly pool = inject(WrInViewObserver);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n if (typeof IntersectionObserver === 'undefined') return;\n\n let stop: (() => void) | null = null;\n const unwatch = (): void => {\n stop?.();\n stop = null;\n };\n let last = false;\n stop = this.pool.observe(this.el.nativeElement, this.wrInViewThreshold(), inView => {\n if (inView === last) return;\n last = inView;\n this.wrInView.emit(inView);\n if (inView && this.wrInViewOnce()) unwatch();\n });\n destroyRef.onDestroy(unwatch);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAa,cAAb,MAAa,YAAW;CAKb,cAAc,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAC/B,YAAY,UAAuC,UAAU,UAAU,QAAQ,sBAAsB,KAAK;CAAE,CAAA;CAG7F,KAAK,OAAgC,UAAU;CAC/C,WAAW,OAAO,QAAQ;CAE3C,cAAA;EACE,aAAY;GACV,MAAM,OAAO,KAAK,YAAW;GAC7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":["../../../projects/lib/directives/autofocus.ts","../../../projects/lib/directives/autosize.ts","../../../projects/lib/directives/click-outside.ts","../../../projects/lib/directives/copy-to-clipboard.ts","../../../projects/lib/directives/fit-text.ts","../../../projects/lib/directives/in-view.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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, Injector, afterNextRender, effect, inject, input } from '@angular/core';\n\nimport { wrGetFocusableElements } from 'ngwr/utils';\n\n/**\n * Focus the host element after the first render, or whenever the bound\n * expression turns truthy. `\"first\"` focuses the first focusable element\n * inside the host instead: the control of a form, a card or a dialog body.\n * Disabled and hidden elements are skipped.\n *\n * @example\n * ```html\n * <input wrAutofocus />\n * <input [wrAutofocus]=\"shouldFocus()\" />\n * <form wrAutofocus=\"first\">…</form>\n * <form [wrAutofocus]=\"editing() && 'first'\">…</form>\n * ```\n */\n@Directive({ selector: '[wrAutofocus]' })\nexport class WrAutofocus {\n /**\n * Truthy = focus the host, `'first'` = focus the first focusable element\n * inside it. Defaults to `true` so bare `wrAutofocus` works.\n */\n readonly wrAutofocus = input(true, {\n transform: (value: unknown): boolean | 'first' => (value === 'first' ? value : coerceBooleanProperty(value)),\n });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly injector = inject(Injector);\n\n constructor() {\n effect(() => {\n const mode = this.wrAutofocus();\n if (!mode) return;\n // After the render, so what the same change drew is there to take focus.\n afterNextRender(\n () => {\n const host = this.el.nativeElement;\n // An explicit negative `tabindex` takes an element out of the Tab order;\n // an editing host with none still reads `tabIndex` -1 and stays eligible.\n const reachable = (el: HTMLElement): boolean => Number(el.getAttribute('tabindex') ?? 0) >= 0;\n (mode === 'first' ? wrGetFocusableElements(host).find(reachable) : host)?.focus();\n },\n { injector: this.injector }\n );\n });\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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n DestroyRef,\n Directive,\n ElementRef,\n PLATFORM_ID,\n afterEveryRender,\n afterNextRender,\n effect,\n inject,\n input,\n} from '@angular/core';\n\n/**\n * Auto-grow a `<textarea>` to fit its content. Optional `minRows` /\n * `maxRows` bounds the height in rendered rows.\n *\n * @example\n * ```html\n * <textarea wrAutosize minRows=\"2\" maxRows=\"8\" [(ngModel)]=\"text\"></textarea>\n * ```\n */\n@Directive({\n selector: 'textarea[wrAutosize]',\n // Bound rather than a static `style` attribute: a real attribute is refused\n // under `style-src 'self'`, and the textarea then keeps the native resize\n // grip, which fights the directive's own height management.\n host: { '[style.overflow]': \"'hidden'\", '[style.resize]': \"'none'\", '(input)': 'onInput()' },\n})\nexport class WrAutosize {\n /**\n * Smallest height, in rendered rows. The textarea never shrinks below it,\n * so a field that starts empty still reserves the room.\n */\n readonly minRows = input(1, { transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 1)) });\n /**\n * Largest height, in rendered rows. `0` — the default — lets it grow without\n * a ceiling; any other value caps the height and the textarea scrolls past it.\n */\n readonly maxRows = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n private readonly el = inject<ElementRef<HTMLTextAreaElement>>(ElementRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n private readonly destroyRef = inject(DestroyRef);\n\n private lastValue: string | null = null;\n\n constructor() {\n // Typing fires `input`, but `[(ngModel)]` / `setValue` write the value\n // without one — a cheap per-render value check catches both, including\n // the initial write that lands after the first render.\n afterEveryRender(() => {\n const value = this.el.nativeElement.value;\n if (value !== this.lastValue) {\n this.lastValue = value;\n this.resize();\n }\n });\n // A narrower or wider box re-wraps the text without any input, so the\n // width is watched too. Height-only changes are this directive's own writes.\n afterNextRender(() => {\n if (typeof ResizeObserver === 'undefined') return;\n let width = -1;\n const observer = new ResizeObserver(([entry]) => {\n if (entry.contentRect.width === width) return;\n width = entry.contentRect.width;\n this.resize();\n });\n observer.observe(this.el.nativeElement);\n this.destroyRef.onDestroy(() => observer.disconnect());\n });\n // Resize when `minRows` / `maxRows` change. Read the inputs before the\n // platform check so the effect still tracks them; the measurement itself\n // needs a real layout, which the server has none of (`afterEveryRender`\n // above is browser-only already, so it needs no guard).\n effect(() => {\n this.minRows();\n this.maxRows();\n if (!this.isBrowser) return;\n this.resize();\n });\n }\n\n /** @internal */\n protected onInput(): void {\n this.lastValue = this.el.nativeElement.value;\n this.resize();\n }\n\n /** Recompute height from `scrollHeight`, clamped to min/max rows. */\n private resize(): void {\n const node = this.el.nativeElement;\n const styles = getComputedStyle(node);\n // `line-height: normal` computes to the literal string — derive the\n // row height from the font size instead of guessing a fixed 20px.\n const lineHeight = parseFloat(styles.lineHeight) || parseFloat(styles.fontSize) * 1.25 || 20;\n const paddingY = parseFloat(styles.paddingTop) + parseFloat(styles.paddingBottom);\n const border = (parseFloat(styles.borderTopWidth) || 0) + (parseFloat(styles.borderBottomWidth) || 0);\n\n // Reset to a single row first so `scrollHeight` shrinks as well as grows.\n node.style.height = 'auto';\n const min = this.minRows() * lineHeight + paddingY + border;\n const max = this.maxRows() > 0 ? this.maxRows() * lineHeight + paddingY + border : Infinity;\n const next = Math.min(Math.max(node.scrollHeight + border, min), max);\n node.style.height = `${next}px`;\n node.style.overflowY = node.scrollHeight + border > max ? 'auto' : 'hidden';\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 { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, ElementRef, NgZone, inject, output } from '@angular/core';\n\n/**\n * Fires `(wrClickOutside)` when a pointer event lands outside the host\n * element. Useful for closing custom poppers / menus.\n *\n * @example\n * ```html\n * <div class=\"popup\" (wrClickOutside)=\"close()\"> … </div>\n * ```\n */\n@Directive({ selector: '[wrClickOutside]' })\nexport class WrClickOutside {\n /**\n * Fires on a pointer press that landed outside the host element. Close a\n * menu or commit an inline edit with it; the event is the original click.\n */\n readonly wrClickOutside = output<MouseEvent>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly doc = inject(DOCUMENT);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor() {\n // Listen outside Angular to avoid CD on every page click; re-enter\n // only when the event lands outside the host.\n this.zone.runOutsideAngular(() => {\n const handler = (event: MouseEvent): void => {\n const target = event.target as Node | null;\n if (target && !this.host.nativeElement.contains(target)) {\n this.zone.run(() => this.wrClickOutside.emit(event));\n }\n };\n this.doc.addEventListener('mousedown', handler, true);\n this.destroyRef.onDestroy(() => {\n this.doc.removeEventListener('mousedown', handler, true);\n });\n });\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 { FocusMonitor, LiveAnnouncer } from '@angular/cdk/a11y';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DOCUMENT } from '@angular/common';\nimport { DestroyRef, Directive, Injector, inject, input, output, signal } from '@angular/core';\n\nimport { WR_COPIED_DURATION } from 'ngwr/clipboard';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrPopover, wrUseTextTooltip } from 'ngwr/popover';\nimport { WrToast } from 'ngwr/toast';\nimport { wrRestoreFocus } from 'ngwr/utils';\n\n/**\n * Copy `wrCopyToClipboard` to the system clipboard on host click.\n *\n * Uses `navigator.clipboard.writeText` when available, with a hidden\n * `<textarea>` + `document.execCommand('copy')` fallback for older browsers\n * and non-secure contexts.\n *\n * After a successful copy the host carries `wr-copy-to-clipboard--copied` for\n * a moment, a tooltip over it reads \"Copied\" and the same text is announced\n * politely. `wrCopyToClipboardToast` shows a toast instead of the tooltip and\n * the announcement. A refused write changes nothing and emits `copyFailed`.\n *\n * @example\n * ```html\n * <button [wrCopyToClipboard]=\"value\">Copy</button>\n * <button [wrCopyToClipboard]=\"rows\" wrCopyToClipboardToast copiedLabel=\"Copied to clipboard\">Copy all</button>\n * ```\n */\n@Directive({\n selector: '[wrCopyToClipboard]',\n exportAs: 'wrCopyToClipboard',\n host: {\n class: 'wr-copy-to-clipboard',\n '[class.wr-copy-to-clipboard--copied]': 'justCopied()',\n '(click)': 'copy()',\n },\n})\nexport class WrCopyToClipboard {\n constructor() {\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.clearTimer();\n });\n }\n\n /** The text to copy. */\n readonly wrCopyToClipboard = input.required<string>();\n\n /**\n * Confirm a copy with a toast instead of the tooltip and the announcement.\n *\n * @default false\n */\n readonly wrCopyToClipboardToast = input(false, { transform: coerceBooleanProperty });\n\n /** Text of the tooltip, the announcement and the toast. Falls back to `copyToClipboard.copied`, then `'Copied'`. */\n readonly copiedLabel = input<string | null>(null);\n\n /** Emitted with the copied text once the write succeeds. */\n readonly copied = output<string>();\n\n /** Emitted if the copy fails (denied permission, no clipboard, …). */\n readonly copyFailed = output<unknown>();\n\n /** True for a moment after a successful copy. */\n protected readonly justCopied = signal(false);\n\n private readonly resolvedCopiedLabel = useI18nText(this.copiedLabel, 'copyToClipboard.copied', 'Copied');\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private readonly tooltip = wrUseTextTooltip();\n private readonly hostPopover = inject(WrPopover, { self: true, optional: true });\n private destroyed = false;\n private timer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * Copies the bound text, as a click does: `(copied)` or `(copyFailed)` fires\n * either way. Resolves `true` once the text is on the clipboard and `false`\n * when neither path could write it. It never rejects.\n */\n async copy(): Promise<boolean> {\n const text = this.wrCopyToClipboard();\n const async = this.doc.defaultView?.navigator?.clipboard;\n\n try {\n if (async) {\n try {\n await async.writeText(text);\n } catch {\n // The legacy path is a RECOVERY from the async one, so it only runs\n // when there was an async attempt to recover from. Reached from the\n // fallback's own failure it just repeated the same refused write —\n // two selections and two focus jumps for one press.\n this.fallback(text);\n }\n } else {\n this.fallback(text);\n }\n } catch (error) {\n this.copyFailed.emit(error);\n return false;\n }\n\n // Outside the try because the try's job is the WRITE. The shape this\n // replaced emitted inside it and recovered by calling `fallback` again, so\n // one refused write became two selections, two focus jumps and two `copied`\n // emissions. (A consumer's own `(copied)` handler cannot reach this frame\n // either way: `OutputEmitterRef.emit` catches what a listener throws and\n // hands it to the `ErrorHandler`.)\n // An output refuses to emit once its directive is gone.\n if (this.destroyed) return true;\n this.confirm();\n this.copied.emit(text);\n return true;\n }\n\n private confirm(): void {\n const label = this.resolvedCopiedLabel();\n this.clearTimer();\n this.justCopied.set(true);\n\n if (this.wrCopyToClipboardToast()) {\n this.injector.get(WrToast).show({ type: 'success', message: label, showCopy: false });\n } else {\n // The host's own hover tooltip would sit under this one, in the same place.\n if (this.hostPopover?.mode() === 'tooltip') this.hostPopover.close();\n this.tooltip.show(label);\n void this.injector.get(LiveAnnouncer).announce(label, 'polite', WR_COPIED_DURATION);\n }\n\n this.timer = setTimeout(() => {\n this.justCopied.set(false);\n this.tooltip.hide();\n }, WR_COPIED_DURATION);\n }\n\n private clearTimer(): void {\n if (this.timer !== null) clearTimeout(this.timer);\n this.timer = null;\n }\n\n /**\n * Legacy clipboard write — hidden textarea + `execCommand('copy')`.\n *\n * Two things this has to get right beyond writing the text. `execCommand`\n * REPORTS refusal rather than throwing it: a document without focus hands back\n * `false` and copies nothing, so ignoring the return value shows a \"Copied!\"\n * toast over an unchanged clipboard. And selecting the textarea moves focus\n * into it, so removing the node afterwards drops focus on `<body>` — the user's\n * next Tab restarts from the top of the page, on every copy.\n */\n private fallback(text: string): void {\n const node = this.doc.createElement('textarea');\n node.value = text;\n node.setAttribute('readonly', '');\n node.style.position = 'fixed';\n node.style.top = '0';\n node.style.left = '0';\n node.style.opacity = '0';\n node.style.pointerEvents = 'none';\n\n const previous = this.doc.activeElement;\n this.doc.body.appendChild(node);\n node.select();\n\n try {\n if (!this.doc.execCommand('copy')) throw new Error('The copy command was refused.');\n } finally {\n this.doc.body.removeChild(node);\n if (previous instanceof HTMLElement) wrRestoreFocus(previous, this.focusMonitor);\n }\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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { DestroyRef, Directive, ElementRef, afterNextRender, effect, inject, input } from '@angular/core';\n\n/**\n * Shrink a block whose text wraps to the width of its longest line.\n *\n * A wrapped block keeps the width it was offered, so a tinted pill with three\n * lines of text carries an empty band of background beside them, and CSS has\n * no way to take it back. The lines are measured and the host's inline `width`\n * is set to the widest one, padding and border included as its `box-sizing`\n * needs. Every line already fits that width, so the line breaks stay where\n * they were. It is measured again when the text changes and when the parent is\n * resized; a block on one line is left alone.\n *\n * The host needs a box that takes a width (block, inline-block, a flex or grid\n * item) and holds text and inline content.\n *\n * @example\n * ```html\n * <wr-tag wrFitText>A label long enough to wrap onto a second line</wr-tag>\n * <p [wrFitText]=\"fit()\">…</p>\n * ```\n */\n@Directive({ selector: '[wrFitText]' })\nexport class WrFitText {\n /** `false` switches the fitting off and removes the width it wrote. Bare `wrFitText` is on. */\n readonly wrFitText = input(true, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private frame = 0;\n private started = false;\n /** The width this directive wrote, so switching off removes that and nothing else. */\n private written = '';\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n const host = this.el.nativeElement;\n // The parent's height follows the host's, and in a shrink-to-fit parent so\n // does its width: only a new inline size can move a line break.\n let offered = -1;\n const resize =\n typeof ResizeObserver === 'undefined'\n ? null\n : new ResizeObserver(([entry]) => {\n if (entry.contentRect.width === offered) return;\n offered = entry.contentRect.width;\n this.schedule();\n });\n const text = new MutationObserver(() => this.schedule());\n\n if (host.parentElement) resize?.observe(host.parentElement);\n // No `attributes`: the width written below must not call the measure back.\n text.observe(host, { characterData: true, childList: true, subtree: true });\n\n this.started = true;\n this.fit();\n\n destroyRef.onDestroy(() => {\n cancelAnimationFrame(this.frame);\n resize?.disconnect();\n text.disconnect();\n });\n });\n\n effect(() => {\n this.wrFitText();\n if (this.started) this.schedule();\n });\n }\n\n private schedule(): void {\n cancelAnimationFrame(this.frame);\n this.frame = requestAnimationFrame(() => this.fit());\n }\n\n private fit(): void {\n const host = this.el.nativeElement;\n\n if (!this.wrFitText()) {\n if (this.written && host.style.width === this.written) host.style.width = '';\n this.written = '';\n return;\n }\n\n // Cleared first, so a parent that grew can take words back onto a line.\n host.style.width = '';\n this.written = '';\n\n const range = host.ownerDocument.createRange();\n range.selectNodeContents(host);\n const rects = Array.from(range.getClientRects()).filter(rect => rect.width > 0);\n if (!rects.length) return;\n\n // Inline children give several rects to one line, so a count says nothing.\n const firstLineEnd = rects[0].bottom;\n if (!rects.some(rect => rect.top >= firstLineEnd)) return;\n\n const start = Math.min(...rects.map(rect => rect.left));\n const end = Math.max(...rects.map(rect => rect.right));\n const style = getComputedStyle(host);\n const px = (value: string): number => parseFloat(value) || 0;\n const box =\n style.boxSizing === 'border-box'\n ? px(style.paddingLeft) + px(style.paddingRight) + px(style.borderLeftWidth) + px(style.borderRightWidth)\n : 0;\n\n // One pixel over: at the exact width, subpixel rounding wraps the longest line again.\n this.written = `${Math.ceil(end - start + box) + 1}px`;\n host.style.width = this.written;\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 { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { DestroyRef, Directive, ElementRef, Service, afterNextRender, inject, input, output } from '@angular/core';\n\ntype ViewCallback = (inView: boolean) => void;\n\ninterface Pool {\n readonly observer: IntersectionObserver;\n readonly targets: Map<Element, Set<ViewCallback>>;\n}\n\n/**\n * One `IntersectionObserver` per distinct `threshold`, shared by every element\n * watched with it. The observer is created with the first element and\n * disconnected with the last. Browser only: call it from `afterNextRender`.\n */\n@Service()\nexport class WrInViewObserver {\n private readonly pools = new Map<number, Pool>();\n\n /**\n * Watch `el` and call `callback` on every change with whether at least `threshold`\n * of it shows: `isIntersecting` alone is true for any sliver. Returns the stop function.\n */\n observe(el: Element, threshold: number, callback: ViewCallback): () => void {\n let pool = this.pools.get(threshold);\n if (!pool) {\n const targets = new Map<Element, Set<ViewCallback>>();\n const observer = new IntersectionObserver(\n entries => {\n for (const entry of entries) {\n // A copy: a callback may stop itself while the set is walked.\n // A fully shown host can report a hair under 1 from subpixel rounding;\n // any lower threshold is compared as it is.\n const inView = entry.isIntersecting && entry.intersectionRatio >= (threshold >= 1 ? 0.999 : threshold);\n for (const cb of [...(targets.get(entry.target) ?? [])]) cb(inView);\n }\n },\n { threshold }\n );\n pool = { observer, targets };\n this.pools.set(threshold, pool);\n }\n\n const { observer, targets } = pool;\n let callbacks = targets.get(el);\n if (!callbacks) {\n callbacks = new Set();\n targets.set(el, callbacks);\n observer.observe(el);\n }\n callbacks.add(callback);\n\n return () => {\n const set = targets.get(el);\n if (!set?.delete(callback) || set.size) return;\n targets.delete(el);\n observer.unobserve(el);\n if (!targets.size) {\n observer.disconnect();\n if (this.pools.get(threshold) === pool) this.pools.delete(threshold);\n }\n };\n }\n}\n\n/**\n * Emits when the host enters or leaves the viewport.\n *\n * `(wrInView)` carries `true` on entering and `false` on leaving, and only on a\n * change: an element that starts out of view emits nothing until it shows up.\n * `wrInViewOnce` stops after the first entry. Every instance with the same\n * `wrInViewThreshold` shares one `IntersectionObserver`. Nothing is observed on\n * the server.\n *\n * @example\n * ```html\n * <section (wrInView)=\"seen.set($event)\" [wrInViewThreshold]=\"0.5\"> … </section>\n * <img wrInViewOnce (wrInView)=\"load()\" />\n * ```\n */\n@Directive({ selector: '[wrInView]' })\nexport class WrInView {\n /** Fires with `true` when the host enters the viewport and `false` when it leaves. */\n readonly wrInView = output<boolean>();\n\n /**\n * The share of the host, from 0 to 1, that must be visible to count as in view.\n * Read once, when the host first renders. A host taller than the viewport never\n * reaches a threshold of 1.\n */\n readonly wrInViewThreshold = input(0, {\n transform: (value: unknown) => Math.min(1, Math.max(0, coerceNumberProperty(value, 0))),\n });\n\n /** Stop watching after the first entry. Bare `wrInViewOnce` is on. */\n readonly wrInViewOnce = input(false, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<Element>>(ElementRef);\n private readonly pool = inject(WrInViewObserver);\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n if (typeof IntersectionObserver === 'undefined') return;\n\n let stop: (() => void) | null = null;\n const unwatch = (): void => {\n stop?.();\n stop = null;\n };\n let last = false;\n stop = this.pool.observe(this.el.nativeElement, this.wrInViewThreshold(), inView => {\n if (inView === last) return;\n last = inView;\n this.wrInView.emit(inView);\n if (inView && this.wrInViewOnce()) unwatch();\n });\n destroyRef.onDestroy(unwatch);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,IAAa,cAAb,MAAa,YAAW;CAKb,cAAc,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAC/B,YAAY,UAAuC,UAAU,UAAU,QAAQ,sBAAsB,KAAK;CAAE,CAAA;CAG7F,KAAK,OAAgC,UAAU;CAC/C,WAAW,OAAO,QAAQ;CAE3C,cAAA;EACE,aAAY;GACV,MAAM,OAAO,KAAK,YAAW;GAC7B,IAAI,CAAC,MAAM;GAEX,sBACO;IACH,MAAM,OAAO,KAAK,GAAG;IAGrB,MAAM,aAAa,OAA6B,OAAO,GAAG,aAAa,UAAU,KAAK,CAAC,KAAK;IAC5F,CAAC,SAAS,UAAU,uBAAuB,IAAI,CAAC,CAAC,KAAK,SAAS,IAAI,KAAA,EAAO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A;EAAU,MAAA,CAAA,EAAE,UAAU,aAAY,CAAE"}
|
package/fesm2022/ngwr-drawer.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { Component, DestroyRef, Directive, EnvironmentInjector, InjectionToken, Injector, PLATFORM_ID, Service, TemplateRef, ViewContainerRef, ViewEncapsulation, afterEveryRender, computed, contentChild, effect, inject, input, model, viewChild } from "@angular/core";
|
|
2
|
+
import { Component, DestroyRef, Directive, ElementRef, EnvironmentInjector, InjectionToken, Injector, PLATFORM_ID, Service, TemplateRef, ViewContainerRef, ViewEncapsulation, afterEveryRender, computed, contentChild, effect, inject, input, model, viewChild } from "@angular/core";
|
|
3
3
|
import { coerceBooleanProperty } from "@angular/cdk/coercion";
|
|
4
4
|
import { Location, isPlatformBrowser } from "@angular/common";
|
|
5
|
-
import { wrCheckStyles, wrRestoreFocus, wrToClassList } from "ngwr/utils";
|
|
5
|
+
import { wrCheckStyles, wrIsComposing, wrRestoreFocus, wrToClassList } from "ngwr/utils";
|
|
6
6
|
import { WrI18n, useI18nText } from "ngwr/i18n";
|
|
7
7
|
import { Directionality } from "@angular/cdk/bidi";
|
|
8
8
|
import { ScrollStrategyOptions } from "@angular/cdk/overlay";
|
|
9
9
|
import { ComponentPortal, TemplatePortal } from "@angular/cdk/portal";
|
|
10
10
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
11
|
-
import { WR_OVERLAY, WrOverlayOrder, wrAppendOverlayClose, wrFocusOverlay, wrFollowDirection } from "ngwr/overlay";
|
|
11
|
+
import { WR_OVERLAY, WrOverlayOrder, WrScrollBlock, wrAppendOverlayClose, wrFocusOverlay, wrFollowDirection } from "ngwr/overlay";
|
|
12
12
|
import { ConfigurableFocusTrapFactory, FocusMonitor, FocusTrapFactory } from "@angular/cdk/a11y";
|
|
13
13
|
import { ReplaySubject } from "rxjs";
|
|
14
14
|
/**
|
|
@@ -22,7 +22,11 @@ var WrDrawerTitle = class WrDrawerTitle {
|
|
|
22
22
|
constructor() {
|
|
23
23
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("drawer");
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
host = inject(ElementRef);
|
|
26
|
+
fallbackId = `wr-drawer-title-${++uid}`;
|
|
27
|
+
get id() {
|
|
28
|
+
return this.host.nativeElement.id || this.fallbackId;
|
|
29
|
+
}
|
|
26
30
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
27
31
|
minVersion: "12.0.0",
|
|
28
32
|
version: "22.3.0",
|
|
@@ -132,6 +136,7 @@ var WrDrawer = class WrDrawer {
|
|
|
132
136
|
focusMonitor = inject(FocusMonitor);
|
|
133
137
|
overlay = inject(WR_OVERLAY);
|
|
134
138
|
order = inject(WrOverlayOrder);
|
|
139
|
+
scrollBlock = inject(WrScrollBlock);
|
|
135
140
|
vcr = inject(ViewContainerRef);
|
|
136
141
|
destroyRef = inject(DestroyRef);
|
|
137
142
|
injector = inject(Injector);
|
|
@@ -199,7 +204,7 @@ var WrDrawer = class WrDrawer {
|
|
|
199
204
|
hasBackdrop: modal,
|
|
200
205
|
backdropClass: "wr-drawer-backdrop",
|
|
201
206
|
panelClass: ["wr-drawer-overlay", `wr-drawer-overlay--${pos}`],
|
|
202
|
-
scrollStrategy: modal ? this.
|
|
207
|
+
scrollStrategy: modal ? this.scrollBlock.strategy() : this.overlay.scrollStrategies.noop(),
|
|
203
208
|
eventPredicate: modal ? void 0 : () => drawerHasFocus(this.overlayRef) || focusIsLost(),
|
|
204
209
|
...this.size(pos)
|
|
205
210
|
});
|
|
@@ -218,7 +223,7 @@ var WrDrawer = class WrDrawer {
|
|
|
218
223
|
}
|
|
219
224
|
if (this.closeOnBackdropClick()) this.overlayRef.backdropClick().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.open.set(false));
|
|
220
225
|
if (this.closeOnEscape()) this.overlayRef.keydownEvents().pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
|
|
221
|
-
if (event.key === "Escape") {
|
|
226
|
+
if (event.key === "Escape" && !wrIsComposing(event)) {
|
|
222
227
|
event.preventDefault();
|
|
223
228
|
this.open.set(false);
|
|
224
229
|
}
|
|
@@ -609,6 +614,7 @@ const BACKDROP_CLASS = "wr-drawer-backdrop";
|
|
|
609
614
|
var WrDrawerManager = class WrDrawerManager {
|
|
610
615
|
overlay = inject(WR_OVERLAY);
|
|
611
616
|
scrollStrategies = inject(ScrollStrategyOptions);
|
|
617
|
+
scrollBlock = inject(WrScrollBlock);
|
|
612
618
|
parentInjector = inject(EnvironmentInjector);
|
|
613
619
|
focusTrapFactory = inject(ConfigurableFocusTrapFactory);
|
|
614
620
|
plainFocusTrapFactory = inject(FocusTrapFactory);
|
|
@@ -630,7 +636,7 @@ var WrDrawerManager = class WrDrawerManager {
|
|
|
630
636
|
let ref = null;
|
|
631
637
|
const overlayRef = this.overlay.create({
|
|
632
638
|
positionStrategy,
|
|
633
|
-
scrollStrategy: modal ? this.
|
|
639
|
+
scrollStrategy: modal ? this.scrollBlock.strategy() : this.scrollStrategies.noop(),
|
|
634
640
|
eventPredicate: modal ? void 0 : () => drawerHasFocus(ref) || focusIsLost(),
|
|
635
641
|
hasBackdrop: modal,
|
|
636
642
|
backdropClass: BACKDROP_CLASS,
|
|
@@ -669,7 +675,7 @@ var WrDrawerManager = class WrDrawerManager {
|
|
|
669
675
|
overlayRef.detachments().subscribe(this.order.add(overlayRef.hostElement, options.toasts));
|
|
670
676
|
if (options.closeOnBackdropClick !== false) overlayRef.backdropClick().subscribe(() => drawerRef.close());
|
|
671
677
|
if (options.closeOnEscape !== false) overlayRef.keydownEvents().subscribe((event) => {
|
|
672
|
-
if (event.key === "Escape") {
|
|
678
|
+
if (event.key === "Escape" && !wrIsComposing(event)) {
|
|
673
679
|
event.preventDefault();
|
|
674
680
|
drawerRef.close();
|
|
675
681
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-drawer.mjs","names":[],"sources":["../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/drawer-focus.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"],"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\nimport { wrCheckStyles } from 'ngwr/utils';\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 exportAs: 'wrDrawerTitle',\n host: { class: 'wr-drawer__title', '[attr.id]': 'id' },\n})\nexport class WrDrawerTitle {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\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 { OverlayRef } from '@angular/cdk/overlay';\n\n/**\n * Whether focus is inside the drawer's panel. Shared by the non-modal Escape\n * gate and the close path, in `<wr-drawer>` and in `WrDrawerRef`.\n *\n * @internal\n */\nexport function drawerHasFocus(overlayRef: OverlayRef | null): boolean {\n const active = typeof document === 'undefined' ? null : document.activeElement;\n return !!active && !!overlayRef?.overlayElement?.contains(active);\n}\n\n/**\n * Whether nothing has focus any more — `<body>` or nothing at all. A non-modal\n * drawer takes Escape, and returns focus to its opener on close, only from\n * inside itself or from here: a click on the panel's own text focuses nothing\n * and lands focus here, while a reader who has clicked or tabbed on into the\n * page is left where they are.\n *\n * @internal\n */\nexport function focusIsLost(): boolean {\n if (typeof document === 'undefined') return false;\n const active = document.activeElement;\n return !active || active === document.body;\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 { ConfigurableFocusTrapFactory, type FocusTrap, FocusTrapFactory, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport type { GlobalPositionStrategy, OverlayRef, OverlaySizeConfig } 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, WrOverlayOrder, wrFocusOverlay, wrFollowDirection } from 'ngwr/overlay';\nimport { wrToClassList, wrCheckStyles, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport type { WrDrawerAutoFocus, WrDrawerPosition } from './types';\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 * 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 /**\n * Show the dimming backdrop, and with it make the drawer MODAL: focus is\n * trapped inside, the panel is announced with `aria-modal=\"true\"`, and the\n * page behind it does not scroll.\n *\n * `false` makes it a NON-MODAL side panel (since v15). The page stays\n * clickable, scrollable and reachable with Tab; the panel keeps\n * `role=\"dialog\"` without `aria-modal`. Focus still moves into it on open,\n * Escape closes it unless focus has moved on to the page, and on close\n * focus goes back to the opener unless the reader has moved on likewise.\n * Read when the drawer opens. @default true\n */\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 /**\n * Extra CSS classes for the drawer's panel — the box that slides in.\n *\n * On the panel rather than on the CDK pane, because that is the element\n * `WrDrawerManager.open({ panelClass })` styles too: there the content IS the\n * pane, so one name has to mean the same surface on both paths.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Where the global toast stack paints while the drawer is open. `'below'`\n * keeps it under the drawer and its backdrop. Read when the drawer opens.\n * @default 'above'\n */\n readonly toasts = input<'above' | 'below'>('above');\n\n /**\n * Where focus goes when the drawer opens: `'dialog'` focuses the panel itself\n * with no ring so the first Tab reaches the first control, `'first-tabbable'`\n * focuses the first tabbable element, `false` moves nothing. An element\n * marked `cdkFocusInitial` wins in every mode. Read when the drawer opens.\n * @default 'dialog'\n */\n readonly autoFocus = input<WrDrawerAutoFocus>('dialog');\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 panelClasses(): 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 // 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 wrToClassList(parts, this.panelClass()).join(' ');\n }\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly order = inject(WrOverlayOrder);\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 plainFocusTrapFactory = inject(FocusTrapFactory);\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 `WR_OVERLAY` parents to the\n * 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: FocusTrap | null = null;\n private previouslyFocused: HTMLElement | null = null;\n /** Whether the open panel is modal — `hasBackdrop` as it was when it opened. */\n private modal = true;\n /** The side the open overlay sits on. */\n private side: WrDrawerPosition = 'right';\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\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 positionStrategy(pos: WrDrawerPosition): GlobalPositionStrategy {\n const strategy = this.overlay\n .position()\n .global()\n [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n if (pos === 'top') strategy.top();\n else if (pos === 'bottom') strategy.bottom();\n else strategy.centerVertically();\n return strategy;\n }\n\n private size(pos: WrDrawerPosition): OverlaySizeConfig {\n const isHorizontal = pos === 'left' || pos === 'right';\n return {\n width: isHorizontal ? this.width() : '100vw',\n height: isHorizontal ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (this.maxHeight() ?? undefined),\n };\n }\n\n /**\n * Carry `position`, `width`, `height` and `maxHeight` over to the open\n * overlay. The CDK reads them once, in `create()`.\n */\n private syncOverlay(ref: OverlayRef): void {\n const pos = this.position();\n if (pos !== this.side) {\n ref.removePanelClass(`wr-drawer-overlay--${this.side}`);\n ref.addPanelClass(`wr-drawer-overlay--${pos}`);\n this.side = pos;\n ref.updatePositionStrategy(this.positionStrategy(pos));\n }\n ref.updateSize(this.size(pos));\n }\n\n private openOverlay(): void {\n if (this.overlayRef) {\n this.syncOverlay(this.overlayRef);\n return;\n }\n\n const pos = this.position();\n this.side = pos;\n const modal = this.hasBackdrop();\n this.modal = modal;\n\n this.overlayRef = this.overlay.create({\n positionStrategy: this.positionStrategy(pos),\n hasBackdrop: modal,\n backdropClass: 'wr-drawer-backdrop',\n panelClass: ['wr-drawer-overlay', `wr-drawer-overlay--${pos}`],\n // A non-modal panel leaves the page scrolling under it: nothing covers\n // the page, so a blocked scroll would only freeze what the reader can\n // still see and click.\n scrollStrategy: modal ? this.overlay.scrollStrategies.block() : this.overlay.scrollStrategies.noop(),\n // The CDK hands Escape to the topmost overlay wherever focus is. That is\n // right for a modal, where focus cannot be anywhere else, and wrong for a\n // panel beside a live page: an Escape meant for a field on the page\n // closed the drawer. Declined, the key walks on to the next overlay.\n // Focus on `<body>` still counts: a click on the panel's own text\n // focuses nothing, so that is where a reader inside it usually is.\n eventPredicate: modal ? undefined : () => drawerHasFocus(this.overlayRef) || focusIsLost(),\n ...this.size(pos),\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 this.overlayRef.detachments().subscribe(this.order.add(this.overlayRef.hostElement, this.toasts()));\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 if (modal) host.setAttribute('aria-modal', 'true');\n // Non-modal: a trap with no anchors and no inert strategy, which only\n // moves focus in — `cdkFocusInitial` honoured the same way — and then\n // lets Tab carry on out into the page.\n this.focusTrap = modal ? this.focusTrapFactory.create(host) : this.plainFocusTrapFactory.create(host, true);\n wrFocusOverlay(host, this.focusTrap, this.autoFocus(), this.injector);\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 // Read before disposal, which takes the focused element out of the page.\n const returnFocus = this.modal || drawerHasFocus(this.overlayRef) || focusIsLost();\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (returnFocus && restore && typeof restore.focus === 'function') {\n wrRestoreFocus(restore, this.focusMonitor);\n }\n }\n}\n","<ng-template>\n <div [class]=\"panelClasses()\">\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 FocusTrap, FocusMonitor } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef, Injector } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\nimport { wrRestoreFocus } from 'ngwr/utils';\n\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\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: FocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n /** @internal — `false` for a drawer opened with `hasBackdrop: false`. */\n modal = true;\n\n /**\n * @param _overlayRef the overlay the drawer is mounted in.\n * @param injector where the focus hand-back finds the CDK `FocusMonitor`; without\n * one it is a plain `focus()`.\n */\n private readonly focusMonitor: FocusMonitor | null;\n\n constructor(\n private readonly _overlayRef: OverlayRef,\n injector?: Injector\n ) {\n // Resolved now: the injector may be gone by the time the drawer closes.\n this.focusMonitor = injector?.get(FocusMonitor, null) ?? null;\n }\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 // A non-modal drawer sends focus back only from inside itself, or when it\n // has been lost: a reader already working on the page stays there. Read\n // before disposal, which takes the focused element out of the page.\n const returnFocus = this.modal || drawerHasFocus(this._overlayRef) || focusIsLost();\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 (returnFocus && restore && typeof restore.focus === 'function') {\n wrRestoreFocus(restore, this.focusMonitor);\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, FocusTrapFactory } 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, WrOverlayOrder, wrAppendOverlayClose, wrFocusOverlay, wrFollowDirection } from 'ngwr/overlay';\nimport { wrToClassList } from 'ngwr/utils';\n\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport { WrDrawerRef } from './drawer-ref';\nimport { WR_DRAWER_DATA, WR_DRAWER_REF } from './tokens';\nimport type { WrDrawerOptions, WrDrawerPosition } from './types';\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 drawers render into NGWR's own overlay container\n * and never collide with other CDK consumers (Material, NG-ZORRO, etc.).\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 plainFocusTrapFactory = inject(FocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly i18n = inject(WrI18n);\n private readonly location = inject(Location);\n private readonly order = inject(WrOverlayOrder);\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 = wrToClassList(\n 'wr-drawer-overlay',\n `wr-drawer-overlay--${position}`,\n 'wr-drawer__panel',\n `wr-drawer__panel--${position}`,\n options.rounded && 'wr-drawer__panel--rounded',\n options.safeArea && 'wr-drawer__panel--safe-area',\n options.panelClass\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 // No backdrop means NON-MODAL, the same rule as `<wr-drawer>`: no trap, no\n // `aria-modal`, no scroll block, and Escape only from inside the panel —\n // or from `<body>`, where a click on the panel's own text leaves focus.\n const modal = options.hasBackdrop !== false;\n // Assigned on the next statement; the predicate only runs from a keydown.\n let ref: OverlayRef | null = null;\n\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: modal ? this.scrollStrategies.block() : this.scrollStrategies.noop(),\n eventPredicate: modal ? undefined : () => drawerHasFocus(ref) || focusIsLost(),\n hasBackdrop: modal,\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 ref = overlayRef;\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, this.parentInjector);\n drawerRef.modal = modal;\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 overlayRef.detachments().subscribe(this.order.add(overlayRef.hostElement, options.toasts));\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 if (modal) 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. A non-modal\n // drawer only gets the second half: a trap with no anchors and no inert\n // strategy moves focus in and leaves Tab free to walk out to the page.\n const trap = modal ? this.focusTrapFactory.create(host) : this.plainFocusTrapFactory.create(host, true);\n drawerRef.focusTrap = trap;\n wrFocusOverlay(host, trap, options.autoFocus ?? 'dialog', this.parentInjector);\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. (`wrReadI18nText` 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\nimport { wrCheckStyles } from 'ngwr/utils';\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 constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\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, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\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: 'wr-drawer__footer', '[class]': 'classes()' },\n})\nexport class WrDrawerFooter {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\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 { wrCheckStyles } from 'ngwr/utils';\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 constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\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"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,IAAI,MAAM;AAqBV,IAAa,gBAAb,MAAa,cAAa;CACxB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,QAAQ;CAC3E;CAGS,KAAK,mBAAmB,EAAE;CANxB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAa,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,WAAA,KAAA;GAAA,gBAAA;EAAA;EAAA,UAAA,CAAA,eAAA;EAAA,UAAA;CAAA,CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EALzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM;IAAE,OAAO;IAAoB,aAAa;G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,QAAS;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAClE,OAAO;EAGP,YAAW,UAAU,UAAU,KAAK,SAAY;CAAM,CAAA;CAGvC,SAAS,OAAO,UAAU,EAAE,UAAU,KAAI,CAAE;CAC5C,MAAM,OAAgC,eAAe,EAAE,UAAU,KAAI,CAAE;CAE9E,QAAK;EAGb,IAAI,KAAK,QAAQ;GACf,KAAK,OAAO,KAAK,IAAI,KAAK;GAC1B;EACF;EACA,KAAK,KAAK,MAAM,KAAK,OAAM,CAAE;CAC/B;CA3BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAa,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,QAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,WAAA,EAAA,SAAA,UAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAJzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EAAE,WAAW,UAAS;EAC7B,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-drawer.mjs","names":[],"sources":["../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/drawer-focus.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"],"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, ElementRef, inject } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\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. Keeps an `id` of your own and otherwise assigns one, so the drawer panel\n * references it via `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 exportAs: 'wrDrawerTitle',\n host: { class: 'wr-drawer__title', '[attr.id]': 'id' },\n})\nexport class WrDrawerTitle {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly fallbackId = `wr-drawer-title-${++uid}`;\n\n /**\n * The id the drawer panel's `aria-labelledby` points at: the element's own\n * `id` when the consumer set one, a generated one otherwise. A getter, read\n * fresh by the host binding, so a bound `[id]` is honoured too.\n */\n get id(): string {\n return this.host.nativeElement.id || this.fallbackId;\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 type { OverlayRef } from '@angular/cdk/overlay';\n\n/**\n * Whether focus is inside the drawer's panel. Shared by the non-modal Escape\n * gate and the close path, in `<wr-drawer>` and in `WrDrawerRef`.\n *\n * @internal\n */\nexport function drawerHasFocus(overlayRef: OverlayRef | null): boolean {\n const active = typeof document === 'undefined' ? null : document.activeElement;\n return !!active && !!overlayRef?.overlayElement?.contains(active);\n}\n\n/**\n * Whether nothing has focus any more — `<body>` or nothing at all. A non-modal\n * drawer takes Escape, and returns focus to its opener on close, only from\n * inside itself or from here: a click on the panel's own text focuses nothing\n * and lands focus here, while a reader who has clicked or tabbed on into the\n * page is left where they are.\n *\n * @internal\n */\nexport function focusIsLost(): boolean {\n if (typeof document === 'undefined') return false;\n const active = document.activeElement;\n return !active || active === document.body;\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 { ConfigurableFocusTrapFactory, type FocusTrap, FocusTrapFactory, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport type { GlobalPositionStrategy, OverlayRef, OverlaySizeConfig } 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, WrOverlayOrder, WrScrollBlock, wrFocusOverlay, wrFollowDirection } from 'ngwr/overlay';\nimport { wrIsComposing, wrToClassList, wrCheckStyles, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport type { WrDrawerAutoFocus, WrDrawerPosition } from './types';\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 * 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 /**\n * Show the dimming backdrop, and with it make the drawer MODAL: focus is\n * trapped inside, the panel is announced with `aria-modal=\"true\"`, and the\n * page behind it does not scroll.\n *\n * `false` makes it a NON-MODAL side panel (since v15). The page stays\n * clickable, scrollable and reachable with Tab; the panel keeps\n * `role=\"dialog\"` without `aria-modal`. Focus still moves into it on open,\n * Escape closes it unless focus has moved on to the page, and on close\n * focus goes back to the opener unless the reader has moved on likewise.\n * Read when the drawer opens. @default true\n */\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 /**\n * Extra CSS classes for the drawer's panel — the box that slides in.\n *\n * On the panel rather than on the CDK pane, because that is the element\n * `WrDrawerManager.open({ panelClass })` styles too: there the content IS the\n * pane, so one name has to mean the same surface on both paths.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Where the global toast stack paints while the drawer is open. `'below'`\n * keeps it under the drawer and its backdrop. Read when the drawer opens.\n * @default 'above'\n */\n readonly toasts = input<'above' | 'below'>('above');\n\n /**\n * Where focus goes when the drawer opens: `'dialog'` focuses the panel itself\n * with no ring so the first Tab reaches the first control, `'first-tabbable'`\n * focuses the first tabbable element, `false` moves nothing. An element\n * marked `cdkFocusInitial` wins in every mode. Read when the drawer opens.\n * @default 'dialog'\n */\n readonly autoFocus = input<WrDrawerAutoFocus>('dialog');\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 panelClasses(): 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 // 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 wrToClassList(parts, this.panelClass()).join(' ');\n }\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly order = inject(WrOverlayOrder);\n private readonly scrollBlock = inject(WrScrollBlock);\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 plainFocusTrapFactory = inject(FocusTrapFactory);\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 `WR_OVERLAY` parents to the\n * 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: FocusTrap | null = null;\n private previouslyFocused: HTMLElement | null = null;\n /** Whether the open panel is modal — `hasBackdrop` as it was when it opened. */\n private modal = true;\n /** The side the open overlay sits on. */\n private side: WrDrawerPosition = 'right';\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\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 positionStrategy(pos: WrDrawerPosition): GlobalPositionStrategy {\n const strategy = this.overlay\n .position()\n .global()\n [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n if (pos === 'top') strategy.top();\n else if (pos === 'bottom') strategy.bottom();\n else strategy.centerVertically();\n return strategy;\n }\n\n private size(pos: WrDrawerPosition): OverlaySizeConfig {\n const isHorizontal = pos === 'left' || pos === 'right';\n return {\n width: isHorizontal ? this.width() : '100vw',\n height: isHorizontal ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (this.maxHeight() ?? undefined),\n };\n }\n\n /**\n * Carry `position`, `width`, `height` and `maxHeight` over to the open\n * overlay. The CDK reads them once, in `create()`.\n */\n private syncOverlay(ref: OverlayRef): void {\n const pos = this.position();\n if (pos !== this.side) {\n ref.removePanelClass(`wr-drawer-overlay--${this.side}`);\n ref.addPanelClass(`wr-drawer-overlay--${pos}`);\n this.side = pos;\n ref.updatePositionStrategy(this.positionStrategy(pos));\n }\n ref.updateSize(this.size(pos));\n }\n\n private openOverlay(): void {\n if (this.overlayRef) {\n this.syncOverlay(this.overlayRef);\n return;\n }\n\n const pos = this.position();\n this.side = pos;\n const modal = this.hasBackdrop();\n this.modal = modal;\n\n this.overlayRef = this.overlay.create({\n positionStrategy: this.positionStrategy(pos),\n hasBackdrop: modal,\n backdropClass: 'wr-drawer-backdrop',\n panelClass: ['wr-drawer-overlay', `wr-drawer-overlay--${pos}`],\n // A non-modal panel leaves the page scrolling under it: nothing covers\n // the page, so a blocked scroll would only freeze what the reader can\n // still see and click.\n scrollStrategy: modal ? this.scrollBlock.strategy() : this.overlay.scrollStrategies.noop(),\n // The CDK hands Escape to the topmost overlay wherever focus is. That is\n // right for a modal, where focus cannot be anywhere else, and wrong for a\n // panel beside a live page: an Escape meant for a field on the page\n // closed the drawer. Declined, the key walks on to the next overlay.\n // Focus on `<body>` still counts: a click on the panel's own text\n // focuses nothing, so that is where a reader inside it usually is.\n eventPredicate: modal ? undefined : () => drawerHasFocus(this.overlayRef) || focusIsLost(),\n ...this.size(pos),\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 this.overlayRef.detachments().subscribe(this.order.add(this.overlayRef.hostElement, this.toasts()));\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 if (modal) host.setAttribute('aria-modal', 'true');\n // Non-modal: a trap with no anchors and no inert strategy, which only\n // moves focus in — `cdkFocusInitial` honoured the same way — and then\n // lets Tab carry on out into the page.\n this.focusTrap = modal ? this.focusTrapFactory.create(host) : this.plainFocusTrapFactory.create(host, true);\n wrFocusOverlay(host, this.focusTrap, this.autoFocus(), this.injector);\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' && !wrIsComposing(event)) {\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 // Read before disposal, which takes the focused element out of the page.\n const returnFocus = this.modal || drawerHasFocus(this.overlayRef) || focusIsLost();\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (returnFocus && restore && typeof restore.focus === 'function') {\n wrRestoreFocus(restore, this.focusMonitor);\n }\n }\n}\n","<ng-template>\n <div [class]=\"panelClasses()\">\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 FocusTrap, FocusMonitor } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef, Injector } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\nimport { wrRestoreFocus } from 'ngwr/utils';\n\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\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: FocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n /** @internal — `false` for a drawer opened with `hasBackdrop: false`. */\n modal = true;\n\n /**\n * @param _overlayRef the overlay the drawer is mounted in.\n * @param injector where the focus hand-back finds the CDK `FocusMonitor`; without\n * one it is a plain `focus()`.\n */\n private readonly focusMonitor: FocusMonitor | null;\n\n constructor(\n private readonly _overlayRef: OverlayRef,\n injector?: Injector\n ) {\n // Resolved now: the injector may be gone by the time the drawer closes.\n this.focusMonitor = injector?.get(FocusMonitor, null) ?? null;\n }\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 // A non-modal drawer sends focus back only from inside itself, or when it\n // has been lost: a reader already working on the page stays there. Read\n // before disposal, which takes the focused element out of the page.\n const returnFocus = this.modal || drawerHasFocus(this._overlayRef) || focusIsLost();\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 (returnFocus && restore && typeof restore.focus === 'function') {\n wrRestoreFocus(restore, this.focusMonitor);\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, FocusTrapFactory } 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 {\n WR_OVERLAY,\n WrOverlayOrder,\n WrScrollBlock,\n wrAppendOverlayClose,\n wrFocusOverlay,\n wrFollowDirection,\n} from 'ngwr/overlay';\nimport { wrIsComposing, wrToClassList } from 'ngwr/utils';\n\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport { WrDrawerRef } from './drawer-ref';\nimport { WR_DRAWER_DATA, WR_DRAWER_REF } from './tokens';\nimport type { WrDrawerOptions, WrDrawerPosition } from './types';\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 drawers render into NGWR's own overlay container\n * and never collide with other CDK consumers (Material, NG-ZORRO, etc.).\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 scrollBlock = inject(WrScrollBlock);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly plainFocusTrapFactory = inject(FocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly i18n = inject(WrI18n);\n private readonly location = inject(Location);\n private readonly order = inject(WrOverlayOrder);\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 = wrToClassList(\n 'wr-drawer-overlay',\n `wr-drawer-overlay--${position}`,\n 'wr-drawer__panel',\n `wr-drawer__panel--${position}`,\n options.rounded && 'wr-drawer__panel--rounded',\n options.safeArea && 'wr-drawer__panel--safe-area',\n options.panelClass\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 // No backdrop means NON-MODAL, the same rule as `<wr-drawer>`: no trap, no\n // `aria-modal`, no scroll block, and Escape only from inside the panel —\n // or from `<body>`, where a click on the panel's own text leaves focus.\n const modal = options.hasBackdrop !== false;\n // Assigned on the next statement; the predicate only runs from a keydown.\n let ref: OverlayRef | null = null;\n\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: modal ? this.scrollBlock.strategy() : this.scrollStrategies.noop(),\n eventPredicate: modal ? undefined : () => drawerHasFocus(ref) || focusIsLost(),\n hasBackdrop: modal,\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 ref = overlayRef;\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, this.parentInjector);\n drawerRef.modal = modal;\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 overlayRef.detachments().subscribe(this.order.add(overlayRef.hostElement, options.toasts));\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' && !wrIsComposing(event)) {\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 if (modal) 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. A non-modal\n // drawer only gets the second half: a trap with no anchors and no inert\n // strategy moves focus in and leaves Tab free to walk out to the page.\n const trap = modal ? this.focusTrapFactory.create(host) : this.plainFocusTrapFactory.create(host, true);\n drawerRef.focusTrap = trap;\n wrFocusOverlay(host, trap, options.autoFocus ?? 'dialog', this.parentInjector);\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. (`wrReadI18nText` 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\nimport { wrCheckStyles } from 'ngwr/utils';\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 constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\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, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\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: 'wr-drawer__footer', '[class]': 'classes()' },\n})\nexport class WrDrawerFooter {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\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 { wrCheckStyles } from 'ngwr/utils';\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 constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\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"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,IAAI,MAAM;AAqBV,IAAa,gBAAb,MAAa,cAAa;CACxB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,QAAQ;CAC3E;CAEiB,OAAO,OAAgC,UAAU;CACjD,aAAa,mBAAmB,EAAE;CAOnD,IAAI,KAAE;EACJ,OAAO,KAAK,KAAK,cAAc,MAAM,KAAK;CAC5C;CAfW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAa,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,WAAA,KAAA;GAAA,gBAAA;EAAA;EAAA,UAAA,CAAA,eAAA;EAAA,UAAA;CAAA,CAAA;;AAAb,GAAA,yBAAA;CAAA,YA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