ngwr 15.0.1 → 15.2.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 (420) hide show
  1. package/anchor/styles/_index.scss +13 -2
  2. package/bits/aurora/styles/_rules.scss +11 -0
  3. package/bits/dot-grid/dot-grid.scss +1 -0
  4. package/bits/dot-grid/styles/_index.scss +8 -0
  5. package/bits/dot-grid/styles/_rules.scss +54 -0
  6. package/bits/iridescence/iridescence.scss +1 -0
  7. package/bits/iridescence/styles/_index.scss +8 -0
  8. package/bits/iridescence/styles/_rules.scss +72 -0
  9. package/bits/marquee/styles/_rules.scss +7 -3
  10. package/bits/ripple-grid/ripple-grid.scss +1 -0
  11. package/bits/ripple-grid/styles/_index.scss +8 -0
  12. package/bits/ripple-grid/styles/_rules.scss +63 -0
  13. package/bits/spotlight-card/styles/_rules.scss +7 -4
  14. package/bits/star-border/styles/_rules.scss +5 -2
  15. package/bits/threads/styles/_index.scss +8 -0
  16. package/bits/threads/styles/_rules.scss +76 -0
  17. package/bits/threads/threads.scss +1 -0
  18. package/bits/waves/styles/_rules.scss +8 -1
  19. package/charts/bar-chart/styles/_index.scss +607 -7
  20. package/charts/boxplot-chart/styles/_index.scss +297 -0
  21. package/charts/bullet-chart/styles/_index.scss +268 -0
  22. package/charts/calendar-heatmap/styles/_index.scss +25 -3
  23. package/charts/candlestick-chart/styles/_index.scss +307 -0
  24. package/charts/chart-legend/styles/_index.scss +143 -0
  25. package/charts/core/styles/_index.scss +30 -0
  26. package/charts/donut-chart/styles/_index.scss +39 -3
  27. package/charts/funnel-chart/styles/_index.scss +237 -0
  28. package/charts/gauge/styles/_index.scss +4 -2
  29. package/charts/heatmap-chart/styles/_index.scss +329 -0
  30. package/charts/line-chart/styles/_index.scss +141 -8
  31. package/charts/meter-group/styles/_index.scss +44 -13
  32. package/charts/radar-chart/styles/_index.scss +206 -0
  33. package/charts/scatter-chart/styles/_index.scss +245 -0
  34. package/charts/sparkline/styles/_index.scss +10 -1
  35. package/charts/treemap-chart/styles/_index.scss +215 -0
  36. package/charts/waterfall-chart/styles/_index.scss +321 -0
  37. package/collapse/styles/_index.scss +6 -1
  38. package/fesm2022/ngwr-affix.mjs +3 -3
  39. package/fesm2022/ngwr-alert.mjs +3 -3
  40. package/fesm2022/ngwr-anchor.mjs +3 -3
  41. package/fesm2022/ngwr-avatar.mjs +3 -3
  42. package/fesm2022/ngwr-back-top.mjs +3 -3
  43. package/fesm2022/ngwr-badge.mjs +6 -6
  44. package/fesm2022/ngwr-bits-aurora.mjs +30 -38
  45. package/fesm2022/ngwr-bits-aurora.mjs.map +1 -1
  46. package/fesm2022/ngwr-bits-blur-text.mjs +3 -3
  47. package/fesm2022/ngwr-bits-border-glow-testing.mjs.map +1 -1
  48. package/fesm2022/ngwr-bits-border-glow.mjs +11 -5
  49. package/fesm2022/ngwr-bits-border-glow.mjs.map +1 -1
  50. package/fesm2022/ngwr-bits-circular-text.mjs +3 -3
  51. package/fesm2022/ngwr-bits-click-spark.mjs +3 -3
  52. package/fesm2022/ngwr-bits-confetti.mjs +3 -3
  53. package/fesm2022/ngwr-bits-decrypt-text.mjs +3 -3
  54. package/fesm2022/ngwr-bits-dot-grid-testing.mjs +40 -0
  55. package/fesm2022/ngwr-bits-dot-grid-testing.mjs.map +1 -0
  56. package/fesm2022/ngwr-bits-dot-grid.mjs +482 -0
  57. package/fesm2022/ngwr-bits-dot-grid.mjs.map +1 -0
  58. package/fesm2022/ngwr-bits-falling-text.mjs +3 -3
  59. package/fesm2022/ngwr-bits-fuzzy-text.mjs +3 -3
  60. package/fesm2022/ngwr-bits-glitch-text.mjs +3 -3
  61. package/fesm2022/ngwr-bits-gradient-text.mjs +3 -3
  62. package/fesm2022/ngwr-bits-iridescence-testing.mjs +31 -0
  63. package/fesm2022/ngwr-bits-iridescence-testing.mjs.map +1 -0
  64. package/fesm2022/ngwr-bits-iridescence.mjs +591 -0
  65. package/fesm2022/ngwr-bits-iridescence.mjs.map +1 -0
  66. package/fesm2022/ngwr-bits-marquee-testing.mjs +1 -1
  67. package/fesm2022/ngwr-bits-marquee-testing.mjs.map +1 -1
  68. package/fesm2022/ngwr-bits-marquee.mjs +7 -7
  69. package/fesm2022/ngwr-bits-marquee.mjs.map +1 -1
  70. package/fesm2022/ngwr-bits-ripple-grid-testing.mjs +40 -0
  71. package/fesm2022/ngwr-bits-ripple-grid-testing.mjs.map +1 -0
  72. package/fesm2022/ngwr-bits-ripple-grid.mjs +805 -0
  73. package/fesm2022/ngwr-bits-ripple-grid.mjs.map +1 -0
  74. package/fesm2022/ngwr-bits-rotating-text.mjs +3 -3
  75. package/fesm2022/ngwr-bits-shiny-text.mjs +6 -6
  76. package/fesm2022/ngwr-bits-splash-cursor.mjs +3 -3
  77. package/fesm2022/ngwr-bits-split-text.mjs +3 -3
  78. package/fesm2022/ngwr-bits-spotlight-card-testing.mjs +1 -1
  79. package/fesm2022/ngwr-bits-spotlight-card-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-bits-spotlight-card.mjs +10 -10
  81. package/fesm2022/ngwr-bits-spotlight-card.mjs.map +1 -1
  82. package/fesm2022/ngwr-bits-star-border-testing.mjs +1 -1
  83. package/fesm2022/ngwr-bits-star-border-testing.mjs.map +1 -1
  84. package/fesm2022/ngwr-bits-star-border.mjs +7 -7
  85. package/fesm2022/ngwr-bits-star-border.mjs.map +1 -1
  86. package/fesm2022/ngwr-bits-threads-testing.mjs +41 -0
  87. package/fesm2022/ngwr-bits-threads-testing.mjs.map +1 -0
  88. package/fesm2022/ngwr-bits-threads.mjs +482 -0
  89. package/fesm2022/ngwr-bits-threads.mjs.map +1 -0
  90. package/fesm2022/ngwr-bits-tilt-card.mjs +6 -6
  91. package/fesm2022/ngwr-bits-typewriter.mjs +3 -3
  92. package/fesm2022/ngwr-bits-waves-testing.mjs.map +1 -1
  93. package/fesm2022/ngwr-bits-waves.mjs +60 -41
  94. package/fesm2022/ngwr-bits-waves.mjs.map +1 -1
  95. package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
  96. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  97. package/fesm2022/ngwr-burger.mjs +3 -3
  98. package/fesm2022/ngwr-button.mjs +6 -6
  99. package/fesm2022/ngwr-calendar.mjs +3 -3
  100. package/fesm2022/ngwr-card.mjs +9 -9
  101. package/fesm2022/ngwr-carousel.mjs +6 -6
  102. package/fesm2022/ngwr-cascader.mjs +5 -5
  103. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  104. package/fesm2022/ngwr-charts-bar-chart-testing.mjs +127 -3
  105. package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
  106. package/fesm2022/ngwr-charts-bar-chart.mjs +683 -49
  107. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  108. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +161 -0
  109. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -0
  110. package/fesm2022/ngwr-charts-boxplot-chart.mjs +517 -0
  111. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -0
  112. package/fesm2022/ngwr-charts-bullet-chart-testing.mjs +68 -0
  113. package/fesm2022/ngwr-charts-bullet-chart-testing.mjs.map +1 -0
  114. package/fesm2022/ngwr-charts-bullet-chart.mjs +459 -0
  115. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -0
  116. package/fesm2022/ngwr-charts-calendar-heatmap-testing.mjs +27 -0
  117. package/fesm2022/ngwr-charts-calendar-heatmap-testing.mjs.map +1 -1
  118. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +96 -17
  119. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  120. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +107 -0
  121. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -0
  122. package/fesm2022/ngwr-charts-candlestick-chart.mjs +508 -0
  123. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -0
  124. package/fesm2022/ngwr-charts-chart-legend-testing.mjs +126 -0
  125. package/fesm2022/ngwr-charts-chart-legend-testing.mjs.map +1 -0
  126. package/fesm2022/ngwr-charts-chart-legend.mjs +251 -0
  127. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -0
  128. package/fesm2022/ngwr-charts-core.mjs +383 -0
  129. package/fesm2022/ngwr-charts-core.mjs.map +1 -0
  130. package/fesm2022/ngwr-charts-donut-chart-testing.mjs +10 -1
  131. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  132. package/fesm2022/ngwr-charts-donut-chart.mjs +187 -31
  133. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  134. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +100 -0
  135. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -0
  136. package/fesm2022/ngwr-charts-funnel-chart.mjs +415 -0
  137. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -0
  138. package/fesm2022/ngwr-charts-gauge-testing.mjs +9 -3
  139. package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
  140. package/fesm2022/ngwr-charts-gauge.mjs +9 -15
  141. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  142. package/fesm2022/ngwr-charts-heatmap-chart-testing.mjs +120 -0
  143. package/fesm2022/ngwr-charts-heatmap-chart-testing.mjs.map +1 -0
  144. package/fesm2022/ngwr-charts-heatmap-chart.mjs +519 -0
  145. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -0
  146. package/fesm2022/ngwr-charts-line-chart-testing.mjs +43 -1
  147. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  148. package/fesm2022/ngwr-charts-line-chart.mjs +436 -122
  149. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  150. package/fesm2022/ngwr-charts-meter-group-testing.mjs +14 -2
  151. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  152. package/fesm2022/ngwr-charts-meter-group.mjs +101 -32
  153. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  154. package/fesm2022/ngwr-charts-radar-chart-testing.mjs +98 -0
  155. package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -0
  156. package/fesm2022/ngwr-charts-radar-chart.mjs +720 -0
  157. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -0
  158. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +132 -0
  159. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -0
  160. package/fesm2022/ngwr-charts-scatter-chart.mjs +545 -0
  161. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -0
  162. package/fesm2022/ngwr-charts-sparkline-testing.mjs.map +1 -1
  163. package/fesm2022/ngwr-charts-sparkline.mjs +14 -16
  164. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  165. package/fesm2022/ngwr-charts-treemap-chart-testing.mjs +103 -0
  166. package/fesm2022/ngwr-charts-treemap-chart-testing.mjs.map +1 -0
  167. package/fesm2022/ngwr-charts-treemap-chart.mjs +535 -0
  168. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -0
  169. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +131 -0
  170. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -0
  171. package/fesm2022/ngwr-charts-waterfall-chart.mjs +462 -0
  172. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -0
  173. package/fesm2022/ngwr-checkbox.mjs +6 -6
  174. package/fesm2022/ngwr-clipboard.mjs +3 -3
  175. package/fesm2022/ngwr-collapse.mjs +9 -9
  176. package/fesm2022/ngwr-color-picker.mjs +6 -6
  177. package/fesm2022/ngwr-command-palette.mjs +3 -3
  178. package/fesm2022/ngwr-compare.mjs +3 -3
  179. package/fesm2022/ngwr-context-menu.mjs +12 -12
  180. package/fesm2022/ngwr-cookie.mjs +3 -3
  181. package/fesm2022/ngwr-counter.mjs +6 -6
  182. package/fesm2022/ngwr-date-picker.mjs +21 -21
  183. package/fesm2022/ngwr-date.mjs +6 -6
  184. package/fesm2022/ngwr-density.mjs +6 -6
  185. package/fesm2022/ngwr-descriptions.mjs +6 -6
  186. package/fesm2022/ngwr-dialog.mjs +15 -15
  187. package/fesm2022/ngwr-directives.mjs +12 -12
  188. package/fesm2022/ngwr-divider.mjs +3 -3
  189. package/fesm2022/ngwr-drawer.mjs +18 -18
  190. package/fesm2022/ngwr-dropdown.mjs +9 -9
  191. package/fesm2022/ngwr-editor.mjs +3 -3
  192. package/fesm2022/ngwr-empty.mjs +3 -3
  193. package/fesm2022/ngwr-event-calendar.mjs +6 -6
  194. package/fesm2022/ngwr-file-upload.mjs +3 -3
  195. package/fesm2022/ngwr-form.mjs +9 -9
  196. package/fesm2022/ngwr-graph.mjs +6 -6
  197. package/fesm2022/ngwr-hotkey.mjs +6 -6
  198. package/fesm2022/ngwr-i18n-ar.mjs +90 -4
  199. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  200. package/fesm2022/ngwr-i18n-cs.mjs +90 -4
  201. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  202. package/fesm2022/ngwr-i18n-de.mjs +90 -4
  203. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  204. package/fesm2022/ngwr-i18n-en.mjs +90 -4
  205. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  206. package/fesm2022/ngwr-i18n-es.mjs +90 -4
  207. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  208. package/fesm2022/ngwr-i18n-fr.mjs +90 -4
  209. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  210. package/fesm2022/ngwr-i18n-he.mjs +90 -4
  211. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  212. package/fesm2022/ngwr-i18n-hi.mjs +90 -4
  213. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  214. package/fesm2022/ngwr-i18n-id.mjs +90 -4
  215. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  216. package/fesm2022/ngwr-i18n-it.mjs +90 -4
  217. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  218. package/fesm2022/ngwr-i18n-ja.mjs +90 -4
  219. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  220. package/fesm2022/ngwr-i18n-ko.mjs +90 -4
  221. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  222. package/fesm2022/ngwr-i18n-nl.mjs +90 -4
  223. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  224. package/fesm2022/ngwr-i18n-pl.mjs +90 -4
  225. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  226. package/fesm2022/ngwr-i18n-pt.mjs +90 -4
  227. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  228. package/fesm2022/ngwr-i18n-ru.mjs +90 -4
  229. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  230. package/fesm2022/ngwr-i18n-sv.mjs +90 -4
  231. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  232. package/fesm2022/ngwr-i18n-tr.mjs +90 -4
  233. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  234. package/fesm2022/ngwr-i18n-uk.mjs +90 -4
  235. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  236. package/fesm2022/ngwr-i18n-vi.mjs +90 -4
  237. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  238. package/fesm2022/ngwr-i18n-zh-tw.mjs +90 -4
  239. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  240. package/fesm2022/ngwr-i18n-zh.mjs +90 -4
  241. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  242. package/fesm2022/ngwr-i18n.mjs +9 -9
  243. package/fesm2022/ngwr-icon.mjs +6 -6
  244. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  245. package/fesm2022/ngwr-input-number.mjs +3 -3
  246. package/fesm2022/ngwr-input-otp.mjs +3 -3
  247. package/fesm2022/ngwr-input.mjs +15 -15
  248. package/fesm2022/ngwr-keyboard.mjs +3 -3
  249. package/fesm2022/ngwr-knob.mjs +3 -3
  250. package/fesm2022/ngwr-layout.mjs +15 -15
  251. package/fesm2022/ngwr-lightbox.mjs +5 -5
  252. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  253. package/fesm2022/ngwr-list.mjs +8 -8
  254. package/fesm2022/ngwr-list.mjs.map +1 -1
  255. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  256. package/fesm2022/ngwr-mention.mjs +6 -6
  257. package/fesm2022/ngwr-meta.mjs +6 -6
  258. package/fesm2022/ngwr-overlay.mjs +6 -6
  259. package/fesm2022/ngwr-page-header.mjs +3 -3
  260. package/fesm2022/ngwr-pagination.mjs +3 -3
  261. package/fesm2022/ngwr-pipes.mjs +21 -21
  262. package/fesm2022/ngwr-platform.mjs +6 -6
  263. package/fesm2022/ngwr-popconfirm.mjs +6 -6
  264. package/fesm2022/ngwr-popover.mjs +43 -20
  265. package/fesm2022/ngwr-popover.mjs.map +1 -1
  266. package/fesm2022/ngwr-progress.mjs +3 -3
  267. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  268. package/fesm2022/ngwr-qr.mjs +4 -3
  269. package/fesm2022/ngwr-qr.mjs.map +1 -1
  270. package/fesm2022/ngwr-radio.mjs +6 -6
  271. package/fesm2022/ngwr-rating.mjs +3 -3
  272. package/fesm2022/ngwr-result.mjs +12 -12
  273. package/fesm2022/ngwr-schema-form.mjs +3 -3
  274. package/fesm2022/ngwr-scroll.mjs +3 -3
  275. package/fesm2022/ngwr-segmented.mjs +3 -3
  276. package/fesm2022/ngwr-select.mjs +12 -12
  277. package/fesm2022/ngwr-sidebar.mjs +3 -3
  278. package/fesm2022/ngwr-skeleton.mjs +3 -3
  279. package/fesm2022/ngwr-slider.mjs +3 -3
  280. package/fesm2022/ngwr-sortable-list.mjs +11 -11
  281. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  282. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  283. package/fesm2022/ngwr-spinner.mjs +3 -3
  284. package/fesm2022/ngwr-splitter.mjs +3 -3
  285. package/fesm2022/ngwr-statistic.mjs +9 -9
  286. package/fesm2022/ngwr-stepper.mjs +6 -6
  287. package/fesm2022/ngwr-storage.mjs +3 -3
  288. package/fesm2022/ngwr-switch.mjs +3 -3
  289. package/fesm2022/ngwr-table.mjs +18 -18
  290. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  291. package/fesm2022/ngwr-tabs.mjs +6 -6
  292. package/fesm2022/ngwr-textarea.mjs +3 -3
  293. package/fesm2022/ngwr-theme.mjs +3 -3
  294. package/fesm2022/ngwr-timeline.mjs +6 -6
  295. package/fesm2022/ngwr-toast-testing.mjs +2 -1
  296. package/fesm2022/ngwr-toast-testing.mjs.map +1 -1
  297. package/fesm2022/ngwr-toast.mjs +34 -15
  298. package/fesm2022/ngwr-toast.mjs.map +1 -1
  299. package/fesm2022/ngwr-toolbar.mjs +3 -3
  300. package/fesm2022/ngwr-tour.mjs +6 -6
  301. package/fesm2022/ngwr-transfer.mjs +3 -3
  302. package/fesm2022/ngwr-tree.mjs +3 -3
  303. package/fesm2022/ngwr-typography.mjs +3 -3
  304. package/fesm2022/ngwr-utils.mjs +31 -1
  305. package/fesm2022/ngwr-utils.mjs.map +1 -1
  306. package/fesm2022/ngwr-version.mjs +1 -1
  307. package/fesm2022/ngwr-version.mjs.map +1 -1
  308. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  309. package/fesm2022/ngwr-window-testing.mjs +61 -5
  310. package/fesm2022/ngwr-window-testing.mjs.map +1 -1
  311. package/fesm2022/ngwr-window.mjs +1538 -895
  312. package/fesm2022/ngwr-window.mjs.map +1 -1
  313. package/fesm2022/ngwr.mjs.map +1 -1
  314. package/i18n/ar.json +84 -4
  315. package/i18n/cs.json +84 -4
  316. package/i18n/de.json +84 -4
  317. package/i18n/en.json +84 -4
  318. package/i18n/es.json +84 -4
  319. package/i18n/fr.json +84 -4
  320. package/i18n/he.json +84 -4
  321. package/i18n/hi.json +84 -4
  322. package/i18n/id.json +84 -4
  323. package/i18n/it.json +84 -4
  324. package/i18n/ja.json +84 -4
  325. package/i18n/ko.json +84 -4
  326. package/i18n/nl.json +84 -4
  327. package/i18n/pl.json +84 -4
  328. package/i18n/pt.json +84 -4
  329. package/i18n/ru.json +84 -4
  330. package/i18n/sv.json +84 -4
  331. package/i18n/tr.json +84 -4
  332. package/i18n/uk.json +84 -4
  333. package/i18n/vi.json +84 -4
  334. package/i18n/zh-TW.json +84 -4
  335. package/i18n/zh.json +84 -4
  336. package/llms-full.txt +266 -9
  337. package/llms.txt +30 -7
  338. package/mcp/api.js +69 -1
  339. package/mcp/catalog.js +10 -1
  340. package/mcp/server.js +15 -1
  341. package/mcp/tools.js +122 -26
  342. package/package.json +132 -1
  343. package/popover/styles/_index.scss +75 -7
  344. package/schematics/component-style/index.js +3 -0
  345. package/schematics/migrations/v15/index.js +3 -26
  346. package/schematics/ng-add/index.js +2 -2
  347. package/schematics/use/symbol-map.json +14 -0
  348. package/schematics/utility/global-styles.js +19 -4
  349. package/schematics/utility/v15-moves.js +55 -0
  350. package/skills/ngwr/SKILL.md +8 -2
  351. package/skills/ngwr/references/catalog.md +28 -0
  352. package/skills/ngwr/references/setup.md +5 -4
  353. package/theme/styles/_focus.scss +8 -0
  354. package/toast/styles/_index.scss +103 -12
  355. package/types/ngwr-bits-aurora.d.ts +11 -0
  356. package/types/ngwr-bits-border-glow-testing.d.ts +5 -6
  357. package/types/ngwr-bits-border-glow.d.ts +5 -1
  358. package/types/ngwr-bits-dot-grid-testing.d.ts +92 -0
  359. package/types/ngwr-bits-dot-grid.d.ts +158 -0
  360. package/types/ngwr-bits-iridescence-testing.d.ts +85 -0
  361. package/types/ngwr-bits-iridescence.d.ts +244 -0
  362. package/types/ngwr-bits-ripple-grid-testing.d.ts +96 -0
  363. package/types/ngwr-bits-ripple-grid.d.ts +294 -0
  364. package/types/ngwr-bits-splash-cursor.d.ts +0 -1
  365. package/types/ngwr-bits-spotlight-card-testing.d.ts +3 -1
  366. package/types/ngwr-bits-star-border-testing.d.ts +7 -7
  367. package/types/ngwr-bits-threads-testing.d.ts +97 -0
  368. package/types/ngwr-bits-threads.d.ts +216 -0
  369. package/types/ngwr-bits-waves-testing.d.ts +1 -1
  370. package/types/ngwr-bits-waves.d.ts +20 -3
  371. package/types/ngwr-charts-bar-chart-testing.d.ts +193 -14
  372. package/types/ngwr-charts-bar-chart.d.ts +546 -38
  373. package/types/ngwr-charts-boxplot-chart-testing.d.ts +165 -0
  374. package/types/ngwr-charts-boxplot-chart.d.ts +308 -0
  375. package/types/ngwr-charts-bullet-chart-testing.d.ts +99 -0
  376. package/types/ngwr-charts-bullet-chart.d.ts +262 -0
  377. package/types/ngwr-charts-calendar-heatmap-testing.d.ts +32 -1
  378. package/types/ngwr-charts-calendar-heatmap.d.ts +55 -6
  379. package/types/ngwr-charts-candlestick-chart-testing.d.ts +135 -0
  380. package/types/ngwr-charts-candlestick-chart.d.ts +361 -0
  381. package/types/ngwr-charts-chart-legend-testing.d.ts +84 -0
  382. package/types/ngwr-charts-chart-legend.d.ts +178 -0
  383. package/types/ngwr-charts-core.d.ts +391 -0
  384. package/types/ngwr-charts-donut-chart-testing.d.ts +28 -5
  385. package/types/ngwr-charts-donut-chart.d.ts +124 -12
  386. package/types/ngwr-charts-funnel-chart-testing.d.ts +130 -0
  387. package/types/ngwr-charts-funnel-chart.d.ts +296 -0
  388. package/types/ngwr-charts-gauge-testing.d.ts +5 -0
  389. package/types/ngwr-charts-gauge.d.ts +6 -4
  390. package/types/ngwr-charts-heatmap-chart-testing.d.ts +148 -0
  391. package/types/ngwr-charts-heatmap-chart.d.ts +359 -0
  392. package/types/ngwr-charts-line-chart-testing.d.ts +72 -11
  393. package/types/ngwr-charts-line-chart.d.ts +291 -67
  394. package/types/ngwr-charts-meter-group-testing.d.ts +16 -2
  395. package/types/ngwr-charts-meter-group.d.ts +71 -11
  396. package/types/ngwr-charts-radar-chart-testing.d.ts +162 -0
  397. package/types/ngwr-charts-radar-chart.d.ts +461 -0
  398. package/types/ngwr-charts-scatter-chart-testing.d.ts +147 -0
  399. package/types/ngwr-charts-scatter-chart.d.ts +396 -0
  400. package/types/ngwr-charts-sparkline-testing.d.ts +4 -1
  401. package/types/ngwr-charts-sparkline.d.ts +8 -6
  402. package/types/ngwr-charts-treemap-chart-testing.d.ts +131 -0
  403. package/types/ngwr-charts-treemap-chart.d.ts +295 -0
  404. package/types/ngwr-charts-waterfall-chart-testing.d.ts +149 -0
  405. package/types/ngwr-charts-waterfall-chart.d.ts +338 -0
  406. package/types/ngwr-color-picker.d.ts +0 -21
  407. package/types/ngwr-dropdown.d.ts +0 -52
  408. package/types/ngwr-editor.d.ts +2 -84
  409. package/types/ngwr-i18n.d.ts +0 -15
  410. package/types/ngwr-mention.d.ts +0 -13
  411. package/types/ngwr-popconfirm.d.ts +0 -33
  412. package/types/ngwr-popover.d.ts +29 -53
  413. package/types/ngwr-toast-testing.d.ts +6 -1
  414. package/types/ngwr-tour.d.ts +0 -2
  415. package/types/ngwr-utils.d.ts +49 -7
  416. package/types/ngwr-version.d.ts +1 -1
  417. package/types/ngwr-window-testing.d.ts +65 -7
  418. package/types/ngwr-window.d.ts +831 -207
  419. package/types/ngwr.d.ts +1 -0
  420. package/window/styles/_index.scss +528 -82
