ngwr 16.4.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 (258) hide show
  1. package/charts/bar-chart/styles/_index.scss +494 -305
  2. package/charts/boxplot-chart/styles/_index.scss +114 -48
  3. package/charts/bullet-chart/styles/_index.scss +113 -42
  4. package/charts/calendar-heatmap/styles/_index.scss +111 -20
  5. package/charts/candlestick-chart/styles/_index.scss +61 -26
  6. package/charts/chart-legend/styles/_index.scss +119 -1
  7. package/charts/core/styles/_index.scss +201 -5
  8. package/charts/donut-chart/styles/_index.scss +76 -21
  9. package/charts/funnel-chart/styles/_index.scss +66 -38
  10. package/charts/gauge/styles/_index.scss +12 -1
  11. package/charts/heatmap-chart/styles/_index.scss +90 -53
  12. package/charts/line-chart/styles/_index.scss +143 -139
  13. package/charts/meter-group/styles/_index.scss +87 -25
  14. package/charts/radar-chart/styles/_index.scss +82 -40
  15. package/charts/scatter-chart/styles/_index.scss +117 -44
  16. package/charts/sparkline/styles/_index.scss +7 -1
  17. package/charts/treemap-chart/styles/_index.scss +94 -42
  18. package/charts/waterfall-chart/styles/_index.scss +150 -87
  19. package/color-picker/styles/_index.scss +7 -3
  20. package/copy-value/styles/_index.scss +21 -2
  21. package/date-stamp/styles/_index.scss +2 -1
  22. package/dialog/styles/_index.scss +6 -0
  23. package/drawer/styles/_index.scss +5 -1
  24. package/fesm2022/ngwr-carousel-testing.mjs +4 -1
  25. package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
  26. package/fesm2022/ngwr-carousel.mjs +21 -2
  27. package/fesm2022/ngwr-carousel.mjs.map +1 -1
  28. package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
  29. package/fesm2022/ngwr-cascader.mjs +48 -4
  30. package/fesm2022/ngwr-cascader.mjs.map +1 -1
  31. package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
  32. package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
  33. package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
  34. package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
  35. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
  36. package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
  37. package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
  38. package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
  39. package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
  40. package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
  41. package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
  42. package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
  43. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
  44. package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
  45. package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
  46. package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
  47. package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
  48. package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
  49. package/fesm2022/ngwr-charts-core.mjs +299 -18
  50. package/fesm2022/ngwr-charts-core.mjs.map +1 -1
  51. package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
  52. package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
  53. package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
  54. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
  55. package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
  56. package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
  57. package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
  58. package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
  59. package/fesm2022/ngwr-charts-gauge.mjs +98 -12
  60. package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
  61. package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
  62. package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
  63. package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
  64. package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
  65. package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
  66. package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
  67. package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
  68. package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
  69. package/fesm2022/ngwr-charts-meter-group.mjs +223 -31
  70. package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
  71. package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
  72. package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
  73. package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
  74. package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
  75. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
  76. package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
  77. package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
  78. package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
  79. package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
  80. package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
  81. package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
  82. package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
  83. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
  84. package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
  85. package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
  86. package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
  87. package/fesm2022/ngwr-color-picker.mjs +44 -4
  88. package/fesm2022/ngwr-color-picker.mjs.map +1 -1
  89. package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
  90. package/fesm2022/ngwr-context-menu.mjs +47 -19
  91. package/fesm2022/ngwr-context-menu.mjs.map +1 -1
  92. package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
  93. package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
  94. package/fesm2022/ngwr-copy-value.mjs +38 -2
  95. package/fesm2022/ngwr-copy-value.mjs.map +1 -1
  96. package/fesm2022/ngwr-date-picker.mjs +56 -8
  97. package/fesm2022/ngwr-date-picker.mjs.map +1 -1
  98. package/fesm2022/ngwr-dialog.mjs +13 -5
  99. package/fesm2022/ngwr-dialog.mjs.map +1 -1
  100. package/fesm2022/ngwr-drawer.mjs +19 -3
  101. package/fesm2022/ngwr-drawer.mjs.map +1 -1
  102. package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
  103. package/fesm2022/ngwr-dropdown.mjs +35 -6
  104. package/fesm2022/ngwr-dropdown.mjs.map +1 -1
  105. package/fesm2022/ngwr-editor.mjs +1 -0
  106. package/fesm2022/ngwr-editor.mjs.map +1 -1
  107. package/fesm2022/ngwr-graph.mjs +81 -13
  108. package/fesm2022/ngwr-graph.mjs.map +1 -1
  109. package/fesm2022/ngwr-i18n-ar.mjs +5 -0
  110. package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
  111. package/fesm2022/ngwr-i18n-cs.mjs +5 -0
  112. package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
  113. package/fesm2022/ngwr-i18n-de.mjs +5 -0
  114. package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
  115. package/fesm2022/ngwr-i18n-en.mjs +5 -0
  116. package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
  117. package/fesm2022/ngwr-i18n-es.mjs +5 -0
  118. package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
  119. package/fesm2022/ngwr-i18n-fr.mjs +5 -0
  120. package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
  121. package/fesm2022/ngwr-i18n-he.mjs +5 -0
  122. package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
  123. package/fesm2022/ngwr-i18n-hi.mjs +5 -0
  124. package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
  125. package/fesm2022/ngwr-i18n-id.mjs +5 -0
  126. package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
  127. package/fesm2022/ngwr-i18n-it.mjs +5 -0
  128. package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
  129. package/fesm2022/ngwr-i18n-ja.mjs +5 -0
  130. package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
  131. package/fesm2022/ngwr-i18n-ko.mjs +5 -0
  132. package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
  133. package/fesm2022/ngwr-i18n-nl.mjs +5 -0
  134. package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
  135. package/fesm2022/ngwr-i18n-pl.mjs +5 -0
  136. package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
  137. package/fesm2022/ngwr-i18n-pt.mjs +5 -0
  138. package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
  139. package/fesm2022/ngwr-i18n-ru.mjs +5 -0
  140. package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
  141. package/fesm2022/ngwr-i18n-sv.mjs +5 -0
  142. package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
  143. package/fesm2022/ngwr-i18n-tr.mjs +5 -0
  144. package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
  145. package/fesm2022/ngwr-i18n-uk.mjs +5 -0
  146. package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
  147. package/fesm2022/ngwr-i18n-vi.mjs +5 -0
  148. package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
  149. package/fesm2022/ngwr-i18n-zh-tw.mjs +5 -0
  150. package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
  151. package/fesm2022/ngwr-i18n-zh.mjs +5 -0
  152. package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
  153. package/fesm2022/ngwr-lightbox.mjs +20 -3
  154. package/fesm2022/ngwr-lightbox.mjs.map +1 -1
  155. package/fesm2022/ngwr-overlay.mjs +21 -2
  156. package/fesm2022/ngwr-overlay.mjs.map +1 -1
  157. package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
  158. package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
  159. package/fesm2022/ngwr-popconfirm.mjs +41 -5
  160. package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
  161. package/fesm2022/ngwr-popover.mjs +67 -12
  162. package/fesm2022/ngwr-popover.mjs.map +1 -1
  163. package/fesm2022/ngwr-schema-form.mjs +2 -0
  164. package/fesm2022/ngwr-schema-form.mjs.map +1 -1
  165. package/fesm2022/ngwr-table.mjs +2 -0
  166. package/fesm2022/ngwr-table.mjs.map +1 -1
  167. package/fesm2022/ngwr-tour.mjs +14 -9
  168. package/fesm2022/ngwr-tour.mjs.map +1 -1
  169. package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
  170. package/fesm2022/ngwr-tree.mjs +49 -16
  171. package/fesm2022/ngwr-tree.mjs.map +1 -1
  172. package/fesm2022/ngwr-version.mjs +1 -1
  173. package/fesm2022/ngwr-version.mjs.map +1 -1
  174. package/fesm2022/ngwr-window.mjs +16 -9
  175. package/fesm2022/ngwr-window.mjs.map +1 -1
  176. package/i18n/ar.json +5 -0
  177. package/i18n/cs.json +5 -0
  178. package/i18n/de.json +5 -0
  179. package/i18n/en.json +5 -0
  180. package/i18n/es.json +5 -0
  181. package/i18n/fr.json +5 -0
  182. package/i18n/he.json +5 -0
  183. package/i18n/hi.json +5 -0
  184. package/i18n/id.json +5 -0
  185. package/i18n/it.json +5 -0
  186. package/i18n/ja.json +5 -0
  187. package/i18n/ko.json +5 -0
  188. package/i18n/nl.json +5 -0
  189. package/i18n/pl.json +5 -0
  190. package/i18n/pt.json +5 -0
  191. package/i18n/ru.json +5 -0
  192. package/i18n/sv.json +5 -0
  193. package/i18n/tr.json +5 -0
  194. package/i18n/uk.json +5 -0
  195. package/i18n/vi.json +5 -0
  196. package/i18n/zh-TW.json +5 -0
  197. package/i18n/zh.json +5 -0
  198. package/llms-full.txt +8 -8
  199. package/llms.txt +7 -3
  200. package/package.json +1 -1
  201. package/popconfirm/styles/_index.scss +6 -0
  202. package/popover/styles/_index.scss +24 -13
  203. package/schematics/use/symbol-map.json +1 -0
  204. package/skills/ngwr/references/catalog.md +1 -1
  205. package/tour/styles/_index.scss +6 -0
  206. package/types/ngwr-carousel-testing.d.ts +6 -4
  207. package/types/ngwr-carousel.d.ts +14 -3
  208. package/types/ngwr-cascader-testing.d.ts +4 -3
  209. package/types/ngwr-cascader.d.ts +27 -3
  210. package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
  211. package/types/ngwr-charts-bar-chart.d.ts +220 -48
  212. package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
  213. package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
  214. package/types/ngwr-charts-bullet-chart.d.ts +72 -12
  215. package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
  216. package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
  217. package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
  218. package/types/ngwr-charts-chart-legend.d.ts +142 -5
  219. package/types/ngwr-charts-core.d.ts +259 -21
  220. package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
  221. package/types/ngwr-charts-donut-chart.d.ts +124 -16
  222. package/types/ngwr-charts-funnel-chart.d.ts +62 -6
  223. package/types/ngwr-charts-gauge-testing.d.ts +5 -1
  224. package/types/ngwr-charts-gauge.d.ts +72 -10
  225. package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
  226. package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
  227. package/types/ngwr-charts-line-chart.d.ts +215 -86
  228. package/types/ngwr-charts-meter-group.d.ts +96 -7
  229. package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
  230. package/types/ngwr-charts-radar-chart.d.ts +148 -28
  231. package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
  232. package/types/ngwr-charts-scatter-chart.d.ts +188 -18
  233. package/types/ngwr-charts-sparkline.d.ts +26 -4
  234. package/types/ngwr-charts-treemap-chart.d.ts +121 -23
  235. package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
  236. package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
  237. package/types/ngwr-color-picker.d.ts +27 -0
  238. package/types/ngwr-context-menu-testing.d.ts +10 -9
  239. package/types/ngwr-context-menu.d.ts +17 -0
  240. package/types/ngwr-copy-value.d.ts +8 -0
  241. package/types/ngwr-date-picker.d.ts +34 -2
  242. package/types/ngwr-dialog.d.ts +30 -10
  243. package/types/ngwr-drawer.d.ts +32 -1
  244. package/types/ngwr-dropdown-testing.d.ts +8 -5
  245. package/types/ngwr-dropdown.d.ts +29 -6
  246. package/types/ngwr-graph.d.ts +22 -6
  247. package/types/ngwr-lightbox.d.ts +15 -0
  248. package/types/ngwr-overlay.d.ts +16 -1
  249. package/types/ngwr-popconfirm-testing.d.ts +11 -2
  250. package/types/ngwr-popconfirm.d.ts +28 -1
  251. package/types/ngwr-popover.d.ts +59 -9
  252. package/types/ngwr-table.d.ts +1 -1
  253. package/types/ngwr-tour.d.ts +21 -2
  254. package/types/ngwr-tree-testing.d.ts +1 -2
  255. package/types/ngwr-tree.d.ts +33 -2
  256. package/types/ngwr-version.d.ts +1 -1
  257. package/types/ngwr-window.d.ts +14 -11
  258. package/window/styles/_index.scss +5 -10
