ngwr 11.1.0 → 12.0.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 (481) hide show
  1. package/README.md +7 -7
  2. package/burger/styles/_index.scss +1 -1
  3. package/button/styles/_index.scss +2 -2
  4. package/calendar/styles/_index.scss +32 -12
  5. package/calendar-heatmap/styles/_index.scss +20 -0
  6. package/carousel/styles/_index.scss +23 -1
  7. package/cascader/styles/_index.scss +15 -3
  8. package/checkbox/styles/_index.scss +2 -2
  9. package/circular-text/styles/_index.scss +11 -0
  10. package/collapse/styles/_index.scss +2 -2
  11. package/color-picker/styles/_index.scss +3 -3
  12. package/command-palette/styles/_index.scss +12 -0
  13. package/compare/styles/_index.scss +18 -2
  14. package/context-menu/styles/_index.scss +21 -2
  15. package/date-picker/styles/_index.scss +5 -5
  16. package/descriptions/styles/_index.scss +1 -1
  17. package/drag-drop/styles/_index.scss +28 -1
  18. package/drawer/styles/_index.scss +37 -0
  19. package/dropdown/styles/_index.scss +2 -2
  20. package/event-calendar/styles/_index.scss +67 -10
  21. package/fesm2022/ngwr-action-sheet-testing.mjs +313 -0
  22. package/fesm2022/ngwr-action-sheet-testing.mjs.map +1 -0
  23. package/fesm2022/ngwr-action-sheet.mjs +3 -3
  24. package/fesm2022/ngwr-affix.mjs +3 -3
  25. package/fesm2022/ngwr-alert.mjs +3 -3
  26. package/fesm2022/ngwr-anchor.mjs +3 -3
  27. package/fesm2022/ngwr-aurora.mjs +3 -3
  28. package/fesm2022/ngwr-avatar.mjs +3 -3
  29. package/fesm2022/ngwr-back-top.mjs +3 -3
  30. package/fesm2022/ngwr-badge.mjs +6 -6
  31. package/fesm2022/ngwr-bar-chart-testing.mjs +107 -0
  32. package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -0
  33. package/fesm2022/ngwr-bar-chart.mjs +3 -3
  34. package/fesm2022/ngwr-blur-text-testing.mjs +203 -0
  35. package/fesm2022/ngwr-blur-text-testing.mjs.map +1 -0
  36. package/fesm2022/ngwr-blur-text.mjs +18 -4
  37. package/fesm2022/ngwr-blur-text.mjs.map +1 -1
  38. package/fesm2022/ngwr-border-glow-testing.mjs +325 -0
  39. package/fesm2022/ngwr-border-glow-testing.mjs.map +1 -0
  40. package/fesm2022/ngwr-border-glow.mjs +4 -4
  41. package/fesm2022/ngwr-border-glow.mjs.map +1 -1
  42. package/fesm2022/ngwr-breadcrumbs.mjs +29 -17
  43. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  44. package/fesm2022/ngwr-burger.mjs +3 -3
  45. package/fesm2022/ngwr-button.mjs +6 -6
  46. package/fesm2022/ngwr-calendar-heatmap-testing.mjs +95 -0
  47. package/fesm2022/ngwr-calendar-heatmap-testing.mjs.map +1 -0
  48. package/fesm2022/ngwr-calendar-heatmap.mjs +17 -5
  49. package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
  50. package/fesm2022/ngwr-calendar-testing.mjs +368 -0
  51. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -0
  52. package/fesm2022/ngwr-calendar.mjs +228 -10
  53. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  54. package/fesm2022/ngwr-card.mjs +10 -10
  55. package/fesm2022/ngwr-card.mjs.map +1 -1
  56. package/fesm2022/ngwr-carousel.mjs +124 -24
  57. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  58. package/fesm2022/ngwr-cascader.mjs +60 -5
  59. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  60. package/fesm2022/ngwr-checkbox.mjs +14 -6
  61. package/fesm2022/ngwr-checkbox.mjs.map +1 -1
  62. package/fesm2022/ngwr-circular-text-testing.mjs +230 -0
  63. package/fesm2022/ngwr-circular-text-testing.mjs.map +1 -0
  64. package/fesm2022/ngwr-circular-text.mjs +4 -4
  65. package/fesm2022/ngwr-circular-text.mjs.map +1 -1
  66. package/fesm2022/ngwr-click-spark.mjs +27 -7
  67. package/fesm2022/ngwr-click-spark.mjs.map +1 -1
  68. package/fesm2022/ngwr-clipboard.mjs +3 -3
  69. package/fesm2022/ngwr-collapse.mjs +9 -9
  70. package/fesm2022/ngwr-color-picker-testing.mjs +452 -0
  71. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -0
  72. package/fesm2022/ngwr-color-picker.mjs +126 -10
  73. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  74. package/fesm2022/ngwr-command-palette.mjs +14 -5
  75. package/fesm2022/ngwr-command-palette.mjs.map +1 -1
  76. package/fesm2022/ngwr-compare.mjs +3 -3
  77. package/fesm2022/ngwr-confetti.mjs +31 -6
  78. package/fesm2022/ngwr-confetti.mjs.map +1 -1
  79. package/fesm2022/ngwr-config.mjs +9 -0
  80. package/fesm2022/ngwr-config.mjs.map +1 -1
  81. package/fesm2022/ngwr-context-menu-testing.mjs +30 -11
  82. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  83. package/fesm2022/ngwr-context-menu.mjs +358 -48
  84. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  85. package/fesm2022/ngwr-cookie.mjs +3 -3
  86. package/fesm2022/ngwr-counter.mjs +25 -9
  87. package/fesm2022/ngwr-counter.mjs.map +1 -1
  88. package/fesm2022/{ngwr-date-adapter-fns.mjs → ngwr-date-adapters-fns.mjs} +37 -10
  89. package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -0
  90. package/fesm2022/{ngwr-date-adapter-luxon.mjs → ngwr-date-adapters-luxon.mjs} +5 -5
  91. package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -0
  92. package/fesm2022/ngwr-date-picker-testing.mjs +21 -85
  93. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  94. package/fesm2022/ngwr-date-picker.mjs +119 -37
  95. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  96. package/fesm2022/{ngwr-date-adapter.mjs → ngwr-date.mjs} +36 -10
  97. package/fesm2022/ngwr-date.mjs.map +1 -0
  98. package/fesm2022/ngwr-decrypt-text-testing.mjs +261 -0
  99. package/fesm2022/ngwr-decrypt-text-testing.mjs.map +1 -0
  100. package/fesm2022/ngwr-decrypt-text.mjs +9 -4
  101. package/fesm2022/ngwr-decrypt-text.mjs.map +1 -1
  102. package/fesm2022/ngwr-density.mjs +6 -6
  103. package/fesm2022/ngwr-descriptions.mjs +6 -6
  104. package/fesm2022/ngwr-dialog.mjs +73 -18
  105. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  106. package/fesm2022/ngwr-directives.mjs +12 -12
  107. package/fesm2022/ngwr-divider.mjs +52 -5
  108. package/fesm2022/ngwr-divider.mjs.map +1 -1
  109. package/fesm2022/ngwr-donut-chart-testing.mjs +97 -0
  110. package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -0
  111. package/fesm2022/ngwr-donut-chart.mjs +7 -7
  112. package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
  113. package/fesm2022/ngwr-drag-drop.mjs +160 -11
  114. package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
  115. package/fesm2022/ngwr-drawer.mjs +156 -64
  116. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  117. package/fesm2022/ngwr-dropdown.mjs +58 -12
  118. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  119. package/fesm2022/ngwr-empty.mjs +3 -3
  120. package/fesm2022/ngwr-event-calendar-testing.mjs +446 -0
  121. package/fesm2022/ngwr-event-calendar-testing.mjs.map +1 -0
  122. package/fesm2022/ngwr-event-calendar.mjs +66 -28
  123. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  124. package/fesm2022/ngwr-falling-text-testing.mjs +220 -0
  125. package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -0
  126. package/fesm2022/ngwr-falling-text.mjs +75 -46
  127. package/fesm2022/ngwr-falling-text.mjs.map +1 -1
  128. package/fesm2022/ngwr-file-upload.mjs +3 -3
  129. package/fesm2022/ngwr-form.mjs +32 -15
  130. package/fesm2022/ngwr-form.mjs.map +1 -1
  131. package/fesm2022/ngwr-fuzzy-text-testing.mjs +134 -0
  132. package/fesm2022/ngwr-fuzzy-text-testing.mjs.map +1 -0
  133. package/fesm2022/ngwr-fuzzy-text.mjs +21 -11
  134. package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
  135. package/fesm2022/ngwr-gauge-testing.mjs +86 -0
  136. package/fesm2022/ngwr-gauge-testing.mjs.map +1 -0
  137. package/fesm2022/ngwr-gauge.mjs +3 -3
  138. package/fesm2022/ngwr-glitch-text-testing.mjs +215 -0
  139. package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -0
  140. package/fesm2022/ngwr-glitch-text.mjs +7 -7
  141. package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
  142. package/fesm2022/ngwr-gradient-text-testing.mjs +258 -0
  143. package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -0
  144. package/fesm2022/ngwr-gradient-text.mjs +4 -4
  145. package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
  146. package/fesm2022/ngwr-hotkey.mjs +24 -9
  147. package/fesm2022/ngwr-hotkey.mjs.map +1 -1
  148. package/fesm2022/ngwr-i18n-en.mjs +87 -1
  149. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  150. package/fesm2022/ngwr-i18n-ru.mjs +69 -1
  151. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n.mjs +26 -15
  153. package/fesm2022/ngwr-i18n.mjs.map +1 -1
  154. package/fesm2022/ngwr-icon.mjs +6 -6
  155. package/fesm2022/ngwr-image-cropper-testing.mjs +200 -0
  156. package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -0
  157. package/fesm2022/ngwr-image-cropper.mjs +156 -11
  158. package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
  159. package/fesm2022/ngwr-input-number-testing.mjs +15 -10
  160. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  161. package/fesm2022/ngwr-input-number.mjs +89 -15
  162. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  163. package/fesm2022/ngwr-input-otp-testing.mjs +12 -6
  164. package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
  165. package/fesm2022/ngwr-input-otp.mjs +24 -5
  166. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  167. package/fesm2022/ngwr-input.mjs +15 -15
  168. package/fesm2022/ngwr-keyboard.mjs +3 -3
  169. package/fesm2022/ngwr-knob-testing.mjs +220 -0
  170. package/fesm2022/ngwr-knob-testing.mjs.map +1 -0
  171. package/fesm2022/ngwr-knob.mjs +3 -3
  172. package/fesm2022/ngwr-layout.mjs +15 -15
  173. package/fesm2022/ngwr-lightbox-testing.mjs +223 -0
  174. package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -0
  175. package/fesm2022/ngwr-lightbox.mjs +11 -4
  176. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  177. package/fesm2022/ngwr-line-chart-testing.mjs +119 -0
  178. package/fesm2022/ngwr-line-chart-testing.mjs.map +1 -0
  179. package/fesm2022/ngwr-line-chart.mjs +73 -26
  180. package/fesm2022/ngwr-line-chart.mjs.map +1 -1
  181. package/fesm2022/ngwr-list.mjs +7 -7
  182. package/fesm2022/ngwr-list.mjs.map +1 -1
  183. package/fesm2022/ngwr-loading-bar.mjs +7 -7
  184. package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
  185. package/fesm2022/ngwr-markdown.mjs +66 -8
  186. package/fesm2022/ngwr-markdown.mjs.map +1 -1
  187. package/fesm2022/ngwr-marquee-testing.mjs +336 -0
  188. package/fesm2022/ngwr-marquee-testing.mjs.map +1 -0
  189. package/fesm2022/ngwr-marquee.mjs +4 -4
  190. package/fesm2022/ngwr-marquee.mjs.map +1 -1
  191. package/fesm2022/ngwr-media.mjs +3 -3
  192. package/fesm2022/ngwr-mention.mjs +108 -13
  193. package/fesm2022/ngwr-mention.mjs.map +1 -1
  194. package/fesm2022/ngwr-meta.mjs +6 -6
  195. package/fesm2022/ngwr-meter-group-testing.mjs +100 -0
  196. package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -0
  197. package/fesm2022/ngwr-meter-group.mjs +3 -3
  198. package/fesm2022/ngwr-overlay.mjs +34 -7
  199. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  200. package/fesm2022/ngwr-page-header.mjs +3 -3
  201. package/fesm2022/ngwr-pagination-testing.mjs +6 -6
  202. package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
  203. package/fesm2022/ngwr-pagination.mjs +17 -13
  204. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  205. package/fesm2022/ngwr-pipes.mjs +39 -26
  206. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  207. package/fesm2022/ngwr-platform.mjs +9 -9
  208. package/fesm2022/ngwr-popconfirm.mjs +6 -6
  209. package/fesm2022/ngwr-popover-testing.mjs +7 -2
  210. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  211. package/fesm2022/ngwr-popover.mjs +169 -33
  212. package/fesm2022/ngwr-popover.mjs.map +1 -1
  213. package/fesm2022/ngwr-progress.mjs +3 -3
  214. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  215. package/fesm2022/ngwr-qr.mjs +42 -5
  216. package/fesm2022/ngwr-qr.mjs.map +1 -1
  217. package/fesm2022/ngwr-radio.mjs +6 -6
  218. package/fesm2022/ngwr-rating.mjs +3 -3
  219. package/fesm2022/ngwr-result.mjs +21 -30
  220. package/fesm2022/ngwr-result.mjs.map +1 -1
  221. package/fesm2022/ngwr-rotating-text-testing.mjs +220 -0
  222. package/fesm2022/ngwr-rotating-text-testing.mjs.map +1 -0
  223. package/fesm2022/ngwr-rotating-text.mjs +4 -4
  224. package/fesm2022/ngwr-rotating-text.mjs.map +1 -1
  225. package/fesm2022/ngwr-scroll.mjs +3 -3
  226. package/fesm2022/ngwr-segmented-testing.mjs +14 -1
  227. package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
  228. package/fesm2022/ngwr-segmented.mjs +29 -6
  229. package/fesm2022/ngwr-segmented.mjs.map +1 -1
  230. package/fesm2022/ngwr-select.mjs +227 -43
  231. package/fesm2022/ngwr-select.mjs.map +1 -1
  232. package/fesm2022/ngwr-shiny-text-testing.mjs +237 -0
  233. package/fesm2022/ngwr-shiny-text-testing.mjs.map +1 -0
  234. package/fesm2022/ngwr-shiny-text.mjs +11 -9
  235. package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
  236. package/fesm2022/ngwr-sidebar.mjs +31 -16
  237. package/fesm2022/ngwr-sidebar.mjs.map +1 -1
  238. package/fesm2022/ngwr-skeleton.mjs +3 -3
  239. package/fesm2022/ngwr-slider.mjs +143 -14
  240. package/fesm2022/ngwr-slider.mjs.map +1 -1
  241. package/fesm2022/ngwr-sparkline-testing.mjs +76 -0
  242. package/fesm2022/ngwr-sparkline-testing.mjs.map +1 -0
  243. package/fesm2022/ngwr-sparkline.mjs +3 -3
  244. package/fesm2022/ngwr-speed-dial-testing.mjs +281 -0
  245. package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -0
  246. package/fesm2022/ngwr-speed-dial.mjs +27 -12
  247. package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
  248. package/fesm2022/ngwr-spinner.mjs +3 -3
  249. package/fesm2022/ngwr-splash-cursor-testing.mjs +89 -0
  250. package/fesm2022/ngwr-splash-cursor-testing.mjs.map +1 -0
  251. package/fesm2022/ngwr-splash-cursor.mjs +3 -3
  252. package/fesm2022/ngwr-split-text-testing.mjs +224 -0
  253. package/fesm2022/ngwr-split-text-testing.mjs.map +1 -0
  254. package/fesm2022/ngwr-split-text.mjs +31 -5
  255. package/fesm2022/ngwr-split-text.mjs.map +1 -1
  256. package/fesm2022/ngwr-splitter-testing.mjs +245 -0
  257. package/fesm2022/ngwr-splitter-testing.mjs.map +1 -0
  258. package/fesm2022/ngwr-splitter.mjs +3 -3
  259. package/fesm2022/ngwr-spotlight-card-testing.mjs +368 -0
  260. package/fesm2022/ngwr-spotlight-card-testing.mjs.map +1 -0
  261. package/fesm2022/ngwr-spotlight-card.mjs +7 -7
  262. package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
  263. package/fesm2022/ngwr-squircle.mjs +6 -6
  264. package/fesm2022/ngwr-star-border-testing.mjs +172 -0
  265. package/fesm2022/ngwr-star-border-testing.mjs.map +1 -0
  266. package/fesm2022/ngwr-star-border.mjs +4 -4
  267. package/fesm2022/ngwr-star-border.mjs.map +1 -1
  268. package/fesm2022/ngwr-statistic.mjs +9 -9
  269. package/fesm2022/ngwr-stepper-testing.mjs +8 -8
  270. package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
  271. package/fesm2022/ngwr-stepper.mjs +33 -8
  272. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  273. package/fesm2022/ngwr-storage.mjs +17 -5
  274. package/fesm2022/ngwr-storage.mjs.map +1 -1
  275. package/fesm2022/ngwr-switch.mjs +3 -3
  276. package/fesm2022/ngwr-table.mjs +110 -40
  277. package/fesm2022/ngwr-table.mjs.map +1 -1
  278. package/fesm2022/ngwr-tabs-testing.mjs +11 -10
  279. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  280. package/fesm2022/ngwr-tabs.mjs +51 -11
  281. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  282. package/fesm2022/ngwr-textarea.mjs +3 -3
  283. package/fesm2022/ngwr-theme.mjs +181 -4
  284. package/fesm2022/ngwr-theme.mjs.map +1 -1
  285. package/fesm2022/ngwr-tilt-card-testing.mjs +190 -0
  286. package/fesm2022/ngwr-tilt-card-testing.mjs.map +1 -0
  287. package/fesm2022/ngwr-tilt-card.mjs +26 -8
  288. package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
  289. package/fesm2022/ngwr-timeline.mjs +6 -6
  290. package/fesm2022/ngwr-toast.mjs +44 -15
  291. package/fesm2022/ngwr-toast.mjs.map +1 -1
  292. package/fesm2022/ngwr-toolbar.mjs +3 -3
  293. package/fesm2022/ngwr-tour-testing.mjs +173 -0
  294. package/fesm2022/ngwr-tour-testing.mjs.map +1 -0
  295. package/fesm2022/ngwr-tour.mjs +34 -10
  296. package/fesm2022/ngwr-tour.mjs.map +1 -1
  297. package/fesm2022/ngwr-transfer.mjs +3 -3
  298. package/fesm2022/ngwr-tree.mjs +36 -11
  299. package/fesm2022/ngwr-tree.mjs.map +1 -1
  300. package/fesm2022/ngwr-typewriter-testing.mjs +242 -0
  301. package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -0
  302. package/fesm2022/ngwr-typewriter.mjs +13 -5
  303. package/fesm2022/ngwr-typewriter.mjs.map +1 -1
  304. package/fesm2022/ngwr-typography.mjs +3 -3
  305. package/fesm2022/ngwr-utils.mjs +5 -2
  306. package/fesm2022/ngwr-utils.mjs.map +1 -1
  307. package/fesm2022/ngwr-version.mjs +1 -1
  308. package/fesm2022/ngwr-version.mjs.map +1 -1
  309. package/fesm2022/ngwr-virtual-scroll.mjs +4 -4
  310. package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
  311. package/fesm2022/ngwr-waves-testing.mjs +128 -0
  312. package/fesm2022/ngwr-waves-testing.mjs.map +1 -0
  313. package/fesm2022/ngwr-waves.mjs +4 -4
  314. package/fesm2022/ngwr-waves.mjs.map +1 -1
  315. package/fesm2022/ngwr-window-testing.mjs +361 -0
  316. package/fesm2022/ngwr-window-testing.mjs.map +1 -0
  317. package/fesm2022/ngwr-window.mjs +175 -31
  318. package/fesm2022/ngwr-window.mjs.map +1 -1
  319. package/file-upload/styles/_index.scss +2 -2
  320. package/glitch-text/styles/_index.scss +27 -12
  321. package/i18n/en.json +71 -7
  322. package/i18n/ru.json +71 -7
  323. package/image-cropper/styles/_index.scss +19 -0
  324. package/input/styles/_index.scss +2 -2
  325. package/input-number/styles/_index.scss +2 -2
  326. package/input-otp/styles/_index.scss +9 -2
  327. package/knob/styles/_index.scss +1 -1
  328. package/lightbox/styles/_index.scss +16 -2
  329. package/line-chart/styles/_index.scss +28 -14
  330. package/list/styles/_index.scss +1 -1
  331. package/llms-full.txt +161 -19
  332. package/llms.txt +45 -10
  333. package/markdown/styles/_index.scss +3 -3
  334. package/mcp/api.js +6 -4
  335. package/mcp/catalog.js +40 -3
  336. package/mcp/providers.js +42 -0
  337. package/mcp/tools.js +22 -30
  338. package/meter-group/styles/_index.scss +1 -1
  339. package/overlay/styles/_index.scss +33 -1
  340. package/package.json +161 -12
  341. package/pagination/styles/_index.scss +23 -1
  342. package/popover/styles/_index.scss +16 -7
  343. package/progress/styles/_index.scss +1 -1
  344. package/radio/styles/_index.scss +2 -2
  345. package/rating/styles/_index.scss +1 -1
  346. package/schematics/collection.json +1 -1
  347. package/schematics/migrations/v12/index.js +65 -0
  348. package/schematics/migrations/v7/index.js +12 -1
  349. package/schematics/migrations/v8/index.js +10 -1
  350. package/schematics/migrations.json +5 -0
  351. package/schematics/ng-add/index.js +8 -3
  352. package/schematics/provider/index.js +80 -13
  353. package/schematics/use/index.js +9 -129
  354. package/schematics/use/rule.js +206 -0
  355. package/schematics/use/symbol-map.json +4 -4
  356. package/segmented/styles/_index.scss +14 -3
  357. package/select/styles/_index.scss +14 -2
  358. package/sidebar/styles/_index.scss +12 -10
  359. package/skills/ngwr/SKILL.md +117 -0
  360. package/skills/ngwr/references/catalog.md +212 -0
  361. package/skills/ngwr/references/setup.md +78 -0
  362. package/slider/styles/_index.scss +1 -1
  363. package/speed-dial/styles/_index.scss +1 -1
  364. package/stepper/styles/_index.scss +12 -3
  365. package/switch/styles/_index.scss +2 -2
  366. package/table/styles/_index.scss +61 -12
  367. package/tabs/styles/_index.scss +1 -1
  368. package/textarea/styles/_index.scss +1 -1
  369. package/theme/styles/_colors.scss +142 -56
  370. package/theme/styles/_dark.scss +46 -3
  371. package/theme/styles/_focus.scss +28 -5
  372. package/theme/styles/_mixins.scss +1 -1
  373. package/theme/styles/_variables.scss +67 -0
  374. package/transfer/styles/_index.scss +26 -3
  375. package/tree/styles/_index.scss +29 -6
  376. package/types/ngwr-action-sheet-testing.d.ts +260 -0
  377. package/types/ngwr-bar-chart-testing.d.ts +85 -0
  378. package/types/ngwr-blur-text-testing.d.ts +180 -0
  379. package/types/ngwr-blur-text.d.ts +20 -4
  380. package/types/ngwr-border-glow-testing.d.ts +219 -0
  381. package/types/ngwr-breadcrumbs.d.ts +17 -10
  382. package/types/ngwr-calendar-heatmap-testing.d.ts +79 -0
  383. package/types/ngwr-calendar-testing.d.ts +277 -0
  384. package/types/ngwr-calendar.d.ts +76 -0
  385. package/types/ngwr-carousel.d.ts +85 -6
  386. package/types/ngwr-cascader.d.ts +17 -0
  387. package/types/ngwr-checkbox.d.ts +13 -0
  388. package/types/ngwr-circular-text-testing.d.ts +196 -0
  389. package/types/ngwr-click-spark.d.ts +4 -0
  390. package/types/ngwr-color-picker-testing.d.ts +299 -0
  391. package/types/ngwr-color-picker.d.ts +34 -2
  392. package/types/ngwr-confetti.d.ts +8 -0
  393. package/types/ngwr-config.d.ts +10 -1
  394. package/types/ngwr-context-menu-testing.d.ts +24 -11
  395. package/types/ngwr-context-menu.d.ts +71 -1
  396. package/types/ngwr-counter.d.ts +1 -0
  397. package/types/{ngwr-date-adapter-fns.d.ts → ngwr-date-adapters-fns.d.ts} +33 -6
  398. package/types/{ngwr-date-adapter-luxon.d.ts → ngwr-date-adapters-luxon.d.ts} +1 -1
  399. package/types/ngwr-date-picker-testing.d.ts +17 -72
  400. package/types/ngwr-date-picker.d.ts +8 -4
  401. package/types/{ngwr-date-adapter.d.ts → ngwr-date.d.ts} +24 -5
  402. package/types/ngwr-decrypt-text-testing.d.ts +222 -0
  403. package/types/ngwr-dialog.d.ts +38 -1
  404. package/types/ngwr-divider.d.ts +25 -0
  405. package/types/ngwr-donut-chart-testing.d.ts +83 -0
  406. package/types/ngwr-donut-chart.d.ts +3 -3
  407. package/types/ngwr-drag-drop.d.ts +56 -2
  408. package/types/ngwr-drawer.d.ts +68 -5
  409. package/types/ngwr-dropdown.d.ts +9 -0
  410. package/types/ngwr-event-calendar-testing.d.ts +301 -0
  411. package/types/ngwr-event-calendar.d.ts +17 -8
  412. package/types/ngwr-falling-text-testing.d.ts +188 -0
  413. package/types/ngwr-falling-text.d.ts +1 -1
  414. package/types/ngwr-form.d.ts +12 -2
  415. package/types/ngwr-fuzzy-text-testing.d.ts +130 -0
  416. package/types/ngwr-gauge-testing.d.ts +71 -0
  417. package/types/ngwr-glitch-text-testing.d.ts +201 -0
  418. package/types/ngwr-gradient-text-testing.d.ts +186 -0
  419. package/types/ngwr-i18n.d.ts +13 -4
  420. package/types/ngwr-image-cropper-testing.d.ts +173 -0
  421. package/types/ngwr-image-cropper.d.ts +71 -5
  422. package/types/ngwr-input-number-testing.d.ts +15 -10
  423. package/types/ngwr-input-number.d.ts +44 -5
  424. package/types/ngwr-input-otp-testing.d.ts +12 -6
  425. package/types/ngwr-input-otp.d.ts +15 -1
  426. package/types/ngwr-knob-testing.d.ts +150 -0
  427. package/types/ngwr-lightbox-testing.d.ts +154 -0
  428. package/types/ngwr-lightbox.d.ts +6 -0
  429. package/types/ngwr-line-chart-testing.d.ts +93 -0
  430. package/types/ngwr-line-chart.d.ts +20 -3
  431. package/types/ngwr-markdown.d.ts +11 -0
  432. package/types/ngwr-marquee-testing.d.ts +280 -0
  433. package/types/ngwr-mention.d.ts +32 -0
  434. package/types/ngwr-meter-group-testing.d.ts +77 -0
  435. package/types/ngwr-overlay.d.ts +20 -1
  436. package/types/ngwr-pagination-testing.d.ts +4 -4
  437. package/types/ngwr-pipes.d.ts +1 -1
  438. package/types/ngwr-popover-testing.d.ts +7 -2
  439. package/types/ngwr-popover.d.ts +1 -0
  440. package/types/ngwr-result.d.ts +6 -0
  441. package/types/ngwr-rotating-text-testing.d.ts +191 -0
  442. package/types/ngwr-segmented-testing.d.ts +9 -0
  443. package/types/ngwr-segmented.d.ts +21 -1
  444. package/types/ngwr-select.d.ts +100 -6
  445. package/types/ngwr-shiny-text-testing.d.ts +165 -0
  446. package/types/ngwr-shiny-text.d.ts +4 -2
  447. package/types/ngwr-sidebar.d.ts +14 -5
  448. package/types/ngwr-slider.d.ts +84 -1
  449. package/types/ngwr-sparkline-testing.d.ts +69 -0
  450. package/types/ngwr-speed-dial-testing.d.ts +199 -0
  451. package/types/ngwr-speed-dial.d.ts +22 -3
  452. package/types/ngwr-splash-cursor-testing.d.ts +95 -0
  453. package/types/ngwr-split-text-testing.d.ts +209 -0
  454. package/types/ngwr-split-text.d.ts +21 -0
  455. package/types/ngwr-splitter-testing.d.ts +174 -0
  456. package/types/ngwr-spotlight-card-testing.d.ts +303 -0
  457. package/types/ngwr-star-border-testing.d.ts +135 -0
  458. package/types/ngwr-stepper-testing.d.ts +5 -5
  459. package/types/ngwr-stepper.d.ts +8 -0
  460. package/types/ngwr-storage.d.ts +1 -0
  461. package/types/ngwr-table.d.ts +114 -12
  462. package/types/ngwr-tabs-testing.d.ts +11 -10
  463. package/types/ngwr-tabs.d.ts +2 -0
  464. package/types/ngwr-theme.d.ts +82 -1
  465. package/types/ngwr-tilt-card-testing.d.ts +158 -0
  466. package/types/ngwr-tilt-card.d.ts +2 -0
  467. package/types/ngwr-toast.d.ts +14 -5
  468. package/types/ngwr-tour-testing.d.ts +143 -0
  469. package/types/ngwr-tour.d.ts +22 -4
  470. package/types/ngwr-tree.d.ts +12 -4
  471. package/types/ngwr-typewriter-testing.d.ts +211 -0
  472. package/types/ngwr-utils.d.ts +5 -2
  473. package/types/ngwr-version.d.ts +1 -1
  474. package/types/ngwr-waves-testing.d.ts +121 -0
  475. package/types/ngwr-window-testing.d.ts +263 -0
  476. package/types/ngwr-window.d.ts +66 -21
  477. package/typography/styles/_index.scss +1 -1
  478. package/window/styles/_index.scss +116 -42
  479. package/fesm2022/ngwr-date-adapter-fns.mjs.map +0 -1
  480. package/fesm2022/ngwr-date-adapter-luxon.mjs.map +0 -1
  481. package/fesm2022/ngwr-date-adapter.mjs.map +0 -1