@@ -0,0 +1,415 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Component, LOCALE_ID, ViewEncapsulation, computed, inject, input, viewChildren } from "@angular/core";
3
+ import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
+ import { readI18nText, useI18nFormatter, useI18nText } from "ngwr/i18n";
5
+ import { clamp } from "ngwr/utils";
6
+ import { WrChartTable, useChartNumbers } from "ngwr/charts/core";
7
+ import { useChartTooltip } from "ngwr/popover";
8
+ /**
9
+ * @license
10
+ *
11
+ * Use of this source code is governed by an MIT-style license that can be
12
+ * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
13
+ */
14
+ const short = (value) => Math.round(value * 1e3) / 1e3 || 0;
15
+ function share(value, reference) {
16
+ if (value === null || reference === null || reference <= 0 || value < 0) return null;
17
+ return value / reference;
18
+ }
19
+ var WrFunnelChart = class WrFunnelChart {
20
+ stages = input([], ...ngDevMode ? [{ debugName: "stages" }] : /* istanbul ignore next */ []);
21
+ ariaLabel = input(null, ...ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
22
+ resolvedAriaLabel = useI18nText(this.ariaLabel, "funnelChart.label", "Funnel chart");
23
+ color = input("var(--wr-color-primary)", ...ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []);
24
+ max = input(0, {
25
+ ...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
26
+ transform: (v) => {
27
+ const value = coerceNumberProperty(v, 0);
28
+ return Number.isFinite(value) ? Math.max(0, value) : 0;
29
+ }
30
+ });
31
+ conversion = input("both", ...ngDevMode ? [{ debugName: "conversion" }] : /* istanbul ignore next */ []);
32
+ showValues = input(true, {
33
+ ...ngDevMode ? { debugName: "showValues" } : /* istanbul ignore next */ {},
34
+ transform: coerceBooleanProperty
35
+ });
36
+ valueLabel = input(null, ...ngDevMode ? [{ debugName: "valueLabel" }] : /* istanbul ignore next */ []);
37
+ tooltip = input(true, {
38
+ ...ngDevMode ? { debugName: "tooltip" } : /* istanbul ignore next */ {},
39
+ transform: coerceBooleanProperty
40
+ });
41
+ valueFormat = input(null, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
42
+ percentFormat = input(null, ...ngDevMode ? [{ debugName: "percentFormat" }] : /* istanbul ignore next */ []);
43
+ dataTable = input(false, {
44
+ ...ngDevMode ? { debugName: "dataTable" } : /* istanbul ignore next */ {},
45
+ transform: coerceBooleanProperty
46
+ });
47
+ numbers = useChartNumbers(this.valueFormat);
48
+ locale = inject(LOCALE_ID);
49
+ percents = new Intl.NumberFormat(this.locale, {
50
+ style: "percent",
51
+ maximumFractionDigits: 1
52
+ });
53
+ smallPercents = new Intl.NumberFormat(this.locale, {
54
+ style: "percent",
55
+ maximumSignificantDigits: 2
56
+ });
57
+ stageName = readI18nText("funnelChart.stage", "Stage");
58
+ valueName = useI18nText(this.valueLabel, "funnelChart.value", "Value");
59
+ fromPreviousName = readI18nText("funnelChart.fromPrevious", "From previous");
60
+ fromFirstName = readI18nText("funnelChart.fromFirst", "From first");
61
+ ofPrevious = useI18nFormatter("funnelChart.ofPrevious", "{{percent}} of previous");
62
+ ofFirst = useI18nFormatter("funnelChart.ofFirst", "{{percent}} of first");
63
+ stageNameText = useI18nFormatter("funnelChart.stageName", "{{label}}: {{value}}");
64
+ stageNameOneText = useI18nFormatter("funnelChart.stageNameOne", "{{label}}: {{value}}, {{conversion}}");
65
+ stageNameBothText = useI18nFormatter("funnelChart.stageNameBoth", "{{label}}: {{value}}, {{previous}}, {{first}}");
66
+ stageEls = viewChildren("stageEl", ...ngDevMode ? [{ debugName: "stageEls" }] : /* istanbul ignore next */ []);
67
+ showPrevious = computed(() => {
68
+ const conversion = this.conversion();
69
+ return conversion === "both" || conversion === "previous";
70
+ }, ...ngDevMode ? [{ debugName: "showPrevious" }] : /* istanbul ignore next */ []);
71
+ showFirst = computed(() => {
72
+ const conversion = this.conversion();
73
+ return conversion === "both" || conversion === "first";
74
+ }, ...ngDevMode ? [{ debugName: "showFirst" }] : /* istanbul ignore next */ []);
75
+ resolved = computed(() => {
76
+ const stages = this.stages();
77
+ const values = stages.map((stage) => Number.isFinite(stage.value) ? stage.value : null);
78
+ const explicit = this.max();
79
+ const largest = Math.max(0, ...values.filter((v) => v !== null));
80
+ const full = explicit > 0 ? explicit : largest > 0 ? largest : 1;
81
+ const first = values[0] ?? null;
82
+ return stages.map((stage, i) => {
83
+ const value = values[i];
84
+ return {
85
+ label: stage.label,
86
+ value,
87
+ color: stage.color ?? this.color(),
88
+ width: value === null ? 0 : clamp(value / full, 0, 1),
89
+ fromPrevious: i === 0 ? null : share(value, values[i - 1]),
90
+ fromFirst: i === 0 ? null : share(value, first)
91
+ };
92
+ });
93
+ }, ...ngDevMode ? [{ debugName: "resolved" }] : /* istanbul ignore next */ []);
94
+ rows = computed(() => {
95
+ const stages = this.resolved();
96
+ return stages.map((stage, i) => {
97
+ const valueText = stage.value === null ? "" : this.numbers.value(stage.value);
98
+ const previousText = stage.fromPrevious === null ? "" : this.percent(stage.fromPrevious);
99
+ const firstText = stage.fromFirst === null ? "" : this.percent(stage.fromFirst);
100
+ const ofPreviousText = previousText ? this.ofPrevious({ percent: previousText }) : "";
101
+ const ofFirstText = firstText ? this.ofFirst({ percent: firstText }) : "";
102
+ const above = stages[Math.max(0, i - 1)];
103
+ let band = null;
104
+ if (i > 0 && above.value !== null && stage.value !== null) {
105
+ const top = above.width * 50;
106
+ const bottom = stage.width * 50;
107
+ band = `polygon(${short(50 - top)}% 0%, ${short(50 + top)}% 0%, ${short(50 + bottom)}% 100%, ${short(50 - bottom)}% 100%)`;
108
+ }
109
+ return {
110
+ label: stage.label,
111
+ value: stage.value,
112
+ color: stage.color,
113
+ width: `${short(stage.width * 100)}%`,
114
+ valueText,
115
+ previousText,
116
+ firstText,
117
+ ofFirstText,
118
+ name: stage.value === null ? stage.label : this.nameOf(stage.label, valueText, ofPreviousText, ofFirstText),
119
+ band,
120
+ bandFrom: above.color
121
+ };
122
+ });
123
+ }, ...ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []);
124
+ tableData = computed(() => ({
125
+ caption: this.resolvedAriaLabel(),
126
+ corner: this.stageName(),
127
+ columns: [
128
+ this.valueName(),
129
+ this.fromPreviousName(),
130
+ this.fromFirstName()
131
+ ],
132
+ groups: [{ rows: this.rows().map((row) => ({
133
+ header: row.label,
134
+ cells: [
135
+ row.valueText,
136
+ row.previousText,
137
+ row.firstText
138
+ ]
139
+ })) }]
140
+ }), ...ngDevMode ? [{ debugName: "tableData" }] : /* istanbul ignore next */ []);
141
+ tip = useChartTooltip(this.tooltip, (index) => {
142
+ const row = this.rows().at(index);
143
+ if (!row) return null;
144
+ const anchor = this.stageEls()[index]?.nativeElement.querySelector(".wr-funnel-chart__bar");
145
+ if (row.value === null || !anchor) return null;
146
+ const rows = [];
147
+ if (row.previousText) rows.push({
148
+ label: this.fromPreviousName(),
149
+ value: row.previousText
150
+ });
151
+ if (row.firstText) rows.push({
152
+ label: this.fromFirstName(),
153
+ value: row.firstText
154
+ });
155
+ return {
156
+ datum: {
157
+ label: row.label,
158
+ value: row.valueText,
159
+ color: row.color,
160
+ rows
161
+ },
162
+ anchor
163
+ };
164
+ });
165
+ activeStage = computed(() => {
166
+ const index = this.tip.active();
167
+ const row = index === null ? void 0 : this.rows().at(index);
168
+ return row && row.value !== null ? index : null;
169
+ }, ...ngDevMode ? [{ debugName: "activeStage" }] : /* istanbul ignore next */ []);
170
+ nameOf(label, value, ofPrevious, ofFirst) {
171
+ if (ofPrevious && ofFirst) return this.stageNameBothText({
172
+ label,
173
+ value,
174
+ previous: ofPrevious,
175
+ first: ofFirst
176
+ });
177
+ if (ofPrevious || ofFirst) return this.stageNameOneText({
178
+ label,
179
+ value,
180
+ conversion: ofPrevious || ofFirst
181
+ });
182
+ return this.stageNameText({
183
+ label,
184
+ value
185
+ });
186
+ }
187
+ percent(ratio) {
188
+ const custom = this.percentFormat();
189
+ if (custom) return custom(ratio);
190
+ return (ratio !== 0 && Math.abs(ratio) < .01 ? this.smallPercents : this.percents).format(ratio);
191
+ }
192
+ static ɵfac = i0.ɵɵngDeclareFactory({
193
+ minVersion: "12.0.0",
194
+ version: "22.2.4",
195
+ ngImport: i0,
196
+ type: WrFunnelChart,
197
+ deps: [],
198
+ target: i0.ɵɵFactoryTarget.Component
199
+ });
200
+ static ɵcmp = i0.ɵɵngDeclareComponent({
201
+ minVersion: "17.0.0",
202
+ version: "22.2.4",
203
+ type: WrFunnelChart,
204
+ isStandalone: true,
205
+ selector: "wr-funnel-chart",
206
+ inputs: {
207
+ stages: {
208
+ classPropertyName: "stages",
209
+ publicName: "stages",
210
+ isSignal: true,
211
+ isRequired: false,
212
+ transformFunction: null
213
+ },
214
+ ariaLabel: {
215
+ classPropertyName: "ariaLabel",
216
+ publicName: "ariaLabel",
217
+ isSignal: true,
218
+ isRequired: false,
219
+ transformFunction: null
220
+ },
221
+ color: {
222
+ classPropertyName: "color",
223
+ publicName: "color",
224
+ isSignal: true,
225
+ isRequired: false,
226
+ transformFunction: null
227
+ },
228
+ max: {
229
+ classPropertyName: "max",
230
+ publicName: "max",
231
+ isSignal: true,
232
+ isRequired: false,
233
+ transformFunction: null
234
+ },
235
+ conversion: {
236
+ classPropertyName: "conversion",
237
+ publicName: "conversion",
238
+ isSignal: true,
239
+ isRequired: false,
240
+ transformFunction: null
241
+ },
242
+ showValues: {
243
+ classPropertyName: "showValues",
244
+ publicName: "showValues",
245
+ isSignal: true,
246
+ isRequired: false,
247
+ transformFunction: null
248
+ },
249
+ valueLabel: {
250
+ classPropertyName: "valueLabel",
251
+ publicName: "valueLabel",
252
+ isSignal: true,
253
+ isRequired: false,
254
+ transformFunction: null
255
+ },
256
+ tooltip: {
257
+ classPropertyName: "tooltip",
258
+ publicName: "tooltip",
259
+ isSignal: true,
260
+ isRequired: false,
261
+ transformFunction: null
262
+ },
263
+ valueFormat: {
264
+ classPropertyName: "valueFormat",
265
+ publicName: "valueFormat",
266
+ isSignal: true,
267
+ isRequired: false,
268
+ transformFunction: null
269
+ },
270
+ percentFormat: {
271
+ classPropertyName: "percentFormat",
272
+ publicName: "percentFormat",
273
+ isSignal: true,
274
+ isRequired: false,
275
+ transformFunction: null
276
+ },
277
+ dataTable: {
278
+ classPropertyName: "dataTable",
279
+ publicName: "dataTable",
280
+ isSignal: true,
281
+ isRequired: false,
282
+ transformFunction: null
283
+ }
284
+ },
285
+ host: { classAttribute: "wr-funnel-chart" },
286
+ viewQueries: [{
287
+ propertyName: "stageEls",
288
+ predicate: ["stageEl"],
289
+ descendants: true,
290
+ isSignal: true
291
+ }],
292
+ ngImport: i0,
293
+ template: "@let previous = showPrevious();\n@let first = showFirst();\n@let values = showValues();\n@let active = activeStage();\n<!-- A named `group` of one named `img` per stage, as the bar chart's columns are. Not one\n `img` round the whole funnel: `img` makes everything inside it presentational, and\n WebKit drops such a subtree, so every stage's own name would go with it. -->\n<div class=\"wr-funnel-chart__plot\" role=\"group\" [attr.aria-label]=\"resolvedAriaLabel()\">\n @for (row of rows(); track $index) {\n @if (!$first) {\n <!-- The band between two bars and the share of the stage above, both repeated in the\n stage's own name, so hidden here. -->\n <div class=\"wr-funnel-chart__gap\" aria-hidden=\"true\">\n @if (row.band) {\n <span\n class=\"wr-funnel-chart__band\"\n [style.clip-path]=\"row.band\"\n [style.--wr-funnel-chart-band-from]=\"row.bandFrom\"\n [style.--wr-funnel-chart-band-to]=\"row.color\"\n ></span>\n }\n @if (previous && row.previousText) {\n <span class=\"wr-funnel-chart__gap-label\">{{ row.previousText }}</span>\n }\n </div>\n }\n <!-- Its label, its value and both conversions in its name: the text inside is drawn for\n the eye, and the `img` role makes it presentational. -->\n <div\n #stageEl\n class=\"wr-funnel-chart__stage\"\n [class.wr-funnel-chart__stage--active]=\"active === $index\"\n role=\"img\"\n [attr.aria-label]=\"row.name\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- The host's own text, in whatever language it is, so it takes its direction from\n that text and is ellipsised at its own end, not at the page's. -->\n <span class=\"wr-funnel-chart__label\" dir=\"auto\">{{ row.label }}</span>\n <span class=\"wr-funnel-chart__track\">\n <!-- A missing stage draws no bar at all; zero and below keep a hairline. -->\n @if (row.value !== null) {\n <span class=\"wr-funnel-chart__bar\" [style.width]=\"row.width\" [style.background]=\"row.color\"></span>\n }\n </span>\n <span class=\"wr-funnel-chart__figures\">\n @if (values && row.valueText) {\n <span class=\"wr-funnel-chart__value\">{{ row.valueText }}</span>\n }\n @if (first && row.ofFirstText) {\n <span class=\"wr-funnel-chart__overall\">{{ row.ofFirstText }}</span>\n }\n </span>\n </div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the stages rather than inside an `img`, which\n would make them presentational. Clipped to nothing by its own stylesheet, so it takes\n no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n",
294
+ dependencies: [{
295
+ kind: "component",
296
+ type: WrChartTable,
297
+ selector: "wr-chart-table",
298
+ inputs: ["data"]
299
+ }],
300
+ encapsulation: i0.ViewEncapsulation.None
301
+ });
302
+ };
303
+ i0.ɵɵngDeclareClassMetadata({
304
+ minVersion: "12.0.0",
305
+ version: "22.2.4",
306
+ ngImport: i0,
307
+ type: WrFunnelChart,
308
+ decorators: [{
309
+ type: Component,
310
+ args: [{
311
+ selector: "wr-funnel-chart",
312
+ encapsulation: ViewEncapsulation.None,
313
+ host: { class: "wr-funnel-chart" },
314
+ imports: [WrChartTable],
315
+ template: "@let previous = showPrevious();\n@let first = showFirst();\n@let values = showValues();\n@let active = activeStage();\n<!-- A named `group` of one named `img` per stage, as the bar chart's columns are. Not one\n `img` round the whole funnel: `img` makes everything inside it presentational, and\n WebKit drops such a subtree, so every stage's own name would go with it. -->\n<div class=\"wr-funnel-chart__plot\" role=\"group\" [attr.aria-label]=\"resolvedAriaLabel()\">\n @for (row of rows(); track $index) {\n @if (!$first) {\n <!-- The band between two bars and the share of the stage above, both repeated in the\n stage's own name, so hidden here. -->\n <div class=\"wr-funnel-chart__gap\" aria-hidden=\"true\">\n @if (row.band) {\n <span\n class=\"wr-funnel-chart__band\"\n [style.clip-path]=\"row.band\"\n [style.--wr-funnel-chart-band-from]=\"row.bandFrom\"\n [style.--wr-funnel-chart-band-to]=\"row.color\"\n ></span>\n }\n @if (previous && row.previousText) {\n <span class=\"wr-funnel-chart__gap-label\">{{ row.previousText }}</span>\n }\n </div>\n }\n <!-- Its label, its value and both conversions in its name: the text inside is drawn for\n the eye, and the `img` role makes it presentational. -->\n <div\n #stageEl\n class=\"wr-funnel-chart__stage\"\n [class.wr-funnel-chart__stage--active]=\"active === $index\"\n role=\"img\"\n [attr.aria-label]=\"row.name\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- The host's own text, in whatever language it is, so it takes its direction from\n that text and is ellipsised at its own end, not at the page's. -->\n <span class=\"wr-funnel-chart__label\" dir=\"auto\">{{ row.label }}</span>\n <span class=\"wr-funnel-chart__track\">\n <!-- A missing stage draws no bar at all; zero and below keep a hairline. -->\n @if (row.value !== null) {\n <span class=\"wr-funnel-chart__bar\" [style.width]=\"row.width\" [style.background]=\"row.color\"></span>\n }\n </span>\n <span class=\"wr-funnel-chart__figures\">\n @if (values && row.valueText) {\n <span class=\"wr-funnel-chart__value\">{{ row.valueText }}</span>\n }\n @if (first && row.ofFirstText) {\n <span class=\"wr-funnel-chart__overall\">{{ row.ofFirstText }}</span>\n }\n </span>\n </div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the stages rather than inside an `img`, which\n would make them presentational. Clipped to nothing by its own stylesheet, so it takes\n no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"
316
+ }]
317
+ }],
318
+ propDecorators: {
319
+ stages: [{
320
+ type: i0.Input,
321
+ args: [{
322
+ isSignal: true,
323
+ alias: "stages",
324
+ required: false
325
+ }]
326
+ }],
327
+ ariaLabel: [{
328
+ type: i0.Input,
329
+ args: [{
330
+ isSignal: true,
331
+ alias: "ariaLabel",
332
+ required: false
333
+ }]
334
+ }],
335
+ color: [{
336
+ type: i0.Input,
337
+ args: [{
338
+ isSignal: true,
339
+ alias: "color",
340
+ required: false
341
+ }]
342
+ }],
343
+ max: [{
344
+ type: i0.Input,
345
+ args: [{
346
+ isSignal: true,
347
+ alias: "max",
348
+ required: false
349
+ }]
350
+ }],
351
+ conversion: [{
352
+ type: i0.Input,
353
+ args: [{
354
+ isSignal: true,
355
+ alias: "conversion",
356
+ required: false
357
+ }]
358
+ }],
359
+ showValues: [{
360
+ type: i0.Input,
361
+ args: [{
362
+ isSignal: true,
363
+ alias: "showValues",
364
+ required: false
365
+ }]
366
+ }],
367
+ valueLabel: [{
368
+ type: i0.Input,
369
+ args: [{
370
+ isSignal: true,
371
+ alias: "valueLabel",
372
+ required: false
373
+ }]
374
+ }],
375
+ tooltip: [{
376
+ type: i0.Input,
377
+ args: [{
378
+ isSignal: true,
379
+ alias: "tooltip",
380
+ required: false
381
+ }]
382
+ }],
383
+ valueFormat: [{
384
+ type: i0.Input,
385
+ args: [{
386
+ isSignal: true,
387
+ alias: "valueFormat",
388
+ required: false
389
+ }]
390
+ }],
391
+ percentFormat: [{
392
+ type: i0.Input,
393
+ args: [{
394
+ isSignal: true,
395
+ alias: "percentFormat",
396
+ required: false
397
+ }]
398
+ }],
399
+ dataTable: [{
400
+ type: i0.Input,
401
+ args: [{
402
+ isSignal: true,
403
+ alias: "dataTable",
404
+ required: false
405
+ }]
406
+ }],
407
+ stageEls: [{
408
+ type: i0.ViewChildren,
409
+ args: ["stageEl", { isSignal: true }]
410
+ }]
411
+ }
412
+ });
413
+ export { WrFunnelChart };
414
+
415
+ //# sourceMappingURL=ngwr-charts-funnel-chart.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngwr-charts-funnel-chart.mjs","names":[],"sources":["../../../projects/lib/charts/funnel-chart/funnel-chart.ts","../../../projects/lib/charts/funnel-chart/funnel-chart.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 { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n type ElementRef,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n inject,\n input,\n viewChildren,\n} from '@angular/core';\n\nimport { WrChartTable, type WrChartTableData, useChartNumbers } from 'ngwr/charts/core';\nimport { readI18nText, useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip } from 'ngwr/popover';\nimport { clamp } from 'ngwr/utils';\n\nimport type { WrFunnelConversion, WrFunnelStage } from './types';\n\n/** A number for an inline style, to three decimals with `-0` folded to `0`, so the style stays short. */\nconst short = (value: number): number => Math.round(value * 1000) / 1000 || 0;\n\n/**\n * `value` as a share of `reference`, or `null` where no share means anything: either\n * side missing, a reference of zero or below (there is nothing to be a share of), or a\n * negative value (a share of a count below zero). A value above its reference is a share\n * above one — a stage that grew — and is returned as it is.\n */\nfunction share(value: number | null, reference: number | null): number | null {\n if (value === null || reference === null || reference <= 0 || value < 0) return null;\n return value / reference;\n}\n\n/** One stage, resolved: its value with `null` where it is missing, its paint, its width and its conversions. */\ninterface Stage {\n readonly label: string;\n /** `null` when the stage's value is not a finite number. */\n readonly value: number | null;\n readonly color: string;\n /** The bar's width as a share of the track, from 0 to 1. */\n readonly width: number;\n /** Its share of the stage before it, or `null` (see `share`). Always `null` for the first stage. */\n readonly fromPrevious: number | null;\n /** Its share of the first stage, or `null`. Always `null` for the first stage, which is the reference. */\n readonly fromFirst: number | null;\n}\n\n/**\n * Funnel chart: how many reached each stage of a sequence — visited, signed up, paid —\n * and how many of them went on to the next. SVG-free and dependency-free: every part is\n * HTML laid out by the stylesheet.\n *\n * @example\n * ```html\n * <wr-funnel-chart\n * [stages]=\"[\n * { label: 'Visited', value: 12000 },\n * { label: 'Signed up', value: 4800 },\n * { label: 'Activated', value: 2900 },\n * { label: 'Paid', value: 720 }\n * ]\"\n * />\n * ```\n *\n * **The bars are honest about the values.** Each stage is a bar centred on the funnel's\n * axis, its width proportional to its value — the largest stage, or `max`, is the full\n * width. The funnel shape between two bars is a band from one bar's width to the next,\n * so it narrows by exactly the drop and carries no value of its own. That is why this is\n * bars and not a trapezoid per stage: a trapezoid's area depends on its neighbour, so a\n * stage would look larger or smaller for what follows it.\n *\n * **What the data does not promise, the drawing does not assume.** A stage larger than\n * the one before it is drawn WIDER and its conversion is above 100%, rather than clamped\n * into a shape a funnel is expected to have. Zero and a negative value draw a hairline,\n * never a negative width; a negative value is printed as given and gets no conversion. A\n * value that is not a finite number is missing: no bar, no figure, no band to or from it,\n * and no conversion that would need it.\n *\n * **The conversions.** Each stage after the first has two: its share of the stage before\n * it, printed between the two bars, and its share of the first stage, printed under its\n * value (`conversion` chooses which are printed). Both are percentages in `LOCALE_ID`,\n * with one fraction digit and two significant digits below 1%, so a real conversion of\n * 0.04% is not printed as `0%`; `percentFormat` replaces that.\n *\n * **What a screen reader gets.** The chart is a named `role=\"group\"` of one `role=\"img\"`\n * per stage, as the bar chart's columns are, each named with its label, its value and both\n * conversions — \"Signed up: 4,800, 40% of previous, 40% of first\". The whole sentence is a\n * catalog template, one per shape — `funnelChart.stageName` with no conversion,\n * `stageNameOne` with one and `stageNameBoth` with both — so a locale sets its own\n * punctuation and order round the figures. The bands and the percentages between the bars\n * are `aria-hidden`, since every figure they show is in a name already. `dataTable` adds\n * the same figures as a table a reader can walk cell by cell. No part of the chart is a\n * tab stop.\n *\n * Under RTL the labels and the figures swap sides; the bars and the bands are centred,\n * so they read the same in both directions. A label takes its direction from its own\n * text, so a Latin one is ellipsised at its end on an RTL page, and a figure from its\n * own, so a sign stays in front of its digits.\n *\n * @see https://ngwr.dev/charts/funnel-chart\n */\n@Component({\n selector: 'wr-funnel-chart',\n templateUrl: './funnel-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-funnel-chart' },\n imports: [WrChartTable],\n})\nexport class WrFunnelChart {\n /**\n * The stages, from the top of the funnel down. Nothing is sorted: a stage is drawn where\n * it is given, so a stage larger than the one before it shows as one.\n */\n readonly stages = input<readonly WrFunnelStage[]>([]);\n\n /**\n * Accessible name of the chart, and the data table's caption. Each stage names itself,\n * so this says what the funnel is about. Falls back to `funnelChart.label`, then\n * `'Funnel chart'`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'funnelChart.label', 'Funnel chart');\n\n /**\n * The colour of a stage with no `color` of its own. One colour by default, because the\n * stages are one quantity measured along a sequence, not categories: every stage is\n * named in text beside its bar, so colour tells nothing apart here.\n * @default 'var(--wr-color-primary)'\n */\n readonly color = input<string>('var(--wr-color-primary)');\n\n /**\n * The value of a full-width bar. `0` makes it the largest stage shown; a value above\n * `0` fixes it, so two funnels side by side share one scale. A stage above a fixed\n * `max` is drawn full width, and its figure, the tooltip and the data table still give\n * its own value. @default 0\n */\n readonly max = input(0, {\n transform: (v: unknown): number => {\n const value = coerceNumberProperty(v, 0);\n return Number.isFinite(value) ? Math.max(0, value) : 0;\n },\n });\n\n /**\n * Which conversions are printed on the drawing: each stage's share of the stage before\n * it, between the two bars (`previous`), its share of the first stage, under its value\n * (`first`), `both` or `none`. The tooltip, every stage's accessible name and the data\n * table carry both whatever this says. @default 'both'\n */\n readonly conversion = input<WrFunnelConversion>('both');\n\n /** Print each stage's value beside its bar. @default true */\n readonly showValues = input(true, { transform: coerceBooleanProperty });\n\n /**\n * What the values count — visitors, orders — as the heading of the data table's value\n * column. Falls back to `funnelChart.value` (\"Value\").\n */\n readonly valueLabel = input<string | null>(null);\n\n /**\n * Show a tooltip with the stage's label, value and both conversions on hover. Pointer\n * only — each stage's accessible name already carries the same figures. @default true\n */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Writes every value the chart shows: beside the bars, in the tooltip, in the accessible\n * names and in the data table. `null` uses `Intl.NumberFormat` in `LOCALE_ID`.\n */\n readonly valueFormat = input<((value: number) => string) | null>(null);\n\n /**\n * Writes every conversion the chart shows, given as a RATIO — `0.25` for a quarter, `1.2`\n * for a stage that grew by a fifth — the number `Intl.NumberFormat`'s `percent` style\n * takes, so one of those can be passed as it is. `null` uses that style in `LOCALE_ID`,\n * with up to one fraction digit, and two significant digits below 1% so a small real\n * conversion is not printed as `0%`.\n */\n readonly percentFormat = input<((ratio: number) => string) | null>(null);\n\n /**\n * Render the chart's figures as a table that only assistive technology reaches: a row\n * per stage, headed by its label, with its value and both conversions, each written as\n * the tooltip writes it. A figure the stage does not have is an empty cell.\n *\n * Each stage's accessible name already carries its figures; the table is for a reader\n * who wants to move through them cell by cell, with the column headings read out. It is\n * rendered beside the stages, clipped to nothing: it takes no room, draws nothing and\n * holds no tab stop. @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /** The figures in full, never compact, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers(this.valueFormat);\n\n private readonly locale = inject(LOCALE_ID);\n private readonly percents = new Intl.NumberFormat(this.locale, { style: 'percent', maximumFractionDigits: 1 });\n /** Below 1%, by significant digits, which keep 0.0004 from printing as `0%`. */\n private readonly smallPercents = new Intl.NumberFormat(this.locale, {\n style: 'percent',\n maximumSignificantDigits: 2,\n });\n\n private readonly stageName = readI18nText('funnelChart.stage', 'Stage');\n private readonly valueName = useI18nText(this.valueLabel, 'funnelChart.value', 'Value');\n private readonly fromPreviousName = readI18nText('funnelChart.fromPrevious', 'From previous');\n private readonly fromFirstName = readI18nText('funnelChart.fromFirst', 'From first');\n private readonly ofPrevious = useI18nFormatter('funnelChart.ofPrevious', '{{percent}} of previous');\n private readonly ofFirst = useI18nFormatter('funnelChart.ofFirst', '{{percent}} of first');\n /**\n * A stage's accessible name, one sentence per shape, so a locale places the colon, the\n * commas and the order itself: with no conversion (the first stage, or none that means\n * anything), with one, and with both. Each conversion arrives already worded — \"40% of\n * previous\" — from the two templates above.\n */\n private readonly stageNameText = useI18nFormatter('funnelChart.stageName', '{{label}}: {{value}}');\n private readonly stageNameOneText = useI18nFormatter(\n 'funnelChart.stageNameOne',\n '{{label}}: {{value}}, {{conversion}}'\n );\n private readonly stageNameBothText = useI18nFormatter(\n 'funnelChart.stageNameBoth',\n '{{label}}: {{value}}, {{previous}}, {{first}}'\n );\n\n private readonly stageEls = viewChildren<ElementRef<HTMLElement>>('stageEl');\n\n /** Whether the shares of the previous stage are printed between the bars. */\n protected readonly showPrevious = computed(() => {\n const conversion = this.conversion();\n return conversion === 'both' || conversion === 'previous';\n });\n\n /** Whether the shares of the first stage are printed under the values. */\n protected readonly showFirst = computed(() => {\n const conversion = this.conversion();\n return conversion === 'both' || conversion === 'first';\n });\n\n /**\n * Every stage, resolved. The full width is a fixed `max`, else the largest value given,\n * else 1 — so a funnel of zeros draws hairlines rather than dividing by nothing.\n */\n private readonly resolved = computed<readonly Stage[]>(() => {\n const stages = this.stages();\n const values = stages.map(stage => (Number.isFinite(stage.value) ? stage.value : null));\n const explicit = this.max();\n const largest = Math.max(0, ...values.filter((v): v is number => v !== null));\n const full = explicit > 0 ? explicit : largest > 0 ? largest : 1;\n const first = values[0] ?? null;\n return stages.map((stage, i) => {\n const value = values[i];\n return {\n label: stage.label,\n value,\n color: stage.color ?? this.color(),\n width: value === null ? 0 : clamp(value / full, 0, 1),\n fromPrevious: i === 0 ? null : share(value, values[i - 1]),\n fromFirst: i === 0 ? null : share(value, first),\n };\n });\n });\n\n /**\n * The stages as drawn and announced: every figure written once, here, so the drawing,\n * the names, the tooltip and the table cannot disagree.\n *\n * `band` is the shape between a stage and the one above it: a `clip-path` polygon on\n * the track's width, from the upper bar's width at its top edge to this bar's at its\n * bottom, both centred. There is none next to a missing stage, since joining across one\n * would draw a drop the data never gave.\n */\n protected readonly rows = computed(() => {\n const stages = this.resolved();\n return stages.map((stage, i) => {\n const valueText = stage.value === null ? '' : this.numbers.value(stage.value);\n const previousText = stage.fromPrevious === null ? '' : this.percent(stage.fromPrevious);\n const firstText = stage.fromFirst === null ? '' : this.percent(stage.fromFirst);\n const ofPreviousText = previousText ? this.ofPrevious({ percent: previousText }) : '';\n const ofFirstText = firstText ? this.ofFirst({ percent: firstText }) : '';\n\n const above = stages[Math.max(0, i - 1)];\n let band: string | null = null;\n if (i > 0 && above.value !== null && stage.value !== null) {\n const top = above.width * 50;\n const bottom = stage.width * 50;\n band =\n `polygon(${short(50 - top)}% 0%, ${short(50 + top)}% 0%, ` +\n `${short(50 + bottom)}% 100%, ${short(50 - bottom)}% 100%)`;\n }\n\n return {\n label: stage.label,\n value: stage.value,\n color: stage.color,\n /** The bar's inline width, a percentage of the track. */\n width: `${short(stage.width * 100)}%`,\n valueText,\n previousText,\n firstText,\n /** The share of the first stage as it is printed under the value: \"40% of first\". */\n ofFirstText,\n /** What the stage announces: its label, its value and both conversions. */\n name: stage.value === null ? stage.label : this.nameOf(stage.label, valueText, ofPreviousText, ofFirstText),\n band,\n /** The paint of the stage above, where the band starts. */\n bandFrom: above.color,\n };\n });\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, a row per stage, and its\n * value and both conversions as the columns, each cell written as the tooltip writes it.\n */\n protected readonly tableData = computed<WrChartTableData>(() => ({\n caption: this.resolvedAriaLabel(),\n corner: this.stageName(),\n columns: [this.valueName(), this.fromPreviousName(), this.fromFirstName()],\n groups: [\n {\n rows: this.rows().map(row => ({\n header: row.label,\n cells: [row.valueText, row.previousText, row.firstText],\n })),\n },\n ],\n }));\n\n /**\n * One tooltip for the whole chart, for the stage under the pointer: its label and value\n * as the heading, and a row for each conversion it has. It points at the top edge of the\n * BAR, so the chip sits over the band and the percentage it repeats; a stage of zero\n * keeps its hairline to point at. A missing stage opens none — it has no figure to show.\n */\n protected readonly tip = useChartTooltip(this.tooltip, index => {\n const row = this.rows().at(index);\n if (!row) return null;\n const anchor = this.stageEls()[index]?.nativeElement.querySelector('.wr-funnel-chart__bar');\n if (row.value === null || !anchor) return null;\n const rows: WrChartTooltipRow[] = [];\n if (row.previousText) rows.push({ label: this.fromPreviousName(), value: row.previousText });\n if (row.firstText) rows.push({ label: this.fromFirstName(), value: row.firstText });\n return { datum: { label: row.label, value: row.valueText, color: row.color, rows }, anchor };\n });\n\n /**\n * The stage the open tooltip is about, which the active row's wash marks: the hovered\n * stage, unless it is missing. A missing stage opens no tooltip, and `tip.active()` is\n * the hovered index whatever the resolver returned, so without this the wash would mark\n * a row with nothing to show.\n */\n protected readonly activeStage = computed(() => {\n const index = this.tip.active();\n const row = index === null ? undefined : this.rows().at(index);\n return row && row.value !== null ? index : null;\n });\n\n /**\n * The accessible name of a stage with a value: the sentence for the conversions it has,\n * each already worded. A missing stage is named by its label alone.\n */\n private nameOf(label: string, value: string, ofPrevious: string, ofFirst: string): string {\n if (ofPrevious && ofFirst) return this.stageNameBothText({ label, value, previous: ofPrevious, first: ofFirst });\n if (ofPrevious || ofFirst) return this.stageNameOneText({ label, value, conversion: ofPrevious || ofFirst });\n return this.stageNameText({ label, value });\n }\n\n /** A conversion as the chart prints it: through `percentFormat`, or as a percentage in `LOCALE_ID`. */\n private percent(ratio: number): string {\n const custom = this.percentFormat();\n if (custom) return custom(ratio);\n return (ratio !== 0 && Math.abs(ratio) < 0.01 ? this.smallPercents : this.percents).format(ratio);\n }\n}\n\nexport type { WrFunnelConversion, WrFunnelStage } from './types';\n","@let previous = showPrevious();\n@let first = showFirst();\n@let values = showValues();\n@let active = activeStage();\n<!-- A named `group` of one named `img` per stage, as the bar chart's columns are. Not one\n `img` round the whole funnel: `img` makes everything inside it presentational, and\n WebKit drops such a subtree, so every stage's own name would go with it. -->\n<div class=\"wr-funnel-chart__plot\" role=\"group\" [attr.aria-label]=\"resolvedAriaLabel()\">\n @for (row of rows(); track $index) {\n @if (!$first) {\n <!-- The band between two bars and the share of the stage above, both repeated in the\n stage's own name, so hidden here. -->\n <div class=\"wr-funnel-chart__gap\" aria-hidden=\"true\">\n @if (row.band) {\n <span\n class=\"wr-funnel-chart__band\"\n [style.clip-path]=\"row.band\"\n [style.--wr-funnel-chart-band-from]=\"row.bandFrom\"\n [style.--wr-funnel-chart-band-to]=\"row.color\"\n ></span>\n }\n @if (previous && row.previousText) {\n <span class=\"wr-funnel-chart__gap-label\">{{ row.previousText }}</span>\n }\n </div>\n }\n <!-- Its label, its value and both conversions in its name: the text inside is drawn for\n the eye, and the `img` role makes it presentational. -->\n <div\n #stageEl\n class=\"wr-funnel-chart__stage\"\n [class.wr-funnel-chart__stage--active]=\"active === $index\"\n role=\"img\"\n [attr.aria-label]=\"row.name\"\n (mouseenter)=\"tip.enter($index)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- The host's own text, in whatever language it is, so it takes its direction from\n that text and is ellipsised at its own end, not at the page's. -->\n <span class=\"wr-funnel-chart__label\" dir=\"auto\">{{ row.label }}</span>\n <span class=\"wr-funnel-chart__track\">\n <!-- A missing stage draws no bar at all; zero and below keep a hairline. -->\n @if (row.value !== null) {\n <span class=\"wr-funnel-chart__bar\" [style.width]=\"row.width\" [style.background]=\"row.color\"></span>\n }\n </span>\n <span class=\"wr-funnel-chart__figures\">\n @if (values && row.valueText) {\n <span class=\"wr-funnel-chart__value\">{{ row.valueText }}</span>\n }\n @if (first && row.ofFirstText) {\n <span class=\"wr-funnel-chart__overall\">{{ row.ofFirstText }}</span>\n }\n </span>\n </div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the stages rather than inside an `img`, which\n would make them presentational. Clipped to nothing by its own stylesheet, so it takes\n no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;AA2BA,MAAM,SAAS,UAA0B,KAAK,MAAM,QAAQ,GAAI,IAAI,OAAQ;AAQ5E,SAAS,MAAM,OAAsB,WAAwB;CAC3D,IAAI,UAAU,QAAQ,cAAc,QAAQ,aAAa,KAAK,QAAQ,GAAG,OAAO;CAChF,OAAO,QAAQ;AACjB;AA6EA,IAAa,gBAAb,MAAa,cAAa;CAKf,SAAS,MAAgC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAO5C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,qBAAqB,cAAc;CAQ7F,QAAQ,MAAc,2BAA0B,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAQhD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,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,YAAA,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,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,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,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAS,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -18,13 +18,19 @@ var WrGaugeHarness = class WrGaugeHarness extends ComponentHarness {
18
18
  return (await this.surface()).getAttribute("aria-label");
19
19
  }
20
20
  async getValue() {
21
- return Number(await (await this.surface()).getAttribute("aria-valuenow"));
21
+ return this.numberAttribute("aria-valuenow", "getValue");
22
22
  }
23
23
  async getMin() {
24
- return Number(await (await this.surface()).getAttribute("aria-valuemin"));
24
+ return this.numberAttribute("aria-valuemin", "getMin");
25
25
  }
26
26
  async getMax() {
27
- return Number(await (await this.surface()).getAttribute("aria-valuemax"));
27
+ return this.numberAttribute("aria-valuemax", "getMax");
28
+ }
29
+ async numberAttribute(name, method) {
30
+ const raw = await (await this.surface()).getAttribute(name);
31
+ const value = raw === null ? NaN : Number.parseFloat(raw);
32
+ if (!Number.isFinite(value)) throw new Error(`WrGaugeHarness.${method}(): the meter carries ${name}="${raw ?? ""}", which the component writes as a finite number on every gauge.`);
33
+ return value;
28
34
  }
29
35
  async getValueText() {
30
36
  return (await this.surface()).getAttribute("aria-valuetext");
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-charts-gauge-testing.mjs","names":[],"sources":["../../../projects/lib/charts/gauge/testing/wr-gauge-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 { WrGaugeHarnessFilters } from './types';\n\n/**\n * Test harness for `<wr-gauge>`.\n *\n * **The dial is `aria-hidden` and the printed number is optional, so the ARIA is the\n * whole readable surface.** The component carries `role=\"meter\"` with the value\n * trio and an `aria-valuetext` that includes the suffix — which is what makes a\n * gauge with `showValue` off readable at all. {@link getValue} is what it announces;\n * {@link getDisplayValue} is what is drawn, and it is `null` when nothing is.\n *\n * The arc is an SVG path, and its `d` is a rendering detail rather than an\n * assertion — it moves with the size, the stroke width and the sweep.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGaugeHarness extends ComponentHarness {\n static hostSelector = 'wr-gauge';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGaugeHarnessFilters = {}): HarnessPredicate<WrGaugeHarness> {\n return new HarnessPredicate(WrGaugeHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('value', options.value, async (harness, value) => (await harness.getValue()) === value);\n }\n\n private readonly surface = this.locatorFor('.wr-gauge__surface');\n\n /** The role the dial announces — `meter`, which is what a gauge is. */\n async getRole(): Promise<string | null> {\n return (await this.surface()).getAttribute('role');\n }\n\n /** The dial's accessible name. */\n async getAccessibleName(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-label');\n }\n\n /** The value it announces, from `aria-valuenow`. */\n async getValue(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuenow'));\n }\n\n /** The bottom of the range, from `aria-valuemin`. */\n async getMin(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuemin'));\n }\n\n /** The top of the range, from `aria-valuemax`. */\n async getMax(): Promise<number> {\n return Number(await (await this.surface()).getAttribute('aria-valuemax'));\n }\n\n /**\n * The spoken form of the value — the number with its suffix.\n *\n * The reason a gauge with no printed value is still readable, and worth asserting\n * separately from {@link getValue}: a percentage announced as a bare `72` says\n * something different from `72%`.\n */\n async getValueText(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-valuetext');\n }\n\n /** The number printed in the middle, suffix included, or `null` when `showValue` is off. */\n async getDisplayValue(): Promise<string | null> {\n const text = await this.locatorForOptional('.wr-gauge__text')();\n return text ? text.text() : null;\n }\n\n /** The suffix alone, or `null` when there is none — or nothing is printed. */\n async getSuffix(): Promise<string | null> {\n const suffix = await this.locatorForOptional('.wr-gauge__suffix')();\n if (!suffix) return null;\n const text = await suffix.text();\n return text === '' ? null : text;\n }\n\n /**\n * The dial's width in pixels, read off the `style` ATTRIBUTE.\n *\n * NOT `getCssValue()`, which is `getComputedStyle()`: a computed read answers\n * from the LAID-OUT box, so it agrees with the inline value in jsdom — which\n * lays nothing out and echoes the declaration — and disagrees in a browser,\n * where sub-pixel rounding turns a declared 240 into 239.5. A harness that\n * answers differently in the two places it runs is worse than one that refuses.\n */\n async getSize(): Promise<number> {\n const style = await (await this.surface()).getAttribute('style');\n const match = /width:\\s*([\\d.]+)px/.exec(style ?? '');\n if (!match) {\n throw new Error(\n `WrGaugeHarness.getSize(): the dial carries no inline width (style: \"${style ?? ''}\"). ` +\n 'The component writes one unconditionally, so its absence is the bug rather than a zero.'\n );\n }\n return Number.parseFloat(match[1]);\n }\n}\n"],"mappings":";;;;;;;AAyBA,IAAa,iBAAb,MAAa,uBAAuB,iBAAgB;CAClD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAiC,CAAA,GAAE;EAC7C,OAAO,IAAI,iBAAiB,gBAAgB,OAAO,CAAC,CACjD,UAAU,aAAa,QAAQ,YAAY,SAAS,UACnD,iBAAiB,cAAc,QAAQ,kBAAiB,GAAI,KAAK,CAAC,CACnE,CACA,UAAU,SAAS,QAAQ,OAAO,OAAO,SAAS,UAAW,MAAM,QAAQ,SAAQ,MAAQ,KAAK;CACrG;CAEiB,UAAU,KAAK,WAAW,oBAAoB;CAG/D,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,MAAM;CACnD;CAGA,MAAM,oBAAiB;EACrB,QAAQ,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,YAAY;CACzD;CAGA,MAAM,WAAQ;EACZ,OAAO,OAAO,OAAO,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,eAAe,CAAC;CAC1E;CAGA,MAAM,SAAM;EACV,OAAO,OAAO,OAAO,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,eAAe,CAAC;CAC1E;CAGA,MAAM,SAAM;EACV,OAAO,OAAO,OAAO,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,eAAe,CAAC;CAC1E;CASA,MAAM,eAAY;EAChB,QAAQ,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,gBAAgB;CAC7D;CAGA,MAAM,kBAAe;EACnB,MAAM,OAAO,MAAM,KAAK,mBAAmB,iBAAiB,CAAC,CAAA;EAC7D,OAAO,OAAO,KAAK,KAAI,IAAK;CAC9B;CAGA,MAAM,YAAS;EACb,MAAM,SAAS,MAAM,KAAK,mBAAmB,mBAAmB,CAAC,CAAA;EACjE,IAAI,CAAC,QAAQ,OAAO;EACpB,MAAM,OAAO,MAAM,OAAO,KAAI;EAC9B,OAAO,SAAS,KAAK,OAAO;CAC9B;CAWA,MAAM,UAAO;EACX,MAAM,QAAQ,OAAO,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,OAAO;EAC/D,MAAM,QAAQ,sBAAsB,KAAK,SAAS,EAAE;EACpD,IAAI,CAAC,OACH,MAAM,IAAI,MACR,uEAAuE,SAAS,GAAE,4FACS;EAG/F,OAAO,OAAO,WAAW,MAAM,EAAE;CACnC"}
1
+ {"version":3,"file":"ngwr-charts-gauge-testing.mjs","names":[],"sources":["../../../projects/lib/charts/gauge/testing/wr-gauge-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 { WrGaugeHarnessFilters } from './types';\n\n/**\n * Test harness for `<wr-gauge>`.\n *\n * **The dial is `aria-hidden` and the printed number is optional, so the ARIA is the\n * whole readable surface.** The component carries `role=\"meter\"` with the value\n * trio and an `aria-valuetext` that includes the suffix — which is what makes a\n * gauge with `showValue` off readable at all. {@link getValue} is what it announces;\n * {@link getDisplayValue} is what is drawn, and it is `null` when nothing is.\n *\n * The arc is an SVG path, and its `d` is a rendering detail rather than an\n * assertion — it moves with the size, the stroke width and the sweep.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrGaugeHarness extends ComponentHarness {\n static hostSelector = 'wr-gauge';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrGaugeHarnessFilters = {}): HarnessPredicate<WrGaugeHarness> {\n return new HarnessPredicate(WrGaugeHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('value', options.value, async (harness, value) => (await harness.getValue()) === value);\n }\n\n private readonly surface = this.locatorFor('.wr-gauge__surface');\n\n /** The role the dial announces — `meter`, which is what a gauge is. */\n async getRole(): Promise<string | null> {\n return (await this.surface()).getAttribute('role');\n }\n\n /** The dial's accessible name. */\n async getAccessibleName(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-label');\n }\n\n /** The value it announces, from `aria-valuenow`. */\n async getValue(): Promise<number> {\n return this.numberAttribute('aria-valuenow', 'getValue');\n }\n\n /** The bottom of the range, from `aria-valuemin`. */\n async getMin(): Promise<number> {\n return this.numberAttribute('aria-valuemin', 'getMin');\n }\n\n /** The top of the range, from `aria-valuemax`. */\n async getMax(): Promise<number> {\n return this.numberAttribute('aria-valuemax', 'getMax');\n }\n\n /**\n * A finite number off one of the meter's attributes, or a sentence saying which one\n * it lacks. `Number(null)` is `0`, so a lost binding read as a range starting at zero.\n */\n private async numberAttribute(name: string, method: string): Promise<number> {\n const raw = await (await this.surface()).getAttribute(name);\n const value = raw === null ? Number.NaN : Number.parseFloat(raw);\n if (!Number.isFinite(value)) {\n throw new Error(\n `WrGaugeHarness.${method}(): the meter carries ${name}=\"${raw ?? ''}\", which the component writes as a ` +\n 'finite number on every gauge.'\n );\n }\n return value;\n }\n\n /**\n * The spoken form of the value — the number with its suffix.\n *\n * The reason a gauge with no printed value is still readable, and worth asserting\n * separately from {@link getValue}: a percentage announced as a bare `72` says\n * something different from `72%`.\n */\n async getValueText(): Promise<string | null> {\n return (await this.surface()).getAttribute('aria-valuetext');\n }\n\n /** The number printed in the middle, suffix included, or `null` when `showValue` is off. */\n async getDisplayValue(): Promise<string | null> {\n const text = await this.locatorForOptional('.wr-gauge__text')();\n return text ? text.text() : null;\n }\n\n /** The suffix alone, or `null` when there is none — or nothing is printed. */\n async getSuffix(): Promise<string | null> {\n const suffix = await this.locatorForOptional('.wr-gauge__suffix')();\n if (!suffix) return null;\n const text = await suffix.text();\n return text === '' ? null : text;\n }\n\n /**\n * The dial's width in pixels, read off the `style` ATTRIBUTE.\n *\n * NOT `getCssValue()`, which is `getComputedStyle()`: a computed read answers\n * from the LAID-OUT box, so it agrees with the inline value in jsdom — which\n * lays nothing out and echoes the declaration — and disagrees in a browser,\n * where sub-pixel rounding turns a declared 240 into 239.5. A harness that\n * answers differently in the two places it runs is worse than one that refuses.\n */\n async getSize(): Promise<number> {\n const style = await (await this.surface()).getAttribute('style');\n const match = /width:\\s*([\\d.]+)px/.exec(style ?? '');\n if (!match) {\n throw new Error(\n `WrGaugeHarness.getSize(): the dial carries no inline width (style: \"${style ?? ''}\"). ` +\n 'The component writes one unconditionally, so its absence is the bug rather than a zero.'\n );\n }\n return Number.parseFloat(match[1]);\n }\n}\n"],"mappings":";;;;;;;AAyBA,IAAa,iBAAb,MAAa,uBAAuB,iBAAgB;CAClD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAiC,CAAA,GAAE;EAC7C,OAAO,IAAI,iBAAiB,gBAAgB,OAAO,CAAC,CACjD,UAAU,aAAa,QAAQ,YAAY,SAAS,UACnD,iBAAiB,cAAc,QAAQ,kBAAiB,GAAI,KAAK,CAAC,CACnE,CACA,UAAU,SAAS,QAAQ,OAAO,OAAO,SAAS,UAAW,MAAM,QAAQ,SAAQ,MAAQ,KAAK;CACrG;CAEiB,UAAU,KAAK,WAAW,oBAAoB;CAG/D,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,MAAM;CACnD;CAGA,MAAM,oBAAiB;EACrB,QAAQ,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,YAAY;CACzD;CAGA,MAAM,WAAQ;EACZ,OAAO,KAAK,gBAAgB,iBAAiB,UAAU;CACzD;CAGA,MAAM,SAAM;EACV,OAAO,KAAK,gBAAgB,iBAAiB,QAAQ;CACvD;CAGA,MAAM,SAAM;EACV,OAAO,KAAK,gBAAgB,iBAAiB,QAAQ;CACvD;CAMQ,MAAM,gBAAgB,MAAc,QAAc;EACxD,MAAM,MAAM,OAAO,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,IAAI;EAC1D,MAAM,QAAQ,QAAQ,OAAO,MAAa,OAAO,WAAW,GAAG;EAC/D,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,MAAM,IAAI,MACR,kBAAkB,OAAM,wBAAyB,KAAI,IAAK,OAAO,GAAE,iEAClC;EAGrC,OAAO;CACT;CASA,MAAM,eAAY;EAChB,QAAQ,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,gBAAgB;CAC7D;CAGA,MAAM,kBAAe;EACnB,MAAM,OAAO,MAAM,KAAK,mBAAmB,iBAAiB,CAAC,CAAA;EAC7D,OAAO,OAAO,KAAK,KAAI,IAAK;CAC9B;CAGA,MAAM,YAAS;EACb,MAAM,SAAS,MAAM,KAAK,mBAAmB,mBAAmB,CAAC,CAAA;EACjE,IAAI,CAAC,QAAQ,OAAO;EACpB,MAAM,OAAO,MAAM,OAAO,KAAI;EAC9B,OAAO,SAAS,KAAK,OAAO;CAC9B;CAWA,MAAM,UAAO;EACX,MAAM,QAAQ,OAAO,MAAM,KAAK,QAAO,EAAA,CAAI,aAAa,OAAO;EAC/D,MAAM,QAAQ,sBAAsB,KAAK,SAAS,EAAE;EACpD,IAAI,CAAC,OACH,MAAM,IAAI,MACR,uEAAuE,SAAS,GAAE,4FACS;EAG/F,OAAO,OAAO,WAAW,MAAM,EAAE;CACnC"}
@@ -1,8 +1,9 @@
1
1
  import * as i0 from "@angular/core";
