@eui/ecl 21.4.0 → 21.4.1-snapshot-1784883186377

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 (309) hide show
  1. package/assets/i18n-ecl/bg.json +11 -3
  2. package/assets/i18n-ecl/cs.json +11 -3
  3. package/assets/i18n-ecl/da.json +11 -3
  4. package/assets/i18n-ecl/de.json +11 -3
  5. package/assets/i18n-ecl/el.json +11 -3
  6. package/assets/i18n-ecl/en.json +11 -3
  7. package/assets/i18n-ecl/es.json +11 -3
  8. package/assets/i18n-ecl/et.json +75 -67
  9. package/assets/i18n-ecl/fi.json +57 -49
  10. package/assets/i18n-ecl/fr.json +11 -3
  11. package/assets/i18n-ecl/ga.json +11 -3
  12. package/assets/i18n-ecl/hr.json +69 -61
  13. package/assets/i18n-ecl/hu.json +11 -3
  14. package/assets/i18n-ecl/it.json +11 -3
  15. package/assets/i18n-ecl/lt.json +105 -97
  16. package/assets/i18n-ecl/lv.json +11 -3
  17. package/assets/i18n-ecl/mt.json +11 -3
  18. package/assets/i18n-ecl/nl.json +11 -3
  19. package/assets/i18n-ecl/pl.json +113 -105
  20. package/assets/i18n-ecl/pt.json +11 -3
  21. package/assets/i18n-ecl/ro.json +11 -3
  22. package/assets/i18n-ecl/sk.json +11 -3
  23. package/assets/i18n-ecl/sl.json +58 -50
  24. package/assets/i18n-ecl/sv.json +102 -94
  25. package/components/ecl-highlight-box/package.json +4 -0
  26. package/components/ecl-layout-wrapper/package.json +4 -0
  27. package/components/ecl-slogan-ticker/package.json +4 -0
  28. package/docs/changelog.html +47 -0
  29. package/docs/components/EclAccordionSummaryComponent.html +70 -4
  30. package/docs/components/EclAddToCalendarComponent.html +2 -117
  31. package/docs/components/EclAnimatedNumbersComponent.html +21 -3
  32. package/docs/components/EclAnimatedNumbersItemComponent.html +56 -6
  33. package/docs/components/EclAppComponent.html +2 -2
  34. package/docs/components/EclBannerComponent.html +2 -2
  35. package/docs/components/EclBlockquoteComponent.html +2 -2
  36. package/docs/components/EclBreadcrumbComponent.html +2 -2
  37. package/docs/components/EclBreadcrumbSegmentComponent.html +2 -2
  38. package/docs/components/EclButtonComponent.html +3 -3
  39. package/docs/components/EclCardBodyComponent.html +2 -2
  40. package/docs/components/EclCardComponent.html +27 -182
  41. package/docs/components/EclCarouselComponent.html +2 -2
  42. package/docs/components/EclCarouselItemComponent.html +2 -2
  43. package/docs/components/EclCategoryFilterComponent.html +2 -2
  44. package/docs/components/EclCategoryFilterItemComponent.html +2 -2
  45. package/docs/components/EclCategoryFilterListComponent.html +2 -2
  46. package/docs/components/EclCheckboxHelpComponent.html +2 -2
  47. package/docs/components/EclCheckboxLabelComponent.html +2 -2
  48. package/docs/components/EclContentBlockComponent.html +2 -2
  49. package/docs/components/EclContentItemComponent.html +2 -2
  50. package/docs/components/EclDateBlockComponent.html +2 -2
  51. package/docs/components/EclDescriptionListDefinitionComponent.html +2 -2
  52. package/docs/components/EclExpandableComponent.html +2 -2
  53. package/docs/components/EclFactFiguresComponent.html +96 -94
  54. package/docs/components/EclFactFiguresItemComponent.html +6 -45
  55. package/docs/components/EclFactFiguresViewAllComponent.html +6 -45
  56. package/docs/components/EclFeaturedComponent.html +2 -2
  57. package/docs/components/EclFeaturedItemComponent.html +2 -2
  58. package/docs/components/EclFeaturedItemDescriptionComponent.html +2 -2
  59. package/docs/components/EclFileComponent.html +2 -2
  60. package/docs/components/EclFileItemComponent.html +2 -2
  61. package/docs/components/EclFileItemsComponent.html +2 -2
  62. package/docs/components/EclFileTaxonomyComponent.html +2 -2
  63. package/docs/components/EclFormGroupComponent.html +2 -2
  64. package/docs/components/EclFormLabelComponent.html +2 -2
  65. package/docs/components/EclGalleryComponent.html +2 -2
  66. package/docs/components/EclGalleryFooterComponent.html +2 -2
  67. package/docs/components/EclGalleryItemComponent.html +2 -2
  68. package/docs/components/EclHighlightBoxComponent.html +473 -0
  69. package/docs/components/EclIconComponent.html +2 -2
  70. package/docs/components/EclIndicatorComponent-1.html +2 -2
  71. package/docs/components/EclIndicatorComponent.html +2 -2
  72. package/docs/components/EclInpageNavigationComponent.html +2 -2
  73. package/docs/components/EclInpageNavigationItemComponent.html +2 -2
  74. package/docs/components/EclLayoutWrapperComponent.html +775 -0
  75. package/docs/components/EclListIllustrationComponent.html +2 -2
  76. package/docs/components/EclListIllustrationItemComponent.html +2 -2
  77. package/docs/components/EclLoadingIndicatorComponent.html +2 -2
  78. package/docs/components/EclMediaContainerComponent.html +2 -2
  79. package/docs/components/EclMegaMenuComponent.html +2 -2
  80. package/docs/components/EclMegaMenuFeaturedComponent.html +2 -2
  81. package/docs/components/EclMegaMenuInfoComponent.html +2 -2
  82. package/docs/components/EclMegaMenuItemComponent.html +2 -2
  83. package/docs/components/EclMegaMenuSubitemComponent.html +2 -2
  84. package/docs/components/EclMenuComponent.html +9 -457
  85. package/docs/components/EclMenuItemComponent.html +19 -286
  86. package/docs/components/EclMenuMegaComponent.html +2 -2
  87. package/docs/components/EclMenuMegaItemComponent.html +2 -2
  88. package/docs/components/EclModalBodyComponent.html +2 -2
  89. package/docs/components/EclModalComponent.html +2 -2
  90. package/docs/components/EclModalFooterComponent.html +2 -2
  91. package/docs/components/EclModalHeaderComponent.html +2 -2
  92. package/docs/components/EclMultiselectComponent.html +2 -2
  93. package/docs/components/EclMultiselectDropdownComponent.html +3 -3
  94. package/docs/components/EclMultiselectInputComponent.html +2 -2
  95. package/docs/components/EclMultiselectOptgroupComponent.html +2 -2
  96. package/docs/components/EclMultiselectOptionComponent.html +2 -2
  97. package/docs/components/EclNavigationListComponent.html +2 -2
  98. package/docs/components/EclNavigationListItemComponent.html +2 -2
  99. package/docs/components/EclNewsTickerComponent.html +2 -2
  100. package/docs/components/EclNewsTickerItemComponent.html +2 -2
  101. package/docs/components/EclNotificationComponent.html +2 -2
  102. package/docs/components/EclPageHeaderComponent.html +2 -2
  103. package/docs/components/EclPageHeaderDescriptionContainerComponent.html +2 -2
  104. package/docs/components/EclPageHeaderExpandableComponent.html +2 -2
  105. package/docs/components/EclPageHeaderNextComponent.html +2 -2
  106. package/docs/components/EclPageHeaderSectionComponent.html +2 -2
  107. package/docs/components/EclPageHeaderSectionInfoComponent.html +2 -2
  108. package/docs/components/EclPageSummaryComponent.html +101 -4
  109. package/docs/components/EclPaginationComponent.html +2 -2
  110. package/docs/components/EclPaginationItemComponent.html +2 -2
  111. package/docs/components/EclPopoverComponent.html +2 -2
  112. package/docs/components/EclQuizCardComponent.html +46 -622
  113. package/docs/components/EclQuizComponent.html +45 -826
  114. package/docs/components/EclRadioHelpComponent.html +2 -2
  115. package/docs/components/EclRadioLabelComponent.html +2 -2
  116. package/docs/components/EclRangeBubbleComponent.html +2 -2
  117. package/docs/components/EclRangeValueComponent.html +2 -2
  118. package/docs/components/EclRatingFieldComponent.html +2 -2
  119. package/docs/components/EclSearchFormComponent.html +2 -2
  120. package/docs/components/EclSelectContainerComponent.html +2 -2
  121. package/docs/components/EclSiteFooterComponent.html +7 -128
  122. package/docs/components/EclSiteFooterCoownerComponent.html +2 -2
  123. package/docs/components/EclSiteFooterCoreComponent.html +2 -2
  124. package/docs/components/EclSiteFooterFeedbackComponent.html +514 -0
  125. package/docs/components/EclSiteFooterFixedContentEUComponent.html +2 -2
  126. package/docs/components/EclSiteFooterRowCommonComponent.html +2 -2
  127. package/docs/components/EclSiteHeaderActionComponent.html +2 -2
  128. package/docs/components/EclSiteHeaderBannerTopComponent.html +18 -3
  129. package/docs/components/EclSiteHeaderComponent.html +2 -2
  130. package/docs/components/EclSiteHeaderCustomActionComponent.html +2 -2
  131. package/docs/components/EclSiteHeaderEnvironmentComponent.html +2 -2
  132. package/docs/components/EclSiteHeaderLanguageComponent.html +2 -2
  133. package/docs/components/EclSiteHeaderLanguagePopoverComponent.html +2 -2
  134. package/docs/components/EclSiteHeaderLoginComponent.html +2 -2
  135. package/docs/components/EclSiteHeaderNotificationComponent.html +2 -2
  136. package/docs/components/EclSiteHeaderSearchComponent.html +2 -2
  137. package/docs/components/EclSloganTickerComponent.html +539 -0
  138. package/docs/components/EclSocialMediaFollowComponent.html +2 -2
  139. package/docs/components/EclSocialMediaFollowItemComponent.html +2 -2
  140. package/docs/components/EclSplashPageComponent.html +2 -2
  141. package/docs/components/EclSplashPageLanguageCategoryComponent.html +2 -2
  142. package/docs/components/EclSplashPageLanguageContainerComponent.html +2 -2
  143. package/docs/components/EclSplashPageLanguageLinkComponent.html +2 -2
  144. package/docs/components/EclSpotlightComponent.html +2 -2
  145. package/docs/components/EclSpotlightLinkComponent.html +2 -2
  146. package/docs/components/EclStickyContainerComponent.html +2 -2
  147. package/docs/components/EclTabComponent.html +2 -2
  148. package/docs/components/EclTabLabelComponent.html +2 -2
  149. package/docs/components/EclTableSortButtonComponent.html +2 -2
  150. package/docs/components/EclTabsComponent.html +2 -2
  151. package/docs/components/EclTagComponent.html +2 -2
  152. package/docs/components/EclTextMediaComponent.html +2 -2
  153. package/docs/components/EclTimelineComponent.html +2 -2
  154. package/docs/components/EclTimelineItemComponent.html +2 -2
  155. package/docs/components/EclTimelineItemTogglerComponent.html +2 -2
  156. package/docs/directives/EclAccordionDirective.html +18 -31
  157. package/docs/directives/EclAccordionToggleIconDirective.html +261 -0
  158. package/docs/directives/EclAnimatedNumbersItemsDirective.html +1 -1
  159. package/docs/directives/EclAnimatedNumbersSourceDirective.html +65 -2
  160. package/docs/directives/EclAnimatedNumbersSourcesItemDirective.html +1 -1
  161. package/docs/directives/EclAnimatedNumbersSourcesListDirective.html +1 -1
  162. package/docs/directives/EclBannerImageDirective.html +39 -59
  163. package/docs/directives/EclBlockquoteImageDirective.html +0 -4
  164. package/docs/directives/EclFactFiguresDescriptionDirective.html +0 -43
  165. package/docs/directives/EclFactFiguresSourceDirective.html +261 -0
  166. package/docs/directives/EclFactFiguresSourcesItemDirective.html +263 -0
  167. package/docs/directives/EclFactFiguresSourcesListDirective.html +263 -0
  168. package/docs/directives/EclHighlightBoxDescriptionDirective.html +261 -0
  169. package/docs/directives/EclHighlightBoxIconDirective.html +261 -0
  170. package/docs/directives/EclHighlightBoxLinkDirective.html +261 -0
  171. package/docs/directives/EclHighlightBoxTitleDirective.html +261 -0
  172. package/docs/directives/EclLayoutItemDirective.html +400 -0
  173. package/docs/directives/EclLayoutWrapperDescriptionDirective.html +261 -0
  174. package/docs/directives/EclLayoutWrapperTitleDirective.html +261 -0
  175. package/docs/directives/EclLayoutWrapperViewAllDirective.html +261 -0
  176. package/docs/directives/EclLinkDirective.html +1 -1
  177. package/docs/directives/EclSiteFooterActionButtonDirective.html +260 -0
  178. package/docs/directives/EclSiteFooterCoownerListDirective.html +156 -0
  179. package/docs/directives/EclSiteFooterLinkDirective.html +7 -275
  180. package/docs/directives/EclSiteFooterLogoImageDirective.html +7 -275
  181. package/docs/directives/EclSiteFooterLogoLinkDirective.html +7 -275
  182. package/docs/directives/EclSiteFooterPictureDirective.html +7 -275
  183. package/docs/directives/EclSloganTickerListDirective.html +267 -0
  184. package/docs/directives/EclSloganTickerSlideDirective.html +329 -0
  185. package/docs/js/menu-wc.js +60 -3
  186. package/docs/js/menu-wc_es5.js +1 -1
  187. package/docs/js/search/search_index.js +2 -2
  188. package/docs/json/EclAccordionDirective.md +3 -0
  189. package/docs/json/EclAccordionSummaryComponent.md +2 -1
  190. package/docs/json/EclAccordionToggleIconDirective.md +14 -0
  191. package/docs/json/EclAnimatedNumbersComponent.md +1 -0
  192. package/docs/json/EclAnimatedNumbersItemComponent.md +5 -3
  193. package/docs/json/EclAnimatedNumbersItemsDirective.md +1 -1
  194. package/docs/json/EclAnimatedNumbersSourceDirective.md +2 -1
  195. package/docs/json/EclAnimatedNumbersSourcesItemDirective.md +1 -1
  196. package/docs/json/EclAnimatedNumbersSourcesListDirective.md +1 -1
  197. package/docs/json/EclBannerImageDirective.md +7 -0
  198. package/docs/json/EclButtonComponent.md +1 -1
  199. package/docs/json/EclCardComponent.md +2 -1
  200. package/docs/json/EclFactFiguresComponent.md +1 -0
  201. package/docs/json/EclFactFiguresSourceDirective.md +14 -0
  202. package/docs/json/EclFactFiguresSourcesItemDirective.md +16 -0
  203. package/docs/json/EclFactFiguresSourcesListDirective.md +16 -0
  204. package/docs/json/EclHighlightBoxComponent.md +17 -0
  205. package/docs/json/EclHighlightBoxDescriptionDirective.md +11 -0
  206. package/docs/json/EclHighlightBoxIconDirective.md +11 -0
  207. package/docs/json/EclHighlightBoxLinkDirective.md +11 -0
  208. package/docs/json/EclHighlightBoxTitleDirective.md +11 -0
  209. package/docs/json/EclLayoutItemDirective.md +16 -0
  210. package/docs/json/EclLayoutWrapperComponent.md +34 -0
  211. package/docs/json/EclLayoutWrapperDescriptionDirective.md +14 -0
  212. package/docs/json/EclLayoutWrapperTitleDirective.md +14 -0
  213. package/docs/json/EclLayoutWrapperViewAllDirective.md +14 -0
  214. package/docs/json/EclLinkDirective.md +1 -1
  215. package/docs/json/EclPageSummaryComponent.md +14 -1
  216. package/docs/json/EclQuizCardComponent.md +1 -1
  217. package/docs/json/EclQuizComponent.md +2 -0
  218. package/docs/json/EclSiteFooterActionButtonDirective.md +10 -0
  219. package/docs/json/EclSiteFooterCoownerListDirective.md +5 -0
  220. package/docs/json/EclSiteFooterFeedbackComponent.md +27 -0
  221. package/docs/json/EclSiteFooterLinkDirective.md +0 -5
  222. package/docs/json/EclSiteFooterLogoImageDirective.md +0 -5
  223. package/docs/json/EclSiteFooterLogoLinkDirective.md +0 -5
  224. package/docs/json/EclSiteFooterPictureDirective.md +0 -5
  225. package/docs/json/EclSiteHeaderBannerTopComponent.md +2 -1
  226. package/docs/json/EclSloganTickerComponent.md +24 -0
  227. package/docs/json/EclSloganTickerListDirective.md +21 -0
  228. package/docs/json/EclSloganTickerSlideDirective.md +19 -0
  229. package/docs/json/documentation.json +3077 -2566
  230. package/docs/miscellaneous/variables.html +118 -1
  231. package/docs/overview.html +2 -2
  232. package/docs/properties.html +1 -1
  233. package/fesm2022/eui-ecl-components-ecl-accordion.mjs +59 -25
  234. package/fesm2022/eui-ecl-components-ecl-accordion.mjs.map +1 -1
  235. package/fesm2022/eui-ecl-components-ecl-add-to-calendar.mjs +5 -11
  236. package/fesm2022/eui-ecl-components-ecl-add-to-calendar.mjs.map +1 -1
  237. package/fesm2022/eui-ecl-components-ecl-animated-numbers.mjs +35 -21
  238. package/fesm2022/eui-ecl-components-ecl-animated-numbers.mjs.map +1 -1
  239. package/fesm2022/eui-ecl-components-ecl-banner.mjs +22 -7
  240. package/fesm2022/eui-ecl-components-ecl-banner.mjs.map +1 -1
  241. package/fesm2022/eui-ecl-components-ecl-blockquote.mjs +0 -1
  242. package/fesm2022/eui-ecl-components-ecl-blockquote.mjs.map +1 -1
  243. package/fesm2022/eui-ecl-components-ecl-button.mjs.map +1 -1
  244. package/fesm2022/eui-ecl-components-ecl-card.mjs +18 -23
  245. package/fesm2022/eui-ecl-components-ecl-card.mjs.map +1 -1
  246. package/fesm2022/eui-ecl-components-ecl-fact-figures.mjs +104 -31
  247. package/fesm2022/eui-ecl-components-ecl-fact-figures.mjs.map +1 -1
  248. package/fesm2022/eui-ecl-components-ecl-highlight-box.mjs +103 -0
  249. package/fesm2022/eui-ecl-components-ecl-highlight-box.mjs.map +1 -0
  250. package/fesm2022/eui-ecl-components-ecl-icon.mjs +3 -0
  251. package/fesm2022/eui-ecl-components-ecl-icon.mjs.map +1 -1
  252. package/fesm2022/eui-ecl-components-ecl-layout-wrapper.mjs +182 -0
  253. package/fesm2022/eui-ecl-components-ecl-layout-wrapper.mjs.map +1 -0
  254. package/fesm2022/eui-ecl-components-ecl-link.mjs.map +1 -1
  255. package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs +20 -0
  256. package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs.map +1 -1
  257. package/fesm2022/eui-ecl-components-ecl-menu.mjs +40 -74
  258. package/fesm2022/eui-ecl-components-ecl-menu.mjs.map +1 -1
  259. package/fesm2022/eui-ecl-components-ecl-multiselect.mjs +2 -2
  260. package/fesm2022/eui-ecl-components-ecl-multiselect.mjs.map +1 -1
  261. package/fesm2022/eui-ecl-components-ecl-navigation-list.mjs +1 -1
  262. package/fesm2022/eui-ecl-components-ecl-navigation-list.mjs.map +1 -1
  263. package/fesm2022/eui-ecl-components-ecl-page-summary.mjs +30 -6
  264. package/fesm2022/eui-ecl-components-ecl-page-summary.mjs.map +1 -1
  265. package/fesm2022/eui-ecl-components-ecl-quiz.mjs +257 -145
  266. package/fesm2022/eui-ecl-components-ecl-quiz.mjs.map +1 -1
  267. package/fesm2022/eui-ecl-components-ecl-site-footer.mjs +103 -78
  268. package/fesm2022/eui-ecl-components-ecl-site-footer.mjs.map +1 -1
  269. package/fesm2022/eui-ecl-components-ecl-site-header.mjs +11 -3
  270. package/fesm2022/eui-ecl-components-ecl-site-header.mjs.map +1 -1
  271. package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs +320 -0
  272. package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs.map +1 -0
  273. package/fesm2022/eui-ecl-components-ecl-text-media.mjs +6 -6
  274. package/fesm2022/eui-ecl-components-ecl-text-media.mjs.map +1 -1
  275. package/package.json +14 -2
  276. package/types/eui-ecl-components-ecl-accordion.d.ts +23 -5
  277. package/types/eui-ecl-components-ecl-accordion.d.ts.map +1 -1
  278. package/types/eui-ecl-components-ecl-add-to-calendar.d.ts +0 -4
  279. package/types/eui-ecl-components-ecl-add-to-calendar.d.ts.map +1 -1
  280. package/types/eui-ecl-components-ecl-animated-numbers.d.ts +16 -8
  281. package/types/eui-ecl-components-ecl-animated-numbers.d.ts.map +1 -1
  282. package/types/eui-ecl-components-ecl-banner.d.ts +13 -2
  283. package/types/eui-ecl-components-ecl-banner.d.ts.map +1 -1
  284. package/types/eui-ecl-components-ecl-blockquote.d.ts.map +1 -1
  285. package/types/eui-ecl-components-ecl-button.d.ts +1 -1
  286. package/types/eui-ecl-components-ecl-card.d.ts +6 -10
  287. package/types/eui-ecl-components-ecl-card.d.ts.map +1 -1
  288. package/types/eui-ecl-components-ecl-fact-figures.d.ts +60 -10
  289. package/types/eui-ecl-components-ecl-fact-figures.d.ts.map +1 -1
  290. package/types/eui-ecl-components-ecl-highlight-box.d.ts +50 -0
  291. package/types/eui-ecl-components-ecl-highlight-box.d.ts.map +1 -0
  292. package/types/eui-ecl-components-ecl-icon.d.ts.map +1 -1
  293. package/types/eui-ecl-components-ecl-layout-wrapper.d.ts +109 -0
  294. package/types/eui-ecl-components-ecl-layout-wrapper.d.ts.map +1 -0
  295. package/types/eui-ecl-components-ecl-link.d.ts +1 -1
  296. package/types/eui-ecl-components-ecl-mega-menu.d.ts +6 -0
  297. package/types/eui-ecl-components-ecl-mega-menu.d.ts.map +1 -1
  298. package/types/eui-ecl-components-ecl-menu.d.ts +3 -10
  299. package/types/eui-ecl-components-ecl-menu.d.ts.map +1 -1
  300. package/types/eui-ecl-components-ecl-page-summary.d.ts +20 -1
  301. package/types/eui-ecl-components-ecl-page-summary.d.ts.map +1 -1
  302. package/types/eui-ecl-components-ecl-quiz.d.ts +153 -119
  303. package/types/eui-ecl-components-ecl-quiz.d.ts.map +1 -1
  304. package/types/eui-ecl-components-ecl-site-footer.d.ts +40 -22
  305. package/types/eui-ecl-components-ecl-site-footer.d.ts.map +1 -1
  306. package/types/eui-ecl-components-ecl-site-header.d.ts +7 -3
  307. package/types/eui-ecl-components-ecl-site-header.d.ts.map +1 -1
  308. package/types/eui-ecl-components-ecl-slogan-ticker.d.ts +135 -0
  309. package/types/eui-ecl-components-ecl-slogan-ticker.d.ts.map +1 -0
