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
@@ -35,6 +35,10 @@ class WrTypography {
35
35
  /**
36
36
  * Color tone. `null` (default) keeps the variant's own color — the base
37
37
  * dark for headings/body, medium for lead/caption, primary for links.
38
+ * Emphasis only: a tone never carries a state on its own. Six of the nine
39
+ * intents share one lightness, and `success` against `danger` is 1.05:1 as
40
+ * text, so the words have to name the state (`500 Server Error`, not a red
41
+ * `Request`) — or reach for `<wr-alert>`, which draws a glyph per type.
38
42
  */
39
43
  tone = input(null, /* @ts-ignore */
40
44
  ...(ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []));
@@ -60,10 +64,10 @@ class WrTypography {
60
64
  return parts.join(' ');
61
65
  }, /* @ts-ignore */
62
66
  ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
63
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrTypography, deps: [], target: i0.ɵɵFactoryTarget.Directive });
64
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.6", type: WrTypography, isStandalone: true, selector: "[wrTypography]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, truncate: { classPropertyName: "truncate", publicName: "truncate", isSignal: true, isRequired: false, transformFunction: null }, mono: { classPropertyName: "mono", publicName: "mono", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
67
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrTypography, deps: [], target: i0.ɵɵFactoryTarget.Directive });
68
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: WrTypography, isStandalone: true, selector: "[wrTypography]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, truncate: { classPropertyName: "truncate", publicName: "truncate", isSignal: true, isRequired: false, transformFunction: null }, mono: { classPropertyName: "mono", publicName: "mono", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
65
69
  }
