ngwr 16.2.0 → 16.4.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 (418) hide show
  1. package/badge/styles/_tag.scss +73 -1
  2. package/calendar/styles/_index.scss +22 -0
  3. package/carousel/styles/_index.scss +53 -1
  4. package/cascader/styles/_rules.scss +7 -0
  5. package/color-picker/styles/_index.scss +21 -0
  6. package/date-picker/styles/_index.scss +19 -0
  7. package/dropdown/styles/_index.scss +13 -19
  8. package/fesm2022/ngwr-affix.mjs +3 -3
  9. package/fesm2022/ngwr-alert-testing.mjs +70 -0
  10. package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
  11. package/fesm2022/ngwr-alert.mjs +3 -3
  12. package/fesm2022/ngwr-anchor.mjs +17 -6
  13. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  14. package/fesm2022/ngwr-animations-aurora.mjs +3 -3
  15. package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
  16. package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
  17. package/fesm2022/ngwr-animations-confetti.mjs +3 -3
  18. package/fesm2022/ngwr-animations-decode.mjs +3 -3
  19. package/fesm2022/ngwr-animations-destruct.mjs +3 -3
  20. package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
  21. package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
  22. package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
  23. package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
  24. package/fesm2022/ngwr-animations-glitch.mjs +3 -3
  25. package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
  26. package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
  27. package/fesm2022/ngwr-animations-marquee.mjs +3 -3
  28. package/fesm2022/ngwr-animations-orbit.mjs +3 -3
  29. package/fesm2022/ngwr-animations-reveal.mjs +3 -3
  30. package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
  31. package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
  32. package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
  33. package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
  34. package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
  35. package/fesm2022/ngwr-animations-tilt.mjs +3 -3
  36. package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
  37. package/fesm2022/ngwr-avatar.mjs +3 -3
  38. package/fesm2022/ngwr-back-top.mjs +3 -3
  39. package/fesm2022/ngwr-badge.mjs +129 -11
  40. package/fesm2022/ngwr-badge.mjs.map +1 -1
  41. package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
  42. package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
  43. package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
  44. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  45. package/fesm2022/ngwr-burger-testing.mjs +45 -0
  46. package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
  47. package/fesm2022/ngwr-burger.mjs +3 -3
  48. package/fesm2022/ngwr-button.mjs +6 -6
  49. package/fesm2022/ngwr-calendar-testing.mjs +18 -0
  50. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  51. package/fesm2022/ngwr-calendar.mjs +500 -73
  52. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  53. package/fesm2022/ngwr-card.mjs +9 -9
  54. package/fesm2022/ngwr-carousel-testing.mjs +24 -1
  55. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  56. package/fesm2022/ngwr-carousel.mjs +73 -10
  57. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  58. package/fesm2022/ngwr-cascader.mjs +45 -37
  59. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  60. package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
  61. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  62. package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
  63. package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
  64. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
  65. package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
  66. package/fesm2022/ngwr-charts-chart-legend.mjs +26 -11
  67. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  68. package/fesm2022/ngwr-charts-core.mjs +3 -3
  69. package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
  70. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  71. package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
  72. package/fesm2022/ngwr-charts-gauge.mjs +3 -3
  73. package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
  74. package/fesm2022/ngwr-charts-line-chart-testing.mjs +3 -2
  75. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
  77. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
  79. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
  81. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  82. package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
  83. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  84. package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
  85. package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
  86. package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
  87. package/fesm2022/ngwr-checkbox.mjs +6 -6
  88. package/fesm2022/ngwr-clipboard.mjs +3 -3
  89. package/fesm2022/ngwr-collapse.mjs +9 -9
  90. package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
  91. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  92. package/fesm2022/ngwr-color-picker.mjs +153 -37
  93. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  94. package/fesm2022/ngwr-command-palette.mjs +3 -3
  95. package/fesm2022/ngwr-comment.mjs +10 -6
  96. package/fesm2022/ngwr-comment.mjs.map +1 -1
  97. package/fesm2022/ngwr-compare-testing.mjs +84 -0
  98. package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
  99. package/fesm2022/ngwr-compare.mjs +3 -3
  100. package/fesm2022/ngwr-context-menu.mjs +28 -13
  101. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  102. package/fesm2022/ngwr-cookie.mjs +3 -3
  103. package/fesm2022/ngwr-copy-value.mjs +3 -3
  104. package/fesm2022/ngwr-counter.mjs +6 -6
  105. package/fesm2022/ngwr-date-picker-testing.mjs +30 -4
  106. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  107. package/fesm2022/ngwr-date-picker.mjs +342 -69
  108. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  109. package/fesm2022/ngwr-date-stamp.mjs +3 -3
  110. package/fesm2022/ngwr-date.mjs +59 -8
  111. package/fesm2022/ngwr-date.mjs.map +1 -1
  112. package/fesm2022/ngwr-density.mjs +6 -6
  113. package/fesm2022/ngwr-descriptions.mjs +6 -6
  114. package/fesm2022/ngwr-dialog.mjs +18 -18
  115. package/fesm2022/ngwr-directives.mjs +15 -15
  116. package/fesm2022/ngwr-divider.mjs +3 -3
  117. package/fesm2022/ngwr-drawer.mjs +51 -29
  118. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  119. package/fesm2022/ngwr-dropdown-testing.mjs +11 -3
  120. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  121. package/fesm2022/ngwr-dropdown.mjs +70 -99
  122. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  123. package/fesm2022/ngwr-editor.mjs +4 -3
  124. package/fesm2022/ngwr-editor.mjs.map +1 -1
  125. package/fesm2022/ngwr-empty.mjs +3 -3
  126. package/fesm2022/ngwr-event-calendar.mjs +186 -33
  127. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  128. package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
  129. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  130. package/fesm2022/ngwr-file-upload.mjs +279 -16
  131. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  132. package/fesm2022/ngwr-form.mjs +9 -9
  133. package/fesm2022/ngwr-form.mjs.map +1 -1
  134. package/fesm2022/ngwr-graph-testing.mjs +30 -0
  135. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  136. package/fesm2022/ngwr-graph.mjs +664 -43
  137. package/fesm2022/ngwr-graph.mjs.map +1 -1
  138. package/fesm2022/ngwr-hotkey.mjs +6 -6
  139. package/fesm2022/ngwr-i18n-ar.mjs +27 -8
  140. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  141. package/fesm2022/ngwr-i18n-cs.mjs +27 -8
  142. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  143. package/fesm2022/ngwr-i18n-de.mjs +27 -8
  144. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  145. package/fesm2022/ngwr-i18n-en.mjs +27 -8
  146. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  147. package/fesm2022/ngwr-i18n-es.mjs +27 -8
  148. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  149. package/fesm2022/ngwr-i18n-fr.mjs +27 -8
  150. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  151. package/fesm2022/ngwr-i18n-he.mjs +27 -8
  152. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  153. package/fesm2022/ngwr-i18n-hi.mjs +27 -8
  154. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  155. package/fesm2022/ngwr-i18n-id.mjs +27 -8
  156. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  157. package/fesm2022/ngwr-i18n-it.mjs +27 -8
  158. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  159. package/fesm2022/ngwr-i18n-ja.mjs +27 -8
  160. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  161. package/fesm2022/ngwr-i18n-ko.mjs +27 -8
  162. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  163. package/fesm2022/ngwr-i18n-nl.mjs +27 -8
  164. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  165. package/fesm2022/ngwr-i18n-pl.mjs +27 -8
  166. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  167. package/fesm2022/ngwr-i18n-pt.mjs +27 -8
  168. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  169. package/fesm2022/ngwr-i18n-ru.mjs +27 -8
  170. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  171. package/fesm2022/ngwr-i18n-sv.mjs +27 -8
  172. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  173. package/fesm2022/ngwr-i18n-tr.mjs +27 -8
  174. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  175. package/fesm2022/ngwr-i18n-uk.mjs +27 -8
  176. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  177. package/fesm2022/ngwr-i18n-vi.mjs +27 -8
  178. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  179. package/fesm2022/ngwr-i18n-zh-tw.mjs +27 -8
  180. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  181. package/fesm2022/ngwr-i18n-zh.mjs +27 -8
  182. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  183. package/fesm2022/ngwr-i18n.mjs +9 -9
  184. package/fesm2022/ngwr-icon.mjs +6 -6
  185. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  186. package/fesm2022/ngwr-input-number-testing.mjs +11 -0
  187. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  188. package/fesm2022/ngwr-input-number.mjs +68 -7
  189. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  190. package/fesm2022/ngwr-input-otp.mjs +23 -3
  191. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  192. package/fesm2022/ngwr-input-testing.mjs +24 -1
  193. package/fesm2022/ngwr-input-testing.mjs.map +1 -1
  194. package/fesm2022/ngwr-input.mjs +152 -36
  195. package/fesm2022/ngwr-input.mjs.map +1 -1
  196. package/fesm2022/ngwr-keyboard.mjs +3 -3
  197. package/fesm2022/ngwr-knob.mjs +3 -3
  198. package/fesm2022/ngwr-layout.mjs +15 -15
  199. package/fesm2022/ngwr-lightbox.mjs +8 -8
  200. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  201. package/fesm2022/ngwr-list.mjs +8 -8
  202. package/fesm2022/ngwr-list.mjs.map +1 -1
  203. package/fesm2022/ngwr-load-state.mjs +15 -15
  204. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  205. package/fesm2022/ngwr-mention.mjs +6 -6
  206. package/fesm2022/ngwr-meta.mjs +6 -6
  207. package/fesm2022/ngwr-overlay.mjs +175 -13
  208. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  209. package/fesm2022/ngwr-page-header.mjs +3 -3
  210. package/fesm2022/ngwr-pagination.mjs +6 -3
  211. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  212. package/fesm2022/ngwr-pipes.mjs +31 -29
  213. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  214. package/fesm2022/ngwr-platform.mjs +9 -9
  215. package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
  216. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  217. package/fesm2022/ngwr-popconfirm.mjs +44 -63
  218. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  219. package/fesm2022/ngwr-popover-testing.mjs +7 -1
  220. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  221. package/fesm2022/ngwr-popover.mjs +58 -156
  222. package/fesm2022/ngwr-popover.mjs.map +1 -1
  223. package/fesm2022/ngwr-progress.mjs +50 -9
  224. package/fesm2022/ngwr-progress.mjs.map +1 -1
  225. package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
  226. package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
  227. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  228. package/fesm2022/ngwr-qr.mjs +3 -3
  229. package/fesm2022/ngwr-radio.mjs +6 -6
  230. package/fesm2022/ngwr-rating.mjs +3 -3
  231. package/fesm2022/ngwr-resizable-testing.mjs +113 -0
  232. package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
  233. package/fesm2022/ngwr-resizable.mjs +3 -3
  234. package/fesm2022/ngwr-result.mjs +12 -12
  235. package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
  236. package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
  237. package/fesm2022/ngwr-schema-form.mjs +416 -19
  238. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  239. package/fesm2022/ngwr-scroll.mjs +3 -3
  240. package/fesm2022/ngwr-segmented.mjs +3 -3
  241. package/fesm2022/ngwr-select-testing.mjs +19 -0
  242. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  243. package/fesm2022/ngwr-select.mjs +361 -84
  244. package/fesm2022/ngwr-select.mjs.map +1 -1
  245. package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
  246. package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
  247. package/fesm2022/ngwr-sidebar.mjs +3 -3
  248. package/fesm2022/ngwr-skeleton.mjs +3 -3
  249. package/fesm2022/ngwr-slider-testing.mjs +6 -0
  250. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  251. package/fesm2022/ngwr-slider.mjs +21 -3
  252. package/fesm2022/ngwr-slider.mjs.map +1 -1
  253. package/fesm2022/ngwr-sortable-list.mjs +29 -12
  254. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  255. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  256. package/fesm2022/ngwr-spinner.mjs +3 -3
  257. package/fesm2022/ngwr-splitter.mjs +3 -3
  258. package/fesm2022/ngwr-statistic.mjs +9 -9
  259. package/fesm2022/ngwr-stepper.mjs +42 -11
  260. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  261. package/fesm2022/ngwr-storage.mjs +3 -3
  262. package/fesm2022/ngwr-switch.mjs +3 -3
  263. package/fesm2022/ngwr-table-testing.mjs +157 -3
  264. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  265. package/fesm2022/ngwr-table.mjs +1051 -74
  266. package/fesm2022/ngwr-table.mjs.map +1 -1
  267. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  268. package/fesm2022/ngwr-tabs-testing.mjs +1 -1
  269. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  270. package/fesm2022/ngwr-tabs.mjs +15 -10
  271. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  272. package/fesm2022/ngwr-textarea-testing.mjs +11 -0
  273. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
  274. package/fesm2022/ngwr-textarea.mjs +128 -16
  275. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  276. package/fesm2022/ngwr-theme.mjs +3 -3
  277. package/fesm2022/ngwr-timeline.mjs +6 -6
  278. package/fesm2022/ngwr-toast.mjs +40 -19
  279. package/fesm2022/ngwr-toast.mjs.map +1 -1
  280. package/fesm2022/ngwr-toolbar.mjs +3 -3
  281. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  282. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  283. package/fesm2022/ngwr-tour.mjs +19 -15
  284. package/fesm2022/ngwr-tour.mjs.map +1 -1
  285. package/fesm2022/ngwr-transfer-testing.mjs +6 -0
  286. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
  287. package/fesm2022/ngwr-transfer.mjs +24 -5
  288. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  289. package/fesm2022/ngwr-tree-testing.mjs +62 -2
  290. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  291. package/fesm2022/ngwr-tree.mjs +978 -79
  292. package/fesm2022/ngwr-tree.mjs.map +1 -1
  293. package/fesm2022/ngwr-typography.mjs +3 -3
  294. package/fesm2022/ngwr-utils-router.mjs +3 -3
  295. package/fesm2022/ngwr-utils.mjs +97 -1
  296. package/fesm2022/ngwr-utils.mjs.map +1 -1
  297. package/fesm2022/ngwr-version.mjs +1 -1
  298. package/fesm2022/ngwr-version.mjs.map +1 -1
  299. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  300. package/fesm2022/ngwr-window.mjs +33 -22
  301. package/fesm2022/ngwr-window.mjs.map +1 -1
  302. package/file-upload/styles/_index.scss +156 -0
  303. package/graph/styles/_index.scss +87 -0
  304. package/i18n/ar.json +29 -8
  305. package/i18n/cs.json +29 -8
  306. package/i18n/de.json +29 -8
  307. package/i18n/en.json +29 -8
  308. package/i18n/es.json +29 -8
  309. package/i18n/fr.json +29 -8
  310. package/i18n/he.json +29 -8
  311. package/i18n/hi.json +29 -8
  312. package/i18n/id.json +29 -8
  313. package/i18n/it.json +29 -8
  314. package/i18n/ja.json +29 -8
  315. package/i18n/ko.json +29 -8
  316. package/i18n/nl.json +29 -8
  317. package/i18n/pl.json +29 -8
  318. package/i18n/pt.json +29 -8
  319. package/i18n/ru.json +29 -8
  320. package/i18n/sv.json +29 -8
  321. package/i18n/tr.json +29 -8
  322. package/i18n/uk.json +29 -8
  323. package/i18n/vi.json +29 -8
  324. package/i18n/zh-TW.json +29 -8
  325. package/i18n/zh.json +29 -8
  326. package/input/styles/_index.scss +68 -1
  327. package/input-otp/styles/_index.scss +14 -0
  328. package/llms-full.txt +53 -21
  329. package/llms.txt +57 -24
  330. package/overlay/styles/_arrow.scss +4 -4
  331. package/package.json +33 -1
  332. package/popconfirm/styles/_index.scss +3 -11
  333. package/progress/styles/_index.scss +32 -0
  334. package/schema-form/styles/_index.scss +78 -0
  335. package/schematics/collection.json +5 -0
  336. package/schematics/eject/index.js +158 -0
  337. package/schematics/eject/schema.js +8 -0
  338. package/schematics/eject/schema.json +24 -0
  339. package/schematics/eject/source.js +295 -0
  340. package/schematics/use/rule.js +2 -0
  341. package/schematics/use/symbol-map.json +5 -0
  342. package/select/styles/_index.scss +127 -22
  343. package/skills/ngwr/SKILL.md +31 -4
  344. package/skills/ngwr/references/catalog.md +9 -1
  345. package/slider/styles/_index.scss +22 -0
  346. package/table/styles/_index.scss +191 -3
  347. package/textarea/styles/_index.scss +80 -0
  348. package/theme/styles/_focus.scss +16 -1
  349. package/theme/styles/_motion.scss +5 -0
  350. package/transfer/styles/_index.scss +84 -0
  351. package/tree/styles/_index.scss +138 -5
  352. package/types/ngwr-alert-testing.d.ts +88 -0
  353. package/types/ngwr-badge.d.ts +72 -2
  354. package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
  355. package/types/ngwr-burger-testing.d.ts +51 -0
  356. package/types/ngwr-calendar-testing.d.ts +18 -6
  357. package/types/ngwr-calendar.d.ts +272 -22
  358. package/types/ngwr-carousel-testing.d.ts +27 -6
  359. package/types/ngwr-carousel.d.ts +42 -6
  360. package/types/ngwr-cascader.d.ts +13 -6
  361. package/types/ngwr-charts-chart-legend.d.ts +9 -4
  362. package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
  363. package/types/ngwr-charts-line-chart.d.ts +7 -4
  364. package/types/ngwr-color-picker-testing.d.ts +15 -4
  365. package/types/ngwr-color-picker.d.ts +76 -6
  366. package/types/ngwr-compare-testing.d.ts +72 -0
  367. package/types/ngwr-context-menu.d.ts +2 -0
  368. package/types/ngwr-date-picker-testing.d.ts +23 -8
  369. package/types/ngwr-date-picker.d.ts +100 -9
  370. package/types/ngwr-date.d.ts +71 -1
  371. package/types/ngwr-drawer.d.ts +9 -0
  372. package/types/ngwr-dropdown-testing.d.ts +20 -0
  373. package/types/ngwr-dropdown.d.ts +26 -6
  374. package/types/ngwr-event-calendar.d.ts +66 -8
  375. package/types/ngwr-file-upload-testing.d.ts +31 -2
  376. package/types/ngwr-file-upload.d.ts +156 -3
  377. package/types/ngwr-form.d.ts +47 -3
  378. package/types/ngwr-graph-testing.d.ts +36 -3
  379. package/types/ngwr-graph.d.ts +309 -13
  380. package/types/ngwr-input-number-testing.d.ts +10 -0
  381. package/types/ngwr-input-number.d.ts +30 -1
  382. package/types/ngwr-input-otp.d.ts +10 -0
  383. package/types/ngwr-input-testing.d.ts +30 -0
  384. package/types/ngwr-input.d.ts +54 -3
  385. package/types/ngwr-overlay.d.ts +84 -5
  386. package/types/ngwr-pipes.d.ts +2 -1
  387. package/types/ngwr-popconfirm-testing.d.ts +12 -3
  388. package/types/ngwr-popconfirm.d.ts +28 -3
  389. package/types/ngwr-popover-testing.d.ts +19 -2
  390. package/types/ngwr-popover.d.ts +22 -2
  391. package/types/ngwr-progress.d.ts +29 -1
  392. package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
  393. package/types/ngwr-resizable-testing.d.ts +116 -0
  394. package/types/ngwr-schema-form-testing.d.ts +260 -0
  395. package/types/ngwr-schema-form.d.ts +76 -6
  396. package/types/ngwr-select-testing.d.ts +20 -0
  397. package/types/ngwr-select.d.ts +149 -11
  398. package/types/ngwr-sidebar-testing.d.ts +176 -0
  399. package/types/ngwr-slider-testing.d.ts +3 -1
  400. package/types/ngwr-slider.d.ts +21 -1
  401. package/types/ngwr-sortable-list.d.ts +6 -0
  402. package/types/ngwr-stepper.d.ts +20 -11
  403. package/types/ngwr-table-testing.d.ts +122 -7
  404. package/types/ngwr-table.d.ts +572 -50
  405. package/types/ngwr-tabs-testing.d.ts +14 -17
  406. package/types/ngwr-tabs.d.ts +6 -0
  407. package/types/ngwr-textarea-testing.d.ts +10 -0
  408. package/types/ngwr-textarea.d.ts +48 -2
  409. package/types/ngwr-toast.d.ts +8 -1
  410. package/types/ngwr-tour-testing.d.ts +10 -0
  411. package/types/ngwr-tour.d.ts +11 -2
  412. package/types/ngwr-transfer-testing.d.ts +3 -0
  413. package/types/ngwr-transfer.d.ts +24 -1
  414. package/types/ngwr-tree-testing.d.ts +65 -1
  415. package/types/ngwr-tree.d.ts +335 -12
  416. package/types/ngwr-utils.d.ts +107 -1
  417. package/types/ngwr-version.d.ts +1 -1
  418. package/types/ngwr-window.d.ts +7 -4
