ngwr 16.7.0 → 16.8.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.
Files changed (167) hide show
  1. package/charts/donut-chart/styles/_index.scss +9 -3
  2. package/charts/meter-group/styles/_index.scss +8 -1
  3. package/charts/sparkline/styles/_index.scss +6 -3
  4. package/checkbox/styles/_index.scss +4 -0
  5. package/command-palette/styles/_index.scss +10 -0
  6. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -1
  7. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  8. package/fesm2022/ngwr-charts-core.mjs +17 -0
  9. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  10. package/fesm2022/ngwr-charts-donut-chart-testing.mjs +27 -0
  11. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  12. package/fesm2022/ngwr-charts-donut-chart.mjs +54 -6
  13. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  14. package/fesm2022/ngwr-charts-meter-group-testing.mjs +27 -0
  15. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  16. package/fesm2022/ngwr-charts-meter-group.mjs +54 -6
  17. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  18. package/fesm2022/ngwr-charts-sparkline-testing.mjs +27 -0
  19. package/fesm2022/ngwr-charts-sparkline-testing.mjs.map +1 -1
  20. package/fesm2022/ngwr-charts-sparkline.mjs +45 -4
  21. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  22. package/fesm2022/ngwr-checkbox.mjs +38 -3
  23. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  24. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  25. package/fesm2022/ngwr-color-picker.mjs +4 -3
  26. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  27. package/fesm2022/ngwr-command-palette.mjs +39 -19
  28. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  29. package/fesm2022/ngwr-context-menu.mjs +7 -2
  30. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  31. package/fesm2022/ngwr-date-picker.mjs +1 -0
  32. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  33. package/fesm2022/ngwr-dialog.mjs +10 -7
  34. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  35. package/fesm2022/ngwr-drawer.mjs +14 -8
  36. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  37. package/fesm2022/ngwr-file-upload.mjs +2 -2
  38. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  39. package/fesm2022/ngwr-i18n-ar.mjs +9 -2
  40. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  41. package/fesm2022/ngwr-i18n-cs.mjs +9 -2
  42. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  43. package/fesm2022/ngwr-i18n-de.mjs +9 -2
  44. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  45. package/fesm2022/ngwr-i18n-en.mjs +9 -2
  46. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  47. package/fesm2022/ngwr-i18n-es.mjs +9 -2
  48. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  49. package/fesm2022/ngwr-i18n-fr.mjs +9 -2
  50. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  51. package/fesm2022/ngwr-i18n-he.mjs +9 -2
  52. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  53. package/fesm2022/ngwr-i18n-hi.mjs +9 -2
  54. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  55. package/fesm2022/ngwr-i18n-id.mjs +9 -2
  56. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  57. package/fesm2022/ngwr-i18n-it.mjs +9 -2
  58. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  59. package/fesm2022/ngwr-i18n-ja.mjs +9 -2
  60. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  61. package/fesm2022/ngwr-i18n-kk.mjs +9 -2
  62. package/fesm2022/ngwr-i18n-kk.mjs.map +1 -1
  63. package/fesm2022/ngwr-i18n-ko.mjs +9 -2
  64. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  65. package/fesm2022/ngwr-i18n-nl.mjs +9 -2
  66. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  67. package/fesm2022/ngwr-i18n-pl.mjs +9 -2
  68. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  69. package/fesm2022/ngwr-i18n-pt.mjs +9 -2
  70. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  71. package/fesm2022/ngwr-i18n-ru.mjs +9 -2
  72. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  73. package/fesm2022/ngwr-i18n-sv.mjs +9 -2
  74. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  75. package/fesm2022/ngwr-i18n-tr.mjs +9 -2
  76. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  77. package/fesm2022/ngwr-i18n-uk.mjs +9 -2
  78. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  79. package/fesm2022/ngwr-i18n-vi.mjs +9 -2
  80. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
  82. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-zh.mjs +9 -2
  84. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  85. package/fesm2022/ngwr-input-number.mjs +33 -10
  86. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  87. package/fesm2022/ngwr-input-otp.mjs +24 -10
  88. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  89. package/fesm2022/ngwr-input.mjs +2 -2
  90. package/fesm2022/ngwr-input.mjs.map +1 -1
  91. package/fesm2022/ngwr-lightbox.mjs +5 -3
  92. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  93. package/fesm2022/ngwr-overlay.mjs +51 -2
  94. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  95. package/fesm2022/ngwr-popconfirm.mjs +2 -2
  96. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  97. package/fesm2022/ngwr-popover.mjs +11 -1
  98. package/fesm2022/ngwr-popover.mjs.map +1 -1
  99. package/fesm2022/ngwr-scroll.mjs +39 -16
  100. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  101. package/fesm2022/ngwr-slider.mjs +22 -17
  102. package/fesm2022/ngwr-slider.mjs.map +1 -1
  103. package/fesm2022/ngwr-switch.mjs +33 -3
  104. package/fesm2022/ngwr-switch.mjs.map +1 -1
  105. package/fesm2022/ngwr-table.mjs +17 -4
  106. package/fesm2022/ngwr-table.mjs.map +1 -1
  107. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  108. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  109. package/fesm2022/ngwr-tour.mjs +8 -3
  110. package/fesm2022/ngwr-tour.mjs.map +1 -1
  111. package/fesm2022/ngwr-version.mjs +1 -1
  112. package/fesm2022/ngwr-version.mjs.map +1 -1
  113. package/i18n/ar.json +9 -2
  114. package/i18n/cs.json +9 -2
  115. package/i18n/de.json +9 -2
  116. package/i18n/en.json +9 -2
  117. package/i18n/es.json +9 -2
  118. package/i18n/fr.json +9 -2
  119. package/i18n/he.json +9 -2
  120. package/i18n/hi.json +9 -2
  121. package/i18n/id.json +9 -2
  122. package/i18n/it.json +9 -2
  123. package/i18n/ja.json +9 -2
  124. package/i18n/kk.json +9 -2
  125. package/i18n/ko.json +9 -2
  126. package/i18n/nl.json +9 -2
  127. package/i18n/pl.json +9 -2
  128. package/i18n/pt.json +9 -2
  129. package/i18n/ru.json +9 -2
  130. package/i18n/sv.json +9 -2
  131. package/i18n/tr.json +9 -2
  132. package/i18n/uk.json +9 -2
  133. package/i18n/vi.json +9 -2
  134. package/i18n/zh-TW.json +9 -2
  135. package/i18n/zh.json +9 -2
  136. package/llms-full.txt +4 -4
  137. package/package.json +1 -1
  138. package/radio/styles/_index.scss +4 -0
  139. package/schematics/use/rule.js +1 -0
  140. package/schematics/use/symbol-map.json +1 -0
  141. package/switch/styles/_index.scss +4 -0
  142. package/table/styles/_index.scss +7 -0
  143. package/tour/styles/_index.scss +11 -7
  144. package/types/ngwr-charts-donut-chart-testing.d.ts +32 -3
  145. package/types/ngwr-charts-donut-chart.d.ts +45 -6
  146. package/types/ngwr-charts-meter-group-testing.d.ts +29 -1
  147. package/types/ngwr-charts-meter-group.d.ts +43 -4
  148. package/types/ngwr-charts-sparkline-testing.d.ts +32 -2
  149. package/types/ngwr-charts-sparkline.d.ts +42 -3
  150. package/types/ngwr-checkbox.d.ts +14 -0
  151. package/types/ngwr-color-picker-testing.d.ts +1 -1
  152. package/types/ngwr-command-palette.d.ts +2 -1
  153. package/types/ngwr-date-picker.d.ts +8 -2
  154. package/types/ngwr-dialog.d.ts +11 -6
  155. package/types/ngwr-drawer.d.ts +12 -4
  156. package/types/ngwr-file-upload.d.ts +1 -1
  157. package/types/ngwr-input-number.d.ts +14 -2
  158. package/types/ngwr-input-otp.d.ts +2 -0
  159. package/types/ngwr-lightbox.d.ts +1 -0
  160. package/types/ngwr-overlay.d.ts +20 -1
  161. package/types/ngwr-popover.d.ts +3 -3
  162. package/types/ngwr-scroll.d.ts +11 -2
  163. package/types/ngwr-slider.d.ts +3 -1
  164. package/types/ngwr-switch.d.ts +13 -0
  165. package/types/ngwr-table.d.ts +1 -0
  166. package/types/ngwr-tabs-router.d.ts +3 -4
  167. package/types/ngwr-version.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-drawer.mjs","names":[],"sources":["../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/drawer-focus.ts","../../../projects/lib/drawer/drawer.ts","../../../projects/lib/drawer/drawer.html","../../../projects/lib/drawer/drawer-ref.ts","../../../projects/lib/drawer/tokens/drawer-data.token.ts","../../../projects/lib/drawer/tokens/drawer-ref.token.ts","../../../projects/lib/drawer/drawer-manager.ts","../../../projects/lib/drawer/directives/drawer-content.ts","../../../projects/lib/drawer/directives/drawer-footer.ts","../../../projects/lib/drawer/directives/drawer-close.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nlet uid = 0;\n\n/**\n * Marks an element as the drawer's title row. Applies the `wr-drawer__title`\n * class so the drawer's stylesheet can lay it out alongside content and\n * footer slots. Auto-assigns an `id` so the drawer panel references it via\n * `aria-labelledby`.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"open\">\n * <h2 wrDrawerTitle>Settings</h2>\n * <div wrDrawerContent>…</div>\n * </wr-drawer>\n * ```\n */\n@Directive({\n selector: '[wrDrawerTitle]',\n exportAs: 'wrDrawerTitle',\n host: { class: 'wr-drawer__title', '[attr.id]': 'id' },\n})\nexport class WrDrawerTitle {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\n /** Generated id used by the drawer panel for `aria-labelledby`. */\n readonly id = `wr-drawer-title-${++uid}`;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { OverlayRef } from '@angular/cdk/overlay';\n\n/**\n * Whether focus is inside the drawer's panel. Shared by the non-modal Escape\n * gate and the close path, in `<wr-drawer>` and in `WrDrawerRef`.\n *\n * @internal\n */\nexport function drawerHasFocus(overlayRef: OverlayRef | null): boolean {\n const active = typeof document === 'undefined' ? null : document.activeElement;\n return !!active && !!overlayRef?.overlayElement?.contains(active);\n}\n\n/**\n * Whether nothing has focus any more — `<body>` or nothing at all. A non-modal\n * drawer takes Escape, and returns focus to its opener on close, only from\n * inside itself or from here: a click on the panel's own text focuses nothing\n * and lands focus here, while a reader who has clicked or tabbed on into the\n * page is left where they are.\n *\n * @internal\n */\nexport function focusIsLost(): boolean {\n if (typeof document === 'undefined') return false;\n const active = document.activeElement;\n return !active || active === document.body;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ConfigurableFocusTrapFactory, type FocusTrap, FocusTrapFactory, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport type { GlobalPositionStrategy, OverlayRef, OverlaySizeConfig } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n EnvironmentInjector,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterEveryRender,\n contentChild,\n effect,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOverlayOrder, wrFocusOverlay, wrFollowDirection } from 'ngwr/overlay';\nimport { wrToClassList, wrCheckStyles, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport type { WrDrawerAutoFocus, WrDrawerPosition } from './types';\n\n/**\n * Side panel that slides in from an edge of the viewport. Two-way binds\n * `open` and renders into a CDK overlay so it sits above page content.\n *\n * Compose the body with `<wrDrawerTitle>`, `<wrDrawerContent>`, and\n * `<wrDrawerFooter>` directives.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"settingsOpen\" position=\"right\" width=\"24rem\">\n * <h2 wrDrawerTitle>Settings</h2>\n * <div wrDrawerContent>...</div>\n * <div wrDrawerFooter>\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * </div>\n * </wr-drawer>\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Component({\n selector: 'wr-drawer',\n templateUrl: './drawer.html',\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\n host: { '[style.display]': \"'none'\" },\n})\nexport class WrDrawer {\n /** Two-way bindable open state. */\n readonly open = model<boolean>(false);\n\n /** Side the drawer slides in from. @default 'right' */\n readonly position = input<WrDrawerPosition>('right');\n\n /** Width when position is left/right. Any CSS length. @default '20rem' */\n readonly width = input<string>('20rem');\n\n /** Height when position is top/bottom. Any CSS length. @default '16rem' */\n readonly height = input<string>('16rem');\n\n /**\n * Upper cap on height (top/bottom positions). Useful for bottom sheets\n * that should grow with content up to a viewport-relative max.\n * Any CSS length. @default null (no cap)\n */\n readonly maxHeight = input<string | null>(null);\n\n /**\n * Round the leading corners — the edge facing the viewport interior.\n * Common bottom-sheet styling. @default false\n */\n readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Pad the trailing edge with `env(safe-area-inset-*)` so content\n * doesn't sit under the iOS home indicator. @default false\n */\n readonly safeArea = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show the dimming backdrop, and with it make the drawer MODAL: focus is\n * trapped inside, the panel is announced with `aria-modal=\"true\"`, and the\n * page behind it does not scroll.\n *\n * `false` makes it a NON-MODAL side panel (since v15). The page stays\n * clickable, scrollable and reachable with Tab; the panel keeps\n * `role=\"dialog\"` without `aria-modal`. Focus still moves into it on open,\n * Escape closes it unless focus has moved on to the page, and on close\n * focus goes back to the opener unless the reader has moved on likewise.\n * Read when the drawer opens. @default true\n */\n readonly hasBackdrop = input(true, { transform: coerceBooleanProperty });\n\n /** Close when the backdrop is clicked. @default true */\n readonly closeOnBackdropClick = input(true, { transform: coerceBooleanProperty });\n\n /** Close on Escape. @default true */\n readonly closeOnEscape = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a dismiss (×) button in the panel's top-right corner. Set `false` when\n * the projected content supplies its own close affordance. @default true\n */\n readonly closable = input(true, { transform: coerceBooleanProperty });\n\n /** Accessible name for the dismiss button. Falls back to `drawer.close`. */\n readonly closeLabel = input<string | null>(null);\n\n /**\n * Extra CSS classes for the drawer's panel — the box that slides in.\n *\n * On the panel rather than on the CDK pane, because that is the element\n * `WrDrawerManager.open({ panelClass })` styles too: there the content IS the\n * pane, so one name has to mean the same surface on both paths.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Where the global toast stack paints while the drawer is open. `'below'`\n * keeps it under the drawer and its backdrop. Read when the drawer opens.\n * @default 'above'\n */\n readonly toasts = input<'above' | 'below'>('above');\n\n /**\n * Where focus goes when the drawer opens: `'dialog'` focuses the panel itself\n * with no ring so the first Tab reaches the first control, `'first-tabbable'`\n * focuses the first tabbable element, `false` moves nothing. An element\n * marked `cdkFocusInitial` wins in every mode. Read when the drawer opens.\n * @default 'dialog'\n */\n readonly autoFocus = input<WrDrawerAutoFocus>('dialog');\n\n protected readonly resolvedCloseLabel = useI18nText(this.closeLabel, 'drawer.close', 'Close drawer');\n\n protected readonly panelTpl = viewChild.required(TemplateRef);\n\n /**\n * A projected `[wrDrawerTitle]`, if the consumer gave one.\n *\n * The dismiss button is corner chrome positioned at a fixed\n * `inset-block-start` chosen to centre it on the TITLE's first line. With no\n * title the content starts at the top of the panel and runs underneath it: on\n * a bare `<wr-drawer><nav /></wr-drawer>` the button covered the first menu\n * row by 24×16 px, and `elementFromPoint` at the button's centre returned the\n * button, so that corner of the first item was unclickable. The panel has to\n * know, because only the panel can reserve the space.\n */\n private readonly projectedTitle = contentChild(WrDrawerTitle);\n\n protected panelClasses(): string {\n const parts = ['wr-drawer__panel', `wr-drawer__panel--${this.position()}`];\n if (this.rounded()) parts.push('wr-drawer__panel--rounded');\n if (this.safeArea()) parts.push('wr-drawer__panel--safe-area');\n if (this.closable()) parts.push('wr-drawer__panel--closable');\n // Only when there is something to collide with: a closable drawer with a\n // title already clears the button, and an unclosable one has no button.\n if (this.closable() && !this.projectedTitle()) parts.push('wr-drawer__panel--untitled');\n return wrToClassList(parts, this.panelClass()).join(' ');\n }\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly order = inject(WrOverlayOrder);\n private readonly vcr = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly plainFocusTrapFactory = inject(FocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n /**\n * The reading direction the open drawer has to keep up with, resolved off the\n * ENVIRONMENT injector rather than this component's.\n *\n * That is where the CDK read it: `createOverlayRef` takes `Directionality`\n * from the `Overlay`'s own injector, which `WR_OVERLAY` parents to the\n * application's, so a node-level CDK `[dir]` is never in the chain. A\n * panel is not IN that island either — it is appended to the overlay\n * container on `<body>` — so following the node injector would not follow the\n * ref at all: it would rewrite a correctly-stamped panel to the island's\n * direction one pass after it opened, and `WrDrawerManager`, a root service\n * with no island to read, could never do the same. Two halves of one\n * component, same panel classes, same stylesheet, two answers.\n *\n * `null` never happens in an app — `Directionality` is root-provided — but a\n * bare `TestBed` should still get a drawer that opens, with nothing ambient\n * to follow.\n */\n private readonly dir = inject(EnvironmentInjector).get(Directionality, null);\n\n private overlayRef: OverlayRef | null = null;\n private focusTrap: FocusTrap | null = null;\n private previouslyFocused: HTMLElement | null = null;\n /** Whether the open panel is modal — `hasBackdrop` as it was when it opened. */\n private modal = true;\n /** The side the open overlay sits on. */\n private side: WrDrawerPosition = 'right';\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n effect(() => {\n if (this.open()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n afterEveryRender(() => this.syncLabel());\n this.destroyRef.onDestroy(() => this.closeOverlay());\n }\n\n /**\n * Point the panel's `aria-labelledby` at the CURRENT `[wrDrawerTitle]`.\n *\n * Re-resolved after every render rather than once when the drawer opens,\n * because the title element is projected content and can come and go while\n * the drawer stays open — an `@if` around it, or a heading that only exists\n * once the data arrives. A one-shot lookup leaves the attribute naming an\n * element that has been removed or replaced, and a dangling reference is not\n * a name: the dialog is announced as unnamed, with nothing on screen to say\n * so. A missing title clears the attribute for the same reason.\n */\n private syncLabel(): void {\n const host = this.overlayRef?.overlayElement;\n if (!host) return;\n\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n }\n\n private positionStrategy(pos: WrDrawerPosition): GlobalPositionStrategy {\n const strategy = this.overlay\n .position()\n .global()\n [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n if (pos === 'top') strategy.top();\n else if (pos === 'bottom') strategy.bottom();\n else strategy.centerVertically();\n return strategy;\n }\n\n private size(pos: WrDrawerPosition): OverlaySizeConfig {\n const isHorizontal = pos === 'left' || pos === 'right';\n return {\n width: isHorizontal ? this.width() : '100vw',\n height: isHorizontal ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (this.maxHeight() ?? undefined),\n };\n }\n\n /**\n * Carry `position`, `width`, `height` and `maxHeight` over to the open\n * overlay. The CDK reads them once, in `create()`.\n */\n private syncOverlay(ref: OverlayRef): void {\n const pos = this.position();\n if (pos !== this.side) {\n ref.removePanelClass(`wr-drawer-overlay--${this.side}`);\n ref.addPanelClass(`wr-drawer-overlay--${pos}`);\n this.side = pos;\n ref.updatePositionStrategy(this.positionStrategy(pos));\n }\n ref.updateSize(this.size(pos));\n }\n\n private openOverlay(): void {\n if (this.overlayRef) {\n this.syncOverlay(this.overlayRef);\n return;\n }\n\n const pos = this.position();\n this.side = pos;\n const modal = this.hasBackdrop();\n this.modal = modal;\n\n this.overlayRef = this.overlay.create({\n positionStrategy: this.positionStrategy(pos),\n hasBackdrop: modal,\n backdropClass: 'wr-drawer-backdrop',\n panelClass: ['wr-drawer-overlay', `wr-drawer-overlay--${pos}`],\n // A non-modal panel leaves the page scrolling under it: nothing covers\n // the page, so a blocked scroll would only freeze what the reader can\n // still see and click.\n scrollStrategy: modal ? this.overlay.scrollStrategies.block() : this.overlay.scrollStrategies.noop(),\n // The CDK hands Escape to the topmost overlay wherever focus is. That is\n // right for a modal, where focus cannot be anywhere else, and wrong for a\n // panel beside a live page: an Escape meant for a field on the page\n // closed the drawer. Declined, the key walks on to the next overlay.\n // Focus on `<body>` still counts: a click on the panel's own text\n // focuses nothing, so that is where a reader inside it usually is.\n eventPredicate: modal ? undefined : () => drawerHasFocus(this.overlayRef) || focusIsLost(),\n ...this.size(pos),\n });\n\n // `position` is PHYSICAL — a `left` drawer is on the physical left in either\n // direction — and it takes BOTH halves of the follower to keep it that way.\n // The CDK places the panel with `justify-content` on a host it also writes\n // `dir` to, and that host is a flex row, so the attribute alone reverses the\n // main axis and slides a `left` drawer across to the right; `apply()`'s own\n // RTL branch swaps `flex-start` for `flex-end` to cancel exactly that. So\n // the `setDirection()` + `updatePosition()` pair leaves the panel where it\n // is and only re-resolves what the panel's own logical CSS reads — which is\n // the whole point, since the direction inside the drawer really did change.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n this.overlayRef.detachments().subscribe(this.order.add(this.overlayRef.hostElement, this.toasts()));\n\n if (this.isBrowser) {\n const active = document.activeElement;\n this.previouslyFocused = active instanceof HTMLElement ? active : null;\n const host = this.overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n if (modal) host.setAttribute('aria-modal', 'true');\n // Non-modal: a trap with no anchors and no inert strategy, which only\n // moves focus in — `cdkFocusInitial` honoured the same way — and then\n // lets Tab carry on out into the page.\n this.focusTrap = modal ? this.focusTrapFactory.create(host) : this.plainFocusTrapFactory.create(host, true);\n wrFocusOverlay(host, this.focusTrap, this.autoFocus(), this.injector);\n }\n\n if (this.closeOnBackdropClick()) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n }\n\n if (this.closeOnEscape()) {\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n this.open.set(false);\n }\n });\n }\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n // Read before disposal, which takes the focused element out of the page.\n const returnFocus = this.modal || drawerHasFocus(this.overlayRef) || focusIsLost();\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (returnFocus && restore && typeof restore.focus === 'function') {\n wrRestoreFocus(restore, this.focusMonitor);\n }\n }\n}\n","<ng-template>\n <div [class]=\"panelClasses()\">\n @if (closable()) {\n <button type=\"button\" class=\"wr-drawer__close\" [attr.aria-label]=\"resolvedCloseLabel()\" (click)=\"open.set(false)\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n }\n <ng-content />\n </div>\n</ng-template>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type FocusTrap, FocusMonitor } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef, Injector } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\nimport { wrRestoreFocus } from 'ngwr/utils';\n\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\n\n/**\n * Handle returned by `WrDrawerManager.open()`.\n *\n * Wraps the underlying `OverlayRef` and tracks the close result. It is also\n * provided inside the drawer's own injector, so the projected content can\n * inject it and close itself — the counterpart to `[wrDrawerClose]` when the\n * close is programmatic (after a save succeeds, say) rather than a click.\n *\n * @example\n * ```ts\n * // Caller side.\n * const ref = drawers.open<ChatComponent, boolean>(ChatComponent, { position: 'right' });\n * const result = await ref.awaitClose(); // boolean | undefined\n * ```\n *\n * @example\n * ```ts\n * // Content side — the drawer closes itself.\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject(WrDrawerRef);\n *\n * send(): void {\n * this.store.send(this.draft());\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport class WrDrawerRef<C, R = unknown> {\n /**\n * Emits the close result once and completes.\n *\n * A `ReplaySubject`, not a plain `Subject`, so the result survives a late\n * subscriber: content can close itself before `open()` has even returned, and\n * `awaitClose()` may be called long after the dismissal — both would otherwise\n * see only `complete` and resolve `undefined`.\n */\n readonly closed = new ReplaySubject<R | undefined>(1);\n\n /** @internal */\n componentRef: ComponentRef<C> | null = null;\n\n /** @internal */\n focusTrap: FocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n /** @internal — `false` for a drawer opened with `hasBackdrop: false`. */\n modal = true;\n\n /**\n * @param _overlayRef the overlay the drawer is mounted in.\n * @param injector where the focus hand-back finds the CDK `FocusMonitor`; without\n * one it is a plain `focus()`.\n */\n private readonly focusMonitor: FocusMonitor | null;\n\n constructor(\n private readonly _overlayRef: OverlayRef,\n injector?: Injector\n ) {\n // Resolved now: the injector may be gone by the time the drawer closes.\n this.focusMonitor = injector?.get(FocusMonitor, null) ?? null;\n }\n\n /** The instantiated drawer component. */\n get componentInstance(): C {\n if (!this.componentRef) {\n throw new Error('WrDrawerRef: component not yet attached');\n }\n return this.componentRef.instance;\n }\n\n private isClosed = false;\n\n /** Close the drawer, optionally returning a result. */\n close(result?: R): void {\n if (this.isClosed) return;\n this.isClosed = true;\n this.closed.next(result);\n this.closed.complete();\n // Content that closes itself while constructing gets here with\n // `OverlayRef.attach()` still on the stack — `componentRef` is assigned\n // only once attach returns. Disposing mid-attach leaves the CDK writing to\n // a detached host, so let the current task finish first.\n if (!this.componentRef) {\n queueMicrotask(() => this.teardown());\n return;\n }\n this.teardown();\n }\n\n private teardown(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n // A non-modal drawer sends focus back only from inside itself, or when it\n // has been lost: a reader already working on the page stays there. Read\n // before disposal, which takes the focused element out of the page.\n const returnFocus = this.modal || drawerHasFocus(this._overlayRef) || focusIsLost();\n this._overlayRef.dispose();\n // Drop the destroyed component so a retained ref doesn't pin its instance,\n // host element and view in memory.\n this.componentRef = null;\n // Restore focus after disposal so the trigger is reachable again.\n if (returnFocus && restore && typeof restore.focus === 'function') {\n wrRestoreFocus(restore, this.focusMonitor);\n }\n }\n\n /** Resolves with the close result when the drawer is dismissed. */\n awaitClose(): Promise<R | undefined> {\n return new Promise(resolve => {\n this.closed.subscribe({\n next: value => resolve(value),\n complete: () => resolve(undefined),\n });\n });\n }\n\n /** Underlying overlay ref — escape hatch for advanced cases. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\n/**\n * Token that exposes the `data` payload passed to `WrDrawerManager.open()`.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * readonly data = inject<ChatData>(WR_DRAWER_DATA);\n * }\n * ```\n */\nexport const WR_DRAWER_DATA = new InjectionToken<unknown>('WR_DRAWER_DATA');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrDrawerRef } from '../drawer-ref';\n\n/**\n * Token exposing the open drawer's `WrDrawerRef` to components and\n * directives rendered inside it (e.g. `[wrDrawerClose]`).\n *\n * **Prefer `inject(WrDrawerRef)`** — the ref is provided under the class token\n * too, and the class path is the documented one. It already covers both cases\n * you might reach for a token for: `inject(WrDrawerRef, { optional: true })`\n * works for content that also renders outside a drawer, and\n * `inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef)` types the generics\n * without a cast.\n *\n * This token is the same object under a second key. It exists for the library's\n * own directives (`[wrDrawerClose]`) and for swapping the provider out — a test\n * stub, say — without touching the class.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef);\n *\n * dismiss(): void {\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport const WR_DRAWER_REF = new InjectionToken<WrDrawerRef<unknown, unknown>>('WR_DRAWER_REF');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ConfigurableFocusTrapFactory, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal, type ComponentType } from '@angular/cdk/portal';\nimport { Location, isPlatformBrowser } from '@angular/common';\nimport { EnvironmentInjector, Injector, PLATFORM_ID, Service, afterEveryRender, inject } from '@angular/core';\n\nimport { WrI18n } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOverlayOrder, wrAppendOverlayClose, wrFocusOverlay, wrFollowDirection } from 'ngwr/overlay';\nimport { wrToClassList } from 'ngwr/utils';\n\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport { WrDrawerRef } from './drawer-ref';\nimport { WR_DRAWER_DATA, WR_DRAWER_REF } from './tokens';\nimport type { WrDrawerOptions, WrDrawerPosition } from './types';\n\nconst DEFAULT_POSITION: WrDrawerPosition = 'right';\nconst DEFAULT_WIDTH = '20rem';\nconst DEFAULT_HEIGHT = '16rem';\nconst BACKDROP_CLASS = 'wr-drawer-backdrop';\n\n/**\n * Opens drawer components in an isolated NGWR overlay — the programmatic\n * counterpart to `<wr-drawer [(open)]=\"…\">`.\n *\n * Use the component when the drawer is part of a template and its open state\n * is a signal you already own; use this service when the caller doesn't own\n * the markup (opening a chat panel from a toolbar action, from an effect, from\n * a route guard) or when you need the close result.\n *\n * Uses `WR_OVERLAY`, so drawers render into NGWR's own overlay container\n * and never collide with other CDK consumers (Material, NG-ZORRO, etc.).\n *\n * @example\n * ```ts\n * const drawers = inject(WrDrawerManager);\n *\n * const ref = drawers.open(ChatComponent, {\n * data: { threadId },\n * position: 'right',\n * width: '28rem',\n * });\n *\n * await ref.awaitClose();\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Service()\nexport class WrDrawerManager {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly plainFocusTrapFactory = inject(FocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly i18n = inject(WrI18n);\n private readonly location = inject(Location);\n private readonly order = inject(WrOverlayOrder);\n /**\n * The application's reading direction — the instance the CDK itself read when\n * it stamped the overlay. A root service has no node injector above it, so a\n * plain `inject()` here already resolves the environment one; `<wr-drawer>`,\n * which does, spells that out and says why. The two halves of one component\n * must not answer differently about the same panel.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n open<C, R = unknown, D = unknown>(component: ComponentType<C>, options: WrDrawerOptions<D> = {}): WrDrawerRef<C, R> {\n const position = options.position ?? DEFAULT_POSITION;\n const isHorizontal = position === 'left' || position === 'right';\n\n // The content component is attached straight into the overlay pane, so the\n // panel styles land on the pane rather than on an inner wrapper.\n const panelClasses = wrToClassList(\n 'wr-drawer-overlay',\n `wr-drawer-overlay--${position}`,\n 'wr-drawer__panel',\n `wr-drawer__panel--${position}`,\n options.rounded && 'wr-drawer__panel--rounded',\n options.safeArea && 'wr-drawer__panel--safe-area',\n options.panelClass\n );\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [position === 'left' ? 'left' : position === 'right' ? 'right' : 'centerHorizontally']();\n\n if (position === 'top') positionStrategy.top();\n else if (position === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = options.maxHeight ?? null;\n // No backdrop means NON-MODAL, the same rule as `<wr-drawer>`: no trap, no\n // `aria-modal`, no scroll block, and Escape only from inside the panel —\n // or from `<body>`, where a click on the panel's own text leaves focus.\n const modal = options.hasBackdrop !== false;\n // Assigned on the next statement; the predicate only runs from a keydown.\n let ref: OverlayRef | null = null;\n\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: modal ? this.scrollStrategies.block() : this.scrollStrategies.noop(),\n eventPredicate: modal ? undefined : () => drawerHasFocus(ref) || focusIsLost(),\n hasBackdrop: modal,\n backdropClass: BACKDROP_CLASS,\n panelClass: panelClasses,\n width: isHorizontal ? (options.width ?? DEFAULT_WIDTH) : '100vw',\n height: isHorizontal ? undefined : (options.height ?? DEFAULT_HEIGHT),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n ref = overlayRef;\n\n // Same pair, same reason as `<wr-drawer>`: `position` is physical, the CDK\n // writes `dir` on the flex host that `justify-content` places the panel in,\n // so the attribute alone would slide a `left` drawer to the right and\n // re-applying the strategy is what cancels it. The follower ends on the\n // ref's own `detachments()`, which every dismissal goes through, and each\n // `open()` creates a fresh ref of its own.\n wrFollowDirection(overlayRef, this.dir, this.parentInjector);\n\n const drawerRef = new WrDrawerRef<C, R>(overlayRef, this.parentInjector);\n drawerRef.modal = modal;\n\n if (this.isBrowser) {\n const active = document.activeElement;\n drawerRef.previouslyFocused = active instanceof HTMLElement ? active : null;\n }\n\n const injector = Injector.create({\n parent: this.parentInjector,\n providers: [\n { provide: WR_DRAWER_DATA, useValue: options.data },\n { provide: WR_DRAWER_REF, useValue: drawerRef },\n // Provided as its own token as well, so drawer content can reach for\n // the familiar `inject(WrDrawerRef)` and close itself.\n { provide: WrDrawerRef, useValue: drawerRef },\n ],\n });\n\n const portal = new ComponentPortal(component, null, injector);\n drawerRef.componentRef = overlayRef.attach(portal);\n overlayRef.detachments().subscribe(this.order.add(overlayRef.hostElement, options.toasts));\n\n // Wired BEFORE the panel is decorated, and the order is the fix: everything\n // below attaches attributes, a ✕ and a focus trap to an overlay that is\n // already on screen, so anything that throws in there used to leave an\n // `aria-modal` panel with no dismissal path at all — no ✕, no backdrop\n // handler, no Escape — over the whole application, and no ref for the caller\n // to close it with. A drawer that fails to finish opening must still be one\n // the user can get rid of. Overlay subscriptions complete when the overlay is\n // disposed, so no explicit teardown is required.\n if (options.closeOnBackdropClick !== false) {\n overlayRef.backdropClick().subscribe(() => drawerRef.close());\n }\n if (options.closeOnEscape !== false) {\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key === 'Escape') {\n event.preventDefault();\n drawerRef.close();\n }\n });\n }\n if (options.closeOnNavigation !== false) {\n this.watchNavigation(overlayRef, drawerRef);\n }\n\n if (this.isBrowser) {\n const host = overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n if (modal) host.setAttribute('aria-modal', 'true');\n // Built-in dismiss, same contract as WrDialog's `closable`.\n if (options.closable !== false) {\n host.classList.add('wr-drawer__panel--closable');\n const label = options.closeLabel ?? this.closeLabel();\n wrAppendOverlayClose(host, 'wr-drawer__close', label, () => drawerRef.close());\n }\n // Wire aria-labelledby to wrDrawerTitle's auto-id once content is in DOM.\n // Has to wait for a render, not a microtask: attaching the portal only\n // schedules change detection, so under zoneless CD a microtask runs while\n // the content is still an empty view and the title id doesn't exist yet.\n //\n // And after EVERY render, not just the next one: the title belongs to the\n // caller's component, so an `@if` or a late-arriving heading can replace\n // or remove the element the attribute names. A reference to a node that is\n // no longer there is not a name — the dialog announces as unnamed — so a\n // missing title clears the attribute rather than leaving it dangling.\n const labelSync = afterEveryRender(\n () => {\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n },\n { injector: this.parentInjector }\n );\n // The hook is bound to the root injector, so it outlives the drawer unless\n // it is torn down with it. `detachments()` fires on dispose, which is the\n // one path every dismissal goes through.\n overlayRef.detachments().subscribe(() => labelSync.destroy());\n // Trap focus inside the drawer and move initial focus in. A non-modal\n // drawer only gets the second half: a trap with no anchors and no inert\n // strategy moves focus in and leaves Tab free to walk out to the page.\n const trap = modal ? this.focusTrapFactory.create(host) : this.plainFocusTrapFactory.create(host, true);\n drawerRef.focusTrap = trap;\n wrFocusOverlay(host, trap, options.autoFocus ?? 'dialog', this.parentInjector);\n }\n\n return drawerRef;\n }\n\n /**\n * Tie the drawer's lifetime to the URL it was opened on — the same treatment\n * `WrDialog` gets, and for the same reason.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape, the appended × or an explicit `close()`, so\n * navigating away left the panel, its backdrop, its focus trap and the\n * page-wide scroll block sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an in-app\n * `router.navigate()` left the drawer standing. And `drawerRef.close()` rather\n * than disposing the overlay behind the ref's back, which would never emit\n * `closed`, never destroy the focus trap, and leave `awaitClose()` pending.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, drawerRef: WrDrawerRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => drawerRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked drawer\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Resolved per open, not stored as a plain string at injection: this is a root\n * service, so a one-shot read — which is what `WrDialog` used to have, and moved\n * off for this reason — would run before an async catalog had loaded and then\n * freeze that answer for the life of the app. (`wrReadI18nText` hands back a signal\n * now, so it would no longer freeze; the name still has to be pushed onto the\n * button per open either way.) `WrDialog.closeLabel()` is the matching precedent,\n * not the counter-example.\n *\n * The miss check is the point. `t()` hands back the KEY when the catalog has\n * no entry, and `WrI18n` is root-provided with an empty catalog by default —\n * so an app that never configured i18n got a button announced as\n * \"drawer.close, button\". A name WAS present, which is exactly why the axe\n * gate could not see it.\n */\n private closeLabel(): string {\n const resolved = this.i18n.t('drawer.close');\n return resolved === 'drawer.close' ? 'Close drawer' : resolved;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Marks the scrollable body of the drawer. Applies the `wr-drawer__content`\n * class so the panel's flex layout can stretch it between the title and the\n * footer.\n */\n@Directive({\n selector: '[wrDrawerContent]',\n host: { class: 'wr-drawer__content' },\n})\nexport class WrDrawerContent {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Marks the action row pinned to the bottom of the drawer. Adds the\n * `wr-drawer__footer` class plus an alignment modifier so action buttons\n * can sit at the start, center, or end of the row.\n *\n * @example\n * ```html\n * <div wrDrawerFooter align=\"end\">\n * <wr-btn wrDrawerClose>Cancel</wr-btn>\n * <wr-btn color=\"primary\" (click)=\"save()\">Save</wr-btn>\n * </div>\n * ```\n */\n@Directive({\n selector: '[wrDrawerFooter]',\n host: { class: 'wr-drawer__footer', '[class]': 'classes()' },\n})\nexport class WrDrawerFooter {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\n /** Horizontal alignment of footer content. @default 'end' */\n readonly align = input<'start' | 'center' | 'end'>('end');\n\n protected readonly classes = computed(() => `wr-drawer__footer wr-drawer__footer--${this.align()}`);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, inject, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrDrawer } from '../drawer';\nimport type { WrDrawerRef } from '../drawer-ref';\nimport { WR_DRAWER_REF } from '../tokens';\n\n/**\n * Closes the parent drawer on click. Attach to any clickable element.\n *\n * Works for both drawer flavours: inside `<wr-drawer>` it clears the\n * component's `open` model, and inside a `WrDrawerManager.open()` drawer it\n * closes the ref — optionally passing a `[wrDrawerClose]` value as the close\n * result (the component flavour has no result to carry, so the value is\n * ignored there).\n *\n * @example\n * ```html\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * <wr-btn color=\"primary\" [wrDrawerClose]=\"true\">Save</wr-btn>\n * ```\n */\n@Directive({\n selector: '[wrDrawerClose]',\n host: { '(click)': 'close()' },\n})\nexport class WrDrawerClose<R = unknown> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\n /**\n * Value to pass to `close()` for service-opened drawers. When unset — or\n * used as a bare attribute — the drawer closes with `undefined`.\n */\n readonly result = input<R | undefined, R | undefined | ''>(undefined, {\n alias: 'wrDrawerClose',\n // A bare `wrDrawerClose` attribute arrives as the empty string; that means\n // \"no result\", not a result of `''`.\n transform: value => (value === '' ? undefined : value),\n });\n\n private readonly drawer = inject(WrDrawer, { optional: true });\n private readonly ref = inject<WrDrawerRef<unknown, R>>(WR_DRAWER_REF, { optional: true });\n\n protected close(): void {\n // Element injectors win, so a surrounding `<wr-drawer>` is the nearer\n // owner even when a service-opened drawer sits further up the tree.\n if (this.drawer) {\n this.drawer.open.set(false);\n return;\n }\n this.ref?.close(this.result());\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,IAAI,MAAM;AAqBV,IAAa,gBAAb,MAAa,cAAa;CACxB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,QAAQ;CAC3E;CAGS,KAAK,mBAAmB,EAAE;CANxB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAa,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,WAAA,KAAA;GAAA,gBAAA;EAAA;EAAA,UAAA,CAAA,eAAA;EAAA,UAAA;CAAA,CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EALzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM;IAAE,OAAO;IAAoB,aAAa;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,cA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AAE,UAAU,KAAI,CAAE;CAE9E,QAAK;EAGb,IAAI,KAAK,QAAQ;GACf,KAAK,OAAO,KAAK,IAAI,KAAK;GAC1B;EACF;EACA,KAAK,KAAK,MAAM,KAAK,OAAM,CAAE;CAC/B;CA3BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAa,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,QAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,WAAA,EAAA,SAAA,UAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAJzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EAAE,WAAW,UAAS;EAC7B,CAAA"}
1
+ {"version":3,"file":"ngwr-drawer.mjs","names":[],"sources":["../../../projects/lib/drawer/directives/drawer-title.ts","../../../projects/lib/drawer/drawer-focus.ts","../../../projects/lib/drawer/drawer.ts","../../../projects/lib/drawer/drawer.html","../../../projects/lib/drawer/drawer-ref.ts","../../../projects/lib/drawer/tokens/drawer-data.token.ts","../../../projects/lib/drawer/tokens/drawer-ref.token.ts","../../../projects/lib/drawer/drawer-manager.ts","../../../projects/lib/drawer/directives/drawer-content.ts","../../../projects/lib/drawer/directives/drawer-footer.ts","../../../projects/lib/drawer/directives/drawer-close.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, ElementRef, inject } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nlet uid = 0;\n\n/**\n * Marks an element as the drawer's title row. Applies the `wr-drawer__title`\n * class so the drawer's stylesheet can lay it out alongside content and\n * footer slots. Keeps an `id` of your own and otherwise assigns one, so the drawer panel\n * references it via `aria-labelledby`.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"open\">\n * <h2 wrDrawerTitle>Settings</h2>\n * <div wrDrawerContent>…</div>\n * </wr-drawer>\n * ```\n */\n@Directive({\n selector: '[wrDrawerTitle]',\n exportAs: 'wrDrawerTitle',\n host: { class: 'wr-drawer__title', '[attr.id]': 'id' },\n})\nexport class WrDrawerTitle {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly fallbackId = `wr-drawer-title-${++uid}`;\n\n /**\n * The id the drawer panel's `aria-labelledby` points at: the element's own\n * `id` when the consumer set one, a generated one otherwise. A getter, read\n * fresh by the host binding, so a bound `[id]` is honoured too.\n */\n get id(): string {\n return this.host.nativeElement.id || this.fallbackId;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { OverlayRef } from '@angular/cdk/overlay';\n\n/**\n * Whether focus is inside the drawer's panel. Shared by the non-modal Escape\n * gate and the close path, in `<wr-drawer>` and in `WrDrawerRef`.\n *\n * @internal\n */\nexport function drawerHasFocus(overlayRef: OverlayRef | null): boolean {\n const active = typeof document === 'undefined' ? null : document.activeElement;\n return !!active && !!overlayRef?.overlayElement?.contains(active);\n}\n\n/**\n * Whether nothing has focus any more — `<body>` or nothing at all. A non-modal\n * drawer takes Escape, and returns focus to its opener on close, only from\n * inside itself or from here: a click on the panel's own text focuses nothing\n * and lands focus here, while a reader who has clicked or tabbed on into the\n * page is left where they are.\n *\n * @internal\n */\nexport function focusIsLost(): boolean {\n if (typeof document === 'undefined') return false;\n const active = document.activeElement;\n return !active || active === document.body;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ConfigurableFocusTrapFactory, type FocusTrap, FocusTrapFactory, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport type { GlobalPositionStrategy, OverlayRef, OverlaySizeConfig } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n EnvironmentInjector,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewContainerRef,\n ViewEncapsulation,\n afterEveryRender,\n contentChild,\n effect,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, WrOverlayOrder, WrScrollBlock, wrFocusOverlay, wrFollowDirection } from 'ngwr/overlay';\nimport { wrIsComposing, wrToClassList, wrCheckStyles, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrDrawerTitle } from './directives/drawer-title';\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport type { WrDrawerAutoFocus, WrDrawerPosition } from './types';\n\n/**\n * Side panel that slides in from an edge of the viewport. Two-way binds\n * `open` and renders into a CDK overlay so it sits above page content.\n *\n * Compose the body with `<wrDrawerTitle>`, `<wrDrawerContent>`, and\n * `<wrDrawerFooter>` directives.\n *\n * @example\n * ```html\n * <wr-drawer [(open)]=\"settingsOpen\" position=\"right\" width=\"24rem\">\n * <h2 wrDrawerTitle>Settings</h2>\n * <div wrDrawerContent>...</div>\n * <div wrDrawerFooter>\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * </div>\n * </wr-drawer>\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Component({\n selector: 'wr-drawer',\n templateUrl: './drawer.html',\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\n host: { '[style.display]': \"'none'\" },\n})\nexport class WrDrawer {\n /** Two-way bindable open state. */\n readonly open = model<boolean>(false);\n\n /** Side the drawer slides in from. @default 'right' */\n readonly position = input<WrDrawerPosition>('right');\n\n /** Width when position is left/right. Any CSS length. @default '20rem' */\n readonly width = input<string>('20rem');\n\n /** Height when position is top/bottom. Any CSS length. @default '16rem' */\n readonly height = input<string>('16rem');\n\n /**\n * Upper cap on height (top/bottom positions). Useful for bottom sheets\n * that should grow with content up to a viewport-relative max.\n * Any CSS length. @default null (no cap)\n */\n readonly maxHeight = input<string | null>(null);\n\n /**\n * Round the leading corners — the edge facing the viewport interior.\n * Common bottom-sheet styling. @default false\n */\n readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Pad the trailing edge with `env(safe-area-inset-*)` so content\n * doesn't sit under the iOS home indicator. @default false\n */\n readonly safeArea = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show the dimming backdrop, and with it make the drawer MODAL: focus is\n * trapped inside, the panel is announced with `aria-modal=\"true\"`, and the\n * page behind it does not scroll.\n *\n * `false` makes it a NON-MODAL side panel (since v15). The page stays\n * clickable, scrollable and reachable with Tab; the panel keeps\n * `role=\"dialog\"` without `aria-modal`. Focus still moves into it on open,\n * Escape closes it unless focus has moved on to the page, and on close\n * focus goes back to the opener unless the reader has moved on likewise.\n * Read when the drawer opens. @default true\n */\n readonly hasBackdrop = input(true, { transform: coerceBooleanProperty });\n\n /** Close when the backdrop is clicked. @default true */\n readonly closeOnBackdropClick = input(true, { transform: coerceBooleanProperty });\n\n /** Close on Escape. @default true */\n readonly closeOnEscape = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Show a dismiss (×) button in the panel's top-right corner. Set `false` when\n * the projected content supplies its own close affordance. @default true\n */\n readonly closable = input(true, { transform: coerceBooleanProperty });\n\n /** Accessible name for the dismiss button. Falls back to `drawer.close`. */\n readonly closeLabel = input<string | null>(null);\n\n /**\n * Extra CSS classes for the drawer's panel — the box that slides in.\n *\n * On the panel rather than on the CDK pane, because that is the element\n * `WrDrawerManager.open({ panelClass })` styles too: there the content IS the\n * pane, so one name has to mean the same surface on both paths.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Where the global toast stack paints while the drawer is open. `'below'`\n * keeps it under the drawer and its backdrop. Read when the drawer opens.\n * @default 'above'\n */\n readonly toasts = input<'above' | 'below'>('above');\n\n /**\n * Where focus goes when the drawer opens: `'dialog'` focuses the panel itself\n * with no ring so the first Tab reaches the first control, `'first-tabbable'`\n * focuses the first tabbable element, `false` moves nothing. An element\n * marked `cdkFocusInitial` wins in every mode. Read when the drawer opens.\n * @default 'dialog'\n */\n readonly autoFocus = input<WrDrawerAutoFocus>('dialog');\n\n protected readonly resolvedCloseLabel = useI18nText(this.closeLabel, 'drawer.close', 'Close drawer');\n\n protected readonly panelTpl = viewChild.required(TemplateRef);\n\n /**\n * A projected `[wrDrawerTitle]`, if the consumer gave one.\n *\n * The dismiss button is corner chrome positioned at a fixed\n * `inset-block-start` chosen to centre it on the TITLE's first line. With no\n * title the content starts at the top of the panel and runs underneath it: on\n * a bare `<wr-drawer><nav /></wr-drawer>` the button covered the first menu\n * row by 24×16 px, and `elementFromPoint` at the button's centre returned the\n * button, so that corner of the first item was unclickable. The panel has to\n * know, because only the panel can reserve the space.\n */\n private readonly projectedTitle = contentChild(WrDrawerTitle);\n\n protected panelClasses(): string {\n const parts = ['wr-drawer__panel', `wr-drawer__panel--${this.position()}`];\n if (this.rounded()) parts.push('wr-drawer__panel--rounded');\n if (this.safeArea()) parts.push('wr-drawer__panel--safe-area');\n if (this.closable()) parts.push('wr-drawer__panel--closable');\n // Only when there is something to collide with: a closable drawer with a\n // title already clears the button, and an unclosable one has no button.\n if (this.closable() && !this.projectedTitle()) parts.push('wr-drawer__panel--untitled');\n return wrToClassList(parts, this.panelClass()).join(' ');\n }\n\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly order = inject(WrOverlayOrder);\n private readonly scrollBlock = inject(WrScrollBlock);\n private readonly vcr = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly plainFocusTrapFactory = inject(FocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n /**\n * The reading direction the open drawer has to keep up with, resolved off the\n * ENVIRONMENT injector rather than this component's.\n *\n * That is where the CDK read it: `createOverlayRef` takes `Directionality`\n * from the `Overlay`'s own injector, which `WR_OVERLAY` parents to the\n * application's, so a node-level CDK `[dir]` is never in the chain. A\n * panel is not IN that island either — it is appended to the overlay\n * container on `<body>` — so following the node injector would not follow the\n * ref at all: it would rewrite a correctly-stamped panel to the island's\n * direction one pass after it opened, and `WrDrawerManager`, a root service\n * with no island to read, could never do the same. Two halves of one\n * component, same panel classes, same stylesheet, two answers.\n *\n * `null` never happens in an app — `Directionality` is root-provided — but a\n * bare `TestBed` should still get a drawer that opens, with nothing ambient\n * to follow.\n */\n private readonly dir = inject(EnvironmentInjector).get(Directionality, null);\n\n private overlayRef: OverlayRef | null = null;\n private focusTrap: FocusTrap | null = null;\n private previouslyFocused: HTMLElement | null = null;\n /** Whether the open panel is modal — `hasBackdrop` as it was when it opened. */\n private modal = true;\n /** The side the open overlay sits on. */\n private side: WrDrawerPosition = 'right';\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n effect(() => {\n if (this.open()) {\n this.openOverlay();\n } else {\n this.closeOverlay();\n }\n });\n afterEveryRender(() => this.syncLabel());\n this.destroyRef.onDestroy(() => this.closeOverlay());\n }\n\n /**\n * Point the panel's `aria-labelledby` at the CURRENT `[wrDrawerTitle]`.\n *\n * Re-resolved after every render rather than once when the drawer opens,\n * because the title element is projected content and can come and go while\n * the drawer stays open — an `@if` around it, or a heading that only exists\n * once the data arrives. A one-shot lookup leaves the attribute naming an\n * element that has been removed or replaced, and a dangling reference is not\n * a name: the dialog is announced as unnamed, with nothing on screen to say\n * so. A missing title clears the attribute for the same reason.\n */\n private syncLabel(): void {\n const host = this.overlayRef?.overlayElement;\n if (!host) return;\n\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n }\n\n private positionStrategy(pos: WrDrawerPosition): GlobalPositionStrategy {\n const strategy = this.overlay\n .position()\n .global()\n [pos === 'left' ? 'left' : pos === 'right' ? 'right' : 'centerHorizontally']();\n\n if (pos === 'top') strategy.top();\n else if (pos === 'bottom') strategy.bottom();\n else strategy.centerVertically();\n return strategy;\n }\n\n private size(pos: WrDrawerPosition): OverlaySizeConfig {\n const isHorizontal = pos === 'left' || pos === 'right';\n return {\n width: isHorizontal ? this.width() : '100vw',\n height: isHorizontal ? undefined : this.height(),\n maxHeight: isHorizontal ? undefined : (this.maxHeight() ?? undefined),\n };\n }\n\n /**\n * Carry `position`, `width`, `height` and `maxHeight` over to the open\n * overlay. The CDK reads them once, in `create()`.\n */\n private syncOverlay(ref: OverlayRef): void {\n const pos = this.position();\n if (pos !== this.side) {\n ref.removePanelClass(`wr-drawer-overlay--${this.side}`);\n ref.addPanelClass(`wr-drawer-overlay--${pos}`);\n this.side = pos;\n ref.updatePositionStrategy(this.positionStrategy(pos));\n }\n ref.updateSize(this.size(pos));\n }\n\n private openOverlay(): void {\n if (this.overlayRef) {\n this.syncOverlay(this.overlayRef);\n return;\n }\n\n const pos = this.position();\n this.side = pos;\n const modal = this.hasBackdrop();\n this.modal = modal;\n\n this.overlayRef = this.overlay.create({\n positionStrategy: this.positionStrategy(pos),\n hasBackdrop: modal,\n backdropClass: 'wr-drawer-backdrop',\n panelClass: ['wr-drawer-overlay', `wr-drawer-overlay--${pos}`],\n // A non-modal panel leaves the page scrolling under it: nothing covers\n // the page, so a blocked scroll would only freeze what the reader can\n // still see and click.\n scrollStrategy: modal ? this.scrollBlock.strategy() : this.overlay.scrollStrategies.noop(),\n // The CDK hands Escape to the topmost overlay wherever focus is. That is\n // right for a modal, where focus cannot be anywhere else, and wrong for a\n // panel beside a live page: an Escape meant for a field on the page\n // closed the drawer. Declined, the key walks on to the next overlay.\n // Focus on `<body>` still counts: a click on the panel's own text\n // focuses nothing, so that is where a reader inside it usually is.\n eventPredicate: modal ? undefined : () => drawerHasFocus(this.overlayRef) || focusIsLost(),\n ...this.size(pos),\n });\n\n // `position` is PHYSICAL — a `left` drawer is on the physical left in either\n // direction — and it takes BOTH halves of the follower to keep it that way.\n // The CDK places the panel with `justify-content` on a host it also writes\n // `dir` to, and that host is a flex row, so the attribute alone reverses the\n // main axis and slides a `left` drawer across to the right; `apply()`'s own\n // RTL branch swaps `flex-start` for `flex-end` to cancel exactly that. So\n // the `setDirection()` + `updatePosition()` pair leaves the panel where it\n // is and only re-resolves what the panel's own logical CSS reads — which is\n // the whole point, since the direction inside the drawer really did change.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n this.overlayRef.detachments().subscribe(this.order.add(this.overlayRef.hostElement, this.toasts()));\n\n if (this.isBrowser) {\n const active = document.activeElement;\n this.previouslyFocused = active instanceof HTMLElement ? active : null;\n const host = this.overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n if (modal) host.setAttribute('aria-modal', 'true');\n // Non-modal: a trap with no anchors and no inert strategy, which only\n // moves focus in — `cdkFocusInitial` honoured the same way — and then\n // lets Tab carry on out into the page.\n this.focusTrap = modal ? this.focusTrapFactory.create(host) : this.plainFocusTrapFactory.create(host, true);\n wrFocusOverlay(host, this.focusTrap, this.autoFocus(), this.injector);\n }\n\n if (this.closeOnBackdropClick()) {\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n }\n\n if (this.closeOnEscape()) {\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (event.key === 'Escape' && !wrIsComposing(event)) {\n event.preventDefault();\n this.open.set(false);\n }\n });\n }\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n // Read before disposal, which takes the focused element out of the page.\n const returnFocus = this.modal || drawerHasFocus(this.overlayRef) || focusIsLost();\n this.overlayRef.dispose();\n this.overlayRef = null;\n if (returnFocus && restore && typeof restore.focus === 'function') {\n wrRestoreFocus(restore, this.focusMonitor);\n }\n }\n}\n","<ng-template>\n <div [class]=\"panelClasses()\">\n @if (closable()) {\n <button type=\"button\" class=\"wr-drawer__close\" [attr.aria-label]=\"resolvedCloseLabel()\" (click)=\"open.set(false)\">\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </button>\n }\n <ng-content />\n </div>\n</ng-template>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type FocusTrap, FocusMonitor } from '@angular/cdk/a11y';\nimport type { OverlayRef } from '@angular/cdk/overlay';\nimport type { ComponentRef, Injector } from '@angular/core';\n\nimport { ReplaySubject } from 'rxjs';\n\nimport { wrRestoreFocus } from 'ngwr/utils';\n\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\n\n/**\n * Handle returned by `WrDrawerManager.open()`.\n *\n * Wraps the underlying `OverlayRef` and tracks the close result. It is also\n * provided inside the drawer's own injector, so the projected content can\n * inject it and close itself — the counterpart to `[wrDrawerClose]` when the\n * close is programmatic (after a save succeeds, say) rather than a click.\n *\n * @example\n * ```ts\n * // Caller side.\n * const ref = drawers.open<ChatComponent, boolean>(ChatComponent, { position: 'right' });\n * const result = await ref.awaitClose(); // boolean | undefined\n * ```\n *\n * @example\n * ```ts\n * // Content side — the drawer closes itself.\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject(WrDrawerRef);\n *\n * send(): void {\n * this.store.send(this.draft());\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport class WrDrawerRef<C, R = unknown> {\n /**\n * Emits the close result once and completes.\n *\n * A `ReplaySubject`, not a plain `Subject`, so the result survives a late\n * subscriber: content can close itself before `open()` has even returned, and\n * `awaitClose()` may be called long after the dismissal — both would otherwise\n * see only `complete` and resolve `undefined`.\n */\n readonly closed = new ReplaySubject<R | undefined>(1);\n\n /** @internal */\n componentRef: ComponentRef<C> | null = null;\n\n /** @internal */\n focusTrap: FocusTrap | null = null;\n\n /** @internal */\n previouslyFocused: HTMLElement | null = null;\n\n /** @internal — `false` for a drawer opened with `hasBackdrop: false`. */\n modal = true;\n\n /**\n * @param _overlayRef the overlay the drawer is mounted in.\n * @param injector where the focus hand-back finds the CDK `FocusMonitor`; without\n * one it is a plain `focus()`.\n */\n private readonly focusMonitor: FocusMonitor | null;\n\n constructor(\n private readonly _overlayRef: OverlayRef,\n injector?: Injector\n ) {\n // Resolved now: the injector may be gone by the time the drawer closes.\n this.focusMonitor = injector?.get(FocusMonitor, null) ?? null;\n }\n\n /** The instantiated drawer component. */\n get componentInstance(): C {\n if (!this.componentRef) {\n throw new Error('WrDrawerRef: component not yet attached');\n }\n return this.componentRef.instance;\n }\n\n private isClosed = false;\n\n /** Close the drawer, optionally returning a result. */\n close(result?: R): void {\n if (this.isClosed) return;\n this.isClosed = true;\n this.closed.next(result);\n this.closed.complete();\n // Content that closes itself while constructing gets here with\n // `OverlayRef.attach()` still on the stack — `componentRef` is assigned\n // only once attach returns. Disposing mid-attach leaves the CDK writing to\n // a detached host, so let the current task finish first.\n if (!this.componentRef) {\n queueMicrotask(() => this.teardown());\n return;\n }\n this.teardown();\n }\n\n private teardown(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n // A non-modal drawer sends focus back only from inside itself, or when it\n // has been lost: a reader already working on the page stays there. Read\n // before disposal, which takes the focused element out of the page.\n const returnFocus = this.modal || drawerHasFocus(this._overlayRef) || focusIsLost();\n this._overlayRef.dispose();\n // Drop the destroyed component so a retained ref doesn't pin its instance,\n // host element and view in memory.\n this.componentRef = null;\n // Restore focus after disposal so the trigger is reachable again.\n if (returnFocus && restore && typeof restore.focus === 'function') {\n wrRestoreFocus(restore, this.focusMonitor);\n }\n }\n\n /** Resolves with the close result when the drawer is dismissed. */\n awaitClose(): Promise<R | undefined> {\n return new Promise(resolve => {\n this.closed.subscribe({\n next: value => resolve(value),\n complete: () => resolve(undefined),\n });\n });\n }\n\n /** Underlying overlay ref — escape hatch for advanced cases. */\n get overlayRef(): OverlayRef {\n return this._overlayRef;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\n/**\n * Token that exposes the `data` payload passed to `WrDrawerManager.open()`.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * readonly data = inject<ChatData>(WR_DRAWER_DATA);\n * }\n * ```\n */\nexport const WR_DRAWER_DATA = new InjectionToken<unknown>('WR_DRAWER_DATA');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrDrawerRef } from '../drawer-ref';\n\n/**\n * Token exposing the open drawer's `WrDrawerRef` to components and\n * directives rendered inside it (e.g. `[wrDrawerClose]`).\n *\n * **Prefer `inject(WrDrawerRef)`** — the ref is provided under the class token\n * too, and the class path is the documented one. It already covers both cases\n * you might reach for a token for: `inject(WrDrawerRef, { optional: true })`\n * works for content that also renders outside a drawer, and\n * `inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef)` types the generics\n * without a cast.\n *\n * This token is the same object under a second key. It exists for the library's\n * own directives (`[wrDrawerClose]`) and for swapping the provider out — a test\n * stub, say — without touching the class.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class ChatComponent {\n * private readonly ref = inject<WrDrawerRef<ChatComponent, boolean>>(WrDrawerRef);\n *\n * dismiss(): void {\n * this.ref.close(true);\n * }\n * }\n * ```\n */\nexport const WR_DRAWER_REF = new InjectionToken<WrDrawerRef<unknown, unknown>>('WR_DRAWER_REF');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ConfigurableFocusTrapFactory, FocusTrapFactory } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { type OverlayRef, ScrollStrategyOptions } from '@angular/cdk/overlay';\nimport { ComponentPortal, type ComponentType } from '@angular/cdk/portal';\nimport { Location, isPlatformBrowser } from '@angular/common';\nimport { EnvironmentInjector, Injector, PLATFORM_ID, Service, afterEveryRender, inject } from '@angular/core';\n\nimport { WrI18n } from 'ngwr/i18n';\nimport {\n WR_OVERLAY,\n WrOverlayOrder,\n WrScrollBlock,\n wrAppendOverlayClose,\n wrFocusOverlay,\n wrFollowDirection,\n} from 'ngwr/overlay';\nimport { wrIsComposing, wrToClassList } from 'ngwr/utils';\n\nimport { drawerHasFocus, focusIsLost } from './drawer-focus';\nimport { WrDrawerRef } from './drawer-ref';\nimport { WR_DRAWER_DATA, WR_DRAWER_REF } from './tokens';\nimport type { WrDrawerOptions, WrDrawerPosition } from './types';\n\nconst DEFAULT_POSITION: WrDrawerPosition = 'right';\nconst DEFAULT_WIDTH = '20rem';\nconst DEFAULT_HEIGHT = '16rem';\nconst BACKDROP_CLASS = 'wr-drawer-backdrop';\n\n/**\n * Opens drawer components in an isolated NGWR overlay — the programmatic\n * counterpart to `<wr-drawer [(open)]=\"…\">`.\n *\n * Use the component when the drawer is part of a template and its open state\n * is a signal you already own; use this service when the caller doesn't own\n * the markup (opening a chat panel from a toolbar action, from an effect, from\n * a route guard) or when you need the close result.\n *\n * Uses `WR_OVERLAY`, so drawers render into NGWR's own overlay container\n * and never collide with other CDK consumers (Material, NG-ZORRO, etc.).\n *\n * @example\n * ```ts\n * const drawers = inject(WrDrawerManager);\n *\n * const ref = drawers.open(ChatComponent, {\n * data: { threadId },\n * position: 'right',\n * width: '28rem',\n * });\n *\n * await ref.awaitClose();\n * ```\n *\n * @see https://ngwr.dev/reference/components/drawer\n */\n@Service()\nexport class WrDrawerManager {\n private readonly overlay = inject(WR_OVERLAY);\n private readonly scrollStrategies = inject(ScrollStrategyOptions);\n private readonly scrollBlock = inject(WrScrollBlock);\n private readonly parentInjector = inject(EnvironmentInjector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n private readonly plainFocusTrapFactory = inject(FocusTrapFactory);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly i18n = inject(WrI18n);\n private readonly location = inject(Location);\n private readonly order = inject(WrOverlayOrder);\n /**\n * The application's reading direction — the instance the CDK itself read when\n * it stamped the overlay. A root service has no node injector above it, so a\n * plain `inject()` here already resolves the environment one; `<wr-drawer>`,\n * which does, spells that out and says why. The two halves of one component\n * must not answer differently about the same panel.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n open<C, R = unknown, D = unknown>(component: ComponentType<C>, options: WrDrawerOptions<D> = {}): WrDrawerRef<C, R> {\n const position = options.position ?? DEFAULT_POSITION;\n const isHorizontal = position === 'left' || position === 'right';\n\n // The content component is attached straight into the overlay pane, so the\n // panel styles land on the pane rather than on an inner wrapper.\n const panelClasses = wrToClassList(\n 'wr-drawer-overlay',\n `wr-drawer-overlay--${position}`,\n 'wr-drawer__panel',\n `wr-drawer__panel--${position}`,\n options.rounded && 'wr-drawer__panel--rounded',\n options.safeArea && 'wr-drawer__panel--safe-area',\n options.panelClass\n );\n\n const positionStrategy = this.overlay\n .position()\n .global()\n [position === 'left' ? 'left' : position === 'right' ? 'right' : 'centerHorizontally']();\n\n if (position === 'top') positionStrategy.top();\n else if (position === 'bottom') positionStrategy.bottom();\n else positionStrategy.centerVertically();\n\n const cap = options.maxHeight ?? null;\n // No backdrop means NON-MODAL, the same rule as `<wr-drawer>`: no trap, no\n // `aria-modal`, no scroll block, and Escape only from inside the panel —\n // or from `<body>`, where a click on the panel's own text leaves focus.\n const modal = options.hasBackdrop !== false;\n // Assigned on the next statement; the predicate only runs from a keydown.\n let ref: OverlayRef | null = null;\n\n const overlayRef: OverlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: modal ? this.scrollBlock.strategy() : this.scrollStrategies.noop(),\n eventPredicate: modal ? undefined : () => drawerHasFocus(ref) || focusIsLost(),\n hasBackdrop: modal,\n backdropClass: BACKDROP_CLASS,\n panelClass: panelClasses,\n width: isHorizontal ? (options.width ?? DEFAULT_WIDTH) : '100vw',\n height: isHorizontal ? undefined : (options.height ?? DEFAULT_HEIGHT),\n maxHeight: isHorizontal ? undefined : (cap ?? undefined),\n });\n ref = overlayRef;\n\n // Same pair, same reason as `<wr-drawer>`: `position` is physical, the CDK\n // writes `dir` on the flex host that `justify-content` places the panel in,\n // so the attribute alone would slide a `left` drawer to the right and\n // re-applying the strategy is what cancels it. The follower ends on the\n // ref's own `detachments()`, which every dismissal goes through, and each\n // `open()` creates a fresh ref of its own.\n wrFollowDirection(overlayRef, this.dir, this.parentInjector);\n\n const drawerRef = new WrDrawerRef<C, R>(overlayRef, this.parentInjector);\n drawerRef.modal = modal;\n\n if (this.isBrowser) {\n const active = document.activeElement;\n drawerRef.previouslyFocused = active instanceof HTMLElement ? active : null;\n }\n\n const injector = Injector.create({\n parent: this.parentInjector,\n providers: [\n { provide: WR_DRAWER_DATA, useValue: options.data },\n { provide: WR_DRAWER_REF, useValue: drawerRef },\n // Provided as its own token as well, so drawer content can reach for\n // the familiar `inject(WrDrawerRef)` and close itself.\n { provide: WrDrawerRef, useValue: drawerRef },\n ],\n });\n\n const portal = new ComponentPortal(component, null, injector);\n drawerRef.componentRef = overlayRef.attach(portal);\n overlayRef.detachments().subscribe(this.order.add(overlayRef.hostElement, options.toasts));\n\n // Wired BEFORE the panel is decorated, and the order is the fix: everything\n // below attaches attributes, a ✕ and a focus trap to an overlay that is\n // already on screen, so anything that throws in there used to leave an\n // `aria-modal` panel with no dismissal path at all — no ✕, no backdrop\n // handler, no Escape — over the whole application, and no ref for the caller\n // to close it with. A drawer that fails to finish opening must still be one\n // the user can get rid of. Overlay subscriptions complete when the overlay is\n // disposed, so no explicit teardown is required.\n if (options.closeOnBackdropClick !== false) {\n overlayRef.backdropClick().subscribe(() => drawerRef.close());\n }\n if (options.closeOnEscape !== false) {\n overlayRef.keydownEvents().subscribe(event => {\n if (event.key === 'Escape' && !wrIsComposing(event)) {\n event.preventDefault();\n drawerRef.close();\n }\n });\n }\n if (options.closeOnNavigation !== false) {\n this.watchNavigation(overlayRef, drawerRef);\n }\n\n if (this.isBrowser) {\n const host = overlayRef.overlayElement;\n host.setAttribute('role', 'dialog');\n if (modal) host.setAttribute('aria-modal', 'true');\n // Built-in dismiss, same contract as WrDialog's `closable`.\n if (options.closable !== false) {\n host.classList.add('wr-drawer__panel--closable');\n const label = options.closeLabel ?? this.closeLabel();\n wrAppendOverlayClose(host, 'wr-drawer__close', label, () => drawerRef.close());\n }\n // Wire aria-labelledby to wrDrawerTitle's auto-id once content is in DOM.\n // Has to wait for a render, not a microtask: attaching the portal only\n // schedules change detection, so under zoneless CD a microtask runs while\n // the content is still an empty view and the title id doesn't exist yet.\n //\n // And after EVERY render, not just the next one: the title belongs to the\n // caller's component, so an `@if` or a late-arriving heading can replace\n // or remove the element the attribute names. A reference to a node that is\n // no longer there is not a name — the dialog announces as unnamed — so a\n // missing title clears the attribute rather than leaving it dangling.\n const labelSync = afterEveryRender(\n () => {\n const titleEl = host.querySelector<HTMLElement>('[wrDrawerTitle], [wr-drawer-title]');\n if (titleEl?.id) host.setAttribute('aria-labelledby', titleEl.id);\n else host.removeAttribute('aria-labelledby');\n },\n { injector: this.parentInjector }\n );\n // The hook is bound to the root injector, so it outlives the drawer unless\n // it is torn down with it. `detachments()` fires on dispose, which is the\n // one path every dismissal goes through.\n overlayRef.detachments().subscribe(() => labelSync.destroy());\n // Trap focus inside the drawer and move initial focus in. A non-modal\n // drawer only gets the second half: a trap with no anchors and no inert\n // strategy moves focus in and leaves Tab free to walk out to the page.\n const trap = modal ? this.focusTrapFactory.create(host) : this.plainFocusTrapFactory.create(host, true);\n drawerRef.focusTrap = trap;\n wrFocusOverlay(host, trap, options.autoFocus ?? 'dialog', this.parentInjector);\n }\n\n return drawerRef;\n }\n\n /**\n * Tie the drawer's lifetime to the URL it was opened on — the same treatment\n * `WrDialog` gets, and for the same reason.\n *\n * Nothing else does. The overlay belongs to a root service and is dismissed\n * only by the backdrop, Escape, the appended × or an explicit `close()`, so\n * navigating away left the panel, its backdrop, its focus trap and the\n * page-wide scroll block sitting over a page the user never opened them on.\n *\n * `onUrlChange`, not `Location.subscribe()` — which is what CDK's own\n * `disposeOnNavigation` uses: `subscribe` fires on popstate alone, so an in-app\n * `router.navigate()` left the drawer standing. And `drawerRef.close()` rather\n * than disposing the overlay behind the ref's back, which would never emit\n * `closed`, never destroy the focus trap, and leave `awaitClose()` pending.\n */\n private watchNavigation<C, R>(overlayRef: OverlayRef, drawerRef: WrDrawerRef<C, R>): void {\n const stopWatching = this.location.onUrlChange(() => drawerRef.close());\n // Unhooked a microtask late, because `Location` notifies its listeners with\n // a `forEach` and unregistering splices the array it is iterating: removing\n // ours synchronously from inside the notification would shift the next entry\n // into the slot forEach has already passed, and a SECOND stacked drawer\n // would be skipped and left behind.\n overlayRef.detachments().subscribe(() => queueMicrotask(stopWatching));\n }\n\n /**\n * The dismiss button's accessible name.\n *\n * Resolved per open, not stored as a plain string at injection: this is a root\n * service, so a one-shot read — which is what `WrDialog` used to have, and moved\n * off for this reason — would run before an async catalog had loaded and then\n * freeze that answer for the life of the app. (`wrReadI18nText` hands back a signal\n * now, so it would no longer freeze; the name still has to be pushed onto the\n * button per open either way.) `WrDialog.closeLabel()` is the matching precedent,\n * not the counter-example.\n *\n * The miss check is the point. `t()` hands back the KEY when the catalog has\n * no entry, and `WrI18n` is root-provided with an empty catalog by default —\n * so an app that never configured i18n got a button announced as\n * \"drawer.close, button\". A name WAS present, which is exactly why the axe\n * gate could not see it.\n */\n private closeLabel(): string {\n const resolved = this.i18n.t('drawer.close');\n return resolved === 'drawer.close' ? 'Close drawer' : resolved;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Marks the scrollable body of the drawer. Applies the `wr-drawer__content`\n * class so the panel's flex layout can stretch it between the title and the\n * footer.\n */\n@Directive({\n selector: '[wrDrawerContent]',\n host: { class: 'wr-drawer__content' },\n})\nexport class WrDrawerContent {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, computed, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Marks the action row pinned to the bottom of the drawer. Adds the\n * `wr-drawer__footer` class plus an alignment modifier so action buttons\n * can sit at the start, center, or end of the row.\n *\n * @example\n * ```html\n * <div wrDrawerFooter align=\"end\">\n * <wr-btn wrDrawerClose>Cancel</wr-btn>\n * <wr-btn color=\"primary\" (click)=\"save()\">Save</wr-btn>\n * </div>\n * ```\n */\n@Directive({\n selector: '[wrDrawerFooter]',\n host: { class: 'wr-drawer__footer', '[class]': 'classes()' },\n})\nexport class WrDrawerFooter {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\n /** Horizontal alignment of footer content. @default 'end' */\n readonly align = input<'start' | 'center' | 'end'>('end');\n\n protected readonly classes = computed(() => `wr-drawer__footer wr-drawer__footer--${this.align()}`);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, inject, input } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrDrawer } from '../drawer';\nimport type { WrDrawerRef } from '../drawer-ref';\nimport { WR_DRAWER_REF } from '../tokens';\n\n/**\n * Closes the parent drawer on click. Attach to any clickable element.\n *\n * Works for both drawer flavours: inside `<wr-drawer>` it clears the\n * component's `open` model, and inside a `WrDrawerManager.open()` drawer it\n * closes the ref — optionally passing a `[wrDrawerClose]` value as the close\n * result (the component flavour has no result to carry, so the value is\n * ignored there).\n *\n * @example\n * ```html\n * <wr-btn wrDrawerClose>Close</wr-btn>\n * <wr-btn color=\"primary\" [wrDrawerClose]=\"true\">Save</wr-btn>\n * ```\n */\n@Directive({\n selector: '[wrDrawerClose]',\n host: { '(click)': 'close()' },\n})\nexport class WrDrawerClose<R = unknown> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('drawer');\n }\n\n /**\n * Value to pass to `close()` for service-opened drawers. When unset — or\n * used as a bare attribute — the drawer closes with `undefined`.\n */\n readonly result = input<R | undefined, R | undefined | ''>(undefined, {\n alias: 'wrDrawerClose',\n // A bare `wrDrawerClose` attribute arrives as the empty string; that means\n // \"no result\", not a result of `''`.\n transform: value => (value === '' ? undefined : value),\n });\n\n private readonly drawer = inject(WrDrawer, { optional: true });\n private readonly ref = inject<WrDrawerRef<unknown, R>>(WR_DRAWER_REF, { optional: true });\n\n protected close(): void {\n // Element injectors win, so a surrounding `<wr-drawer>` is the nearer\n // owner even when a service-opened drawer sits further up the tree.\n if (this.drawer) {\n this.drawer.open.set(false);\n return;\n }\n this.ref?.close(this.result());\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA,IAAI,MAAM;AAqBV,IAAa,gBAAb,MAAa,cAAa;CACxB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,QAAQ;CAC3E;CAEiB,OAAO,OAAgC,UAAU;CACjD,aAAa,mBAAmB,EAAE;CAOnD,IAAI,KAAE;EACJ,OAAO,KAAK,KAAK,cAAc,MAAM,KAAK;CAC5C;CAfW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAa,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,MAAA;GAAA,YAAA,EAAA,WAAA,KAAA;GAAA,gBAAA;EAAA;EAAA,UAAA,CAAA,eAAA;EAAA,UAAA;CAAA,CAAA;;AAAb,GAAA,yBAAA;CAAA,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;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AQ;CAC3E;CAMS,SAAS,MAAyC,QAAS;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAClE,OAAO;EAGP,YAAW,UAAU,UAAU,KAAK,SAAY;CAAM,CAAA;CAGvC,SAAS,OAAO,UAAU,EAAE,UAAU,KAAI,CAAE;CAC5C,MAAM,OAAgC,eAAe,EAAE,UAAU,KAAI,CAAE;CAE9E,QAAK;EAGb,IAAI,KAAK,QAAQ;GACf,KAAK,OAAO,KAAK,IAAI,KAAK;GAC1B;EACF;EACA,KAAK,KAAK,MAAM,KAAK,OAAM,CAAE;CAC/B;CA3BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAa,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAb,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAa,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,QAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,WAAA,EAAA,SAAA,UAAA,EAAA;EAAA,UAAA;CAAA,CAAA;;AAAb,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAa,YAAA,CAAA;EAJzB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EAAE,WAAW,UAAS;EAC7B,CAAA"}
@@ -553,7 +553,7 @@ var WrFileUpload = class WrFileUpload {
553
553
  isSignal: true
554
554
  }],
555
555
  ngImport: i0,
556
- template: "<div\n #zone\n class=\"wr-file-upload__zone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"zoneName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"openPicker()\"\n (keydown)=\"onZoneKey($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n (paste)=\"onPaste($event)\"\n>\n <svg class=\"wr-file-upload__icon\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <div class=\"wr-file-upload__hint\" [id]=\"hintId\">\n <strong>{{ resolvedPick() }}</strong>\n <span>{{ resolvedDrop() }}</span>\n @if (helperText()) {\n <small>{{ helperText() }}</small>\n }\n </div>\n</div>\n\n<!--\n The real <input type=\"file\"> is never operated directly — the zone above is\n the control and forwards clicks here, so the input is visually hidden and kept\n OUTSIDE the zone: inside, it nested one interactive element within another\n (the zone is role=\"button\") and put two tab stops where users see one. It is\n positioned absolutely and clipped, so being a sibling changes nothing visually.\n aria-hidden must be paired with tabindex=\"-1\", or hiding a focusable element is\n itself a violation.\n-->\n<input\n #picker\n class=\"wr-file-upload__picker\"\n type=\"file\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n [attr.accept]=\"accept() || null\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [disabled]=\"disabled() || readonly()\"\n (change)=\"onPickerChange($event)\"\n/>\n\n@if (showList() && (files().length > 0 || storedRows().length > 0)) {\n <ul class=\"wr-file-upload__list\" [attr.aria-busy]=\"busy() || null\">\n @for (row of storedRows(); track row.stored) {\n <li class=\"wr-file-upload__item wr-file-upload__item--stored\">\n <span class=\"wr-file-upload__name\" [title]=\"row.stored.name\">\n @if (row.url; as url) {\n <a\n class=\"wr-file-upload__link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"url\"\n [attr.aria-label]=\"openText({ name: row.stored.name })\"\n >{{ row.stored.name }}</a\n >\n } @else {\n {{ row.stored.name }}\n }\n </span>\n @if (row.size !== null) {\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.size) }}</span>\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.stored.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeStored(row, $index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n </li>\n }\n @for (row of rows(); track $index) {\n <li [class]=\"row.classes\">\n @if (row.preview; as url) {\n <img class=\"wr-file-upload__preview\" alt=\"\" [src]=\"url\" />\n }\n <span\n class=\"wr-file-upload__name\"\n [attr.id]=\"row.state === 'error' ? `${nameId}-${$index}` : null\"\n [title]=\"row.file.name\"\n >{{ row.file.name }}</span\n >\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.file.size) }}</span>\n @switch (row.state) {\n @case ('done') {\n <span class=\"wr-file-upload__done\" role=\"img\" [attr.aria-label]=\"resolvedUploaded()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M20 6 9 17l-5-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n }\n @case ('error') {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-file-upload__retry\"\n [attr.aria-describedby]=\"`${nameId}-${$index}`\"\n [disabled]=\"disabled()\"\n (click)=\"onRetry(row.file, $index)\"\n >\n {{ resolvedRetry() }}\n </button>\n }\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.file.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeAt($index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n @if (row.state === 'uploading') {\n <wr-progress\n class=\"wr-file-upload__progress\"\n size=\"sm\"\n [indeterminate]=\"row.percent === null\"\n [value]=\"row.percent ?? 0\"\n [ariaLabel]=\"statusText({ name: row.file.name, status: resolvedUploading() })\"\n />\n } @else if (row.state === 'error') {\n <span class=\"wr-file-upload__error\">{{ row.message ?? resolvedFailed() }}</span>\n }\n </li>\n }\n </ul>\n}\n\n<!-- One live region for the whole list, in the DOM before any state changes: a\n region inserted together with its text is often not read. -->\n@if (status() !== null) {\n <span class=\"wr-file-upload__announce\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n}\n",
556
+ template: "<div\n #zone\n class=\"wr-file-upload__zone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"zoneName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"openPicker()\"\n (keydown)=\"onZoneKey($event)\"\n (blur)=\"touch.emit()\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n (paste)=\"onPaste($event)\"\n>\n <svg class=\"wr-file-upload__icon\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <div class=\"wr-file-upload__hint\" [id]=\"hintId\">\n <strong>{{ resolvedPick() }}</strong>\n <span>{{ resolvedDrop() }}</span>\n @if (helperText()) {\n <small>{{ helperText() }}</small>\n }\n </div>\n</div>\n\n<!--\n The real <input type=\"file\"> is never operated directly — the zone above is\n the control and forwards clicks here, so the input is visually hidden and kept\n OUTSIDE the zone: inside, it nested one interactive element within another\n (the zone is role=\"button\") and put two tab stops where users see one. It is\n positioned absolutely and clipped, so being a sibling changes nothing visually.\n aria-hidden must be paired with tabindex=\"-1\", or hiding a focusable element is\n itself a violation.\n-->\n<input\n #picker\n class=\"wr-file-upload__picker\"\n type=\"file\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n [attr.accept]=\"accept() || null\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [disabled]=\"disabled() || readonly()\"\n (change)=\"onPickerChange($event)\"\n/>\n\n@if (showList() && (files().length > 0 || storedRows().length > 0)) {\n <ul class=\"wr-file-upload__list\" [attr.aria-busy]=\"busy() || null\">\n @for (row of storedRows(); track row.stored) {\n <li class=\"wr-file-upload__item wr-file-upload__item--stored\">\n <span class=\"wr-file-upload__name\" [title]=\"row.stored.name\">\n @if (row.url; as url) {\n <a\n class=\"wr-file-upload__link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"url\"\n [attr.aria-label]=\"openText({ name: row.stored.name })\"\n >{{ row.stored.name }}</a\n >\n } @else {\n {{ row.stored.name }}\n }\n </span>\n @if (row.size !== null) {\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.size) }}</span>\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.stored.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeStored(row, $index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n </li>\n }\n @for (row of rows(); track $index) {\n <li [class]=\"row.classes\">\n @if (row.preview; as url) {\n <img class=\"wr-file-upload__preview\" alt=\"\" [src]=\"url\" />\n }\n <span\n class=\"wr-file-upload__name\"\n [attr.id]=\"row.state === 'error' ? `${nameId}-${$index}` : null\"\n [title]=\"row.file.name\"\n >{{ row.file.name }}</span\n >\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.file.size) }}</span>\n @switch (row.state) {\n @case ('done') {\n <span class=\"wr-file-upload__done\" role=\"img\" [attr.aria-label]=\"resolvedUploaded()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M20 6 9 17l-5-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n }\n @case ('error') {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-file-upload__retry\"\n [attr.aria-describedby]=\"`${nameId}-${$index}`\"\n [disabled]=\"disabled()\"\n (click)=\"onRetry(row.file, $index)\"\n >\n {{ resolvedRetry() }}\n </button>\n }\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.file.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeAt($index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n @if (row.state === 'uploading') {\n <wr-progress\n class=\"wr-file-upload__progress\"\n size=\"sm\"\n [indeterminate]=\"row.percent === null\"\n [value]=\"row.percent ?? 0\"\n [ariaLabel]=\"statusText({ name: row.file.name, status: resolvedUploading() })\"\n />\n } @else if (row.state === 'error') {\n <span class=\"wr-file-upload__error\">{{ row.message ?? resolvedFailed() }}</span>\n }\n </li>\n }\n </ul>\n}\n\n<!-- One live region for the whole list, in the DOM before any state changes: a\n region inserted together with its text is often not read. -->\n@if (status() !== null) {\n <span class=\"wr-file-upload__announce\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n}\n",
557
557
  dependencies: [{
558
558
  kind: "component",
559
559
  type: WrButton,
@@ -602,7 +602,7 @@ i0.ɵɵngDeclareClassMetadata({
602
602
  "[class]": "classes()"
603
603
  },
604
604
  imports: [WrButton, WrProgress],
605
- template: "<div\n #zone\n class=\"wr-file-upload__zone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"zoneName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"openPicker()\"\n (keydown)=\"onZoneKey($event)\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n (paste)=\"onPaste($event)\"\n>\n <svg class=\"wr-file-upload__icon\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <div class=\"wr-file-upload__hint\" [id]=\"hintId\">\n <strong>{{ resolvedPick() }}</strong>\n <span>{{ resolvedDrop() }}</span>\n @if (helperText()) {\n <small>{{ helperText() }}</small>\n }\n </div>\n</div>\n\n<!--\n The real <input type=\"file\"> is never operated directly — the zone above is\n the control and forwards clicks here, so the input is visually hidden and kept\n OUTSIDE the zone: inside, it nested one interactive element within another\n (the zone is role=\"button\") and put two tab stops where users see one. It is\n positioned absolutely and clipped, so being a sibling changes nothing visually.\n aria-hidden must be paired with tabindex=\"-1\", or hiding a focusable element is\n itself a violation.\n-->\n<input\n #picker\n class=\"wr-file-upload__picker\"\n type=\"file\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n [attr.accept]=\"accept() || null\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [disabled]=\"disabled() || readonly()\"\n (change)=\"onPickerChange($event)\"\n/>\n\n@if (showList() && (files().length > 0 || storedRows().length > 0)) {\n <ul class=\"wr-file-upload__list\" [attr.aria-busy]=\"busy() || null\">\n @for (row of storedRows(); track row.stored) {\n <li class=\"wr-file-upload__item wr-file-upload__item--stored\">\n <span class=\"wr-file-upload__name\" [title]=\"row.stored.name\">\n @if (row.url; as url) {\n <a\n class=\"wr-file-upload__link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"url\"\n [attr.aria-label]=\"openText({ name: row.stored.name })\"\n >{{ row.stored.name }}</a\n >\n } @else {\n {{ row.stored.name }}\n }\n </span>\n @if (row.size !== null) {\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.size) }}</span>\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.stored.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeStored(row, $index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n </li>\n }\n @for (row of rows(); track $index) {\n <li [class]=\"row.classes\">\n @if (row.preview; as url) {\n <img class=\"wr-file-upload__preview\" alt=\"\" [src]=\"url\" />\n }\n <span\n class=\"wr-file-upload__name\"\n [attr.id]=\"row.state === 'error' ? `${nameId}-${$index}` : null\"\n [title]=\"row.file.name\"\n >{{ row.file.name }}</span\n >\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.file.size) }}</span>\n @switch (row.state) {\n @case ('done') {\n <span class=\"wr-file-upload__done\" role=\"img\" [attr.aria-label]=\"resolvedUploaded()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M20 6 9 17l-5-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n }\n @case ('error') {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-file-upload__retry\"\n [attr.aria-describedby]=\"`${nameId}-${$index}`\"\n [disabled]=\"disabled()\"\n (click)=\"onRetry(row.file, $index)\"\n >\n {{ resolvedRetry() }}\n </button>\n }\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.file.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeAt($index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n @if (row.state === 'uploading') {\n <wr-progress\n class=\"wr-file-upload__progress\"\n size=\"sm\"\n [indeterminate]=\"row.percent === null\"\n [value]=\"row.percent ?? 0\"\n [ariaLabel]=\"statusText({ name: row.file.name, status: resolvedUploading() })\"\n />\n } @else if (row.state === 'error') {\n <span class=\"wr-file-upload__error\">{{ row.message ?? resolvedFailed() }}</span>\n }\n </li>\n }\n </ul>\n}\n\n<!-- One live region for the whole list, in the DOM before any state changes: a\n region inserted together with its text is often not read. -->\n@if (status() !== null) {\n <span class=\"wr-file-upload__announce\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n}\n"
605
+ template: "<div\n #zone\n class=\"wr-file-upload__zone\"\n role=\"button\"\n tabindex=\"0\"\n [attr.aria-label]=\"zoneName()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.aria-invalid]=\"fieldAria.ariaInvalid()\"\n [attr.aria-describedby]=\"fieldAria.describedBy()\"\n (click)=\"openPicker()\"\n (keydown)=\"onZoneKey($event)\"\n (blur)=\"touch.emit()\"\n (dragenter)=\"onDragEnter($event)\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave()\"\n (drop)=\"onDrop($event)\"\n (paste)=\"onPaste($event)\"\n>\n <svg class=\"wr-file-upload__icon\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M12 16V4M12 4l-4 4M12 4l4 4M4 16v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <div class=\"wr-file-upload__hint\" [id]=\"hintId\">\n <strong>{{ resolvedPick() }}</strong>\n <span>{{ resolvedDrop() }}</span>\n @if (helperText()) {\n <small>{{ helperText() }}</small>\n }\n </div>\n</div>\n\n<!--\n The real <input type=\"file\"> is never operated directly — the zone above is\n the control and forwards clicks here, so the input is visually hidden and kept\n OUTSIDE the zone: inside, it nested one interactive element within another\n (the zone is role=\"button\") and put two tab stops where users see one. It is\n positioned absolutely and clipped, so being a sibling changes nothing visually.\n aria-hidden must be paired with tabindex=\"-1\", or hiding a focusable element is\n itself a violation.\n-->\n<input\n #picker\n class=\"wr-file-upload__picker\"\n type=\"file\"\n aria-hidden=\"true\"\n tabindex=\"-1\"\n [attr.accept]=\"accept() || null\"\n [attr.multiple]=\"multiple() ? '' : null\"\n [disabled]=\"disabled() || readonly()\"\n (change)=\"onPickerChange($event)\"\n/>\n\n@if (showList() && (files().length > 0 || storedRows().length > 0)) {\n <ul class=\"wr-file-upload__list\" [attr.aria-busy]=\"busy() || null\">\n @for (row of storedRows(); track row.stored) {\n <li class=\"wr-file-upload__item wr-file-upload__item--stored\">\n <span class=\"wr-file-upload__name\" [title]=\"row.stored.name\">\n @if (row.url; as url) {\n <a\n class=\"wr-file-upload__link\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n [href]=\"url\"\n [attr.aria-label]=\"openText({ name: row.stored.name })\"\n >{{ row.stored.name }}</a\n >\n } @else {\n {{ row.stored.name }}\n }\n </span>\n @if (row.size !== null) {\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.size) }}</span>\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.stored.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeStored(row, $index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n </li>\n }\n @for (row of rows(); track $index) {\n <li [class]=\"row.classes\">\n @if (row.preview; as url) {\n <img class=\"wr-file-upload__preview\" alt=\"\" [src]=\"url\" />\n }\n <span\n class=\"wr-file-upload__name\"\n [attr.id]=\"row.state === 'error' ? `${nameId}-${$index}` : null\"\n [title]=\"row.file.name\"\n >{{ row.file.name }}</span\n >\n <span class=\"wr-file-upload__size\">{{ formatBytes(row.file.size) }}</span>\n @switch (row.state) {\n @case ('done') {\n <span class=\"wr-file-upload__done\" role=\"img\" [attr.aria-label]=\"resolvedUploaded()\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n d=\"M20 6 9 17l-5-5\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n }\n @case ('error') {\n <button\n wr-btn\n type=\"button\"\n size=\"sm\"\n outlined\n class=\"wr-file-upload__retry\"\n [attr.aria-describedby]=\"`${nameId}-${$index}`\"\n [disabled]=\"disabled()\"\n (click)=\"onRetry(row.file, $index)\"\n >\n {{ resolvedRetry() }}\n </button>\n }\n }\n <button\n type=\"button\"\n class=\"wr-file-upload__remove\"\n [attr.aria-label]=\"removeName(row.file.name)\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"removeAt($index)\"\n >\n <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n <path\n d=\"M2 2 L10 10 M10 2 L2 10\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n @if (row.state === 'uploading') {\n <wr-progress\n class=\"wr-file-upload__progress\"\n size=\"sm\"\n [indeterminate]=\"row.percent === null\"\n [value]=\"row.percent ?? 0\"\n [ariaLabel]=\"statusText({ name: row.file.name, status: resolvedUploading() })\"\n />\n } @else if (row.state === 'error') {\n <span class=\"wr-file-upload__error\">{{ row.message ?? resolvedFailed() }}</span>\n }\n </li>\n }\n </ul>\n}\n\n<!-- One live region for the whole list, in the DOM before any state changes: a\n region inserted together with its text is often not read. -->\n@if (status() !== null) {\n <span class=\"wr-file-upload__announce\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n}\n"
606
606
  }]
607
607
  }],
608
608
  ctorParameters: () => [],