@@ -64,12 +64,12 @@ class WrTabHarness extends ContentContainerComponentHarness {
64
64
  * Whether this is the strip's selected tab.
65
65
  *
66
66
  * `aria-selected` first, because that is the state a screen reader acts on and
67
- * the `--active` class is only what it looks like. A ROUTER tab carries no
68
- * `aria-selected` at all — the router paints the class through
69
- * `routerLinkActive` and nothing announces the selection — so the class is the
70
- * fallback rather than the first choice, and the two branches are not
71
- * interchangeable: reading the class first would report a content tab as selected
72
- * while `aria-selected="false"` told assistive tech otherwise.
67
+ * the `--active` class is only what it looks like. Both shapes carry it now — a
68
+ * router tab publishes it off the same `routerLinkActive` that paints the class —
69
+ * so the class is a fallback for a tab that has neither yet, not a second reading
70
+ * of the same thing. The order is not interchangeable: reading the class first
71
+ * would report a tab as selected while `aria-selected="false"` told assistive tech
72
+ * otherwise.
73
73
  */
74
74
  async isSelected() {
75
75
  const host = await this.host();
@@ -267,10 +267,11 @@ class WrTabHarness extends ContentContainerComponentHarness {
267
267
  * the tab they move to, the APG's automatic-activation pattern. `<wr-tabs>`
268
268
  * renders exactly one panel: the selected tab's.
269
269
  * - **Router** — one `routerLink` on any child switches the whole strip over. The
270
- * tabs become `<a role="tab">`s, they announce no `aria-selected` at all (the
271
- * router paints `--active` and nothing else), the strip renders NO panel, and it
272
- * stops being one tab stop — every enabled tab is a Tab stop of its own. The
273
- * arrow keys still move focus, but they select nothing: the route does that.
270
+ * tabs become `<a role="tab">`s whose `aria-selected` follows the resolved route
271
+ * (the same `routerLinkActive` that paints `--active`), the strip renders NO
272
+ * panel, and it stops being one tab stop — every enabled tab is a Tab stop of its
273
+ * own. The arrow keys still move focus, but they select nothing: the route does
274
+ * that.
274
275
  *
275
276
  * So {@link getSelectedLabel} and {@link getFocusedLabel} are two different
276
277
  * questions, and {@link getTabStopLabels} is a third. They coincide in content mode
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-tabs-testing.mjs","sources":["../../../projects/lib/tabs/testing/wr-tab-harness.ts","../../../projects/lib/tabs/testing/wr-tabs-harness.ts","../../../projects/lib/tabs/testing/ngwr-tabs-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters } from './interfaces';\n\n/**\n * Test harness for one tab of a `<wr-tabs>` strip — the header, and the panel it\n * controls.\n *\n * Its host is the RENDERED HEADER, not the `<wr-tab>` element. A `<wr-tab>` is\n * `display:none` and holds nothing but a `<ng-template>`: the label, the selection\n * state, the tab stop and the click target all live on the element the parent\n * renders for it, which is a `<button role=\"tab\">` in content mode and an\n * `<a role=\"tab\">` in router mode. A harness hosted on `wr-tab` would answer every\n * question with nothing.\n *\n * Also a CONTENT CONTAINER, scoped to the panel this tab controls, so\n * `tab.getHarness(WrButtonHarness…)` reaches the consumer's own components inside\n * the tab's content. The panel is not a descendant of the header — it is a sibling\n * of the whole strip — so it is resolved through the `aria-controls` id, which is\n * also the pairing {@link isPanelBound} checks. Only the SELECTED tab has a panel\n * to reach: `<wr-tabs>` renders one panel and destroys it on every switch.\n *\n * @example\n * ```ts\n * const tabs = await loader.getHarness(WrTabsHarness);\n * const [first] = await tabs.getTabs();\n *\n * expect(await first.isSelected()).toBe(true);\n * expect(await first.isPanelBound()).toBe(true);\n * await (await first.getHarness(WrButtonHarness.with({ text: 'Save' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTabHarness extends ContentContainerComponentHarness {\n /** The header the strip renders for a `<wr-tab>` — a `<button>`, or an `<a>` in router mode. */\n static hostSelector = '.wr-tabs__tab';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTabHarnessFilters = {}): HarnessPredicate<WrTabHarness> {\n return new HarnessPredicate(WrTabHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /** The tab's visible label, trimmed — the `<wr-tab>`'s `title`. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * The header's own id, which is what the panel points back at with\n * `aria-labelledby` — the tab is the panel's accessible name.\n *\n * Generated from the tab's `key`, so two strips on one page whose tabs share keys\n * publish the same ids and each panel then names whichever header came first.\n */\n async getId(): Promise<string | null> {\n return (await this.host()).getAttribute('id');\n }\n\n /**\n * Whether this is the strip's selected tab.\n *\n * `aria-selected` first, because that is the state a screen reader acts on and\n * the `--active` class is only what it looks like. A ROUTER tab carries no\n * `aria-selected` at all — the router paints the class through\n * `routerLinkActive` and nothing announces the selection — so the class is the\n * fallback rather than the first choice, and the two branches are not\n * interchangeable: reading the class first would report a content tab as selected\n * while `aria-selected=\"false\"` told assistive tech otherwise.\n */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n const selected = await host.getAttribute('aria-selected');\n if (selected !== null) return selected === 'true';\n return host.hasClass('wr-tabs__tab--active');\n }\n\n /**\n * Whether the tab refuses activation.\n *\n * The two shapes say it differently and both are read: a content tab is a real\n * `<button>` and carries the native `disabled`, a router tab is an `<a>` — which\n * cannot be disabled natively — and carries `aria-disabled` with `tabindex=\"-1\"`.\n * The `--disabled` class is on both and is deliberately not the source: a class\n * says how the tab looks, these two say what it refuses.\n */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n if ((await host.getAttribute('aria-disabled')) === 'true') return true;\n return (await host.getProperty<boolean | undefined>('disabled')) === true;\n }\n\n /** Whether this tab is a link — the router shape, where selection follows the route. */\n async isLink(): Promise<boolean> {\n return (await this.host()).matchesSelector('a');\n }\n\n /**\n * The resolved href of a router tab, or `null` for a content tab.\n *\n * `null` is the answer for a `<button>` rather than a gap — a content tab\n * navigates nowhere, it swaps a panel.\n */\n async getHref(): Promise<string | null> {\n return (await this.host()).getAttribute('href');\n }\n\n /**\n * Whether a Tab press can land on this header.\n *\n * A content strip is ONE tab stop and hands it to the selected tab; a router\n * strip makes every enabled tab a stop of its own. See\n * `WrTabsHarness.getTabStopLabels()` — the difference is a mode difference, not\n * a rounding error.\n *\n * A non-negative `tabindex` is not enough on its own, which is why `disabled` is\n * read too: `<wr-tabs>` gives the roving `tabindex=\"0\"` to whatever `active`\n * names without checking whether that tab is disabled, so a host binding `active`\n * to a disabled tab's key renders a `<button disabled tabindex=\"0\">` — which no\n * Tab press reaches. jsdom will focus such a button anyway, so this is the only\n * place a unit test can tell the difference.\n */\n async isTabStop(): Promise<boolean> {\n if (await this.isDisabled()) return false;\n const tabIndex = await (await this.host()).getAttribute('tabindex');\n return Number.parseInt(tabIndex ?? '-1', 10) >= 0;\n }\n\n /**\n * The id of the panel this tab controls, or `null` when it controls none.\n *\n * `null` for a router tab — the strip renders no panel in that mode, the consumer\n * drops a `<router-outlet>` after it — and that missing `aria-controls` is the\n * honest report: there is nothing for the header to point at.\n */\n async getPanelId(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-controls');\n }\n\n /** Whether this tab's panel is in the DOM right now — true only for the selected tab. */\n async hasPanel(): Promise<boolean> {\n return (await this.panelOrNull()) !== null;\n }\n\n /**\n * Whether the panel and this header really name each other.\n *\n * Both halves, because each covers a different failure: the header's\n * `aria-controls` has to reach the panel that is showing, and the panel's\n * `aria-labelledby` has to come back to THIS header. A panel wired to the wrong\n * tab looks perfect on screen — the right content is under the right header — and\n * announces the wrong name, which is the whole of a tabbed interface for anyone\n * not looking at it. It also has to be a `tabpanel`: the reference resolving to\n * some other element is a broken pairing, not a styling detail.\n *\n * Throws when there is no panel at all, which is a different fact from a broken\n * pairing — see {@link getPanelText}.\n */\n async isPanelBound(): Promise<boolean> {\n const panel = await this.panelOrThrow('isPanelBound');\n if ((await panel.getAttribute('role')) !== 'tabpanel') return false;\n return (await panel.getAttribute('aria-labelledby')) === (await this.getId());\n }\n\n /**\n * The text of this tab's panel, trimmed.\n *\n * Throws rather than answering `''` for a tab whose panel is not rendered, and\n * the message says which of the two reasons it is: `<wr-tabs>` keeps only the\n * selected tab's panel in the DOM (the content of every other tab sits in an\n * unrendered `<ng-template>`, so switching tabs destroys a panel and builds the\n * next one), and a router strip renders no panel at all.\n */\n async getPanelText(): Promise<string> {\n return (await this.panelOrThrow('getPanelText')).text();\n }\n\n /**\n * Activate this tab the way a pointer does.\n *\n * A disabled CONTENT tab is left alone: it is a real `<button disabled>`, which\n * fires no click at all. A disabled ROUTER tab is NOT — the anchor carries\n * `aria-disabled=\"true\"` and `tabindex=\"-1\"`, and nothing cancels its\n * `routerLink`, so a click on it still navigates. That is a gap in the component\n * rather than in this harness, and it is why a router strip's expectations belong\n * on the resolved route rather than on the click.\n */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Move keyboard focus onto this header. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Take focus off this header. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether this header holds keyboard focus — the roving cursor, not the selection. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** `getHarness(…)` searches this tab's PANEL, which is where its content is. */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n // Both checks, in this order, so the failure names the reason — no panel in this\n // mode, or a panel that is not the one showing — instead of the CDK's generic\n // \"no element matching selector\".\n const id = await this.panelIdOrThrow('getHarness');\n await this.panelOrThrow('getHarness');\n return this.documentRootLocatorFactory().harnessLoaderFor(WrTabHarness.byId(id));\n }\n\n /** The panel element, or `null` when this tab has none rendered. */\n private async panelOrNull(): Promise<TestElement | null> {\n const id = await this.getPanelId();\n if (id === null) return null;\n // From the document root: the panel is a sibling of the strip, not a descendant\n // of the header this harness is hosted on.\n return this.documentRootLocatorFactory().locatorForOptional(WrTabHarness.byId(id))();\n }\n\n /** The panel element, or a failure naming which of the two reasons there isn't one. */\n private async panelOrThrow(method: string): Promise<TestElement> {\n await this.panelIdOrThrow(method);\n const panel = await this.panelOrNull();\n if (!panel) {\n throw new Error(\n `WrTabHarness.${method}(): the panel for \"${await this.getLabel()}\" is not rendered. <wr-tabs> keeps ` +\n 'only the SELECTED panel in the DOM — the content of every other tab waits in an unrendered ' +\n '<ng-template> — so select the tab first.'\n );\n }\n return panel;\n }\n\n /** This tab's `aria-controls`, or a failure saying a router strip has no panels. */\n private async panelIdOrThrow(method: string): Promise<string> {\n const id = await this.getPanelId();\n if (id === null) {\n throw new Error(\n `WrTabHarness.${method}(): \"${await this.getLabel()}\" controls no panel. A router strip renders none ` +\n '— its tabs navigate and the consumer drops a <router-outlet> after the strip — so assert the ' +\n 'routed content instead.'\n );\n }\n return id;\n }\n\n /**\n * An id selector that survives the id it is given.\n *\n * `[id=\"…\"]` rather than `#…`: the ids here are built from the consumer's `key`,\n * and a key holding a dot, a colon or a leading digit turns `#id` into a selector\n * that either throws or matches something else entirely.\n */\n private static byId(id: string): string {\n return `[id=\"${id}\"]`;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters, WrTabsHarnessFilters, WrTabsHarnessSize } from './interfaces';\nimport { WrTabHarness } from './wr-tab-harness';\n\n/**\n * Test harness for `<wr-tabs>`, with {@link WrTabHarness} for one tab and the panel\n * it controls.\n *\n * The component has two modes and they answer \"which tab is active\" differently,\n * which is most of what this harness exists to keep straight:\n *\n * - **Content** — the tabs are `<button role=\"tab\">`s, the strip is ONE tab stop\n * (the roving `tabindex` sits on the selected tab), and the arrow keys ACTIVATE\n * the tab they move to, the APG's automatic-activation pattern. `<wr-tabs>`\n * renders exactly one panel: the selected tab's.\n * - **Router** — one `routerLink` on any child switches the whole strip over. The\n * tabs become `<a role=\"tab\">`s, they announce no `aria-selected` at all (the\n * router paints `--active` and nothing else), the strip renders NO panel, and it\n * stops being one tab stop — every enabled tab is a Tab stop of its own. The\n * arrow keys still move focus, but they select nothing: the route does that.\n *\n * So {@link getSelectedLabel} and {@link getFocusedLabel} are two different\n * questions, and {@link getTabStopLabels} is a third. They coincide in content mode\n * and come apart in router mode; a spec that asserts one and means another passes\n * through the bug.\n *\n * Everything here is driven from the KEYBOARD rather than by clicking a coordinate:\n * a unit test has no layout, so a hit test would answer with nothing, and the\n * keyboard is the accessible path anyway. {@link select} is the exception — a\n * no-arg click needs no coordinate.\n *\n * @example\n * ```ts\n * const tabs = await loader.getHarness(WrTabsHarness);\n *\n * expect(await tabs.getTabLabels()).toEqual(['One', 'Two', 'Three']);\n * await tabs.select({ label: 'Two' });\n * expect(await tabs.getPanelText()).toContain('Second panel');\n * ```\n *\n * @see https://ngwr.dev/reference/components/tabs\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTabsHarness extends ComponentHarness {\n static hostSelector = 'wr-tabs';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTabsHarnessFilters = {}): HarnessPredicate<WrTabsHarness> {\n return new HarnessPredicate(WrTabsHarness, options)\n .addOption('tabLabel', options.tabLabel, async (harness, label) => {\n for (const tab of await harness.getTabLabels()) {\n if (await HarnessPredicate.stringMatches(tab, label)) return true;\n }\n return false;\n })\n .addOption('selectedLabel', options.selectedLabel, async (harness, label) => {\n const selected = await harness.getSelectedLabel();\n return selected === null ? false : HarnessPredicate.stringMatches(selected, label);\n })\n .addOption('size', options.size, async (harness, size) => (await harness.getSize()) === size)\n .addOption('router', options.router, async (harness, router) => (await harness.isRouterMode()) === router);\n }\n\n /**\n * The role the strip announces — `tablist`.\n *\n * Read off the strip, not the host: `<wr-tabs>` carries the `wr-tabs` class and no\n * role of its own, and the `tablist` is the scrolling `.wr-tabs__strip` inside it.\n * Without that role the headers are a row of buttons: nothing tells a screen\n * reader how many tabs there are or which one of them is showing.\n */\n async getRole(): Promise<string | null> {\n return (await this.strip()).getAttribute('role');\n }\n\n /**\n * The axis the strip announces, which decides which arrow keys a screen-reader\n * user is told to press.\n *\n * `<wr-tabs>` ships one orientation — the strip is a horizontal scroller and hard\n * codes `aria-orientation=\"horizontal\"` — so today this always answers\n * `'horizontal'`. It is read from the DOM and normalized the way ARIA reads it:\n * anything that is not `vertical`, a missing attribute included, is `'horizontal'`,\n * the default for a `tablist`.\n *\n * Which means an assertion here catches a strip that starts ANNOUNCING `vertical`\n * while its arrow keys still walk the horizontal axis — and cannot catch the\n * mirror image, a vertical mode that forgets to update the attribute: that one\n * answers `'horizontal'` and looks unchanged. One attribute is all this reads.\n */\n async getOrientation(): Promise<'horizontal' | 'vertical'> {\n return (await (await this.strip()).getAttribute('aria-orientation')) === 'vertical' ? 'vertical' : 'horizontal';\n }\n\n /**\n * The size the strip renders at, from the host modifier.\n *\n * `md` is the default and paints no modifier of its own, so its absence is the\n * answer rather than a missing one.\n */\n async getSize(): Promise<WrTabsHarnessSize> {\n const host = await this.host();\n if (await host.hasClass('wr-tabs--sm')) return 'sm';\n if (await host.hasClass('wr-tabs--lg')) return 'lg';\n return 'md';\n }\n\n /**\n * Whether this strip navigates instead of swapping panels.\n *\n * Derived from what got RENDERED — a router tab is an `<a>` — rather than from the\n * `routerLink` inputs, because the switch is all-or-nothing: one `routerLink`\n * anywhere in the strip turns every tab into a link and drops the panel. A strip\n * with no tabs at all is content mode, which is what the component does with it.\n */\n async isRouterMode(): Promise<boolean> {\n const tabs = await this.getTabs();\n for (const tab of tabs) {\n if (await tab.isLink()) return true;\n }\n return false;\n }\n\n /**\n * This strip's tabs, in render order.\n *\n * Scoped to this strip rather than to the host, which is what keeps a `<wr-tabs>`\n * NESTED in a panel from answering for its parent: the inner strip is a descendant\n * of the outer host, so a host-wide query would hand back both sets of tabs as one\n * flat list.\n */\n async getTabs(filters: WrTabHarnessFilters = {}): Promise<WrTabHarness[]> {\n return (await this.stripLoader()).getAllHarnesses(WrTabHarness.with(filters));\n }\n\n /** The label of every tab, in render order. */\n async getTabLabels(): Promise<string[]> {\n const tabs = await this.getTabs();\n return Promise.all(tabs.map(tab => tab.getLabel()));\n }\n\n /**\n * The selected tab, or `null` when none is.\n *\n * A content strip always has one — it falls back to the first tab when `active`\n * matches nothing — so `null` means a router strip whose current route matches no\n * tab, or a strip with no tabs.\n */\n async getSelectedTab(): Promise<WrTabHarness | null> {\n const [selected] = await this.getTabs({ selected: true });\n return selected ?? null;\n }\n\n /** The label of the selected tab, or `null` when none is selected. */\n async getSelectedLabel(): Promise<string | null> {\n const selected = await this.getSelectedTab();\n return selected ? selected.getLabel() : null;\n }\n\n /**\n * Select the first tab matching the filters, the way a pointer does.\n *\n * Throws when nothing matches, naming the tabs that do exist, and throws again\n * when the tab is still unselected afterwards — with both causes named, because a\n * click that quietly did nothing surfaces as an unrelated assertion three lines\n * later. Those causes are a disabled CONTENT tab (a `<button disabled>` never sees\n * the click at all) and a router strip whose navigation did not land on this tab.\n *\n * A router strip is otherwise fine here: the click starts a route change, the\n * harness stabilizes the pending navigation before it re-reads the strip, and\n * `routerLinkActive` has painted the selection by then — so this resolves. It is a\n * guard, a redirect or an unmatched path that leaves the tab unselected. Note that\n * `disabled` does not stop a router tab at all; see {@link WrTabHarness.click}.\n */\n async select(filters: WrTabHarnessFilters): Promise<void> {\n const [tab] = await this.getTabs(filters);\n if (!tab) {\n const labels = await this.getTabLabels();\n const offered =\n labels.length > 0 ? `This strip offers: ${labels.join(', ')}.` : 'This strip renders no tabs at all.';\n throw new Error(`WrTabsHarness.select(): no tab matched ${JSON.stringify(filters)}. ${offered}`);\n }\n await this.activate(tab, 'select');\n }\n\n /**\n * Select the tab at this position in render order, counting from 0.\n *\n * Throws on an index the strip does not have, naming its length: a silent no-op\n * there reads as \"the tab did not react\" when the tab was never addressed.\n */\n async selectByIndex(index: number): Promise<void> {\n const tabs = await this.getTabs();\n const tab = tabs[index];\n if (!tab) {\n throw new Error(\n `WrTabsHarness.selectByIndex(): this strip has ${tabs.length} tab(s), so index ${index} is out of ` +\n 'range — they are numbered from 0 in render order.'\n );\n }\n await this.activate(tab, 'selectByIndex');\n }\n\n /**\n * The labels of every tab a Tab press can land on, in render order.\n *\n * A LIST rather than one label, because the count is the mode: a content strip\n * roves a single `tabindex=\"0\"` and answers with exactly one label — the selected\n * tab — while a router strip makes every enabled tab its own stop and answers with\n * all of them. Either way a disabled tab is never in here.\n */\n async getTabStopLabels(): Promise<string[]> {\n const labels: string[] = [];\n for (const tab of await this.getTabs()) {\n if (await tab.isTabStop()) labels.push(await tab.getLabel());\n }\n return labels;\n }\n\n /**\n * Whether the strip is a single tab stop — the roving-`tabindex` pattern the APG\n * asks a `tablist` for.\n *\n * True for a content strip, false for a router one, which puts every enabled tab\n * in the page tab order. A strip whose every tab is disabled has no stop at all\n * and answers `true`: nothing to rove, and Tab skips it.\n */\n async isRoving(): Promise<boolean> {\n return (await this.getTabStopLabels()).length <= 1;\n }\n\n /**\n * The label of the tab holding keyboard focus, or `null` when focus is elsewhere.\n *\n * The other answer to \"which tab is active\", and not the same as\n * {@link getSelectedLabel}: the arrow keys move this. In content mode they also\n * select what they land on, so the two stay together; in router mode focus walks\n * the strip while the selection stays on whatever the route resolved to.\n */\n async getFocusedLabel(): Promise<string | null> {\n for (const tab of await this.getTabs()) {\n if (await tab.isFocused()) return tab.getLabel();\n }\n return null;\n }\n\n /**\n * Put focus where a Tab press would put it — the first tab stop in render order.\n *\n * That is the selected tab in content mode, and the first enabled tab in a router\n * strip. Throws when the strip has no stop at all, because Tab then skips past it\n * rather than entering it — a content strip whose selected tab is disabled has\n * none, and neither has one whose every tab is disabled, or one with no tabs.\n */\n async focusTabStop(): Promise<void> {\n for (const tab of await this.getTabs()) {\n if (await tab.isTabStop()) {\n await tab.focus();\n return;\n }\n }\n\n throw new Error(\n 'WrTabsHarness.focusTabStop(): this strip has no tab stop — its selected tab is disabled, every tab ' +\n 'is disabled, or it renders no tabs — so Tab skips it rather than entering it.'\n );\n }\n\n /**\n * ArrowRight on the strip — one tab toward the visual RIGHT, wrapping at the end\n * and skipping disabled tabs.\n *\n * The physical key, because that is what a keyboard has. The component follows\n * visual order per the APG, so under `dir=\"rtl\"` this moves to the PREVIOUS tab —\n * a spec exercising a mirrored strip swaps this and {@link pressArrowLeft}.\n *\n * In content mode the tab it lands on is also SELECTED (automatic activation); in\n * router mode only focus moves.\n */\n async pressArrowRight(): Promise<void> {\n await this.press(TestKey.RIGHT_ARROW);\n }\n\n /** ArrowLeft on the strip — one tab toward the visual LEFT, mirrored under `dir=\"rtl\"`. */\n async pressArrowLeft(): Promise<void> {\n await this.press(TestKey.LEFT_ARROW);\n }\n\n /**\n * Home on the strip — the FIRST enabled tab.\n *\n * Home and End name a position in the tab list rather than an edge of the strip,\n * so unlike the arrows they read the same in both reading directions.\n */\n async pressHome(): Promise<void> {\n await this.press(TestKey.HOME);\n }\n\n /** End on the strip — the LAST enabled tab, in both reading directions. */\n async pressEnd(): Promise<void> {\n await this.press(TestKey.END);\n }\n\n /** Whether this strip is showing a panel at all — false for a router strip. */\n async hasPanel(): Promise<boolean> {\n const selected = await this.getSelectedTab();\n return selected === null ? false : selected.hasPanel();\n }\n\n /**\n * The text of the panel that is showing, trimmed — the selected tab's content, and\n * the only tab content in the DOM.\n *\n * Throws when nothing is selected. Delegates to the selected tab, so the panel it\n * reads is the one that tab's `aria-controls` points at rather than \"the first\n * `.wr-tabs__panel` around\" — the two are only the same page when the wiring is\n * right, and {@link WrTabHarness.isPanelBound} is what says whether it is.\n */\n async getPanelText(): Promise<string> {\n const selected = await this.getSelectedTab();\n if (!selected) {\n throw new Error(\n 'WrTabsHarness.getPanelText(): no tab is selected, so no panel is rendered. A router strip whose ' +\n 'route matches none of its tabs looks like this, as does a strip with no tabs.'\n );\n }\n return selected.getPanelText();\n }\n\n /**\n * Which edges of the strip are faded out, from the public `--fade-start` /\n * `--fade-end` host modifiers — the cue that there are more tabs than fit, on the\n * side they are on.\n *\n * The component computes these from the strip's scroll metrics, so in a unit test\n * both are always `false`: jsdom lays nothing out, every element measures 0x0, and\n * a strip that never overflows never fades. Assert this in a real browser, or\n * declare the metrics and dispatch a `scroll` the way the component's own spec\n * does.\n */\n async getFades(): Promise<{ start: boolean; end: boolean }> {\n const host = await this.host();\n return {\n start: await host.hasClass('wr-tabs--fade-start'),\n end: await host.hasClass('wr-tabs--fade-end'),\n };\n }\n\n /** Click a tab and check it took, or say which of the two reasons it did not. */\n private async activate(tab: WrTabHarness, method: string): Promise<void> {\n await tab.click();\n if (await tab.isSelected()) return;\n\n throw new Error(\n `WrTabsHarness.${method}(): \"${await tab.getLabel()}\" is still unselected after being clicked — ` +\n 'either it is a content tab carrying `disabled`, which fires no click at all, or this is a router ' +\n 'strip whose navigation did not land on this tab: a guard, a redirect or an unmatched path leaves ' +\n '`routerLinkActive` painting some other one.'\n );\n }\n\n /**\n * Send a key to the `role=\"tablist\"` strip.\n *\n * The strip owns the keydown handler, and a real user's keypress on the focused\n * header bubbles to exactly here — so this is the honest target, and the one that\n * still works when jsdom has left real focus on `<body>`. It is also the target\n * that leaves the headers alone: the CDK types into whatever element it is handed,\n * which on a `<button>` means writing a `value` attribute onto a tab.\n */\n private async press(key: TestKey): Promise<void> {\n await (await this.strip()).sendKeys(key);\n }\n\n /** This strip's own `role=\"tablist\"` element — the first one under the host. */\n private async strip(): Promise<TestElement> {\n return this.locatorFor('.wr-tabs__strip')();\n }\n\n /**\n * A loader rooted at this strip, so tab queries cannot reach a nested strip's tabs:\n * a nested `<wr-tabs>` lives in the PANEL, which is outside this element.\n */\n private async stripLoader(): Promise<HarnessLoader> {\n return this.locatorFactory.harnessLoaderFor('.wr-tabs__strip');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;AAKG;AAWH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AACG,MAAO,YAAa,SAAQ,gCAAgC,CAAA;;AAEhE,IAAA,OAAO,YAAY,GAAG,eAAe;;AAGrC,IAAA,OAAO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E;;;AC/YF;;AAEG;;;;"}
1
+ {"version":3,"file":"ngwr-tabs-testing.mjs","sources":["../../../projects/lib/tabs/testing/wr-tab-harness.ts","../../../projects/lib/tabs/testing/wr-tabs-harness.ts","../../../projects/lib/tabs/testing/ngwr-tabs-testing.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters } from './interfaces';\n\n/**\n * Test harness for one tab of a `<wr-tabs>` strip — the header, and the panel it\n * controls.\n *\n * Its host is the RENDERED HEADER, not the `<wr-tab>` element. A `<wr-tab>` is\n * `display:none` and holds nothing but a `<ng-template>`: the label, the selection\n * state, the tab stop and the click target all live on the element the parent\n * renders for it, which is a `<button role=\"tab\">` in content mode and an\n * `<a role=\"tab\">` in router mode. A harness hosted on `wr-tab` would answer every\n * question with nothing.\n *\n * Also a CONTENT CONTAINER, scoped to the panel this tab controls, so\n * `tab.getHarness(WrButtonHarness…)` reaches the consumer's own components inside\n * the tab's content. The panel is not a descendant of the header — it is a sibling\n * of the whole strip — so it is resolved through the `aria-controls` id, which is\n * also the pairing {@link isPanelBound} checks. Only the SELECTED tab has a panel\n * to reach: `<wr-tabs>` renders one panel and destroys it on every switch.\n *\n * @example\n * ```ts\n * const tabs = await loader.getHarness(WrTabsHarness);\n * const [first] = await tabs.getTabs();\n *\n * expect(await first.isSelected()).toBe(true);\n * expect(await first.isPanelBound()).toBe(true);\n * await (await first.getHarness(WrButtonHarness.with({ text: 'Save' }))).click();\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTabHarness extends ContentContainerComponentHarness {\n /** The header the strip renders for a `<wr-tab>` — a `<button>`, or an `<a>` in router mode. */\n static hostSelector = '.wr-tabs__tab';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTabHarnessFilters = {}): HarnessPredicate<WrTabHarness> {\n return new HarnessPredicate(WrTabHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('selected', options.selected, async (harness, selected) => (await harness.isSelected()) === selected)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n /** The tab's visible label, trimmed — the `<wr-tab>`'s `title`. */\n async getLabel(): Promise<string> {\n return (await this.host()).text();\n }\n\n /**\n * The header's own id, which is what the panel points back at with\n * `aria-labelledby` — the tab is the panel's accessible name.\n *\n * Generated from the tab's `key`, so two strips on one page whose tabs share keys\n * publish the same ids and each panel then names whichever header came first.\n */\n async getId(): Promise<string | null> {\n return (await this.host()).getAttribute('id');\n }\n\n /**\n * Whether this is the strip's selected tab.\n *\n * `aria-selected` first, because that is the state a screen reader acts on and\n * the `--active` class is only what it looks like. Both shapes carry it now — a\n * router tab publishes it off the same `routerLinkActive` that paints the class —\n * so the class is a fallback for a tab that has neither yet, not a second reading\n * of the same thing. The order is not interchangeable: reading the class first\n * would report a tab as selected while `aria-selected=\"false\"` told assistive tech\n * otherwise.\n */\n async isSelected(): Promise<boolean> {\n const host = await this.host();\n const selected = await host.getAttribute('aria-selected');\n if (selected !== null) return selected === 'true';\n return host.hasClass('wr-tabs__tab--active');\n }\n\n /**\n * Whether the tab refuses activation.\n *\n * The two shapes say it differently and both are read: a content tab is a real\n * `<button>` and carries the native `disabled`, a router tab is an `<a>` — which\n * cannot be disabled natively — and carries `aria-disabled` with `tabindex=\"-1\"`.\n * The `--disabled` class is on both and is deliberately not the source: a class\n * says how the tab looks, these two say what it refuses.\n */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n if ((await host.getAttribute('aria-disabled')) === 'true') return true;\n return (await host.getProperty<boolean | undefined>('disabled')) === true;\n }\n\n /** Whether this tab is a link — the router shape, where selection follows the route. */\n async isLink(): Promise<boolean> {\n return (await this.host()).matchesSelector('a');\n }\n\n /**\n * The resolved href of a router tab, or `null` for a content tab.\n *\n * `null` is the answer for a `<button>` rather than a gap — a content tab\n * navigates nowhere, it swaps a panel.\n */\n async getHref(): Promise<string | null> {\n return (await this.host()).getAttribute('href');\n }\n\n /**\n * Whether a Tab press can land on this header.\n *\n * A content strip is ONE tab stop and hands it to the selected tab; a router\n * strip makes every enabled tab a stop of its own. See\n * `WrTabsHarness.getTabStopLabels()` — the difference is a mode difference, not\n * a rounding error.\n *\n * A non-negative `tabindex` is not enough on its own, which is why `disabled` is\n * read too: `<wr-tabs>` gives the roving `tabindex=\"0\"` to whatever `active`\n * names without checking whether that tab is disabled, so a host binding `active`\n * to a disabled tab's key renders a `<button disabled tabindex=\"0\">` — which no\n * Tab press reaches. jsdom will focus such a button anyway, so this is the only\n * place a unit test can tell the difference.\n */\n async isTabStop(): Promise<boolean> {\n if (await this.isDisabled()) return false;\n const tabIndex = await (await this.host()).getAttribute('tabindex');\n return Number.parseInt(tabIndex ?? '-1', 10) >= 0;\n }\n\n /**\n * The id of the panel this tab controls, or `null` when it controls none.\n *\n * `null` for a router tab — the strip renders no panel in that mode, the consumer\n * drops a `<router-outlet>` after it — and that missing `aria-controls` is the\n * honest report: there is nothing for the header to point at.\n */\n async getPanelId(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-controls');\n }\n\n /** Whether this tab's panel is in the DOM right now — true only for the selected tab. */\n async hasPanel(): Promise<boolean> {\n return (await this.panelOrNull()) !== null;\n }\n\n /**\n * Whether the panel and this header really name each other.\n *\n * Both halves, because each covers a different failure: the header's\n * `aria-controls` has to reach the panel that is showing, and the panel's\n * `aria-labelledby` has to come back to THIS header. A panel wired to the wrong\n * tab looks perfect on screen — the right content is under the right header — and\n * announces the wrong name, which is the whole of a tabbed interface for anyone\n * not looking at it. It also has to be a `tabpanel`: the reference resolving to\n * some other element is a broken pairing, not a styling detail.\n *\n * Throws when there is no panel at all, which is a different fact from a broken\n * pairing — see {@link getPanelText}.\n */\n async isPanelBound(): Promise<boolean> {\n const panel = await this.panelOrThrow('isPanelBound');\n if ((await panel.getAttribute('role')) !== 'tabpanel') return false;\n return (await panel.getAttribute('aria-labelledby')) === (await this.getId());\n }\n\n /**\n * The text of this tab's panel, trimmed.\n *\n * Throws rather than answering `''` for a tab whose panel is not rendered, and\n * the message says which of the two reasons it is: `<wr-tabs>` keeps only the\n * selected tab's panel in the DOM (the content of every other tab sits in an\n * unrendered `<ng-template>`, so switching tabs destroys a panel and builds the\n * next one), and a router strip renders no panel at all.\n */\n async getPanelText(): Promise<string> {\n return (await this.panelOrThrow('getPanelText')).text();\n }\n\n /**\n * Activate this tab the way a pointer does.\n *\n * A disabled CONTENT tab is left alone: it is a real `<button disabled>`, which\n * fires no click at all. A disabled ROUTER tab is NOT — the anchor carries\n * `aria-disabled=\"true\"` and `tabindex=\"-1\"`, and nothing cancels its\n * `routerLink`, so a click on it still navigates. That is a gap in the component\n * rather than in this harness, and it is why a router strip's expectations belong\n * on the resolved route rather than on the click.\n */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /** Move keyboard focus onto this header. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Take focus off this header. */\n async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /** Whether this header holds keyboard focus — the roving cursor, not the selection. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /** `getHarness(…)` searches this tab's PANEL, which is where its content is. */\n protected override async getRootHarnessLoader(): Promise<HarnessLoader> {\n // Both checks, in this order, so the failure names the reason — no panel in this\n // mode, or a panel that is not the one showing — instead of the CDK's generic\n // \"no element matching selector\".\n const id = await this.panelIdOrThrow('getHarness');\n await this.panelOrThrow('getHarness');\n return this.documentRootLocatorFactory().harnessLoaderFor(WrTabHarness.byId(id));\n }\n\n /** The panel element, or `null` when this tab has none rendered. */\n private async panelOrNull(): Promise<TestElement | null> {\n const id = await this.getPanelId();\n if (id === null) return null;\n // From the document root: the panel is a sibling of the strip, not a descendant\n // of the header this harness is hosted on.\n return this.documentRootLocatorFactory().locatorForOptional(WrTabHarness.byId(id))();\n }\n\n /** The panel element, or a failure naming which of the two reasons there isn't one. */\n private async panelOrThrow(method: string): Promise<TestElement> {\n await this.panelIdOrThrow(method);\n const panel = await this.panelOrNull();\n if (!panel) {\n throw new Error(\n `WrTabHarness.${method}(): the panel for \"${await this.getLabel()}\" is not rendered. <wr-tabs> keeps ` +\n 'only the SELECTED panel in the DOM — the content of every other tab waits in an unrendered ' +\n '<ng-template> — so select the tab first.'\n );\n }\n return panel;\n }\n\n /** This tab's `aria-controls`, or a failure saying a router strip has no panels. */\n private async panelIdOrThrow(method: string): Promise<string> {\n const id = await this.getPanelId();\n if (id === null) {\n throw new Error(\n `WrTabHarness.${method}(): \"${await this.getLabel()}\" controls no panel. A router strip renders none ` +\n '— its tabs navigate and the consumer drops a <router-outlet> after the strip — so assert the ' +\n 'routed content instead.'\n );\n }\n return id;\n }\n\n /**\n * An id selector that survives the id it is given.\n *\n * `[id=\"…\"]` rather than `#…`: the ids here are built from the consumer's `key`,\n * and a key holding a dot, a colon or a leading digit turns `#id` into a selector\n * that either throws or matches something else entirely.\n */\n private static byId(id: string): string {\n return `[id=\"${id}\"]`;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n TestKey,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters, WrTabsHarnessFilters, WrTabsHarnessSize } from './interfaces';\nimport { WrTabHarness } from './wr-tab-harness';\n\n/**\n * Test harness for `<wr-tabs>`, with {@link WrTabHarness} for one tab and the panel\n * it controls.\n *\n * The component has two modes and they answer \"which tab is active\" differently,\n * which is most of what this harness exists to keep straight:\n *\n * - **Content** — the tabs are `<button role=\"tab\">`s, the strip is ONE tab stop\n * (the roving `tabindex` sits on the selected tab), and the arrow keys ACTIVATE\n * the tab they move to, the APG's automatic-activation pattern. `<wr-tabs>`\n * renders exactly one panel: the selected tab's.\n * - **Router** — one `routerLink` on any child switches the whole strip over. The\n * tabs become `<a role=\"tab\">`s whose `aria-selected` follows the resolved route\n * (the same `routerLinkActive` that paints `--active`), the strip renders NO\n * panel, and it stops being one tab stop — every enabled tab is a Tab stop of its\n * own. The arrow keys still move focus, but they select nothing: the route does\n * that.\n *\n * So {@link getSelectedLabel} and {@link getFocusedLabel} are two different\n * questions, and {@link getTabStopLabels} is a third. They coincide in content mode\n * and come apart in router mode; a spec that asserts one and means another passes\n * through the bug.\n *\n * Everything here is driven from the KEYBOARD rather than by clicking a coordinate:\n * a unit test has no layout, so a hit test would answer with nothing, and the\n * keyboard is the accessible path anyway. {@link select} is the exception — a\n * no-arg click needs no coordinate.\n *\n * @example\n * ```ts\n * const tabs = await loader.getHarness(WrTabsHarness);\n *\n * expect(await tabs.getTabLabels()).toEqual(['One', 'Two', 'Three']);\n * await tabs.select({ label: 'Two' });\n * expect(await tabs.getPanelText()).toContain('Second panel');\n * ```\n *\n * @see https://ngwr.dev/reference/components/tabs\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTabsHarness extends ComponentHarness {\n static hostSelector = 'wr-tabs';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTabsHarnessFilters = {}): HarnessPredicate<WrTabsHarness> {\n return new HarnessPredicate(WrTabsHarness, options)\n .addOption('tabLabel', options.tabLabel, async (harness, label) => {\n for (const tab of await harness.getTabLabels()) {\n if (await HarnessPredicate.stringMatches(tab, label)) return true;\n }\n return false;\n })\n .addOption('selectedLabel', options.selectedLabel, async (harness, label) => {\n const selected = await harness.getSelectedLabel();\n return selected === null ? false : HarnessPredicate.stringMatches(selected, label);\n })\n .addOption('size', options.size, async (harness, size) => (await harness.getSize()) === size)\n .addOption('router', options.router, async (harness, router) => (await harness.isRouterMode()) === router);\n }\n\n /**\n * The role the strip announces — `tablist`.\n *\n * Read off the strip, not the host: `<wr-tabs>` carries the `wr-tabs` class and no\n * role of its own, and the `tablist` is the scrolling `.wr-tabs__strip` inside it.\n * Without that role the headers are a row of buttons: nothing tells a screen\n * reader how many tabs there are or which one of them is showing.\n */\n async getRole(): Promise<string | null> {\n return (await this.strip()).getAttribute('role');\n }\n\n /**\n * The axis the strip announces, which decides which arrow keys a screen-reader\n * user is told to press.\n *\n * `<wr-tabs>` ships one orientation — the strip is a horizontal scroller and hard\n * codes `aria-orientation=\"horizontal\"` — so today this always answers\n * `'horizontal'`. It is read from the DOM and normalized the way ARIA reads it:\n * anything that is not `vertical`, a missing attribute included, is `'horizontal'`,\n * the default for a `tablist`.\n *\n * Which means an assertion here catches a strip that starts ANNOUNCING `vertical`\n * while its arrow keys still walk the horizontal axis — and cannot catch the\n * mirror image, a vertical mode that forgets to update the attribute: that one\n * answers `'horizontal'` and looks unchanged. One attribute is all this reads.\n */\n async getOrientation(): Promise<'horizontal' | 'vertical'> {\n return (await (await this.strip()).getAttribute('aria-orientation')) === 'vertical' ? 'vertical' : 'horizontal';\n }\n\n /**\n * The size the strip renders at, from the host modifier.\n *\n * `md` is the default and paints no modifier of its own, so its absence is the\n * answer rather than a missing one.\n */\n async getSize(): Promise<WrTabsHarnessSize> {\n const host = await this.host();\n if (await host.hasClass('wr-tabs--sm')) return 'sm';\n if (await host.hasClass('wr-tabs--lg')) return 'lg';\n return 'md';\n }\n\n /**\n * Whether this strip navigates instead of swapping panels.\n *\n * Derived from what got RENDERED — a router tab is an `<a>` — rather than from the\n * `routerLink` inputs, because the switch is all-or-nothing: one `routerLink`\n * anywhere in the strip turns every tab into a link and drops the panel. A strip\n * with no tabs at all is content mode, which is what the component does with it.\n */\n async isRouterMode(): Promise<boolean> {\n const tabs = await this.getTabs();\n for (const tab of tabs) {\n if (await tab.isLink()) return true;\n }\n return false;\n }\n\n /**\n * This strip's tabs, in render order.\n *\n * Scoped to this strip rather than to the host, which is what keeps a `<wr-tabs>`\n * NESTED in a panel from answering for its parent: the inner strip is a descendant\n * of the outer host, so a host-wide query would hand back both sets of tabs as one\n * flat list.\n */\n async getTabs(filters: WrTabHarnessFilters = {}): Promise<WrTabHarness[]> {\n return (await this.stripLoader()).getAllHarnesses(WrTabHarness.with(filters));\n }\n\n /** The label of every tab, in render order. */\n async getTabLabels(): Promise<string[]> {\n const tabs = await this.getTabs();\n return Promise.all(tabs.map(tab => tab.getLabel()));\n }\n\n /**\n * The selected tab, or `null` when none is.\n *\n * A content strip always has one — it falls back to the first tab when `active`\n * matches nothing — so `null` means a router strip whose current route matches no\n * tab, or a strip with no tabs.\n */\n async getSelectedTab(): Promise<WrTabHarness | null> {\n const [selected] = await this.getTabs({ selected: true });\n return selected ?? null;\n }\n\n /** The label of the selected tab, or `null` when none is selected. */\n async getSelectedLabel(): Promise<string | null> {\n const selected = await this.getSelectedTab();\n return selected ? selected.getLabel() : null;\n }\n\n /**\n * Select the first tab matching the filters, the way a pointer does.\n *\n * Throws when nothing matches, naming the tabs that do exist, and throws again\n * when the tab is still unselected afterwards — with both causes named, because a\n * click that quietly did nothing surfaces as an unrelated assertion three lines\n * later. Those causes are a disabled CONTENT tab (a `<button disabled>` never sees\n * the click at all) and a router strip whose navigation did not land on this tab.\n *\n * A router strip is otherwise fine here: the click starts a route change, the\n * harness stabilizes the pending navigation before it re-reads the strip, and\n * `routerLinkActive` has painted the selection by then — so this resolves. It is a\n * guard, a redirect or an unmatched path that leaves the tab unselected. Note that\n * `disabled` does not stop a router tab at all; see {@link WrTabHarness.click}.\n */\n async select(filters: WrTabHarnessFilters): Promise<void> {\n const [tab] = await this.getTabs(filters);\n if (!tab) {\n const labels = await this.getTabLabels();\n const offered =\n labels.length > 0 ? `This strip offers: ${labels.join(', ')}.` : 'This strip renders no tabs at all.';\n throw new Error(`WrTabsHarness.select(): no tab matched ${JSON.stringify(filters)}. ${offered}`);\n }\n await this.activate(tab, 'select');\n }\n\n /**\n * Select the tab at this position in render order, counting from 0.\n *\n * Throws on an index the strip does not have, naming its length: a silent no-op\n * there reads as \"the tab did not react\" when the tab was never addressed.\n */\n async selectByIndex(index: number): Promise<void> {\n const tabs = await this.getTabs();\n const tab = tabs[index];\n if (!tab) {\n throw new Error(\n `WrTabsHarness.selectByIndex(): this strip has ${tabs.length} tab(s), so index ${index} is out of ` +\n 'range — they are numbered from 0 in render order.'\n );\n }\n await this.activate(tab, 'selectByIndex');\n }\n\n /**\n * The labels of every tab a Tab press can land on, in render order.\n *\n * A LIST rather than one label, because the count is the mode: a content strip\n * roves a single `tabindex=\"0\"` and answers with exactly one label — the selected\n * tab — while a router strip makes every enabled tab its own stop and answers with\n * all of them. Either way a disabled tab is never in here.\n */\n async getTabStopLabels(): Promise<string[]> {\n const labels: string[] = [];\n for (const tab of await this.getTabs()) {\n if (await tab.isTabStop()) labels.push(await tab.getLabel());\n }\n return labels;\n }\n\n /**\n * Whether the strip is a single tab stop — the roving-`tabindex` pattern the APG\n * asks a `tablist` for.\n *\n * True for a content strip, false for a router one, which puts every enabled tab\n * in the page tab order. A strip whose every tab is disabled has no stop at all\n * and answers `true`: nothing to rove, and Tab skips it.\n */\n async isRoving(): Promise<boolean> {\n return (await this.getTabStopLabels()).length <= 1;\n }\n\n /**\n * The label of the tab holding keyboard focus, or `null` when focus is elsewhere.\n *\n * The other answer to \"which tab is active\", and not the same as\n * {@link getSelectedLabel}: the arrow keys move this. In content mode they also\n * select what they land on, so the two stay together; in router mode focus walks\n * the strip while the selection stays on whatever the route resolved to.\n */\n async getFocusedLabel(): Promise<string | null> {\n for (const tab of await this.getTabs()) {\n if (await tab.isFocused()) return tab.getLabel();\n }\n return null;\n }\n\n /**\n * Put focus where a Tab press would put it — the first tab stop in render order.\n *\n * That is the selected tab in content mode, and the first enabled tab in a router\n * strip. Throws when the strip has no stop at all, because Tab then skips past it\n * rather than entering it — a content strip whose selected tab is disabled has\n * none, and neither has one whose every tab is disabled, or one with no tabs.\n */\n async focusTabStop(): Promise<void> {\n for (const tab of await this.getTabs()) {\n if (await tab.isTabStop()) {\n await tab.focus();\n return;\n }\n }\n\n throw new Error(\n 'WrTabsHarness.focusTabStop(): this strip has no tab stop — its selected tab is disabled, every tab ' +\n 'is disabled, or it renders no tabs — so Tab skips it rather than entering it.'\n );\n }\n\n /**\n * ArrowRight on the strip — one tab toward the visual RIGHT, wrapping at the end\n * and skipping disabled tabs.\n *\n * The physical key, because that is what a keyboard has. The component follows\n * visual order per the APG, so under `dir=\"rtl\"` this moves to the PREVIOUS tab —\n * a spec exercising a mirrored strip swaps this and {@link pressArrowLeft}.\n *\n * In content mode the tab it lands on is also SELECTED (automatic activation); in\n * router mode only focus moves.\n */\n async pressArrowRight(): Promise<void> {\n await this.press(TestKey.RIGHT_ARROW);\n }\n\n /** ArrowLeft on the strip — one tab toward the visual LEFT, mirrored under `dir=\"rtl\"`. */\n async pressArrowLeft(): Promise<void> {\n await this.press(TestKey.LEFT_ARROW);\n }\n\n /**\n * Home on the strip — the FIRST enabled tab.\n *\n * Home and End name a position in the tab list rather than an edge of the strip,\n * so unlike the arrows they read the same in both reading directions.\n */\n async pressHome(): Promise<void> {\n await this.press(TestKey.HOME);\n }\n\n /** End on the strip — the LAST enabled tab, in both reading directions. */\n async pressEnd(): Promise<void> {\n await this.press(TestKey.END);\n }\n\n /** Whether this strip is showing a panel at all — false for a router strip. */\n async hasPanel(): Promise<boolean> {\n const selected = await this.getSelectedTab();\n return selected === null ? false : selected.hasPanel();\n }\n\n /**\n * The text of the panel that is showing, trimmed — the selected tab's content, and\n * the only tab content in the DOM.\n *\n * Throws when nothing is selected. Delegates to the selected tab, so the panel it\n * reads is the one that tab's `aria-controls` points at rather than \"the first\n * `.wr-tabs__panel` around\" — the two are only the same page when the wiring is\n * right, and {@link WrTabHarness.isPanelBound} is what says whether it is.\n */\n async getPanelText(): Promise<string> {\n const selected = await this.getSelectedTab();\n if (!selected) {\n throw new Error(\n 'WrTabsHarness.getPanelText(): no tab is selected, so no panel is rendered. A router strip whose ' +\n 'route matches none of its tabs looks like this, as does a strip with no tabs.'\n );\n }\n return selected.getPanelText();\n }\n\n /**\n * Which edges of the strip are faded out, from the public `--fade-start` /\n * `--fade-end` host modifiers — the cue that there are more tabs than fit, on the\n * side they are on.\n *\n * The component computes these from the strip's scroll metrics, so in a unit test\n * both are always `false`: jsdom lays nothing out, every element measures 0x0, and\n * a strip that never overflows never fades. Assert this in a real browser, or\n * declare the metrics and dispatch a `scroll` the way the component's own spec\n * does.\n */\n async getFades(): Promise<{ start: boolean; end: boolean }> {\n const host = await this.host();\n return {\n start: await host.hasClass('wr-tabs--fade-start'),\n end: await host.hasClass('wr-tabs--fade-end'),\n };\n }\n\n /** Click a tab and check it took, or say which of the two reasons it did not. */\n private async activate(tab: WrTabHarness, method: string): Promise<void> {\n await tab.click();\n if (await tab.isSelected()) return;\n\n throw new Error(\n `WrTabsHarness.${method}(): \"${await tab.getLabel()}\" is still unselected after being clicked — ` +\n 'either it is a content tab carrying `disabled`, which fires no click at all, or this is a router ' +\n 'strip whose navigation did not land on this tab: a guard, a redirect or an unmatched path leaves ' +\n '`routerLinkActive` painting some other one.'\n );\n }\n\n /**\n * Send a key to the `role=\"tablist\"` strip.\n *\n * The strip owns the keydown handler, and a real user's keypress on the focused\n * header bubbles to exactly here — so this is the honest target, and the one that\n * still works when jsdom has left real focus on `<body>`. It is also the target\n * that leaves the headers alone: the CDK types into whatever element it is handed,\n * which on a `<button>` means writing a `value` attribute onto a tab.\n */\n private async press(key: TestKey): Promise<void> {\n await (await this.strip()).sendKeys(key);\n }\n\n /** This strip's own `role=\"tablist\"` element — the first one under the host. */\n private async strip(): Promise<TestElement> {\n return this.locatorFor('.wr-tabs__strip')();\n }\n\n /**\n * A loader rooted at this strip, so tab queries cannot reach a nested strip's tabs:\n * a nested `<wr-tabs>` lives in the PANEL, which is outside this element.\n */\n private async stripLoader(): Promise<HarnessLoader> {\n return this.locatorFactory.harnessLoaderFor('.wr-tab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CAAC,GAAG,CAAC;IAC1C;;AAGQ,IAAA,MAAM,KAAK,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;IAC7C;AAEA;;;AAGG;AACK,IAAA,MAAM,WAAW,GAAA;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;IAChE;;;AChZF;;AAEG;;;;"}
@@ -67,10 +67,10 @@ class WrTab {
67
67
  this.destroyRef.onDestroy(() => this.parent?.unregister(this.key()));
68
68
  }
69
69
  }
70
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
71
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.1", type: WrTab, isStandalone: true, selector: "wr-tab", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display:none" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: `<ng-template><ng-content /></ng-template>`, isInline: true, encapsulation: i0.ViewEncapsulation.None });
70
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrTab, deps: [], target: i0.ɵɵFactoryTarget.Component });
71
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.2", type: WrTab, isStandalone: true, selector: "wr-tab", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: true, transformFunction: null }, key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display:none" }, viewQueries: [{ propertyName: "contentTpl", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: `<ng-template><ng-content /></ng-template>`, isInline: true, encapsulation: i0.ViewEncapsulation.None });
72
72
  }
