@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.
- package/assets/i18n-ecl/bg.json +11 -3
- package/assets/i18n-ecl/cs.json +11 -3
- package/assets/i18n-ecl/da.json +11 -3
- package/assets/i18n-ecl/de.json +11 -3
- package/assets/i18n-ecl/el.json +11 -3
- package/assets/i18n-ecl/en.json +11 -3
- package/assets/i18n-ecl/es.json +11 -3
- package/assets/i18n-ecl/et.json +75 -67
- package/assets/i18n-ecl/fi.json +57 -49
- package/assets/i18n-ecl/fr.json +11 -3
- package/assets/i18n-ecl/ga.json +11 -3
- package/assets/i18n-ecl/hr.json +69 -61
- package/assets/i18n-ecl/hu.json +11 -3
- package/assets/i18n-ecl/it.json +11 -3
- package/assets/i18n-ecl/lt.json +105 -97
- package/assets/i18n-ecl/lv.json +11 -3
- package/assets/i18n-ecl/mt.json +11 -3
- package/assets/i18n-ecl/nl.json +11 -3
- package/assets/i18n-ecl/pl.json +113 -105
- package/assets/i18n-ecl/pt.json +11 -3
- package/assets/i18n-ecl/ro.json +11 -3
- package/assets/i18n-ecl/sk.json +11 -3
- package/assets/i18n-ecl/sl.json +58 -50
- package/assets/i18n-ecl/sv.json +102 -94
- package/components/ecl-highlight-box/package.json +4 -0
- package/components/ecl-layout-wrapper/package.json +4 -0
- package/components/ecl-slogan-ticker/package.json +4 -0
- package/docs/changelog.html +47 -0
- package/docs/components/EclAccordionSummaryComponent.html +70 -4
- package/docs/components/EclAddToCalendarComponent.html +2 -117
- package/docs/components/EclAnimatedNumbersComponent.html +21 -3
- package/docs/components/EclAnimatedNumbersItemComponent.html +56 -6
- package/docs/components/EclAppComponent.html +2 -2
- package/docs/components/EclBannerComponent.html +2 -2
- package/docs/components/EclBlockquoteComponent.html +2 -2
- package/docs/components/EclBreadcrumbComponent.html +2 -2
- package/docs/components/EclBreadcrumbSegmentComponent.html +2 -2
- package/docs/components/EclButtonComponent.html +3 -3
- package/docs/components/EclCardBodyComponent.html +2 -2
- package/docs/components/EclCardComponent.html +27 -182
- package/docs/components/EclCarouselComponent.html +2 -2
- package/docs/components/EclCarouselItemComponent.html +2 -2
- package/docs/components/EclCategoryFilterComponent.html +2 -2
- package/docs/components/EclCategoryFilterItemComponent.html +2 -2
- package/docs/components/EclCategoryFilterListComponent.html +2 -2
- package/docs/components/EclCheckboxHelpComponent.html +2 -2
- package/docs/components/EclCheckboxLabelComponent.html +2 -2
- package/docs/components/EclContentBlockComponent.html +2 -2
- package/docs/components/EclContentItemComponent.html +2 -2
- package/docs/components/EclDateBlockComponent.html +2 -2
- package/docs/components/EclDescriptionListDefinitionComponent.html +2 -2
- package/docs/components/EclExpandableComponent.html +2 -2
- package/docs/components/EclFactFiguresComponent.html +96 -94
- package/docs/components/EclFactFiguresItemComponent.html +6 -45
- package/docs/components/EclFactFiguresViewAllComponent.html +6 -45
- package/docs/components/EclFeaturedComponent.html +2 -2
- package/docs/components/EclFeaturedItemComponent.html +2 -2
- package/docs/components/EclFeaturedItemDescriptionComponent.html +2 -2
- package/docs/components/EclFileComponent.html +2 -2
- package/docs/components/EclFileItemComponent.html +2 -2
- package/docs/components/EclFileItemsComponent.html +2 -2
- package/docs/components/EclFileTaxonomyComponent.html +2 -2
- package/docs/components/EclFormGroupComponent.html +2 -2
- package/docs/components/EclFormLabelComponent.html +2 -2
- package/docs/components/EclGalleryComponent.html +2 -2
- package/docs/components/EclGalleryFooterComponent.html +2 -2
- package/docs/components/EclGalleryItemComponent.html +2 -2
- package/docs/components/EclHighlightBoxComponent.html +473 -0
- package/docs/components/EclIconComponent.html +2 -2
- package/docs/components/EclIndicatorComponent-1.html +2 -2
- package/docs/components/EclIndicatorComponent.html +2 -2
- package/docs/components/EclInpageNavigationComponent.html +2 -2
- package/docs/components/EclInpageNavigationItemComponent.html +2 -2
- package/docs/components/EclLayoutWrapperComponent.html +775 -0
- package/docs/components/EclListIllustrationComponent.html +2 -2
- package/docs/components/EclListIllustrationItemComponent.html +2 -2
- package/docs/components/EclLoadingIndicatorComponent.html +2 -2
- package/docs/components/EclMediaContainerComponent.html +2 -2
- package/docs/components/EclMegaMenuComponent.html +2 -2
- package/docs/components/EclMegaMenuFeaturedComponent.html +2 -2
- package/docs/components/EclMegaMenuInfoComponent.html +2 -2
- package/docs/components/EclMegaMenuItemComponent.html +2 -2
- package/docs/components/EclMegaMenuSubitemComponent.html +2 -2
- package/docs/components/EclMenuComponent.html +9 -457
- package/docs/components/EclMenuItemComponent.html +19 -286
- package/docs/components/EclMenuMegaComponent.html +2 -2
- package/docs/components/EclMenuMegaItemComponent.html +2 -2
- package/docs/components/EclModalBodyComponent.html +2 -2
- package/docs/components/EclModalComponent.html +2 -2
- package/docs/components/EclModalFooterComponent.html +2 -2
- package/docs/components/EclModalHeaderComponent.html +2 -2
- package/docs/components/EclMultiselectComponent.html +2 -2
- package/docs/components/EclMultiselectDropdownComponent.html +3 -3
- package/docs/components/EclMultiselectInputComponent.html +2 -2
- package/docs/components/EclMultiselectOptgroupComponent.html +2 -2
- package/docs/components/EclMultiselectOptionComponent.html +2 -2
- package/docs/components/EclNavigationListComponent.html +2 -2
- package/docs/components/EclNavigationListItemComponent.html +2 -2
- package/docs/components/EclNewsTickerComponent.html +2 -2
- package/docs/components/EclNewsTickerItemComponent.html +2 -2
- package/docs/components/EclNotificationComponent.html +2 -2
- package/docs/components/EclPageHeaderComponent.html +2 -2
- package/docs/components/EclPageHeaderDescriptionContainerComponent.html +2 -2
- package/docs/components/EclPageHeaderExpandableComponent.html +2 -2
- package/docs/components/EclPageHeaderNextComponent.html +2 -2
- package/docs/components/EclPageHeaderSectionComponent.html +2 -2
- package/docs/components/EclPageHeaderSectionInfoComponent.html +2 -2
- package/docs/components/EclPageSummaryComponent.html +101 -4
- package/docs/components/EclPaginationComponent.html +2 -2
- package/docs/components/EclPaginationItemComponent.html +2 -2
- package/docs/components/EclPopoverComponent.html +2 -2
- package/docs/components/EclQuizCardComponent.html +46 -622
- package/docs/components/EclQuizComponent.html +45 -826
- package/docs/components/EclRadioHelpComponent.html +2 -2
- package/docs/components/EclRadioLabelComponent.html +2 -2
- package/docs/components/EclRangeBubbleComponent.html +2 -2
- package/docs/components/EclRangeValueComponent.html +2 -2
- package/docs/components/EclRatingFieldComponent.html +2 -2
- package/docs/components/EclSearchFormComponent.html +2 -2
- package/docs/components/EclSelectContainerComponent.html +2 -2
- package/docs/components/EclSiteFooterComponent.html +7 -128
- package/docs/components/EclSiteFooterCoownerComponent.html +2 -2
- package/docs/components/EclSiteFooterCoreComponent.html +2 -2
- package/docs/components/EclSiteFooterFeedbackComponent.html +514 -0
- package/docs/components/EclSiteFooterFixedContentEUComponent.html +2 -2
- package/docs/components/EclSiteFooterRowCommonComponent.html +2 -2
- package/docs/components/EclSiteHeaderActionComponent.html +2 -2
- package/docs/components/EclSiteHeaderBannerTopComponent.html +18 -3
- package/docs/components/EclSiteHeaderComponent.html +2 -2
- package/docs/components/EclSiteHeaderCustomActionComponent.html +2 -2
- package/docs/components/EclSiteHeaderEnvironmentComponent.html +2 -2
- package/docs/components/EclSiteHeaderLanguageComponent.html +2 -2
- package/docs/components/EclSiteHeaderLanguagePopoverComponent.html +2 -2
- package/docs/components/EclSiteHeaderLoginComponent.html +2 -2
- package/docs/components/EclSiteHeaderNotificationComponent.html +2 -2
- package/docs/components/EclSiteHeaderSearchComponent.html +2 -2
- package/docs/components/EclSloganTickerComponent.html +539 -0
- package/docs/components/EclSocialMediaFollowComponent.html +2 -2
- package/docs/components/EclSocialMediaFollowItemComponent.html +2 -2
- package/docs/components/EclSplashPageComponent.html +2 -2
- package/docs/components/EclSplashPageLanguageCategoryComponent.html +2 -2
- package/docs/components/EclSplashPageLanguageContainerComponent.html +2 -2
- package/docs/components/EclSplashPageLanguageLinkComponent.html +2 -2
- package/docs/components/EclSpotlightComponent.html +2 -2
- package/docs/components/EclSpotlightLinkComponent.html +2 -2
- package/docs/components/EclStickyContainerComponent.html +2 -2
- package/docs/components/EclTabComponent.html +2 -2
- package/docs/components/EclTabLabelComponent.html +2 -2
- package/docs/components/EclTableSortButtonComponent.html +2 -2
- package/docs/components/EclTabsComponent.html +2 -2
- package/docs/components/EclTagComponent.html +2 -2
- package/docs/components/EclTextMediaComponent.html +2 -2
- package/docs/components/EclTimelineComponent.html +2 -2
- package/docs/components/EclTimelineItemComponent.html +2 -2
- package/docs/components/EclTimelineItemTogglerComponent.html +2 -2
- package/docs/directives/EclAccordionDirective.html +18 -31
- package/docs/directives/EclAccordionToggleIconDirective.html +261 -0
- package/docs/directives/EclAnimatedNumbersItemsDirective.html +1 -1
- package/docs/directives/EclAnimatedNumbersSourceDirective.html +65 -2
- package/docs/directives/EclAnimatedNumbersSourcesItemDirective.html +1 -1
- package/docs/directives/EclAnimatedNumbersSourcesListDirective.html +1 -1
- package/docs/directives/EclBannerImageDirective.html +39 -59
- package/docs/directives/EclBlockquoteImageDirective.html +0 -4
- package/docs/directives/EclFactFiguresDescriptionDirective.html +0 -43
- package/docs/directives/EclFactFiguresSourceDirective.html +261 -0
- package/docs/directives/EclFactFiguresSourcesItemDirective.html +263 -0
- package/docs/directives/EclFactFiguresSourcesListDirective.html +263 -0
- package/docs/directives/EclHighlightBoxDescriptionDirective.html +261 -0
- package/docs/directives/EclHighlightBoxIconDirective.html +261 -0
- package/docs/directives/EclHighlightBoxLinkDirective.html +261 -0
- package/docs/directives/EclHighlightBoxTitleDirective.html +261 -0
- package/docs/directives/EclLayoutItemDirective.html +400 -0
- package/docs/directives/EclLayoutWrapperDescriptionDirective.html +261 -0
- package/docs/directives/EclLayoutWrapperTitleDirective.html +261 -0
- package/docs/directives/EclLayoutWrapperViewAllDirective.html +261 -0
- package/docs/directives/EclLinkDirective.html +1 -1
- package/docs/directives/EclSiteFooterActionButtonDirective.html +260 -0
- package/docs/directives/EclSiteFooterCoownerListDirective.html +156 -0
- package/docs/directives/EclSiteFooterLinkDirective.html +7 -275
- package/docs/directives/EclSiteFooterLogoImageDirective.html +7 -275
- package/docs/directives/EclSiteFooterLogoLinkDirective.html +7 -275
- package/docs/directives/EclSiteFooterPictureDirective.html +7 -275
- package/docs/directives/EclSloganTickerListDirective.html +267 -0
- package/docs/directives/EclSloganTickerSlideDirective.html +329 -0
- package/docs/js/menu-wc.js +60 -3
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/EclAccordionDirective.md +3 -0
- package/docs/json/EclAccordionSummaryComponent.md +2 -1
- package/docs/json/EclAccordionToggleIconDirective.md +14 -0
- package/docs/json/EclAnimatedNumbersComponent.md +1 -0
- package/docs/json/EclAnimatedNumbersItemComponent.md +5 -3
- package/docs/json/EclAnimatedNumbersItemsDirective.md +1 -1
- package/docs/json/EclAnimatedNumbersSourceDirective.md +2 -1
- package/docs/json/EclAnimatedNumbersSourcesItemDirective.md +1 -1
- package/docs/json/EclAnimatedNumbersSourcesListDirective.md +1 -1
- package/docs/json/EclBannerImageDirective.md +7 -0
- package/docs/json/EclButtonComponent.md +1 -1
- package/docs/json/EclCardComponent.md +2 -1
- package/docs/json/EclFactFiguresComponent.md +1 -0
- package/docs/json/EclFactFiguresSourceDirective.md +14 -0
- package/docs/json/EclFactFiguresSourcesItemDirective.md +16 -0
- package/docs/json/EclFactFiguresSourcesListDirective.md +16 -0
- package/docs/json/EclHighlightBoxComponent.md +17 -0
- package/docs/json/EclHighlightBoxDescriptionDirective.md +11 -0
- package/docs/json/EclHighlightBoxIconDirective.md +11 -0
- package/docs/json/EclHighlightBoxLinkDirective.md +11 -0
- package/docs/json/EclHighlightBoxTitleDirective.md +11 -0
- package/docs/json/EclLayoutItemDirective.md +16 -0
- package/docs/json/EclLayoutWrapperComponent.md +34 -0
- package/docs/json/EclLayoutWrapperDescriptionDirective.md +14 -0
- package/docs/json/EclLayoutWrapperTitleDirective.md +14 -0
- package/docs/json/EclLayoutWrapperViewAllDirective.md +14 -0
- package/docs/json/EclLinkDirective.md +1 -1
- package/docs/json/EclPageSummaryComponent.md +14 -1
- package/docs/json/EclQuizCardComponent.md +1 -1
- package/docs/json/EclQuizComponent.md +2 -0
- package/docs/json/EclSiteFooterActionButtonDirective.md +10 -0
- package/docs/json/EclSiteFooterCoownerListDirective.md +5 -0
- package/docs/json/EclSiteFooterFeedbackComponent.md +27 -0
- package/docs/json/EclSiteFooterLinkDirective.md +0 -5
- package/docs/json/EclSiteFooterLogoImageDirective.md +0 -5
- package/docs/json/EclSiteFooterLogoLinkDirective.md +0 -5
- package/docs/json/EclSiteFooterPictureDirective.md +0 -5
- package/docs/json/EclSiteHeaderBannerTopComponent.md +2 -1
- package/docs/json/EclSloganTickerComponent.md +24 -0
- package/docs/json/EclSloganTickerListDirective.md +21 -0
- package/docs/json/EclSloganTickerSlideDirective.md +19 -0
- package/docs/json/documentation.json +3077 -2566
- package/docs/miscellaneous/variables.html +118 -1
- package/docs/overview.html +2 -2
- package/docs/properties.html +1 -1
- package/fesm2022/eui-ecl-components-ecl-accordion.mjs +59 -25
- package/fesm2022/eui-ecl-components-ecl-accordion.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-add-to-calendar.mjs +5 -11
- package/fesm2022/eui-ecl-components-ecl-add-to-calendar.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-animated-numbers.mjs +35 -21
- package/fesm2022/eui-ecl-components-ecl-animated-numbers.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-banner.mjs +22 -7
- package/fesm2022/eui-ecl-components-ecl-banner.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-blockquote.mjs +0 -1
- package/fesm2022/eui-ecl-components-ecl-blockquote.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-button.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-card.mjs +18 -23
- package/fesm2022/eui-ecl-components-ecl-card.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-fact-figures.mjs +104 -31
- package/fesm2022/eui-ecl-components-ecl-fact-figures.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-highlight-box.mjs +103 -0
- package/fesm2022/eui-ecl-components-ecl-highlight-box.mjs.map +1 -0
- package/fesm2022/eui-ecl-components-ecl-icon.mjs +3 -0
- package/fesm2022/eui-ecl-components-ecl-icon.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-layout-wrapper.mjs +182 -0
- package/fesm2022/eui-ecl-components-ecl-layout-wrapper.mjs.map +1 -0
- package/fesm2022/eui-ecl-components-ecl-link.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs +20 -0
- package/fesm2022/eui-ecl-components-ecl-mega-menu.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-menu.mjs +40 -74
- package/fesm2022/eui-ecl-components-ecl-menu.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-multiselect.mjs +2 -2
- package/fesm2022/eui-ecl-components-ecl-multiselect.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-navigation-list.mjs +1 -1
- package/fesm2022/eui-ecl-components-ecl-navigation-list.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-page-summary.mjs +30 -6
- package/fesm2022/eui-ecl-components-ecl-page-summary.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-quiz.mjs +257 -145
- package/fesm2022/eui-ecl-components-ecl-quiz.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs +103 -78
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-header.mjs +11 -3
- package/fesm2022/eui-ecl-components-ecl-site-header.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs +320 -0
- package/fesm2022/eui-ecl-components-ecl-slogan-ticker.mjs.map +1 -0
- package/fesm2022/eui-ecl-components-ecl-text-media.mjs +6 -6
- package/fesm2022/eui-ecl-components-ecl-text-media.mjs.map +1 -1
- package/package.json +14 -2
- package/types/eui-ecl-components-ecl-accordion.d.ts +23 -5
- package/types/eui-ecl-components-ecl-accordion.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-add-to-calendar.d.ts +0 -4
- package/types/eui-ecl-components-ecl-add-to-calendar.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-animated-numbers.d.ts +16 -8
- package/types/eui-ecl-components-ecl-animated-numbers.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-banner.d.ts +13 -2
- package/types/eui-ecl-components-ecl-banner.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-blockquote.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-button.d.ts +1 -1
- package/types/eui-ecl-components-ecl-card.d.ts +6 -10
- package/types/eui-ecl-components-ecl-card.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-fact-figures.d.ts +60 -10
- package/types/eui-ecl-components-ecl-fact-figures.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-highlight-box.d.ts +50 -0
- package/types/eui-ecl-components-ecl-highlight-box.d.ts.map +1 -0
- package/types/eui-ecl-components-ecl-icon.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-layout-wrapper.d.ts +109 -0
- package/types/eui-ecl-components-ecl-layout-wrapper.d.ts.map +1 -0
- package/types/eui-ecl-components-ecl-link.d.ts +1 -1
- package/types/eui-ecl-components-ecl-mega-menu.d.ts +6 -0
- package/types/eui-ecl-components-ecl-mega-menu.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-menu.d.ts +3 -10
- package/types/eui-ecl-components-ecl-menu.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-page-summary.d.ts +20 -1
- package/types/eui-ecl-components-ecl-page-summary.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-quiz.d.ts +153 -119
- package/types/eui-ecl-components-ecl-quiz.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-site-footer.d.ts +40 -22
- package/types/eui-ecl-components-ecl-site-footer.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-site-header.d.ts +7 -3
- package/types/eui-ecl-components-ecl-site-header.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-slogan-ticker.d.ts +135 -0
- 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,
|
|
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
|
-
*
|
|
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.
|
|
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
|
-
/**
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
/**
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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
|
-
|
|
300
|
-
|
|
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
|
-
/**
|
|
306
|
-
|
|
307
|
-
if (this.
|
|
308
|
-
|
|
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
|
-
/**
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
/**
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
-
|
|
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
|
-
|
|
328
|
-
this.
|
|
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
|
-
|
|
331
|
-
|
|
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
|
-
/**
|
|
403
|
-
|
|
404
|
-
|
|
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
|
-
|
|
408
|
-
|
|
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
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
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
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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,
|