ngwr 11.0.0 → 11.2.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 (237) hide show
  1. package/action-sheet/styles/_index.scss +4 -1
  2. package/anchor/styles/_index.scss +2 -1
  3. package/calendar/styles/_index.scss +11 -2
  4. package/cascader/styles/_index.scss +3 -1
  5. package/circular-text/styles/_index.scss +11 -0
  6. package/command-palette/styles/_index.scss +14 -1
  7. package/context-menu/styles/_index.scss +2 -1
  8. package/falling-text/styles/_index.scss +2 -1
  9. package/fesm2022/ngwr-action-sheet-testing.mjs +313 -0
  10. package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -0
  11. package/fesm2022/ngwr-bar-chart-testing.mjs +89 -0
  12. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -0
  13. package/fesm2022/ngwr-blur-text-testing.mjs +203 -0
  14. package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -0
  15. package/fesm2022/ngwr-blur-text.mjs +15 -1
  16. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  17. package/fesm2022/ngwr-border-glow-testing.mjs +325 -0
  18. package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -0
  19. package/fesm2022/ngwr-border-glow.mjs +2 -2
  20. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  21. package/fesm2022/ngwr-calendar-heatmap-testing.mjs +95 -0
  22. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -0
  23. package/fesm2022/ngwr-calendar-testing.mjs +368 -0
  24. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -0
  25. package/fesm2022/ngwr-calendar.mjs +43 -3
  26. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  27. package/fesm2022/ngwr-card.mjs +2 -2
  28. package/fesm2022/ngwr-cascader.mjs +14 -2
  29. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  30. package/fesm2022/ngwr-checkbox.mjs +8 -0
  31. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  32. package/fesm2022/ngwr-circular-text-testing.mjs +230 -0
  33. package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -0
  34. package/fesm2022/ngwr-circular-text.mjs +2 -2
  35. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  36. package/fesm2022/ngwr-color-picker-testing.mjs +432 -0
  37. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -0
  38. package/fesm2022/ngwr-color-picker.mjs +29 -3
  39. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  40. package/fesm2022/ngwr-context-menu.mjs +25 -5
  41. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  42. package/fesm2022/ngwr-date-picker-testing.mjs +10 -79
  43. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  44. package/fesm2022/ngwr-decrypt-text-testing.mjs +261 -0
  45. package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -0
  46. package/fesm2022/ngwr-decrypt-text.mjs +6 -1
  47. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  48. package/fesm2022/ngwr-donut-chart-testing.mjs +93 -0
  49. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -0
  50. package/fesm2022/ngwr-drag-drop.mjs +2 -2
  51. package/fesm2022/ngwr-drawer.mjs +36 -7
  52. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  53. package/fesm2022/ngwr-dropdown.mjs +32 -2
  54. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  55. package/fesm2022/ngwr-event-calendar-testing.mjs +446 -0
  56. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -0
  57. package/fesm2022/ngwr-event-calendar.mjs +43 -18
  58. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  59. package/fesm2022/ngwr-falling-text-testing.mjs +218 -0
  60. package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -0
  61. package/fesm2022/ngwr-falling-text.mjs +2 -2
  62. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  63. package/fesm2022/ngwr-fuzzy-text-testing.mjs +134 -0
  64. package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -0
  65. package/fesm2022/ngwr-gauge-testing.mjs +86 -0
  66. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -0
  67. package/fesm2022/ngwr-glitch-text-testing.mjs +181 -0
  68. package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -0
  69. package/fesm2022/ngwr-glitch-text.mjs +2 -2
  70. package/fesm2022/ngwr-gradient-text-testing.mjs +223 -0
  71. package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -0
  72. package/fesm2022/ngwr-gradient-text.mjs +2 -2
  73. package/fesm2022/ngwr-i18n-en.mjs +14 -0
  74. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  75. package/fesm2022/ngwr-i18n-ru.mjs +14 -0
  76. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  77. package/fesm2022/ngwr-image-cropper-testing.mjs +156 -0
  78. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -0
  79. package/fesm2022/ngwr-image-cropper.mjs +10 -3
  80. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  81. package/fesm2022/ngwr-input-number.mjs +73 -6
  82. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  83. package/fesm2022/ngwr-knob-testing.mjs +220 -0
  84. package/fesm2022/ngwr-knob-testing.mjs.map +1 -0
  85. package/fesm2022/ngwr-lightbox-testing.mjs +223 -0
  86. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -0
  87. package/fesm2022/ngwr-lightbox.mjs +9 -2
  88. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  89. package/fesm2022/ngwr-line-chart-testing.mjs +119 -0
  90. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -0
  91. package/fesm2022/ngwr-list.mjs +2 -2
  92. package/fesm2022/ngwr-loading-bar.mjs +2 -2
  93. package/fesm2022/ngwr-marquee-testing.mjs +336 -0
  94. package/fesm2022/ngwr-marquee-testing.mjs.map +1 -0
  95. package/fesm2022/ngwr-marquee.mjs +2 -2
  96. package/fesm2022/ngwr-meter-group-testing.mjs +80 -0
  97. package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -0
  98. package/fesm2022/ngwr-overlay.mjs +28 -1
  99. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  100. package/fesm2022/ngwr-popover.mjs +14 -0
  101. package/fesm2022/ngwr-popover.mjs.map +1 -1
  102. package/fesm2022/ngwr-rotating-text-testing.mjs +220 -0
  103. package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -0
  104. package/fesm2022/ngwr-rotating-text.mjs +2 -2
  105. package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
  106. package/fesm2022/ngwr-select.mjs +70 -11
  107. package/fesm2022/ngwr-select.mjs.map +1 -1
  108. package/fesm2022/ngwr-shiny-text-testing.mjs +237 -0
  109. package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -0
  110. package/fesm2022/ngwr-shiny-text.mjs +2 -2
  111. package/fesm2022/ngwr-slider.mjs +44 -6
  112. package/fesm2022/ngwr-slider.mjs.map +1 -1
  113. package/fesm2022/ngwr-sparkline-testing.mjs +76 -0
  114. package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -0
  115. package/fesm2022/ngwr-speed-dial-testing.mjs +279 -0
  116. package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -0
  117. package/fesm2022/ngwr-splash-cursor-testing.mjs +89 -0
  118. package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -0
  119. package/fesm2022/ngwr-split-text-testing.mjs +224 -0
  120. package/fesm2022/ngwr-split-text-testing.mjs.map +1 -0
  121. package/fesm2022/ngwr-split-text.mjs +15 -1
  122. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  123. package/fesm2022/ngwr-splitter-testing.mjs +245 -0
  124. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -0
  125. package/fesm2022/ngwr-spotlight-card-testing.mjs +368 -0
  126. package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -0
  127. package/fesm2022/ngwr-spotlight-card.mjs +2 -2
  128. package/fesm2022/ngwr-star-border-testing.mjs +172 -0
  129. package/fesm2022/ngwr-star-border-testing.mjs.map +1 -0
  130. package/fesm2022/ngwr-star-border.mjs +2 -2
  131. package/fesm2022/ngwr-table.mjs +13 -3
  132. package/fesm2022/ngwr-table.mjs.map +1 -1
  133. package/fesm2022/ngwr-tabs.mjs +15 -1
  134. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  135. package/fesm2022/ngwr-tilt-card-testing.mjs +190 -0
  136. package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -0
  137. package/fesm2022/ngwr-tilt-card.mjs +21 -3
  138. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  139. package/fesm2022/ngwr-toast.mjs +36 -7
  140. package/fesm2022/ngwr-toast.mjs.map +1 -1
  141. package/fesm2022/ngwr-tour-testing.mjs +173 -0
  142. package/fesm2022/ngwr-tour-testing.mjs.map +1 -0
  143. package/fesm2022/ngwr-tour.mjs +2 -2
  144. package/fesm2022/ngwr-tour.mjs.map +1 -1
  145. package/fesm2022/ngwr-tree.mjs +10 -3
  146. package/fesm2022/ngwr-tree.mjs.map +1 -1
  147. package/fesm2022/ngwr-typewriter-testing.mjs +228 -0
  148. package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -0
  149. package/fesm2022/ngwr-typewriter.mjs +2 -2
  150. package/fesm2022/ngwr-version.mjs +1 -1
  151. package/fesm2022/ngwr-version.mjs.map +1 -1
  152. package/fesm2022/ngwr-virtual-scroll.mjs +2 -2
  153. package/fesm2022/ngwr-waves-testing.mjs +128 -0
  154. package/fesm2022/ngwr-waves-testing.mjs.map +1 -0
  155. package/fesm2022/ngwr-waves.mjs +2 -2
  156. package/fesm2022/ngwr-window-testing.mjs +361 -0
  157. package/fesm2022/ngwr-window-testing.mjs.map +1 -0
  158. package/fesm2022/ngwr-window.mjs +84 -10
  159. package/fesm2022/ngwr-window.mjs.map +1 -1
  160. package/file-upload/styles/_index.scss +7 -2
  161. package/i18n/en.json +16 -2
  162. package/i18n/ru.json +16 -2
  163. package/llms-full.txt +147 -0
  164. package/llms.txt +27 -8
  165. package/mcp/providers.js +29 -0
  166. package/mcp/tools.js +1 -29
  167. package/package.json +145 -1
  168. package/result/styles/_index.scss +3 -1
  169. package/segmented/styles/_index.scss +5 -1
  170. package/select/styles/_index.scss +3 -1
  171. package/skills/ngwr/SKILL.md +115 -0
  172. package/skills/ngwr/references/catalog.md +212 -0
  173. package/skills/ngwr/references/setup.md +73 -0
  174. package/stepper/styles/_index.scss +18 -2
  175. package/table/styles/_index.scss +3 -1
  176. package/theme/styles/_colors.scss +15 -2
  177. package/theme/styles/_dark.scss +24 -12
  178. package/tree/styles/_index.scss +4 -2
  179. package/types/ngwr-action-sheet-testing.d.ts +260 -0
  180. package/types/ngwr-bar-chart-testing.d.ts +77 -0
  181. package/types/ngwr-blur-text-testing.d.ts +180 -0
  182. package/types/ngwr-blur-text.d.ts +12 -0
  183. package/types/ngwr-border-glow-testing.d.ts +219 -0
  184. package/types/ngwr-calendar-heatmap-testing.d.ts +79 -0
  185. package/types/ngwr-calendar-testing.d.ts +277 -0
  186. package/types/ngwr-calendar.d.ts +10 -0
  187. package/types/ngwr-checkbox.d.ts +13 -0
  188. package/types/ngwr-circular-text-testing.d.ts +196 -0
  189. package/types/ngwr-color-picker-testing.d.ts +291 -0
  190. package/types/ngwr-color-picker.d.ts +13 -1
  191. package/types/ngwr-context-menu.d.ts +15 -1
  192. package/types/ngwr-date-picker-testing.d.ts +6 -66
  193. package/types/ngwr-decrypt-text-testing.d.ts +222 -0
  194. package/types/ngwr-donut-chart-testing.d.ts +79 -0
  195. package/types/ngwr-drawer.d.ts +12 -0
  196. package/types/ngwr-dropdown.d.ts +9 -0
  197. package/types/ngwr-event-calendar-testing.d.ts +301 -0
  198. package/types/ngwr-event-calendar.d.ts +9 -6
  199. package/types/ngwr-falling-text-testing.d.ts +186 -0
  200. package/types/ngwr-fuzzy-text-testing.d.ts +130 -0
  201. package/types/ngwr-gauge-testing.d.ts +71 -0
  202. package/types/ngwr-glitch-text-testing.d.ts +172 -0
  203. package/types/ngwr-gradient-text-testing.d.ts +173 -0
  204. package/types/ngwr-image-cropper-testing.d.ts +134 -0
  205. package/types/ngwr-image-cropper.d.ts +1 -0
  206. package/types/ngwr-input-number.d.ts +33 -1
  207. package/types/ngwr-knob-testing.d.ts +150 -0
  208. package/types/ngwr-lightbox-testing.d.ts +154 -0
  209. package/types/ngwr-lightbox.d.ts +6 -0
  210. package/types/ngwr-line-chart-testing.d.ts +93 -0
  211. package/types/ngwr-marquee-testing.d.ts +280 -0
  212. package/types/ngwr-meter-group-testing.d.ts +67 -0
  213. package/types/ngwr-overlay.d.ts +19 -1
  214. package/types/ngwr-rotating-text-testing.d.ts +191 -0
  215. package/types/ngwr-select.d.ts +32 -0
  216. package/types/ngwr-shiny-text-testing.d.ts +165 -0
  217. package/types/ngwr-slider.d.ts +15 -0
  218. package/types/ngwr-sparkline-testing.d.ts +69 -0
  219. package/types/ngwr-speed-dial-testing.d.ts +195 -0
  220. package/types/ngwr-splash-cursor-testing.d.ts +95 -0
  221. package/types/ngwr-split-text-testing.d.ts +209 -0
  222. package/types/ngwr-split-text.d.ts +12 -0
  223. package/types/ngwr-splitter-testing.d.ts +174 -0
  224. package/types/ngwr-spotlight-card-testing.d.ts +303 -0
  225. package/types/ngwr-star-border-testing.d.ts +135 -0
  226. package/types/ngwr-table.d.ts +10 -1
  227. package/types/ngwr-tilt-card-testing.d.ts +158 -0
  228. package/types/ngwr-tilt-card.d.ts +2 -0
  229. package/types/ngwr-toast.d.ts +14 -5
  230. package/types/ngwr-tour-testing.d.ts +143 -0
  231. package/types/ngwr-tree.d.ts +7 -0
  232. package/types/ngwr-typewriter-testing.d.ts +201 -0
  233. package/types/ngwr-version.d.ts +1 -1
  234. package/types/ngwr-waves-testing.d.ts +121 -0
  235. package/types/ngwr-window-testing.d.ts +263 -0
  236. package/types/ngwr-window.d.ts +27 -10
  237. package/window/styles/_index.scss +44 -16
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-input-number.mjs","sources":["../../../projects/lib/input-number/input-number.ts","../../../projects/lib/input-number/input-number.html","../../../projects/lib/input-number/ngwr-input-number.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type BooleanInput, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useConfigValue } from 'ngwr/config';\nimport { WrInput, WrInputGroup, WrInputPrefix, WrInputSuffix, type WrInputSize } from 'ngwr/input';\nimport { clamp, round } from 'ngwr/utils';\n\n/** Round to `decimals` places, avoiding common float artefacts (`1.005 → 1.01`). */\n\n/** Resolve the locale's decimal + grouping separators from `Intl.NumberFormat`. */\nfunction resolveSeparators(locale: string): { decimal: string; group: string } {\n const parts = new Intl.NumberFormat(locale).formatToParts(12345.6);\n const decimal = parts.find(p => p.type === 'decimal')?.value ?? '.';\n const group = parts.find(p => p.type === 'group')?.value ?? '';\n return { decimal, group };\n}\n\n/**\n * Numeric input with locale-aware formatting + ▲▼ stepper buttons.\n *\n * A signal-forms native control: it implements `FormValueControl<number | null>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone.\n *\n * Parses leniently while typing (allows partial input like `\"1.\"` or `\"-\"`),\n * re-formats with grouping + fixed decimals on blur.\n *\n * Locale comes from Angular's `LOCALE_ID` — input-number intentionally does\n * NOT depend on `ngwr/date-adapter` so it can be used in date-free apps.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-input-number [formField]=\"form.qty\" [min]=\"0\" [max]=\"100\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-input-number [(value)]=\"price\" [decimals]=\"2\" suffix=\"USD\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/input-number\n */\n@Component({\n selector: 'wr-input-number',\n templateUrl: './input-number.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()' },\n imports: [WrInput, WrInputGroup, WrInputPrefix, WrInputSuffix],\n})\nexport class WrInputNumber implements FormValueControl<number | null> {\n /** Minimum allowed value. @default -Infinity */\n readonly min = input<number | undefined>(Number.NEGATIVE_INFINITY, {\n transform: (v: unknown): number => coerceNumberProperty(v, Number.NEGATIVE_INFINITY),\n });\n\n /** Maximum allowed value. @default Infinity */\n readonly max = input<number | undefined>(Number.POSITIVE_INFINITY, {\n transform: (v: unknown): number => coerceNumberProperty(v, Number.POSITIVE_INFINITY),\n });\n\n private readonly minValue = computed(() => this.min() ?? Number.NEGATIVE_INFINITY);\n private readonly maxValue = computed(() => this.max() ?? Number.POSITIVE_INFINITY);\n\n /** Step used by stepper buttons + arrow keys. @default 1 */\n readonly step = input(1, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 1)) });\n\n /** Fixed number of decimals shown on blur. `null` keeps the entered precision. @default null */\n readonly decimals = input<number | null>(null);\n\n /** Render the ▲▼ stepper column. @default true */\n readonly showSteppers = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Control size — forwarded to the field, and shares the `--wr-control-*`\n * contract. Unset falls back to the `inputNumber.size` app default from\n * `provideWrConfig()`, then to the `input.size` one, then to `md`. @default 'md'\n */\n readonly size = input<WrInputSize | null>(null);\n\n /**\n * Pill-shaped corners. Unset falls back to the `inputNumber.rounded` app default\n * from `provideWrConfig()`, then to the `input.rounded` one;\n * `[rounded]=\"false\"` turns a configured `true` back off. @default false\n */\n readonly rounded = input<boolean | null, BooleanInput>(null, {\n // Null-preserving: the plain `coerceBooleanProperty` folds `null` into\n // `false`, which would make \"not set\" and \"set to false\" the same value —\n // and a config default nothing could ever supply.\n transform: (v: BooleanInput): boolean | null => (v == null ? null : coerceBooleanProperty(v)),\n });\n\n /**\n * `size`, then the app config, then `md` — bound to the field's `[wrSize]`.\n *\n * The chrome this control is built from resolves the same pair for itself, so\n * the config lookup falls through to `input.*` rather than stopping at\n * `inputNumber.*`: binding a value down always wins there, and an unchained\n * lookup would therefore SUPPRESS an `input.size` an app had set — the field\n * inside a number input would be the one `[wrInput]` in the app that ignored it.\n * Chained, the specific key wins where it is set and the general one still\n * applies where it is not.\n */\n protected readonly resolvedSize = useConfigValue(this.size, c => c.inputNumber?.size ?? c.input?.size, 'md');\n\n /** `rounded`, then the app config, then `false` — bound to the group AND the field. */\n protected readonly resolvedRounded = useConfigValue(\n this.rounded,\n c => c.inputNumber?.rounded ?? c.input?.rounded,\n false\n );\n\n /** Optional prefix label (e.g. `\"$\"`). */\n readonly prefix = input<string>('');\n\n /** Optional suffix label (e.g. `\"kg\"`). */\n readonly suffix = input<string>('');\n\n /** Placeholder shown when the input is empty. */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name for the field. Falls back to the placeholder — inside a\n * `<wr-form-field>` the projected `wrInput` picks up the label's id and needs\n * neither, but standalone the text field has no name at all.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = computed(() => {\n // Not `??`: an empty placeholder is no name at all, so it must fall through.\n const explicit = this.ariaLabel();\n if (explicit) return explicit;\n const placeholder = this.placeholder();\n return placeholder ? placeholder : null;\n });\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Read-only — values cannot be changed (steppers + typing disabled). @default false */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** Numeric value (`null` when empty). Bound by `[formField]`, or two-way via `[(value)]`. */\n readonly value = model<number | null>(null);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n private readonly locale = inject(LOCALE_ID);\n private readonly separators = resolveSeparators(this.locale);\n\n /** Text currently in the input (may be partial / invalid mid-type). */\n protected readonly text = signal<string>('');\n\n /** Whether the input is focused. While true, the input handlers own `text`. */\n protected readonly focused = signal(false);\n\n protected readonly interactive = computed(() => !this.disabled() && !this.readonly());\n\n protected readonly atMin = computed(() => {\n const v = this.value();\n return v !== null && v <= this.minValue();\n });\n\n protected readonly atMax = computed(() => {\n const v = this.value();\n return v !== null && v >= this.maxValue();\n });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-input-number'];\n if (this.disabled()) parts.push('wr-input-number--disabled');\n return parts.join(' ');\n });\n\n constructor() {\n // Keep the display `text` in sync with external writes to `value` (via\n // `[formField]` / `[(value)]`). While the user is editing, the input\n // handlers own `text`, so skip re-formatting to avoid clobbering partial\n // input (e.g. mid-typed grouping or a value that is still being clamped).\n effect(() => {\n const v = this.value();\n if (this.focused()) return;\n this.text.set(v === null || Number.isNaN(v) ? '' : this.format(this.constrain(v)));\n });\n }\n\n // Template handlers\n\n protected onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value;\n this.text.set(raw);\n if (!raw.trim()) {\n this.value.set(null);\n return;\n }\n const parsed = this.parse(raw);\n if (parsed === null) return; // partial input — wait for more\n const next = this.constrain(parsed);\n this.value.set(next);\n }\n\n protected onFocus(): void {\n this.focused.set(true);\n }\n\n protected onBlur(): void {\n // Flipping `focused` false lets the sync effect re-format `text` from the\n // committed `value` (e.g. `\"1.\"` → `\"1\"`, or grouping the final number).\n this.focused.set(false);\n this.touch.emit();\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!this.interactive()) return;\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return;\n event.preventDefault();\n const direction = event.key === 'ArrowUp' ? 1 : -1;\n const multiplier = event.shiftKey ? 10 : 1;\n this.bump(direction * multiplier);\n }\n\n protected stepBy(direction: 1 | -1): void {\n if (!this.interactive()) return;\n this.bump(direction);\n }\n\n // Internals\n\n private bump(units: number): void {\n const stepSize = this.step() || 1;\n const base = this.value() ?? this.fallbackBase();\n const next = this.constrain(base + units * stepSize);\n this.value.set(next);\n this.text.set(this.format(next));\n }\n\n /** Choose a sensible starting point when bumping from `null`. */\n private fallbackBase(): number {\n if (Number.isFinite(this.minValue()) && this.minValue() > 0) return this.minValue();\n if (Number.isFinite(this.maxValue()) && this.maxValue() < 0) return this.maxValue();\n return 0;\n }\n\n private constrain(v: number): number {\n let next = clamp(v, this.minValue(), this.maxValue());\n const d = this.decimals();\n if (d !== null) next = round(next, d);\n return next;\n }\n\n /** Parse a locale-formatted string. Returns `null` for partial / not-yet-numeric input. */\n private parse(raw: string): number | null {\n const trimmed = raw.trim();\n if (!trimmed) return null;\n // Strip group separators, normalise the decimal separator to `.`.\n let normalised = trimmed;\n if (this.separators.group) {\n normalised = normalised.split(this.separators.group).join('');\n }\n if (this.separators.decimal !== '.') {\n normalised = normalised.split(this.separators.decimal).join('.');\n }\n // Partial inputs we don't want to clobber while the user is still typing:\n // `-`, `-.`, `.`, `1.`, `-1.` etc.\n if (/^-?\\.?$/.test(normalised) || normalised.endsWith('.')) return null;\n const n = Number(normalised);\n return Number.isFinite(n) ? n : null;\n }\n\n /** Format a value using `Intl.NumberFormat` for the active locale. */\n private format(v: number): string {\n const d = this.decimals();\n const formatter = new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: d ?? 0,\n maximumFractionDigits: d ?? 20,\n useGrouping: true,\n });\n return formatter.format(v);\n }\n}\n","<wr-input-group [rounded]=\"resolvedRounded()\">\n @if (prefix(); as p) {\n <span wrInputPrefix>{{ p }}</span>\n }\n <input\n #input\n wrInput\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"off\"\n [wrSize]=\"resolvedSize()\"\n [rounded]=\"resolvedRounded()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n spellcheck=\"false\"\n [value]=\"text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\"\n />\n @if (suffix(); as s) {\n <span wrInputSuffix>{{ s }}</span>\n }\n @if (showSteppers()) {\n <div class=\"wr-input-number__steppers\" wrInputSuffix>\n <button\n type=\"button\"\n class=\"wr-input-number__step\"\n tabindex=\"-1\"\n aria-label=\"Increment\"\n [disabled]=\"!interactive() || atMax()\"\n (click)=\"stepBy(1)\"\n >\n <svg width=\"10\" height=\"6\" viewBox=\"0 0 8 5\" aria-hidden=\"true\">\n <path d=\"M0 5 L4 0 L8 5 Z\" fill=\"currentColor\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-input-number__step\"\n tabindex=\"-1\"\n aria-label=\"Decrement\"\n [disabled]=\"!interactive() || atMin()\"\n (click)=\"stepBy(-1)\"\n >\n <svg width=\"10\" height=\"6\" viewBox=\"0 0 8 5\" aria-hidden=\"true\">\n <path d=\"M0 0 L4 5 L8 0 Z\" fill=\"currentColor\" />\n </svg>\n </button>\n </div>\n }\n</wr-input-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AAqBH;AAEA;AACA,SAAS,iBAAiB,CAAC,MAAc,EAAA;AACvC,IAAA,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC;IAClE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,KAAK,IAAI,GAAG;IACnE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,EAAE,KAAK,IAAI,EAAE;AAC9D,IAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AAC3B;AAEA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;MAQU,aAAa,CA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,6GAAE,YAAY,EAAA,QAAA,EAAA,gBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,aAAa,EAAA,QAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,aAAa,EAAA,QAAA,EAAA,iBAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAElD,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,iBAEZ,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B,EAAE,SAAS,EAAE,WAAW,EAAE,EAAA,OAAA,EACvB,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,umDAAA,EAAA;;;AEjEhE;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-input-number.mjs","sources":["../../../projects/lib/input-number/input-number.ts","../../../projects/lib/input-number/input-number.html","../../../projects/lib/input-number/ngwr-input-number.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type BooleanInput, coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { useConfigValue } from 'ngwr/config';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrInput, WrInputGroup, WrInputPrefix, WrInputSuffix, type WrInputSize } from 'ngwr/input';\nimport { clamp, round } from 'ngwr/utils';\n\n/** Round to `decimals` places, avoiding common float artefacts (`1.005 → 1.01`). */\n\n/** Resolve the locale's decimal + grouping separators from `Intl.NumberFormat`. */\nfunction resolveSeparators(locale: string): { decimal: string; group: string } {\n const parts = new Intl.NumberFormat(locale).formatToParts(12345.6);\n const decimal = parts.find(p => p.type === 'decimal')?.value ?? '.';\n const group = parts.find(p => p.type === 'group')?.value ?? '';\n return { decimal, group };\n}\n\n/**\n * Numeric input with locale-aware formatting + ▲▼ stepper buttons.\n *\n * A signal-forms native control: it implements `FormValueControl<number | null>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone.\n *\n * Parses leniently while typing (allows partial input like `\"1.\"` or `\"-\"`),\n * re-formats with grouping + fixed decimals on blur.\n *\n * Locale comes from Angular's `LOCALE_ID` — input-number intentionally does\n * NOT depend on `ngwr/date-adapter` so it can be used in date-free apps.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-input-number [formField]=\"form.qty\" [min]=\"0\" [max]=\"100\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-input-number [(value)]=\"price\" [decimals]=\"2\" suffix=\"USD\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/input-number\n */\n@Component({\n selector: 'wr-input-number',\n templateUrl: './input-number.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()' },\n imports: [WrInput, WrInputGroup, WrInputPrefix, WrInputSuffix],\n})\nexport class WrInputNumber implements FormValueControl<number | null> {\n /** Minimum allowed value. @default -Infinity */\n readonly min = input<number | undefined>(Number.NEGATIVE_INFINITY, {\n transform: (v: unknown): number => coerceNumberProperty(v, Number.NEGATIVE_INFINITY),\n });\n\n /** Maximum allowed value. @default Infinity */\n readonly max = input<number | undefined>(Number.POSITIVE_INFINITY, {\n transform: (v: unknown): number => coerceNumberProperty(v, Number.POSITIVE_INFINITY),\n });\n\n private readonly minValue = computed(() => this.min() ?? Number.NEGATIVE_INFINITY);\n private readonly maxValue = computed(() => this.max() ?? Number.POSITIVE_INFINITY);\n\n /** Step used by stepper buttons + arrow keys. @default 1 */\n readonly step = input(1, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 1)) });\n\n /** Fixed number of decimals shown on blur. `null` keeps the entered precision. @default null */\n readonly decimals = input<number | null>(null);\n\n /** Render the ▲▼ stepper column. @default true */\n readonly showSteppers = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Control size — forwarded to the field, and shares the `--wr-control-*`\n * contract. Unset falls back to the `inputNumber.size` app default from\n * `provideWrConfig()`, then to the `input.size` one, then to `md`. @default 'md'\n */\n readonly size = input<WrInputSize | null>(null);\n\n /**\n * Pill-shaped corners. Unset falls back to the `inputNumber.rounded` app default\n * from `provideWrConfig()`, then to the `input.rounded` one;\n * `[rounded]=\"false\"` turns a configured `true` back off. @default false\n */\n readonly rounded = input<boolean | null, BooleanInput>(null, {\n // Null-preserving: the plain `coerceBooleanProperty` folds `null` into\n // `false`, which would make \"not set\" and \"set to false\" the same value —\n // and a config default nothing could ever supply.\n transform: (v: BooleanInput): boolean | null => (v == null ? null : coerceBooleanProperty(v)),\n });\n\n /**\n * `size`, then the app config, then `md` — bound to the field's `[wrSize]`.\n *\n * The chrome this control is built from resolves the same pair for itself, so\n * the config lookup falls through to `input.*` rather than stopping at\n * `inputNumber.*`: binding a value down always wins there, and an unchained\n * lookup would therefore SUPPRESS an `input.size` an app had set — the field\n * inside a number input would be the one `[wrInput]` in the app that ignored it.\n * Chained, the specific key wins where it is set and the general one still\n * applies where it is not.\n */\n protected readonly resolvedSize = useConfigValue(this.size, c => c.inputNumber?.size ?? c.input?.size, 'md');\n\n /** `rounded`, then the app config, then `false` — bound to the group AND the field. */\n protected readonly resolvedRounded = useConfigValue(\n this.rounded,\n c => c.inputNumber?.rounded ?? c.input?.rounded,\n false\n );\n\n /** Optional prefix label (e.g. `\"$\"`). */\n readonly prefix = input<string>('');\n\n /** Optional suffix label (e.g. `\"kg\"`). */\n readonly suffix = input<string>('');\n\n /** Placeholder shown when the input is empty. */\n readonly placeholder = input<string>('');\n\n /**\n * Accessible name for the field. Falls back to the placeholder — inside a\n * `<wr-form-field>` the projected `wrInput` picks up the label's id and needs\n * neither, but standalone the text field has no name at all.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = computed(() => {\n // Not `??`: an empty placeholder is no name at all, so it must fall through.\n const explicit = this.ariaLabel();\n if (explicit) return explicit;\n const placeholder = this.placeholder();\n return placeholder ? placeholder : null;\n });\n\n /** Increment button aria-label. Falls back to `inputNumber.increment`. */\n readonly incrementLabel = input<string | null>(null);\n\n /** Decrement button aria-label. Falls back to `inputNumber.decrement`. */\n readonly decrementLabel = input<string | null>(null);\n\n /**\n * The steppers are icon-only buttons, so these ARE their accessible names.\n * They were hard-coded English while the catalog carried the keys for them\n * unread — a Russian app announced \"Increment\".\n */\n protected readonly resolvedIncrement = useI18nText(this.incrementLabel, 'inputNumber.increment', 'Increment');\n protected readonly resolvedDecrement = useI18nText(this.decrementLabel, 'inputNumber.decrement', 'Decrement');\n\n /** Disable interaction. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Read-only — values cannot be changed (steppers + typing disabled). @default false */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n\n /** Numeric value (`null` when empty). Bound by `[formField]`, or two-way via `[(value)]`. */\n readonly value = model<number | null>(null);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n private readonly locale = inject(LOCALE_ID);\n private readonly separators = resolveSeparators(this.locale);\n\n /** Text currently in the input (may be partial / invalid mid-type). */\n protected readonly text = signal<string>('');\n\n /** Whether the input is focused. While true, the input handlers own `text`. */\n protected readonly focused = signal(false);\n\n protected readonly interactive = computed(() => !this.disabled() && !this.readonly());\n\n protected readonly atMin = computed(() => {\n const v = this.value();\n return v !== null && v <= this.minValue();\n });\n\n protected readonly atMax = computed(() => {\n const v = this.value();\n return v !== null && v >= this.maxValue();\n });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-input-number'];\n if (this.disabled()) parts.push('wr-input-number--disabled');\n return parts.join(' ');\n });\n\n /**\n * Fraction digits the stepper rounds its arithmetic to when `decimals` says\n * nothing. High enough to leave a real value alone, low enough to erase the\n * binary-float tail that repeated stepping accumulates.\n */\n private static readonly STEP_PRECISION = 10;\n\n /**\n * Above this, the anti-drift round is skipped — it would MANUFACTURE drift.\n *\n * `round(v, 10)` is `Math.round((v + EPSILON) * 1e10) / 1e10`, and the scale\n * factor is only exact while `v * 1e10` stays inside 2^53, i.e. |v| under\n * about 900,720. In practice the round-trip still recovers up to ~9.2e8 and\n * then breaks: `round(1000000001, 10)` is `1000000000.9999999`, and since\n * `format` prints up to 20 fraction digits that tail reaches the screen —\n * and compounds, because the next press starts from it. Integer stepping at\n * that magnitude is exact in IEEE754 and needed no help; the only thing this\n * rounding exists to defend is `0.1 + 0.1 + 0.1`.\n */\n private static readonly SAFE_ROUND_MAGNITUDE = 1e6;\n\n /** Steps finer than this would be rounded away by {@link STEP_PRECISION}. */\n private static readonly SAFE_ROUND_STEP = 1e-9;\n\n constructor() {\n // Keep the display `text` in sync with external writes to `value` (via\n // `[formField]` / `[(value)]`). While the user is editing, the input\n // handlers own `text`, so skip re-formatting to avoid clobbering partial\n // input (e.g. mid-typed grouping or a value that is still being clamped).\n effect(() => {\n const v = this.value();\n if (this.focused()) return;\n if (v === null || Number.isNaN(v)) {\n this.text.set('');\n return;\n }\n // SHOW WHAT THE MODEL HOLDS. It used to format `constrain(v)`, so a\n // `[max]=\"10\"` field handed 500 drew \"10\" over a model that still said\n // 500 — the display was the thing lying, not the model.\n //\n // The tempting repair is to write the clamp back so the two agree, and\n // that is worse: under `[formField]` the bounds arrive ONLY through the\n // schema's `min()` / `max()` rules (binding `[min]` next to `[formField]`\n // is an NG8022 compile error), so overwriting the value ERASES the very\n // error those rules exist to raise — and the write marks a pristine form\n // dirty, tripping unsaved-changes guards and opening every other\n // validator's message on first paint.\n //\n // So: `min` / `max` bound what this component's own edits may produce,\n // and a value written from outside is displayed as it is and left for\n // validation to judge.\n this.text.set(this.format(v));\n });\n }\n\n // Template handlers\n\n protected onInput(event: Event): void {\n const raw = (event.target as HTMLInputElement).value;\n this.text.set(raw);\n if (!raw.trim()) {\n this.value.set(null);\n return;\n }\n const parsed = this.parse(raw);\n if (parsed === null) return; // partial input — wait for more\n const next = this.constrain(parsed);\n this.value.set(next);\n }\n\n protected onFocus(): void {\n this.focused.set(true);\n }\n\n protected onBlur(): void {\n // Flipping `focused` false lets the sync effect re-format `text` from the\n // committed `value` (e.g. `\"1.\"` → `\"1\"`, or grouping the final number).\n this.focused.set(false);\n this.touch.emit();\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (!this.interactive()) return;\n if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') return;\n event.preventDefault();\n const direction = event.key === 'ArrowUp' ? 1 : -1;\n const multiplier = event.shiftKey ? 10 : 1;\n this.bump(direction * multiplier);\n }\n\n protected stepBy(direction: 1 | -1): void {\n if (!this.interactive()) return;\n this.bump(direction);\n }\n\n // Internals\n\n private bump(units: number): void {\n const stepSize = this.step() || 1;\n const base = this.value() ?? this.fallbackBase();\n // `round` before `constrain`, and only on the stepped ARITHMETIC. Binary\n // floats do not add: three presses of a `step=\"0.1\"` stepper produced\n // 0.30000000000000004, `constrain` only rounds when `decimals` is set, and\n // `format` prints up to 20 fraction digits — so the drift went into the\n // model AND onto the screen. Ten digits erases IEEE noise without\n // quantising a value the user typed (0.15000000000000002 stays 0.15, it\n // does not snap to the step grid).\n //\n // Guarded on BOTH ends, because outside them the correction is the thing\n // that corrupts: see SAFE_ROUND_MAGNITUDE, and a step finer than 1e-9 would\n // simply be rounded away to nothing.\n const raw = base + units * stepSize;\n const correctable =\n Math.abs(raw) < WrInputNumber.SAFE_ROUND_MAGNITUDE && Math.abs(stepSize) >= WrInputNumber.SAFE_ROUND_STEP;\n const next = this.constrain(correctable ? round(raw, WrInputNumber.STEP_PRECISION) : raw);\n this.value.set(next);\n this.text.set(this.format(next));\n }\n\n /** Choose a sensible starting point when bumping from `null`. */\n private fallbackBase(): number {\n if (Number.isFinite(this.minValue()) && this.minValue() > 0) return this.minValue();\n if (Number.isFinite(this.maxValue()) && this.maxValue() < 0) return this.maxValue();\n return 0;\n }\n\n private constrain(v: number): number {\n let next = clamp(v, this.minValue(), this.maxValue());\n const d = this.decimals();\n if (d !== null) next = round(next, d);\n return next;\n }\n\n /** Parse a locale-formatted string. Returns `null` for partial / not-yet-numeric input. */\n private parse(raw: string): number | null {\n const trimmed = raw.trim();\n if (!trimmed) return null;\n // Strip group separators, normalise the decimal separator to `.`.\n let normalised = trimmed;\n if (this.separators.group) {\n normalised = normalised.split(this.separators.group).join('');\n }\n if (this.separators.decimal !== '.') {\n normalised = normalised.split(this.separators.decimal).join('.');\n }\n // Partial inputs we don't want to clobber while the user is still typing:\n // `-`, `-.`, `.`, `1.`, `-1.` etc.\n if (/^-?\\.?$/.test(normalised) || normalised.endsWith('.')) return null;\n const n = Number(normalised);\n return Number.isFinite(n) ? n : null;\n }\n\n /** Format a value using `Intl.NumberFormat` for the active locale. */\n private format(v: number): string {\n const d = this.decimals();\n const formatter = new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: d ?? 0,\n maximumFractionDigits: d ?? 20,\n useGrouping: true,\n });\n return formatter.format(v);\n }\n}\n","<wr-input-group [rounded]=\"resolvedRounded()\">\n @if (prefix(); as p) {\n <span wrInputPrefix>{{ p }}</span>\n }\n <input\n #input\n wrInput\n type=\"text\"\n inputmode=\"decimal\"\n autocomplete=\"off\"\n [wrSize]=\"resolvedSize()\"\n [rounded]=\"resolvedRounded()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n spellcheck=\"false\"\n [value]=\"text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onInput($event)\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeydown($event)\"\n />\n @if (suffix(); as s) {\n <span wrInputSuffix>{{ s }}</span>\n }\n @if (showSteppers()) {\n <div class=\"wr-input-number__steppers\" wrInputSuffix>\n <button\n type=\"button\"\n class=\"wr-input-number__step\"\n tabindex=\"-1\"\n [attr.aria-label]=\"resolvedIncrement()\"\n [disabled]=\"!interactive() || atMax()\"\n (click)=\"stepBy(1)\"\n >\n <svg width=\"10\" height=\"6\" viewBox=\"0 0 8 5\" aria-hidden=\"true\">\n <path d=\"M0 5 L4 0 L8 5 Z\" fill=\"currentColor\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-input-number__step\"\n tabindex=\"-1\"\n [attr.aria-label]=\"resolvedDecrement()\"\n [disabled]=\"!interactive() || atMin()\"\n (click)=\"stepBy(-1)\"\n >\n <svg width=\"10\" height=\"6\" viewBox=\"0 0 8 5\" aria-hidden=\"true\">\n <path d=\"M0 0 L4 5 L8 0 Z\" fill=\"currentColor\" />\n </svg>\n </button>\n </div>\n }\n</wr-input-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAsBH;AAEA;AACA,SAAS,iBAAiB,CAAC,MAAc,EAAA;AACvC,IAAA,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC;IAClE,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,KAAK,IAAI,GAAG;IACnE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,EAAE,KAAK,IAAI,EAAE;AAC9D,IAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AAC3B;AAEA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;MAQU,aAAa,CAAA;;IAEf,GAAG,GAAG,KAAK,CAAqB,MAAM,CAAC,iBAAiB,EAAA,E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,EAAA,iBAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAElD,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,iBAEZ,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B,EAAE,SAAS,EAAE,WAAW,EAAE,EAAA,OAAA,EACvB,CAAC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,CAAC,EAAA,QAAA,EAAA,yoDAAA,EAAA;;;AElEhE;;AAEG;;;;"}
@@ -0,0 +1,220 @@
1
+ import { TestKey, ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
2
+
3
+ /**
4
+ * @license
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
8
+ */
9
+ const ARROWS = {
10
+ left: TestKey.LEFT_ARROW,
11
+ right: TestKey.RIGHT_ARROW,
12
+ up: TestKey.UP_ARROW,
13
+ down: TestKey.DOWN_ARROW,
14
+ };
15
+ /** Enough presses to cross any sane range; a stall throws long before this. */
16
+ const WALK_LIMIT = 400;
17
+ /**
18
+ * Test harness for `<wr-knob>` — the radial dial.
19
+ *
20
+ * **Driven by the keyboard, and the drag is not merely unsupported.** Turning the
21
+ * dial with a pointer takes `getBoundingClientRect()`, measures the angle from the
22
+ * centre to the cursor, and maps it onto a 270° arc. jsdom lays nothing out, so the
23
+ * centre is `(0, 0)` and every synthetic gesture writes the same corner of the arc
24
+ * whatever coordinates it is given — a `turnTo()` built on one would pass while
25
+ * proving nothing. The arrows reach every value on the grid and are the accessible
26
+ * path anyway.
27
+ *
28
+ * **Two questions about the value, not one.** {@link getValue} is the number
29
+ * `aria-valuenow` carries; {@link getDisplayValue} is the string in the middle of the
30
+ * dial, which the `suffix` input can make `"50%"` while the announced value stays
31
+ * `50`. They are separate methods because they can disagree, and because
32
+ * `showValue` can remove the text entirely without touching the value.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const knob = await loader.getHarness(WrKnobHarness);
37
+ *
38
+ * await knob.setValue(60);
39
+ * expect(await knob.getValue()).toBe(60);
40
+ * expect(await knob.getDisplayValue()).toBe('60%');
41
+ * ```
42
+ *
43
+ * @see https://ngwr.dev/guides/testing
44
+ */
45
+ class WrKnobHarness extends ComponentHarness {
46
+ static hostSelector = 'wr-knob';
47
+ /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
48
+ static with(options = {}) {
49
+ return new HarnessPredicate(WrKnobHarness, options)
50
+ .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))
51
+ .addOption('value', options.value, async (harness, value) => (await harness.getValue()) === value)
52
+ .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)
53
+ .addOption('readonly', options.readonly, async (harness, readonly) => (await harness.isReadonly()) === readonly);
54
+ }
55
+ surface = this.locatorFor('.wr-knob__surface');
56
+ /** The value the dial announces, from `aria-valuenow`. */
57
+ async getValue() {
58
+ return this.numeric('aria-valuenow');
59
+ }
60
+ /** The bottom of the range, from `aria-valuemin`. */
61
+ async getMin() {
62
+ return this.numeric('aria-valuemin');
63
+ }
64
+ /** The top of the range, from `aria-valuemax`. */
65
+ async getMax() {
66
+ return this.numeric('aria-valuemax');
67
+ }
68
+ /**
69
+ * The text printed in the middle of the dial, suffix included, or `null` when the
70
+ * knob was built with `[showValue]="false"`.
71
+ *
72
+ * Not the same question as {@link getValue}: with a `suffix` the two disagree by
73
+ * design, and a screen reader is told the bare number — the component publishes no
74
+ * `aria-valuetext`, so `50` is what gets announced for a dial that reads `50%`.
75
+ */
76
+ async getDisplayValue() {
77
+ const text = await this.locatorForOptional('.wr-knob__text')();
78
+ return text ? text.text() : null;
79
+ }
80
+ /** The suffix alone, or `null` when there is none (or no value text at all). */
81
+ async getSuffix() {
82
+ const suffix = await this.locatorForOptional('.wr-knob__suffix')();
83
+ if (!suffix)
84
+ return null;
85
+ const text = await suffix.text();
86
+ return text === '' ? null : text;
87
+ }
88
+ /** The dial's accessible name — `role="slider"` needs one. */
89
+ async getLabel() {
90
+ return (await this.surface()).getAttribute('aria-label');
91
+ }
92
+ /** Whether the dial is disabled, from `aria-disabled`. */
93
+ async isDisabled() {
94
+ return (await (await this.surface()).getAttribute('aria-disabled')) === 'true';
95
+ }
96
+ /** Whether the dial is read-only, from `aria-readonly`. */
97
+ async isReadonly() {
98
+ return (await (await this.surface()).getAttribute('aria-readonly')) === 'true';
99
+ }
100
+ /**
101
+ * Whether the dial is a tab stop.
102
+ *
103
+ * The component drops it out of the tab order for BOTH disabled and read-only,
104
+ * which is worth knowing: a read-only slider that a keyboard user cannot reach is
105
+ * also one they cannot read, and this is the method that says so.
106
+ */
107
+ async isFocusable() {
108
+ return (await (await this.surface()).getAttribute('tabindex')) === '0';
109
+ }
110
+ /** Move keyboard focus to the dial. */
111
+ async focus() {
112
+ return (await this.surface()).focus();
113
+ }
114
+ /** Whether the dial currently holds focus. */
115
+ async isFocused() {
116
+ return (await this.surface()).isFocused();
117
+ }
118
+ /** Blur the dial — which is what emits `touch` for a knob moved with the keyboard. */
119
+ async blur() {
120
+ return (await this.surface()).blur();
121
+ }
122
+ /**
123
+ * Press one arrow key.
124
+ *
125
+ * Right and Up raise the value, Left and Down lower it — all four are live on this
126
+ * component, which has one axis and no mirroring to do. `shift` multiplies the step
127
+ * by ten.
128
+ */
129
+ async pressArrow(arrow, options = {}) {
130
+ const surface = await this.surface();
131
+ await (options.shift ? surface.sendKeys({ shift: true }, ARROWS[arrow]) : surface.sendKeys(ARROWS[arrow]));
132
+ }
133
+ /** Press Home — the bottom of the range. */
134
+ async pressHome() {
135
+ return (await this.surface()).sendKeys(TestKey.HOME);
136
+ }
137
+ /**
138
+ * Press End — the top of the range, or the last value ON the grid below it: a range
139
+ * that is not a whole number of steps cannot reach its own maximum.
140
+ */
141
+ async pressEnd() {
142
+ return (await this.surface()).sendKeys(TestKey.END);
143
+ }
144
+ /**
145
+ * Walk the dial to a value with the arrow keys, and assert it landed there.
146
+ *
147
+ * It measures the step as it goes rather than being told it — `step` is an input
148
+ * with no DOM presence, and the value can arrive off the grid, since an external
149
+ * write is clamped but never snapped. So the first press may move by less than a
150
+ * step (it snaps onto the grid) and the walk adapts, which also means the ten-step
151
+ * hops only start once a real step has been seen.
152
+ *
153
+ * Throws rather than half-arriving, and the two reasons read differently: a target
154
+ * outside `[min, max]` is refused before anything moves, while a target BETWEEN two
155
+ * grid points is only discovered by overshooting it, and says where it landed. A
156
+ * dial that will not move at all — disabled, read-only — is the third.
157
+ */
158
+ async setValue(target) {
159
+ const [min, max] = [await this.getMin(), await this.getMax()];
160
+ if (target < min || target > max) {
161
+ throw new Error(`WrKnobHarness.setValue(${target}): out of range — this dial accepts ${min}–${max}. The component ` +
162
+ 'clamps, so the walk would stop at the bound and never reach the number asked for.');
163
+ }
164
+ if (target === min)
165
+ return this.pressHome();
166
+ if (target === max)
167
+ return this.pressEnd();
168
+ await this.focus();
169
+ let step = null;
170
+ for (let guard = 0; guard < WALK_LIMIT; guard++) {
171
+ const current = await this.getValue();
172
+ if (current === target)
173
+ return;
174
+ const forward = target > current;
175
+ const coarse = step !== null && Math.abs(target - current) >= step * 10;
176
+ await this.pressArrow(forward ? 'right' : 'left', { shift: coarse });
177
+ const now = await this.getValue();
178
+ if (now === current) {
179
+ throw new Error(`WrKnobHarness.setValue(${target}): the dial stopped moving at ${now}. A disabled or read-only ` +
180
+ 'knob ignores its arrows, which is the usual reason.');
181
+ }
182
+ if (!coarse)
183
+ step = Math.abs(now - current);
184
+ if (now === target)
185
+ return;
186
+ if (forward ? now > target : now < target) {
187
+ throw new Error(`WrKnobHarness.setValue(${target}): the walk stepped from ${current} to ${now}, straight past the ` +
188
+ 'target — it is not on the step grid, which the component measures from `min` rather than from zero.');
189
+ }
190
+ }
191
+ throw new Error(`WrKnobHarness.setValue(${target}): gave up after ${WALK_LIMIT} presses at ${await this.getValue()}.`);
192
+ }
193
+ /**
194
+ * Where the handle dot sits, in the SVG's own 100×100 viewBox units.
195
+ *
196
+ * The dial's whole visual state is an arc path and this dot, and neither can be
197
+ * measured in a unit test — but the dot's centre is written as plain `cx` / `cy`
198
+ * attributes, so it reads with no layout at all. That makes it the evidence that
199
+ * the drawing followed the value: at `min` the handle is at the 7 o'clock end of
200
+ * the arc, at `max` the 5 o'clock end.
201
+ */
202
+ async getHandlePosition() {
203
+ const handle = await this.locatorFor('.wr-knob__handle')();
204
+ return {
205
+ x: Number(await handle.getAttribute('cx')),
206
+ y: Number(await handle.getAttribute('cy')),
207
+ };
208
+ }
209
+ async numeric(attribute) {
210
+ const raw = await (await this.surface()).getAttribute(attribute);
211
+ return raw === null ? Number.NaN : Number(raw);
212
+ }
213
+ }
214
+
215
+ /**
216
+ * Generated bundle index. Do not edit.
217
+ */
218
+
219
+ export { WrKnobHarness };
220
+ //# sourceMappingURL=ngwr-knob-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-knob-testing.mjs","sources":["../../../projects/lib/knob/testing/wr-knob-harness.ts","../../../projects/lib/knob/testing/ngwr-knob-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrKnobHarnessFilters } from './interfaces';\n\n/** The two arrow keys that raise the value, and the two that lower it. */\ntype Arrow = 'left' | 'right' | 'up' | 'down';\n\nconst ARROWS: Record<Arrow, TestKey> = {\n left: TestKey.LEFT_ARROW,\n right: TestKey.RIGHT_ARROW,\n up: TestKey.UP_ARROW,\n down: TestKey.DOWN_ARROW,\n};\n\n/** Enough presses to cross any sane range; a stall throws long before this. */\nconst WALK_LIMIT = 400;\n\n/**\n * Test harness for `<wr-knob>` — the radial dial.\n *\n * **Driven by the keyboard, and the drag is not merely unsupported.** Turning the\n * dial with a pointer takes `getBoundingClientRect()`, measures the angle from the\n * centre to the cursor, and maps it onto a 270° arc. jsdom lays nothing out, so the\n * centre is `(0, 0)` and every synthetic gesture writes the same corner of the arc\n * whatever coordinates it is given — a `turnTo()` built on one would pass while\n * proving nothing. The arrows reach every value on the grid and are the accessible\n * path anyway.\n *\n * **Two questions about the value, not one.** {@link getValue} is the number\n * `aria-valuenow` carries; {@link getDisplayValue} is the string in the middle of the\n * dial, which the `suffix` input can make `\"50%\"` while the announced value stays\n * `50`. They are separate methods because they can disagree, and because\n * `showValue` can remove the text entirely without touching the value.\n *\n * @example\n * ```ts\n * const knob = await loader.getHarness(WrKnobHarness);\n *\n * await knob.setValue(60);\n * expect(await knob.getValue()).toBe(60);\n * expect(await knob.getDisplayValue()).toBe('60%');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrKnobHarness extends ComponentHarness {\n static hostSelector = 'wr-knob';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrKnobHarnessFilters = {}): HarnessPredicate<WrKnobHarness> {\n return new HarnessPredicate(WrKnobHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('value', options.value, async (harness, value) => (await harness.getValue()) === value)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption('readonly', options.readonly, async (harness, readonly) => (await harness.isReadonly()) === readonly);\n }\n\n private readonly surface = this.locatorFor('.wr-knob__surface');\n\n /** The value the dial announces, from `aria-valuenow`. */\n async getValue(): Promise<number> {\n return this.numeric('aria-valuenow');\n }\n\n /** The bottom of the range, from `aria-valuemin`. */\n async getMin(): Promise<number> {\n return this.numeric('aria-valuemin');\n }\n\n /** The top of the range, from `aria-valuemax`. */\n async getMax(): Promise<number> {\n return this.numeric('aria-valuemax');\n }\n\n /**\n * The text printed in the middle of the dial, suffix included, or `null` when the\n * knob was built with `[showValue]=\"false\"`.\n *\n * Not the same question as {@link getValue}: with a `suffix` the two disagree by\n * design, and a screen reader is told the bare number — the component publishes no\n * `aria-valuetext`, so `50` is what gets announced for a dial that reads `50%`.\n */\n async getDisplayValue(): Promise<string | null> {\n const text = await this.locatorForOptional('.wr-knob__text')();\n return text ? text.text() : null;\n }\n\n /** The suffix alone, or `null` when there is none (or no value text at all). */\n async getSuffix(): Promise<string | null> {\n const suffix = await this.locatorForOptional('.wr-knob__suffix')();\n if (!suffix) return null;\n const text = await suffix.text();\n return text === '' ? null : text;\n }\n\n /** The dial's accessible name — `role=\"slider\"` needs one. */\n async getLabel(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-label');\n }\n\n /** Whether the dial is disabled, from `aria-disabled`. */\n async isDisabled(): Promise<boolean> {\n return (await (await this.surface()).getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the dial is read-only, from `aria-readonly`. */\n async isReadonly(): Promise<boolean> {\n return (await (await this.surface()).getAttribute('aria-readonly')) === 'true';\n }\n\n /**\n * Whether the dial is a tab stop.\n *\n * The component drops it out of the tab order for BOTH disabled and read-only,\n * which is worth knowing: a read-only slider that a keyboard user cannot reach is\n * also one they cannot read, and this is the method that says so.\n */\n async isFocusable(): Promise<boolean> {\n return (await (await this.surface()).getAttribute('tabindex')) === '0';\n }\n\n /** Move keyboard focus to the dial. */\n async focus(): Promise<void> {\n return (await this.surface()).focus();\n }\n\n /** Whether the dial currently holds focus. */\n async isFocused(): Promise<boolean> {\n return (await this.surface()).isFocused();\n }\n\n /** Blur the dial — which is what emits `touch` for a knob moved with the keyboard. */\n async blur(): Promise<void> {\n return (await this.surface()).blur();\n }\n\n /**\n * Press one arrow key.\n *\n * Right and Up raise the value, Left and Down lower it — all four are live on this\n * component, which has one axis and no mirroring to do. `shift` multiplies the step\n * by ten.\n */\n async pressArrow(arrow: Arrow, options: { shift?: boolean } = {}): Promise<void> {\n const surface = await this.surface();\n await (options.shift ? surface.sendKeys({ shift: true }, ARROWS[arrow]) : surface.sendKeys(ARROWS[arrow]));\n }\n\n /** Press Home — the bottom of the range. */\n async pressHome(): Promise<void> {\n return (await this.surface()).sendKeys(TestKey.HOME);\n }\n\n /**\n * Press End — the top of the range, or the last value ON the grid below it: a range\n * that is not a whole number of steps cannot reach its own maximum.\n */\n async pressEnd(): Promise<void> {\n return (await this.surface()).sendKeys(TestKey.END);\n }\n\n /**\n * Walk the dial to a value with the arrow keys, and assert it landed there.\n *\n * It measures the step as it goes rather than being told it — `step` is an input\n * with no DOM presence, and the value can arrive off the grid, since an external\n * write is clamped but never snapped. So the first press may move by less than a\n * step (it snaps onto the grid) and the walk adapts, which also means the ten-step\n * hops only start once a real step has been seen.\n *\n * Throws rather than half-arriving, and the two reasons read differently: a target\n * outside `[min, max]` is refused before anything moves, while a target BETWEEN two\n * grid points is only discovered by overshooting it, and says where it landed. A\n * dial that will not move at all — disabled, read-only — is the third.\n */\n async setValue(target: number): Promise<void> {\n const [min, max] = [await this.getMin(), await this.getMax()];\n if (target < min || target > max) {\n throw new Error(\n `WrKnobHarness.setValue(${target}): out of range — this dial accepts ${min}–${max}. The component ` +\n 'clamps, so the walk would stop at the bound and never reach the number asked for.'\n );\n }\n\n if (target === min) return this.pressHome();\n if (target === max) return this.pressEnd();\n\n await this.focus();\n let step: number | null = null;\n\n for (let guard = 0; guard < WALK_LIMIT; guard++) {\n const current = await this.getValue();\n if (current === target) return;\n\n const forward = target > current;\n const coarse = step !== null && Math.abs(target - current) >= step * 10;\n\n await this.pressArrow(forward ? 'right' : 'left', { shift: coarse });\n const now = await this.getValue();\n\n if (now === current) {\n throw new Error(\n `WrKnobHarness.setValue(${target}): the dial stopped moving at ${now}. A disabled or read-only ` +\n 'knob ignores its arrows, which is the usual reason.'\n );\n }\n if (!coarse) step = Math.abs(now - current);\n if (now === target) return;\n\n if (forward ? now > target : now < target) {\n throw new Error(\n `WrKnobHarness.setValue(${target}): the walk stepped from ${current} to ${now}, straight past the ` +\n 'target — it is not on the step grid, which the component measures from `min` rather than from zero.'\n );\n }\n }\n\n throw new Error(\n `WrKnobHarness.setValue(${target}): gave up after ${WALK_LIMIT} presses at ${await this.getValue()}.`\n );\n }\n\n /**\n * Where the handle dot sits, in the SVG's own 100×100 viewBox units.\n *\n * The dial's whole visual state is an arc path and this dot, and neither can be\n * measured in a unit test — but the dot's centre is written as plain `cx` / `cy`\n * attributes, so it reads with no layout at all. That makes it the evidence that\n * the drawing followed the value: at `min` the handle is at the 7 o'clock end of\n * the arc, at `max` the 5 o'clock end.\n */\n async getHandlePosition(): Promise<{ x: number; y: number }> {\n const handle = await this.locatorFor('.wr-knob__handle')();\n return {\n x: Number(await handle.getAttribute('cx')),\n y: Number(await handle.getAttribute('cy')),\n };\n }\n\n private async numeric(attribute: string): Promise<number> {\n const raw = await (await this.surface()).getAttribute(attribute);\n return raw === null ? Number.NaN : Number(raw);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AASH,MAAM,MAAM,GAA2B;IACrC,IAAI,EAAE,OAAO,CAAC,UAAU;IACxB,KAAK,EAAE,OAAO,CAAC,WAAW;IAC1B,EAAE,EAAE,OAAO,CAAC,QAAQ;IACpB,IAAI,EAAE,OAAO,CAAC,UAAU;CACzB;AAED;AACA,MAAM,UAAU,GAAG,GAAG;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACG,MAAO,aAAc,SAAQ,gBAAgB,CAAA;AACjD,IAAA,OAAO,YAAY,GAAG,SAAS;;AAG/B,IAAA,OAAO,IAAI,CAAC,OAAA,GAAgC,EAAE,EAAA;AAC5C,QAAA,OAAO,IAAI,gBAAgB,CAAC,aAAa,EAAE,OAAO;aAC/C,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAA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,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAC3C;IACH;IAEQ,MAAM,OAAO,CAAC,SAAiB,EAAA;AACrC,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,SAAS,CAAC;AAChE,QAAA,OAAO,GAAG,KAAK,IAAI,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IAChD;;;ACzPF;;AAEG;;;;"}
@@ -0,0 +1,223 @@
1
+ import { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
2
+
3
+ /**
4
+ * @license
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
8
+ */
9
+ /**
10
+ * Test harness for `<wr-lightbox>` — the thumbnail, and the full-size viewer it
11
+ * opens.
12
+ *
13
+ * The thumbnail is an element in your fixture and the viewer is a portal in the NGWR
14
+ * overlay container, so this is loaded from the normal fixture loader and reaches
15
+ * across for you — scoped by the id the trigger publishes as `aria-controls`, never
16
+ * by `.wr-lightbox-viewer`, which would answer with whichever lightbox opened first.
17
+ *
18
+ * **A closed lightbox has no viewer at all**, unlike the collapse or the speed dial:
19
+ * the overlay is created on open and disposed on close, so every viewer read here
20
+ * throws while it is shut rather than answering about a stale element.
21
+ *
22
+ * **`disablePreview` removes the button, not just its behaviour.** The thumbnail is
23
+ * then a bare `<img>` with nothing to click and nothing in the tab order, which is
24
+ * why {@link isInteractive} exists and why {@link open} explains itself rather than
25
+ * timing out on a missing element.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const lightbox = await loader.getHarness(WrLightboxHarness.with({ alt: 'Mountain' }));
30
+ *
31
+ * await lightbox.open();
32
+ * expect(await lightbox.getFullSrc()).toBe('/photo.jpg');
33
+ *
34
+ * await lightbox.sendEscape();
35
+ * expect(await lightbox.isOpen()).toBe(false);
36
+ * ```
37
+ *
38
+ * @see https://ngwr.dev/guides/testing
39
+ */
40
+ class WrLightboxHarness extends ComponentHarness {
41
+ static hostSelector = 'wr-lightbox';
42
+ /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */
43
+ static with(options = {}) {
44
+ return new HarnessPredicate(WrLightboxHarness, options)
45
+ .addOption('alt', options.alt, (harness, alt) => HarnessPredicate.stringMatches(harness.getAlt(), alt))
46
+ .addOption('caption', options.caption, (harness, caption) => HarnessPredicate.stringMatches(harness.readCaption(), caption))
47
+ .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);
48
+ }
49
+ thumb = this.locatorFor('.wr-lightbox__thumb');
50
+ trigger = this.locatorForOptional('.wr-lightbox__trigger');
51
+ /**
52
+ * Whether the viewer is open, from the host's own modifier.
53
+ *
54
+ * The class rather than the overlay, because it is the answer that holds for a
55
+ * harness you are HOLDING: the viewer is disposed on close, and a query for it
56
+ * cannot tell "shut" apart from "never opened".
57
+ */
58
+ async isOpen() {
59
+ return (await this.host()).hasClass('wr-lightbox--open');
60
+ }
61
+ /**
62
+ * Whether the thumbnail has settled — loaded OR failed.
63
+ *
64
+ * A failure counts on purpose: the loading state animates a shimmer and hides the
65
+ * image, so a broken `src` with no error path would shimmer for ever instead of
66
+ * falling back to its alt text. The two cases are deliberately not separated here,
67
+ * because the DOM does not separate them either.
68
+ */
69
+ async isLoading() {
70
+ return (await this.host()).hasClass('wr-lightbox--loading');
71
+ }
72
+ /** The thumbnail's alt text — the same string the viewer takes its name from. */
73
+ async getAlt() {
74
+ return (await this.thumb()).getProperty('alt');
75
+ }
76
+ /**
77
+ * What the THUMBNAIL is showing: `preview` when one was given, `src` otherwise.
78
+ *
79
+ * Worth its own method because the two images are different files by design — a
80
+ * grid of thumbnails should not pull full-size originals — and because the
81
+ * thumbnail never swaps to `src` later. Compare with {@link getFullSrc}.
82
+ */
83
+ async getThumbSrc() {
84
+ return (await this.thumb()).getProperty('src');
85
+ }
86
+ /** Whether the thumbnail can be clicked open at all (`disablePreview` off). */
87
+ async isInteractive() {
88
+ return (await this.trigger()) !== null;
89
+ }
90
+ /** The trigger's accessible name — falls back to the alt text, then to the catalog. */
91
+ async getOpenLabel() {
92
+ const trigger = await this.trigger();
93
+ return trigger ? trigger.getAttribute('aria-label') : null;
94
+ }
95
+ /** Open the viewer. An already-open one is left alone; a non-interactive one throws. */
96
+ async open() {
97
+ if (await this.isOpen())
98
+ return;
99
+ const trigger = await this.trigger();
100
+ if (!trigger) {
101
+ throw new Error('WrLightboxHarness.open(): this lightbox has `disablePreview` set, so there is no trigger — the ' +
102
+ 'thumbnail renders as a bare <img> with nothing to click and nothing in the tab order.');
103
+ }
104
+ await trigger.click();
105
+ }
106
+ /** Close the viewer through its ✕ button. An already-closed one is left alone. */
107
+ async close() {
108
+ if (!(await this.isOpen()))
109
+ return;
110
+ await (await this.viewerPart('.wr-lightbox-viewer__close', 'close')).click();
111
+ }
112
+ /**
113
+ * Click the full image — which closes the viewer.
114
+ *
115
+ * It looks like decoration and is not: the image is styled `cursor: zoom-out`, and
116
+ * that is a promise. It is deliberately NOT in the tab order, since the ✕ button,
117
+ * Escape, the backdrop and a swipe all do the same thing and all reach a keyboard —
118
+ * so this is a mouse affordance, and the only way to assert it still works.
119
+ */
120
+ async clickImage() {
121
+ await (await this.viewerPart('.wr-lightbox-viewer__full', 'clickImage')).click();
122
+ }
123
+ /**
124
+ * Press Escape.
125
+ *
126
+ * Sent to the viewer, though it would arrive from anywhere: the overlay is fed by
127
+ * the CDK's keyboard dispatcher, which keeps one document listener and routes to
128
+ * the top-most overlay.
129
+ */
130
+ async sendEscape() {
131
+ await (await this.requireViewer('sendEscape')).sendKeys(TestKey.ESCAPE);
132
+ }
133
+ /** The full-size image's `src`. Throws while the viewer is closed. */
134
+ async getFullSrc() {
135
+ return (await this.viewerPart('.wr-lightbox-viewer__full', 'getFullSrc')).getProperty('src');
136
+ }
137
+ /** The caption under the full image, or `null` when there is none. Throws while closed. */
138
+ async getCaption() {
139
+ await this.requireViewer('getCaption');
140
+ return this.readCaption();
141
+ }
142
+ /** The name the viewer dialog announces — its alt text, or the catalog's fallback. */
143
+ async getViewerLabel() {
144
+ return (await this.requireViewer('getViewerLabel')).getAttribute('aria-label');
145
+ }
146
+ /** The ✕ button's accessible name. Throws while the viewer is closed. */
147
+ async getCloseLabel() {
148
+ return (await this.viewerPart('.wr-lightbox-viewer__close', 'getCloseLabel')).getAttribute('aria-label');
149
+ }
150
+ /** Whether the viewer announces itself as a modal dialog. */
151
+ async isModal() {
152
+ const viewer = await this.requireViewer('isModal');
153
+ return (await viewer.getAttribute('role')) === 'dialog' && (await viewer.getAttribute('aria-modal')) === 'true';
154
+ }
155
+ /**
156
+ * Whether focus is inside the viewer, where the trap should be holding it.
157
+ *
158
+ * `role="dialog"` with `aria-modal` promises the page behind is out of reach, and a
159
+ * missing trap makes that a lie — Tab walks straight through the backdrop. Note
160
+ * that in a unit test the trap needs elements with a box to find anything tabbable,
161
+ * so a spec asserting this has to hand the DOM some dimensions first.
162
+ */
163
+ async isFocusTrapped() {
164
+ return (await this.requireViewer('isFocusTrapped')).matchesSelector(':focus-within');
165
+ }
166
+ /**
167
+ * Whether the trigger's `aria-controls` names THIS lightbox's viewer, and nothing
168
+ * else on the page.
169
+ *
170
+ * The reference only exists while the viewer does — an id naming an element that is
171
+ * not in the document is not a pairing, it is a dangling reference — so this is
172
+ * `false` for a closed lightbox by construction. Counted across the document too,
173
+ * because two viewers answering to one id hand every reference to the first.
174
+ */
175
+ async isViewerBound() {
176
+ const id = await this.viewerId();
177
+ if (!id)
178
+ return false;
179
+ const matches = await this.documentRootLocatorFactory().locatorForAll(`.wr-lightbox-viewer#${id}`)();
180
+ const everywhere = await this.documentRootLocatorFactory().locatorForAll(`[id="${id}"]`)();
181
+ return matches.length === 1 && everywhere.length === 1;
182
+ }
183
+ /** The caption without the open check — for filters, which must not throw. */
184
+ async readCaption() {
185
+ const id = await this.viewerId();
186
+ if (!id)
187
+ return null;
188
+ const caption = await this.documentRootLocatorFactory().locatorForOptional(`#${id} .wr-lightbox-viewer__caption`)();
189
+ return caption ? caption.text() : null;
190
+ }
191
+ /** The id the trigger currently points at, or `null` while the viewer is closed. */
192
+ async viewerId() {
193
+ const trigger = await this.trigger();
194
+ return trigger ? trigger.getAttribute('aria-controls') : null;
195
+ }
196
+ async requireViewer(method) {
197
+ const id = await this.viewerId();
198
+ const viewer = id
199
+ ? await this.documentRootLocatorFactory().locatorForOptional(`.wr-lightbox-viewer#${id}`)()
200
+ : null;
201
+ if (!viewer) {
202
+ throw new Error(`WrLightboxHarness.${method}(): the viewer is not open. It is an overlay created on open and disposed ` +
203
+ 'on close, so there is nothing to read while the lightbox is shut — call open() first.');
204
+ }
205
+ return viewer;
206
+ }
207
+ async viewerPart(selector, method) {
208
+ const viewer = await this.requireViewer(method);
209
+ const id = await viewer.getAttribute('id');
210
+ const part = await this.documentRootLocatorFactory().locatorForOptional(`#${id} ${selector}`)();
211
+ if (!part) {
212
+ throw new Error(`WrLightboxHarness.${method}(): the viewer has no \`${selector}\` element.`);
213
+ }
214
+ return part;
215
+ }
216
+ }
217
+
218
+ /**
219
+ * Generated bundle index. Do not edit.
220
+ */
221
+
222
+ export { WrLightboxHarness };
223
+ //# sourceMappingURL=ngwr-lightbox-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-lightbox-testing.mjs","sources":["../../../projects/lib/lightbox/testing/wr-lightbox-harness.ts","../../../projects/lib/lightbox/testing/ngwr-lightbox-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrLightboxHarnessFilters } from './interfaces';\n\n/**\n * Test harness for `<wr-lightbox>` — the thumbnail, and the full-size viewer it\n * opens.\n *\n * The thumbnail is an element in your fixture and the viewer is a portal in the NGWR\n * overlay container, so this is loaded from the normal fixture loader and reaches\n * across for you — scoped by the id the trigger publishes as `aria-controls`, never\n * by `.wr-lightbox-viewer`, which would answer with whichever lightbox opened first.\n *\n * **A closed lightbox has no viewer at all**, unlike the collapse or the speed dial:\n * the overlay is created on open and disposed on close, so every viewer read here\n * throws while it is shut rather than answering about a stale element.\n *\n * **`disablePreview` removes the button, not just its behaviour.** The thumbnail is\n * then a bare `<img>` with nothing to click and nothing in the tab order, which is\n * why {@link isInteractive} exists and why {@link open} explains itself rather than\n * timing out on a missing element.\n *\n * @example\n * ```ts\n * const lightbox = await loader.getHarness(WrLightboxHarness.with({ alt: 'Mountain' }));\n *\n * await lightbox.open();\n * expect(await lightbox.getFullSrc()).toBe('/photo.jpg');\n *\n * await lightbox.sendEscape();\n * expect(await lightbox.isOpen()).toBe(false);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrLightboxHarness extends ComponentHarness {\n static hostSelector = 'wr-lightbox';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrLightboxHarnessFilters = {}): HarnessPredicate<WrLightboxHarness> {\n return new HarnessPredicate(WrLightboxHarness, options)\n .addOption('alt', options.alt, (harness, alt) => HarnessPredicate.stringMatches(harness.getAlt(), alt))\n .addOption('caption', options.caption, (harness, caption) =>\n HarnessPredicate.stringMatches(harness.readCaption(), caption)\n )\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n private readonly thumb = this.locatorFor('.wr-lightbox__thumb');\n private readonly trigger = this.locatorForOptional('.wr-lightbox__trigger');\n\n /**\n * Whether the viewer is open, from the host's own modifier.\n *\n * The class rather than the overlay, because it is the answer that holds for a\n * harness you are HOLDING: the viewer is disposed on close, and a query for it\n * cannot tell \"shut\" apart from \"never opened\".\n */\n async isOpen(): Promise<boolean> {\n return (await this.host()).hasClass('wr-lightbox--open');\n }\n\n /**\n * Whether the thumbnail has settled — loaded OR failed.\n *\n * A failure counts on purpose: the loading state animates a shimmer and hides the\n * image, so a broken `src` with no error path would shimmer for ever instead of\n * falling back to its alt text. The two cases are deliberately not separated here,\n * because the DOM does not separate them either.\n */\n async isLoading(): Promise<boolean> {\n return (await this.host()).hasClass('wr-lightbox--loading');\n }\n\n /** The thumbnail's alt text — the same string the viewer takes its name from. */\n async getAlt(): Promise<string> {\n return (await this.thumb()).getProperty<string>('alt');\n }\n\n /**\n * What the THUMBNAIL is showing: `preview` when one was given, `src` otherwise.\n *\n * Worth its own method because the two images are different files by design — a\n * grid of thumbnails should not pull full-size originals — and because the\n * thumbnail never swaps to `src` later. Compare with {@link getFullSrc}.\n */\n async getThumbSrc(): Promise<string> {\n return (await this.thumb()).getProperty<string>('src');\n }\n\n /** Whether the thumbnail can be clicked open at all (`disablePreview` off). */\n async isInteractive(): Promise<boolean> {\n return (await this.trigger()) !== null;\n }\n\n /** The trigger's accessible name — falls back to the alt text, then to the catalog. */\n async getOpenLabel(): Promise<string | null> {\n const trigger = await this.trigger();\n return trigger ? trigger.getAttribute('aria-label') : null;\n }\n\n /** Open the viewer. An already-open one is left alone; a non-interactive one throws. */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n const trigger = await this.trigger();\n if (!trigger) {\n throw new Error(\n 'WrLightboxHarness.open(): this lightbox has `disablePreview` set, so there is no trigger — the ' +\n 'thumbnail renders as a bare <img> with nothing to click and nothing in the tab order.'\n );\n }\n await trigger.click();\n }\n\n /** Close the viewer through its ✕ button. An already-closed one is left alone. */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n await (await this.viewerPart('.wr-lightbox-viewer__close', 'close')).click();\n }\n\n /**\n * Click the full image — which closes the viewer.\n *\n * It looks like decoration and is not: the image is styled `cursor: zoom-out`, and\n * that is a promise. It is deliberately NOT in the tab order, since the ✕ button,\n * Escape, the backdrop and a swipe all do the same thing and all reach a keyboard —\n * so this is a mouse affordance, and the only way to assert it still works.\n */\n async clickImage(): Promise<void> {\n await (await this.viewerPart('.wr-lightbox-viewer__full', 'clickImage')).click();\n }\n\n /**\n * Press Escape.\n *\n * Sent to the viewer, though it would arrive from anywhere: the overlay is fed by\n * the CDK's keyboard dispatcher, which keeps one document listener and routes to\n * the top-most overlay.\n */\n async sendEscape(): Promise<void> {\n await (await this.requireViewer('sendEscape')).sendKeys(TestKey.ESCAPE);\n }\n\n /** The full-size image's `src`. Throws while the viewer is closed. */\n async getFullSrc(): Promise<string> {\n return (await this.viewerPart('.wr-lightbox-viewer__full', 'getFullSrc')).getProperty<string>('src');\n }\n\n /** The caption under the full image, or `null` when there is none. Throws while closed. */\n async getCaption(): Promise<string | null> {\n await this.requireViewer('getCaption');\n return this.readCaption();\n }\n\n /** The name the viewer dialog announces — its alt text, or the catalog's fallback. */\n async getViewerLabel(): Promise<string | null> {\n return (await this.requireViewer('getViewerLabel')).getAttribute('aria-label');\n }\n\n /** The ✕ button's accessible name. Throws while the viewer is closed. */\n async getCloseLabel(): Promise<string | null> {\n return (await this.viewerPart('.wr-lightbox-viewer__close', 'getCloseLabel')).getAttribute('aria-label');\n }\n\n /** Whether the viewer announces itself as a modal dialog. */\n async isModal(): Promise<boolean> {\n const viewer = await this.requireViewer('isModal');\n return (await viewer.getAttribute('role')) === 'dialog' && (await viewer.getAttribute('aria-modal')) === 'true';\n }\n\n /**\n * Whether focus is inside the viewer, where the trap should be holding it.\n *\n * `role=\"dialog\"` with `aria-modal` promises the page behind is out of reach, and a\n * missing trap makes that a lie — Tab walks straight through the backdrop. Note\n * that in a unit test the trap needs elements with a box to find anything tabbable,\n * so a spec asserting this has to hand the DOM some dimensions first.\n */\n async isFocusTrapped(): Promise<boolean> {\n return (await this.requireViewer('isFocusTrapped')).matchesSelector(':focus-within');\n }\n\n /**\n * Whether the trigger's `aria-controls` names THIS lightbox's viewer, and nothing\n * else on the page.\n *\n * The reference only exists while the viewer does — an id naming an element that is\n * not in the document is not a pairing, it is a dangling reference — so this is\n * `false` for a closed lightbox by construction. Counted across the document too,\n * because two viewers answering to one id hand every reference to the first.\n */\n async isViewerBound(): Promise<boolean> {\n const id = await this.viewerId();\n if (!id) return false;\n\n const matches = await this.documentRootLocatorFactory().locatorForAll(`.wr-lightbox-viewer#${id}`)();\n const everywhere = await this.documentRootLocatorFactory().locatorForAll(`[id=\"${id}\"]`)();\n return matches.length === 1 && everywhere.length === 1;\n }\n\n /** The caption without the open check — for filters, which must not throw. */\n private async readCaption(): Promise<string | null> {\n const id = await this.viewerId();\n if (!id) return null;\n\n const caption = await this.documentRootLocatorFactory().locatorForOptional(`#${id} .wr-lightbox-viewer__caption`)();\n return caption ? caption.text() : null;\n }\n\n /** The id the trigger currently points at, or `null` while the viewer is closed. */\n private async viewerId(): Promise<string | null> {\n const trigger = await this.trigger();\n return trigger ? trigger.getAttribute('aria-controls') : null;\n }\n\n private async requireViewer(method: string): Promise<TestElement> {\n const id = await this.viewerId();\n const viewer = id\n ? await this.documentRootLocatorFactory().locatorForOptional(`.wr-lightbox-viewer#${id}`)()\n : null;\n\n if (!viewer) {\n throw new Error(\n `WrLightboxHarness.${method}(): the viewer is not open. It is an overlay created on open and disposed ` +\n 'on close, so there is nothing to read while the lightbox is shut — call open() first.'\n );\n }\n return viewer;\n }\n\n private async viewerPart(selector: string, method: string): Promise<TestElement> {\n const viewer = await this.requireViewer(method);\n const id = await viewer.getAttribute('id');\n\n const part = await this.documentRootLocatorFactory().locatorForOptional(`#${id} ${selector}`)();\n if (!part) {\n throw new Error(`WrLightboxHarness.${method}(): the viewer has no \\`${selector}\\` element.`);\n }\n return part;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACG,MAAO,iBAAkB,SAAQ,gBAAgB,CAAA;AACrD,IAAA,OAAO,YAAY,GAAG,aAAa;;AAGnC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAoC,EAAE,EAAA;AAChD,QAAA,OAAO,IA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