73
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrTab, decorators: [{
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrTab, decorators: [{
74
74
  type: Component,
75
75
  args: [{
76
76
  selector: 'wr-tab',
@@ -86,6 +86,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
86
86
  * Use of this source code is governed by an MIT-style license that can be
87
87
  * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
88
88
  */
89
+ /**
90
+ * Instance counter for the header / panel ids. Deterministic under prerender,
91
+ * unlike `randomId()` — the same reason `wr-sidebar` and `wr-mention` count.
92
+ *
93
+ * The ids used to be built from the tab key alone, so two `<wr-tabs>` on one
94
+ * page that both name a tab `key="overview"` emitted the same
95
+ * `wr-tab-overview-header` twice, and the second group's `aria-labelledby`
96
+ * resolved to the FIRST group's tab. A key is documented as parent-scoped, so
97
+ * it is the parent that has to make it unique document-wide.
98
+ */
99
+ let tabsUid = 0;
100
+ /**
101
+ * A tab key as an id fragment: anything outside `[A-Za-z0-9_-]` becomes `-`.
102
+ * These ids land in `aria-controls` / `aria-labelledby`, which are
103
+ * space-separated IDREF lists — `key="my tab"` emitted
104
+ * `aria-controls="wr-tab-my tab-panel"`, two tokens, neither of which resolves.
105
+ *
106
+ * Two keys differing only outside that set collapse to one fragment; the
107
+ * instance counter keeps that inside a single group, where the keys are the
108
+ * consumer's own to keep apart.
109
+ */
110
+ function idFragment(key) {
111
+ return key.replace(/[^A-Za-z0-9_-]/g, '-');
112
+ }
89
113
  /**
90
114
  * Tabbed container. Two modes depending on the child `<wr-tab>`
91
115
  * definitions:
@@ -218,21 +242,37 @@ class WrTabs {
218
242
  if (!this.isRouter())
219
243
  this.activate(tab.key());
220
244
  }
245
+ /** Per-instance prefix, so keys only have to be unique within one group. */
246
+ uid = ++tabsUid;
221
247
  /** Header id for `aria-labelledby` on the panel. @internal */
222
248
  headerId(key) {
223
- return `wr-tab-${key}-header`;
249
+ return `wr-tabs-${this.uid}-tab-${idFragment(key)}-header`;
224
250
  }
225
251
  /** Panel id for `aria-controls` on the tab header. @internal */
226
252
  panelId(key) {
227
- return `wr-tab-${key}-panel`;
253
+ return `wr-tabs-${this.uid}-tab-${idFragment(key)}-panel`;
228
254
  }
229
255
  /** ArrowLeft/Right/Home/End keyboard navigation on the tab strip. */
230
256
  onStripKeydown(event) {
231
257
  const tabs = this.tabs().filter(t => !t.disabled());
232
258
  if (tabs.length === 0)
233
259
  return;
260
+ // Step from where FOCUS is, not from what is active.
261
+ //
262
+ // In router mode nothing ever moves `active` — `onTabClick` and this
263
+ // handler both gate `activate()` on `!isRouter()`, because the route is
264
+ // what selects a tab there. Reading the neighbour off `activeTab()`
265
+ // therefore recomputed the same `idx` on every press, and ArrowRight
266
+ // walked from the first tab to the second and stayed there for the rest of
267
+ // the session. In manual mode focus and activation move together, so the
268
+ // two readings agree and nothing changes.
269
+ const strip = this.stripRef()?.nativeElement;
270
+ const focused = strip?.ownerDocument.activeElement;
271
+ const focusedIdx = focused instanceof HTMLElement && strip?.contains(focused)
272
+ ? tabs.findIndex(t => this.headerId(t.key()) === focused.id)
273
+ : -1;
234
274
  const active = this.activeTab();
235
- const idx = active ? tabs.indexOf(active) : -1;
275
+ const idx = focusedIdx >= 0 ? focusedIdx : active ? tabs.indexOf(active) : -1;
236
276
  // The two neighbours in DOM order, wrapping at the ends.
237
277
  const forward = idx < tabs.length - 1 ? idx + 1 : 0;
238
278
  const backward = idx > 0 ? idx - 1 : tabs.length - 1;
@@ -267,16 +307,16 @@ class WrTabs {
267
307
  const headerEl = this.stripRef()?.nativeElement.querySelector(`#${CSS.escape(this.headerId(next.key()))}`);
268
308
  headerEl?.focus();
269
309
  }
270
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrTabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
271
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrTabs, isStandalone: true, selector: "wr-tabs", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { active: "activeChange" }, host: { properties: { "class.wr-tabs--fade-start": "canScrollStart()", "class.wr-tabs--fade-end": "canScrollEnd()", "class.wr-tabs--sm": "size() === 'sm'", "class.wr-tabs--lg": "size() === 'lg'" }, classAttribute: "wr-tabs" }, providers: [
310
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrTabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
311
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: WrTabs, isStandalone: true, selector: "wr-tabs", inputs: { active: { classPropertyName: "active", publicName: "active", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { active: "activeChange" }, host: { properties: { "class.wr-tabs--fade-start": "canScrollStart()", "class.wr-tabs--fade-end": "canScrollEnd()", "class.wr-tabs--sm": "size() === 'sm'", "class.wr-tabs--lg": "size() === 'lg'" }, classAttribute: "wr-tabs" }, providers: [
272
312
  {
273
313
  provide: WR_TABS,
274
314
  // eslint-disable-next-line @angular-eslint/no-forward-ref
275
315
  useExisting: forwardRef(() => WrTabs),
276
316
  },
277
- ], queries: [{ propertyName: "tabs", predicate: WrTab, isSignal: true }], viewQueries: [{ propertyName: "stripRef", first: true, predicate: ["strip"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink(); as link) {\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n routerLinkActive=\"wr-tabs__tab--active\"\n [attr.id]=\"headerId(tab.key())\"\n [routerLink]=\"tab.disabled() ? null : link\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.tabindex]=\"tab.disabled() ? -1 : 0\"\n >\n {{ tab.title() }}\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === activeTab() && !tab.disabled() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n {{ tab.title() }}\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], encapsulation: i0.ViewEncapsulation.None });
317
+ ], queries: [{ propertyName: "tabs", predicate: WrTab, isSignal: true }], viewQueries: [{ propertyName: "stripRef", first: true, predicate: ["strip"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink(); as link) {\n <!--\n `aria-selected` comes off the SAME `routerLinkActive` that paints `--active`,\n exported as `rla`, so the announced state and the painted one can never\n disagree. Without it a `role=\"tablist\"` shipped with no tab selected in any of\n them: the route decides here, and the class it paints is invisible to\n assistive tech.\n -->\n <a\n #rla=\"routerLinkActive\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n routerLinkActive=\"wr-tabs__tab--active\"\n [attr.id]=\"headerId(tab.key())\"\n [routerLink]=\"tab.disabled() ? null : link\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"rla.isActive\"\n [attr.tabindex]=\"tab.disabled() ? -1 : 0\"\n >\n {{ tab.title() }}\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === activeTab() && !tab.disabled() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n {{ tab.title() }}\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], encapsulation: i0.ViewEncapsulation.None });
278
318
  }
279
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrTabs, decorators: [{
319
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrTabs, decorators: [{
280
320
  type: Component,
281
321
  args: [{ selector: 'wr-tabs', encapsulation: ViewEncapsulation.None, host: {
282
322
  class: 'wr-tabs',
@@ -290,7 +330,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
290
330
  // eslint-disable-next-line @angular-eslint/no-forward-ref
291
331
  useExisting: forwardRef(() => WrTabs),
292
332
  },
293
- ], template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink(); as link) {\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n routerLinkActive=\"wr-tabs__tab--active\"\n [attr.id]=\"headerId(tab.key())\"\n [routerLink]=\"tab.disabled() ? null : link\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.tabindex]=\"tab.disabled() ? -1 : 0\"\n >\n {{ tab.title() }}\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === activeTab() && !tab.disabled() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n {{ tab.title() }}\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n" }]
333
+ ], template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink(); as link) {\n <!--\n `aria-selected` comes off the SAME `routerLinkActive` that paints `--active`,\n exported as `rla`, so the announced state and the painted one can never\n disagree. Without it a `role=\"tablist\"` shipped with no tab selected in any of\n them: the route decides here, and the class it paints is invisible to\n assistive tech.\n -->\n <a\n #rla=\"routerLinkActive\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n routerLinkActive=\"wr-tabs__tab--active\"\n [attr.id]=\"headerId(tab.key())\"\n [routerLink]=\"tab.disabled() ? null : link\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"rla.isActive\"\n [attr.tabindex]=\"tab.disabled() ? -1 : 0\"\n >\n {{ tab.title() }}\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === activeTab() && !tab.disabled() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n {{ tab.title() }}\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n" }]
294
334
  }], ctorParameters: () => [], propDecorators: { active: [{ type: i0.Input, args: [{ isSignal: true, alias: "active", required: false }] }, { type: i0.Output, args: ["activeChange"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], tabs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WrTab), { isSignal: true }] }], stripRef: [{ type: i0.ViewChild, args: ['strip', { isSignal: true }] }] } });
295
335
 
296
336
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-tabs.mjs","sources":["../../../projects/lib/tabs/tokens/tabs.token.ts","../../../projects/lib/tabs/tab.ts","../../../projects/lib/tabs/tabs.ts","../../../projects/lib/tabs/tabs.html","../../../projects/lib/tabs/ngwr-tabs.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 { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Contract a `<wr-tab>` uses to talk to its parent `<wr-tabs>`.\n *\n * @internal\n */\nexport interface WrTabsContext {\n /** Currently active tab key (component-managed only). */\n readonly active: Signal<string | null>;\n /** Activate a tab by key (component-managed only). */\n activate(key: string): void;\n /** Register a child tab so the parent can pick a default. */\n register(tab: { key: string; routerLink: unknown }): void;\n /** Unregister on destroy. */\n unregister(key: string): void;\n}\n\n/**\n * Token a `<wr-tab>` injects to register itself with — and read the active\n * key from — its parent `<wr-tabs>` host.\n *\n * @internal\n */\nexport const WR_TABS = new InjectionToken<WrTabsContext>('WR_TABS');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n TemplateRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n viewChild,\n} from '@angular/core';\n\nimport { randomId } from 'ngwr/utils';\n\nimport { WR_TABS } from './tokens';\n\n/**\n * Single tab. Two modes, decided by inputs:\n *\n * - **Content tab** — projected children render in the parent's content\n * panel when this tab is active.\n * - **Router tab** — set `routerLink` and the tab becomes a link; the\n * parent skips its content panel and the consumer drops a\n * `<router-outlet>` below the tab strip.\n */\n@Component({\n selector: 'wr-tab',\n template: `<ng-template><ng-content /></ng-template>`,\n encapsulation: ViewEncapsulation.None,\n host: { style: 'display:none' },\n})\nexport class WrTab {\n /** Visible label on the tab strip. */\n readonly title = input.required<string>();\n\n /**\n * Stable identifier used by the parent to track the active tab.\n * Auto-generated if omitted.\n */\n readonly key = input<string>(randomId('wr-tab'));\n\n /** Router target — when set, the tab becomes a `[routerLink]` link. */\n readonly routerLink = input<string | readonly string[] | null>(null);\n\n /** Disable the tab. */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Tab content template; portaled into the parent's panel area. @internal */\n readonly contentTpl = viewChild.required(TemplateRef);\n\n private readonly parent = inject(WR_TABS, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n protected readonly isRouter = computed(() => this.routerLink() !== null);\n\n constructor() {\n if (this.parent) {\n // Both calls run with the input signals still on their defaults — a\n // constructor is too early for `key()` to be the consumer's value. The\n // parent tracks tabs through `contentChildren` and seeds `active` from\n // there; these stay as the declared lifecycle contract.\n this.parent.register({ key: this.key(), routerLink: this.routerLink() });\n this.destroyRef.onDestroy(() => this.parent?.unregister(this.key()));\n }\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n type ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\n\nimport { WrTab } from './tab';\nimport { WR_TABS, type WrTabsContext } from './tokens';\n\n/**\n * Tabbed container. Two modes depending on the child `<wr-tab>`\n * definitions:\n *\n * - **Content** — children project body content; the parent renders an\n * active-tab panel automatically.\n * - **Router** — any child with `routerLink` switches the whole strip\n * into router mode; the parent skips its panel so the consumer can\n * drop a `<router-outlet>` after it.\n *\n * @example\n * ```html\n * <!-- content tabs -->\n * <wr-tabs [(active)]=\"key\">\n * <wr-tab key=\"one\" title=\"One\">First panel</wr-tab>\n * <wr-tab key=\"two\" title=\"Two\">Second panel</wr-tab>\n * </wr-tabs>\n *\n * <!-- router tabs -->\n * <wr-tabs>\n * <wr-tab title=\"Overview\" routerLink=\"overview\" />\n * <wr-tab title=\"Details\" routerLink=\"details\" />\n * </wr-tabs>\n * <router-outlet />\n * ```\n *\n * @see https://ngwr.dev/reference/components/tabs\n */\n@Component({\n selector: 'wr-tabs',\n templateUrl: './tabs.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-tabs',\n '[class.wr-tabs--fade-start]': 'canScrollStart()',\n '[class.wr-tabs--fade-end]': 'canScrollEnd()',\n '[class.wr-tabs--sm]': \"size() === 'sm'\",\n '[class.wr-tabs--lg]': \"size() === 'lg'\",\n },\n imports: [NgTemplateOutlet, RouterLink, RouterLinkActive],\n providers: [\n {\n provide: WR_TABS,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrTabs),\n },\n ],\n})\nexport class WrTabs implements WrTabsContext {\n /** Two-way bindable active tab key (content mode). */\n readonly active = model<string | null>(null);\n\n /** Visual size variant. */\n readonly size = input<'sm' | 'md' | 'lg'>('md');\n\n protected readonly tabs = contentChildren(WrTab);\n\n private readonly dir = inject(Directionality, { optional: true });\n\n /**\n * Reading direction of the strip. `Directionality` is root-provided, so this\n * always resolves — `optional` only guards a consumer who has deliberately\n * torn the provider out. It reads the document once at construction; a\n * subtree that overrides the direction does it with the CDK's `Dir`\n * directive, which writes `valueSignal`, so the read stays reactive.\n */\n private readonly isRtl = computed(() => this.dir?.valueSignal() === 'rtl');\n\n /** When any child has a routerLink, the whole strip switches to router mode. */\n protected readonly isRouter = computed(() => this.tabs().some(t => t.routerLink() !== null));\n\n /** Content-mode: the tab whose key matches `active()` (or the first tab if none yet). */\n protected readonly activeTab = computed(() => {\n const key = this.active();\n const tabs = this.tabs();\n if (tabs.length === 0) return null;\n return tabs.find(t => t.key() === key) ?? tabs[0];\n });\n\n // WrTabsContext\n\n activate(key: string): void {\n this.active.set(key);\n }\n\n register(): void {\n // Deliberately a no-op. A `WrTab` calls this from its own constructor,\n // where its `key` signal input is not bound yet — so it would report the\n // generated default and this parent would write THAT into `active`. The\n // effect below seeds from `tabs()`, by which point the inputs are real.\n }\n\n unregister(): void {\n // No-op: contentChildren handles removal.\n }\n\n // Template handlers\n\n protected readonly stripRef = viewChild<ElementRef<HTMLElement>>('strip');\n\n /** Whether the strip is scrolled away from its start / end — drives the edge fades. */\n protected readonly canScrollStart = signal(false);\n protected readonly canScrollEnd = signal(false);\n\n constructor() {\n // Seed `active` with the first tab's key, once the content children exist\n // and their inputs are bound. Without this the model writes back a\n // generated id like `wr-tab-b1crta5aix0v`: the strip still highlighted the\n // right tab, because `activeTab()` falls back to `tabs[0]`, so the only\n // visible symptom was a two-way binding holding a key the consumer had\n // never heard of.\n effect(() => {\n const tabs = this.tabs();\n if (tabs.length > 0 && this.active() === null) this.active.set(tabs[0].key());\n });\n\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n this.updateFades();\n const el = this.stripRef()?.nativeElement;\n if (!el || typeof ResizeObserver === 'undefined') return;\n // Re-evaluate when the strip's width changes (e.g. the container narrows\n // and the tabs start overflowing).\n const ro = new ResizeObserver(() => this.updateFades());\n ro.observe(el);\n destroyRef.onDestroy(() => ro.disconnect());\n });\n }\n\n /** Recompute which edges can scroll, from the strip's scroll metrics. @internal */\n protected updateFades(): void {\n const el = this.stripRef()?.nativeElement;\n if (!el) return;\n const max = el.scrollWidth - el.clientWidth;\n // Distance from the INLINE start, which is what the two fades mean.\n // `scrollLeft` is 0 at the inline start in BOTH directions and counts away\n // from it — up in LTR, DOWN into negatives under `dir=\"rtl\"` (the CSSOM\n // model every engine Angular 22 supports now implements; the legacy\n // \"reversed\"/\"normal\" RTL conventions are gone). Read raw, the RTL value\n // said \"never scrolled from the start, always more to come\" at every\n // position: the end fade was pinned on and the start fade never appeared.\n //\n // Clamped rather than `Math.abs`, because an elastic overscroll reports a\n // value of the WRONG sign at the start edge — a rubber-band past the start\n // is still the start, and `abs` would light the start fade there in LTR too.\n const scrolled = this.isRtl() ? Math.max(-el.scrollLeft, 0) : Math.max(el.scrollLeft, 0);\n this.canScrollStart.set(scrolled > 1);\n this.canScrollEnd.set(max > 1 && scrolled < max - 1);\n }\n\n protected onTabClick(tab: WrTab): void {\n if (tab.disabled()) return;\n if (!this.isRouter()) this.activate(tab.key());\n }\n\n /** Header id for `aria-labelledby` on the panel. @internal */\n headerId(key: string): string {\n return `wr-tab-${key}-header`;\n }\n\n /** Panel id for `aria-controls` on the tab header. @internal */\n panelId(key: string): string {\n return `wr-tab-${key}-panel`;\n }\n\n /** ArrowLeft/Right/Home/End keyboard navigation on the tab strip. */\n protected onStripKeydown(event: KeyboardEvent): void {\n const tabs = this.tabs().filter(t => !t.disabled());\n if (tabs.length === 0) return;\n const active = this.activeTab();\n const idx = active ? tabs.indexOf(active) : -1;\n // The two neighbours in DOM order, wrapping at the ends.\n const forward = idx < tabs.length - 1 ? idx + 1 : 0;\n const backward = idx > 0 ? idx - 1 : tabs.length - 1;\n const rtl = this.isRtl();\n let nextIdx: number;\n\n switch (event.key) {\n // Arrow keys follow VISUAL order (WAI-ARIA APG). The strip is mirrored\n // under `dir=\"rtl\"`, so ArrowRight moves toward the visual right, which is\n // the PREVIOUS tab there.\n case 'ArrowRight':\n nextIdx = rtl ? backward : forward;\n break;\n case 'ArrowLeft':\n nextIdx = rtl ? forward : backward;\n break;\n // Home / End name a position in the tab list — first and last — not a\n // physical edge, so they read the same in both directions.\n case 'Home':\n nextIdx = 0;\n break;\n case 'End':\n nextIdx = tabs.length - 1;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n const next = tabs[nextIdx];\n if (!this.isRouter()) this.activate(next.key());\n // Move focus to the corresponding header element.\n const headerEl = this.stripRef()?.nativeElement.querySelector<HTMLElement>(\n `#${CSS.escape(this.headerId(next.key()))}`\n );\n headerEl?.focus();\n }\n}\n","<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink(); as link) {\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n routerLinkActive=\"wr-tabs__tab--active\"\n [attr.id]=\"headerId(tab.key())\"\n [routerLink]=\"tab.disabled() ? null : link\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.tabindex]=\"tab.disabled() ? -1 : 0\"\n >\n {{ tab.title() }}\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === activeTab() && !tab.disabled() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n {{ tab.title() }}\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAoBH;;;;;AAKG;MACU,OAAO,GAAG,IAAI,cAAc,CAAgB,S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../../projects/lib/tabs/tabs.html","../../../projects/lib/tabs/ngwr-tabs.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 { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Contract a `<wr-tab>` uses to talk to its parent `<wr-tabs>`.\n *\n * @internal\n */\nexport interface WrTabsContext {\n /** Currently active tab key (component-managed only). */\n readonly active: Signal<string | null>;\n /** Activate a tab by key (component-managed only). */\n activate(key: string): void;\n /** Register a child tab so the parent can pick a default. */\n register(tab: { key: string; routerLink: unknown }): void;\n /** Unregister on destroy. */\n unregister(key: string): void;\n}\n\n/**\n * Token a `<wr-tab>` injects to register itself with — and read the active\n * key from — its parent `<wr-tabs>` host.\n *\n * @internal\n */\nexport const WR_TABS = new InjectionToken<WrTabsContext>('WR_TABS');\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n DestroyRef,\n TemplateRef,\n ViewEncapsulation,\n computed,\n inject,\n input,\n viewChild,\n} from '@angular/core';\n\nimport { randomId } from 'ngwr/utils';\n\nimport { WR_TABS } from './tokens';\n\n/**\n * Single tab. Two modes, decided by inputs:\n *\n * - **Content tab** — projected children render in the parent's content\n * panel when this tab is active.\n * - **Router tab** — set `routerLink` and the tab becomes a link; the\n * parent skips its content panel and the consumer drops a\n * `<router-outlet>` below the tab strip.\n */\n@Component({\n selector: 'wr-tab',\n template: `<ng-template><ng-content /></ng-template>`,\n encapsulation: ViewEncapsulation.None,\n host: { style: 'display:none' },\n})\nexport class WrTab {\n /** Visible label on the tab strip. */\n readonly title = input.required<string>();\n\n /**\n * Stable identifier used by the parent to track the active tab.\n * Auto-generated if omitted.\n */\n readonly key = input<string>(randomId('wr-tab'));\n\n /** Router target — when set, the tab becomes a `[routerLink]` link. */\n readonly routerLink = input<string | readonly string[] | null>(null);\n\n /** Disable the tab. */\n readonly disabled = input(false, { transform: coerceBooleanProperty });\n\n /** Tab content template; portaled into the parent's panel area. @internal */\n readonly contentTpl = viewChild.required(TemplateRef);\n\n private readonly parent = inject(WR_TABS, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n protected readonly isRouter = computed(() => this.routerLink() !== null);\n\n constructor() {\n if (this.parent) {\n // Both calls run with the input signals still on their defaults — a\n // constructor is too early for `key()` to be the consumer's value. The\n // parent tracks tabs through `contentChildren` and seeds `active` from\n // there; these stay as the declared lifecycle contract.\n this.parent.register({ key: this.key(), routerLink: this.routerLink() });\n this.destroyRef.onDestroy(() => this.parent?.unregister(this.key()));\n }\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directionality } from '@angular/cdk/bidi';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n type ElementRef,\n ViewEncapsulation,\n afterNextRender,\n computed,\n contentChildren,\n effect,\n forwardRef,\n inject,\n input,\n model,\n signal,\n viewChild,\n} from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\n\nimport { WrTab } from './tab';\nimport { WR_TABS, type WrTabsContext } from './tokens';\n\n/**\n * Instance counter for the header / panel ids. Deterministic under prerender,\n * unlike `randomId()` — the same reason `wr-sidebar` and `wr-mention` count.\n *\n * The ids used to be built from the tab key alone, so two `<wr-tabs>` on one\n * page that both name a tab `key=\"overview\"` emitted the same\n * `wr-tab-overview-header` twice, and the second group's `aria-labelledby`\n * resolved to the FIRST group's tab. A key is documented as parent-scoped, so\n * it is the parent that has to make it unique document-wide.\n */\nlet tabsUid = 0;\n\n/**\n * A tab key as an id fragment: anything outside `[A-Za-z0-9_-]` becomes `-`.\n * These ids land in `aria-controls` / `aria-labelledby`, which are\n * space-separated IDREF lists — `key=\"my tab\"` emitted\n * `aria-controls=\"wr-tab-my tab-panel\"`, two tokens, neither of which resolves.\n *\n * Two keys differing only outside that set collapse to one fragment; the\n * instance counter keeps that inside a single group, where the keys are the\n * consumer's own to keep apart.\n */\nfunction idFragment(key: string): string {\n return key.replace(/[^A-Za-z0-9_-]/g, '-');\n}\n\n/**\n * Tabbed container. Two modes depending on the child `<wr-tab>`\n * definitions:\n *\n * - **Content** — children project body content; the parent renders an\n * active-tab panel automatically.\n * - **Router** — any child with `routerLink` switches the whole strip\n * into router mode; the parent skips its panel so the consumer can\n * drop a `<router-outlet>` after it.\n *\n * @example\n * ```html\n * <!-- content tabs -->\n * <wr-tabs [(active)]=\"key\">\n * <wr-tab key=\"one\" title=\"One\">First panel</wr-tab>\n * <wr-tab key=\"two\" title=\"Two\">Second panel</wr-tab>\n * </wr-tabs>\n *\n * <!-- router tabs -->\n * <wr-tabs>\n * <wr-tab title=\"Overview\" routerLink=\"overview\" />\n * <wr-tab title=\"Details\" routerLink=\"details\" />\n * </wr-tabs>\n * <router-outlet />\n * ```\n *\n * @see https://ngwr.dev/reference/components/tabs\n */\n@Component({\n selector: 'wr-tabs',\n templateUrl: './tabs.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-tabs',\n '[class.wr-tabs--fade-start]': 'canScrollStart()',\n '[class.wr-tabs--fade-end]': 'canScrollEnd()',\n '[class.wr-tabs--sm]': \"size() === 'sm'\",\n '[class.wr-tabs--lg]': \"size() === 'lg'\",\n },\n imports: [NgTemplateOutlet, RouterLink, RouterLinkActive],\n providers: [\n {\n provide: WR_TABS,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrTabs),\n },\n ],\n})\nexport class WrTabs implements WrTabsContext {\n /** Two-way bindable active tab key (content mode). */\n readonly active = model<string | null>(null);\n\n /** Visual size variant. */\n readonly size = input<'sm' | 'md' | 'lg'>('md');\n\n protected readonly tabs = contentChildren(WrTab);\n\n private readonly dir = inject(Directionality, { optional: true });\n\n /**\n * Reading direction of the strip. `Directionality` is root-provided, so this\n * always resolves — `optional` only guards a consumer who has deliberately\n * torn the provider out. It reads the document once at construction; a\n * subtree that overrides the direction does it with the CDK's `Dir`\n * directive, which writes `valueSignal`, so the read stays reactive.\n */\n private readonly isRtl = computed(() => this.dir?.valueSignal() === 'rtl');\n\n /** When any child has a routerLink, the whole strip switches to router mode. */\n protected readonly isRouter = computed(() => this.tabs().some(t => t.routerLink() !== null));\n\n /** Content-mode: the tab whose key matches `active()` (or the first tab if none yet). */\n protected readonly activeTab = computed(() => {\n const key = this.active();\n const tabs = this.tabs();\n if (tabs.length === 0) return null;\n return tabs.find(t => t.key() === key) ?? tabs[0];\n });\n\n // WrTabsContext\n\n activate(key: string): void {\n this.active.set(key);\n }\n\n register(): void {\n // Deliberately a no-op. A `WrTab` calls this from its own constructor,\n // where its `key` signal input is not bound yet — so it would report the\n // generated default and this parent would write THAT into `active`. The\n // effect below seeds from `tabs()`, by which point the inputs are real.\n }\n\n unregister(): void {\n // No-op: contentChildren handles removal.\n }\n\n // Template handlers\n\n protected readonly stripRef = viewChild<ElementRef<HTMLElement>>('strip');\n\n /** Whether the strip is scrolled away from its start / end — drives the edge fades. */\n protected readonly canScrollStart = signal(false);\n protected readonly canScrollEnd = signal(false);\n\n constructor() {\n // Seed `active` with the first tab's key, once the content children exist\n // and their inputs are bound. Without this the model writes back a\n // generated id like `wr-tab-b1crta5aix0v`: the strip still highlighted the\n // right tab, because `activeTab()` falls back to `tabs[0]`, so the only\n // visible symptom was a two-way binding holding a key the consumer had\n // never heard of.\n effect(() => {\n const tabs = this.tabs();\n if (tabs.length > 0 && this.active() === null) this.active.set(tabs[0].key());\n });\n\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n this.updateFades();\n const el = this.stripRef()?.nativeElement;\n if (!el || typeof ResizeObserver === 'undefined') return;\n // Re-evaluate when the strip's width changes (e.g. the container narrows\n // and the tabs start overflowing).\n const ro = new ResizeObserver(() => this.updateFades());\n ro.observe(el);\n destroyRef.onDestroy(() => ro.disconnect());\n });\n }\n\n /** Recompute which edges can scroll, from the strip's scroll metrics. @internal */\n protected updateFades(): void {\n const el = this.stripRef()?.nativeElement;\n if (!el) return;\n const max = el.scrollWidth - el.clientWidth;\n // Distance from the INLINE start, which is what the two fades mean.\n // `scrollLeft` is 0 at the inline start in BOTH directions and counts away\n // from it — up in LTR, DOWN into negatives under `dir=\"rtl\"` (the CSSOM\n // model every engine Angular 22 supports now implements; the legacy\n // \"reversed\"/\"normal\" RTL conventions are gone). Read raw, the RTL value\n // said \"never scrolled from the start, always more to come\" at every\n // position: the end fade was pinned on and the start fade never appeared.\n //\n // Clamped rather than `Math.abs`, because an elastic overscroll reports a\n // value of the WRONG sign at the start edge — a rubber-band past the start\n // is still the start, and `abs` would light the start fade there in LTR too.\n const scrolled = this.isRtl() ? Math.max(-el.scrollLeft, 0) : Math.max(el.scrollLeft, 0);\n this.canScrollStart.set(scrolled > 1);\n this.canScrollEnd.set(max > 1 && scrolled < max - 1);\n }\n\n protected onTabClick(tab: WrTab): void {\n if (tab.disabled()) return;\n if (!this.isRouter()) this.activate(tab.key());\n }\n\n /** Per-instance prefix, so keys only have to be unique within one group. */\n private readonly uid = ++tabsUid;\n\n /** Header id for `aria-labelledby` on the panel. @internal */\n headerId(key: string): string {\n return `wr-tabs-${this.uid}-tab-${idFragment(key)}-header`;\n }\n\n /** Panel id for `aria-controls` on the tab header. @internal */\n panelId(key: string): string {\n return `wr-tabs-${this.uid}-tab-${idFragment(key)}-panel`;\n }\n\n /** ArrowLeft/Right/Home/End keyboard navigation on the tab strip. */\n protected onStripKeydown(event: KeyboardEvent): void {\n const tabs = this.tabs().filter(t => !t.disabled());\n if (tabs.length === 0) return;\n\n // Step from where FOCUS is, not from what is active.\n //\n // In router mode nothing ever moves `active` — `onTabClick` and this\n // handler both gate `activate()` on `!isRouter()`, because the route is\n // what selects a tab there. Reading the neighbour off `activeTab()`\n // therefore recomputed the same `idx` on every press, and ArrowRight\n // walked from the first tab to the second and stayed there for the rest of\n // the session. In manual mode focus and activation move together, so the\n // two readings agree and nothing changes.\n const strip = this.stripRef()?.nativeElement;\n const focused = strip?.ownerDocument.activeElement;\n const focusedIdx =\n focused instanceof HTMLElement && strip?.contains(focused)\n ? tabs.findIndex(t => this.headerId(t.key()) === focused.id)\n : -1;\n const active = this.activeTab();\n const idx = focusedIdx >= 0 ? focusedIdx : active ? tabs.indexOf(active) : -1;\n // The two neighbours in DOM order, wrapping at the ends.\n const forward = idx < tabs.length - 1 ? idx + 1 : 0;\n const backward = idx > 0 ? idx - 1 : tabs.length - 1;\n const rtl = this.isRtl();\n let nextIdx: number;\n\n switch (event.key) {\n // Arrow keys follow VISUAL order (WAI-ARIA APG). The strip is mirrored\n // under `dir=\"rtl\"`, so ArrowRight moves toward the visual right, which is\n // the PREVIOUS tab there.\n case 'ArrowRight':\n nextIdx = rtl ? backward : forward;\n break;\n case 'ArrowLeft':\n nextIdx = rtl ? forward : backward;\n break;\n // Home / End name a position in the tab list — first and last — not a\n // physical edge, so they read the same in both directions.\n case 'Home':\n nextIdx = 0;\n break;\n case 'End':\n nextIdx = tabs.length - 1;\n break;\n default:\n return;\n }\n\n event.preventDefault();\n const next = tabs[nextIdx];\n if (!this.isRouter()) this.activate(next.key());\n // Move focus to the corresponding header element.\n const headerEl = this.stripRef()?.nativeElement.querySelector<HTMLElement>(\n `#${CSS.escape(this.headerId(next.key()))}`\n );\n headerEl?.focus();\n }\n}\n","<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n<div\n #strip\n class=\"wr-tabs__strip\"\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n (keydown)=\"onStripKeydown($event)\"\n (scroll)=\"updateFades()\"\n>\n @for (tab of tabs(); track tab.key()) {\n @if (tab.routerLink(); as link) {\n <!--\n `aria-selected` comes off the SAME `routerLinkActive` that paints `--active`,\n exported as `rla`, so the announced state and the painted one can never\n disagree. Without it a `role=\"tablist\"` shipped with no tab selected in any of\n them: the route decides here, and the class it paints is invisible to\n assistive tech.\n -->\n <a\n #rla=\"routerLinkActive\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n routerLinkActive=\"wr-tabs__tab--active\"\n [attr.id]=\"headerId(tab.key())\"\n [routerLink]=\"tab.disabled() ? null : link\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"rla.isActive\"\n [attr.tabindex]=\"tab.disabled() ? -1 : 0\"\n >\n {{ tab.title() }}\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.aria-controls]=\"panelId(tab.key())\"\n [attr.tabindex]=\"tab === activeTab() && !tab.disabled() ? 0 : -1\"\n [class.wr-tabs__tab--active]=\"tab === activeTab()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-selected]=\"tab === activeTab()\"\n [disabled]=\"tab.disabled()\"\n (click)=\"onTabClick(tab)\"\n >\n {{ tab.title() }}\n </button>\n }\n }\n</div>\n\n@if (!isRouter() && activeTab(); as tab) {\n <div\n class=\"wr-tabs__panel\"\n role=\"tabpanel\"\n tabindex=\"0\"\n [attr.id]=\"panelId(tab.key())\"\n [attr.aria-labelledby]=\"headerId(tab.key())\"\n >\n <ng-container [ngTemplateOutlet]=\"tab.contentTpl()\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;AAKG;AAoBH;;;;;AAKG;MACU,OAAO,GAAG,IAAI,cAAc,CAAgB,SAAS;;AC/BlE;;;;;AAKG;AAkBH;;;;;;;;AAQG;MAOU,KAAK,CAAA;;IAEP,KAAK,GAAG,KAAK,CAAC,QAAQ;8EAAU;AAEzC;;;AAGG;AACM,IAAA,GAAG,GAAG,KAAK,CAAS,QAAQ,CAAC,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AAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,MAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,IAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,KAAK,mEA2CkB,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE1J1E;;AAEG;;;;"}
@@ -207,10 +207,10 @@ class WrTextarea {
207
207
  el.style.overflowY = 'hidden';
208
208
  }
209
209
  }
210
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrTextarea, deps: [], target: i0.ɵɵFactoryTarget.Component });
211
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrTextarea, isStandalone: true, selector: "wr-textarea", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, autosize: { classPropertyName: "autosize", publicName: "autosize", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, host: { properties: { "class": "classes()" } }, viewQueries: [{ propertyName: "native", first: true, predicate: ["native"], descendants: true, isSignal: true }], ngImport: i0, template: "<textarea\n #native\n class=\"wr-textarea__native\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [placeholder]=\"placeholder()\"\n [rows]=\"rows()\"\n [readonly]=\"readonly()\"\n [disabled]=\"disabled()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (focus)=\"focused.set(true)\"\n (blur)=\"onBlur()\"\n></textarea>\n\n@if (showHandle()) {\n <!-- Custom corner grip \u2014 the lucide icon + cursor follow the `resize`\n direction. Icons inlined so no icon registration is required. -->\n <span\n [class]=\"`wr-textarea__resize wr-textarea__resize--${effectiveResize()}`\"\n aria-hidden=\"true\"\n (pointerdown)=\"startResize($event)\"\n (pointermove)=\"onResize($event)\"\n (pointerup)=\"endResize($event)\"\n (pointercancel)=\"endResize($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @switch (effectiveResize()) {\n @case ('vertical') {\n <path d=\"M12 2v20\" />\n <path d=\"m8 18 4 4 4-4\" />\n <path d=\"m8 6 4-4 4 4\" />\n }\n @case ('horizontal') {\n <path d=\"M2 12h20\" />\n <path d=\"m18 8 4 4-4 4\" />\n <path d=\"m6 8-4 4 4 4\" />\n }\n @default {\n <path d=\"M19 13v6h-6\" />\n <path d=\"M5 11V5h6\" />\n <path d=\"m5 5 14 14\" />\n }\n }\n </svg>\n </span>\n}\n", encapsulation: i0.ViewEncapsulation.None });
210
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrTextarea, deps: [], target: i0.ɵɵFactoryTarget.Component });
211
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: WrTextarea, isStandalone: true, selector: "wr-textarea", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, resize: { classPropertyName: "resize", publicName: "resize", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, autosize: { classPropertyName: "autosize", publicName: "autosize", isSignal: true, isRequired: false, transformFunction: null }, maxRows: { classPropertyName: "maxRows", publicName: "maxRows", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", touch: "touch" }, host: { properties: { "class": "classes()" } }, viewQueries: [{ propertyName: "native", first: true, predicate: ["native"], descendants: true, isSignal: true }], ngImport: i0, template: "<textarea\n #native\n class=\"wr-textarea__native\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [placeholder]=\"placeholder()\"\n [rows]=\"rows()\"\n [readonly]=\"readonly()\"\n [disabled]=\"disabled()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (focus)=\"focused.set(true)\"\n (blur)=\"onBlur()\"\n></textarea>\n\n@if (showHandle()) {\n <!-- Custom corner grip \u2014 the lucide icon + cursor follow the `resize`\n direction. Icons inlined so no icon registration is required. -->\n <span\n [class]=\"`wr-textarea__resize wr-textarea__resize--${effectiveResize()}`\"\n aria-hidden=\"true\"\n (pointerdown)=\"startResize($event)\"\n (pointermove)=\"onResize($event)\"\n (pointerup)=\"endResize($event)\"\n (pointercancel)=\"endResize($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @switch (effectiveResize()) {\n @case ('vertical') {\n <path d=\"M12 2v20\" />\n <path d=\"m8 18 4 4 4-4\" />\n <path d=\"m8 6 4-4 4 4\" />\n }\n @case ('horizontal') {\n <path d=\"M2 12h20\" />\n <path d=\"m18 8 4 4-4 4\" />\n <path d=\"m6 8-4 4 4 4\" />\n }\n @default {\n <path d=\"M19 13v6h-6\" />\n <path d=\"M5 11V5h6\" />\n <path d=\"m5 5 14 14\" />\n }\n }\n </svg>\n </span>\n}\n", encapsulation: i0.ViewEncapsulation.None });
212
212
  }
213
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrTextarea, decorators: [{
213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrTextarea, decorators: [{
214
214
  type: Component,
215
215
  args: [{ selector: 'wr-textarea', encapsulation: ViewEncapsulation.None, host: { '[class]': 'classes()' }, template: "<textarea\n #native\n class=\"wr-textarea__native\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [placeholder]=\"placeholder()\"\n [rows]=\"rows()\"\n [readonly]=\"readonly()\"\n [disabled]=\"disabled()\"\n [value]=\"value()\"\n (input)=\"onInput($event)\"\n (focus)=\"focused.set(true)\"\n (blur)=\"onBlur()\"\n></textarea>\n\n@if (showHandle()) {\n <!-- Custom corner grip \u2014 the lucide icon + cursor follow the `resize`\n direction. Icons inlined so no icon registration is required. -->\n <span\n [class]=\"`wr-textarea__resize wr-textarea__resize--${effectiveResize()}`\"\n aria-hidden=\"true\"\n (pointerdown)=\"startResize($event)\"\n (pointermove)=\"onResize($event)\"\n (pointerup)=\"endResize($event)\"\n (pointercancel)=\"endResize($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n @switch (effectiveResize()) {\n @case ('vertical') {\n <path d=\"M12 2v20\" />\n <path d=\"m8 18 4 4 4-4\" />\n <path d=\"m8 6 4-4 4 4\" />\n }\n @case ('horizontal') {\n <path d=\"M2 12h20\" />\n <path d=\"m18 8 4 4-4 4\" />\n <path d=\"m6 8-4 4 4 4\" />\n }\n @default {\n <path d=\"M19 13v6h-6\" />\n <path d=\"M5 11V5h6\" />\n <path d=\"m5 5 14 14\" />\n }\n }\n </svg>\n </span>\n}\n" }]
216
216
  }], ctorParameters: () => [], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], rows: [{ type: i0.Input, args: [{ isSignal: true, alias: "rows", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], resize: [{ type: i0.Input, args: [{ isSignal: true, alias: "resize", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], autosize: [{ type: i0.Input, args: [{ isSignal: true, alias: "autosize", required: false }] }], maxRows: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxRows", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], touch: [{ type: i0.Output, args: ["touch"] }], native: [{ type: i0.ViewChild, args: ['native', { isSignal: true }] }] } });