ngwr 15.9.0 → 16.0.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 (375) hide show
  1. package/animations/aurora/styles/_index.scss +1 -1
  2. package/animations/blur-reveal/styles/_index.scss +1 -1
  3. package/animations/decode/styles/_index.scss +1 -1
  4. package/animations/dot-grid/styles/_index.scss +1 -1
  5. package/animations/flow-lines/styles/_index.scss +1 -1
  6. package/animations/fluid-cursor/styles/_index.scss +1 -1
  7. package/animations/{core → internal}/styles/_mixins.scss +1 -1
  8. package/animations/reveal/styles/_index.scss +1 -1
  9. package/animations/ripple-grid/styles/_index.scss +1 -1
  10. package/animations/rotate-reveal/styles/_index.scss +1 -1
  11. package/animations/thread-lines/styles/_index.scss +1 -1
  12. package/animations/typewriter/styles/_index.scss +1 -1
  13. package/copy-value/styles/_index.scss +104 -0
  14. package/date-picker/styles/_index.scss +117 -0
  15. package/fesm2022/{ngwr-animations-core.mjs → internal-BaQU4t_0.mjs} +6 -49
  16. package/fesm2022/internal-BaQU4t_0.mjs.map +1 -0
  17. package/fesm2022/ngwr-alert.mjs +2 -2
  18. package/fesm2022/ngwr-alert.mjs.map +1 -1
  19. package/fesm2022/ngwr-animations-aurora.mjs +21 -21
  20. package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
  21. package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
  22. package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
  23. package/fesm2022/ngwr-animations-click-sparks.mjs +2 -2
  24. package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
  25. package/fesm2022/ngwr-animations-confetti.mjs +5 -5
  26. package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
  27. package/fesm2022/ngwr-animations-decode.mjs +4 -4
  28. package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
  29. package/fesm2022/ngwr-animations-destruct.mjs +5 -5
  30. package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
  31. package/fesm2022/ngwr-animations-dot-grid.mjs +7 -7
  32. package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
  33. package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
  34. package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
  35. package/fesm2022/ngwr-animations-flow-lines.mjs +17 -17
  36. package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
  37. package/fesm2022/ngwr-animations-fluid-cursor.mjs +12 -12
  38. package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
  39. package/fesm2022/ngwr-animations-glitch.mjs +2 -2
  40. package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
  41. package/fesm2022/ngwr-animations-marquee.mjs +2 -2
  42. package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
  43. package/fesm2022/ngwr-animations-orbit.mjs +7 -7
  44. package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
  45. package/fesm2022/ngwr-animations-reveal.mjs +4 -4
  46. package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
  47. package/fesm2022/ngwr-animations-ripple-grid.mjs +5 -5
  48. package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
  49. package/fesm2022/ngwr-animations-rotate-reveal.mjs +4 -4
  50. package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
  51. package/fesm2022/ngwr-animations-shimmer.mjs +2 -2
  52. package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
  53. package/fesm2022/ngwr-animations-spotlight.mjs +1 -1
  54. package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
  55. package/fesm2022/ngwr-animations-thread-lines.mjs +16 -16
  56. package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
  57. package/fesm2022/ngwr-animations-tilt.mjs +3 -3
  58. package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
  59. package/fesm2022/ngwr-animations-typewriter.mjs +4 -4
  60. package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
  61. package/fesm2022/ngwr-avatar.mjs +3 -3
  62. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  63. package/fesm2022/ngwr-badge.mjs.map +1 -1
  64. package/fesm2022/ngwr-cascader.mjs +43 -20
  65. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  66. package/fesm2022/ngwr-charts-bar-chart.mjs +13 -13
  67. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  68. package/fesm2022/ngwr-charts-boxplot-chart.mjs +9 -9
  69. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
  70. package/fesm2022/ngwr-charts-bullet-chart.mjs +8 -8
  71. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-candlestick-chart.mjs +11 -11
  73. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-chart-legend.mjs +2 -2
  75. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-core.mjs +20 -20
  77. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-donut-chart.mjs +2 -2
  79. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-funnel-chart.mjs +6 -6
  81. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
  82. package/fesm2022/ngwr-charts-gauge.mjs +3 -3
  83. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  84. package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
  85. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
  86. package/fesm2022/ngwr-charts-line-chart.mjs +10 -10
  87. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  88. package/fesm2022/ngwr-charts-meter-group.mjs +2 -2
  89. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  90. package/fesm2022/ngwr-charts-radar-chart.mjs +11 -11
  91. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  92. package/fesm2022/ngwr-charts-scatter-chart.mjs +10 -10
  93. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  94. package/fesm2022/ngwr-charts-treemap-chart.mjs +4 -4
  95. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
  96. package/fesm2022/ngwr-charts-waterfall-chart.mjs +7 -7
  97. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
  98. package/fesm2022/ngwr-checkbox.mjs +2 -2
  99. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  100. package/fesm2022/ngwr-collapse.mjs +2 -2
  101. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  102. package/fesm2022/ngwr-color-picker.mjs +52 -52
  103. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  104. package/fesm2022/ngwr-command-palette.mjs +4 -4
  105. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  106. package/fesm2022/ngwr-comment.mjs +2 -2
  107. package/fesm2022/ngwr-comment.mjs.map +1 -1
  108. package/fesm2022/ngwr-compare.mjs +6 -6
  109. package/fesm2022/ngwr-compare.mjs.map +1 -1
  110. package/fesm2022/ngwr-context-menu.mjs +4 -4
  111. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  112. package/fesm2022/ngwr-copy-value-testing.mjs +58 -0
  113. package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -0
  114. package/fesm2022/ngwr-copy-value.mjs +196 -0
  115. package/fesm2022/ngwr-copy-value.mjs.map +1 -0
  116. package/fesm2022/ngwr-counter.mjs +3 -3
  117. package/fesm2022/ngwr-counter.mjs.map +1 -1
  118. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  119. package/fesm2022/ngwr-date-picker.mjs +217 -40
  120. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  121. package/fesm2022/ngwr-date.mjs +27 -5
  122. package/fesm2022/ngwr-date.mjs.map +1 -1
  123. package/fesm2022/ngwr-dialog.mjs +32 -3
  124. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  125. package/fesm2022/ngwr-directives.mjs +116 -1
  126. package/fesm2022/ngwr-directives.mjs.map +1 -1
  127. package/fesm2022/ngwr-drawer.mjs +3 -3
  128. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  129. package/fesm2022/ngwr-dropdown.mjs +13 -12
  130. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  131. package/fesm2022/ngwr-editor.mjs +28 -28
  132. package/fesm2022/ngwr-editor.mjs.map +1 -1
  133. package/fesm2022/ngwr-event-calendar.mjs +5 -5
  134. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  135. package/fesm2022/ngwr-file-upload.mjs +8 -8
  136. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  137. package/fesm2022/ngwr-graph.mjs +3 -3
  138. package/fesm2022/ngwr-graph.mjs.map +1 -1
  139. package/fesm2022/ngwr-hotkey.mjs +22 -22
  140. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  141. package/fesm2022/ngwr-i18n-ar.mjs +5 -0
  142. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  143. package/fesm2022/ngwr-i18n-cs.mjs +5 -0
  144. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  145. package/fesm2022/ngwr-i18n-de.mjs +5 -0
  146. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  147. package/fesm2022/ngwr-i18n-en.mjs +5 -0
  148. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  149. package/fesm2022/ngwr-i18n-es.mjs +5 -0
  150. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  151. package/fesm2022/ngwr-i18n-fr.mjs +5 -0
  152. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  153. package/fesm2022/ngwr-i18n-he.mjs +5 -0
  154. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  155. package/fesm2022/ngwr-i18n-hi.mjs +5 -0
  156. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  157. package/fesm2022/ngwr-i18n-id.mjs +5 -0
  158. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  159. package/fesm2022/ngwr-i18n-it.mjs +5 -0
  160. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  161. package/fesm2022/ngwr-i18n-ja.mjs +5 -0
  162. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  163. package/fesm2022/ngwr-i18n-ko.mjs +5 -0
  164. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  165. package/fesm2022/ngwr-i18n-nl.mjs +5 -0
  166. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  167. package/fesm2022/ngwr-i18n-pl.mjs +5 -0
  168. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  169. package/fesm2022/ngwr-i18n-pt.mjs +5 -0
  170. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  171. package/fesm2022/ngwr-i18n-ru.mjs +5 -0
  172. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  173. package/fesm2022/ngwr-i18n-sv.mjs +5 -0
  174. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  175. package/fesm2022/ngwr-i18n-tr.mjs +5 -0
  176. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  177. package/fesm2022/ngwr-i18n-uk.mjs +5 -0
  178. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  179. package/fesm2022/ngwr-i18n-vi.mjs +5 -0
  180. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  181. package/fesm2022/ngwr-i18n-zh-tw.mjs +5 -0
  182. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  183. package/fesm2022/ngwr-i18n-zh.mjs +5 -0
  184. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  185. package/fesm2022/ngwr-i18n.mjs +2 -2
  186. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  187. package/fesm2022/ngwr-icon.mjs +5 -5
  188. package/fesm2022/ngwr-icon.mjs.map +1 -1
  189. package/fesm2022/ngwr-image-cropper.mjs +11 -11
  190. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  191. package/fesm2022/ngwr-input-number.mjs +4 -4
  192. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  193. package/fesm2022/ngwr-input-otp.mjs +2 -2
  194. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  195. package/fesm2022/ngwr-input.mjs +15 -15
  196. package/fesm2022/ngwr-input.mjs.map +1 -1
  197. package/fesm2022/ngwr-keyboard.mjs +28 -28
  198. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  199. package/fesm2022/ngwr-knob.mjs +4 -4
  200. package/fesm2022/ngwr-knob.mjs.map +1 -1
  201. package/fesm2022/ngwr-lightbox.mjs +2 -2
  202. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  203. package/fesm2022/ngwr-load-state.mjs +2 -2
  204. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  205. package/fesm2022/ngwr-mention.mjs +6 -6
  206. package/fesm2022/ngwr-mention.mjs.map +1 -1
  207. package/fesm2022/ngwr-meta.mjs +19 -3
  208. package/fesm2022/ngwr-meta.mjs.map +1 -1
  209. package/fesm2022/ngwr-overlay.mjs +3 -3
  210. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  211. package/fesm2022/ngwr-pagination.mjs +7 -5
  212. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  213. package/fesm2022/ngwr-pipes.mjs +3 -5
  214. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  215. package/fesm2022/ngwr-platform.mjs +4 -1
  216. package/fesm2022/ngwr-platform.mjs.map +1 -1
  217. package/fesm2022/ngwr-popconfirm.mjs +6 -5
  218. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  219. package/fesm2022/ngwr-popover.mjs +31 -30
  220. package/fesm2022/ngwr-popover.mjs.map +1 -1
  221. package/fesm2022/ngwr-pull-to-refresh.mjs +2 -2
  222. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  223. package/fesm2022/ngwr-qr.mjs +6 -6
  224. package/fesm2022/ngwr-qr.mjs.map +1 -1
  225. package/fesm2022/ngwr-radio.mjs +3 -3
  226. package/fesm2022/ngwr-radio.mjs.map +1 -1
  227. package/fesm2022/ngwr-rating.mjs +10 -10
  228. package/fesm2022/ngwr-rating.mjs.map +1 -1
  229. package/fesm2022/ngwr-schema-form.mjs +15 -5
  230. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  231. package/fesm2022/ngwr-select.mjs +57 -34
  232. package/fesm2022/ngwr-select.mjs.map +1 -1
  233. package/fesm2022/ngwr-sidebar.mjs +3 -3
  234. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  235. package/fesm2022/ngwr-skeleton.mjs +2 -2
  236. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  237. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  238. package/fesm2022/ngwr-slider.mjs +13 -13
  239. package/fesm2022/ngwr-slider.mjs.map +1 -1
  240. package/fesm2022/ngwr-sortable-list.mjs +3 -3
  241. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  242. package/fesm2022/ngwr-splitter.mjs +5 -5
  243. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  244. package/fesm2022/ngwr-statistic.mjs +5 -3
  245. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  246. package/fesm2022/ngwr-storage.mjs +6 -4
  247. package/fesm2022/ngwr-storage.mjs.map +1 -1
  248. package/fesm2022/ngwr-switch.mjs +2 -2
  249. package/fesm2022/ngwr-switch.mjs.map +1 -1
  250. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  251. package/fesm2022/ngwr-table.mjs +231 -27
  252. package/fesm2022/ngwr-table.mjs.map +1 -1
  253. package/fesm2022/ngwr-tabs.mjs +2 -2
  254. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  255. package/fesm2022/ngwr-toast-testing.mjs +8 -1
  256. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  257. package/fesm2022/ngwr-toast.mjs +63 -20
  258. package/fesm2022/ngwr-toast.mjs.map +1 -1
  259. package/fesm2022/ngwr-tour.mjs +7 -7
  260. package/fesm2022/ngwr-tour.mjs.map +1 -1
  261. package/fesm2022/ngwr-transfer.mjs +20 -9
  262. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  263. package/fesm2022/ngwr-tree.mjs +64 -24
  264. package/fesm2022/ngwr-tree.mjs.map +1 -1
  265. package/fesm2022/ngwr-utils.mjs +98 -55
  266. package/fesm2022/ngwr-utils.mjs.map +1 -1
  267. package/fesm2022/ngwr-validators.mjs +2 -2
  268. package/fesm2022/ngwr-validators.mjs.map +1 -1
  269. package/fesm2022/ngwr-version.mjs +1 -1
  270. package/fesm2022/ngwr-version.mjs.map +1 -1
  271. package/fesm2022/ngwr-window.mjs +26 -26
  272. package/fesm2022/ngwr-window.mjs.map +1 -1
  273. package/fesm2022/ngwr.mjs.map +1 -1
  274. package/i18n/ar.json +5 -0
  275. package/i18n/cs.json +5 -0
  276. package/i18n/de.json +5 -0
  277. package/i18n/en.json +5 -0
  278. package/i18n/es.json +5 -0
  279. package/i18n/fr.json +5 -0
  280. package/i18n/he.json +5 -0
  281. package/i18n/hi.json +5 -0
  282. package/i18n/id.json +5 -0
  283. package/i18n/it.json +5 -0
  284. package/i18n/ja.json +5 -0
  285. package/i18n/ko.json +5 -0
  286. package/i18n/nl.json +5 -0
  287. package/i18n/pl.json +5 -0
  288. package/i18n/pt.json +5 -0
  289. package/i18n/ru.json +5 -0
  290. package/i18n/sv.json +5 -0
  291. package/i18n/tr.json +5 -0
  292. package/i18n/uk.json +5 -0
  293. package/i18n/vi.json +5 -0
  294. package/i18n/zh-TW.json +5 -0
  295. package/i18n/zh.json +5 -0
  296. package/input-number/styles/_index.scss +6 -0
  297. package/llms-full.txt +31 -19
  298. package/llms.txt +37 -19
  299. package/mcp/providers.js +1 -1
  300. package/package.json +15 -10
  301. package/schematics/icon-set/index.js +3 -3
  302. package/schematics/migrations/v16/index.js +742 -0
  303. package/schematics/migrations.json +5 -0
  304. package/schematics/ng-add/index.js +4 -4
  305. package/schematics/provider/index.js +4 -4
  306. package/schematics/use/symbol-map.json +2 -0
  307. package/select/styles/_index.scss +1 -1
  308. package/skills/ngwr/SKILL.md +6 -4
  309. package/skills/ngwr/references/catalog.md +4 -2
  310. package/skills/ngwr/references/setup.md +10 -9
  311. package/table/styles/_index.scss +85 -29
  312. package/toast/styles/_index.scss +30 -0
  313. package/tree/styles/_index.scss +17 -0
  314. package/types/index-CXbgza47.d.ts +13 -0
  315. package/types/ngwr-animations-aurora.d.ts +1 -1
  316. package/types/ngwr-animations-blur-reveal.d.ts +2 -2
  317. package/types/ngwr-animations-dot-grid.d.ts +1 -2
  318. package/types/ngwr-animations-flow-lines.d.ts +1 -1
  319. package/types/ngwr-animations-fluid-cursor.d.ts +1 -1
  320. package/types/ngwr-animations-reveal.d.ts +4 -8
  321. package/types/ngwr-animations-ripple-grid.d.ts +1 -1
  322. package/types/ngwr-animations-spotlight.d.ts +1 -1
  323. package/types/ngwr-animations-thread-lines.d.ts +1 -1
  324. package/types/ngwr-animations-tilt.d.ts +1 -1
  325. package/types/ngwr-avatar.d.ts +2 -2
  326. package/types/ngwr-badge.d.ts +1 -1
  327. package/types/ngwr-cascader.d.ts +12 -1
  328. package/types/ngwr-charts-boxplot-chart.d.ts +1 -1
  329. package/types/ngwr-charts-bullet-chart.d.ts +2 -2
  330. package/types/ngwr-charts-candlestick-chart.d.ts +1 -1
  331. package/types/ngwr-charts-core.d.ts +12 -12
  332. package/types/ngwr-charts-line-chart.d.ts +2 -2
  333. package/types/ngwr-charts-radar-chart.d.ts +1 -1
  334. package/types/ngwr-charts-scatter-chart.d.ts +2 -2
  335. package/types/ngwr-charts-waterfall-chart.d.ts +1 -1
  336. package/types/ngwr-color-picker.d.ts +12 -12
  337. package/types/ngwr-copy-value-testing.d.ts +87 -0
  338. package/types/ngwr-copy-value.d.ts +95 -0
  339. package/types/ngwr-date-picker-testing.d.ts +3 -3
  340. package/types/ngwr-date-picker.d.ts +97 -1
  341. package/types/ngwr-date.d.ts +44 -3
  342. package/types/ngwr-dialog.d.ts +50 -3
  343. package/types/ngwr-directives.d.ts +40 -0
  344. package/types/ngwr-drawer.d.ts +1 -1
  345. package/types/ngwr-dropdown.d.ts +3 -2
  346. package/types/ngwr-hotkey.d.ts +5 -5
  347. package/types/ngwr-i18n.d.ts +3 -3
  348. package/types/ngwr-icon.d.ts +26 -26
  349. package/types/ngwr-input-number.d.ts +2 -2
  350. package/types/ngwr-input.d.ts +8 -8
  351. package/types/ngwr-load-state.d.ts +6 -6
  352. package/types/ngwr-meta.d.ts +18 -0
  353. package/types/ngwr-pipes.d.ts +6 -4
  354. package/types/ngwr-platform.d.ts +2 -1
  355. package/types/ngwr-popconfirm.d.ts +3 -2
  356. package/types/ngwr-popover.d.ts +4 -3
  357. package/types/ngwr-select.d.ts +33 -18
  358. package/types/ngwr-slider-testing.d.ts +2 -2
  359. package/types/ngwr-slider.d.ts +3 -3
  360. package/types/ngwr-statistic.d.ts +5 -1
  361. package/types/ngwr-storage.d.ts +1 -1
  362. package/types/ngwr-table-testing.d.ts +2 -1
  363. package/types/ngwr-table.d.ts +136 -11
  364. package/types/ngwr-tabs.d.ts +10 -2
  365. package/types/ngwr-toast-testing.d.ts +6 -2
  366. package/types/ngwr-toast.d.ts +33 -5
  367. package/types/ngwr-transfer.d.ts +5 -0
  368. package/types/ngwr-tree.d.ts +22 -2
  369. package/types/ngwr-utils.d.ts +157 -82
  370. package/types/ngwr-validators.d.ts +4 -2
  371. package/types/ngwr-version.d.ts +1 -1
  372. package/types/ngwr.d.ts +1 -0
  373. package/types/pointer-tracker-D7fXxLQL.d.ts +24 -0
  374. package/fesm2022/ngwr-animations-core.mjs.map +0 -1
  375. package/types/ngwr-animations-core.d.ts +0 -294