@@ -36,6 +36,15 @@
36
36
  // Zero leading would otherwise shrink the tag 22px -> 21px, so the box is
37
37
  // floored explicitly instead of being an accident of the line height.
38
38
  --wr-tag-min-height: 1.375rem;
39
+ // The remove button reads the tag's own colour and radius, so it follows
40
+ // every variant: contrast on a fill, ink on a tint, round in a pill. Its box
41
+ // is the tag's content height, 22px less the border and the block padding.
42
+ --wr-tag-icon-size: 0.875rem;
43
+ --wr-tag-remove-size: 1rem;
44
+ --wr-tag-remove-icon-size: 0.75rem;
45
+ --wr-tag-remove-color: var(--wr-tag-color);
46
+ --wr-tag-remove-hover-bg: color-mix(in srgb, var(--wr-tag-color) 16%, transparent);
47
+ --wr-tag-remove-radius: var(--wr-tag-radius);
39
48
 
40
49
  color: var(--wr-tag-color);
41
50
  background: var(--wr-tag-bg);
@@ -56,13 +65,76 @@
56
65
  --wr-tag-padding-x: var(--wr-space-md);
57
66
  }
58
67
 
68
+ // Sizes. After the shape, and with the pill's wider inline padding restated
69
+ // per size, so `rounded` keeps its extra step at every size.
70
+ &--sm,
71
+ &:where([size='sm']) {
72
+ --wr-tag-padding-y: 0.0625rem;
73
+ --wr-tag-padding-x: 0.375rem;
74
+ --wr-tag-font-size: 0.6875rem; // 11px, a label and not a count, so above the badge's 10px
75
+ --wr-tag-min-height: 1.25rem;
76
+ --wr-tag-icon-size: 0.75rem;
77
+ --wr-tag-remove-size: 0.875rem;
78
+ --wr-tag-remove-icon-size: 0.625rem;
79
+
80
+ &.wr-tag--rounded,
81
+ &:where([rounded]:not([rounded='false'])) {
82
+ --wr-tag-padding-x: var(--wr-space-sm);
83
+ }
84
+ }
85
+
86
+ &--lg,
87
+ &:where([size='lg']) {
88
+ --wr-tag-padding-y: 0.25rem;
89
+ --wr-tag-padding-x: var(--wr-space-md);
90
+ --wr-tag-font-size: var(--wr-text-base);
91
+ --wr-tag-min-height: 2rem;
92
+ --wr-tag-icon-size: 1.125rem;
93
+ --wr-tag-remove-size: 1.375rem;
94
+ --wr-tag-remove-icon-size: 1rem;
95
+
96
+ &.wr-tag--rounded,
97
+ &:where([rounded]:not([rounded='false'])) {
98
+ --wr-tag-padding-x: var(--wr-space-lg);
99
+ }
100
+ }
101
+
59
102
  // Icon slot sizing
