ngwr 16.2.0 → 16.3.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 (398) hide show
  1. package/badge/styles/_tag.scss +73 -1
  2. package/calendar/styles/_index.scss +22 -0
  3. package/cascader/styles/_rules.scss +7 -0
  4. package/color-picker/styles/_index.scss +21 -0
  5. package/date-picker/styles/_index.scss +19 -0
  6. package/dropdown/styles/_index.scss +13 -19
  7. package/fesm2022/ngwr-affix.mjs +3 -3
  8. package/fesm2022/ngwr-alert-testing.mjs +70 -0
  9. package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
  10. package/fesm2022/ngwr-alert.mjs +3 -3
  11. package/fesm2022/ngwr-anchor.mjs +17 -6
  12. package/fesm2022/ngwr-anchor.mjs.map +1 -1
  13. package/fesm2022/ngwr-animations-aurora.mjs +3 -3
  14. package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
  15. package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
  16. package/fesm2022/ngwr-animations-confetti.mjs +3 -3
  17. package/fesm2022/ngwr-animations-decode.mjs +3 -3
  18. package/fesm2022/ngwr-animations-destruct.mjs +3 -3
  19. package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
  20. package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
  21. package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
  22. package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
  23. package/fesm2022/ngwr-animations-glitch.mjs +3 -3
  24. package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
  25. package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
  26. package/fesm2022/ngwr-animations-marquee.mjs +3 -3
  27. package/fesm2022/ngwr-animations-orbit.mjs +3 -3
  28. package/fesm2022/ngwr-animations-reveal.mjs +3 -3
  29. package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
  30. package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
  31. package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
  32. package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
  33. package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
  34. package/fesm2022/ngwr-animations-tilt.mjs +3 -3
  35. package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
  36. package/fesm2022/ngwr-avatar.mjs +3 -3
  37. package/fesm2022/ngwr-back-top.mjs +3 -3
  38. package/fesm2022/ngwr-badge.mjs +129 -11
  39. package/fesm2022/ngwr-badge.mjs.map +1 -1
  40. package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
  41. package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
  42. package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
  43. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  44. package/fesm2022/ngwr-burger-testing.mjs +45 -0
  45. package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
  46. package/fesm2022/ngwr-burger.mjs +3 -3
  47. package/fesm2022/ngwr-button.mjs +6 -6
  48. package/fesm2022/ngwr-calendar-testing.mjs +18 -0
  49. package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
  50. package/fesm2022/ngwr-calendar.mjs +500 -73
  51. package/fesm2022/ngwr-calendar.mjs.map +1 -1
  52. package/fesm2022/ngwr-card.mjs +9 -9
  53. package/fesm2022/ngwr-carousel.mjs +6 -6
  54. package/fesm2022/ngwr-cascader.mjs +37 -16
  55. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  56. package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
  57. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  58. package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
  59. package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
  60. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
  61. package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
  62. package/fesm2022/ngwr-charts-chart-legend.mjs +26 -11
  63. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  64. package/fesm2022/ngwr-charts-core.mjs +3 -3
  65. package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
  66. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  67. package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
  68. package/fesm2022/ngwr-charts-gauge.mjs +3 -3
  69. package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
  70. package/fesm2022/ngwr-charts-line-chart-testing.mjs +3 -2
  71. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
  73. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
  75. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
  77. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
  79. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
  81. package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
  82. package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
  83. package/fesm2022/ngwr-checkbox.mjs +6 -6
  84. package/fesm2022/ngwr-clipboard.mjs +3 -3
  85. package/fesm2022/ngwr-collapse.mjs +9 -9
  86. package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
  87. package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
  88. package/fesm2022/ngwr-color-picker.mjs +153 -37
  89. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  90. package/fesm2022/ngwr-command-palette.mjs +3 -3
  91. package/fesm2022/ngwr-comment.mjs +10 -6
  92. package/fesm2022/ngwr-comment.mjs.map +1 -1
  93. package/fesm2022/ngwr-compare-testing.mjs +84 -0
  94. package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
  95. package/fesm2022/ngwr-compare.mjs +3 -3
  96. package/fesm2022/ngwr-context-menu.mjs +12 -12
  97. package/fesm2022/ngwr-cookie.mjs +3 -3
  98. package/fesm2022/ngwr-copy-value.mjs +3 -3
  99. package/fesm2022/ngwr-counter.mjs +6 -6
  100. package/fesm2022/ngwr-date-picker-testing.mjs +30 -4
  101. package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
  102. package/fesm2022/ngwr-date-picker.mjs +342 -69
  103. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  104. package/fesm2022/ngwr-date-stamp.mjs +3 -3
  105. package/fesm2022/ngwr-date.mjs +59 -8
  106. package/fesm2022/ngwr-date.mjs.map +1 -1
  107. package/fesm2022/ngwr-density.mjs +6 -6
  108. package/fesm2022/ngwr-descriptions.mjs +6 -6
  109. package/fesm2022/ngwr-dialog.mjs +18 -18
  110. package/fesm2022/ngwr-directives.mjs +15 -15
  111. package/fesm2022/ngwr-divider.mjs +3 -3
  112. package/fesm2022/ngwr-drawer.mjs +51 -29
  113. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  114. package/fesm2022/ngwr-dropdown-testing.mjs +11 -3
  115. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  116. package/fesm2022/ngwr-dropdown.mjs +52 -95
  117. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  118. package/fesm2022/ngwr-editor.mjs +4 -3
  119. package/fesm2022/ngwr-editor.mjs.map +1 -1
  120. package/fesm2022/ngwr-empty.mjs +3 -3
  121. package/fesm2022/ngwr-event-calendar.mjs +186 -33
  122. package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
  123. package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
  124. package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
  125. package/fesm2022/ngwr-file-upload.mjs +274 -15
  126. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  127. package/fesm2022/ngwr-form.mjs +9 -9
  128. package/fesm2022/ngwr-form.mjs.map +1 -1
  129. package/fesm2022/ngwr-graph-testing.mjs +3 -0
  130. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  131. package/fesm2022/ngwr-graph.mjs +102 -42
  132. package/fesm2022/ngwr-graph.mjs.map +1 -1
  133. package/fesm2022/ngwr-hotkey.mjs +6 -6
  134. package/fesm2022/ngwr-i18n-ar.mjs +19 -4
  135. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  136. package/fesm2022/ngwr-i18n-cs.mjs +19 -4
  137. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  138. package/fesm2022/ngwr-i18n-de.mjs +19 -4
  139. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  140. package/fesm2022/ngwr-i18n-en.mjs +19 -4
  141. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  142. package/fesm2022/ngwr-i18n-es.mjs +19 -4
  143. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  144. package/fesm2022/ngwr-i18n-fr.mjs +19 -4
  145. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  146. package/fesm2022/ngwr-i18n-he.mjs +19 -4
  147. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  148. package/fesm2022/ngwr-i18n-hi.mjs +19 -4
  149. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  150. package/fesm2022/ngwr-i18n-id.mjs +19 -4
  151. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n-it.mjs +19 -4
  153. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  154. package/fesm2022/ngwr-i18n-ja.mjs +19 -4
  155. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  156. package/fesm2022/ngwr-i18n-ko.mjs +19 -4
  157. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  158. package/fesm2022/ngwr-i18n-nl.mjs +19 -4
  159. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  160. package/fesm2022/ngwr-i18n-pl.mjs +19 -4
  161. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  162. package/fesm2022/ngwr-i18n-pt.mjs +19 -4
  163. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  164. package/fesm2022/ngwr-i18n-ru.mjs +19 -4
  165. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  166. package/fesm2022/ngwr-i18n-sv.mjs +19 -4
  167. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  168. package/fesm2022/ngwr-i18n-tr.mjs +19 -4
  169. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  170. package/fesm2022/ngwr-i18n-uk.mjs +19 -4
  171. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  172. package/fesm2022/ngwr-i18n-vi.mjs +19 -4
  173. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  174. package/fesm2022/ngwr-i18n-zh-tw.mjs +19 -4
  175. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  176. package/fesm2022/ngwr-i18n-zh.mjs +19 -4
  177. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  178. package/fesm2022/ngwr-i18n.mjs +9 -9
  179. package/fesm2022/ngwr-icon.mjs +6 -6
  180. package/fesm2022/ngwr-image-cropper.mjs +3 -3
  181. package/fesm2022/ngwr-input-number-testing.mjs +11 -0
  182. package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
  183. package/fesm2022/ngwr-input-number.mjs +68 -7
  184. package/fesm2022/ngwr-input-number.mjs.map +1 -1
  185. package/fesm2022/ngwr-input-otp.mjs +23 -3
  186. package/fesm2022/ngwr-input-otp.mjs.map +1 -1
  187. package/fesm2022/ngwr-input-testing.mjs +24 -1
  188. package/fesm2022/ngwr-input-testing.mjs.map +1 -1
  189. package/fesm2022/ngwr-input.mjs +152 -36
  190. package/fesm2022/ngwr-input.mjs.map +1 -1
  191. package/fesm2022/ngwr-keyboard.mjs +3 -3
  192. package/fesm2022/ngwr-knob.mjs +3 -3
  193. package/fesm2022/ngwr-layout.mjs +15 -15
  194. package/fesm2022/ngwr-lightbox.mjs +8 -8
  195. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  196. package/fesm2022/ngwr-list.mjs +8 -8
  197. package/fesm2022/ngwr-list.mjs.map +1 -1
  198. package/fesm2022/ngwr-load-state.mjs +15 -15
  199. package/fesm2022/ngwr-loading-bar.mjs +6 -6
  200. package/fesm2022/ngwr-mention.mjs +6 -6
  201. package/fesm2022/ngwr-meta.mjs +6 -6
  202. package/fesm2022/ngwr-overlay.mjs +175 -13
  203. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  204. package/fesm2022/ngwr-page-header.mjs +3 -3
  205. package/fesm2022/ngwr-pagination.mjs +5 -3
  206. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  207. package/fesm2022/ngwr-pipes.mjs +31 -29
  208. package/fesm2022/ngwr-pipes.mjs.map +1 -1
  209. package/fesm2022/ngwr-platform.mjs +9 -9
  210. package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
  211. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  212. package/fesm2022/ngwr-popconfirm.mjs +44 -63
  213. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  214. package/fesm2022/ngwr-popover-testing.mjs +7 -1
  215. package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
  216. package/fesm2022/ngwr-popover.mjs +58 -156
  217. package/fesm2022/ngwr-popover.mjs.map +1 -1
  218. package/fesm2022/ngwr-progress.mjs +50 -9
  219. package/fesm2022/ngwr-progress.mjs.map +1 -1
  220. package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
  221. package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
  222. package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
  223. package/fesm2022/ngwr-qr.mjs +3 -3
  224. package/fesm2022/ngwr-radio.mjs +6 -6
  225. package/fesm2022/ngwr-rating.mjs +3 -3
  226. package/fesm2022/ngwr-resizable-testing.mjs +113 -0
  227. package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
  228. package/fesm2022/ngwr-resizable.mjs +3 -3
  229. package/fesm2022/ngwr-result.mjs +12 -12
  230. package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
  231. package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
  232. package/fesm2022/ngwr-schema-form.mjs +415 -19
  233. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  234. package/fesm2022/ngwr-scroll.mjs +3 -3
  235. package/fesm2022/ngwr-segmented.mjs +3 -3
  236. package/fesm2022/ngwr-select-testing.mjs +19 -0
  237. package/fesm2022/ngwr-select-testing.mjs.map +1 -1
  238. package/fesm2022/ngwr-select.mjs +263 -83
  239. package/fesm2022/ngwr-select.mjs.map +1 -1
  240. package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
  241. package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
  242. package/fesm2022/ngwr-sidebar.mjs +3 -3
  243. package/fesm2022/ngwr-skeleton.mjs +3 -3
  244. package/fesm2022/ngwr-slider-testing.mjs +6 -0
  245. package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
  246. package/fesm2022/ngwr-slider.mjs +21 -3
  247. package/fesm2022/ngwr-slider.mjs.map +1 -1
  248. package/fesm2022/ngwr-sortable-list.mjs +29 -12
  249. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  250. package/fesm2022/ngwr-speed-dial.mjs +3 -3
  251. package/fesm2022/ngwr-spinner.mjs +3 -3
  252. package/fesm2022/ngwr-splitter.mjs +3 -3
  253. package/fesm2022/ngwr-statistic.mjs +9 -9
  254. package/fesm2022/ngwr-stepper.mjs +42 -11
  255. package/fesm2022/ngwr-stepper.mjs.map +1 -1
  256. package/fesm2022/ngwr-storage.mjs +3 -3
  257. package/fesm2022/ngwr-switch.mjs +3 -3
  258. package/fesm2022/ngwr-table-testing.mjs +88 -2
  259. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  260. package/fesm2022/ngwr-table.mjs +891 -74
  261. package/fesm2022/ngwr-table.mjs.map +1 -1
  262. package/fesm2022/ngwr-tabs-router.mjs +3 -3
  263. package/fesm2022/ngwr-tabs-testing.mjs +1 -1
  264. package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
  265. package/fesm2022/ngwr-tabs.mjs +15 -10
  266. package/fesm2022/ngwr-tabs.mjs.map +1 -1
  267. package/fesm2022/ngwr-textarea-testing.mjs +11 -0
  268. package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
  269. package/fesm2022/ngwr-textarea.mjs +128 -16
  270. package/fesm2022/ngwr-textarea.mjs.map +1 -1
  271. package/fesm2022/ngwr-theme.mjs +3 -3
  272. package/fesm2022/ngwr-timeline.mjs +6 -6
  273. package/fesm2022/ngwr-toast.mjs +40 -19
  274. package/fesm2022/ngwr-toast.mjs.map +1 -1
  275. package/fesm2022/ngwr-toolbar.mjs +3 -3
  276. package/fesm2022/ngwr-tour.mjs +6 -6
  277. package/fesm2022/ngwr-transfer-testing.mjs +6 -0
  278. package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
  279. package/fesm2022/ngwr-transfer.mjs +24 -5
  280. package/fesm2022/ngwr-transfer.mjs.map +1 -1
  281. package/fesm2022/ngwr-tree-testing.mjs +62 -2
  282. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  283. package/fesm2022/ngwr-tree.mjs +966 -78
  284. package/fesm2022/ngwr-tree.mjs.map +1 -1
  285. package/fesm2022/ngwr-typography.mjs +3 -3
  286. package/fesm2022/ngwr-utils-router.mjs +3 -3
  287. package/fesm2022/ngwr-utils.mjs +34 -1
  288. package/fesm2022/ngwr-utils.mjs.map +1 -1
  289. package/fesm2022/ngwr-version.mjs +1 -1
  290. package/fesm2022/ngwr-version.mjs.map +1 -1
  291. package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
  292. package/fesm2022/ngwr-window.mjs +33 -22
  293. package/fesm2022/ngwr-window.mjs.map +1 -1
  294. package/file-upload/styles/_index.scss +156 -0
  295. package/i18n/ar.json +21 -4
  296. package/i18n/cs.json +21 -4
  297. package/i18n/de.json +21 -4
  298. package/i18n/en.json +21 -4
  299. package/i18n/es.json +21 -4
  300. package/i18n/fr.json +21 -4
  301. package/i18n/he.json +21 -4
  302. package/i18n/hi.json +21 -4
  303. package/i18n/id.json +21 -4
  304. package/i18n/it.json +21 -4
  305. package/i18n/ja.json +21 -4
  306. package/i18n/ko.json +21 -4
  307. package/i18n/nl.json +21 -4
  308. package/i18n/pl.json +21 -4
  309. package/i18n/pt.json +21 -4
  310. package/i18n/ru.json +21 -4
  311. package/i18n/sv.json +21 -4
  312. package/i18n/tr.json +21 -4
  313. package/i18n/uk.json +21 -4
  314. package/i18n/vi.json +21 -4
  315. package/i18n/zh-TW.json +21 -4
  316. package/i18n/zh.json +21 -4
  317. package/input/styles/_index.scss +68 -1
  318. package/input-otp/styles/_index.scss +14 -0
  319. package/llms-full.txt +52 -20
  320. package/overlay/styles/_arrow.scss +4 -4
  321. package/package.json +33 -1
  322. package/popconfirm/styles/_index.scss +3 -11
  323. package/progress/styles/_index.scss +32 -0
  324. package/schema-form/styles/_index.scss +78 -0
  325. package/schematics/use/rule.js +2 -0
  326. package/schematics/use/symbol-map.json +4 -0
  327. package/select/styles/_index.scss +114 -22
  328. package/skills/ngwr/SKILL.md +1 -1
  329. package/skills/ngwr/references/catalog.md +9 -1
  330. package/slider/styles/_index.scss +22 -0
  331. package/table/styles/_index.scss +167 -3
  332. package/textarea/styles/_index.scss +80 -0
  333. package/theme/styles/_focus.scss +5 -0
  334. package/theme/styles/_motion.scss +5 -0
  335. package/transfer/styles/_index.scss +84 -0
  336. package/tree/styles/_index.scss +138 -5
  337. package/types/ngwr-alert-testing.d.ts +88 -0
  338. package/types/ngwr-badge.d.ts +72 -2
  339. package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
  340. package/types/ngwr-burger-testing.d.ts +51 -0
  341. package/types/ngwr-calendar-testing.d.ts +18 -6
  342. package/types/ngwr-calendar.d.ts +272 -22
  343. package/types/ngwr-cascader.d.ts +10 -1
  344. package/types/ngwr-charts-chart-legend.d.ts +9 -4
  345. package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
  346. package/types/ngwr-charts-line-chart.d.ts +7 -4
  347. package/types/ngwr-color-picker-testing.d.ts +15 -4
  348. package/types/ngwr-color-picker.d.ts +76 -6
  349. package/types/ngwr-compare-testing.d.ts +72 -0
  350. package/types/ngwr-date-picker-testing.d.ts +23 -8
  351. package/types/ngwr-date-picker.d.ts +100 -9
  352. package/types/ngwr-date.d.ts +71 -1
  353. package/types/ngwr-drawer.d.ts +9 -0
  354. package/types/ngwr-dropdown-testing.d.ts +20 -0
  355. package/types/ngwr-dropdown.d.ts +24 -6
  356. package/types/ngwr-event-calendar.d.ts +66 -8
  357. package/types/ngwr-file-upload-testing.d.ts +31 -2
  358. package/types/ngwr-file-upload.d.ts +148 -1
  359. package/types/ngwr-form.d.ts +47 -3
  360. package/types/ngwr-graph-testing.d.ts +8 -3
  361. package/types/ngwr-graph.d.ts +147 -7
  362. package/types/ngwr-input-number-testing.d.ts +10 -0
  363. package/types/ngwr-input-number.d.ts +30 -1
  364. package/types/ngwr-input-otp.d.ts +10 -0
  365. package/types/ngwr-input-testing.d.ts +30 -0
  366. package/types/ngwr-input.d.ts +54 -3
  367. package/types/ngwr-overlay.d.ts +84 -5
  368. package/types/ngwr-pipes.d.ts +2 -1
  369. package/types/ngwr-popconfirm-testing.d.ts +12 -3
  370. package/types/ngwr-popconfirm.d.ts +28 -3
  371. package/types/ngwr-popover-testing.d.ts +19 -2
  372. package/types/ngwr-popover.d.ts +22 -2
  373. package/types/ngwr-progress.d.ts +29 -1
  374. package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
  375. package/types/ngwr-resizable-testing.d.ts +116 -0
  376. package/types/ngwr-schema-form-testing.d.ts +260 -0
  377. package/types/ngwr-schema-form.d.ts +76 -6
  378. package/types/ngwr-select-testing.d.ts +20 -0
  379. package/types/ngwr-select.d.ts +112 -11
  380. package/types/ngwr-sidebar-testing.d.ts +176 -0
  381. package/types/ngwr-slider-testing.d.ts +3 -1
  382. package/types/ngwr-slider.d.ts +21 -1
  383. package/types/ngwr-sortable-list.d.ts +6 -0
  384. package/types/ngwr-stepper.d.ts +20 -11
  385. package/types/ngwr-table-testing.d.ts +70 -6
  386. package/types/ngwr-table.d.ts +480 -50
  387. package/types/ngwr-tabs-testing.d.ts +14 -17
  388. package/types/ngwr-tabs.d.ts +6 -0
  389. package/types/ngwr-textarea-testing.d.ts +10 -0
  390. package/types/ngwr-textarea.d.ts +48 -2
  391. package/types/ngwr-toast.d.ts +8 -1
  392. package/types/ngwr-transfer-testing.d.ts +3 -0
  393. package/types/ngwr-transfer.d.ts +24 -1
  394. package/types/ngwr-tree-testing.d.ts +65 -1
  395. package/types/ngwr-tree.d.ts +333 -12
  396. package/types/ngwr-utils.d.ts +28 -0
  397. package/types/ngwr-version.d.ts +1 -1
  398. package/types/ngwr-window.d.ts +7 -4
