ngwr 16.0.0 → 16.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 (295) hide show
  1. package/badge/styles/_tag.scss +8 -4
  2. package/button/styles/_index.scss +13 -7
  3. package/cascader/styles/_rules.scss +4 -2
  4. package/checkbox/styles/_index.scss +4 -2
  5. package/date-picker/styles/_index.scss +95 -3
  6. package/date-stamp/styles/_index.scss +38 -0
  7. package/dialog/styles/_index.scss +38 -0
  8. package/dropdown/styles/_index.scss +37 -1
  9. package/fesm2022/internal-CVLvP9b_.mjs +33 -0
  10. package/fesm2022/internal-CVLvP9b_.mjs.map +1 -0
  11. package/fesm2022/ngwr-alert.mjs +11 -7
  12. package/fesm2022/ngwr-alert.mjs.map +1 -1
  13. package/fesm2022/ngwr-avatar.mjs +11 -7
  14. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  15. package/fesm2022/ngwr-back-top.mjs +10 -6
  16. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  17. package/fesm2022/ngwr-badge.mjs +18 -6
  18. package/fesm2022/ngwr-badge.mjs.map +1 -1
  19. package/fesm2022/ngwr-burger.mjs +9 -6
  20. package/fesm2022/ngwr-burger.mjs.map +1 -1
  21. package/fesm2022/ngwr-button.mjs +8 -4
  22. package/fesm2022/ngwr-button.mjs.map +1 -1
  23. package/fesm2022/ngwr-calendar.mjs +19 -8
  24. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  25. package/fesm2022/ngwr-card.mjs +9 -5
  26. package/fesm2022/ngwr-card.mjs.map +1 -1
  27. package/fesm2022/ngwr-cascader.mjs +11 -5
  28. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  29. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +5 -2
  30. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  31. package/fesm2022/ngwr-checkbox.mjs +10 -6
  32. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  33. package/fesm2022/ngwr-clipboard.mjs +2 -1
  34. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  35. package/fesm2022/ngwr-collapse.mjs +9 -5
  36. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  37. package/fesm2022/ngwr-color-picker.mjs +4 -2
  38. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  39. package/fesm2022/ngwr-comment.mjs +13 -7
  40. package/fesm2022/ngwr-comment.mjs.map +1 -1
  41. package/fesm2022/ngwr-compare.mjs +9 -3
  42. package/fesm2022/ngwr-compare.mjs.map +1 -1
  43. package/fesm2022/ngwr-context-menu.mjs +4 -2
  44. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  45. package/fesm2022/ngwr-copy-value.mjs +11 -6
  46. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  47. package/fesm2022/ngwr-date-picker-testing.mjs +18 -0
  48. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  49. package/fesm2022/ngwr-date-picker.mjs +238 -38
  50. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  51. package/fesm2022/ngwr-date-stamp-testing.mjs +34 -0
  52. package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -0
  53. package/fesm2022/ngwr-date-stamp.mjs +213 -0
  54. package/fesm2022/ngwr-date-stamp.mjs.map +1 -0
  55. package/fesm2022/ngwr-date.mjs +364 -54
  56. package/fesm2022/ngwr-date.mjs.map +1 -1
  57. package/fesm2022/ngwr-descriptions.mjs +9 -5
  58. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  59. package/fesm2022/ngwr-dialog-testing.mjs +23 -2
  60. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-dialog.mjs +45 -16
  62. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  63. package/fesm2022/ngwr-directives.mjs +102 -11
  64. package/fesm2022/ngwr-directives.mjs.map +1 -1
  65. package/fesm2022/ngwr-divider.mjs +4 -2
  66. package/fesm2022/ngwr-divider.mjs.map +1 -1
  67. package/fesm2022/ngwr-drawer.mjs +29 -3
  68. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  69. package/fesm2022/ngwr-dropdown-testing.mjs +38 -3
  70. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  71. package/fesm2022/ngwr-dropdown.mjs +362 -26
  72. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  73. package/fesm2022/ngwr-editor.mjs +5 -2
  74. package/fesm2022/ngwr-editor.mjs.map +1 -1
  75. package/fesm2022/ngwr-event-calendar.mjs +4 -2
  76. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  77. package/fesm2022/ngwr-file-upload.mjs +9 -3
  78. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  79. package/fesm2022/ngwr-form.mjs +18 -6
  80. package/fesm2022/ngwr-form.mjs.map +1 -1
  81. package/fesm2022/ngwr-i18n-ar.mjs +9 -2
  82. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  83. package/fesm2022/ngwr-i18n-cs.mjs +9 -2
  84. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  85. package/fesm2022/ngwr-i18n-de.mjs +9 -2
  86. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  87. package/fesm2022/ngwr-i18n-en.mjs +9 -2
  88. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  89. package/fesm2022/ngwr-i18n-es.mjs +9 -2
  90. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  91. package/fesm2022/ngwr-i18n-fr.mjs +9 -2
  92. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  93. package/fesm2022/ngwr-i18n-he.mjs +9 -2
  94. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  95. package/fesm2022/ngwr-i18n-hi.mjs +9 -2
  96. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  97. package/fesm2022/ngwr-i18n-id.mjs +9 -2
  98. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  99. package/fesm2022/ngwr-i18n-it.mjs +9 -2
  100. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  101. package/fesm2022/ngwr-i18n-ja.mjs +9 -2
  102. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  103. package/fesm2022/ngwr-i18n-ko.mjs +9 -2
  104. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  105. package/fesm2022/ngwr-i18n-nl.mjs +9 -2
  106. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  107. package/fesm2022/ngwr-i18n-pl.mjs +9 -2
  108. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-pt.mjs +9 -2
  110. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n-ru.mjs +9 -2
  112. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-sv.mjs +9 -2
  114. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-tr.mjs +9 -2
  116. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-uk.mjs +9 -2
  118. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-vi.mjs +9 -2
  120. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-zh-tw.mjs +9 -2
  122. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-zh.mjs +9 -2
  124. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n.mjs +34 -8
  126. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  127. package/fesm2022/ngwr-input-number.mjs +9 -3
  128. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  129. package/fesm2022/ngwr-input-otp.mjs +4 -2
  130. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  131. package/fesm2022/ngwr-input.mjs +20 -10
  132. package/fesm2022/ngwr-input.mjs.map +1 -1
  133. package/fesm2022/ngwr-keyboard.mjs +9 -3
  134. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  135. package/fesm2022/ngwr-knob.mjs +9 -3
  136. package/fesm2022/ngwr-knob.mjs.map +1 -1
  137. package/fesm2022/ngwr-layout.mjs +13 -5
  138. package/fesm2022/ngwr-layout.mjs.map +1 -1
  139. package/fesm2022/ngwr-lightbox-testing.mjs +26 -0
  140. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-lightbox.mjs +255 -15
  142. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  143. package/fesm2022/ngwr-list.mjs +13 -5
  144. package/fesm2022/ngwr-list.mjs.map +1 -1
  145. package/fesm2022/ngwr-load-state.mjs +9 -5
  146. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  147. package/fesm2022/ngwr-overlay.mjs +84 -1
  148. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  149. package/fesm2022/ngwr-pagination.mjs +3 -2
  150. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  151. package/fesm2022/ngwr-pipes.mjs +47 -9
  152. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  153. package/fesm2022/ngwr-popover.mjs +93 -4
  154. package/fesm2022/ngwr-popover.mjs.map +1 -1
  155. package/fesm2022/ngwr-progress.mjs +4 -2
  156. package/fesm2022/ngwr-progress.mjs.map +1 -1
  157. package/fesm2022/ngwr-radio.mjs +9 -5
  158. package/fesm2022/ngwr-radio.mjs.map +1 -1
  159. package/fesm2022/ngwr-rating.mjs +9 -3
  160. package/fesm2022/ngwr-rating.mjs.map +1 -1
  161. package/fesm2022/ngwr-resizable.mjs +503 -0
  162. package/fesm2022/ngwr-resizable.mjs.map +1 -0
  163. package/fesm2022/ngwr-result.mjs +9 -5
  164. package/fesm2022/ngwr-result.mjs.map +1 -1
  165. package/fesm2022/ngwr-schema-form.mjs +3 -0
  166. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  167. package/fesm2022/ngwr-segmented.mjs +4 -2
  168. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  169. package/fesm2022/ngwr-select.mjs +13 -5
  170. package/fesm2022/ngwr-select.mjs.map +1 -1
  171. package/fesm2022/ngwr-skeleton.mjs +4 -2
  172. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  173. package/fesm2022/ngwr-slider-testing.mjs +17 -0
  174. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  175. package/fesm2022/ngwr-slider.mjs +91 -13
  176. package/fesm2022/ngwr-slider.mjs.map +1 -1
  177. package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
  178. package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
  179. package/fesm2022/ngwr-sortable-list.mjs +257 -53
  180. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  181. package/fesm2022/ngwr-speed-dial.mjs +4 -2
  182. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  183. package/fesm2022/ngwr-spinner.mjs +4 -2
  184. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  185. package/fesm2022/ngwr-splitter.mjs +17 -21
  186. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  187. package/fesm2022/ngwr-stepper.mjs +9 -3
  188. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  189. package/fesm2022/ngwr-switch.mjs +9 -5
  190. package/fesm2022/ngwr-switch.mjs.map +1 -1
  191. package/fesm2022/ngwr-table-testing.mjs +5 -1
  192. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  193. package/fesm2022/ngwr-table.mjs +167 -10
  194. package/fesm2022/ngwr-table.mjs.map +1 -1
  195. package/fesm2022/ngwr-textarea.mjs +9 -3
  196. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  197. package/fesm2022/ngwr-timeline.mjs +18 -8
  198. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  199. package/fesm2022/ngwr-toast-testing.mjs +6 -1
  200. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  201. package/fesm2022/ngwr-toast.mjs +529 -104
  202. package/fesm2022/ngwr-toast.mjs.map +1 -1
  203. package/fesm2022/ngwr-transfer.mjs +4 -2
  204. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  205. package/fesm2022/ngwr-tree.mjs +4 -2
  206. package/fesm2022/ngwr-tree.mjs.map +1 -1
  207. package/fesm2022/ngwr-typography.mjs +9 -3
  208. package/fesm2022/ngwr-typography.mjs.map +1 -1
  209. package/fesm2022/ngwr-utils-router.mjs +18 -2
  210. package/fesm2022/ngwr-utils-router.mjs.map +1 -1
  211. package/fesm2022/ngwr-utils.mjs +9 -2
  212. package/fesm2022/ngwr-utils.mjs.map +1 -1
  213. package/fesm2022/ngwr-version.mjs +1 -1
  214. package/fesm2022/ngwr-version.mjs.map +1 -1
  215. package/fesm2022/ngwr-window.mjs +7 -4
  216. package/fesm2022/ngwr-window.mjs.map +1 -1
  217. package/fesm2022/ngwr.mjs.map +1 -1
  218. package/i18n/ar.json +13 -2
  219. package/i18n/cs.json +13 -2
  220. package/i18n/de.json +13 -2
  221. package/i18n/en.json +13 -2
  222. package/i18n/es.json +13 -2
  223. package/i18n/fr.json +13 -2
  224. package/i18n/he.json +13 -2
  225. package/i18n/hi.json +13 -2
  226. package/i18n/id.json +13 -2
  227. package/i18n/it.json +13 -2
  228. package/i18n/ja.json +13 -2
  229. package/i18n/ko.json +13 -2
  230. package/i18n/nl.json +13 -2
  231. package/i18n/pl.json +13 -2
  232. package/i18n/pt.json +13 -2
  233. package/i18n/ru.json +13 -2
  234. package/i18n/sv.json +13 -2
  235. package/i18n/tr.json +13 -2
  236. package/i18n/uk.json +13 -2
  237. package/i18n/vi.json +13 -2
  238. package/i18n/zh-TW.json +13 -2
  239. package/i18n/zh.json +13 -2
  240. package/input/styles/_index.scss +10 -5
  241. package/input-number/styles/_index.scss +6 -3
  242. package/input-otp/styles/_index.scss +4 -2
  243. package/lightbox/styles/_rules.scss +96 -0
  244. package/llms-full.txt +40 -17
  245. package/llms.txt +20 -4
  246. package/package.json +19 -1
  247. package/radio/styles/_index.scss +4 -2
  248. package/resizable/styles/_index.scss +154 -0
  249. package/schematics/use/rule.js +1 -0
  250. package/schematics/use/symbol-map.json +5 -0
  251. package/select/styles/_index.scss +6 -3
  252. package/skills/ngwr/SKILL.md +1 -1
  253. package/skills/ngwr/references/catalog.md +6 -2
  254. package/skills/ngwr/references/setup.md +3 -0
  255. package/slider/styles/_index.scss +106 -0
  256. package/sortable-list/styles/_rules.scss +23 -1
  257. package/switch/styles/_index.scss +4 -2
  258. package/table/styles/_index.scss +53 -0
  259. package/textarea/styles/_index.scss +4 -2
  260. package/theme/styles/_motion.scss +6 -0
  261. package/toast/styles/_index.scss +19 -0
  262. package/types/ngwr-burger.d.ts +0 -1
  263. package/types/ngwr-calendar.d.ts +7 -0
  264. package/types/ngwr-charts-calendar-heatmap.d.ts +2 -1
  265. package/types/ngwr-clipboard.d.ts +7 -0
  266. package/types/ngwr-date-picker-testing.d.ts +17 -0
  267. package/types/ngwr-date-picker.d.ts +88 -4
  268. package/types/ngwr-date-stamp-testing.d.ts +47 -0
  269. package/types/ngwr-date-stamp.d.ts +127 -0
  270. package/types/ngwr-date.d.ts +251 -37
  271. package/types/ngwr-dialog-testing.d.ts +10 -0
  272. package/types/ngwr-dialog.d.ts +72 -4
  273. package/types/ngwr-directives.d.ts +36 -1
  274. package/types/ngwr-drawer.d.ts +21 -0
  275. package/types/ngwr-dropdown-testing.d.ts +53 -5
  276. package/types/ngwr-dropdown.d.ts +100 -0
  277. package/types/ngwr-i18n.d.ts +44 -14
  278. package/types/ngwr-lightbox-testing.d.ts +27 -0
  279. package/types/ngwr-lightbox.d.ts +71 -6
  280. package/types/ngwr-overlay.d.ts +36 -0
  281. package/types/ngwr-pipes.d.ts +48 -13
  282. package/types/ngwr-popover.d.ts +39 -1
  283. package/types/ngwr-resizable.d.ts +228 -0
  284. package/types/ngwr-slider-testing.d.ts +8 -1
  285. package/types/ngwr-slider.d.ts +89 -3
  286. package/types/ngwr-sortable-list-testing.d.ts +79 -0
  287. package/types/ngwr-sortable-list.d.ts +113 -10
  288. package/types/ngwr-table-testing.d.ts +3 -1
  289. package/types/ngwr-table.d.ts +120 -4
  290. package/types/ngwr-toast-testing.d.ts +12 -1
  291. package/types/ngwr-toast.d.ts +215 -18
  292. package/types/ngwr-utils-router.d.ts +22 -0
  293. package/types/ngwr-utils.d.ts +8 -1
  294. package/types/ngwr-version.d.ts +1 -1
  295. package/types/ngwr.d.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-slider.mjs","names":[],"sources":["../../../projects/lib/slider/slider.ts","../../../projects/lib/slider/slider.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 { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport type { ElementRef } from '@angular/core';\nimport {\n Component,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrClamp, wrRound, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrSliderValue } from './types';\n\n/** Trim float drift from step calculations. */\n\n/**\n * Numeric slider with optional dual-thumb range mode.\n *\n * A signal-forms native control: it implements `FormValueControl<WrSliderValue>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone. The value\n * shape depends on `range`: `number` (default) or `[number, number]` when\n * `range=\"true\"`.\n *\n * Keyboard: ← / → adjust by `step`; ↑ / ↓ same; Shift+arrow by `step × 10`;\n * Home / End jump to min / max; PageUp / PageDown by `step × 10`.\n *\n * Reading direction: the arrows follow the VISUAL track, so under `dir=\"rtl\"`\n * → moves toward the lower end and ← toward the higher one, and a drag reads\n * its ratio from the right edge. ↑ / ↓, PageUp / PageDown and Home / End are\n * unchanged — they name a value, not a side of the screen.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-slider [formField]=\"form.volume\" min=\"0\" max=\"100\" step=\"5\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-slider [(value)]=\"range\" range min=\"0\" max=\"1000\" step=\"10\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/slider\n */\n@Component({\n selector: 'wr-slider',\n templateUrl: './slider.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()', '(focusout)': 'onFocusOut($event)' },\n})\nexport class WrSlider implements FormValueControl<WrSliderValue> {\n // Typed `WrSliderValue | undefined` (not `number`) to satisfy the reserved\n // `FormUiControl` min/max slots, which are keyed to the control's value type.\n // The transform still coerces to a plain number, so the bounds stay numeric\n // at runtime; `minValue`/`maxValue` narrow them back for arithmetic.\n /** Lower bound. @default 0 */\n readonly min = input<WrSliderValue | undefined>(0, { transform: (v: unknown): number => coerceNumberProperty(v, 0) });\n /** Upper bound. @default 100 */\n readonly max = input<WrSliderValue | undefined>(100, {\n transform: (v: unknown): number => coerceNumberProperty(v, 100),\n });\n\n /** Resolved numeric lower bound for internal arithmetic. */\n private readonly minValue = computed(() => {\n const m = this.min();\n return typeof m === 'number' ? m : 0;\n });\n /** Resolved numeric upper bound for internal arithmetic. */\n private readonly maxValue = computed(() => {\n const m = this.max();\n return typeof m === 'number' ? m : 100;\n });\n\n /** Step size for keyboard and drag. @default 1 */\n readonly step = input(1, { transform: (v: unknown): number => Math.max(0.0001, coerceNumberProperty(v, 1)) });\n /** Render two thumbs and emit `[low, high]`. @default false */\n readonly range = input(false, { transform: coerceBooleanProperty });\n /**\n * Disable interaction. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse value changes while the thumbs stay focusable and the value still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The thumbs keep their tab stop and keep announcing their value — arrow keys,\n * Home / End and the pointer simply move nothing — which is the whole\n * difference from `disabled`, where they would leave the tab order entirely.\n * Mirrored as `aria-readonly`, which role `slider` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n /** Render the current value below the track. @default true */\n readonly showValue = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Maps a value to the text of the value label, and to `aria-valuetext` on\n * the thumb, so a screen reader hears what the label shows. In range mode\n * each end is mapped on its own. Unset, the label prints the number and the\n * thumb announces `aria-valuenow`.\n *\n * @example\n * ```html\n * <wr-slider [max]=\"24\" [labelWith]=\"hour\" [(value)]=\"start\" />\n * ```\n */\n readonly labelWith = input<(value: number) => string>();\n\n /**\n * Accessible name of the thumb — the single one, or the LOWER one in range\n * mode. Falls back to `slider.label` / `slider.lower`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /** Accessible name of the upper thumb in range mode. Falls back to `slider.upper`. */\n readonly upperLabel = input<string | null>(null);\n\n /**\n * A thumb projects no text, so these ARE the accessible names — and they were\n * hard-coded English with no key behind them, so every slider on a page\n * announced the same untranslated \"Value\" whatever it controlled.\n *\n * Range mode reads `ariaLabel` as the LOWER end rather than as the whole\n * control: a name given once must land on something, and naming both thumbs\n * the same thing would read two different values under one name.\n */\n private readonly singleLabel = useI18nText(this.ariaLabel, 'slider.label', 'Value');\n private readonly lowerLabel = useI18nText(this.ariaLabel, 'slider.lower', 'Lower value');\n protected readonly resolvedUpperLabel = useI18nText(this.upperLabel, 'slider.upper', 'Upper value');\n protected readonly resolvedLowLabel = computed(() => (this.range() ? this.lowerLabel() : this.singleLabel()));\n\n private readonly field = inject(WR_FORM_FIELD, { optional: true });\n\n /**\n * Id the surrounding `<wr-form-field>`'s `<label for>` points at, put on the\n * single thumb — the LOWER one in range mode, the same end `ariaLabel` names.\n *\n * The field renders its label before it can see what was projected into it, so\n * the id travels the other way and the control adopts it, exactly as\n * `[wrInput]` does. Without this the `for` named an element that was nowhere\n * in the document: clicking the label did nothing, and the field's own text\n * reached the thumb through no path at all.\n *\n * It lands on the THUMB rather than on the host because only a labelable\n * element can be a label's target, and `<wr-slider>` is not one — a `for`\n * pointing at the host would resolve and still name nothing. The thumb is a\n * real `<button>`, so it is.\n *\n * What this does NOT change is the thumb's name: an `aria-label` outranks a\n * `<label>` in the accname order, and the thumb keeps its own because the\n * field cannot promise it has one to give — `<wr-form-field>` renders a label\n * only when `label` is set, and a slider that traded a generic name for no\n * name would be the worse bug. Set `[ariaLabel]` to the field's label where\n * the two should read alike.\n */\n protected readonly thumbId = computed(() => this.field?.controlId() ?? null);\n\n /**\n * The field's error message, wired to the thumb the same way `wrInput` wires it\n * to its native element.\n *\n * Without this the messages `<wr-form-field>` renders are visible and nothing\n * else: a screen reader on the thumb never learns the field is invalid, nor\n * what the message says. `aria-invalid` is keyed on the message EXISTING rather\n * than on `errorKeys()`, because the field only publishes an id once it is\n * showing something — announcing \"invalid\" while pointing at nothing is worse\n * than staying quiet.\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\n /**\n * The field's own label, when it renders one — `null` otherwise, and `null`\n * when `[ariaLabel]` was set deliberately.\n *\n * `aria-label` outranks a `<label for>` in the accname order, so without this\n * every slider in a form announced the generic `slider.value` default: three\n * sliders under three different labels, all called \"Value\". Nothing catches\n * it — the control HAS a name, so axe is satisfied — and it fails WCAG 2.5.3,\n * where the visible label has to be IN the accessible name.\n *\n * SINGLE thumb only, and deliberately: a range has two, and pointing both at\n * one label would name them identically, which is worse than the generic\n * pair they carry now. Naming a range's thumbs after their field needs\n * `aria-labelledby` to carry two ids — the field's and a hidden one per thumb\n * — which is more machinery than this is worth until someone asks for it.\n */\n protected readonly labelledBy = computed(() =>\n this.ariaLabel() || this.range() ? null : this.fieldAria.labelledBy()\n );\n\n /** `null` once `aria-labelledby` is carrying the name — see {@link labelledBy}. */\n protected readonly lowNameLabel = computed(() => (this.labelledBy() ? null : this.resolvedLowLabel()));\n protected readonly ariaInvalid = this.fieldAria.ariaInvalid;\n\n /**\n * Current value. Bound by `[formField]`, or two-way via `[(value)]`. Shape\n * follows `range`: a plain `number`, or `[low, high]` in range mode.\n */\n readonly value = model<WrSliderValue>(0);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n protected readonly low = signal(0);\n /**\n * The high thumb's cell. Its literal default stands in for `maxValue()`,\n * which cannot be read at field-initialisation time — see `highSeeded` and\n * the constructor effect.\n */\n protected readonly high = signal(100);\n\n /**\n * Whether `high` has ever been told a real value by the model.\n *\n * `<wr-slider range [min]=\"200\" [max]=\"300\" />` binds no value, so the model\n * holds its own scalar default and the tuple branch below never runs: `high`\n * kept the literal 100, which is not inside every `[min, max]`. The thumb\n * rendered off the track and the first interaction committed `[low, 100]` —\n * a value the slider itself calls out of range.\n */\n private highSeeded = false;\n\n protected readonly track = viewChild.required<ElementRef<HTMLElement>>('track');\n private readonly lowThumb = viewChild.required<ElementRef<HTMLButtonElement>>('lowThumb');\n\n /**\n * Ambient reading direction. Optional so a bare `TestBed` — or any consumer\n * that never set a direction — needs no provider; `Directionality` is\n * root-provided, so `null` only ever means \"nobody asked\", which is LTR.\n *\n * Nothing caches a direction-derived value: the thumbs are painted with\n * `inset-inline-start`, so the track mirrors from CSS alone, and `isRtl()` is\n * read inside the event handlers. A runtime flip therefore needs no\n * subscription to `Directionality.change`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-slider'];\n if (this.range()) parts.push('wr-slider--range');\n if (this.disabled()) parts.push('wr-slider--disabled');\n else if (this.readonly()) parts.push('wr-slider--readonly');\n return parts.join(' ');\n });\n\n protected readonly lowPercent = computed(() => this.percentOf(this.low()));\n protected readonly highPercent = computed(() => this.percentOf(this.high()));\n\n /** Offset of the fill from the track's START edge — the left one in LTR, the right one in RTL. */\n protected readonly fillStart = computed(() => (this.range() ? this.lowPercent() : 0));\n protected readonly fillWidth = computed(() =>\n this.range() ? this.highPercent() - this.lowPercent() : this.lowPercent()\n );\n\n /** `aria-valuetext` of the lower thumb: `null` without `labelWith`, so the number announces as is. */\n protected readonly lowText = computed<string | null>(() => this.labelWith()?.(this.low()) ?? null);\n /** `aria-valuetext` of the upper thumb, see {@link lowText}. */\n protected readonly highText = computed<string | null>(() => this.labelWith()?.(this.high()) ?? null);\n\n protected readonly label = computed(() => {\n const low = this.lowText() ?? `${this.low()}`;\n return this.range() ? `${low} – ${this.highText() ?? this.high()}` : low;\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('slider');\n // Keep the internal thumbs in sync with external writes to `value`\n // (the old `writeValue`): split the tuple / clamp into the low & high cells.\n // The cells are clamped and the MODEL IS NOT TOUCHED, and the asymmetry is\n // deliberate. A thumb cannot render outside its own track, so the display\n // has no choice — but writing that clamp back into `value` would erase the\n // error it represents: under `[formField]` the bounds reach this component\n // only through the schema's `min()` / `max()` rules (binding `[min]` beside\n // `[formField]` is an NG8022 compile error), so the write-back deleted the\n // out-of-range value those rules exist to report, and marked a pristine\n // form dirty on first paint besides. The first real interaction emits an\n // in-range number through `emitChange` and the two agree from then on.\n effect(() => {\n const v = this.value();\n\n if (Array.isArray(v)) {\n const tuple = v as readonly [number, number];\n const a = this.clampToBounds(tuple[0]);\n const b = this.clampToBounds(tuple[1]);\n // ORDERED, and only for the display — the same asymmetry as the clamp\n // above, for the same reason. An external `[80, 20]` used to seed\n // `low = 80` and `high = 20`, which made each thumb report an\n // `aria-valuenow` outside its OWN `aria-valuemin`/`aria-valuemax` (the\n // two bound each other), and left the fill with a start and no width,\n // so a range that is real simply vanished.\n //\n // This does not contradict the recorded contract that an edit to one\n // end is never reordered: that one is scoped to \"while the user is\n // still on it\", and ordering settles when the interaction ends. An\n // external write IS the end — there is no interaction in progress.\n const lo = Math.min(a, b);\n const hi = Math.max(a, b);\n this.low.set(lo);\n this.high.set(hi);\n this.highSeeded = true;\n return;\n }\n\n if (typeof v !== 'number') return;\n const lo = this.clampToBounds(v);\n this.low.set(lo);\n\n if (!this.range()) return;\n\n // Range mode holding a scalar: the high thumb has never been told\n // anything, and its literal default is not inside every `[min, max]`.\n // Seed it at the top of the range — which is what the 100 meant back when\n // the bounds were 0–100. The MODEL is left alone here too; the shape it\n // holds is the consumer's business until they move a thumb.\n this.high.set(this.highSeeded ? this.clampToBounds(untracked(this.high)) : this.maxValue());\n this.highSeeded = true;\n });\n }\n\n /**\n * Focus the slider — what Signal Forms calls to focus this control, from\n * `focusBoundControl()`. The host carries no tab stop, so the call goes to\n * the thumb, and in range mode to the LOWER one: the first in the tab order,\n * and the one that carries the field's id and error description.\n */\n focus(options?: FocusOptions): void {\n this.lowThumb().nativeElement.focus(options);\n }\n\n // Interaction\n\n protected onPointerDown(event: PointerEvent, thumb: 'low' | 'high'): void {\n if (this.disabled() || this.readonly()) return;\n event.preventDefault();\n const target = event.currentTarget as HTMLElement;\n target.setPointerCapture(event.pointerId);\n // `preventDefault` above also suppresses the default focus, so the arrows\n // did nothing after a mouse drag until the thumb was found again with Tab —\n // while a click on the bare TRACK focused it. Synchronously, not through\n // `focusThumb`: `event.currentTarget` is already the thumb, so that\n // helper's `queueMicrotask` would only defer a focus nothing is waiting on.\n target.focus();\n\n const move = (e: PointerEvent): void => this.updateFromEvent(e, thumb);\n const cleanup = (e: PointerEvent): void => {\n target.releasePointerCapture(e.pointerId);\n target.removeEventListener('pointermove', move);\n target.removeEventListener('pointerup', cleanup);\n target.removeEventListener('pointercancel', cleanup);\n this.touch.emit();\n };\n\n target.addEventListener('pointermove', move);\n target.addEventListener('pointerup', cleanup);\n // `pointercancel` is never followed by a `pointerup`, so without this the\n // move listener outlived the drag: the thumb kept following a pointer that\n // was merely hovering over it, with no button held.\n target.addEventListener('pointercancel', cleanup);\n this.updateFromEvent(event, thumb);\n }\n\n protected onTrackPointerDown(event: PointerEvent): void {\n if (this.disabled() || this.readonly()) return;\n if ((event.target as HTMLElement).closest('.wr-slider__thumb')) return;\n const thumb = this.nearestThumb(event);\n this.updateFromEvent(event, thumb);\n this.focusThumb(thumb);\n }\n\n protected onKey(event: KeyboardEvent, thumb: 'low' | 'high'): void {\n if (this.disabled() || this.readonly()) return;\n const big = event.shiftKey || event.key === 'PageUp' || event.key === 'PageDown' ? 10 : 1;\n const delta = this.step() * big;\n const current = thumb === 'low' ? this.low() : this.high();\n // The horizontal arrows name a SIDE of the track, so they follow the\n // reading direction; every other key names a value and does not.\n const inline = this.isRtl() ? -delta : delta;\n let next: number | null = null;\n\n switch (event.key) {\n case 'ArrowRight':\n next = current + inline;\n break;\n case 'ArrowLeft':\n next = current - inline;\n break;\n case 'ArrowUp':\n case 'PageUp':\n next = current + delta;\n break;\n case 'ArrowDown':\n case 'PageDown':\n next = current - delta;\n break;\n case 'Home':\n next = this.minValue();\n break;\n case 'End':\n next = this.maxValue();\n break;\n }\n\n if (next === null) return;\n event.preventDefault();\n this.setThumb(thumb, next);\n this.emitChange();\n this.touch.emit();\n }\n\n /**\n * A bound field learns it may show its validation copy from `touch`, and\n * pointer-up plus a value-changing keypress cannot be the only sources: a\n * slider tabbed into and out of without an arrow press left the field\n * untouched forever — which is exactly the case `touched` exists for, and\n * what this output has always documented itself as doing. `wr-knob` and\n * `wr-rating` bind `(blur)` on the one element they own; this component has\n * two thumbs, so it listens for the bubbling `focusout` on its host instead\n * — and ignores the one that only moves focus from one thumb to the other.\n */\n protected onFocusOut(event: FocusEvent): void {\n if (this.track().nativeElement.contains(event.relatedTarget as Node | null)) return;\n this.touch.emit();\n }\n\n // Internals\n\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n\n /**\n * The value under a pointer, measured along the track's INLINE axis.\n *\n * The offset is taken from whichever edge the track starts at — the left one\n * in LTR, the right one in RTL — so the whole component needs the direction\n * in exactly one place. Measuring from `rect.left` regardless would read 0 at\n * the visual maximum of a mirrored track.\n */\n private valueAt(event: PointerEvent): number {\n const rect = this.track().nativeElement.getBoundingClientRect();\n const offset = this.isRtl() ? rect.right - event.clientX : event.clientX - rect.left;\n const ratio = wrClamp(offset / rect.width, 0, 1);\n return this.minValue() + ratio * (this.maxValue() - this.minValue());\n }\n\n private updateFromEvent(event: PointerEvent, thumb: 'low' | 'high'): void {\n this.setThumb(thumb, this.valueAt(event));\n this.emitChange();\n }\n\n /**\n * Which thumb a track click grabs: the one nearest the pointer ON SCREEN.\n *\n * Value distance is the same thing as visual distance once {@link valueAt}\n * has mirrored the ratio — in RTL the low thumb is the RIGHT one, and a click\n * near the right edge lands close to `low` in value space too.\n */\n private nearestThumb(event: PointerEvent): 'low' | 'high' {\n if (!this.range()) return 'low';\n const raw = this.valueAt(event);\n return Math.abs(raw - this.low()) <= Math.abs(raw - this.high()) ? 'low' : 'high';\n }\n\n private focusThumb(thumb: 'low' | 'high'): void {\n queueMicrotask(() => {\n const root = this.track().nativeElement;\n const el = root.querySelector<HTMLElement>(`.wr-slider__thumb--${thumb}`);\n el?.focus();\n });\n }\n\n private setThumb(thumb: 'low' | 'high', raw: number): void {\n const stepped = this.snap(raw);\n if (thumb === 'low') {\n const next = this.range() ? Math.min(stepped, this.high()) : stepped;\n this.low.set(next);\n } else {\n this.high.set(Math.max(stepped, this.low()));\n }\n }\n\n private snap(value: number): number {\n const stepped = Math.round((value - this.minValue()) / this.step()) * this.step() + this.minValue();\n return this.clampToBounds(wrRound(stepped, 6));\n }\n\n private clampToBounds(v: number): number {\n return wrClamp(v, this.minValue(), this.maxValue());\n }\n\n private percentOf(v: number): number {\n const span = this.maxValue() - this.minValue();\n if (span <= 0) return 0;\n return ((v - this.minValue()) / span) * 100;\n }\n\n private emitChange(): void {\n const value: WrSliderValue = this.range() ? [this.low(), this.high()] : this.low();\n this.value.set(value);\n }\n}\n","<div #track class=\"wr-slider__track\" (pointerdown)=\"onTrackPointerDown($event)\">\n <!--\n Positioned on the INLINE axis, not with `left`: `inset-inline-start` is the\n same edge in LTR and mirrors under `dir=\"rtl\"`, so the track paints itself\n the right way round without the component reading a direction to draw.\n -->\n <span class=\"wr-slider__fill\" [style.inset-inline-start.%]=\"fillStart()\" [style.width.%]=\"fillWidth()\"></span>\n\n <button\n #lowThumb\n type=\"button\"\n class=\"wr-slider__thumb wr-slider__thumb--low\"\n role=\"slider\"\n [attr.id]=\"thumbId()\"\n [style.inset-inline-start.%]=\"lowPercent()\"\n [disabled]=\"disabled()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"range() ? high() : max()\"\n [attr.aria-valuenow]=\"low()\"\n [attr.aria-valuetext]=\"lowText()\"\n [attr.aria-label]=\"lowNameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n (pointerdown)=\"onPointerDown($event, 'low')\"\n (keydown)=\"onKey($event, 'low')\"\n ></button>\n\n @if (range()) {\n <button\n type=\"button\"\n class=\"wr-slider__thumb wr-slider__thumb--high\"\n role=\"slider\"\n [style.inset-inline-start.%]=\"highPercent()\"\n [disabled]=\"disabled()\"\n [attr.aria-valuemin]=\"low()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"high()\"\n [attr.aria-valuetext]=\"highText()\"\n [attr.aria-label]=\"resolvedUpperLabel()\"\n [attr.aria-readonly]=\"readonly() || null\"\n (pointerdown)=\"onPointerDown($event, 'high')\"\n (keydown)=\"onKey($event, 'high')\"\n ></button>\n }\n</div>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AAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CACA,YAAU,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-slider.mjs","names":[],"sources":["../../../projects/lib/slider/slider.ts","../../../projects/lib/slider/slider.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 { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport type { ElementRef } from '@angular/core';\nimport {\n Component,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n model,\n output,\n signal,\n untracked,\n viewChild,\n} from '@angular/core';\nimport type { FormValueControl } from '@angular/forms/signals';\n\nimport { WR_FORM_FIELD, useFormFieldAria } from 'ngwr/form';\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrClamp, wrRound, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrSliderMark, WrSliderValue } from './types';\n\n/** Trim float drift from step calculations. */\n\n/**\n * Numeric slider with optional dual-thumb range mode.\n *\n * A signal-forms native control: it implements `FormValueControl<WrSliderValue>`,\n * so `[formField]` binds straight to its `value` model — no\n * `ControlValueAccessor` in between. `[(value)]` works standalone. The value\n * shape depends on `range`: `number` (default) or `[number, number]` when\n * `range=\"true\"`.\n *\n * Keyboard: ← / → adjust by `step`; ↑ / ↓ same; Shift+arrow by `step × 10`;\n * Home / End jump to min / max; PageUp / PageDown by `step × 10`.\n * With `snapToMarks` every one of those keys moves one mark instead, and\n * Home / End land on the first and the last mark.\n *\n * Reading direction: the arrows follow the VISUAL track, so under `dir=\"rtl\"`\n * → moves toward the lower end and ← toward the higher one, and a drag reads\n * its ratio from the right edge. ↑ / ↓, PageUp / PageDown and Home / End are\n * unchanged — they name a value, not a side of the screen.\n *\n * `orientation=\"vertical\"` runs the track from the bottom (min) to the top\n * (max). → then raises the value like ↑ and ← lowers it like ↓, in both\n * reading directions.\n *\n * @example\n * ```html\n * <!-- signal forms -->\n * <wr-slider [formField]=\"form.volume\" min=\"0\" max=\"100\" step=\"5\" />\n *\n * <!-- standalone two-way binding -->\n * <wr-slider [(value)]=\"range\" range min=\"0\" max=\"1000\" step=\"10\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/slider\n */\n@Component({\n selector: 'wr-slider',\n templateUrl: './slider.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-slider', '[class]': 'classes()', '(focusout)': 'onFocusOut($event)' },\n})\nexport class WrSlider implements FormValueControl<WrSliderValue> {\n // Typed `WrSliderValue | undefined` (not `number`) to satisfy the reserved\n // `FormUiControl` min/max slots, which are keyed to the control's value type.\n // The transform still coerces to a plain number, so the bounds stay numeric\n // at runtime; `minValue`/`maxValue` narrow them back for arithmetic.\n /** Lower bound. @default 0 */\n readonly min = input<WrSliderValue | undefined>(0, { transform: (v: unknown): number => coerceNumberProperty(v, 0) });\n /** Upper bound. @default 100 */\n readonly max = input<WrSliderValue | undefined>(100, {\n transform: (v: unknown): number => coerceNumberProperty(v, 100),\n });\n\n /** Resolved numeric lower bound for internal arithmetic. */\n private readonly minValue = computed(() => {\n const m = this.min();\n return typeof m === 'number' ? m : 0;\n });\n /** Resolved numeric upper bound for internal arithmetic. */\n private readonly maxValue = computed(() => {\n const m = this.max();\n return typeof m === 'number' ? m : 100;\n });\n\n /** Step size for keyboard and drag. @default 1 */\n readonly step = input(1, { transform: (v: unknown): number => Math.max(0.0001, coerceNumberProperty(v, 1)) });\n /** Render two thumbs and emit `[low, high]`. @default false */\n readonly range = input(false, { transform: coerceBooleanProperty });\n /**\n * Disable interaction. Bound automatically from the field's disabled state\n * when used with `[formField]`.\n *\n * @default false\n */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Refuse value changes while the thumbs stay focusable and the value still\n * submits. Bound automatically from the field's readonly state when used with\n * `[formField]`.\n *\n * The thumbs keep their tab stop and keep announcing their value — arrow keys,\n * Home / End and the pointer simply move nothing — which is the whole\n * difference from `disabled`, where they would leave the tab order entirely.\n * Mirrored as `aria-readonly`, which role `slider` supports.\n *\n * @default false\n */\n readonly readonly = input(false, { transform: coerceBooleanProperty });\n /** Render the current value below the track. @default true */\n readonly showValue = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Maps a value to the text of the value label, and to `aria-valuetext` on\n * the thumb, so a screen reader hears what the label shows. In range mode\n * each end is mapped on its own. Unset, the label prints the number and the\n * thumb announces `aria-valuenow`.\n *\n * @example\n * ```html\n * <wr-slider [max]=\"24\" [labelWith]=\"hour\" [(value)]=\"start\" />\n * ```\n */\n readonly labelWith = input<(value: number) => string>();\n\n /**\n * Stops drawn on the track: a tick at each `value`, and its `label` under the\n * track when it has one. A mark outside `[min, max]` is not drawn. The thumb\n * announces the label of the mark it stands on as `aria-valuetext`, ahead of\n * `labelWith`.\n *\n * @example\n * ```html\n * <wr-slider [marks]=\"[{ value: 0, label: 'Low' }, { value: 50 }, { value: 100, label: 'High' }]\" />\n * ```\n */\n readonly marks = input<readonly WrSliderMark[]>([]);\n\n /**\n * Restrict the value to the marks: a drag lands on the nearest one and the\n * keyboard moves from mark to mark, whatever `step` says. Without marks it\n * does nothing.\n *\n * @default false\n */\n readonly snapToMarks = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Axis of the track. `vertical` runs from the bottom (min) to the top (max),\n * as tall as `--wr-slider-vertical-height`, with the value and the marks'\n * labels beside it.\n *\n * @default 'horizontal'\n */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /**\n * Accessible name of the thumb — the single one, or the LOWER one in range\n * mode. Falls back to `slider.label` / `slider.lower`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /** Accessible name of the upper thumb in range mode. Falls back to `slider.upper`. */\n readonly upperLabel = input<string | null>(null);\n\n /**\n * A thumb projects no text, so these ARE the accessible names — and they were\n * hard-coded English with no key behind them, so every slider on a page\n * announced the same untranslated \"Value\" whatever it controlled.\n *\n * Range mode reads `ariaLabel` as the LOWER end rather than as the whole\n * control: a name given once must land on something, and naming both thumbs\n * the same thing would read two different values under one name.\n */\n private readonly singleLabel = useI18nText(this.ariaLabel, 'slider.label', 'Value');\n private readonly lowerLabel = useI18nText(this.ariaLabel, 'slider.lower', 'Lower value');\n protected readonly resolvedUpperLabel = useI18nText(this.upperLabel, 'slider.upper', 'Upper value');\n protected readonly resolvedLowLabel = computed(() => (this.range() ? this.lowerLabel() : this.singleLabel()));\n\n private readonly field = inject(WR_FORM_FIELD, { optional: true });\n\n /**\n * Id the surrounding `<wr-form-field>`'s `<label for>` points at, put on the\n * single thumb — the LOWER one in range mode, the same end `ariaLabel` names.\n *\n * The field renders its label before it can see what was projected into it, so\n * the id travels the other way and the control adopts it, exactly as\n * `[wrInput]` does. Without this the `for` named an element that was nowhere\n * in the document: clicking the label did nothing, and the field's own text\n * reached the thumb through no path at all.\n *\n * It lands on the THUMB rather than on the host because only a labelable\n * element can be a label's target, and `<wr-slider>` is not one — a `for`\n * pointing at the host would resolve and still name nothing. The thumb is a\n * real `<button>`, so it is.\n *\n * What this does NOT change is the thumb's name: an `aria-label` outranks a\n * `<label>` in the accname order, and the thumb keeps its own because the\n * field cannot promise it has one to give — `<wr-form-field>` renders a label\n * only when `label` is set, and a slider that traded a generic name for no\n * name would be the worse bug. Set `[ariaLabel]` to the field's label where\n * the two should read alike.\n */\n protected readonly thumbId = computed(() => this.field?.controlId() ?? null);\n\n /**\n * The field's error message, wired to the thumb the same way `wrInput` wires it\n * to its native element.\n *\n * Without this the messages `<wr-form-field>` renders are visible and nothing\n * else: a screen reader on the thumb never learns the field is invalid, nor\n * what the message says. `aria-invalid` is keyed on the message EXISTING rather\n * than on `errorKeys()`, because the field only publishes an id once it is\n * showing something — announcing \"invalid\" while pointing at nothing is worse\n * than staying quiet.\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\n /**\n * The field's own label, when it renders one — `null` otherwise, and `null`\n * when `[ariaLabel]` was set deliberately.\n *\n * `aria-label` outranks a `<label for>` in the accname order, so without this\n * every slider in a form announced the generic `slider.value` default: three\n * sliders under three different labels, all called \"Value\". Nothing catches\n * it — the control HAS a name, so axe is satisfied — and it fails WCAG 2.5.3,\n * where the visible label has to be IN the accessible name.\n *\n * SINGLE thumb only, and deliberately: a range has two, and pointing both at\n * one label would name them identically, which is worse than the generic\n * pair they carry now. Naming a range's thumbs after their field needs\n * `aria-labelledby` to carry two ids — the field's and a hidden one per thumb\n * — which is more machinery than this is worth until someone asks for it.\n */\n protected readonly labelledBy = computed(() =>\n this.ariaLabel() || this.range() ? null : this.fieldAria.labelledBy()\n );\n\n /** `null` once `aria-labelledby` is carrying the name — see {@link labelledBy}. */\n protected readonly lowNameLabel = computed(() => (this.labelledBy() ? null : this.resolvedLowLabel()));\n protected readonly ariaInvalid = this.fieldAria.ariaInvalid;\n\n /**\n * Current value. Bound by `[formField]`, or two-way via `[(value)]`. Shape\n * follows `range`: a plain `number`, or `[low, high]` in range mode.\n */\n readonly value = model<WrSliderValue>(0);\n\n /** Emitted on blur so a bound field can mark itself touched. */\n readonly touch = output<void>();\n\n protected readonly low = signal(0);\n /**\n * The high thumb's cell. Its literal default stands in for `maxValue()`,\n * which cannot be read at field-initialisation time — see `highSeeded` and\n * the constructor effect.\n */\n protected readonly high = signal(100);\n\n /**\n * Whether `high` has ever been told a real value by the model.\n *\n * `<wr-slider range [min]=\"200\" [max]=\"300\" />` binds no value, so the model\n * holds its own scalar default and the tuple branch below never runs: `high`\n * kept the literal 100, which is not inside every `[min, max]`. The thumb\n * rendered off the track and the first interaction committed `[low, 100]` —\n * a value the slider itself calls out of range.\n */\n private highSeeded = false;\n\n protected readonly track = viewChild.required<ElementRef<HTMLElement>>('track');\n private readonly lowThumb = viewChild.required<ElementRef<HTMLButtonElement>>('lowThumb');\n\n /**\n * Ambient reading direction. Optional so a bare `TestBed` — or any consumer\n * that never set a direction — needs no provider; `Directionality` is\n * root-provided, so `null` only ever means \"nobody asked\", which is LTR.\n *\n * Nothing caches a direction-derived value: the thumbs are painted with\n * `inset-inline-start`, so the track mirrors from CSS alone, and `isRtl()` is\n * read inside the event handlers. A runtime flip therefore needs no\n * subscription to `Directionality.change`.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n protected readonly classes = computed(() => {\n const parts: string[] = [];\n if (this.range()) parts.push('wr-slider--range');\n if (this.vertical()) parts.push('wr-slider--vertical');\n if (this.disabled()) parts.push('wr-slider--disabled');\n else if (this.readonly()) parts.push('wr-slider--readonly');\n return parts.join(' ');\n });\n\n protected readonly vertical = computed(() => this.orientation() === 'vertical');\n\n protected readonly lowPercent = computed(() => this.percentOf(this.low()));\n protected readonly highPercent = computed(() => this.percentOf(this.high()));\n\n /** Offset of the fill from the track's START edge — the left one in LTR, the right one in RTL. */\n protected readonly fillStart = computed(() => (this.range() ? this.lowPercent() : 0));\n protected readonly fillWidth = computed(() =>\n this.range() ? this.highPercent() - this.lowPercent() : this.lowPercent()\n );\n\n /** The marks inside the bounds, in value order: what is drawn and what `snapToMarks` walks. */\n protected readonly visibleMarks = computed(() =>\n this.marks()\n .filter(mark => mark.value >= this.minValue() && mark.value <= this.maxValue())\n .sort((a, b) => a.value - b.value)\n .map(mark => ({ ...mark, percent: this.percentOf(mark.value) }))\n );\n protected readonly labelledMarks = computed(() => this.visibleMarks().filter(mark => !!mark.label));\n\n private readonly snapping = computed(() => this.snapToMarks() && this.visibleMarks().length > 0);\n\n /**\n * `aria-valuetext` of the lower thumb: the label of the mark it stands on,\n * else `labelWith`, else `null` so the number announces as is.\n */\n protected readonly lowText = computed<string | null>(() => this.textOf(this.low()));\n /** `aria-valuetext` of the upper thumb, see {@link lowText}. */\n protected readonly highText = computed<string | null>(() => this.textOf(this.high()));\n\n /** Where the value label sits along a vertical track: beside the thumb, or midway between two. */\n protected readonly labelPercent = computed(() =>\n this.range() ? (this.lowPercent() + this.highPercent()) / 2 : this.lowPercent()\n );\n\n protected readonly label = computed(() => {\n const low = this.lowText() ?? `${this.low()}`;\n return this.range() ? `${low} – ${this.highText() ?? this.high()}` : low;\n });\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('slider');\n // Keep the internal thumbs in sync with external writes to `value`\n // (the old `writeValue`): split the tuple / clamp into the low & high cells.\n // The cells are clamped and the MODEL IS NOT TOUCHED, and the asymmetry is\n // deliberate. A thumb cannot render outside its own track, so the display\n // has no choice — but writing that clamp back into `value` would erase the\n // error it represents: under `[formField]` the bounds reach this component\n // only through the schema's `min()` / `max()` rules (binding `[min]` beside\n // `[formField]` is an NG8022 compile error), so the write-back deleted the\n // out-of-range value those rules exist to report, and marked a pristine\n // form dirty on first paint besides. The first real interaction emits an\n // in-range number through `emitChange` and the two agree from then on.\n effect(() => {\n const v = this.value();\n\n if (Array.isArray(v)) {\n const tuple = v as readonly [number, number];\n const a = this.clampToBounds(tuple[0]);\n const b = this.clampToBounds(tuple[1]);\n // ORDERED, and only for the display — the same asymmetry as the clamp\n // above, for the same reason. An external `[80, 20]` used to seed\n // `low = 80` and `high = 20`, which made each thumb report an\n // `aria-valuenow` outside its OWN `aria-valuemin`/`aria-valuemax` (the\n // two bound each other), and left the fill with a start and no width,\n // so a range that is real simply vanished.\n //\n // This does not contradict the recorded contract that an edit to one\n // end is never reordered: that one is scoped to \"while the user is\n // still on it\", and ordering settles when the interaction ends. An\n // external write IS the end — there is no interaction in progress.\n const lo = Math.min(a, b);\n const hi = Math.max(a, b);\n this.low.set(lo);\n this.high.set(hi);\n this.highSeeded = true;\n return;\n }\n\n if (typeof v !== 'number') return;\n const lo = this.clampToBounds(v);\n this.low.set(lo);\n\n if (!this.range()) return;\n\n // Range mode holding a scalar: the high thumb has never been told\n // anything, and its literal default is not inside every `[min, max]`.\n // Seed it at the top of the range — which is what the 100 meant back when\n // the bounds were 0–100. The MODEL is left alone here too; the shape it\n // holds is the consumer's business until they move a thumb.\n this.high.set(this.highSeeded ? this.clampToBounds(untracked(this.high)) : this.maxValue());\n this.highSeeded = true;\n });\n }\n\n /**\n * Focus the slider — what Signal Forms calls to focus this control, from\n * `focusBoundControl()`. The host carries no tab stop, so the call goes to\n * the thumb, and in range mode to the LOWER one: the first in the tab order,\n * and the one that carries the field's id and error description.\n */\n focus(options?: FocusOptions): void {\n this.lowThumb().nativeElement.focus(options);\n }\n\n // Interaction\n\n protected onPointerDown(event: PointerEvent, thumb: 'low' | 'high'): void {\n if (this.disabled() || this.readonly()) return;\n event.preventDefault();\n const target = event.currentTarget as HTMLElement;\n target.setPointerCapture(event.pointerId);\n // `preventDefault` above also suppresses the default focus, so the arrows\n // did nothing after a mouse drag until the thumb was found again with Tab —\n // while a click on the bare TRACK focused it. Synchronously, not through\n // `focusThumb`: `event.currentTarget` is already the thumb, so that\n // helper's `queueMicrotask` would only defer a focus nothing is waiting on.\n target.focus();\n\n const move = (e: PointerEvent): void => this.updateFromEvent(e, thumb);\n const cleanup = (e: PointerEvent): void => {\n target.releasePointerCapture(e.pointerId);\n target.removeEventListener('pointermove', move);\n target.removeEventListener('pointerup', cleanup);\n target.removeEventListener('pointercancel', cleanup);\n this.touch.emit();\n };\n\n target.addEventListener('pointermove', move);\n target.addEventListener('pointerup', cleanup);\n // `pointercancel` is never followed by a `pointerup`, so without this the\n // move listener outlived the drag: the thumb kept following a pointer that\n // was merely hovering over it, with no button held.\n target.addEventListener('pointercancel', cleanup);\n this.updateFromEvent(event, thumb);\n }\n\n protected onTrackPointerDown(event: PointerEvent): void {\n if (this.disabled() || this.readonly()) return;\n if ((event.target as HTMLElement).closest('.wr-slider__thumb')) return;\n const thumb = this.nearestThumb(event);\n this.updateFromEvent(event, thumb);\n this.focusThumb(thumb);\n }\n\n protected onKey(event: KeyboardEvent, thumb: 'low' | 'high'): void {\n if (this.disabled() || this.readonly()) return;\n const big = event.shiftKey || event.key === 'PageUp' || event.key === 'PageDown' ? 10 : 1;\n const delta = this.step() * big;\n const current = thumb === 'low' ? this.low() : this.high();\n // The horizontal arrows name a SIDE of the track, so they follow the\n // reading direction; every other key names a value and does not. A\n // vertical track has no inline side to name.\n const inline = this.isRtl() && !this.vertical() ? -1 : 1;\n let direction = 0;\n let next: number | null = null;\n\n switch (event.key) {\n case 'ArrowRight':\n direction = inline;\n break;\n case 'ArrowLeft':\n direction = -inline;\n break;\n case 'ArrowUp':\n case 'PageUp':\n direction = 1;\n break;\n case 'ArrowDown':\n case 'PageDown':\n direction = -1;\n break;\n case 'Home':\n next = this.minValue();\n break;\n case 'End':\n next = this.maxValue();\n break;\n }\n\n if (direction) next = this.snapping() ? this.adjacentMark(current, direction) : current + direction * delta;\n if (next === null) return;\n event.preventDefault();\n this.setThumb(thumb, next);\n this.emitChange();\n this.touch.emit();\n }\n\n /**\n * A bound field learns it may show its validation copy from `touch`, and\n * pointer-up plus a value-changing keypress cannot be the only sources: a\n * slider tabbed into and out of without an arrow press left the field\n * untouched forever — which is exactly the case `touched` exists for, and\n * what this output has always documented itself as doing. `wr-knob` and\n * `wr-rating` bind `(blur)` on the one element they own; this component has\n * two thumbs, so it listens for the bubbling `focusout` on its host instead\n * — and ignores the one that only moves focus from one thumb to the other.\n */\n protected onFocusOut(event: FocusEvent): void {\n if (this.track().nativeElement.contains(event.relatedTarget as Node | null)) return;\n this.touch.emit();\n }\n\n // Internals\n\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n\n /**\n * The value under a pointer, measured along the track's INLINE axis, or up\n * from its bottom edge when vertical.\n *\n * The offset is taken from whichever edge the track starts at — the left one\n * in LTR, the right one in RTL — so the whole component needs the direction\n * in exactly one place. Measuring from `rect.left` regardless would read 0 at\n * the visual maximum of a mirrored track.\n */\n private valueAt(event: PointerEvent): number {\n const rect = this.track().nativeElement.getBoundingClientRect();\n const inline = this.isRtl() ? rect.right - event.clientX : event.clientX - rect.left;\n const ratio = wrClamp(this.vertical() ? (rect.bottom - event.clientY) / rect.height : inline / rect.width, 0, 1);\n return this.minValue() + ratio * (this.maxValue() - this.minValue());\n }\n\n private updateFromEvent(event: PointerEvent, thumb: 'low' | 'high'): void {\n this.setThumb(thumb, this.valueAt(event));\n this.emitChange();\n }\n\n /**\n * Which thumb a track click grabs: the one nearest the pointer ON SCREEN.\n *\n * Value distance is the same thing as visual distance once {@link valueAt}\n * has mirrored the ratio — in RTL the low thumb is the RIGHT one, and a click\n * near the right edge lands close to `low` in value space too.\n */\n private nearestThumb(event: PointerEvent): 'low' | 'high' {\n if (!this.range()) return 'low';\n const raw = this.valueAt(event);\n return Math.abs(raw - this.low()) <= Math.abs(raw - this.high()) ? 'low' : 'high';\n }\n\n private focusThumb(thumb: 'low' | 'high'): void {\n queueMicrotask(() => {\n const root = this.track().nativeElement;\n const el = root.querySelector<HTMLElement>(`.wr-slider__thumb--${thumb}`);\n el?.focus();\n });\n }\n\n private setThumb(thumb: 'low' | 'high', raw: number): void {\n const stepped = this.snap(raw);\n if (thumb === 'low') {\n const next = this.range() ? Math.min(stepped, this.high()) : stepped;\n this.low.set(next);\n } else {\n this.high.set(Math.max(stepped, this.low()));\n }\n }\n\n private snap(value: number): number {\n if (this.snapping()) return this.nearestMark(value);\n const stepped = Math.round((value - this.minValue()) / this.step()) * this.step() + this.minValue();\n return this.clampToBounds(wrRound(stepped, 6));\n }\n\n private nearestMark(value: number): number {\n return this.visibleMarks().reduce((best, mark) =>\n Math.abs(mark.value - value) < Math.abs(best.value - value) ? mark : best\n ).value;\n }\n\n /** The next mark above or below `value`; `value` itself when there is none, which `snap` then settles. */\n private adjacentMark(value: number, direction: number): number {\n const marks = this.visibleMarks();\n const next =\n direction > 0 ? marks.find(mark => mark.value > value) : [...marks].reverse().find(mark => mark.value < value);\n return next?.value ?? value;\n }\n\n private textOf(value: number): string | null {\n const mark = this.labelledMarks().find(({ value: at }) => at === value);\n return mark?.label ?? this.labelWith()?.(value) ?? null;\n }\n\n protected isActiveMark(value: number): boolean {\n return this.range() ? value >= this.low() && value <= this.high() : value <= this.low();\n }\n\n private clampToBounds(v: number): number {\n return wrClamp(v, this.minValue(), this.maxValue());\n }\n\n private percentOf(v: number): number {\n const span = this.maxValue() - this.minValue();\n if (span <= 0) return 0;\n return ((v - this.minValue()) / span) * 100;\n }\n\n private emitChange(): void {\n const value: WrSliderValue = this.range() ? [this.low(), this.high()] : this.low();\n this.value.set(value);\n }\n}\n","<div #track class=\"wr-slider__track\" (pointerdown)=\"onTrackPointerDown($event)\">\n <!--\n Positioned on the INLINE axis, not with `left`: `inset-inline-start` is the\n same edge in LTR and mirrors under `dir=\"rtl\"`, so the track paints itself\n the right way round without the component reading a direction to draw.\n A vertical track measures every part up from `bottom` instead.\n -->\n <span\n class=\"wr-slider__fill\"\n [style.inset-inline-start.%]=\"vertical() ? null : fillStart()\"\n [style.width.%]=\"vertical() ? null : fillWidth()\"\n [style.bottom.%]=\"vertical() ? fillStart() : null\"\n [style.height.%]=\"vertical() ? fillWidth() : null\"\n ></span>\n\n @for (mark of visibleMarks(); track $index) {\n <span\n class=\"wr-slider__mark\"\n [class.wr-slider__mark--active]=\"isActiveMark(mark.value)\"\n [attr.data-value]=\"mark.value\"\n [style.inset-inline-start.%]=\"vertical() ? null : mark.percent\"\n [style.bottom.%]=\"vertical() ? mark.percent : null\"\n ></span>\n }\n\n <button\n #lowThumb\n type=\"button\"\n class=\"wr-slider__thumb wr-slider__thumb--low\"\n role=\"slider\"\n [attr.id]=\"thumbId()\"\n [style.inset-inline-start.%]=\"vertical() ? null : lowPercent()\"\n [style.bottom.%]=\"vertical() ? lowPercent() : null\"\n [disabled]=\"disabled()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"range() ? high() : max()\"\n [attr.aria-valuenow]=\"low()\"\n [attr.aria-valuetext]=\"lowText()\"\n [attr.aria-orientation]=\"vertical() ? 'vertical' : null\"\n [attr.aria-label]=\"lowNameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-readonly]=\"readonly() || null\"\n [attr.aria-describedby]=\"describedBy()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n (pointerdown)=\"onPointerDown($event, 'low')\"\n (keydown)=\"onKey($event, 'low')\"\n ></button>\n\n @if (range()) {\n <button\n type=\"button\"\n class=\"wr-slider__thumb wr-slider__thumb--high\"\n role=\"slider\"\n [style.inset-inline-start.%]=\"vertical() ? null : highPercent()\"\n [style.bottom.%]=\"vertical() ? highPercent() : null\"\n [disabled]=\"disabled()\"\n [attr.aria-valuemin]=\"low()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"high()\"\n [attr.aria-valuetext]=\"highText()\"\n [attr.aria-orientation]=\"vertical() ? 'vertical' : null\"\n [attr.aria-label]=\"resolvedUpperLabel()\"\n [attr.aria-readonly]=\"readonly() || null\"\n (pointerdown)=\"onPointerDown($event, 'high')\"\n (keydown)=\"onKey($event, 'high')\"\n ></button>\n }\n</div>\n\n@if (labelledMarks().length) {\n <!-- Hidden from assistive tech: the thumb announces the label of the mark it stands on. -->\n <div class=\"wr-slider__mark-labels\" aria-hidden=\"true\">\n @for (mark of labelledMarks(); track $index) {\n <span\n class=\"wr-slider__mark-label\"\n [attr.data-value]=\"mark.value\"\n [style.inset-inline-start.%]=\"vertical() ? null : mark.percent\"\n [style.bottom.%]=\"vertical() ? mark.percent : null\"\n >{{ mark.label }}</span\n >\n }\n </div>\n}\n\n@if (showValue()) {\n <div class=\"wr-slider__label\" [style.bottom.%]=\"vertical() ? labelPercent() : null\">{{ label() }}</div>\n}\n"],"mappings":";;;;;;;;;;;;;AAyEA,IAAa,WAAb,MAAa,SAAQ;CAMV,MAAM,MAAiC,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,MAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,qBAAqB,GAAG,CAAC;CAAC,CAAA;CAEzG,MAAM,MAAiC,KAAG;EAAA,GAAA,YAAA,EAAA,WAAA,MAAA,+BAAA,CAAA;EACjD,YAAY,MAAuB,qBAAqB,GAAG,GAAG;CAAC,CAAA;CAIhD,WAAW,eAAc;EACxC,MAAM,IAAI,KAAK,IAAG;EAClB,OAAO,OAAO,MAAM,WAAW,IAAI;CACrC,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAEe,WAAW,eAAc;EACxC,MAAM,IAAI,KAAK,IAAG;EAClB,OAAO,OAAO,MAAM,WAAW,IAAI;CACrC,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAGO,OAAO,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,OAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,KAAK,IAAI,MAAQ,qBAAqB,GAAG,CAAC,CAAC;CAAC,CAAA;CAEjG,QAAQ,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAOvD,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAc1D,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,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A;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,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CACA,YAAU,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -0,0 +1,103 @@
1
+ import { ComponentHarness, HarnessPredicate, TestKey } from "@angular/cdk/testing";
2
+ /**
3
+ * @license
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
7
+ */
8
+ var WrSortableListHarness = class WrSortableListHarness extends ComponentHarness {
9
+ static hostSelector = "wr-sortable-list";
10
+ static with(options = {}) {
11
+ return new HarnessPredicate(WrSortableListHarness, options).addOption("ariaLabel", options.ariaLabel, async (harness, label) => HarnessPredicate.stringMatches(harness.getAriaLabel(), label)).addOption("item", options.item, async (harness, item) => {
12
+ for (const text of await harness.getItems()) if (await HarnessPredicate.stringMatches(text, item)) return true;
13
+ return false;
14
+ });
15
+ }
16
+ rows = this.locatorForAll(".wr-sortable-list__item");
17
+ list = this.locatorFor(".wr-sortable-list__list");
18
+ status = this.locatorFor("[role=\"status\"]");
19
+ held = this.documentRootLocatorFactory().locatorForOptional(".wr-sortable-list__item--grabbed");
20
+ allLists = this.documentRootLocatorFactory().locatorForAll("wr-sortable-list");
21
+ async getItems() {
22
+ const rows = await this.rows();
23
+ return Promise.all(rows.map((row) => row.text()));
24
+ }
25
+ async getAriaLabel() {
26
+ return (await this.list()).getAttribute("aria-label");
27
+ }
28
+ async getId() {
29
+ return (await this.host()).getAttribute("id");
30
+ }
31
+ async isEmpty() {
32
+ return (await this.host()).hasClass("wr-sortable-list--empty");
33
+ }
34
+ async isConnected() {
35
+ return (await this.host()).hasClass("wr-sortable-list--connected");
36
+ }
37
+ async getEmptyText() {
38
+ const text = await (await this.locatorForOptional(".wr-sortable-list__empty")())?.text() ?? "";
39
+ return text === "" ? null : text;
40
+ }
41
+ async getAnnouncement() {
42
+ return (await this.status()).text();
43
+ }
44
+ async getHeldIndex() {
45
+ const rows = await this.rows();
46
+ for (const [index, row] of rows.entries()) if (await row.hasClass("wr-sortable-list__item--grabbed")) return index;
47
+ return null;
48
+ }
49
+ async moveItem(from, to) {
50
+ const text = await this.grab(from, "moveItem");
51
+ await this.walkTo(to, "moveItem");
52
+ await this.release(text, to, "moveItem");
53
+ }
54
+ async moveItemTo(from, target, to) {
55
+ const name = "moveItemTo";
56
+ const reach = (await this.allLists()).length;
57
+ for (const key of [TestKey.RIGHT_ARROW, TestKey.LEFT_ARROW]) {
58
+ const text = await this.grab(from, name);
59
+ for (let i = 0; i < reach && await target.getHeldIndex() === null; i += 1) await (await this.heldRow(name)).sendKeys(key);
60
+ if (await target.getHeldIndex() !== null) {
61
+ await target.walkTo(to, name);
62
+ await target.release(text, to, name);
63
+ return;
64
+ }
65
+ await (await this.heldRow(name)).sendKeys(TestKey.ESCAPE);
66
+ }
67
+ throw new Error(`WrSortableListHarness.${name}(): the row never reached the target list. The two lists share no group, or the target is disabled or its canEnter refused the item. The row is back at index ${from}.`);
68
+ }
69
+ async grab(index, name) {
70
+ const rows = await this.rows();
71
+ const row = rows[index];
72
+ if (!row) throw new Error(`WrSortableListHarness.${name}(): index ${index} is out of range. This list holds ${rows.length} row(s).`);
73
+ const text = await row.text();
74
+ await row.sendKeys(TestKey.ENTER);
75
+ if (await this.getHeldIndex() !== index) throw new Error(`WrSortableListHarness.${name}(): the row at ${index} was not picked up. Is the list disabled?`);
76
+ return text;
77
+ }
78
+ async walkTo(to, name) {
79
+ const total = (await this.rows()).length;
80
+ if (to < 0 || to >= total) {
81
+ await (await this.heldRow(name)).sendKeys(TestKey.ESCAPE);
82
+ throw new Error(`WrSortableListHarness.${name}(): target index ${to} is out of range. The list holds ${total} row(s) with the moved one, so the last index is ${total - 1}. The move was cancelled.`);
83
+ }
84
+ for (let i = 0; i < total; i += 1) {
85
+ const at = await this.getHeldIndex();
86
+ if (at === null || at === to) return;
87
+ await (await this.heldRow(name)).sendKeys(at < to ? TestKey.DOWN_ARROW : TestKey.UP_ARROW);
88
+ }
89
+ }
90
+ async release(text, to, name) {
91
+ const at = await this.getHeldIndex();
92
+ await (await this.heldRow(name)).sendKeys(at === to ? TestKey.ENTER : TestKey.ESCAPE);
93
+ if (at !== to || (await this.getItems())[to] !== text) throw new Error(`WrSortableListHarness.${name}(): the row stopped at ${at} instead of ${to} and the move was cancelled. This harness drives vertical lists only.`);
94
+ }
95
+ async heldRow(name) {
96
+ const row = await this.held();
97
+ if (!row) throw new Error(`WrSortableListHarness.${name}(): no row is being held, the gesture ended early.`);
98
+ return row;
99
+ }
100
+ };
101
+ export { WrSortableListHarness };
102
+
103
+ //# sourceMappingURL=ngwr-sortable-list-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-sortable-list-testing.mjs","names":[],"sources":["../../../projects/lib/sortable-list/testing/wr-sortable-list-harness.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, type TestElement, TestKey } from '@angular/cdk/testing';\n\nimport type { WrSortableListHarnessFilters } from './types';\n\n/**\n * Test harness for `<wr-sortable-list>`.\n *\n * Every move goes through the keyboard path: pick up, arrows, drop. There is\n * no drag method, because a drag is decided by measured boxes and jsdom has\n * none, so one would report success on a list that sorts nothing.\n *\n * The moves drive a VERTICAL list (ArrowUp / ArrowDown inside it, ArrowLeft /\n * ArrowRight across its group). `orientation` is an input that never reaches\n * the DOM, so the harness cannot read it; on a horizontal list a move lands\n * nowhere and throws, rather than resolving on an order nobody asked for.\n *\n * @example\n * ```ts\n * const todo = await loader.getHarness(WrSortableListHarness.with({ ariaLabel: 'To do' }));\n * const done = await loader.getHarness(WrSortableListHarness.with({ ariaLabel: 'Done' }));\n *\n * await todo.moveItemTo(0, done, 0);\n * expect(await done.getItems()).toEqual(['Write the spec']);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrSortableListHarness extends ComponentHarness {\n static hostSelector = 'wr-sortable-list';\n\n /** Build a predicate that narrows the query: pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrSortableListHarnessFilters = {}): HarnessPredicate<WrSortableListHarness> {\n return new HarnessPredicate(WrSortableListHarness, options)\n .addOption('ariaLabel', options.ariaLabel, async (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAriaLabel(), label)\n )\n .addOption('item', options.item, async (harness, item) => {\n for (const text of await harness.getItems()) {\n if (await HarnessPredicate.stringMatches(text, item)) return true;\n }\n return false;\n });\n }\n\n private readonly rows = this.locatorForAll('.wr-sortable-list__item');\n private readonly list = this.locatorFor('.wr-sortable-list__list');\n private readonly status = this.locatorFor('[role=\"status\"]');\n /** The row the keyboard is holding, in whichever list of the page has it. */\n private readonly held = this.documentRootLocatorFactory().locatorForOptional('.wr-sortable-list__item--grabbed');\n private readonly allLists = this.documentRootLocatorFactory().locatorForAll('wr-sortable-list');\n\n /** The text of every row, in order. The empty-state slot is not a row. */\n async getItems(): Promise<string[]> {\n const rows = await this.rows();\n return Promise.all(rows.map(row => row.text()));\n }\n\n /** The list's accessible name, or `null` when it has none. */\n async getAriaLabel(): Promise<string | null> {\n return (await this.list()).getAttribute('aria-label');\n }\n\n /** The host's `id`: the `id` input, or the generated one. */\n async getId(): Promise<string | null> {\n return (await this.host()).getAttribute('id');\n }\n\n /** Whether the list has no rows. */\n async isEmpty(): Promise<boolean> {\n return (await this.host()).hasClass('wr-sortable-list--empty');\n }\n\n /** Whether the list belongs to a group, so it can exchange rows with other lists. */\n async isConnected(): Promise<boolean> {\n return (await this.host()).hasClass('wr-sortable-list--connected');\n }\n\n /** The text projected into the empty-state slot, or `null` when the list has rows or projects nothing. */\n async getEmptyText(): Promise<string | null> {\n const empty = await this.locatorForOptional('.wr-sortable-list__empty')();\n const text = (await empty?.text()) ?? '';\n return text === '' ? null : text;\n }\n\n /** What the list's live region last said. Written by keyboard moves only. */\n async getAnnouncement(): Promise<string> {\n return (await this.status()).text();\n }\n\n /** Index of the row the keyboard is holding in THIS list, or `null`. */\n async getHeldIndex(): Promise<number | null> {\n const rows = await this.rows();\n for (const [index, row] of rows.entries()) {\n if (await row.hasClass('wr-sortable-list__item--grabbed')) return index;\n }\n return null;\n }\n\n /**\n * Moves the row at `from` to `to` inside this list: pick up, arrows, drop.\n * The list emits one `reorder`. Throws when the row does not land on `to`,\n * which is what a disabled or horizontal list does.\n */\n async moveItem(from: number, to: number): Promise<void> {\n const text = await this.grab(from, 'moveItem');\n await this.walkTo(to, 'moveItem');\n await this.release(text, to, 'moveItem');\n }\n\n /**\n * Moves the row at `from` into another list of the same group, at `to`.\n * The target emits one `move`.\n *\n * It walks the group one way, then the other, so it needs no knowledge of the\n * page's direction. Throws when the row never reaches `target`: another\n * group, a list that is disabled, or a `canEnter` that refuses the item. The\n * row is back where it started by then.\n */\n async moveItemTo(from: number, target: WrSortableListHarness, to: number): Promise<void> {\n const name = 'moveItemTo';\n const reach = (await this.allLists()).length;\n\n for (const key of [TestKey.RIGHT_ARROW, TestKey.LEFT_ARROW]) {\n const text = await this.grab(from, name);\n for (let i = 0; i < reach && (await target.getHeldIndex()) === null; i += 1) {\n await (await this.heldRow(name)).sendKeys(key);\n }\n if ((await target.getHeldIndex()) !== null) {\n await target.walkTo(to, name);\n await target.release(text, to, name);\n return;\n }\n await (await this.heldRow(name)).sendKeys(TestKey.ESCAPE);\n }\n\n throw new Error(\n `WrSortableListHarness.${name}(): the row never reached the target list. The two lists share no group, ` +\n `or the target is disabled or its canEnter refused the item. The row is back at index ${from}.`\n );\n }\n\n private async grab(index: number, name: string): Promise<string> {\n const rows = await this.rows();\n const row = rows[index];\n if (!row) {\n throw new Error(\n `WrSortableListHarness.${name}(): index ${index} is out of range. This list holds ${rows.length} row(s).`\n );\n }\n const text = await row.text();\n await row.sendKeys(TestKey.ENTER);\n if ((await this.getHeldIndex()) !== index) {\n throw new Error(`WrSortableListHarness.${name}(): the row at ${index} was not picked up. Is the list disabled?`);\n }\n return text;\n }\n\n private async walkTo(to: number, name: string): Promise<void> {\n const total = (await this.rows()).length;\n if (to < 0 || to >= total) {\n await (await this.heldRow(name)).sendKeys(TestKey.ESCAPE);\n throw new Error(\n `WrSortableListHarness.${name}(): target index ${to} is out of range. The list holds ${total} row(s) ` +\n `with the moved one, so the last index is ${total - 1}. The move was cancelled.`\n );\n }\n for (let i = 0; i < total; i += 1) {\n const at = await this.getHeldIndex();\n if (at === null || at === to) return;\n await (await this.heldRow(name)).sendKeys(at < to ? TestKey.DOWN_ARROW : TestKey.UP_ARROW);\n }\n }\n\n private async release(text: string, to: number, name: string): Promise<void> {\n const at = await this.getHeldIndex();\n await (await this.heldRow(name)).sendKeys(at === to ? TestKey.ENTER : TestKey.ESCAPE);\n if (at !== to || (await this.getItems())[to] !== text) {\n throw new Error(\n `WrSortableListHarness.${name}(): the row stopped at ${at} instead of ${to} and the move was cancelled. ` +\n `This harness drives vertical lists only.`\n );\n }\n }\n\n private async heldRow(name: string): Promise<TestElement> {\n const row = await this.held();\n if (!row) throw new Error(`WrSortableListHarness.${name}(): no row is being held, the gesture ended early.`);\n return row;\n }\n}\n"],"mappings":";;;;;;;AAkCA,IAAa,wBAAb,MAAa,8BAA8B,iBAAgB;CACzD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAwC,CAAA,GAAE;EACpD,OAAO,IAAI,iBAAiB,uBAAuB,OAAO,CAAC,CACxD,UAAU,aAAa,QAAQ,WAAW,OAAO,SAAS,UACzD,iBAAiB,cAAc,QAAQ,aAAY,GAAI,KAAK,CAAC,CAC9D,CACA,UAAU,QAAQ,QAAQ,MAAM,OAAO,SAAS,SAAQ;GACvD,KAAK,MAAM,QAAQ,MAAM,QAAQ,SAAQ,GACvC,IAAI,MAAM,iBAAiB,cAAc,MAAM,IAAI,GAAG,OAAO;GAE/D,OAAO;EACT,CAAC;CACL;CAEiB,OAAO,KAAK,cAAc,yBAAyB;CACnD,OAAO,KAAK,WAAW,yBAAyB;CAChD,SAAS,KAAK,WAAW,mBAAiB;CAE1C,OAAO,KAAK,2BAA0B,CAAE,CAAC,mBAAmB,kCAAkC;CAC9F,WAAW,KAAK,2BAA0B,CAAE,CAAC,cAAc,kBAAkB;CAG9F,MAAM,WAAQ;EACZ,MAAM,OAAO,MAAM,KAAK,KAAI;EAC5B,OAAO,QAAQ,IAAI,KAAK,KAAI,QAAO,IAAI,KAAI,CAAE,CAAC;CAChD;CAGA,MAAM,eAAY;EAChB,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,YAAY;CACtD;CAGA,MAAM,QAAK;EACT,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,IAAI;CAC9C;CAGA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,SAAS,yBAAyB;CAC/D;CAGA,MAAM,cAAW;EACf,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,SAAS,6BAA6B;CACnE;CA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