ngwr 16.0.0 → 16.1.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/badge/styles/_tag.scss +8 -4
- package/button/styles/_index.scss +13 -7
- package/cascader/styles/_rules.scss +4 -2
- package/checkbox/styles/_index.scss +4 -2
- package/date-picker/styles/_index.scss +6 -2
- package/date-stamp/styles/_index.scss +38 -0
- package/dialog/styles/_index.scss +38 -0
- package/fesm2022/internal-CVLvP9b_.mjs +33 -0
- package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +11 -7
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +11 -7
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +10 -6
- package/fesm2022/ngwr-back-top.mjs.map +1 -1
- package/fesm2022/ngwr-badge.mjs +18 -6
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +9 -6
- package/fesm2022/ngwr-burger.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +8 -4
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +19 -8
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -5
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +11 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +10 -6
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +2 -1
- package/fesm2022/ngwr-clipboard.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +9 -5
- package/fesm2022/ngwr-collapse.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +4 -2
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-comment.mjs +13 -7
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +9 -3
- package/fesm2022/ngwr-compare.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +4 -2
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value.mjs +11 -6
- package/fesm2022/ngwr-copy-value.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +86 -30
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
- package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
- package/fesm2022/ngwr-date-stamp.mjs +149 -0
- package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
- package/fesm2022/ngwr-date.mjs +279 -50
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-descriptions.mjs +9 -5
- package/fesm2022/ngwr-descriptions.mjs.map +1 -1
- package/fesm2022/ngwr-dialog-testing.mjs +23 -2
- package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +45 -16
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +102 -11
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +4 -2
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +29 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +4 -2
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +5 -2
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +4 -2
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +9 -3
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +18 -6
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +2 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +2 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +2 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +2 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +2 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +2 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +2 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +2 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +2 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +2 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +2 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +2 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +2 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +2 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +2 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +2 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +2 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +2 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +2 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +2 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +2 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +2 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +34 -8
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +9 -3
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +4 -2
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +20 -10
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +9 -3
- package/fesm2022/ngwr-keyboard.mjs.map +1 -1
- package/fesm2022/ngwr-knob.mjs +9 -3
- package/fesm2022/ngwr-knob.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs +13 -5
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +9 -5
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +13 -5
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +9 -5
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +84 -1
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +3 -2
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +21 -5
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +93 -4
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +4 -2
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +9 -5
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +9 -3
- package/fesm2022/ngwr-rating.mjs.map +1 -1
- package/fesm2022/ngwr-resizable.mjs +503 -0
- package/fesm2022/ngwr-resizable.mjs.map +1 -0
- package/fesm2022/ngwr-result.mjs +9 -5
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +4 -2
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +13 -5
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +4 -2
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +4 -2
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +4 -2
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +4 -2
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +17 -21
- package/fesm2022/ngwr-splitter.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +9 -3
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +9 -5
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-testing.mjs +5 -1
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +167 -10
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +9 -3
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +18 -8
- package/fesm2022/ngwr-timeline.mjs.map +1 -1
- package/fesm2022/ngwr-toast-testing.mjs +6 -1
- package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +529 -104
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +4 -2
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +4 -2
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +9 -3
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils-router.mjs +18 -2
- package/fesm2022/ngwr-utils-router.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +9 -2
- 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-window.mjs +7 -4
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/fesm2022/ngwr.mjs.map +1 -1
- package/i18n/ar.json +6 -0
- package/i18n/cs.json +6 -0
- package/i18n/de.json +6 -0
- package/i18n/en.json +6 -0
- package/i18n/es.json +6 -0
- package/i18n/fr.json +6 -0
- package/i18n/he.json +6 -0
- package/i18n/hi.json +6 -0
- package/i18n/id.json +6 -0
- package/i18n/it.json +6 -0
- package/i18n/ja.json +6 -0
- package/i18n/ko.json +6 -0
- package/i18n/nl.json +6 -0
- package/i18n/pl.json +6 -0
- package/i18n/pt.json +6 -0
- package/i18n/ru.json +6 -0
- package/i18n/sv.json +6 -0
- package/i18n/tr.json +6 -0
- package/i18n/uk.json +6 -0
- package/i18n/vi.json +6 -0
- package/i18n/zh-TW.json +6 -0
- package/i18n/zh.json +6 -0
- package/input/styles/_index.scss +10 -5
- package/input-number/styles/_index.scss +6 -3
- package/input-otp/styles/_index.scss +4 -2
- package/llms-full.txt +29 -10
- package/llms.txt +8 -4
- package/package.json +15 -1
- package/radio/styles/_index.scss +4 -2
- package/resizable/styles/_index.scss +154 -0
- package/schematics/use/rule.js +1 -0
- package/schematics/use/symbol-map.json +4 -0
- package/select/styles/_index.scss +6 -3
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +4 -1
- package/skills/ngwr/references/setup.md +3 -0
- package/switch/styles/_index.scss +4 -2
- package/table/styles/_index.scss +53 -0
- package/textarea/styles/_index.scss +4 -2
- package/theme/styles/_motion.scss +6 -0
- package/toast/styles/_index.scss +19 -0
- package/types/ngwr-burger.d.ts +0 -1
- package/types/ngwr-calendar.d.ts +7 -0
- package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
- package/types/ngwr-clipboard.d.ts +7 -0
- package/types/ngwr-date-picker.d.ts +9 -2
- package/types/ngwr-date-stamp-testing.d.ts +47 -0
- package/types/ngwr-date-stamp.d.ts +81 -0
- package/types/ngwr-date.d.ts +135 -24
- package/types/ngwr-dialog-testing.d.ts +10 -0
- package/types/ngwr-dialog.d.ts +72 -4
- package/types/ngwr-directives.d.ts +36 -1
- package/types/ngwr-drawer.d.ts +21 -0
- package/types/ngwr-i18n.d.ts +44 -14
- package/types/ngwr-overlay.d.ts +36 -0
- package/types/ngwr-pipes.d.ts +15 -0
- package/types/ngwr-popover.d.ts +39 -1
- package/types/ngwr-resizable.d.ts +228 -0
- package/types/ngwr-table-testing.d.ts +3 -1
- package/types/ngwr-table.d.ts +120 -4
- package/types/ngwr-toast-testing.d.ts +12 -1
- package/types/ngwr-toast.d.ts +215 -18
- package/types/ngwr-utils-router.d.ts +22 -0
- package/types/ngwr-utils.d.ts +8 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr.d.ts +1 -0
|
@@ -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"],"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, afterNextRender, effect, inject, input } from '@angular/core';\n\n/**\n * Focus the host element after the first render — or whenever the bound\n * expression transitions to truthy.\n *\n * @example\n * ```html\n * <input wrAutofocus />\n * <input [wrAutofocus]=\"shouldFocus()\" />\n * ```\n */\n@Directive({ selector: '[wrAutofocus]' })\nexport class WrAutofocus {\n /** Truthy = focus. Defaults to `true` so bare `wrAutofocus` works. */\n readonly wrAutofocus = input(true, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n afterNextRender(() => {\n if (this.wrAutofocus()) this.el.nativeElement.focus();\n });\n effect(() => {\n if (this.wrAutofocus()) {\n // Microtask defer so view updates that flip the expression land first.\n queueMicrotask(() => this.el.nativeElement.focus());\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 } from '@angular/cdk/a11y';\nimport { DOCUMENT } from '@angular/common';\nimport { Directive, inject, input, output } from '@angular/core';\n\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 * @example\n * ```html\n * <button [wrCopyToClipboard]=\"value\" (copied)=\"toast('Copied!')\">Copy</button>\n * ```\n */\n@Directive({ selector: '[wrCopyToClipboard]', exportAs: 'wrCopyToClipboard', host: { '(click)': 'copy()' } })\nexport class WrCopyToClipboard {\n /** The text to copy. */\n readonly wrCopyToClipboard = input.required<string>();\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 private readonly focusMonitor = inject(FocusMonitor);\n private readonly doc = inject(DOCUMENT);\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 this.copied.emit(text);\n return true;\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"],"mappings":";;;;;;;;;;;;AAqBA,IAAa,cAAb,MAAa,YAAW;CAEb,cAAc,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAEpD,KAAK,OAAgC,UAAU;CAEhE,cAAA;EACE,sBAAqB;GACnB,IAAI,KAAK,YAAW,GAAI,KAAK,GAAG,cAAc,MAAK;EACrD,CAAC;EACD,aAAY;GACV,IAAI,KAAK,YAAW,GAElB,qBAAqB,KAAK,GAAG,cAAc,MAAK,CAAE;EAEtD,CAAC;CACH;CAhBW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAW,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAX,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAW,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,aAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAX,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAW,YAAA,CAAA;EADvB,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,gBAAe,CAAE;;;;;;;;;;;;;;;;;;ACOxC,IAAa,aAAb,MAAa,WAAU;CAKZ,UAAU,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,KAAK,IAAI,GAAG,qBAAqB,GAAG,CAAC,CAAC;CAAC,CAAA;CAK/F,UAAU,MAAM,GAAC;EAAA,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,MAAM,KAAK,IAAI,GAAG,MAAM,KAAI,SAAQ,KAAK,KAAK,CAAC;EACrD,MAAM,QAAQ,iBAAiB,IAAI;EACnC,MAAM,MAAM,UAA0B,WAAW,KAAK,KAAK;EAC3D,MAAM,MACJ,MAAM,cAAc,eAChB,GAAG,MAAM,WAAW,IAAI,GAAG,MAAM,YAAY,IAAI,GAAG,MAAM,eAAe,IAAI,GAAG,MAAM,gBAAgB,IACtG;EAGN,KAAK,UAAU,GAAG,KAAK,KAAK,MAAM,QAAQ,GAAG,IAAI,EAAC;EAClD,KAAK,MAAM,QAAQ,KAAK;CAC1B;CAxFW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,WAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAT,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EADrB,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,cAAa,CAAE"}
|
|
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"],"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, afterNextRender, effect, inject, input } from '@angular/core';\n\n/**\n * Focus the host element after the first render — or whenever the bound\n * expression transitions to truthy.\n *\n * @example\n * ```html\n * <input wrAutofocus />\n * <input [wrAutofocus]=\"shouldFocus()\" />\n * ```\n */\n@Directive({ selector: '[wrAutofocus]' })\nexport class WrAutofocus {\n /** Truthy = focus. Defaults to `true` so bare `wrAutofocus` works. */\n readonly wrAutofocus = input(true, { transform: coerceBooleanProperty });\n\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n\n constructor() {\n afterNextRender(() => {\n if (this.wrAutofocus()) this.el.nativeElement.focus();\n });\n effect(() => {\n if (this.wrAutofocus()) {\n // Microtask defer so view updates that flip the expression land first.\n queueMicrotask(() => this.el.nativeElement.focus());\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"],"mappings":";;;;;;;;;;;;;;;;AAqBA,IAAa,cAAb,MA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,KAAK,IAAI,CAAC;EACtD,MAAM,MAAM,KAAK,IAAI,GAAG,MAAM,KAAI,SAAQ,KAAK,KAAK,CAAC;EACrD,MAAM,QAAQ,iBAAiB,IAAI;EACnC,MAAM,MAAM,UAA0B,WAAW,KAAK,KAAK;EAC3D,MAAM,MACJ,MAAM,cAAc,eAChB,GAAG,MAAM,WAAW,IAAI,GAAG,MAAM,YAAY,IAAI,GAAG,MAAM,eAAe,IAAI,GAAG,MAAM,gBAAgB,IACtG;EAGN,KAAK,UAAU,GAAG,KAAK,KAAK,MAAM,QAAQ,GAAG,IAAI,EAAC;EAClD,KAAK,MAAM,QAAQ,KAAK;CAC1B;CAxFW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,WAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAT,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EADrB,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,cAAa,CAAE"}
|
|
@@ -17,7 +17,7 @@ var WrDivider = class WrDivider {
|
|
|
17
17
|
});
|
|
18
18
|
align = input("center", ...ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []);
|
|
19
19
|
classes = computed(() => {
|
|
20
|
-
const parts = [
|
|
20
|
+
const parts = [`wr-divider--${this.type()}`];
|
|
21
21
|
const color = this.color();
|
|
22
22
|
if (color) parts.push(`wr-divider--${color}`);
|
|
23
23
|
const align = this.align();
|
|
@@ -88,7 +88,8 @@ var WrDivider = class WrDivider {
|
|
|
88
88
|
properties: {
|
|
89
89
|
"class": "classes()",
|
|
90
90
|
"style.--wr-divider-width.px": "width()"
|
|
91
|
-
}
|
|
91
|
+
},
|
|
92
|
+
classAttribute: "wr-divider"
|
|
92
93
|
},
|
|
93
94
|
ngImport: i0,
|
|
94
95
|
template: "<ng-content />",
|
|
@@ -109,6 +110,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
109
110
|
encapsulation: ViewEncapsulation.None,
|
|
110
111
|
host: {
|
|
111
112
|
role: "separator",
|
|
113
|
+
class: "wr-divider",
|
|
112
114
|
"[class]": "classes()",
|
|
113
115
|
"[style.--wr-divider-width.px]": "width()"
|
|
114
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-divider.mjs","names":[],"sources":["../../../projects/lib/divider/divider.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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ElementRef,\n ViewEncapsulation,\n afterEveryRender,\n computed,\n effect,\n inject,\n input,\n} from '@angular/core';\n\nimport type { WrColor } from 'ngwr/theme';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrDividerAlign, WrDividerType } from './types';\n\n/**\n * Horizontal separator line. Projected content renders as a label\n * inline with the line (split into two halves on either side).\n *\n * @example\n * ```html\n * <wr-divider />\n * <wr-divider type=\"dashed\" color=\"primary\" [width]=\"2\" />\n * <wr-divider>OR</wr-divider>\n * <wr-divider align=\"start\">Section</wr-divider>\n * ```\n *\n * @see https://ngwr.dev/reference/components/divider\n */\n@Component({\n selector: 'wr-divider',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'separator',\n '[class]': 'classes()',\n '[style.--wr-divider-width.px]': 'width()',\n },\n})\nexport class WrDivider {\n /**\n * Color of the divider line. Omit for the neutral default.\n *\n * @default null\n */\n readonly color = input<WrColor | null>(null);\n\n /**\n * Line style.\n *\n * @default 'solid'\n */\n readonly type = input<WrDividerType>('solid');\n\n /**\n * Line width in pixels.\n *\n * @default 1\n */\n readonly width = input(1, { transform: (v: unknown): number => coerceNumberProperty(v, 1) });\n\n /**\n * Label position. Only meaningful when the divider has projected\n * content — otherwise the line is symmetric and alignment has no\n * visible effect.\n *\n * @default 'center'\n */\n readonly align = input<WrDividerAlign>('center');\n\n protected readonly classes = computed(() => {\n const parts = [
|
|
1
|
+
{"version":3,"file":"ngwr-divider.mjs","names":[],"sources":["../../../projects/lib/divider/divider.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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ElementRef,\n ViewEncapsulation,\n afterEveryRender,\n computed,\n effect,\n inject,\n input,\n} from '@angular/core';\n\nimport type { WrColor } from 'ngwr/theme';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrDividerAlign, WrDividerType } from './types';\n\n/**\n * Horizontal separator line. Projected content renders as a label\n * inline with the line (split into two halves on either side).\n *\n * @example\n * ```html\n * <wr-divider />\n * <wr-divider type=\"dashed\" color=\"primary\" [width]=\"2\" />\n * <wr-divider>OR</wr-divider>\n * <wr-divider align=\"start\">Section</wr-divider>\n * ```\n *\n * @see https://ngwr.dev/reference/components/divider\n */\n@Component({\n selector: 'wr-divider',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'separator',\n class: 'wr-divider',\n '[class]': 'classes()',\n '[style.--wr-divider-width.px]': 'width()',\n },\n})\nexport class WrDivider {\n /**\n * Color of the divider line. Omit for the neutral default.\n *\n * @default null\n */\n readonly color = input<WrColor | null>(null);\n\n /**\n * Line style.\n *\n * @default 'solid'\n */\n readonly type = input<WrDividerType>('solid');\n\n /**\n * Line width in pixels.\n *\n * @default 1\n */\n readonly width = input(1, { transform: (v: unknown): number => coerceNumberProperty(v, 1) });\n\n /**\n * Label position. Only meaningful when the divider has projected\n * content — otherwise the line is symmetric and alignment has no\n * visible effect.\n *\n * @default 'center'\n */\n readonly align = input<WrDividerAlign>('center');\n\n protected readonly classes = computed(() => {\n const parts = [`wr-divider--${this.type()}`];\n const color = this.color();\n if (color) parts.push(`wr-divider--${color}`);\n const align = this.align();\n if (align !== 'center') parts.push(`wr-divider--${align}`);\n return parts.join(' ');\n });\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * The consumer's own `aria-label`, resolved on the first sync — `undefined`\n * until then, which is how \"not looked at yet\" stays distinct from \"they wrote\n * none\".\n */\n private authored: string | null | undefined;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('divider');\n // `afterEveryRender` is a hard NO-OP under SSR, so while it was the only\n // writer every prerendered page shipped `role=\"separator\"` with no name —\n // exactly the defect `syncLabel()` exists to fix, in the one window (before\n // hydration, no JS, a raw read of the server HTML) where nothing can repair\n // it. An effect is not gated that way and runs after the content has been\n // projected, so it names the separator in the emitted markup; the render\n // hook stays because a single effect run cannot follow a label that changes\n // afterwards, and it reads nothing reactive to be re-run by.\n effect(() => this.syncLabel());\n afterEveryRender(() => this.syncLabel());\n }\n\n /**\n * Name the separator with the label it projects.\n *\n * `role=\"separator\"` makes the host's children presentational and a separator\n * takes its accessible name from the author alone — so `<wr-divider>OR</wr-divider>`\n * reaches assistive tech as an unnamed rule while everyone else reads \"OR\".\n * Copying the label into `aria-label` is the only way to expose it without giving\n * up the role, and the two can never disagree because one is the source of the\n * other.\n *\n * Written straight to the DOM rather than through a host binding, for two\n * reasons a binding cannot cover: the label is projected content, so an\n * interpolation or an `@if` can change it while the divider stays put; and a\n * binding resolving to `null` would strip an `aria-label` the consumer wrote\n * themselves — theirs is the author name already and is never touched.\n */\n private syncLabel(): void {\n const el = this.host.nativeElement;\n if (this.authored === undefined) this.authored = el.getAttribute('aria-label');\n if (this.authored !== null) return;\n\n const label = el.textContent?.trim();\n if (label) el.setAttribute('aria-label', label);\n else el.removeAttribute('aria-label');\n }\n}\n"],"mappings":";;;;;;;;;;AAiDA,IAAa,YAAb,MAAa,UAAS;CAMX,QAAQ,MAAsB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAOnC,OAAO,MAAqB,SAAQ,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAOpC,QAAQ,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,qBAAqB,GAAG,CAAC;CAAC,CAAA;CAShF,QAAQ,MAAsB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAE7B,UAAU,eAAc;EACzC,MAAM,QAAQ,CAAC,eAAe,KAAK,KAAI,GAAI;EAC3C,MAAM,QAAQ,KAAK,MAAK;EACxB,IAAI,OAAO,MAAM,KAAK,eAAe,OAAO;EAC5C,MAAM,QAAQ,KAAK,MAAK;EACxB,IAAI,UAAU,UAAU,MAAM,KAAK,eAAe,OAAO;EACzD,OAAO,MAAM,KAAK,GAAG;CACvB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEe,OAAO,OAAgC,UAAU;CAO1D;CAER,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,SAAS;EAS1E,aAAa,KAAK,UAAS,CAAE;EAC7B,uBAAuB,KAAK,UAAS,CAAE;CACzC;CAkBQ,YAAS;EACf,MAAM,KAAK,KAAK,KAAK;EACrB,IAAI,KAAK,aAAa,QAAW,KAAK,WAAW,GAAG,aAAa,YAAY;EAC7E,IAAI,KAAK,aAAa,MAAM;EAE5B,MAAM,QAAQ,GAAG,aAAa,KAAI;EAClC,IAAI,OAAO,GAAG,aAAa,cAAc,KAAK;OACzC,GAAG,gBAAgB,YAAY;CACtC;CAvFW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,YAAA;GAAA,YAAA;IAAA,SAAA;IAAA,+BAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UATV;EAAgB,UAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AASf,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EAXrB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,eAAe,kBAAkB;GACjC,MAAM;IACJ,MAAM;IACN,OAAO;IACP,WAAW;IACX,iCAAiC;GAClC;EACF,CAAA"}
|
package/fesm2022/ngwr-drawer.mjs
CHANGED
|
@@ -8,7 +8,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, wrAppendOverlayClose, wrFollowDirection } from "ngwr/overlay";
|
|
11
|
+
import { WR_OVERLAY, WrOverlayOrder, wrAppendOverlayClose, wrFollowDirection } from "ngwr/overlay";
|
|
12
12
|
import { ConfigurableFocusTrapFactory, FocusMonitor, FocusTrapFactory } from "@angular/cdk/a11y";
|
|
13
13
|
import { ReplaySubject } from "rxjs";
|
|
14
14
|
/**
|
|
@@ -116,6 +116,7 @@ var WrDrawer = class WrDrawer {
|
|
|
116
116
|
});
|
|
117
117
|
closeLabel = input(null, ...ngDevMode ? [{ debugName: "closeLabel" }] : /* istanbul ignore next */ []);
|
|
118
118
|
panelClass = input(null, ...ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []);
|
|
119
|
+
toasts = input("above", ...ngDevMode ? [{ debugName: "toasts" }] : /* istanbul ignore next */ []);
|
|
119
120
|
resolvedCloseLabel = useI18nText(this.closeLabel, "drawer.close", "Close drawer");
|
|
120
121
|
panelTpl = viewChild.required(TemplateRef, ...ngDevMode ? [{ debugName: "panelTpl" }] : /* istanbul ignore next */ []);
|
|
121
122
|
projectedTitle = contentChild(WrDrawerTitle, ...ngDevMode ? [{ debugName: "projectedTitle" }] : /* istanbul ignore next */ []);
|
|
@@ -129,6 +130,7 @@ var WrDrawer = class WrDrawer {
|
|
|
129
130
|
}
|
|
130
131
|
focusMonitor = inject(FocusMonitor);
|
|
131
132
|
overlay = inject(WR_OVERLAY);
|
|
133
|
+
order = inject(WrOverlayOrder);
|
|
132
134
|
vcr = inject(ViewContainerRef);
|
|
133
135
|
destroyRef = inject(DestroyRef);
|
|
134
136
|
injector = inject(Injector);
|
|
@@ -181,6 +183,7 @@ var WrDrawer = class WrDrawer {
|
|
|
181
183
|
wrFollowDirection(this.overlayRef, this.dir, this.injector);
|
|
182
184
|
const portal = new TemplatePortal(this.panelTpl(), this.vcr);
|
|
183
185
|
this.overlayRef.attach(portal);
|
|
186
|
+
this.overlayRef.detachments().subscribe(this.order.add(this.overlayRef.hostElement, this.toasts()));
|
|
184
187
|
if (this.isBrowser) {
|
|
185
188
|
const active = document.activeElement;
|
|
186
189
|
this.previouslyFocused = active instanceof HTMLElement ? active : null;
|
|
@@ -314,6 +317,13 @@ var WrDrawer = class WrDrawer {
|
|
|
314
317
|
isSignal: true,
|
|
315
318
|
isRequired: false,
|
|
316
319
|
transformFunction: null
|
|
320
|
+
},
|
|
321
|
+
toasts: {
|
|
322
|
+
classPropertyName: "toasts",
|
|
323
|
+
publicName: "toasts",
|
|
324
|
+
isSignal: true,
|
|
325
|
+
isRequired: false,
|
|
326
|
+
transformFunction: null
|
|
317
327
|
}
|
|
318
328
|
},
|
|
319
329
|
outputs: { open: "openChange" },
|
|
@@ -460,6 +470,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
460
470
|
required: false
|
|
461
471
|
}]
|
|
462
472
|
}],
|
|
473
|
+
toasts: [{
|
|
474
|
+
type: i0.Input,
|
|
475
|
+
args: [{
|
|
476
|
+
isSignal: true,
|
|
477
|
+
alias: "toasts",
|
|
478
|
+
required: false
|
|
479
|
+
}]
|
|
480
|
+
}],
|
|
463
481
|
panelTpl: [{
|
|
464
482
|
type: i0.ViewChild,
|
|
465
483
|
args: [i0.forwardRef(() => TemplateRef), { isSignal: true }]
|
|
@@ -559,6 +577,7 @@ var WrDrawerManager = class WrDrawerManager {
|
|
|
559
577
|
isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
|
|
560
578
|
i18n = inject(WrI18n);
|
|
561
579
|
location = inject(Location);
|
|
580
|
+
order = inject(WrOverlayOrder);
|
|
562
581
|
dir = inject(Directionality, { optional: true });
|
|
563
582
|
open(component, options = {}) {
|
|
564
583
|
const position = options.position ?? DEFAULT_POSITION;
|
|
@@ -609,6 +628,7 @@ var WrDrawerManager = class WrDrawerManager {
|
|
|
609
628
|
});
|
|
610
629
|
const portal = new ComponentPortal(component, null, injector);
|
|
611
630
|
drawerRef.componentRef = overlayRef.attach(portal);
|
|
631
|
+
overlayRef.detachments().subscribe(this.order.add(overlayRef.hostElement, options.toasts));
|
|
612
632
|
if (options.closeOnBackdropClick !== false) overlayRef.backdropClick().subscribe(() => drawerRef.close());
|
|
613
633
|
if (options.closeOnEscape !== false) overlayRef.keydownEvents().subscribe((event) => {
|
|
614
634
|
if (event.key === "Escape") {
|
|
@@ -743,7 +763,10 @@ var WrDrawerFooter = class WrDrawerFooter {
|
|
|
743
763
|
isRequired: false,
|
|
744
764
|
transformFunction: null
|
|
745
765
|
} },
|
|
746
|
-
host: {
|
|
766
|
+
host: {
|
|
767
|
+
properties: { "class": "classes()" },
|
|
768
|
+
classAttribute: "wr-drawer__footer"
|
|
769
|
+
},
|
|
747
770
|
ngImport: i0
|
|
748
771
|
});
|
|
749
772
|
};
|
|
@@ -756,7 +779,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
756
779
|
type: Directive,
|
|
757
780
|
args: [{
|
|
758
781
|
selector: "[wrDrawerFooter]",
|
|
759
|
-
host: {
|
|
782
|
+
host: {
|
|
783
|
+
class: "wr-drawer__footer",
|
|
784
|
+
"[class]": "classes()"
|
|
785
|
+
}
|
|
760
786
|
}]
|
|
761
787
|
}],
|
|
762
788
|
ctorParameters: () => [],
|
|
@@ -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 OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n EnvironmentInjector,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterEveryRender,\n contentChild,\n effect,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, wrFollowDirection } from 'ngwr/overlay';\nimport { wrToClassList, wrCheckStyles, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport type { 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 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 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\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 openOverlay(): void {\n if (this.overlayRef) return;\n\n const pos = this.position();\n const isHorizontal = pos === 'left' || pos === 'right';\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n if (pos === 'top') positionStrategy.top();\n else if (pos === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = this.maxHeight();\n const modal = this.hasBackdrop();\n this.modal = modal;\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\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 width: isHorizontal ? this.width() : '100vw',\n height: isHorizontal ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n // `position` is PHYSICAL — a `left` drawer is on the physical left in either\n // direction — and it takes BOTH halves of the follower to keep it that way.\n // The CDK places the panel with `justify-content` on a host it also writes\n // `dir` to, and that host is a flex row, so the attribute alone reverses the\n // main axis and slides a `left` drawer across to the right; `apply()`'s own\n // RTL branch swaps `flex-start` for `flex-end` to cancel exactly that. So\n // the `setDirection()` + `updatePosition()` pair leaves the panel where it\n // is and only re-resolves what the panel's own logical CSS reads — which is\n // the whole point, since the direction inside the drawer really did change.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n if (this.isBrowser) {\n const active = document.activeElement;\n this.previouslyFocused = active instanceof HTMLElement ? active : null;\n const host = this.overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n 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 void this.focusTrap.focusInitialElementWhenReady();\n }\n\n if (this.closeOnBackdropClick()) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n }\n\n if (this.closeOnEscape()) {\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.open.set(false);\n }\n });\n }\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n // 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, wrAppendOverlayClose, 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 /**\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\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 void trap.focusInitialElementWhenReady();\n }\n\n return drawerRef;\n }\n\n /**\n * Tie the drawer's lifetime to the URL it was opened on — the same treatment\n * `WrDialog` gets, and for the same reason.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape, the appended × or an explicit `close()`, so\n * navigating away left the panel, its backdrop, its focus trap and the\n * page-wide scroll block sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an in-app\n * `router.navigate()` left the drawer standing. And `drawerRef.close()` rather\n * than disposing the overlay behind the ref's back, which would never emit\n * `closed`, never destroy the focus trap, and leave `awaitClose()` pending.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, drawerRef: WrDrawerRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => drawerRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked drawer\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Resolved per open, not stored as a plain string at injection: this is a root\n * service, so a one-shot read — which is what `WrDialog` used to have, and moved\n * off for this reason — would run before an async catalog had loaded and then\n * freeze that answer for the life of the app. (`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]': '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;GAAI;EACrD,CAAA;;;;;;;;;;AChBD,SAAgB,eAAe,YAA6B;CAC1D,MAAM,SAAS,OAAO,aAAa,cAAc,OAAO,SAAS;CACjE,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,YAAY,gBAAgB,SAAS,MAAM;AAClE;AAWA,SAAgB,cAAW;CACzB,IAAI,OAAO,aAA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E;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 } 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 OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n EnvironmentInjector,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterEveryRender,\n contentChild,\n effect,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOverlayOrder, 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 { 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 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\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 openOverlay(): void {\n if (this.overlayRef) return;\n\n const pos = this.position();\n const isHorizontal = pos === 'left' || pos === 'right';\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n if (pos === 'top') positionStrategy.top();\n else if (pos === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = this.maxHeight();\n const modal = this.hasBackdrop();\n this.modal = modal;\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\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 width: isHorizontal ? this.width() : '100vw',\n height: isHorizontal ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n\n // `position` is PHYSICAL — a `left` drawer is on the physical left in either\n // direction — and it takes BOTH halves of the follower to keep it that way.\n // The CDK places the panel with `justify-content` on a host it also writes\n // `dir` to, and that host is a flex row, so the attribute alone reverses the\n // main axis and slides a `left` drawer across to the right; `apply()`'s own\n // RTL branch swaps `flex-start` for `flex-end` to cancel exactly that. So\n // the `setDirection()` + `updatePosition()` pair leaves the panel where it\n // is and only re-resolves what the panel's own logical CSS reads — which is\n // the whole point, since the direction inside the drawer really did change.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n 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 void this.focusTrap.focusInitialElementWhenReady();\n }\n\n if (this.closeOnBackdropClick()) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n }\n\n if (this.closeOnEscape()) {\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.open.set(false);\n }\n });\n }\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n // 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, 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 void trap.focusInitialElementWhenReady();\n }\n\n return drawerRef;\n }\n\n /**\n * Tie the drawer's lifetime to the URL it was opened on — the same treatment\n * `WrDialog` gets, and for the same reason.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape, the appended × or an explicit `close()`, so\n * navigating away left the panel, its backdrop, its focus trap and the\n * page-wide scroll block sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an in-app\n * `router.navigate()` left the drawer standing. And `drawerRef.close()` rather\n * than disposing the overlay behind the ref's back, which would never emit\n * `closed`, never destroy the focus trap, and leave `awaitClose()` pending.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, drawerRef: WrDrawerRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => drawerRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked drawer\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Resolved per open, not stored as a plain string at injection: this is a root\n * service, so a one-shot read — which is what `WrDialog` used to have, and moved\n * off for this reason — would run before an async catalog had loaded and then\n * freeze that answer for the life of the app. (`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;GAAI;EACrD,CAAA;;;;;;;;;;AChBD,SAAgB,eAAe,YAA6B;CAC1D,MAAM,SAAS,OAAO,aAAa,cAAc,OAAO,SAAS;CACjE,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,YAAY,gBAAgB,SA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downItem {
|
|
|
501
501
|
transform: coerceBooleanProperty
|
|
502
502
|
});
|
|
503
503
|
classes = computed(() => {
|
|
504
|
-
const parts = [
|
|
504
|
+
const parts = [];
|
|
505
505
|
if (this.disabled()) parts.push("wr-dropdown-item--disabled");
|
|
506
506
|
return parts.join(" ");
|
|
507
507
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
@@ -551,7 +551,8 @@ var WrDropdownItem = class WrDropdownItem {
|
|
|
551
551
|
"class": "classes()",
|
|
552
552
|
"attr.tabindex": "-1",
|
|
553
553
|
"attr.aria-disabled": "disabled() ? true : null"
|
|
554
|
-
}
|
|
554
|
+
},
|
|
555
|
+
classAttribute: "wr-dropdown-item"
|
|
555
556
|
},
|
|
556
557
|
ngImport: i0,
|
|
557
558
|
template: "@if (icon(); as name) {\n <wr-icon class=\"wr-dropdown-item__icon\" [name]=\"name\" />\n}\n<span class=\"wr-dropdown-item__label\">\n <ng-content />\n</span>\n",
|
|
@@ -576,6 +577,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
576
577
|
encapsulation: ViewEncapsulation.None,
|
|
577
578
|
host: {
|
|
578
579
|
role: "menuitem",
|
|
580
|
+
class: "wr-dropdown-item",
|
|
579
581
|
"[class]": "classes()",
|
|
580
582
|
"[attr.tabindex]": "-1",
|
|
581
583
|
"[attr.aria-disabled]": "disabled() ? true : null",
|