@@ -1,4 +1,5 @@
1
1
  @use '../../theme/styles' as theme;
2
+ @use '../../popover/styles' as popover-styles; // WrPopover
2
3
 
3
4
  @include theme.loaded('copy-value');
4
5
 
@@ -92,13 +93,31 @@
92
93
  }
93
94
 
94
95
  &--wrap {
95
- // The button stays on the first line of a value that runs over several.
96
- align-items: flex-start;
96
+ // Inline flow, not a flex row: a flex text block keeps the width it was
97
+ // offered, so the button would sit at the far edge of a two-line value.
98
+ display: block;
97
99
  }
98
100
 
99
101
  &--wrap &__text {
102
+ display: inline;
100
103
  overflow: visible;
101
104
  white-space: normal;
102
105
  overflow-wrap: anywhere;
103
106
  }
107
+
108
+ // Empty outside `wrap`, so the button stays a flex item of the host.
109
+ &__tail {
110
+ display: contents;
111
+ }
112
+
113
+ // The last character and the button never part; the rest of a long value can still break.
114
+ &--wrap &__tail {
115
+ display: inline;
116
+ white-space: nowrap;
117
+ }
118
+
119
+ &--wrap &__button {
120
+ margin-inline-start: var(--wr-copy-value-gap);
121
+ vertical-align: middle;
122
+ }
104
123
  }
@@ -7,7 +7,8 @@
7
7
  --wr-date-stamp-line-height: var(--wr-text-sm-leading);
8
8
  --wr-date-stamp-date-color: inherit;
9
9
  --wr-date-stamp-time-color: var(--wr-color-on-surface-muted);
10
- --wr-date-stamp-time-font-size: var(--wr-text-sm);
10
+ // Never larger than the date: in a table set below `sm` the time follows it down.
11
+ --wr-date-stamp-time-font-size: min(var(--wr-text-sm), 1em);
11
12
  --wr-date-stamp-empty-color: var(--wr-color-on-surface-muted);
12
13
 
13
14
  display: inline-block;
@@ -64,6 +64,12 @@
64
64
  backdrop-filter: blur(2px);
65
65
  }
66
66
 
67
+ // `autoFocus: 'dialog'` focuses the panel by script. It is a container, never a
68
+ // control, so the browser's own ring on it would read as a stray frame.
69
+ .wr-dialog-panel:focus {
70
+ outline: none;
71
+ }
72
+
67
73
  .wr-dialog-panel {
68
74
  --wr-dialog-bg: var(--wr-color-surface);
69
75
  --wr-dialog-radius: var(--wr-border-radius-lg);
@@ -10,6 +10,11 @@
10
10
  pointer-events: auto;
11
11
  }
12
12
 
13
+ .wr-drawer-overlay:focus {
14
+ // `autoFocus: 'dialog'` focuses the panel by script; it is not a control.
15
+ outline: none;
16
+ }
17
+
13
18
  // Horizontal drawers stretch full-height. The height moved off the CDK inline