60
103
  &__adornment {
61
- --wr-icon-size: 0.875rem;
104
+ --wr-icon-size: var(--wr-tag-icon-size);
62
105
  color: inherit;
63
106
  flex: 0 0 auto;
64
107
  }
65
108
 
109
+ &__remove {
110
+ flex: 0 0 auto;
111
+ display: inline-flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+ appearance: none;
115
+ width: var(--wr-tag-remove-size);
116
+ height: var(--wr-tag-remove-size);
117
+ // Half the inline padding back, so the ✕ sits as far from the edge as the
118
+ // label does from the other one, glyph to glyph.
119
+ margin-inline-end: calc(var(--wr-tag-padding-x) * var(--wr-density-x, 1) * -0.5);
120
+ padding: 0;
121
+ border: 0;
122
+ border-radius: var(--wr-tag-remove-radius);
123
+ background: transparent;
124
+ color: var(--wr-tag-remove-color);
125
+ // The ✕ is a bare `.wr-icon__svg`, which is `1em`, and a `<button>` takes
126
+ // the browser's control font unless the app resets it.
127
+ font-size: var(--wr-tag-remove-icon-size);
128
+ cursor: pointer;
129
+ transition: background var(--wr-transition-base);
130
+
131
+ @include theme.touch-target;
132
+
133
+ &:hover {
134
+ background: var(--wr-tag-remove-hover-bg);
135
+ }
136
+ }
137
+
66
138
  // Hoverable (used when the tag is interactive)