@@ -1,11 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { HostBinding, Directive, input, computed, EventEmitter, signal, ViewChild, Output, ChangeDetectionStrategy, Component, inject, ChangeDetectorRef, ViewChildren, forwardRef, ContentChildren } from '@angular/core';
2
+ import { HostBinding, Directive, input, signal, output, computed, viewChild, ChangeDetectionStrategy, Component, booleanAttribute, viewChildren, inject, ChangeDetectorRef, forwardRef, ContentChildren } from '@angular/core';
3
3
  import { EclIconComponent } from '@eui/ecl/components/ecl-icon';
4
4
  import { ECLBaseDirective, EclRtlService } from '@eui/ecl/core';
5
5
  import * as i1 from '@ngx-translate/core';
6
6
  import { TranslateModule } from '@ngx-translate/core';
7
7
  import { EmblaCarouselDirective } from 'embla-carousel-angular';
8
8
  import { Subject, takeUntil } from 'rxjs';
9
+ import { outputToObservable } from '@angular/core/rxjs-interop';
9
10
 
10
11
  class EclQuizListDirective {
11
12
  constructor() {
@@ -37,14 +38,6 @@ class EclQuizCardComponent extends ECLBaseDirective {
37
38
  * If not provided, a unique ID is generated automatically.
38
39
  */
39
40
  this.id = input(`ecl-quiz-card-${crypto.randomUUID()}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
40
- /**
41
- * Unique identifier for the question element.
42
- */
43
- this.questionId = computed(() => `${this.id()}-question`, ...(ngDevMode ? [{ debugName: "questionId" }] : /* istanbul ignore next */ []));
44
- /**
45
- * Unique identifier for the answer element.
46
- */
47
- this.answerId = computed(() => `${this.id()}-answer`, ...(ngDevMode ? [{ debugName: "answerId" }] : /* istanbul ignore next */ []));
48
41
  /**
49
42
  * The question text displayed on the front of the card.
50
43
  */
@@ -80,16 +73,74 @@ class EclQuizCardComponent extends ECLBaseDirective {
80
73
  */
81
74
  this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
82
75
  /**
83
- * Emitted when the card is flipped.
76
+ * Whether this is the first card in the quiz.
77
+ * Set by the parent EclQuizComponent to render skip-instructions only once.
84
78
  */
85
- this.cardFlip = new EventEmitter();
79
+ this.isFirstCard = signal(false, ...(ngDevMode ? [{ debugName: "isFirstCard" }] : /* istanbul ignore next */ []));
80
+ /**
81
+ * Whether all cards in the quiz have been flipped.
82
+ * Set by the parent EclQuizComponent to restore tabindex on category spans.
83
+ */
84
+ this.allCardsFlipped = signal(false, ...(ngDevMode ? [{ debugName: "allCardsFlipped" }] : /* istanbul ignore next */ []));
86
85
  /** Whether the card is currently flipped (showing back). */
87
86
  this.isFlipped = signal(false, ...(ngDevMode ? [{ debugName: "isFlipped" }] : /* istanbul ignore next */ []));
87
+ /**
88
+ * Emitted when the card is flipped.
89
+ */
90
+ this.cardFlip = output();
91
+ this.questionId = computed(() => `${this.id()}-question`, ...(ngDevMode ? [{ debugName: "questionId" }] : /* istanbul ignore next */ []));
92
+ this.answerId = computed(() => `${this.id()}-answer`, ...(ngDevMode ? [{ debugName: "answerId" }] : /* istanbul ignore next */ []));
93
+ /** Whether the category span currently has focus (for tabindex management). */
94
+ this.categoryHasFocus = signal(false, ...(ngDevMode ? [{ debugName: "categoryHasFocus" }] : /* istanbul ignore next */ []));
88
95
  /** Index of the selected option (poll variant). */
89
96
  this.selectedOptionIndex = signal(null, ...(ngDevMode ? [{ debugName: "selectedOptionIndex" }] : /* istanbul ignore next */ []));
90
97
  /** Whether the selected option is correct (poll variant). */
91
98
  this.isCorrect = signal(null, ...(ngDevMode ? [{ debugName: "isCorrect" }] : /* istanbul ignore next */ []));
92
99
  this.styleTransform = 'translate3d(0px, 0px, 0px)';
100
+ this.frontElementRef = viewChild('frontElement', ...(ngDevMode ? [{ debugName: "frontElementRef" }] : /* istanbul ignore next */ []));
101
+ this.backElementRef = viewChild('backElement', ...(ngDevMode ? [{ debugName: "backElementRef" }] : /* istanbul ignore next */ []));
102
+ this.questionElementRef = viewChild('questionElement', ...(ngDevMode ? [{ debugName: "questionElementRef" }] : /* istanbul ignore next */ []));
103
+ this.answerElementRef = viewChild('answerElement', ...(ngDevMode ? [{ debugName: "answerElementRef" }] : /* istanbul ignore next */ []));
104
+ this.contentElementRef = viewChild('contentElement', ...(ngDevMode ? [{ debugName: "contentElementRef" }] : /* istanbul ignore next */ []));
105
+ this.categorySuccessRef = viewChild('categorySuccess', ...(ngDevMode ? [{ debugName: "categorySuccessRef" }] : /* istanbul ignore next */ []));
106
+ this.categoryErrorRef = viewChild('categoryError', ...(ngDevMode ? [{ debugName: "categoryErrorRef" }] : /* istanbul ignore next */ []));
107
+ }
108
+ /** Get the native front element for height calculations. */
109
+ getFrontElement() {
110
+ return this.frontElementRef()?.nativeElement ?? null;
111
+ }
112
+ /** Get the native back element for height calculations. */
113
+ getBackElement() {
114
+ return this.backElementRef()?.nativeElement ?? null;
115
+ }
116
+ /** Get the native question element for height calculations. */
117
+ getQuestionElement() {
118
+ return this.questionElementRef()?.nativeElement ?? null;
119
+ }
120
+ /** Get the native answer element for height calculations. */
121
+ getAnswerElement() {
122
+ return this.answerElementRef()?.nativeElement ?? null;
123
+ }
124
+ /** Get the native content element for height calculations. */
125
+ getContentElement() {
126
+ return this.contentElementRef()?.nativeElement ?? null;
127
+ }
128
+ /** Get all radio inputs in this card. */
129
+ getRadioInputs() {
130
+ const el = this.frontElementRef()?.nativeElement;
131
+ if (!el) {
132
+ return [];
133
+ }
134
+ return Array.from(el.querySelectorAll('input[type="radio"]'));
135
+ }
136
+ /** Get the first radio input in this card. */
137
+ getFirstRadioInput() {
138
+ return this.getRadioInputs()[0] ?? null;
139
+ }
140
+ /** Get the last radio input in this card. */
141
+ getLastRadioInput() {
142
+ const inputs = this.getRadioInputs();
143
+ return inputs[inputs.length - 1] ?? null;
93
144
  }
94
145
  get cssClasses() {
95
146
  return [
@@ -102,6 +153,17 @@ class EclQuizCardComponent extends ECLBaseDirective {
102
153
  get tabIndex() {
103
154
  return this.variant === 'reveal' ? 0 : null;
104
155
  }
156
+ /** Get the resolved icon name based on variant. */
157
+ getIconName() {
158
+ if (this.icon()) {
159
+ return this.icon();
160
+ }
161
+ return this.variant === 'poll' ? 'question' : 'sparkle';
162
+ }
163
+ /** Get the resolved icon size. */
164
+ getIconSize() {
165
+ return this.iconSize() || (this.variant === 'poll' ? '2xl' : 'xl');
166
+ }
105
167
  /**
106
168
  * Handle click on the card itself (reveal variant).
107
169
  */
@@ -130,6 +192,7 @@ class EclQuizCardComponent extends ECLBaseDirective {
130
192
  this.selectedOptionIndex.set(optionIndex);
131
193
  this.isCorrect.set(optionsList[optionIndex]?.match ?? false);
132
194
  this.flipCard();
195
+ this.focusCategoryAfterFlip();
133
196
  }
134
197
  /**
135
198
  * Handle keyboard on option (poll variant).
@@ -140,6 +203,12 @@ class EclQuizCardComponent extends ECLBaseDirective {
140
203
  this.onOptionClick(optionIndex);
141
204
  }
142
205
  }
206
+ /**
207
+ * Handle blur on the category span. Sets tabindex to -1 so it leaves the tab order.
208
+ */
209
+ onCategoryBlur() {
210
+ this.categoryHasFocus.set(false);
211
+ }
143
212
  /**
144
213
  * Flip the card between front and back.
145
214
  */
@@ -152,39 +221,21 @@ class EclQuizCardComponent extends ECLBaseDirective {
152
221
  }
153
222
  this.cardFlip.emit(event);
154
223
  }
155
- /** Get the native front element for height calculations. */
156
- getFrontElement() {
157
- return this.frontElementRef?.nativeElement ?? null;
158
- }
159
- /** Get the native back element for height calculations. */
160
- getBackElement() {
161
- return this.backElementRef?.nativeElement ?? null;
162
- }
163
- /** Get the native question element for height calculations. */
164
- getQuestionElement() {
165
- return this.questionElementRef?.nativeElement ?? null;
166
- }
167
- /** Get the native answer element for height calculations. */
168
- getAnswerElement() {
169
- return this.answerElementRef?.nativeElement ?? null;
170
- }
171
- /** Get the native content element for height calculations. */
172
- getContentElement() {
173
- return this.contentElementRef?.nativeElement ?? null;
174
- }
175
- /** Get the resolved icon name based on variant. */
176
- getIconName() {
177
- if (this.icon()) {
178
- return this.icon();
179
- }
180
- return this.variant === 'poll' ? 'question' : 'sparkle';
181
- }
182
- /** Get the resolved icon size. */
183
- getIconSize() {
184
- return this.iconSize() || (this.variant === 'poll' ? '2xl' : 'xl');
224
+ /**
225
+ * Focus the correct/incorrect category span after the card flips in poll variant.
226
+ * Uses requestAnimationFrame to ensure the DOM has updated (inert removed from back face).
227
+ */
228
+ focusCategoryAfterFlip() {
229
+ this.categoryHasFocus.set(true);
230
+ requestAnimationFrame(() => {
231
+ const ref = this.isCorrect() ? this.categorySuccessRef() : this.categoryErrorRef();
232
+ if (ref?.nativeElement) {
233
+ ref.nativeElement.focus();
234
+ }
235
+ });
185
236
  }
186
237
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizCardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
187
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: EclQuizCardComponent, isStandalone: true, selector: "li[eclQuizCard]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, question: { classPropertyName: "question", publicName: "question", isSignal: true, isRequired: false, transformFunction: null }, answer: { classPropertyName: "answer", publicName: "answer", isSignal: true, isRequired: false, transformFunction: null }, answerTitle: { classPropertyName: "answerTitle", publicName: "answerTitle", isSignal: true, isRequired: false, transformFunction: null }, category: { classPropertyName: "category", publicName: "category", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cardFlip: "cardFlip" }, host: { listeners: { "click": "onClick()", "keydown": "onKeydown($event)" }, properties: { "attr.id": "id()", "attr.aria-labelledby": "questionId()", "class": "cssClasses", "attr.tabindex": "tabIndex", "style.transform": "styleTransform" } }, viewQueries: [{ propertyName: "frontElementRef", first: true, predicate: ["frontElement"], descendants: true }, { propertyName: "backElementRef", first: true, predicate: ["backElement"], descendants: true }, { propertyName: "questionElementRef", first: true, predicate: ["questionElement"], descendants: true }, { propertyName: "answerElementRef", first: true, predicate: ["answerElement"], descendants: true }, { propertyName: "contentElementRef", first: true, predicate: ["contentElement"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<article class=\"ecl-quiz-card__content\" #contentElement>\n <!-- Front face -->\n <div class=\"ecl-quiz-card__front\" #frontElement [hidden]=\"isFlipped()\">\n <div class=\"ecl-quiz-card__header\">\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon [icon]=\"getIconName()\" [size]=\"getIconSize()\" iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n @if (category()) {\n <span class=\"ecl-quiz-card__category\">{{ category() }}</span>\n }\n </div>\n\n @if (variant === 'reveal') {\n <div class=\"ecl-quiz-card__question\" [id]=\"questionId()\" #questionElement>{{ question() }}</div>\n <!-- Reveal variant: flip label -->\n <div class=\"ecl-quiz-card__flip\">\n {{ 'ecl.quiz.CLICK-TO-REVEAL' | translate }}\n <ecl-icon iconSet=\"phosphor\" icon=\"arrow-clockwise\" size=\"m\"></ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: options -->\n <fieldset>\n <legend class=\"ecl-quiz-card__question\" [id]=\"questionId()\" #questionElement>{{ question() }}</legend>\n <ol class=\"ecl-quiz-card__options\" type=\"A\">\n @for (option of options(); let i = $index; track i) {\n <li class=\"ecl-quiz-card__option\" [attr.data-match]=\"option.match\"\n (mouseup)=\"onOptionClick(i)\">\n <label class=\"ecl-quiz-card__label\">\n <input type=\"radio\" [name]=\"id() + '-options'\" [attr.data-match]=\"option.match\"\n [attr.tabindex]=\"isFlipped() ? -1 : null\"\n (keydown)=\"onOptionKeydown($event, i)\">\n {{ option.text }}</label>\n </li>\n }\n </ol>\n </fieldset>\n }\n </div>\n\n <!-- Back face -->\n <div class=\"ecl-quiz-card__back\" #backElement [hidden]=\"!isFlipped()\" style\n [class.ecl-quiz-card--correct]=\"variant === 'poll' && isCorrect() === true\">\n <div class=\"ecl-quiz-card__header\">\n @if (variant === 'reveal') {\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon [icon]=\"getIconName()\" [size]=\"getIconSize()\" iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: success/error icons and category labels -->\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon icon=\"check-circle\" iconSet=\"phosphor\" size=\"2xl\" class=\"ecl-quiz-card__icon--success\">\n </ecl-icon>\n <ecl-icon icon=\"x-circle\" size=\"2xl\" iconSet=\"phosphor\" class=\"ecl-quiz-card__icon--error\">\n </ecl-icon>\n </div>\n <span class=\"ecl-quiz-card__category ecl-quiz-card__category--success\" [attr.tabindex]=\"isFlipped() && isCorrect() === true ? 0 : null\">Correct</span>\n <span class=\"ecl-quiz-card__category ecl-quiz-card__category--error\" [attr.tabindex]=\"isFlipped() && isCorrect() === false ? 0 : null\">Incorrect</span>\n }\n </div>\n\n <div class=\"ecl-quiz-card__answer\" [id]=\"answerId()\" #answerElement>\n @if (answerTitle()) {\n <div class=\"ecl-quiz-card__answer-title\">{{ answerTitle() }}</div>\n }\n {{ answer() }}\n </div>\n\n @if (variant === 'reveal') {\n <!-- Reveal variant: go back label -->\n <div class=\"ecl-quiz-card__flip\">\n {{ 'ecl.quiz.GO-BACK' | translate }}\n <ecl-icon icon=\"arrow-clockwise\" size=\"m\" iconSet=\"phosphor\"></ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: options list on back (showing selected state) -->\n <ol class=\"ecl-quiz-card__options\" type=\"A\">\n @for (option of options(); let i = $index; track i) {\n <li class=\"ecl-quiz-card__option\"\n [class.ecl-quiz-card__option--selected]=\"selectedOptionIndex() === i\" [attr.data-match]=\"option.match\">\n {{ option.text }}\n </li>\n }\n </ol>\n }\n </div>\n</article>", dependencies: [{ kind: "component", type: EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
238
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: EclQuizCardComponent, isStandalone: true, selector: "li[eclQuizCard]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, question: { classPropertyName: "question", publicName: "question", isSignal: true, isRequired: false, transformFunction: null }, answer: { classPropertyName: "answer", publicName: "answer", isSignal: true, isRequired: false, transformFunction: null }, answerTitle: { classPropertyName: "answerTitle", publicName: "answerTitle", isSignal: true, isRequired: false, transformFunction: null }, category: { classPropertyName: "category", publicName: "category", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, iconSize: { classPropertyName: "iconSize", publicName: "iconSize", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { cardFlip: "cardFlip" }, host: { listeners: { "click": "onClick()", "keydown": "onKeydown($event)" }, properties: { "attr.id": "id()", "attr.aria-labelledby": "questionId()", "class": "cssClasses", "attr.tabindex": "tabIndex", "style.transform": "styleTransform" } }, viewQueries: [{ propertyName: "frontElementRef", first: true, predicate: ["frontElement"], descendants: true, isSignal: true }, { propertyName: "backElementRef", first: true, predicate: ["backElement"], descendants: true, isSignal: true }, { propertyName: "questionElementRef", first: true, predicate: ["questionElement"], descendants: true, isSignal: true }, { propertyName: "answerElementRef", first: true, predicate: ["answerElement"], descendants: true, isSignal: true }, { propertyName: "contentElementRef", first: true, predicate: ["contentElement"], descendants: true, isSignal: true }, { propertyName: "categorySuccessRef", first: true, predicate: ["categorySuccess"], descendants: true, isSignal: true }, { propertyName: "categoryErrorRef", first: true, predicate: ["categoryError"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<article class=\"ecl-quiz-card__content\" #contentElement>\n <!-- Front face -->\n <div class=\"ecl-quiz-card__front\" #frontElement [hidden]=\"isFlipped()\" [inert]=\"isFlipped()\">\n <div class=\"ecl-quiz-card__header\">\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon [icon]=\"getIconName()\" [size]=\"getIconSize()\" iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n @if (category()) {\n <span class=\"ecl-quiz-card__category\">{{ category() }}</span>\n }\n </div>\n\n @if (variant === 'reveal') {\n <div class=\"ecl-quiz-card__question\" [id]=\"questionId()\" #questionElement>{{ question() }}</div>\n <!-- Reveal variant: flip label -->\n <div class=\"ecl-quiz-card__flip\">\n {{ 'ecl.quiz.REVEAL-ANSWER' | translate }}\n <ecl-icon iconSet=\"phosphor\" icon=\"arrow-clockwise\" size=\"m\"></ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: options -->\n <fieldset [attr.aria-describedby]=\"isFirstCard() ? id() + '-skip-instructions' : null\">\n <legend class=\"ecl-quiz-card__question\" [id]=\"questionId()\" #questionElement>{{ question() }}</legend>\n <ol class=\"ecl-quiz-card__options\" type=\"A\">\n @for (option of options(); let i = $index; track i) {\n <li class=\"ecl-quiz-card__option\" [attr.data-match]=\"option.match\" (mouseup)=\"onOptionClick(i)\">\n <label class=\"ecl-quiz-card__label\">\n <input type=\"radio\" [name]=\"id() + '-options'\" [attr.data-match]=\"option.match\"\n [attr.tabindex]=\"isFlipped() ? -1 : null\" (keydown)=\"onOptionKeydown($event, i)\">\n {{ option.text }}</label>\n @if (i === 0 && isFirstCard()) {\n <span class=\"ecl-quiz__skip\" [id]=\"id() + '-skip-instructions'\">{{ 'ecl.quiz.SKIP-INSTRUCTIONS' |\n translate }}</span>\n }\n </li>\n }\n </ol>\n </fieldset>\n }\n </div>\n\n <!-- Back face -->\n <div class=\"ecl-quiz-card__back\" #backElement [hidden]=\"!isFlipped()\" [inert]=\"!isFlipped()\" style\n [class.ecl-quiz-card--correct]=\"variant === 'poll' && isCorrect() === true\">\n <div class=\"ecl-quiz-card__header\">\n @if (variant === 'reveal') {\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon [icon]=\"getIconName()\" [size]=\"getIconSize()\" iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: success/error icons and category labels -->\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon icon=\"check-circle\" iconSet=\"phosphor\" size=\"2xl\" class=\"ecl-quiz-card__icon--success\">\n </ecl-icon>\n <ecl-icon icon=\"x-circle\" size=\"2xl\" iconSet=\"phosphor\" class=\"ecl-quiz-card__icon--error\">\n </ecl-icon>\n </div>\n <span #categorySuccess class=\"ecl-quiz-card__category ecl-quiz-card__category--success\"\n [attr.tabindex]=\"(allCardsFlipped() || categoryHasFocus()) && isCorrect() === true ? 0 : -1\"\n (blur)=\"onCategoryBlur()\">{{\n 'ecl.quiz.CORRECT' | translate }}</span>\n <span #categoryError class=\"ecl-quiz-card__category ecl-quiz-card__category--error\"\n [attr.tabindex]=\"(allCardsFlipped() || categoryHasFocus()) && isCorrect() === false ? 0 : -1\"\n (blur)=\"onCategoryBlur()\">{{\n 'ecl.quiz.INCORRECT' | translate }}</span>\n <span class=\"ecl-quiz-card__sr-status\" role=\"status\" aria-atomic=\"true\">{{ isFlipped() ? (isCorrect() ===\n true ? ('ecl.quiz.CORRECT' | translate) : ('ecl.quiz.INCORRECT' | translate)) : '' }}</span>\n }\n </div>\n\n <div class=\"ecl-quiz-card__answer\" [id]=\"answerId()\" #answerElement>\n @if (answerTitle()) {\n <div class=\"ecl-quiz-card__answer-title\">{{ answerTitle() }}</div>\n }\n {{ answer() }}\n </div>\n\n @if (variant === 'reveal') {\n <!-- Reveal variant: go back label -->\n <div class=\"ecl-quiz-card__flip\">\n {{ 'ecl.quiz.FLIP-BACK' | translate }}\n <ecl-icon icon=\"arrow-clockwise\" size=\"m\" iconSet=\"phosphor\"></ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: options list on back (showing selected state) -->\n <ol class=\"ecl-quiz-card__options\" type=\"A\">\n @for (option of options(); let i = $index; track i) {\n <li class=\"ecl-quiz-card__option\" [class.ecl-quiz-card__option--selected]=\"selectedOptionIndex() === i\"\n [attr.data-match]=\"option.match\">\n @if (selectedOptionIndex() === i) {\n @if (!option.match) {\n <span class=\"ecl-quiz-card__option-assistive-label\">{{ 'ecl.quiz.YOUR-INCORRECT-ANSWER' | translate }}</span>\n }\n @if (option.match) {\n <span class=\"ecl-quiz-card__option-assistive-label\">{{ 'ecl.quiz.YOUR-CORRECT-ANSWER' | translate }}</span>\n }\n } @else if (option.match) {\n <span class=\"ecl-quiz-card__option-assistive-label\">{{ 'ecl.quiz.CORRECT-ANSWER' | translate }}</span>\n }\n {{ option.text }}\n @if (selectedOptionIndex() === i && !option.match) {\n <span class=\"ecl-quiz-card__option-icon\">\n <ecl-icon icon=\"x-circle\" size=\"s\" iconSet=\"phosphor\"\n class=\"ecl-quiz-card__option-icon--error\"></ecl-icon>\n </span>\n }\n @if (option.match) {\n <span class=\"ecl-quiz-card__option-icon\">\n <ecl-icon icon=\"check-circle\" size=\"s\" iconSet=\"phosphor\"\n class=\"ecl-quiz-card__option-icon--success\"></ecl-icon>\n </span>\n }\n </li>\n }\n </ol>\n }\n </div>\n</article>", dependencies: [{ kind: "component", type: EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
188
239
  }
189
240
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizCardComponent, decorators: [{
190
241
  type: Component,
@@ -196,25 +247,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
196
247
  '[style.transform]': 'styleTransform',
197
248
  '(click)': 'onClick()',
198
249
  '(keydown)': 'onKeydown($event)',
199
- }, imports: [EclIconComponent, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article class=\"ecl-quiz-card__content\" #contentElement>\n <!-- Front face -->\n <div class=\"ecl-quiz-card__front\" #frontElement [hidden]=\"isFlipped()\">\n <div class=\"ecl-quiz-card__header\">\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon [icon]=\"getIconName()\" [size]=\"getIconSize()\" iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n @if (category()) {\n <span class=\"ecl-quiz-card__category\">{{ category() }}</span>\n }\n </div>\n\n @if (variant === 'reveal') {\n <div class=\"ecl-quiz-card__question\" [id]=\"questionId()\" #questionElement>{{ question() }}</div>\n <!-- Reveal variant: flip label -->\n <div class=\"ecl-quiz-card__flip\">\n {{ 'ecl.quiz.CLICK-TO-REVEAL' | translate }}\n <ecl-icon iconSet=\"phosphor\" icon=\"arrow-clockwise\" size=\"m\"></ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: options -->\n <fieldset>\n <legend class=\"ecl-quiz-card__question\" [id]=\"questionId()\" #questionElement>{{ question() }}</legend>\n <ol class=\"ecl-quiz-card__options\" type=\"A\">\n @for (option of options(); let i = $index; track i) {\n <li class=\"ecl-quiz-card__option\" [attr.data-match]=\"option.match\"\n (mouseup)=\"onOptionClick(i)\">\n <label class=\"ecl-quiz-card__label\">\n <input type=\"radio\" [name]=\"id() + '-options'\" [attr.data-match]=\"option.match\"\n [attr.tabindex]=\"isFlipped() ? -1 : null\"\n (keydown)=\"onOptionKeydown($event, i)\">\n {{ option.text }}</label>\n </li>\n }\n </ol>\n </fieldset>\n }\n </div>\n\n <!-- Back face -->\n <div class=\"ecl-quiz-card__back\" #backElement [hidden]=\"!isFlipped()\" style\n [class.ecl-quiz-card--correct]=\"variant === 'poll' && isCorrect() === true\">\n <div class=\"ecl-quiz-card__header\">\n @if (variant === 'reveal') {\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon [icon]=\"getIconName()\" [size]=\"getIconSize()\" iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: success/error icons and category labels -->\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon icon=\"check-circle\" iconSet=\"phosphor\" size=\"2xl\" class=\"ecl-quiz-card__icon--success\">\n </ecl-icon>\n <ecl-icon icon=\"x-circle\" size=\"2xl\" iconSet=\"phosphor\" class=\"ecl-quiz-card__icon--error\">\n </ecl-icon>\n </div>\n <span class=\"ecl-quiz-card__category ecl-quiz-card__category--success\" [attr.tabindex]=\"isFlipped() && isCorrect() === true ? 0 : null\">Correct</span>\n <span class=\"ecl-quiz-card__category ecl-quiz-card__category--error\" [attr.tabindex]=\"isFlipped() && isCorrect() === false ? 0 : null\">Incorrect</span>\n }\n </div>\n\n <div class=\"ecl-quiz-card__answer\" [id]=\"answerId()\" #answerElement>\n @if (answerTitle()) {\n <div class=\"ecl-quiz-card__answer-title\">{{ answerTitle() }}</div>\n }\n {{ answer() }}\n </div>\n\n @if (variant === 'reveal') {\n <!-- Reveal variant: go back label -->\n <div class=\"ecl-quiz-card__flip\">\n {{ 'ecl.quiz.GO-BACK' | translate }}\n <ecl-icon icon=\"arrow-clockwise\" size=\"m\" iconSet=\"phosphor\"></ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: options list on back (showing selected state) -->\n <ol class=\"ecl-quiz-card__options\" type=\"A\">\n @for (option of options(); let i = $index; track i) {\n <li class=\"ecl-quiz-card__option\"\n [class.ecl-quiz-card__option--selected]=\"selectedOptionIndex() === i\" [attr.data-match]=\"option.match\">\n {{ option.text }}\n </li>\n }\n </ol>\n }\n </div>\n</article>" }]
200
- }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], question: [{ type: i0.Input, args: [{ isSignal: true, alias: "question", required: false }] }], answer: [{ type: i0.Input, args: [{ isSignal: true, alias: "answer", required: false }] }], answerTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "answerTitle", required: false }] }], category: [{ type: i0.Input, args: [{ isSignal: true, alias: "category", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], cardFlip: [{
201
- type: Output
202
- }], frontElementRef: [{
203
- type: ViewChild,
204
- args: ['frontElement']
205
- }], backElementRef: [{
206
- type: ViewChild,
207
- args: ['backElement']
208
- }], questionElementRef: [{
209
- type: ViewChild,
210
- args: ['questionElement']
211
- }], answerElementRef: [{
212
- type: ViewChild,
213
- args: ['answerElement']
214
- }], contentElementRef: [{
215
- type: ViewChild,
216
- args: ['contentElement']
217
- }] } });
250
+ }, imports: [EclIconComponent, TranslateModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<article class=\"ecl-quiz-card__content\" #contentElement>\n <!-- Front face -->\n <div class=\"ecl-quiz-card__front\" #frontElement [hidden]=\"isFlipped()\" [inert]=\"isFlipped()\">\n <div class=\"ecl-quiz-card__header\">\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon [icon]=\"getIconName()\" [size]=\"getIconSize()\" iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n @if (category()) {\n <span class=\"ecl-quiz-card__category\">{{ category() }}</span>\n }\n </div>\n\n @if (variant === 'reveal') {\n <div class=\"ecl-quiz-card__question\" [id]=\"questionId()\" #questionElement>{{ question() }}</div>\n <!-- Reveal variant: flip label -->\n <div class=\"ecl-quiz-card__flip\">\n {{ 'ecl.quiz.REVEAL-ANSWER' | translate }}\n <ecl-icon iconSet=\"phosphor\" icon=\"arrow-clockwise\" size=\"m\"></ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: options -->\n <fieldset [attr.aria-describedby]=\"isFirstCard() ? id() + '-skip-instructions' : null\">\n <legend class=\"ecl-quiz-card__question\" [id]=\"questionId()\" #questionElement>{{ question() }}</legend>\n <ol class=\"ecl-quiz-card__options\" type=\"A\">\n @for (option of options(); let i = $index; track i) {\n <li class=\"ecl-quiz-card__option\" [attr.data-match]=\"option.match\" (mouseup)=\"onOptionClick(i)\">\n <label class=\"ecl-quiz-card__label\">\n <input type=\"radio\" [name]=\"id() + '-options'\" [attr.data-match]=\"option.match\"\n [attr.tabindex]=\"isFlipped() ? -1 : null\" (keydown)=\"onOptionKeydown($event, i)\">\n {{ option.text }}</label>\n @if (i === 0 && isFirstCard()) {\n <span class=\"ecl-quiz__skip\" [id]=\"id() + '-skip-instructions'\">{{ 'ecl.quiz.SKIP-INSTRUCTIONS' |\n translate }}</span>\n }\n </li>\n }\n </ol>\n </fieldset>\n }\n </div>\n\n <!-- Back face -->\n <div class=\"ecl-quiz-card__back\" #backElement [hidden]=\"!isFlipped()\" [inert]=\"!isFlipped()\" style\n [class.ecl-quiz-card--correct]=\"variant === 'poll' && isCorrect() === true\">\n <div class=\"ecl-quiz-card__header\">\n @if (variant === 'reveal') {\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon [icon]=\"getIconName()\" [size]=\"getIconSize()\" iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: success/error icons and category labels -->\n <div class=\"ecl-quiz-card__icon\">\n <ecl-icon icon=\"check-circle\" iconSet=\"phosphor\" size=\"2xl\" class=\"ecl-quiz-card__icon--success\">\n </ecl-icon>\n <ecl-icon icon=\"x-circle\" size=\"2xl\" iconSet=\"phosphor\" class=\"ecl-quiz-card__icon--error\">\n </ecl-icon>\n </div>\n <span #categorySuccess class=\"ecl-quiz-card__category ecl-quiz-card__category--success\"\n [attr.tabindex]=\"(allCardsFlipped() || categoryHasFocus()) && isCorrect() === true ? 0 : -1\"\n (blur)=\"onCategoryBlur()\">{{\n 'ecl.quiz.CORRECT' | translate }}</span>\n <span #categoryError class=\"ecl-quiz-card__category ecl-quiz-card__category--error\"\n [attr.tabindex]=\"(allCardsFlipped() || categoryHasFocus()) && isCorrect() === false ? 0 : -1\"\n (blur)=\"onCategoryBlur()\">{{\n 'ecl.quiz.INCORRECT' | translate }}</span>\n <span class=\"ecl-quiz-card__sr-status\" role=\"status\" aria-atomic=\"true\">{{ isFlipped() ? (isCorrect() ===\n true ? ('ecl.quiz.CORRECT' | translate) : ('ecl.quiz.INCORRECT' | translate)) : '' }}</span>\n }\n </div>\n\n <div class=\"ecl-quiz-card__answer\" [id]=\"answerId()\" #answerElement>\n @if (answerTitle()) {\n <div class=\"ecl-quiz-card__answer-title\">{{ answerTitle() }}</div>\n }\n {{ answer() }}\n </div>\n\n @if (variant === 'reveal') {\n <!-- Reveal variant: go back label -->\n <div class=\"ecl-quiz-card__flip\">\n {{ 'ecl.quiz.FLIP-BACK' | translate }}\n <ecl-icon icon=\"arrow-clockwise\" size=\"m\" iconSet=\"phosphor\"></ecl-icon>\n </div>\n } @else {\n <!-- Poll variant: options list on back (showing selected state) -->\n <ol class=\"ecl-quiz-card__options\" type=\"A\">\n @for (option of options(); let i = $index; track i) {\n <li class=\"ecl-quiz-card__option\" [class.ecl-quiz-card__option--selected]=\"selectedOptionIndex() === i\"\n [attr.data-match]=\"option.match\">\n @if (selectedOptionIndex() === i) {\n @if (!option.match) {\n <span class=\"ecl-quiz-card__option-assistive-label\">{{ 'ecl.quiz.YOUR-INCORRECT-ANSWER' | translate }}</span>\n }\n @if (option.match) {\n <span class=\"ecl-quiz-card__option-assistive-label\">{{ 'ecl.quiz.YOUR-CORRECT-ANSWER' | translate }}</span>\n }\n } @else if (option.match) {\n <span class=\"ecl-quiz-card__option-assistive-label\">{{ 'ecl.quiz.CORRECT-ANSWER' | translate }}</span>\n }\n {{ option.text }}\n @if (selectedOptionIndex() === i && !option.match) {\n <span class=\"ecl-quiz-card__option-icon\">\n <ecl-icon icon=\"x-circle\" size=\"s\" iconSet=\"phosphor\"\n class=\"ecl-quiz-card__option-icon--error\"></ecl-icon>\n </span>\n }\n @if (option.match) {\n <span class=\"ecl-quiz-card__option-icon\">\n <ecl-icon icon=\"check-circle\" size=\"s\" iconSet=\"phosphor\"\n class=\"ecl-quiz-card__option-icon--success\"></ecl-icon>\n </span>\n }\n </li>\n }\n </ol>\n }\n </div>\n</article>" }]
251
+ }], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], question: [{ type: i0.Input, args: [{ isSignal: true, alias: "question", required: false }] }], answer: [{ type: i0.Input, args: [{ isSignal: true, alias: "answer", required: false }] }], answerTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "answerTitle", required: false }] }], category: [{ type: i0.Input, args: [{ isSignal: true, alias: "category", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], iconSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSize", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], cardFlip: [{ type: i0.Output, args: ["cardFlip"] }], frontElementRef: [{ type: i0.ViewChild, args: ['frontElement', { isSignal: true }] }], backElementRef: [{ type: i0.ViewChild, args: ['backElement', { isSignal: true }] }], questionElementRef: [{ type: i0.ViewChild, args: ['questionElement', { isSignal: true }] }], answerElementRef: [{ type: i0.ViewChild, args: ['answerElement', { isSignal: true }] }], contentElementRef: [{ type: i0.ViewChild, args: ['contentElement', { isSignal: true }] }], categorySuccessRef: [{ type: i0.ViewChild, args: ['categorySuccess', { isSignal: true }] }], categoryErrorRef: [{ type: i0.ViewChild, args: ['categoryError', { isSignal: true }] }] } });
218
252
 
219
253
  /**
220
254
  * ECL Quiz component – renders a carousel of quiz cards with navigation.
@@ -232,8 +266,12 @@ class EclQuizComponent extends ECLBaseDirective {
232
266
  this.eclTitle = input('', ...(ngDevMode ? [{ debugName: "eclTitle" }] : /* istanbul ignore next */ []));
233
267
  /** Description displayed below the title. */
234
268
  this.eclDescription = input('', ...(ngDevMode ? [{ debugName: "eclDescription" }] : /* istanbul ignore next */ []));
269
+ this.isFullWidth = input(false, { ...(ngDevMode ? { debugName: "isFullWidth" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
270
+ this.hasBackground = input(false, { ...(ngDevMode ? { debugName: "hasBackground" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
235
271
  /** Embla carousel options matching ECL's configuration. */
236
272
  this.emblaOptions = { loop: false, align: 'start', direction: 'ltr' };
273
+ /** Subscribed Embla events. */
274
+ this.subscribeToEvents = ['select', 'init', 'reInit'];
237
275
  /** Current snap index. */
238
276
  this.activeIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
239
277
  /** Total number of snap points. */
@@ -246,26 +284,82 @@ class EclQuizComponent extends ECLBaseDirective {
246
284
  this.nextDisabled = signal(true, ...(ngDevMode ? [{ debugName: "nextDisabled" }] : /* istanbul ignore next */ []));
247
285
  /** Whether navigation controls should be shown. */
248
286
  this.showControls = signal(false, ...(ngDevMode ? [{ debugName: "showControls" }] : /* istanbul ignore next */ []));
287
+ this.emblaRef = viewChild(EmblaCarouselDirective, ...(ngDevMode ? [{ debugName: "emblaRef" }] : /* istanbul ignore next */ []));
288
+ this.dotButtons = viewChildren('dotButton', ...(ngDevMode ? [{ debugName: "dotButtons" }] : /* istanbul ignore next */ []));
249
289
  this.cd = inject(ChangeDetectorRef);
250
290
  this.eclRtlService = inject(EclRtlService);
251
291
  this.destroy$ = new Subject();
252
- /** Subscribed Embla events. */
253
- this.subscribeToEvents = ['select', 'init', 'reInit'];
254
292
  }
255
293
  get cssClasses() {
256
294
  return [
257
295
  super.getCssClasses('ecl-quiz'),
258
296
  `ecl-quiz--${this.variant()}`,
297
+ this.hasBackground() ? 'ecl-quiz--background' : '',
298
+ this.isFullWidth() ? 'ecl-quiz--full-width' : '',
259
299
  ]
260
300
  .join(' ')
261
301
  .trim();
262
302
  }
303
+ /** Returns an array of indices for dot rendering. */
304
+ getDotIndices() {
305
+ return Array.from({ length: this.totalSnaps() }, (_, i) => i);
306
+ }
307
+ /** Called by the emblaChange event from the directive. */
308
+ onEmblaChange(eventName) {
309
+ if (!this.emblaApi) {
310
+ this.emblaApi = this.emblaRef()?.emblaApi;
311
+ }
312
+ if (!this.emblaApi) {
313
+ return;
314
+ }
315
+ if (eventName === 'select' || eventName === 'init' || eventName === 'reInit') {
316
+ this.syncState();
317
+ }
318
+ if (eventName === 'reInit') {
319
+ this.checkHeight();
320
+ }
321
+ }
322
+ /** Handle keyboard events. */
323
+ onKeydown(event) {
324
+ if (event.key === 'Escape') {
325
+ this.escapeSlider();
326
+ return;
327
+ }
328
+ if (this.variant() === 'poll' && event.key === 'Tab') {
329
+ this.handlePollTabNavigation(event);
330
+ }
331
+ }
332
+ /** Navigate to the previous snap. */
333
+ onPrevClick() {
334
+ const embla = this.emblaRef();
335
+ if (embla) {
336
+ embla.scrollPrev();
337
+ }
338
+ }
339
+ /** Navigate to the next snap. */
340
+ onNextClick() {
341
+ const embla = this.emblaRef();
342
+ if (embla) {
343
+ embla.scrollNext();
344
+ }
345
+ }
346
+ /** Navigate to a specific snap index. */
347
+ goTo(index) {
348
+ const embla = this.emblaRef();
349
+ if (embla) {
350
+ embla.scrollTo(index);
351
+ }
352
+ }
263
353
  ngAfterContentInit() {
264
354
  if (this.cards && this.cards.length > 1) {
265
355
  this.showControls.set(true);
266
356
  }
267
357
  this.propagateVariant();
268
- this.cards.changes.subscribe(() => this.propagateVariant());
358
+ this.subscribeToCardFlips();
359
+ this.cards.changes.subscribe(() => {
360
+ this.propagateVariant();
361
+ this.subscribeToCardFlips();
362
+ });
269
363
  this.eclRtlService.currentRtlState$.pipe(takeUntil(this.destroy$)).subscribe((isRtl) => {
270
364
  const direction = isRtl ? 'rtl' : 'ltr';
271
365
  if (this.emblaOptions.direction !== direction) {
@@ -275,7 +369,6 @@ class EclQuizComponent extends ECLBaseDirective {
275
369
  });
276
370
  }
277
371
  ngAfterViewInit() {
278
- // Give Embla time to initialize
279
372
  setTimeout(() => {
280
373
  this.initEmbla();
281
374
  });
@@ -284,51 +377,71 @@ class EclQuizComponent extends ECLBaseDirective {
284
377
  this.destroy$.next();
285
378
  this.destroy$.complete();
286
379
  }
287
- /** Handle keyboard events. */
288
- onKeydown(event) {
289
- if (event.key === 'Escape') {
290
- this.escapeSlider();
291
- }
292
- }
293
- /** Navigate to the previous snap. */
294
- onPrevClick() {
295
- if (this.emblaRef) {
296
- this.emblaRef.scrollPrev();
380
+ /** Initialize Embla and wire up state syncing. */
381
+ initEmbla() {
382
+ const embla = this.emblaRef();
383
+ if (!embla) {
384
+ return;
297
385
  }
298
- }
299
- /** Navigate to the next snap. */
300
- onNextClick() {
301
- if (this.emblaRef) {
302
- this.emblaRef.scrollNext();
386
+ this.emblaApi = embla.emblaApi;
387
+ if (!this.emblaApi) {
388
+ return;
303
389
  }
390
+ this.syncState();
391
+ this.checkHeight();
392
+ this.cd.detectChanges();
304
393
  }
305
- /** Navigate to a specific snap index. */
306
- goTo(index) {
307
- if (this.emblaRef) {
308
- this.emblaRef.scrollTo(index);
394
+ /** Sync component state from Embla API. */
395
+ syncState() {
396
+ if (!this.emblaApi) {
397
+ return;
309
398
  }
399
+ const snapList = this.emblaApi.scrollSnapList();
400
+ const selectedSnap = this.emblaApi.selectedScrollSnap();
401
+ const canScrollPrev = this.emblaApi.canScrollPrev();
402
+ const canScrollNext = this.emblaApi.canScrollNext();
403
+ this.totalSnaps.set(snapList.length);
404
+ this.activeIndex.set(selectedSnap);
405
+ this.prevDisabled.set(!canScrollPrev);
406
+ this.nextDisabled.set(!canScrollNext);
407
+ this.showControls.set(canScrollPrev || canScrollNext);
408
+ this.updateCounter();
310
409
  }
311
- /** Returns the total number of cards. */
312
- getCardsCount() {
313
- return this.cards?.length ?? 0;
314
- }
315
- /** Returns an array of indices for dot rendering. */
316
- getDotIndices() {
317
- return Array.from({ length: this.totalSnaps() }, (_, i) => i);
410
+ /** Update the counter text (mobile). */
411
+ updateCounter() {
412
+ const total = this.totalSnaps();
413
+ const current = this.activeIndex() + 1;
414
+ this.counterText.set(`${current} / ${total}`);
318
415
  }
319
- /** Called by the emblaChange event from the directive. */
320
- onEmblaChange(eventName) {
321
- if (!this.emblaApi) {
322
- this.emblaApi = this.emblaRef?.emblaApi;
416
+ /** Move focus to the last dot button when Escape is pressed. */
417
+ escapeSlider() {
418
+ const dots = this.dotButtons();
419
+ if (dots && dots.length > 0) {
420
+ const lastDot = dots[dots.length - 1];
421
+ lastDot.nativeElement.focus();
323
422
  }
324
- if (!this.emblaApi) {
423
+ }
424
+ /** Subscribe to cardFlip events on all cards to detect when all are flipped. */
425
+ subscribeToCardFlips() {
426
+ if (this.variant() !== 'poll') {
325
427
  return;
326
428
  }
327
- if (eventName === 'select' || eventName === 'init' || eventName === 'reInit') {
328
- this.syncState();
429
+ this.cards?.forEach(card => {
430
+ outputToObservable(card.cardFlip).pipe(takeUntil(this.destroy$)).subscribe(() => {
431
+ this.checkAllCardsFlipped();
432
+ });
433
+ });
434
+ }
435
+ /** Check if all cards are flipped and propagate the state. */
436
+ checkAllCardsFlipped() {
437
+ if (!this.cards || this.variant() !== 'poll') {
438
+ return;
329
439
  }
330
- if (eventName === 'reInit') {
331
- this.checkHeight();
440
+ const allFlipped = this.cards.toArray().every(card => card.isFlipped());
441
+ if (allFlipped) {
442
+ this.cards.forEach(card => {
443
+ card.allCardsFlipped.set(true);
444
+ });
332
445
  }
333
446
  }
334
447
  /**
@@ -399,57 +512,62 @@ class EclQuizComponent extends ECLBaseDirective {
399
512
  });
400
513
  }
401
514
  }
402
- /** Initialize Embla and wire up state syncing. */
403
- initEmbla() {
404
- if (!this.emblaRef) {
515
+ /**
516
+ * Handle Tab/Shift+Tab navigation between unflipped poll cards.
517
+ * Tab from a radio input jumps to the first radio of the next unflipped card.
518
+ * Shift+Tab from a radio input jumps to the last radio of the previous unflipped card.
519
+ * If no unflipped card is found in that direction, native Tab takes over.
520
+ */
521
+ handlePollTabNavigation(event) {
522
+ const target = event.target;
523
+ if (!(target instanceof HTMLInputElement) || target.type !== 'radio') {
405
524
  return;
406
525
  }
407
- this.emblaApi = this.emblaRef.emblaApi;
408
- if (!this.emblaApi) {
526
+ const cardsArray = this.cards.toArray();
527
+ const currentCardIndex = cardsArray.findIndex(card => {
528
+ const radios = card.getRadioInputs();
529
+ return radios.includes(target);
530
+ });
531
+ if (currentCardIndex === -1) {
409
532
  return;
410
533
  }
411
- this.syncState();
412
- this.checkHeight();
413
- this.cd.detectChanges();
414
- }
415
- /** Sync component state from Embla API. */
416
- syncState() {
417
- if (!this.emblaApi) {
418
- return;
534
+ if (event.shiftKey) {
535
+ for (let i = currentCardIndex - 1; i >= 0; i--) {
536
+ if (!cardsArray[i].isFlipped()) {
537
+ event.preventDefault();
538
+ this.goTo(i);
539
+ const lastInput = cardsArray[i].getLastRadioInput();
540
+ if (lastInput) {
541
+ lastInput.focus();
542
+ }
543
+ return;
544
+ }
545
+ }
419
546
  }
420
- const snapList = this.emblaApi.scrollSnapList();
421
- const selectedSnap = this.emblaApi.selectedScrollSnap();
422
- const canScrollPrev = this.emblaApi.canScrollPrev();
423
- const canScrollNext = this.emblaApi.canScrollNext();
424
- this.totalSnaps.set(snapList.length);
425
- this.activeIndex.set(selectedSnap);
426
- this.prevDisabled.set(!canScrollPrev);
427
- this.nextDisabled.set(!canScrollNext);
428
- this.showControls.set(canScrollPrev || canScrollNext);
429
- this.updateCounter();
430
- }
431
- /** Update the counter text (mobile). */
432
- updateCounter() {
433
- const total = this.totalSnaps();
434
- const current = this.activeIndex() + 1;
435
- this.counterText.set(`${current} / ${total}`);
436
- }
437
- /** Move focus to the last dot button when Escape is pressed. */
438
- escapeSlider() {
439
- if (this.dotButtons && this.dotButtons.length > 0) {
440
- const lastDot = this.dotButtons.last;
441
- lastDot.nativeElement.focus();
547
+ else {
548
+ for (let i = currentCardIndex + 1; i < cardsArray.length; i++) {
549
+ if (!cardsArray[i].isFlipped()) {
550
+ event.preventDefault();
551
+ this.goTo(i);
552
+ const firstInput = cardsArray[i].getFirstRadioInput();
553
+ if (firstInput) {
554
+ firstInput.focus();
555
+ }
556
+ return;
557
+ }
558
+ }
442
559
  }
443
560
  }
444
561
  /** Propagate the variant to all child cards. */
445
562
  propagateVariant() {
446
563
  const v = this.variant();
447
- this.cards?.forEach(card => {
564
+ this.cards?.forEach((card, index) => {
448
565
  card.variant = v;
566
+ card.isFirstCard.set(index === 0);
449
567
  });
450
568
  }
451
569
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
452
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: EclQuizComponent, isStandalone: true, selector: "section[eclQuiz]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, eclTitle: { classPropertyName: "eclTitle", publicName: "eclTitle", isSignal: true, isRequired: false, transformFunction: null }, eclDescription: { classPropertyName: "eclDescription", publicName: "eclDescription", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "cssClasses" } }, queries: [{ propertyName: "cards", predicate: i0.forwardRef(() => EclQuizCardComponent), descendants: true }], viewQueries: [{ propertyName: "emblaRef", first: true, predicate: EmblaCarouselDirective, descendants: true }, { propertyName: "dotButtons", predicate: ["dotButton"], descendants: true }], usesInheritance: true, ngImport: i0, template: "@if (eclTitle() || eclDescription()) {\n<div class=\"ecl-quiz__header\">\n @if (eclTitle()) {\n <div class=\"ecl-quiz__title\">{{ eclTitle() }}</div>\n }\n @if (eclDescription()) {\n <div class=\"ecl-quiz__description\">{{ eclDescription() }}</div>\n }\n</div>\n}\n\n<div class=\"ecl-quiz__viewport\" data-ecl-quiz-slider\n role=\"region\"\n aria-label=\"Quiz slider\"\n aria-roledescription=\"carousel\"\n emblaCarousel\n [options]=\"emblaOptions\"\n [subscribeToEvents]=\"subscribeToEvents\"\n (emblaChange)=\"onEmblaChange($event)\">\n \n <ng-content></ng-content>\n</div>\n\n@if (showControls()) {\n<div class=\"ecl-quiz__pager\">\n <button\n class=\"ecl-quiz__prev\"\n [disabled]=\"prevDisabled()\"\n (click)=\"onPrevClick()\">\n <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-270\"></ecl-icon>\n <span class=\"ecl-quiz__prev-label\">\n {{ 'ecl.quiz.PREVIOUS' | translate }}\n </span>\n </button>\n\n <div class=\"ecl-quiz__dots\">\n @for (dotIndex of getDotIndices(); track dotIndex) {\n <button\n #dotButton\n class=\"ecl-quiz__dot\"\n [class.ecl-quiz__dot--active]=\"dotIndex === activeIndex()\"\n [class.is-prev]=\"dotIndex === activeIndex() - 1\"\n [attr.aria-label]=\"'ecl.quiz.GO-TO-SLIDE' | translate: { current: dotIndex + 1, total: totalSnaps() }\"\n (click)=\"goTo(dotIndex)\">\n </button>\n }\n </div>\n\n <button\n class=\"ecl-quiz__next\"\n [disabled]=\"nextDisabled()\"\n (click)=\"onNextClick()\">\n <span class=\"ecl-quiz__next-label\">\n {{ 'ecl.quiz.NEXT' | translate }}\n </span>\n <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-90\"></ecl-icon>\n </button>\n</div>\n\n<div class=\"ecl-quiz__counter\">{{ counterText() }}</div>\n}\n\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "directive", type: EmblaCarouselDirective, selector: "[emblaCarousel]", inputs: ["options", "plugins", "subscribeToEvents", "eventsThrottleTime"], outputs: ["emblaChange"], exportAs: ["emblaCarousel"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
570
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: EclQuizComponent, isStandalone: true, selector: "section[eclQuiz]", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, eclTitle: { classPropertyName: "eclTitle", publicName: "eclTitle", isSignal: true, isRequired: false, transformFunction: null }, eclDescription: { classPropertyName: "eclDescription", publicName: "eclDescription", isSignal: true, isRequired: false, transformFunction: null }, isFullWidth: { classPropertyName: "isFullWidth", publicName: "isFullWidth", isSignal: true, isRequired: false, transformFunction: null }, hasBackground: { classPropertyName: "hasBackground", publicName: "hasBackground", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "class": "cssClasses" } }, queries: [{ propertyName: "cards", predicate: i0.forwardRef(() => EclQuizCardComponent), descendants: true }], viewQueries: [{ propertyName: "emblaRef", first: true, predicate: EmblaCarouselDirective, descendants: true, isSignal: true }, { propertyName: "dotButtons", predicate: ["dotButton"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (eclTitle() || eclDescription()) {\n<div class=\"ecl-quiz__header\">\n @if (eclTitle()) {\n <div class=\"ecl-quiz__title\">{{ eclTitle() }}</div>\n }\n @if (eclDescription()) {\n <div class=\"ecl-quiz__description\">{{ eclDescription() }}</div>\n }\n</div>\n}\n\n<div class=\"ecl-quiz__viewport\" data-ecl-quiz-slider\n role=\"region\"\n aria-label=\"Quiz slider\"\n aria-roledescription=\"carousel\"\n emblaCarousel\n [options]=\"emblaOptions\"\n [subscribeToEvents]=\"subscribeToEvents\"\n (emblaChange)=\"onEmblaChange($event)\">\n \n <ng-content></ng-content>\n</div>\n\n@if (showControls()) {\n<div class=\"ecl-quiz__pager\">\n <button\n class=\"ecl-quiz__prev\"\n [disabled]=\"prevDisabled()\"\n (click)=\"onPrevClick()\">\n <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-270\"></ecl-icon>\n <span class=\"ecl-quiz__prev-label\">\n {{ 'ecl.quiz.PREVIOUS' | translate }}\n </span>\n </button>\n\n <div class=\"ecl-quiz__dots\">\n @for (dotIndex of getDotIndices(); track dotIndex) {\n <button\n #dotButton\n class=\"ecl-quiz__dot\"\n [class.ecl-quiz__dot--active]=\"dotIndex === activeIndex()\"\n [class.is-prev]=\"dotIndex === activeIndex() - 1\"\n [attr.aria-label]=\"'ecl.quiz.GO-TO-SLIDE' | translate: { current: dotIndex + 1, total: totalSnaps() }\"\n (click)=\"goTo(dotIndex)\">\n </button>\n }\n </div>\n\n <button\n class=\"ecl-quiz__next\"\n [disabled]=\"nextDisabled()\"\n (click)=\"onNextClick()\">\n <span class=\"ecl-quiz__next-label\">\n {{ 'ecl.quiz.NEXT' | translate }}\n </span>\n <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-90\"></ecl-icon>\n </button>\n</div>\n\n<div class=\"ecl-quiz__counter\">{{ counterText() }}</div>\n}\n\n", dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "component", type: EclIconComponent, selector: "ecl-icon", inputs: ["iconSet", "icon", "size", "color", "transform", "ariaLabelledby", "role", "title", "ariaHidden", "focusable", "isFlipHorizontal"] }, { kind: "directive", type: EmblaCarouselDirective, selector: "[emblaCarousel]", inputs: ["options", "plugins", "subscribeToEvents", "eventsThrottleTime"], outputs: ["emblaChange"], exportAs: ["emblaCarousel"] }, { kind: "pipe", type: i1.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
453
571
  }
454
572
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizComponent, decorators: [{
455
573
  type: Component,
@@ -461,16 +579,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
461
579
  EclIconComponent,
462
580
  EmblaCarouselDirective,
463
581
  ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (eclTitle() || eclDescription()) {\n<div class=\"ecl-quiz__header\">\n @if (eclTitle()) {\n <div class=\"ecl-quiz__title\">{{ eclTitle() }}</div>\n }\n @if (eclDescription()) {\n <div class=\"ecl-quiz__description\">{{ eclDescription() }}</div>\n }\n</div>\n}\n\n<div class=\"ecl-quiz__viewport\" data-ecl-quiz-slider\n role=\"region\"\n aria-label=\"Quiz slider\"\n aria-roledescription=\"carousel\"\n emblaCarousel\n [options]=\"emblaOptions\"\n [subscribeToEvents]=\"subscribeToEvents\"\n (emblaChange)=\"onEmblaChange($event)\">\n \n <ng-content></ng-content>\n</div>\n\n@if (showControls()) {\n<div class=\"ecl-quiz__pager\">\n <button\n class=\"ecl-quiz__prev\"\n [disabled]=\"prevDisabled()\"\n (click)=\"onPrevClick()\">\n <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-270\"></ecl-icon>\n <span class=\"ecl-quiz__prev-label\">\n {{ 'ecl.quiz.PREVIOUS' | translate }}\n </span>\n </button>\n\n <div class=\"ecl-quiz__dots\">\n @for (dotIndex of getDotIndices(); track dotIndex) {\n <button\n #dotButton\n class=\"ecl-quiz__dot\"\n [class.ecl-quiz__dot--active]=\"dotIndex === activeIndex()\"\n [class.is-prev]=\"dotIndex === activeIndex() - 1\"\n [attr.aria-label]=\"'ecl.quiz.GO-TO-SLIDE' | translate: { current: dotIndex + 1, total: totalSnaps() }\"\n (click)=\"goTo(dotIndex)\">\n </button>\n }\n </div>\n\n <button\n class=\"ecl-quiz__next\"\n [disabled]=\"nextDisabled()\"\n (click)=\"onNextClick()\">\n <span class=\"ecl-quiz__next-label\">\n {{ 'ecl.quiz.NEXT' | translate }}\n </span>\n <ecl-icon icon=\"corner-arrow\" size=\"xs\" transform=\"rotate-90\"></ecl-icon>\n </button>\n</div>\n\n<div class=\"ecl-quiz__counter\">{{ counterText() }}</div>\n}\n\n" }]
464
- }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], eclTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "eclTitle", required: false }] }], eclDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "eclDescription", required: false }] }], cards: [{
582
+ }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], eclTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "eclTitle", required: false }] }], eclDescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "eclDescription", required: false }] }], isFullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "isFullWidth", required: false }] }], hasBackground: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasBackground", required: false }] }], cards: [{
465
583
  type: ContentChildren,
466
584
  args: [forwardRef(() => EclQuizCardComponent), { descendants: true }]
467
- }], emblaRef: [{
468
- type: ViewChild,
469
- args: [EmblaCarouselDirective]
470
- }], dotButtons: [{
471
- type: ViewChildren,
472
- args: ['dotButton']
473
- }] } });
585
+ }], emblaRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => EmblaCarouselDirective), { isSignal: true }] }], dotButtons: [{ type: i0.ViewChildren, args: ['dotButton', { isSignal: true }] }] } });
474
586
 
475
587
  const EUI_ECL_QUIZ = [
476
588
  EclQuizComponent,