66
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrTypography, decorators: [{
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrTypography, decorators: [{
67
71
  type: Directive,
68
72
  args: [{
69
73
  selector: '[wrTypography]',
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-typography.mjs","sources":["../../../projects/lib/typography/typography.ts","../../../projects/lib/typography/ngwr-typography.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 { Directive, computed, input } from '@angular/core';\n\nimport type { WrTypographyAlign, WrTypographyTone, WrTypographyVariant } from './interfaces';\n\n/**\n * Semantic typography directive. Attaches to any native element and\n * applies the visual treatment for the chosen `variant` (`h1`–`h6`,\n * `display`, `lead`, `body`, `small`, `caption`, `overline`, `code`).\n *\n * Reads from the same `--wr-text-*` / `--wr-font-weight-*` / `--wr-leading-*`\n * tokens used by the opt-in typography utility classes — themeable by\n * overriding tokens at `:root`.\n *\n * @example\n * ```html\n * <h1 wrTypography variant=\"display\">Build interfaces</h1>\n * <h2 wrTypography variant=\"h2\" tone=\"primary\">that feel alive.</h2>\n * <p wrTypography variant=\"lead\">A developer-first library.</p>\n * <span wrTypography variant=\"caption\" tone=\"medium\">v1.6.0 — released today</span>\n * <code wrTypography variant=\"code\">inject(WrTheme)</code>\n * ```\n *\n * @see https://ngwr.dev/guides/typography/overview\n */\n@Directive({\n selector: '[wrTypography]',\n host: { '[class]': 'classes()' },\n})\nexport class WrTypography {\n /** Visual variant. @default 'body' */\n readonly variant = input<WrTypographyVariant>('body');\n\n /**\n * Color tone. `null` (default) keeps the variant's own color — the base\n * dark for headings/body, medium for lead/caption, primary for links.\n */\n readonly tone = input<WrTypographyTone | null>(null);\n\n /** Horizontal alignment. */\n readonly align = input<WrTypographyAlign | null>(null);\n\n /** Truncate to single line with ellipsis. @default false */\n readonly truncate = input(false, { transform: coerceBooleanProperty });\n\n /** Render with monospace font. @default false (auto-true for `code`) */\n readonly mono = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-typography', `wr-typography--${this.variant()}`];\n const tone = this.tone();\n if (tone) parts.push(`wr-typography--tone-${tone}`);\n const align = this.align();\n if (align) parts.push(`wr-typography--align-${align}`);\n if (this.truncate()) parts.push('wr-typography--truncate');\n if (this.mono() || this.variant() === 'code') parts.push('wr-typography--mono');\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;;;;;;;;;;;;;;;;;;;AAmBG;MAKU,YAAY,CAAA;;IAEd,OAAO,GAAG,KAAK,CAAsB,MAAM;gFAAC;AAErD;;;AAGG;IACM,IAAI,GAAG,KAAK,CAA0B,IAAI;6EAAC;;IAG3C,KAAK,GAAG,KAAK,CAA2B,IAAI;8EAAC;;IAG7C,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;;IAG7D,IAAI,GAAG,KAAK,CAAC,KAAK,4EAAI,SAAS,EAAE,qBAAqB,EAAA,CAAG;AAE/C,IAAA,OAAO,GAAG,QAAQ,CA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AA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE;AACjC,iBAAA;;;ACnCD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-typography.mjs","sources":["../../../projects/lib/typography/typography.ts","../../../projects/lib/typography/ngwr-typography.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 { Directive, computed, input } from '@angular/core';\n\nimport type { WrTypographyAlign, WrTypographyTone, WrTypographyVariant } from './interfaces';\n\n/**\n * Semantic typography directive. Attaches to any native element and\n * applies the visual treatment for the chosen `variant` (`h1`–`h6`,\n * `display`, `lead`, `body`, `small`, `caption`, `overline`, `code`).\n *\n * Reads from the same `--wr-text-*` / `--wr-font-weight-*` / `--wr-leading-*`\n * tokens used by the opt-in typography utility classes — themeable by\n * overriding tokens at `:root`.\n *\n * @example\n * ```html\n * <h1 wrTypography variant=\"display\">Build interfaces</h1>\n * <h2 wrTypography variant=\"h2\" tone=\"primary\">that feel alive.</h2>\n * <p wrTypography variant=\"lead\">A developer-first library.</p>\n * <span wrTypography variant=\"caption\" tone=\"medium\">v1.6.0 — released today</span>\n * <code wrTypography variant=\"code\">inject(WrTheme)</code>\n * ```\n *\n * @see https://ngwr.dev/guides/typography/overview\n */\n@Directive({\n selector: '[wrTypography]',\n host: { '[class]': 'classes()' },\n})\nexport class WrTypography {\n /** Visual variant. @default 'body' */\n readonly variant = input<WrTypographyVariant>('body');\n\n /**\n * Color tone. `null` (default) keeps the variant's own color — the base\n * dark for headings/body, medium for lead/caption, primary for links.\n * Emphasis only: a tone never carries a state on its own. Six of the nine\n * intents share one lightness, and `success` against `danger` is 1.05:1 as\n * text, so the words have to name the state (`500 Server Error`, not a red\n * `Request`) — or reach for `<wr-alert>`, which draws a glyph per type.\n */\n readonly tone = input<WrTypographyTone | null>(null);\n\n /** Horizontal alignment. */\n readonly align = input<WrTypographyAlign | null>(null);\n\n /** Truncate to single line with ellipsis. @default false */\n readonly truncate = input(false, { transform: coerceBooleanProperty });\n\n /** Render with monospace font. @default false (auto-true for `code`) */\n readonly mono = input(false, { transform: coerceBooleanProperty });\n\n protected readonly classes = computed(() => {\n const parts = ['wr-typography', `wr-typography--${this.variant()}`];\n const tone = this.tone();\n if (tone) parts.push(`wr-typography--tone-${tone}`);\n const align = this.align();\n if (align) parts.push(`wr-typography--align-${align}`);\n if (this.truncate()) parts.push('wr-typography--truncate');\n if (this.mono() || this.variant() === 'code') parts.push('wr-typography--mono');\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;;;;;;;;;;;;;;;;;;;AAmBG;MAKU,YAAY,CAAA;;IAEd,OAAO,GAAG,KAAK,CAAsB,MAAM;gFAAC;AAErD;;;;;;;AAOG;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AAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,QAAA,EAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,WAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAJxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE;AACjC,iBAAA;;;ACnCD;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-utils.mjs","sources":["../../../projects/lib/utils/guards/is-defined.ts","../../../projects/lib/utils/guards/is-non-empty-array.ts","../../../projects/lib/utils/guards/is-observable.ts","../../../projects/lib/utils/math/clamp.ts","../../../projects/lib/utils/math/round.ts","../../../projects/lib/utils/coercion/num-attr.ts","../../../projects/lib/utils/css-value/is-safe-css-value.ts","../../../projects/lib/utils/dom/get-root-font-size.ts","../../../projects/lib/utils/dom/focus.ts","../../../projects/lib/utils/css-size/resolve-css-size.ts","../../../projects/lib/utils/id/random-id.ts","../../../projects/lib/utils/fn/noop.ts","../../../projects/lib/utils/fn/debounce.ts","../../../projects/lib/utils/fn/throttle.ts","../../../projects/lib/utils/keyboard/keys.ts","../../../projects/lib/utils/keyboard/predicates.ts","../../../projects/lib/utils/log/badge-log.ts","../../../projects/lib/utils/public-api.ts","../../../projects/lib/utils/ngwr-utils.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Maybe } from '../interfaces';\n\n/**\n * Type guard that checks if a value is neither `null` nor `undefined`.\n *\n * @example\n * ```ts\n * const maybeValue: Maybe<number> = getValue();\n *\n * if (isDefined(maybeValue)) {\n * // here maybeValue is number\n * console.log(maybeValue.toFixed(2));\n * }\n * ```\n *\n * @see {@link Maybe}\n */\nexport function isDefined<T>(value: Maybe<T>): value is T {\n return value !== null && value !== undefined;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Maybe } from '../interfaces';\n\n/**\n * Type guard that checks if a value is an array with at least one element.\n *\n * @example\n * ```ts\n * const items: Maybe<string[]> = getItems();\n *\n * if (isNonEmptyArray(items)) {\n * // items is string[]\n * console.log(items[0]);\n * }\n * ```\n */\nexport function isNonEmptyArray<T>(value: Maybe<T[]>): value is [T, ...T[]] {\n return Array.isArray(value) && value.length > 0;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Observable } from 'rxjs';\n\n/**\n * Type guard that checks whether a value looks like an RxJS `Observable`.\n *\n * Uses duck-typing: verifies that the object has a `subscribe` function.\n * Does not require an actual `Observable` instance.\n *\n * @example\n * ```ts\n * if (isObservable(stream)) {\n * stream.subscribe(value => console.log(value));\n * }\n * ```\n */\nexport function isObservable<T = unknown>(value: unknown): value is Observable<T> {\n return !!value && typeof (value as { subscribe?: unknown }).subscribe === 'function';\n}\n","/**\n * Clamps `value` into the inclusive `[min, max]` range.\n *\n * @example\n * ```ts\n * clamp(140, 0, 100); // 100\n * clamp(-3, 0, 100); // 0\n * clamp(42, 0, 100); // 42\n * ```\n */\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n","/**\n * Rounds `value` to `decimals` fraction digits, compensating the usual\n * floating point drift (`0.1 + 0.2` rounds to `0.3`, not `0.30000000000000004`).\n *\n * @example\n * ```ts\n * round(0.1 + 0.2, 2); // 0.3\n * round(1.005, 2); // 1.01\n * round(7.4); // 7\n * ```\n */\nexport function round(value: number, decimals = 0): number {\n const factor = 10 ** decimals;\n return Math.round((value + Number.EPSILON) * factor) / factor;\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\n\n/**\n * Input-transform factory: coerces any bound value to a number, falling\n * back to `fallback` for `null` / `undefined` / unparsable input. The\n * standard transform for numeric `input()`s across ngwr.\n *\n * @example\n * ```ts\n * readonly speed = input(4, { transform: numAttr(4) });\n * ```\n */\nexport const numAttr =\n (fallback: number) =>\n (value: unknown): number =>\n coerceNumberProperty(value, fallback);\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\n/** Longest value worth composing. A colour is never near this. */\nconst MAX_LENGTH = 256;\n\n/**\n * Characters that end a declaration, open a string, or start a comment — none\n * of which belong in a value the library is about to wrap its own syntax around.\n */\nconst FORBIDDEN = /[;{}\"'\\\\@<>!]|\\/\\*|\\*\\//;\n\n/** Function name immediately preceding an open paren. */\nconst FUNCTION_NAME = /([\\w-]*)\\($/;\n\n/**\n * Functions a composed value may call. Every image-producing function is absent\n * on purpose — `url()`, `image-set()`, `cross-fade()`, `element()`, `paint()` —\n * because fetching is the whole impact of this class.\n */\nconst ALLOWED_FUNCTIONS = new Set([\n 'rgb',\n 'rgba',\n 'hsl',\n 'hsla',\n 'hwb',\n 'lab',\n 'lch',\n 'oklab',\n 'oklch',\n 'color',\n 'color-mix',\n 'light-dark',\n 'var',\n 'calc',\n 'min',\n 'max',\n 'clamp',\n]);\n\n/**\n * Answers whether a value can be composed **into** a larger CSS expression\n * without escaping the slot it was given — a colour inside a `linear-gradient()`\n * the component builds, an entry the component joins into a custom property a\n * stylesheet then substitutes.\n *\n * It is a containment check, not a colour parser. It says the value cannot\n * terminate the construct the library wrapped around it; it says nothing about\n * whether the value is a colour a browser will accept, and a rejected value\n * should fall back to the component's own default rather than be repaired.\n *\n * **A value bound straight to `[style.background]` needs none of this.** There\n * is nothing to break out of there, and Angular applies style values through\n * CSSOM by design — validating those would amount to refusing style values in a\n * style binding.\n *\n * Rejected, and each one is a way out of the slot:\n *\n * - a `)` the value never opened — `red), url(…), linear-gradient(red` is the\n * shape that turns a colour into an extra background layer the browser fetches;\n * - a top-level `,` — a `<color>` is one value, so a comma at depth 0 means the\n * payload has reached the slot next to the one it was handed;\n * - `;` `{` `}` a quote, a backslash, `!`, or a CSS comment delimiter;\n * - any function outside {@link ALLOWED_FUNCTIONS} — `url()` above all.\n *\n * Top-level whitespace is allowed: `red 20%` is a legitimate gradient stop, and\n * without a comma or a bare `)` it cannot reach anything.\n *\n * @example\n * ```ts\n * isSafeCssValue('var(--wr-color-primary)'); // true\n * isSafeCssValue('color-mix(in srgb, red 50%, blue)'); // true\n * isSafeCssValue('red), url(\"https://x.test/beacon\"), linear-gradient(red'); // false\n * ```\n *\n * @param value Raw value handed to the component.\n * @returns `true` when the value stays inside its slot.\n */\nexport function isSafeCssValue(value: string): boolean {\n if (typeof value !== 'string') return false;\n\n const trimmed = value.trim();\n if (trimmed === '' || trimmed.length > MAX_LENGTH) return false;\n if (FORBIDDEN.test(trimmed)) return false;\n\n let depth = 0;\n for (let i = 0; i < trimmed.length; i++) {\n const char = trimmed[i];\n\n if (char === '(') {\n const name = FUNCTION_NAME.exec(trimmed.slice(0, i + 1));\n if (!name || !ALLOWED_FUNCTIONS.has(name[1].toLowerCase())) return false;\n depth++;\n } else if (char === ')') {\n depth--;\n if (depth < 0) return false;\n } else if (depth === 0 && char === ',') {\n return false;\n }\n }\n\n return depth === 0;\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\n/**\n * Reads the root font size (in pixels) from\n * `getComputedStyle(document.documentElement).fontSize`.\n *\n * Typical use case: converting `rem` values to pixels for layout calculations.\n *\n * Falls back to the provided value when:\n * - DOM is not available (SSR);\n * - `getComputedStyle` fails or returns an unparseable value.\n *\n * @example\n * ```ts\n * const rootFontSize = getRootFontSize(); // e.g. 16\n * const customFallback = getRootFontSize(14); // uses 14 if DOM is unavailable\n * ```\n *\n * @param fallback - Value in pixels when DOM is unavailable. Defaults to `16`.\n * @returns Root font size in pixels.\n */\nexport function getRootFontSize(fallback = 16): number {\n try {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return fallback;\n }\n\n const raw = window.getComputedStyle(document.documentElement).fontSize;\n const parsed = Number.parseFloat(raw);\n\n return Number.isFinite(parsed) ? parsed : fallback;\n } catch {\n return 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\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\n/** Return every focusable descendant of `root` in DOM order. */\nexport function getFocusableElements(root: HTMLElement): readonly HTMLElement[] {\n return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n el => el.offsetParent !== null || el === document.activeElement\n );\n}\n\n/**\n * Trap Tab navigation inside `root` for a keyboard event — call from a\n * `keydown` handler. Cycles focus from first ↔ last focusable element.\n * Returns `true` when focus was redirected (event was handled).\n */\nexport function trapFocus(root: HTMLElement, event: KeyboardEvent): boolean {\n if (event.key !== 'Tab') return false;\n const focusable = getFocusableElements(root);\n if (focusable.length === 0) return false;\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement as HTMLElement | null;\n\n if (event.shiftKey && active === first) {\n event.preventDefault();\n last.focus();\n return true;\n }\n if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n return true;\n }\n return false;\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 { getRootFontSize } from '../dom';\n\nimport type { ResolveCssSizeOptions } from './resolve-css-size-options';\nimport type { ResolvedCssSize } from './resolved-css-size';\n\n/**\n * Resolves a raw size value into a CSS string and an optional pixel equivalent.\n *\n * Supported formats:\n * - `number` → pixels (`48` → `\"48px\"`)\n * - `\"12px\"` → pixels (`\"12px\"` → `\"12px\"`)\n * - `\"3rem\"` → rems via root (`\"3rem\"` → `\"3rem\"`, pxValue = 3 × root font size)\n * - `\"80%\"` → percentage (`\"80%\"` → `\"80%\"`, pxValue = null)\n * - `\"15\"` → pixels (`\"15\"` → `\"15px\"`)\n * - anything else → passed through as-is, pxValue = null\n *\n * @example\n * ```ts\n * const size = resolveCssSize('3rem', { defaultValue: '6rem' });\n * // size.cssValue === '3rem'\n * // size.pxValue === 3 * getRootFontSize()\n * ```\n *\n * @param raw - Value to resolve. Accepts numbers, pixel/rem/percent strings, or `null`/`undefined`.\n * @param options - Optional configuration.\n * @returns Resolved CSS value and its pixel equivalent when computable.\n *\n * @see {@link ResolvedCssSize}\n * @see {@link ResolveCssSizeOptions}\n */\nexport function resolveCssSize(raw: unknown, options: ResolveCssSizeOptions = {}): ResolvedCssSize {\n const rootFontSize = getRootFontSize();\n const value: unknown = raw ?? options.defaultValue;\n\n if (value == null) {\n return { cssValue: '0px', pxValue: 0 };\n }\n\n if (typeof value === 'number' && Number.isFinite(value)) {\n return { cssValue: `${value}px`, pxValue: value };\n }\n\n if (typeof value !== 'string') {\n return { cssValue: '0px', pxValue: 0 };\n }\n\n const trimmed = value.trim();\n\n const remMatch = /^([\\d.]+)\\s*rem$/i.exec(trimmed);\n if (remMatch) {\n const rem = Number.parseFloat(remMatch[1]);\n const px = rem * rootFontSize;\n return { cssValue: `${rem}rem`, pxValue: Number.isFinite(px) ? px : null };\n }\n\n const pxMatch = /^([\\d.]+)\\s*px$/i.exec(trimmed);\n if (pxMatch) {\n const px = Number.parseFloat(pxMatch[1]);\n return { cssValue: `${px}px`, pxValue: Number.isFinite(px) ? px : null };\n }\n\n const percentMatch = /^([\\d.]+)\\s*%$/.exec(trimmed);\n if (percentMatch) {\n return { cssValue: `${percentMatch[1]}%`, pxValue: null };\n }\n\n const numberMatch = /^([\\d.]+)$/.exec(trimmed);\n if (numberMatch) {\n const px = Number.parseFloat(numberMatch[1]);\n return { cssValue: `${px}px`, pxValue: Number.isFinite(px) ? px : null };\n }\n\n return { cssValue: trimmed, pxValue: null };\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\nconst ALPHABET = 'abcdefghijklmnopqrstuvwxyz0123456789';\nconst MIN_LENGTH = 4;\nconst MAX_LENGTH = 64;\nconst DEFAULT_LENGTH = 12;\n\n/**\n * Returns random bytes using the best available source.\n *\n * @internal\n */\nfunction defaultRandomBytes(count: number): Uint8Array {\n // Covers: all browsers, Node ≥ 18, Deno, Bun, Cloudflare Workers\n if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(count));\n }\n\n // Fallback: Node < 18 or exotic runtimes\n const buf = new Uint8Array(count);\n for (let i = 0; i < count; i++) {\n buf[i] = Math.floor(Math.random() * 256);\n }\n return buf;\n}\n\n/**\n * Generates a pseudo-random, DOM-safe identifier.\n *\n * Produced ids:\n * - are prefixed to avoid collisions with host-application ids;\n * - contain only `[a-z0-9-]` characters;\n * - use `crypto.getRandomValues` when available, falling back to `Math.random`.\n *\n * **Not suitable for cryptographic or security-sensitive purposes** —\n * intended only for UI element identifiers (`id`, `for`, `aria-*`, etc.).\n *\n * @example\n * ```ts\n * randomId();\n * // → \"wr-a8f2bx1k9q4z\"\n *\n * randomId('ng', 8);\n * // → \"ng-k2f9mbeo\"\n *\n * randomId('wr', 24);\n * // → \"wr-a8f2bx1k9q4zmneo73wplr\"\n * ```\n *\n * @param prefix - Namespace prefix prepended before the random segment. Defaults to `'wr'`.\n * @param length - Length of the random segment. Clamped to `[4, 64]`. Defaults to `12`.\n * @param random - Custom random byte source `(byteLength) => Uint8Array`.\n * When omitted, uses `crypto.getRandomValues` with a `Math.random` fallback.\n * @returns A pseudo-random id string matching `/^[a-z]+-[a-z0-9]+$/`.\n */\nexport function randomId(prefix = 'wr', length = DEFAULT_LENGTH, random?: (byteLength: number) => Uint8Array): string {\n const safeLength = Math.min(Math.max(Math.trunc(length), MIN_LENGTH), MAX_LENGTH);\n\n const bytes = random ? random(safeLength) : defaultRandomBytes(safeLength);\n\n let result = '';\n for (let i = 0; i < safeLength; i++) {\n result += ALPHABET[bytes[i] % ALPHABET.length];\n }\n\n return `${prefix}-${result}`;\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\n/**\n * A function that does nothing.\n *\n * Useful as a default callback, placeholder event handler,\n * or to explicitly signal intentional no-ops.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * onTouched: () => void = noop;\n * }\n * ```\n */\nexport const noop = (): void => undefined;\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\n/** A debounced function — same signature as the original plus `cancel`. */\nexport type WrDebouncedFn<TArgs extends readonly unknown[]> = ((...args: TArgs) => void) & {\n readonly cancel: () => void;\n};\n\n/**\n * Wrap `fn` so it only fires `waitMs` after the last invocation.\n * Useful for resize / scroll / input handlers.\n *\n * @example\n * ```ts\n * const onResize = debounce(() => recalcLayout(), 150);\n * window.addEventListener('resize', onResize);\n * ```\n */\nexport function debounce<TArgs extends readonly unknown[]>(\n fn: (...args: TArgs) => void,\n waitMs: number\n): WrDebouncedFn<TArgs> {\n let timer: ReturnType<typeof setTimeout> | null = null;\n\n const debounced = (...args: TArgs): void => {\n if (timer !== null) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = null;\n fn(...args);\n }, waitMs);\n };\n\n debounced.cancel = (): void => {\n if (timer !== null) {\n clearTimeout(timer);\n timer = null;\n }\n };\n\n return debounced;\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\n/** A throttled function — same signature as the original plus `cancel`. */\nexport type WrThrottledFn<TArgs extends readonly unknown[]> = ((...args: TArgs) => void) & {\n readonly cancel: () => void;\n};\n\n/**\n * Wrap `fn` so it fires at most once every `waitMs`. Leading-edge call\n * fires immediately; trailing-edge call fires once at the end of the window\n * if there were further invocations.\n */\nexport function throttle<TArgs extends readonly unknown[]>(\n fn: (...args: TArgs) => void,\n waitMs: number\n): WrThrottledFn<TArgs> {\n let lastInvoke = 0;\n let trailingTimer: ReturnType<typeof setTimeout> | null = null;\n let pendingArgs: TArgs | null = null;\n\n const throttled = (...args: TArgs): void => {\n const now = Date.now();\n const remaining = waitMs - (now - lastInvoke);\n\n if (remaining <= 0) {\n if (trailingTimer !== null) {\n clearTimeout(trailingTimer);\n trailingTimer = null;\n }\n lastInvoke = now;\n fn(...args);\n } else {\n pendingArgs = args;\n trailingTimer ??= setTimeout(() => {\n lastInvoke = Date.now();\n trailingTimer = null;\n if (pendingArgs) fn(...pendingArgs);\n pendingArgs = null;\n }, remaining);\n }\n };\n\n throttled.cancel = (): void => {\n if (trailingTimer !== null) {\n clearTimeout(trailingTimer);\n trailingTimer = null;\n }\n pendingArgs = null;\n lastInvoke = 0;\n };\n\n return throttled;\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\n/**\n * Canonical `KeyboardEvent.key` values for your own `keydown` handlers.\n *\n * The spec spellings are easy to get wrong — arrows are `ArrowUp`, space is a\n * literal `' '` — and a typo like `'Esacpe'` never matches and never errors.\n * These give you autocomplete and the {@link WrKey} union to match against.\n */\nexport const KEYS = {\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n TAB: 'Tab',\n SPACE: ' ',\n BACKSPACE: 'Backspace',\n DELETE: 'Delete',\n ARROW_UP: 'ArrowUp',\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_RIGHT: 'ArrowRight',\n HOME: 'Home',\n END: 'End',\n PAGE_UP: 'PageUp',\n PAGE_DOWN: 'PageDown',\n} as const;\n\nexport type WrKey = (typeof KEYS)[keyof typeof KEYS];\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\n/** True when any modifier key (Ctrl / Cmd / Alt / Shift / Meta) is held. */\nexport function hasModifier(event: KeyboardEvent): boolean {\n return event.ctrlKey || event.altKey || event.metaKey || event.shiftKey;\n}\n\n/**\n * True when the key is a single printable character (letters, digits,\n * punctuation, etc.). Skips function keys, arrows, modifiers, and named\n * keys like `Backspace` or `Tab`.\n */\nexport function isPrintableKey(event: KeyboardEvent): boolean {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\n}\n\n/**\n * True while an input method is composing — the key belongs to the IME, not to\n * your handler. **Return early on it in every `keydown` handler that reads\n * Enter, Escape or an arrow on, or above, a field that accepts typed text.**\n *\n * A Japanese or Chinese user reaches every character through a conversion. From\n * `compositionstart` until `compositionend` a candidate window is open, and\n * those keys are how it is driven: Enter accepts the candidate, Escape cancels\n * the conversion back to kana, the arrows walk the candidate list. A component\n * that acts on them anyway takes the key away from the IME mid-word — the\n * overlay closes instead of the candidate window, and the half-composed reading\n * the user was still choosing between is gone with it.\n *\n * Both halves of the test are needed. `isComposing` is the standard flag, but\n * Safari fires `compositionend` *before* the `keydown` of the Enter that commits\n * a candidate, so that one arrives with `isComposing === false` and only the\n * legacy `keyCode` of `229` — the sentinel every engine sets on a key it handed\n * to the input method — to say where it came from.\n *\n * `keydown` is the whole scope. It does NOT answer \"is a composition in\n * progress\" for an `input` or `blur` handler: on the committing keystroke the\n * two disagree by design. A component that needs the state *between* events\n * tracks it with the `compositionstart` / `compositionend` pair instead.\n *\n * ```ts\n * protected onKeydown(event: KeyboardEvent): void {\n * if (isComposing(event)) return;\n * // …\n * }\n * ```\n */\nexport function isComposing(event: KeyboardEvent): boolean {\n // `keyCode` is deprecated and stays anyway: it is the only signal Safari\n // leaves on the committing keystroke. See the doc comment above.\n return event.isComposing || event.keyCode === 229;\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\n/**\n * Logs a coloured pill to the browser console followed by a payload.\n *\n * Useful when you need to scan a noisy console for a specific subsystem's\n * messages. The pill is rendered with the CSS `%c` console formatting trick.\n *\n * @example\n * ```ts\n * badgeLog('icons', '#3969e2', { name: 'plus', registered: true });\n * // → [icons] { name: 'plus', registered: true }\n * ```\n *\n * @param badgeText Short label shown inside the pill.\n * @param color CSS colour applied to the pill border and text.\n * @param message Anything you'd pass to `console.log` as the second argument.\n *\n * @internal\n */\nexport function badgeLog(badgeText: string, color: string, message: unknown): void {\n const style = `\n display: inline-block;\n border: 1px solid ${color};\n color: ${color};\n padding: 1px 3px;\n border-radius: 4px;\n margin-right: 0\n `;\n // eslint-disable-next-line no-console -- this helper exists to log\n console.log(`%c${badgeText}`, style, message);\n}\n","// Types\nexport type { Maybe, SafeAny } from './interfaces';\n\n// Guards\nexport { isDefined, isNonEmptyArray, isObservable } from './guards';\n\n// Math\nexport { clamp, round } from './math';\n\n// Coercion\nexport { numAttr } from './coercion';\n\n// CSS value\nexport { isSafeCssValue } from './css-value';\n\n// CSS size\nexport { resolveCssSize } from './css-size';\nexport type { ResolveCssSizeOptions, ResolvedCssSize } from './css-size';\n\n// DOM\nexport { getRootFontSize, getFocusableElements, trapFocus } from './dom';\n\n// ID\nexport { randomId } from './id';\n\n// Fn\nexport { noop, debounce, throttle } from './fn';\nexport type { WrDebouncedFn, WrThrottledFn } from './fn';\n\n// Keyboard\nexport { KEYS, hasModifier, isComposing, isPrintableKey } from './keyboard';\nexport type { WrKey } from './keyboard';\n\n// Log\nexport { badgeLog } from './log';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["MAX_LENGTH"],"mappings":";;AAAA;;;;;AAKG;AAIH;;;;;;;;;;;;;;AAcG;AACG,SAAU,SAAS,CAAI,KAAe,EAAA;AAC1C,IAAA,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;AAC9C;;AC1BA;;;;;AAKG;AAIH;;;;;;;;;;;;AAYG;AACG,SAAU,eAAe,CAAI,KAAiB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;AACjD;;ACxBA;;;;;AAKG;AAIH;;;;;;;;;;;;AAYG;AACG,SAAU,YAAY,CAAc,KAAc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AAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM;AACpF;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACG,SAAU,WAAW,CAAC,KAAoB,EAAA;;;IAG9C,OAAO,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,KAAK,GAAG;AACnD;;ACxDA;;;;;AAKG;AAEH;;;;;;;;;;;;;;;;;AAiBG;SACa,QAAQ,CAAC,SAAiB,EAAE,KAAa,EAAE,OAAgB,EAAA;AACzE,IAAA,MAAM,KAAK,GAAG;;wBAEQ,KAAK,CAAA;aAChB,KAAK,CAAA;;;;GAIf;;IAED,OAAO,CAAC,GAAG,CAAC,CAAA,EAAA,EAAK,SAAS,CAAA,CAAE,EAAE,KAAK,EAAE,OAAO,CAAC;AAC/C;;ACjCA;;ACHA;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-utils.mjs","sources":["../../../projects/lib/utils/guards/is-defined.ts","../../../projects/lib/utils/guards/is-non-empty-array.ts","../../../projects/lib/utils/guards/is-observable.ts","../../../projects/lib/utils/math/clamp.ts","../../../projects/lib/utils/math/round.ts","../../../projects/lib/utils/coercion/num-attr.ts","../../../projects/lib/utils/css-value/is-safe-css-value.ts","../../../projects/lib/utils/dom/get-root-font-size.ts","../../../projects/lib/utils/dom/focus.ts","../../../projects/lib/utils/css-size/resolve-css-size.ts","../../../projects/lib/utils/id/random-id.ts","../../../projects/lib/utils/fn/noop.ts","../../../projects/lib/utils/fn/debounce.ts","../../../projects/lib/utils/fn/throttle.ts","../../../projects/lib/utils/keyboard/keys.ts","../../../projects/lib/utils/keyboard/predicates.ts","../../../projects/lib/utils/log/badge-log.ts","../../../projects/lib/utils/public-api.ts","../../../projects/lib/utils/ngwr-utils.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Maybe } from '../interfaces';\n\n/**\n * Type guard that checks if a value is neither `null` nor `undefined`.\n *\n * @example\n * ```ts\n * const maybeValue: Maybe<number> = getValue();\n *\n * if (isDefined(maybeValue)) {\n * // here maybeValue is number\n * console.log(maybeValue.toFixed(2));\n * }\n * ```\n *\n * @see {@link Maybe}\n */\nexport function isDefined<T>(value: Maybe<T>): value is T {\n return value !== null && value !== undefined;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Maybe } from '../interfaces';\n\n/**\n * Type guard that checks if a value is an array with at least one element.\n *\n * @example\n * ```ts\n * const items: Maybe<string[]> = getItems();\n *\n * if (isNonEmptyArray(items)) {\n * // items is string[]\n * console.log(items[0]);\n * }\n * ```\n */\nexport function isNonEmptyArray<T>(value: Maybe<T[]>): value is [T, ...T[]] {\n return Array.isArray(value) && value.length > 0;\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { Observable } from 'rxjs';\n\n/**\n * Type guard that checks whether a value looks like an RxJS `Observable`.\n *\n * Uses duck-typing: verifies that the object has a `subscribe` function.\n * Does not require an actual `Observable` instance.\n *\n * @example\n * ```ts\n * if (isObservable(stream)) {\n * stream.subscribe(value => console.log(value));\n * }\n * ```\n */\nexport function isObservable<T = unknown>(value: unknown): value is Observable<T> {\n return !!value && typeof (value as { subscribe?: unknown }).subscribe === 'function';\n}\n","/**\n * Clamps `value` into the inclusive `[min, max]` range.\n *\n * @example\n * ```ts\n * clamp(140, 0, 100); // 100\n * clamp(-3, 0, 100); // 0\n * clamp(42, 0, 100); // 42\n * ```\n */\nexport function clamp(value: number, min: number, max: number): number {\n return Math.min(max, Math.max(min, value));\n}\n","/**\n * Rounds `value` to `decimals` fraction digits, compensating the usual\n * floating point drift (`0.1 + 0.2` rounds to `0.3`, not `0.30000000000000004`).\n *\n * @example\n * ```ts\n * round(0.1 + 0.2, 2); // 0.3\n * round(1.005, 2); // 1.01\n * round(7.4); // 7\n * ```\n */\nexport function round(value: number, decimals = 0): number {\n const factor = 10 ** decimals;\n return Math.round((value + Number.EPSILON) * factor) / factor;\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\n\n/**\n * Input-transform factory: coerces any bound value to a number, falling\n * back to `fallback` for `null` / `undefined` / unparsable input. The\n * standard transform for numeric `input()`s across ngwr.\n *\n * @example\n * ```ts\n * readonly speed = input(4, { transform: numAttr(4) });\n * ```\n */\nexport const numAttr =\n (fallback: number) =>\n (value: unknown): number =>\n coerceNumberProperty(value, fallback);\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\n/** Longest value worth composing. A colour is never near this. */\nconst MAX_LENGTH = 256;\n\n/**\n * Characters that end a declaration, open a string, or start a comment — none\n * of which belong in a value the library is about to wrap its own syntax around.\n */\nconst FORBIDDEN = /[;{}\"'\\\\@<>!]|\\/\\*|\\*\\//;\n\n/** Function name immediately preceding an open paren. */\nconst FUNCTION_NAME = /([\\w-]*)\\($/;\n\n/**\n * Functions a composed value may call. Every image-producing function is absent\n * on purpose — `url()`, `image-set()`, `cross-fade()`, `element()`, `paint()` —\n * because fetching is the whole impact of this class.\n */\nconst ALLOWED_FUNCTIONS = new Set([\n 'rgb',\n 'rgba',\n 'hsl',\n 'hsla',\n 'hwb',\n 'lab',\n 'lch',\n 'oklab',\n 'oklch',\n 'color',\n 'color-mix',\n 'light-dark',\n 'var',\n 'calc',\n 'min',\n 'max',\n 'clamp',\n]);\n\n/**\n * Answers whether a value can be composed **into** a larger CSS expression\n * without escaping the slot it was given — a colour inside a `linear-gradient()`\n * the component builds, an entry the component joins into a custom property a\n * stylesheet then substitutes.\n *\n * It is a containment check, not a colour parser. It says the value cannot\n * terminate the construct the library wrapped around it; it says nothing about\n * whether the value is a colour a browser will accept, and a rejected value\n * should fall back to the component's own default rather than be repaired.\n *\n * **A value bound straight to `[style.background]` needs none of this.** There\n * is nothing to break out of there, and Angular applies style values through\n * CSSOM by design — validating those would amount to refusing style values in a\n * style binding.\n *\n * Rejected, and each one is a way out of the slot:\n *\n * - a `)` the value never opened — `red), url(…), linear-gradient(red` is the\n * shape that turns a colour into an extra background layer the browser fetches;\n * - a top-level `,` — a `<color>` is one value, so a comma at depth 0 means the\n * payload has reached the slot next to the one it was handed;\n * - `;` `{` `}` a quote, a backslash, `!`, or a CSS comment delimiter;\n * - any function outside {@link ALLOWED_FUNCTIONS} — `url()` above all.\n *\n * Top-level whitespace is allowed: `red 20%` is a legitimate gradient stop, and\n * without a comma or a bare `)` it cannot reach anything.\n *\n * @example\n * ```ts\n * isSafeCssValue('var(--wr-color-primary)'); // true\n * isSafeCssValue('color-mix(in srgb, red 50%, blue)'); // true\n * isSafeCssValue('red), url(\"https://x.test/beacon\"), linear-gradient(red'); // false\n * ```\n *\n * @param value Raw value handed to the component.\n * @returns `true` when the value stays inside its slot.\n */\nexport function isSafeCssValue(value: string): boolean {\n if (typeof value !== 'string') return false;\n\n const trimmed = value.trim();\n if (trimmed === '' || trimmed.length > MAX_LENGTH) return false;\n if (FORBIDDEN.test(trimmed)) return false;\n\n let depth = 0;\n for (let i = 0; i < trimmed.length; i++) {\n const char = trimmed[i];\n\n if (char === '(') {\n const name = FUNCTION_NAME.exec(trimmed.slice(0, i + 1));\n if (!name || !ALLOWED_FUNCTIONS.has(name[1].toLowerCase())) return false;\n depth++;\n } else if (char === ')') {\n depth--;\n if (depth < 0) return false;\n } else if (depth === 0 && char === ',') {\n return false;\n }\n }\n\n return depth === 0;\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\n/**\n * Reads the root font size (in pixels) from\n * `getComputedStyle(document.documentElement).fontSize`.\n *\n * Typical use case: converting `rem` values to pixels for layout calculations.\n *\n * Falls back to the provided value when:\n * - DOM is not available (SSR);\n * - `getComputedStyle` fails or returns an unparseable value.\n *\n * @example\n * ```ts\n * const rootFontSize = getRootFontSize(); // e.g. 16\n * const customFallback = getRootFontSize(14); // uses 14 if DOM is unavailable\n * ```\n *\n * @param fallback - Value in pixels when DOM is unavailable. Defaults to `16`.\n * @returns Root font size in pixels.\n */\nexport function getRootFontSize(fallback = 16): number {\n try {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return fallback;\n }\n\n const raw = window.getComputedStyle(document.documentElement).fontSize;\n const parsed = Number.parseFloat(raw);\n\n return Number.isFinite(parsed) ? parsed : fallback;\n } catch {\n return 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\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\n/** Return every focusable descendant of `root` in DOM order. */\nexport function getFocusableElements(root: HTMLElement): readonly HTMLElement[] {\n return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR)).filter(\n el => el.offsetParent !== null || el === document.activeElement\n );\n}\n\n/**\n * Trap Tab navigation inside `root` for a keyboard event — call from a\n * `keydown` handler. Cycles focus from first ↔ last focusable element.\n * Returns `true` when focus was redirected (event was handled).\n */\nexport function trapFocus(root: HTMLElement, event: KeyboardEvent): boolean {\n if (event.key !== 'Tab') return false;\n const focusable = getFocusableElements(root);\n if (focusable.length === 0) return false;\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n const active = document.activeElement as HTMLElement | null;\n\n if (event.shiftKey && active === first) {\n event.preventDefault();\n last.focus();\n return true;\n }\n if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n return true;\n }\n return false;\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 { getRootFontSize } from '../dom';\n\nimport type { ResolveCssSizeOptions } from './resolve-css-size-options';\nimport type { ResolvedCssSize } from './resolved-css-size';\n\n/**\n * Resolves a raw size value into a CSS string and an optional pixel equivalent.\n *\n * Supported formats:\n * - `number` → pixels (`48` → `\"48px\"`)\n * - `\"12px\"` → pixels (`\"12px\"` → `\"12px\"`)\n * - `\"3rem\"` → rems via root (`\"3rem\"` → `\"3rem\"`, pxValue = 3 × root font size)\n * - `\"80%\"` → percentage (`\"80%\"` → `\"80%\"`, pxValue = null)\n * - `\"15\"` → pixels (`\"15\"` → `\"15px\"`)\n * - anything else → passed through as-is, pxValue = null\n *\n * @example\n * ```ts\n * const size = resolveCssSize('3rem', { defaultValue: '6rem' });\n * // size.cssValue === '3rem'\n * // size.pxValue === 3 * getRootFontSize()\n * ```\n *\n * @param raw - Value to resolve. Accepts numbers, pixel/rem/percent strings, or `null`/`undefined`.\n * @param options - Optional configuration.\n * @returns Resolved CSS value and its pixel equivalent when computable.\n *\n * @see {@link ResolvedCssSize}\n * @see {@link ResolveCssSizeOptions}\n */\nexport function resolveCssSize(raw: unknown, options: ResolveCssSizeOptions = {}): ResolvedCssSize {\n const rootFontSize = getRootFontSize();\n const value: unknown = raw ?? options.defaultValue;\n\n if (value == null) {\n return { cssValue: '0px', pxValue: 0 };\n }\n\n if (typeof value === 'number' && Number.isFinite(value)) {\n return { cssValue: `${value}px`, pxValue: value };\n }\n\n if (typeof value !== 'string') {\n return { cssValue: '0px', pxValue: 0 };\n }\n\n const trimmed = value.trim();\n\n const remMatch = /^([\\d.]+)\\s*rem$/i.exec(trimmed);\n if (remMatch) {\n const rem = Number.parseFloat(remMatch[1]);\n const px = rem * rootFontSize;\n return { cssValue: `${rem}rem`, pxValue: Number.isFinite(px) ? px : null };\n }\n\n const pxMatch = /^([\\d.]+)\\s*px$/i.exec(trimmed);\n if (pxMatch) {\n const px = Number.parseFloat(pxMatch[1]);\n return { cssValue: `${px}px`, pxValue: Number.isFinite(px) ? px : null };\n }\n\n const percentMatch = /^([\\d.]+)\\s*%$/.exec(trimmed);\n if (percentMatch) {\n return { cssValue: `${percentMatch[1]}%`, pxValue: null };\n }\n\n const numberMatch = /^([\\d.]+)$/.exec(trimmed);\n if (numberMatch) {\n const px = Number.parseFloat(numberMatch[1]);\n return { cssValue: `${px}px`, pxValue: Number.isFinite(px) ? px : null };\n }\n\n return { cssValue: trimmed, pxValue: null };\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\nconst ALPHABET = 'abcdefghijklmnopqrstuvwxyz0123456789';\nconst MIN_LENGTH = 4;\nconst MAX_LENGTH = 64;\nconst DEFAULT_LENGTH = 12;\n\n/**\n * Returns random bytes using the best available source.\n *\n * @internal\n */\nfunction defaultRandomBytes(count: number): Uint8Array {\n // Covers: all browsers, Node ≥ 18, Deno, Bun, Cloudflare Workers\n if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {\n return crypto.getRandomValues(new Uint8Array(count));\n }\n\n // Fallback: Node < 18 or exotic runtimes\n const buf = new Uint8Array(count);\n for (let i = 0; i < count; i++) {\n buf[i] = Math.floor(Math.random() * 256);\n }\n return buf;\n}\n\n/**\n * Generates a pseudo-random, DOM-safe identifier.\n *\n * Produced ids:\n * - are prefixed to avoid collisions with host-application ids;\n * - contain only `[a-z0-9-]` characters;\n * - use `crypto.getRandomValues` when available, falling back to `Math.random`.\n *\n * **Not suitable for cryptographic or security-sensitive purposes** —\n * intended only for UI element identifiers (`id`, `for`, `aria-*`, etc.).\n *\n * @example\n * ```ts\n * randomId();\n * // → \"wr-a8f2bx1k9q4z\"\n *\n * randomId('ng', 8);\n * // → \"ng-k2f9mbeo\"\n *\n * randomId('wr', 24);\n * // → \"wr-a8f2bx1k9q4zmneo73wplr\"\n * ```\n *\n * @param prefix - Namespace prefix prepended before the random segment. Defaults to `'wr'`.\n * @param length - Length of the random segment. Clamped to `[4, 64]`. Defaults to `12`.\n * @param random - Custom random byte source `(byteLength) => Uint8Array`.\n * When omitted, uses `crypto.getRandomValues` with a `Math.random` fallback.\n * @returns A pseudo-random id string matching `/^[a-z]+-[a-z0-9]+$/`.\n */\nexport function randomId(prefix = 'wr', length = DEFAULT_LENGTH, random?: (byteLength: number) => Uint8Array): string {\n const safeLength = Math.min(Math.max(Math.trunc(length), MIN_LENGTH), MAX_LENGTH);\n\n const bytes = random ? random(safeLength) : defaultRandomBytes(safeLength);\n\n let result = '';\n for (let i = 0; i < safeLength; i++) {\n result += ALPHABET[bytes[i] % ALPHABET.length];\n }\n\n return `${prefix}-${result}`;\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\n/**\n * A function that does nothing.\n *\n * Useful as a default callback, placeholder event handler,\n * or to explicitly signal intentional no-ops.\n *\n * @example\n * ```ts\n * @Component({ ... })\n * export class MyComponent {\n * onTouched: () => void = noop;\n * }\n * ```\n */\nexport const noop = (): void => undefined;\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\n/** A debounced function — same signature as the original plus `cancel`. */\nexport type WrDebouncedFn<TArgs extends readonly unknown[]> = ((...args: TArgs) => void) & {\n readonly cancel: () => void;\n};\n\n/**\n * Wrap `fn` so it only fires `waitMs` after the last invocation.\n * Useful for resize / scroll / input handlers.\n *\n * @example\n * ```ts\n * const onResize = debounce(() => recalcLayout(), 150);\n * window.addEventListener('resize', onResize);\n * ```\n */\nexport function debounce<TArgs extends readonly unknown[]>(\n fn: (...args: TArgs) => void,\n waitMs: number\n): WrDebouncedFn<TArgs> {\n let timer: ReturnType<typeof setTimeout> | null = null;\n\n const debounced = (...args: TArgs): void => {\n if (timer !== null) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = null;\n fn(...args);\n }, waitMs);\n };\n\n debounced.cancel = (): void => {\n if (timer !== null) {\n clearTimeout(timer);\n timer = null;\n }\n };\n\n return debounced;\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\n/** A throttled function — same signature as the original plus `cancel`. */\nexport type WrThrottledFn<TArgs extends readonly unknown[]> = ((...args: TArgs) => void) & {\n readonly cancel: () => void;\n};\n\n/**\n * Wrap `fn` so it fires at most once every `waitMs`. Leading-edge call\n * fires immediately; trailing-edge call fires once at the end of the window\n * if there were further invocations.\n */\nexport function throttle<TArgs extends readonly unknown[]>(\n fn: (...args: TArgs) => void,\n waitMs: number\n): WrThrottledFn<TArgs> {\n let lastInvoke = 0;\n let trailingTimer: ReturnType<typeof setTimeout> | null = null;\n let pendingArgs: TArgs | null = null;\n\n const throttled = (...args: TArgs): void => {\n const now = Date.now();\n const remaining = waitMs - (now - lastInvoke);\n\n if (remaining <= 0) {\n if (trailingTimer !== null) {\n clearTimeout(trailingTimer);\n trailingTimer = null;\n }\n lastInvoke = now;\n fn(...args);\n } else {\n pendingArgs = args;\n trailingTimer ??= setTimeout(() => {\n lastInvoke = Date.now();\n trailingTimer = null;\n if (pendingArgs) fn(...pendingArgs);\n pendingArgs = null;\n }, remaining);\n }\n };\n\n throttled.cancel = (): void => {\n if (trailingTimer !== null) {\n clearTimeout(trailingTimer);\n trailingTimer = null;\n }\n pendingArgs = null;\n lastInvoke = 0;\n };\n\n return throttled;\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\n/**\n * Canonical `KeyboardEvent.key` values for your own `keydown` handlers.\n *\n * The spec spellings are easy to get wrong — arrows are `ArrowUp`, space is a\n * literal `' '` — and a typo like `'Esacpe'` never matches and never errors.\n * These give you autocomplete and the {@link WrKey} union to match against.\n */\nexport const KEYS = {\n ENTER: 'Enter',\n ESCAPE: 'Escape',\n TAB: 'Tab',\n SPACE: ' ',\n BACKSPACE: 'Backspace',\n DELETE: 'Delete',\n ARROW_UP: 'ArrowUp',\n ARROW_DOWN: 'ArrowDown',\n ARROW_LEFT: 'ArrowLeft',\n ARROW_RIGHT: 'ArrowRight',\n HOME: 'Home',\n END: 'End',\n PAGE_UP: 'PageUp',\n PAGE_DOWN: 'PageDown',\n} as const;\n\nexport type WrKey = (typeof KEYS)[keyof typeof KEYS];\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\n/** True when any modifier key (Ctrl / Cmd / Alt / Shift / Meta) is held. */\nexport function hasModifier(event: KeyboardEvent): boolean {\n return event.ctrlKey || event.altKey || event.metaKey || event.shiftKey;\n}\n\n/**\n * True when the key is a single printable character (letters, digits,\n * punctuation, etc.). Skips function keys, arrows, modifiers, and named\n * keys like `Backspace` or `Tab`.\n */\nexport function isPrintableKey(event: KeyboardEvent): boolean {\n return event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey;\n}\n\n/**\n * True while an input method is composing — the key belongs to the IME, not to\n * your handler. **Return early on it in every `keydown` handler that reads\n * Enter, Escape or an arrow on, or above, a field that accepts typed text.**\n *\n * A Japanese or Chinese user reaches every character through a conversion. From\n * `compositionstart` until `compositionend` a candidate window is open, and\n * those keys are how it is driven: Enter accepts the candidate, Escape cancels\n * the conversion back to kana, the arrows walk the candidate list. A component\n * that acts on them anyway takes the key away from the IME mid-word — the\n * overlay closes instead of the candidate window, and the half-composed reading\n * the user was still choosing between is gone with it.\n *\n * Both halves of the test are needed. `isComposing` is the standard flag, but\n * Safari fires `compositionend` *before* the `keydown` of the Enter that commits\n * a candidate, so that one arrives with `isComposing === false` and only the\n * legacy `keyCode` of `229` — the sentinel every engine sets on a key it handed\n * to the input method — to say where it came from.\n *\n * `keydown` is the whole scope. It does NOT answer \"is a composition in\n * progress\" for an `input` or `blur` handler: on the committing keystroke the\n * two disagree by design. A component that needs the state *between* events\n * tracks it with the `compositionstart` / `compositionend` pair instead.\n *\n * ```ts\n * protected onKeydown(event: KeyboardEvent): void {\n * if (isComposing(event)) return;\n * // …\n * }\n * ```\n */\nexport function isComposing(event: KeyboardEvent): boolean {\n // `keyCode` is deprecated and stays anyway: it is the only signal Safari\n // leaves on the committing keystroke. See the doc comment above.\n return event.isComposing || event.keyCode === 229;\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\n/**\n * Logs a coloured pill to the browser console followed by a payload.\n *\n * Useful when you need to scan a noisy console for a specific subsystem's\n * messages. The pill is rendered with the CSS `%c` console formatting trick.\n *\n * @example\n * ```ts\n * badgeLog('icons', '#3969e2', { name: 'plus', registered: true });\n * // → [icons] { name: 'plus', registered: true }\n * ```\n *\n * @param badgeText Short label shown inside the pill.\n * @param color CSS colour applied to the pill border and text.\n * @param message Anything you'd pass to `console.log` as the second argument.\n *\n * @internal\n */\nexport function badgeLog(badgeText: string, color: string, message: unknown): void {\n const style = `\n display: inline-block;\n border: 1px solid ${color};\n color: ${color};\n padding: 1px 3px;\n border-radius: 4px;\n margin-right: 0\n `;\n // eslint-disable-next-line no-console -- this helper exists to log\n console.log(`%c${badgeText}`, style, message);\n}\n","// Types\nexport type { Maybe, SafeAny } from './interfaces';\n\n// Guards\nexport { isDefined, isNonEmptyArray, isObservable } from './guards';\n\n// Math\nexport { clamp, round } from './math';\n\n// Coercion\nexport { numAttr } from './coercion';\n\n// CSS value\nexport { isSafeCssValue } from './css-value';\n\n// CSS size\nexport { resolveCssSize } from './css-size';\nexport type { ResolveCssSizeOptions, ResolvedCssSize } from './css-size';\n\n// DOM\nexport { getRootFontSize, getFocusableElements, trapFocus } from './dom';\n\n// ID\nexport { randomId } from './id';\n\n// Fn\nexport { noop, debounce, throttle } from './fn';\nexport type { WrDebouncedFn, WrThrottledFn } from './fn';\n\n// Keyboard\nexport { KEYS, hasModifier, isComposing, isPrintableKey } from './keyboard';\nexport type { WrKey } from './keyboard';\n\n// Log\nexport { badgeLog } from './log';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["MAX_LENGTH"],"mappings":";;AAAA;;;;;AAKG;AAIH;;;;;;;;;;;;;;AAcG;AACG,SAAU,SAAS,CAAI,KAAe,EAAA;AAC1C,IAAA,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;AAC9C;;AC1BA;;;;;AAKG;AAIH;;;;;;;;;;;;AAYG;AACG,SAAU,eAAe,CAAI,KAAiB,EAAA;AAClD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;AACjD;;ACxBA;;;;;AAKG;AAIH;;;;;;;;;;;;AAYG;AACG,SAAU,YAAY,CAAc,KAAc,EAAA;IACtD,OAAO,CAAC,CAAC,KAAK,IAAI,OAAQ,KAAiC,CAAC,SAAS,KAAK,UAAU;AACtF;;ACxBA;;;;;;;;;AASG;SACa,KAAK,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAA;AAC3D,IAAA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC5C;;ACZA;;;;;;;;;;AAUG;SACa,KAAK,CAAC,KAAa,EAAE,QAAQ,GAAG,CAAC,EAAA;AAC/C,IAAA,MAAM,MAAM,GAAG,EAAE,IAAI,QAAQ;AAC7B,IAAA,OAAO,IAAI,CAAC,KAAK,CAA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AAC,CAAA,EAAA,EAAK,SAAS,CAAA,CAAE,EAAE,KAAK,EAAE,OAAO,CAAC;AAC/C;;ACjCA;;ACHA;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-validators.mjs","sources":["../../../projects/lib/validators/wr-validators.ts","../../../projects/lib/validators/ngwr-validators.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 { isDevMode } from '@angular/core';\nimport { type AbstractControl, type ValidationErrors, type ValidatorFn } from '@angular/forms';\n\nfunction stringValue(control: AbstractControl): string {\n const v: unknown = control.value;\n if (v == null) return '';\n if (typeof v === 'string') return v.trim();\n if (typeof v === 'number' || typeof v === 'boolean') return String(v).trim();\n return '';\n}\n\n/** Like {@link stringValue} but preserves whitespace — for checks that inspect spacing. */\nfunction rawStringValue(control: AbstractControl): string {\n const v: unknown = control.value;\n if (v == null) return '';\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n return '';\n}\n\n/** Luhn checksum. Returns true when the digit string is a valid card number. */\nfunction luhn(digits: string): boolean {\n let sum = 0;\n let dbl = false;\n for (let i = digits.length - 1; i >= 0; i--) {\n let d = digits.charCodeAt(i) - 48;\n if (dbl) {\n d *= 2;\n if (d > 9) d -= 9;\n }\n sum += d;\n dbl = !dbl;\n }\n return sum % 10 === 0;\n}\n\n/** ISO 13616 mod-97 check for IBANs. Returns the remainder; valid IBANs yield 1. */\nfunction mod97(iban: string): number {\n // Move first 4 chars to the end + convert letters to digits (A=10..Z=35).\n const rearranged = iban.slice(4) + iban.slice(0, 4);\n let expanded = '';\n for (let i = 0; i < rearranged.length; i++) {\n const code = rearranged.charCodeAt(i);\n if (code >= 65 && code <= 90) expanded += (code - 55).toString();\n else expanded += rearranged.charAt(i);\n }\n // Apply mod 97 in chunks — BigInt isn't necessary.\n let remainder = 0;\n for (let i = 0; i < expanded.length; i += 7) {\n const slice = remainder.toString() + expanded.substring(i, i + 7);\n remainder = Number.parseInt(slice, 10) % 97;\n }\n return remainder;\n}\n\nfunction toMs(value: unknown): number {\n if (value instanceof Date) return value.getTime();\n if (typeof value === 'string' || typeof value === 'number') return new Date(value).getTime();\n return Number.NaN;\n}\n\n/**\n * Bundled `ValidatorFn`s — pure functions, no DOM, no DI. (`matchFields` keeps\n * one bit of per-instance state, a latch so its dev-mode misconfiguration\n * warning fires once rather than on every validation run; it is never read as\n * part of the result.) Mirrors the API shape of Angular's built-in\n * `Validators` so it composes cleanly:\n *\n * ```ts\n * import { Validators } from '@angular/forms';\n * import { WrValidators } from 'ngwr/validators';\n *\n * new FormControl('', [\n * Validators.required,\n * WrValidators.cardNumber,\n * WrValidators.cvc(3),\n * WrValidators.match('password'),\n * WrValidators.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),\n * ]);\n * ```\n *\n * Each error is keyed under the validator name (e.g. `cardNumber`,\n * `cvc`, `iban`) so consumers can branch in templates.\n *\n * Anything Angular already ships (`required`, `email`, `min`, `max`,\n * `pattern`, …) is deliberately NOT duplicated here.\n *\n * @see https://ngwr.dev/reference/validators\n */\nexport const WrValidators = {\n // String shape\n\n /** No whitespace anywhere in the value. */\n noWhitespace: (control: AbstractControl): ValidationErrors | null => {\n const v = rawStringValue(control);\n if (v === '') return null;\n return /\\s/.test(v) ? { noWhitespace: true } : null;\n },\n\n /** 3, 4, 6, or 8-digit hex colour (`#abc`, `#1a2b3c`, `#1a2b3c4d`). */\n hexColor: (control: AbstractControl): ValidationErrors | null => {\n const v = stringValue(control);\n if (v === '') return null;\n return /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(v) ? null : { hexColor: true };\n },\n\n // Network / payments\n\n /**\n * Valid URL. Accepts any scheme by default; pass `{ protocols: ['https'] }`\n * to restrict. A scheme is required by default; pass `{ requireProtocol: false }`\n * to also accept bare domains (e.g. `ngwr.dev`), assuming `https`.\n */\n url: (options: { readonly protocols?: readonly string[]; readonly requireProtocol?: boolean } = {}): ValidatorFn => {\n const allow = options.protocols?.map(p => p.replace(/:$/, '').toLowerCase());\n const requireProtocol = options.requireProtocol ?? true;\n return (control: AbstractControl): ValidationErrors | null => {\n const v = stringValue(control);\n if (v === '') return null;\n let parsed: URL;\n try {\n parsed = new URL(v);\n } catch {\n // Bare domain support: when protocols aren't required and the input has\n // no scheme, retry assuming `https://`.\n if (!requireProtocol && !/^[a-z][a-z0-9+.-]*:/i.test(v)) {\n let retried: URL;\n try {\n retried = new URL(`https://${v}`);\n } catch {\n return { url: true };\n }\n // Unreachable, and kept as a guard rather than deleted. `https` is a\n // WHATWG \"special\" scheme, which may not have an empty host, so\n // `new URL('https://' + v)` either threw above or produced one —\n // there is no `v` that lands here (checked by brute force over\n // two-character ASCII as well as by the spec). It stays because the\n // line above is the only thing making that true, and a future retry\n // through a non-special scheme would need it back.\n if (retried.host === '') {\n return { url: true };\n }\n if (allow && !allow.includes('https')) {\n return { url: { allowed: allow } };\n }\n return null;\n }\n return { url: true };\n }\n const protocol = parsed.protocol.replace(/:$/, '').toLowerCase();\n // WHATWG auto-inserts the authority for \"special\" schemes, so `http:host`\n // (missing `//`) still parses. Require the explicit `//` for those.\n const needsAuthority = ['http', 'https', 'ws', 'wss', 'ftp', 'file'].includes(protocol);\n if (needsAuthority && !/^[a-z][a-z0-9+.-]*:\\/\\//i.test(v)) {\n return { url: true };\n }\n if (allow && !allow.includes(protocol)) {\n return { url: { allowed: allow } };\n }\n return null;\n };\n },\n\n /** Credit card number — Luhn check + 13-19 digit length. Spaces and dashes are stripped first. */\n cardNumber: (control: AbstractControl): ValidationErrors | null => {\n const raw = stringValue(control).replace(/[\\s-]/g, '');\n if (raw === '') return null;\n if (!/^\\d{13,19}$/.test(raw)) return { cardNumber: true };\n return luhn(raw) ? null : { cardNumber: true };\n },\n\n /** CVC / CVV — N digits (default 3). Common: 3 for Visa/MC, 4 for Amex. */\n cvc: (length = 3): ValidatorFn => {\n const re = new RegExp(`^\\\\d{${length}}$`);\n return (control: AbstractControl): ValidationErrors | null => {\n const v = stringValue(control);\n if (v === '') return null;\n return re.test(v) ? null : { cvc: { length } };\n };\n },\n\n /**\n * IBAN — basic structure (CC + 2 digits + up to 30 alphanumerics) +\n * the mod-97 check. Country-length tables not enforced.\n */\n iban: (control: AbstractControl): ValidationErrors | null => {\n const raw = stringValue(control).replace(/\\s/g, '').toUpperCase();\n if (raw === '') return null;\n if (!/^[A-Z]{2}\\d{2}[A-Z0-9]{4,30}$/.test(raw)) return { iban: true };\n return mod97(raw) === 1 ? null : { iban: true };\n },\n\n // Cross-field\n\n /**\n * Value must equal a sibling control's value (e.g. confirm-password).\n * The target lookup uses `control.parent.get(name)`, so it works\n * inside `FormGroup` and nested groups.\n *\n * **It cannot report a mismatch until something revalidates the control.**\n * Angular runs a control's validators inside the control's own constructor,\n * before the control has a parent — so the lookup finds nothing and this\n * returns `null`, and attaching the control to a group does not re-run it.\n *\n * `formControlName` revalidates when it binds, so a group rendered through\n * the reactive-forms directives corrects itself on its first change\n * detection. The window is open for everything that reads validity BEFORE\n * that: a route guard or resolver checking `form.valid`, a form built and\n * submitted from a service, a unit test. Such a group reports itself valid\n * with two values that plainly disagree.\n *\n * Put {@link WrValidators.matchFields} on the group to close it, and keep\n * this one on the child for the per-field message. They do not conflict —\n * different error keys, different hosts.\n *\n * @see WrValidators.matchFields\n */\n match: (targetName: string): ValidatorFn => {\n return (control: AbstractControl): ValidationErrors | null => {\n const target = control.parent?.get(targetName);\n if (!target) return null;\n return control.value === target.value ? null : { match: { target: targetName } };\n };\n },\n\n /**\n * Every named control must hold the same value — the group-level counterpart\n * to {@link WrValidators.match}. Attach it to the group that OWNS the fields,\n * not to one of its children.\n *\n * Unlike `match` this has no ordering hole: Angular attaches the children and\n * aggregates their values BEFORE it runs the group's own validators, so a\n * group built from a record whose fields already disagree is invalid the\n * moment it exists — no revalidation step, and nothing that depends on the\n * form having been rendered.\n *\n * Names are `AbstractControl.get()` paths, so `'billing.zip'` reaches into a\n * nested group. `null`, `undefined` and `''` all count as the same empty\n * value; everything else is compared with `===`, so two equal `Date`s are NOT\n * equal — compare a derived primitive instead. **Disabled controls are\n * skipped**, which makes the rule compare exactly what `group.value`\n * contains, and the error names only the controls it actually compared.\n *\n * A name that resolves to nothing, or to a group or an array rather than a\n * leaf control, turns the whole check off and warns once per validator\n * instance in dev — never a partial comparison of the names that did\n * resolve, and never an error the user has no way to satisfy.\n *\n * The error lands on the GROUP, and `<wr-form-field>` only reads the one\n * control projected into it — so pair this with `match` for a per-field\n * message, or render it yourself from `form.hasError('matchFields')`.\n *\n * @example\n * ```ts\n * new FormGroup(\n * {\n * password: new FormControl(''),\n * confirm: new FormControl('', [WrValidators.match('password')]),\n * },\n * { validators: [WrValidators.matchFields('password', 'confirm')] },\n * );\n * ```\n */\n matchFields: (first: string, second: string, ...rest: readonly string[]): ValidatorFn => {\n // Frozen because the payload hands these names out: a consumer who mutated\n // the array would be editing the validator's own configuration, and a\n // `push` of a name that resolves to nothing switches the check OFF — the\n // form then goes valid with two values that plainly disagree.\n const fields: readonly string[] = Object.freeze([first, second, ...rest]);\n\n // Per-instance, never module-level: a shared latch is process-wide state\n // under SSR, where one request's warning would silence every later one.\n let warned = false;\n\n const warn = (message: string): void => {\n if (!isDevMode() || warned) return;\n warned = true;\n // `warn`, not `error`: a prerender worker forwards app console errors as\n // `ERROR …` and `scripts/build-showcase-app.ts` fails the build on them —\n // and adding the control later is a legitimate pattern, not a red build.\n // Reported rather than thrown for the same reason.\n // eslint-disable-next-line no-console -- a silent pass is the very bug this validator removes\n console.warn(`[NGWR] matchFields: ${message} — the check did not run.`);\n };\n\n return (group: AbstractControl): ValidationErrors | null => {\n const compared: string[] = [];\n const values: unknown[] = [];\n\n for (const name of fields) {\n const found = group.get(name);\n if (!found) {\n warn(`no control at \"${name}\". Names are AbstractControl.get() paths, relative to this group`);\n return null;\n }\n\n // A group or an array RESOLVES, so it slips past the check above and\n // would then be compared by reference against another container —\n // never equal, whatever the user types. `'billing'` instead of\n // `'billing.zip'` is the easy mistake, and it makes a form that can\n // never be submitted and says nothing about why.\n if ('controls' in found) {\n warn(`\"${name}\" is a group or an array; name a leaf control, e.g. \"${name}.<field>\"`);\n return null;\n }\n\n // A disabled control is absent from `group.value` and its own\n // validators do not run; blocking a form on a value the user cannot\n // edit is not a rule anyone can satisfy.\n if (found.disabled) continue;\n\n compared.push(name);\n values.push((found.value as unknown) ?? '');\n }\n\n if (values.length < 2) return null;\n // A fresh array, and only the names that actually took part: naming a\n // disabled control would point the reader at something they cannot edit.\n // No control VALUES — this guards passwords, and error objects reach the\n // DOM, logs and error reporters.\n return values.every(v => v === values[0]) ? null : { matchFields: { fields: [...compared] } };\n };\n },\n\n // Choice\n\n /** Value must be one of the allowed entries (strict equality). */\n oneOf: <T>(allowed: readonly T[]): ValidatorFn => {\n return (control: AbstractControl): ValidationErrors | null => {\n const v = control.value as T;\n if (v == null || (v as unknown) === '') return null;\n return allowed.includes(v) ? null : { oneOf: { allowed } };\n };\n },\n\n // Date bounds\n\n /** Value (Date | parseable) must be ≥ `min`. */\n minDate: (min: Date | string | number): ValidatorFn => {\n const minMs = toMs(min);\n return (control: AbstractControl): ValidationErrors | null => {\n const v: unknown = control.value;\n if (v == null || v === '') return null;\n const got = toMs(v);\n if (Number.isNaN(got)) return { minDate: { min } };\n return got >= minMs ? null : { minDate: { min } };\n };\n },\n\n /** Value (Date | parseable) must be ≤ `max`. */\n maxDate: (max: Date | string | number): ValidatorFn => {\n const maxMs = toMs(max);\n return (control: AbstractControl): ValidationErrors | null => {\n const v: unknown = control.value;\n if (v == null || v === '') return null;\n const got = toMs(v);\n if (Number.isNaN(got)) return { maxDate: { max } };\n return got <= maxMs ? null : { maxDate: { max } };\n };\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAKH,SAAS,WAAW,C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AAC;AACnB,YAAA,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAAE,gBAAA,OAAO,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE;AAClD,YAAA,OAAO,GAAG,IAAI,KAAK,GAAG,IAAI,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE;AACnD,QAAA,CAAC;IACH,CAAC;;AAGD,IAAA,OAAO,EAAE,CAAC,GAA2B,KAAiB;AACpD,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC;QACvB,OAAO,CAAC,OAAwB,KAA6B;AAC3D,YAAA,MAAM,CAAC,GAAY,OAAO,CAAC,KAAK;AAChC,YAAA,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE;AAAE,gBAAA,OAAO,IAAI;AACtC,YAAA,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;AACnB,YAAA,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAAE,gBAAA,OAAO,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE;AAClD,YAAA,OAAO,GAAG,IAAI,KAAK,GAAG,IAAI,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE;AACnD,QAAA,CAAC;IACH,CAAC;;;AC9WH;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-validators.mjs","sources":["../../../projects/lib/validators/wr-validators.ts","../../../projects/lib/validators/ngwr-validators.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 { isDevMode } from '@angular/core';\nimport { type AbstractControl, type ValidationErrors, type ValidatorFn } from '@angular/forms';\n\nfunction stringValue(control: AbstractControl): string {\n const v: unknown = control.value;\n if (v == null) return '';\n if (typeof v === 'string') return v.trim();\n if (typeof v === 'number' || typeof v === 'boolean') return String(v).trim();\n return '';\n}\n\n/** Like {@link stringValue} but preserves whitespace — for checks that inspect spacing. */\nfunction rawStringValue(control: AbstractControl): string {\n const v: unknown = control.value;\n if (v == null) return '';\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n return '';\n}\n\n/** Luhn checksum. Returns true when the digit string is a valid card number. */\nfunction luhn(digits: string): boolean {\n let sum = 0;\n let dbl = false;\n for (let i = digits.length - 1; i >= 0; i--) {\n let d = digits.charCodeAt(i) - 48;\n if (dbl) {\n d *= 2;\n if (d > 9) d -= 9;\n }\n sum += d;\n dbl = !dbl;\n }\n return sum % 10 === 0;\n}\n\n/** ISO 13616 mod-97 check for IBANs. Returns the remainder; valid IBANs yield 1. */\nfunction mod97(iban: string): number {\n // Move first 4 chars to the end + convert letters to digits (A=10..Z=35).\n const rearranged = iban.slice(4) + iban.slice(0, 4);\n let expanded = '';\n for (let i = 0; i < rearranged.length; i++) {\n const code = rearranged.charCodeAt(i);\n if (code >= 65 && code <= 90) expanded += (code - 55).toString();\n else expanded += rearranged.charAt(i);\n }\n // Apply mod 97 in chunks — BigInt isn't necessary.\n let remainder = 0;\n for (let i = 0; i < expanded.length; i += 7) {\n const slice = remainder.toString() + expanded.substring(i, i + 7);\n remainder = Number.parseInt(slice, 10) % 97;\n }\n return remainder;\n}\n\nfunction toMs(value: unknown): number {\n if (value instanceof Date) return value.getTime();\n if (typeof value === 'string' || typeof value === 'number') return new Date(value).getTime();\n return Number.NaN;\n}\n\n/**\n * Bundled `ValidatorFn`s — pure functions, no DOM, no DI. (`matchFields` keeps\n * one bit of per-instance state, a latch so its dev-mode misconfiguration\n * warning fires once rather than on every validation run; it is never read as\n * part of the result.) Mirrors the API shape of Angular's built-in\n * `Validators` so it composes cleanly:\n *\n * ```ts\n * import { Validators } from '@angular/forms';\n * import { WrValidators } from 'ngwr/validators';\n *\n * new FormControl('', [\n * Validators.required,\n * WrValidators.cardNumber,\n * WrValidators.cvc(3),\n * WrValidators.match('password'),\n * WrValidators.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),\n * ]);\n * ```\n *\n * Each error is keyed under the validator name (e.g. `cardNumber`,\n * `cvc`, `iban`) so consumers can branch in templates.\n *\n * Anything Angular already ships (`required`, `email`, `min`, `max`,\n * `pattern`, …) is deliberately NOT duplicated here.\n *\n * @see https://ngwr.dev/reference/validators\n */\nexport const WrValidators = {\n // String shape\n\n /** No whitespace anywhere in the value. */\n noWhitespace: (control: AbstractControl): ValidationErrors | null => {\n const v = rawStringValue(control);\n if (v === '') return null;\n return /\\s/.test(v) ? { noWhitespace: true } : null;\n },\n\n /** 3, 4, 6, or 8-digit hex colour (`#abc`, `#1a2b3c`, `#1a2b3c4d`). */\n hexColor: (control: AbstractControl): ValidationErrors | null => {\n const v = stringValue(control);\n if (v === '') return null;\n return /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(v) ? null : { hexColor: true };\n },\n\n // Network / payments\n\n /**\n * Valid URL. Accepts any scheme by default; pass `{ protocols: ['https'] }`\n * to restrict. A scheme is required by default; pass `{ requireProtocol: false }`\n * to also accept bare domains (e.g. `ngwr.dev`), assuming `https`.\n */\n url: (options: { readonly protocols?: readonly string[]; readonly requireProtocol?: boolean } = {}): ValidatorFn => {\n const allow = options.protocols?.map(p => p.replace(/:$/, '').toLowerCase());\n const requireProtocol = options.requireProtocol ?? true;\n return (control: AbstractControl): ValidationErrors | null => {\n const v = stringValue(control);\n if (v === '') return null;\n let parsed: URL;\n try {\n parsed = new URL(v);\n } catch {\n // Bare domain support: when protocols aren't required and the input has\n // no scheme, retry assuming `https://`.\n if (!requireProtocol && !/^[a-z][a-z0-9+.-]*:/i.test(v)) {\n let retried: URL;\n try {\n retried = new URL(`https://${v}`);\n } catch {\n return { url: true };\n }\n // Unreachable, and kept as a guard rather than deleted. `https` is a\n // WHATWG \"special\" scheme, which may not have an empty host, so\n // `new URL('https://' + v)` either threw above or produced one —\n // there is no `v` that lands here (checked by brute force over\n // two-character ASCII as well as by the spec). It stays because the\n // line above is the only thing making that true, and a future retry\n // through a non-special scheme would need it back.\n if (retried.host === '') {\n return { url: true };\n }\n if (allow && !allow.includes('https')) {\n return { url: { allowed: allow } };\n }\n return null;\n }\n return { url: true };\n }\n const protocol = parsed.protocol.replace(/:$/, '').toLowerCase();\n // WHATWG auto-inserts the authority for \"special\" schemes, so `http:host`\n // (missing `//`) still parses. Require the explicit `//` for those.\n const needsAuthority = ['http', 'https', 'ws', 'wss', 'ftp', 'file'].includes(protocol);\n if (needsAuthority && !/^[a-z][a-z0-9+.-]*:\\/\\//i.test(v)) {\n return { url: true };\n }\n if (allow && !allow.includes(protocol)) {\n return { url: { allowed: allow } };\n }\n return null;\n };\n },\n\n /** Credit card number — Luhn check + 13-19 digit length. Spaces and dashes are stripped first. */\n cardNumber: (control: AbstractControl): ValidationErrors | null => {\n const raw = stringValue(control).replace(/[\\s-]/g, '');\n if (raw === '') return null;\n if (!/^\\d{13,19}$/.test(raw)) return { cardNumber: true };\n return luhn(raw) ? null : { cardNumber: true };\n },\n\n /** CVC / CVV — N digits (default 3). Common: 3 for Visa/MC, 4 for Amex. */\n cvc: (length = 3): ValidatorFn => {\n const re = new RegExp(`^\\\\d{${length}}$`);\n return (control: AbstractControl): ValidationErrors | null => {\n const v = stringValue(control);\n if (v === '') return null;\n return re.test(v) ? null : { cvc: { length } };\n };\n },\n\n /**\n * IBAN — basic structure (CC + 2 digits + up to 30 alphanumerics) +\n * the mod-97 check. Country-length tables not enforced.\n */\n iban: (control: AbstractControl): ValidationErrors | null => {\n const raw = stringValue(control).replace(/\\s/g, '').toUpperCase();\n if (raw === '') return null;\n if (!/^[A-Z]{2}\\d{2}[A-Z0-9]{4,30}$/.test(raw)) return { iban: true };\n return mod97(raw) === 1 ? null : { iban: true };\n },\n\n // Cross-field\n\n /**\n * Value must equal a sibling control's value (e.g. confirm-password).\n * The target lookup uses `control.parent.get(name)`, so it works\n * inside `FormGroup` and nested groups.\n *\n * **It cannot report a mismatch until something revalidates the control.**\n * Angular runs a control's validators inside the control's own constructor,\n * before the control has a parent — so the lookup finds nothing and this\n * returns `null`, and attaching the control to a group does not re-run it.\n *\n * `formControlName` revalidates when it binds, so a group rendered through\n * the reactive-forms directives corrects itself on its first change\n * detection. The window is open for everything that reads validity BEFORE\n * that: a route guard or resolver checking `form.valid`, a form built and\n * submitted from a service, a unit test. Such a group reports itself valid\n * with two values that plainly disagree.\n *\n * Put {@link WrValidators.matchFields} on the group to close it, and keep\n * this one on the child for the per-field message. They do not conflict —\n * different error keys, different hosts.\n *\n * @see WrValidators.matchFields\n */\n match: (targetName: string): ValidatorFn => {\n return (control: AbstractControl): ValidationErrors | null => {\n const target = control.parent?.get(targetName);\n if (!target) return null;\n return control.value === target.value ? null : { match: { target: targetName } };\n };\n },\n\n /**\n * Every named control must hold the same value — the group-level counterpart\n * to {@link WrValidators.match}. Attach it to the group that OWNS the fields,\n * not to one of its children.\n *\n * Unlike `match` this has no ordering hole: Angular attaches the children and\n * aggregates their values BEFORE it runs the group's own validators, so a\n * group built from a record whose fields already disagree is invalid the\n * moment it exists — no revalidation step, and nothing that depends on the\n * form having been rendered.\n *\n * Names are `AbstractControl.get()` paths, so `'billing.zip'` reaches into a\n * nested group. `null`, `undefined` and `''` all count as the same empty\n * value; everything else is compared with `===`, so two equal `Date`s are NOT\n * equal — compare a derived primitive instead. **Disabled controls are\n * skipped**, which makes the rule compare exactly what `group.value`\n * contains, and the error names only the controls it actually compared.\n *\n * A name that resolves to nothing, or to a group or an array rather than a\n * leaf control, turns the whole check off and warns once per validator\n * instance in dev — never a partial comparison of the names that did\n * resolve, and never an error the user has no way to satisfy.\n *\n * The error lands on the GROUP, and `<wr-form-field>` only reads the one\n * control projected into it — so pair this with `match` for a per-field\n * message, or render it yourself from `form.hasError('matchFields')`.\n *\n * @example\n * ```ts\n * new FormGroup(\n * {\n * password: new FormControl(''),\n * confirm: new FormControl('', [WrValidators.match('password')]),\n * },\n * { validators: [WrValidators.matchFields('password', 'confirm')] },\n * );\n * ```\n */\n matchFields: (first: string, second: string, ...rest: readonly string[]): ValidatorFn => {\n // Frozen because the payload hands these names out: a consumer who mutated\n // the array would be editing the validator's own configuration, and a\n // `push` of a name that resolves to nothing switches the check OFF — the\n // form then goes valid with two values that plainly disagree.\n const fields: readonly string[] = Object.freeze([first, second, ...rest]);\n\n // Per-instance, never module-level: a shared latch is process-wide state\n // under SSR, where one request's warning would silence every later one.\n let warned = false;\n\n const warn = (message: string): void => {\n if (!isDevMode() || warned) return;\n warned = true;\n // `warn`, not `error`: a prerender worker forwards app console errors as\n // `ERROR …` and `scripts/build-showcase-app.ts` fails the build on them —\n // and adding the control later is a legitimate pattern, not a red build.\n // Reported rather than thrown for the same reason.\n // eslint-disable-next-line no-console -- a silent pass is the very bug this validator removes\n console.warn(`[NGWR] matchFields: ${message} — the check did not run.`);\n };\n\n return (group: AbstractControl): ValidationErrors | null => {\n const compared: string[] = [];\n const values: unknown[] = [];\n\n for (const name of fields) {\n const found = group.get(name);\n if (!found) {\n warn(`no control at \"${name}\". Names are AbstractControl.get() paths, relative to this group`);\n return null;\n }\n\n // A group or an array RESOLVES, so it slips past the check above and\n // would then be compared by reference against another container —\n // never equal, whatever the user types. `'billing'` instead of\n // `'billing.zip'` is the easy mistake, and it makes a form that can\n // never be submitted and says nothing about why.\n if ('controls' in found) {\n warn(`\"${name}\" is a group or an array; name a leaf control, e.g. \"${name}.<field>\"`);\n return null;\n }\n\n // A disabled control is absent from `group.value` and its own\n // validators do not run; blocking a form on a value the user cannot\n // edit is not a rule anyone can satisfy.\n if (found.disabled) continue;\n\n compared.push(name);\n values.push((found.value as unknown) ?? '');\n }\n\n if (values.length < 2) return null;\n // A fresh array, and only the names that actually took part: naming a\n // disabled control would point the reader at something they cannot edit.\n // No control VALUES — this guards passwords, and error objects reach the\n // DOM, logs and error reporters.\n return values.every(v => v === values[0]) ? null : { matchFields: { fields: [...compared] } };\n };\n },\n\n // Choice\n\n /** Value must be one of the allowed entries (strict equality). */\n oneOf: <T>(allowed: readonly T[]): ValidatorFn => {\n return (control: AbstractControl): ValidationErrors | null => {\n const v = control.value as T;\n if (v == null || (v as unknown) === '') return null;\n return allowed.includes(v) ? null : { oneOf: { allowed } };\n };\n },\n\n // Date bounds\n\n /** Value (Date | parseable) must be ≥ `min`. */\n minDate: (min: Date | string | number): ValidatorFn => {\n const minMs = toMs(min);\n return (control: AbstractControl): ValidationErrors | null => {\n const v: unknown = control.value;\n if (v == null || v === '') return null;\n const got = toMs(v);\n if (Number.isNaN(got)) return { minDate: { min } };\n return got >= minMs ? null : { minDate: { min } };\n };\n },\n\n /** Value (Date | parseable) must be ≤ `max`. */\n maxDate: (max: Date | string | number): ValidatorFn => {\n const maxMs = toMs(max);\n return (control: AbstractControl): ValidationErrors | null => {\n const v: unknown = control.value;\n if (v == null || v === '') return null;\n const got = toMs(v);\n if (Number.isNaN(got)) return { maxDate: { max } };\n return got <= maxMs ? null : { maxDate: { max } };\n };\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAKH,SAAS,WAAW,CAAC,OAAwB,EAAA;AAC3C,IAAA,MAAM,CAAC,GAAY,OAAO,CAAC,KAAK;IAChC,IAAI,CAAC,IAAI,IAAI;AAAE,QAAA,OAAO,EAAE;IACxB,IAAI,OAAO,CAAC,KAAK,QAAQ;AAAE,QAAA,OAAO,CAAC,CAAC,IAAI,EAAE;IAC1C,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,SAAS;AAAE,QAAA,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;AAC5E,IAAA,OAAO,EAAE;AACX;AAEA;AACA,SAAS,cAAc,CAAC,OAAwB,EAAA;AAC9C,IAAA,MAAM,CAAC,GAAY,OAAO,CAAC,KAAK;IAChC,IAAI,CAAC,IAAI,IAAI;AAAE,QAAA,OAAO,EAAE;IACxB,IAAI,OA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AAA,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC;AACnB,YAAA,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;AAAE,gBAAA,OAAO,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE;AAClD,YAAA,OAAO,GAAG,IAAI,KAAK,GAAG,IAAI,GAAG,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,EAAE;AACnD,QAAA,CAAC;IACH,CAAC;;;AC9WH;;AAEG;;"}
@@ -16,7 +16,7 @@ import { InjectionToken } from '@angular/core';
16
16
  * Distinct from `Version` exported by `@angular/core`, which reports the
17
17
  * loaded Angular runtime version (e.g. `'22.0.0'`), not ngwr's.
18
18
  */
19
- const NGWR_VERSION = '14.7.0';
19
+ const NGWR_VERSION = '14.9.0';
20
20
 
21
21
  /**
22
22
  * @license
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-version.mjs","sources":["../../../projects/lib/version/version.ts","../../../projects/lib/version/version.token.ts","../../../projects/lib/version/ngwr-version.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\n/**\n * The ngwr library version string, kept in sync with\n * `projects/lib/package.json` by `scripts/release-prepare.ts`.\n *\n * Prefer this over reading `package.json` at runtime — that requires a JSON\n * import or `require`, neither of which tree-shakes well in Angular builds.\n *\n * Distinct from `Version` exported by `@angular/core`, which reports the\n * loaded Angular runtime version (e.g. `'22.0.0'`), not ngwr's.\n */\nexport const NGWR_VERSION = '14.7.0';\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 { InjectionToken } from '@angular/core';\n\nimport { NGWR_VERSION } from './version';\n\n/**\n * Injection token holding the ngwr library version string.\n *\n * Default factory returns {@link NGWR_VERSION}. Override it in tests or in\n * apps that want to surface a custom build identifier.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class FooterComponent {\n * readonly version = inject(NGWR_VERSION_TOKEN);\n * }\n * ```\n */\nexport const NGWR_VERSION_TOKEN = new InjectionToken<string>('NGWR_VERSION_TOKEN', {\n providedIn: 'root',\n factory: () => NGWR_VERSION,\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAEH;;;;;;;;;AASG;AACI,MAAM,YAAY,GAAG;;ACjB5B;;;;;AAKG;AAMH;;;;;;;;;;;;;AAaG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAAS,oBAAoB,EAAE;AACjF,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,YAAY;AAC5B,CAAA;;AC5BD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-version.mjs","sources":["../../../projects/lib/version/version.ts","../../../projects/lib/version/version.token.ts","../../../projects/lib/version/ngwr-version.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\n/**\n * The ngwr library version string, kept in sync with\n * `projects/lib/package.json` by `scripts/release-prepare.ts`.\n *\n * Prefer this over reading `package.json` at runtime — that requires a JSON\n * import or `require`, neither of which tree-shakes well in Angular builds.\n *\n * Distinct from `Version` exported by `@angular/core`, which reports the\n * loaded Angular runtime version (e.g. `'22.0.0'`), not ngwr's.\n */\nexport const NGWR_VERSION = '14.9.0';\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 { InjectionToken } from '@angular/core';\n\nimport { NGWR_VERSION } from './version';\n\n/**\n * Injection token holding the ngwr library version string.\n *\n * Default factory returns {@link NGWR_VERSION}. Override it in tests or in\n * apps that want to surface a custom build identifier.\n *\n * @example\n * ```ts\n * @Component({...})\n * export class FooterComponent {\n * readonly version = inject(NGWR_VERSION_TOKEN);\n * }\n * ```\n */\nexport const NGWR_VERSION_TOKEN = new InjectionToken<string>('NGWR_VERSION_TOKEN', {\n providedIn: 'root',\n factory: () => NGWR_VERSION,\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAEH;;;;;;;;;AASG;AACI,MAAM,YAAY,GAAG;;ACjB5B;;;;;AAKG;AAMH;;;;;;;;;;;;;AAaG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAAS,oBAAoB,EAAE;AACjF,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,YAAY;AAC5B,CAAA;;AC5BD;;AAEG;;"}
@@ -111,10 +111,10 @@ class WrVirtualScroll {
111
111
  checkViewportSize() {
112
112
  this.viewport().checkViewportSize();
113
113
  }
114
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrVirtualScroll, deps: [], target: i0.ɵɵFactoryTarget.Component });
115
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: WrVirtualScroll, isStandalone: true, selector: "wr-virtual-scroll", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, minBufferPx: { classPropertyName: "minBufferPx", publicName: "minBufferPx", isSignal: true, isRequired: false, transformFunction: null }, maxBufferPx: { classPropertyName: "maxBufferPx", publicName: "maxBufferPx", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-virtual-scroll" }, queries: [{ propertyName: "rowTemplate", first: true, predicate: (TemplateRef), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], ngImport: i0, template: "<cdk-virtual-scroll-viewport\n class=\"wr-virtual-scroll__viewport\"\n [itemSize]=\"itemSize()\"\n [minBufferPx]=\"resolvedMinBuffer()\"\n [maxBufferPx]=\"resolvedMaxBuffer()\"\n [style.height]=\"resolvedHeight()\"\n>\n <ng-container *cdkVirtualFor=\"let item of items(); let i = index; trackBy: trackBy()\">\n <ng-container *ngTemplateOutlet=\"rowTemplate(); context: { $implicit: item, index: i }\" />\n </ng-container>\n</cdk-virtual-scroll-viewport>\n", styles: [".wr-virtual-scroll{display:block;width:100%;overflow:hidden}.wr-virtual-scroll__viewport{width:100%;height:100%;scrollbar-width:thin}.wr-virtual-scroll__viewport::-webkit-scrollbar{width:.5rem;height:.5rem}.wr-virtual-scroll__viewport::-webkit-scrollbar-thumb{background:rgba(var(--wr-color-on-surface-rgb),.2);border-radius:999px}\n"], dependencies: [{ kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None });
114
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrVirtualScroll, deps: [], target: i0.ɵɵFactoryTarget.Component });
115
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: WrVirtualScroll, isStandalone: true, selector: "wr-virtual-scroll", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, itemSize: { classPropertyName: "itemSize", publicName: "itemSize", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, minBufferPx: { classPropertyName: "minBufferPx", publicName: "minBufferPx", isSignal: true, isRequired: false, transformFunction: null }, maxBufferPx: { classPropertyName: "maxBufferPx", publicName: "maxBufferPx", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "wr-virtual-scroll" }, queries: [{ propertyName: "rowTemplate", first: true, predicate: (TemplateRef), descendants: true, isSignal: true }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, isSignal: true }], ngImport: i0, template: "<cdk-virtual-scroll-viewport\n class=\"wr-virtual-scroll__viewport\"\n [itemSize]=\"itemSize()\"\n [minBufferPx]=\"resolvedMinBuffer()\"\n [maxBufferPx]=\"resolvedMaxBuffer()\"\n [style.height]=\"resolvedHeight()\"\n>\n <ng-container *cdkVirtualFor=\"let item of items(); let i = index; trackBy: trackBy()\">\n <ng-container *ngTemplateOutlet=\"rowTemplate(); context: { $implicit: item, index: i }\" />\n </ng-container>\n</cdk-virtual-scroll-viewport>\n", styles: [".wr-virtual-scroll{display:block;width:100%;overflow:hidden}.wr-virtual-scroll__viewport{width:100%;height:100%;scrollbar-width:thin}.wr-virtual-scroll__viewport::-webkit-scrollbar{width:.5rem;height:.5rem}.wr-virtual-scroll__viewport::-webkit-scrollbar-thumb{background:rgba(var(--wr-color-on-surface-rgb),.2);border-radius:999px}\n"], dependencies: [{ kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], encapsulation: i0.ViewEncapsulation.None });
116
116
  }
117
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrVirtualScroll, decorators: [{
117
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrVirtualScroll, decorators: [{
118
118
  type: Component,
119
119
  args: [{ selector: 'wr-virtual-scroll', encapsulation: ViewEncapsulation.None, imports: [ScrollingModule, NgTemplateOutlet], host: { class: 'wr-virtual-scroll' }, template: "<cdk-virtual-scroll-viewport\n class=\"wr-virtual-scroll__viewport\"\n [itemSize]=\"itemSize()\"\n [minBufferPx]=\"resolvedMinBuffer()\"\n [maxBufferPx]=\"resolvedMaxBuffer()\"\n [style.height]=\"resolvedHeight()\"\n>\n <ng-container *cdkVirtualFor=\"let item of items(); let i = index; trackBy: trackBy()\">\n <ng-container *ngTemplateOutlet=\"rowTemplate(); context: { $implicit: item, index: i }\" />\n </ng-container>\n</cdk-virtual-scroll-viewport>\n", styles: [".wr-virtual-scroll{display:block;width:100%;overflow:hidden}.wr-virtual-scroll__viewport{width:100%;height:100%;scrollbar-width:thin}.wr-virtual-scroll__viewport::-webkit-scrollbar{width:.5rem;height:.5rem}.wr-virtual-scroll__viewport::-webkit-scrollbar-thumb{background:rgba(var(--wr-color-on-surface-rgb),.2);border-radius:999px}\n"] }]
120
120
  }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], itemSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemSize", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], minBufferPx: [{ type: i0.Input, args: [{ isSignal: true, alias: "minBufferPx", required: false }] }], maxBufferPx: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxBufferPx", required: false }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], rowTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => TemplateRef), { isSignal: true }] }], viewport: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkVirtualScrollViewport), { isSignal: true }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-virtual-scroll.mjs","sources":["../../../projects/lib/virtual-scroll/virtual-scroll.ts","../../../projects/lib/virtual-scroll/virtual-scroll.html","../../../projects/lib/virtual-scroll/ngwr-virtual-scroll.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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n TemplateRef,\n type TrackByFunction,\n ViewEncapsulation,\n computed,\n contentChild,\n input,\n viewChild,\n} from '@angular/core';\n\n/**\n * Fixed-size virtual scroll viewport.\n *\n * Thin wrapper around CDK's `cdk-virtual-scroll-viewport` with ngwr\n * theming and sensible buffer defaults. Project a single template — it's\n * called per item with `let-item let-index=\"index\"`.\n *\n * @example\n * ```html\n * <wr-virtual-scroll [items]=\"rows\" [itemSize]=\"32\" [height]=\"320\">\n * <ng-template let-row let-i=\"index\">\n * <div class=\"row\">{{ i }}. {{ row.name }}</div>\n * </ng-template>\n * </wr-virtual-scroll>\n * ```\n *\n * @see https://ngwr.dev/reference/components/virtual-scroll\n */\n@Component({\n selector: 'wr-virtual-scroll',\n templateUrl: './virtual-scroll.html',\n styleUrl: './virtual-scroll.scss',\n encapsulation: ViewEncapsulation.None,\n imports: [ScrollingModule, NgTemplateOutlet],\n host: { class: 'wr-virtual-scroll' },\n})\nexport class WrVirtualScroll<T = unknown> {\n /** Items to render. */\n readonly items = input.required<readonly T[]>();\n\n /** Per-item pixel height. All rows must be the same height. @default 32 */\n readonly itemSize = input(32, {\n transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 32)),\n });\n\n /**\n * Viewport height. Pass a number (`px`) or any CSS length string\n * (`'80vh'`, `'40rem'`). @default 256\n */\n readonly height = input<number | string>(256);\n\n /**\n * Pixels of rendered content kept above + below the viewport. CDK\n * keeps adding rows until at least this many pixels are buffered.\n * @default itemSize * 4\n */\n readonly minBufferPx = input<number | undefined>(undefined);\n\n /**\n * Maximum pixels of buffered content before CDK starts recycling rows.\n * Must be ≥ `minBufferPx`. @default itemSize * 8\n */\n readonly maxBufferPx = input<number | undefined>(undefined);\n\n /**\n * `trackBy` function for the inner `*cdkVirtualFor`. Defaults to\n * identity (recreates rows when the item reference changes).\n */\n readonly trackBy = input<TrackByFunction<T>>((_, item) => item);\n\n protected readonly rowTemplate = contentChild.required(TemplateRef<{ $implicit: T; index: number }>);\n\n protected readonly viewport = viewChild.required(CdkVirtualScrollViewport);\n\n protected readonly resolvedHeight = computed(() => {\n const h = this.height();\n return typeof h === 'number' ? `${h}px` : h;\n });\n\n /**\n * The two buffers, resolved as a PAIR. CDK requires `maxBufferPx >= minBufferPx` and\n * throws `CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx`\n * outright otherwise — so resolving them independently meant that setting just one of\n * them, the obvious thing to do, crashed the viewport on construction. Whichever a\n * consumer gave is honoured and the other follows it.\n */\n private readonly buffers = computed<{ readonly min: number; readonly max: number }>(() => {\n const size = this.itemSize();\n const min = this.minBufferPx();\n const max = this.maxBufferPx();\n // Ordered so each branch narrows: a given minimum pushes the maximum up, a given\n // maximum pulls the minimum down, and both given are simply sorted.\n if (min !== undefined && max !== undefined) return { min: Math.min(min, max), max: Math.max(min, max) };\n if (min !== undefined) return { min, max: Math.max(min, size * 8) };\n if (max !== undefined) return { min: Math.min(size * 4, max), max };\n return { min: size * 4, max: size * 8 };\n });\n\n protected readonly resolvedMinBuffer = computed(() => this.buffers().min);\n protected readonly resolvedMaxBuffer = computed(() => this.buffers().max);\n\n /** Scroll a specific index into view. Mirrors the CDK API. */\n scrollToIndex(index: number, behavior: ScrollBehavior = 'auto'): void {\n this.viewport().scrollToIndex(index, behavior);\n }\n\n /** Scroll to a pixel offset. */\n scrollToOffset(offset: number, behavior: ScrollBehavior = 'auto'): void {\n this.viewport().scrollToOffset(offset, behavior);\n }\n\n /**\n * Re-measure the viewport. CDK already watches the window with its `ViewportRuler`, so\n * this is for a size change it cannot see — the host being resized by a layout the\n * window never noticed, or a parent that was display:none until now.\n */\n checkViewportSize(): void {\n this.viewport().checkViewportSize();\n }\n}\n","<cdk-virtual-scroll-viewport\n class=\"wr-virtual-scroll__viewport\"\n [itemSize]=\"itemSize()\"\n [minBufferPx]=\"resolvedMinBuffer()\"\n [maxBufferPx]=\"resolvedMaxBuffer()\"\n [style.height]=\"resolvedHeight()\"\n>\n <ng-container *cdkVirtualFor=\"let item of items(); let i = index; trackBy: trackBy()\">\n <ng-container *ngTemplateOutlet=\"rowTemplate(); context: { $implicit: item, index: i }\" />\n </ng-container>\n</cdk-virtual-scroll-viewport>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AAgBH;;;;;;;;;;;;;;;;;AAiBG;MASU,eAAe,CAAA;;IAEjB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAgB;;IAGtC,QAAQ,GAAG,KAAK,CAAC,EAAE,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EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnF3E;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-virtual-scroll.mjs","sources":["../../../projects/lib/virtual-scroll/virtual-scroll.ts","../../../projects/lib/virtual-scroll/virtual-scroll.html","../../../projects/lib/virtual-scroll/ngwr-virtual-scroll.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 { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n TemplateRef,\n type TrackByFunction,\n ViewEncapsulation,\n computed,\n contentChild,\n input,\n viewChild,\n} from '@angular/core';\n\n/**\n * Fixed-size virtual scroll viewport.\n *\n * Thin wrapper around CDK's `cdk-virtual-scroll-viewport` with ngwr\n * theming and sensible buffer defaults. Project a single template — it's\n * called per item with `let-item let-index=\"index\"`.\n *\n * @example\n * ```html\n * <wr-virtual-scroll [items]=\"rows\" [itemSize]=\"32\" [height]=\"320\">\n * <ng-template let-row let-i=\"index\">\n * <div class=\"row\">{{ i }}. {{ row.name }}</div>\n * </ng-template>\n * </wr-virtual-scroll>\n * ```\n *\n * @see https://ngwr.dev/reference/components/virtual-scroll\n */\n@Component({\n selector: 'wr-virtual-scroll',\n templateUrl: './virtual-scroll.html',\n styleUrl: './virtual-scroll.scss',\n encapsulation: ViewEncapsulation.None,\n imports: [ScrollingModule, NgTemplateOutlet],\n host: { class: 'wr-virtual-scroll' },\n})\nexport class WrVirtualScroll<T = unknown> {\n /** Items to render. */\n readonly items = input.required<readonly T[]>();\n\n /** Per-item pixel height. All rows must be the same height. @default 32 */\n readonly itemSize = input(32, {\n transform: (v: unknown): number => Math.max(1, coerceNumberProperty(v, 32)),\n });\n\n /**\n * Viewport height. Pass a number (`px`) or any CSS length string\n * (`'80vh'`, `'40rem'`). @default 256\n */\n readonly height = input<number | string>(256);\n\n /**\n * Pixels of rendered content kept above + below the viewport. CDK\n * keeps adding rows until at least this many pixels are buffered.\n * @default itemSize * 4\n */\n readonly minBufferPx = input<number | undefined>(undefined);\n\n /**\n * Maximum pixels of buffered content before CDK starts recycling rows.\n * Must be ≥ `minBufferPx`. @default itemSize * 8\n */\n readonly maxBufferPx = input<number | undefined>(undefined);\n\n /**\n * `trackBy` function for the inner `*cdkVirtualFor`. Defaults to\n * identity (recreates rows when the item reference changes).\n */\n readonly trackBy = input<TrackByFunction<T>>((_, item) => item);\n\n protected readonly rowTemplate = contentChild.required(TemplateRef<{ $implicit: T; index: number }>);\n\n protected readonly viewport = viewChild.required(CdkVirtualScrollViewport);\n\n protected readonly resolvedHeight = computed(() => {\n const h = this.height();\n return typeof h === 'number' ? `${h}px` : h;\n });\n\n /**\n * The two buffers, resolved as a PAIR. CDK requires `maxBufferPx >= minBufferPx` and\n * throws `CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx`\n * outright otherwise — so resolving them independently meant that setting just one of\n * them, the obvious thing to do, crashed the viewport on construction. Whichever a\n * consumer gave is honoured and the other follows it.\n */\n private readonly buffers = computed<{ readonly min: number; readonly max: number }>(() => {\n const size = this.itemSize();\n const min = this.minBufferPx();\n const max = this.maxBufferPx();\n // Ordered so each branch narrows: a given minimum pushes the maximum up, a given\n // maximum pulls the minimum down, and both given are simply sorted.\n if (min !== undefined && max !== undefined) return { min: Math.min(min, max), max: Math.max(min, max) };\n if (min !== undefined) return { min, max: Math.max(min, size * 8) };\n if (max !== undefined) return { min: Math.min(size * 4, max), max };\n return { min: size * 4, max: size * 8 };\n });\n\n protected readonly resolvedMinBuffer = computed(() => this.buffers().min);\n protected readonly resolvedMaxBuffer = computed(() => this.buffers().max);\n\n /** Scroll a specific index into view. Mirrors the CDK API. */\n scrollToIndex(index: number, behavior: ScrollBehavior = 'auto'): void {\n this.viewport().scrollToIndex(index, behavior);\n }\n\n /** Scroll to a pixel offset. */\n scrollToOffset(offset: number, behavior: ScrollBehavior = 'auto'): void {\n this.viewport().scrollToOffset(offset, behavior);\n }\n\n /**\n * Re-measure the viewport. CDK already watches the window with its `ViewportRuler`, so\n * this is for a size change it cannot see — the host being resized by a layout the\n * window never noticed, or a parent that was display:none until now.\n */\n checkViewportSize(): void {\n this.viewport().checkViewportSize();\n }\n}\n","<cdk-virtual-scroll-viewport\n class=\"wr-virtual-scroll__viewport\"\n [itemSize]=\"itemSize()\"\n [minBufferPx]=\"resolvedMinBuffer()\"\n [maxBufferPx]=\"resolvedMaxBuffer()\"\n [style.height]=\"resolvedHeight()\"\n>\n <ng-container *cdkVirtualFor=\"let item of items(); let i = index; trackBy: trackBy()\">\n <ng-container *ngTemplateOutlet=\"rowTemplate(); context: { $implicit: item, index: i }\" />\n </ng-container>\n</cdk-virtual-scroll-viewport>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AAgBH;;;;;;;;;;;;;;;;;AAiBG;MASU,eAAe,CAAA;;IAEjB,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAgB;;IAGtC,QAAQ,GAAG,KAAK,CAAC,EAAE,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,UAAA,EAAA,8BAAA,EAAA,CAAA,EAC1B,SAAS,EAAE,CAAC,CAAU,KAAa,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAA,CAC3E;AAEF;;;AAGG;IACM,MAAM,GAAG,KAAK,CAAkB,GAAG;+EAAC;AAE7C;;;;AAIG;IACM,WAAW,GAAG,KAAK,CAAqB,SAAS;oFAAC;AAE3D;;;AAGG;IACM,WAAW,GAAG,KAAK,CAAqB,SAAS;oFAAC;AAE3D;;;AAGG;IACM,OAAO,GAAG,KAAK,CAAqB,CAAC,CAAC,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EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,WAA4C,uFAElD,wBAAwB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnF3E;;AAEG;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-waves-testing.mjs","sources":["../../../projects/lib/waves/testing/wr-waves-harness.ts","../../../projects/lib/waves/testing/ngwr-waves-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 { WrWavesHarnessFilters } from './interfaces';\n\n/** `--wr-waves-x-gap: 40px` on the host's own `style` attribute — the pitch, as published. */\nconst X_GAP = /(?:^|;)\\s*--wr-waves-x-gap\\s*:\\s*([^;]+)/;\n\n/**\n * Test harness for `<wr-waves>` — a field of lines drifting on perlin noise.\n *\n * **The lines themselves are unreadable and always will be.** They are strokes on a 2D\n * canvas, seeded from the host's measured box and redrawn every frame; a unit test has\n * no box and no drawing context, so there is nothing to count and nothing to compare.\n * What the component publishes to the DOM is small, deliberate and worth pinning: the\n * handover flag {@link isPainted}, the pitch {@link getLineGapPx} that the CSS stand-in\n * grid draws at before the canvas takes over, and the surface itself.\n *\n * Two style reads, taken two different ways, and the difference is the point.\n * {@link getBackgroundColor} is computed, because nothing but the component declares\n * that property and the resolved value is what gets painted. {@link getLineGapPx} is\n * read from the inline declaration, because the stylesheet declares\n * `--wr-waves-x-gap` too — as the stand-in's own 10px fallback — so a computed read\n * would answer `10px` on a component that had stopped publishing anything, which is\n * precisely the break the method exists to catch.\n *\n * There is no `getLineCount()`, `getPoints()` or `getCanvasSize()`: the grid is seeded\n * from `getBoundingClientRect()`, which is 0×0 here, and the numbers that fall out of\n * that describe nothing. No `getLineColor()` either — it is a canvas `strokeStyle`\n * resolved from a themed custom property that only a stylesheet can supply. No\n * `moveMouse()`: the pointer listeners are on `window` and are only installed once a\n * context exists. And no `isReducedMotion()`, which is the sharpest of them — the\n * reduced-motion path draws one static grid through the same code and sets the same\n * flag, so the DOM is identical either way and any answer would be a guess.\n *\n * @example\n * ```ts\n * const waves = await loader.getHarness(WrWavesHarness);\n *\n * expect(await waves.hasCanvas()).toBe(true);\n * expect(await waves.isDecorative()).toBe(true);\n * expect(await waves.getLineGapPx()).toBe(10);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrWavesHarness extends ComponentHarness {\n static hostSelector = 'wr-waves';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrWavesHarnessFilters = {}): HarnessPredicate<WrWavesHarness> {\n return new HarnessPredicate(WrWavesHarness, options).addOption(\n 'painted',\n options.painted,\n async (harness, painted) => (await harness.isPainted()) === painted\n );\n }\n\n private readonly canvas = this.locatorFor('.wr-waves__canvas');\n\n /**\n * Whether the canvas has drawn a frame and retired the CSS stand-in grid.\n *\n * **In a unit test this is always `false`, and asserting exactly that is the point.**\n * jsdom hands back no 2D context, so the component must leave the stand-in up rather\n * than declare itself painted over a blank box — the flag is set inside the draw for\n * that reason, not at the end of the boot. A spec that waits for this to turn `true`\n * waits forever.\n */\n async isPainted(): Promise<boolean> {\n return (await this.host()).hasClass('wr-waves--painted');\n }\n\n /**\n * The horizontal gap between lines, in pixels, as the component publishes it.\n *\n * `[xGap]` feeds the canvas maths, which is invisible here — but it is also published\n * to the stand-in grid, and that is the half a spec can hold: a field whose stand-in\n * draws at 10px and whose canvas then arrives at 40px changes pitch under the reader\n * on hydration, a visible pop that nothing else can catch.\n */\n async getLineGapPx(): Promise<number> {\n const style = (await (await this.host()).getAttribute('style')) ?? '';\n const match = X_GAP.exec(style);\n const gap = match ? Number.parseFloat(match[1]) : Number.NaN;\n if (Number.isNaN(gap)) {\n throw new Error(\n `WrWavesHarness.getLineGapPx(): the host publishes no \\`--wr-waves-x-gap\\` (style: \"${style}\"). The ` +\n 'component writes it from `[xGap]` on every render, so its absence means the stand-in grid has fallen ' +\n \"back to the stylesheet's own 10px and no longer follows the input.\"\n );\n }\n return gap;\n }\n\n /**\n * The fill behind the lines, resolved.\n *\n * Comes back as the browser reports it rather than as it was authored — the default\n * `'transparent'` reads as `'rgba(0, 0, 0, 0)'` and `'#5227ff'` as\n * `'rgb(82, 39, 255)'` — which is true in jsdom and in a real browser alike, so an\n * assertion written against it travels. Worth pinning because the alternative\n * implementation is to fill the canvas instead, and a canvas fill is invisible to\n * everything until it has painted: the background has to be a real declaration on the\n * host so the field is the right colour from the prerendered HTML onwards.\n */\n async getBackgroundColor(): Promise<string> {\n return (await this.host()).getCssValue('background-color');\n }\n\n /**\n * Whether the field is hidden from assistive tech.\n *\n * A background canvas has nothing to announce, so losing this leaves a screen reader\n * stopping on a nameless graphic in front of the section's actual content.\n */\n async isDecorative(): Promise<boolean> {\n return (await (await this.canvas()).getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * Whether the drawing surface is in the markup.\n *\n * It is there in every state, including the ones where nothing is ever drawn on it —\n * prerendered, no 2D context, reduced motion. That is the contract: the element goes\n * up and the component stops, so the stand-in grid has something to sit behind and\n * {@link isPainted} has something to answer about.\n */\n async hasCanvas(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-waves__canvas')()) !== null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;AACA,MAAM,KAAK,GAAG,0CAA0C;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACG,MAAO,cAAe,SAAQ,gBAAgB,CAAA;AAClD,IAAA,OAAO,YAAY,GAAG,UAAU;;AAGhC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAiC,EAAE,EAAA;AAC7C,QAAA,OAAO,IAAI,gBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS,CAC5D,SAAS,EACT,OAAO,CAAC,OAAO,EACf,OAAO,OAAO,EAAE,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC,SAAS,EAAE,MAAM,OAAO,CACpE;IACH;AAEiB,IAAA,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;AAE9D;;;;;;;;AAQG;AACH,IAAA,MAAM,SAAS,GAAA;AACb,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,mBAAmB,CAAC;IAC1D;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;QACrE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/B,MAAM,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG;AAC5D,QAAA,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;AACrB,YAAA,MAAM,IAAI,KAAK,CACb,CAAA,mFAAA,EAAsF,KAAK,CAAA,QAAA,CAAU;gBACnG,uGAAuG;AACvG,gBAAA,oEAAoE,CACvE;QACH;AACA,QAAA,OAAO,GAAG;IACZ;AAEA;;;;;;;;;;AAUG;AACH,IAAA,MAAM,kBAAkB,GAAA;AACtB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,kBAAkB,CAAC;IAC5D;AAEA;;;;;AAKG;AACH,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,aAAa,CAAC,MAAM,MAAM;IAC7E;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,SAAS,GAAA;AACb,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,EAAE,MAAM,IAAI;IACxE;;;ACxIF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-waves-testing.mjs","sources":["../../../projects/lib/waves/testing/wr-waves-harness.ts","../../../projects/lib/waves/testing/ngwr-waves-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 { WrWavesHarnessFilters } from './interfaces';\n\n/** `--wr-waves-x-gap: 40px` on the host's own `style` attribute — the pitch, as published. */\nconst X_GAP = /(?:^|;)\\s*--wr-waves-x-gap\\s*:\\s*([^;]+)/;\n\n/**\n * Test harness for `<wr-waves>` — a field of lines drifting on perlin noise.\n *\n * **The lines themselves are unreadable and always will be.** They are strokes on a 2D\n * canvas, seeded from the host's measured box and redrawn every frame; a unit test has\n * no box and no drawing context, so there is nothing to count and nothing to compare.\n * What the component publishes to the DOM is small, deliberate and worth pinning: the\n * handover flag {@link isPainted}, the pitch {@link getLineGapPx} that the CSS stand-in\n * grid draws at before the canvas takes over, and the surface itself.\n *\n * Two style reads, taken two different ways, and the difference is the point.\n * {@link getBackgroundColor} is computed, because nothing but the component declares\n * that property and the resolved value is what gets painted. {@link getLineGapPx} is\n * read from the inline declaration, because the stylesheet declares\n * `--wr-waves-x-gap` too — as the stand-in's own 10px fallback — so a computed read\n * would answer `10px` on a component that had stopped publishing anything, which is\n * precisely the break the method exists to catch.\n *\n * There is no `getLineCount()`, `getPoints()` or `getCanvasSize()`: the grid is seeded\n * from `getBoundingClientRect()`, which is 0×0 here, and the numbers that fall out of\n * that describe nothing. No `getLineColor()` either — it is a canvas `strokeStyle`\n * resolved from a themed custom property that only a stylesheet can supply. No\n * `moveMouse()`: the pointer listeners are on `window` and are only installed once a\n * context exists. And no `isReducedMotion()`, which is the sharpest of them — the\n * reduced-motion path draws one static grid through the same code and sets the same\n * flag, so the DOM is identical either way and any answer would be a guess.\n *\n * @example\n * ```ts\n * const waves = await loader.getHarness(WrWavesHarness);\n *\n * expect(await waves.hasCanvas()).toBe(true);\n * expect(await waves.isDecorative()).toBe(true);\n * expect(await waves.getLineGapPx()).toBe(10);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrWavesHarness extends ComponentHarness {\n static hostSelector = 'wr-waves';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrWavesHarnessFilters = {}): HarnessPredicate<WrWavesHarness> {\n return new HarnessPredicate(WrWavesHarness, options).addOption(\n 'painted',\n options.painted,\n async (harness, painted) => (await harness.isPainted()) === painted\n );\n }\n\n private readonly canvas = this.locatorFor('.wr-waves__canvas');\n\n /**\n * Whether the canvas has drawn a frame and retired the CSS stand-in grid.\n *\n * **In a unit test this is always `false`, and asserting exactly that is the point.**\n * jsdom hands back no 2D context, so the component must leave the stand-in up rather\n * than declare itself painted over a blank box — the flag is set inside the draw for\n * that reason, not at the end of the boot. A spec that waits for this to turn `true`\n * waits forever.\n */\n async isPainted(): Promise<boolean> {\n return (await this.host()).hasClass('wr-waves--painted');\n }\n\n /**\n * The horizontal gap between lines, in pixels, as the component publishes it.\n *\n * `[xGap]` feeds the canvas maths, which is invisible here — but it is also published\n * to the stand-in grid, and that is the half a spec can hold: a field whose stand-in\n * draws at 10px and whose canvas then arrives at 40px changes pitch under the reader\n * on hydration, a visible pop that nothing else can catch.\n */\n async getLineGapPx(): Promise<number> {\n const style = (await (await this.host()).getAttribute('style')) ?? '';\n const match = X_GAP.exec(style);\n const gap = match ? Number.parseFloat(match[1]) : Number.NaN;\n if (Number.isNaN(gap)) {\n throw new Error(\n `WrWavesHarness.getLineGapPx(): the host publishes no \\`--wr-waves-x-gap\\` (style: \"${style}\"). The ` +\n 'component writes it from `[xGap]` on every render, so its absence means the stand-in grid has fallen ' +\n \"back to the stylesheet's own 10px and no longer follows the input.\"\n );\n }\n return gap;\n }\n\n /**\n * The fill behind the lines, resolved.\n *\n * Comes back as the browser reports it rather than as it was authored — the default\n * `'transparent'` reads as `'rgba(0, 0, 0, 0)'` and `'#5227ff'` as\n * `'rgb(82, 39, 255)'` — which is true in jsdom and in a real browser alike, so an\n * assertion written against it travels. Worth pinning because the alternative\n * implementation is to fill the canvas instead, and a canvas fill is invisible to\n * everything until it has painted: the background has to be a real declaration on the\n * host so the field is the right colour from the prerendered HTML onwards.\n */\n async getBackgroundColor(): Promise<string> {\n return (await this.host()).getCssValue('background-color');\n }\n\n /**\n * Whether the field is hidden from assistive tech.\n *\n * A background canvas has nothing to announce, so losing this leaves a screen reader\n * stopping on a nameless graphic in front of the section's actual content.\n */\n async isDecorative(): Promise<boolean> {\n return (await (await this.canvas()).getAttribute('aria-hidden')) === 'true';\n }\n\n /**\n * Whether the drawing surface is in the markup.\n *\n * It is there in every state, including the ones where nothing is ever drawn on it —\n * prerendered, no 2D context, reduced motion. That is the contract: the element goes\n * up and the component stops, so the stand-in grid has something to sit behind and\n * {@link isPainted} has something to answer about.\n */\n async hasCanvas(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-waves__canvas')()) !== null;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAMH;AACA,MAAM,KAAK,GAAG,0CAA0C;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCG;AACG,MAAO,cAAe,SAAQ,gBAAgB,CAAA;AAClD,IAAA,OAAO,YAAY,GAAG,UAAU;;AAGhC,IAAA,OAAO,IAAI,CAAC,OAAA,GAAiC,EAAE,EAAA;AAC7C,QAAA,OAAO,IAAI,gBAAgB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC,SAAS,CAC5D,SAAS,EACT,OAAO,CAAC,OAAO,EACf,OAAO,OAAO,EAAE,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC,SAAS,EAAE,MAAM,OAAO,CACpE;IACH;AAEiB,IAAA,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;AAE9D;;;;;;;;AAQG;AACH,IAAA,MAAM,SAAS,GAAA;AACb,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,QAAQ,CAAC,mBAAmB,CAAC;IAC1D;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE;QACrE,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/B,MAAM,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG;AAC5D,QAAA,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;AACrB,YAAA,MAAM,IAAI,KAAK,CACb,CAAA,mFAAA,EAAsF,KAAK,CAAA,QAAA,CAAU;gBACnG,uGAAuG;AACvG,gBAAA,oEAAoE,CACvE;QACH;AACA,QAAA,OAAO,GAAG;IACZ;AAEA;;;;;;;;;;AAUG;AACH,IAAA,MAAM,kBAAkB,GAAA;AACtB,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,kBAAkB,CAAC;IAC5D;AAEA;;;;;AAKG;AACH,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,aAAa,CAAC,MAAM,MAAM;IAC7E;AAEA;;;;;;;AAOG;AACH,IAAA,MAAM,SAAS,GAAA;AACb,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,EAAE,MAAM,IAAI;IACxE;;;ACxIF;;AAEG;;"}
@@ -356,10 +356,10 @@ class WrWaves {
356
356
  mouse.set = true;
357
357
  }
358
358
  }
359
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrWaves, deps: [], target: i0.ɵɵFactoryTarget.Component });
360
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.6", type: WrWaves, isStandalone: true, selector: "wr-waves", inputs: { lineColor: { classPropertyName: "lineColor", publicName: "lineColor", isSignal: true, isRequired: false, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null }, waveSpeedX: { classPropertyName: "waveSpeedX", publicName: "waveSpeedX", isSignal: true, isRequired: false, transformFunction: null }, waveSpeedY: { classPropertyName: "waveSpeedY", publicName: "waveSpeedY", isSignal: true, isRequired: false, transformFunction: null }, waveAmpX: { classPropertyName: "waveAmpX", publicName: "waveAmpX", isSignal: true, isRequired: false, transformFunction: null }, waveAmpY: { classPropertyName: "waveAmpY", publicName: "waveAmpY", isSignal: true, isRequired: false, transformFunction: null }, xGap: { classPropertyName: "xGap", publicName: "xGap", isSignal: true, isRequired: false, transformFunction: null }, yGap: { classPropertyName: "yGap", publicName: "yGap", isSignal: true, isRequired: false, transformFunction: null }, friction: { classPropertyName: "friction", publicName: "friction", isSignal: true, isRequired: false, transformFunction: null }, tension: { classPropertyName: "tension", publicName: "tension", isSignal: true, isRequired: false, transformFunction: null }, maxCursorMove: { classPropertyName: "maxCursorMove", publicName: "maxCursorMove", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.background-color": "backgroundColor()", "style.--wr-waves-x-gap.px": "xGap()", "class.wr-waves--painted": "painted()" }, classAttribute: "wr-waves" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: '<canvas #canvas class="wr-waves__canvas" aria-hidden="true"></canvas>', isInline: true, styles: [".wr-waves{--wr-waves-line-color: rgba(var(--wr-color-on-surface-rgb), .12);--wr-waves-x-gap: 10px;position:absolute;inset:0;display:block;margin:0;padding:0;overflow:hidden;background-image:repeating-linear-gradient(to right,var(--wr-waves-line-color) 0 1px,transparent 1px var(--wr-waves-x-gap))}.wr-waves--painted{background-image:none}.wr-waves__canvas{display:block;width:100%;height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
359
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrWaves, deps: [], target: i0.ɵɵFactoryTarget.Component });
360
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.7", type: WrWaves, isStandalone: true, selector: "wr-waves", inputs: { lineColor: { classPropertyName: "lineColor", publicName: "lineColor", isSignal: true, isRequired: false, transformFunction: null }, backgroundColor: { classPropertyName: "backgroundColor", publicName: "backgroundColor", isSignal: true, isRequired: false, transformFunction: null }, waveSpeedX: { classPropertyName: "waveSpeedX", publicName: "waveSpeedX", isSignal: true, isRequired: false, transformFunction: null }, waveSpeedY: { classPropertyName: "waveSpeedY", publicName: "waveSpeedY", isSignal: true, isRequired: false, transformFunction: null }, waveAmpX: { classPropertyName: "waveAmpX", publicName: "waveAmpX", isSignal: true, isRequired: false, transformFunction: null }, waveAmpY: { classPropertyName: "waveAmpY", publicName: "waveAmpY", isSignal: true, isRequired: false, transformFunction: null }, xGap: { classPropertyName: "xGap", publicName: "xGap", isSignal: true, isRequired: false, transformFunction: null }, yGap: { classPropertyName: "yGap", publicName: "yGap", isSignal: true, isRequired: false, transformFunction: null }, friction: { classPropertyName: "friction", publicName: "friction", isSignal: true, isRequired: false, transformFunction: null }, tension: { classPropertyName: "tension", publicName: "tension", isSignal: true, isRequired: false, transformFunction: null }, maxCursorMove: { classPropertyName: "maxCursorMove", publicName: "maxCursorMove", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.background-color": "backgroundColor()", "style.--wr-waves-x-gap.px": "xGap()", "class.wr-waves--painted": "painted()" }, classAttribute: "wr-waves" }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, isSignal: true }], ngImport: i0, template: '<canvas #canvas class="wr-waves__canvas" aria-hidden="true"></canvas>', isInline: true, styles: [".wr-waves{--wr-waves-line-color: rgba(var(--wr-color-on-surface-rgb), .12);--wr-waves-x-gap: 10px;position:absolute;inset:0;display:block;margin:0;padding:0;overflow:hidden;background-image:repeating-linear-gradient(to right,var(--wr-waves-line-color) 0 1px,transparent 1px var(--wr-waves-x-gap))}.wr-waves--painted{background-image:none}.wr-waves__canvas{display:block;width:100%;height:100%}\n"], encapsulation: i0.ViewEncapsulation.None });
361
361
  }
362
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: WrWaves, decorators: [{
362
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: WrWaves, decorators: [{
363
363
  type: Component,
364
364
  args: [{ selector: 'wr-waves', template: '<canvas #canvas class="wr-waves__canvas" aria-hidden="true"></canvas>', encapsulation: ViewEncapsulation.None, host: {
365
365
  class: 'wr-waves',