2
- import { Component, LOCALE_ID, ViewEncapsulation, computed, inject, input, viewChild } from "@angular/core";
2
+ import { Component, ViewEncapsulation, computed, input, viewChild } from "@angular/core";
3
3
  import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coercion";
4
4
  import { useI18nText } from "ngwr/i18n";
5
5
  import { clamp } from "ngwr/utils";
6
+ import { useChartNumbers } from "ngwr/charts/core";
6
7
  import { useChartTooltip } from "ngwr/popover";
7
8
  /**
8
9
  * @license
@@ -45,20 +46,13 @@ var WrGauge = class WrGauge {
45
46
  transform: coerceBooleanProperty
46
47
  });
47
48
  valueFormat = input(null, ...ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []);
48
- locale = inject(LOCALE_ID);
49
- numbers = new Intl.NumberFormat(this.locale);
50
- smallNumbers = new Intl.NumberFormat(this.locale, { maximumSignificantDigits: 3 });
49
+ numbers = useChartNumbers(this.valueFormat);
51
50
  surface = viewChild("surface", ...ngDevMode ? [{ debugName: "surface" }] : /* istanbul ignore next */ []);
52
51
  cx = 50;
53
52
  cy = 50;
54
53
  radius = computed(() => Math.max(1, 50 - this.strokeWidth() / 2 - .5), ...ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []);