@@ -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 { clamp, round, 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 showLabel = 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 = clamp(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(round(stepped, 6));\n }\n\n private clampToBounds(v: number): number {\n return clamp(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>\n\n@if (showLabel()) {\n <div class=\"wr-slider__label\">{{ label() }}</div>\n}\n"],"mappings":";;;;;;;;;;;;;AAmEA,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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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>\n\n@if (showValue()) {\n <div class=\"wr-slider__label\">{{ label() }}</div>\n}\n"],"mappings":";;;;;;;;;;;;;AAmEA,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,WA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7 @@ import * as i0 from "@angular/core";
2
2
  import { Component, Directive, ElementRef, InjectionToken, Injector, ViewEncapsulation, afterNextRender, computed, effect, inject, input, model, output, signal } from "@angular/core";
3
3
  import { coerceBooleanProperty } from "@angular/cdk/coercion";
4
4
  import { wrCheckStyles } from "ngwr/utils";
5
- import { readI18nText, useI18nFormatter } from "ngwr/i18n";
5
+ import { useI18nFormatter, wrReadI18nText } from "ngwr/i18n";
6
6
  import { Directionality } from "@angular/cdk/bidi";
7
7
  import * as i1 from "@angular/cdk/drag-drop";
8
8
  import { CdkDrag, CdkDragHandle, CdkDropList, moveItemInArray } from "@angular/cdk/drag-drop";
@@ -42,11 +42,11 @@ var WrSortableList = class WrSortableList {
42
42
  grabbedIndex = signal(null, ...ngDevMode ? [{ debugName: "grabbedIndex" }] : /* istanbul ignore next */ []);
43
43
  announcement = signal("", ...ngDevMode ? [{ debugName: "announcement" }] : /* istanbul ignore next */ []);
44
44
  keyHelpId = `wr-sortable-list-help-${++sortableListUid}`;
45
- resolvedKeyHelp = readI18nText("sortableList.keyHelp", "Press Space to pick this item up, then use the arrow keys to move it. Press Space again to drop it, or Escape to put it back.");
45
+ resolvedKeyHelp = wrReadI18nText("sortableList.keyHelp", "Press Space to pick this item up, then use the arrow keys to move it. Press Space again to drop it, or Escape to put it back.");
46
46
  grabbedText = useI18nFormatter("sortableList.grabbed", "Grabbed. {{index}} of {{total}}.");
47
47
  movedText = useI18nFormatter("sortableList.moved", "{{index}} of {{total}}.");
48
48
  droppedText = useI18nFormatter("sortableList.dropped", "Dropped. {{index}} of {{total}}.");
49
- cancelledText = readI18nText("sortableList.cancelled", "Move cancelled.");
49
+ cancelledText = wrReadI18nText("sortableList.cancelled", "Move cancelled.");
50
50
  grabOrigin = -1;
51
51
  restoringFocus = false;
52
52
  onDrop(event) {
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-sortable-list.mjs","names":[],"sources":["../../../projects/lib/sortable-list/tokens/sortable-list.token.ts","../../../projects/lib/sortable-list/sortable-list.ts","../../../projects/lib/sortable-list/sortable-list.html","../../../projects/lib/sortable-list/sortable-item.ts","../../../projects/lib/sortable-list/drag-handle.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 { InjectionToken } from '@angular/core';\n\nimport type { WrSortableListContext } from '../types';\n\n/**\n * Token a `<wr-sortable-item>` injects to find its parent `<wr-sortable-list>`.\n *\n * Rows arrive through `<ng-content>`, so nothing in the list's template can\n * bind to them and the child has to reach up — the same shape\n * `<wr-carousel-slide>` and `<wr-tab>` use.\n *\n * @internal\n */\nexport const WR_SORTABLE_LIST = new InjectionToken<WrSortableListContext>('WR_SORTABLE_LIST');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';\nimport type { ElementRef } from '@angular/core';\nimport {\n Component,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\n\nimport { readI18nText, useI18nFormatter } from 'ngwr/i18n';\n\nimport { WR_SORTABLE_LIST } from './tokens';\nimport type { WrSortableListContext, WrSortableReorderEvent } from './types';\n\n/** Whether `b` comes after `a` in the document. */\nfunction follows(a: HTMLElement, b: HTMLElement): boolean {\n // eslint-disable-next-line no-bitwise -- compareDocumentPosition answers with a bitmask\n return (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0;\n}\n\n/** Counted, not random: the list prerenders, so the id has to match on rehydration. */\nlet sortableListUid = 0;\n\n/**\n * Drag-to-reorder list. Wraps CDK's `cdkDropList` + `cdkDrag` with a\n * signal-based items binding — the source array is updated in place and\n * emitted via 2-way `[(items)]`.\n *\n * Write the loop yourself and project a `<wr-sortable-item>` per row. Until\n * v15 the list owned the loop and rendered one unnamed `<ng-template\n * let-row let-i=\"index\">`, which said nothing in the markup about where those\n * variables came from and gave a row no way to carry anything of its own. Put\n * `wrDragHandle` on an element inside a row to restrict drag start to a\n * handle; there is no input for it, the directive's presence is the switch.\n *\n * Every row is a tab stop: Space or Enter picks it up, the arrow keys move it,\n * Space or Enter drops it and Escape puts it back. CDK's `cdkDrag` ships no key\n * handling of its own, so without this the component's only function was\n * unreachable from a keyboard.\n *\n * Reading direction: a `horizontal` list follows the VISUAL order, so under\n * `dir=\"rtl\"` ArrowLeft moves the held row toward the higher index — the same\n * rule `wr-slider` applies to its track. A vertical list never mirrors.\n *\n * What that does NOT answer is WCAG 2.5.7, which asks for a POINTER alternative\n * to the drag. Click-to-pick-up is the obvious candidate and is not safe here:\n * the CDK's drag-drop bundle installs no click suppressor of any kind, so the\n * mouseup ending a drag still produces a click, and a row that grabbed itself on\n * click would be picking itself straight back up. A visible move-up /\n * move-down affordance is the remaining answer, and that is a design change.\n *\n * @example\n * ```html\n * <wr-sortable-list [(items)]=\"rows\" (reorder)=\"onReorder($event)\">\n * @for (row of rows(); track row.id) {\n * <wr-sortable-item>\n * <span wrDragHandle>≡</span>\n * {{ row.label }}\n * </wr-sortable-item>\n * }\n * </wr-sortable-list>\n * ```\n *\n * @see https://ngwr.dev/reference/components/sortable-list\n */\n@Component({\n selector: 'wr-sortable-list',\n templateUrl: './sortable-list.html',\n styleUrl: './sortable-list.scss',\n encapsulation: ViewEncapsulation.None,\n imports: [CdkDropList],\n host: { class: 'wr-sortable-list' },\n providers: [{ provide: WR_SORTABLE_LIST, useExisting: WrSortableList }],\n})\nexport class WrSortableList<T = unknown> implements WrSortableListContext {\n /** Items to render. Two-way — emits the reordered array on drop. */\n readonly items = model.required<T[]>();\n\n /** Layout direction. Drives CDK's `cdkDropListOrientation`. @default 'vertical' */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Disable all dragging. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Locked axis — restrict drag movement to one axis even diagonally. */\n readonly lockAxis = input<'x' | 'y' | undefined>(undefined);\n\n /**\n * Delay (ms) before a drag begins after the pointer goes down. The touch\n * delay is the fix for the classic CDK touch snag: without it, the\n * `touch-action: none` CDK puts on each item blocks scrolling the list on a\n * phone. With a small touch delay, a quick swipe scrolls and a brief hold\n * starts the drag; mouse stays instant. Pass a single number to apply one\n * delay to both pointers. @default { touch: 150, mouse: 0 }\n */\n readonly dragStartDelay = input<number | { touch: number; mouse: number }>({ touch: 150, mouse: 0 });\n\n /** Fired after a successful reorder with the new array + indices. */\n readonly reorder = output<WrSortableReorderEvent<T>>();\n\n private readonly injector = inject(Injector);\n\n /**\n * Ambient reading direction, for the horizontal keyboard path only.\n *\n * Optional so a bare `TestBed` — or any consumer that never set a direction —\n * needs no provider; `Directionality` is root-provided, so `null` only ever\n * means \"nobody asked\", which is LTR. Nothing caches a direction-derived\n * value: `isRtl()` is read inside the key handler, so a runtime flip needs no\n * subscription to `Directionality.change`.\n *\n * The POINTER path already mirrors without this — `cdkDropList` injects\n * `Directionality` itself and feeds it to `DropListRef.withDirection`, so a\n * horizontal drag has always followed the visual order. The keyboard path was\n * the half that did not, which is why the two disagreed.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n /**\n * The rows, in projection order, which is the order the consumer's own loop\n * rendered them in — so a row's position here IS its index into `items()`.\n *\n * Collected on construction rather than through `contentChildren`, because\n * the keyboard path has to resolve an index DURING a keydown and a query\n * signal is only guaranteed current after change detection. A row that\n * Angular destroys drops out on the next lookup: the element is gone from\n * the DOM, so `indexOf` cannot find it and the stale entry is swept then.\n */\n private readonly rows: { readonly host: ElementRef<HTMLElement> }[] = [];\n\n /** Index of the row the keyboard is holding, or `null` when nothing is held. */\n readonly grabbedIndex = signal<number | null>(null);\n\n /** Live-region text. Written by the keyboard path only. */\n protected readonly announcement = signal('');\n\n /** Links every row to the key model via `aria-describedby`. */\n readonly keyHelpId = `wr-sortable-list-help-${++sortableListUid}`;\n\n protected readonly resolvedKeyHelp = readI18nText(\n 'sortableList.keyHelp',\n 'Press Space to pick this item up, then use the arrow keys to move it. ' +\n 'Press Space again to drop it, or Escape to put it back.'\n );\n\n private readonly grabbedText = useI18nFormatter('sortableList.grabbed', 'Grabbed. {{index}} of {{total}}.');\n private readonly movedText = useI18nFormatter('sortableList.moved', '{{index}} of {{total}}.');\n private readonly droppedText = useI18nFormatter('sortableList.dropped', 'Dropped. {{index}} of {{total}}.');\n private readonly cancelledText = readI18nText('sortableList.cancelled', 'Move cancelled.');\n\n /** Where the held row started. Escape puts it back there. */\n private grabOrigin = -1;\n\n /** True while a keyboard move is handing focus back — see `onRowFocusout`. */\n private restoringFocus = false;\n\n protected onDrop(event: CdkDragDrop<T[]>): void {\n if (event.previousIndex === event.currentIndex) return;\n const next = this.items().slice();\n moveItemInArray(next, event.previousIndex, event.currentIndex);\n this.items.set(next);\n this.reorder.emit({\n items: next,\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n item: next[event.currentIndex],\n });\n }\n\n /**\n * The keyboard reorder path: pick up, move, drop — deliberately a two-step\n * grab rather than \"an arrow moves the focused row\", so that arrowing through\n * a list a user is only reading can never rearrange it.\n *\n * Keys are handled only when the ROW itself is the event target; a button or\n * an input projected into the row template keeps every key it would normally\n * get.\n */\n /** @internal A row registering itself on construction. */\n register(item: { readonly host: ElementRef<HTMLElement> }): void {\n this.rows.push(item);\n }\n\n /**\n * @internal A row's position among its live siblings.\n *\n * Read off the DOM rather than off the registration order, because a row can\n * be added, removed or moved by the consumer's own loop and construction\n * order survives none of those. Rows whose element has left the document are\n * swept here, which is the only place that can tell.\n */\n indexOf(item: { readonly host: ElementRef<HTMLElement> }): number {\n this.sortRows();\n return this.rows.indexOf(item);\n }\n\n /**\n * Drops rows whose element has left the document and puts the rest into\n * document order.\n *\n * Its own method because `relocate` needs it too: that one focuses\n * `rows[to]` after the move, and without a re-sort it reached into an array\n * still ordered as the list looked BEFORE the move.\n */\n private sortRows(): void {\n for (let i = this.rows.length - 1; i >= 0; i -= 1) {\n if (!this.rows[i].host.nativeElement.isConnected) this.rows.splice(i, 1);\n }\n this.rows.sort((a, b) => (follows(a.host.nativeElement, b.host.nativeElement) ? -1 : 1));\n }\n\n /** @internal */\n onRowKeydown(event: KeyboardEvent, index: number): void {\n if (this.disabled() || event.target !== event.currentTarget) return;\n\n const grabbed = this.grabbedIndex();\n const horizontal = this.orientation() === 'horizontal';\n // The horizontal arrows name a SIDE of the row, so they follow the reading\n // direction: a horizontal list under `dir=\"rtl\"` paints index 0 at the right,\n // so the key that raises the index is ArrowLeft. Raising it on ArrowRight\n // regardless moved the held item away from the arrow the user pressed — the\n // one failure in this set a user cannot rationalise, because it inverts their\n // model of the list silently. The block arrows name a value's direction in a\n // column and never mirror, which is why only the horizontal pair is swapped.\n const rtl = horizontal && this.dir?.value === 'rtl';\n const forward = horizontal ? (rtl ? 'ArrowLeft' : 'ArrowRight') : 'ArrowDown';\n const back = horizontal ? (rtl ? 'ArrowRight' : 'ArrowLeft') : 'ArrowUp';\n\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n if (grabbed === null) this.grab(index);\n else this.drop();\n return;\n }\n\n if (grabbed === null) return;\n\n if (event.key === 'Escape') {\n event.preventDefault();\n // Held only while a row is grabbed — an Escape typed anywhere else has to\n // keep reaching whatever dialog or overlay the list is sitting in.\n event.stopPropagation();\n this.cancelGrab();\n return;\n }\n\n if (event.key === forward || event.key === back) {\n event.preventDefault();\n this.moveGrabbed(event.key === forward ? 1 : -1);\n }\n }\n\n /**\n * Focus leaving a held row ends the gesture as a drop rather than dropping the\n * change on the floor — `[(items)]` has already been written by then, so a\n * silent release would leave `reorder` never reporting a move that happened.\n * The guard is what makes it safe: moving a focused node in the DOM blurs it,\n * so every keyboard move fires this too.\n */\n /** @internal */\n onRowFocusout(): void {\n if (this.restoringFocus || this.grabbedIndex() === null) return;\n this.drop();\n }\n\n private grab(index: number): void {\n this.grabOrigin = index;\n this.grabbedIndex.set(index);\n this.announcement.set(this.grabbedText(this.position(index)));\n }\n\n private moveGrabbed(delta: number): void {\n const from = this.grabbedIndex();\n if (from === null) return;\n const to = from + delta;\n if (to < 0 || to >= this.items().length) return;\n\n this.relocate(from, to);\n this.grabbedIndex.set(to);\n this.announcement.set(this.movedText(this.position(to)));\n }\n\n private drop(): void {\n const to = this.grabbedIndex();\n const from = this.grabOrigin;\n this.grabbedIndex.set(null);\n this.grabOrigin = -1;\n if (to === null) return;\n\n this.announcement.set(this.droppedText(this.position(to)));\n if (from === to) return;\n // One event per gesture, the way a drag emits one on drop — not one per\n // arrow press, which would put a host that persists on `reorder` through a\n // write per keystroke. `[(items)]` still updates on every press, because\n // the rendered order has to follow the row the user is moving.\n this.reorder.emit({ items: this.items(), previousIndex: from, currentIndex: to, item: this.items()[to] });\n }\n\n private cancelGrab(): void {\n const from = this.grabbedIndex();\n if (from === null) return;\n if (from !== this.grabOrigin) this.relocate(from, this.grabOrigin);\n this.grabbedIndex.set(null);\n this.grabOrigin = -1;\n this.announcement.set(this.cancelledText());\n }\n\n private relocate(from: number, to: number): void {\n const next = this.items().slice();\n moveItemInArray(next, from, to);\n this.items.set(next);\n\n // The row is the same DOM node moved to another slot, and moving a focused\n // node hands focus back to `<body>` — so it has to be taken again once the\n // move has rendered. `afterNextRender`, never a microtask: zoneless change\n // detection runs in a macrotask, so a microtask would fire while the row is\n // still at its old index and focus the wrong one. (jsdom keeps focus across\n // a node move, so no spec here can express that half.)\n this.restoringFocus = true;\n afterNextRender(\n () => {\n // Re-sorted FIRST. `this.rows` is only ever put into document order by\n // `indexOf`, and nothing calls it between the move and here — so the\n // array was still in the order it had BEFORE the move, and `rows[to]`\n // was whichever row used to be at that slot. `sortRows()` is the same\n // sweep-and-sort `indexOf` runs; after it, index `to` is the row the\n // move actually put there.\n this.sortRows();\n this.rows[to]?.host.nativeElement.focus();\n this.restoringFocus = false;\n },\n { injector: this.injector }\n );\n }\n\n private position(index: number): { index: number; total: number } {\n return { index: index + 1, total: this.items().length };\n }\n}\n\nexport type { WrSortableReorderEvent } from './types';\n","<!--\n `role=\"list\"` on the container and `role=\"listitem\"` on each row rather than\n bare divs: every row is a tab stop, and a focusable element with no role at\n all is announced as loose text. The list role is what gives the reader the\n position of the row focus lands on.\n\n Rows arrive through `<ng-content>` — the consumer writes the loop, so the\n markup says what each row is instead of hiding it in an unnamed template.\n-->\n<div\n cdkDropList\n role=\"list\"\n class=\"wr-sortable-list__list\"\n [cdkDropListOrientation]=\"orientation()\"\n [cdkDropListDisabled]=\"disabled()\"\n (cdkDropListDropped)=\"onDrop($event)\"\n>\n <ng-content />\n</div>\n\n<!--\n The key model, on every row rather than once on the container: focus lands on\n a row and never on the list itself, so a description hung on the list would\n never be read out.\n-->\n<p class=\"wr-sortable-list__sr-only\" [id]=\"keyHelpId\">{{ resolvedKeyHelp() }}</p>\n\n<!--\n Position announcements, written by the keyboard path only — a drag already\n gives sighted feedback, and announcing every pointer move would flood the\n region.\n-->\n<p class=\"wr-sortable-list__sr-only\" role=\"status\">{{ announcement() }}</p>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { CdkDrag } from '@angular/cdk/drag-drop';\nimport { Component, ElementRef, ViewEncapsulation, computed, effect, inject } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WR_SORTABLE_LIST } from './tokens';\n\n/**\n * One row of a {@link WrSortableList}. Write the loop yourself and put whatever\n * the row shows inside it.\n *\n * It replaced a single unnamed `<ng-template let-row let-i=\"index\">` that the\n * list rendered per item. Two things were wrong with that. The template had no\n * name, so nothing in the markup said what the context variables were or where\n * they came from — a reader had to open the component to learn that `let-row`\n * is the item and `let-i` the index. And a row could not carry anything of its\n * own: every per-row decision had to be an input on the LIST, or a branch\n * inside one template.\n *\n * The row is the tab stop, so the keyboard contract lives here: Space or Enter\n * picks it up, the arrows move it, Space or Enter drops it, Escape puts it\n * back. The list owns the array and the announcements, and this delegates to\n * it — an item knows its own position and nothing else.\n *\n * @example\n * ```html\n * <wr-sortable-list [(items)]=\"rows\">\n * @for (row of rows(); track row.id) {\n * <wr-sortable-item>\n * <span wrDragHandle>≡</span>\n * {{ row.label }}\n * </wr-sortable-item>\n * }\n * </wr-sortable-list>\n * ```\n *\n * @see https://ngwr.dev/reference/components/sortable-list\n */\n@Component({\n selector: 'wr-sortable-item',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [CdkDrag],\n host: {\n class: 'wr-sortable-list__item',\n role: 'listitem',\n '[class.wr-sortable-list__item--grabbed]': 'grabbed()',\n '[attr.tabindex]': 'list.disabled() ? null : 0',\n '[attr.aria-describedby]': 'list.disabled() ? null : list.keyHelpId',\n '(keydown)': 'onKeydown($event)',\n '(focusout)': 'list.onRowFocusout()',\n },\n})\nexport class WrSortableItem {\n /** @internal The list this row belongs to. Read by the host bindings above. */\n protected readonly list = inject(WR_SORTABLE_LIST);\n\n private readonly drag = inject(CdkDrag);\n\n /** @internal */\n readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Position among the list's rows, which IS the index into `items()`: the\n * consumer's own loop renders them in that order.\n *\n * `indexOf` resolves by DOCUMENT ORDER over a plain array and touches no\n * signal, so the `computed` needs a producer that changes whenever a position\n * can. That producer is the `items` ARRAY, not its length: a reorder keeps the\n * count, so a length-keyed index stayed on the slot the row had left, the\n * highlight stayed behind with it, and a second pick-up of the same row moved\n * its old neighbour instead. Host bindings run after the consumer's `@for`\n * has moved the nodes, so the recomputation reads the new order.\n */\n protected readonly index = computed(() => {\n this.list.items();\n return this.list.indexOf(this);\n });\n\n protected readonly grabbed = computed(() => this.list.grabbedIndex() === this.index());\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('sortable-list');\n this.list.register(this);\n\n // Assigned rather than bound, because these belong to the LIST and a host\n // binding cannot reach another directive's input. `CdkDrag` reads all\n // three as plain properties on every gesture, so writing them from an\n // effect is enough and a runtime change takes effect on the next drag.\n effect(() => {\n this.drag.disabled = this.list.disabled();\n this.drag.lockAxis = this.list.lockAxis() ?? null;\n this.drag.dragStartDelay = this.list.dragStartDelay();\n });\n }\n\n /**\n * @internal Resolves the position at the moment of the key, off the DOM,\n * rather than through the cached `index`: nothing has to have rendered\n * between two presses for the answer to be right.\n */\n protected onKeydown(event: KeyboardEvent): void {\n this.list.onRowKeydown(event, this.list.indexOf(this));\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { CdkDragHandle } from '@angular/cdk/drag-drop';\nimport { Directive } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Drag handle for {@link WrSortableList} (and any nested `cdkDrag`).\n * Composes CDK's `cdkDragHandle` via `hostDirectives` so consumers don't\n * need to import the CDK selector directly.\n *\n * @example\n * ```html\n * <wr-sortable-list [(items)]=\"rows\">\n * @for (row of rows(); track row.id) {\n * <wr-sortable-item>\n * <span wrDragHandle class=\"grip\">≡</span>\n * <span>{{ row.label }}</span>\n * </wr-sortable-item>\n * }\n * </wr-sortable-list>\n * ```\n */\n@Directive({\n selector: '[wrDragHandle]',\n hostDirectives: [CdkDragHandle],\n host: { class: 'wr-drag-handle' },\n})\nexport class WrDragHandle {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('sortable-list');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,mBAAmB,IAAI,eAAsC,kBAAkB;;;;;;;ACS5F,SAAS,QAAQ,GAAgB,GAAc;CAE7C,QAAQ,EAAE,wBAAwB,CAAC,IAAI,KAAK,iCAAiC;AAC/E;AAGA,IAAI,kBAAkB;AAqDtB,IAAa,iB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AAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EALxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,gBAAgB,CAAC,aAAa;GAC9B,MAAM,EAAE,OAAO,iBAAgB;EAChC,CAAA"}
1
+ {"version":3,"file":"ngwr-sortable-list.mjs","names":[],"sources":["../../../projects/lib/sortable-list/tokens/sortable-list.token.ts","../../../projects/lib/sortable-list/sortable-list.ts","../../../projects/lib/sortable-list/sortable-list.html","../../../projects/lib/sortable-list/sortable-item.ts","../../../projects/lib/sortable-list/drag-handle.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 { InjectionToken } from '@angular/core';\n\nimport type { WrSortableListContext } from '../types';\n\n/**\n * Token a `<wr-sortable-item>` injects to find its parent `<wr-sortable-list>`.\n *\n * Rows arrive through `<ng-content>`, so nothing in the list's template can\n * bind to them and the child has to reach up — the same shape\n * `<wr-carousel-slide>` and `<wr-tab>` use.\n *\n * @internal\n */\nexport const WR_SORTABLE_LIST = new InjectionToken<WrSortableListContext>('WR_SORTABLE_LIST');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { type CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';\nimport type { ElementRef } from '@angular/core';\nimport {\n Component,\n Injector,\n ViewEncapsulation,\n afterNextRender,\n inject,\n input,\n model,\n output,\n signal,\n} from '@angular/core';\n\nimport { wrReadI18nText, useI18nFormatter } from 'ngwr/i18n';\n\nimport { WR_SORTABLE_LIST } from './tokens';\nimport type { WrSortableListContext, WrSortableReorderEvent } from './types';\n\n/** Whether `b` comes after `a` in the document. */\nfunction follows(a: HTMLElement, b: HTMLElement): boolean {\n // eslint-disable-next-line no-bitwise -- compareDocumentPosition answers with a bitmask\n return (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0;\n}\n\n/** Counted, not random: the list prerenders, so the id has to match on rehydration. */\nlet sortableListUid = 0;\n\n/**\n * Drag-to-reorder list. Wraps CDK's `cdkDropList` + `cdkDrag` with a\n * signal-based items binding — the source array is updated in place and\n * emitted via 2-way `[(items)]`.\n *\n * Write the loop yourself and project a `<wr-sortable-item>` per row. Until\n * v15 the list owned the loop and rendered one unnamed `<ng-template\n * let-row let-i=\"index\">`, which said nothing in the markup about where those\n * variables came from and gave a row no way to carry anything of its own. Put\n * `wrDragHandle` on an element inside a row to restrict drag start to a\n * handle; there is no input for it, the directive's presence is the switch.\n *\n * Every row is a tab stop: Space or Enter picks it up, the arrow keys move it,\n * Space or Enter drops it and Escape puts it back. CDK's `cdkDrag` ships no key\n * handling of its own, so without this the component's only function was\n * unreachable from a keyboard.\n *\n * Reading direction: a `horizontal` list follows the VISUAL order, so under\n * `dir=\"rtl\"` ArrowLeft moves the held row toward the higher index — the same\n * rule `wr-slider` applies to its track. A vertical list never mirrors.\n *\n * What that does NOT answer is WCAG 2.5.7, which asks for a POINTER alternative\n * to the drag. Click-to-pick-up is the obvious candidate and is not safe here:\n * the CDK's drag-drop bundle installs no click suppressor of any kind, so the\n * mouseup ending a drag still produces a click, and a row that grabbed itself on\n * click would be picking itself straight back up. A visible move-up /\n * move-down affordance is the remaining answer, and that is a design change.\n *\n * @example\n * ```html\n * <wr-sortable-list [(items)]=\"rows\" (reorder)=\"onReorder($event)\">\n * @for (row of rows(); track row.id) {\n * <wr-sortable-item>\n * <span wrDragHandle>≡</span>\n * {{ row.label }}\n * </wr-sortable-item>\n * }\n * </wr-sortable-list>\n * ```\n *\n * @see https://ngwr.dev/reference/components/sortable-list\n */\n@Component({\n selector: 'wr-sortable-list',\n templateUrl: './sortable-list.html',\n styleUrl: './sortable-list.scss',\n encapsulation: ViewEncapsulation.None,\n imports: [CdkDropList],\n host: { class: 'wr-sortable-list' },\n providers: [{ provide: WR_SORTABLE_LIST, useExisting: WrSortableList }],\n})\nexport class WrSortableList<T = unknown> implements WrSortableListContext {\n /** Items to render. Two-way — emits the reordered array on drop. */\n readonly items = model.required<T[]>();\n\n /** Layout direction. Drives CDK's `cdkDropListOrientation`. @default 'vertical' */\n readonly orientation = input<'vertical' | 'horizontal'>('vertical');\n\n /** Disable all dragging. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Locked axis — restrict drag movement to one axis even diagonally. */\n readonly lockAxis = input<'x' | 'y' | undefined>(undefined);\n\n /**\n * Delay (ms) before a drag begins after the pointer goes down. The touch\n * delay is the fix for the classic CDK touch snag: without it, the\n * `touch-action: none` CDK puts on each item blocks scrolling the list on a\n * phone. With a small touch delay, a quick swipe scrolls and a brief hold\n * starts the drag; mouse stays instant. Pass a single number to apply one\n * delay to both pointers. @default { touch: 150, mouse: 0 }\n */\n readonly dragStartDelay = input<number | { touch: number; mouse: number }>({ touch: 150, mouse: 0 });\n\n /** Fired after a successful reorder with the new array + indices. */\n readonly reorder = output<WrSortableReorderEvent<T>>();\n\n private readonly injector = inject(Injector);\n\n /**\n * Ambient reading direction, for the horizontal keyboard path only.\n *\n * Optional so a bare `TestBed` — or any consumer that never set a direction —\n * needs no provider; `Directionality` is root-provided, so `null` only ever\n * means \"nobody asked\", which is LTR. Nothing caches a direction-derived\n * value: `isRtl()` is read inside the key handler, so a runtime flip needs no\n * subscription to `Directionality.change`.\n *\n * The POINTER path already mirrors without this — `cdkDropList` injects\n * `Directionality` itself and feeds it to `DropListRef.withDirection`, so a\n * horizontal drag has always followed the visual order. The keyboard path was\n * the half that did not, which is why the two disagreed.\n */\n private readonly dir = inject(Directionality, { optional: true });\n\n /**\n * The rows, in projection order, which is the order the consumer's own loop\n * rendered them in — so a row's position here IS its index into `items()`.\n *\n * Collected on construction rather than through `contentChildren`, because\n * the keyboard path has to resolve an index DURING a keydown and a query\n * signal is only guaranteed current after change detection. A row that\n * Angular destroys drops out on the next lookup: the element is gone from\n * the DOM, so `indexOf` cannot find it and the stale entry is swept then.\n */\n private readonly rows: { readonly host: ElementRef<HTMLElement> }[] = [];\n\n /** Index of the row the keyboard is holding, or `null` when nothing is held. */\n readonly grabbedIndex = signal<number | null>(null);\n\n /** Live-region text. Written by the keyboard path only. */\n protected readonly announcement = signal('');\n\n /** Links every row to the key model via `aria-describedby`. */\n readonly keyHelpId = `wr-sortable-list-help-${++sortableListUid}`;\n\n protected readonly resolvedKeyHelp = wrReadI18nText(\n 'sortableList.keyHelp',\n 'Press Space to pick this item up, then use the arrow keys to move it. ' +\n 'Press Space again to drop it, or Escape to put it back.'\n );\n\n private readonly grabbedText = useI18nFormatter('sortableList.grabbed', 'Grabbed. {{index}} of {{total}}.');\n private readonly movedText = useI18nFormatter('sortableList.moved', '{{index}} of {{total}}.');\n private readonly droppedText = useI18nFormatter('sortableList.dropped', 'Dropped. {{index}} of {{total}}.');\n private readonly cancelledText = wrReadI18nText('sortableList.cancelled', 'Move cancelled.');\n\n /** Where the held row started. Escape puts it back there. */\n private grabOrigin = -1;\n\n /** True while a keyboard move is handing focus back — see `onRowFocusout`. */\n private restoringFocus = false;\n\n protected onDrop(event: CdkDragDrop<T[]>): void {\n if (event.previousIndex === event.currentIndex) return;\n const next = this.items().slice();\n moveItemInArray(next, event.previousIndex, event.currentIndex);\n this.items.set(next);\n this.reorder.emit({\n items: next,\n previousIndex: event.previousIndex,\n currentIndex: event.currentIndex,\n item: next[event.currentIndex],\n });\n }\n\n /**\n * The keyboard reorder path: pick up, move, drop — deliberately a two-step\n * grab rather than \"an arrow moves the focused row\", so that arrowing through\n * a list a user is only reading can never rearrange it.\n *\n * Keys are handled only when the ROW itself is the event target; a button or\n * an input projected into the row template keeps every key it would normally\n * get.\n */\n /** @internal A row registering itself on construction. */\n register(item: { readonly host: ElementRef<HTMLElement> }): void {\n this.rows.push(item);\n }\n\n /**\n * @internal A row's position among its live siblings.\n *\n * Read off the DOM rather than off the registration order, because a row can\n * be added, removed or moved by the consumer's own loop and construction\n * order survives none of those. Rows whose element has left the document are\n * swept here, which is the only place that can tell.\n */\n indexOf(item: { readonly host: ElementRef<HTMLElement> }): number {\n this.sortRows();\n return this.rows.indexOf(item);\n }\n\n /**\n * Drops rows whose element has left the document and puts the rest into\n * document order.\n *\n * Its own method because `relocate` needs it too: that one focuses\n * `rows[to]` after the move, and without a re-sort it reached into an array\n * still ordered as the list looked BEFORE the move.\n */\n private sortRows(): void {\n for (let i = this.rows.length - 1; i >= 0; i -= 1) {\n if (!this.rows[i].host.nativeElement.isConnected) this.rows.splice(i, 1);\n }\n this.rows.sort((a, b) => (follows(a.host.nativeElement, b.host.nativeElement) ? -1 : 1));\n }\n\n /** @internal */\n onRowKeydown(event: KeyboardEvent, index: number): void {\n if (this.disabled() || event.target !== event.currentTarget) return;\n\n const grabbed = this.grabbedIndex();\n const horizontal = this.orientation() === 'horizontal';\n // The horizontal arrows name a SIDE of the row, so they follow the reading\n // direction: a horizontal list under `dir=\"rtl\"` paints index 0 at the right,\n // so the key that raises the index is ArrowLeft. Raising it on ArrowRight\n // regardless moved the held item away from the arrow the user pressed — the\n // one failure in this set a user cannot rationalise, because it inverts their\n // model of the list silently. The block arrows name a value's direction in a\n // column and never mirror, which is why only the horizontal pair is swapped.\n const rtl = horizontal && this.dir?.value === 'rtl';\n const forward = horizontal ? (rtl ? 'ArrowLeft' : 'ArrowRight') : 'ArrowDown';\n const back = horizontal ? (rtl ? 'ArrowRight' : 'ArrowLeft') : 'ArrowUp';\n\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n if (grabbed === null) this.grab(index);\n else this.drop();\n return;\n }\n\n if (grabbed === null) return;\n\n if (event.key === 'Escape') {\n event.preventDefault();\n // Held only while a row is grabbed — an Escape typed anywhere else has to\n // keep reaching whatever dialog or overlay the list is sitting in.\n event.stopPropagation();\n this.cancelGrab();\n return;\n }\n\n if (event.key === forward || event.key === back) {\n event.preventDefault();\n this.moveGrabbed(event.key === forward ? 1 : -1);\n }\n }\n\n /**\n * Focus leaving a held row ends the gesture as a drop rather than dropping the\n * change on the floor — `[(items)]` has already been written by then, so a\n * silent release would leave `reorder` never reporting a move that happened.\n * The guard is what makes it safe: moving a focused node in the DOM blurs it,\n * so every keyboard move fires this too.\n */\n /** @internal */\n onRowFocusout(): void {\n if (this.restoringFocus || this.grabbedIndex() === null) return;\n this.drop();\n }\n\n private grab(index: number): void {\n this.grabOrigin = index;\n this.grabbedIndex.set(index);\n this.announcement.set(this.grabbedText(this.position(index)));\n }\n\n private moveGrabbed(delta: number): void {\n const from = this.grabbedIndex();\n if (from === null) return;\n const to = from + delta;\n if (to < 0 || to >= this.items().length) return;\n\n this.relocate(from, to);\n this.grabbedIndex.set(to);\n this.announcement.set(this.movedText(this.position(to)));\n }\n\n private drop(): void {\n const to = this.grabbedIndex();\n const from = this.grabOrigin;\n this.grabbedIndex.set(null);\n this.grabOrigin = -1;\n if (to === null) return;\n\n this.announcement.set(this.droppedText(this.position(to)));\n if (from === to) return;\n // One event per gesture, the way a drag emits one on drop — not one per\n // arrow press, which would put a host that persists on `reorder` through a\n // write per keystroke. `[(items)]` still updates on every press, because\n // the rendered order has to follow the row the user is moving.\n this.reorder.emit({ items: this.items(), previousIndex: from, currentIndex: to, item: this.items()[to] });\n }\n\n private cancelGrab(): void {\n const from = this.grabbedIndex();\n if (from === null) return;\n if (from !== this.grabOrigin) this.relocate(from, this.grabOrigin);\n this.grabbedIndex.set(null);\n this.grabOrigin = -1;\n this.announcement.set(this.cancelledText());\n }\n\n private relocate(from: number, to: number): void {\n const next = this.items().slice();\n moveItemInArray(next, from, to);\n this.items.set(next);\n\n // The row is the same DOM node moved to another slot, and moving a focused\n // node hands focus back to `<body>` — so it has to be taken again once the\n // move has rendered. `afterNextRender`, never a microtask: zoneless change\n // detection runs in a macrotask, so a microtask would fire while the row is\n // still at its old index and focus the wrong one. (jsdom keeps focus across\n // a node move, so no spec here can express that half.)\n this.restoringFocus = true;\n afterNextRender(\n () => {\n // Re-sorted FIRST. `this.rows` is only ever put into document order by\n // `indexOf`, and nothing calls it between the move and here — so the\n // array was still in the order it had BEFORE the move, and `rows[to]`\n // was whichever row used to be at that slot. `sortRows()` is the same\n // sweep-and-sort `indexOf` runs; after it, index `to` is the row the\n // move actually put there.\n this.sortRows();\n this.rows[to]?.host.nativeElement.focus();\n this.restoringFocus = false;\n },\n { injector: this.injector }\n );\n }\n\n private position(index: number): { index: number; total: number } {\n return { index: index + 1, total: this.items().length };\n }\n}\n\nexport type { WrSortableReorderEvent } from './types';\n","<!--\n `role=\"list\"` on the container and `role=\"listitem\"` on each row rather than\n bare divs: every row is a tab stop, and a focusable element with no role at\n all is announced as loose text. The list role is what gives the reader the\n position of the row focus lands on.\n\n Rows arrive through `<ng-content>` — the consumer writes the loop, so the\n markup says what each row is instead of hiding it in an unnamed template.\n-->\n<div\n cdkDropList\n role=\"list\"\n class=\"wr-sortable-list__list\"\n [cdkDropListOrientation]=\"orientation()\"\n [cdkDropListDisabled]=\"disabled()\"\n (cdkDropListDropped)=\"onDrop($event)\"\n>\n <ng-content />\n</div>\n\n<!--\n The key model, on every row rather than once on the container: focus lands on\n a row and never on the list itself, so a description hung on the list would\n never be read out.\n-->\n<p class=\"wr-sortable-list__sr-only\" [id]=\"keyHelpId\">{{ resolvedKeyHelp() }}</p>\n\n<!--\n Position announcements, written by the keyboard path only — a drag already\n gives sighted feedback, and announcing every pointer move would flood the\n region.\n-->\n<p class=\"wr-sortable-list__sr-only\" role=\"status\">{{ announcement() }}</p>\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { CdkDrag } from '@angular/cdk/drag-drop';\nimport { Component, ElementRef, ViewEncapsulation, computed, effect, inject } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WR_SORTABLE_LIST } from './tokens';\n\n/**\n * One row of a {@link WrSortableList}. Write the loop yourself and put whatever\n * the row shows inside it.\n *\n * It replaced a single unnamed `<ng-template let-row let-i=\"index\">` that the\n * list rendered per item. Two things were wrong with that. The template had no\n * name, so nothing in the markup said what the context variables were or where\n * they came from — a reader had to open the component to learn that `let-row`\n * is the item and `let-i` the index. And a row could not carry anything of its\n * own: every per-row decision had to be an input on the LIST, or a branch\n * inside one template.\n *\n * The row is the tab stop, so the keyboard contract lives here: Space or Enter\n * picks it up, the arrows move it, Space or Enter drops it, Escape puts it\n * back. The list owns the array and the announcements, and this delegates to\n * it — an item knows its own position and nothing else.\n *\n * @example\n * ```html\n * <wr-sortable-list [(items)]=\"rows\">\n * @for (row of rows(); track row.id) {\n * <wr-sortable-item>\n * <span wrDragHandle>≡</span>\n * {{ row.label }}\n * </wr-sortable-item>\n * }\n * </wr-sortable-list>\n * ```\n *\n * @see https://ngwr.dev/reference/components/sortable-list\n */\n@Component({\n selector: 'wr-sortable-item',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [CdkDrag],\n host: {\n class: 'wr-sortable-list__item',\n role: 'listitem',\n '[class.wr-sortable-list__item--grabbed]': 'grabbed()',\n '[attr.tabindex]': 'list.disabled() ? null : 0',\n '[attr.aria-describedby]': 'list.disabled() ? null : list.keyHelpId',\n '(keydown)': 'onKeydown($event)',\n '(focusout)': 'list.onRowFocusout()',\n },\n})\nexport class WrSortableItem {\n /** @internal The list this row belongs to. Read by the host bindings above. */\n protected readonly list = inject(WR_SORTABLE_LIST);\n\n private readonly drag = inject(CdkDrag);\n\n /** @internal */\n readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Position among the list's rows, which IS the index into `items()`: the\n * consumer's own loop renders them in that order.\n *\n * `indexOf` resolves by DOCUMENT ORDER over a plain array and touches no\n * signal, so the `computed` needs a producer that changes whenever a position\n * can. That producer is the `items` ARRAY, not its length: a reorder keeps the\n * count, so a length-keyed index stayed on the slot the row had left, the\n * highlight stayed behind with it, and a second pick-up of the same row moved\n * its old neighbour instead. Host bindings run after the consumer's `@for`\n * has moved the nodes, so the recomputation reads the new order.\n */\n protected readonly index = computed(() => {\n this.list.items();\n return this.list.indexOf(this);\n });\n\n protected readonly grabbed = computed(() => this.list.grabbedIndex() === this.index());\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('sortable-list');\n this.list.register(this);\n\n // Assigned rather than bound, because these belong to the LIST and a host\n // binding cannot reach another directive's input. `CdkDrag` reads all\n // three as plain properties on every gesture, so writing them from an\n // effect is enough and a runtime change takes effect on the next drag.\n effect(() => {\n this.drag.disabled = this.list.disabled();\n this.drag.lockAxis = this.list.lockAxis() ?? null;\n this.drag.dragStartDelay = this.list.dragStartDelay();\n });\n }\n\n /**\n * @internal Resolves the position at the moment of the key, off the DOM,\n * rather than through the cached `index`: nothing has to have rendered\n * between two presses for the answer to be right.\n */\n protected onKeydown(event: KeyboardEvent): void {\n this.list.onRowKeydown(event, this.list.indexOf(this));\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { CdkDragHandle } from '@angular/cdk/drag-drop';\nimport { Directive } from '@angular/core';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Drag handle for {@link WrSortableList} (and any nested `cdkDrag`).\n * Composes CDK's `cdkDragHandle` via `hostDirectives` so consumers don't\n * need to import the CDK selector directly.\n *\n * @example\n * ```html\n * <wr-sortable-list [(items)]=\"rows\">\n * @for (row of rows(); track row.id) {\n * <wr-sortable-item>\n * <span wrDragHandle class=\"grip\">≡</span>\n * <span>{{ row.label }}</span>\n * </wr-sortable-item>\n * }\n * </wr-sortable-list>\n * ```\n */\n@Directive({\n selector: '[wrDragHandle]',\n hostDirectives: [CdkDragHandle],\n host: { class: 'wr-drag-handle' },\n})\nexport class WrDragHandle {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('sortable-list');\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,mBAAmB,IAAI,eAAsC,kBAAkB;;;;;;;ACS5F,SAAS,QAAQ,GAAgB,GAAc;CAE7C,QAAQ,EAAE,wBAAwB,CAAC,IAAI,KAAK,iCAAiC;AAC/E;AAGA,IAAI,kBAAkB;AAqDtB,IAAa,iBAAb,MAAa,eAAc;CAEhB,QAAQ,MAAM,SAAe,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAG7B,cAAc,MAAiC,YAAW,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAG1D,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,WAAW,MAA6B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAUlD,iBAAiB,MAAiD;EAAE,OAAO;EAAK,OAAO;CAAC,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;CAG3F,UAAU,OAAM;CAER,WAAW,OAAO,QAAQ;CAgB1B,MAAM,OAAO,gBAAgB,EAAE,UAAU,KAAI,CAAE;CAY/C,OAAqD,CAAA;CAG7D,eAAe,OAAsB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAGhC,eAAe,OAAO,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAGnC,YAAY,yBAAyB,EAAE;CAE7B,kBAAkB,eACnC,wBACA,+HAC2D;CAG5C,cAAc,iBAAiB,wBAAwB,kCAAkC;CACz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AAW,cAAc,eAAe;CAClF;CAHW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAY,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAZ,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,MAAA,EAAA,gBAAA,iBAAA;EAAA,gBAAA,CAAA,EAAA,WAAA,GAAA,cAAA,CAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EALxB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,gBAAgB,CAAC,aAAa;GAC9B,MAAM,EAAE,OAAO,iBAAgB;EAChC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { Component, ElementRef, ViewEncapsulation, computed, effect, inject, input, model } from "@angular/core";
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
- import { clamp, round, wrCheckStyles } from "ngwr/utils";
4
+ import { wrCheckStyles, wrClamp, wrRound } from "ngwr/utils";
5
5
  import { useI18nText } from "ngwr/i18n";
6
6
  import { Directionality } from "@angular/cdk/bidi";
7
7
  /**
@@ -33,7 +33,7 @@ var WrSplitter = class WrSplitter {
33
33
  constructor() {
34
34
  if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("splitter");
35
35
  effect(() => {
36
- const clamped = clamp(this.position(), this.minPosition(), this.maxPosition());
36
+ const clamped = wrClamp(this.position(), this.minPosition(), this.maxPosition());
37
37
  if (clamped !== this.position()) this.position.set(clamped);
38
38
  });
39
39
  }
@@ -57,7 +57,7 @@ var WrSplitter = class WrSplitter {
57
57
  if (!this.dragging) return;
58
58
  const rect = this.host.nativeElement.getBoundingClientRect();
59
59
  const raw = this.orientation() === "horizontal" ? this.inlineFraction(event.clientX, rect) * 100 : (event.clientY - rect.top) / rect.height * 100;
60
- this.position.set(clamp(round(raw, 1), this.minPosition(), this.maxPosition()));
60
+ this.position.set(wrClamp(wrRound(raw, 1), this.minPosition(), this.maxPosition()));
61
61
  }
62
62
  onPointerUp(event) {
63
63
  if (!this.dragging) return;
@@ -67,7 +67,7 @@ var WrSplitter = class WrSplitter {
67
67
  onKeydown(event) {
68
68
  if (this.disabled()) return;
69
69
  const step = event.shiftKey ? 10 : 1;
70
- const position = round(this.position());
70
+ const position = wrRound(this.position());
71
71
  let next = null;
72
72
  if (this.orientation() === "horizontal") {
73
73
  const inline = this.isRtl() ? -step : step;
@@ -79,7 +79,7 @@ var WrSplitter = class WrSplitter {
79
79
  else if (event.key === "End") next = this.maxPosition();
80
80
  if (next === null) return;
81
81
  event.preventDefault();
82
- this.position.set(clamp(next, this.minPosition(), this.maxPosition()));
82
+ this.position.set(wrClamp(next, this.minPosition(), this.maxPosition()));
83
83
  }
84
84
  inlineFraction(clientX, rect) {
85
85
  return this.isRtl() ? (rect.right - clientX) / rect.width : (clientX - rect.left) / rect.width;
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-splitter.mjs","names":[],"sources":["../../../projects/lib/splitter/splitter.ts","../../../projects/lib/splitter/splitter.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 { Component, ElementRef, ViewEncapsulation, computed, effect, inject, input, model } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { clamp, round, wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Resizable two-pane splitter. Project two pieces of content via\n * `[wrSplitterStart]` and `[wrSplitterEnd]`; the user drags the divider\n * to reallocate space between them.\n *\n * @example\n * ```html\n * <wr-splitter [(position)]=\"pos\">\n * <div wrSplitterStart>Files</div>\n * <div wrSplitterEnd>Editor</div>\n * </wr-splitter>\n *\n * <wr-splitter orientation=\"vertical\" [minPosition]=\"20\" [maxPosition]=\"80\">\n * <div wrSplitterStart>Preview</div>\n * <div wrSplitterEnd>Logs</div>\n * </wr-splitter>\n * ```\n *\n * @see https://ngwr.dev/reference/components/splitter\n */\n@Component({\n selector: 'wr-splitter',\n templateUrl: './splitter.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()' },\n})\nexport class WrSplitter {\n /** Position of the divider as a percentage (0–100). Two-way bindable. @default 50 */\n readonly position = model(50);\n\n /**\n * Divider direction:\n * - `'horizontal'` — vertical divider, drags L/R (panes side by side).\n * - `'vertical'` — horizontal divider, drags U/D (panes stacked).\n * @default 'horizontal'\n */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /** Minimum allowed position. @default 0 */\n readonly minPosition = input(0, { transform: (v: unknown): number => coerceNumberProperty(v, 0) });\n\n /** Maximum allowed position. @default 100 */\n readonly maxPosition = input(100, { transform: (v: unknown): number => coerceNumberProperty(v, 100) });\n\n /** Disable dragging. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Accessible name of the divider. A focusable `role=\"separator\"` is an\n * interactive widget, so it needs one — without it a screen reader reaching the\n * divider announces nothing but \"separator\" and its number. Falls back to\n * `splitter.divider`.\n */\n readonly dividerLabel = input<string | null>(null);\n\n protected readonly resolvedDividerLabel = useI18nText(this.dividerLabel, 'splitter.divider', 'Resize panes');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n // Optional on purpose: `Directionality` is root-provided, so a consumer never has to\n // supply it — and a bare `TestBed` does not either.\n private readonly dir = inject(Directionality, { optional: true });\n private dragging = false;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('splitter');\n // `position` is a `model`, so `[(position)]` and a restored layout write into it\n // directly; only the drag and the arrows clamped. Left alone, an out-of-range\n // write reached the DOM as `aria-valuenow=\"150\"` against a `valuemax` of 100 and\n // sized a pane at `150%`.\n effect(() => {\n const clamped = clamp(this.position(), this.minPosition(), this.maxPosition());\n if (clamped !== this.position()) this.position.set(clamped);\n });\n }\n\n protected readonly classes = computed(() => {\n const parts = ['wr-splitter', `wr-splitter--${this.orientation()}`];\n if (this.disabled()) parts.push('wr-splitter--disabled');\n return parts.join(' ');\n });\n\n protected readonly startStyle = computed(() => `${this.position()}%`);\n protected readonly endStyle = computed(() => `${100 - this.position()}%`);\n\n // Drag\n\n protected onPointerDown(event: PointerEvent): void {\n if (this.disabled()) return;\n // Any pointerdown used to start a drag, so holding the RIGHT button over the\n // divider and moving resized the panes; the same guard keeps a second finger\n // from taking over a drag already in progress.\n if (event.button !== 0 || !event.isPrimary) return;\n event.preventDefault();\n this.dragging = true;\n const handle = event.currentTarget as HTMLElement;\n handle.setPointerCapture(event.pointerId);\n // `preventDefault` above also suppresses the click's default focus, so without\n // this the arrows did nothing after a mouse drag until the user found the\n // divider again with Tab. `wr-slider` focuses its thumb for the same reason.\n handle.focus();\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (!this.dragging) return;\n const rect = this.host.nativeElement.getBoundingClientRect();\n const raw =\n this.orientation() === 'horizontal'\n ? this.inlineFraction(event.clientX, rect) * 100\n : // The vertical split is laid out on the BLOCK axis, which `dir` does not\n // touch — measured from the top in both directions.\n ((event.clientY - rect.top) / rect.height) * 100;\n // To a tenth of a percent — about a pixel on a full-width split. The raw\n // quotient reached `aria-valuenow` and `[(position)]` as `29.99999822054938`,\n // read out digit by digit and handed to the host to persist.\n this.position.set(clamp(round(raw, 1), this.minPosition(), this.maxPosition()));\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (!this.dragging) return;\n this.dragging = false;\n (event.currentTarget as HTMLElement).releasePointerCapture(event.pointerId);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled()) return;\n const step = event.shiftKey ? 10 : 1;\n // An arrow step lands on a whole number, so the keys after a drag do not\n // carry the drag's fraction along (`30.4` stepped to `31.4`, `32.4`, …).\n // Home and End below are the bounds themselves, whatever they are.\n const position = round(this.position());\n let next: number | null = null;\n if (this.orientation() === 'horizontal') {\n // Arrows follow the VISUAL axis (WAI-ARIA APG). Under `dir=\"rtl\"` the start pane\n // is the one on the RIGHT, so the visual right is the low end of the range and\n // ArrowRight has to shrink the position rather than grow it — otherwise the\n // divider walks away from the key the user is pressing.\n const inline = this.isRtl() ? -step : step;\n if (event.key === 'ArrowLeft') next = position - inline;\n else if (event.key === 'ArrowRight') next = position + inline;\n } else {\n // Block axis: unaffected by `dir`.\n if (event.key === 'ArrowUp') next = position - step;\n else if (event.key === 'ArrowDown') next = position + step;\n }\n // Home/End are semantic — first/last, not left/right — so they never mirror.\n if (event.key === 'Home') next = this.minPosition();\n else if (event.key === 'End') next = this.maxPosition();\n if (next === null) return;\n event.preventDefault();\n this.position.set(clamp(next, this.minPosition(), this.maxPosition()));\n }\n\n /**\n * Fraction of the host's width measured from the INLINE-START edge — the left edge in\n * LTR, the right edge in RTL, which is where `flex-direction: row` puts the start pane\n * whose size `position` is. Counted from `rect.left` in both, a drag under `dir=\"rtl\"`\n * read 0 where the start pane was widest and inverted the whole gesture.\n */\n private inlineFraction(clientX: number, rect: DOMRect): number {\n return this.isRtl() ? (rect.right - clientX) / rect.width : (clientX - rect.left) / rect.width;\n }\n\n /**\n * Read per event rather than cached: nothing this component renders is derived from the\n * direction — `flex-direction: row` mirrors the panes on its own — so there is no stale\n * value for `Directionality.change` to invalidate.\n */\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n}\n","<div class=\"wr-splitter__pane wr-splitter__pane--start\" [style.flex-basis]=\"startStyle()\">\n <ng-content select=\"[wrSplitterStart]\" />\n</div>\n\n<!-- Roving focus + arrow keys for keyboard resizing. -->\n<div\n class=\"wr-splitter__divider\"\n role=\"separator\"\n [attr.aria-label]=\"resolvedDividerLabel()\"\n [attr.aria-orientation]=\"orientation() === 'horizontal' ? 'vertical' : 'horizontal'\"\n [attr.aria-valuemin]=\"minPosition()\"\n [attr.aria-valuemax]=\"maxPosition()\"\n [attr.aria-valuenow]=\"position()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"wr-splitter__handle\" aria-hidden=\"true\"></span>\n</div>\n\n<div class=\"wr-splitter__pane wr-splitter__pane--end\" [style.flex-basis]=\"endStyle()\">\n <ng-content select=\"[wrSplitterEnd]\" />\n</div>\n"],"mappings":";;;;;;;;;;;;AAwCA,IAAa,aAAb,MAAa,WAAU;CAEZ,WAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAQpB,cAAc,MAAiC,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAG5D,cAAc,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,qBAAqB,GAAG,CAAC;CAAC,CAAA;CAGtF,cAAc,MAAM,KAAG;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,qBAAqB,GAAG,GAAG;CAAC,CAAA;CAG1F,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAQ1D,eAAe,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAE/B,uBAAuB,YAAY,KAAK,cAAc,oBAAoB,cAAc;CAE1F,OAAO,OAAgC,UAAU;CAGjD,M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A;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,UAAA,iBAAA;EAAA,MAAA,EAAA,YAAA,EAAA,SAAA,YAAA,EAAA;EAAA,UAAA;EAAA,UCxCvB;EA2BA,eAAA,GAAA,kBAAA;CAAA,CAAA;;ADaa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EANtB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,eAER,kBAAkB;GAAI,MAC/B,EAAE,WAAW,YAAW;GAAE,UAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-splitter.mjs","names":[],"sources":["../../../projects/lib/splitter/splitter.ts","../../../projects/lib/splitter/splitter.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 { Component, ElementRef, ViewEncapsulation, computed, effect, inject, input, model } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrClamp, wrRound, wrCheckStyles } from 'ngwr/utils';\n\n/**\n * Resizable two-pane splitter. Project two pieces of content via\n * `[wrSplitterStart]` and `[wrSplitterEnd]`; the user drags the divider\n * to reallocate space between them.\n *\n * @example\n * ```html\n * <wr-splitter [(position)]=\"pos\">\n * <div wrSplitterStart>Files</div>\n * <div wrSplitterEnd>Editor</div>\n * </wr-splitter>\n *\n * <wr-splitter orientation=\"vertical\" [minPosition]=\"20\" [maxPosition]=\"80\">\n * <div wrSplitterStart>Preview</div>\n * <div wrSplitterEnd>Logs</div>\n * </wr-splitter>\n * ```\n *\n * @see https://ngwr.dev/reference/components/splitter\n */\n@Component({\n selector: 'wr-splitter',\n templateUrl: './splitter.html',\n encapsulation: ViewEncapsulation.None,\n host: { '[class]': 'classes()' },\n})\nexport class WrSplitter {\n /** Position of the divider as a percentage (0–100). Two-way bindable. @default 50 */\n readonly position = model(50);\n\n /**\n * Divider direction:\n * - `'horizontal'` — vertical divider, drags L/R (panes side by side).\n * - `'vertical'` — horizontal divider, drags U/D (panes stacked).\n * @default 'horizontal'\n */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /** Minimum allowed position. @default 0 */\n readonly minPosition = input(0, { transform: (v: unknown): number => coerceNumberProperty(v, 0) });\n\n /** Maximum allowed position. @default 100 */\n readonly maxPosition = input(100, { transform: (v: unknown): number => coerceNumberProperty(v, 100) });\n\n /** Disable dragging. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Accessible name of the divider. A focusable `role=\"separator\"` is an\n * interactive widget, so it needs one — without it a screen reader reaching the\n * divider announces nothing but \"separator\" and its number. Falls back to\n * `splitter.divider`.\n */\n readonly dividerLabel = input<string | null>(null);\n\n protected readonly resolvedDividerLabel = useI18nText(this.dividerLabel, 'splitter.divider', 'Resize panes');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n // Optional on purpose: `Directionality` is root-provided, so a consumer never has to\n // supply it — and a bare `TestBed` does not either.\n private readonly dir = inject(Directionality, { optional: true });\n private dragging = false;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('splitter');\n // `position` is a `model`, so `[(position)]` and a restored layout write into it\n // directly; only the drag and the arrows clamped. Left alone, an out-of-range\n // write reached the DOM as `aria-valuenow=\"150\"` against a `valuemax` of 100 and\n // sized a pane at `150%`.\n effect(() => {\n const clamped = wrClamp(this.position(), this.minPosition(), this.maxPosition());\n if (clamped !== this.position()) this.position.set(clamped);\n });\n }\n\n protected readonly classes = computed(() => {\n const parts = ['wr-splitter', `wr-splitter--${this.orientation()}`];\n if (this.disabled()) parts.push('wr-splitter--disabled');\n return parts.join(' ');\n });\n\n protected readonly startStyle = computed(() => `${this.position()}%`);\n protected readonly endStyle = computed(() => `${100 - this.position()}%`);\n\n // Drag\n\n protected onPointerDown(event: PointerEvent): void {\n if (this.disabled()) return;\n // Any pointerdown used to start a drag, so holding the RIGHT button over the\n // divider and moving resized the panes; the same guard keeps a second finger\n // from taking over a drag already in progress.\n if (event.button !== 0 || !event.isPrimary) return;\n event.preventDefault();\n this.dragging = true;\n const handle = event.currentTarget as HTMLElement;\n handle.setPointerCapture(event.pointerId);\n // `preventDefault` above also suppresses the click's default focus, so without\n // this the arrows did nothing after a mouse drag until the user found the\n // divider again with Tab. `wr-slider` focuses its thumb for the same reason.\n handle.focus();\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (!this.dragging) return;\n const rect = this.host.nativeElement.getBoundingClientRect();\n const raw =\n this.orientation() === 'horizontal'\n ? this.inlineFraction(event.clientX, rect) * 100\n : // The vertical split is laid out on the BLOCK axis, which `dir` does not\n // touch — measured from the top in both directions.\n ((event.clientY - rect.top) / rect.height) * 100;\n // To a tenth of a percent — about a pixel on a full-width split. The raw\n // quotient reached `aria-valuenow` and `[(position)]` as `29.99999822054938`,\n // read out digit by digit and handed to the host to persist.\n this.position.set(wrClamp(wrRound(raw, 1), this.minPosition(), this.maxPosition()));\n }\n\n protected onPointerUp(event: PointerEvent): void {\n if (!this.dragging) return;\n this.dragging = false;\n (event.currentTarget as HTMLElement).releasePointerCapture(event.pointerId);\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.disabled()) return;\n const step = event.shiftKey ? 10 : 1;\n // An arrow step lands on a whole number, so the keys after a drag do not\n // carry the drag's fraction along (`30.4` stepped to `31.4`, `32.4`, …).\n // Home and End below are the bounds themselves, whatever they are.\n const position = wrRound(this.position());\n let next: number | null = null;\n if (this.orientation() === 'horizontal') {\n // Arrows follow the VISUAL axis (WAI-ARIA APG). Under `dir=\"rtl\"` the start pane\n // is the one on the RIGHT, so the visual right is the low end of the range and\n // ArrowRight has to shrink the position rather than grow it — otherwise the\n // divider walks away from the key the user is pressing.\n const inline = this.isRtl() ? -step : step;\n if (event.key === 'ArrowLeft') next = position - inline;\n else if (event.key === 'ArrowRight') next = position + inline;\n } else {\n // Block axis: unaffected by `dir`.\n if (event.key === 'ArrowUp') next = position - step;\n else if (event.key === 'ArrowDown') next = position + step;\n }\n // Home/End are semantic — first/last, not left/right — so they never mirror.\n if (event.key === 'Home') next = this.minPosition();\n else if (event.key === 'End') next = this.maxPosition();\n if (next === null) return;\n event.preventDefault();\n this.position.set(wrClamp(next, this.minPosition(), this.maxPosition()));\n }\n\n /**\n * Fraction of the host's width measured from the INLINE-START edge — the left edge in\n * LTR, the right edge in RTL, which is where `flex-direction: row` puts the start pane\n * whose size `position` is. Counted from `rect.left` in both, a drag under `dir=\"rtl\"`\n * read 0 where the start pane was widest and inverted the whole gesture.\n */\n private inlineFraction(clientX: number, rect: DOMRect): number {\n return this.isRtl() ? (rect.right - clientX) / rect.width : (clientX - rect.left) / rect.width;\n }\n\n /**\n * Read per event rather than cached: nothing this component renders is derived from the\n * direction — `flex-direction: row` mirrors the panes on its own — so there is no stale\n * value for `Directionality.change` to invalidate.\n */\n private isRtl(): boolean {\n return this.dir?.value === 'rtl';\n }\n}\n","<div class=\"wr-splitter__pane wr-splitter__pane--start\" [style.flex-basis]=\"startStyle()\">\n <ng-content select=\"[wrSplitterStart]\" />\n</div>\n\n<!-- Roving focus + arrow keys for keyboard resizing. -->\n<div\n class=\"wr-splitter__divider\"\n role=\"separator\"\n [attr.aria-label]=\"resolvedDividerLabel()\"\n [attr.aria-orientation]=\"orientation() === 'horizontal' ? 'vertical' : 'horizontal'\"\n [attr.aria-valuemin]=\"minPosition()\"\n [attr.aria-valuemax]=\"maxPosition()\"\n [attr.aria-valuenow]=\"position()\"\n [attr.aria-disabled]=\"disabled() || null\"\n [attr.tabindex]=\"disabled() ? -1 : 0\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp($event)\"\n (pointercancel)=\"onPointerUp($event)\"\n (keydown)=\"onKeydown($event)\"\n>\n <span class=\"wr-splitter__handle\" aria-hidden=\"true\"></span>\n</div>\n\n<div class=\"wr-splitter__pane wr-splitter__pane--end\" [style.flex-basis]=\"endStyle()\">\n <ng-content select=\"[wrSplitterEnd]\" />\n</div>\n"],"mappings":";;;;;;;;;;;;AAwCA,IAAa,aAAb,MAAa,WAAU;CAEZ,WAAW,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAQpB,cAAc,MAAiC,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAG5D,cAAc,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,qBAAqB,GAAG,CAAC;CAAC,CAAA;CAGtF,cAAc,MAAM,KAAG;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,qBAAqB,GAAG,GAAG;CAAC,CAAA;CAG1F,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAQ1D,eAAe,MAAqB,MAAK,GAAA,YAAA,CAAA,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gBAAA;CAAA,CAAA;CAAV,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAU,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,aAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,SAAA,EAAA,UAAA,iBAAA;EAAA,MAAA,EAAA,YAAA,EAAA,SAAA,YAAA,EAAA;EAAA,UAAA;EAAA,UCxCvB;EA2BA,eAAA,GAAA,kBAAA;CAAA,CAAA;;ADaa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAU,YAAA,CAAA;EANtB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAa,eAER,kBAAkB;GAAI,MAC/B,EAAE,WAAW,YAAW;GAAE,UAAA;EAAA,CAAA"}
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
2
2
  import { Component, LOCALE_ID, PLATFORM_ID, ViewEncapsulation, computed, effect, inject, input, output, signal, untracked } from "@angular/core";
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
4
  import { isPlatformBrowser } from "@angular/common";
5
- import { numAttr, wrCheckStyles } from "ngwr/utils";
5
+ import { wrCheckStyles, wrNumAttr } from "ngwr/utils";
6
6
  import { useI18nFormatter, useI18nText } from "ngwr/i18n";
7
7
  import { WrPlatform } from "ngwr/platform";
8
8
  import { WrCountUp } from "ngwr/counter";
@@ -31,7 +31,7 @@ var WrStatistic = class WrStatistic {
31
31
  });
32
32
  duration = input(700, {
33
33
  ...ngDevMode ? { debugName: "duration" } : /* istanbul ignore next */ {},
34
- transform: numAttr(700)
34
+ transform: wrNumAttr(700)
35
35
  });
36
36
  numericValue = computed(() => {
37
37
  const raw = this.value();
@@ -328,7 +328,7 @@ var WrStatisticCountdown = class WrStatisticCountdown {
328
328
  endText = input(null, ...ngDevMode ? [{ debugName: "endText" }] : /* istanbul ignore next */ []);
329
329
  tickMs = input(1e3, {
330
330
  ...ngDevMode ? { debugName: "tickMs" } : /* istanbul ignore next */ {},
331
- transform: (v) => Math.max(16, numAttr(1e3)(v))
331
+ transform: (v) => Math.max(16, wrNumAttr(1e3)(v))
332
332
  });
333
333
  countdownEnd = output();
334
334
  isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
@@ -349,9 +349,11 @@ var WrStatisticCountdown = class WrStatisticCountdown {
349
349
  const ms = this.remainingMs();
350
350
  this.remaining.set(ms ?? 0);
351
351
  this.finished.set(ms === 0);
352
+ if (ms === 0) untracked(() => this.countdownEnd.emit());
352
353
  });
353
354
  if (!this.isBrowser) return;
354
355
  effect((onCleanup) => {
356
+ if (this.finished()) return;
355
357
  const handle = setInterval(() => this.tick(), this.tickMs());
356
358
  onCleanup(() => clearInterval(handle));
357
359
  });