ngwr 14.7.0 → 14.9.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 (482) hide show
  1. package/README.md +66 -332
  2. package/alert/styles/_index.scss +10 -0
  3. package/avatar/styles/_index.scss +18 -7
  4. package/badge/styles/_index.scss +7 -0
  5. package/badge/styles/_tag.scss +7 -1
  6. package/bar-chart/styles/_index.scss +1 -0
  7. package/button/styles/_index.scss +6 -0
  8. package/calendar-heatmap/styles/_index.scss +1 -0
  9. package/cascader/styles/_rules.scss +87 -15
  10. package/checkbox/styles/_index.scss +4 -0
  11. package/command-palette/styles/_index.scss +1 -1
  12. package/date-picker/styles/_index.scss +30 -0
  13. package/density/styles/_index.scss +4 -2
  14. package/divider/styles/_index.scss +2 -0
  15. package/donut-chart/styles/_index.scss +10 -0
  16. package/dropdown/styles/_index.scss +67 -5
  17. package/editor/styles/_index.scss +441 -0
  18. package/event-calendar/styles/_index.scss +209 -35
  19. package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -1
  20. package/fesm2022/ngwr-action-sheet.mjs +3 -3
  21. package/fesm2022/ngwr-action-sheet.mjs.map +1 -1
  22. package/fesm2022/ngwr-affix.mjs +3 -3
  23. package/fesm2022/ngwr-affix.mjs.map +1 -1
  24. package/fesm2022/ngwr-alert.mjs +3 -3
  25. package/fesm2022/ngwr-alert.mjs.map +1 -1
  26. package/fesm2022/ngwr-anchor.mjs +3 -3
  27. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  28. package/fesm2022/ngwr-aurora.mjs +3 -3
  29. package/fesm2022/ngwr-aurora.mjs.map +1 -1
  30. package/fesm2022/ngwr-avatar.mjs +3 -3
  31. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  32. package/fesm2022/ngwr-back-top.mjs +3 -3
  33. package/fesm2022/ngwr-back-top.mjs.map +1 -1
  34. package/fesm2022/ngwr-badge.mjs +28 -13
  35. package/fesm2022/ngwr-badge.mjs.map +1 -1
  36. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
  37. package/fesm2022/ngwr-bar-chart.mjs +31 -6
  38. package/fesm2022/ngwr-bar-chart.mjs.map +1 -1
  39. package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -1
  40. package/fesm2022/ngwr-blur-text.mjs +3 -3
  41. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  42. package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -1
  43. package/fesm2022/ngwr-border-glow.mjs +3 -3
  44. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  45. package/fesm2022/ngwr-breadcrumbs.mjs +6 -6
  46. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  47. package/fesm2022/ngwr-burger.mjs +3 -3
  48. package/fesm2022/ngwr-burger.mjs.map +1 -1
  49. package/fesm2022/ngwr-button-testing.mjs.map +1 -1
  50. package/fesm2022/ngwr-button.mjs +6 -6
  51. package/fesm2022/ngwr-button.mjs.map +1 -1
  52. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -1
  53. package/fesm2022/ngwr-calendar-heatmap.mjs +61 -6
  54. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  55. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  56. package/fesm2022/ngwr-calendar.mjs +3 -3
  57. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  58. package/fesm2022/ngwr-card.mjs +9 -9
  59. package/fesm2022/ngwr-card.mjs.map +1 -1
  60. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  61. package/fesm2022/ngwr-carousel.mjs +6 -6
  62. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  63. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  64. package/fesm2022/ngwr-cascader.mjs +4 -4
  65. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  66. package/fesm2022/ngwr-checkbox-testing.mjs.map +1 -1
  67. package/fesm2022/ngwr-checkbox.mjs +18 -8
  68. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  69. package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -1
  70. package/fesm2022/ngwr-circular-text.mjs +3 -3
  71. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  72. package/fesm2022/ngwr-click-spark.mjs +3 -3
  73. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  74. package/fesm2022/ngwr-clipboard.mjs +3 -3
  75. package/fesm2022/ngwr-clipboard.mjs.map +1 -1
  76. package/fesm2022/ngwr-collapse-testing.mjs.map +1 -1
  77. package/fesm2022/ngwr-collapse.mjs +9 -9
  78. package/fesm2022/ngwr-collapse.mjs.map +1 -1
  79. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-color-picker.mjs +6 -6
  81. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  82. package/fesm2022/ngwr-command-palette-testing.mjs.map +1 -1
  83. package/fesm2022/ngwr-command-palette.mjs +3 -3
  84. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  85. package/fesm2022/ngwr-compare.mjs +3 -3
  86. package/fesm2022/ngwr-compare.mjs.map +1 -1
  87. package/fesm2022/ngwr-confetti.mjs +3 -3
  88. package/fesm2022/ngwr-confetti.mjs.map +1 -1
  89. package/fesm2022/ngwr-config.mjs.map +1 -1
  90. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  91. package/fesm2022/ngwr-context-menu.mjs +12 -12
  92. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  93. package/fesm2022/ngwr-cookie.mjs +3 -3
  94. package/fesm2022/ngwr-cookie.mjs.map +1 -1
  95. package/fesm2022/ngwr-counter.mjs +6 -6
  96. package/fesm2022/ngwr-counter.mjs.map +1 -1
  97. package/fesm2022/ngwr-date-adapters-fns.mjs +3 -3
  98. package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-adapters-luxon.mjs +3 -3
  100. package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -1
  101. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  102. package/fesm2022/ngwr-date-picker.mjs +721 -62
  103. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  104. package/fesm2022/ngwr-date.mjs +3 -3
  105. package/fesm2022/ngwr-date.mjs.map +1 -1
  106. package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -1
  107. package/fesm2022/ngwr-decrypt-text.mjs +3 -3
  108. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  109. package/fesm2022/ngwr-density.mjs +6 -6
  110. package/fesm2022/ngwr-density.mjs.map +1 -1
  111. package/fesm2022/ngwr-descriptions.mjs +6 -6
  112. package/fesm2022/ngwr-descriptions.mjs.map +1 -1
  113. package/fesm2022/ngwr-dialog-testing.mjs.map +1 -1
  114. package/fesm2022/ngwr-dialog.mjs +15 -15
  115. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  116. package/fesm2022/ngwr-directives.mjs +12 -12
  117. package/fesm2022/ngwr-directives.mjs.map +1 -1
  118. package/fesm2022/ngwr-divider.mjs +3 -3
  119. package/fesm2022/ngwr-divider.mjs.map +1 -1
  120. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
  121. package/fesm2022/ngwr-donut-chart.mjs +48 -6
  122. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  123. package/fesm2022/ngwr-drag-drop.mjs +6 -6
  124. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  125. package/fesm2022/ngwr-drawer-testing.mjs.map +1 -1
  126. package/fesm2022/ngwr-drawer.mjs +18 -18
  127. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  128. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  129. package/fesm2022/ngwr-dropdown.mjs +174 -25
  130. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  131. package/fesm2022/ngwr-editor-testing.mjs +568 -0
  132. package/fesm2022/ngwr-editor-testing.mjs.map +1 -0
  133. package/fesm2022/ngwr-editor.mjs +2601 -0
  134. package/fesm2022/ngwr-editor.mjs.map +1 -0
  135. package/fesm2022/ngwr-empty.mjs +3 -3
  136. package/fesm2022/ngwr-empty.mjs.map +1 -1
  137. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -1
  138. package/fesm2022/ngwr-event-calendar.mjs +14 -7
  139. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  140. package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
  141. package/fesm2022/ngwr-falling-text.mjs +3 -3
  142. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  143. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  144. package/fesm2022/ngwr-file-upload.mjs +3 -3
  145. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  146. package/fesm2022/ngwr-form-testing.mjs.map +1 -1
  147. package/fesm2022/ngwr-form.mjs +61 -10
  148. package/fesm2022/ngwr-form.mjs.map +1 -1
  149. package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -1
  150. package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
  151. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  152. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -1
  153. package/fesm2022/ngwr-gauge.mjs +35 -6
  154. package/fesm2022/ngwr-gauge.mjs.map +1 -1
  155. package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
  156. package/fesm2022/ngwr-glitch-text.mjs +3 -3
  157. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  158. package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
  159. package/fesm2022/ngwr-gradient-text.mjs +3 -3
  160. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  161. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  162. package/fesm2022/ngwr-graph.mjs +6 -6
  163. package/fesm2022/ngwr-graph.mjs.map +1 -1
  164. package/fesm2022/ngwr-hotkey.mjs +6 -6
  165. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  166. package/fesm2022/ngwr-i18n-ar.mjs +31 -0
  167. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  168. package/fesm2022/ngwr-i18n-cs.mjs +31 -0
  169. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  170. package/fesm2022/ngwr-i18n-de.mjs +31 -0
  171. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  172. package/fesm2022/ngwr-i18n-en.mjs +39 -0
  173. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  174. package/fesm2022/ngwr-i18n-es.mjs +31 -0
  175. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  176. package/fesm2022/ngwr-i18n-fr.mjs +31 -0
  177. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  178. package/fesm2022/ngwr-i18n-he.mjs +31 -0
  179. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  180. package/fesm2022/ngwr-i18n-hi.mjs +31 -0
  181. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  182. package/fesm2022/ngwr-i18n-id.mjs +31 -0
  183. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  184. package/fesm2022/ngwr-i18n-it.mjs +31 -0
  185. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  186. package/fesm2022/ngwr-i18n-ja.mjs +31 -0
  187. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  188. package/fesm2022/ngwr-i18n-ko.mjs +31 -0
  189. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  190. package/fesm2022/ngwr-i18n-nl.mjs +31 -0
  191. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  192. package/fesm2022/ngwr-i18n-pl.mjs +31 -0
  193. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  194. package/fesm2022/ngwr-i18n-pt.mjs +31 -0
  195. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  196. package/fesm2022/ngwr-i18n-ru.mjs +31 -0
  197. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  198. package/fesm2022/ngwr-i18n-sv.mjs +31 -0
  199. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  200. package/fesm2022/ngwr-i18n-tr.mjs +31 -0
  201. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  202. package/fesm2022/ngwr-i18n-uk.mjs +31 -0
  203. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  204. package/fesm2022/ngwr-i18n-vi.mjs +31 -0
  205. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  206. package/fesm2022/ngwr-i18n-zh-TW.mjs +31 -0
  207. package/fesm2022/ngwr-i18n-zh-TW.mjs.map +1 -1
  208. package/fesm2022/ngwr-i18n-zh.mjs +31 -0
  209. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  210. package/fesm2022/ngwr-i18n.mjs +9 -9
  211. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  212. package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -1
  213. package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -1
  214. package/fesm2022/ngwr-icon.mjs +6 -6
  215. package/fesm2022/ngwr-icon.mjs.map +1 -1
  216. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
  217. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  218. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  219. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  220. package/fesm2022/ngwr-input-number.mjs +15 -3
  221. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  222. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
  223. package/fesm2022/ngwr-input-otp.mjs +3 -3
  224. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  225. package/fesm2022/ngwr-input-testing.mjs.map +1 -1
  226. package/fesm2022/ngwr-input.mjs +15 -15
  227. package/fesm2022/ngwr-input.mjs.map +1 -1
  228. package/fesm2022/ngwr-keyboard.mjs +3 -3
  229. package/fesm2022/ngwr-keyboard.mjs.map +1 -1
  230. package/fesm2022/ngwr-knob-testing.mjs.map +1 -1
  231. package/fesm2022/ngwr-knob.mjs +3 -3
  232. package/fesm2022/ngwr-knob.mjs.map +1 -1
  233. package/fesm2022/ngwr-layout.mjs +15 -15
  234. package/fesm2022/ngwr-layout.mjs.map +1 -1
  235. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
  236. package/fesm2022/ngwr-lightbox.mjs +3 -3
  237. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  238. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -1
  239. package/fesm2022/ngwr-line-chart.mjs +18 -7
  240. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  241. package/fesm2022/ngwr-list.mjs +6 -6
  242. package/fesm2022/ngwr-list.mjs.map +1 -1
  243. package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
  244. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  245. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  246. package/fesm2022/ngwr-markdown-testing.mjs.map +1 -1
  247. package/fesm2022/ngwr-markdown.mjs +798 -17
  248. package/fesm2022/ngwr-markdown.mjs.map +1 -1
  249. package/fesm2022/ngwr-marquee-testing.mjs.map +1 -1
  250. package/fesm2022/ngwr-marquee.mjs +3 -3
  251. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  252. package/fesm2022/ngwr-media.mjs +3 -3
  253. package/fesm2022/ngwr-media.mjs.map +1 -1
  254. package/fesm2022/ngwr-mention-testing.mjs.map +1 -1
  255. package/fesm2022/ngwr-mention.mjs +6 -6
  256. package/fesm2022/ngwr-mention.mjs.map +1 -1
  257. package/fesm2022/ngwr-meta.mjs +6 -6
  258. package/fesm2022/ngwr-meta.mjs.map +1 -1
  259. package/fesm2022/ngwr-meter-group-testing.mjs +7 -3
  260. package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
  261. package/fesm2022/ngwr-meter-group.mjs +26 -6
  262. package/fesm2022/ngwr-meter-group.mjs.map +1 -1
  263. package/fesm2022/ngwr-overlay.mjs +6 -6
  264. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  265. package/fesm2022/ngwr-page-header.mjs +13 -5
  266. package/fesm2022/ngwr-page-header.mjs.map +1 -1
  267. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  268. package/fesm2022/ngwr-pagination.mjs +3 -3
  269. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  270. package/fesm2022/ngwr-pipes.mjs +21 -21
  271. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  272. package/fesm2022/ngwr-platform.mjs +9 -9
  273. package/fesm2022/ngwr-platform.mjs.map +1 -1
  274. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  275. package/fesm2022/ngwr-popconfirm.mjs +6 -6
  276. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  277. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  278. package/fesm2022/ngwr-popover.mjs +578 -16
  279. package/fesm2022/ngwr-popover.mjs.map +1 -1
  280. package/fesm2022/ngwr-progress.mjs +3 -3
  281. package/fesm2022/ngwr-progress.mjs.map +1 -1
  282. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  283. package/fesm2022/ngwr-pull-to-refresh.mjs.map +1 -1
  284. package/fesm2022/ngwr-qr.mjs +3 -3
  285. package/fesm2022/ngwr-qr.mjs.map +1 -1
  286. package/fesm2022/ngwr-radio-testing.mjs.map +1 -1
  287. package/fesm2022/ngwr-radio.mjs +6 -6
  288. package/fesm2022/ngwr-radio.mjs.map +1 -1
  289. package/fesm2022/ngwr-rating-testing.mjs.map +1 -1
  290. package/fesm2022/ngwr-rating.mjs +3 -3
  291. package/fesm2022/ngwr-rating.mjs.map +1 -1
  292. package/fesm2022/ngwr-result.mjs +12 -12
  293. package/fesm2022/ngwr-result.mjs.map +1 -1
  294. package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -1
  295. package/fesm2022/ngwr-rotating-text.mjs +3 -3
  296. package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
  297. package/fesm2022/ngwr-schema-form.mjs +3 -3
  298. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  299. package/fesm2022/ngwr-scroll.mjs +3 -3
  300. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  301. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
  302. package/fesm2022/ngwr-segmented.mjs +3 -3
  303. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  304. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  305. package/fesm2022/ngwr-select.mjs +12 -12
  306. package/fesm2022/ngwr-select.mjs.map +1 -1
  307. package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -1
  308. package/fesm2022/ngwr-shiny-text.mjs +6 -6
  309. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  310. package/fesm2022/ngwr-sidebar.mjs +10 -3
  311. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  312. package/fesm2022/ngwr-skeleton.mjs +3 -3
  313. package/fesm2022/ngwr-skeleton.mjs.map +1 -1
  314. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  315. package/fesm2022/ngwr-slider.mjs +3 -3
  316. package/fesm2022/ngwr-slider.mjs.map +1 -1
  317. package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -1
  318. package/fesm2022/ngwr-sparkline.mjs +84 -10
  319. package/fesm2022/ngwr-sparkline.mjs.map +1 -1
  320. package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
  321. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  322. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  323. package/fesm2022/ngwr-spinner.mjs +3 -3
  324. package/fesm2022/ngwr-spinner.mjs.map +1 -1
  325. package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -1
  326. package/fesm2022/ngwr-splash-cursor.mjs +3 -3
  327. package/fesm2022/ngwr-splash-cursor.mjs.map +1 -1
  328. package/fesm2022/ngwr-split-text-testing.mjs.map +1 -1
  329. package/fesm2022/ngwr-split-text.mjs +3 -3
  330. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  331. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -1
  332. package/fesm2022/ngwr-splitter.mjs +3 -3
  333. package/fesm2022/ngwr-splitter.mjs.map +1 -1
  334. package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -1
  335. package/fesm2022/ngwr-spotlight-card.mjs +6 -6
  336. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  337. package/fesm2022/ngwr-squircle.mjs +6 -6
  338. package/fesm2022/ngwr-squircle.mjs.map +1 -1
  339. package/fesm2022/ngwr-star-border-testing.mjs.map +1 -1
  340. package/fesm2022/ngwr-star-border.mjs +3 -3
  341. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  342. package/fesm2022/ngwr-statistic.mjs +9 -9
  343. package/fesm2022/ngwr-statistic.mjs.map +1 -1
  344. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
  345. package/fesm2022/ngwr-stepper.mjs +6 -6
  346. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  347. package/fesm2022/ngwr-storage.mjs +3 -3
  348. package/fesm2022/ngwr-storage.mjs.map +1 -1
  349. package/fesm2022/ngwr-switch-testing.mjs.map +1 -1
  350. package/fesm2022/ngwr-switch.mjs +3 -3
  351. package/fesm2022/ngwr-switch.mjs.map +1 -1
  352. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  353. package/fesm2022/ngwr-table.mjs +18 -18
  354. package/fesm2022/ngwr-table.mjs.map +1 -1
  355. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  356. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  357. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  358. package/fesm2022/ngwr-tabs.mjs +6 -6
  359. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  360. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
  361. package/fesm2022/ngwr-textarea.mjs +3 -3
  362. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  363. package/fesm2022/ngwr-theme.mjs +3 -3
  364. package/fesm2022/ngwr-theme.mjs.map +1 -1
  365. package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -1
  366. package/fesm2022/ngwr-tilt-card.mjs +6 -6
  367. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  368. package/fesm2022/ngwr-timeline.mjs +6 -6
  369. package/fesm2022/ngwr-timeline.mjs.map +1 -1
  370. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  371. package/fesm2022/ngwr-toast.mjs +9 -9
  372. package/fesm2022/ngwr-toast.mjs.map +1 -1
  373. package/fesm2022/ngwr-toolbar.mjs +10 -3
  374. package/fesm2022/ngwr-toolbar.mjs.map +1 -1
  375. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  376. package/fesm2022/ngwr-tour.mjs +6 -6
  377. package/fesm2022/ngwr-tour.mjs.map +1 -1
  378. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
  379. package/fesm2022/ngwr-transfer.mjs +3 -3
  380. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  381. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  382. package/fesm2022/ngwr-tree.mjs +3 -3
  383. package/fesm2022/ngwr-tree.mjs.map +1 -1
  384. package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
  385. package/fesm2022/ngwr-typewriter.mjs +3 -3
  386. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  387. package/fesm2022/ngwr-typography.mjs +7 -3
  388. package/fesm2022/ngwr-typography.mjs.map +1 -1
  389. package/fesm2022/ngwr-utils.mjs.map +1 -1
  390. package/fesm2022/ngwr-validators.mjs.map +1 -1
  391. package/fesm2022/ngwr-version.mjs +1 -1
  392. package/fesm2022/ngwr-version.mjs.map +1 -1
  393. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  394. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  395. package/fesm2022/ngwr-waves-testing.mjs.map +1 -1
  396. package/fesm2022/ngwr-waves.mjs +3 -3
  397. package/fesm2022/ngwr-waves.mjs.map +1 -1
  398. package/fesm2022/ngwr-window-testing.mjs.map +1 -1
  399. package/fesm2022/ngwr-window.mjs +12 -12
  400. package/fesm2022/ngwr-window.mjs.map +1 -1
  401. package/form/styles/_index.scss +16 -1
  402. package/gauge/styles/_index.scss +1 -0
  403. package/i18n/ar.json +32 -1
  404. package/i18n/cs.json +32 -1
  405. package/i18n/de.json +32 -1
  406. package/i18n/en.json +32 -1
  407. package/i18n/es.json +32 -1
  408. package/i18n/fr.json +32 -1
  409. package/i18n/he.json +32 -1
  410. package/i18n/hi.json +32 -1
  411. package/i18n/id.json +32 -1
  412. package/i18n/it.json +32 -1
  413. package/i18n/ja.json +32 -1
  414. package/i18n/ko.json +32 -1
  415. package/i18n/nl.json +32 -1
  416. package/i18n/pl.json +32 -1
  417. package/i18n/pt.json +32 -1
  418. package/i18n/ru.json +32 -1
  419. package/i18n/sv.json +32 -1
  420. package/i18n/tr.json +32 -1
  421. package/i18n/uk.json +32 -1
  422. package/i18n/vi.json +32 -1
  423. package/i18n/zh-TW.json +32 -1
  424. package/i18n/zh.json +32 -1
  425. package/input/styles/_index.scss +24 -1
  426. package/input-number/styles/_index.scss +69 -0
  427. package/input-otp/styles/_index.scss +5 -5
  428. package/line-chart/styles/_index.scss +30 -2
  429. package/llms-full.txt +14 -4
  430. package/llms.txt +188 -132
  431. package/mcp/providers.js +2 -2
  432. package/mcp/server.js +1 -1
  433. package/meter-group/styles/_index.scss +1 -0
  434. package/overlay/styles/_arrow.scss +30 -2
  435. package/package.json +43 -2
  436. package/page-header/styles/_index.scss +37 -1
  437. package/pagination/styles/_index.scss +9 -5
  438. package/popover/styles/_index.scss +73 -5
  439. package/progress/styles/_index.scss +4 -0
  440. package/radio/styles/_index.scss +4 -1
  441. package/schematics/use/symbol-map.json +1 -0
  442. package/select/styles/_index.scss +51 -12
  443. package/sidebar/styles/_index.scss +44 -2
  444. package/skeleton/styles/_index.scss +3 -0
  445. package/skills/ngwr/SKILL.md +5 -5
  446. package/skills/ngwr/references/catalog.md +2 -0
  447. package/skills/ngwr/references/setup.md +3 -3
  448. package/sparkline/styles/_index.scss +19 -0
  449. package/styles.scss +1 -0
  450. package/table/styles/_index.scss +7 -0
  451. package/textarea/styles/_index.scss +12 -3
  452. package/theme/styles/_colors.scss +39 -13
  453. package/theme/styles/_contrast.scss +9 -7
  454. package/toast/styles/_index.scss +4 -0
  455. package/toolbar/styles/_index.scss +35 -1
  456. package/tree/styles/_index.scss +46 -7
  457. package/types/ngwr-badge.d.ts +22 -7
  458. package/types/ngwr-bar-chart.d.ts +19 -1
  459. package/types/ngwr-calendar-heatmap.d.ts +29 -1
  460. package/types/ngwr-checkbox.d.ts +2 -0
  461. package/types/ngwr-config.d.ts +12 -0
  462. package/types/ngwr-date-picker.d.ts +308 -43
  463. package/types/ngwr-donut-chart.d.ts +24 -1
  464. package/types/ngwr-dropdown.d.ts +22 -2
  465. package/types/ngwr-editor-testing.d.ts +378 -0
  466. package/types/ngwr-editor.d.ts +449 -0
  467. package/types/ngwr-event-calendar.d.ts +8 -0
  468. package/types/ngwr-form.d.ts +35 -5
  469. package/types/ngwr-gauge.d.ts +20 -1
  470. package/types/ngwr-input-number.d.ts +7 -0
  471. package/types/ngwr-line-chart.d.ts +9 -1
  472. package/types/ngwr-markdown.d.ts +61 -2
  473. package/types/ngwr-meter-group-testing.d.ts +3 -2
  474. package/types/ngwr-meter-group.d.ts +14 -1
  475. package/types/ngwr-page-header.d.ts +10 -2
  476. package/types/ngwr-popover.d.ts +154 -3
  477. package/types/ngwr-sidebar.d.ts +7 -0
  478. package/types/ngwr-sparkline.d.ts +43 -1
  479. package/types/ngwr-toolbar.d.ts +7 -0
  480. package/types/ngwr-typography.d.ts +4 -0
  481. package/types/ngwr-version.d.ts +1 -1
  482. package/typography/styles/_index.scss +16 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-shiny-text-testing.mjs","sources":["../../../projects/lib/shiny-text/testing/wr-shiny-text-harness.ts","../../../projects/lib/shiny-text/testing/ngwr-shiny-text-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrShinyTextHarnessFilters, WrShinyTextSweepDirection } from './interfaces';\n\nconst GRADIENT = /^linear-gradient\\((.*)\\)$/s;\nconst DEGREES = /^(-?[\\d.]+)deg$/;\nconst STOP_POSITION = /\\s+-?[\\d.]+%$/;\n\n/** Split a declaration list or an argument list on top-level separators only. */\nfunction splitTopLevel(value: string, separator: string): string[] {\n const parts: string[] = [];\n let depth = 0;\n let current = '';\n\n for (const character of value) {\n if (character === '(') depth++;\n if (character === ')') depth--;\n\n if (character === separator && depth === 0) {\n parts.push(current.trim());\n current = '';\n } else {\n current += character;\n }\n }\n\n parts.push(current.trim());\n return parts;\n}\n\n/** The colour half of a `<colour> <position>` gradient stop. */\nfunction stopColour(stop: string): string {\n return stop.replace(STOP_POSITION, '').trim();\n}\n\n/**\n * Test harness for `<wr-shiny-text>`.\n *\n * **The duration is the assertion that matters.** The pause between sweeps is not\n * `animation-delay` and not a second animation — it is folded INTO `animation-duration`,\n * because the keyframe finishes at 50% and holds there. So `[speed]=\"2\"` with\n * `[delay]=\"3\"` has to read 5 seconds, and anyone reimplementing the pause the obvious\n * way passes every other check here and fails {@link getCycleDurationSeconds}.\n *\n * **The stripe is five stops and only one of them is the shine.** The base colour fills\n * 0%, 35%, 65% and 100%; the highlight sits alone at 50%. {@link getBaseColor} and\n * {@link getShineColor} are offered as a pair because swapping the two inputs is\n * otherwise undetectable — the gradient stays well-formed, the angle is unchanged, and\n * the text simply stops shimmering.\n *\n * **Both gradient reads come off the inline `style` attribute**, not through computed\n * style. Unset colours fall through to the literal `var(--wr-shiny-text-base)` /\n * `var(--wr-shiny-text-shine)` tokens, which is exactly what makes the dark-theme\n * override work — and a computed read resolves those tokens in a real browser while\n * handing them back verbatim in a unit test. Reading what the component wrote gives the\n * same answer in both places.\n *\n * The colours still pass through the CSSOM on their way back out, and it has its own\n * spelling: a hex literal is re-serialised, so `[color]=\"'#444'\"` reads\n * `rgb(68, 68, 68)`. Functional notations and `var()` tokens survive untouched. Assert\n * the form the CSSOM returns, not the one the template passed in.\n *\n * There is no inner element to query: the template is the bare interpolation, so the text\n * is a node on the host. A locator copied from the gradient-text harness finds nothing.\n *\n * **What the harness deliberately does not offer**, and why. There is no `isAnimating()`\n * / `getBackgroundPosition()`: the sweep is a stylesheet keyframe over\n * `background-position`, and a unit test neither loads the sheet nor runs the animation.\n * There is no `getAnimationName()` / `getIterationCount()` / `getPlayState()`: every\n * animation property except the duration lives in the stylesheet, so those reads answer\n * the same empty string for a working component and a deleted one. {@link isPaused} and\n * {@link pausesOnHover} claim the CLASSES and not the pauses — `:hover` is a selector and\n * `animation-play-state` is a stylesheet rule, so what they honestly pin is that the\n * input arrived. There is no `respectsReducedMotion()`: the handling is a `@media` block\n * with no TypeScript counterpart. And there is nothing reporting the painted text colour,\n * because `-webkit-text-fill-color: transparent` is a stylesheet declaration and a read\n * would report the inherited colour as if the text were solid.\n *\n * The `[wrShimmer]` directive shipped from the same entry point has no harness: it adds\n * one static class and nothing else, so a harness could only restate its own selector.\n *\n * @example\n * ```ts\n * const shiny = await loader.getHarness(WrShinyTextHarness);\n *\n * expect(await shiny.getCycleDurationSeconds()).toBe(5);\n * expect(await shiny.getShineColor()).toBe('var(--wr-shiny-text-shine)');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrShinyTextHarness extends ComponentHarness {\n static hostSelector = 'wr-shiny-text';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrShinyTextHarnessFilters = {}): HarnessPredicate<WrShinyTextHarness> {\n return new HarnessPredicate(WrShinyTextHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('paused', options.paused, async (harness, paused) => (await harness.isPaused()) === paused)\n .addOption(\n 'direction',\n options.direction,\n async (harness, direction) => (await harness.getDirection()) === direction\n );\n }\n\n /** The rendered text, trimmed. It is a text node on the host — there is no inner span. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * The whole stripe gradient the component computed, as written.\n *\n * Unresolved on purpose. With no `[color]` / `[shineColor]` given this string contains\n * the theme's own custom-property tokens rather than colours, and that is the working\n * state, not a gap — resolving them would need the stylesheet, and the resolved answer\n * would differ between a unit test and a browser.\n */\n async getGradient(): Promise<string> {\n return this.require('getGradient', 'background-image');\n }\n\n /**\n * The gradient's angle in degrees, from `[spread]`.\n *\n * The only observable effect that input has, `numAttr` coercion included. Note the name\n * is inherited vocabulary and describes the ANGLE, not the width of the bright stripe:\n * the stop positions are hard-coded, so no input narrows the shine.\n */\n async getSpreadDegrees(): Promise<number> {\n const [angle] = await this.gradientArguments('getSpreadDegrees');\n const match = DEGREES.exec(angle);\n\n if (!match) {\n throw new Error(\n `WrShinyTextHarness.getSpreadDegrees(): the gradient starts with \"${angle}\", which is not an angle in ` +\n 'degrees. The component writes `<spread>deg` as the first argument of the gradient; anything else ' +\n 'means the angle is no longer coming from that input.'\n );\n }\n return Number.parseFloat(match[1]);\n }\n\n /**\n * The colour outside the bright stripe — the 0% stop.\n *\n * The same colour fills 35%, 65% and 100%; only the 50% stop differs. Assert it next to\n * {@link getShineColor}: a `[color]` that lands in the shine slot instead leaves a\n * perfectly valid gradient that no longer shimmers.\n */\n async getBaseColor(): Promise<string> {\n return stopColour((await this.gradientStops('getBaseColor'))[0]);\n }\n\n /** The highlight colour — the lone 50% stop the stripe is made of. */\n async getShineColor(): Promise<string> {\n return stopColour((await this.gradientStops('getShineColor'))[2]);\n }\n\n /**\n * One full cycle in seconds — the sweep AND the pause after it.\n *\n * `[delay]` is not `animation-delay` and not a second animation: the keyframe reaches\n * its end at 50% and holds, so the wait is bought by making the animation twice as long.\n * That is why this reads `speed + delay` and why the method is named for the cycle\n * rather than for the sweep.\n *\n * Read from the inline declaration rather than from computed style, so a missing binding\n * is reported as missing instead of being answered from the stylesheet.\n */\n async getCycleDurationSeconds(): Promise<number> {\n const raw = await this.require('getCycleDurationSeconds', 'animation-duration');\n const seconds = Number.parseFloat(raw);\n\n if (Number.isNaN(seconds)) {\n throw new Error(\n `WrShinyTextHarness.getCycleDurationSeconds(): \\`animation-duration\\` is \"${raw}\", which is not a number ` +\n 'of seconds. The component writes `[speed] + [delay]` there — the pause is folded into the duration ' +\n 'rather than expressed as a delay.'\n );\n }\n return seconds;\n }\n\n /**\n * Whether the animation is stopped (`disabled`).\n *\n * Three names for one thing, which is why this method exists rather than a spec reading\n * the class: the input is `disabled`, its JSDoc says \"pause\", and the DOM contract is\n * `wr-shiny-text--paused`. Only the last of those is public API.\n */\n async isPaused(): Promise<boolean> {\n return (await this.host()).hasClass('wr-shiny-text--paused');\n }\n\n /** Whether the opt-in reached the class the `:hover` rule needs. */\n async pausesOnHover(): Promise<boolean> {\n return (await this.host()).hasClass('wr-shiny-text--pause-on-hover');\n }\n\n /**\n * Whether the stripe bounces instead of restarting (`yoyo`).\n *\n * Defaults to `false` here — the opposite of the same-named input on `wr-gradient-text`,\n * which is worth pinning in a spec that uses both. Together with {@link getDirection}\n * this is the whole four-way matrix the stylesheet derives `animation-direction` from.\n */\n async isYoyo(): Promise<boolean> {\n return (await this.host()).hasClass('wr-shiny-text--yoyo');\n }\n\n /** Which way the stripe travels — `'left'` is the absence of the reverse modifier. */\n async getDirection(): Promise<WrShinyTextSweepDirection> {\n return (await (await this.host()).hasClass('wr-shiny-text--reverse')) ? 'right' : 'left';\n }\n\n /** The five stops of the stripe, positions attached, in gradient order. */\n private async gradientStops(caller: string): Promise<string[]> {\n const [, ...stops] = await this.gradientArguments(caller);\n\n if (stops.length !== 5) {\n throw new Error(\n `WrShinyTextHarness.${caller}(): the gradient has ${stops.length} stops, not the five the stripe is made ` +\n 'of (base at 0% / 35%, shine at 50%, base at 65% / 100%). Reading a colour out of a differently ' +\n 'shaped gradient would report a stop that means something else.'\n );\n }\n return stops;\n }\n\n /** The gradient's arguments — the angle first, then the stops. */\n private async gradientArguments(caller: string): Promise<string[]> {\n const gradient = await this.require(caller, 'background-image');\n const match = GRADIENT.exec(gradient);\n\n if (!match) {\n throw new Error(\n `WrShinyTextHarness.${caller}(): \\`background-image\\` is \"${gradient}\", which is not a linear-gradient(). ` +\n 'The stripe IS that gradient, so anything else means the component is no longer painting one.'\n );\n }\n return splitTopLevel(match[1], ',');\n }\n\n /** One of the host's two inline declarations, or a failure that says which one is missing. */\n private async require(caller: string, property: string): Promise<string> {\n const style = (await (await this.host()).getAttribute('style')) ?? '';\n\n for (const declaration of splitTopLevel(style, ';')) {\n const colon = declaration.indexOf(':');\n if (colon !== -1 && declaration.slice(0, colon).trim() === property) {\n return declaration.slice(colon + 1).trim();\n }\n }\n\n throw new Error(\n `WrShinyTextHarness.${caller}(): the host carries no inline \\`${property}\\` (style: \"${style}\"). The ` +\n 'component writes it on every render, so its absence is a broken host binding rather than a default — ' +\n 'and it is read inline, not through computed style, precisely so the stylesheet cannot answer for it.'\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH,MAAM,QAAQ,GAAG,4BAA4B;AAC7C,MAAM,OAAO,GAAG,iBAAiB;AACjC,MAAM,aAAa,GAAG,eAAe;AAErC;AACA,SAAS,aAAa,CAAC,KAAa,EAAE,SAAiB,EAAA;IACrD,MAAM,KAAK,GAAa,EAAE;IAC1B,IAAI,KAAK,GAAG,CAAC;IACb,IAAI,OAAO,GAAG,EAAE;AAEhB,IAAA,KAAK,MAAM,SAAS,IA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AC,IAAI,CAAC,QAAQ,CAAC;QAErC,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,MAAM,IAAI,KAAK,CACb,sBAAsB,MAAM,CAAA,6BAAA,EAAgC,QAAQ,CAAA,qCAAA,CAAuC;AACzG,gBAAA,8FAA8F,CACjG;QACH;QACA,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;IACrC;;AAGQ,IAAA,MAAM,OAAO,CAAC,MAAc,EAAE,QAAgB,EAAA;AACpD,QAAA,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;QAErE,KAAK,MAAM,WAAW,IAAI,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;YACnD,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC;AACtC,YAAA,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,QAAQ,EAAE;gBACnE,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE;YAC5C;QACF;QAEA,MAAM,IAAI,KAAK,CACb,CAAA,mBAAA,EAAsB,MAAM,CAAA,iCAAA,EAAoC,QAAQ,CAAA,YAAA,EAAe,KAAK,CAAA,QAAA,CAAU;YACpG,uGAAuG;AACvG,YAAA,sGAAsG,CACzG;IACH;;;AC5QF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-shiny-text-testing.mjs","sources":["../../../projects/lib/shiny-text/testing/wr-shiny-text-harness.ts","../../../projects/lib/shiny-text/testing/ngwr-shiny-text-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrShinyTextHarnessFilters, WrShinyTextSweepDirection } from './interfaces';\n\nconst GRADIENT = /^linear-gradient\\((.*)\\)$/s;\nconst DEGREES = /^(-?[\\d.]+)deg$/;\nconst STOP_POSITION = /\\s+-?[\\d.]+%$/;\n\n/** Split a declaration list or an argument list on top-level separators only. */\nfunction splitTopLevel(value: string, separator: string): string[] {\n const parts: string[] = [];\n let depth = 0;\n let current = '';\n\n for (const character of value) {\n if (character === '(') depth++;\n if (character === ')') depth--;\n\n if (character === separator && depth === 0) {\n parts.push(current.trim());\n current = '';\n } else {\n current += character;\n }\n }\n\n parts.push(current.trim());\n return parts;\n}\n\n/** The colour half of a `<colour> <position>` gradient stop. */\nfunction stopColour(stop: string): string {\n return stop.replace(STOP_POSITION, '').trim();\n}\n\n/**\n * Test harness for `<wr-shiny-text>`.\n *\n * **The duration is the assertion that matters.** The pause between sweeps is not\n * `animation-delay` and not a second animation — it is folded INTO `animation-duration`,\n * because the keyframe finishes at 50% and holds there. So `[speed]=\"2\"` with\n * `[delay]=\"3\"` has to read 5 seconds, and anyone reimplementing the pause the obvious\n * way passes every other check here and fails {@link getCycleDurationSeconds}.\n *\n * **The stripe is five stops and only one of them is the shine.** The base colour fills\n * 0%, 35%, 65% and 100%; the highlight sits alone at 50%. {@link getBaseColor} and\n * {@link getShineColor} are offered as a pair because swapping the two inputs is\n * otherwise undetectable — the gradient stays well-formed, the angle is unchanged, and\n * the text simply stops shimmering.\n *\n * **Both gradient reads come off the inline `style` attribute**, not through computed\n * style. Unset colours fall through to the literal `var(--wr-shiny-text-base)` /\n * `var(--wr-shiny-text-shine)` tokens, which is exactly what makes the dark-theme\n * override work — and a computed read resolves those tokens in a real browser while\n * handing them back verbatim in a unit test. Reading what the component wrote gives the\n * same answer in both places.\n *\n * The colours still pass through the CSSOM on their way back out, and it has its own\n * spelling: a hex literal is re-serialised, so `[color]=\"'#444'\"` reads\n * `rgb(68, 68, 68)`. Functional notations and `var()` tokens survive untouched. Assert\n * the form the CSSOM returns, not the one the template passed in.\n *\n * There is no inner element to query: the template is the bare interpolation, so the text\n * is a node on the host. A locator copied from the gradient-text harness finds nothing.\n *\n * **What the harness deliberately does not offer**, and why. There is no `isAnimating()`\n * / `getBackgroundPosition()`: the sweep is a stylesheet keyframe over\n * `background-position`, and a unit test neither loads the sheet nor runs the animation.\n * There is no `getAnimationName()` / `getIterationCount()` / `getPlayState()`: every\n * animation property except the duration lives in the stylesheet, so those reads answer\n * the same empty string for a working component and a deleted one. {@link isPaused} and\n * {@link pausesOnHover} claim the CLASSES and not the pauses — `:hover` is a selector and\n * `animation-play-state` is a stylesheet rule, so what they honestly pin is that the\n * input arrived. There is no `respectsReducedMotion()`: the handling is a `@media` block\n * with no TypeScript counterpart. And there is nothing reporting the painted text colour,\n * because `-webkit-text-fill-color: transparent` is a stylesheet declaration and a read\n * would report the inherited colour as if the text were solid.\n *\n * The `[wrShimmer]` directive shipped from the same entry point has no harness: it adds\n * one static class and nothing else, so a harness could only restate its own selector.\n *\n * @example\n * ```ts\n * const shiny = await loader.getHarness(WrShinyTextHarness);\n *\n * expect(await shiny.getCycleDurationSeconds()).toBe(5);\n * expect(await shiny.getShineColor()).toBe('var(--wr-shiny-text-shine)');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrShinyTextHarness extends ComponentHarness {\n static hostSelector = 'wr-shiny-text';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrShinyTextHarnessFilters = {}): HarnessPredicate<WrShinyTextHarness> {\n return new HarnessPredicate(WrShinyTextHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('paused', options.paused, async (harness, paused) => (await harness.isPaused()) === paused)\n .addOption(\n 'direction',\n options.direction,\n async (harness, direction) => (await harness.getDirection()) === direction\n );\n }\n\n /** The rendered text, trimmed. It is a text node on the host — there is no inner span. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * The whole stripe gradient the component computed, as written.\n *\n * Unresolved on purpose. With no `[color]` / `[shineColor]` given this string contains\n * the theme's own custom-property tokens rather than colours, and that is the working\n * state, not a gap — resolving them would need the stylesheet, and the resolved answer\n * would differ between a unit test and a browser.\n */\n async getGradient(): Promise<string> {\n return this.require('getGradient', 'background-image');\n }\n\n /**\n * The gradient's angle in degrees, from `[spread]`.\n *\n * The only observable effect that input has, `numAttr` coercion included. Note the name\n * is inherited vocabulary and describes the ANGLE, not the width of the bright stripe:\n * the stop positions are hard-coded, so no input narrows the shine.\n */\n async getSpreadDegrees(): Promise<number> {\n const [angle] = await this.gradientArguments('getSpreadDegrees');\n const match = DEGREES.exec(angle);\n\n if (!match) {\n throw new Error(\n `WrShinyTextHarness.getSpreadDegrees(): the gradient starts with \"${angle}\", which is not an angle in ` +\n 'degrees. The component writes `<spread>deg` as the first argument of the gradient; anything else ' +\n 'means the angle is no longer coming from that input.'\n );\n }\n return Number.parseFloat(match[1]);\n }\n\n /**\n * The colour outside the bright stripe — the 0% stop.\n *\n * The same colour fills 35%, 65% and 100%; only the 50% stop differs. Assert it next to\n * {@link getShineColor}: a `[color]` that lands in the shine slot instead leaves a\n * perfectly valid gradient that no longer shimmers.\n */\n async getBaseColor(): Promise<string> {\n return stopColour((await this.gradientStops('getBaseColor'))[0]);\n }\n\n /** The highlight colour — the lone 50% stop the stripe is made of. */\n async getShineColor(): Promise<string> {\n return stopColour((await this.gradientStops('getShineColor'))[2]);\n }\n\n /**\n * One full cycle in seconds — the sweep AND the pause after it.\n *\n * `[delay]` is not `animation-delay` and not a second animation: the keyframe reaches\n * its end at 50% and holds, so the wait is bought by making the animation twice as long.\n * That is why this reads `speed + delay` and why the method is named for the cycle\n * rather than for the sweep.\n *\n * Read from the inline declaration rather than from computed style, so a missing binding\n * is reported as missing instead of being answered from the stylesheet.\n */\n async getCycleDurationSeconds(): Promise<number> {\n const raw = await this.require('getCycleDurationSeconds', 'animation-duration');\n const seconds = Number.parseFloat(raw);\n\n if (Number.isNaN(seconds)) {\n throw new Error(\n `WrShinyTextHarness.getCycleDurationSeconds(): \\`animation-duration\\` is \"${raw}\", which is not a number ` +\n 'of seconds. The component writes `[speed] + [delay]` there — the pause is folded into the duration ' +\n 'rather than expressed as a delay.'\n );\n }\n return seconds;\n }\n\n /**\n * Whether the animation is stopped (`disabled`).\n *\n * Three names for one thing, which is why this method exists rather than a spec reading\n * the class: the input is `disabled`, its JSDoc says \"pause\", and the DOM contract is\n * `wr-shiny-text--paused`. Only the last of those is public API.\n */\n async isPaused(): Promise<boolean> {\n return (await this.host()).hasClass('wr-shiny-text--paused');\n }\n\n /** Whether the opt-in reached the class the `:hover` rule needs. */\n async pausesOnHover(): Promise<boolean> {\n return (await this.host()).hasClass('wr-shiny-text--pause-on-hover');\n }\n\n /**\n * Whether the stripe bounces instead of restarting (`yoyo`).\n *\n * Defaults to `false` here — the opposite of the same-named input on `wr-gradient-text`,\n * which is worth pinning in a spec that uses both. Together with {@link getDirection}\n * this is the whole four-way matrix the stylesheet derives `animation-direction` from.\n */\n async isYoyo(): Promise<boolean> {\n return (await this.host()).hasClass('wr-shiny-text--yoyo');\n }\n\n /** Which way the stripe travels — `'left'` is the absence of the reverse modifier. */\n async getDirection(): Promise<WrShinyTextSweepDirection> {\n return (await (await this.host()).hasClass('wr-shiny-text--reverse')) ? 'right' : 'left';\n }\n\n /** The five stops of the stripe, positions attached, in gradient order. */\n private async gradientStops(caller: string): Promise<string[]> {\n const [, ...stops] = await this.gradientArguments(caller);\n\n if (stops.length !== 5) {\n throw new Error(\n `WrShinyTextHarness.${caller}(): the gradient has ${stops.length} stops, not the five the stripe is made ` +\n 'of (base at 0% / 35%, shine at 50%, base at 65% / 100%). Reading a colour out of a differently ' +\n 'shaped gradient would report a stop that means something else.'\n );\n }\n return stops;\n }\n\n /** The gradient's arguments — the angle first, then the stops. */\n private async gradientArguments(caller: string): Promise<string[]> {\n const gradient = await this.require(caller, 'background-image');\n const match = GRADIENT.exec(gradient);\n\n if (!match) {\n throw new Error(\n `WrShinyTextHarness.${caller}(): \\`background-image\\` is \"${gradient}\", which is not a linear-gradient(). ` +\n 'The stripe IS that gradient, so anything else means the component is no longer painting one.'\n );\n }\n return splitTopLevel(match[1], ',');\n }\n\n /** One of the host's two inline declarations, or a failure that says which one is missing. */\n private async require(caller: string, property: string): Promise<string> {\n const style = (await (await this.host()).getAttribute('style')) ?? '';\n\n for (const declaration of splitTopLevel(style, ';')) {\n const colon = declaration.indexOf(':');\n if (colon !== -1 && declaration.slice(0, colon).trim() === property) {\n return declaration.slice(colon + 1).trim();\n }\n }\n\n throw new Error(\n `WrShinyTextHarness.${caller}(): the host carries no inline \\`${property}\\` (style: \"${style}\"). The ` +\n 'component writes it on every render, so its absence is a broken host binding rather than a default — ' +\n 'and it is read inline, not through computed style, precisely so the stylesheet cannot answer for it.'\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH,MAAM,QAAQ,GAAG,4BAA4B;AAC7C,MAAM,OAAO,GAAG,iBAAiB;AACjC,MAAM,aAAa,GAAG,eAAe;AAErC;AACA,SAAS,aAAa,CAAC,KAAa,EAAE,SAAiB,EAAA;IACrD,MAAM,KAAK,GAAa,EAAE;IAC1B,IAAI,KAAK,GAAG,CAAC;IACb,IAAI,OAAO,GAAG,EAAE;AAEhB,IAAA,KAAK,MAAM,SAAS,IAAI,KAAK,EAAE;QAC7B,IAAI,SAAS,KAAK,GAAG;AAAE,YAAA,KAAK,EAAE;QAC9B,IAAI,SAAS,KAAK,GAAG;AAAE,YAAA,KAAK,EAAE;QAE9B,IAAI,SAAS,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC,EAAE;YAC1C,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC1B,OAAO,GAAG,EAAE;QACd;aAAO;YACL,OAAO,IAAI,SAAS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gB,EAAA;AACpD,QAAA,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;QAErE,KAAK,MAAM,WAAW,IAAI,aAAa,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;YACnD,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC;AACtC,YAAA,IAAI,KAAK,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,QAAQ,EAAE;gBACnE,OAAO,WAAW,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE;YAC5C;QACF;QAEA,MAAM,IAAI,KAAK,CACb,CAAA,mBAAA,EAAsB,MAAM,CAAA,iCAAA,EAAoC,QAAQ,CAAA,YAAA,EAAe,KAAK,CAAA,QAAA,CAAU;YACpG,uGAAuG;AACvG,YAAA,sGAAsG,CACzG;IACH;;;AC5QF;;AAEG;;"}
@@ -78,10 +78,10 @@ class WrShinyText {
78
78
  slot(value, fallback) {
79
79
  return value !== null && isSafeCssValue(value) ? value : fallback;
80
80
  }
81
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrShinyText, deps: [], target: i0.ɵɵFactoryTarget.Component });
82
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: WrShinyText, isStandalone: true, selector: "wr-shiny-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, shineColor: { classPropertyName: "shineColor", publicName: "shineColor", isSignal: true, isRequired: false, transformFunction: null }, spread: { classPropertyName: "spread", publicName: "spread", isSignal: true, isRequired: false, transformFunction: null }, yoyo: { classPropertyName: "yoyo", publicName: "yoyo", isSignal: true, isRequired: false, transformFunction: null }, pauseOnHover: { classPropertyName: "pauseOnHover", publicName: "pauseOnHover", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-shiny-text--paused": "disabled()", "class.wr-shiny-text--pause-on-hover": "pauseOnHover()", "class.wr-shiny-text--yoyo": "yoyo()", "class.wr-shiny-text--reverse": "direction() === 'right'", "style.background-image": "gradient()", "style.animation-duration": "totalDuration() + 's'" }, classAttribute: "wr-shiny-text" }, ngImport: i0, template: '{{ text() }}', isInline: true, styles: [".wr-shiny-text{--wr-shiny-text-base: var(--wr-color-on-surface-muted, #8594a4);--wr-shiny-text-shine: var(--wr-color-on-surface, #0f172a);display:inline-block;background-size:200% auto;background-position:150% center;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;animation-name:wr-shiny-text-sweep;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:normal;animation-fill-mode:both;animation-play-state:running}.wr-shiny-text--reverse{animation-direction:reverse}.wr-shiny-text--yoyo{animation-direction:alternate}.wr-shiny-text--yoyo.wr-shiny-text--reverse{animation-direction:alternate-reverse}.wr-shiny-text--paused,.wr-shiny-text--pause-on-hover:hover{animation-play-state:paused}@keyframes wr-shiny-text-sweep{0%{background-position:150% center}50%{background-position:-50% center}to{background-position:-50% center}}@media(prefers-reduced-motion:reduce){.wr-shiny-text{animation:none!important}}@keyframes wr-shimmer{to{background-position-x:-200%}}.wr-shimmer{background:linear-gradient(110deg,var(--wr-color-on-surface) 30%,rgba(var(--wr-color-primary-rgb),.9) 50%,var(--wr-color-on-surface) 70%);background-size:200% 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;color:transparent;animation:wr-shimmer 2.5s linear infinite}@media(prefers-reduced-motion:reduce){.wr-shimmer{animation:none}}\n"], encapsulation: i0.ViewEncapsulation.None });
81
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrShinyText, deps: [], target: i0.ɵɵFactoryTarget.Component });
82
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: WrShinyText, isStandalone: true, selector: "wr-shiny-text", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, speed: { classPropertyName: "speed", publicName: "speed", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, shineColor: { classPropertyName: "shineColor", publicName: "shineColor", isSignal: true, isRequired: false, transformFunction: null }, spread: { classPropertyName: "spread", publicName: "spread", isSignal: true, isRequired: false, transformFunction: null }, yoyo: { classPropertyName: "yoyo", publicName: "yoyo", isSignal: true, isRequired: false, transformFunction: null }, pauseOnHover: { classPropertyName: "pauseOnHover", publicName: "pauseOnHover", isSignal: true, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wr-shiny-text--paused": "disabled()", "class.wr-shiny-text--pause-on-hover": "pauseOnHover()", "class.wr-shiny-text--yoyo": "yoyo()", "class.wr-shiny-text--reverse": "direction() === 'right'", "style.background-image": "gradient()", "style.animation-duration": "totalDuration() + 's'" }, classAttribute: "wr-shiny-text" }, ngImport: i0, template: '{{ text() }}', isInline: true, styles: [".wr-shiny-text{--wr-shiny-text-base: var(--wr-color-on-surface-muted, #8594a4);--wr-shiny-text-shine: var(--wr-color-on-surface, #0f172a);display:inline-block;background-size:200% auto;background-position:150% center;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;animation-name:wr-shiny-text-sweep;animation-timing-function:linear;animation-iteration-count:infinite;animation-direction:normal;animation-fill-mode:both;animation-play-state:running}.wr-shiny-text--reverse{animation-direction:reverse}.wr-shiny-text--yoyo{animation-direction:alternate}.wr-shiny-text--yoyo.wr-shiny-text--reverse{animation-direction:alternate-reverse}.wr-shiny-text--paused,.wr-shiny-text--pause-on-hover:hover{animation-play-state:paused}@keyframes wr-shiny-text-sweep{0%{background-position:150% center}50%{background-position:-50% center}to{background-position:-50% center}}@media(prefers-reduced-motion:reduce){.wr-shiny-text{animation:none!important}}@keyframes wr-shimmer{to{background-position-x:-200%}}.wr-shimmer{background:linear-gradient(110deg,var(--wr-color-on-surface) 30%,rgba(var(--wr-color-primary-rgb),.9) 50%,var(--wr-color-on-surface) 70%);background-size:200% 100%;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;color:transparent;animation:wr-shimmer 2.5s linear infinite}@media(prefers-reduced-motion:reduce){.wr-shimmer{animation:none}}\n"], encapsulation: i0.ViewEncapsulation.None });
83
83
  }
84
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrShinyText, decorators: [{
84
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrShinyText, decorators: [{
85
85
  type: Component,
86
86
  args: [{ selector: 'wr-shiny-text', template: '{{ text() }}', encapsulation: ViewEncapsulation.None, host: {
87
87
  class: 'wr-shiny-text',
@@ -115,10 +115,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImpor
115
115
  * ```
116
116
  */
117
117
  class WrShimmer {
118
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrShimmer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
119
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.6", type: WrShimmer, isStandalone: true, selector: "[wrShimmer]", host: { classAttribute: "wr-shimmer" }, ngImport: i0 });
118
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrShimmer, deps: [], target: i0.ɵɵFactoryTarget.Directive });
119
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.7", type: WrShimmer, isStandalone: true, selector: "[wrShimmer]", host: { classAttribute: "wr-shimmer" }, ngImport: i0 });
120
120
  }
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrShimmer, decorators: [{
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrShimmer, decorators: [{
122
122
  type: Directive,
123
123
  args: [{
124
124
  selector: '[wrShimmer]',
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-shiny-text.mjs","sources":["../../../projects/lib/shiny-text/shiny-text.ts","../../../projects/lib/shiny-text/shimmer.ts","../../../projects/lib/shiny-text/ngwr-shiny-text.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 * Angular adaptation of the ShinyText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/shiny-text\n *\n * The reactbits version uses `motion/react` to drive `background-position`\n * via rAF. This port is pure CSS — the same effect via a keyframe that\n * sweeps `background-position`, parameterised by `[speed]` / `[delay]` /\n * `[yoyo]` / `[direction]`.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { isSafeCssValue, numAttr } from 'ngwr/utils';\n\n/**\n * Animated shimmer-over-text effect. A bright stripe sweeps across the\n * text using `background-clip: text` + an animated `background-position`.\n *\n * @example\n * ```html\n * <wr-shiny-text text=\"Premium\" />\n * <wr-shiny-text\n * text=\"Custom\"\n * color=\"#444\"\n * shineColor=\"#a0e0ff\"\n * [speed]=\"3\"\n * [delay]=\"0.5\"\n * [yoyo]=\"true\"\n * [pauseOnHover]=\"true\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/shiny-text\n */\n@Component({\n selector: 'wr-shiny-text',\n template: '{{ text() }}',\n styleUrl: './shiny-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-shiny-text',\n '[class.wr-shiny-text--paused]': 'disabled()',\n '[class.wr-shiny-text--pause-on-hover]': 'pauseOnHover()',\n '[class.wr-shiny-text--yoyo]': 'yoyo()',\n '[class.wr-shiny-text--reverse]': \"direction() === 'right'\",\n '[style.background-image]': 'gradient()',\n '[style.animation-duration]': \"totalDuration() + 's'\",\n },\n})\nexport class WrShinyText {\n /** Text to render. */\n readonly text = input.required<string>();\n\n /** Pause the animation. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Time for the bright stripe to traverse the text, in seconds. @default 2 */\n readonly speed = input(2, { transform: numAttr(2) });\n\n /** Base text colour outside the bright stripe. Unset falls back to `--wr-shiny-text-base`. */\n readonly color = input<string | null>(null);\n\n /** Sweep highlight colour. Unset falls back to the theme token. */\n readonly shineColor = input<string | null>(null);\n\n /** Gradient angle in degrees. @default 120 */\n readonly spread = input(120, { transform: numAttr(120) });\n\n /** Bounce the stripe back-and-forth instead of restarting. @default false */\n readonly yoyo = input(false, { transform: coerceBooleanProperty });\n\n /** Pause the animation while hovered. @default false */\n readonly pauseOnHover = input(false, { transform: coerceBooleanProperty });\n\n /** Sweep direction. @default 'left' */\n readonly direction = input<'left' | 'right'>('left');\n\n /** Pause between sweeps in seconds. @default 0 */\n readonly delay = input(0, { transform: numAttr(0) });\n\n /** Total animation cycle (speed + delay) in seconds. */\n protected readonly totalDuration = computed(() => this.speed() + this.delay());\n\n protected readonly gradient = computed(() => {\n // Both colours are CONCATENATED into the gradient below, so a value that\n // balances the surrounding parens escapes its stop and adds a `url()` layer\n // the browser then fetches. Anything that would not stay in its slot falls\n // back to the theme token — see `isSafeCssValue`.\n const base = this.slot(this.color(), 'var(--wr-shiny-text-base)');\n const shine = this.slot(this.shineColor(), 'var(--wr-shiny-text-shine)');\n return `linear-gradient(${this.spread()}deg, ${base} 0%, ${base} 35%, ${shine} 50%, ${base} 65%, ${base} 100%)`;\n });\n\n private slot(value: string | null, fallback: string): string {\n return value !== null && isSafeCssValue(value) ? value : fallback;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n/**\n * Gradient sweep over text. Applies a `background-clip: text` gradient\n * with a moving highlight — gives any text a subtle shimmer.\n *\n * The directive only adds the `wr-shimmer` host class. Pair with the styles\n * in `ngwr/shiny-text` (`@use 'ngwr/shiny-text'`), which carry the\n * `.wr-shimmer` rule and its keyframes; the umbrella `@use 'ngwr'` forwards\n * the same sheet.\n *\n * @example\n * ```html\n * <h1 wrShimmer>Premium</h1>\n * ```\n */\n@Directive({\n selector: '[wrShimmer]',\n host: { class: 'wr-shimmer' },\n})\nexport class WrShimmer {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;AAaG;AAOH;;;;;;;;;;;;;;;;;;;AAmBG;MAgBU,WAAW,CAAA;;IAEb,IAAI,GAAG,KAAK,CAAC,QAAQ;6EAAU;;IAG/B,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;AAG7D,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CA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A,IAAA,EAAA,EAAA,cAAA,EAAA,YAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAJrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;AAC9B,iBAAA;;;AC1BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-shiny-text.mjs","sources":["../../../projects/lib/shiny-text/shiny-text.ts","../../../projects/lib/shiny-text/shimmer.ts","../../../projects/lib/shiny-text/ngwr-shiny-text.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 * Angular adaptation of the ShinyText effect by David Haz / reactbits.dev.\n * Original: https://www.reactbits.dev/text-animations/shiny-text\n *\n * The reactbits version uses `motion/react` to drive `background-position`\n * via rAF. This port is pure CSS — the same effect via a keyframe that\n * sweeps `background-position`, parameterised by `[speed]` / `[delay]` /\n * `[yoyo]` / `[direction]`.\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport { isSafeCssValue, numAttr } from 'ngwr/utils';\n\n/**\n * Animated shimmer-over-text effect. A bright stripe sweeps across the\n * text using `background-clip: text` + an animated `background-position`.\n *\n * @example\n * ```html\n * <wr-shiny-text text=\"Premium\" />\n * <wr-shiny-text\n * text=\"Custom\"\n * color=\"#444\"\n * shineColor=\"#a0e0ff\"\n * [speed]=\"3\"\n * [delay]=\"0.5\"\n * [yoyo]=\"true\"\n * [pauseOnHover]=\"true\"\n * />\n * ```\n *\n * @see https://www.reactbits.dev/text-animations/shiny-text\n */\n@Component({\n selector: 'wr-shiny-text',\n template: '{{ text() }}',\n styleUrl: './shiny-text.scss',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-shiny-text',\n '[class.wr-shiny-text--paused]': 'disabled()',\n '[class.wr-shiny-text--pause-on-hover]': 'pauseOnHover()',\n '[class.wr-shiny-text--yoyo]': 'yoyo()',\n '[class.wr-shiny-text--reverse]': \"direction() === 'right'\",\n '[style.background-image]': 'gradient()',\n '[style.animation-duration]': \"totalDuration() + 's'\",\n },\n})\nexport class WrShinyText {\n /** Text to render. */\n readonly text = input.required<string>();\n\n /** Pause the animation. @default false */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Time for the bright stripe to traverse the text, in seconds. @default 2 */\n readonly speed = input(2, { transform: numAttr(2) });\n\n /** Base text colour outside the bright stripe. Unset falls back to `--wr-shiny-text-base`. */\n readonly color = input<string | null>(null);\n\n /** Sweep highlight colour. Unset falls back to the theme token. */\n readonly shineColor = input<string | null>(null);\n\n /** Gradient angle in degrees. @default 120 */\n readonly spread = input(120, { transform: numAttr(120) });\n\n /** Bounce the stripe back-and-forth instead of restarting. @default false */\n readonly yoyo = input(false, { transform: coerceBooleanProperty });\n\n /** Pause the animation while hovered. @default false */\n readonly pauseOnHover = input(false, { transform: coerceBooleanProperty });\n\n /** Sweep direction. @default 'left' */\n readonly direction = input<'left' | 'right'>('left');\n\n /** Pause between sweeps in seconds. @default 0 */\n readonly delay = input(0, { transform: numAttr(0) });\n\n /** Total animation cycle (speed + delay) in seconds. */\n protected readonly totalDuration = computed(() => this.speed() + this.delay());\n\n protected readonly gradient = computed(() => {\n // Both colours are CONCATENATED into the gradient below, so a value that\n // balances the surrounding parens escapes its stop and adds a `url()` layer\n // the browser then fetches. Anything that would not stay in its slot falls\n // back to the theme token — see `isSafeCssValue`.\n const base = this.slot(this.color(), 'var(--wr-shiny-text-base)');\n const shine = this.slot(this.shineColor(), 'var(--wr-shiny-text-shine)');\n return `linear-gradient(${this.spread()}deg, ${base} 0%, ${base} 35%, ${shine} 50%, ${base} 65%, ${base} 100%)`;\n });\n\n private slot(value: string | null, fallback: string): string {\n return value !== null && isSafeCssValue(value) ? value : fallback;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive } from '@angular/core';\n\n/**\n * Gradient sweep over text. Applies a `background-clip: text` gradient\n * with a moving highlight — gives any text a subtle shimmer.\n *\n * The directive only adds the `wr-shimmer` host class. Pair with the styles\n * in `ngwr/shiny-text` (`@use 'ngwr/shiny-text'`), which carry the\n * `.wr-shimmer` rule and its keyframes; the umbrella `@use 'ngwr'` forwards\n * the same sheet.\n *\n * @example\n * ```html\n * <h1 wrShimmer>Premium</h1>\n * ```\n */\n@Directive({\n selector: '[wrShimmer]',\n host: { class: 'wr-shimmer' },\n})\nexport class WrShimmer {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;;;;;;;;;AAaG;AAOH;;;;;;;;;;;;;;;;;;;AAmBG;MAgBU,WAAW,CAAA;;IAEb,IAAI,GAAG,KAAK,CAAC,QAAQ;6EAAU;;IAG/B,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;AAG7D,IAAA,KAAK,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,EAAA,CAAG;;IAG3C,KAAK,GAAG,KAAK,CAAgB,IAAI;8EAAC;;IAGlC,UAAU,GAAG,KAAK,CAAgB,IAAI;mFAAC;;AAGvC,IAAA,MAAM,GAAG,KAAK,CAAC,GAAG,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,QAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,EAAA,CAAG;;IAGhD,IAAI,GAA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) or `WrSidebarGroup`s (expand to reveal
50
50
  * child items). Active route auto-expands its containing group.
51
51
  *
52
+ * The host pads its rows by `--wr-sidebar-padding` (`0.5rem`), so a hovered or
53
+ * active row's tint stays off the edge of whatever holds the nav, a bordered
54
+ * card or a `<wr-layout-sider>`, which pads nothing itself. Where the container
55
+ * already supplies the inset, set the hook to `0` on the sidebar, not on the
56
+ * container: the host declares its own default, which shadows an inherited one
57
+ * (`.my-panel .wr-sidebar { --wr-sidebar-padding: 0 }`, or inline).
58
+ *
52
59
  * @example
53
60
  * ```html
54
61
  * <wr-sidebar [entries]="[
@@ -186,10 +193,10 @@ class WrSidebar {
186
193
  }
187
194
  return null;
188
195
  }
189
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrSidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
190
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrSidebar, isStandalone: true, selector: "wr-sidebar", inputs: { entries: { classPropertyName: "entries", publicName: "entries", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, defaultGroupIcon: { classPropertyName: "defaultGroupIcon", publicName: "defaultGroupIcon", isSignal: true, isRequired: false, transformFunction: null }, defaultItemIcon: { classPropertyName: "defaultItemIcon", publicName: "defaultItemIcon", isSignal: true, isRequired: false, transformFunction: null }, autoExpand: { classPropertyName: "autoExpand", publicName: "autoExpand", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "resolvedAriaLabel()" }, classAttribute: "wr-sidebar" }, ngImport: i0, template: "<!-- A div, not a <nav>: the host already IS the navigation landmark, and two\n nested ones announce the same list twice. -->\n<div class=\"wr-sidebar__inner\">\n @for (entry of entries(); track entry.title) {\n @if (!isGroup(entry)) {\n <!--\n A span, not a greyed anchor, exactly as the nested branch below does it.\n `--disabled` only paints: `pointer-events: none` stops a real pointer but\n not the keyboard, so a disabled entry stayed in the tab order and Enter\n navigated \u2014 `disabled` on a `WrSidebarItem` is documented as \"no\n navigation\". An empty `url` is the same case: `[routerLink]=\"[]\"` resolves\n to the current route, which is a link that goes nowhere.\n -->\n @if (asItem(entry).disabled || !asItem(entry).url.length) {\n <span class=\"wr-sidebar__entry wr-sidebar__entry--disabled\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__entry\" routerLinkActive=\"wr-sidebar__entry--active\" [routerLink]=\"asItem(entry).url\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </a>\n }\n } @else {\n <section class=\"wr-sidebar__group\" [class.wr-sidebar__group--collapsed]=\"!isOpen(entry.title)\">\n <button\n type=\"button\"\n class=\"wr-sidebar__group-toggle\"\n [attr.aria-expanded]=\"isOpen(entry.title)\"\n [attr.aria-controls]=\"groupBodyId($index)\"\n (click)=\"toggleGroup(entry.title)\"\n >\n @if (asGroup(entry).icon || defaultGroupIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n <!-- Inline chrome chevron \u2014 not user-customizable. -->\n <svg\n class=\"wr-icon__svg wr-sidebar__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n <div\n class=\"wr-sidebar__group-wrap\"\n [attr.id]=\"groupBodyId($index)\"\n [attr.inert]=\"!isOpen(entry.title) ? '' : null\"\n >\n <div class=\"wr-sidebar__group-body\">\n <ul class=\"wr-sidebar__list\">\n @for (child of asGroup(entry).children; track child.title) {\n <li>\n @if (child.disabled || !child.url.length) {\n <span class=\"wr-sidebar__item wr-sidebar__item--disabled\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__item\" routerLinkActive=\"wr-sidebar__item--active\" [routerLink]=\"child.url\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </a>\n }\n </li>\n }\n </ul>\n </div>\n </div>\n </section>\n }\n }\n</div>\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
196
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSidebar, deps: [], target: i0.ɵɵFactoryTarget.Component });
197
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: WrSidebar, isStandalone: true, selector: "wr-sidebar", inputs: { entries: { classPropertyName: "entries", publicName: "entries", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, defaultGroupIcon: { classPropertyName: "defaultGroupIcon", publicName: "defaultGroupIcon", isSignal: true, isRequired: false, transformFunction: null }, defaultItemIcon: { classPropertyName: "defaultItemIcon", publicName: "defaultItemIcon", isSignal: true, isRequired: false, transformFunction: null }, autoExpand: { classPropertyName: "autoExpand", publicName: "autoExpand", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "resolvedAriaLabel()" }, classAttribute: "wr-sidebar" }, ngImport: i0, template: "<!-- A div, not a <nav>: the host already IS the navigation landmark, and two\n nested ones announce the same list twice. -->\n<div class=\"wr-sidebar__inner\">\n @for (entry of entries(); track entry.title) {\n @if (!isGroup(entry)) {\n <!--\n A span, not a greyed anchor, exactly as the nested branch below does it.\n `--disabled` only paints: `pointer-events: none` stops a real pointer but\n not the keyboard, so a disabled entry stayed in the tab order and Enter\n navigated \u2014 `disabled` on a `WrSidebarItem` is documented as \"no\n navigation\". An empty `url` is the same case: `[routerLink]=\"[]\"` resolves\n to the current route, which is a link that goes nowhere.\n -->\n @if (asItem(entry).disabled || !asItem(entry).url.length) {\n <span class=\"wr-sidebar__entry wr-sidebar__entry--disabled\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__entry\" routerLinkActive=\"wr-sidebar__entry--active\" [routerLink]=\"asItem(entry).url\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </a>\n }\n } @else {\n <section class=\"wr-sidebar__group\" [class.wr-sidebar__group--collapsed]=\"!isOpen(entry.title)\">\n <button\n type=\"button\"\n class=\"wr-sidebar__group-toggle\"\n [attr.aria-expanded]=\"isOpen(entry.title)\"\n [attr.aria-controls]=\"groupBodyId($index)\"\n (click)=\"toggleGroup(entry.title)\"\n >\n @if (asGroup(entry).icon || defaultGroupIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n <!-- Inline chrome chevron \u2014 not user-customizable. -->\n <svg\n class=\"wr-icon__svg wr-sidebar__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n <div\n class=\"wr-sidebar__group-wrap\"\n [attr.id]=\"groupBodyId($index)\"\n [attr.inert]=\"!isOpen(entry.title) ? '' : null\"\n >\n <div class=\"wr-sidebar__group-body\">\n <ul class=\"wr-sidebar__list\">\n @for (child of asGroup(entry).children; track child.title) {\n <li>\n @if (child.disabled || !child.url.length) {\n <span class=\"wr-sidebar__item wr-sidebar__item--disabled\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__item\" routerLinkActive=\"wr-sidebar__item--active\" [routerLink]=\"child.url\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </a>\n }\n </li>\n }\n </ul>\n </div>\n </div>\n </section>\n }\n }\n</div>\n", dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: WrIcon, selector: "wr-icon", inputs: ["name"] }], encapsulation: i0.ViewEncapsulation.None });
191
198
  }
192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrSidebar, decorators: [{
199
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSidebar, decorators: [{
193
200
  type: Component,
194
201
  args: [{ selector: 'wr-sidebar', encapsulation: ViewEncapsulation.None, host: { class: 'wr-sidebar', role: 'navigation', '[attr.aria-label]': 'resolvedAriaLabel()' }, imports: [RouterLink, RouterLinkActive, WrIcon], template: "<!-- A div, not a <nav>: the host already IS the navigation landmark, and two\n nested ones announce the same list twice. -->\n<div class=\"wr-sidebar__inner\">\n @for (entry of entries(); track entry.title) {\n @if (!isGroup(entry)) {\n <!--\n A span, not a greyed anchor, exactly as the nested branch below does it.\n `--disabled` only paints: `pointer-events: none` stops a real pointer but\n not the keyboard, so a disabled entry stayed in the tab order and Enter\n navigated \u2014 `disabled` on a `WrSidebarItem` is documented as \"no\n navigation\". An empty `url` is the same case: `[routerLink]=\"[]\"` resolves\n to the current route, which is a link that goes nowhere.\n -->\n @if (asItem(entry).disabled || !asItem(entry).url.length) {\n <span class=\"wr-sidebar__entry wr-sidebar__entry--disabled\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__entry\" routerLinkActive=\"wr-sidebar__entry--active\" [routerLink]=\"asItem(entry).url\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </a>\n }\n } @else {\n <section class=\"wr-sidebar__group\" [class.wr-sidebar__group--collapsed]=\"!isOpen(entry.title)\">\n <button\n type=\"button\"\n class=\"wr-sidebar__group-toggle\"\n [attr.aria-expanded]=\"isOpen(entry.title)\"\n [attr.aria-controls]=\"groupBodyId($index)\"\n (click)=\"toggleGroup(entry.title)\"\n >\n @if (asGroup(entry).icon || defaultGroupIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n <!-- Inline chrome chevron \u2014 not user-customizable. -->\n <svg\n class=\"wr-icon__svg wr-sidebar__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n <div\n class=\"wr-sidebar__group-wrap\"\n [attr.id]=\"groupBodyId($index)\"\n [attr.inert]=\"!isOpen(entry.title) ? '' : null\"\n >\n <div class=\"wr-sidebar__group-body\">\n <ul class=\"wr-sidebar__list\">\n @for (child of asGroup(entry).children; track child.title) {\n <li>\n @if (child.disabled || !child.url.length) {\n <span class=\"wr-sidebar__item wr-sidebar__item--disabled\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__item\" routerLinkActive=\"wr-sidebar__item--active\" [routerLink]=\"child.url\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </a>\n }\n </li>\n }\n </ul>\n </div>\n </div>\n </section>\n }\n }\n</div>\n" }]
195
202
  }], ctorParameters: () => [], propDecorators: { entries: [{ type: i0.Input, args: [{ isSignal: true, alias: "entries", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], defaultGroupIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultGroupIcon", required: false }] }], defaultItemIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultItemIcon", required: false }] }], autoExpand: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoExpand", required: false }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-sidebar.mjs","sources":["../../../projects/lib/sidebar/sidebar.ts","../../../projects/lib/sidebar/sidebar.html","../../../projects/lib/sidebar/ngwr-sidebar.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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, effect, inject, input, signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router, RouterLink, RouterLinkActive } from '@angular/router';\n\nimport { filter, map, startWith } from 'rxjs';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrIcon } from 'ngwr/icon';\n\nimport type { WrSidebarEntry, WrSidebarGroup, WrSidebarItem } from './interfaces';\n\nfunction isGroup(entry: WrSidebarEntry): entry is WrSidebarGroup {\n return 'children' in entry;\n}\n\n/**\n * Instance counter for the group-body ids. Deterministic under prerender, unlike\n * `randomId()`, and unique across sidebars — a title-only id collided between two\n * sidebars on one page, and `aria-controls` then pointed at the wrong body.\n */\nlet sidebarUid = 0;\n\n/**\n * A `routerLink` segment array as an absolute path.\n *\n * The documented form carries the leading slash on the FIRST segment\n * (`['/settings', 'profile']`), and prefixing another one produced\n * `//settings/profile` — a path no URL ever equals, which is why auto-expand\n * never fired for anyone following the example. Both forms normalise here.\n */\nfunction routePath(segments: readonly (string | number)[]): string {\n return `/${segments.join('/')}`.replace(/\\/{2,}/g, '/');\n}\n\n/**\n * Whether `url` is `route` or something below it. A bare `startsWith` matched a\n * SIBLING whose path merely began the same way, so visiting `/table` expanded the\n * group that owns `/tabs`.\n */\nfunction matchesRoute(url: string, route: string): boolean {\n if (!url.startsWith(route)) return false;\n const rest = url.slice(route.length);\n return rest === '' || rest.startsWith('/') || rest.startsWith('?') || rest.startsWith('#');\n}\n\n/**\n * Data-driven sidebar nav. Pass `[entries]` — either flat\n * `WrSidebarItem`s (direct links) or `WrSidebarGroup`s (expand to reveal\n * child items). Active route auto-expands its containing group.\n *\n * @example\n * ```html\n * <wr-sidebar [entries]=\"[\n * { title: 'Dashboard', icon: 'home', url: ['/dashboard'] },\n * {\n * title: 'Settings',\n * icon: 'cog',\n * children: [\n * { title: 'Profile', url: ['/settings', 'profile'] },\n * { title: 'Billing', url: ['/settings', 'billing'] }\n * ]\n * }\n * ]\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/sidebar\n */\n@Component({\n selector: 'wr-sidebar',\n templateUrl: './sidebar.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-sidebar', role: 'navigation', '[attr.aria-label]': 'resolvedAriaLabel()' },\n imports: [RouterLink, RouterLinkActive, WrIcon],\n})\nexport class WrSidebar {\n readonly entries = input<readonly WrSidebarEntry[]>([]);\n\n /**\n * Accessible name for the navigation landmark. Falls back to `sidebar.label`,\n * then `'Sidebar'` — a page with a sidebar AND a table of contents has two\n * navigation landmarks, and an unnamed one is announced as just \"navigation\".\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'sidebar.label', 'Sidebar');\n\n /** Default icon for entries without one. @default 'folder' */\n readonly defaultGroupIcon = input<string>('folder');\n\n /** Default icon for items without one. @default 'caret-forward' */\n readonly defaultItemIcon = input<string>('caret-forward');\n\n /** Auto-expand the group containing the active route. @default true */\n readonly autoExpand = input(true, { transform: coerceBooleanProperty });\n\n protected readonly isGroup = isGroup;\n\n private readonly opened = signal<ReadonlySet<string>>(new Set());\n\n /** Group titles already seeded from `defaultOpen`, so it seeds once and not again. */\n private readonly seeded = new Set<string>();\n\n private readonly uid = ++sidebarUid;\n\n private readonly router = inject(Router);\n private readonly currentUrl = toSignal(\n this.router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n map(e => e.urlAfterRedirects),\n startWith(this.router.url)\n ),\n { initialValue: this.router.url }\n );\n\n /**\n * Last URL we resolved to a group — prevents re-opening one the user collapsed.\n * A URL no entry claims is deliberately NOT recorded: see the effect below.\n */\n private lastAutoUrl: string | null = null;\n\n constructor() {\n // Seed `defaultOpen` groups — once per group, not once per `entries` emission.\n // Re-seeding meant any later change to the array (a badge count, a filtered\n // list) re-opened a group the user had deliberately collapsed.\n effect(() => {\n const fresh: string[] = [];\n for (const entry of this.entries()) {\n if (isGroup(entry) && entry.defaultOpen && !this.seeded.has(entry.title)) {\n this.seeded.add(entry.title);\n fresh.push(entry.title);\n }\n }\n if (fresh.length > 0) {\n this.opened.update(prev => new Set([...prev, ...fresh]));\n }\n });\n\n // Auto-expand the group containing the current URL.\n effect(() => {\n if (!this.autoExpand()) return;\n const url = this.currentUrl();\n if (url === this.lastAutoUrl) return;\n // Latch AFTER the lookup, never before it. `entries` often arrives from an\n // HTTP call, so the first run matches nothing — and latching first told the\n // re-run that landed with the real nav that this URL was already handled.\n // A deep link into a `defaultOpen: false` group then stayed collapsed, with\n // the active link out of the tab order, until the user navigated away and\n // back. Only a run that found a group has actually handled the URL; the\n // user-collapse latch is unaffected, since that run is also the one that\n // records it.\n const match = this.findGroupForUrl(url);\n if (!match) return;\n this.lastAutoUrl = url;\n if (this.opened().has(match)) return;\n this.opened.update(prev => {\n const next = new Set(prev);\n next.add(match);\n return next;\n });\n });\n }\n\n protected isOpen(title: string): boolean {\n return this.opened().has(title);\n }\n\n /**\n * Stable id for the group body, referenced by the toggle's `aria-controls`.\n *\n * Keyed by POSITION, not by the title. Slugging the title kept the id readable\n * but was not injective: it lowercases and collapses every non-`[a-z0-9]` run,\n * so `Data & charts` and `Data / charts` produced the same string, and a title\n * with no ASCII alphanumerics at all — `Компоненты`, `数据` — produced the empty\n * one. A whole Russian or Chinese sidebar therefore emitted N identical ids and\n * every toggle's `aria-controls` resolved to the FIRST group's body. The toggle\n * and its body read `$index` from the same `@for` iteration, so the two always\n * name each other — reordering `entries` renumbers both together.\n */\n protected groupBodyId(index: number): string {\n return `wr-sidebar-${this.uid}-group-${index}`;\n }\n\n protected toggleGroup(title: string): void {\n this.opened.update(prev => {\n const next = new Set(prev);\n if (next.has(title)) next.delete(title);\n else next.add(title);\n return next;\n });\n }\n\n protected asItem(entry: WrSidebarEntry): WrSidebarItem {\n return entry as WrSidebarItem;\n }\n\n protected asGroup(entry: WrSidebarEntry): WrSidebarGroup {\n return entry as WrSidebarGroup;\n }\n\n private findGroupForUrl(url: string): string | null {\n for (const entry of this.entries()) {\n if (!isGroup(entry)) continue;\n const hit = entry.children.some(child => matchesRoute(url, routePath(child.url)));\n if (hit) return entry.title;\n }\n return null;\n }\n}\n","<!-- A div, not a <nav>: the host already IS the navigation landmark, and two\n nested ones announce the same list twice. -->\n<div class=\"wr-sidebar__inner\">\n @for (entry of entries(); track entry.title) {\n @if (!isGroup(entry)) {\n <!--\n A span, not a greyed anchor, exactly as the nested branch below does it.\n `--disabled` only paints: `pointer-events: none` stops a real pointer but\n not the keyboard, so a disabled entry stayed in the tab order and Enter\n navigated — `disabled` on a `WrSidebarItem` is documented as \"no\n navigation\". An empty `url` is the same case: `[routerLink]=\"[]\"` resolves\n to the current route, which is a link that goes nowhere.\n -->\n @if (asItem(entry).disabled || !asItem(entry).url.length) {\n <span class=\"wr-sidebar__entry wr-sidebar__entry--disabled\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__entry\" routerLinkActive=\"wr-sidebar__entry--active\" [routerLink]=\"asItem(entry).url\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </a>\n }\n } @else {\n <section class=\"wr-sidebar__group\" [class.wr-sidebar__group--collapsed]=\"!isOpen(entry.title)\">\n <button\n type=\"button\"\n class=\"wr-sidebar__group-toggle\"\n [attr.aria-expanded]=\"isOpen(entry.title)\"\n [attr.aria-controls]=\"groupBodyId($index)\"\n (click)=\"toggleGroup(entry.title)\"\n >\n @if (asGroup(entry).icon || defaultGroupIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n <!-- Inline chrome chevron — not user-customizable. -->\n <svg\n class=\"wr-icon__svg wr-sidebar__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n <div\n class=\"wr-sidebar__group-wrap\"\n [attr.id]=\"groupBodyId($index)\"\n [attr.inert]=\"!isOpen(entry.title) ? '' : null\"\n >\n <div class=\"wr-sidebar__group-body\">\n <ul class=\"wr-sidebar__list\">\n @for (child of asGroup(entry).children; track child.title) {\n <li>\n @if (child.disabled || !child.url.length) {\n <span class=\"wr-sidebar__item wr-sidebar__item--disabled\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__item\" routerLinkActive=\"wr-sidebar__item--active\" [routerLink]=\"child.url\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </a>\n }\n </li>\n }\n </ul>\n </div>\n </div>\n </section>\n }\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAcH,SAAS,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,EAAA,IAAA,EAC/B,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,EAAA,OAAA,EACpF,CAAC,UAAU,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAA,QAAA,EAAA,ugJAAA,EAAA;;;AEhFjD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-sidebar.mjs","sources":["../../../projects/lib/sidebar/sidebar.ts","../../../projects/lib/sidebar/sidebar.html","../../../projects/lib/sidebar/ngwr-sidebar.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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, effect, inject, input, signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router, RouterLink, RouterLinkActive } from '@angular/router';\n\nimport { filter, map, startWith } from 'rxjs';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrIcon } from 'ngwr/icon';\n\nimport type { WrSidebarEntry, WrSidebarGroup, WrSidebarItem } from './interfaces';\n\nfunction isGroup(entry: WrSidebarEntry): entry is WrSidebarGroup {\n return 'children' in entry;\n}\n\n/**\n * Instance counter for the group-body ids. Deterministic under prerender, unlike\n * `randomId()`, and unique across sidebars — a title-only id collided between two\n * sidebars on one page, and `aria-controls` then pointed at the wrong body.\n */\nlet sidebarUid = 0;\n\n/**\n * A `routerLink` segment array as an absolute path.\n *\n * The documented form carries the leading slash on the FIRST segment\n * (`['/settings', 'profile']`), and prefixing another one produced\n * `//settings/profile` — a path no URL ever equals, which is why auto-expand\n * never fired for anyone following the example. Both forms normalise here.\n */\nfunction routePath(segments: readonly (string | number)[]): string {\n return `/${segments.join('/')}`.replace(/\\/{2,}/g, '/');\n}\n\n/**\n * Whether `url` is `route` or something below it. A bare `startsWith` matched a\n * SIBLING whose path merely began the same way, so visiting `/table` expanded the\n * group that owns `/tabs`.\n */\nfunction matchesRoute(url: string, route: string): boolean {\n if (!url.startsWith(route)) return false;\n const rest = url.slice(route.length);\n return rest === '' || rest.startsWith('/') || rest.startsWith('?') || rest.startsWith('#');\n}\n\n/**\n * Data-driven sidebar nav. Pass `[entries]` — either flat\n * `WrSidebarItem`s (direct links) or `WrSidebarGroup`s (expand to reveal\n * child items). Active route auto-expands its containing group.\n *\n * The host pads its rows by `--wr-sidebar-padding` (`0.5rem`), so a hovered or\n * active row's tint stays off the edge of whatever holds the nav, a bordered\n * card or a `<wr-layout-sider>`, which pads nothing itself. Where the container\n * already supplies the inset, set the hook to `0` on the sidebar, not on the\n * container: the host declares its own default, which shadows an inherited one\n * (`.my-panel .wr-sidebar { --wr-sidebar-padding: 0 }`, or inline).\n *\n * @example\n * ```html\n * <wr-sidebar [entries]=\"[\n * { title: 'Dashboard', icon: 'home', url: ['/dashboard'] },\n * {\n * title: 'Settings',\n * icon: 'cog',\n * children: [\n * { title: 'Profile', url: ['/settings', 'profile'] },\n * { title: 'Billing', url: ['/settings', 'billing'] }\n * ]\n * }\n * ]\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/sidebar\n */\n@Component({\n selector: 'wr-sidebar',\n templateUrl: './sidebar.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-sidebar', role: 'navigation', '[attr.aria-label]': 'resolvedAriaLabel()' },\n imports: [RouterLink, RouterLinkActive, WrIcon],\n})\nexport class WrSidebar {\n readonly entries = input<readonly WrSidebarEntry[]>([]);\n\n /**\n * Accessible name for the navigation landmark. Falls back to `sidebar.label`,\n * then `'Sidebar'` — a page with a sidebar AND a table of contents has two\n * navigation landmarks, and an unnamed one is announced as just \"navigation\".\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'sidebar.label', 'Sidebar');\n\n /** Default icon for entries without one. @default 'folder' */\n readonly defaultGroupIcon = input<string>('folder');\n\n /** Default icon for items without one. @default 'caret-forward' */\n readonly defaultItemIcon = input<string>('caret-forward');\n\n /** Auto-expand the group containing the active route. @default true */\n readonly autoExpand = input(true, { transform: coerceBooleanProperty });\n\n protected readonly isGroup = isGroup;\n\n private readonly opened = signal<ReadonlySet<string>>(new Set());\n\n /** Group titles already seeded from `defaultOpen`, so it seeds once and not again. */\n private readonly seeded = new Set<string>();\n\n private readonly uid = ++sidebarUid;\n\n private readonly router = inject(Router);\n private readonly currentUrl = toSignal(\n this.router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n map(e => e.urlAfterRedirects),\n startWith(this.router.url)\n ),\n { initialValue: this.router.url }\n );\n\n /**\n * Last URL we resolved to a group — prevents re-opening one the user collapsed.\n * A URL no entry claims is deliberately NOT recorded: see the effect below.\n */\n private lastAutoUrl: string | null = null;\n\n constructor() {\n // Seed `defaultOpen` groups — once per group, not once per `entries` emission.\n // Re-seeding meant any later change to the array (a badge count, a filtered\n // list) re-opened a group the user had deliberately collapsed.\n effect(() => {\n const fresh: string[] = [];\n for (const entry of this.entries()) {\n if (isGroup(entry) && entry.defaultOpen && !this.seeded.has(entry.title)) {\n this.seeded.add(entry.title);\n fresh.push(entry.title);\n }\n }\n if (fresh.length > 0) {\n this.opened.update(prev => new Set([...prev, ...fresh]));\n }\n });\n\n // Auto-expand the group containing the current URL.\n effect(() => {\n if (!this.autoExpand()) return;\n const url = this.currentUrl();\n if (url === this.lastAutoUrl) return;\n // Latch AFTER the lookup, never before it. `entries` often arrives from an\n // HTTP call, so the first run matches nothing — and latching first told the\n // re-run that landed with the real nav that this URL was already handled.\n // A deep link into a `defaultOpen: false` group then stayed collapsed, with\n // the active link out of the tab order, until the user navigated away and\n // back. Only a run that found a group has actually handled the URL; the\n // user-collapse latch is unaffected, since that run is also the one that\n // records it.\n const match = this.findGroupForUrl(url);\n if (!match) return;\n this.lastAutoUrl = url;\n if (this.opened().has(match)) return;\n this.opened.update(prev => {\n const next = new Set(prev);\n next.add(match);\n return next;\n });\n });\n }\n\n protected isOpen(title: string): boolean {\n return this.opened().has(title);\n }\n\n /**\n * Stable id for the group body, referenced by the toggle's `aria-controls`.\n *\n * Keyed by POSITION, not by the title. Slugging the title kept the id readable\n * but was not injective: it lowercases and collapses every non-`[a-z0-9]` run,\n * so `Data & charts` and `Data / charts` produced the same string, and a title\n * with no ASCII alphanumerics at all — `Компоненты`, `数据` — produced the empty\n * one. A whole Russian or Chinese sidebar therefore emitted N identical ids and\n * every toggle's `aria-controls` resolved to the FIRST group's body. The toggle\n * and its body read `$index` from the same `@for` iteration, so the two always\n * name each other — reordering `entries` renumbers both together.\n */\n protected groupBodyId(index: number): string {\n return `wr-sidebar-${this.uid}-group-${index}`;\n }\n\n protected toggleGroup(title: string): void {\n this.opened.update(prev => {\n const next = new Set(prev);\n if (next.has(title)) next.delete(title);\n else next.add(title);\n return next;\n });\n }\n\n protected asItem(entry: WrSidebarEntry): WrSidebarItem {\n return entry as WrSidebarItem;\n }\n\n protected asGroup(entry: WrSidebarEntry): WrSidebarGroup {\n return entry as WrSidebarGroup;\n }\n\n private findGroupForUrl(url: string): string | null {\n for (const entry of this.entries()) {\n if (!isGroup(entry)) continue;\n const hit = entry.children.some(child => matchesRoute(url, routePath(child.url)));\n if (hit) return entry.title;\n }\n return null;\n }\n}\n","<!-- A div, not a <nav>: the host already IS the navigation landmark, and two\n nested ones announce the same list twice. -->\n<div class=\"wr-sidebar__inner\">\n @for (entry of entries(); track entry.title) {\n @if (!isGroup(entry)) {\n <!--\n A span, not a greyed anchor, exactly as the nested branch below does it.\n `--disabled` only paints: `pointer-events: none` stops a real pointer but\n not the keyboard, so a disabled entry stayed in the tab order and Enter\n navigated — `disabled` on a `WrSidebarItem` is documented as \"no\n navigation\". An empty `url` is the same case: `[routerLink]=\"[]\"` resolves\n to the current route, which is a link that goes nowhere.\n -->\n @if (asItem(entry).disabled || !asItem(entry).url.length) {\n <span class=\"wr-sidebar__entry wr-sidebar__entry--disabled\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__entry\" routerLinkActive=\"wr-sidebar__entry--active\" [routerLink]=\"asItem(entry).url\">\n @if (asItem(entry).icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n @if (asItem(entry).badge) {\n <small class=\"wr-sidebar__badge\">{{ asItem(entry).badge }}</small>\n }\n </a>\n }\n } @else {\n <section class=\"wr-sidebar__group\" [class.wr-sidebar__group--collapsed]=\"!isOpen(entry.title)\">\n <button\n type=\"button\"\n class=\"wr-sidebar__group-toggle\"\n [attr.aria-expanded]=\"isOpen(entry.title)\"\n [attr.aria-controls]=\"groupBodyId($index)\"\n (click)=\"toggleGroup(entry.title)\"\n >\n @if (asGroup(entry).icon || defaultGroupIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__title\">{{ entry.title }}</span>\n <!-- Inline chrome chevron — not user-customizable. -->\n <svg\n class=\"wr-icon__svg wr-sidebar__chevron\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n <div\n class=\"wr-sidebar__group-wrap\"\n [attr.id]=\"groupBodyId($index)\"\n [attr.inert]=\"!isOpen(entry.title) ? '' : null\"\n >\n <div class=\"wr-sidebar__group-body\">\n <ul class=\"wr-sidebar__list\">\n @for (child of asGroup(entry).children; track child.title) {\n <li>\n @if (child.disabled || !child.url.length) {\n <span class=\"wr-sidebar__item wr-sidebar__item--disabled\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </span>\n } @else {\n <a class=\"wr-sidebar__item\" routerLinkActive=\"wr-sidebar__item--active\" [routerLink]=\"child.url\">\n @if (child.icon || defaultItemIcon(); as name) {\n <wr-icon class=\"wr-sidebar__icon\" [name]=\"name\" />\n }\n <span class=\"wr-sidebar__item-title\">{{ child.title }}</span>\n @if (child.badge) {\n <small class=\"wr-sidebar__badge\">{{ child.badge }}</small>\n }\n </a>\n }\n </li>\n }\n </ul>\n </div>\n </div>\n </section>\n }\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAcH,SAAS,OAAO,CAAC,KAAqB,EAAA;IACpC,OAAO,UAAU,IAAI,KAAK;AAC5B;AAEA;;;;AAIG;AACH,IAAI,UAAU,GAAG,CAAC;AAElB;;;;;;;AAOG;AACH,SAAS,SAAS,CAAC,QAAsC,EAAA;AACvD,IAAA,OAAO,CAAA,CAAA,EAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC;AACzD;AAEA;;;;AAIG;AACH,SAAS,YAAY,CAAC,GAAW,EAAE,KAAa,EAAA;AAC9C,IAAA,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK;IACxC,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;IACpC,OAAO,IAAI,KAAK,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAA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AAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,k5BCzFtB,ugJAqGA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDdY,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,8MAAE,MAAM,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAEnC,SAAS,EAAA,UAAA,EAAA,CAAA;kBAPrB,SAAS;+BACE,YAAY,EAAA,aAAA,EAEP,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,EAAA,OAAA,EACpF,CAAC,UAAU,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAA,QAAA,EAAA,ugJAAA,EAAA;;;AEvFjD;;AAEG;;"}
@@ -49,10 +49,10 @@ class WrSkeleton {
49
49
  return parts.join(' ');
50
50
  }, /* @ts-ignore */
51
51
  ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
52
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrSkeleton, deps: [], target: i0.ɵɵFactoryTarget.Component });
53
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.6", type: WrSkeleton, isStandalone: true, selector: "wr-skeleton", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-busy": "true", "aria-live": "polite" }, properties: { "class": "classes()" } }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
52
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSkeleton, deps: [], target: i0.ɵɵFactoryTarget.Component });
53
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: WrSkeleton, isStandalone: true, selector: "wr-skeleton", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, animated: { classPropertyName: "animated", publicName: "animated", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-busy": "true", "aria-live": "polite" }, properties: { "class": "classes()" } }, ngImport: i0, template: '', isInline: true, encapsulation: i0.ViewEncapsulation.None });
54
54
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrSkeleton, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSkeleton, decorators: [{
56
56
  type: Component,
57
57
  args: [{
58
58
  selector: 'wr-skeleton',
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-skeleton.mjs","sources":["../../../projects/lib/skeleton/skeleton.ts","../../../projects/lib/skeleton/ngwr-skeleton.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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport type { WrColor } from 'ngwr/theme';\n\n/**\n * Placeholder block shown while content is loading.\n *\n * Default sizing fills the parent width and matches the surrounding\n * text height (`1lh`). Override `--wr-skeleton-height` / `width` on the\n * host for custom shapes.\n *\n * @example\n * ```html\n * <wr-skeleton />\n * <wr-skeleton color=\"primary\" [animated]=\"false\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/skeleton\n */\n@Component({\n selector: 'wr-skeleton',\n template: '',\n encapsulation: ViewEncapsulation.None,\n host: {\n 'aria-busy': 'true',\n 'aria-live': 'polite',\n '[class]': 'classes()',\n },\n})\nexport class WrSkeleton {\n /**\n * Color tint for the placeholder.\n *\n * Default is `'light'` because it's theme-stable — the `light` token is\n * slate-300 in light mode (subtle gray on white) and slate-800 in dark\n * mode (subtle lift on near-black). The `'dark'` value flips to a near-\n * white wash in dark mode and breaks the placeholder affordance.\n *\n * @default 'light'\n */\n readonly color = input<WrColor>('light');\n\n /**\n * Whether the shimmer animation runs.\n *\n * @default true\n */\n readonly animated = input(true, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-skeleton', `wr-skeleton--${this.color()}`];\n if (this.animated()) parts.push('wr-skeleton--animated');\n return parts.join(' ');\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAOH;;;;;;;;;;;;;;AAcG;MAWU,UAAU,CAAA;AACrB;;;;;;;;;AASG;IACM,KAAK,GAAG,KAAK,CAAU,OAAO;8EAAC;AAExC;;;;AAIG;IACM,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAElD,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,KAAK,GAAG,CAAC,aAAa,EAAE,CAAA,aAAA,EAAgB,IAAI,CAAC,KAAK,EAAE,CAAA,CAAE,CAAC;QAC7D,IAAI,IAAI,CAAC,QAAQ,EAAE;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC;AACxD,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACxB,CAAC;gFAAC;uGAxBS,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,wbARX,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAQD,UAAU,EAAA,UAAA,EAAA,CAAA;kBAVtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,EAAE;oBACZ,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,WAAW,EAAE,QAAQ;AACrB,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACF,iBAAA;;;ACpCD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-skeleton.mjs","sources":["../../../projects/lib/skeleton/skeleton.ts","../../../projects/lib/skeleton/ngwr-skeleton.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 { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { Component, ViewEncapsulation, computed, input } from '@angular/core';\n\nimport type { WrColor } from 'ngwr/theme';\n\n/**\n * Placeholder block shown while content is loading.\n *\n * Default sizing fills the parent width and matches the surrounding\n * text height (`1lh`). Override `--wr-skeleton-height` / `width` on the\n * host for custom shapes.\n *\n * @example\n * ```html\n * <wr-skeleton />\n * <wr-skeleton color=\"primary\" [animated]=\"false\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/skeleton\n */\n@Component({\n selector: 'wr-skeleton',\n template: '',\n encapsulation: ViewEncapsulation.None,\n host: {\n 'aria-busy': 'true',\n 'aria-live': 'polite',\n '[class]': 'classes()',\n },\n})\nexport class WrSkeleton {\n /**\n * Color tint for the placeholder.\n *\n * Default is `'light'` because it's theme-stable — the `light` token is\n * slate-300 in light mode (subtle gray on white) and slate-800 in dark\n * mode (subtle lift on near-black). The `'dark'` value flips to a near-\n * white wash in dark mode and breaks the placeholder affordance.\n *\n * @default 'light'\n */\n readonly color = input<WrColor>('light');\n\n /**\n * Whether the shimmer animation runs.\n *\n * @default true\n */\n readonly animated = input(true, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-skeleton', `wr-skeleton--${this.color()}`];\n if (this.animated()) parts.push('wr-skeleton--animated');\n return parts.join(' ');\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;;;AAKG;AAOH;;;;;;;;;;;;;;AAcG;MAWU,UAAU,CAAA;AACrB;;;;;;;;;AASG;IACM,KAAK,GAAG,KAAK,CAAU,OAAO;8EAAC;AAExC;;;;AAIG;IACM,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAElD,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,QAAA,MAAM,KAAK,GAAG,CAAC,aAAa,EAAE,CAAA,aAAA,EAAgB,IAAI,CAAC,KAAK,EAAE,CAAA,CAAE,CAAC;QAC7D,IAAI,IAAI,CAAC,QAAQ,EAAE;AAAE,YAAA,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC;AACxD,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACxB,CAAC;gFAAC;uGAxBS,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAV,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAU,wbARX,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAQD,UAAU,EAAA,UAAA,EAAA,CAAA;kBAVtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,EAAE;oBACZ,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE;AACJ,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,WAAW,EAAE,QAAQ;AACrB,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACF,iBAAA;;;ACpCD;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-slider-testing.mjs","sources":["../../../projects/lib/slider/testing/wr-slider-thumb-harness.ts","../../../projects/lib/slider/testing/wr-slider-harness.ts","../../../projects/lib/slider/testing/ngwr-slider-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrSliderThumbHarnessFilters, WrSliderThumbPosition } from './interfaces';\n\n/** How many key presses {@link WrSliderThumbHarness.setValue} spends before it gives up. */\nconst MAX_PRESSES = 1000;\n\n/**\n * Test harness for one thumb of a `<wr-slider>`.\n *\n * A single-thumb slider has exactly one; a `range` one has two, and each thumb\n * is the other's limit — the lower thumb's `aria-valuemax` is wherever the upper\n * thumb is standing, and vice versa. So {@link getMin} / {@link getMax} answer\n * the room THIS thumb has, not the slider's bounds, which is exactly what a\n * screen reader announces and exactly the window {@link setValue} can reach.\n *\n * Every write here is a KEY PRESS, because a drag is not something a unit test\n * can perform — see {@link setValue}.\n *\n * Every press is on the BLOCK axis — `ArrowUp` / `ArrowDown`, `PageUp` /\n * `PageDown`, `Home` / `End` — so the harness means the same thing in both\n * reading directions. That is not a detail: the component's ← / → follow the\n * VISUAL track, so under `dir=\"rtl\"` a right-arrow LOWERS the value, and a\n * harness that pressed it would have `stepUp()` stepping down while every LTR\n * spec stayed green. It cannot detect the direction to compensate either —\n * `Directionality` is injected, not published to the DOM — so it stays on the\n * axis `dir` does not govern.\n *\n * @example\n * ```ts\n * const upper = await slider.getHighThumb();\n *\n * await upper.setValue(90);\n * expect(await upper.getValue()).toBe(90);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrSliderThumbHarness extends ComponentHarness {\n /**\n * The thumb is a real `<button role=\"slider\">`, so it is focusable without a\n * `tabindex` and leaves the tab order by itself when disabled. Anchored on the\n * BEM class rather than on `[role=\"slider\"]`: the class also carries the\n * `--low` / `--high` modifier this harness reads.\n */\n static hostSelector = '.wr-slider__thumb';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrSliderThumbHarnessFilters = {}): HarnessPredicate<WrSliderThumbHarness> {\n return new HarnessPredicate(WrSliderThumbHarness, options)\n .addOption('position', options.position, async (harness, position) => (await harness.getPosition()) === position)\n .addOption('value', options.value, async (harness, value) => (await harness.getValue()) === value)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label));\n }\n\n /** Which end this thumb is. A single-thumb slider's thumb is the `'low'` one. */\n async getPosition(): Promise<WrSliderThumbPosition> {\n return (await (await this.host()).hasClass('wr-slider__thumb--high')) ? 'high' : 'low';\n }\n\n /** Where the thumb is standing, from `aria-valuenow` — the number a screen reader reads out. */\n async getValue(): Promise<number> {\n return this.numeric('aria-valuenow');\n }\n\n /**\n * The lowest value THIS thumb can reach (`aria-valuemin`).\n *\n * On a range slider's upper thumb that is the lower thumb, not the slider's\n * `min` — the two cannot cross, so the neighbour is the real floor.\n */\n async getMin(): Promise<number> {\n return this.numeric('aria-valuemin');\n }\n\n /**\n * The highest value THIS thumb can reach (`aria-valuemax`).\n *\n * On a range slider's lower thumb that is the upper thumb, not the slider's\n * `max`.\n */\n async getMax(): Promise<number> {\n return this.numeric('aria-valuemax');\n }\n\n /** The thumb's accessible name — `'Value'`, or `'Lower value'` / `'Upper value'` in range mode. */\n async getLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** What a screen reader is told this control is. The role is why the arrows mean anything here. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** Whether the thumb refuses the keyboard. Read from the button's native `disabled`. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * One step up (`ArrowUp`). A disabled thumb does not move.\n *\n * `ArrowRight` is the same key press in an LTR slider and the OPPOSITE one in\n * an RTL slider, so the vertical arrow is the one that means \"up\" everywhere.\n */\n async stepUp(): Promise<void> {\n return this.press(TestKey.UP_ARROW);\n }\n\n /** One step down (`ArrowDown`; `ArrowLeft` only agrees in LTR — see {@link stepUp}). */\n async stepDown(): Promise<void> {\n return this.press(TestKey.DOWN_ARROW);\n }\n\n /** Ten steps up (`PageUp`; `Shift`+arrow is the same stride). */\n async largeStepUp(): Promise<void> {\n return this.press(TestKey.PAGE_UP);\n }\n\n /** Ten steps down (`PageDown`; `Shift`+arrow is the same stride). */\n async largeStepDown(): Promise<void> {\n return this.press(TestKey.PAGE_DOWN);\n }\n\n /**\n * `Home` — jump to the lowest value this thumb can reach.\n *\n * On a range slider's UPPER thumb that lands on the lower thumb, not on the\n * slider's `min`: the component asks for `min` and then refuses to let the\n * ends cross, so the range collapses instead of inverting.\n */\n async toMin(): Promise<void> {\n return this.press(TestKey.HOME);\n }\n\n /**\n * `End` — jump to the highest value this thumb can reach.\n *\n * On a range slider's LOWER thumb that lands on the upper thumb, not on the\n * slider's `max`, for the same reason as {@link toMin}.\n */\n async toMax(): Promise<void> {\n return this.press(TestKey.END);\n }\n\n /**\n * Walk the thumb to `value` FROM THE KEYBOARD — `PageUp` / `PageDown` for the\n * distance, arrows for the last stretch, `Home` / `End` for the bounds. That\n * is the accessible path, and the only one a unit test can trust.\n *\n * There is deliberately no drag. jsdom has no layout: the track measures 0×0\n * and `getBoundingClientRect()` answers all zeros, while the component turns a\n * pointer into a value by dividing the offset by the track width. Every\n * positive offset therefore divides by zero, clamps to a ratio of 1 and writes\n * the slider's MAX — quietly, with no error to notice. A coordinate cannot\n * mean anything here.\n *\n * It costs one press per stride, so the walk is not free: crossing most of a\n * 0–100 range costs ~19 presses at `step=\"1\"` and ~109 at `step=\"0.1\"`.\n * Landing exactly on a bound is one press, whatever the step. The walk gives\n * up after 1000 presses — a 0–100 range reaches that at `step=\"0.01\"` or finer\n * — and throws rather than spin.\n *\n * A bound the step grid misses is announced but not reachable: `aria-valuemax`\n * is the `max` input, while the component snaps every key press onto whole\n * steps from `min`, so `max=\"100\" step=\"3\"` stops at 99. That is the off-grid\n * throw, arriving for `setValue(100)`.\n *\n * Either the thumb ends up exactly on `value` or this throws: when `value` is\n * outside the thumb's window (the other thumb is one end of it in range mode),\n * when the thumb is disabled, and when `value` is not on the step grid — on\n * the last one the thumb is left at the nearest value it could reach.\n */\n async setValue(value: number): Promise<void> {\n if (await this.isDisabled()) {\n throw new Error('WrSliderThumbHarness.setValue(): the slider is disabled, so the keyboard cannot move it.');\n }\n\n const [min, max] = [await this.getMin(), await this.getMax()];\n if (value < min || value > max) {\n throw new Error(\n `WrSliderThumbHarness.setValue(): ${value} is outside the [${min}, ${max}] window this thumb can ` +\n 'reach. On a range slider the other thumb is one end of that window — move it first.'\n );\n }\n\n let current = await this.getValue();\n if (current === value) return;\n // The bounds are one key press, and on a range thumb `Home` / `End` stop at\n // the neighbour — which is precisely this window's end. The landing is still\n // checked: a `max` that is not a whole number of steps from `min` is\n // announced by `aria-valuemax` and refused by the component's snapping.\n if (value === min || value === max) {\n await (value === min ? this.toMin() : this.toMax());\n return this.assertSettled(await this.getValue(), value, min);\n }\n\n let presses = 0;\n // Start on the ten-step stride: neither stride is published to the DOM, so\n // the only way to learn one is to take it and look. One overshoot is pressed\n // back off and the rest of the walk goes a single step at a time.\n let striding = true;\n\n while (current !== value) {\n if (presses >= MAX_PRESSES) {\n throw new Error(\n `WrSliderThumbHarness.setValue(): gave up walking to ${value} after ${MAX_PRESSES} key presses ` +\n `(reached ${current}). A step this fine is not something a keyboard reaches — write the ` +\n 'slider through its `[(value)]` model instead.'\n );\n }\n\n // Re-derived every pass so the walk follows wherever the thumb actually\n // landed rather than where a stride aimed. It never has to reverse: the\n // window check above keeps the target inside [min, max], so pressing back\n // off an overshoot lands at or short of where the stride began — on the\n // same side of the target it started on.\n const direction: 1 | -1 = value > current ? 1 : -1;\n await this.press(this.strideKey(direction, striding));\n presses++;\n\n const next = await this.getValue();\n // Nothing moved: the thumb is pinned against a bound or its neighbour, and\n // pressing again would only spin. The final check below reports where.\n if (next === current) break;\n\n const overshot = direction === 1 ? next > value : next < value;\n current = next;\n if (!overshot) continue;\n\n await this.press(this.strideKey(direction === 1 ? -1 : 1, striding));\n presses++;\n current = await this.getValue();\n\n // Single steps straddling the target means it is not on the step grid.\n if (!striding) break;\n striding = false;\n }\n\n this.assertSettled(current, value, min);\n }\n\n /**\n * The landing check every path through {@link setValue} ends on: exactly the\n * value asked for, or an error naming where the thumb stopped instead.\n */\n private assertSettled(current: number, value: number, min: number): void {\n if (current === value) return;\n throw new Error(\n `WrSliderThumbHarness.setValue(): the keyboard settled on ${current} instead of ${value}. The thumb ` +\n `moves in whole steps from ${min}, so only values on that grid are reachable.`\n );\n }\n\n /** The key that moves the thumb one stride in `direction`. */\n private strideKey(direction: 1 | -1, striding: boolean): TestKey {\n if (striding) return direction === 1 ? TestKey.PAGE_UP : TestKey.PAGE_DOWN;\n // The vertical arrows, for the reason {@link stepUp} gives: the horizontal\n // pair swaps meaning under `dir=\"rtl\"`, which would send the fine stretch of\n // the walk away from its target.\n return direction === 1 ? TestKey.UP_ARROW : TestKey.DOWN_ARROW;\n }\n\n /**\n * Press a key on the thumb.\n *\n * `sendKeys` focuses the element first, so this is the whole gesture a user\n * makes — the component listens for `keydown` on the thumb itself.\n */\n private async press(key: TestKey): Promise<void> {\n return (await this.host()).sendKeys(key);\n }\n\n /**\n * One of the ARIA range attributes as a number.\n *\n * Throws instead of handing back `NaN`: a slider whose `aria-valuenow` is not\n * a number is broken in a way every later assertion would describe badly.\n */\n private async numeric(attribute: string): Promise<number> {\n const raw = await (await this.host()).getAttribute(attribute);\n const value = raw === null ? Number.NaN : Number.parseFloat(raw);\n\n if (Number.isNaN(value)) {\n throw new Error(`WrSliderThumbHarness: the thumb's ${attribute} is ${JSON.stringify(raw)}, not a number.`);\n }\n return value;\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 { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrSliderValue } from 'ngwr/slider';\n\nimport type { WrSliderHarnessFilters, WrSliderThumbHarnessFilters } from './interfaces';\nimport { WrSliderThumbHarness } from './wr-slider-thumb-harness';\n\n/** Element-wise comparison for the `value` filter — a tuple never matches a plain number. */\nfunction sameValue(actual: WrSliderValue, expected: WrSliderValue): boolean {\n if (typeof actual === 'number') return actual === expected;\n if (typeof expected === 'number') return false;\n return actual[0] === expected[0] && actual[1] === expected[1];\n}\n\n/**\n * Test harness for `<wr-slider>` — single-thumb and `range`.\n *\n * Every NUMBER it reads comes off the thumbs' ARIA range trio (`aria-valuenow`,\n * `aria-valuemin`, `aria-valuemax`), which is what a screen reader is told and\n * the only place the slider publishes its value. The mode comes off the host's\n * `wr-slider--range` class and {@link getLabelText} off the rendered text.\n *\n * Everything it WRITES is a key press. A slider is a pointer control, but a\n * pointer control cannot be driven by coordinates in jsdom — there is no layout,\n * so the track measures 0×0 and the component divides every offset by that\n * width: a positive one writes the slider's MAX and `clientX: 0` writes `NaN`,\n * neither of them the value asked for. The keyboard is both the accessible path\n * and the only honest one here; {@link WrSliderThumbHarness.setValue} spells out\n * what the walk costs, and {@link WrSliderThumbHarness} why every one of those\n * presses is on the block axis, which `dir` does not turn around.\n *\n * The `step` is deliberately not readable: the component publishes it nowhere in\n * the DOM (ARIA has no attribute for it), so a spec that needs the number should\n * measure it — `stepUp()` moves by exactly one step.\n *\n * @example\n * ```ts\n * const volume = await loader.getHarness(WrSliderHarness);\n *\n * await volume.setValue(70);\n * expect(await volume.getValue()).toBe(70);\n *\n * const span = await loader.getHarness(WrSliderHarness.with({ range: true }));\n * await span.setRange(30, 60);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrSliderHarness extends ComponentHarness {\n static hostSelector = 'wr-slider';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrSliderHarnessFilters = {}): HarnessPredicate<WrSliderHarness> {\n return new HarnessPredicate(WrSliderHarness, options)\n .addOption('value', options.value, async (harness, value) => sameValue(await harness.getValue(), value))\n .addOption('range', options.range, async (harness, range) => (await harness.isRange()) === range)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption('labelText', options.labelText, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getLabelText(), text)\n );\n }\n\n /** Whether the slider has two thumbs and answers with a `[low, high]` tuple. */\n async isRange(): Promise<boolean> {\n return (await this.host()).hasClass('wr-slider--range');\n }\n\n /**\n * Whether the slider refuses interaction.\n *\n * Read from the thumb's native `disabled` rather than from the\n * `wr-slider--disabled` class: the class is paint, while `disabled` on the\n * button is what takes the thumb out of the tab order and what assistive tech\n * reports.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.getLowThumb()).isDisabled();\n }\n\n /**\n * The current value, in the shape the model uses: a plain number for one\n * thumb, `[low, high]` for two.\n */\n async getValue(): Promise<WrSliderValue> {\n const values = await Promise.all((await this.getThumbs()).map(thumb => thumb.getValue()));\n return values.length > 1 ? ([values[0], values[1]] as const) : values[0];\n }\n\n /** The slider's lower bound. */\n async getMin(): Promise<number> {\n return (await this.getThumbs())[0].getMin();\n }\n\n /**\n * The slider's upper bound.\n *\n * Taken from the LAST thumb, because in range mode the thumbs bound each\n * other: the lower one's `aria-valuemax` is wherever the upper one is\n * standing, so only the upper thumb knows the real ceiling.\n */\n async getMax(): Promise<number> {\n const thumbs = await this.getThumbs();\n return thumbs[thumbs.length - 1].getMax();\n }\n\n /**\n * The text the slider prints under the track, or `null` when `showLabel` is\n * off.\n *\n * A range slider joins its ends with an EN DASH — `'20 – 80'`, U+2013 — so an\n * assertion typed with a hyphen will not match.\n */\n async getLabelText(): Promise<string | null> {\n const label = await this.locatorForOptional('.wr-slider__label')();\n return label ? label.text() : null;\n }\n\n /** The slider's thumbs in DOM order: the lower one first. */\n async getThumbs(filters: WrSliderThumbHarnessFilters = {}): Promise<WrSliderThumbHarness[]> {\n return this.locatorForAll(WrSliderThumbHarness.with(filters))();\n }\n\n /** The only thumb of a single-thumb slider, or the lower one of a range slider. */\n async getLowThumb(): Promise<WrSliderThumbHarness> {\n return this.locatorFor(WrSliderThumbHarness.with({ position: 'low' }))();\n }\n\n /** The upper thumb. Throws on a single-thumb slider, which has no such part. */\n async getHighThumb(): Promise<WrSliderThumbHarness> {\n const thumb = await this.locatorForOptional(WrSliderThumbHarness.with({ position: 'high' }))();\n if (!thumb) {\n throw new Error('WrSliderHarness.getHighThumb(): this slider has one thumb — only a `range` slider has two.');\n }\n return thumb;\n }\n\n /**\n * Walk the slider to `value` from the keyboard.\n *\n * Single-thumb only — {@link setRange} moves both ends. See\n * {@link WrSliderThumbHarness.setValue} for what the walk costs and when it\n * throws.\n */\n async setValue(value: number): Promise<void> {\n return (await this.single('setValue')).setValue(value);\n }\n\n /**\n * Walk both ends of a range slider to `[low, high]`.\n *\n * The far end moves FIRST. The thumbs bound each other, so writing `[90, 95]`\n * over `[20, 80]` lower-end-first would be refused outright — 90 is outside\n * the `[0, 80]` window the upper thumb leaves the lower one.\n */\n async setRange(low: number, high: number): Promise<void> {\n if (!(await this.isRange())) {\n throw new Error('WrSliderHarness.setRange(): this slider has one thumb — add `range` to it, or call setValue().');\n }\n if (low > high) {\n throw new Error(`WrSliderHarness.setRange(): ${low} is above ${high}, and the thumbs cannot cross.`);\n }\n\n const lowThumb = await this.getLowThumb();\n const highThumb = await this.getHighThumb();\n\n if (high >= (await highThumb.getValue())) {\n await highThumb.setValue(high);\n await lowThumb.setValue(low);\n return;\n }\n\n await lowThumb.setValue(low);\n await highThumb.setValue(high);\n }\n\n /** One step up (`ArrowUp`). Single-thumb only. A disabled slider does not move. */\n async stepUp(): Promise<void> {\n return (await this.single('stepUp')).stepUp();\n }\n\n /** One step down (`ArrowDown`). Single-thumb only. A disabled slider does not move. */\n async stepDown(): Promise<void> {\n return (await this.single('stepDown')).stepDown();\n }\n\n /** `Home` — jump to the slider's `min`. Single-thumb only. */\n async toMin(): Promise<void> {\n return (await this.single('toMin')).toMin();\n }\n\n /** `End` — jump to the slider's `max`. Single-thumb only. */\n async toMax(): Promise<void> {\n return (await this.single('toMax')).toMax();\n }\n\n /**\n * Move keyboard focus to the slider's first thumb. A range slider's thumbs are\n * two separate tab stops (both are plain buttons — there is no roving\n * `tabindex`), so reach the other one through {@link getHighThumb}.\n */\n async focus(): Promise<void> {\n return (await this.getLowThumb()).focus();\n }\n\n /** Whether any of the slider's thumbs holds focus. */\n async isFocused(): Promise<boolean> {\n const focused = await Promise.all((await this.getThumbs()).map(thumb => thumb.isFocused()));\n return focused.includes(true);\n }\n\n /**\n * The one thumb a single-thumb convenience call means.\n *\n * Range mode gets an error rather than a guess: \"step this slider up\" has two\n * possible answers there, and picking one silently is how a spec ends up\n * asserting against the end it did not move.\n */\n private async single(caller: string): Promise<WrSliderThumbHarness> {\n if (await this.isRange()) {\n throw new Error(\n `WrSliderHarness.${caller}(): this slider has two thumbs — use setRange(), or reach for one end ` +\n 'with getLowThumb() / getHighThumb().'\n );\n }\n return this.getLowThumb();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;AACA,MAAM,WAAW,GAAG,IAAI;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACG,MAAO,oBAAqB,SAAQ,gBAAgB,CAAA;AACxD;;;;;AAKG;AACH,IAAA,OAAO,YAAY,GAAG,mBAAmB;;AAGzC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAuC,EAAE,EAAA;AACnD,QAAA,OAAO,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,OAAO;aACtD,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,OAAO,EAAE,QAAQ,KAAK,CAAC,MAAM,OAAO,CAAC,WAAW,EAAE,MAAM,QAAQ;aAC/G,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,MAAM,KAAK;aAChG,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,KAAK,gBAAgB,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,CAAC;IACrH;;AAGA,IAAA,MAAM,WAAW,GAAA;QACf,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,wBAAwB,CAAC,IAAI,MAAM,GAAG,KAAK;IACxF;;AAGA,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC;IACtC;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AA;AACZ,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE;IACnD;;AAGA,IAAA,MAAM,KAAK,GAAA;AACT,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE;IAC7C;;AAGA,IAAA,MAAM,KAAK,GAAA;AACT,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE;IAC7C;AAEA;;;;AAIG;AACH,IAAA,MAAM,KAAK,GAAA;QACT,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE;IAC3C;;AAGA,IAAA,MAAM,SAAS,GAAA;QACb,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,SAAS,EAAE,EAAE,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;AAC3F,QAAA,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC/B;AAEA;;;;;;AAMG;IACK,MAAM,MAAM,CAAC,MAAc,EAAA;AACjC,QAAA,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE,EAAE;AACxB,YAAA,MAAM,IAAI,KAAK,CACb,CAAA,gBAAA,EAAmB,MAAM,CAAA,sEAAA,CAAwE;AAC/F,gBAAA,sCAAsC,CACzC;QACH;AACA,QAAA,OAAO,IAAI,CAAC,WAAW,EAAE;IAC3B;;;ACxOF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-slider-testing.mjs","sources":["../../../projects/lib/slider/testing/wr-slider-thumb-harness.ts","../../../projects/lib/slider/testing/wr-slider-harness.ts","../../../projects/lib/slider/testing/ngwr-slider-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrSliderThumbHarnessFilters, WrSliderThumbPosition } from './interfaces';\n\n/** How many key presses {@link WrSliderThumbHarness.setValue} spends before it gives up. */\nconst MAX_PRESSES = 1000;\n\n/**\n * Test harness for one thumb of a `<wr-slider>`.\n *\n * A single-thumb slider has exactly one; a `range` one has two, and each thumb\n * is the other's limit — the lower thumb's `aria-valuemax` is wherever the upper\n * thumb is standing, and vice versa. So {@link getMin} / {@link getMax} answer\n * the room THIS thumb has, not the slider's bounds, which is exactly what a\n * screen reader announces and exactly the window {@link setValue} can reach.\n *\n * Every write here is a KEY PRESS, because a drag is not something a unit test\n * can perform — see {@link setValue}.\n *\n * Every press is on the BLOCK axis — `ArrowUp` / `ArrowDown`, `PageUp` /\n * `PageDown`, `Home` / `End` — so the harness means the same thing in both\n * reading directions. That is not a detail: the component's ← / → follow the\n * VISUAL track, so under `dir=\"rtl\"` a right-arrow LOWERS the value, and a\n * harness that pressed it would have `stepUp()` stepping down while every LTR\n * spec stayed green. It cannot detect the direction to compensate either —\n * `Directionality` is injected, not published to the DOM — so it stays on the\n * axis `dir` does not govern.\n *\n * @example\n * ```ts\n * const upper = await slider.getHighThumb();\n *\n * await upper.setValue(90);\n * expect(await upper.getValue()).toBe(90);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrSliderThumbHarness extends ComponentHarness {\n /**\n * The thumb is a real `<button role=\"slider\">`, so it is focusable without a\n * `tabindex` and leaves the tab order by itself when disabled. Anchored on the\n * BEM class rather than on `[role=\"slider\"]`: the class also carries the\n * `--low` / `--high` modifier this harness reads.\n */\n static hostSelector = '.wr-slider__thumb';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrSliderThumbHarnessFilters = {}): HarnessPredicate<WrSliderThumbHarness> {\n return new HarnessPredicate(WrSliderThumbHarness, options)\n .addOption('position', options.position, async (harness, position) => (await harness.getPosition()) === position)\n .addOption('value', options.value, async (harness, value) => (await harness.getValue()) === value)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label));\n }\n\n /** Which end this thumb is. A single-thumb slider's thumb is the `'low'` one. */\n async getPosition(): Promise<WrSliderThumbPosition> {\n return (await (await this.host()).hasClass('wr-slider__thumb--high')) ? 'high' : 'low';\n }\n\n /** Where the thumb is standing, from `aria-valuenow` — the number a screen reader reads out. */\n async getValue(): Promise<number> {\n return this.numeric('aria-valuenow');\n }\n\n /**\n * The lowest value THIS thumb can reach (`aria-valuemin`).\n *\n * On a range slider's upper thumb that is the lower thumb, not the slider's\n * `min` — the two cannot cross, so the neighbour is the real floor.\n */\n async getMin(): Promise<number> {\n return this.numeric('aria-valuemin');\n }\n\n /**\n * The highest value THIS thumb can reach (`aria-valuemax`).\n *\n * On a range slider's lower thumb that is the upper thumb, not the slider's\n * `max`.\n */\n async getMax(): Promise<number> {\n return this.numeric('aria-valuemax');\n }\n\n /** The thumb's accessible name — `'Value'`, or `'Lower value'` / `'Upper value'` in range mode. */\n async getLabel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-label');\n }\n\n /** What a screen reader is told this control is. The role is why the arrows mean anything here. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** Whether the thumb refuses the keyboard. Read from the button's native `disabled`. */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).getProperty<boolean>('disabled');\n }\n\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * One step up (`ArrowUp`). A disabled thumb does not move.\n *\n * `ArrowRight` is the same key press in an LTR slider and the OPPOSITE one in\n * an RTL slider, so the vertical arrow is the one that means \"up\" everywhere.\n */\n async stepUp(): Promise<void> {\n return this.press(TestKey.UP_ARROW);\n }\n\n /** One step down (`ArrowDown`; `ArrowLeft` only agrees in LTR — see {@link stepUp}). */\n async stepDown(): Promise<void> {\n return this.press(TestKey.DOWN_ARROW);\n }\n\n /** Ten steps up (`PageUp`; `Shift`+arrow is the same stride). */\n async largeStepUp(): Promise<void> {\n return this.press(TestKey.PAGE_UP);\n }\n\n /** Ten steps down (`PageDown`; `Shift`+arrow is the same stride). */\n async largeStepDown(): Promise<void> {\n return this.press(TestKey.PAGE_DOWN);\n }\n\n /**\n * `Home` — jump to the lowest value this thumb can reach.\n *\n * On a range slider's UPPER thumb that lands on the lower thumb, not on the\n * slider's `min`: the component asks for `min` and then refuses to let the\n * ends cross, so the range collapses instead of inverting.\n */\n async toMin(): Promise<void> {\n return this.press(TestKey.HOME);\n }\n\n /**\n * `End` — jump to the highest value this thumb can reach.\n *\n * On a range slider's LOWER thumb that lands on the upper thumb, not on the\n * slider's `max`, for the same reason as {@link toMin}.\n */\n async toMax(): Promise<void> {\n return this.press(TestKey.END);\n }\n\n /**\n * Walk the thumb to `value` FROM THE KEYBOARD — `PageUp` / `PageDown` for the\n * distance, arrows for the last stretch, `Home` / `End` for the bounds. That\n * is the accessible path, and the only one a unit test can trust.\n *\n * There is deliberately no drag. jsdom has no layout: the track measures 0×0\n * and `getBoundingClientRect()` answers all zeros, while the component turns a\n * pointer into a value by dividing the offset by the track width. Every\n * positive offset therefore divides by zero, clamps to a ratio of 1 and writes\n * the slider's MAX — quietly, with no error to notice. A coordinate cannot\n * mean anything here.\n *\n * It costs one press per stride, so the walk is not free: crossing most of a\n * 0–100 range costs ~19 presses at `step=\"1\"` and ~109 at `step=\"0.1\"`.\n * Landing exactly on a bound is one press, whatever the step. The walk gives\n * up after 1000 presses — a 0–100 range reaches that at `step=\"0.01\"` or finer\n * — and throws rather than spin.\n *\n * A bound the step grid misses is announced but not reachable: `aria-valuemax`\n * is the `max` input, while the component snaps every key press onto whole\n * steps from `min`, so `max=\"100\" step=\"3\"` stops at 99. That is the off-grid\n * throw, arriving for `setValue(100)`.\n *\n * Either the thumb ends up exactly on `value` or this throws: when `value` is\n * outside the thumb's window (the other thumb is one end of it in range mode),\n * when the thumb is disabled, and when `value` is not on the step grid — on\n * the last one the thumb is left at the nearest value it could reach.\n */\n async setValue(value: number): Promise<void> {\n if (await this.isDisabled()) {\n throw new Error('WrSliderThumbHarness.setValue(): the slider is disabled, so the keyboard cannot move it.');\n }\n\n const [min, max] = [await this.getMin(), await this.getMax()];\n if (value < min || value > max) {\n throw new Error(\n `WrSliderThumbHarness.setValue(): ${value} is outside the [${min}, ${max}] window this thumb can ` +\n 'reach. On a range slider the other thumb is one end of that window — move it first.'\n );\n }\n\n let current = await this.getValue();\n if (current === value) return;\n // The bounds are one key press, and on a range thumb `Home` / `End` stop at\n // the neighbour — which is precisely this window's end. The landing is still\n // checked: a `max` that is not a whole number of steps from `min` is\n // announced by `aria-valuemax` and refused by the component's snapping.\n if (value === min || value === max) {\n await (value === min ? this.toMin() : this.toMax());\n return this.assertSettled(await this.getValue(), value, min);\n }\n\n let presses = 0;\n // Start on the ten-step stride: neither stride is published to the DOM, so\n // the only way to learn one is to take it and look. One overshoot is pressed\n // back off and the rest of the walk goes a single step at a time.\n let striding = true;\n\n while (current !== value) {\n if (presses >= MAX_PRESSES) {\n throw new Error(\n `WrSliderThumbHarness.setValue(): gave up walking to ${value} after ${MAX_PRESSES} key presses ` +\n `(reached ${current}). A step this fine is not something a keyboard reaches — write the ` +\n 'slider through its `[(value)]` model instead.'\n );\n }\n\n // Re-derived every pass so the walk follows wherever the thumb actually\n // landed rather than where a stride aimed. It never has to reverse: the\n // window check above keeps the target inside [min, max], so pressing back\n // off an overshoot lands at or short of where the stride began — on the\n // same side of the target it started on.\n const direction: 1 | -1 = value > current ? 1 : -1;\n await this.press(this.strideKey(direction, striding));\n presses++;\n\n const next = await this.getValue();\n // Nothing moved: the thumb is pinned against a bound or its neighbour, and\n // pressing again would only spin. The final check below reports where.\n if (next === current) break;\n\n const overshot = direction === 1 ? next > value : next < value;\n current = next;\n if (!overshot) continue;\n\n await this.press(this.strideKey(direction === 1 ? -1 : 1, striding));\n presses++;\n current = await this.getValue();\n\n // Single steps straddling the target means it is not on the step grid.\n if (!striding) break;\n striding = false;\n }\n\n this.assertSettled(current, value, min);\n }\n\n /**\n * The landing check every path through {@link setValue} ends on: exactly the\n * value asked for, or an error naming where the thumb stopped instead.\n */\n private assertSettled(current: number, value: number, min: number): void {\n if (current === value) return;\n throw new Error(\n `WrSliderThumbHarness.setValue(): the keyboard settled on ${current} instead of ${value}. The thumb ` +\n `moves in whole steps from ${min}, so only values on that grid are reachable.`\n );\n }\n\n /** The key that moves the thumb one stride in `direction`. */\n private strideKey(direction: 1 | -1, striding: boolean): TestKey {\n if (striding) return direction === 1 ? TestKey.PAGE_UP : TestKey.PAGE_DOWN;\n // The vertical arrows, for the reason {@link stepUp} gives: the horizontal\n // pair swaps meaning under `dir=\"rtl\"`, which would send the fine stretch of\n // the walk away from its target.\n return direction === 1 ? TestKey.UP_ARROW : TestKey.DOWN_ARROW;\n }\n\n /**\n * Press a key on the thumb.\n *\n * `sendKeys` focuses the element first, so this is the whole gesture a user\n * makes — the component listens for `keydown` on the thumb itself.\n */\n private async press(key: TestKey): Promise<void> {\n return (await this.host()).sendKeys(key);\n }\n\n /**\n * One of the ARIA range attributes as a number.\n *\n * Throws instead of handing back `NaN`: a slider whose `aria-valuenow` is not\n * a number is broken in a way every later assertion would describe badly.\n */\n private async numeric(attribute: string): Promise<number> {\n const raw = await (await this.host()).getAttribute(attribute);\n const value = raw === null ? Number.NaN : Number.parseFloat(raw);\n\n if (Number.isNaN(value)) {\n throw new Error(`WrSliderThumbHarness: the thumb's ${attribute} is ${JSON.stringify(raw)}, not a number.`);\n }\n return value;\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 { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrSliderValue } from 'ngwr/slider';\n\nimport type { WrSliderHarnessFilters, WrSliderThumbHarnessFilters } from './interfaces';\nimport { WrSliderThumbHarness } from './wr-slider-thumb-harness';\n\n/** Element-wise comparison for the `value` filter — a tuple never matches a plain number. */\nfunction sameValue(actual: WrSliderValue, expected: WrSliderValue): boolean {\n if (typeof actual === 'number') return actual === expected;\n if (typeof expected === 'number') return false;\n return actual[0] === expected[0] && actual[1] === expected[1];\n}\n\n/**\n * Test harness for `<wr-slider>` — single-thumb and `range`.\n *\n * Every NUMBER it reads comes off the thumbs' ARIA range trio (`aria-valuenow`,\n * `aria-valuemin`, `aria-valuemax`), which is what a screen reader is told and\n * the only place the slider publishes its value. The mode comes off the host's\n * `wr-slider--range` class and {@link getLabelText} off the rendered text.\n *\n * Everything it WRITES is a key press. A slider is a pointer control, but a\n * pointer control cannot be driven by coordinates in jsdom — there is no layout,\n * so the track measures 0×0 and the component divides every offset by that\n * width: a positive one writes the slider's MAX and `clientX: 0` writes `NaN`,\n * neither of them the value asked for. The keyboard is both the accessible path\n * and the only honest one here; {@link WrSliderThumbHarness.setValue} spells out\n * what the walk costs, and {@link WrSliderThumbHarness} why every one of those\n * presses is on the block axis, which `dir` does not turn around.\n *\n * The `step` is deliberately not readable: the component publishes it nowhere in\n * the DOM (ARIA has no attribute for it), so a spec that needs the number should\n * measure it — `stepUp()` moves by exactly one step.\n *\n * @example\n * ```ts\n * const volume = await loader.getHarness(WrSliderHarness);\n *\n * await volume.setValue(70);\n * expect(await volume.getValue()).toBe(70);\n *\n * const span = await loader.getHarness(WrSliderHarness.with({ range: true }));\n * await span.setRange(30, 60);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrSliderHarness extends ComponentHarness {\n static hostSelector = 'wr-slider';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrSliderHarnessFilters = {}): HarnessPredicate<WrSliderHarness> {\n return new HarnessPredicate(WrSliderHarness, options)\n .addOption('value', options.value, async (harness, value) => sameValue(await harness.getValue(), value))\n .addOption('range', options.range, async (harness, range) => (await harness.isRange()) === range)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption('labelText', options.labelText, (harness, text) =>\n HarnessPredicate.stringMatches(harness.getLabelText(), text)\n );\n }\n\n /** Whether the slider has two thumbs and answers with a `[low, high]` tuple. */\n async isRange(): Promise<boolean> {\n return (await this.host()).hasClass('wr-slider--range');\n }\n\n /**\n * Whether the slider refuses interaction.\n *\n * Read from the thumb's native `disabled` rather than from the\n * `wr-slider--disabled` class: the class is paint, while `disabled` on the\n * button is what takes the thumb out of the tab order and what assistive tech\n * reports.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.getLowThumb()).isDisabled();\n }\n\n /**\n * The current value, in the shape the model uses: a plain number for one\n * thumb, `[low, high]` for two.\n */\n async getValue(): Promise<WrSliderValue> {\n const values = await Promise.all((await this.getThumbs()).map(thumb => thumb.getValue()));\n return values.length > 1 ? ([values[0], values[1]] as const) : values[0];\n }\n\n /** The slider's lower bound. */\n async getMin(): Promise<number> {\n return (await this.getThumbs())[0].getMin();\n }\n\n /**\n * The slider's upper bound.\n *\n * Taken from the LAST thumb, because in range mode the thumbs bound each\n * other: the lower one's `aria-valuemax` is wherever the upper one is\n * standing, so only the upper thumb knows the real ceiling.\n */\n async getMax(): Promise<number> {\n const thumbs = await this.getThumbs();\n return thumbs[thumbs.length - 1].getMax();\n }\n\n /**\n * The text the slider prints under the track, or `null` when `showLabel` is\n * off.\n *\n * A range slider joins its ends with an EN DASH — `'20 – 80'`, U+2013 — so an\n * assertion typed with a hyphen will not match.\n */\n async getLabelText(): Promise<string | null> {\n const label = await this.locatorForOptional('.wr-slider__label')();\n return label ? label.text() : null;\n }\n\n /** The slider's thumbs in DOM order: the lower one first. */\n async getThumbs(filters: WrSliderThumbHarnessFilters = {}): Promise<WrSliderThumbHarness[]> {\n return this.locatorForAll(WrSliderThumbHarness.with(filters))();\n }\n\n /** The only thumb of a single-thumb slider, or the lower one of a range slider. */\n async getLowThumb(): Promise<WrSliderThumbHarness> {\n return this.locatorFor(WrSliderThumbHarness.with({ position: 'low' }))();\n }\n\n /** The upper thumb. Throws on a single-thumb slider, which has no such part. */\n async getHighThumb(): Promise<WrSliderThumbHarness> {\n const thumb = await this.locatorForOptional(WrSliderThumbHarness.with({ position: 'high' }))();\n if (!thumb) {\n throw new Error('WrSliderHarness.getHighThumb(): this slider has one thumb — only a `range` slider has two.');\n }\n return thumb;\n }\n\n /**\n * Walk the slider to `value` from the keyboard.\n *\n * Single-thumb only — {@link setRange} moves both ends. See\n * {@link WrSliderThumbHarness.setValue} for what the walk costs and when it\n * throws.\n */\n async setValue(value: number): Promise<void> {\n return (await this.single('setValue')).setValue(value);\n }\n\n /**\n * Walk both ends of a range slider to `[low, high]`.\n *\n * The far end moves FIRST. The thumbs bound each other, so writing `[90, 95]`\n * over `[20, 80]` lower-end-first would be refused outright — 90 is outside\n * the `[0, 80]` window the upper thumb leaves the lower one.\n */\n async setRange(low: number, high: number): Promise<void> {\n if (!(await this.isRange())) {\n throw new Error('WrSliderHarness.setRange(): this slider has one thumb — add `range` to it, or call setValue().');\n }\n if (low > high) {\n throw new Error(`WrSliderHarness.setRange(): ${low} is above ${high}, and the thumbs cannot cross.`);\n }\n\n const lowThumb = await this.getLowThumb();\n const highThumb = await this.getHighThumb();\n\n if (high >= (await highThumb.getValue())) {\n await highThumb.setValue(high);\n await lowThumb.setValue(low);\n return;\n }\n\n await lowThumb.setValue(low);\n await highThumb.setValue(high);\n }\n\n /** One step up (`ArrowUp`). Single-thumb only. A disabled slider does not move. */\n async stepUp(): Promise<void> {\n return (await this.single('stepUp')).stepUp();\n }\n\n /** One step down (`ArrowDown`). Single-thumb only. A disabled slider does not move. */\n async stepDown(): Promise<void> {\n return (await this.single('stepDown')).stepDown();\n }\n\n /** `Home` — jump to the slider's `min`. Single-thumb only. */\n async toMin(): Promise<void> {\n return (await this.single('toMin')).toMin();\n }\n\n /** `End` — jump to the slider's `max`. Single-thumb only. */\n async toMax(): Promise<void> {\n return (await this.single('toMax')).toMax();\n }\n\n /**\n * Move keyboard focus to the slider's first thumb. A range slider's thumbs are\n * two separate tab stops (both are plain buttons — there is no roving\n * `tabindex`), so reach the other one through {@link getHighThumb}.\n */\n async focus(): Promise<void> {\n return (await this.getLowThumb()).focus();\n }\n\n /** Whether any of the slider's thumbs holds focus. */\n async isFocused(): Promise<boolean> {\n const focused = await Promise.all((await this.getThumbs()).map(thumb => thumb.isFocused()));\n return focused.includes(true);\n }\n\n /**\n * The one thumb a single-thumb convenience call means.\n *\n * Range mode gets an error rather than a guess: \"step this slider up\" has two\n * possible answers there, and picking one silently is how a spec ends up\n * asserting against the end it did not move.\n */\n private async single(caller: string): Promise<WrSliderThumbHarness> {\n if (await this.isRange()) {\n throw new Error(\n `WrSliderHarness.${caller}(): this slider has two thumbs — use setRange(), or reach for one end ` +\n 'with getLowThumb() / getHighThumb().'\n );\n }\n return this.getLowThumb();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;AACA,MAAM,WAAW,GAAG,IAAI;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACG,MAAO,oBAAqB,SAAQ,gBAAgB,CAAA;AACxD;;;;;AAKG;AACH,IAAA,OAAO,YAAY,GAAG,mBAAmB;;AAGzC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAuC,EAAE,EAAA;AACnD,QAAA,OAAO,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,OAAO;aACtD,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,OAAO,EAAE,QAAQ,KAAK,CAAC,MAAM,OAAO,CAAC,WAAW,EAAE,MAAM,QAAQ;aAC/G,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,OAAO,EAAE,KAAK,KAAK,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,MAAM,KAAK;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AAA,MAAM,IAAI,KAAK,CACb,CAAA,gBAAA,EAAmB,MAAM,CAAA,sEAAA,CAAwE;AAC/F,gBAAA,sCAAsC,CACzC;QACH;AACA,QAAA,OAAO,IAAI,CAAC,WAAW,EAAE;IAC3B;;;ACxOF;;AAEG;;"}
@@ -429,10 +429,10 @@ class WrSlider {
429
429
  const value = this.range() ? [this.low(), this.high()] : this.low();
430
430
  this.value.set(value);
431
431
  }
432
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrSlider, deps: [], target: i0.ɵɵFactoryTarget.Component });
433
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.6", type: WrSlider, isStandalone: true, selector: "wr-slider", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, upperLabel: { classPropertyName: "upperLabel", publicName: "upperLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class": "classes()" } }, viewQueries: [{ propertyName: "track", first: true, predicate: ["track"], descendants: true, isSignal: true }], ngImport: i0, template: "<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 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-label]=\"resolvedLowLabel()\"\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-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", encapsulation: i0.ViewEncapsulation.None });
432
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSlider, deps: [], target: i0.ɵɵFactoryTarget.Component });
433
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: WrSlider, isStandalone: true, selector: "wr-slider", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, range: { classPropertyName: "range", publicName: "range", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, showLabel: { classPropertyName: "showLabel", publicName: "showLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, upperLabel: { classPropertyName: "upperLabel", publicName: "upperLabel", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class": "classes()" } }, viewQueries: [{ propertyName: "track", first: true, predicate: ["track"], descendants: true, isSignal: true }], ngImport: i0, template: "<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 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-label]=\"resolvedLowLabel()\"\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-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", encapsulation: i0.ViewEncapsulation.None });
434
434
  }
435
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrSlider, decorators: [{
435
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrSlider, decorators: [{
436
436
  type: Component,
437
437
  args: [{ selector: 'wr-slider', encapsulation: ViewEncapsulation.None, host: { '[class]': 'classes()', '(focusout)': 'onFocusOut($event)' }, template: "<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 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-label]=\"resolvedLowLabel()\"\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-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" }]
438
438
  }], ctorParameters: () => [], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], range: [{ type: i0.Input, args: [{ isSignal: true, alias: "range", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], showLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "showLabel", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], upperLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "upperLabel", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], touch: [{ type: i0.Output, args: ["touch"] }], track: [{ type: i0.ViewChild, args: ['track', { isSignal: true }] }] } });