@@ -41,7 +41,7 @@ var WrTabsRouting = class WrTabsRouting {
41
41
  }
42
42
  static ɵfac = i0.ɵɵngDeclareFactory({
43
43
  minVersion: "12.0.0",
44
- version: "22.2.5",
44
+ version: "22.2.6",
45
45
  ngImport: i0,
46
46
  type: WrTabsRouting,
47
47
  deps: [],
@@ -49,7 +49,7 @@ var WrTabsRouting = class WrTabsRouting {
49
49
  });
50
50
  static ɵdir = i0.ɵɵngDeclareDirective({
51
51
  minVersion: "14.0.0",
52
- version: "22.2.5",
52
+ version: "22.2.6",
53
53
  type: WrTabsRouting,
54
54
  isStandalone: true,
55
55
  selector: "[wrTabsRouting]",
@@ -63,7 +63,7 @@ var WrTabsRouting = class WrTabsRouting {
63
63
  };
64
64
  i0.ɵɵngDeclareClassMetadata({
65
65
  minVersion: "12.0.0",
66
- version: "22.2.5",
66
+ version: "22.2.6",
67
67
  ngImport: i0,
68
68
  type: WrTabsRouting,
69
69
  decorators: [{
@@ -170,7 +170,7 @@ var WrTabsHarness = class WrTabsHarness extends ComponentHarness {
170
170
  await tab.focus();
171
171
  return;
172
172
  }
173
- throw new Error("WrTabsHarness.focusTabStop(): this strip has no tab stop — its selected tab is disabled, every tab is disabled, or it renders no tabs — so Tab skips it rather than entering it.");
173
+ throw new Error("WrTabsHarness.focusTabStop(): this strip has no tab stop — every tab is disabled, or it renders no tabs — so Tab skips it rather than entering it.");
174
174
  }
175
175
  async pressArrowRight() {
176
176
  await this.press(TestKey.RIGHT_ARROW);
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-tabs-testing.mjs","names":[],"sources":["../../../projects/lib/tabs/testing/wr-tab-harness.ts","../../../projects/lib/tabs/testing/wr-tabs-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters } from './types';\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 `routerActive()` 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 * Either strip is ONE tab stop: a content strip hands it to the selected tab, a\n * router strip to the tab the route selects, or to the first enabled one while\n * no route matches. See `WrTabsHarness.getTabStopLabels()`.\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 an `<a>`, where `disabled` is\n * not a thing — it carries `aria-disabled=\"true\"` and `tabindex=\"-1\"` to stay off\n * the keyboard path, renders NO href, and the component drops the click rather\n * than routing it. So the click lands and nothing moves, which is why a router\n * strip's expectations belong 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 './types';\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 `routerActive()` that paints `--active`) and the strip renders NO\n * panel. It is still ONE tab stop — on the tab the route selects, or the first\n * enabled tab when no route matches — and Space activates a tab as Enter does.\n * The arrow keys 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 * `routerActive()` 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. A\n * DISABLED router tab is a different shape and no longer navigates: it renders\n * no href and the component drops the click, so the click lands and nothing\n * moves — 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 what breaks: both modes\n * rove a single `tabindex=\"0\"` and answer with exactly one label — the selected\n * tab, or in router mode the first enabled one while no route matches — and a\n * router strip used to answer with every enabled tab. Either way a disabled tab is\n * 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 both modes; false means more than one tab is in the page tab order,\n * which is what a router strip did before it roved too. A strip whose every tab\n * is disabled has no stop at all and answers `true`: nothing to rove, and Tab\n * 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 '`routerActive()` 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"],"mappings":";;;;;;;AA8CA,IAAa,eAAb,MAAa,qBAAqB,iCAAgC;CAEhE,OAAO,eAAe;CAGtB,OAAO,KAAK,UAA+B,CAAA,GAAE;EAC3C,OAAO,IAAI,iBAAiB,cAAc,OAAO,CAAC,CAC/C,UAAU,SAAS,QAAQ,QAAQ,SAAS,UAAU,iBAAiB,cAAc,QAAQ,SAAQ,GAAI,KAAK,CAAC,CAAC,CAChH,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ,CAAC,CAC/G,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ;CACnH;CAGA,MAAM,WAAQ;EACZ,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,KAAI;CACjC;CASA,MAAM,QAAK;EACT,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,IAAI;CAC9C;CAaA,MAAM,aAAU;EACd,MAAM,OAAO,MAAM,KAAK,KAAI;EAC5B,MAAM,WAAW,MAAM,KAAK,aAAa,eAAe;EACxD,IAAI,aAAa,MAAM,OAAO,aAAa;EAC3C,OAAO,KAAK,SAAS,sBAAsB;CAC7C;CAWA,MAAM,aAAU;EACd,MAA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,GAAG;CAC9B;CAGA,MAAM,WAAQ;EACZ,MAAM,WAAW,MAAM,KAAK,eAAc;EAC1C,OAAO,aAAa,OAAO,QAAQ,SAAS,SAAQ;CACtD;CAWA,MAAM,eAAY;EAChB,MAAM,WAAW,MAAM,KAAK,eAAc;EAC1C,IAAI,CAAC,UACH,MAAM,IAAI,MACR,+KACiF;EAGrF,OAAO,SAAS,aAAY;CAC9B;CAaA,MAAM,WAAQ;EACZ,MAAM,OAAO,MAAM,KAAK,KAAI;EAC5B,OAAO;GACL,OAAO,MAAM,KAAK,SAAS,qBAAqB;GAChD,KAAK,MAAM,KAAK,SAAS,mBAAmB;EAC7C;CACH;CAGQ,MAAM,SAAS,KAAmB,QAAc;EACtD,MAAM,IAAI,MAAK;EACf,IAAI,MAAM,IAAI,WAAU,GAAI;EAE5B,MAAM,IAAI,MACR,iBAAiB,OAAM,OAAQ,MAAM,IAAI,SAAQ,EAAE,4RAGN;CAEjD;CAWQ,MAAM,MAAM,KAAY;EAC9B,OAAO,MAAM,KAAK,MAAK,EAAA,CAAI,SAAS,GAAG;CACzC;CAGQ,MAAM,QAAK;EACjB,OAAO,KAAK,WAAW,iBAAiB,CAAC,CAAA;CAC3C;CAMQ,MAAM,cAAW;EACvB,OAAO,KAAK,eAAe,iBAAiB,iBAAiB;CAC/D"}
1
+ {"version":3,"file":"ngwr-tabs-testing.mjs","names":[],"sources":["../../../projects/lib/tabs/testing/wr-tab-harness.ts","../../../projects/lib/tabs/testing/wr-tabs-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ContentContainerComponentHarness,\n type HarnessLoader,\n HarnessPredicate,\n type TestElement,\n} from '@angular/cdk/testing';\n\nimport type { WrTabHarnessFilters } from './types';\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 `routerActive()` 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 * Either strip is ONE tab stop: a content strip hands it to the selected tab, or\n * to the first enabled one while the selected tab is disabled; a router strip to\n * the tab the route selects, or to the first enabled one while no route matches.\n * See `WrTabsHarness.getTabStopLabels()`.\n *\n * `disabled` is read as well as `tabindex`, because no Tab press reaches a\n * disabled button whatever its `tabindex` says, and jsdom will focus one anyway.\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 an `<a>`, where `disabled` is\n * not a thing — it carries `aria-disabled=\"true\"` and `tabindex=\"-1\"` to stay off\n * the keyboard path, renders NO href, and the component drops the click rather\n * than routing it. So the click lands and nothing moves, which is why a router\n * strip's expectations belong 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 './types';\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 `routerActive()` that paints `--active`) and the strip renders NO\n * panel. It is still ONE tab stop — on the tab the route selects, or the first\n * enabled tab when no route matches — and Space activates a tab as Enter does.\n * The arrow keys 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 * `routerActive()` 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. A\n * DISABLED router tab is a different shape and no longer navigates: it renders\n * no href and the component drops the click, so the click lands and nothing\n * moves — 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 what breaks: both modes\n * rove a single `tabindex=\"0\"` and answer with exactly one label — the selected\n * tab, or the first enabled one while the selected tab is disabled or, in router\n * mode, while no route matches — and a router strip used to answer with every\n * enabled tab. 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 both modes; false means more than one tab is in the page tab order,\n * which is what a router strip did before it roved too. A strip whose every tab\n * is disabled has no stop at all and answers `true`: nothing to rove, and Tab\n * 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, or the first enabled one while it is\n * disabled, and the first enabled tab in a router strip. Throws when the strip\n * has no stop at all, because Tab then skips past it rather than entering it — a\n * strip whose every tab is disabled has none, and neither has 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 — every tab is disabled, or it renders ' +\n '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 '`routerActive()` 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"],"mappings":";;;;;;;AA8CA,IAAa,eAAb,MAAa,qBAAqB,iCAAgC;CAEhE,OAAO,eAAe;CAGtB,OAAO,KAAK,UAA+B,CAAA,GAAE;EAC3C,OAAO,IAAI,iBAAiB,cAAc,OAAO,CAAC,CAC/C,UAAU,SAAS,QAAQ,QAAQ,SAAS,UAAU,iBAAiB,cAAc,QAAQ,SAAQ,GAAI,KAAK,CAAC,CAAC,CAChH,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ,CAAC,CAC/G,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ;CACnH;CAGA,MAAM,WAAQ;EACZ,QAAQ,MAAM,KAAK,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: "22.2.5",
67
+ version: "22.2.6",
68
68
  ngImport: i0,
69
69
  type: WrTab,
70
70
  deps: [],
@@ -72,7 +72,7 @@ var WrTab = class WrTab {
72
72
  });
73
73
  static ɵcmp = i0.ɵɵngDeclareComponent({
74
74
  minVersion: "17.2.0",
75
- version: "22.2.5",
75
+ version: "22.2.6",
76
76
  type: WrTab,
77
77
  isStandalone: true,
78
78
  selector: "wr-tab",
@@ -125,7 +125,7 @@ var WrTab = class WrTab {
125
125
  };
126
126
  i0.ɵɵngDeclareClassMetadata({
127
127
  minVersion: "12.0.0",
128
- version: "22.2.5",
128
+ version: "22.2.6",
129
129
  ngImport: i0,
130
130
  type: WrTab,
131
131
  decorators: [{
@@ -208,6 +208,11 @@ var WrTabs = class WrTabs {
208
208
  if (tabs.length === 0) return null;
209
209
  return tabs.find((t) => t.key() === key) ?? tabs.find((t) => !t.disabled()) ?? tabs[0];
210
210
  }, ...ngDevMode ? [{ debugName: "activeTab" }] : /* istanbul ignore next */ []);
211
+ contentStop = computed(() => {
212
+ const active = this.activeTab();
213
+ if (active && !active.disabled()) return active;
214
+ return this.tabs().find((t) => !t.disabled()) ?? null;
215
+ }, ...ngDevMode ? [{ debugName: "contentStop" }] : /* istanbul ignore next */ []);
211
216
  routerStop = computed(() => {
212
217
  const enabled = this.tabs().filter((t) => !t.disabled());
213
218
  return enabled.find((t) => t.routerActive()) ?? enabled[0] ?? null;
@@ -273,8 +278,8 @@ var WrTabs = class WrTabs {
273
278
  const strip = this.stripRef()?.nativeElement;
274
279
  const focused = strip?.ownerDocument.activeElement;
275
280
  const focusedIdx = focused instanceof HTMLElement && strip?.contains(focused) ? tabs.findIndex((t) => this.headerId(t.key()) === focused.id) : -1;
276
- const active = this.activeTab();
277
- const idx = focusedIdx >= 0 ? focusedIdx : active ? tabs.indexOf(active) : -1;
281
+ const stop = this.contentStop();
282
+ const idx = focusedIdx >= 0 ? focusedIdx : stop ? tabs.indexOf(stop) : -1;
278
283
  const forward = idx < tabs.length - 1 ? idx + 1 : 0;
279
284
  const backward = idx > 0 ? idx - 1 : tabs.length - 1;
280
285
  const rtl = this.isRtl();
@@ -301,7 +306,7 @@ var WrTabs = class WrTabs {
301
306
  }
302
307
  static ɵfac = i0.ɵɵngDeclareFactory({
303
308
  minVersion: "12.0.0",
304
- version: "22.2.5",
309
+ version: "22.2.6",
305
310
  ngImport: i0,
306
311
  type: WrTabs,
307
312
  deps: [],
@@ -309,7 +314,7 @@ var WrTabs = class WrTabs {
309
314
  });
310
315
  static ɵcmp = i0.ɵɵngDeclareComponent({
311
316
  minVersion: "17.0.0",
312
- version: "22.2.5",
317
+ version: "22.2.6",
313
318
  type: WrTabs,
314
319
  isStandalone: true,
315
320
  selector: "wr-tabs",
@@ -356,7 +361,7 @@ var WrTabs = class WrTabs {
356
361
  isSignal: true
357
362
  }],
358
363
  ngImport: i0,
359
- 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() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\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",
364
+ 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() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\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 === contentStop() ? 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",
360
365
  dependencies: [{
361
366
  kind: "directive",
362
367
  type: NgTemplateOutlet,
@@ -372,7 +377,7 @@ var WrTabs = class WrTabs {
372
377
  };
373
378
  i0.ɵɵngDeclareClassMetadata({
374
379
  minVersion: "12.0.0",
375
- version: "22.2.5",
380
+ version: "22.2.6",
376
381
  ngImport: i0,
377
382
  type: WrTabs,
378
383
  decorators: [{
@@ -392,7 +397,7 @@ i0.ɵɵngDeclareClassMetadata({
392
397
  provide: WR_TABS,
393
398
  useExisting: forwardRef(() => WrTabs)
394
399
  }],
395
- 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() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\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"
400
+ 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() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\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 === contentStop() ? 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"
396
401
  }]
397
402
  }],
398
403
  ctorParameters: () => [],
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-tabs.mjs","names":[],"sources":["../../../projects/lib/tabs/tokens/tabs.token.ts","../../../projects/lib/tabs/tokens/tabs-routing.token.ts","../../../projects/lib/tabs/tab.ts","../../../projects/lib/tabs/tabs.ts","../../../projects/lib/tabs/tabs.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrTabsContext } from '../types';\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 { InjectionToken } from '@angular/core';\n\nimport type { WrTabsRoutingAdapter } from '../types';\n\n/**\n * Token a `<wr-tabs>` reads to find out whether router tabs are usable. Provided\n * by the `WrTabsRouting` directive from `ngwr/tabs/router`; absent by default,\n * which is what keeps `@angular/router` out of a content-only strip.\n */\nexport const WR_TABS_ROUTING = new InjectionToken<WrTabsRoutingAdapter>('WR_TABS_ROUTING');\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 { wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\nimport { WR_TABS, WR_TABS_ROUTING } 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. Router mode needs the\n * `WrTabsRouting` directive from `ngwr/tabs/router` in the same\n * `imports: []`; without it a strip carrying a `routerLink` throws.\n */\n@Component({\n selector: 'wr-tab',\n template: `<ng-template><ng-content /></ng-template>`,\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\n // The host is `display: none`, so the tooltip never shows — but a static\n // `title=` still lands on it. See `WrAlert` for the whole shape.\n host: { '[style.display]': \"'none'\", '[attr.title]': 'null' },\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>(wrRandomId('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 /**\n * The routing adapter published by `WrTabsRouting` on the parent `<wr-tabs>`\n * element. A `<wr-tab>` is DECLARED inside `<wr-tabs>` in the consumer's\n * template — content projection moves where it renders, not where it injects\n * — so the parent's element injector is this one's, the same walk that\n * resolves `WR_TABS` above.\n */\n private readonly routing = inject(WR_TABS_ROUTING, { optional: true });\n\n protected readonly isRouter = computed(() => this.routerLink() !== null);\n\n /**\n * Resolved href for a router tab — `null` for a content tab, and for a\n * disabled one, which is how the anchor stops navigating at all.\n * @internal\n */\n readonly routerHref = computed(() => {\n const link = this.routerLink();\n if (link === null || this.disabled()) return null;\n return this.routing?.href(link) ?? null;\n });\n\n /**\n * Whether the current route selects this tab. The strip publishes it as BOTH\n * `aria-selected` and the `--active` class, off this one read, so the\n * announced selection and the painted one cannot drift apart.\n * @internal\n */\n readonly routerActive = computed(() => {\n const link = this.routerLink();\n if (link === null || this.disabled()) return false;\n return this.routing?.isActive(link) ?? false;\n });\n\n /** Hand a click on this tab's anchor to the routing adapter. @internal */\n navigate(event: MouseEvent): void {\n const link = this.routerLink();\n if (link === null || this.disabled()) return;\n this.routing?.navigate(link, event);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('tabs');\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';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrTab } from './tab';\nimport { WR_TABS, WR_TABS_ROUTING } from './tokens';\nimport type { WrTabsContext, WrTabsSize } from './types';\n\n/**\n * Instance counter for the header / panel ids. Deterministic under prerender,\n * unlike `wrRandomId()` — 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. That mode needs the `WrTabsRouting`\n * directive from `ngwr/tabs/router` alongside `WrTabs` in `imports: []`\n * — the strip itself names no `@angular/router` symbol, which is what\n * keeps a content-only strip free of the router.\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: imports: [WrTabs, WrTab, WrTabsRouting] -->\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],\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<WrTabsSize>('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 /**\n * The routing adapter, when `WrTabsRouting` from `ngwr/tabs/router` is in the\n * consumer's `imports`. `null` is the default and the whole point: the strip\n * has no `@angular/router` import of its own, so a content-only tab strip\n * costs no router bytes.\n */\n private readonly routing = inject(WR_TABS_ROUTING, { optional: true });\n\n /**\n * When any child has a routerLink, the whole strip switches to router mode.\n *\n * Throws rather than degrading when the adapter is missing. Falling back to\n * content mode would render the tabs as `<button>`s that navigate nowhere and\n * open an empty panel — a strip that looks right and does nothing, with the\n * one missing import unnamed. The route is what selects a tab here, so there\n * is no half of this that still works.\n */\n protected readonly isRouter = computed(() => {\n const isRouter = this.tabs().some(t => t.routerLink() !== null);\n if (isRouter && !this.routing) {\n throw new Error(\n '<wr-tabs>: a <wr-tab> sets `routerLink`, but no routing adapter is provided. ' +\n \"Add `WrTabsRouting` from 'ngwr/tabs/router' to the `imports` of the component that \" +\n 'declares this strip.'\n );\n }\n return isRouter;\n });\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 // Same fallback as the seed: landing on a disabled tab leaves the strip\n // with no tab stop at all.\n return tabs.find(t => t.key() === key) ?? tabs.find(t => !t.disabled()) ?? tabs[0];\n });\n\n /**\n * Router mode: the one tab in the tab order — the tab the route selects, else\n * the first enabled one, so a URL no tab matches still leaves the strip\n * reachable. The roving stop content mode keeps; without it every router tab\n * was a Tab stop of its own.\n */\n protected readonly routerStop = computed(() => {\n const enabled = this.tabs().filter(t => !t.disabled());\n return enabled.find(t => t.routerActive()) ?? enabled[0] ?? null;\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 if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('tabs');\n // Seed `active` with the first tab's key, once the content children exist.\n // Without this the model writes back a generated id like\n // `wr-tab-b1crta5aix0v`: the strip still highlighted the right tab, because\n // `activeTab()` falls back to `tabs[0]`, so the only visible symptom was a\n // two-way binding holding a key the consumer had never heard of.\n //\n // `previousKeys` is what the last run saw. The first runs can see a `[key]`\n // binding still on its generated default — measured with keys bound inside\n // an `@for` — so \"the bound key is not among the tabs\" cannot mean \"removed\"\n // on its own: it would throw away a key the consumer bound before its tab\n // had bound its own. The same memory is what lets a seed that landed on a\n // generated default correct itself once the real keys arrive.\n let previousKeys: ReadonlySet<string> = new Set();\n effect(() => {\n const tabs = this.tabs();\n const keys = tabs.map(t => t.key());\n const key = this.active();\n // Also re-seed when the active tab LEAVES the list. `activeTab()` falls\n // back on its own, so the strip showed the fallback while `[(active)]`\n // kept the gone key: a host persisting the selection saved a tab that no\n // longer existed, and a tab later added under that key took the\n // selection back without anyone asking. A key the list has never held is\n // left alone — that is a tab still on its way, not one that went.\n const removed = key !== null && previousKeys.has(key) && !keys.includes(key);\n previousKeys = new Set(keys);\n // The first ENABLED tab, not the first tab. Every other path already\n // skips a disabled one — `onStripKeydown` filters them out and\n // `onTabClick` returns early — so a strip whose first tab is behind a\n // flag seeded `active` to a key nothing can select: the roving stop is\n // `tab === activeTab() && !tab.disabled()`, which no button then\n // satisfied, and the whole strip left the tab order.\n if (tabs.length > 0 && (key === null || removed)) {\n this.active.set((tabs.find(t => !t.disabled()) ?? tabs[0]).key());\n }\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 /**\n * Click on a router tab's anchor. The anchor carries a real `href`, so a\n * modified or middle click is left alone and the browser opens it the way it\n * opens any link; only a plain left click is turned into a navigation.\n */\n protected onRouterTabClick(tab: WrTab, event: MouseEvent): void {\n tab.navigate(event);\n }\n\n /**\n * Space on a router tab. The anchor answers Enter on its own, as a link does,\n * but `role=\"tab\"` promises Space as well (WAI-ARIA APG), and on a bare link\n * Space scrolls the page instead. Routed through a real click so the one\n * navigation path above handles both keys.\n */\n protected onRouterTabSpace(event: Event): void {\n event.preventDefault();\n (event.currentTarget as HTMLElement).click();\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() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\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"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,UAAU,IAAI,eAA8B,SAAS;;;;;;;ACDlE,MAAa,kBAAkB,IAAI,eAAqC,iBAAiB;;;;;;;AC8BzF,IAAa,QAAb,MAAa,MAAK;CAEP,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,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CAAC,gBAAgB;GAAC,WAChB,CACT;IACE,SAAS;IAET,aAAa,iBAAgB,MAAO;GACrC,CACF;GAAA,UAAA;EAAA,CAAA;CASyC,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,cAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,KAAK,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAkFkB,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-tabs.mjs","names":[],"sources":["../../../projects/lib/tabs/tokens/tabs.token.ts","../../../projects/lib/tabs/tokens/tabs-routing.token.ts","../../../projects/lib/tabs/tab.ts","../../../projects/lib/tabs/tabs.ts","../../../projects/lib/tabs/tabs.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { InjectionToken } from '@angular/core';\n\nimport type { WrTabsContext } from '../types';\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 { InjectionToken } from '@angular/core';\n\nimport type { WrTabsRoutingAdapter } from '../types';\n\n/**\n * Token a `<wr-tabs>` reads to find out whether router tabs are usable. Provided\n * by the `WrTabsRouting` directive from `ngwr/tabs/router`; absent by default,\n * which is what keeps `@angular/router` out of a content-only strip.\n */\nexport const WR_TABS_ROUTING = new InjectionToken<WrTabsRoutingAdapter>('WR_TABS_ROUTING');\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 { wrRandomId, wrCheckStyles } from 'ngwr/utils';\n\nimport { WR_TABS, WR_TABS_ROUTING } 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. Router mode needs the\n * `WrTabsRouting` directive from `ngwr/tabs/router` in the same\n * `imports: []`; without it a strip carrying a `routerLink` throws.\n */\n@Component({\n selector: 'wr-tab',\n template: `<ng-template><ng-content /></ng-template>`,\n encapsulation: ViewEncapsulation.None,\n // A BOUND display rather than a static `style` attribute: Angular writes a\n // binding through `style.setProperty`, which no CSP governs, while a real\n // `style=\"…\"` attribute is refused under `style-src 'self'` — and this host\n // would then lay out an empty box in the middle of the content.\n // The host is `display: none`, so the tooltip never shows — but a static\n // `title=` still lands on it. See `WrAlert` for the whole shape.\n host: { '[style.display]': \"'none'\", '[attr.title]': 'null' },\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>(wrRandomId('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 /**\n * The routing adapter published by `WrTabsRouting` on the parent `<wr-tabs>`\n * element. A `<wr-tab>` is DECLARED inside `<wr-tabs>` in the consumer's\n * template — content projection moves where it renders, not where it injects\n * — so the parent's element injector is this one's, the same walk that\n * resolves `WR_TABS` above.\n */\n private readonly routing = inject(WR_TABS_ROUTING, { optional: true });\n\n protected readonly isRouter = computed(() => this.routerLink() !== null);\n\n /**\n * Resolved href for a router tab — `null` for a content tab, and for a\n * disabled one, which is how the anchor stops navigating at all.\n * @internal\n */\n readonly routerHref = computed(() => {\n const link = this.routerLink();\n if (link === null || this.disabled()) return null;\n return this.routing?.href(link) ?? null;\n });\n\n /**\n * Whether the current route selects this tab. The strip publishes it as BOTH\n * `aria-selected` and the `--active` class, off this one read, so the\n * announced selection and the painted one cannot drift apart.\n * @internal\n */\n readonly routerActive = computed(() => {\n const link = this.routerLink();\n if (link === null || this.disabled()) return false;\n return this.routing?.isActive(link) ?? false;\n });\n\n /** Hand a click on this tab's anchor to the routing adapter. @internal */\n navigate(event: MouseEvent): void {\n const link = this.routerLink();\n if (link === null || this.disabled()) return;\n this.routing?.navigate(link, event);\n }\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('tabs');\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';\n\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrTab } from './tab';\nimport { WR_TABS, WR_TABS_ROUTING } from './tokens';\nimport type { WrTabsContext, WrTabsSize } from './types';\n\n/**\n * Instance counter for the header / panel ids. Deterministic under prerender,\n * unlike `wrRandomId()` — 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. That mode needs the `WrTabsRouting`\n * directive from `ngwr/tabs/router` alongside `WrTabs` in `imports: []`\n * — the strip itself names no `@angular/router` symbol, which is what\n * keeps a content-only strip free of the router.\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: imports: [WrTabs, WrTab, WrTabsRouting] -->\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],\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<WrTabsSize>('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 /**\n * The routing adapter, when `WrTabsRouting` from `ngwr/tabs/router` is in the\n * consumer's `imports`. `null` is the default and the whole point: the strip\n * has no `@angular/router` import of its own, so a content-only tab strip\n * costs no router bytes.\n */\n private readonly routing = inject(WR_TABS_ROUTING, { optional: true });\n\n /**\n * When any child has a routerLink, the whole strip switches to router mode.\n *\n * Throws rather than degrading when the adapter is missing. Falling back to\n * content mode would render the tabs as `<button>`s that navigate nowhere and\n * open an empty panel — a strip that looks right and does nothing, with the\n * one missing import unnamed. The route is what selects a tab here, so there\n * is no half of this that still works.\n */\n protected readonly isRouter = computed(() => {\n const isRouter = this.tabs().some(t => t.routerLink() !== null);\n if (isRouter && !this.routing) {\n throw new Error(\n '<wr-tabs>: a <wr-tab> sets `routerLink`, but no routing adapter is provided. ' +\n \"Add `WrTabsRouting` from 'ngwr/tabs/router' to the `imports` of the component that \" +\n 'declares this strip.'\n );\n }\n return isRouter;\n });\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 // Same fallback as the seed: landing on a disabled tab leaves the strip\n // with no tab stop at all.\n return tabs.find(t => t.key() === key) ?? tabs.find(t => !t.disabled()) ?? tabs[0];\n });\n\n /**\n * Content mode: the one tab in the tab order. The active tab, or the first\n * enabled one while the active tab is disabled: its panel stays up and\n * `active` keeps its key, but a disabled button cannot hold the stop.\n */\n protected readonly contentStop = computed(() => {\n const active = this.activeTab();\n if (active && !active.disabled()) return active;\n return this.tabs().find(t => !t.disabled()) ?? null;\n });\n\n /**\n * Router mode: the one tab in the tab order — the tab the route selects, else\n * the first enabled one, so a URL no tab matches still leaves the strip\n * reachable. The roving stop content mode keeps; without it every router tab\n * was a Tab stop of its own.\n */\n protected readonly routerStop = computed(() => {\n const enabled = this.tabs().filter(t => !t.disabled());\n return enabled.find(t => t.routerActive()) ?? enabled[0] ?? null;\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 if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('tabs');\n // Seed `active` with the first tab's key, once the content children exist.\n // Without this the model writes back a generated id like\n // `wr-tab-b1crta5aix0v`: the strip still highlighted the right tab, because\n // `activeTab()` falls back to `tabs[0]`, so the only visible symptom was a\n // two-way binding holding a key the consumer had never heard of.\n //\n // `previousKeys` is what the last run saw. The first runs can see a `[key]`\n // binding still on its generated default — measured with keys bound inside\n // an `@for` — so \"the bound key is not among the tabs\" cannot mean \"removed\"\n // on its own: it would throw away a key the consumer bound before its tab\n // had bound its own. The same memory is what lets a seed that landed on a\n // generated default correct itself once the real keys arrive.\n let previousKeys: ReadonlySet<string> = new Set();\n effect(() => {\n const tabs = this.tabs();\n const keys = tabs.map(t => t.key());\n const key = this.active();\n // Also re-seed when the active tab LEAVES the list. `activeTab()` falls\n // back on its own, so the strip showed the fallback while `[(active)]`\n // kept the gone key: a host persisting the selection saved a tab that no\n // longer existed, and a tab later added under that key took the\n // selection back without anyone asking. A key the list has never held is\n // left alone — that is a tab still on its way, not one that went.\n const removed = key !== null && previousKeys.has(key) && !keys.includes(key);\n previousKeys = new Set(keys);\n // The first ENABLED tab, not the first tab. Every other path already\n // skips a disabled one — `onStripKeydown` filters them out and\n // `onTabClick` returns early — so a strip whose first tab is behind a\n // flag seeded `active` to a key nothing can select: the roving stop is\n // `tab === activeTab() && !tab.disabled()`, which no button then\n // satisfied, and the whole strip left the tab order.\n if (tabs.length > 0 && (key === null || removed)) {\n this.active.set((tabs.find(t => !t.disabled()) ?? tabs[0]).key());\n }\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 /**\n * Click on a router tab's anchor. The anchor carries a real `href`, so a\n * modified or middle click is left alone and the browser opens it the way it\n * opens any link; only a plain left click is turned into a navigation.\n */\n protected onRouterTabClick(tab: WrTab, event: MouseEvent): void {\n tab.navigate(event);\n }\n\n /**\n * Space on a router tab. The anchor answers Enter on its own, as a link does,\n * but `role=\"tab\"` promises Space as well (WAI-ARIA APG), and on a bare link\n * Space scrolls the page instead. Routed through a real click so the one\n * navigation path above handles both keys.\n */\n protected onRouterTabSpace(event: Event): void {\n event.preventDefault();\n (event.currentTarget as HTMLElement).click();\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 stop = this.contentStop();\n const idx = focusedIdx >= 0 ? focusedIdx : stop ? tabs.indexOf(stop) : -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() !== null) {\n <!--\n `aria-selected` and `--active` come off the SAME `tab.routerActive()`, so the\n announced state and the painted one can never disagree. Without it a\n `role=\"tablist\"` shipped with no tab selected in any of them: the route decides\n here, and the class it paints is invisible to assistive tech.\n\n A real `href` rather than a `[routerLink]`: the directive would drag\n `@angular/router` into every content-only strip as well (see `WR_TABS_ROUTING`).\n The href, the active match and the click all come from the adapter the\n `ngwr/tabs/router` directive publishes, which is `RouterLink` doing the work.\n -->\n <a\n class=\"wr-tabs__tab\"\n role=\"tab\"\n [attr.id]=\"headerId(tab.key())\"\n [attr.href]=\"tab.routerHref()\"\n [class.wr-tabs__tab--active]=\"tab.routerActive()\"\n [class.wr-tabs__tab--disabled]=\"tab.disabled()\"\n [attr.aria-disabled]=\"tab.disabled() ? true : null\"\n [attr.aria-selected]=\"tab.routerActive()\"\n [attr.tabindex]=\"tab === routerStop() ? 0 : -1\"\n (click)=\"onRouterTabClick(tab, $event)\"\n (keydown.space)=\"onRouterTabSpace($event)\"\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 === contentStop() ? 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"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,UAAU,IAAI,eAA8B,SAAS;;;;;;;ACDlE,MAAa,kBAAkB,IAAI,eAAqC,iBAAiB;;;;;;;AC8BzF,IAAa,QAAb,MAAa,MAAK;CAEP,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAMhC,MAAM,MAAc,WAAW,QAAQ,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,MAAA,CAAA,+BAAA,CAAA,CAAA;CAGzC,aAAa,MAAyC,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAG3D,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAqB,CAAA;CAG1D,aAAa,UAAU,SAAS,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CAEpC,SAAS,OAAO,SAAS,EAAE,UAAU,KAAI,CAAE;CAC3C,aAAa,OAAO,UAAU;CAS9B,UAAU,OAAO,iBAAiB,EAAE,UAAU,KAAI,CAAE;CAElD,WAAW,eAAe,KAAK,WAAU,MAAO,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAO/D,aAAa,eAAc;EAClC,MAAM,OAAO,KAAK,WAAU;EAC5B,IAAI,SAA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GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,KAAK,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CA6FkB,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -28,6 +28,17 @@ var WrTextareaHarness = class WrTextareaHarness extends ComponentHarness {
28
28
  async clear() {
29
29
  await (await this.assertWritable("clear")).clear();
30
30
  }
31
+ async hasClearButton() {
32
+ return await this.locatorForOptional(".wr-textarea__clear")() !== null;
33
+ }
34
+ async clickClear() {
35
+ const button = await this.locatorForOptional(".wr-textarea__clear")();
36
+ if (!button) throw new Error("WrTextareaHarness.clickClear(): no clear button. It shows on a `clearable` textarea that has text and is neither disabled nor read-only.");
37
+ await button.click();
38
+ }
39
+ async isLoading() {
40
+ return await this.locatorForOptional(".wr-textarea__spinner")() !== null;
41
+ }
31
42
  async getPlaceholder() {
32
43
  return (await this.native()).getProperty("placeholder");
33
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-textarea-testing.mjs","names":[],"sources":["../../../projects/lib/textarea/testing/wr-textarea-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrTextareaResize, WrTextareaSize } from 'ngwr/textarea';\n\nimport type { WrTextareaHarnessFilters } from './types';\n\n/** Sizes that earn a modifier class — `md` is the default and carries none. */\nconst SIZES: readonly WrTextareaSize[] = ['sm', 'lg'];\n\n/** Directions the corner grip can advertise. It never renders for `none`. */\nconst RESIZE_DIRECTIONS: readonly WrTextareaResize[] = ['vertical', 'horizontal', 'both'];\n\n/**\n * Test harness for `<wr-textarea>` — the multi-line COMPONENT.\n *\n * Not to be confused with `WrInputHarness` (`ngwr/input/testing`), which drives\n * `[wrInput]` — the directive form, applied to a real `<textarea>` the consumer\n * wrote themselves. Pick by the markup: `<wr-textarea …>` is this harness,\n * `<textarea wrInput>` is that one. They are not interchangeable, because here\n * the native element is INSIDE the component: the value, the name and every\n * native state below are read off `.wr-textarea__native` (the host carries only\n * the `wr-textarea--*` modifiers), and the accessible name has to be forwarded\n * onto it — a `<label for>` in the consumer's template cannot reach inside.\n *\n * Two things this deliberately does NOT offer:\n *\n * - **A character counter or `maxlength`.** `<wr-textarea>` has neither — it\n * forwards only `placeholder`, `rows`, `readonly`, `disabled`, `value` and the\n * resolved `aria-label` to the native element, so there is no counter to read, and a\n * `maxlength` attribute written on `<wr-textarea>` lands on the wrapper where\n * nothing consumes it. A `getMaxLength()` could only ever answer `null`, which\n * would read as \"no limit set\" rather than \"no limit possible\". Cap the text in\n * the model instead.\n * - **A height, or a grip drag.** Autosize fits from `scrollHeight`, and the grip\n * is driven by pointer coordinates. A DOM with no layout reports 0 for both, so\n * either method would answer confidently and wrongly. What survives without\n * layout is who OWNS the height ({@link hasFittedHeight}) and which direction\n * the grip advertises ({@link getResizeDirection}); the grip is also\n * `aria-hidden` and has no keyboard path, so there is no accessible route for a\n * harness to drive it down.\n *\n * @example\n * ```ts\n * const notes = await loader.getHarness(WrTextareaHarness.with({ placeholder: 'Notes' }));\n *\n * await notes.setValue('first draft');\n * expect(await notes.getValue()).toBe('first draft');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTextareaHarness extends ComponentHarness {\n static hostSelector = 'wr-textarea';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTextareaHarnessFilters = {}): HarnessPredicate<WrTextareaHarness> {\n return new HarnessPredicate(WrTextareaHarness, options)\n .addOption('value', options.value, (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value))\n .addOption('placeholder', options.placeholder, (harness, placeholder) =>\n HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder)\n )\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly native = this.locatorFor('textarea.wr-textarea__native');\n\n /**\n * The text currently in the field.\n *\n * The `value` PROPERTY, never the element's text: a `<textarea>`'s text content\n * is only its initial content, and this one is bound with `[value]`, so the\n * text content stays empty for the field's whole life no matter what is typed.\n */\n async getValue(): Promise<string> {\n return (await this.native()).getProperty<string>('value');\n }\n\n /**\n * Type a value in, the way a user would as far as the component can tell.\n *\n * No `change` is dispatched: `sendKeys` fires one `input` per character (plus the\n * key events around it), and `input` is the only value event the component\n * listens to. It hands the result out through the `value` model, so signal forms,\n * `[formField]`, `[(ngModel)]` and `[(value)]` all hear that single write.\n * `WrInputHarness` dispatches a `change` on top for the directive form; that is\n * belt-and-braces rather than a requirement, since Angular's own accessors for\n * text controls listen to `input` too.\n *\n * Throws on a disabled or read-only field — see {@link assertWritable}.\n */\n async setValue(value: string): Promise<void> {\n const native = await this.assertWritable('setValue');\n\n await native.clear();\n // `sendKeys('')` throws \"No keys have been specified\", so an empty write is\n // the clear on its own — which is exactly what emptying a field produces.\n if (value) await native.sendKeys(value);\n }\n\n /** Empty the field, dispatching the same `input` a user's last backspace would. */\n async clear(): Promise<void> {\n await (await this.assertWritable('clear')).clear();\n }\n\n /** The placeholder text, or `''` when the field has none. */\n async getPlaceholder(): Promise<string> {\n return (await this.native()).getProperty<string>('placeholder');\n }\n\n /**\n * The accessible name the field answers to, or `null` when it has none.\n *\n * Read from the native element's `aria-label`, which is the only place a name\n * can live for this component: the `<textarea>` is inside it, so a\n * `<label for>` outside cannot reach it and an `aria-label` on `<wr-textarea>`\n * names the wrapper rather than the control. The component forwards `ariaLabel`\n * and falls back to `placeholder` — and an empty placeholder is treated as no\n * name at all rather than an empty one, so this answers `null`, not `''`.\n */\n async getLabel(): Promise<string | null> {\n return (await this.native()).getAttribute('aria-label');\n }\n\n /** The visible row count (`rows`) — the field's height until autosize takes over. */\n async getRows(): Promise<number> {\n return (await this.native()).getProperty<number>('rows');\n }\n\n /** The control size. `md` is the default and earns no modifier, so a bare host IS `md`. */\n async getSize(): Promise<WrTextareaSize> {\n const host = await this.host();\n for (const size of SIZES) {\n if (await host.hasClass(`wr-textarea--${size}`)) return size;\n }\n return 'md';\n }\n\n /**\n * Whether the field refuses input.\n *\n * The native element's `disabled` property, not the host's `--disabled` class:\n * the property is what actually blocks typing and what the accessibility tree\n * reports, while the class only paints it.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.native()).getProperty<boolean>('disabled');\n }\n\n /** Whether the field shows its value but refuses edits (`readonly`). */\n async isReadonly(): Promise<boolean> {\n return (await this.native()).getProperty<boolean>('readOnly');\n }\n\n /**\n * Whether the field is marked invalid.\n *\n * The native element is checked first, because that is the element a screen\n * reader reports on — but `<wr-textarea>` forwards nothing here (it takes no\n * `ariaInvalid` input and, unlike `[wrInput]`, does not read the surrounding\n * `<wr-form-field>`), so a consumer marks the field by binding `aria-invalid`\n * on the host. Both are read for that reason, and a native `aria-invalid=\"false\"`\n * wins over the wrapper rather than falling through to it.\n */\n async isInvalid(): Promise<boolean> {\n const onNative = await (await this.native()).getAttribute('aria-invalid');\n if (onNative !== null) return onNative === 'true';\n\n return (await (await this.host()).getAttribute('aria-invalid')) === 'true';\n }\n\n /**\n * Whether the field grows with its content (`autosize`).\n *\n * Read from `wr-textarea--no-resize`, which is named for what it does to the\n * grip but is added by `autosize` and by nothing else — `[resizable]=\"false\"`\n * takes the grip away without it.\n */\n async isAutosizing(): Promise<boolean> {\n return (await this.host()).hasClass('wr-textarea--no-resize');\n }\n\n /**\n * Whether autosize currently OWNS the field's height: the inline `height` it\n * writes on the native element, and hands back when `autosize` goes off.\n *\n * The fitted number itself is not exposed — see the class docs. What is worth\n * asserting is the handover: a field left frozen at the last fitted height\n * ignores `rows` from then on, which reads as the input having done nothing.\n *\n * An inline `height` a consumer wrote themselves is indistinguishable from a\n * fitted one; pair this with {@link isAutosizing} when that matters.\n */\n async hasFittedHeight(): Promise<boolean> {\n const style = (await (await this.native()).getAttribute('style')) ?? '';\n return /(?:^|;)\\s*height\\s*:/.test(style);\n }\n\n /**\n * The direction the corner grip will drag in, or `'none'` when there is no grip\n * to drag — which is any of `[resizable]=\"false\"`, `autosize` or `disabled`.\n * {@link isAutosizing} and {@link isDisabled} tell those three apart.\n */\n async getResizeDirection(): Promise<WrTextareaResize> {\n const grip = await this.locatorForOptional('.wr-textarea__resize')();\n if (!grip) return 'none';\n\n for (const direction of RESIZE_DIRECTIONS) {\n if (await grip.hasClass(`wr-textarea__resize--${direction}`)) return direction;\n }\n\n throw new Error(\n 'WrTextareaHarness.getResizeDirection(): the grip carries no ' +\n '`wr-textarea__resize--<direction>` class. Every rendered grip sets one, so the element ' +\n 'matched is probably not an ngwr textarea grip.'\n );\n }\n\n /** Move keyboard focus onto the native element — the host itself is not focusable. */\n async focus(): Promise<void> {\n return (await this.native()).focus();\n }\n\n /** Take focus away, which is what makes the component emit `touch`. */\n async blur(): Promise<void> {\n return (await this.native()).blur();\n }\n\n async isFocused(): Promise<boolean> {\n return (await this.native()).isFocused();\n }\n\n /**\n * The native element, or a targeted failure when writing to it would prove\n * nothing.\n *\n * A browser drops every keystroke aimed at a disabled or read-only field, but a\n * DOM with no input gating accepts them and the model updates — so a harness\n * that typed anyway would hand a consumer a green spec for behaviour that\n * cannot happen in their app.\n */\n private async assertWritable(method: string): Promise<TestElement> {\n if (await this.isDisabled()) {\n throw new Error(\n `WrTextareaHarness.${method}(): the textarea is disabled, so a user could not type here. ` +\n 'Enable it first, or assert isDisabled() instead.'\n );\n }\n if (await this.isReadonly()) {\n throw new Error(\n `WrTextareaHarness.${method}(): the textarea is read-only, so a user could not type here. ` +\n 'Write through the bound model instead, or assert isReadonly().'\n );\n }\n\n return this.native();\n }\n}\n"],"mappings":";;;;;;;AAcA,MAAM,QAAmC,CAAC,MAAM,IAAI;AAGpD,MAAM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AqB,OAAM,6HACuC;EAItE,OAAO,KAAK,OAAM;CACpB"}
1
+ {"version":3,"file":"ngwr-textarea-testing.mjs","names":[],"sources":["../../../projects/lib/textarea/testing/wr-textarea-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrTextareaResize, WrTextareaSize } from 'ngwr/textarea';\n\nimport type { WrTextareaHarnessFilters } from './types';\n\n/** Sizes that earn a modifier class — `md` is the default and carries none. */\nconst SIZES: readonly WrTextareaSize[] = ['sm', 'lg'];\n\n/** Directions the corner grip can advertise. It never renders for `none`. */\nconst RESIZE_DIRECTIONS: readonly WrTextareaResize[] = ['vertical', 'horizontal', 'both'];\n\n/**\n * Test harness for `<wr-textarea>` — the multi-line COMPONENT.\n *\n * Not to be confused with `WrInputHarness` (`ngwr/input/testing`), which drives\n * `[wrInput]` — the directive form, applied to a real `<textarea>` the consumer\n * wrote themselves. Pick by the markup: `<wr-textarea …>` is this harness,\n * `<textarea wrInput>` is that one. They are not interchangeable, because here\n * the native element is INSIDE the component: the value, the name and every\n * native state below are read off `.wr-textarea__native` (the host carries only\n * the `wr-textarea--*` modifiers), and the accessible name has to be forwarded\n * onto it — a `<label for>` in the consumer's template cannot reach inside.\n *\n * Two things this deliberately does NOT offer:\n *\n * - **A character counter or `maxlength`.** `<wr-textarea>` has neither — it\n * forwards only `placeholder`, `rows`, `readonly`, `disabled`, `value` and the\n * resolved `aria-label` to the native element, so there is no counter to read, and a\n * `maxlength` attribute written on `<wr-textarea>` lands on the wrapper where\n * nothing consumes it. A `getMaxLength()` could only ever answer `null`, which\n * would read as \"no limit set\" rather than \"no limit possible\". Cap the text in\n * the model instead.\n * - **A height, or a grip drag.** Autosize fits from `scrollHeight`, and the grip\n * is driven by pointer coordinates. A DOM with no layout reports 0 for both, so\n * either method would answer confidently and wrongly. What survives without\n * layout is who OWNS the height ({@link hasFittedHeight}) and which direction\n * the grip advertises ({@link getResizeDirection}); the grip is also\n * `aria-hidden` and has no keyboard path, so there is no accessible route for a\n * harness to drive it down.\n *\n * @example\n * ```ts\n * const notes = await loader.getHarness(WrTextareaHarness.with({ placeholder: 'Notes' }));\n *\n * await notes.setValue('first draft');\n * expect(await notes.getValue()).toBe('first draft');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrTextareaHarness extends ComponentHarness {\n static hostSelector = 'wr-textarea';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrTextareaHarnessFilters = {}): HarnessPredicate<WrTextareaHarness> {\n return new HarnessPredicate(WrTextareaHarness, options)\n .addOption('value', options.value, (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value))\n .addOption('placeholder', options.placeholder, (harness, placeholder) =>\n HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder)\n )\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabel(), label))\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly native = this.locatorFor('textarea.wr-textarea__native');\n\n /**\n * The text currently in the field.\n *\n * The `value` PROPERTY, never the element's text: a `<textarea>`'s text content\n * is only its initial content, and this one is bound with `[value]`, so the\n * text content stays empty for the field's whole life no matter what is typed.\n */\n async getValue(): Promise<string> {\n return (await this.native()).getProperty<string>('value');\n }\n\n /**\n * Type a value in, the way a user would as far as the component can tell.\n *\n * No `change` is dispatched: `sendKeys` fires one `input` per character (plus the\n * key events around it), and `input` is the only value event the component\n * listens to. It hands the result out through the `value` model, so signal forms,\n * `[formField]`, `[(ngModel)]` and `[(value)]` all hear that single write.\n * `WrInputHarness` dispatches a `change` on top for the directive form; that is\n * belt-and-braces rather than a requirement, since Angular's own accessors for\n * text controls listen to `input` too.\n *\n * Throws on a disabled or read-only field — see {@link assertWritable}.\n */\n async setValue(value: string): Promise<void> {\n const native = await this.assertWritable('setValue');\n\n await native.clear();\n // `sendKeys('')` throws \"No keys have been specified\", so an empty write is\n // the clear on its own — which is exactly what emptying a field produces.\n if (value) await native.sendKeys(value);\n }\n\n /** Empty the field, dispatching the same `input` a user's last backspace would. */\n async clear(): Promise<void> {\n await (await this.assertWritable('clear')).clear();\n }\n\n /** Whether the clear (×) button is on show: `clearable`, with text, neither disabled nor read-only. */\n async hasClearButton(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-textarea__clear')()) !== null;\n }\n\n /**\n * Click the clear (×) button, which sets the value to `''` and emits `touch`.\n * {@link clear} empties the field from the keyboard instead. Throws when the\n * button is not on show.\n */\n async clickClear(): Promise<void> {\n const button = await this.locatorForOptional('.wr-textarea__clear')();\n if (!button) {\n throw new Error(\n 'WrTextareaHarness.clickClear(): no clear button. It shows on a `clearable` textarea ' +\n 'that has text and is neither disabled nor read-only.'\n );\n }\n await button.click();\n }\n\n /** Whether the textarea is drawing its `loading` spinner. */\n async isLoading(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-textarea__spinner')()) !== null;\n }\n\n /** The placeholder text, or `''` when the field has none. */\n async getPlaceholder(): Promise<string> {\n return (await this.native()).getProperty<string>('placeholder');\n }\n\n /**\n * The accessible name the field answers to, or `null` when it has none.\n *\n * Read from the native element's `aria-label`, which is the only place a name\n * can live for this component: the `<textarea>` is inside it, so a\n * `<label for>` outside cannot reach it and an `aria-label` on `<wr-textarea>`\n * names the wrapper rather than the control. The component forwards `ariaLabel`\n * and falls back to `placeholder` — and an empty placeholder is treated as no\n * name at all rather than an empty one, so this answers `null`, not `''`.\n */\n async getLabel(): Promise<string | null> {\n return (await this.native()).getAttribute('aria-label');\n }\n\n /** The visible row count (`rows`) — the field's height until autosize takes over. */\n async getRows(): Promise<number> {\n return (await this.native()).getProperty<number>('rows');\n }\n\n /** The control size. `md` is the default and earns no modifier, so a bare host IS `md`. */\n async getSize(): Promise<WrTextareaSize> {\n const host = await this.host();\n for (const size of SIZES) {\n if (await host.hasClass(`wr-textarea--${size}`)) return size;\n }\n return 'md';\n }\n\n /**\n * Whether the field refuses input.\n *\n * The native element's `disabled` property, not the host's `--disabled` class:\n * the property is what actually blocks typing and what the accessibility tree\n * reports, while the class only paints it.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.native()).getProperty<boolean>('disabled');\n }\n\n /** Whether the field shows its value but refuses edits (`readonly`). */\n async isReadonly(): Promise<boolean> {\n return (await this.native()).getProperty<boolean>('readOnly');\n }\n\n /**\n * Whether the field is marked invalid.\n *\n * The native element is checked first, because that is the element a screen\n * reader reports on — but `<wr-textarea>` forwards nothing here (it takes no\n * `ariaInvalid` input and, unlike `[wrInput]`, does not read the surrounding\n * `<wr-form-field>`), so a consumer marks the field by binding `aria-invalid`\n * on the host. Both are read for that reason, and a native `aria-invalid=\"false\"`\n * wins over the wrapper rather than falling through to it.\n */\n async isInvalid(): Promise<boolean> {\n const onNative = await (await this.native()).getAttribute('aria-invalid');\n if (onNative !== null) return onNative === 'true';\n\n return (await (await this.host()).getAttribute('aria-invalid')) === 'true';\n }\n\n /**\n * Whether the field grows with its content (`autosize`).\n *\n * Read from `wr-textarea--no-resize`, which is named for what it does to the\n * grip but is added by `autosize` and by nothing else — `[resizable]=\"false\"`\n * takes the grip away without it.\n */\n async isAutosizing(): Promise<boolean> {\n return (await this.host()).hasClass('wr-textarea--no-resize');\n }\n\n /**\n * Whether autosize currently OWNS the field's height: the inline `height` it\n * writes on the native element, and hands back when `autosize` goes off.\n *\n * The fitted number itself is not exposed — see the class docs. What is worth\n * asserting is the handover: a field left frozen at the last fitted height\n * ignores `rows` from then on, which reads as the input having done nothing.\n *\n * An inline `height` a consumer wrote themselves is indistinguishable from a\n * fitted one; pair this with {@link isAutosizing} when that matters.\n */\n async hasFittedHeight(): Promise<boolean> {\n const style = (await (await this.native()).getAttribute('style')) ?? '';\n return /(?:^|;)\\s*height\\s*:/.test(style);\n }\n\n /**\n * The direction the corner grip will drag in, or `'none'` when there is no grip\n * to drag — which is any of `[resizable]=\"false\"`, `autosize` or `disabled`.\n * {@link isAutosizing} and {@link isDisabled} tell those three apart.\n */\n async getResizeDirection(): Promise<WrTextareaResize> {\n const grip = await this.locatorForOptional('.wr-textarea__resize')();\n if (!grip) return 'none';\n\n for (const direction of RESIZE_DIRECTIONS) {\n if (await grip.hasClass(`wr-textarea__resize--${direction}`)) return direction;\n }\n\n throw new Error(\n 'WrTextareaHarness.getResizeDirection(): the grip carries no ' +\n '`wr-textarea__resize--<direction>` class. Every rendered grip sets one, so the element ' +\n 'matched is probably not an ngwr textarea grip.'\n );\n }\n\n /** Move keyboard focus onto the native element — the host itself is not focusable. */\n async focus(): Promise<void> {\n return (await this.native()).focus();\n }\n\n /** Take focus away, which is what makes the component emit `touch`. */\n async blur(): Promise<void> {\n return (await this.native()).blur();\n }\n\n async isFocused(): Promise<boolean> {\n return (await this.native()).isFocused();\n }\n\n /**\n * The native element, or a targeted failure when writing to it would prove\n * nothing.\n *\n * A browser drops every keystroke aimed at a disabled or read-only field, but a\n * DOM with no input gating accepts them and the model updates — so a harness\n * that typed anyway would hand a consumer a green spec for behaviour that\n * cannot happen in their app.\n */\n private async assertWritable(method: string): Promise<TestElement> {\n if (await this.isDisabled()) {\n throw new Error(\n `WrTextareaHarness.${method}(): the textarea is disabled, so a user could not type here. ` +\n 'Enable it first, or assert isDisabled() instead.'\n );\n }\n if (await this.isReadonly()) {\n throw new Error(\n `WrTextareaHarness.${method}(): the textarea is read-only, so a user could not type here. ` +\n 'Write through the bound model instead, or assert isReadonly().'\n );\n }\n\n return this.native();\n }\n}\n"],"mappings":";;;;;;;AAcA,MAAM,QAAmC,CAAC,MAAM,IAAI;AAGpD,MAAM,oBAAiD;CAAC;CAAY;CAAc;AAAM;AAyCxF,IAAa,oBAAb,MAAa,0BAA0B,iBAAgB;CACrD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAoC,CAAA,GAAE;EAChD,OAAO,IAAI,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