ngwr 16.3.0 → 16.5.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 (295) hide show
  1. package/carousel/styles/_index.scss +53 -1
  2. package/charts/bar-chart/styles/_index.scss +494 -305
  3. package/charts/boxplot-chart/styles/_index.scss +114 -48
  4. package/charts/bullet-chart/styles/_index.scss +113 -42
  5. package/charts/calendar-heatmap/styles/_index.scss +111 -20
  6. package/charts/candlestick-chart/styles/_index.scss +61 -26
  7. package/charts/chart-legend/styles/_index.scss +119 -1
  8. package/charts/core/styles/_index.scss +201 -5
  9. package/charts/donut-chart/styles/_index.scss +76 -21
  10. package/charts/funnel-chart/styles/_index.scss +66 -38
  11. package/charts/gauge/styles/_index.scss +12 -1
  12. package/charts/heatmap-chart/styles/_index.scss +90 -53
  13. package/charts/line-chart/styles/_index.scss +143 -139
  14. package/charts/meter-group/styles/_index.scss +87 -25
  15. package/charts/radar-chart/styles/_index.scss +82 -40
  16. package/charts/scatter-chart/styles/_index.scss +117 -44
  17. package/charts/sparkline/styles/_index.scss +7 -1
  18. package/charts/treemap-chart/styles/_index.scss +94 -42
  19. package/charts/waterfall-chart/styles/_index.scss +150 -87
  20. package/color-picker/styles/_index.scss +7 -3
  21. package/copy-value/styles/_index.scss +21 -2
  22. package/date-stamp/styles/_index.scss +2 -1
  23. package/dialog/styles/_index.scss +6 -0
  24. package/drawer/styles/_index.scss +5 -1
  25. package/fesm2022/ngwr-breadcrumbs.mjs +2 -2
  26. package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
  27. package/fesm2022/ngwr-carousel-testing.mjs +27 -1
  28. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  29. package/fesm2022/ngwr-carousel.mjs +86 -4
  30. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  31. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  32. package/fesm2022/ngwr-cascader.mjs +56 -25
  33. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  34. package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
  35. package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
  36. package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
  37. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  38. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
  39. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
  40. package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
  41. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
  42. package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
  43. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
  44. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
  45. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  46. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
  47. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
  48. package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
  49. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
  50. package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
  51. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  52. package/fesm2022/ngwr-charts-core.mjs +299 -18
  53. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  54. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  55. package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
  56. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  57. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
  58. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
  59. package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
  60. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
  61. package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
  62. package/fesm2022/ngwr-charts-gauge.mjs +98 -12
  63. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  64. package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
  65. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
  66. package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
  67. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  68. package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
  69. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  70. package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
  71. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  72. package/fesm2022/ngwr-charts-meter-group.mjs +223 -31
  73. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  74. package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
  75. package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
  76. package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
  77. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  78. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
  79. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
  80. package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
  81. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  82. package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
  83. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  84. package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
  85. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
  86. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
  87. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
  88. package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
  89. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
  90. package/fesm2022/ngwr-color-picker.mjs +44 -4
  91. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  92. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  93. package/fesm2022/ngwr-context-menu.mjs +60 -17
  94. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  95. package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
  96. package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
  97. package/fesm2022/ngwr-copy-value.mjs +38 -2
  98. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  99. package/fesm2022/ngwr-date-picker.mjs +56 -8
  100. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  101. package/fesm2022/ngwr-dialog.mjs +13 -5
  102. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  103. package/fesm2022/ngwr-drawer.mjs +19 -3
  104. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  105. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  106. package/fesm2022/ngwr-dropdown.mjs +49 -6
  107. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  108. package/fesm2022/ngwr-editor.mjs +1 -0
  109. package/fesm2022/ngwr-editor.mjs.map +1 -1
  110. package/fesm2022/ngwr-file-upload.mjs +7 -3
  111. package/fesm2022/ngwr-file-upload.mjs.map +1 -1
  112. package/fesm2022/ngwr-graph-testing.mjs +27 -0
  113. package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
  114. package/fesm2022/ngwr-graph.mjs +643 -14
  115. package/fesm2022/ngwr-graph.mjs.map +1 -1
  116. package/fesm2022/ngwr-i18n-ar.mjs +13 -4
  117. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  118. package/fesm2022/ngwr-i18n-cs.mjs +13 -4
  119. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  120. package/fesm2022/ngwr-i18n-de.mjs +13 -4
  121. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  122. package/fesm2022/ngwr-i18n-en.mjs +13 -4
  123. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  124. package/fesm2022/ngwr-i18n-es.mjs +13 -4
  125. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  126. package/fesm2022/ngwr-i18n-fr.mjs +13 -4
  127. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  128. package/fesm2022/ngwr-i18n-he.mjs +13 -4
  129. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  130. package/fesm2022/ngwr-i18n-hi.mjs +13 -4
  131. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  132. package/fesm2022/ngwr-i18n-id.mjs +13 -4
  133. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  134. package/fesm2022/ngwr-i18n-it.mjs +13 -4
  135. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  136. package/fesm2022/ngwr-i18n-ja.mjs +13 -4
  137. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  138. package/fesm2022/ngwr-i18n-ko.mjs +13 -4
  139. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  140. package/fesm2022/ngwr-i18n-nl.mjs +13 -4
  141. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  142. package/fesm2022/ngwr-i18n-pl.mjs +13 -4
  143. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  144. package/fesm2022/ngwr-i18n-pt.mjs +13 -4
  145. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  146. package/fesm2022/ngwr-i18n-ru.mjs +13 -4
  147. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  148. package/fesm2022/ngwr-i18n-sv.mjs +13 -4
  149. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  150. package/fesm2022/ngwr-i18n-tr.mjs +13 -4
  151. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  152. package/fesm2022/ngwr-i18n-uk.mjs +13 -4
  153. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  154. package/fesm2022/ngwr-i18n-vi.mjs +13 -4
  155. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  156. package/fesm2022/ngwr-i18n-zh-tw.mjs +13 -4
  157. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  158. package/fesm2022/ngwr-i18n-zh.mjs +13 -4
  159. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  160. package/fesm2022/ngwr-lightbox.mjs +22 -5
  161. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  162. package/fesm2022/ngwr-list.mjs +2 -2
  163. package/fesm2022/ngwr-list.mjs.map +1 -1
  164. package/fesm2022/ngwr-overlay.mjs +21 -2
  165. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  166. package/fesm2022/ngwr-pagination.mjs +1 -0
  167. package/fesm2022/ngwr-pagination.mjs.map +1 -1
  168. package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
  169. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  170. package/fesm2022/ngwr-popconfirm.mjs +41 -5
  171. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  172. package/fesm2022/ngwr-popover.mjs +67 -12
  173. package/fesm2022/ngwr-popover.mjs.map +1 -1
  174. package/fesm2022/ngwr-schema-form.mjs +3 -0
  175. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  176. package/fesm2022/ngwr-select.mjs +100 -3
  177. package/fesm2022/ngwr-select.mjs.map +1 -1
  178. package/fesm2022/ngwr-sortable-list.mjs +2 -2
  179. package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
  180. package/fesm2022/ngwr-table-testing.mjs +71 -3
  181. package/fesm2022/ngwr-table-testing.mjs.map +1 -1
  182. package/fesm2022/ngwr-table.mjs +173 -11
  183. package/fesm2022/ngwr-table.mjs.map +1 -1
  184. package/fesm2022/ngwr-tour-testing.mjs +13 -1
  185. package/fesm2022/ngwr-tour-testing.mjs.map +1 -1
  186. package/fesm2022/ngwr-tour.mjs +25 -16
  187. package/fesm2022/ngwr-tour.mjs.map +1 -1
  188. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  189. package/fesm2022/ngwr-tree.mjs +52 -8
  190. package/fesm2022/ngwr-tree.mjs.map +1 -1
  191. package/fesm2022/ngwr-utils.mjs +64 -1
  192. package/fesm2022/ngwr-utils.mjs.map +1 -1
  193. package/fesm2022/ngwr-version.mjs +1 -1
  194. package/fesm2022/ngwr-version.mjs.map +1 -1
  195. package/fesm2022/ngwr-window.mjs +16 -9
  196. package/fesm2022/ngwr-window.mjs.map +1 -1
  197. package/graph/styles/_index.scss +87 -0
  198. package/i18n/ar.json +13 -4
  199. package/i18n/cs.json +13 -4
  200. package/i18n/de.json +13 -4
  201. package/i18n/en.json +13 -4
  202. package/i18n/es.json +13 -4
  203. package/i18n/fr.json +13 -4
  204. package/i18n/he.json +13 -4
  205. package/i18n/hi.json +13 -4
  206. package/i18n/id.json +13 -4
  207. package/i18n/it.json +13 -4
  208. package/i18n/ja.json +13 -4
  209. package/i18n/ko.json +13 -4
  210. package/i18n/nl.json +13 -4
  211. package/i18n/pl.json +13 -4
  212. package/i18n/pt.json +13 -4
  213. package/i18n/ru.json +13 -4
  214. package/i18n/sv.json +13 -4
  215. package/i18n/tr.json +13 -4
  216. package/i18n/uk.json +13 -4
  217. package/i18n/vi.json +13 -4
  218. package/i18n/zh-TW.json +13 -4
  219. package/i18n/zh.json +13 -4
  220. package/llms-full.txt +12 -12
  221. package/llms.txt +64 -27
  222. package/package.json +1 -1
  223. package/popconfirm/styles/_index.scss +6 -0
  224. package/popover/styles/_index.scss +24 -13
  225. package/schematics/collection.json +5 -0
  226. package/schematics/eject/index.js +158 -0
  227. package/schematics/eject/schema.js +8 -0
  228. package/schematics/eject/schema.json +24 -0
  229. package/schematics/eject/source.js +295 -0
  230. package/schematics/use/symbol-map.json +2 -0
  231. package/select/styles/_index.scss +13 -0
  232. package/skills/ngwr/SKILL.md +30 -3
  233. package/skills/ngwr/references/catalog.md +2 -2
  234. package/table/styles/_index.scss +24 -0
  235. package/theme/styles/_focus.scss +11 -1
  236. package/tour/styles/_index.scss +6 -0
  237. package/types/ngwr-carousel-testing.d.ts +29 -6
  238. package/types/ngwr-carousel.d.ts +52 -5
  239. package/types/ngwr-cascader-testing.d.ts +4 -3
  240. package/types/ngwr-cascader.d.ts +29 -7
  241. package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
  242. package/types/ngwr-charts-bar-chart.d.ts +220 -48
  243. package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
  244. package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
  245. package/types/ngwr-charts-bullet-chart.d.ts +72 -12
  246. package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
  247. package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
  248. package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
  249. package/types/ngwr-charts-chart-legend.d.ts +142 -5
  250. package/types/ngwr-charts-core.d.ts +259 -21
  251. package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
  252. package/types/ngwr-charts-donut-chart.d.ts +124 -16
  253. package/types/ngwr-charts-funnel-chart.d.ts +62 -6
  254. package/types/ngwr-charts-gauge-testing.d.ts +5 -1
  255. package/types/ngwr-charts-gauge.d.ts +72 -10
  256. package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
  257. package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
  258. package/types/ngwr-charts-line-chart.d.ts +215 -86
  259. package/types/ngwr-charts-meter-group.d.ts +96 -7
  260. package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
  261. package/types/ngwr-charts-radar-chart.d.ts +148 -28
  262. package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
  263. package/types/ngwr-charts-scatter-chart.d.ts +188 -18
  264. package/types/ngwr-charts-sparkline.d.ts +26 -4
  265. package/types/ngwr-charts-treemap-chart.d.ts +121 -23
  266. package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
  267. package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
  268. package/types/ngwr-color-picker.d.ts +27 -0
  269. package/types/ngwr-context-menu-testing.d.ts +10 -9
  270. package/types/ngwr-context-menu.d.ts +19 -0
  271. package/types/ngwr-copy-value.d.ts +8 -0
  272. package/types/ngwr-date-picker.d.ts +34 -2
  273. package/types/ngwr-dialog.d.ts +30 -10
  274. package/types/ngwr-drawer.d.ts +32 -1
  275. package/types/ngwr-dropdown-testing.d.ts +8 -5
  276. package/types/ngwr-dropdown.d.ts +31 -6
  277. package/types/ngwr-file-upload.d.ts +8 -2
  278. package/types/ngwr-graph-testing.d.ts +28 -0
  279. package/types/ngwr-graph.d.ts +263 -91
  280. package/types/ngwr-lightbox.d.ts +15 -0
  281. package/types/ngwr-overlay.d.ts +16 -1
  282. package/types/ngwr-popconfirm-testing.d.ts +11 -2
  283. package/types/ngwr-popconfirm.d.ts +28 -1
  284. package/types/ngwr-popover.d.ts +59 -9
  285. package/types/ngwr-select.d.ts +37 -0
  286. package/types/ngwr-table-testing.d.ts +52 -1
  287. package/types/ngwr-table.d.ts +102 -10
  288. package/types/ngwr-tour-testing.d.ts +10 -0
  289. package/types/ngwr-tour.d.ts +32 -4
  290. package/types/ngwr-tree-testing.d.ts +1 -2
  291. package/types/ngwr-tree.d.ts +35 -2
  292. package/types/ngwr-utils.d.ts +79 -1
  293. package/types/ngwr-version.d.ts +1 -1
  294. package/types/ngwr-window.d.ts +14 -11
  295. package/window/styles/_index.scss +5 -10
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-carousel.mjs","names":[],"sources":["../../../projects/lib/carousel/tokens/carousel.token.ts","../../../projects/lib/carousel/carousel-slide.ts","../../../projects/lib/carousel/carousel.ts","../../../projects/lib/carousel/carousel.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 { WrCarouselContext } from '../types';\n\n/** Token a `<wr-carousel-slide>` injects to find its parent `<wr-carousel>`. */\nexport const WR_CAROUSEL = new InjectionToken<WrCarouselContext>('WR_CAROUSEL');\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 { Component, ViewEncapsulation, computed, inject, input } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WR_CAROUSEL } from './tokens';\n\n/**\n * One slide in a {@link WrCarousel}. Holds whatever content you\n * project — image, card, video, anything.\n *\n * **An off-screen slide is `inert`.** Only one slide is visible, but the track\n * merely translates the others out of view: without this they stay in the tab\n * order and in the accessibility tree, so a keyboard user tabs into a link they\n * cannot see and a screen reader announces every slide as if they were all on\n * screen. `inert` takes the whole subtree out of both at once, which is why it\n * is preferred here over `tabindex=\"-1\"` (which reaches only the host) — the\n * same answer `wr-collapse` uses.\n *\n * `aria-hidden` rides along: it states the intent for anything reading the attribute\n * rather than honouring `inert`.\n */\n@Component({\n selector: 'wr-carousel-slide',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-carousel-slide',\n role: 'group',\n '[attr.aria-roledescription]': 'resolvedRoledescription()',\n '[attr.inert]': 'offScreen() ? \"\" : null',\n '[attr.aria-hidden]': 'offScreen() ? \"true\" : null',\n },\n})\nexport class WrCarouselSlide {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('carousel');\n }\n\n private readonly carousel = inject(WR_CAROUSEL, { optional: true });\n\n /**\n * Word a screen reader speaks IN PLACE OF the `group` role. Falls back to\n * `carousel.slideRoledescription`, then `'slide'`.\n */\n readonly roledescription = input<string | null>(null);\n\n // Spoken verbatim, and only the off-screen slides are `inert` — so the visible\n // one announced an English \"slide\" inside an otherwise localized carousel.\n protected readonly resolvedRoledescription = useI18nText(\n this.roledescription,\n 'carousel.slideRoledescription',\n 'slide'\n );\n\n /**\n * Whether this slide is one of the ones translated out of view.\n *\n * `false` while the index is `-1`: content children resolve after the first\n * render, and a slide that hid itself in that window would make the carousel\n * open with everything inert. `false` too when there is no parent — the\n * component is exported, so it can be used on its own.\n */\n protected readonly offScreen = computed(() => {\n if (!this.carousel) return false;\n const index = this.carousel.indexOf(this);\n return index >= 0 && index !== this.carousel.active();\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 { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n ViewEncapsulation,\n computed,\n contentChildren,\n forwardRef,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrCarouselSlide } from './carousel-slide';\nimport { WR_CAROUSEL } from './tokens';\nimport type { WrCarouselContext } from './types';\n\n/**\n * How far a touch travels before the carousel decides whether it is a swipe or a\n * scroll — the usual touch slop, so a finger's first wobble decides nothing.\n */\nconst SWIPE_SLOP = 10;\n\n/**\n * Slide carousel. Project `<wr-carousel-slide>` children — the carousel\n * snaps between them with prev/next buttons and optional dots / autoplay.\n *\n * @example\n * ```html\n * <wr-carousel [(active)]=\"i\" autoplay>\n * <wr-carousel-slide><img src=\"a.jpg\" /></wr-carousel-slide>\n * <wr-carousel-slide><img src=\"b.jpg\" /></wr-carousel-slide>\n * <wr-carousel-slide><img src=\"c.jpg\" /></wr-carousel-slide>\n * </wr-carousel>\n * ```\n *\n * @see https://ngwr.dev/reference/components/carousel\n */\n@Component({\n selector: 'wr-carousel',\n templateUrl: './carousel.html',\n encapsulation: ViewEncapsulation.None,\n // On the HOST, not the viewport: the arrows and dots are the viewport's siblings, so\n // viewport-scoped listeners let a slide change under a cursor aiming at an arrow.\n // `focusin` / `focusout` are the keyboard half — WCAG 2.2.2 wants a way to stop\n // moving content, and hovering is not one for someone who never uses a mouse.\n host: {\n class: 'wr-carousel',\n '(mouseenter)': 'onHoverIn()',\n '(mouseleave)': 'onHoverOut()',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onFocusOut()',\n },\n providers: [\n {\n provide: WR_CAROUSEL,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrCarousel),\n },\n ],\n})\nexport class WrCarousel implements WrCarouselContext {\n /** Accessible name of the previous-slide button. Falls back to `carousel.prev`. */\n readonly prevLabel = input<string | null>(null);\n\n /** Accessible name of the next-slide button. Falls back to `carousel.next`. */\n readonly nextLabel = input<string | null>(null);\n\n /** Accessible name of the dot group. Falls back to `carousel.pagination`. */\n readonly paginationLabel = input<string | null>(null);\n\n protected readonly resolvedPrevLabel = useI18nText(this.prevLabel, 'carousel.prev', 'Previous slide');\n protected readonly resolvedNextLabel = useI18nText(this.nextLabel, 'carousel.next', 'Next slide');\n protected readonly resolvedPaginationLabel = useI18nText(\n this.paginationLabel,\n 'carousel.pagination',\n 'Carousel pagination'\n );\n\n /** Accessible name of the carousel itself. Falls back to `carousel.label`. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'carousel.label', 'Carousel');\n\n /**\n * Word a screen reader speaks IN PLACE OF the `group` role. Falls back to\n * `carousel.roledescription`, then `'carousel'`.\n */\n readonly roledescription = input<string | null>(null);\n\n // Routed for the same reason the name above is: `aria-roledescription` is spoken\n // verbatim, so a static English \"carousel\" made the viewport announce\n // \"Карусель, carousel\" with the localized arrows right beside it.\n protected readonly resolvedRoledescription = useI18nText(\n this.roledescription,\n 'carousel.roledescription',\n 'carousel'\n );\n\n // The three labels above route through the catalog; this one was a hard-coded\n // English template, so a localized app got two languages in one pagination strip.\n protected readonly slideLabel = useI18nFormatter('carousel.goToSlide', 'Go to slide {{index}}');\n\n /** Active slide index. Two-way bindable. @default 0 */\n readonly active = model(0);\n\n /** Show prev / next arrow buttons. @default true */\n readonly showArrows = input(true, { transform: coerceBooleanProperty });\n\n /** Show dot indicators below the slides. @default true */\n readonly showDots = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Auto-advance slides. Held while the pointer or keyboard focus is inside the\n * carousel and during a swipe, and does not run at all while the reader prefers\n * reduced motion — followed live, so turning the setting on mid-session stops\n * the slides and turning it off starts them. @default false\n */\n readonly autoplay = input(false, { transform: coerceBooleanProperty });\n\n /** Autoplay interval (ms). @default 4000 */\n readonly intervalMs = input(4000, {\n transform: (v: unknown): number => Math.max(500, coerceNumberProperty(v, 4000)),\n });\n\n /** Wrap around at the ends. @default true */\n readonly loop = input(true, { transform: coerceBooleanProperty });\n\n protected readonly slides = contentChildren(WrCarouselSlide);\n protected readonly count = computed(() => this.slides().length);\n\n /**\n * Whether an arrow has nowhere to go: only without `loop`, at the matching end.\n * The arrows used to stay enabled there and do nothing — announced, focusable\n * and clickable controls with no effect. Native `disabled`, the way\n * `wr-pagination` stops its own previous / next at the ends.\n */\n protected readonly atStart = computed(() => !this.loop() && this.active() <= 0);\n protected readonly atEnd = computed(() => !this.loop() && this.active() >= this.count() - 1);\n\n /**\n * Where a slide sits in projection order — {@link WrCarouselContext}.\n *\n * Public only because the child injects the parent through `WR_CAROUSEL`;\n * reading `slides()` here is what makes the child's `computed()` re-run when a\n * slide is added or removed.\n */\n indexOf(slide: object): number {\n return this.slides().indexOf(slide as WrCarouselSlide);\n }\n\n /** Live horizontal drag offset (px) during a touch swipe. */\n protected readonly dragX = signal(0);\n protected readonly dragging = signal(false);\n\n private readonly dir = inject(Directionality, { optional: true });\n\n /**\n * Reading direction of the track. `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 `trackStyle` re-renders instead\n * of leaving the track parked on the old side.\n */\n private readonly isRtl = computed(() => this.dir?.valueSignal() === 'rtl');\n\n /** CSS transform for the track — the per-slide offset plus any live drag. */\n protected readonly trackStyle = computed(() => {\n // `translateX` is PHYSICAL while the slides are laid out on the inline axis:\n // under `dir=\"rtl\"` the flex track runs right-to-left, so slide 1 sits to the\n // LEFT of slide 0 and reaching it means moving the track the other way. Left\n // unsigned, every RTL carousel translated itself off into blank space.\n const base = (this.isRtl() ? 1 : -1) * this.active() * 100;\n // The drag stays physical on purpose: it is the finger's own displacement,\n // and the track follows the finger in both directions.\n const drag = this.dragX();\n return drag === 0 ? `translateX(${base}%)` : `translateX(calc(${base}% + ${drag}px))`;\n });\n\n private timer: ReturnType<typeof setInterval> | null = null;\n\n // Three sources hold the pause and they release independently, so they get a\n // flag each rather than one shared boolean — the same `hovered` / `focusWithin`\n // pair `WrToastHost` keeps. With one flag whichever source released LAST won:\n // moving the pointer off the carousel while focus was still on a link inside it\n // restarted the slides under the focused element, and a `touchend` released a\n // pause it had never taken. Flags, not a counter: `mouseenter`/`mouseleave` and\n // `focusin`/`focusout` each pair exactly once per source, so a count would only\n // add a way to drift out of step.\n private readonly hovered = signal(false);\n private readonly focusWithin = signal(false);\n private readonly paused = computed(() => this.hovered() || this.focusWithin() || this.dragging());\n\n /**\n * Autoplay is motion the reader did not start, which is exactly what\n * `prefers-reduced-motion` asks a page to drop: the stylesheet already switches\n * slides in place under it, and a panel that still changed every four seconds\n * was the half that stylesheet cannot reach. A signal, so the preference is\n * followed while the page is open. There is no play control to restart it, so\n * the arrows and dots are how a reader with the preference on pages through.\n */\n private readonly reducedMotion = inject(WrPlatform).prefersReducedMotion;\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('carousel');\n effect(() => {\n if (this.timer) clearInterval(this.timer);\n this.timer = null;\n // `isBrowser` first: without it the prerender ran the timer too, doing work\n // nobody will ever see on a slide index that then gets serialized.\n if (!this.isBrowser || !this.autoplay() || this.paused() || this.reducedMotion() || this.count() < 2) return;\n const interval = this.intervalMs();\n this.timer = setInterval(() => this.next(), interval);\n });\n\n // `active` is a plain `model`, so `[(active)]` and a shrinking slide list both\n // write into it unchecked — a filtered list left it pointing past the end,\n // translating the track into blank space with no dot lit.\n effect(() => {\n const max = this.count() - 1;\n if (max < 0) return;\n const clamped = Math.min(Math.max(0, this.active()), max);\n if (clamped !== this.active()) this.active.set(clamped);\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.timer) clearInterval(this.timer);\n });\n }\n\n protected onHoverIn(): void {\n this.hovered.set(true);\n }\n\n protected onHoverOut(): void {\n this.hovered.set(false);\n }\n\n protected onFocusIn(): void {\n this.focusWithin.set(true);\n }\n\n protected onFocusOut(): void {\n this.focusWithin.set(false);\n }\n\n // Imperative\n\n goTo(index: number): void {\n const max = this.count() - 1;\n if (max < 0) return;\n if (this.loop()) {\n const next = ((index % this.count()) + this.count()) % this.count();\n this.active.set(next);\n } else {\n this.active.set(Math.min(Math.max(0, index), max));\n }\n }\n\n next(): void {\n this.goTo(this.active() + 1);\n }\n\n prev(): void {\n this.goTo(this.active() - 1);\n }\n\n // Swipe navigation — the track follows the finger; releasing past ~20% of the\n // viewport advances a slide, otherwise snaps back. Which way that is follows\n // the reading direction: dragging toward the inline start (left in LTR, right\n // in RTL) pulls the next slide into view.\n\n private swipeStartX = 0;\n private swipeStartY = 0;\n\n /**\n * Which way the finger is going, decided once it has moved {@link SWIPE_SLOP}\n * px: `'x'` is a swipe, `'y'` a page scroll that happened to start on a slide.\n * Without the lock every vertical scroll that drifted sideways dragged the\n * track along and, past 20% of the width, changed the slide under it.\n */\n private swipeAxis: 'x' | 'y' | null = null;\n\n protected onSwipeStart(event: TouchEvent): void {\n const touch = event.touches[0];\n if (!touch) return;\n this.swipeStartX = touch.clientX;\n this.swipeStartY = touch.clientY;\n this.swipeAxis = null;\n this.dragging.set(true); // holds autoplay on its own — `paused` reads it\n }\n\n protected onSwipeMove(event: TouchEvent): void {\n if (!this.dragging()) return;\n const touch = event.touches[0];\n if (!touch) return;\n const dx = touch.clientX - this.swipeStartX;\n const dy = touch.clientY - this.swipeStartY;\n if (this.swipeAxis === null) {\n if (Math.abs(dx) < SWIPE_SLOP && Math.abs(dy) < SWIPE_SLOP) return;\n this.swipeAxis = Math.abs(dx) > Math.abs(dy) ? 'x' : 'y';\n }\n if (this.swipeAxis === 'x') this.dragX.set(dx);\n }\n\n protected onSwipeEnd(event: TouchEvent, viewport: HTMLElement): void {\n if (!this.dragging()) return;\n this.dragging.set(false);\n const dx = this.swipeAxis === 'x' ? this.dragX() : 0;\n this.swipeAxis = null;\n this.dragX.set(0);\n const threshold = (viewport.offsetWidth || 0) * 0.2;\n // `dx` is a physical delta. The next slide sits to the physical RIGHT in LTR\n // and to the LEFT in RTL, so the drag that pulls it into view — and with it\n // the sign that advances — turns around with the direction. The buttons keep\n // their semantics either way; only the gesture is physical.\n const advance = this.isRtl() ? dx >= threshold : dx <= -threshold;\n const retreat = this.isRtl() ? dx <= -threshold : dx >= threshold;\n if (advance) this.next();\n else if (retreat) this.prev();\n }\n}\n","<div\n #viewport\n class=\"wr-carousel__viewport\"\n role=\"group\"\n [attr.aria-roledescription]=\"resolvedRoledescription()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (touchstart)=\"onSwipeStart($event)\"\n (touchmove)=\"onSwipeMove($event)\"\n (touchend)=\"onSwipeEnd($event, viewport)\"\n (touchcancel)=\"onSwipeEnd($event, viewport)\"\n>\n <div class=\"wr-carousel__track\" [style.transform]=\"trackStyle()\" [style.transition]=\"dragging() ? 'none' : null\">\n <ng-content />\n </div>\n</div>\n\n@if (showArrows() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--prev\"\n [attr.aria-label]=\"resolvedPrevLabel()\"\n [disabled]=\"atStart()\"\n (click)=\"prev()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M9 2 L4 7 L9 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--next\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [disabled]=\"atEnd()\"\n (click)=\"next()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M5 2 L10 7 L5 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n\n@if (showDots() && count() > 1) {\n <div class=\"wr-carousel__dots\" role=\"group\" [attr.aria-label]=\"resolvedPaginationLabel()\">\n @for (slide of slides(); track $index) {\n <button\n type=\"button\"\n class=\"wr-carousel__dot\"\n [class.wr-carousel__dot--active]=\"$index === active()\"\n [attr.aria-current]=\"$index === active() ? 'true' : null\"\n [attr.aria-label]=\"slideLabel({ index: $index + 1 })\"\n (click)=\"goTo($index)\"\n ></button>\n }\n </div>\n}\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAa,cAAc,IAAI,eAAkC,aAAa;;;;;;;AC6B9E,IAAa,kBAAb,MAAa,gBAAe;CAC1B,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,UAAU;CAC7E;CAEiB,WAAW,OAAO,aAAa,EAAE,UAAU,KAAI,CAAE;CAMzD,kBAAkB,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;CAIlC,0BAA0B,YAC3C,KAAK,iBACL,iCACA,OAAO;CAWU,YAAY,eAAc;EAC3C,IAAI,CAAC,KAAK,UAAU,OAAO;EAC3B,MAAM,QAAQ,KAAK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A;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;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,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,eAAe,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
1
+ {"version":3,"file":"ngwr-carousel.mjs","names":[],"sources":["../../../projects/lib/carousel/tokens/carousel.token.ts","../../../projects/lib/carousel/carousel-slide.ts","../../../projects/lib/carousel/carousel.ts","../../../projects/lib/carousel/carousel.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 { WrCarouselContext } from '../types';\n\n/** Token a `<wr-carousel-slide>` injects to find its parent `<wr-carousel>`. */\nexport const WR_CAROUSEL = new InjectionToken<WrCarouselContext>('WR_CAROUSEL');\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 { Component, ViewEncapsulation, computed, inject, input } from '@angular/core';\n\nimport { useI18nText } from 'ngwr/i18n';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WR_CAROUSEL } from './tokens';\n\n/**\n * One slide in a {@link WrCarousel}. Holds whatever content you\n * project — image, card, video, anything.\n *\n * **An off-screen slide is `inert`.** Only one slide is visible, but the track\n * merely translates the others out of view: without this they stay in the tab\n * order and in the accessibility tree, so a keyboard user tabs into a link they\n * cannot see and a screen reader announces every slide as if they were all on\n * screen. `inert` takes the whole subtree out of both at once, which is why it\n * is preferred here over `tabindex=\"-1\"` (which reaches only the host) — the\n * same answer `wr-collapse` uses.\n *\n * `aria-hidden` rides along: it states the intent for anything reading the attribute\n * rather than honouring `inert`.\n */\n@Component({\n selector: 'wr-carousel-slide',\n template: '<ng-content />',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-carousel-slide',\n role: 'group',\n '[attr.aria-roledescription]': 'resolvedRoledescription()',\n '[attr.inert]': 'offScreen() ? \"\" : null',\n '[attr.aria-hidden]': 'offScreen() ? \"true\" : null',\n },\n})\nexport class WrCarouselSlide {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('carousel');\n }\n\n private readonly carousel = inject(WR_CAROUSEL, { optional: true });\n\n /**\n * Word a screen reader speaks IN PLACE OF the `group` role. Falls back to\n * `carousel.slideRoledescription`, then `'slide'`.\n */\n readonly roledescription = input<string | null>(null);\n\n // Spoken verbatim, and only the off-screen slides are `inert` — so the visible\n // one announced an English \"slide\" inside an otherwise localized carousel.\n protected readonly resolvedRoledescription = useI18nText(\n this.roledescription,\n 'carousel.slideRoledescription',\n 'slide'\n );\n\n /**\n * Whether this slide is one of the ones translated out of view.\n *\n * `false` while the index is `-1`: content children resolve after the first\n * render, and a slide that hid itself in that window would make the carousel\n * open with everything inert. `false` too when there is no parent — the\n * component is exported, so it can be used on its own.\n */\n protected readonly offScreen = computed(() => {\n if (!this.carousel) return false;\n const index = this.carousel.indexOf(this);\n return index >= 0 && index !== this.carousel.active();\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 { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n PLATFORM_ID,\n ViewEncapsulation,\n computed,\n contentChildren,\n forwardRef,\n effect,\n inject,\n input,\n model,\n signal,\n} from '@angular/core';\n\nimport { useI18nFormatter, useI18nText } from 'ngwr/i18n';\nimport { WrPlatform } from 'ngwr/platform';\nimport { wrCheckStyles } from 'ngwr/utils';\n\nimport { WrCarouselSlide } from './carousel-slide';\nimport { WR_CAROUSEL } from './tokens';\nimport type { WrCarouselContext } from './types';\n\n/**\n * How far a touch travels before the carousel decides whether it is a swipe or a\n * scroll — the usual touch slop, so a finger's first wobble decides nothing.\n */\nconst SWIPE_SLOP = 10;\n\n/**\n * Slide carousel. Project `<wr-carousel-slide>` children — the carousel\n * snaps between them with prev/next buttons and optional dots / autoplay.\n *\n * @example\n * ```html\n * <wr-carousel [(active)]=\"i\" autoplay>\n * <wr-carousel-slide><img src=\"a.jpg\" /></wr-carousel-slide>\n * <wr-carousel-slide><img src=\"b.jpg\" /></wr-carousel-slide>\n * <wr-carousel-slide><img src=\"c.jpg\" /></wr-carousel-slide>\n * </wr-carousel>\n * ```\n *\n * @see https://ngwr.dev/reference/components/carousel\n */\n@Component({\n selector: 'wr-carousel',\n templateUrl: './carousel.html',\n encapsulation: ViewEncapsulation.None,\n // On the HOST, not the viewport: the arrows and dots are the viewport's siblings, so\n // viewport-scoped listeners let a slide change under a cursor aiming at an arrow.\n // `focusin` / `focusout` are the keyboard half — WCAG 2.2.2 wants a way to stop\n // moving content, and hovering is not one for someone who never uses a mouse.\n host: {\n class: 'wr-carousel',\n '(mouseenter)': 'onHoverIn()',\n '(mouseleave)': 'onHoverOut()',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onFocusOut()',\n },\n providers: [\n {\n provide: WR_CAROUSEL,\n // eslint-disable-next-line @angular-eslint/no-forward-ref\n useExisting: forwardRef(() => WrCarousel),\n },\n ],\n})\nexport class WrCarousel implements WrCarouselContext {\n /** Accessible name of the previous-slide button. Falls back to `carousel.prev`. */\n readonly prevLabel = input<string | null>(null);\n\n /** Accessible name of the next-slide button. Falls back to `carousel.next`. */\n readonly nextLabel = input<string | null>(null);\n\n /** Accessible name of the dot group. Falls back to `carousel.pagination`. */\n readonly paginationLabel = input<string | null>(null);\n\n protected readonly resolvedPrevLabel = useI18nText(this.prevLabel, 'carousel.prev', 'Previous slide');\n protected readonly resolvedNextLabel = useI18nText(this.nextLabel, 'carousel.next', 'Next slide');\n protected readonly resolvedPaginationLabel = useI18nText(\n this.paginationLabel,\n 'carousel.pagination',\n 'Carousel pagination'\n );\n\n /** Accessible name of the carousel itself. Falls back to `carousel.label`. */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'carousel.label', 'Carousel');\n\n /**\n * Word a screen reader speaks IN PLACE OF the `group` role. Falls back to\n * `carousel.roledescription`, then `'carousel'`.\n */\n readonly roledescription = input<string | null>(null);\n\n // Routed for the same reason the name above is: `aria-roledescription` is spoken\n // verbatim, so a static English \"carousel\" made the viewport announce\n // \"Карусель, carousel\" with the localized arrows right beside it.\n protected readonly resolvedRoledescription = useI18nText(\n this.roledescription,\n 'carousel.roledescription',\n 'carousel'\n );\n\n // The three labels above route through the catalog; this one was a hard-coded\n // English template, so a localized app got two languages in one pagination strip.\n protected readonly slideLabel = useI18nFormatter('carousel.goToSlide', 'Go to slide {{index}}');\n\n /** Name of the autoplay button while the slides advance. Falls back to `marquee.pause`, \"Pause\" in English. */\n readonly pauseLabel = input<string | null>(null);\n\n /** Name of the autoplay button while the slides stand. Falls back to `marquee.play`, \"Play\" in English. */\n readonly playLabel = input<string | null>(null);\n\n // The marquee's pair: the same two words on the same kind of button.\n protected readonly resolvedPauseLabel = useI18nText(this.pauseLabel, 'marquee.pause', 'Pause');\n protected readonly resolvedPlayLabel = useI18nText(this.playLabel, 'marquee.play', 'Play');\n\n private readonly positionText = useI18nFormatter('carousel.position', 'Slide {{current}} of {{total}}');\n\n /** Active slide index. Two-way bindable. @default 0 */\n readonly active = model(0);\n\n /** Show prev / next arrow buttons. @default true */\n readonly showArrows = input(true, { transform: coerceBooleanProperty });\n\n /** Show dot indicators below the slides. @default true */\n readonly showDots = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Auto-advance slides. Held while the pointer or keyboard focus is inside the\n * carousel and during a swipe. While the reader prefers reduced motion it does\n * not start until they press play. Turn on `pauseButton` to let readers stop\n * it. @default false\n */\n readonly autoplay = input(false, { transform: coerceBooleanProperty });\n\n /**\n * Draw a pause / play button while `autoplay` is on. WCAG 2.2.2 asks for a way\n * to pause moving content, so turn it on with autoplay. @default false\n */\n readonly pauseButton = input(false, { transform: coerceBooleanProperty });\n\n /** Autoplay interval (ms). @default 4000 */\n readonly intervalMs = input(4000, {\n transform: (v: unknown): number => Math.max(500, coerceNumberProperty(v, 4000)),\n });\n\n /** Wrap around at the ends. @default true */\n readonly loop = input(true, { transform: coerceBooleanProperty });\n\n protected readonly slides = contentChildren(WrCarouselSlide);\n protected readonly count = computed(() => this.slides().length);\n\n /**\n * Whether an arrow has nowhere to go: only without `loop`, at the matching end.\n * The arrows used to stay enabled there and do nothing — announced, focusable\n * and clickable controls with no effect. Native `disabled`, the way\n * `wr-pagination` stops its own previous / next at the ends.\n */\n protected readonly atStart = computed(() => !this.loop() && this.active() <= 0);\n protected readonly atEnd = computed(() => !this.loop() && this.active() >= this.count() - 1);\n\n /**\n * Where a slide sits in projection order — {@link WrCarouselContext}.\n *\n * Public only because the child injects the parent through `WR_CAROUSEL`;\n * reading `slides()` here is what makes the child's `computed()` re-run when a\n * slide is added or removed.\n */\n indexOf(slide: object): number {\n return this.slides().indexOf(slide as WrCarouselSlide);\n }\n\n /** Live horizontal drag offset (px) during a touch swipe. */\n protected readonly dragX = signal(0);\n protected readonly dragging = signal(false);\n\n private readonly dir = inject(Directionality, { optional: true });\n\n /**\n * Reading direction of the track. `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 `trackStyle` re-renders instead\n * of leaving the track parked on the old side.\n */\n private readonly isRtl = computed(() => this.dir?.valueSignal() === 'rtl');\n\n /** CSS transform for the track — the per-slide offset plus any live drag. */\n protected readonly trackStyle = computed(() => {\n // `translateX` is PHYSICAL while the slides are laid out on the inline axis:\n // under `dir=\"rtl\"` the flex track runs right-to-left, so slide 1 sits to the\n // LEFT of slide 0 and reaching it means moving the track the other way. Left\n // unsigned, every RTL carousel translated itself off into blank space.\n const base = (this.isRtl() ? 1 : -1) * this.active() * 100;\n // The drag stays physical on purpose: it is the finger's own displacement,\n // and the track follows the finger in both directions.\n const drag = this.dragX();\n return drag === 0 ? `translateX(${base}%)` : `translateX(calc(${base}% + ${drag}px))`;\n });\n\n private timer: ReturnType<typeof setInterval> | null = null;\n\n // Three sources hold the pause and they release independently, so they get a\n // flag each rather than one shared boolean — the same `hovered` / `focusWithin`\n // pair `WrToastHost` keeps. With one flag whichever source released LAST won:\n // moving the pointer off the carousel while focus was still on a link inside it\n // restarted the slides under the focused element, and a `touchend` released a\n // pause it had never taken. Flags, not a counter: `mouseenter`/`mouseleave` and\n // `focusin`/`focusout` each pair exactly once per source, so a count would only\n // add a way to drift out of step.\n private readonly hovered = signal(false);\n private readonly focusWithin = signal(false);\n private readonly paused = computed(() => this.hovered() || this.focusWithin() || this.dragging());\n\n /**\n * Autoplay is motion the reader did not start, which is exactly what\n * `prefers-reduced-motion` asks a page to drop: the stylesheet already switches\n * slides in place under it, and a panel that still changed every four seconds\n * was the half that stylesheet cannot reach. A signal, so the preference is\n * followed while the page is open, until the reader presses the button: a\n * press is an explicit answer and outranks the preference.\n */\n private readonly reducedMotion = inject(WrPlatform).prefersReducedMotion;\n\n /** What the reader last asked of the pause button, `null` until it is pressed. */\n private readonly asked = signal<'play' | 'pause' | null>(null);\n\n /** Whether autoplay is switched on, holds aside: what the button's name and glyph follow. */\n protected readonly playing = computed(() => {\n const asked = this.asked();\n return this.autoplay() && (asked === null ? !this.reducedMotion() : asked === 'play');\n });\n\n /** The slides are advancing on their own right now. */\n protected readonly rotating = computed(() => this.isBrowser && this.playing() && !this.paused() && this.count() > 1);\n\n /**\n * Text of the live region: the position after a move the reader made. Empty\n * after an autoplay tick, so the same position can be said again later.\n */\n protected readonly announcement = signal('');\n\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('carousel');\n effect(() => {\n if (this.timer) clearInterval(this.timer);\n this.timer = null;\n // `isBrowser` first: without it the prerender ran the timer too, doing work\n // nobody will ever see on a slide index that then gets serialized.\n if (!this.rotating()) return;\n const interval = this.intervalMs();\n this.timer = setInterval(() => {\n this.move(this.active() + 1);\n this.announcement.set('');\n }, interval);\n });\n\n // `active` is a plain `model`, so `[(active)]` and a shrinking slide list both\n // write into it unchecked — a filtered list left it pointing past the end,\n // translating the track into blank space with no dot lit.\n effect(() => {\n const max = this.count() - 1;\n if (max < 0) return;\n const clamped = Math.min(Math.max(0, this.active()), max);\n if (clamped !== this.active()) this.active.set(clamped);\n });\n\n this.destroyRef.onDestroy(() => {\n if (this.timer) clearInterval(this.timer);\n });\n }\n\n protected onHoverIn(): void {\n this.hovered.set(true);\n }\n\n protected onHoverOut(): void {\n this.hovered.set(false);\n }\n\n protected onFocusIn(): void {\n this.focusWithin.set(true);\n }\n\n protected onFocusOut(): void {\n this.focusWithin.set(false);\n }\n\n /**\n * The pause button. Play also lets go of the hover and focus holds in force:\n * the press came from inside the carousel, so they would keep the slides still\n * after the reader asked for them to move. Each hold comes back with the next\n * `focusin` or `mouseenter`.\n */\n protected toggleAutoplay(): void {\n if (this.playing()) {\n this.asked.set('pause');\n return;\n }\n this.asked.set('play');\n this.hovered.set(false);\n this.focusWithin.set(false);\n }\n\n // Imperative\n\n /** Show a slide, and announce its position: an autoplay tick is the only silent move. */\n goTo(index: number): void {\n const before = this.active();\n this.move(index);\n const current = this.active();\n if (current !== before) this.announcement.set(this.positionText({ current: current + 1, total: this.count() }));\n }\n\n private move(index: number): void {\n const max = this.count() - 1;\n if (max < 0) return;\n if (this.loop()) {\n const next = ((index % this.count()) + this.count()) % this.count();\n this.active.set(next);\n } else {\n this.active.set(Math.min(Math.max(0, index), max));\n }\n }\n\n next(): void {\n this.goTo(this.active() + 1);\n }\n\n prev(): void {\n this.goTo(this.active() - 1);\n }\n\n // Swipe navigation — the track follows the finger; releasing past ~20% of the\n // viewport advances a slide, otherwise snaps back. Which way that is follows\n // the reading direction: dragging toward the inline start (left in LTR, right\n // in RTL) pulls the next slide into view.\n\n private swipeStartX = 0;\n private swipeStartY = 0;\n\n /**\n * Which way the finger is going, decided once it has moved {@link SWIPE_SLOP}\n * px: `'x'` is a swipe, `'y'` a page scroll that happened to start on a slide.\n * Without the lock every vertical scroll that drifted sideways dragged the\n * track along and, past 20% of the width, changed the slide under it.\n */\n private swipeAxis: 'x' | 'y' | null = null;\n\n protected onSwipeStart(event: TouchEvent): void {\n const touch = event.touches[0];\n if (!touch) return;\n this.swipeStartX = touch.clientX;\n this.swipeStartY = touch.clientY;\n this.swipeAxis = null;\n this.dragging.set(true); // holds autoplay on its own — `paused` reads it\n }\n\n protected onSwipeMove(event: TouchEvent): void {\n if (!this.dragging()) return;\n const touch = event.touches[0];\n if (!touch) return;\n const dx = touch.clientX - this.swipeStartX;\n const dy = touch.clientY - this.swipeStartY;\n if (this.swipeAxis === null) {\n if (Math.abs(dx) < SWIPE_SLOP && Math.abs(dy) < SWIPE_SLOP) return;\n this.swipeAxis = Math.abs(dx) > Math.abs(dy) ? 'x' : 'y';\n }\n if (this.swipeAxis === 'x') this.dragX.set(dx);\n }\n\n protected onSwipeEnd(event: TouchEvent, viewport: HTMLElement): void {\n if (!this.dragging()) return;\n this.dragging.set(false);\n const dx = this.swipeAxis === 'x' ? this.dragX() : 0;\n this.swipeAxis = null;\n this.dragX.set(0);\n const threshold = (viewport.offsetWidth || 0) * 0.2;\n // `dx` is a physical delta. The next slide sits to the physical RIGHT in LTR\n // and to the LEFT in RTL, so the drag that pulls it into view — and with it\n // the sign that advances — turns around with the direction. The buttons keep\n // their semantics either way; only the gesture is physical.\n const advance = this.isRtl() ? dx >= threshold : dx <= -threshold;\n const retreat = this.isRtl() ? dx <= -threshold : dx >= threshold;\n if (advance) this.next();\n else if (retreat) this.prev();\n }\n}\n","<!--\n First in the DOM, so it is the first tab stop of the carousel: the way to stop\n the slides comes before the slides. Named for what a press does next.\n-->\n@if (autoplay() && pauseButton() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__toggle\"\n [attr.aria-label]=\"playing() ? resolvedPauseLabel() : resolvedPlayLabel()\"\n (click)=\"toggleAutoplay()\"\n >\n @if (playing()) {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <rect x=\"5\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n <rect x=\"14\" y=\"4\" width=\"5\" height=\"16\" rx=\"1\" />\n </svg>\n } @else {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n <path d=\"M6 4.5a1 1 0 0 1 1.52-.86l12 7.5a1 1 0 0 1 0 1.72l-12 7.5A1 1 0 0 1 6 19.5z\" />\n </svg>\n }\n </button>\n}\n\n<div\n #viewport\n class=\"wr-carousel__viewport\"\n role=\"group\"\n [attr.aria-roledescription]=\"resolvedRoledescription()\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n (touchstart)=\"onSwipeStart($event)\"\n (touchmove)=\"onSwipeMove($event)\"\n (touchend)=\"onSwipeEnd($event, viewport)\"\n (touchcancel)=\"onSwipeEnd($event, viewport)\"\n>\n <div class=\"wr-carousel__track\" [style.transform]=\"trackStyle()\" [style.transition]=\"dragging() ? 'none' : null\">\n <ng-content />\n </div>\n</div>\n\n@if (showArrows() && count() > 1) {\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--prev\"\n [attr.aria-label]=\"resolvedPrevLabel()\"\n [disabled]=\"atStart()\"\n (click)=\"prev()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M9 2 L4 7 L9 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n <button\n type=\"button\"\n class=\"wr-carousel__nav wr-carousel__nav--next\"\n [attr.aria-label]=\"resolvedNextLabel()\"\n [disabled]=\"atEnd()\"\n (click)=\"next()\"\n >\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <path d=\"M5 2 L10 7 L5 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n </button>\n}\n\n@if (showDots() && count() > 1) {\n <div class=\"wr-carousel__dots\" role=\"group\" [attr.aria-label]=\"resolvedPaginationLabel()\">\n @for (slide of slides(); track $index) {\n <button\n type=\"button\"\n class=\"wr-carousel__dot\"\n [class.wr-carousel__dot--active]=\"$index === active()\"\n [attr.aria-current]=\"$index === active() ? 'true' : null\"\n [attr.aria-label]=\"slideLabel({ index: $index + 1 })\"\n (click)=\"goTo($index)\"\n ></button>\n }\n </div>\n}\n\n<!--\n One live region for the whole carousel, in the DOM before its text changes.\n Off while the slides advance on their own, as the WAI-ARIA carousel pattern has it.\n-->\n<div class=\"wr-carousel__live\" aria-atomic=\"true\" [attr.aria-live]=\"rotating() ? 'off' : 'polite'\">\n {{ announcement() }}\n</div>\n"],"mappings":";;;;;;;;;;;;;;AAYA,MAAa,cAAc,IAAI,eAAkC,aAAa;;;;;;;AC6B9E,IAAa,kBAAb,MAAa,gBAAe;CAC1B,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,UAAU;CAC7E;CAEiB,WAAW,OAAO,aAAa,EAAE,UAAU,KAAI,CAAE;CAMzD,kBAAkB,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;CAIlC,0BAA0B,YAC3C,KAAK,iBACL,iCACA,OAAO;CAWU,YAAY,eAAc;EAC3C,IAAI,CAAC,KAAK,UAAU,OAAO;EAC3B,MAAM,QAAQ,KAAK,SAAS,QAAQ,IAAI;EACxC,OAAO,SAAS,KAAK,UAAU,KAAK,SAAS,OAAM;CACrD,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAjCS,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAe,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAf,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAe,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,iBAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA;GAAA,YAAA,EAAA,QAAA,QAAA;GAAA,YAAA;IAAA,6BAAA;IAAA,cAAA;IAAA,oBAAA;GAAA;GA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,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;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,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,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;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,eAAe,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-cascader-testing.mjs","names":[],"sources":["../../../projects/lib/cascader/testing/wr-cascader-option-harness.ts","../../../projects/lib/cascader/testing/wr-cascader-column-harness.ts","../../../projects/lib/cascader/testing/wr-cascader-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, TestKey } from '@angular/cdk/testing';\n\nimport type { WrCascaderOptionHarnessFilters } from './types';\n\n/**\n * Test harness for one option inside a `<wr-cascader>` column.\n *\n * An option is either a BRANCH (it has children, so clicking it opens the next\n * column) or a LEAF (clicking it commits the whole path and closes the panel).\n * {@link hasChildren} reads the chevron the template draws for branches;\n * {@link isExpanded} reads the state that same branch announces. The two are\n * not one question — a branch always HAS children and is expanded only while\n * the column to its right is showing them.\n *\n * The panel is a `role=\"tree\"` and an option is a `treeitem`. It was a `menu`\n * of `menuitem`s until the roles were corrected, and this class documented that\n * a branch announced nothing at all; both are historical now.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCascaderOptionHarness extends ComponentHarness {\n /** The `<li role=\"treeitem\">` a column renders per option. */\n static hostSelector = '.wr-cascader__opt';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrCascaderOptionHarnessFilters = {}): HarnessPredicate<WrCascaderOptionHarness> {\n return new HarnessPredicate(WrCascaderOptionHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption('active', options.active, async (harness, active) => (await harness.isActive()) === active)\n .addOption(\n 'hasChildren',\n options.hasChildren,\n async (harness, hasChildren) => (await harness.hasChildren()) === hasChildren\n );\n }\n\n /** The option's label, trimmed. The branch chevron contributes no text. */\n async getText(): Promise<string> {\n return (await this.locatorFor('.wr-cascader__opt-label')()).text();\n }\n\n /** The role the option announces — `treeitem`. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** Whether the option refuses selection, from the state a screen reader is given. */\n async isDisabled(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-disabled')) === 'true';\n }\n\n /**\n * Whether this is the option its column is currently drilled into — the one\n * whose children the column to the right is showing, or the committed segment\n * at this level.\n *\n * Read from the `--active` modifier, and NOT the same question as\n * {@link isSelected}: this one tracks where the user has navigated, that one\n * tracks what they committed. They agree only once a leaf is picked, and a\n * harness that collapsed them would hide exactly the divergence it exists to\n * catch.\n */\n async isActive(): Promise<boolean> {\n return (await this.host()).hasClass('wr-cascader__opt--active');\n }\n\n /**\n * Whether this option is the committed choice, or `null` when it is not a\n * choice at all.\n *\n * `null` — the attribute absent — for a branch while `changeOnSelect` is off,\n * because such a branch genuinely cannot be chosen. Answering a plausible\n * `false` there would report an unselectable row as merely unselected, which\n * is the distinction the attribute exists to carry.\n */\n async isSelected(): Promise<boolean | null> {\n const raw = await (await this.host()).getAttribute('aria-selected');\n return raw === null ? null : raw === 'true';\n }\n\n /**\n * Whether this branch's children are the column to its right, or `null` for a\n * leaf.\n *\n * `null` rather than `false`, and the difference is the whole point: a leaf\n * does not have a collapsed subtree, it has none. `aria-expanded=\"false\"` on\n * one would state that a subtree exists and is shut.\n */\n async isExpanded(): Promise<boolean | null> {\n const raw = await (await this.host()).getAttribute('aria-expanded');\n return raw === null ? null : raw === 'true';\n }\n\n /**\n * The option's depth, 1-based — its `aria-level`.\n *\n * Worth reading in a spec rather than trusting: the columns are DOM SIBLINGS,\n * so nothing about the markup's shape carries depth. Every option would be\n * level 1 if this attribute were dropped, and no gate would say so.\n */\n async getLevel(): Promise<number | null> {\n const raw = await (await this.host()).getAttribute('aria-level');\n return raw === null ? null : Number.parseInt(raw, 10);\n }\n\n /** Whether the option opens a deeper level rather than ending the path. */\n async hasChildren(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-cascader__opt-arrow')()) !== null;\n }\n\n /**\n * The option's tab index — `0` for the panel's one tab stop, `-1` for every\n * other option, disabled ones included.\n *\n * Worth asking: the panel holds ONE stop, as in the APG tree pattern — the\n * option the caret last moved to, else the selected path's leaf, else the first\n * enabled root — and the arrows move it. Until v15 every enabled option was its\n * own stop.\n *\n * Read as the element's `tabIndex` PROPERTY rather than the attribute, so an\n * option that carried no `tabindex` at all answers `-1` — what the DOM says of a\n * bare `<li>` — instead of a made-up `0` that would report an unfocusable option\n * as the tab stop.\n */\n async getTabIndex(): Promise<number> {\n return (await this.host()).getProperty<number>('tabIndex');\n }\n\n /**\n * Click the option: a branch opens its children to the right, a leaf commits\n * the path and closes the panel.\n *\n * A disabled option is clickable here on purpose — the component refuses it in\n * its own handler rather than through `pointer-events`, so the click a spec\n * dispatches is exactly as ineffective as one in a browser.\n */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /**\n * Activate the option from the keyboard (Enter; Space is bound to the same\n * handler).\n *\n * Sent to THIS option, wherever the caret is. A keyboard user reaches it with\n * the arrows (and type-ahead) from the panel's one tab stop — opening the panel\n * moves focus onto the selected path's leaf, else the first enabled root — and\n * Tab leaves the panel rather than walking it. Call {@link focus} first when a\n * spec wants the caret where a reader's would be.\n */\n async selectByKeyboard(): Promise<void> {\n return (await this.host()).sendKeys(TestKey.ENTER);\n }\n\n /**\n * Move the pointer onto the option.\n *\n * Deliberately does NOT expand a branch: this cascader drills down on CLICK\n * only, unlike the hover-to-expand cascaders elsewhere. Kept because a spec\n * may want to pin that, and because the option's hover tint is styled.\n */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move keyboard focus to the option. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Whether the option holds keyboard focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\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 { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrCascaderColumnHarnessFilters, WrCascaderOptionHarnessFilters } from './types';\nimport { WrCascaderOptionHarness } from './wr-cascader-option-harness';\n\n/**\n * Test harness for one COLUMN of an open `<wr-cascader>` panel.\n *\n * A column is a level of the tree: column 0 holds the root options, and each\n * further column holds the children of the active option in the column before\n * it. Which columns exist is therefore a function of what is expanded — the\n * relationship this harness exists to let a spec assert. Column 0 is always\n * there; a column only appears once there are children to put in it, so a leaf\n * adds none.\n *\n * @example\n * ```ts\n * const [countries, cities] = await cascader.getColumns();\n *\n * expect(await countries.getActiveOptionText()).toBe('Germany');\n * expect(await cities.getOptionLabels()).toEqual(['Berlin']);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCascaderColumnHarness extends ComponentHarness {\n /** The `<ul role=\"group\">` the panel renders per level, inside the `tree`. */\n static hostSelector = '.wr-cascader__col';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrCascaderColumnHarnessFilters = {}): HarnessPredicate<WrCascaderColumnHarness> {\n return new HarnessPredicate(WrCascaderColumnHarness, options).addOption(\n 'optionText',\n options.optionText,\n async (harness, text) => {\n for (const label of await harness.getOptionLabels()) {\n if (await HarnessPredicate.stringMatches(label, text)) return true;\n }\n return false;\n }\n );\n }\n\n /** The role the column announces — `group`, inside the panel's `tree`. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** The options this level offers, in order. */\n async getOptions(filters: WrCascaderOptionHarnessFilters = {}): Promise<WrCascaderOptionHarness[]> {\n return this.locatorForAll(WrCascaderOptionHarness.with(filters))();\n }\n\n /** The labels this level offers, in order. */\n async getOptionLabels(): Promise<string[]> {\n const options = await this.getOptions();\n return Promise.all(options.map(option => option.getText()));\n }\n\n /**\n * The first option matching the filters.\n *\n * Throws rather than answering `null`, and names what the column does offer:\n * a missing option here almost always means the level is not the one the spec\n * thought it was, and that is far easier to see with the alternatives listed.\n */\n async getOption(filters: WrCascaderOptionHarnessFilters): Promise<WrCascaderOptionHarness> {\n const [option] = await this.getOptions(filters);\n if (!option) {\n throw new Error(\n `WrCascaderColumnHarness.getOption(): no option matched ${JSON.stringify(filters)}. ` +\n `This column offers: ${(await this.getOptionLabels()).join(', ')}.`\n );\n }\n return option;\n }\n\n /** The option this level is drilled into, or `null` when nothing here is expanded. */\n async getActiveOption(): Promise<WrCascaderOptionHarness | null> {\n const [active] = await this.getOptions({ active: true });\n return active ?? null;\n }\n\n /** The label of the option this level is drilled into, or `null`. */\n async getActiveOptionText(): Promise<string | null> {\n const active = await this.getActiveOption();\n return active ? active.getText() : null;\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 { WrCascaderColumnHarnessFilters, WrCascaderHarnessFilters, WrCascaderOptionHarnessFilters } from './types';\nimport { WrCascaderColumnHarness } from './wr-cascader-column-harness';\nimport type { WrCascaderOptionHarness } from './wr-cascader-option-harness';\n\n/**\n * Test harness for `<wr-cascader>` — the trigger, and the panel of COLUMNS it\n * opens. Root of a small family: {@link WrCascaderColumnHarness} for one level,\n * `WrCascaderOptionHarness` for one option in it.\n *\n * A cascader is not a select with extra steps. Its value is the whole PATH from\n * root to leaf (`['eu', 'de', 'ber']`, not `'ber'`), and the panel shows one\n * column per level, so which columns exist depends on what is expanded — column\n * 0 is the roots, and every further column holds the children of the active\n * option in the column to its left. That relationship is the component, so it is\n * what {@link getColumns} and {@link getColumnLabels} are for.\n *\n * The panel is NOT inside the cascader: it is a template portal in the overlay\n * container, a sibling of the whole app. Every read of it goes through the\n * document root scoped by the `aria-controls` id the trigger publishes, so two\n * cascaders on one page can never answer with each other's columns.\n *\n * @example\n * ```ts\n * const cascader = await loader.getHarness(WrCascaderHarness);\n *\n * await cascader.selectPath(['Europe', 'Germany', 'Berlin']);\n *\n * expect(await cascader.getValueText()).toBe('Europe / Germany / Berlin');\n * expect(await cascader.isOpen()).toBe(false);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCascaderHarness extends ComponentHarness {\n static hostSelector = 'wr-cascader';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrCascaderHarnessFilters = {}): HarnessPredicate<WrCascaderHarness> {\n return new HarnessPredicate(WrCascaderHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getValueText(), text))\n .addOption('placeholder', options.placeholder, (harness, placeholder) =>\n HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder)\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n private readonly trigger = this.locatorFor('.wr-cascader__trigger');\n\n /**\n * Whether the panel is showing.\n *\n * From the trigger's `aria-expanded` rather than the host's `--open` class:\n * both exist, and the ARIA state is the one a screen-reader user is told.\n */\n async isOpen(): Promise<boolean> {\n return (await (await this.trigger()).getAttribute('aria-expanded')) === 'true';\n }\n\n /**\n * Whether the cascader refuses interaction.\n *\n * From the trigger's native `disabled`, which is what actually stops a pointer\n * and what assistive tech reports; the host's `--disabled` class only mirrors\n * it for styling.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.trigger()).getProperty<boolean>('disabled');\n }\n\n /**\n * What the trigger displays as the selection: the labels of the whole path\n * joined by the `separator` (`'Europe / Germany / Berlin'` by default), or `''`\n * while nothing is selected and the placeholder is showing.\n *\n * The joined string is all the DOM has — the separator is not published\n * anywhere on its own, so the harness will not pretend it can split the path\n * back apart. Assert against the bound value, or against\n * {@link getActiveTrail} while the panel is open, when the segments matter.\n */\n async getValueText(): Promise<string> {\n const value = await this.locatorForOptional('.wr-cascader__value')();\n return value ? value.text() : '';\n }\n\n /**\n * The placeholder, or `null` when a selection is hiding it.\n *\n * `''` is a real answer, not an absence: a cascader with no `placeholder` still\n * renders the element while unselected.\n */\n async getPlaceholder(): Promise<string | null> {\n const placeholder = await this.locatorForOptional('.wr-cascader__placeholder')();\n return placeholder ? placeholder.text() : null;\n }\n\n /**\n * The trigger's accessible name — the `ariaLabel` input, falling back to the\n * placeholder and then to the i18n catalog, because a `role=\"combobox\"` with\n * nothing selected and no placeholder would otherwise have no name at all.\n */\n async getAccessibleName(): Promise<string | null> {\n return (await this.trigger()).getAttribute('aria-label');\n }\n\n /**\n * The kind of popup the trigger promises via `aria-haspopup` — `tree`.\n *\n * Worth pinning rather than assuming: a combobox's popup may be a listbox, a\n * tree, a grid or a dialog and nothing else, and this one said `menu` for a\n * long time. `menu` is a valid token for the global `aria-haspopup`, so axe\n * reports nothing either way — an assertion here is the only guard there is.\n */\n async getPopupRole(): Promise<string | null> {\n return (await this.trigger()).getAttribute('aria-haspopup');\n }\n\n /** The role the panel announces — `tree`, matching what the trigger promised. */\n async getPanelRole(): Promise<string | null> {\n return (await this.panel()).getAttribute('role');\n }\n\n /**\n * The id the trigger publishes as `aria-controls`.\n *\n * Published unconditionally, open or closed — so while the panel is closed this\n * id resolves to nothing in the document. Exposed so a spec can pin that\n * (dangling or not) rather than have the harness quietly decide for it; every\n * panel read goes through the same id but refuses to run while closed.\n */\n async getPanelId(): Promise<string | null> {\n return (await this.trigger()).getAttribute('aria-controls');\n }\n\n /**\n * Whether the panel now in the overlay is the one this trigger claims to\n * control — `aria-controls` resolving to a real element that carries that id.\n *\n * With several cascaders on a page it is also the check that the reference lands\n * on THIS instance's panel rather than a neighbour's: the overlay container is\n * shared, so panels sit side by side in it with nothing but their ids to tell\n * them apart.\n */\n async isPanelWiredToTrigger(): Promise<boolean> {\n const rendered = await (await this.panel()).getAttribute('id');\n return rendered !== null && rendered === (await this.getPanelId());\n }\n\n /**\n * Open the panel.\n *\n * Clicks the trigger, because that is the only gesture the component binds. The\n * trigger is a native `<button>`, so a browser turns Enter / Space on it into\n * the same click — there is no separate keyboard route to model here, and jsdom\n * does not synthesise button activation from a key, so an `openByKeyboard()`\n * would only be able to lie.\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.trigger()).click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrCascaderHarness.open(): the panel did not open. A disabled cascader refuses the click — ' +\n 'check isDisabled().'\n );\n }\n\n /**\n * Close the panel with Escape. A closed cascader is left alone.\n *\n * Escape reaches the panel through the CDK's keyboard dispatcher rather than\n * through the DOM tree, which is why sending it to the trigger works even\n * though the panel is somewhere else entirely.\n */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.trigger()).sendKeys(TestKey.ESCAPE);\n if (await this.isOpen()) {\n throw new Error('WrCascaderHarness.close(): Escape did not close the panel.');\n }\n }\n\n /** Click the trigger once, whatever that does — opens a closed panel, closes an open one. */\n async clickTrigger(): Promise<void> {\n return (await this.trigger()).click();\n }\n\n /**\n * The columns of the open panel, left to right: column 0 is the root options,\n * and each further one holds the children of its neighbour's active option.\n *\n * Throws while the panel is closed. The columns do not exist anywhere until the\n * portal is attached, and an empty array reads like a panel that rendered\n * nothing — a confusing failure three lines later instead of here.\n */\n async getColumns(filters: WrCascaderColumnHarnessFilters = {}): Promise<WrCascaderColumnHarness[]> {\n const loader = await this.panelLoader();\n return loader.getAllHarnesses(WrCascaderColumnHarness.with(filters));\n }\n\n /** How many levels the panel is currently showing. */\n async getColumnCount(): Promise<number> {\n return (await this.getColumns()).length;\n }\n\n /**\n * One column by its 0-based level. Throws when the level is not showing, which\n * is the interesting failure: it means the option before it has no children, or\n * has not been expanded yet.\n */\n async getColumn(index: number): Promise<WrCascaderColumnHarness> {\n const columns = await this.getColumns();\n const column = columns[index];\n if (!column) {\n throw new Error(\n `WrCascaderHarness.getColumn(): no column at level ${index} — the panel is showing ` +\n `${columns.length}. A deeper column appears only once a parent with children is expanded.`\n );\n }\n return column;\n }\n\n /** The labels offered by every column, outer array left to right. */\n async getColumnLabels(): Promise<string[][]> {\n const columns = await this.getColumns();\n return Promise.all(columns.map(column => column.getOptionLabels()));\n }\n\n /**\n * The expanded trail — the label of the active option in each column, root\n * first.\n *\n * This is the panel's own idea of where the user is, which is NOT always the\n * committed value: drilling into a branch moves the trail without committing\n * anything unless `changeOnSelect` is on. Once a leaf is picked the two agree,\n * and this is the only place the path's segments exist separately in the DOM.\n */\n async getActiveTrail(): Promise<string[]> {\n const trail: string[] = [];\n for (const column of await this.getColumns()) {\n const active = await column.getActiveOptionText();\n if (active !== null) trail.push(active);\n }\n return trail;\n }\n\n /**\n * The first option matching the filters, anywhere in the panel. Throws when\n * nothing matches, naming what is on offer.\n *\n * Use {@link getColumn} when the level matters — the same label can legitimately\n * appear at more than one level.\n */\n async getOption(filters: WrCascaderOptionHarnessFilters): Promise<WrCascaderOptionHarness> {\n for (const column of await this.getColumns()) {\n const [option] = await column.getOptions(filters);\n if (option) return option;\n }\n\n throw new Error(\n `WrCascaderHarness.getOption(): no option matched ${JSON.stringify(filters)}. ` +\n `The panel offers: ${(await this.getColumnLabels()).map(labels => labels.join(', ')).join(' | ')}.`\n );\n }\n\n /**\n * Walk a path by label, opening the panel first if needed: each label is\n * clicked in the column it belongs to, so `['Europe', 'Germany', 'Berlin']`\n * drills two levels and commits the third.\n *\n * Clicking is the only way down — this cascader does not expand on hover, so\n * neither does the harness. A path that ends on a BRANCH just leaves that\n * branch expanded: the component commits nothing on the way down unless\n * `changeOnSelect` is on, and only a leaf closes the panel.\n */\n async selectPath(labels: readonly string[]): Promise<void> {\n if (labels.length === 0) {\n throw new Error(\n 'WrCascaderHarness.selectPath(): the path is empty. Pass at least one label, or call clear() ' +\n 'to unset the selection.'\n );\n }\n\n await this.open();\n\n for (let level = 0; level < labels.length; level++) {\n const label = labels[level];\n const columns = await this.getColumns();\n const column = columns[level];\n if (!column) {\n throw new Error(\n `WrCascaderHarness.selectPath(): \"${label}\" would be at level ${level}, but the panel is ` +\n `showing ${columns.length} column(s) — the step before it opened no deeper level.`\n );\n }\n\n const option = await column.getOption({ text: label });\n if (await option.isDisabled()) {\n throw new Error(`WrCascaderHarness.selectPath(): \"${label}\" is disabled, so no path can pass through it.`);\n }\n\n const isLast = level === labels.length - 1;\n if (!isLast && !(await option.hasChildren())) {\n throw new Error(\n `WrCascaderHarness.selectPath(): \"${label}\" is a leaf, so the path cannot continue to ` +\n `\"${labels[level + 1]}\" — picking it commits and closes the panel.`\n );\n }\n\n await option.click();\n }\n }\n\n /**\n * Click the clear (×) control on the trigger.\n *\n * Throws when there is none, and both reasons are worth failing on: the\n * cascader is not `clearable`, or nothing is selected — the control is not\n * rendered at all in either case (nor while disabled).\n */\n async clear(): Promise<void> {\n const clear = await this.locatorForOptional('.wr-cascader__clear')();\n if (!clear) {\n throw new Error(\n 'WrCascaderHarness.clear(): this cascader shows no clear control — it is rendered only when ' +\n '`clearable` is on, something is selected, and the control is enabled.'\n );\n }\n await clear.click();\n }\n\n /**\n * Clear from the keyboard — Backspace on the closed trigger.\n *\n * The × {@link clear} clicks is a `tabindex=\"-1\"` span inside the trigger, so no\n * key can ever reach it; Backspace on the trigger is its keyboard twin, and the\n * route a keyboard-only user actually has. Prefer this one in a spec that cares\n * about that user — {@link clear} proves the pointer path and nothing more.\n *\n * The component honours the key only on the CLOSED trigger, so an open panel\n * is closed first with Escape — the step a keyboard user takes too. Sending\n * Backspace into an open panel and returning would be a plausible nothing.\n *\n * Does nothing, rather than throwing, when there is nothing to clear, `clearable`\n * is off, or the cascader is disabled or read-only: that silence IS the\n * component's contract, so a spec asserts it on the value.\n */\n async clearByKeyboard(): Promise<void> {\n if (await this.isOpen()) await this.close();\n await (await this.trigger()).sendKeys(TestKey.BACKSPACE);\n }\n\n /** Move keyboard focus to the trigger. */\n async focus(): Promise<void> {\n return (await this.trigger()).focus();\n }\n\n /** Take focus off the trigger, which is what makes a bound form field touched. */\n async blur(): Promise<void> {\n return (await this.trigger()).blur();\n }\n\n /** Whether the trigger holds keyboard focus. */\n async isFocused(): Promise<boolean> {\n return (await this.trigger()).isFocused();\n }\n\n /** This cascader's panel element in the overlay — the single-element scoped read. */\n private async panel(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();\n }\n\n /**\n * A loader scoped to THIS cascader's panel — the list scoped read.\n *\n * Scoped by the published id rather than by `.wr-cascader-panel`: the overlay\n * container is shared with every other overlay in the app, so a bare class\n * query would answer with whichever panel happened to be open.\n */\n private async panelLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);\n }\n\n /** The panel id, refusing to hand it out while there is no panel to find. */\n private async panelId(): Promise<string> {\n if (!(await this.isOpen())) {\n throw new Error(\n 'WrCascaderHarness: the panel is closed, so there are no columns to read — call open() or ' +\n 'selectPath() first. The trigger publishes `aria-controls` even while closed, so the id ' +\n 'alone is not proof the panel exists.'\n );\n }\n\n const id = await this.getPanelId();\n if (!id) {\n throw new Error('WrCascaderHarness: the trigger publishes no `aria-controls`, so its panel cannot be found.');\n }\n return id;\n }\n}\n"],"mappings":";;;;;;;AA2BA,IAAa,0BAAb,MAAa,gCAAgC,iBAAgB;CAE3D,OAAO,eAAe;CAGtB,OAAO,KAAK,UAA0C,CAAA,GAAE;EACtD,OAAO,IAAI,iBAAiB,yBAAyB,OAAO,CAAC,CAC1D,UAAU,QAAQ,QAAQ,OAAO,SAAS,SAAS,iBAAiB,cAAc,QAAQ,QAAO,GAAI,IAAI,CAAC,CAAC,CAC3G,UAAU,YAAY,QAAQ,UAAU,OAAO,SAAS,aAAc,MAAM,QAAQ,WAAU,MAAQ,QAAQ,CAAC,CAC/G,UAAU,UAAU,QAAQ,QAAQ,OAAO,SAAS,WAAY,MAAM,QAAQ,SAAQ,MAAQ,MAAM,CAAC,CACrG,UACC,eACA,QAAQ,aACR,OAAO,SAAS,gBAAiB,MAAM,QAAQ,YAAW,MAAQ,WAAW;CAEnF;CAGA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,WAAW,yBAAyB,CAAC,CAAA,EAAA,CAAI,KAAI;CAClE;CAGA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,MAAM;CAChD;CAGA,MAAM,aAAU;EACd,OAAQ,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,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MAAM,YAAS;EACb,QAAQ,MAAM,KAAK,QAAO,EAAA,CAAI,UAAS;CACzC;CAGQ,MAAM,QAAK;EACjB,OAAO,KAAK,2BAA0B,CAAE,CAAC,WAAW,IAAI,MAAM,KAAK,QAAO,GAAI,CAAC,CAAA;CACjF;CASQ,MAAM,cAAW;EACvB,OAAO,KAAK,2BAA0B,CAAE,CAAC,iBAAiB,IAAI,MAAM,KAAK,QAAO,GAAI;CACtF;CAGQ,MAAM,UAAO;EACnB,IAAI,CAAE,MAAM,KAAK,OAAM,GACrB,MAAM,IAAI,MACR,sNAEwC;EAI5C,MAAM,KAAK,MAAM,KAAK,WAAU;EAChC,IAAI,CAAC,IACH,MAAM,IAAI,MAAM,4FAA4F;EAE9G,OAAO;CACT"}
1
+ {"version":3,"file":"ngwr-cascader-testing.mjs","names":[],"sources":["../../../projects/lib/cascader/testing/wr-cascader-option-harness.ts","../../../projects/lib/cascader/testing/wr-cascader-column-harness.ts","../../../projects/lib/cascader/testing/wr-cascader-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, TestKey } from '@angular/cdk/testing';\n\nimport type { WrCascaderOptionHarnessFilters } from './types';\n\n/**\n * Test harness for one option inside a `<wr-cascader>` column.\n *\n * An option is either a BRANCH (it has children, so clicking it opens the next\n * column) or a LEAF (clicking it commits the whole path and closes the panel).\n * {@link hasChildren} reads the chevron the template draws for branches;\n * {@link isExpanded} reads the state that same branch announces. The two are\n * not one question — a branch always HAS children and is expanded only while\n * the column to its right is showing them.\n *\n * The panel is a `role=\"tree\"` and an option is a `treeitem`. It was a `menu`\n * of `menuitem`s until the roles were corrected, and this class documented that\n * a branch announced nothing at all; both are historical now.\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCascaderOptionHarness extends ComponentHarness {\n /** The `<li role=\"treeitem\">` a column renders per option. */\n static hostSelector = '.wr-cascader__opt';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrCascaderOptionHarnessFilters = {}): HarnessPredicate<WrCascaderOptionHarness> {\n return new HarnessPredicate(WrCascaderOptionHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption('active', options.active, async (harness, active) => (await harness.isActive()) === active)\n .addOption(\n 'hasChildren',\n options.hasChildren,\n async (harness, hasChildren) => (await harness.hasChildren()) === hasChildren\n );\n }\n\n /** The option's label, trimmed. The branch chevron contributes no text. */\n async getText(): Promise<string> {\n return (await this.locatorFor('.wr-cascader__opt-label')()).text();\n }\n\n /** The role the option announces — `treeitem`. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** Whether the option refuses selection, from the state a screen reader is given. */\n async isDisabled(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-disabled')) === 'true';\n }\n\n /**\n * Whether this is the option its column is currently drilled into — the one\n * whose children the column to the right is showing, or the committed segment\n * at this level.\n *\n * Read from the `--active` modifier, and NOT the same question as\n * {@link isSelected}: this one tracks where the user has navigated, that one\n * tracks what they committed. They agree only once a leaf is picked, and a\n * harness that collapsed them would hide exactly the divergence it exists to\n * catch.\n */\n async isActive(): Promise<boolean> {\n return (await this.host()).hasClass('wr-cascader__opt--active');\n }\n\n /**\n * Whether this option is the committed choice, or `null` when it is not a\n * choice at all.\n *\n * `null` — the attribute absent — for a branch while `changeOnSelect` is off,\n * because such a branch genuinely cannot be chosen. Answering a plausible\n * `false` there would report an unselectable row as merely unselected, which\n * is the distinction the attribute exists to carry.\n */\n async isSelected(): Promise<boolean | null> {\n const raw = await (await this.host()).getAttribute('aria-selected');\n return raw === null ? null : raw === 'true';\n }\n\n /**\n * Whether this branch's children are the column to its right, or `null` for a\n * leaf.\n *\n * `null` rather than `false`, and the difference is the whole point: a leaf\n * does not have a collapsed subtree, it has none. `aria-expanded=\"false\"` on\n * one would state that a subtree exists and is shut.\n */\n async isExpanded(): Promise<boolean | null> {\n const raw = await (await this.host()).getAttribute('aria-expanded');\n return raw === null ? null : raw === 'true';\n }\n\n /**\n * The option's depth, 1-based — its `aria-level`.\n *\n * Worth reading in a spec rather than trusting: the columns are DOM SIBLINGS,\n * so nothing about the markup's shape carries depth. Every option would be\n * level 1 if this attribute were dropped, and no gate would say so.\n */\n async getLevel(): Promise<number | null> {\n const raw = await (await this.host()).getAttribute('aria-level');\n return raw === null ? null : Number.parseInt(raw, 10);\n }\n\n /** Whether the option opens a deeper level rather than ending the path. */\n async hasChildren(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-cascader__opt-arrow')()) !== null;\n }\n\n /**\n * The option's tab index — `0` for the panel's one tab stop, `-1` for every\n * other option, disabled ones included.\n *\n * Worth asking: the panel holds ONE stop, as in the APG tree pattern — the\n * option the caret last moved to, else the selected path's leaf, else the first\n * enabled root — and the arrows move it. Until v15 every enabled option was its\n * own stop.\n *\n * Read as the element's `tabIndex` PROPERTY rather than the attribute, so an\n * option that carried no `tabindex` at all answers `-1` — what the DOM says of a\n * bare `<li>` — instead of a made-up `0` that would report an unfocusable option\n * as the tab stop.\n */\n async getTabIndex(): Promise<number> {\n return (await this.host()).getProperty<number>('tabIndex');\n }\n\n /**\n * Click the option: a branch opens its children to the right, a leaf commits\n * the path and closes the panel.\n *\n * A disabled option is clickable here on purpose — the component refuses it in\n * its own handler rather than through `pointer-events`, so the click a spec\n * dispatches is exactly as ineffective as one in a browser.\n */\n async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /**\n * Activate the option from the keyboard (Enter; Space is bound to the same\n * handler).\n *\n * Sent to THIS option, wherever the caret is. A keyboard user reaches it with\n * the arrows (and type-ahead) from the panel's one tab stop — ArrowDown or Tab\n * on the trigger of an open panel moves focus onto the selected path's leaf,\n * else the first enabled root; opening alone moves nothing unless `autoFocus`\n * is set — and Tab leaves the panel rather than walking it. Call {@link focus} first when a\n * spec wants the caret where a reader's would be.\n */\n async selectByKeyboard(): Promise<void> {\n return (await this.host()).sendKeys(TestKey.ENTER);\n }\n\n /**\n * Move the pointer onto the option.\n *\n * Deliberately does NOT expand a branch: this cascader drills down on CLICK\n * only, unlike the hover-to-expand cascaders elsewhere. Kept because a spec\n * may want to pin that, and because the option's hover tint is styled.\n */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move keyboard focus to the option. */\n async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /** Whether the option holds keyboard focus. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\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 { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\n\nimport type { WrCascaderColumnHarnessFilters, WrCascaderOptionHarnessFilters } from './types';\nimport { WrCascaderOptionHarness } from './wr-cascader-option-harness';\n\n/**\n * Test harness for one COLUMN of an open `<wr-cascader>` panel.\n *\n * A column is a level of the tree: column 0 holds the root options, and each\n * further column holds the children of the active option in the column before\n * it. Which columns exist is therefore a function of what is expanded — the\n * relationship this harness exists to let a spec assert. Column 0 is always\n * there; a column only appears once there are children to put in it, so a leaf\n * adds none.\n *\n * @example\n * ```ts\n * const [countries, cities] = await cascader.getColumns();\n *\n * expect(await countries.getActiveOptionText()).toBe('Germany');\n * expect(await cities.getOptionLabels()).toEqual(['Berlin']);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCascaderColumnHarness extends ComponentHarness {\n /** The `<ul role=\"group\">` the panel renders per level, inside the `tree`. */\n static hostSelector = '.wr-cascader__col';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrCascaderColumnHarnessFilters = {}): HarnessPredicate<WrCascaderColumnHarness> {\n return new HarnessPredicate(WrCascaderColumnHarness, options).addOption(\n 'optionText',\n options.optionText,\n async (harness, text) => {\n for (const label of await harness.getOptionLabels()) {\n if (await HarnessPredicate.stringMatches(label, text)) return true;\n }\n return false;\n }\n );\n }\n\n /** The role the column announces — `group`, inside the panel's `tree`. */\n async getRole(): Promise<string | null> {\n return (await this.host()).getAttribute('role');\n }\n\n /** The options this level offers, in order. */\n async getOptions(filters: WrCascaderOptionHarnessFilters = {}): Promise<WrCascaderOptionHarness[]> {\n return this.locatorForAll(WrCascaderOptionHarness.with(filters))();\n }\n\n /** The labels this level offers, in order. */\n async getOptionLabels(): Promise<string[]> {\n const options = await this.getOptions();\n return Promise.all(options.map(option => option.getText()));\n }\n\n /**\n * The first option matching the filters.\n *\n * Throws rather than answering `null`, and names what the column does offer:\n * a missing option here almost always means the level is not the one the spec\n * thought it was, and that is far easier to see with the alternatives listed.\n */\n async getOption(filters: WrCascaderOptionHarnessFilters): Promise<WrCascaderOptionHarness> {\n const [option] = await this.getOptions(filters);\n if (!option) {\n throw new Error(\n `WrCascaderColumnHarness.getOption(): no option matched ${JSON.stringify(filters)}. ` +\n `This column offers: ${(await this.getOptionLabels()).join(', ')}.`\n );\n }\n return option;\n }\n\n /** The option this level is drilled into, or `null` when nothing here is expanded. */\n async getActiveOption(): Promise<WrCascaderOptionHarness | null> {\n const [active] = await this.getOptions({ active: true });\n return active ?? null;\n }\n\n /** The label of the option this level is drilled into, or `null`. */\n async getActiveOptionText(): Promise<string | null> {\n const active = await this.getActiveOption();\n return active ? active.getText() : null;\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 { WrCascaderColumnHarnessFilters, WrCascaderHarnessFilters, WrCascaderOptionHarnessFilters } from './types';\nimport { WrCascaderColumnHarness } from './wr-cascader-column-harness';\nimport type { WrCascaderOptionHarness } from './wr-cascader-option-harness';\n\n/**\n * Test harness for `<wr-cascader>` — the trigger, and the panel of COLUMNS it\n * opens. Root of a small family: {@link WrCascaderColumnHarness} for one level,\n * `WrCascaderOptionHarness` for one option in it.\n *\n * A cascader is not a select with extra steps. Its value is the whole PATH from\n * root to leaf (`['eu', 'de', 'ber']`, not `'ber'`), and the panel shows one\n * column per level, so which columns exist depends on what is expanded — column\n * 0 is the roots, and every further column holds the children of the active\n * option in the column to its left. That relationship is the component, so it is\n * what {@link getColumns} and {@link getColumnLabels} are for.\n *\n * The panel is NOT inside the cascader: it is a template portal in the overlay\n * container, a sibling of the whole app. Every read of it goes through the\n * document root scoped by the `aria-controls` id the trigger publishes, so two\n * cascaders on one page can never answer with each other's columns.\n *\n * @example\n * ```ts\n * const cascader = await loader.getHarness(WrCascaderHarness);\n *\n * await cascader.selectPath(['Europe', 'Germany', 'Berlin']);\n *\n * expect(await cascader.getValueText()).toBe('Europe / Germany / Berlin');\n * expect(await cascader.isOpen()).toBe(false);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCascaderHarness extends ComponentHarness {\n static hostSelector = 'wr-cascader';\n\n /** Build a predicate that narrows the query. */\n static with(options: WrCascaderHarnessFilters = {}): HarnessPredicate<WrCascaderHarness> {\n return new HarnessPredicate(WrCascaderHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getValueText(), text))\n .addOption('placeholder', options.placeholder, (harness, placeholder) =>\n HarnessPredicate.stringMatches(harness.getPlaceholder(), placeholder)\n )\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled)\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n private readonly trigger = this.locatorFor('.wr-cascader__trigger');\n\n /**\n * Whether the panel is showing.\n *\n * From the trigger's `aria-expanded` rather than the host's `--open` class:\n * both exist, and the ARIA state is the one a screen-reader user is told.\n */\n async isOpen(): Promise<boolean> {\n return (await (await this.trigger()).getAttribute('aria-expanded')) === 'true';\n }\n\n /**\n * Whether the cascader refuses interaction.\n *\n * From the trigger's native `disabled`, which is what actually stops a pointer\n * and what assistive tech reports; the host's `--disabled` class only mirrors\n * it for styling.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.trigger()).getProperty<boolean>('disabled');\n }\n\n /**\n * What the trigger displays as the selection: the labels of the whole path\n * joined by the `separator` (`'Europe / Germany / Berlin'` by default), or `''`\n * while nothing is selected and the placeholder is showing.\n *\n * The joined string is all the DOM has — the separator is not published\n * anywhere on its own, so the harness will not pretend it can split the path\n * back apart. Assert against the bound value, or against\n * {@link getActiveTrail} while the panel is open, when the segments matter.\n */\n async getValueText(): Promise<string> {\n const value = await this.locatorForOptional('.wr-cascader__value')();\n return value ? value.text() : '';\n }\n\n /**\n * The placeholder, or `null` when a selection is hiding it.\n *\n * `''` is a real answer, not an absence: a cascader with no `placeholder` still\n * renders the element while unselected.\n */\n async getPlaceholder(): Promise<string | null> {\n const placeholder = await this.locatorForOptional('.wr-cascader__placeholder')();\n return placeholder ? placeholder.text() : null;\n }\n\n /**\n * The trigger's accessible name — the `ariaLabel` input, falling back to the\n * placeholder and then to the i18n catalog, because a `role=\"combobox\"` with\n * nothing selected and no placeholder would otherwise have no name at all.\n */\n async getAccessibleName(): Promise<string | null> {\n return (await this.trigger()).getAttribute('aria-label');\n }\n\n /**\n * The kind of popup the trigger promises via `aria-haspopup` — `tree`.\n *\n * Worth pinning rather than assuming: a combobox's popup may be a listbox, a\n * tree, a grid or a dialog and nothing else, and this one said `menu` for a\n * long time. `menu` is a valid token for the global `aria-haspopup`, so axe\n * reports nothing either way — an assertion here is the only guard there is.\n */\n async getPopupRole(): Promise<string | null> {\n return (await this.trigger()).getAttribute('aria-haspopup');\n }\n\n /** The role the panel announces — `tree`, matching what the trigger promised. */\n async getPanelRole(): Promise<string | null> {\n return (await this.panel()).getAttribute('role');\n }\n\n /**\n * The id the trigger publishes as `aria-controls`.\n *\n * Published unconditionally, open or closed — so while the panel is closed this\n * id resolves to nothing in the document. Exposed so a spec can pin that\n * (dangling or not) rather than have the harness quietly decide for it; every\n * panel read goes through the same id but refuses to run while closed.\n */\n async getPanelId(): Promise<string | null> {\n return (await this.trigger()).getAttribute('aria-controls');\n }\n\n /**\n * Whether the panel now in the overlay is the one this trigger claims to\n * control — `aria-controls` resolving to a real element that carries that id.\n *\n * With several cascaders on a page it is also the check that the reference lands\n * on THIS instance's panel rather than a neighbour's: the overlay container is\n * shared, so panels sit side by side in it with nothing but their ids to tell\n * them apart.\n */\n async isPanelWiredToTrigger(): Promise<boolean> {\n const rendered = await (await this.panel()).getAttribute('id');\n return rendered !== null && rendered === (await this.getPanelId());\n }\n\n /**\n * Open the panel.\n *\n * Clicks the trigger, because that is the only gesture the component binds. The\n * trigger is a native `<button>`, so a browser turns Enter / Space on it into\n * the same click — there is no separate keyboard route to model here, and jsdom\n * does not synthesise button activation from a key, so an `openByKeyboard()`\n * would only be able to lie.\n */\n async open(): Promise<void> {\n if (await this.isOpen()) return;\n\n await (await this.trigger()).click();\n if (await this.isOpen()) return;\n\n throw new Error(\n 'WrCascaderHarness.open(): the panel did not open. A disabled cascader refuses the click — ' +\n 'check isDisabled().'\n );\n }\n\n /**\n * Close the panel with Escape. A closed cascader is left alone.\n *\n * Escape reaches the panel through the CDK's keyboard dispatcher rather than\n * through the DOM tree, which is why sending it to the trigger works even\n * though the panel is somewhere else entirely.\n */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n\n await (await this.trigger()).sendKeys(TestKey.ESCAPE);\n if (await this.isOpen()) {\n throw new Error('WrCascaderHarness.close(): Escape did not close the panel.');\n }\n }\n\n /** Click the trigger once, whatever that does — opens a closed panel, closes an open one. */\n async clickTrigger(): Promise<void> {\n return (await this.trigger()).click();\n }\n\n /**\n * The columns of the open panel, left to right: column 0 is the root options,\n * and each further one holds the children of its neighbour's active option.\n *\n * Throws while the panel is closed. The columns do not exist anywhere until the\n * portal is attached, and an empty array reads like a panel that rendered\n * nothing — a confusing failure three lines later instead of here.\n */\n async getColumns(filters: WrCascaderColumnHarnessFilters = {}): Promise<WrCascaderColumnHarness[]> {\n const loader = await this.panelLoader();\n return loader.getAllHarnesses(WrCascaderColumnHarness.with(filters));\n }\n\n /** How many levels the panel is currently showing. */\n async getColumnCount(): Promise<number> {\n return (await this.getColumns()).length;\n }\n\n /**\n * One column by its 0-based level. Throws when the level is not showing, which\n * is the interesting failure: it means the option before it has no children, or\n * has not been expanded yet.\n */\n async getColumn(index: number): Promise<WrCascaderColumnHarness> {\n const columns = await this.getColumns();\n const column = columns[index];\n if (!column) {\n throw new Error(\n `WrCascaderHarness.getColumn(): no column at level ${index} — the panel is showing ` +\n `${columns.length}. A deeper column appears only once a parent with children is expanded.`\n );\n }\n return column;\n }\n\n /** The labels offered by every column, outer array left to right. */\n async getColumnLabels(): Promise<string[][]> {\n const columns = await this.getColumns();\n return Promise.all(columns.map(column => column.getOptionLabels()));\n }\n\n /**\n * The expanded trail — the label of the active option in each column, root\n * first.\n *\n * This is the panel's own idea of where the user is, which is NOT always the\n * committed value: drilling into a branch moves the trail without committing\n * anything unless `changeOnSelect` is on. Once a leaf is picked the two agree,\n * and this is the only place the path's segments exist separately in the DOM.\n */\n async getActiveTrail(): Promise<string[]> {\n const trail: string[] = [];\n for (const column of await this.getColumns()) {\n const active = await column.getActiveOptionText();\n if (active !== null) trail.push(active);\n }\n return trail;\n }\n\n /**\n * The first option matching the filters, anywhere in the panel. Throws when\n * nothing matches, naming what is on offer.\n *\n * Use {@link getColumn} when the level matters — the same label can legitimately\n * appear at more than one level.\n */\n async getOption(filters: WrCascaderOptionHarnessFilters): Promise<WrCascaderOptionHarness> {\n for (const column of await this.getColumns()) {\n const [option] = await column.getOptions(filters);\n if (option) return option;\n }\n\n throw new Error(\n `WrCascaderHarness.getOption(): no option matched ${JSON.stringify(filters)}. ` +\n `The panel offers: ${(await this.getColumnLabels()).map(labels => labels.join(', ')).join(' | ')}.`\n );\n }\n\n /**\n * Walk a path by label, opening the panel first if needed: each label is\n * clicked in the column it belongs to, so `['Europe', 'Germany', 'Berlin']`\n * drills two levels and commits the third.\n *\n * Clicking is the only way down — this cascader does not expand on hover, so\n * neither does the harness. A path that ends on a BRANCH just leaves that\n * branch expanded: the component commits nothing on the way down unless\n * `changeOnSelect` is on, and only a leaf closes the panel.\n */\n async selectPath(labels: readonly string[]): Promise<void> {\n if (labels.length === 0) {\n throw new Error(\n 'WrCascaderHarness.selectPath(): the path is empty. Pass at least one label, or call clear() ' +\n 'to unset the selection.'\n );\n }\n\n await this.open();\n\n for (let level = 0; level < labels.length; level++) {\n const label = labels[level];\n const columns = await this.getColumns();\n const column = columns[level];\n if (!column) {\n throw new Error(\n `WrCascaderHarness.selectPath(): \"${label}\" would be at level ${level}, but the panel is ` +\n `showing ${columns.length} column(s) — the step before it opened no deeper level.`\n );\n }\n\n const option = await column.getOption({ text: label });\n if (await option.isDisabled()) {\n throw new Error(`WrCascaderHarness.selectPath(): \"${label}\" is disabled, so no path can pass through it.`);\n }\n\n const isLast = level === labels.length - 1;\n if (!isLast && !(await option.hasChildren())) {\n throw new Error(\n `WrCascaderHarness.selectPath(): \"${label}\" is a leaf, so the path cannot continue to ` +\n `\"${labels[level + 1]}\" — picking it commits and closes the panel.`\n );\n }\n\n await option.click();\n }\n }\n\n /**\n * Click the clear (×) control on the trigger.\n *\n * Throws when there is none, and both reasons are worth failing on: the\n * cascader is not `clearable`, or nothing is selected — the control is not\n * rendered at all in either case (nor while disabled).\n */\n async clear(): Promise<void> {\n const clear = await this.locatorForOptional('.wr-cascader__clear')();\n if (!clear) {\n throw new Error(\n 'WrCascaderHarness.clear(): this cascader shows no clear control — it is rendered only when ' +\n '`clearable` is on, something is selected, and the control is enabled.'\n );\n }\n await clear.click();\n }\n\n /**\n * Clear from the keyboard — Backspace on the closed trigger.\n *\n * The × {@link clear} clicks is a `tabindex=\"-1\"` span inside the trigger, so no\n * key can ever reach it; Backspace on the trigger is its keyboard twin, and the\n * route a keyboard-only user actually has. Prefer this one in a spec that cares\n * about that user — {@link clear} proves the pointer path and nothing more.\n *\n * The component honours the key only on the CLOSED trigger, so an open panel\n * is closed first with Escape — the step a keyboard user takes too. Sending\n * Backspace into an open panel and returning would be a plausible nothing.\n *\n * Does nothing, rather than throwing, when there is nothing to clear, `clearable`\n * is off, or the cascader is disabled or read-only: that silence IS the\n * component's contract, so a spec asserts it on the value.\n */\n async clearByKeyboard(): Promise<void> {\n if (await this.isOpen()) await this.close();\n await (await this.trigger()).sendKeys(TestKey.BACKSPACE);\n }\n\n /** Move keyboard focus to the trigger. */\n async focus(): Promise<void> {\n return (await this.trigger()).focus();\n }\n\n /** Take focus off the trigger, which is what makes a bound form field touched. */\n async blur(): Promise<void> {\n return (await this.trigger()).blur();\n }\n\n /** Whether the trigger holds keyboard focus. */\n async isFocused(): Promise<boolean> {\n return (await this.trigger()).isFocused();\n }\n\n /** This cascader's panel element in the overlay — the single-element scoped read. */\n private async panel(): Promise<TestElement> {\n return this.documentRootLocatorFactory().locatorFor(`#${await this.panelId()}`)();\n }\n\n /**\n * A loader scoped to THIS cascader's panel — the list scoped read.\n *\n * Scoped by the published id rather than by `.wr-cascader-panel`: the overlay\n * container is shared with every other overlay in the app, so a bare class\n * query would answer with whichever panel happened to be open.\n */\n private async panelLoader(): Promise<HarnessLoader> {\n return this.documentRootLocatorFactory().harnessLoaderFor(`#${await this.panelId()}`);\n }\n\n /** The panel id, refusing to hand it out while there is no panel to find. */\n private async panelId(): Promise<string> {\n if (!(await this.isOpen())) {\n throw new Error(\n 'WrCascaderHarness: the panel is closed, so there are no columns to read — call open() or ' +\n 'selectPath() first. The trigger publishes `aria-controls` even while closed, so the id ' +\n 'alone is not proof the panel exists.'\n );\n }\n\n const id = await this.getPanelId();\n if (!id) {\n throw new Error('WrCascaderHarness: the trigger publishes no `aria-controls`, so its panel cannot be found.');\n }\n return id;\n }\n}\n"],"mappings":";;;;;;;AA2BA,IAAa,0BAAb,MAAa,gCAAgC,iBAAgB;CAE3D,OA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