ngwr 16.6.0 → 16.7.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 (318) hide show
  1. package/avatar/styles/_index.scss +39 -0
  2. package/button/styles/_index.scss +45 -2
  3. package/copy-value/styles/_index.scss +4 -0
  4. package/dropdown/styles/_index.scss +17 -0
  5. package/fesm2022/ngwr-affix.mjs +3 -3
  6. package/fesm2022/ngwr-alert.mjs +3 -3
  7. package/fesm2022/ngwr-anchor.mjs +3 -3
  8. package/fesm2022/ngwr-animations-aurora.mjs +3 -3
  9. package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
  10. package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
  11. package/fesm2022/ngwr-animations-confetti.mjs +3 -3
  12. package/fesm2022/ngwr-animations-decode.mjs +3 -3
  13. package/fesm2022/ngwr-animations-destruct.mjs +3 -3
  14. package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
  15. package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
  16. package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
  17. package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
  18. package/fesm2022/ngwr-animations-glitch.mjs +3 -3
  19. package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
  20. package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
  21. package/fesm2022/ngwr-animations-marquee.mjs +4 -3
  22. package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
  23. package/fesm2022/ngwr-animations-orbit.mjs +3 -3
  24. package/fesm2022/ngwr-animations-reveal.mjs +3 -3
  25. package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
  26. package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
  27. package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
  28. package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
  29. package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
  30. package/fesm2022/ngwr-animations-tilt.mjs +3 -3
  31. package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
  32. package/fesm2022/ngwr-avatar.mjs +171 -6
  33. package/fesm2022/ngwr-avatar.mjs.map +1 -1
  34. package/fesm2022/ngwr-back-top.mjs +3 -3
  35. package/fesm2022/ngwr-badge.mjs +6 -6
  36. package/fesm2022/ngwr-breadcrumbs.mjs +9 -8
  37. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  38. package/fesm2022/ngwr-burger.mjs +3 -3
  39. package/fesm2022/ngwr-button.mjs +26 -6
  40. package/fesm2022/ngwr-button.mjs.map +1 -1
  41. package/fesm2022/ngwr-calendar.mjs +3 -3
  42. package/fesm2022/ngwr-card.mjs +9 -9
  43. package/fesm2022/ngwr-carousel.mjs +6 -6
  44. package/fesm2022/ngwr-cascader.mjs +5 -5
  45. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  46. package/fesm2022/ngwr-charts-bar-chart.mjs +3 -3
  47. package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
  48. package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
  49. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
  50. package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
  51. package/fesm2022/ngwr-charts-chart-legend.mjs +9 -9
  52. package/fesm2022/ngwr-charts-core.mjs +6 -6
  53. package/fesm2022/ngwr-charts-donut-chart.mjs +3 -3
  54. package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
  55. package/fesm2022/ngwr-charts-gauge.mjs +3 -3
  56. package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
  57. package/fesm2022/ngwr-charts-line-chart.mjs +3 -3
  58. package/fesm2022/ngwr-charts-meter-group.mjs +3 -3
  59. package/fesm2022/ngwr-charts-radar-chart.mjs +3 -3
  60. package/fesm2022/ngwr-charts-scatter-chart.mjs +3 -3
  61. package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
  62. package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
  63. package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
  64. package/fesm2022/ngwr-checkbox.mjs +6 -6
  65. package/fesm2022/ngwr-clipboard.mjs +3 -3
  66. package/fesm2022/ngwr-collapse.mjs +9 -9
  67. package/fesm2022/ngwr-color-picker.mjs +6 -6
  68. package/fesm2022/ngwr-command-palette.mjs +3 -3
  69. package/fesm2022/ngwr-comment.mjs +7 -6
  70. package/fesm2022/ngwr-comment.mjs.map +1 -1
  71. package/fesm2022/ngwr-compare.mjs +3 -3
  72. package/fesm2022/ngwr-context-menu.mjs +12 -12
  73. package/fesm2022/ngwr-cookie.mjs +3 -3
  74. package/fesm2022/ngwr-copy-value.mjs +3 -3
  75. package/fesm2022/ngwr-counter.mjs +6 -6
  76. package/fesm2022/ngwr-date-picker-testing.mjs +35 -0
  77. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  78. package/fesm2022/ngwr-date-picker.mjs +102 -53
  79. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  80. package/fesm2022/ngwr-date-stamp.mjs +3 -3
  81. package/fesm2022/ngwr-date.mjs +40 -16
  82. package/fesm2022/ngwr-date.mjs.map +1 -1
  83. package/fesm2022/ngwr-density.mjs +6 -6
  84. package/fesm2022/ngwr-descriptions.mjs +6 -6
  85. package/fesm2022/ngwr-dialog.mjs +19 -18
  86. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  87. package/fesm2022/ngwr-directives.mjs +181 -18
  88. package/fesm2022/ngwr-directives.mjs.map +1 -1
  89. package/fesm2022/ngwr-divider.mjs +3 -3
  90. package/fesm2022/ngwr-drawer.mjs +18 -18
  91. package/fesm2022/ngwr-dropdown-testing.mjs +5 -1
  92. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  93. package/fesm2022/ngwr-dropdown.mjs +59 -16
  94. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  95. package/fesm2022/ngwr-editor.mjs +6 -5
  96. package/fesm2022/ngwr-editor.mjs.map +1 -1
  97. package/fesm2022/ngwr-empty.mjs +3 -3
  98. package/fesm2022/ngwr-event-calendar.mjs +7 -6
  99. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  100. package/fesm2022/ngwr-file-upload-testing.mjs +5 -0
  101. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  102. package/fesm2022/ngwr-file-upload.mjs +68 -13
  103. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  104. package/fesm2022/ngwr-form.mjs +18 -16
  105. package/fesm2022/ngwr-form.mjs.map +1 -1
  106. package/fesm2022/ngwr-graph-testing.mjs +30 -0
  107. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  108. package/fesm2022/ngwr-graph.mjs +100 -11
  109. package/fesm2022/ngwr-graph.mjs.map +1 -1
  110. package/fesm2022/ngwr-hotkey.mjs +6 -6
  111. package/fesm2022/ngwr-i18n-ar.mjs +6 -2
  112. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-cs.mjs +6 -2
  114. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-de.mjs +6 -2
  116. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-en.mjs +6 -2
  118. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-es.mjs +6 -2
  120. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-fr.mjs +6 -2
  122. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-he.mjs +6 -2
  124. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n-hi.mjs +6 -2
  126. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  127. package/fesm2022/ngwr-i18n-id.mjs +6 -2
  128. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  129. package/fesm2022/ngwr-i18n-it.mjs +6 -2
  130. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  131. package/fesm2022/ngwr-i18n-ja.mjs +6 -2
  132. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  133. package/fesm2022/ngwr-i18n-kk.mjs +520 -0
  134. package/fesm2022/ngwr-i18n-kk.mjs.map +1 -0
  135. package/fesm2022/ngwr-i18n-ko.mjs +6 -2
  136. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  137. package/fesm2022/ngwr-i18n-nl.mjs +6 -2
  138. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  139. package/fesm2022/ngwr-i18n-pl.mjs +6 -2
  140. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  141. package/fesm2022/ngwr-i18n-pt.mjs +6 -2
  142. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  143. package/fesm2022/ngwr-i18n-ru.mjs +6 -2
  144. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  145. package/fesm2022/ngwr-i18n-sv.mjs +6 -2
  146. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  147. package/fesm2022/ngwr-i18n-tr.mjs +6 -2
  148. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  149. package/fesm2022/ngwr-i18n-uk.mjs +6 -2
  150. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  151. package/fesm2022/ngwr-i18n-vi.mjs +6 -2
  152. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  153. package/fesm2022/ngwr-i18n-zh-tw.mjs +6 -2
  154. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  155. package/fesm2022/ngwr-i18n-zh.mjs +6 -2
  156. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  157. package/fesm2022/ngwr-i18n.mjs +9 -9
  158. package/fesm2022/ngwr-icon.mjs +6 -6
  159. package/fesm2022/ngwr-image-cropper.mjs +8 -4
  160. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  161. package/fesm2022/ngwr-input-number.mjs +3 -3
  162. package/fesm2022/ngwr-input-otp.mjs +3 -3
  163. package/fesm2022/ngwr-input.mjs +15 -15
  164. package/fesm2022/ngwr-keyboard.mjs +3 -3
  165. package/fesm2022/ngwr-knob.mjs +3 -3
  166. package/fesm2022/ngwr-layout.mjs +15 -15
  167. package/fesm2022/ngwr-lightbox.mjs +8 -8
  168. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  169. package/fesm2022/ngwr-list.mjs +8 -8
  170. package/fesm2022/ngwr-list.mjs.map +1 -1
  171. package/fesm2022/ngwr-load-state.mjs +16 -15
  172. package/fesm2022/ngwr-load-state.mjs.map +1 -1
  173. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  174. package/fesm2022/ngwr-mention.mjs +6 -6
  175. package/fesm2022/ngwr-meta.mjs +6 -6
  176. package/fesm2022/ngwr-overlay.mjs +9 -9
  177. package/fesm2022/ngwr-page-header.mjs +3 -3
  178. package/fesm2022/ngwr-pagination-testing.mjs +3 -0
  179. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  180. package/fesm2022/ngwr-pagination.mjs +32 -5
  181. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  182. package/fesm2022/ngwr-pipes.mjs +27 -27
  183. package/fesm2022/ngwr-platform.mjs +9 -9
  184. package/fesm2022/ngwr-popconfirm.mjs +7 -6
  185. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  186. package/fesm2022/ngwr-popover.mjs +115 -15
  187. package/fesm2022/ngwr-popover.mjs.map +1 -1
  188. package/fesm2022/ngwr-progress.mjs +75 -10
  189. package/fesm2022/ngwr-progress.mjs.map +1 -1
  190. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  191. package/fesm2022/ngwr-qr.mjs +3 -3
  192. package/fesm2022/ngwr-radio.mjs +6 -6
  193. package/fesm2022/ngwr-rating.mjs +3 -3
  194. package/fesm2022/ngwr-resizable.mjs +3 -3
  195. package/fesm2022/ngwr-result.mjs +12 -12
  196. package/fesm2022/ngwr-schema-form.mjs +10 -6
  197. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  198. package/fesm2022/ngwr-scroll.mjs +232 -7
  199. package/fesm2022/ngwr-scroll.mjs.map +1 -1
  200. package/fesm2022/ngwr-segmented.mjs +3 -3
  201. package/fesm2022/ngwr-select.mjs +28 -19
  202. package/fesm2022/ngwr-select.mjs.map +1 -1
  203. package/fesm2022/ngwr-sidebar-testing.mjs +17 -1
  204. package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -1
  205. package/fesm2022/ngwr-sidebar.mjs +66 -11
  206. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  207. package/fesm2022/ngwr-skeleton.mjs +3 -3
  208. package/fesm2022/ngwr-slider.mjs +3 -3
  209. package/fesm2022/ngwr-sortable-list.mjs +11 -11
  210. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  211. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  212. package/fesm2022/ngwr-spinner.mjs +3 -3
  213. package/fesm2022/ngwr-splitter.mjs +3 -3
  214. package/fesm2022/ngwr-statistic.mjs +9 -9
  215. package/fesm2022/ngwr-stepper.mjs +6 -6
  216. package/fesm2022/ngwr-storage.mjs +3 -3
  217. package/fesm2022/ngwr-switch.mjs +3 -3
  218. package/fesm2022/ngwr-table-router.mjs +89 -0
  219. package/fesm2022/ngwr-table-router.mjs.map +1 -0
  220. package/fesm2022/ngwr-table-testing.mjs +5 -0
  221. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  222. package/fesm2022/ngwr-table.mjs +268 -42
  223. package/fesm2022/ngwr-table.mjs.map +1 -1
  224. package/fesm2022/ngwr-tabs-router.mjs +9 -5
  225. package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
  226. package/fesm2022/ngwr-tabs-testing.mjs +8 -1
  227. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  228. package/fesm2022/ngwr-tabs.mjs +60 -10
  229. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  230. package/fesm2022/ngwr-textarea.mjs +3 -3
  231. package/fesm2022/ngwr-theme.mjs +3 -3
  232. package/fesm2022/ngwr-timeline.mjs +6 -6
  233. package/fesm2022/ngwr-toast.mjs +15 -15
  234. package/fesm2022/ngwr-toolbar.mjs +3 -3
  235. package/fesm2022/ngwr-tour.mjs +7 -6
  236. package/fesm2022/ngwr-tour.mjs.map +1 -1
  237. package/fesm2022/ngwr-transfer.mjs +4 -3
  238. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  239. package/fesm2022/ngwr-tree.mjs +3 -3
  240. package/fesm2022/ngwr-typography.mjs +3 -3
  241. package/fesm2022/ngwr-utils-router.mjs +3 -3
  242. package/fesm2022/ngwr-utils.mjs +30 -2
  243. package/fesm2022/ngwr-utils.mjs.map +1 -1
  244. package/fesm2022/ngwr-version.mjs +1 -1
  245. package/fesm2022/ngwr-version.mjs.map +1 -1
  246. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  247. package/fesm2022/ngwr-window.mjs +18 -13
  248. package/fesm2022/ngwr-window.mjs.map +1 -1
  249. package/file-upload/styles/_index.scss +16 -0
  250. package/graph/styles/_index.scss +48 -0
  251. package/i18n/ar.json +4 -2
  252. package/i18n/cs.json +4 -2
  253. package/i18n/de.json +4 -2
  254. package/i18n/en.json +4 -2
  255. package/i18n/es.json +4 -2
  256. package/i18n/fr.json +4 -2
  257. package/i18n/he.json +4 -2
  258. package/i18n/hi.json +4 -2
  259. package/i18n/id.json +4 -2
  260. package/i18n/it.json +4 -2
  261. package/i18n/ja.json +4 -2
  262. package/i18n/kk.json +567 -0
  263. package/i18n/ko.json +4 -2
  264. package/i18n/nl.json +4 -2
  265. package/i18n/pl.json +4 -2
  266. package/i18n/pt.json +4 -2
  267. package/i18n/ru.json +4 -2
  268. package/i18n/sv.json +4 -2
  269. package/i18n/tr.json +4 -2
  270. package/i18n/uk.json +4 -2
  271. package/i18n/vi.json +4 -2
  272. package/i18n/zh-TW.json +4 -2
  273. package/i18n/zh.json +4 -2
  274. package/llms-full.txt +29 -18
  275. package/llms.txt +4 -1
  276. package/package.json +15 -7
  277. package/pagination/styles/_index.scss +6 -0
  278. package/popover/styles/_index.scss +4 -2
  279. package/progress/styles/_index.scss +64 -0
  280. package/schematics/use/symbol-map.json +5 -0
  281. package/sidebar/styles/_index.scss +58 -6
  282. package/skills/ngwr/SKILL.md +7 -6
  283. package/skills/ngwr/references/catalog.md +6 -4
  284. package/table/styles/_index.scss +121 -32
  285. package/tabs/styles/_index.scss +9 -0
  286. package/theme/styles/_focus.scss +3 -1
  287. package/tour/styles/_index.scss +3 -2
  288. package/types/ngwr-avatar.d.ts +39 -0
  289. package/types/ngwr-button.d.ts +12 -0
  290. package/types/ngwr-date-picker-testing.d.ts +22 -0
  291. package/types/ngwr-date-picker.d.ts +78 -17
  292. package/types/ngwr-date.d.ts +51 -0
  293. package/types/ngwr-directives.d.ts +45 -0
  294. package/types/ngwr-dropdown-testing.d.ts +8 -1
  295. package/types/ngwr-dropdown.d.ts +29 -0
  296. package/types/ngwr-file-upload-testing.d.ts +10 -0
  297. package/types/ngwr-file-upload.d.ts +55 -1
  298. package/types/ngwr-form.d.ts +3 -1
  299. package/types/ngwr-graph-testing.d.ts +28 -1
  300. package/types/ngwr-graph.d.ts +53 -3
  301. package/types/ngwr-i18n-kk.d.ts +3 -0
  302. package/types/ngwr-image-cropper.d.ts +6 -0
  303. package/types/ngwr-pagination-testing.d.ts +8 -0
  304. package/types/ngwr-pagination.d.ts +16 -0
  305. package/types/ngwr-popover.d.ts +39 -0
  306. package/types/ngwr-progress.d.ts +63 -1
  307. package/types/ngwr-scroll.d.ts +86 -0
  308. package/types/ngwr-select.d.ts +31 -12
  309. package/types/ngwr-sidebar-testing.d.ts +21 -7
  310. package/types/ngwr-sidebar.d.ts +66 -4
  311. package/types/ngwr-table-router.d.ts +49 -0
  312. package/types/ngwr-table-testing.d.ts +7 -0
  313. package/types/ngwr-table.d.ts +184 -6
  314. package/types/ngwr-tabs-router.d.ts +1 -1
  315. package/types/ngwr-tabs-testing.d.ts +5 -1
  316. package/types/ngwr-tabs.d.ts +34 -1
  317. package/types/ngwr-utils.d.ts +13 -0
  318. package/types/ngwr-version.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-animations-marquee.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/marquee/marquee.ts","../../../projects/lib/animations/marquee/marquee.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 { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrMarqueeItem, WrMarqueeItemContext } from './types';\n\n/** How fast the row travels when `speed` is not set, in px per second. */\nconst MARQUEE_SPEED = 40;\n\n/**\n * A row of links that glides sideways in an endless loop, each item entering\n * under a soft fade at one end and leaving under the other.\n *\n * The loop is one CSS animation on a belt that holds the list twice, moving\n * by exactly the measured width of one copy, so the frame the cycle ends on\n * is the frame it began on and the seam never shows. The width is read once\n * the browser has laid the row out, again when its size changes (a font that\n * finishes loading, a resize) and the duration is that width over `speed`,\n * so the row moves at the same px per second whatever is in it. Nothing but\n * `translate` animates, declared paused and set running by one modifier, so a\n * pause keeps the phase: the row picks up where it stopped. It stops off\n * screen, while the document is hidden, under the pointer, while focus is in\n * it, and on the pause button at its end (WCAG 2.2.2).\n *\n * An item renders as a plain `<a href>` by default. A projected\n * `<ng-template let-item>` renders it instead, with the item as `$implicit`,\n * and its anchor carries the link's class `wr-marquee__link`: that is where a\n * `routerLink` goes, since the library never imports the router itself.\n *\n * A keyboard user who tabs into a link gets a still row: while focus is in\n * the belt the animation is off and the viewport scrolls natively, and the\n * link is brought into view, so what has focus is what can be seen. Leaving\n * resumes the loop. Under `prefers-reduced-motion: reduce` the row never\n * moves: one copy, scrollable, with the fade. The second copy is\n * presentational, `aria-hidden` and `inert`, so a screen reader hears the list\n * once, as a list of links named by `label`. With `pausable`, the pause button's name comes\n * from the i18n catalog (`marquee.pause`, `marquee.play`) unless `pauseLabel`\n * and `playLabel` say otherwise. The server renders the one copy as a still\n * row; the loop starts from the same picture, so nothing shifts. Styles:\n * `@use 'ngwr/animations/marquee'`, which also lists the `--wr-marquee-*` hooks.\n */\n@Component({\n selector: 'wr-marquee',\n templateUrl: './marquee.html',\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, WrButton],\n host: {\n class: 'wr-marquee',\n '[class.wr-marquee--loop]': 'looping()',\n '[class.wr-marquee--run]': 'running()',\n '[class.wr-marquee--static]': 'still()',\n '(pointerenter)': 'hovered.set(true)',\n '(pointerleave)': 'hovered.set(false)',\n '(focusin)': 'focused.set(true)',\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class WrMarquee {\n /** The links, in the order they pass. */\n readonly items = input.required<readonly WrMarqueeItem[]>();\n\n /** How fast the row travels, in px per second. @default 40 */\n readonly speed = input(MARQUEE_SPEED, { transform: wrNumAttr(MARQUEE_SPEED) });\n\n /** The accessible name of the list. */\n readonly label = input<string | null>(null);\n\n /** Renders the pause button at the row's end, the way to stop a row that runs on (WCAG 2.2.2). Hover and focus pause the row with or without it. @default false */\n readonly pausable = input(false, { transform: booleanAttribute });\n\n /** The pause button's name while the row moves. Unset, the `marquee.pause` string of the i18n catalog, \"Pause\" in English. */\n readonly pauseLabel = input<string | null>(null);\n\n /** The pause button's name while the row stands. Unset, the `marquee.play` string of the i18n catalog, \"Play\" in English. */\n readonly playLabel = input<string | null>(null);\n\n /** The projected item template, when there is one; the plain anchor otherwise. */\n protected readonly itemTemplate = contentChild<TemplateRef<WrMarqueeItemContext>>(TemplateRef);\n\n protected readonly pauseText = useI18nText(this.pauseLabel, 'marquee.pause', 'Pause');\n protected readonly playText = useI18nText(this.playLabel, 'marquee.play', 'Play');\n\n /** The reader pressed pause. */\n protected readonly paused = signal(false);\n\n /** Focus is on a link in the belt: the row is still and scrolls natively. */\n protected readonly still = signal(false);\n\n /** The width of one copy of the list, in px, or `null` until measured. */\n protected readonly width = signal<number | null>(null);\n\n /** One copy's width as a length, for the belt's keyframe. */\n protected readonly shift = computed(() => {\n const width = this.width();\n return width === null ? null : `${width}px`;\n });\n\n /** One cycle, so the row moves `speed` px every second. */\n protected readonly duration = computed(() => {\n const width = this.width();\n const speed = this.speed();\n return width === null || speed <= 0 ? null : `${width / speed}s`;\n });\n\n /** The second copy is in the DOM and the animation is declared. */\n protected readonly looping = computed(() => this.ready() && !this.platform.prefersReducedMotion());\n\n /** One place decides whether the belt moves. */\n protected readonly running = computed(\n () =>\n this.looping() &&\n this.intersecting() &&\n this.platform.pageVisible() &&\n !this.hovered() &&\n !this.focused() &&\n !this.paused()\n );\n\n protected readonly hovered = signal(false);\n protected readonly focused = signal(false);\n private readonly intersecting = signal(false);\n /** `afterNextRender` ran in a browser that can loop. */\n private readonly ready = signal(false);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private viewObserver: IntersectionObserver | null = null;\n private sizeObserver: ResizeObserver | null = null;\n private listeners: AbortController | null = null;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/marquee');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n afterNextRender(() => {\n if (this.platform.prefersReducedMotion() || typeof IntersectionObserver === 'undefined') return;\n\n // Any part of the row on screen counts: a loop should not burn paint off\n // screen, and should not wait for the whole row to show either.\n this.viewObserver = new IntersectionObserver(entries =>\n this.intersecting.set(entries[entries.length - 1]?.isIntersecting ?? false)\n );\n this.viewObserver.observe(this.host.nativeElement);\n this.listen();\n this.ready.set(true);\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.viewObserver?.disconnect();\n this.viewObserver = null;\n this.sizeObserver?.disconnect();\n this.sizeObserver = null;\n this.listeners?.abort();\n this.listeners = null;\n });\n }\n\n protected toggle(): void {\n this.paused.update(paused => !paused);\n }\n\n /** Focus left the host altogether: a move from a link to the button keeps the pause. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.host.nativeElement.contains(next)) return;\n this.focused.set(false);\n }\n\n /**\n * A link took focus: the belt stands still and the viewport scrolls, and\n * once that state is painted the link is scrolled into view. The scroll\n * waits for the render, because the viewport is still `overflow: hidden`\n * and the belt still translated when the event fires.\n */\n protected onTrackFocusIn(event: FocusEvent): void {\n const target = event.target as HTMLElement | null;\n this.still.set(true);\n afterNextRender(() => target?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' }), {\n injector: this.injector,\n });\n }\n\n /** Focus left the belt: back to the loop, from the start of the row, not from wherever the viewport was scrolled to. */\n protected onTrackFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this.still.set(false);\n (event.currentTarget as HTMLElement).scrollLeft = 0;\n }\n\n /**\n * The width of one copy, read from the first track, which never moves within\n * the belt. A `ResizeObserver` on it reports the first layout, a font that\n * finishes loading and anything else that changes its size; without one,\n * one read now and another on resize and when the fonts are ready.\n */\n private listen(): void {\n const track = this.host.nativeElement.querySelector<HTMLElement>('.wr-marquee__track');\n if (!track) return;\n this.listeners = new AbortController();\n const options = { signal: this.listeners.signal, passive: true };\n if (typeof ResizeObserver !== 'undefined') {\n this.sizeObserver = new ResizeObserver(() => this.measure(track));\n this.sizeObserver.observe(track);\n } else {\n this.measure(track);\n this.doc.defaultView?.addEventListener('resize', () => this.measure(track), options);\n }\n const fonts = this.doc.fonts;\n if (fonts) {\n fonts.addEventListener('loadingdone', () => this.measure(track), options);\n void fonts.ready.then(() => {\n if (this.listeners) this.measure(track);\n });\n }\n }\n\n private measure(track: HTMLElement): void {\n const width = track.getBoundingClientRect().width;\n this.width.set(width > 0 ? width : null);\n }\n}\n\nexport { MARQUEE_SPEED };\n","<!-- One item when no template is projected: a plain link. -->\n<ng-template #plainItem let-item>\n <a class=\"wr-marquee__link\" [href]=\"item.url\">{{ item.title }}</a>\n</ng-template>\n\n<div class=\"wr-marquee__viewport\" (focusin)=\"onTrackFocusIn($event)\" (focusout)=\"onTrackFocusOut($event)\">\n <div class=\"wr-marquee__belt\" [style.--wr-marquee-shift]=\"shift()\" [style.--wr-marquee-duration]=\"duration()\">\n <ul class=\"wr-marquee__track\" [attr.aria-label]=\"label()\">\n @for (item of items(); track item.url) {\n <li class=\"wr-marquee__item\">\n <ng-container *ngTemplateOutlet=\"itemTemplate() ?? plainItem; context: { $implicit: item }\" />\n </li>\n }\n </ul>\n <!--\n The second copy is the picture only: hidden from readers and inert, so its\n links are out of the tab order, and the list is read once and tabbed once.\n -->\n @if (looping()) {\n <ul class=\"wr-marquee__track wr-marquee__track--copy\" aria-hidden=\"true\" inert>\n @for (item of items(); track item.url) {\n <li class=\"wr-marquee__item\">\n <ng-container *ngTemplateOutlet=\"itemTemplate() ?? plainItem; context: { $implicit: item }\" />\n </li>\n }\n </ul>\n }\n </div>\n</div>\n<!--\n The button is opt-in (`pausable`), and only a row that moves needs it: a still\n row (reduced motion, the server) has none. The glyph is a bare SVG, as the other entry points draw their own\n chrome, so the button needs no icon registered by the app.\n-->\n@if (pausable() && looping()) {\n <button\n wr-btn\n type=\"button\"\n class=\"wr-marquee__toggle\"\n size=\"sm\"\n [attr.aria-label]=\"paused() ? playText() : pauseText()\"\n (click)=\"toggle()\"\n >\n <span class=\"wr-marquee__glyph\" aria-hidden=\"true\">\n @if (paused()) {\n <svg class=\"wr-icon__svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M6 4.5a1 1 0 0 1 1.52-.86l12 7.5a1 1 0 0 1 0 1.72l-12 7.5A1 1 0 0 1 6 19.5z\" />\n </svg>\n } @else {\n <svg class=\"wr-icon__svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <rect x=\"5\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n </svg>\n }\n </span>\n </button>\n}\n"],"mappings":";;;;;;;;;;;;;AAmFA,IAAa,YAAb,MAAa,UAAS;CAEX,QAAQ,MAAM,SAAoC,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGlD,QAAQ,MAAA,IAAmB;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EAAI,WAAW,UAAA,EAAuB;CAAC,CAAA;CAGlE,QAAQ,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGlC,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAGrD,aAAa,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAGvC,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAG5B,eAAe,aAAgD,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CAE3E,YAAY,YAAY,KAAK,YAAY,iBAAiB,OAAO;CACjE,WAAW,YAAY,KAAK,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IAClB,aAAa;IACb,cAAc;GACf;GAAA,UAAA;EAAA,CAAA;CAsBiF,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,WAAW,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-animations-marquee.mjs","names":["DOCUMENT"],"sources":["../../../projects/lib/animations/marquee/marquee.ts","../../../projects/lib/animations/marquee/marquee.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 { DOCUMENT, NgTemplateOutlet, isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n Injector,\n PLATFORM_ID,\n TemplateRef,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n signal,\n} from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrNumAttr, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrMarqueeItem, WrMarqueeItemContext } from './types';\n\n/** How fast the row travels when `speed` is not set, in px per second. */\nconst MARQUEE_SPEED = 40;\n\n/**\n * A row of links that glides sideways in an endless loop, each item entering\n * under a soft fade at one end and leaving under the other.\n *\n * The loop is one CSS animation on a belt that holds the list twice, moving\n * by exactly the measured width of one copy, so the frame the cycle ends on\n * is the frame it began on and the seam never shows. The width is read once\n * the browser has laid the row out, again when its size changes (a font that\n * finishes loading, a resize) and the duration is that width over `speed`,\n * so the row moves at the same px per second whatever is in it. Nothing but\n * `translate` animates, declared paused and set running by one modifier, so a\n * pause keeps the phase: the row picks up where it stopped. It stops off\n * screen, while the document is hidden, under the pointer, while focus is in\n * it, and on the pause button at its end (WCAG 2.2.2).\n *\n * An item renders as a plain `<a href>` by default. A projected\n * `<ng-template let-item>` renders it instead, with the item as `$implicit`,\n * and its anchor carries the link's class `wr-marquee__link`: that is where a\n * `routerLink` goes, since the library never imports the router itself.\n *\n * A keyboard user who tabs into a link gets a still row: while focus is in\n * the belt the animation is off and the viewport scrolls natively, and the\n * link is brought into view, so what has focus is what can be seen. Leaving\n * resumes the loop. Under `prefers-reduced-motion: reduce` the row never\n * moves: one copy, scrollable, with the fade. The second copy is\n * presentational, `aria-hidden` and `inert`, so a screen reader hears the list\n * once, as a list of links named by `label`. With `pausable`, the pause button's name comes\n * from the i18n catalog (`marquee.pause`, `marquee.play`) unless `pauseLabel`\n * and `playLabel` say otherwise. The server renders the one copy as a still\n * row; the loop starts from the same picture, so nothing shifts. Styles:\n * `@use 'ngwr/animations/marquee'`, which also lists the `--wr-marquee-*` hooks.\n */\n@Component({\n selector: 'wr-marquee',\n templateUrl: './marquee.html',\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, WrButton],\n host: {\n class: 'wr-marquee',\n '[class.wr-marquee--loop]': 'looping()',\n '[class.wr-marquee--run]': 'running()',\n '[class.wr-marquee--static]': 'still()',\n '(pointerenter)': 'hovered.set(true)',\n '(pointerleave)': 'hovered.set(false)',\n '(focusin)': 'focused.set(true)',\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class WrMarquee {\n /** The links, in the order they pass. */\n readonly items = input.required<readonly WrMarqueeItem[]>();\n\n /** How fast the row travels, in px per second. @default 40 */\n readonly speed = input(MARQUEE_SPEED, { transform: wrNumAttr(MARQUEE_SPEED) });\n\n /** The accessible name of the list. */\n readonly label = input<string | null>(null);\n\n /** Renders the pause button at the row's end, the way to stop a row that runs on (WCAG 2.2.2). Hover and focus pause the row with or without it. @default false */\n readonly pausable = input(false, { transform: booleanAttribute });\n\n /** The pause button's name while the row moves. Unset, the `marquee.pause` string of the i18n catalog, \"Pause\" in English. */\n readonly pauseLabel = input<string | null>(null);\n\n /** The pause button's name while the row stands. Unset, the `marquee.play` string of the i18n catalog, \"Play\" in English. */\n readonly playLabel = input<string | null>(null);\n\n /** The projected item template, when there is one; the plain anchor otherwise. */\n protected readonly itemTemplate = contentChild<TemplateRef<WrMarqueeItemContext>>(TemplateRef);\n\n protected readonly pauseText = useI18nText(this.pauseLabel, 'marquee.pause', 'Pause');\n protected readonly playText = useI18nText(this.playLabel, 'marquee.play', 'Play');\n\n /** The reader pressed pause. */\n protected readonly paused = signal(false);\n\n /** Focus is on a link in the belt: the row is still and scrolls natively. */\n protected readonly still = signal(false);\n\n /** The width of one copy of the list, in px, or `null` until measured. */\n protected readonly width = signal<number | null>(null);\n\n /** One copy's width as a length, for the belt's keyframe. */\n protected readonly shift = computed(() => {\n const width = this.width();\n return width === null ? null : `${width}px`;\n });\n\n /** One cycle, so the row moves `speed` px every second. */\n protected readonly duration = computed(() => {\n const width = this.width();\n const speed = this.speed();\n return width === null || speed <= 0 ? null : `${width / speed}s`;\n });\n\n /** The second copy is in the DOM and the animation is declared. */\n protected readonly looping = computed(() => this.ready() && !this.platform.prefersReducedMotion());\n\n /** One place decides whether the belt moves. */\n protected readonly running = computed(\n () =>\n this.looping() &&\n this.intersecting() &&\n this.platform.pageVisible() &&\n !this.hovered() &&\n !this.focused() &&\n !this.paused()\n );\n\n protected readonly hovered = signal(false);\n protected readonly focused = signal(false);\n private readonly intersecting = signal(false);\n /** `afterNextRender` ran in a browser that can loop. */\n private readonly ready = signal(false);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly platform = inject(WrPlatform);\n private readonly doc = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private viewObserver: IntersectionObserver | null = null;\n private sizeObserver: ResizeObserver | null = null;\n private listeners: AbortController | null = null;\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('animations/marquee');\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n afterNextRender(() => {\n if (this.platform.prefersReducedMotion() || typeof IntersectionObserver === 'undefined') return;\n\n // Any part of the row on screen counts: a loop should not burn paint off\n // screen, and should not wait for the whole row to show either.\n this.viewObserver = new IntersectionObserver(entries =>\n this.intersecting.set(entries[entries.length - 1]?.isIntersecting ?? false)\n );\n this.viewObserver.observe(this.host.nativeElement);\n this.listen();\n this.ready.set(true);\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.viewObserver?.disconnect();\n this.viewObserver = null;\n this.sizeObserver?.disconnect();\n this.sizeObserver = null;\n this.listeners?.abort();\n this.listeners = null;\n });\n }\n\n protected toggle(): void {\n this.paused.update(paused => !paused);\n }\n\n /** Focus left the host altogether: a move from a link to the button keeps the pause. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.host.nativeElement.contains(next)) return;\n this.focused.set(false);\n }\n\n /**\n * A link took focus: the belt stands still and the viewport scrolls, and\n * once that state is painted the link is scrolled into view. The scroll\n * waits for the render, because the viewport is still `overflow: hidden`\n * and the belt still translated when the event fires.\n */\n protected onTrackFocusIn(event: FocusEvent): void {\n const target = event.target as HTMLElement | null;\n this.still.set(true);\n afterNextRender(() => target?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' }), {\n injector: this.injector,\n });\n }\n\n /** Focus left the belt: back to the loop, from the start of the row, not from wherever the viewport was scrolled to. */\n protected onTrackFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && (event.currentTarget as HTMLElement).contains(next)) return;\n this.still.set(false);\n (event.currentTarget as HTMLElement).scrollLeft = 0;\n }\n\n /**\n * The width of one copy, read from the first track, which never moves within\n * the belt. A `ResizeObserver` on it reports the first layout, a font that\n * finishes loading and anything else that changes its size; without one,\n * one read now and another on resize and when the fonts are ready.\n */\n private listen(): void {\n const track = this.host.nativeElement.querySelector<HTMLElement>('.wr-marquee__track');\n if (!track) return;\n this.listeners = new AbortController();\n const options = { signal: this.listeners.signal, passive: true };\n if (typeof ResizeObserver !== 'undefined') {\n this.sizeObserver = new ResizeObserver(() => this.measure(track));\n this.sizeObserver.observe(track);\n } else {\n this.measure(track);\n this.doc.defaultView?.addEventListener('resize', () => this.measure(track), options);\n }\n const fonts = this.doc.fonts;\n if (fonts) {\n fonts.addEventListener('loadingdone', () => this.measure(track), options);\n void fonts.ready.then(() => {\n if (this.listeners) this.measure(track);\n });\n }\n }\n\n private measure(track: HTMLElement): void {\n const width = track.getBoundingClientRect().width;\n this.width.set(width > 0 ? width : null);\n }\n}\n\nexport { MARQUEE_SPEED };\n","<!-- One item when no template is projected: a plain link. -->\n<ng-template #plainItem let-item>\n <a class=\"wr-marquee__link\" [href]=\"item.url\">{{ item.title }}</a>\n</ng-template>\n\n<div class=\"wr-marquee__viewport\" (focusin)=\"onTrackFocusIn($event)\" (focusout)=\"onTrackFocusOut($event)\">\n <div class=\"wr-marquee__belt\" [style.--wr-marquee-shift]=\"shift()\" [style.--wr-marquee-duration]=\"duration()\">\n <ul class=\"wr-marquee__track\" [attr.aria-label]=\"label()\">\n @for (item of items(); track item.url) {\n <li class=\"wr-marquee__item\">\n <ng-container *ngTemplateOutlet=\"itemTemplate() ?? plainItem; context: { $implicit: item }\" />\n </li>\n }\n </ul>\n <!--\n The second copy is the picture only: hidden from readers and inert, so its\n links are out of the tab order, and the list is read once and tabbed once.\n -->\n @if (looping()) {\n <ul class=\"wr-marquee__track wr-marquee__track--copy\" aria-hidden=\"true\" inert>\n @for (item of items(); track item.url) {\n <li class=\"wr-marquee__item\">\n <ng-container *ngTemplateOutlet=\"itemTemplate() ?? plainItem; context: { $implicit: item }\" />\n </li>\n }\n </ul>\n }\n </div>\n</div>\n<!--\n The button is opt-in (`pausable`), and only a row that moves needs it: a still\n row (reduced motion, the server) has none. The glyph is a bare SVG, as the other entry points draw their own\n chrome, so the button needs no icon registered by the app.\n-->\n@if (pausable() && looping()) {\n <button\n wr-btn\n type=\"button\"\n class=\"wr-marquee__toggle\"\n size=\"sm\"\n [attr.aria-label]=\"paused() ? playText() : pauseText()\"\n (click)=\"toggle()\"\n >\n <span class=\"wr-marquee__glyph\" aria-hidden=\"true\">\n @if (paused()) {\n <svg class=\"wr-icon__svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M6 4.5a1 1 0 0 1 1.52-.86l12 7.5a1 1 0 0 1 0 1.72l-12 7.5A1 1 0 0 1 6 19.5z\" />\n </svg>\n } @else {\n <svg class=\"wr-icon__svg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <rect x=\"5\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n </svg>\n }\n </span>\n </button>\n}\n"],"mappings":";;;;;;;;;;;;;AAmFA,IAAa,YAAb,MAAa,UAAS;CAEX,QAAQ,MA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A;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,WAAW,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -119,7 +119,7 @@ var WrOrbit = class WrOrbit {
