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-input.mjs","names":[],"sources":["../../../projects/lib/input/directives/wr-input.ts","../../../projects/lib/input/directives/wr-input-prefix.ts","../../../projects/lib/input/directives/wr-input-suffix.ts","../../../projects/lib/input/input-group.ts","../../../projects/lib/input/input-group.html","../../../projects/lib/input/password-toggle.ts","../../../projects/lib/input/password-toggle.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, computed, inject, input } from '@angular/core';\n\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrInputSize } from '../types';\n\n/**\n * Applies NGWR input styling to a native `<input>` element.\n *\n * Because this is an attribute directive on the real `<input>` (not a wrapper\n * component), any other directive that targets `input` — `[(ngModel)]`,\n * `[formControl]`, validators, third-party libraries like `ngx-mask` — composes\n * naturally on the same element.\n *\n * @example\n * ```html\n * <input wrInput [(ngModel)]=\"name\" placeholder=\"Your name\" />\n *\n * <!-- Works with ngx-mask, validators, etc. -->\n * <input wrInput [(ngModel)]=\"phone\" mask=\"(000) 000-0000\" />\n * ```\n *\n * For prefix / suffix / password-toggle layouts, wrap the input in\n * `<wr-input-group>`.\n *\n * @see https://ngwr.dev/reference/components/input\n */\n@Directive({\n selector: 'input[wrInput], textarea[wrInput]',\n host: {\n class: 'wr-input',\n '[class]': 'classes()',\n '[attr.id]': 'resolvedId()',\n '[attr.aria-invalid]': 'ariaInvalid()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-required]': 'ariaRequired()',\n },\n})\nexport class WrInput {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly field = inject(WR_FORM_FIELD, { optional: true });\n\n /**\n * Read once, at construction: a static `id=\"\"` in the template is already on\n * the element by the time a directive is instantiated, and it must win over\n * the field's generated one.\n */\n private readonly ownId = this.host.nativeElement.getAttribute('id');\n\n /**\n * Adopts the surrounding `<wr-form-field>`'s `controlId`, so the label it\n * already rendered actually points at this element. Without this the `for`\n * referenced an id that existed nowhere and the input had no label at all.\n */\n protected readonly resolvedId = computed(() => this.ownId ?? this.field?.controlId() ?? null);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\n // Tell the field which id actually stuck. Without this its `<label for>` keeps\n // pointing at the generated id while this element answers to the author's own —\n // a label referencing nothing, which is the same as having none.\n if (this.ownId) this.field?.adoptControlId(this.ownId);\n }\n\n /**\n * Announced state, taken from the surrounding `<wr-form-field>`.\n *\n * The field renders the message but cannot reach the projected control, so\n * the control reads back: without this the error is visible on screen and\n * invisible to a screen reader, which never learns the field is invalid or\n * what the message says.\n */\n // Through the shared helper, not a local pair: the hint is described by\n // `hintId`, which only `useFormFieldAria()` composes, and `aria-invalid` keys\n // on the error COUNT rather than on \"something is described\". Hand-rolled here,\n // these three announced the error and never the hint — and `<input wrInput>` is\n // the control the report was filed against.\n private readonly fieldAria = useFormFieldAria();\n protected readonly describedBy = this.fieldAria.describedBy;\n protected readonly ariaInvalid = this.fieldAria.ariaInvalid;\n\n /** The element's own `aria-required`, read once: a hand-written one wins over the field's. */\n private readonly ownAriaRequired = this.host.nativeElement.getAttribute('aria-required');\n\n /**\n * Native `required` (including the one Signal Forms binds) already announces it,\n * so the field's `required` only fills in when neither is there.\n */\n protected ariaRequired(): string | null {\n if (this.ownAriaRequired !== null) return this.ownAriaRequired;\n if ((this.host.nativeElement as HTMLInputElement).required) return null;\n return this.fieldAria.ariaRequired();\n }\n\n /**\n * Control size. @default 'md'\n *\n * Called `wrSize` until v14, to dodge the native `<input size>` attribute —\n * which measures the field in characters and which `.wr-input`'s `width: 100%`\n * has always overridden, so the clash it guarded against was never observable.\n * It made this the one size input in the catalog spelled differently from the\n * other twenty-three. The cost of the change is that a consumer who wanted the\n * NATIVE `size` on an ngwr input can no longer have it — but `width: 100%`\n * meant they never did.\n */\n readonly size = input<WrInputSize>('md');\n\n /** Pill-shaped corners. @default false */\n readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-input--${size}`);\n if (this.rounded()) parts.push('wr-input--rounded');\n return parts.join(' ');\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 an element as the **left** decoration inside `<wr-input-group>`.\n * Adds the `.wr-input-group__affix` class so the group's layout flexes it\n * to the input's left edge.\n *\n * @example\n * ```html\n * <wr-input-group>\n * <span wrInputPrefix>$</span>\n * <input wrInput [(ngModel)]=\"amount\" type=\"number\" />\n * </wr-input-group>\n * ```\n */\n@Directive({\n selector: '[wrInputPrefix]',\n host: { class: 'wr-input-group__affix wr-input-group__affix--prefix' },\n})\nexport class WrInputPrefix {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\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 an element as the **right** decoration inside `<wr-input-group>`.\n * Adds the `.wr-input-group__affix` class so the group's layout flexes it\n * to the input's right edge.\n *\n * @example\n * ```html\n * <wr-input-group>\n * <input wrInput [(ngModel)]=\"amount\" type=\"number\" />\n * <span wrInputSuffix>USD</span>\n * </wr-input-group>\n * ```\n */\n@Directive({\n selector: '[wrInputSuffix]',\n host: { class: 'wr-input-group__affix wr-input-group__affix--suffix' },\n})\nexport class WrInputSuffix {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ElementRef,\n Renderer2,\n ViewEncapsulation,\n afterEveryRender,\n computed,\n contentChild,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrSpinner } from 'ngwr/spinner';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrInput } from './directives';\n\n/**\n * Container for `<input wrInput>` + `[wrInputPrefix]` / `[wrInputSuffix]` /\n * `<wr-password-toggle>` siblings. Renders the border and focus ring; the\n * inner native input drops its own border so it visually melts into the\n * group.\n *\n * Focus styling is driven entirely by `:focus-within`, so any focusable child\n * counts.\n *\n * `clearable` and `loading` draw a clear (×) button and a spinner after the\n * field, before any `[wrInputSuffix]` or `<wr-password-toggle>`. Both act on the\n * first `wrInput` the group wraps.\n *\n * @example\n * ```html\n * <wr-input-group>\n * <span wrInputPrefix>$</span>\n * <input wrInput [(ngModel)]=\"amount\" type=\"number\" />\n * <span wrInputSuffix>USD</span>\n * </wr-input-group>\n *\n * <!-- a search box: a clear button, and a spinner while the lookup runs -->\n * <wr-input-group clearable [loading]=\"pending()\">\n * <input wrInput [(ngModel)]=\"query\" placeholder=\"Search\" />\n * </wr-input-group>\n * ```\n *\n * @see https://ngwr.dev/reference/components/input\n */\n@Component({\n selector: 'wr-input-group',\n templateUrl: './input-group.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-input-group', '[class]': 'classes()', '(input)': 'syncClear()' },\n imports: [WrSpinner],\n})\nexport class WrInputGroup {\n private readonly renderer = inject(Renderer2);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\n\n // A native field's value is not a signal, and a model write (`ngModel`,\n // `[formField]`, a bound `[value]`) reaches it with no event. So the field\n // is read after every render, and on its own `input` events in between.\n afterEveryRender({ read: () => this.syncClear() });\n\n effect(() => {\n const field = this.field()?.nativeElement;\n if (!field) return;\n if (this.loading()) this.renderer.setAttribute(field, 'aria-busy', 'true');\n else this.renderer.removeAttribute(field, 'aria-busy');\n });\n }\n\n /** Pill-shaped corners. @default false */\n readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show a clear (×) button while the field holds text and is neither disabled\n * nor read-only. Clearing empties the field through an `input` event, so\n * whatever is bound to it (`ngModel`, `[formField]`, an `(input)` listener)\n * hears it as an edit, and puts focus back in the field. It is a pointer\n * control: from the keyboard, emptying the field clears it. @default false\n */\n readonly clearable = input(false, { transform: coerceBooleanProperty });\n\n /** Clear (×) button aria-label. Falls back to `common.clear`. */\n readonly clearLabel = input<string | null>(null);\n\n /**\n * Show a spinner after the field and mark the field `aria-busy`. The field\n * stays editable. @default false\n */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /** Emitted after the clear (×) button emptied the field. */\n readonly cleared = output<void>();\n\n protected readonly resolvedClear = useI18nText(this.clearLabel, 'common.clear', 'Clear');\n\n private readonly field = contentChild<WrInput, ElementRef<HTMLInputElement | HTMLTextAreaElement>>(WrInput, {\n read: ElementRef,\n });\n\n /** Whether the field has text a user could clear right now. */\n private readonly fieldClearable = signal(false);\n\n protected readonly clearShown = computed(() => this.clearable() && this.fieldClearable());\n\n protected syncClear(): void {\n if (!this.clearable()) return;\n const field = this.field()?.nativeElement;\n this.fieldClearable.set(!!field && field.value !== '' && !field.disabled && !field.readOnly);\n }\n\n protected clear(): void {\n const field = this.field()?.nativeElement;\n if (!field || field.disabled || field.readOnly) return;\n field.value = '';\n field.dispatchEvent(new Event('input', { bubbles: true }));\n field.focus();\n this.cleared.emit();\n }\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.rounded()) parts.push('wr-input-group--rounded');\n return parts.join(' ');\n });\n}\n","<ng-content />\n<!-- Pointer-only, as the select's is: emptying the field is the keyboard way to clear. -->\n@if (clearShown()) {\n <span class=\"wr-input-group__clear\" role=\"button\" [attr.aria-label]=\"resolvedClear()\" tabindex=\"-1\" (click)=\"clear()\">\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 </span>\n} @else if (clearable()) {\n <!-- Holds the ×'s room while the field is empty, so clearing does not narrow the group. -->\n <span class=\"wr-input-group__clear-space\" aria-hidden=\"true\"></span>\n}\n<!-- Hidden from the accessibility tree: the field says it is busy with `aria-busy`. -->\n@if (loading()) {\n <wr-spinner class=\"wr-input-group__spinner\" size=\"sm\" aria-hidden=\"true\" />\n}\n<ng-content select=\"[wrInputSuffix], wr-password-toggle\" />\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, computed, input, signal } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Self-contained eye-toggle button. Flips the linked `<input>`'s `type`\n * attribute between `password` and `text`. Drop it inside an\n * `<wr-input-group>` next to a password input.\n *\n * @example\n * ```html\n * <wr-input-group>\n * <input wrInput type=\"password\" [(ngModel)]=\"pw\" #pwInput />\n * <wr-password-toggle [for]=\"pwInput\" />\n * </wr-input-group>\n * ```\n */\n@Component({\n selector: 'wr-password-toggle',\n templateUrl: './password-toggle.html',\n encapsulation: ViewEncapsulation.None,\n})\nexport class WrPasswordToggle {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\n }\n\n /** Reference to the linked password input. */\n readonly for = input.required<HTMLInputElement>();\n\n protected readonly revealed = signal(false);\n\n /** Accessible name while the password is hidden. Falls back to `input.showPassword`. */\n readonly showPasswordLabel = input<string | null>(null);\n\n /** Accessible name while the password is revealed. Falls back to `input.hidePassword`. */\n readonly hidePasswordLabel = input<string | null>(null);\n\n private readonly resolvedShowPasswordLabel = useI18nText(\n this.showPasswordLabel,\n 'input.showPassword',\n 'Show password'\n );\n private readonly resolvedHidePasswordLabel = useI18nText(\n this.hidePasswordLabel,\n 'input.hidePassword',\n 'Hide password'\n );\n\n protected readonly ariaLabel = computed(() =>\n this.revealed() ? this.resolvedHidePasswordLabel() : this.resolvedShowPasswordLabel()\n );\n\n protected toggle(): void {\n const input = this.for();\n const next = input.type === 'password' ? 'text' : 'password';\n input.type = next;\n this.revealed.set(next === 'text');\n }\n}\n","<button\n type=\"button\"\n class=\"wr-input-group__toggle\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-pressed]=\"revealed()\"\n (click)=\"toggle()\"\n>\n @if (revealed()) {\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=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" />\n <path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" />\n <path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n } @else {\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=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n }\n</button>\n"],"mappings":";;;;;;;;;;;;;AA+CA,IAAa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,YAAA,CAAA,+BAAA,CAAA,CAAA;CAES,SAAM;EACd,MAAM,QAAQ,KAAK,IAAG;EACtB,MAAM,OAAO,MAAM,SAAS,aAAa,SAAS;EAClD,MAAM,OAAO;EACb,KAAK,SAAS,IAAI,SAAS,MAAM;CACnC;CApCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAgB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAhB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAgB,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,KAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,mBAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,mBAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UC9B7B;EAyCA,eAAA,GAAA,kBAAA;CAAA,CAAA;;ADXa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EAL5B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAoB,eAEf,kBAAkB;GAAI,UAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-input.mjs","names":[],"sources":["../../../projects/lib/input/directives/wr-input.ts","../../../projects/lib/input/directives/wr-input-prefix.ts","../../../projects/lib/input/directives/wr-input-suffix.ts","../../../projects/lib/input/input-group.ts","../../../projects/lib/input/input-group.html","../../../projects/lib/input/password-toggle.ts","../../../projects/lib/input/password-toggle.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Directive, ElementRef, computed, inject, input } from '@angular/core';\n\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrInputSize } from '../types';\n\n/**\n * Applies NGWR input styling to a native `<input>` element.\n *\n * Because this is an attribute directive on the real `<input>` (not a wrapper\n * component), any other directive that targets `input` — `[(ngModel)]`,\n * `[formControl]`, validators, third-party libraries like `ngx-mask` — composes\n * naturally on the same element.\n *\n * @example\n * ```html\n * <input wrInput [(ngModel)]=\"name\" placeholder=\"Your name\" />\n *\n * <!-- Works with ngx-mask, validators, etc. -->\n * <input wrInput [(ngModel)]=\"phone\" mask=\"(000) 000-0000\" />\n * ```\n *\n * For prefix / suffix / password-toggle layouts, wrap the input in\n * `<wr-input-group>`.\n *\n * @see https://ngwr.dev/reference/components/input\n */\n@Directive({\n selector: 'input[wrInput], textarea[wrInput]',\n host: {\n class: 'wr-input',\n '[class]': 'classes()',\n '[attr.id]': 'resolvedId()',\n '[attr.aria-invalid]': 'ariaInvalid()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-required]': 'ariaRequired()',\n },\n})\nexport class WrInput {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly field = inject(WR_FORM_FIELD, { optional: true });\n\n /**\n * Read once, at construction: a static `id=\"\"` in the template is already on\n * the element by the time a directive is instantiated, and it must win over\n * the field's generated one.\n */\n private readonly ownId = this.host.nativeElement.getAttribute('id');\n\n /**\n * Adopts the surrounding `<wr-form-field>`'s `controlId`, so the label it\n * already rendered actually points at this element. Without this the `for`\n * referenced an id that existed nowhere and the input had no label at all.\n */\n protected readonly resolvedId = computed(() => this.ownId ?? this.field?.controlId() ?? null);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\n // Tell the field which id actually stuck. Without this its `<label for>` keeps\n // pointing at the generated id while this element answers to the author's own —\n // a label referencing nothing, which is the same as having none.\n if (this.ownId) this.field?.adoptControlId(this.ownId);\n }\n\n /**\n * Announced state, taken from the surrounding `<wr-form-field>`.\n *\n * The field renders the message but cannot reach the projected control, so\n * the control reads back: without this the error is visible on screen and\n * invisible to a screen reader, which never learns the field is invalid or\n * what the message says.\n */\n // Through the shared helper, not a local pair: the hint is described by\n // `hintId`, which only `useFormFieldAria()` composes, and `aria-invalid` keys\n // on the error COUNT rather than on \"something is described\". Hand-rolled here,\n // these three announced the error and never the hint — and `<input wrInput>` is\n // the control the report was filed against.\n private readonly fieldAria = useFormFieldAria();\n protected readonly describedBy = this.fieldAria.describedBy;\n protected readonly ariaInvalid = this.fieldAria.ariaInvalid;\n\n /** The element's own `aria-required`, read once: a hand-written one wins over the field's. */\n private readonly ownAriaRequired = this.host.nativeElement.getAttribute('aria-required');\n\n /**\n * Native `required` (including the one Signal Forms binds) already announces it,\n * so the field's `required` only fills in when neither is there.\n */\n protected ariaRequired(): string | null {\n if (this.ownAriaRequired !== null) return this.ownAriaRequired;\n if ((this.host.nativeElement as HTMLInputElement).required) return null;\n return this.fieldAria.ariaRequired();\n }\n\n /**\n * Control size. @default 'md'\n *\n * Called `wrSize` until v14, to dodge the native `<input size>` attribute —\n * which measures the field in characters and which `.wr-input`'s `width: 100%`\n * has always overridden, so the clash it guarded against was never observable.\n * It made this the one size input in the catalog spelled differently from the\n * other twenty-three. The cost of the change is that a consumer who wanted the\n * NATIVE `size` on an ngwr input can no longer have it — but `width: 100%`\n * meant they never did.\n */\n readonly size = input<WrInputSize>('md');\n\n /** Pill-shaped corners. @default false */\n readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n const size = this.size();\n if (size !== 'md') parts.push(`wr-input--${size}`);\n if (this.rounded()) parts.push('wr-input--rounded');\n return parts.join(' ');\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 an element as the **left** decoration inside `<wr-input-group>`.\n * Adds the `.wr-input-group__affix` class so the group's layout flexes it\n * to the input's left edge.\n *\n * @example\n * ```html\n * <wr-input-group>\n * <span wrInputPrefix>$</span>\n * <input wrInput [(ngModel)]=\"amount\" type=\"number\" />\n * </wr-input-group>\n * ```\n */\n@Directive({\n selector: '[wrInputPrefix]',\n host: { class: 'wr-input-group__affix wr-input-group__affix--prefix' },\n})\nexport class WrInputPrefix {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\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 an element as the **right** decoration inside `<wr-input-group>`.\n * Adds the `.wr-input-group__affix` class so the group's layout flexes it\n * to the input's right edge.\n *\n * @example\n * ```html\n * <wr-input-group>\n * <input wrInput [(ngModel)]=\"amount\" type=\"number\" />\n * <span wrInputSuffix>USD</span>\n * </wr-input-group>\n * ```\n */\n@Directive({\n selector: '[wrInputSuffix]',\n host: { class: 'wr-input-group__affix wr-input-group__affix--suffix' },\n})\nexport class WrInputSuffix {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n ElementRef,\n Renderer2,\n ViewEncapsulation,\n afterEveryRender,\n computed,\n contentChild,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrSpinner } from 'ngwr/spinner';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrInput } from './directives';\n\n/**\n * Container for `<input wrInput>` + `[wrInputPrefix]` / `[wrInputSuffix]` /\n * `<wr-password-toggle>` siblings. Renders the border and focus ring; the\n * inner native input drops its own border so it visually melts into the\n * group.\n *\n * Focus styling is driven entirely by `:focus-within`, so any focusable child\n * counts.\n *\n * `clearable` and `loading` draw a clear (×) button and a spinner after the\n * field, before any `[wrInputSuffix]` or `<wr-password-toggle>`. Both act on the\n * first `wrInput` the group wraps.\n *\n * @example\n * ```html\n * <wr-input-group>\n * <span wrInputPrefix>$</span>\n * <input wrInput [(ngModel)]=\"amount\" type=\"number\" />\n * <span wrInputSuffix>USD</span>\n * </wr-input-group>\n *\n * <!-- a search box: a clear button, and a spinner while the lookup runs -->\n * <wr-input-group clearable [loading]=\"pending()\">\n * <input wrInput [(ngModel)]=\"query\" placeholder=\"Search\" />\n * </wr-input-group>\n * ```\n *\n * @see https://ngwr.dev/reference/components/input\n */\n@Component({\n selector: 'wr-input-group',\n templateUrl: './input-group.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-input-group', '[class]': 'classes()', '(input)': 'syncClear()' },\n imports: [WrSpinner],\n})\nexport class WrInputGroup {\n private readonly renderer = inject(Renderer2);\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\n\n // A native field's value is not a signal, and a model write (`ngModel`,\n // `[formField]`, a bound `[value]`) reaches it with no event. So the field\n // is read after every render, and on its own `input` events in between.\n afterEveryRender({ read: () => this.syncClear() });\n\n effect(() => {\n const field = this.field()?.nativeElement;\n if (!field) return;\n if (this.loading()) this.renderer.setAttribute(field, 'aria-busy', 'true');\n else this.renderer.removeAttribute(field, 'aria-busy');\n });\n }\n\n /** Pill-shaped corners. @default false */\n readonly rounded = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Show a clear (×) button while the field holds text and is neither disabled\n * nor read-only. Clearing empties the field through an `input` event, so\n * whatever is bound to it (`ngModel`, `[formField]`, an `(input)` listener)\n * hears it as an edit, and puts focus back in the field. It is a pointer\n * control: from the keyboard, emptying the field clears it. @default false\n */\n readonly clearable = input(false, { transform: coerceBooleanProperty });\n\n /** Clear (×) button aria-label. Falls back to `common.clear`. */\n readonly clearLabel = input<string | null>(null);\n\n /**\n * Show a spinner after the field and mark the field `aria-busy`. The field\n * stays editable. @default false\n */\n readonly loading = input(false, { transform: coerceBooleanProperty });\n\n /** Emitted after the clear (×) button emptied the field. */\n readonly cleared = output<void>();\n\n protected readonly resolvedClear = useI18nText(this.clearLabel, 'common.clear', 'Clear');\n\n private readonly field = contentChild<WrInput, ElementRef<HTMLInputElement | HTMLTextAreaElement>>(WrInput, {\n read: ElementRef,\n });\n\n /** Whether the field has text a user could clear right now. */\n private readonly fieldClearable = signal(false);\n\n protected readonly clearShown = computed(() => this.clearable() && this.fieldClearable());\n\n protected syncClear(): void {\n if (!this.clearable()) return;\n const field = this.field()?.nativeElement;\n this.fieldClearable.set(!!field && field.value !== '' && !field.disabled && !field.readOnly);\n }\n\n protected clear(): void {\n const field = this.field()?.nativeElement;\n if (!field || field.disabled || field.readOnly) return;\n field.value = '';\n field.dispatchEvent(new Event('input', { bubbles: true }));\n field.focus();\n this.cleared.emit();\n }\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.rounded()) parts.push('wr-input-group--rounded');\n return parts.join(' ');\n });\n}\n","<ng-content />\n<!-- Pointer-only, as the select's is: emptying the field is the keyboard way to clear. -->\n@if (clearShown()) {\n <span class=\"wr-input-group__clear\" role=\"button\" [attr.aria-label]=\"resolvedClear()\" tabindex=\"-1\" (click)=\"clear()\">\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 </span>\n} @else if (clearable()) {\n <!-- Holds the ×'s room while the field is empty, so clearing does not narrow the group. -->\n <span class=\"wr-input-group__clear-space\" aria-hidden=\"true\"></span>\n}\n<!-- Hidden from the accessibility tree: the field says it is busy with `aria-busy`. -->\n@if (loading()) {\n <wr-spinner class=\"wr-input-group__spinner\" size=\"sm\" aria-hidden=\"true\" />\n}\n<ng-content select=\"[wrInputSuffix], wr-password-toggle\" />\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, computed, input, signal } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Self-contained eye-toggle button. Flips the linked `<input>`'s `type`\n * attribute between `password` and `text`. Drop it inside an\n * `<wr-input-group>` next to a password input.\n *\n * @example\n * ```html\n * <wr-input-group>\n * <input wrInput type=\"password\" [(ngModel)]=\"pw\" #pwInput />\n * <wr-password-toggle [for]=\"pwInput\" />\n * </wr-input-group>\n * ```\n */\n@Component({\n selector: 'wr-password-toggle',\n templateUrl: './password-toggle.html',\n encapsulation: ViewEncapsulation.None,\n})\nexport class WrPasswordToggle {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('input');\n }\n\n /** Reference to the linked password input. */\n readonly for = input.required<HTMLInputElement>();\n\n protected readonly revealed = signal(false);\n\n /** Accessible name while the password is hidden. Falls back to `input.showPassword`. */\n readonly showPasswordLabel = input<string | null>(null);\n\n /** Accessible name while the password is revealed. Falls back to `input.hidePassword`. */\n readonly hidePasswordLabel = input<string | null>(null);\n\n private readonly resolvedShowPasswordLabel = useI18nText(\n this.showPasswordLabel,\n 'input.showPassword',\n 'Show password'\n );\n private readonly resolvedHidePasswordLabel = useI18nText(\n this.hidePasswordLabel,\n 'input.hidePassword',\n 'Hide password'\n );\n\n protected readonly ariaLabel = computed(() =>\n this.revealed() ? this.resolvedHidePasswordLabel() : this.resolvedShowPasswordLabel()\n );\n\n protected toggle(): void {\n const input = this.for();\n const next = input.type === 'password' ? 'text' : 'password';\n input.type = next;\n this.revealed.set(next === 'text');\n }\n}\n","<button type=\"button\" class=\"wr-input-group__toggle\" [attr.aria-label]=\"ariaLabel()\" (click)=\"toggle()\">\n @if (revealed()) {\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=\"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\" />\n <path d=\"M14.084 14.158a3 3 0 0 1-4.242-4.242\" />\n <path d=\"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\" />\n <path d=\"m2 2 20 20\" />\n </svg>\n } @else {\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=\"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\" />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n }\n</button>\n"],"mappings":";;;;;;;;;;;;;AA+CA,IAAa,UAAb,MAAa,QAAO;CACD,OAAO,OAAgC,UAAU;CACjD,QAAQ,OAAO,eAAe,EAAE,UAAU,KAAI,CAAE;CAOhD,QAAQ,KAAK,KAAK,cAAc,aAAa,IAAI;CAO/C,aA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AS,IAAI,SAAS,MAAM;CACnC;CApCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAgB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAhB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAgB,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,KAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,mBAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,mBAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,UAAA;EAAA,UC9B7B;EAmCA,eAAA,GAAA,kBAAA;CAAA,CAAA;;ADLa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAgB,YAAA,CAAA;EAL5B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAoB,eAEf,kBAAkB;GAAI,UAAA;EAAA,CAAA"}
@@ -2,12 +2,12 @@ import * as i0 from "@angular/core";
2
2
  import { Component, DestroyRef, ElementRef, EnvironmentInjector, Injector, PLATFORM_ID, Service, ViewContainerRef, ViewEncapsulation, computed, effect, inject, input, signal, untracked, viewChild } from "@angular/core";
3
3
  import { coerceBooleanProperty } from "@angular/cdk/coercion";
4
4
  import { isPlatformBrowser } from "@angular/common";
5
- import { wrRestoreFocus, wrToClassList } from "ngwr/utils";
5
+ import { wrIsComposing, wrRestoreFocus, wrToClassList } from "ngwr/utils";
6
6
  import { useI18nFormatter, useI18nText } from "ngwr/i18n";
7
7
  import { Directionality } from "@angular/cdk/bidi";
8
8
  import { TemplatePortal } from "@angular/cdk/portal";
9
9
  import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
10
- import { WR_OVERLAY, wrFocusOverlay, wrFollowDirection } from "ngwr/overlay";
10
+ import { WR_OVERLAY, WrScrollBlock, wrFocusOverlay, wrFollowDirection } from "ngwr/overlay";
11
11
  import { ConfigurableFocusTrapFactory, FocusMonitor } from "@angular/cdk/a11y";
12
12
  /**
13
13
  * @license
@@ -119,6 +119,7 @@ var WrLightbox = class WrLightbox {
119
119
  isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
120
120
  focusMonitor = inject(FocusMonitor);
121
121
  overlay = inject(WR_OVERLAY);
122
+ scrollBlock = inject(WrScrollBlock);
122
123
  vcr = inject(ViewContainerRef);
123
124
  destroyRef = inject(DestroyRef);
124
125
  injector = inject(Injector);
@@ -269,7 +270,7 @@ var WrLightbox = class WrLightbox {
269
270
  hasBackdrop: true,
270
271
  backdropClass: "wr-lightbox-backdrop",
271
272
  positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),
272
- scrollStrategy: this.overlay.scrollStrategies.block(),
273
+ scrollStrategy: this.scrollBlock.strategy(),
273
274
  panelClass: wrToClassList("wr-lightbox-overlay", this.panelClass())
274
275
  });
275
276
  wrFollowDirection(this.overlayRef, this.dir, this.injector);
@@ -282,6 +283,7 @@ var WrLightbox = class WrLightbox {
282
283
  wrFocusOverlay(pane.querySelector(".wr-lightbox-viewer") ?? pane, this.focusTrap, this.autoFocus(), this.injector);
283
284
  this.overlayRef.backdropClick().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.open.set(false));
284
285
  this.overlayRef.keydownEvents().pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
286
+ if (wrIsComposing(event)) return;
285
287
  if (event.key === "Escape") {
286
288
  event.preventDefault();
287
289
  this.open.set(false);
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-lightbox.mjs","names":[],"sources":["../../../projects/lib/lightbox/lightbox-groups.ts","../../../projects/lib/lightbox/lightbox.ts","../../../projects/lib/lightbox/lightbox.html"],"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 { Service, signal, type WritableSignal } from '@angular/core';\n\nimport type { WrLightbox } from './lightbox';\n\ninterface Entry {\n readonly member: WrLightbox;\n readonly host: HTMLElement;\n}\n\n/**\n * Every grouped `wr-lightbox`, keyed by its `group`.\n *\n * @internal\n */\n@Service()\nexport class WrLightboxGroups {\n private readonly groups = new Map<string, WritableSignal<readonly Entry[]>>();\n\n add(group: string, member: WrLightbox, host: HTMLElement): void {\n this.entries(group).update(list => [...list, { member, host }]);\n }\n\n remove(group: string, member: WrLightbox): void {\n const entries = this.entries(group);\n entries.update(list => list.filter(entry => entry.member !== member));\n if (!entries().length) this.groups.delete(group);\n }\n\n /**\n * Re-reads the order. Registration follows creation, and a member that only\n * MOVED in the document registers nothing, so the gallery asks again each\n * time it opens.\n */\n refresh(group: string): void {\n this.groups.get(group)?.update(list => [...list]);\n }\n\n /** The group's members in document order. */\n members(group: string): readonly WrLightbox[] {\n return [...this.entries(group)()]\n .sort((a, b) =>\n // eslint-disable-next-line no-bitwise -- compareDocumentPosition answers with a bitmask\n (a.host.compareDocumentPosition(b.host) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0 ? -1 : 1\n )\n .map(entry => entry.member);\n }\n\n private entries(group: string): WritableSignal<readonly Entry[]> {\n let entries = this.groups.get(group);\n if (!entries) {\n entries = signal<readonly Entry[]>([]);\n this.groups.set(group, entries);\n }\n return entries;\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 ConfigurableFocusTrap, ConfigurableFocusTrapFactory, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport type { Signal, TemplateRef } from '@angular/core';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n EnvironmentInjector,\n Injector,\n PLATFORM_ID,\n ViewContainerRef,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, type WrOverlayAutoFocus, wrFocusOverlay, wrFollowDirection } from 'ngwr/overlay';\nimport { wrToClassList, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrLightboxGroups } from './lightbox-groups';\n\n/** How far a horizontal swipe travels before it turns the page. */\nconst SWIPE_STEP_PX = 48;\n\nlet viewerUid = 0;\n\n/**\n * Image with click-to-zoom lightbox. The thumbnail is a plain `<img>`\n * with whatever sizing/`object-fit` you give it; clicking opens a CDK\n * overlay showing the full image, with Escape + close button + backdrop\n * to dismiss.\n *\n * Lightboxes that share a `group` form a gallery in document order: the viewer\n * gains previous and next buttons, a counter and the arrow keys.\n *\n * @example\n * ```html\n * <wr-lightbox\n * src=\"/photo.jpg\"\n * alt=\"Mountain\"\n * style=\"width: 16rem; height: 10rem; object-fit: cover\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/lightbox\n */\n@Component({\n selector: 'wr-lightbox',\n templateUrl: './lightbox.html',\n styleUrl: './lightbox.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-lightbox',\n '[class]': 'classes()',\n '[style.aspect-ratio]': 'aspectRatio()',\n },\n})\nexport class WrLightbox {\n /** Accessible name of the thumbnail button. Falls back to `alt`, then `image.open`. */\n readonly openLabel = input<string | null>(null);\n\n /** Accessible name of the viewer's close button. Falls back to `image.close`, then `'Close preview'`. */\n readonly closeLabel = input<string | null>(null);\n\n protected readonly resolvedCloseLabel = useI18nText(this.closeLabel, 'image.close', 'Close preview');\n\n /** Image source. */\n readonly src = input.required<string>();\n\n /** Alt text. Required for a11y; falls back to an empty string. @default '' */\n readonly alt = input<string>('');\n\n /**\n * Lighter source for the THUMBNAIL — a small or blurred copy, so the grid does not\n * pull full-size images. The viewer always shows `src`; the thumbnail does not swap\n * to it later.\n */\n readonly preview = input<string | null>(null);\n\n // Both of these were hard-coded English literals in the template, next to a catalog\n // that already carried `image.open` translated and unread. `useI18nText` already\n // does the whole chain — a non-empty binding wins, then the catalog, then the\n // English default — so the alt text (which describes the actual picture) is what\n // gets forwarded, with `openLabel` ahead of it as the explicit override.\n protected readonly resolvedOpenLabel = useI18nText(\n computed(() => {\n // Not `??`: an empty `openLabel` is no label at all, so it has to fall through\n // to the alt text rather than winning as an empty string.\n const explicit = this.openLabel();\n if (explicit) return explicit;\n return this.alt();\n }),\n 'image.open',\n 'Open preview'\n );\n\n protected readonly resolvedViewerLabel = useI18nText(\n computed(() => this.shown().alt()),\n 'image.viewer',\n 'Image preview'\n );\n\n /** Disable the click-to-zoom lightbox. @default false */\n readonly disablePreview = input(false, { transform: coerceBooleanProperty });\n\n /** Caption shown under the full image in the lightbox. */\n readonly caption = input<string>('');\n\n /**\n * Reserve space before the image resolves by fixing the thumbnail's\n * `aspect-ratio` (e.g. `'16 / 9'`, `'4 / 3'`, or a number like `1.5`).\n * Prevents the layout jump when the intrinsic image size isn't known up\n * front — pair it with a `width` and the box keeps its height from first\n * paint. @default null\n */\n readonly aspectRatio = input<string | number | null>(null);\n\n /**\n * Where focus goes when the viewer opens. `'dialog'` puts it on the viewer\n * itself, with no ring, so the keyboard is inside and no button is lit;\n * `'first-tabbable'` puts it on the Close button; `false` leaves it on the\n * thumbnail. The viewer traps Tab in every mode, and closing returns focus to\n * the thumbnail.\n * @default 'dialog'\n */\n readonly autoFocus = input<WrOverlayAutoFocus>('dialog');\n\n /**\n * Extra CSS classes for the viewer's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Gallery name. Every `wr-lightbox` with the same group, in document order,\n * can be paged through from whichever one was opened. A lightbox with\n * `disablePreview` stays out of it. @default null\n */\n readonly group = input<string | null>(null);\n\n /** Wrap from the last image of the group to the first, and back. @default false */\n readonly loop = input(false, { transform: coerceBooleanProperty });\n\n /** Accessible name of the viewer's previous button. Falls back to `common.previous`. */\n readonly previousLabel = input<string | null>(null);\n\n /** Accessible name of the viewer's next button. Falls back to `common.next`. */\n readonly nextLabel = input<string | null>(null);\n\n protected readonly resolvedPreviousLabel = useI18nText(this.previousLabel, 'common.previous', 'Previous');\n protected readonly resolvedNextLabel = useI18nText(this.nextLabel, 'common.next', 'Next');\n private readonly counterText = useI18nFormatter('image.counter', '{{current}} / {{total}}');\n private readonly positionText = useI18nFormatter('image.position', 'Image {{current}} of {{total}}');\n\n protected readonly open = signal(false);\n protected readonly loaded = signal(false);\n\n /**\n * Id the trigger's `aria-controls` points at while the viewer is open.\n *\n * @internal Public so the host bindings can read it.\n */\n protected readonly viewerId = `wr-lightbox-viewer-${++viewerUid}`;\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.open()) parts.push('wr-lightbox--open');\n if (!this.loaded()) parts.push('wr-lightbox--loading');\n return parts.join(' ');\n });\n\n // Query by name — `@if` blocks register their own TemplateRefs, so an\n // unqualified TemplateRef query would grab the thumbnail branch instead.\n protected readonly panelTpl = viewChild.required<TemplateRef<unknown>>('viewerTpl');\n\n private readonly groups = inject(WrLightboxGroups);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly overlay = inject(WR_OVERLAY);\n private readonly vcr = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly injector = inject(Injector);\n private readonly focusTrapFactory = inject(ConfigurableFocusTrapFactory);\n /**\n * The reading direction the open viewer has to keep up with, resolved off the\n * ENVIRONMENT injector rather than this component's — the same instance the\n * CDK read when it stamped the overlay, since `createOverlayRef` takes\n * `Directionality` from the `Overlay`'s injector and no node-level `[dir]` is\n * in that chain. The viewer is appended to the overlay container on `<body>`,\n * not into whatever region the thumbnail sits in, so reading the node\n * injector would rewrite a correctly-stamped panel to an island's direction\n * one pass after it opened rather than follow the application at all.\n *\n * `null` never happens in an app — `Directionality` is root-provided — but a\n * bare `TestBed` should still get a viewer that opens.\n */\n private readonly dir = inject(EnvironmentInjector).get(Directionality, null);\n private focusTrap: ConfigurableFocusTrap | null = null;\n private previouslyFocused: HTMLElement | null = null;\n private overlayRef: OverlayRef | null = null;\n\n /** The gallery this lightbox pages through; empty when it stands alone. */\n protected readonly gallery: Signal<readonly WrLightbox[]> = computed(() => {\n const group = this.group();\n if (!group) return [];\n const members = this.groups.members(group).filter(member => !member.disablePreview());\n return members.length > 1 && members.includes(this) ? members : [];\n });\n\n private readonly target = signal<WrLightbox | null>(null);\n private lastIndex = 0;\n\n /** The lightbox whose image the viewer is showing. */\n protected readonly shown: Signal<WrLightbox> = computed(() => {\n const target = this.target();\n return target && this.gallery().includes(target) ? target : this;\n });\n\n protected readonly index = computed(() => this.gallery().indexOf(this.shown()));\n protected readonly canPrevious = computed(() => this.loop() || this.index() > 0);\n protected readonly canNext = computed(() => this.loop() || this.index() < this.gallery().length - 1);\n\n protected readonly counter = computed(() => this.counterText(this.place()));\n\n protected readonly announcement = computed(() => {\n const alt = this.shown().alt();\n const position = this.positionText(this.place());\n return alt ? `${position}, ${alt}` : position;\n });\n\n private readonly preloaded = new Set<string>();\n\n constructor() {\n // Destroying the component while the viewer is open removes the projected\n // content (the portal uses this component's ViewContainerRef) but leaves the\n // overlay pane and its full-screen backdrop behind, with page scroll still\n // blocked. Dispose the overlay explicitly.\n this.destroyRef.onDestroy(() => this.closeOverlay());\n\n effect(() => {\n if (this.open()) this.openOverlay();\n else this.closeOverlay();\n });\n\n effect(onCleanup => {\n const group = this.group();\n if (!group) return;\n this.groups.add(group, this, this.host);\n onCleanup(() => this.groups.remove(group, this));\n });\n\n // The image on screen left the group: stay at its place in the order\n // instead of jumping back to the one that was opened.\n effect(() => {\n const target = this.target();\n if (!target) return;\n const gallery = this.gallery();\n const index = gallery.indexOf(target);\n if (index >= 0) {\n this.lastIndex = index;\n return;\n }\n untracked(() => this.target.set(gallery[Math.min(this.lastIndex, gallery.length - 1)] ?? null));\n });\n\n effect(() => {\n if (!this.isBrowser || !this.open()) return;\n const gallery = this.gallery();\n // The viewer's own <img> fetches this one.\n this.preloaded.add(this.shown().src());\n for (const delta of [-1, 1]) {\n const neighbour = gallery[this.wrap(this.index() + delta)];\n if (neighbour) this.preload(neighbour.src());\n }\n });\n }\n\n protected onClick(): void {\n if (this.disablePreview()) return;\n const group = this.group();\n if (group) this.groups.refresh(group);\n this.target.set(this);\n this.open.set(true);\n }\n\n /** Move through the gallery by one image; a no-op at an end unless `loop` is set. */\n protected step(delta: -1 | 1): void {\n this.show(this.wrap(this.index() + delta));\n }\n\n private show(index: number): void {\n const member = this.gallery()[index];\n if (member) this.target.set(member);\n }\n\n private wrap(index: number): number {\n const total = this.gallery().length;\n return this.loop() && total ? (index + total) % total : index;\n }\n\n private place(): { current: number; total: number } {\n return { current: this.index() + 1, total: this.gallery().length };\n }\n\n private preload(src: string): void {\n if (this.preloaded.has(src)) return;\n this.preloaded.add(src);\n new Image().src = src;\n }\n\n protected onClose(): void {\n this.open.set(false);\n }\n\n // Swipe-down-to-dismiss on the open viewer. The image follows the finger and\n // fades; releasing past ~20% of the viewer height closes it.\n private viewerStartX = 0;\n private viewerStartY = 0;\n private viewerSwiping = false;\n\n protected onViewerSwipeStart(event: TouchEvent): void {\n const touch = event.touches[0];\n if (!touch) return;\n this.viewerStartX = touch.clientX;\n this.viewerStartY = touch.clientY;\n this.viewerSwiping = true;\n }\n\n protected onViewerSwipeMove(event: TouchEvent, viewer: HTMLElement): void {\n if (!this.viewerSwiping) return;\n const touch = event.touches[0];\n if (!touch) return;\n const dy = touch.clientY - this.viewerStartY;\n if (dy <= 0 || this.isSideways(touch.clientX - this.viewerStartX, dy)) {\n viewer.style.transform = '';\n viewer.style.opacity = '';\n return;\n }\n event.preventDefault();\n viewer.style.transition = 'none';\n viewer.style.transform = `translateY(${dy}px)`;\n viewer.style.opacity = String(Math.max(0.3, 1 - dy / (viewer.offsetHeight || 1)));\n }\n\n protected onViewerSwipeEnd(event: TouchEvent, viewer: HTMLElement): void {\n if (!this.viewerSwiping) return;\n this.viewerSwiping = false;\n const touch = event.changedTouches[0];\n const dx = touch ? touch.clientX - this.viewerStartX : 0;\n const dy = touch ? touch.clientY - this.viewerStartY : 0;\n if (this.isSideways(dx, dy)) {\n if (Math.abs(dx) >= SWIPE_STEP_PX) this.step(dx < 0 !== this.isRtl() ? 1 : -1);\n } else if (dy > (viewer.offsetHeight || 0) * 0.2) {\n this.onClose();\n } else {\n viewer.style.transition = '';\n viewer.style.transform = '';\n viewer.style.opacity = '';\n }\n }\n\n /** A drag that belongs to the gallery rather than to swipe-down-to-dismiss. */\n private isSideways(dx: number, dy: number): boolean {\n return this.gallery().length > 0 && Math.abs(dx) > Math.abs(dy);\n }\n\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n\n /**\n * The thumbnail has settled, one way or the other. A failure counts: `--loading`\n * animates a shimmer AND sets `opacity: 0` on the image, so a broken `src` with no\n * error path left an invisible box shimmering for ever instead of showing its alt\n * text.\n */\n protected onSettled(): void {\n this.loaded.set(true);\n }\n\n // Overlay\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'wr-lightbox-backdrop',\n positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),\n scrollStrategy: this.overlay.scrollStrategies.block(),\n panelClass: wrToClassList('wr-lightbox-overlay', this.panelClass()),\n });\n\n // Centred on both axes, so no geometry rides on the direction — but the\n // viewer's own chrome does. The ✕ is placed with `inset-inline-end` and the\n // caption reads as prose, both against the `dir` the CDK froze at create, so\n // a flip while the viewer is open leaves the button on the wrong corner.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // The viewer declares role=\"dialog\" + aria-modal=\"true\", which promises the\n // rest of the page is inert. Without a focus trap that promise is a lie:\n // Tab walks straight out of the viewer into the page behind the backdrop.\n const active = document.activeElement;\n this.previouslyFocused = active instanceof HTMLElement ? active : null;\n const pane = this.overlayRef.overlayElement;\n this.focusTrap = this.focusTrapFactory.create(pane);\n // Onto the viewer itself by default, the element that carries the dialog\n // role: the keyboard is inside and the Close button is not lit.\n wrFocusOverlay(\n pane.querySelector<HTMLElement>('.wr-lightbox-viewer') ?? pane,\n this.focusTrap,\n this.autoFocus(),\n this.injector\n );\n\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n\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 } else {\n this.onGalleryKey(event);\n }\n });\n }\n\n private onGalleryKey(event: KeyboardEvent): void {\n const total = this.gallery().length;\n if (!total || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n\n switch (event.key) {\n case 'ArrowLeft':\n this.step(this.isRtl() ? 1 : -1);\n break;\n case 'ArrowRight':\n this.step(this.isRtl() ? -1 : 1);\n break;\n case 'Home':\n this.show(0);\n break;\n case 'End':\n this.show(total - 1);\n break;\n default:\n return;\n }\n event.preventDefault();\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this.overlayRef.dispose();\n this.overlayRef = null;\n // Send focus back where it came from, or it lands on <body> and the user\n // has to tab from the top of the page again.\n if (restore && typeof restore.focus === 'function') wrRestoreFocus(restore, this.focusMonitor);\n }\n}\n","@if (disablePreview()) {\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n} @else {\n <!-- The trigger opens a modal dialog, and used to say so nowhere: no hint that it\n opens anything, and nothing on the page tying it to the viewer it opened. -->\n <button\n type=\"button\"\n class=\"wr-lightbox__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-controls]=\"open() ? viewerId : null\"\n [attr.aria-label]=\"resolvedOpenLabel()\"\n (click)=\"onClick()\"\n >\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </button>\n}\n\n<ng-template #viewerTpl>\n <div\n #viewer\n class=\"wr-lightbox-viewer\"\n [id]=\"viewerId\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"resolvedViewerLabel()\"\n (touchstart)=\"onViewerSwipeStart($event)\"\n (touchmove)=\"onViewerSwipeMove($event, viewer)\"\n (touchend)=\"onViewerSwipeEnd($event, viewer)\"\n (touchcancel)=\"onViewerSwipeEnd($event, viewer)\"\n >\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__close\"\n [attr.aria-label]=\"resolvedCloseLabel()\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose()\"\n (keydown.space)=\"onClose()\"\n >\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 @if (gallery().length) {\n <span class=\"wr-lightbox-viewer__counter\" aria-hidden=\"true\">{{ counter() }}</span>\n <!-- `aria-disabled`, not `disabled`: a disabled button drops focus to <body>,\n out of the trap, the moment the last image is reached. -->\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__nav wr-lightbox-viewer__nav--previous\"\n [class.wr-lightbox-viewer__nav--disabled]=\"!canPrevious()\"\n [attr.aria-label]=\"resolvedPreviousLabel()\"\n [attr.aria-disabled]=\"canPrevious() ? null : 'true'\"\n (click)=\"step(-1)\"\n >\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=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__nav wr-lightbox-viewer__nav--next\"\n [class.wr-lightbox-viewer__nav--disabled]=\"!canNext()\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [attr.aria-disabled]=\"canNext() ? null : 'true'\"\n (click)=\"step(1)\"\n >\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=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n }\n <!--\n Styled `cursor: zoom-out`, which is a promise: clicking the image closes. A\n REDUNDANT mouse affordance — the close button, Escape, the backdrop and\n swipe-down all do the same thing and all reach a keyboard — so the image stays\n out of the tab order rather than becoming a second close stop.\n -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <img class=\"wr-lightbox-viewer__full\" [src]=\"shown().src()\" [alt]=\"shown().alt()\" (click)=\"onClose()\" />\n @if (shown().caption()) {\n <div class=\"wr-lightbox-viewer__caption\">{{ shown().caption() }}</div>\n }\n @if (gallery().length) {\n <span class=\"wr-lightbox-viewer__status\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n }\n </div>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAa,mBAAb,MAAa,iBAAgB;CACV,yBAAS,IAAI,IAAG;CAEjC,IAAI,OAAe,QAAoB,MAAiB;EACtD,KAAK,QAAQ,KAAK,CAAC,CAAC,QAAO,SAAQ,CAAC,GAAG,MAAM;GAAE;GAAQ;EAAI,CAAE,CAAC;CAChE;CAEA,OAAO,OAAe,QAAkB;EACtC,MAAM,UAAU,KAAK,QAAQ,KAAK;EAClC,QAAQ,QAAO,SAAQ,KAAK,QAAO,UAAS,MAAM,WAAW,MAAM,CAAC;EACpE,IAAI,CAAC,QAAO,CAAE,CAAC,QAAQ,KAAK,OAAO,OAAO,KAAK;CACjD;CAOA,QAAQ,OAAa;EACnB,KAAK,OAAO,IAAI,KAAK,CAAC,EAAE,QAAO,SAAQ,CAAC,GAAG,IAAI,CAAC;CAClD;CAGA,QAAQ,OAAa;EACnB,OAAO,CAAC,GAAG,KAAK,QAAQ,KAAK,CAAC,CAAA,CAAE,CAAC,CAC9B,MAAM,GAAG,OAEP,EAAE,KAAK,wBAAwB,EAAE,IAAI,IAAI,KAAK,iCAAiC,IAAI,KAAK,CAAC,CAC3F,CACA,KAAI,UAAS,MAAM,MAAM;CAC9B;CAEQ,QAAQ,OAAa;EAC3B,IAAI,UAAU,KAAK,OAAO,IAAI,KAAK;EACnC,IAAI,CAAC,SAAS;GACZ,UAAU,OAAyB,CAAA,CAAE;GACrC,KAAK,OAAO,IAAI,OAAO,OAAO;EAChC;EACA,OAAO;CACT;CAvCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,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AA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAW,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-lightbox.mjs","names":[],"sources":["../../../projects/lib/lightbox/lightbox-groups.ts","../../../projects/lib/lightbox/lightbox.ts","../../../projects/lib/lightbox/lightbox.html"],"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 { Service, signal, type WritableSignal } from '@angular/core';\n\nimport type { WrLightbox } from './lightbox';\n\ninterface Entry {\n readonly member: WrLightbox;\n readonly host: HTMLElement;\n}\n\n/**\n * Every grouped `wr-lightbox`, keyed by its `group`.\n *\n * @internal\n */\n@Service()\nexport class WrLightboxGroups {\n private readonly groups = new Map<string, WritableSignal<readonly Entry[]>>();\n\n add(group: string, member: WrLightbox, host: HTMLElement): void {\n this.entries(group).update(list => [...list, { member, host }]);\n }\n\n remove(group: string, member: WrLightbox): void {\n const entries = this.entries(group);\n entries.update(list => list.filter(entry => entry.member !== member));\n if (!entries().length) this.groups.delete(group);\n }\n\n /**\n * Re-reads the order. Registration follows creation, and a member that only\n * MOVED in the document registers nothing, so the gallery asks again each\n * time it opens.\n */\n refresh(group: string): void {\n this.groups.get(group)?.update(list => [...list]);\n }\n\n /** The group's members in document order. */\n members(group: string): readonly WrLightbox[] {\n return [...this.entries(group)()]\n .sort((a, b) =>\n // eslint-disable-next-line no-bitwise -- compareDocumentPosition answers with a bitmask\n (a.host.compareDocumentPosition(b.host) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0 ? -1 : 1\n )\n .map(entry => entry.member);\n }\n\n private entries(group: string): WritableSignal<readonly Entry[]> {\n let entries = this.groups.get(group);\n if (!entries) {\n entries = signal<readonly Entry[]>([]);\n this.groups.set(group, entries);\n }\n return entries;\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 ConfigurableFocusTrap, ConfigurableFocusTrapFactory, FocusMonitor } from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type OverlayRef } from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\nimport { isPlatformBrowser } from '@angular/common';\nimport type { Signal, TemplateRef } from '@angular/core';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n EnvironmentInjector,\n Injector,\n PLATFORM_ID,\n ViewContainerRef,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WR_OVERLAY, type WrOverlayAutoFocus, WrScrollBlock, wrFocusOverlay, wrFollowDirection } from 'ngwr/overlay';\nimport { wrIsComposing, wrToClassList, type WrClassInput, wrRestoreFocus } from 'ngwr/utils';\n\nimport { WrLightboxGroups } from './lightbox-groups';\n\n/** How far a horizontal swipe travels before it turns the page. */\nconst SWIPE_STEP_PX = 48;\n\nlet viewerUid = 0;\n\n/**\n * Image with click-to-zoom lightbox. The thumbnail is a plain `<img>`\n * with whatever sizing/`object-fit` you give it; clicking opens a CDK\n * overlay showing the full image, with Escape + close button + backdrop\n * to dismiss.\n *\n * Lightboxes that share a `group` form a gallery in document order: the viewer\n * gains previous and next buttons, a counter and the arrow keys.\n *\n * @example\n * ```html\n * <wr-lightbox\n * src=\"/photo.jpg\"\n * alt=\"Mountain\"\n * style=\"width: 16rem; height: 10rem; object-fit: cover\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/lightbox\n */\n@Component({\n selector: 'wr-lightbox',\n templateUrl: './lightbox.html',\n styleUrl: './lightbox.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-lightbox',\n '[class]': 'classes()',\n '[style.aspect-ratio]': 'aspectRatio()',\n },\n})\nexport class WrLightbox {\n /** Accessible name of the thumbnail button. Falls back to `alt`, then `image.open`. */\n readonly openLabel = input<string | null>(null);\n\n /** Accessible name of the viewer's close button. Falls back to `image.close`, then `'Close preview'`. */\n readonly closeLabel = input<string | null>(null);\n\n protected readonly resolvedCloseLabel = useI18nText(this.closeLabel, 'image.close', 'Close preview');\n\n /** Image source. */\n readonly src = input.required<string>();\n\n /** Alt text. Required for a11y; falls back to an empty string. @default '' */\n readonly alt = input<string>('');\n\n /**\n * Lighter source for the THUMBNAIL — a small or blurred copy, so the grid does not\n * pull full-size images. The viewer always shows `src`; the thumbnail does not swap\n * to it later.\n */\n readonly preview = input<string | null>(null);\n\n // Both of these were hard-coded English literals in the template, next to a catalog\n // that already carried `image.open` translated and unread. `useI18nText` already\n // does the whole chain — a non-empty binding wins, then the catalog, then the\n // English default — so the alt text (which describes the actual picture) is what\n // gets forwarded, with `openLabel` ahead of it as the explicit override.\n protected readonly resolvedOpenLabel = useI18nText(\n computed(() => {\n // Not `??`: an empty `openLabel` is no label at all, so it has to fall through\n // to the alt text rather than winning as an empty string.\n const explicit = this.openLabel();\n if (explicit) return explicit;\n return this.alt();\n }),\n 'image.open',\n 'Open preview'\n );\n\n protected readonly resolvedViewerLabel = useI18nText(\n computed(() => this.shown().alt()),\n 'image.viewer',\n 'Image preview'\n );\n\n /** Disable the click-to-zoom lightbox. @default false */\n readonly disablePreview = input(false, { transform: coerceBooleanProperty });\n\n /** Caption shown under the full image in the lightbox. */\n readonly caption = input<string>('');\n\n /**\n * Reserve space before the image resolves by fixing the thumbnail's\n * `aspect-ratio` (e.g. `'16 / 9'`, `'4 / 3'`, or a number like `1.5`).\n * Prevents the layout jump when the intrinsic image size isn't known up\n * front — pair it with a `width` and the box keeps its height from first\n * paint. @default null\n */\n readonly aspectRatio = input<string | number | null>(null);\n\n /**\n * Where focus goes when the viewer opens. `'dialog'` puts it on the viewer\n * itself, with no ring, so the keyboard is inside and no button is lit;\n * `'first-tabbable'` puts it on the Close button; `false` leaves it on the\n * thumbnail. The viewer traps Tab in every mode, and closing returns focus to\n * the thumbnail.\n * @default 'dialog'\n */\n readonly autoFocus = input<WrOverlayAutoFocus>('dialog');\n\n /**\n * Extra CSS classes for the viewer's overlay pane.\n *\n * The pane is appended to the overlay container, not to this component, so\n * nothing in the consumer's own template encloses it and no descendant rule\n * written around the trigger can reach it. This input is the only per-instance\n * handle on it. A space-separated string works as well as an array.\n */\n readonly panelClass = input<WrClassInput>(null);\n\n /**\n * Gallery name. Every `wr-lightbox` with the same group, in document order,\n * can be paged through from whichever one was opened. A lightbox with\n * `disablePreview` stays out of it. @default null\n */\n readonly group = input<string | null>(null);\n\n /** Wrap from the last image of the group to the first, and back. @default false */\n readonly loop = input(false, { transform: coerceBooleanProperty });\n\n /** Accessible name of the viewer's previous button. Falls back to `common.previous`. */\n readonly previousLabel = input<string | null>(null);\n\n /** Accessible name of the viewer's next button. Falls back to `common.next`. */\n readonly nextLabel = input<string | null>(null);\n\n protected readonly resolvedPreviousLabel = useI18nText(this.previousLabel, 'common.previous', 'Previous');\n protected readonly resolvedNextLabel = useI18nText(this.nextLabel, 'common.next', 'Next');\n private readonly counterText = useI18nFormatter('image.counter', '{{current}} / {{total}}');\n private readonly positionText = useI18nFormatter('image.position', 'Image {{current}} of {{total}}');\n\n protected readonly open = signal(false);\n protected readonly loaded = signal(false);\n\n /**\n * Id the trigger's `aria-controls` points at while the viewer is open.\n *\n * @internal Public so the host bindings can read it.\n */\n protected readonly viewerId = `wr-lightbox-viewer-${++viewerUid}`;\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.open()) parts.push('wr-lightbox--open');\n if (!this.loaded()) parts.push('wr-lightbox--loading');\n return parts.join(' ');\n });\n\n // Query by name — `@if` blocks register their own TemplateRefs, so an\n // unqualified TemplateRef query would grab the thumbnail branch instead.\n protected readonly panelTpl = viewChild.required<TemplateRef<unknown>>('viewerTpl');\n\n private readonly groups = inject(WrLightboxGroups);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly focusMonitor = inject(FocusMonitor);\n private readonly overlay = inject(WR_OVERLAY);\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 /**\n * The reading direction the open viewer has to keep up with, resolved off the\n * ENVIRONMENT injector rather than this component's — the same instance the\n * CDK read when it stamped the overlay, since `createOverlayRef` takes\n * `Directionality` from the `Overlay`'s injector and no node-level `[dir]` is\n * in that chain. The viewer is appended to the overlay container on `<body>`,\n * not into whatever region the thumbnail sits in, so reading the node\n * injector would rewrite a correctly-stamped panel to an island's direction\n * one pass after it opened rather than follow the application at all.\n *\n * `null` never happens in an app — `Directionality` is root-provided — but a\n * bare `TestBed` should still get a viewer that opens.\n */\n private readonly dir = inject(EnvironmentInjector).get(Directionality, null);\n private focusTrap: ConfigurableFocusTrap | null = null;\n private previouslyFocused: HTMLElement | null = null;\n private overlayRef: OverlayRef | null = null;\n\n /** The gallery this lightbox pages through; empty when it stands alone. */\n protected readonly gallery: Signal<readonly WrLightbox[]> = computed(() => {\n const group = this.group();\n if (!group) return [];\n const members = this.groups.members(group).filter(member => !member.disablePreview());\n return members.length > 1 && members.includes(this) ? members : [];\n });\n\n private readonly target = signal<WrLightbox | null>(null);\n private lastIndex = 0;\n\n /** The lightbox whose image the viewer is showing. */\n protected readonly shown: Signal<WrLightbox> = computed(() => {\n const target = this.target();\n return target && this.gallery().includes(target) ? target : this;\n });\n\n protected readonly index = computed(() => this.gallery().indexOf(this.shown()));\n protected readonly canPrevious = computed(() => this.loop() || this.index() > 0);\n protected readonly canNext = computed(() => this.loop() || this.index() < this.gallery().length - 1);\n\n protected readonly counter = computed(() => this.counterText(this.place()));\n\n protected readonly announcement = computed(() => {\n const alt = this.shown().alt();\n const position = this.positionText(this.place());\n return alt ? `${position}, ${alt}` : position;\n });\n\n private readonly preloaded = new Set<string>();\n\n constructor() {\n // Destroying the component while the viewer is open removes the projected\n // content (the portal uses this component's ViewContainerRef) but leaves the\n // overlay pane and its full-screen backdrop behind, with page scroll still\n // blocked. Dispose the overlay explicitly.\n this.destroyRef.onDestroy(() => this.closeOverlay());\n\n effect(() => {\n if (this.open()) this.openOverlay();\n else this.closeOverlay();\n });\n\n effect(onCleanup => {\n const group = this.group();\n if (!group) return;\n this.groups.add(group, this, this.host);\n onCleanup(() => this.groups.remove(group, this));\n });\n\n // The image on screen left the group: stay at its place in the order\n // instead of jumping back to the one that was opened.\n effect(() => {\n const target = this.target();\n if (!target) return;\n const gallery = this.gallery();\n const index = gallery.indexOf(target);\n if (index >= 0) {\n this.lastIndex = index;\n return;\n }\n untracked(() => this.target.set(gallery[Math.min(this.lastIndex, gallery.length - 1)] ?? null));\n });\n\n effect(() => {\n if (!this.isBrowser || !this.open()) return;\n const gallery = this.gallery();\n // The viewer's own <img> fetches this one.\n this.preloaded.add(this.shown().src());\n for (const delta of [-1, 1]) {\n const neighbour = gallery[this.wrap(this.index() + delta)];\n if (neighbour) this.preload(neighbour.src());\n }\n });\n }\n\n protected onClick(): void {\n if (this.disablePreview()) return;\n const group = this.group();\n if (group) this.groups.refresh(group);\n this.target.set(this);\n this.open.set(true);\n }\n\n /** Move through the gallery by one image; a no-op at an end unless `loop` is set. */\n protected step(delta: -1 | 1): void {\n this.show(this.wrap(this.index() + delta));\n }\n\n private show(index: number): void {\n const member = this.gallery()[index];\n if (member) this.target.set(member);\n }\n\n private wrap(index: number): number {\n const total = this.gallery().length;\n return this.loop() && total ? (index + total) % total : index;\n }\n\n private place(): { current: number; total: number } {\n return { current: this.index() + 1, total: this.gallery().length };\n }\n\n private preload(src: string): void {\n if (this.preloaded.has(src)) return;\n this.preloaded.add(src);\n new Image().src = src;\n }\n\n protected onClose(): void {\n this.open.set(false);\n }\n\n // Swipe-down-to-dismiss on the open viewer. The image follows the finger and\n // fades; releasing past ~20% of the viewer height closes it.\n private viewerStartX = 0;\n private viewerStartY = 0;\n private viewerSwiping = false;\n\n protected onViewerSwipeStart(event: TouchEvent): void {\n const touch = event.touches[0];\n if (!touch) return;\n this.viewerStartX = touch.clientX;\n this.viewerStartY = touch.clientY;\n this.viewerSwiping = true;\n }\n\n protected onViewerSwipeMove(event: TouchEvent, viewer: HTMLElement): void {\n if (!this.viewerSwiping) return;\n const touch = event.touches[0];\n if (!touch) return;\n const dy = touch.clientY - this.viewerStartY;\n if (dy <= 0 || this.isSideways(touch.clientX - this.viewerStartX, dy)) {\n viewer.style.transform = '';\n viewer.style.opacity = '';\n return;\n }\n event.preventDefault();\n viewer.style.transition = 'none';\n viewer.style.transform = `translateY(${dy}px)`;\n viewer.style.opacity = String(Math.max(0.3, 1 - dy / (viewer.offsetHeight || 1)));\n }\n\n protected onViewerSwipeEnd(event: TouchEvent, viewer: HTMLElement): void {\n if (!this.viewerSwiping) return;\n this.viewerSwiping = false;\n const touch = event.changedTouches[0];\n const dx = touch ? touch.clientX - this.viewerStartX : 0;\n const dy = touch ? touch.clientY - this.viewerStartY : 0;\n if (this.isSideways(dx, dy)) {\n if (Math.abs(dx) >= SWIPE_STEP_PX) this.step(dx < 0 !== this.isRtl() ? 1 : -1);\n } else if (dy > (viewer.offsetHeight || 0) * 0.2) {\n this.onClose();\n } else {\n viewer.style.transition = '';\n viewer.style.transform = '';\n viewer.style.opacity = '';\n }\n }\n\n /** A drag that belongs to the gallery rather than to swipe-down-to-dismiss. */\n private isSideways(dx: number, dy: number): boolean {\n return this.gallery().length > 0 && Math.abs(dx) > Math.abs(dy);\n }\n\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n\n /**\n * The thumbnail has settled, one way or the other. A failure counts: `--loading`\n * animates a shimmer AND sets `opacity: 0` on the image, so a broken `src` with no\n * error path left an invisible box shimmering for ever instead of showing its alt\n * text.\n */\n protected onSettled(): void {\n this.loaded.set(true);\n }\n\n // Overlay\n\n private openOverlay(): void {\n if (this.overlayRef) return;\n\n this.overlayRef = this.overlay.create({\n hasBackdrop: true,\n backdropClass: 'wr-lightbox-backdrop',\n positionStrategy: this.overlay.position().global().centerHorizontally().centerVertically(),\n scrollStrategy: this.scrollBlock.strategy(),\n panelClass: wrToClassList('wr-lightbox-overlay', this.panelClass()),\n });\n\n // Centred on both axes, so no geometry rides on the direction — but the\n // viewer's own chrome does. The ✕ is placed with `inset-inline-end` and the\n // caption reads as prose, both against the `dir` the CDK froze at create, so\n // a flip while the viewer is open leaves the button on the wrong corner.\n wrFollowDirection(this.overlayRef, this.dir, this.injector);\n\n const portal = new TemplatePortal(this.panelTpl(), this.vcr);\n this.overlayRef.attach(portal);\n\n // The viewer declares role=\"dialog\" + aria-modal=\"true\", which promises the\n // rest of the page is inert. Without a focus trap that promise is a lie:\n // Tab walks straight out of the viewer into the page behind the backdrop.\n const active = document.activeElement;\n this.previouslyFocused = active instanceof HTMLElement ? active : null;\n const pane = this.overlayRef.overlayElement;\n this.focusTrap = this.focusTrapFactory.create(pane);\n // Onto the viewer itself by default, the element that carries the dialog\n // role: the keyboard is inside and the Close button is not lit.\n wrFocusOverlay(\n pane.querySelector<HTMLElement>('.wr-lightbox-viewer') ?? pane,\n this.focusTrap,\n this.autoFocus(),\n this.injector\n );\n\n this.overlayRef\n .backdropClick()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.open.set(false));\n\n this.overlayRef\n .keydownEvents()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(event => {\n if (wrIsComposing(event)) return;\n if (event.key === 'Escape') {\n event.preventDefault();\n this.open.set(false);\n } else {\n this.onGalleryKey(event);\n }\n });\n }\n\n private onGalleryKey(event: KeyboardEvent): void {\n const total = this.gallery().length;\n if (!total || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;\n\n switch (event.key) {\n case 'ArrowLeft':\n this.step(this.isRtl() ? 1 : -1);\n break;\n case 'ArrowRight':\n this.step(this.isRtl() ? -1 : 1);\n break;\n case 'Home':\n this.show(0);\n break;\n case 'End':\n this.show(total - 1);\n break;\n default:\n return;\n }\n event.preventDefault();\n }\n\n private closeOverlay(): void {\n if (!this.overlayRef) return;\n this.focusTrap?.destroy();\n this.focusTrap = null;\n const restore = this.previouslyFocused;\n this.previouslyFocused = null;\n this.overlayRef.dispose();\n this.overlayRef = null;\n // Send focus back where it came from, or it lands on <body> and the user\n // has to tab from the top of the page again.\n if (restore && typeof restore.focus === 'function') wrRestoreFocus(restore, this.focusMonitor);\n }\n}\n","@if (disablePreview()) {\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n} @else {\n <!-- The trigger opens a modal dialog, and used to say so nowhere: no hint that it\n opens anything, and nothing on the page tying it to the viewer it opened. -->\n <button\n type=\"button\"\n class=\"wr-lightbox__trigger\"\n aria-haspopup=\"dialog\"\n [attr.aria-controls]=\"open() ? viewerId : null\"\n [attr.aria-label]=\"resolvedOpenLabel()\"\n (click)=\"onClick()\"\n >\n <img\n class=\"wr-lightbox__thumb\"\n [src]=\"preview() || src()\"\n [alt]=\"alt()\"\n (load)=\"onSettled()\"\n (error)=\"onSettled()\"\n loading=\"lazy\"\n decoding=\"async\"\n />\n </button>\n}\n\n<ng-template #viewerTpl>\n <div\n #viewer\n class=\"wr-lightbox-viewer\"\n [id]=\"viewerId\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"resolvedViewerLabel()\"\n (touchstart)=\"onViewerSwipeStart($event)\"\n (touchmove)=\"onViewerSwipeMove($event, viewer)\"\n (touchend)=\"onViewerSwipeEnd($event, viewer)\"\n (touchcancel)=\"onViewerSwipeEnd($event, viewer)\"\n >\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__close\"\n [attr.aria-label]=\"resolvedCloseLabel()\"\n (click)=\"onClose()\"\n (keydown.enter)=\"onClose()\"\n (keydown.space)=\"onClose()\"\n >\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 @if (gallery().length) {\n <span class=\"wr-lightbox-viewer__counter\" aria-hidden=\"true\">{{ counter() }}</span>\n <!-- `aria-disabled`, not `disabled`: a disabled button drops focus to <body>,\n out of the trap, the moment the last image is reached. -->\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__nav wr-lightbox-viewer__nav--previous\"\n [class.wr-lightbox-viewer__nav--disabled]=\"!canPrevious()\"\n [attr.aria-label]=\"resolvedPreviousLabel()\"\n [attr.aria-disabled]=\"canPrevious() ? null : 'true'\"\n (click)=\"step(-1)\"\n >\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=\"m15 18-6-6 6-6\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-lightbox-viewer__nav wr-lightbox-viewer__nav--next\"\n [class.wr-lightbox-viewer__nav--disabled]=\"!canNext()\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [attr.aria-disabled]=\"canNext() ? null : 'true'\"\n (click)=\"step(1)\"\n >\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=\"m9 18 6-6-6-6\" />\n </svg>\n </button>\n }\n <!--\n Styled `cursor: zoom-out`, which is a promise: clicking the image closes. A\n REDUNDANT mouse affordance — the close button, Escape, the backdrop and\n swipe-down all do the same thing and all reach a keyboard — so the image stays\n out of the tab order rather than becoming a second close stop.\n -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n <img class=\"wr-lightbox-viewer__full\" [src]=\"shown().src()\" [alt]=\"shown().alt()\" (click)=\"onClose()\" />\n @if (shown().caption()) {\n <div class=\"wr-lightbox-viewer__caption\">{{ shown().caption() }}</div>\n }\n @if (gallery().length) {\n <span class=\"wr-lightbox-viewer__status\" role=\"status\" aria-live=\"polite\">{{ announcement() }}</span>\n }\n </div>\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,IAAa,mBAAb,MAAa,iBAAgB;CACV,yBAAS,IAAI,IAAG;CAEjC,IAAI,OAAe,QAAoB,MAAiB;EACtD,KAAK,QAAQ,KAAK,CAAC,CAAC,QAAO,SAAQ,CAAC,GAAG,MAAM;GAAE;GAAQ;EAAI,CAAE,CAAC;CAChE;CAEA,OAAO,OAAe,QAAkB;EACtC,MAAM,UAAU,KAAK,QAAQ,KAAK;EAClC,Q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AA"}
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
2
2
  import { EnvironmentInjector, InjectionToken, Injector, PLATFORM_ID, Service, afterNextRender, effect, inject, untracked } from "@angular/core";
3
3
  import { DOCUMENT as DOCUMENT$1, isPlatformBrowser } from "@angular/common";
4
4
  import { wrNoop } from "ngwr/utils";
5
- import { Overlay, OverlayContainer, OverlayPositionBuilder } from "@angular/cdk/overlay";
5
+ import { Overlay, OverlayContainer, OverlayPositionBuilder, ScrollStrategyOptions } from "@angular/cdk/overlay";
6
6
  import { Observable, Subscription } from "rxjs";
7
7
  import { _isTestEnvironment } from "@angular/cdk/platform";
8
8
  /**
@@ -515,6 +515,55 @@ i0.ɵɵngDeclareClassMetadata({
515
515
  * Use of this source code is governed by an MIT-style license that can be
516
516
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
517
517
  */
518
+ var WrScrollBlock = class WrScrollBlock {
519
+ block = inject(ScrollStrategyOptions).block();
520
+ holders = 0;
521
+ strategy() {
522
+ let held = false;
523
+ return {
524
+ attach: () => void 0,
525
+ enable: () => {
526
+ if (!held) {
527
+ held = true;
528
+ this.holders++;
529
+ }
530
+ this.block.enable();
531
+ },
532
+ disable: () => {
533
+ if (!held) return;
534
+ held = false;
535
+ if (--this.holders === 0) this.block.disable();
536
+ }
537
+ };
538
+ }
539
+ static ɵfac = i0.ɵɵngDeclareFactory({
540
+ minVersion: "12.0.0",
541
+ version: "22.3.0",
542
+ ngImport: i0,
543
+ type: WrScrollBlock,
544
+ deps: [],
545
+ target: i0.ɵɵFactoryTarget.Service
546
+ });
547
+ static ɵprov = i0.ɵɵngDeclareService({
548
+ minVersion: "22.0.0",
549
+ version: "22.3.0",
550
+ ngImport: i0,
551
+ type: WrScrollBlock
552
+ });
553
+ };
554
+ i0.ɵɵngDeclareClassMetadata({
555
+ minVersion: "12.0.0",
556
+ version: "22.3.0",
557
+ ngImport: i0,
558
+ type: WrScrollBlock,
559
+ decorators: [{ type: Service }]
560
+ });
561
+ /**
562
+ * @license
563
+ *
564
+ * Use of this source code is governed by an MIT-style license that can be
565
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
566
+ */
518
567
  const WR_OVERLAY_CONTAINER = new InjectionToken("WR_OVERLAY_CONTAINER", {
519
568
  providedIn: "root",
520
569
  factory: () => inject(WrOverlayContainer)
@@ -549,6 +598,6 @@ const WR_OVERLAY = new InjectionToken("WR_OVERLAY", {
549
598
  }).get(Overlay);
550
599
  }
551
600
  });
552
- export { WR_ANCHORED_FALLBACKS, WR_ANCHORED_POSITIONS, WR_OVERLAY, WR_OVERLAY_CONTAINER, WrOutsideClick, WrOverlayContainer, WrOverlayOrder, wrAnchoredPositions, wrAppendOverlayClose, wrFocusOverlay, wrFollowDirection, wrFollowSize, wrMirrorOffsets };
601
+ export { WR_ANCHORED_FALLBACKS, WR_ANCHORED_POSITIONS, WR_OVERLAY, WR_OVERLAY_CONTAINER, WrOutsideClick, WrOverlayContainer, WrOverlayOrder, WrScrollBlock, wrAnchoredPositions, wrAppendOverlayClose, wrFocusOverlay, wrFollowDirection, wrFollowSize, wrMirrorOffsets };
553
602
 
554
603
  //# sourceMappingURL=ngwr-overlay.mjs.map