67
139
  &--hoverable {
68
140
  cursor: pointer;
@@ -36,6 +36,7 @@
36
36
  --wr-calendar-day-font-weight: var(--wr-font-weight-semibold);
37
37
  --wr-calendar-months-gap: var(--wr-space-xs);
38
38
  --wr-calendar-years-gap: var(--wr-space-xs);
39
+ --wr-calendar-quarters-gap: var(--wr-space-xs);
39
40
  --wr-calendar-chip-font-size: var(--wr-text-sm);
40
41
  --wr-calendar-chip-font-weight: var(--wr-font-weight-semibold);
41
42
 
@@ -258,6 +259,13 @@
258
259
  gap: var(--wr-calendar-years-gap);
259
260
  }
260
261
 
262
+ // Two rows of two: a quarter's label is a word in some locales, not `Q1`.
263
+ &__quarters {
264
+ display: grid;
265
+ grid-template-columns: repeat(2, 1fr);
266
+ gap: var(--wr-calendar-quarters-gap);
267
+ }
268
+
261
269
  &__chip {
262
270
  appearance: none;
263
271
  background: transparent;
@@ -292,6 +300,15 @@
292
300
  font-weight: var(--wr-calendar-chip-font-weight);
293
301
  }
294
302
 
303
+ // A range of periods, tinted as a range of days is.
304
+ &--in-range {
305
+ background: color-mix(in srgb, var(--wr-calendar-accent) 12%, transparent);
306
+ }
307
+
308
+ &--range-preview {
309
+ background: color-mix(in srgb, var(--wr-calendar-accent) 6%, transparent);
310
+ }
311
+
295
312
  &--selected {
296
313
  background: var(--wr-calendar-accent);
297
314
  color: var(--wr-calendar-accent-contrast);
@@ -309,4 +326,9 @@
309
326
  pointer-events: none;
310
327
  opacity: var(--wr-disabled-opacity);
311
328
  }
329
+
330
+ // Still focusable and browsable, so only the cue changes: a day no longer picks.
331
+ &--readonly &__day:not(:disabled) {
332
+ cursor: default;
333
+ }
312
334
  }
@@ -3,7 +3,10 @@
3
3
 
4
4
  .wr-carousel {
5
5
  --wr-carousel-font-family: var(--wr-font-family-base);
6
- --wr-carousel-dots-gap: var(--wr-space-sm);
6
+ // Between two dots. With the 0.5rem dot it puts neighbouring centres 24px
7
+ // apart, which is what WCAG 2.5.8 asks of a target under 24px: a smaller gap
8
+ // fails it.
9
+ --wr-carousel-dots-gap: var(--wr-space-lg);
7
10
  // The pill the active dot stretches into. The resting dot is a circle, which
8
11
  // is a percentage and off the radius scale.
9
12
  --wr-carousel-dot-active-radius: var(--wr-border-radius-pill);
@@ -118,6 +121,46 @@
118
121
  }
119
122
  }
120
123
 
124
+ // The pause button: the arrows' chrome, smaller, in the corner the dots and
125
+ // the arrows leave free.
126
+ &__toggle {
127
+ position: absolute;
128
+ z-index: 1;
129
+ inset-block-end: 0.5rem;
130
+ inset-inline-end: 0.75rem;
131
+ width: 1.75rem;
132
+ height: 1.75rem;
133
+ display: inline-flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ padding: 0;
137
+ border: 0;
138
+ border-radius: 50%;
139
+ background: color-mix(in srgb, var(--wr-color-surface) 85%, transparent);
140
+ color: var(--wr-color-on-surface);
141
+ cursor: pointer;
142
+ box-shadow: var(--wr-shadow-sm);
143
+ backdrop-filter: blur(4px);
144
+ transition: background var(--wr-transition-base);
145
+
146
+ &:hover {
147
+ background: var(--wr-color-surface);
148
+ }
149
+ }
150
+
151
+ // The live region: read out, never drawn.
152
+ &__live {
153
+ position: absolute;
154
+ width: 1px;
155
+ height: 1px;
156
+ padding: 0;
157
+ margin: -1px;
158
+ overflow: hidden;
159
+ clip: rect(0, 0, 0, 0);
160
+ white-space: nowrap;
161
+ border: 0;
162
+ }
163
+
121
164
  &__dots {
122
165
  position: absolute;
123
166
  bottom: 0.75rem;
@@ -129,6 +172,7 @@
129
172
  }
130
173
 