119
119
  }
120
120
  static ɵfac = i0.ɵɵngDeclareFactory({
121
121
  minVersion: "12.0.0",
122
- version: "22.2.6",
122
+ version: "22.3.0",
123
123
  ngImport: i0,
124
124
  type: WrOrbit,
125
125
  deps: [],
@@ -127,7 +127,7 @@ var WrOrbit = class WrOrbit {
127
127
  });
128
128
  static ɵcmp = i0.ɵɵngDeclareComponent({
129
129
  minVersion: "17.2.0",
130
- version: "22.2.6",
130
+ version: "22.3.0",
131
131
  type: WrOrbit,
132
132
  isStandalone: true,
133
133
  selector: "wr-orbit",
@@ -189,7 +189,7 @@ var WrOrbit = class WrOrbit {
189
189
  };
190
190
  i0.ɵɵngDeclareClassMetadata({
191
191
  minVersion: "12.0.0",
192
- version: "22.2.6",
192
+ version: "22.3.0",
193
193
  ngImport: i0,
194
194
  type: WrOrbit,
195
195
  decorators: [{
@@ -105,7 +105,7 @@ var WrReveal = class WrReveal {
105
105
  }
106
106
  static ɵfac = i0.ɵɵngDeclareFactory({
107
107
  minVersion: "12.0.0",
108
- version: "22.2.6",
108
+ version: "22.3.0",
109
109
  ngImport: i0,
110
110
  type: WrReveal,
111
111
  deps: [],
@@ -113,7 +113,7 @@ var WrReveal = class WrReveal {
113
113
  });
114
114
  static ɵcmp = i0.ɵɵngDeclareComponent({
115
115
  minVersion: "17.0.0",
116
- version: "22.2.6",
116
+ version: "22.3.0",
117
117
  type: WrReveal,
118
118
  isStandalone: true,
119
119
  selector: "wr-reveal",
@@ -188,7 +188,7 @@ var WrReveal = class WrReveal {
188
188
  };
189
189
  i0.ɵɵngDeclareClassMetadata({
190
190
  minVersion: "12.0.0",
191
- version: "22.2.6",
191
+ version: "22.3.0",
192
192
  ngImport: i0,
193
193
  type: WrReveal,
194
194
  decorators: [{
@@ -241,7 +241,7 @@ var WrRippleGrid = class WrRippleGrid {
241
241
  }
242
242
  static ɵfac = i0.ɵɵngDeclareFactory({
243
243
  minVersion: "12.0.0",
244
- version: "22.2.6",
244
+ version: "22.3.0",
245
245
  ngImport: i0,
246
246
  type: WrRippleGrid,
247
247
  deps: [],
@@ -249,7 +249,7 @@ var WrRippleGrid = class WrRippleGrid {
249
249
  });
250
250
  static ɵcmp = i0.ɵɵngDeclareComponent({
251
251
  minVersion: "17.2.0",
252
- version: "22.2.6",
252
+ version: "22.3.0",
253
253
  type: WrRippleGrid,
254
254
  isStandalone: true,
255
255
  selector: "wr-ripple-grid",
@@ -278,7 +278,7 @@ var WrRippleGrid = class WrRippleGrid {
278
278
  };
279
279
  i0.ɵɵngDeclareClassMetadata({
280
280
  minVersion: "12.0.0",
281
- version: "22.2.6",
281
+ version: "22.3.0",
282
282
  ngImport: i0,
283
283
  type: WrRippleGrid,
284
284
  decorators: [{
@@ -149,7 +149,7 @@ var WrRotateReveal = class WrRotateReveal {
149
149
  }
150
150
  static ɵfac = i0.ɵɵngDeclareFactory({
151
151
  minVersion: "12.0.0",
152
- version: "22.2.6",
152
+ version: "22.3.0",
153
153
  ngImport: i0,
154
154
  type: WrRotateReveal,
155
155
  deps: [],
@@ -157,7 +157,7 @@ var WrRotateReveal = class WrRotateReveal {
157
157
  });
158
158
  static ɵcmp = i0.ɵɵngDeclareComponent({
159
159
  minVersion: "17.0.0",
160
- version: "22.2.6",
160
+ version: "22.3.0",
161
161
  type: WrRotateReveal,
162
162
  isStandalone: true,
163
163
  selector: "wr-rotate-reveal",
@@ -213,7 +213,7 @@ var WrRotateReveal = class WrRotateReveal {
213
213
  };
214
214
  i0.ɵɵngDeclareClassMetadata({
215
215
  minVersion: "12.0.0",
216
- version: "22.2.6",
216
+ version: "22.3.0",
217
217
  ngImport: i0,
218
218
  type: WrRotateReveal,
219
219
  decorators: [{
@@ -80,7 +80,7 @@ var WrShimmer = class WrShimmer {
80
80
  }
81
81
  static ɵfac = i0.ɵɵngDeclareFactory({
82
82
  minVersion: "12.0.0",
83
- version: "22.2.6",
83
+ version: "22.3.0",
84
84
  ngImport: i0,
85
85
  type: WrShimmer,
86
86
  deps: [],
@@ -88,7 +88,7 @@ var WrShimmer = class WrShimmer {
88
88
  });
89
89
  static ɵdir = i0.ɵɵngDeclareDirective({
90
90
  minVersion: "14.0.0",
91
- version: "22.2.6",
91
+ version: "22.3.0",
92
92
  type: WrShimmer,
93
93
  isStandalone: true,
94
94
  selector: "[wrShimmer]",
@@ -98,7 +98,7 @@ var WrShimmer = class WrShimmer {
98
98
  };
99
99
  i0.ɵɵngDeclareClassMetadata({
100
100
  minVersion: "12.0.0",
101
- version: "22.2.6",
101
+ version: "22.3.0",
102
102
  ngImport: i0,
103
103
  type: WrShimmer,
104
104
  decorators: [{
@@ -49,7 +49,7 @@ var WrSpotlight = class WrSpotlight {
49
49
  }
50
50
  static ɵfac = i0.ɵɵngDeclareFactory({
51
51
  minVersion: "12.0.0",
52
- version: "22.2.6",
52
+ version: "22.3.0",
53
53
  ngImport: i0,
54
54
  type: WrSpotlight,
55
55
  deps: [],
@@ -57,7 +57,7 @@ var WrSpotlight = class WrSpotlight {
57
57
  });
58
58
  static ɵdir = i0.ɵɵngDeclareDirective({
59
59
  minVersion: "14.0.0",
60
- version: "22.2.6",
60
+ version: "22.3.0",
61
61
  type: WrSpotlight,
62
62
  isStandalone: true,
63
63
  selector: "[wrSpotlight]",
@@ -67,7 +67,7 @@ var WrSpotlight = class WrSpotlight {
67
67
  };
68
68
  i0.ɵɵngDeclareClassMetadata({
69
69
  minVersion: "12.0.0",
70
- version: "22.2.6",
70
+ version: "22.3.0",
71
71
  ngImport: i0,
72
72
  type: WrSpotlight,
73
73
  decorators: [{
@@ -755,7 +755,7 @@ var WrThreadLines = class WrThreadLines {
755
755
  }
756
756
  static ɵfac = i0.ɵɵngDeclareFactory({
757
757
  minVersion: "12.0.0",
758
- version: "22.2.6",
758
+ version: "22.3.0",
759
759
  ngImport: i0,
760
760
  type: WrThreadLines,
761
761
  deps: [],
@@ -763,7 +763,7 @@ var WrThreadLines = class WrThreadLines {
763
763
  });
764
764
  static ɵcmp = i0.ɵɵngDeclareComponent({
765
765
  minVersion: "17.2.0",
766
- version: "22.2.6",
766
+ version: "22.3.0",
767
767
  type: WrThreadLines,
768
768
  isStandalone: true,
769
769
  selector: "wr-thread-lines",
@@ -836,7 +836,7 @@ var WrThreadLines = class WrThreadLines {
836
836
  };
837
837
  i0.ɵɵngDeclareClassMetadata({
838
838
  minVersion: "12.0.0",
839
- version: "22.2.6",
839
+ version: "22.3.0",
840
840
  ngImport: i0,
841
841
  type: WrThreadLines,
842
842
  decorators: [{
@@ -100,7 +100,7 @@ var WrTilt = class WrTilt {
100
100
  }
101
101
  static ɵfac = i0.ɵɵngDeclareFactory({
102
102
  minVersion: "12.0.0",
103
- version: "22.2.6",
103
+ version: "22.3.0",
104
104
  ngImport: i0,
105
105
  type: WrTilt,
106
106
  deps: [],
@@ -108,7 +108,7 @@ var WrTilt = class WrTilt {
108
108
  });
109
109
  static ɵdir = i0.ɵɵngDeclareDirective({
110
110
  minVersion: "14.0.0",
111
- version: "22.2.6",
111
+ version: "22.3.0",
112
112
  type: WrTilt,
113
113
  isStandalone: true,
114
114
  selector: "[wrTilt]",
@@ -118,7 +118,7 @@ var WrTilt = class WrTilt {
118
118
  };
119
119
  i0.ɵɵngDeclareClassMetadata({
120
120
  minVersion: "12.0.0",
121
- version: "22.2.6",
121
+ version: "22.3.0",
122
122
  ngImport: i0,
123
123
  type: WrTilt,
124
124
  decorators: [{
@@ -199,7 +199,7 @@ var WrTypewriter = class WrTypewriter {
199
199
  }
200
200
  static ɵfac = i0.ɵɵngDeclareFactory({
201
201
  minVersion: "12.0.0",
202
- version: "22.2.6",
202
+ version: "22.3.0",
203
203
  ngImport: i0,
204
204
  type: WrTypewriter,
205
205
  deps: [],
@@ -207,7 +207,7 @@ var WrTypewriter = class WrTypewriter {
207
207
  });
208
208
  static ɵcmp = i0.ɵɵngDeclareComponent({
209
209
  minVersion: "17.0.0",
210
- version: "22.2.6",
210
+ version: "22.3.0",
211
211
  type: WrTypewriter,
212
212
  isStandalone: true,
213
213
  selector: "wr-typewriter",
@@ -263,7 +263,7 @@ var WrTypewriter = class WrTypewriter {
263
263
  };
264
264
  i0.ɵɵngDeclareClassMetadata({
265
265
  minVersion: "12.0.0",
266
- version: "22.2.6",
266
+ version: "22.3.0",
267
267
  ngImport: i0,
268
268
  type: WrTypewriter,
269
269
  decorators: [{
@@ -1,8 +1,8 @@
1
1
  import * as i0 from "@angular/core";
2
- import { Component, LOCALE_ID, ViewEncapsulation, afterNextRender, computed, effect, inject, input, signal, untracked, viewChild } from "@angular/core";
2
+ import { Component, ElementRef, LOCALE_ID, Renderer2, ViewEncapsulation, afterNextRender, computed, contentChildren, effect, inject, input, signal, untracked, viewChild } from "@angular/core";
3
3
  import { coerceBooleanProperty } from "@angular/cdk/coercion";
4
4
  import { wrCheckStyles, wrInitials, wrResolveCssSize } from "ngwr/utils";
5
- import { useI18nText } from "ngwr/i18n";
5
+ import { useI18nFormatter, useI18nText } from "ngwr/i18n";
6
6
  import { WrSpinner } from "ngwr/spinner";
7
7
  /**
8
8
  * @license
@@ -99,7 +99,7 @@ var WrAvatar = class WrAvatar {
99
99
  }
100
100
  static ɵfac = i0.ɵɵngDeclareFactory({
101
101
  minVersion: "12.0.0",
102
- version: "22.2.6",
102
+ version: "22.3.0",
103
103
  ngImport: i0,
104
104
  type: WrAvatar,
105
105
  deps: [],
@@ -107,7 +107,7 @@ var WrAvatar = class WrAvatar {
107
107
  });
108
108
  static ɵcmp = i0.ɵɵngDeclareComponent({
109
109
  minVersion: "17.0.0",
110
- version: "22.2.6",
110
+ version: "22.3.0",
111
111
  type: WrAvatar,
112
112
  isStandalone: true,
113
113
  selector: "wr-avatar",
@@ -184,7 +184,7 @@ var WrAvatar = class WrAvatar {
184
184
  };
185
185
  i0.ɵɵngDeclareClassMetadata({
186
186
  minVersion: "12.0.0",
187
- version: "22.2.6",
187
+ version: "22.3.0",
188
188
  ngImport: i0,
189
189
  type: WrAvatar,
190
190
  decorators: [{
@@ -259,6 +259,171 @@ i0.ɵɵngDeclareClassMetadata({
259
259
  }]
260
260
  }
261
261
  });
262
- export { WrAvatar };
262
+ /**
263
+ * @license
264
+ *
265
+ * Use of this source code is governed by an MIT-style license that can be
266
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
267
+ */
268
+ function toMax(value) {
269
+ if (value === null || value === void 0 || value === "") return null;
270
+ const n = Math.floor(Number(value));
271
+ return Number.isFinite(n) && n >= 0 ? n : null;
272
+ }
273
+ const GROUP_HIDDEN = "data-wr-group-hidden";
274
+ var WrAvatarGroup = class WrAvatarGroup {
275
+ max = input(null, {
276
+ ...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
277
+ transform: toMax
278
+ });
279
+ label = input(null, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
280
+ avatars = contentChildren(WrAvatar, ...ngDevMode ? [{ debugName: "avatars" }] : /* istanbul ignore next */ []);
281
+ elements = contentChildren(WrAvatar, {
282
+ ...ngDevMode ? { debugName: "elements" } : /* istanbul ignore next */ {},
283
+ read: ElementRef
284
+ });
285
+ renderer = inject(Renderer2);
286
+ moreText = useI18nFormatter("avatar.more", "{{count}} more");
287
+ hiddenCount = computed(() => {
288
+ const max = this.max();
289
+ return max === null ? 0 : Math.max(0, this.avatars().length - max);
290
+ }, ...ngDevMode ? [{ debugName: "hiddenCount" }] : /* istanbul ignore next */ []);
291
+ moreName = computed(() => this.moreText({ count: this.hiddenCount() }), ...ngDevMode ? [{ debugName: "moreName" }] : /* istanbul ignore next */ []);
292
+ moreSize = computed(() => this.avatars()[0]?.size() ?? "6rem", ...ngDevMode ? [{ debugName: "moreSize" }] : /* istanbul ignore next */ []);
293
+ moreShape = computed(() => this.avatars()[0]?.shape() ?? "rounded", ...ngDevMode ? [{ debugName: "moreShape" }] : /* istanbul ignore next */ []);
294
+ constructor() {
295
+ if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("avatar");
296
+ effect(() => {
297
+ const max = this.max();
298
+ this.elements().forEach((el, i) => {
299
+ const node = el.nativeElement;
300
+ const ours = node.hasAttribute(GROUP_HIDDEN);
301
+ if (max !== null && i >= max) {
302
+ if (node.hasAttribute("hidden")) return;
303
+ this.renderer.setAttribute(node, "hidden", "");
304
+ this.renderer.setAttribute(node, GROUP_HIDDEN, "");
305
+ } else if (ours) {
306
+ this.renderer.removeAttribute(node, "hidden");
307
+ this.renderer.removeAttribute(node, GROUP_HIDDEN);
308
+ }
309
+ });
310
+ });
311
+ }
312
+ static ɵfac = i0.ɵɵngDeclareFactory({
313
+ minVersion: "12.0.0",
314
+ version: "22.3.0",
315
+ ngImport: i0,
316
+ type: WrAvatarGroup,
317
+ deps: [],
318
+ target: i0.ɵɵFactoryTarget.Component
319
+ });
320
+ static ɵcmp = i0.ɵɵngDeclareComponent({
321
+ minVersion: "17.0.0",
322
+ version: "22.3.0",
323
+ type: WrAvatarGroup,
324
+ isStandalone: true,
325
+ selector: "wr-avatar-group",
326
+ inputs: {
327
+ max: {
328
+ classPropertyName: "max",
329
+ publicName: "max",
330
+ isSignal: true,
331
+ isRequired: false,
332
+ transformFunction: null
333
+ },
334
+ label: {
335
+ classPropertyName: "label",
336
+ publicName: "label",
337
+ isSignal: true,
338
+ isRequired: false,
339
+ transformFunction: null
340
+ }
341
+ },
342
+ host: {
343
+ properties: {
344
+ "attr.role": "label() ? \"group\" : null",
345
+ "attr.aria-label": "label() || null"
346
+ },
347
+ classAttribute: "wr-avatar-group"
348
+ },
349
+ queries: [{
350
+ propertyName: "avatars",
351
+ predicate: WrAvatar,
352
+ isSignal: true
353
+ }, {
354
+ propertyName: "elements",
355
+ predicate: WrAvatar,
356
+ read: ElementRef,
357
+ isSignal: true
358
+ }],
359
+ ngImport: i0,
360
+ template: "<ng-content />\n\n@if (hiddenCount() > 0) {\n <!-- `role=\"img\"` makes the \"+N\" text presentational: the name says it once. -->\n <wr-avatar\n class=\"wr-avatar-group__more\"\n role=\"img\"\n [attr.aria-label]=\"moreName()\"\n [size]=\"moreSize()\"\n [shape]=\"moreShape()\"\n >+{{ hiddenCount() }}</wr-avatar\n >\n}\n",
361
+ dependencies: [{
362
+ kind: "component",
363
+ type: WrAvatar,
364
+ selector: "wr-avatar",
365
+ inputs: [
366
+ "url",
367
+ "alt",
368
+ "name",
369
+ "tint",
370
+ "shape",
371
+ "size"
372
+ ]
373
+ }],
374
+ encapsulation: i0.ViewEncapsulation.None
375
+ });
376
+ };
377
+ i0.ɵɵngDeclareClassMetadata({
378
+ minVersion: "12.0.0",
379
+ version: "22.3.0",
380
+ ngImport: i0,
381
+ type: WrAvatarGroup,
382
+ decorators: [{
383
+ type: Component,
384
+ args: [{
385
+ selector: "wr-avatar-group",
386
+ encapsulation: ViewEncapsulation.None,
387
+ host: {
388
+ class: "wr-avatar-group",
389
+ "[attr.role]": "label() ? \"group\" : null",
390
+ "[attr.aria-label]": "label() || null"
391
+ },
392
+ imports: [WrAvatar],
393
+ template: "<ng-content />\n\n@if (hiddenCount() > 0) {\n <!-- `role=\"img\"` makes the \"+N\" text presentational: the name says it once. -->\n <wr-avatar\n class=\"wr-avatar-group__more\"\n role=\"img\"\n [attr.aria-label]=\"moreName()\"\n [size]=\"moreSize()\"\n [shape]=\"moreShape()\"\n >+{{ hiddenCount() }}</wr-avatar\n >\n}\n"
394
+ }]
395
+ }],
396
+ ctorParameters: () => [],
397
+ propDecorators: {
398
+ max: [{
399
+ type: i0.Input,
400
+ args: [{
401
+ isSignal: true,
402
+ alias: "max",
403
+ required: false
404
+ }]
405
+ }],
406
+ label: [{
407
+ type: i0.Input,
408
+ args: [{
409
+ isSignal: true,
410
+ alias: "label",
411
+ required: false
412
+ }]
413
+ }],
414
+ avatars: [{
415
+ type: i0.ContentChildren,
416
+ args: [i0.forwardRef(() => WrAvatar), { isSignal: true }]
417
+ }],
418
+ elements: [{
419
+ type: i0.ContentChildren,
420
+ args: [i0.forwardRef(() => WrAvatar), {
421
+ read: ElementRef,
422
+ isSignal: true
423
+ }]
424
+ }]
425
+ }
426
+ });
427
+ export { WrAvatar, WrAvatarGroup };
263
428
 
264
429
  //# sourceMappingURL=ngwr-avatar.mjs.map