14
19
  // style (which can't carry a fallback) so we can offer `dvh` with a `vh`
15
20
  // fallback here; the panel's `height: 100%` then fills it.
@@ -54,7 +59,6 @@
54
59
  padding-block-start: 3.25rem;
55
60
  }
56
61
 
57
-
58
62
  // …and that same flattening puts the content component's own host element
59
63
  // between the panel and the title / content / footer slots, so the panel's
60
64
  // column layout stops one level short: the footer wouldn't pin to the bottom
@@ -95,6 +95,9 @@ var WrCarouselHarness = class WrCarouselHarness extends ComponentHarness {
95
95
  async getLivePoliteness() {
96
96
  return (await this.locatorFor(".wr-carousel__live")()).getAttribute("aria-live");
97
97
  }
98
+ async hasPauseButton() {
99
+ return await this.locatorForOptional(".wr-carousel__toggle")() !== null;
100
+ }
98
101
  async getAutoplayLabel() {
99
102
  return (await this.autoplayButton("getAutoplayLabel")).getAttribute("aria-label");
100
103
  }
@@ -143,7 +146,7 @@ var WrCarouselHarness = class WrCarouselHarness extends ComponentHarness {
143
146
  }
144
147
  async autoplayButton(method) {
145
148
  const button = await this.locatorForOptional(".wr-carousel__toggle")();
146
- if (!button) throw new Error(`WrCarouselHarness.${method}(): this carousel renders no pause button, which it does only with [autoplay] on and two slides or more.`);
149
+ if (!button) throw new Error(`WrCarouselHarness.${method}(): this carousel renders no pause button, which it does only with [autoplay] and [pauseButton] on and two slides or more.`);
147
150
  return button;
148
151
  }
149
152
  async nav(side, caller) {
@@ -1 +1 @@
1
- {"version":3,"file":"ngwr-carousel-testing.mjs","names":[],"sources":["../../../projects/lib/carousel/testing/wr-carousel-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrCarouselHarnessFilters } from './types';\n\n/**\n * The settled percentage out of `translateX(-100%)`, and out of the mid-drag\n * `translateX(calc(-100% + 12px))` — the pixel half is the finger, not the slide.\n */\nconst TRACK_OFFSET = /translateX\\(\\s*(?:calc\\(\\s*)?(-?[\\d.]+)%/;\n\n/**\n * Test harness for `<wr-carousel>` — drive the strip the way someone on the page\n * drives it.\n *\n * Everything it reads is public API: the `.wr-carousel__*` elements, the dots'\n * `aria-current`, and the `aria-roledescription` the viewport and each slide\n * publish. Two things are worth knowing before writing an assertion against it:\n *\n * - **The slides do not say which one is showing.** A `<wr-carousel-slide>` carries\n * `role=\"group\"` and `aria-roledescription=\"slide\"` and nothing else — no\n * `aria-current`, no `aria-hidden` on the ones off-screen. The current slide is\n * published in exactly two places, the dot carrying `aria-current=\"true\"` and the\n * track's own offset, and {@link getActiveIndex} reads them in that order. A\n * move the reader made is also said by the one live region, which\n * {@link getAnnouncement} reads; an autoplay tick is not.\n * - **It never drags.** The swipe the component supports is a touch gesture\n * measured against the viewport's own width, and jsdom has no layout — that width\n * is 0, so the \"20% of the viewport\" threshold is 0 too and EVERY drag clears it,\n * a 1px twitch included. The result says nothing about a real finger, and the spec\n * pins that artifact rather than pretending otherwise. Every move here goes\n * through the arrow buttons and the dots instead, which is the accessible path\n * anyway. `carousel.spec.ts` is where the gesture itself is pinned, by staging the\n * touch events and declaring an `offsetWidth`.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const gallery = await loader.getHarness(WrCarouselHarness.with({ ariaLabel: 'Gallery' }));\n *\n * expect(await gallery.getSlideCount()).toBe(3);\n * await gallery.next();\n * expect(await gallery.getActiveIndex()).toBe(1);\n *\n * await gallery.goTo(2);\n * expect(await gallery.getActiveSlideText()).toBe('Dunes');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCarouselHarness extends ComponentHarness {\n static hostSelector = 'wr-carousel';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCarouselHarnessFilters = {}): HarnessPredicate<WrCarouselHarness> {\n return new HarnessPredicate(WrCarouselHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('slideCount', options.slideCount, async (harness, count) => (await harness.getSlideCount()) === count)\n .addOption('slideText', options.slideText, async (harness, text) => {\n for (const slide of await harness.getSlideTexts()) {\n if (await HarnessPredicate.stringMatches(slide, text)) return true;\n }\n return false;\n });\n }\n\n // What the carousel announces\n\n /**\n * The role the strip announces — `group`, which is what lets\n * `aria-roledescription` mean anything.\n *\n * Read off the VIEWPORT rather than the host, and that is the whole point of the\n * pairing: `aria-roledescription` is dropped on an element with no semantic role,\n * and the host element (`<wr-carousel>`) has none.\n */\n async getRole(): Promise<string | null> {\n return (await this.viewport()).getAttribute('role');\n }\n\n /** How the strip describes itself to a screen reader — `carousel`. */\n async getRoleDescription(): Promise<string | null> {\n return (await this.viewport()).getAttribute('aria-roledescription');\n }\n\n /**\n * The carousel's accessible name.\n *\n * The RESOLVED one, which is the only one the page has: the `ariaLabel` input\n * defaults to `null` and the component runs it through the `ngwr/i18n` catalog\n * (`carousel.label`, falling back to `'Carousel'`), so a consumer who passed\n * nothing still gets a named group and this still answers. Reporting the raw\n * input would say `null` about a carousel that announces itself perfectly well.\n */\n async getAccessibleName(): Promise<string | null> {\n return (await this.viewport()).getAttribute('aria-label');\n }\n\n /** The accessible name of the previous-slide button. Throws when the arrows are not rendered. */\n async getPreviousLabel(): Promise<string | null> {\n return (await this.nav('prev', 'getPreviousLabel')).getAttribute('aria-label');\n }\n\n /** The accessible name of the next-slide button. Throws when the arrows are not rendered. */\n async getNextLabel(): Promise<string | null> {\n return (await this.nav('next', 'getNextLabel')).getAttribute('aria-label');\n }\n\n /**\n * The accessible name of the dot group — what names the row of dots as a set\n * rather than leaving a screen reader with N unexplained buttons.\n *\n * Throws when the dots are not rendered: there is no group to name then, and a\n * `null` would read like a group that lost its label.\n */\n async getPaginationLabel(): Promise<string | null> {\n const dots = await this.locatorForOptional('.wr-carousel__dots')();\n if (!dots) {\n throw new Error(\n 'WrCarouselHarness.getPaginationLabel(): this carousel renders no dot group — the dots are dropped ' +\n 'when [showDots] is false or when there are fewer than two slides.'\n );\n }\n return dots.getAttribute('aria-label');\n }\n\n /**\n * What each slide announces itself as — `slide`, on every one of them, in DOM\n * order.\n *\n * The one piece of ARIA the slides carry, and the reason it is worth asking: it\n * is set on the slide component's own host, so a slide reaching the page through\n * some other element would come back `null` here while the carousel kept working.\n */\n async getSlideRoleDescriptions(): Promise<(string | null)[]> {\n const slides = await this.slides();\n return Promise.all(slides.map(slide => slide.getAttribute('aria-roledescription')));\n }\n\n // What the carousel is showing\n\n /** How many slides the carousel holds. */\n async getSlideCount(): Promise<number> {\n return (await this.slides()).length;\n }\n\n /** The text of every slide, in DOM order. */\n async getSlideTexts(): Promise<string[]> {\n const slides = await this.slides();\n return Promise.all(slides.map(slide => slide.text()));\n }\n\n /**\n * Which slide is showing, as a zero-based index.\n *\n * Taken from the dot carrying `aria-current=\"true\"` whenever the dots are\n * rendered — that attribute is the only thing on the page that tells a screen\n * reader where in the strip it has got to, so it is the answer that matters —\n * and derived from the track's rendered offset when they are not, `[showDots]`\n * being off and a single-slide carousel both dropping the strip entirely.\n *\n * That fallback takes the MAGNITUDE of the offset on purpose. The transform is\n * physical while the slides sit on the inline axis, so a mirrored carousel paints\n * `translateX(100%)` for the very slide an LTR one paints `translateX(-100%)`\n * for; signed, this reported slide -1 for a perfectly healthy RTL carousel.\n *\n * Throws on a carousel with no slides at all — nothing is showing there, and `0`\n * would read like the first slide.\n */\n async getActiveIndex(): Promise<number> {\n const count = await this.getSlideCount();\n if (count === 0) {\n throw new Error(\n 'WrCarouselHarness.getActiveIndex(): this carousel has no <wr-carousel-slide> children, so no slide is ' +\n 'current — 0 would read like the first one.'\n );\n }\n\n const dots = await this.dots();\n if (dots.length) {\n for (let index = 0; index < dots.length; index++) {\n if ((await dots[index].getAttribute('aria-current')) === 'true') return index;\n }\n throw new Error(\n 'WrCarouselHarness.getActiveIndex(): the dots are rendered but none of them carries aria-current, so the ' +\n 'page tells a screen reader that no slide is current. The component clamps `active` into range, so look ' +\n 'for a lost aria-current binding rather than an out-of-range index — the `--active` class alone is paint.'\n );\n }\n\n return Math.round(Math.abs(await this.getTrackOffsetPercent()) / 100);\n }\n\n /** The text of the slide that is showing. Throws on a carousel with no slides. */\n async getActiveSlideText(): Promise<string> {\n const index = await this.getActiveIndex();\n return (await this.slides())[index].text();\n }\n\n /**\n * The track's rendered offset, as a percentage of one viewport: `-100` for the\n * second slide of an LTR carousel, `+100` for the second slide of a mirrored one.\n *\n * Read off the inline `style` attribute rather than through `getCssValue()`,\n * because the percentage only survives where the component wrote it. jsdom hands\n * a declared `transform` straight back through `getComputedStyle`, so\n * `getCssValue()` answers correctly HERE and would stop the moment the same\n * harness ran against a real browser, which resolves the property to a pixel\n * matrix — a green unit test would be hiding it. Mid-drag the component writes\n * `translateX(calc(-100% + 12px))` and this reports the settled `-100`: the pixel\n * half is the finger's own displacement, which is physical in both directions and\n * belongs to no slide.\n *\n * Worth asserting next to {@link getActiveIndex}: it is the same fact painted\n * instead of announced, and a carousel that lights the right dot while parking\n * the track in blank space is exactly the failure nobody sees in a spec.\n */\n async getTrackOffsetPercent(): Promise<number> {\n const style = (await (await this.track()).getAttribute('style')) ?? '';\n const match = TRACK_OFFSET.exec(style);\n if (!match) {\n throw new Error(\n `WrCarouselHarness.getTrackOffsetPercent(): the track carries no translateX() offset (style: \"${style}\"). ` +\n 'That transform is how the carousel moves at all, so it should always be there.'\n );\n }\n return Number(match[1]);\n }\n\n // The controls the carousel renders\n\n /** Whether the prev / next arrows are on the page. Both are dropped together. */\n async hasArrows(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__nav--next')()) !== null;\n }\n\n /** Whether the dot strip is on the page. */\n async hasDots(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__dots')()) !== null;\n }\n\n /** How many dots are rendered — one per slide, or `0` while the strip is hidden. */\n async getDotCount(): Promise<number> {\n return (await this.dots()).length;\n }\n\n /**\n * The accessible name of every dot, in order — `'Go to slide 1'`, … resolved\n * through the `ngwr/i18n` catalog.\n *\n * A dot is a bare button with no text of its own, so this label is all a screen\n * reader has to tell one from another. `[]` when the strip is hidden, matching\n * {@link getDotCount}.\n */\n async getDotLabels(): Promise<(string | null)[]> {\n const dots = await this.dots();\n return Promise.all(dots.map(dot => dot.getAttribute('aria-label')));\n }\n\n // Moving the carousel\n\n /**\n * Click the next-slide arrow.\n *\n * \"Next\" is the next SLIDE, not the next thing on the right: the buttons keep\n * their semantics under `dir=\"rtl\"` and only the travel under them turns around.\n * At the last slide this wraps to the first one, unless `[loop]` is off — in\n * which case the arrow is `disabled` and nothing moves, so nothing is asserted\n * about the move.\n */\n async next(): Promise<void> {\n return (await this.nav('next', 'next')).click();\n }\n\n /** Click the previous-slide arrow. Wraps to the last slide unless `[loop]` is off. */\n async previous(): Promise<void> {\n return (await this.nav('prev', 'previous')).click();\n }\n\n /**\n * Jump to a slide by clicking its dot — the only way the page offers to reach a\n * slide directly.\n *\n * Throws when the dots are hidden (the component's own `goTo()` is still there\n * for a spec holding the instance, but nothing on the page can be clicked) and\n * throws on an index no slide has, rather than clicking nothing and leaving the\n * carousel where it was.\n */\n async goTo(index: number): Promise<void> {\n const dots = await this.dots();\n if (!dots.length) {\n throw new Error(\n `WrCarouselHarness.goTo(${index}): this carousel renders no dots, and they are the only way to reach a ` +\n 'slide directly from the page — they are dropped when [showDots] is false or when there are fewer than ' +\n 'two slides. Use next() / previous(), or write the active index from the host.'\n );\n }\n if (!Number.isInteger(index) || index < 0 || index >= dots.length) {\n throw new Error(\n `WrCarouselHarness.goTo(${index}): out of range — this carousel has ${dots.length} slides, so the index ` +\n `must be a whole number between 0 and ${dots.length - 1}.`\n );\n }\n return dots[index].click();\n }\n\n // What the carousel says\n\n /**\n * The text of the live region: `Slide 2 of 3` after an arrow, a dot or a swipe\n * moved the carousel, and empty before any move and after an autoplay tick.\n */\n async getAnnouncement(): Promise<string> {\n return (await (await this.locatorFor('.wr-carousel__live')()).text()).trim();\n }\n\n /**\n * Whether the live region speaks: `polite`, or `off` while the slides advance on\n * their own, when a tick must not be read out.\n */\n async getLivePoliteness(): Promise<string | null> {\n return (await this.locatorFor('.wr-carousel__live')()).getAttribute('aria-live');\n }\n\n // Autoplay\n\n /**\n * The name of the pause button, which says what a press does next: the pause\n * label while autoplay is on, the play label while it is off, held or not.\n * Throws when the carousel has no such button, which is every carousel\n * without `autoplay`.\n */\n async getAutoplayLabel(): Promise<string | null> {\n return (await this.autoplayButton('getAutoplayLabel')).getAttribute('aria-label');\n }\n\n /** Press the pause button. Throws without `autoplay`. */\n async toggleAutoplay(): Promise<void> {\n return (await this.autoplayButton('toggleAutoplay')).click();\n }\n\n // Holding autoplay\n\n /**\n * Move the pointer onto the carousel, which is what HOLDS autoplay.\n *\n * Aimed at the host and not the viewport, deliberately: the arrows and the dots\n * are the viewport's SIBLINGS, so a viewport-scoped hover would let a slide\n * change under a cursor that is aiming at an arrow.\n */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move the pointer away again, releasing the hold. */\n async mouseAway(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /**\n * Put keyboard focus on the first control the carousel renders — the pause\n * button under `autoplay`, else the previous arrow, or the first dot when the\n * arrows are hidden.\n *\n * This is the keyboard half of the autoplay hold: WCAG 2.2.2 wants a way to stop\n * moving content, and hovering is not one for someone who never touches a mouse,\n * so the component listens for `focusin` on its host as well. Focus lands on the\n * carousel's OWN controls; anything focusable a slide happens to project is not\n * this harness's business, though in a browser it would hold autoplay just the\n * same.\n *\n * Note what this is NOT: the dot of the slide showing. The dots are ordinary\n * buttons with no roving `tabindex`, so each of them is a tab stop of its own and\n * the first one a Tab press meets is the same whatever slide is current —\n * two different questions, answered here and by {@link getActiveIndex}.\n *\n * Throws when the carousel renders no controls at all, because then there is\n * nothing for a Tab press to land on and no keyboard mechanism to assert.\n */\n async focus(): Promise<void> {\n const [first] = await this.controls();\n if (!first) {\n throw new Error(\n 'WrCarouselHarness.focus(): this carousel renders no controls of its own — the arrows and the dots are ' +\n 'both gone (a single slide, or [showArrows] and [showDots] switched off), so a Tab press has nothing ' +\n 'inside it to land on.'\n );\n }\n return first.focus();\n }\n\n /**\n * Take focus off whichever of the carousel's controls holds it, releasing the\n * hold {@link focus} started.\n *\n * Throws when none of them is focused: `focusout` is what the component listens\n * for, and blurring an element that never had focus fires nothing — a quiet\n * no-op here surfaces as an autoplay assertion failing three lines later.\n */\n async blur(): Promise<void> {\n for (const control of await this.controls()) {\n if (await control.isFocused()) return control.blur();\n }\n throw new Error(\n 'WrCarouselHarness.blur(): none of the controls this carousel renders holds focus, so there is no focus to ' +\n 'release. Call focus() first — the hold is released by blurring the element that took it.'\n );\n }\n\n /** Whether one of the carousel's own controls holds focus — which is what holds autoplay. */\n async isFocused(): Promise<boolean> {\n for (const control of await this.controls()) {\n if (await control.isFocused()) return true;\n }\n return false;\n }\n\n // Internals\n\n /** The element that carries the carousel's role and name. */\n private async viewport(): Promise<TestElement> {\n return this.locatorFor('.wr-carousel__viewport')();\n }\n\n /** The moving strip, whose inline transform is where the carousel IS. */\n private async track(): Promise<TestElement> {\n return this.locatorFor('.wr-carousel__track')();\n }\n\n private async slides(): Promise<TestElement[]> {\n return this.locatorForAll('wr-carousel-slide')();\n }\n\n private async dots(): Promise<TestElement[]> {\n return this.locatorForAll('.wr-carousel__dot')();\n }\n\n /**\n * Every control the carousel renders itself, in the order a Tab press meets\n * them: the two arrows, then the dots.\n */\n private async controls(): Promise<TestElement[]> {\n const toggle = await this.locatorForAll('.wr-carousel__toggle')();\n const navs = await this.locatorForAll('.wr-carousel__nav')();\n return [...toggle, ...navs, ...(await this.dots())];\n }\n\n /** One arrow, or a failure naming both reasons it might not be there. */\n private async autoplayButton(method: string): Promise<TestElement> {\n const button = await this.locatorForOptional('.wr-carousel__toggle')();\n if (!button) {\n throw new Error(\n `WrCarouselHarness.${method}(): this carousel renders no pause button, which it does only with ` +\n '[autoplay] on and two slides or more.'\n );\n }\n return button;\n }\n\n private async nav(side: 'prev' | 'next', caller: string): Promise<TestElement> {\n const button = await this.locatorForOptional(`.wr-carousel__nav--${side}`)();\n if (!button) {\n throw new Error(\n `WrCarouselHarness.${caller}(): this carousel renders no ${side} arrow — the arrows are dropped when ` +\n '[showArrows] is false or when there are fewer than two slides to page through.'\n );\n }\n return button;\n }\n}\n"],"mappings":";;;;;;;AAeA,MAAM,eAAe;AAyCrB,IAAa,oBAAb,MAAa,0BAA0B,iBAAgB;CACrD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAoC,CAAA,GAAE;EAChD,OAAO,IAAI,iBAAiB,mBAAmB,OAAO,CAAC,CACpD,UAAU,aAAa,QAAQ,YAAY,SAAS,UACnD,iBAAiB,cAAc,QAAQ,kBAAiB,GAAI,KAAK,CAAC,CACnE,CACA,UAAU,cAAc,QAAQ,YAAY,OAAO,SAAS,UAAW,MAAM,QAAQ,cAAa,MAAQ,KAAK,CAAC,CAChH,UAAU,aAAa,QAAQ,WAAW,OAAO,SAAS,SAAQ;GACjE,KAAK,MAAM,SAAS,MAAM,QAAQ,cAAa,GAC7C,IAAI,MAAM,iBAAiB,cAAc,OAAO,IAAI,GAAG,OAAO;GAEhE,OAAO;EACT,CAAC;CACL;CAYA,MAAM,UAAO;EACX,QAAQ,MAAM,KAAK,SAAQ,EAAA,CAAI,aAAa,MAAM;CACpD;CAGA,MAAM,qBAAkB;EACtB,QAAQ,MAAM,KAAK,SAAQ,EAAA,CAAI,aAAa,sBAAsB;CACpE;CAWA,MAAM,oBAAiB;EACrB,QAAQ,MAAM,KAAK,SAAQ,EAAA,CAAI,aAAa,YAAY;CAC1D;CAGA,MAAM,mBAAgB;EACpB,QAAQ,MAAM,KAAK,IAAI,QAAQ,kBAAkB,EAAA,CAAG,aAAa,YAAY;CAC/E;CAGA,MAAM,eAAY;EAChB,QAAQ,MAAM,KAAK,IAAI,QAAQ,cAAc,EAAA,CAAG,aAAa,YAAY;CAC3E;CASA,MAAM,qBAAkB;EACtB,MAAM,OAAO,MAAM,KAAK,mBAAmB,oBAAoB,CAAC,CAAA;EAChE,IAAI,CAAC,MACH,MAAM,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K,mBAAmB,sBAAsB,MAAM,CAAC,CAAA;EAC1E,IAAI,CAAC,QACH,MAAM,IAAI,MACR,qBAAqB,OAAM,+BAAgC,KAAI,oHACmB;EAGtF,OAAO;CACT"}
1
+ {"version":3,"file":"ngwr-carousel-testing.mjs","names":[],"sources":["../../../projects/lib/carousel/testing/wr-carousel-harness.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrCarouselHarnessFilters } from './types';\n\n/**\n * The settled percentage out of `translateX(-100%)`, and out of the mid-drag\n * `translateX(calc(-100% + 12px))` — the pixel half is the finger, not the slide.\n */\nconst TRACK_OFFSET = /translateX\\(\\s*(?:calc\\(\\s*)?(-?[\\d.]+)%/;\n\n/**\n * Test harness for `<wr-carousel>` — drive the strip the way someone on the page\n * drives it.\n *\n * Everything it reads is public API: the `.wr-carousel__*` elements, the dots'\n * `aria-current`, and the `aria-roledescription` the viewport and each slide\n * publish. Two things are worth knowing before writing an assertion against it:\n *\n * - **The slides do not say which one is showing.** A `<wr-carousel-slide>` carries\n * `role=\"group\"` and `aria-roledescription=\"slide\"` and nothing else — no\n * `aria-current`, no `aria-hidden` on the ones off-screen. The current slide is\n * published in exactly two places, the dot carrying `aria-current=\"true\"` and the\n * track's own offset, and {@link getActiveIndex} reads them in that order. A\n * move the reader made is also said by the one live region, which\n * {@link getAnnouncement} reads; an autoplay tick is not.\n * - **It never drags.** The swipe the component supports is a touch gesture\n * measured against the viewport's own width, and jsdom has no layout — that width\n * is 0, so the \"20% of the viewport\" threshold is 0 too and EVERY drag clears it,\n * a 1px twitch included. The result says nothing about a real finger, and the spec\n * pins that artifact rather than pretending otherwise. Every move here goes\n * through the arrow buttons and the dots instead, which is the accessible path\n * anyway. `carousel.spec.ts` is where the gesture itself is pinned, by staging the\n * touch events and declaring an `offsetWidth`.\n *\n * @example\n * ```ts\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const gallery = await loader.getHarness(WrCarouselHarness.with({ ariaLabel: 'Gallery' }));\n *\n * expect(await gallery.getSlideCount()).toBe(3);\n * await gallery.next();\n * expect(await gallery.getActiveIndex()).toBe(1);\n *\n * await gallery.goTo(2);\n * expect(await gallery.getActiveSlideText()).toBe('Dunes');\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrCarouselHarness extends ComponentHarness {\n static hostSelector = 'wr-carousel';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrCarouselHarnessFilters = {}): HarnessPredicate<WrCarouselHarness> {\n return new HarnessPredicate(WrCarouselHarness, options)\n .addOption('ariaLabel', options.ariaLabel, (harness, label) =>\n HarnessPredicate.stringMatches(harness.getAccessibleName(), label)\n )\n .addOption('slideCount', options.slideCount, async (harness, count) => (await harness.getSlideCount()) === count)\n .addOption('slideText', options.slideText, async (harness, text) => {\n for (const slide of await harness.getSlideTexts()) {\n if (await HarnessPredicate.stringMatches(slide, text)) return true;\n }\n return false;\n });\n }\n\n // What the carousel announces\n\n /**\n * The role the strip announces — `group`, which is what lets\n * `aria-roledescription` mean anything.\n *\n * Read off the VIEWPORT rather than the host, and that is the whole point of the\n * pairing: `aria-roledescription` is dropped on an element with no semantic role,\n * and the host element (`<wr-carousel>`) has none.\n */\n async getRole(): Promise<string | null> {\n return (await this.viewport()).getAttribute('role');\n }\n\n /** How the strip describes itself to a screen reader — `carousel`. */\n async getRoleDescription(): Promise<string | null> {\n return (await this.viewport()).getAttribute('aria-roledescription');\n }\n\n /**\n * The carousel's accessible name.\n *\n * The RESOLVED one, which is the only one the page has: the `ariaLabel` input\n * defaults to `null` and the component runs it through the `ngwr/i18n` catalog\n * (`carousel.label`, falling back to `'Carousel'`), so a consumer who passed\n * nothing still gets a named group and this still answers. Reporting the raw\n * input would say `null` about a carousel that announces itself perfectly well.\n */\n async getAccessibleName(): Promise<string | null> {\n return (await this.viewport()).getAttribute('aria-label');\n }\n\n /** The accessible name of the previous-slide button. Throws when the arrows are not rendered. */\n async getPreviousLabel(): Promise<string | null> {\n return (await this.nav('prev', 'getPreviousLabel')).getAttribute('aria-label');\n }\n\n /** The accessible name of the next-slide button. Throws when the arrows are not rendered. */\n async getNextLabel(): Promise<string | null> {\n return (await this.nav('next', 'getNextLabel')).getAttribute('aria-label');\n }\n\n /**\n * The accessible name of the dot group — what names the row of dots as a set\n * rather than leaving a screen reader with N unexplained buttons.\n *\n * Throws when the dots are not rendered: there is no group to name then, and a\n * `null` would read like a group that lost its label.\n */\n async getPaginationLabel(): Promise<string | null> {\n const dots = await this.locatorForOptional('.wr-carousel__dots')();\n if (!dots) {\n throw new Error(\n 'WrCarouselHarness.getPaginationLabel(): this carousel renders no dot group — the dots are dropped ' +\n 'when [showDots] is false or when there are fewer than two slides.'\n );\n }\n return dots.getAttribute('aria-label');\n }\n\n /**\n * What each slide announces itself as — `slide`, on every one of them, in DOM\n * order.\n *\n * The one piece of ARIA the slides carry, and the reason it is worth asking: it\n * is set on the slide component's own host, so a slide reaching the page through\n * some other element would come back `null` here while the carousel kept working.\n */\n async getSlideRoleDescriptions(): Promise<(string | null)[]> {\n const slides = await this.slides();\n return Promise.all(slides.map(slide => slide.getAttribute('aria-roledescription')));\n }\n\n // What the carousel is showing\n\n /** How many slides the carousel holds. */\n async getSlideCount(): Promise<number> {\n return (await this.slides()).length;\n }\n\n /** The text of every slide, in DOM order. */\n async getSlideTexts(): Promise<string[]> {\n const slides = await this.slides();\n return Promise.all(slides.map(slide => slide.text()));\n }\n\n /**\n * Which slide is showing, as a zero-based index.\n *\n * Taken from the dot carrying `aria-current=\"true\"` whenever the dots are\n * rendered — that attribute is the only thing on the page that tells a screen\n * reader where in the strip it has got to, so it is the answer that matters —\n * and derived from the track's rendered offset when they are not, `[showDots]`\n * being off and a single-slide carousel both dropping the strip entirely.\n *\n * That fallback takes the MAGNITUDE of the offset on purpose. The transform is\n * physical while the slides sit on the inline axis, so a mirrored carousel paints\n * `translateX(100%)` for the very slide an LTR one paints `translateX(-100%)`\n * for; signed, this reported slide -1 for a perfectly healthy RTL carousel.\n *\n * Throws on a carousel with no slides at all — nothing is showing there, and `0`\n * would read like the first slide.\n */\n async getActiveIndex(): Promise<number> {\n const count = await this.getSlideCount();\n if (count === 0) {\n throw new Error(\n 'WrCarouselHarness.getActiveIndex(): this carousel has no <wr-carousel-slide> children, so no slide is ' +\n 'current — 0 would read like the first one.'\n );\n }\n\n const dots = await this.dots();\n if (dots.length) {\n for (let index = 0; index < dots.length; index++) {\n if ((await dots[index].getAttribute('aria-current')) === 'true') return index;\n }\n throw new Error(\n 'WrCarouselHarness.getActiveIndex(): the dots are rendered but none of them carries aria-current, so the ' +\n 'page tells a screen reader that no slide is current. The component clamps `active` into range, so look ' +\n 'for a lost aria-current binding rather than an out-of-range index — the `--active` class alone is paint.'\n );\n }\n\n return Math.round(Math.abs(await this.getTrackOffsetPercent()) / 100);\n }\n\n /** The text of the slide that is showing. Throws on a carousel with no slides. */\n async getActiveSlideText(): Promise<string> {\n const index = await this.getActiveIndex();\n return (await this.slides())[index].text();\n }\n\n /**\n * The track's rendered offset, as a percentage of one viewport: `-100` for the\n * second slide of an LTR carousel, `+100` for the second slide of a mirrored one.\n *\n * Read off the inline `style` attribute rather than through `getCssValue()`,\n * because the percentage only survives where the component wrote it. jsdom hands\n * a declared `transform` straight back through `getComputedStyle`, so\n * `getCssValue()` answers correctly HERE and would stop the moment the same\n * harness ran against a real browser, which resolves the property to a pixel\n * matrix — a green unit test would be hiding it. Mid-drag the component writes\n * `translateX(calc(-100% + 12px))` and this reports the settled `-100`: the pixel\n * half is the finger's own displacement, which is physical in both directions and\n * belongs to no slide.\n *\n * Worth asserting next to {@link getActiveIndex}: it is the same fact painted\n * instead of announced, and a carousel that lights the right dot while parking\n * the track in blank space is exactly the failure nobody sees in a spec.\n */\n async getTrackOffsetPercent(): Promise<number> {\n const style = (await (await this.track()).getAttribute('style')) ?? '';\n const match = TRACK_OFFSET.exec(style);\n if (!match) {\n throw new Error(\n `WrCarouselHarness.getTrackOffsetPercent(): the track carries no translateX() offset (style: \"${style}\"). ` +\n 'That transform is how the carousel moves at all, so it should always be there.'\n );\n }\n return Number(match[1]);\n }\n\n // The controls the carousel renders\n\n /** Whether the prev / next arrows are on the page. Both are dropped together. */\n async hasArrows(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__nav--next')()) !== null;\n }\n\n /** Whether the dot strip is on the page. */\n async hasDots(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__dots')()) !== null;\n }\n\n /** How many dots are rendered — one per slide, or `0` while the strip is hidden. */\n async getDotCount(): Promise<number> {\n return (await this.dots()).length;\n }\n\n /**\n * The accessible name of every dot, in order — `'Go to slide 1'`, … resolved\n * through the `ngwr/i18n` catalog.\n *\n * A dot is a bare button with no text of its own, so this label is all a screen\n * reader has to tell one from another. `[]` when the strip is hidden, matching\n * {@link getDotCount}.\n */\n async getDotLabels(): Promise<(string | null)[]> {\n const dots = await this.dots();\n return Promise.all(dots.map(dot => dot.getAttribute('aria-label')));\n }\n\n // Moving the carousel\n\n /**\n * Click the next-slide arrow.\n *\n * \"Next\" is the next SLIDE, not the next thing on the right: the buttons keep\n * their semantics under `dir=\"rtl\"` and only the travel under them turns around.\n * At the last slide this wraps to the first one, unless `[loop]` is off — in\n * which case the arrow is `disabled` and nothing moves, so nothing is asserted\n * about the move.\n */\n async next(): Promise<void> {\n return (await this.nav('next', 'next')).click();\n }\n\n /** Click the previous-slide arrow. Wraps to the last slide unless `[loop]` is off. */\n async previous(): Promise<void> {\n return (await this.nav('prev', 'previous')).click();\n }\n\n /**\n * Jump to a slide by clicking its dot — the only way the page offers to reach a\n * slide directly.\n *\n * Throws when the dots are hidden (the component's own `goTo()` is still there\n * for a spec holding the instance, but nothing on the page can be clicked) and\n * throws on an index no slide has, rather than clicking nothing and leaving the\n * carousel where it was.\n */\n async goTo(index: number): Promise<void> {\n const dots = await this.dots();\n if (!dots.length) {\n throw new Error(\n `WrCarouselHarness.goTo(${index}): this carousel renders no dots, and they are the only way to reach a ` +\n 'slide directly from the page — they are dropped when [showDots] is false or when there are fewer than ' +\n 'two slides. Use next() / previous(), or write the active index from the host.'\n );\n }\n if (!Number.isInteger(index) || index < 0 || index >= dots.length) {\n throw new Error(\n `WrCarouselHarness.goTo(${index}): out of range — this carousel has ${dots.length} slides, so the index ` +\n `must be a whole number between 0 and ${dots.length - 1}.`\n );\n }\n return dots[index].click();\n }\n\n // What the carousel says\n\n /**\n * The text of the live region: `Slide 2 of 3` after an arrow, a dot or a swipe\n * moved the carousel, and empty before any move and after an autoplay tick.\n */\n async getAnnouncement(): Promise<string> {\n return (await (await this.locatorFor('.wr-carousel__live')()).text()).trim();\n }\n\n /**\n * Whether the live region speaks: `polite`, or `off` while the slides advance on\n * their own, when a tick must not be read out.\n */\n async getLivePoliteness(): Promise<string | null> {\n return (await this.locatorFor('.wr-carousel__live')()).getAttribute('aria-live');\n }\n\n // Autoplay\n\n /** Whether the pause button is on the page: `autoplay` and `pauseButton` on, two slides or more. */\n async hasPauseButton(): Promise<boolean> {\n return (await this.locatorForOptional('.wr-carousel__toggle')()) !== null;\n }\n\n /**\n * The name of the pause button, which says what a press does next: the pause\n * label while autoplay is on, the play label while it is off, held or not.\n * Throws when the button is not drawn, which is every carousel without\n * `autoplay` and `pauseButton`.\n */\n async getAutoplayLabel(): Promise<string | null> {\n return (await this.autoplayButton('getAutoplayLabel')).getAttribute('aria-label');\n }\n\n /** Press the pause button. Throws when the button is not drawn. */\n async toggleAutoplay(): Promise<void> {\n return (await this.autoplayButton('toggleAutoplay')).click();\n }\n\n // Holding autoplay\n\n /**\n * Move the pointer onto the carousel, which is what HOLDS autoplay.\n *\n * Aimed at the host and not the viewport, deliberately: the arrows and the dots\n * are the viewport's SIBLINGS, so a viewport-scoped hover would let a slide\n * change under a cursor that is aiming at an arrow.\n */\n async hover(): Promise<void> {\n return (await this.host()).hover();\n }\n\n /** Move the pointer away again, releasing the hold. */\n async mouseAway(): Promise<void> {\n return (await this.host()).mouseAway();\n }\n\n /**\n * Put keyboard focus on the first control the carousel renders — the pause\n * button under `autoplay` with `pauseButton`, else the previous arrow, or the first dot when the\n * arrows are hidden.\n *\n * This is the keyboard half of the autoplay hold: WCAG 2.2.2 wants a way to stop\n * moving content, and hovering is not one for someone who never touches a mouse,\n * so the component listens for `focusin` on its host as well. Focus lands on the\n * carousel's OWN controls; anything focusable a slide happens to project is not\n * this harness's business, though in a browser it would hold autoplay just the\n * same.\n *\n * Note what this is NOT: the dot of the slide showing. The dots are ordinary\n * buttons with no roving `tabindex`, so each of them is a tab stop of its own and\n * the first one a Tab press meets is the same whatever slide is current —\n * two different questions, answered here and by {@link getActiveIndex}.\n *\n * Throws when the carousel renders no controls at all, because then there is\n * nothing for a Tab press to land on and no keyboard mechanism to assert.\n */\n async focus(): Promise<void> {\n const [first] = await this.controls();\n if (!first) {\n throw new Error(\n 'WrCarouselHarness.focus(): this carousel renders no controls of its own — the arrows and the dots are ' +\n 'both gone (a single slide, or [showArrows] and [showDots] switched off), so a Tab press has nothing ' +\n 'inside it to land on.'\n );\n }\n return first.focus();\n }\n\n /**\n * Take focus off whichever of the carousel's controls holds it, releasing the\n * hold {@link focus} started.\n *\n * Throws when none of them is focused: `focusout` is what the component listens\n * for, and blurring an element that never had focus fires nothing — a quiet\n * no-op here surfaces as an autoplay assertion failing three lines later.\n */\n async blur(): Promise<void> {\n for (const control of await this.controls()) {\n if (await control.isFocused()) return control.blur();\n }\n throw new Error(\n 'WrCarouselHarness.blur(): none of the controls this carousel renders holds focus, so there is no focus to ' +\n 'release. Call focus() first — the hold is released by blurring the element that took it.'\n );\n }\n\n /** Whether one of the carousel's own controls holds focus — which is what holds autoplay. */\n async isFocused(): Promise<boolean> {\n for (const control of await this.controls()) {\n if (await control.isFocused()) return true;\n }\n return false;\n }\n\n // Internals\n\n /** The element that carries the carousel's role and name. */\n private async viewport(): Promise<TestElement> {\n return this.locatorFor('.wr-carousel__viewport')();\n }\n\n /** The moving strip, whose inline transform is where the carousel IS. */\n private async track(): Promise<TestElement> {\n return this.locatorFor('.wr-carousel__track')();\n }\n\n private async slides(): Promise<TestElement[]> {\n return this.locatorForAll('wr-carousel-slide')();\n }\n\n private async dots(): Promise<TestElement[]> {\n return this.locatorForAll('.wr-carousel__dot')();\n }\n\n /**\n * Every control the carousel renders itself, in the order a Tab press meets\n * them: the two arrows, then the dots.\n */\n private async controls(): Promise<TestElement[]> {\n const toggle = await this.locatorForAll('.wr-carousel__toggle')();\n const navs = await this.locatorForAll('.wr-carousel__nav')();\n return [...toggle, ...navs, ...(await this.dots())];\n }\n\n /** One arrow, or a failure naming both reasons it might not be there. */\n private async autoplayButton(method: string): Promise<TestElement> {\n const button = await this.locatorForOptional('.wr-carousel__toggle')();\n if (!button) {\n throw new Error(\n `WrCarouselHarness.${method}(): this carousel renders no pause button, which it does only with ` +\n '[autoplay] and [pauseButton] on and two slides or more.'\n );\n }\n return button;\n }\n\n private async nav(side: 'prev' | 'next', caller: string): Promise<TestElement> {\n const button = await this.locatorForOptional(`.wr-carousel__nav--${side}`)();\n if (!button) {\n throw new Error(\n `WrCarouselHarness.${caller}(): this carousel renders no ${side} arrow — the arrows are dropped when ` +\n '[showArrows] is false or when there are fewer than two slides to page through.'\n );\n }\n return button;\n }\n}\n"],"mappings":";;;;;;;AAeA,MAAM,eAAe;AAyCrB,IAAa,oBAAb,MAAa,0BAA0B,iBAAgB;CACrD,OAAO,eAAe;CAGtB,OAAO,KAAK,UAAoC,CAAA,GAAE;EAChD,OAAO,IAAI,iBAAiB,mBAAmB,OAAO,CAAC,CACpD,UAAU,aAAa,QAAQ,YAAY,SAAS,UACnD,iBAAiB,cAAc,QAAQ,kBAAiB,GAAI,KAAK,CAAC,CACnE,CACA,UAAU,cAAc,QAAQ,YAAY,OAAO,SAAS,UAAW,MAAM,QAAQ,cAAa,MA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AAM,YAAS;EACb,KAAK,MAAM,WAAW,MAAM,KAAK,SAAQ,GACvC,IAAI,MAAM,QAAQ,UAAS,GAAI,OAAO;EAExC,OAAO;CACT;CAKQ,MAAM,WAAQ;EACpB,OAAO,KAAK,WAAW,wBAAwB,CAAC,CAAA;CAClD;CAGQ,MAAM,QAAK;EACjB,OAAO,KAAK,WAAW,qBAAqB,CAAC,CAAA;CAC/C;CAEQ,MAAM,SAAM;EAClB,OAAO,KAAK,cAAc,mBAAmB,CAAC,CAAA;CAChD;CAEQ,MAAM,OAAI;EAChB,OAAO,KAAK,cAAc,mBAAmB,CAAC,CAAA;CAChD;CAMQ,MAAM,WAAQ;EACpB,MAAM,SAAS,MAAM,KAAK,cAAc,sBAAsB,CAAC,CAAA;EAC/D,MAAM,OAAO,MAAM,KAAK,cAAc,mBAAmB,CAAC,CAAA;EAC1D,OAAO;GAAC,GAAG;GAAQ,GAAG;GAAM,GAAI,MAAM,KAAK,KAAI;EAAG;CACpD;CAGQ,MAAM,eAAe,QAAc;EACzC,MAAM,SAAS,MAAM,KAAK,mBAAmB,sBAAsB,CAAC,CAAA;EACpE,IAAI,CAAC,QACH,MAAM,IAAI,MACR,qBAAqB,OAAM,2HACgC;EAG/D,OAAO;CACT;CAEQ,MAAM,IAAI,MAAuB,QAAc;EACrD,MAAM,SAAS,MAAM,KAAK,mBAAmB,sBAAsB,MAAM,CAAC,CAAA;EAC1E,IAAI,CAAC,QACH,MAAM,IAAI,MACR,qBAAqB,OAAM,+BAAgC,KAAI,oHACmB;EAGtF,OAAO;CACT"}
@@ -134,6 +134,10 @@ var WrCarousel = class WrCarousel {
134
134
  ...ngDevMode ? { debugName: "autoplay" } : /* istanbul ignore next */ {},
135
135
  transform: coerceBooleanProperty
136
136
  });
137
+ pauseButton = input(false, {
138
+ ...ngDevMode ? { debugName: "pauseButton" } : /* istanbul ignore next */ {},
139
+ transform: coerceBooleanProperty
140
+ });
137
141
  intervalMs = input(4e3, {
138
142
  ...ngDevMode ? { debugName: "intervalMs" } : /* istanbul ignore next */ {},
139
143
  transform: (v) => Math.max(500, coerceNumberProperty(v, 4e3))
@@ -365,6 +369,13 @@ var WrCarousel = class WrCarousel {
365
369
  isRequired: false,
366
370
  transformFunction: null
367
371
  },
372
+ pauseButton: {
373
+ classPropertyName: "pauseButton",
374
+ publicName: "pauseButton",
375
+ isSignal: true,
376
+ isRequired: false,
377
+ transformFunction: null
378
+ },
368
379
  intervalMs: {
369
380
  classPropertyName: "intervalMs",
370
381
  publicName: "intervalMs",
@@ -400,7 +411,7 @@ var WrCarousel = class WrCarousel {
400
411
  isSignal: true
401
412
  }],
402
413
  ngImport: i0,
403
- template: "<!--\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() && 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",
414
+ template: "<!--\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",
404
415
  encapsulation: i0.ViewEncapsulation.None
405
416
  });
406
417
  };
@@ -425,7 +436,7 @@ i0.ɵɵngDeclareClassMetadata({
425
436
  provide: WR_CAROUSEL,
426
437
  useExisting: forwardRef(() => WrCarousel)
427
438
  }],
428
- template: "<!--\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() && 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"
439
+ template: "<!--\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"
429
440
  }]
430
441
  }],
431
442
  ctorParameters: () => [],
@@ -521,6 +532,14 @@ i0.ɵɵngDeclareClassMetadata({
521
532
  required: false
522
533
  }]
523
534
  }],
535
+ pauseButton: [{
536
+ type: i0.Input,
537
+ args: [{
538
+ isSignal: true,
539
+ alias: "pauseButton",
540
+ required: false
541
+ }]
542
+ }],
524
543
  intervalMs: [{
525
544
  type: i0.Input,
526
545
  args: [{
@@ -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 /** 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, with a pause / play button. Held while the pointer or\n * keyboard focus is inside the carousel and during a swipe. While the reader\n * prefers reduced motion it does not start until they press play. @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, 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() && 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,OAA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A,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,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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