131
174
  &__dot {
175
+ position: relative;
132
176
  width: 0.5rem;
133
177
  height: 0.5rem;
134
178
  border: 0;
@@ -149,6 +193,14 @@
149
193
  background var(--wr-transition-base);
150
194
  padding: 0;
151
195
 
196
+ // The hit area: half the gap to each side and 24px tall, so a press beside
197
+ // the 8px dot still lands, and two neighbours' areas meet without overlapping.
198
+ &::after {
199
+ content: '';
200
+ position: absolute;
201
+ inset: -0.5rem calc(var(--wr-carousel-dots-gap) / -2);
202
+ }
203
+
152
204
  &--active {
153
205
  width: 1.25rem;
154
206
  border-radius: var(--wr-carousel-dot-active-radius);
@@ -91,6 +91,13 @@
91
91
  --wr-cascader-line-height: var(--wr-control-line-height-lg);
92
92
  }
93
93
 
94
+ // After the sizes, so the pill wins at every one of them.
95
+ &--rounded,
96
+ &:where([rounded]:not([rounded='false'])) {
97
+ --wr-cascader-radius: var(--wr-border-radius-pill);
98
+ --wr-cascader-padding-x: var(--wr-control-padding-x-lg);
99
+ }
100
+
94
101
  &__trigger {
95
102
  display: inline-flex;
96
103
  align-items: center;
@@ -12,6 +12,7 @@
12
12
  //
13
13
  // Sass deduplicates `@use` within a compilation, so an app that also loads one of
14
14
  // these by hand still emits it once.
15
+ @use '../../popover/styles' as popover-styles; // WrPopover
15
16
  @use '../../segmented/styles' as segmented-styles; // WrSegmented
16
17
  @include theme.loaded('color-picker');
17
18
 
@@ -43,6 +44,26 @@
43
44
  font-family: var(--wr-color-picker-font-family);
44
45
  user-select: none;
45
46
 
47
+ // Sizes. The two sliders keep their 12px track and 14px thumb at `sm`: they
48
+ // sit one gap apart, and a thinner pair or a smaller thumb fails 2.5.8's
49
+ // spacing between the hue and alpha targets (axe, target-size).
50
+ &--sm,
51
+ &:where([size='sm']) {
52
+ --wr-color-picker-width: 14rem;
53
+ --wr-color-picker-sv-height: 8rem;
54
+ --wr-color-picker-padding: var(--wr-space-sm);
55
+ }
56
+
57
+ &--lg,
58
+ &:where([size='lg']) {
59
+ --wr-color-picker-width: 20rem;
60
+ --wr-color-picker-sv-height: 12rem;
61
+ --wr-color-picker-slider-height: 1rem;
62
+ --wr-color-picker-thumb-size: 1.125rem;
63
+ --wr-color-picker-padding: var(--wr-space-lg);
64
+ --wr-color-picker-gap: var(--wr-space-md);
65
+ }
66
+
46
67
  // SV (saturation + value) canvas
47
68
  &__sv {
48
69
  position: relative;
@@ -157,6 +157,25 @@
157
157
  }
158
158
  }
159
159
 
160
+ // The pill. The group and the fields carry their own `--rounded` class; the host
161
+ // rule is here because the size rules above set the group's radius from the host
162
+ // and would otherwise outrank the group's own modifier at `sm` and `lg`.
163
+ .wr-date-picker--rounded,
164
+ .wr-date-picker:where([rounded]:not([rounded='false'])),
165
+ .wr-date-range-picker--rounded,
166
+ .wr-date-range-picker:where([rounded]:not([rounded='false'])) {
167
+ > .wr-input-group {
168
+ --wr-input-group-radius: var(--wr-border-radius-pill);
169
+ --wr-input-group-padding-x: var(--wr-control-padding-x-lg);
170
+ }
171
+
172
+ // Flush to the pill's end, so its focus ring follows the curve, less the border.
173
+ .wr-date-picker__trigger {
174
+ border-start-end-radius: calc(var(--wr-input-group-radius) - 1px);
175
+ border-end-end-radius: calc(var(--wr-input-group-radius) - 1px);
176
+ }
177
+ }
178
+
160
179
  .wr-date-range-picker {
161
180
  display: inline-block;
162
181
 
@@ -83,15 +83,19 @@ $arrow-gap: 0.5rem;
83
83
  padding-top: $gap;
84
84
  }
85
85
 
86
- // The gap sits on the pane edge that faces the trigger. `left` / `right` map
87
- // to CDK `originX: 'start' | 'end'` (see `WR_DROPDOWN_POSITIONS`), which
86
+ // The gap sits on the pane edge that faces the trigger. `left*` / `right*` map
87
+ // to CDK `originX: 'start' | 'end'` (see `WR_ANCHORED_POSITIONS`), which
88
88
  // `FlexibleConnectedPositionStrategy` already resolves against the ambient
89
89
  // `Directionality` — so the padding has to follow the same axis, logically.
90
- &--left {
90
+ &--left,
91
+ &--left-start,
92
+ &--left-end {
91
93
  padding-inline-end: $gap;
92
94
  }
93
95
 
94
- &--right {
96
+ &--right,
97
+ &--right-start,
98
+ &--right-end {
95
99
  padding-inline-start: $gap;
96
100
  }
97
101
 
@@ -110,11 +114,11 @@ $arrow-gap: 0.5rem;
110
114
  padding-top: $arrow-gap;
111
115
  }
112
116
 
113
- &:where(.wr-dropdown-overlay--left) {
117
+ &:where(.wr-dropdown-overlay--left, .wr-dropdown-overlay--left-start, .wr-dropdown-overlay--left-end) {
114
118
  padding-inline-end: $arrow-gap;
115
119
  }
116
120
 
117
- &:where(.wr-dropdown-overlay--right) {
121
+ &:where(.wr-dropdown-overlay--right, .wr-dropdown-overlay--right-start, .wr-dropdown-overlay--right-end) {
118
122
  padding-inline-start: $arrow-gap;
119
123
  }
120
124
  }
@@ -127,23 +131,13 @@ $arrow-gap: 0.5rem;
127
131
  // otherwise get an arrow in the old colours. The `::after` inherits the hooks
128
132
  // from the menu it belongs to, so the per-instance value reaches it.
129
133
  //
130
- // Eight placements, not twelve: `WrDropdownPosition` has no `left-start` and
131
- // friends, and those rules could never match.
134
+ // All twelve placements, the mixin's default: `WrDropdownPosition` is the shared
135
+ // set.
132
136
  @include arrow.anchored-arrow(
133
137
  $pane: '.wr-dropdown-overlay',
134
138
  $panel: '> .wr-dropdown-menu',
135
139
  $background: var(--wr-dropdown-bg),
136
- $border: var(--wr-dropdown-border),
137
- $placements-used: (
138
- top,
139
- top-start,
140
- top-end,
141
- bottom,
142
- bottom-start,
143
- bottom-end,
144
- left,
145
- right,
146
- )
140
+ $border: var(--wr-dropdown-border)
147
141
  );
148
142
 
149
143
  // `[arrow]="false"` — the directive leaves `--arrow` off the pane and the square
@@ -131,7 +131,7 @@ var WrAffix = class WrAffix {
131
131
  }
132
132
  static ɵfac = i0.ɵɵngDeclareFactory({
133
133
  minVersion: "12.0.0",
134
- version: "22.2.5",
134
+ version: "22.2.6",
135
135
  ngImport: i0,
136
136
  type: WrAffix,
137
137
  deps: [],
@@ -139,7 +139,7 @@ var WrAffix = class WrAffix {
139
139
  });
140
140
  static ɵdir = i0.ɵɵngDeclareDirective({
141
141
  minVersion: "17.1.0",
142
- version: "22.2.5",
142
+ version: "22.2.6",
143
143
  type: WrAffix,
144
144
  isStandalone: true,
145
145
  selector: "[wrAffix]",
@@ -163,7 +163,7 @@ var WrAffix = class WrAffix {
163
163
  };
164
164
  i0.ɵɵngDeclareClassMetadata({
165
165
  minVersion: "12.0.0",
166
- version: "22.2.5",
166
+ version: "22.2.6",
167
167
  ngImport: i0,
168
168
  type: WrAffix,
169
169
  decorators: [{
@@ -0,0 +1,70 @@
1
+ import { ComponentHarness, HarnessPredicate } from "@angular/cdk/testing";
2
+ /**
3
+ * @license
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
7
+ */
8
+ const TYPES = [
9
+ "info",
10
+ "success",
11
+ "warning",
12
+ "danger",
13
+ "neutral",
14
+ "offline"
15
+ ];
16
+ var WrAlertHarness = class WrAlertHarness extends ComponentHarness {
17
+ static hostSelector = "wr-alert";
18
+ static with(options = {}) {
19
+ return new HarnessPredicate(WrAlertHarness, options).addOption("title", options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title)).addOption("text", options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text)).addOption("type", options.type, async (harness, type) => await harness.getType() === type).addOption("closable", options.closable, async (harness, closable) => await harness.isClosable() === closable);
20
+ }
21
+ closeButton = this.locatorForOptional("button.wr-alert__close");
22
+ async getTitle() {
23
+ return await (await this.locatorForOptional(".wr-alert__title")())?.text() ?? null;
24
+ }
25
+ async getMessage() {
26
+ return await (await this.locatorForOptional(".wr-alert__message")())?.text() ?? null;
27
+ }
28
+ async getContentText() {
29
+ return await (await this.locatorForOptional(".wr-alert__content")())?.text() ?? "";
30
+ }
31
+ async getText() {
32
+ return (await Promise.all([
33
+ ".wr-alert__title",
34
+ ".wr-alert__message",
35
+ ".wr-alert__content",
36
+ ".wr-alert__actions"
37
+ ].map(async (selector) => (await this.locatorForOptional(selector)())?.text()))).filter(Boolean).join(" ");
38
+ }
39
+ async getType() {
40
+ const host = await this.host();
41
+ for (const type of TYPES) if (await host.hasClass(`wr-alert--${type}`)) return type;
42
+ throw new Error("WrAlertHarness.getType(): the host carries no wr-alert--<type> modifier.");
43
+ }
44
+ async getRole() {
45
+ return (await this.host()).getAttribute("role");
46
+ }
47
+ async getLiveLevel() {
48
+ return (await this.host()).getAttribute("aria-live");
49
+ }
50
+ async hasIcon() {
51
+ return await this.locatorForOptional(".wr-alert__icon")() !== null;
52
+ }
53
+ async isClosable() {
54
+ return await this.closeButton() !== null;
55
+ }
56
+ async getCloseLabel() {
57
+ return await (await this.closeButton())?.getAttribute("aria-label") ?? null;
58
+ }
59
+ async isDismissed() {
60
+ return (await this.host()).hasClass("wr-alert--dismissed");
61
+ }
62
+ async close() {
63
+ const button = await this.closeButton();
64
+ if (!button) throw new Error("WrAlertHarness.close(): this alert has no close button. It is not `closable`, or it was already dismissed.");
65
+ await button.click();
66
+ }
67
+ };
68
+ export { WrAlertHarness };
69
+
70
+ //# sourceMappingURL=ngwr-alert-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-alert-testing.mjs","names":[],"sources":["../../../projects/lib/alert/testing/wr-alert-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrAlertType } from 'ngwr/alert';\n\nimport type { WrAlertHarnessFilters } from './types';\n\nconst TYPES: readonly WrAlertType[] = ['info', 'success', 'warning', 'danger', 'neutral', 'offline'];\n\n/**\n * Test harness for `<wr-alert>`, the inline status banner.\n *\n * A dismissed alert keeps its host element and renders nothing inside it, so\n * every reader below answers `null` or `''` for one and {@link isDismissed} is\n * how a spec tells \"closed\" from \"empty\". There is no `getIcon()`: the default\n * glyph is an inline `<svg>` whose only difference between variants is its path\n * data, and {@link getType} already answers the question a spec has.\n *\n * @example\n * ```ts\n * const alert = await loader.getHarness(WrAlertHarness.with({ type: 'danger' }));\n *\n * expect(await alert.getTitle()).toBe('Sync failed');\n * await alert.close();\n * expect(await alert.isDismissed()).toBe(true);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrAlertHarness extends ComponentHarness {\n static hostSelector = 'wr-alert';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrAlertHarnessFilters = {}): HarnessPredicate<WrAlertHarness> {\n return new HarnessPredicate(WrAlertHarness, options)\n .addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title))\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('type', options.type, async (harness, type) => (await harness.getType()) === type)\n .addOption('closable', options.closable, async (harness, closable) => (await harness.isClosable()) === closable);\n }\n\n private readonly closeButton = this.locatorForOptional('button.wr-alert__close');\n\n /**\n * The headline, or `null` when the alert has none.\n *\n * A `message` with no `title` IS the headline: the component draws it in\n * `.wr-alert__title`, so it is answered here and {@link getMessage} is `null`.\n */\n async getTitle(): Promise<string | null> {\n return (await (await this.locatorForOptional('.wr-alert__title')())?.text()) ?? null;\n }\n\n /** The secondary line under the headline, or `null`. Only drawn when a `title` sits above it. */\n async getMessage(): Promise<string | null> {\n return (await (await this.locatorForOptional('.wr-alert__message')())?.text()) ?? null;\n }\n\n /** The projected default content, trimmed: `''` when nothing was projected or the alert is dismissed. */\n async getContentText(): Promise<string> {\n return (await (await this.locatorForOptional('.wr-alert__content')())?.text()) ?? '';\n }\n\n /**\n * Everything the alert says: headline, message, projected content and the\n * labels of projected actions, in that order, one space between them. `''`\n * once dismissed.\n *\n * Joined here rather than read off the body in one go: the pieces are\n * separate blocks with no text between them, so their raw text runs together\n * as `Sync failedThe server…`.\n */\n async getText(): Promise<string> {\n const parts = await Promise.all(\n ['.wr-alert__title', '.wr-alert__message', '.wr-alert__content', '.wr-alert__actions'].map(async selector =>\n (await this.locatorForOptional(selector)())?.text()\n )\n );\n return parts.filter(Boolean).join(' ');\n }\n\n /**\n * The variant, from the host's `wr-alert--<type>` modifier.\n *\n * Throws when the host carries none of them rather than answering `'info'`:\n * the component always writes one, so its absence is the bug.\n */\n async getType(): Promise<WrAlertType> {\n const host = await this.host();\n for (const type of TYPES) {\n if (await host.hasClass(`wr-alert--${type}`)) return type;\n }\n throw new Error('WrAlertHarness.getType(): the host carries no wr-alert--<type> modifier.');\n }\n\n /**\n * How the alert is announced: `'alert'` for `danger`, `'status'` for the\n * rest, `null` once dismissed.\n */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** The `aria-live` level: `'assertive'` for `danger` and `warning`, `'polite'` otherwise, `null` once dismissed. */\n async getLiveLevel(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-live');\n }\n\n /** Whether the leading status icon is drawn. */\n async hasIcon(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-alert__icon')()) !== null;\n }\n\n /** Whether the alert renders a close button. `false` once dismissed: the button goes with the rest. */\n async isClosable(): Promise<boolean> {\n return (await this.closeButton()) !== null;\n }\n\n /** The close button's accessible name, or `null` when there is no button. */\n async getCloseLabel(): Promise<string | null> {\n return (await (await this.closeButton())?.getAttribute('aria-label')) ?? null;\n }\n\n /** Whether the user closed the alert, from the host's `wr-alert--dismissed` modifier. */\n async isDismissed(): Promise<boolean> {\n return (await this.host()).hasClass('wr-alert--dismissed');\n }\n\n /**\n * Click the close button. Throws when there is none: the alert is not\n * `closable`, or it is already dismissed.\n */\n async close(): Promise<void> {\n const button = await this.closeButton();\n if (!button) {\n throw new Error(\n 'WrAlertHarness.close(): this alert has no close button. It is not `closable`, or it was already dismissed.'\n );\n }\n await button.click();\n }\n}\n"],"mappings":";;;;;;;AAaA,MAAM,QAAgC;CAAC;CAAQ;CAAW;CAAW;CAAU;CAAW;AAAS;AAsBnG,IAAa,iBAAb,MAAa,uBAAuB,iBAAgB;CAClD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAiC,CAAA,GAAE;EAC7C,OAAO,IAAI,iBAAiB,gBAAgB,OAAO,CAAC,CACjD,UAAU,SAAS,QAAQ,QAAQ,SAAS,UAAU,iBAAiB,cAAc,QAAQ,SAAQ,GAAI,KAAK,CAAC,CAAC,CAChH,UAAU,QAAQ,QAAQ,OAAO,SAAS,SAAS,iBAAiB,cAAc,QAAQ,QAAO,GAAI,IAAI,CAAC,CAAC,CAC3G,UAAU,QAAQ,QAAQ,MAAM,OAAO,SAAS,SAAU,MAAM,QAAQ,QAAO,MAAQ,IAAI,CAAC,CAC5F,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ;CACnH;CAEiB,cAAc,KAAK,mBAAmB,wBAAwB;CAQ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K;EACT,MAAM,SAAS,MAAM,KAAK,YAAW;EACrC,IAAI,CAAC,QACH,MAAM,IAAI,MACR,4GAA4G;EAGhH,MAAM,OAAO,MAAK;CACpB"}
@@ -57,7 +57,7 @@ var WrAlert = class WrAlert {
57
57
  }
58
58
  static ɵfac = i0.ɵɵngDeclareFactory({
59
59
  minVersion: "12.0.0",
60
- version: "22.2.5",
60
+ version: "22.2.6",
61
61
  ngImport: i0,
62
62
  type: WrAlert,
63
63
  deps: [],
@@ -65,7 +65,7 @@ var WrAlert = class WrAlert {
65
65
  });
66
66
  static ɵcmp = i0.ɵɵngDeclareComponent({
67
67
  minVersion: "17.0.0",
68
- version: "22.2.5",
68
+ version: "22.2.6",
69
69
  type: WrAlert,
70
70
  isStandalone: true,
71
71
  selector: "wr-alert",
@@ -143,7 +143,7 @@ var WrAlert = class WrAlert {
143
143
  };
144
144
  i0.ɵɵngDeclareClassMetadata({
145
145
  minVersion: "12.0.0",
146
- version: "22.2.5",
146
+ version: "22.2.6",
147
147
  ngImport: i0,
148
148
  type: WrAlert,
149
149
  decorators: [{
@@ -41,7 +41,7 @@ var WrAnchor = class WrAnchor {
41
41
  constructor() {
42
42
  if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("anchor");
43
43
  if (!this.platform.isBrowser) return;
44
- const handler = () => {
44
+ const measure = () => {
45
45
  const y = window.scrollY;
46
46
  const pin = this.pinned;
47
47
  if (pin) {
@@ -64,9 +64,20 @@ var WrAnchor = class WrAnchor {
64
64
  }
65
65
  if (active !== this.activeId()) this.zone.run(() => this.activeId.set(active));
66
66
  };
67
+ let frame = 0;
68
+ const handler = () => {
69
+ if (frame) return;
70
+ frame = requestAnimationFrame(() => {
71
+ frame = 0;
72
+ measure();
73
+ });
74
+ };
67
75
  this.zone.runOutsideAngular(() => window.addEventListener("scroll", handler, { passive: true }));
68
- this.destroyRef.onDestroy(() => window.removeEventListener("scroll", handler));
69
- afterNextRender(() => handler());
76
+ this.destroyRef.onDestroy(() => {
77
+ window.removeEventListener("scroll", handler);
78
+ if (frame) cancelAnimationFrame(frame);
79
+ });
80
+ afterNextRender(() => measure());
70
81
  }
71
82
  onClick(id, event) {
72
83
  event.preventDefault();
@@ -86,7 +97,7 @@ var WrAnchor = class WrAnchor {
86
97
  }
87
98
  static ɵfac = i0.ɵɵngDeclareFactory({
88
99
  minVersion: "12.0.0",
89
- version: "22.2.5",
100
+ version: "22.2.6",
90
101
  ngImport: i0,
91
102
  type: WrAnchor,
92
103
  deps: [],
@@ -94,7 +105,7 @@ var WrAnchor = class WrAnchor {
94
105
  });
95
106
  static ɵcmp = i0.ɵɵngDeclareComponent({
96
107
  minVersion: "17.0.0",
97
- version: "22.2.5",
108
+ version: "22.2.6",
98
109
  type: WrAnchor,
99
110
  isStandalone: true,
100
111
  selector: "wr-anchor",
@@ -140,7 +151,7 @@ var WrAnchor = class WrAnchor {
140
151
  };
141
152
  i0.ɵɵngDeclareClassMetadata({
142
153
  minVersion: "12.0.0",
143
- version: "22.2.5",
154
+ version: "22.2.6",
144
155
  ngImport: i0,
145
156
  type: WrAnchor,
146
157
  decorators: [{
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-anchor.mjs","names":[],"sources":["../../../projects/lib/anchor/anchor.ts","../../../projects/lib/anchor/anchor.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n NgZone,\n ViewEncapsulation,\n afterNextRender,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { WrScroll } from 'ngwr/scroll';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrAnchorLink } from './types';\n\n/**\n * Scroll-spy in-page navigation. Renders a list of links to elements on\n * the page; clicking a link smooth-scrolls (via {@link WrScroll}),\n * and the closest visible heading auto-highlights as the user scrolls.\n *\n * @example\n * ```html\n * <wr-anchor\n * [links]=\"[\n * { id: 'intro', label: 'Introduction' },\n * { id: 'usage', label: 'Usage', children: [\n * { id: 'basic', label: 'Basic' },\n * { id: 'advanced', label: 'Advanced' },\n * ]}\n * ]\"\n * [offset]=\"80\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/anchor\n */\n@Component({\n selector: 'wr-anchor',\n templateUrl: './anchor.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-anchor', role: 'navigation', '[attr.aria-label]': 'resolvedAriaLabel()' },\n})\nexport class WrAnchor {\n /**\n * The entries, in DOCUMENT ORDER — the scroll spy walks them top to bottom\n * and stops at the first target below the cursor line, so a list in any other\n * order highlights the wrong entry.\n */\n readonly links = input<readonly WrAnchorLink[]>([]);\n\n /**\n * Accessible name for the navigation landmark. Falls back to `anchor.label`,\n * then `'Table of contents'` — it used to be that English string, hard-coded\n * on the host, in a landmark a screen reader reads out on every page.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'anchor.label', 'Table of contents');\n\n /** Pixel offset subtracted on scroll — for sticky headers. @default 0 */\n readonly offset = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Highlight an item when its target's top is within this many px of the offset line. @default 80 */\n readonly hitArea = input(80, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 80)) });\n\n protected readonly activeId = signal<string | null>(null);\n\n /**\n * Flat list of the ids the template RENDERS — top level plus one level of\n * children, which is the nesting `WrAnchorLink` documents. It used to recurse\n * all the way down, so a third level was spied on and drawn nowhere: scrolling\n * through a grandchild made it active, no rendered link matched the id, and\n * the highlight vanished for that whole region rather than resting on its\n * parent.\n */\n protected readonly flatIds = computed<readonly string[]>(() => {\n const out: string[] = [];\n for (const item of this.links()) {\n out.push(item.id);\n for (const child of item.children ?? []) out.push(child.id);\n }\n return out;\n });\n\n private readonly scroll = inject(WrScroll);\n private readonly platform = inject(WrPlatform);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * The entry a click asked for, and the scroll position that click sends the\n * page to. A target near the end of the page can never reach the cursor line —\n * the page runs out of scroll first — so the spy took the highlight straight\n * back from the entry just clicked and handed it to the one above. While the\n * page is still travelling toward that position, or parked on it, the clicked\n * entry stays lit; the first scroll AWAY from it is the reader's own, and the\n * spy takes over again.\n */\n private pinned: { readonly id: string; readonly y: number } | null = null;\n private lastY = 0;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('anchor');\n if (!this.platform.isBrowser) return;\n const handler = (): void => {\n const y = window.scrollY;\n const pin = this.pinned;\n if (pin) {\n const distance = Math.abs(pin.y - y);\n if (distance <= 1 || distance < Math.abs(pin.y - this.lastY)) {\n this.lastY = y;\n if (pin.id !== this.activeId()) this.zone.run(() => this.activeId.set(pin.id));\n return;\n }\n this.pinned = null;\n }\n this.lastY = y;\n const cursor = this.offset() + this.hitArea();\n let active: string | null = null;\n for (const id of this.flatIds()) {\n const el = document.getElementById(id);\n if (!el) continue;\n const top = el.getBoundingClientRect().top;\n if (top <= cursor) active = id;\n else break;\n }\n if (active !== this.activeId()) this.zone.run(() => this.activeId.set(active));\n };\n this.zone.runOutsideAngular(() => window.addEventListener('scroll', handler, { passive: true }));\n this.destroyRef.onDestroy(() => window.removeEventListener('scroll', handler));\n // The first pass has to wait for a render: the targets are elsewhere on the\n // page and are usually rendered AFTER this list, so a constructor-time pass\n // found nothing by `getElementById` and left the page with no highlight at\n // all until the reader happened to scroll.\n afterNextRender(() => handler());\n }\n\n protected onClick(id: string, event: MouseEvent): void {\n event.preventDefault();\n const target = document.getElementById(id);\n if (target) {\n // Where `WrScroll` sends the page, clamped the way the browser clamps it.\n const root = document.documentElement;\n const max = Math.max(0, root.scrollHeight - root.clientHeight);\n const y = target.getBoundingClientRect().top + window.scrollY - this.offset();\n this.pinned = { id, y: Math.min(max, Math.max(0, y)) };\n this.lastY = window.scrollY;\n }\n this.scroll.to(`#${id}`, { offset: this.offset() });\n this.activeId.set(id);\n }\n}\n\nexport type { WrAnchorLink } from './types';\n","<ul class=\"wr-anchor__list\">\n @for (link of links(); track link.id) {\n <li class=\"wr-anchor__item\">\n <a\n class=\"wr-anchor__link\"\n [class.wr-anchor__link--active]=\"activeId() === link.id\"\n [attr.aria-current]=\"activeId() === link.id ? 'location' : null\"\n [href]=\"`#${link.id}`\"\n (click)=\"onClick(link.id, $event)\"\n >\n {{ link.label }}\n </a>\n @if (link.children?.length) {\n <ul class=\"wr-anchor__list wr-anchor__list--nested\">\n @for (child of link.children; track child.id) {\n <li class=\"wr-anchor__item\">\n <a\n class=\"wr-anchor__link\"\n [class.wr-anchor__link--active]=\"activeId() === child.id\"\n [attr.aria-current]=\"activeId() === child.id ? 'location' : null\"\n [href]=\"`#${child.id}`\"\n (click)=\"onClick(child.id, $event)\"\n >\n {{ child.label }}\n </a>\n </li>\n }\n </ul>\n }\n </li>\n }\n</ul>\n"],"mappings":";;;;;;;;;;;;;AAsDA,IAAa,WAAb,MAAa,SAAQ;CAMV,QAAQ,MAA+B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAO1C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,gBAAgB,mBAAmB;CAG7F,SAAS,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,KAAK,IAAI,GAAG,qBAAqB,GAAG,CAAC,CAAC;CAAC,CAAA;CAG9F,UAAU,MAAM,IAAE;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,KAAK,IAAI,GAAG,qBAA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YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,aAAA;GAAA,YAAA,EAAA,mBAAA,sBAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UCtDrB;EAgCA,eAAA,GAAA,kBAAA;CAAA,CAAA;;ADsBa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EANpB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAW,eAEN,kBAAkB;GAAI,MAC/B;IAAE,OAAO;IAAa,MAAM;IAAc,qBAAqB;GAAqB;GAAE,UAAA;EAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-anchor.mjs","names":[],"sources":["../../../projects/lib/anchor/anchor.ts","../../../projects/lib/anchor/anchor.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n NgZone,\n ViewEncapsulation,\n afterNextRender,\n computed,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { WrScroll } from 'ngwr/scroll';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrAnchorLink } from './types';\n\n/**\n * Scroll-spy in-page navigation. Renders a list of links to elements on\n * the page; clicking a link smooth-scrolls (via {@link WrScroll}),\n * and the closest visible heading auto-highlights as the user scrolls.\n *\n * @example\n * ```html\n * <wr-anchor\n * [links]=\"[\n * { id: 'intro', label: 'Introduction' },\n * { id: 'usage', label: 'Usage', children: [\n * { id: 'basic', label: 'Basic' },\n * { id: 'advanced', label: 'Advanced' },\n * ]}\n * ]\"\n * [offset]=\"80\"\n * />\n * ```\n *\n * @see https://ngwr.dev/reference/components/anchor\n */\n@Component({\n selector: 'wr-anchor',\n templateUrl: './anchor.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-anchor', role: 'navigation', '[attr.aria-label]': 'resolvedAriaLabel()' },\n})\nexport class WrAnchor {\n /**\n * The entries, in DOCUMENT ORDER — the scroll spy walks them top to bottom\n * and stops at the first target below the cursor line, so a list in any other\n * order highlights the wrong entry.\n */\n readonly links = input<readonly WrAnchorLink[]>([]);\n\n /**\n * Accessible name for the navigation landmark. Falls back to `anchor.label`,\n * then `'Table of contents'` — it used to be that English string, hard-coded\n * on the host, in a landmark a screen reader reads out on every page.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'anchor.label', 'Table of contents');\n\n /** Pixel offset subtracted on scroll — for sticky headers. @default 0 */\n readonly offset = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Highlight an item when its target's top is within this many px of the offset line. @default 80 */\n readonly hitArea = input(80, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 80)) });\n\n protected readonly activeId = signal<string | null>(null);\n\n /**\n * Flat list of the ids the template RENDERS — top level plus one level of\n * children, which is the nesting `WrAnchorLink` documents. It used to recurse\n * all the way down, so a third level was spied on and drawn nowhere: scrolling\n * through a grandchild made it active, no rendered link matched the id, and\n * the highlight vanished for that whole region rather than resting on its\n * parent.\n */\n protected readonly flatIds = computed<readonly string[]>(() => {\n const out: string[] = [];\n for (const item of this.links()) {\n out.push(item.id);\n for (const child of item.children ?? []) out.push(child.id);\n }\n return out;\n });\n\n private readonly scroll = inject(WrScroll);\n private readonly platform = inject(WrPlatform);\n private readonly zone = inject(NgZone);\n private readonly destroyRef = inject(DestroyRef);\n\n /**\n * The entry a click asked for, and the scroll position that click sends the\n * page to. A target near the end of the page can never reach the cursor line —\n * the page runs out of scroll first — so the spy took the highlight straight\n * back from the entry just clicked and handed it to the one above. While the\n * page is still travelling toward that position, or parked on it, the clicked\n * entry stays lit; the first scroll AWAY from it is the reader's own, and the\n * spy takes over again.\n */\n private pinned: { readonly id: string; readonly y: number } | null = null;\n private lastY = 0;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('anchor');\n if (!this.platform.isBrowser) return;\n const measure = (): void => {\n const y = window.scrollY;\n const pin = this.pinned;\n if (pin) {\n const distance = Math.abs(pin.y - y);\n if (distance <= 1 || distance < Math.abs(pin.y - this.lastY)) {\n this.lastY = y;\n if (pin.id !== this.activeId()) this.zone.run(() => this.activeId.set(pin.id));\n return;\n }\n this.pinned = null;\n }\n this.lastY = y;\n const cursor = this.offset() + this.hitArea();\n let active: string | null = null;\n for (const id of this.flatIds()) {\n const el = document.getElementById(id);\n if (!el) continue;\n const top = el.getBoundingClientRect().top;\n if (top <= cursor) active = id;\n else break;\n }\n if (active !== this.activeId()) this.zone.run(() => this.activeId.set(active));\n };\n let frame = 0;\n const handler = (): void => {\n if (frame) return;\n frame = requestAnimationFrame(() => {\n frame = 0;\n measure();\n });\n };\n this.zone.runOutsideAngular(() => window.addEventListener('scroll', handler, { passive: true }));\n this.destroyRef.onDestroy(() => {\n window.removeEventListener('scroll', handler);\n if (frame) cancelAnimationFrame(frame);\n });\n // The first pass has to wait for a render: the targets are elsewhere on the\n // page and are usually rendered AFTER this list, so a constructor-time pass\n // found nothing by `getElementById` and left the page with no highlight at\n // all until the reader happened to scroll.\n afterNextRender(() => measure());\n }\n\n protected onClick(id: string, event: MouseEvent): void {\n event.preventDefault();\n const target = document.getElementById(id);\n if (target) {\n // Where `WrScroll` sends the page, clamped the way the browser clamps it.\n const root = document.documentElement;\n const max = Math.max(0, root.scrollHeight - root.clientHeight);\n const y = target.getBoundingClientRect().top + window.scrollY - this.offset();\n this.pinned = { id, y: Math.min(max, Math.max(0, y)) };\n this.lastY = window.scrollY;\n }\n this.scroll.to(`#${id}`, { offset: this.offset() });\n this.activeId.set(id);\n }\n}\n\nexport type { WrAnchorLink } from './types';\n","<ul class=\"wr-anchor__list\">\n @for (link of links(); track link.id) {\n <li class=\"wr-anchor__item\">\n <a\n class=\"wr-anchor__link\"\n [class.wr-anchor__link--active]=\"activeId() === link.id\"\n [attr.aria-current]=\"activeId() === link.id ? 'location' : null\"\n [href]=\"`#${link.id}`\"\n (click)=\"onClick(link.id, $event)\"\n >\n {{ link.label }}\n </a>\n @if (link.children?.length) {\n <ul class=\"wr-anchor__list wr-anchor__list--nested\">\n @for (child of link.children; track child.id) {\n <li class=\"wr-anchor__item\">\n <a\n class=\"wr-anchor__link\"\n [class.wr-anchor__link--active]=\"activeId() === child.id\"\n [attr.aria-current]=\"activeId() === child.id ? 'location' : null\"\n [href]=\"`#${child.id}`\"\n (click)=\"onClick(child.id, $event)\"\n >\n {{ child.label }}\n </a>\n </li>\n }\n </ul>\n }\n </li>\n }\n</ul>\n"],"mappings":";;;;;;;;;;;;;AAsDA,IAAa,WAAb,MAAa,SAAQ;CAMV,QAAQ,MAA+B,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAO1C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,gBAAgB,mBAAmB;CAG7F,SAAS,MAAM,GAAC;EAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,KAAK,IAAI,GAAG,qBAAqB,GAAG,CAAC,CAAC;CAAC,CAAA;CAG9F,UAAU,MAAM,IAAE;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,YAAY,MAAuB,KAAK,IAAI,GAAG,qBAAqB,GAAG,EAAE,CAAC;CAAC,CAAA;CAEvF,WAAW,OAAsB,MAAK,GAAA,YAAA,CAAA,EAAA,W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;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,aAAA;GAAA,YAAA,EAAA,mBAAA,sBAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UCtDrB;EAgCA,eAAA,GAAA,kBAAA;CAAA,CAAA;;ADsBa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAQ,YAAA,CAAA;EANpB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAW,eAEN,kBAAkB;GAAI,MAC/B;IAAE,OAAO;IAAa,MAAM;IAAc,qBAAqB;GAAqB;GAAE,UAAA;EAAA,CAAA"}
@@ -784,7 +784,7 @@ var WrAurora = class WrAurora {
784
784
  }
785
785
  static ɵfac = i0.ɵɵngDeclareFactory({
786
786
  minVersion: "12.0.0",
787
- version: "22.2.5",
787
+ version: "22.2.6",
788
788
  ngImport: i0,
789
789
  type: WrAurora,
790
790
  deps: [],
@@ -792,7 +792,7 @@ var WrAurora = class WrAurora {
792
792
  });
793
793
  static ɵcmp = i0.ɵɵngDeclareComponent({
794
794
  minVersion: "17.2.0",
795
- version: "22.2.5",
795
+ version: "22.2.6",
796
796
  type: WrAurora,
797
797
  isStandalone: true,
798
798
  selector: "wr-aurora",
@@ -886,7 +886,7 @@ var WrAurora = class WrAurora {
886
886
  };
887
887
  i0.ɵɵngDeclareClassMetadata({
888
888
  minVersion: "12.0.0",
889
- version: "22.2.5",
889
+ version: "22.2.6",
890
890
  ngImport: i0,
891
891
  type: WrAurora,
892
892
  decorators: [{