55
54
  displayValue = computed(() => clamp(this.value(), this.min(), this.max()), ...ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []);
56
- displayText = computed(() => {
57
- const value = this.displayValue();
58
- const custom = this.valueFormat();
59
- if (custom) return custom(value);
60
- return (value !== 0 && Math.abs(value) < 1 ? this.smallNumbers : this.numbers).format(value);
61
- }, ...ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []);
55
+ displayText = computed(() => this.numbers.value(this.displayValue()), ...ngDevMode ? [{ debugName: "displayText" }] : /* istanbul ignore next */ []);
62
56
  ratio = computed(() => {
63
57
  const range = this.max() - this.min();
64
58
  if (range <= 0) return 0;
@@ -92,7 +86,7 @@ var WrGauge = class WrGauge {
92
86
  });
93
87
  static ɵfac = i0.ɵɵngDeclareFactory({
94
88
  minVersion: "12.0.0",
95
- version: "22.2.3",
89
+ version: "22.2.4",
96
90
  ngImport: i0,
97
91
  type: WrGauge,
98
92
  deps: [],
@@ -100,7 +94,7 @@ var WrGauge = class WrGauge {
100
94
  });
101
95
  static ɵcmp = i0.ɵɵngDeclareComponent({
102
96
  minVersion: "17.0.0",
103
- version: "22.2.3",
97
+ version: "22.2.4",
104
98
  type: WrGauge,
105
99
  isStandalone: true,
106
100
  selector: "wr-gauge",
@@ -199,13 +193,13 @@ var WrGauge = class WrGauge {
199
193
  isSignal: true
200
194
  }],
201
195
  ngImport: i0,
202
- template: "<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n #surface\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"valueText()\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <div class=\"wr-gauge__text\">\n {{ displayText() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n",
196
+ template: "<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n #surface\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"valueText()\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <!--\n `dir=\"auto\"`, as on `wr-knob`'s value: a number and its unit read as one phrase,\n and the browser is the only thing that knows which way that phrase runs. In an\n RTL page the flex row ran right to left, so `72%` was drawn `% 72` and `9.5/10`\n as `10/ 9.5`. `dir=\"auto\"` takes the direction from the first strong character,\n so a Latin or symbol `suffix` keeps the number first, and an Arabic one still\n reads right to left. `unicode-bidi: isolate` does nothing here, since the flip\n happens inside the element; a hard `dir=\"ltr\"` would be wrong for that Arabic\n suffix.\n -->\n <div class=\"wr-gauge__text\" dir=\"auto\">\n {{ displayText() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n",
203
197
  encapsulation: i0.ViewEncapsulation.None
204
198
  });
205
199
  };
206
200
  i0.ɵɵngDeclareClassMetadata({
207
201
  minVersion: "12.0.0",
208
- version: "22.2.3",
202
+ version: "22.2.4",
209
203
  ngImport: i0,
210
204
  type: WrGauge,
211
205
  decorators: [{
@@ -214,7 +208,7 @@ i0.ɵɵngDeclareClassMetadata({
214
208
  selector: "wr-gauge",
215
209
  encapsulation: ViewEncapsulation.None,
216
210
  host: { class: "wr-gauge" },
217
- template: "<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n #surface\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"valueText()\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <div class=\"wr-gauge__text\">\n {{ displayText() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n"
211
+ template: "<!--\n The dial is drawn in an aria-hidden <svg> and the printed value is optional, so\n with `showValue` off the component had no accessible representation at all.\n `role=\"meter\"` plus the value attributes make it readable either way.\n-->\n<div\n #surface\n class=\"wr-gauge__surface\"\n [style.width.px]=\"size()\"\n role=\"meter\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [attr.aria-valuemin]=\"min()\"\n [attr.aria-valuemax]=\"max()\"\n [attr.aria-valuenow]=\"displayValue()\"\n [attr.aria-valuetext]=\"valueText()\"\n (mouseenter)=\"tip.enter(0)\"\n (mouseleave)=\"tip.leave($event)\"\n>\n <svg [attr.viewBox]=\"viewBox\" aria-hidden=\"true\">\n <path\n class=\"wr-gauge__track\"\n [attr.d]=\"trackPath()\"\n fill=\"none\"\n [attr.stroke]=\"trackColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n <path\n class=\"wr-gauge__value\"\n [attr.d]=\"valuePath()\"\n fill=\"none\"\n [attr.stroke]=\"valueColor()\"\n [attr.stroke-width]=\"strokeWidth()\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (showValue()) {\n <!--\n `dir=\"auto\"`, as on `wr-knob`'s value: a number and its unit read as one phrase,\n and the browser is the only thing that knows which way that phrase runs. In an\n RTL page the flex row ran right to left, so `72%` was drawn `% 72` and `9.5/10`\n as `10/ 9.5`. `dir=\"auto\"` takes the direction from the first strong character,\n so a Latin or symbol `suffix` keeps the number first, and an Arabic one still\n reads right to left. `unicode-bidi: isolate` does nothing here, since the flip\n happens inside the element; a hard `dir=\"ltr\"` would be wrong for that Arabic\n suffix.\n -->\n <div class=\"wr-gauge__text\" dir=\"auto\">\n {{ displayText() }}<span class=\"wr-gauge__suffix\">{{ suffix() }}</span>\n </div>\n }\n</div>\n"
218
212
  }]
219
213
  }],
220
214
  propDecorators: {