@eui/ecl 21.3.2 → 21.3.3-snapshot-1782299250059
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 +1 -2
- package/assets/i18n-ecl/cs.json +1 -2
- package/assets/i18n-ecl/da.json +1 -2
- package/assets/i18n-ecl/de.json +1 -2
- package/assets/i18n-ecl/el.json +1 -2
- package/assets/i18n-ecl/en.json +1 -2
- package/assets/i18n-ecl/es.json +1 -2
- package/assets/i18n-ecl/et.json +66 -67
- package/assets/i18n-ecl/fi.json +47 -48
- package/assets/i18n-ecl/fr.json +1 -2
- package/assets/i18n-ecl/ga.json +3 -4
- package/assets/i18n-ecl/hr.json +59 -60
- package/assets/i18n-ecl/hu.json +1 -2
- package/assets/i18n-ecl/it.json +1 -2
- package/assets/i18n-ecl/lt.json +95 -96
- package/assets/i18n-ecl/lv.json +1 -2
- package/assets/i18n-ecl/mt.json +1 -2
- package/assets/i18n-ecl/nl.json +1 -2
- package/assets/i18n-ecl/pl.json +105 -106
- package/assets/i18n-ecl/pt.json +1 -2
- package/assets/i18n-ecl/ro.json +1 -2
- package/assets/i18n-ecl/sk.json +1 -2
- package/assets/i18n-ecl/sl.json +48 -49
- package/assets/i18n-ecl/sv.json +93 -94
- package/components/ecl-animated-numbers/package.json +4 -0
- package/components/ecl-page-summary/package.json +4 -0
- package/components/ecl-text-media/package.json +4 -0
- package/docs/changelog.html +32 -0
- package/docs/components/EclAccordionSummaryComponent.html +2 -2
- package/docs/components/EclAddToCalendarComponent.html +2 -2
- package/docs/components/EclAnimatedNumbersComponent.html +625 -0
- package/docs/components/EclAnimatedNumbersItemComponent.html +625 -0
- 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 +2 -2
- package/docs/components/EclCardBodyComponent.html +2 -2
- package/docs/components/EclCardComponent.html +2 -2
- 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 +2 -2
- package/docs/components/EclFactFiguresItemComponent.html +2 -2
- package/docs/components/EclFactFiguresViewAllComponent.html +2 -2
- 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/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/EclListIllustrationComponent.html +2 -2
- package/docs/components/EclListIllustrationItemComponent.html +2 -2
- package/docs/components/EclLoadingIndicatorComponent.html +2 -2
- package/docs/components/EclMediaContainerComponent.html +189 -103
- 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 +2 -2
- package/docs/components/EclMenuItemComponent.html +2 -2
- 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 +2 -2
- 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 +364 -0
- 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 +71 -402
- package/docs/components/EclQuizComponent.html +10 -137
- 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 +2 -10
- package/docs/components/EclSiteFooterCoownerComponent.html +2 -2
- package/docs/components/EclSiteFooterCoreComponent.html +2 -2
- 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 +2 -2
- 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/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 +569 -0
- package/docs/components/EclTimelineComponent.html +2 -2
- package/docs/components/EclTimelineItemComponent.html +2 -2
- package/docs/components/EclTimelineItemTogglerComponent.html +2 -2
- package/docs/directives/EclAnimatedNumbersIconDirective.html +261 -0
- package/docs/directives/EclAnimatedNumbersItemsDirective.html +263 -0
- package/docs/directives/EclAnimatedNumbersSourceDirective.html +261 -0
- package/docs/directives/EclAnimatedNumbersSourcesItemDirective.html +263 -0
- package/docs/directives/EclAnimatedNumbersSourcesListDirective.html +263 -0
- package/docs/directives/EclPageInformationDirective.html +6 -130
- package/docs/directives/EclQuizListDirective.html +365 -0
- package/docs/directives/EclTextMediaContainerDirective.html +260 -0
- package/docs/directives/EclTextMediaDescriptionDirective.html +260 -0
- package/docs/directives/EclTextMediaLinkDirective.html +260 -0
- package/docs/directives/EclTextMediaMediaAnchorDirective.html +313 -0
- package/docs/directives/EclTextMediaMicroTitleDirective.html +260 -0
- package/docs/directives/EclTextMediaTitleDirective.html +260 -0
- package/docs/js/menu-wc.js +48 -0
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/EclAccordionDirective.md +1 -0
- package/docs/json/EclAnimatedNumbersComponent.md +34 -0
- package/docs/json/EclAnimatedNumbersIconDirective.md +14 -0
- package/docs/json/EclAnimatedNumbersItemComponent.md +33 -0
- package/docs/json/EclAnimatedNumbersItemsDirective.md +16 -0
- package/docs/json/EclAnimatedNumbersSourceDirective.md +14 -0
- package/docs/json/EclAnimatedNumbersSourcesItemDirective.md +16 -0
- package/docs/json/EclAnimatedNumbersSourcesListDirective.md +16 -0
- package/docs/json/EclMediaContainerComponent.md +1 -0
- package/docs/json/EclPageSummaryComponent.md +12 -0
- package/docs/json/EclQuizCardComponent.md +2 -3
- package/docs/json/EclQuizComponent.md +1 -1
- package/docs/json/EclQuizListDirective.md +8 -0
- package/docs/json/EclTextMediaComponent.md +18 -0
- package/docs/json/EclTextMediaContainerDirective.md +10 -0
- package/docs/json/EclTextMediaDescriptionDirective.md +10 -0
- package/docs/json/EclTextMediaLinkDirective.md +10 -0
- package/docs/json/EclTextMediaMediaAnchorDirective.md +17 -0
- package/docs/json/EclTextMediaMicroTitleDirective.md +10 -0
- package/docs/json/EclTextMediaTitleDirective.md +10 -0
- package/docs/json/documentation.json +1252 -493
- package/docs/miscellaneous/variables.html +115 -0
- package/docs/overview.html +2 -2
- package/docs/properties.html +1 -1
- package/fesm2022/eui-ecl-components-ecl-accordion.mjs +1 -0
- package/fesm2022/eui-ecl-components-ecl-accordion.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-animated-numbers.mjs +359 -0
- package/fesm2022/eui-ecl-components-ecl-animated-numbers.mjs.map +1 -0
- package/fesm2022/eui-ecl-components-ecl-link.mjs +6 -1
- package/fesm2022/eui-ecl-components-ecl-link.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-media-container.mjs +57 -27
- package/fesm2022/eui-ecl-components-ecl-media-container.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-page-information.mjs +6 -14
- package/fesm2022/eui-ecl-components-ecl-page-information.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-page-summary.mjs +30 -0
- package/fesm2022/eui-ecl-components-ecl-page-summary.mjs.map +1 -0
- package/fesm2022/eui-ecl-components-ecl-quiz.mjs +63 -87
- package/fesm2022/eui-ecl-components-ecl-quiz.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs +4 -4
- package/fesm2022/eui-ecl-components-ecl-site-footer.mjs.map +1 -1
- package/fesm2022/eui-ecl-components-ecl-text-media.mjs +161 -0
- package/fesm2022/eui-ecl-components-ecl-text-media.mjs.map +1 -0
- package/package.json +14 -2
- package/types/eui-ecl-components-ecl-accordion.d.ts +1 -0
- package/types/eui-ecl-components-ecl-accordion.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-animated-numbers.d.ts +165 -0
- package/types/eui-ecl-components-ecl-animated-numbers.d.ts.map +1 -0
- package/types/eui-ecl-components-ecl-link.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-media-container.d.ts +19 -4
- package/types/eui-ecl-components-ecl-media-container.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-page-information.d.ts +0 -6
- package/types/eui-ecl-components-ecl-page-information.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-page-summary.d.ts +13 -0
- package/types/eui-ecl-components-ecl-page-summary.d.ts.map +1 -0
- package/types/eui-ecl-components-ecl-quiz.d.ts +27 -23
- package/types/eui-ecl-components-ecl-quiz.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-site-footer.d.ts.map +1 -1
- package/types/eui-ecl-components-ecl-text-media.d.ts +69 -0
- package/types/eui-ecl-components-ecl-text-media.d.ts.map +1 -0
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { HostBinding, Directive, input, computed, EventEmitter, signal, ViewChild, Output, ChangeDetectionStrategy, Component, inject, ChangeDetectorRef, ViewChildren, forwardRef, ContentChildren } from '@angular/core';
|
|
3
3
|
import { EclIconComponent } from '@eui/ecl/components/ecl-icon';
|
|
4
4
|
import { ECLBaseDirective } from '@eui/ecl/core';
|
|
5
5
|
import * as i1 from '@ngx-translate/core';
|
|
6
|
-
import { TranslateModule
|
|
6
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
7
7
|
import { EmblaCarouselDirective } from 'embla-carousel-angular';
|
|
8
8
|
|
|
9
|
+
class EclQuizListDirective {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.hasClass = true;
|
|
12
|
+
}
|
|
13
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
14
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.17", type: EclQuizListDirective, isStandalone: true, selector: "ol[eclQuizList]", host: { properties: { "class.ecl-quiz__list": "this.hasClass" } }, ngImport: i0 }); }
|
|
15
|
+
}
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizListDirective, decorators: [{
|
|
17
|
+
type: Directive,
|
|
18
|
+
args: [{
|
|
19
|
+
selector: 'ol[eclQuizList]',
|
|
20
|
+
}]
|
|
21
|
+
}], propDecorators: { hasClass: [{
|
|
22
|
+
type: HostBinding,
|
|
23
|
+
args: ['class.ecl-quiz__list']
|
|
24
|
+
}] } });
|
|
9
25
|
/**
|
|
10
26
|
* ECL Quiz Card component – represents a single card in the quiz.
|
|
11
27
|
*
|
|
@@ -15,6 +31,19 @@ import { EmblaCarouselDirective } from 'embla-carousel-angular';
|
|
|
15
31
|
class EclQuizCardComponent extends ECLBaseDirective {
|
|
16
32
|
constructor() {
|
|
17
33
|
super(...arguments);
|
|
34
|
+
/**
|
|
35
|
+
* Unique identifier for the card, used for accessibility attributes.
|
|
36
|
+
* If not provided, a unique ID is generated automatically.
|
|
37
|
+
*/
|
|
38
|
+
this.id = input(`ecl-quiz-card-${crypto.randomUUID()}`, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
39
|
+
/**
|
|
40
|
+
* Unique identifier for the question element.
|
|
41
|
+
*/
|
|
42
|
+
this.questionId = computed(() => `${this.id()}-question`, ...(ngDevMode ? [{ debugName: "questionId" }] : /* istanbul ignore next */ []));
|
|
43
|
+
/**
|
|
44
|
+
* Unique identifier for the answer element.
|
|
45
|
+
*/
|
|
46
|
+
this.answerId = computed(() => `${this.id()}-answer`, ...(ngDevMode ? [{ debugName: "answerId" }] : /* istanbul ignore next */ []));
|
|
18
47
|
/**
|
|
19
48
|
* The question text displayed on the front of the card.
|
|
20
49
|
*/
|
|
@@ -49,29 +78,22 @@ class EclQuizCardComponent extends ECLBaseDirective {
|
|
|
49
78
|
* Options for the poll variant. Each option has text and a match flag.
|
|
50
79
|
*/
|
|
51
80
|
this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
52
|
-
/**
|
|
53
|
-
* Whether this card is currently active/visible in the slider.
|
|
54
|
-
*/
|
|
55
|
-
this.isActive = false;
|
|
56
81
|
/**
|
|
57
82
|
* Emitted when the card is flipped.
|
|
58
83
|
*/
|
|
59
84
|
this.cardFlip = new EventEmitter();
|
|
60
85
|
/** Whether the card is currently flipped (showing back). */
|
|
61
|
-
this.isFlipped = false;
|
|
86
|
+
this.isFlipped = signal(false, ...(ngDevMode ? [{ debugName: "isFlipped" }] : /* istanbul ignore next */ []));
|
|
62
87
|
/** Index of the selected option (poll variant). */
|
|
63
|
-
this.selectedOptionIndex = null;
|
|
88
|
+
this.selectedOptionIndex = signal(null, ...(ngDevMode ? [{ debugName: "selectedOptionIndex" }] : /* istanbul ignore next */ []));
|
|
64
89
|
/** Whether the selected option is correct (poll variant). */
|
|
65
|
-
this.isCorrect = null;
|
|
66
|
-
this.role = 'group';
|
|
67
|
-
this.ariaRoleDescription = null;
|
|
68
|
-
this.ariaHidden = null;
|
|
90
|
+
this.isCorrect = signal(null, ...(ngDevMode ? [{ debugName: "isCorrect" }] : /* istanbul ignore next */ []));
|
|
69
91
|
this.styleTransform = 'translate3d(0px, 0px, 0px)';
|
|
70
92
|
}
|
|
71
93
|
get cssClasses() {
|
|
72
94
|
return [
|
|
73
95
|
super.getCssClasses('ecl-quiz-card'),
|
|
74
|
-
this.isFlipped ? 'ecl-quiz-card__flipped' : '',
|
|
96
|
+
this.isFlipped() ? 'ecl-quiz-card__flipped' : '',
|
|
75
97
|
]
|
|
76
98
|
.join(' ')
|
|
77
99
|
.trim();
|
|
@@ -79,9 +101,6 @@ class EclQuizCardComponent extends ECLBaseDirective {
|
|
|
79
101
|
get tabIndex() {
|
|
80
102
|
return this.variant === 'reveal' ? 0 : null;
|
|
81
103
|
}
|
|
82
|
-
get ariaPressed() {
|
|
83
|
-
return this.variant === 'reveal' ? String(this.isFlipped) : null;
|
|
84
|
-
}
|
|
85
104
|
/**
|
|
86
105
|
* Handle click on the card itself (reveal variant).
|
|
87
106
|
*/
|
|
@@ -103,12 +122,12 @@ class EclQuizCardComponent extends ECLBaseDirective {
|
|
|
103
122
|
* Handle option click (poll variant).
|
|
104
123
|
*/
|
|
105
124
|
onOptionClick(optionIndex) {
|
|
106
|
-
if (this.isFlipped) {
|
|
125
|
+
if (this.isFlipped()) {
|
|
107
126
|
return;
|
|
108
127
|
}
|
|
109
128
|
const optionsList = this.options();
|
|
110
|
-
this.selectedOptionIndex
|
|
111
|
-
this.isCorrect
|
|
129
|
+
this.selectedOptionIndex.set(optionIndex);
|
|
130
|
+
this.isCorrect.set(optionsList[optionIndex]?.match ?? false);
|
|
112
131
|
this.flipCard();
|
|
113
132
|
}
|
|
114
133
|
/**
|
|
@@ -124,11 +143,11 @@ class EclQuizCardComponent extends ECLBaseDirective {
|
|
|
124
143
|
* Flip the card between front and back.
|
|
125
144
|
*/
|
|
126
145
|
flipCard() {
|
|
127
|
-
this.isFlipped
|
|
128
|
-
const event = { flipped: this.isFlipped };
|
|
146
|
+
this.isFlipped.update(v => !v);
|
|
147
|
+
const event = { flipped: this.isFlipped() };
|
|
129
148
|
if (this.variant === 'poll') {
|
|
130
|
-
event.selectedOptionIndex = this.selectedOptionIndex;
|
|
131
|
-
event.isCorrect = this.isCorrect;
|
|
149
|
+
event.selectedOptionIndex = this.selectedOptionIndex();
|
|
150
|
+
event.isCorrect = this.isCorrect();
|
|
132
151
|
}
|
|
133
152
|
this.cardFlip.emit(event);
|
|
134
153
|
}
|
|
@@ -164,15 +183,20 @@ class EclQuizCardComponent extends ECLBaseDirective {
|
|
|
164
183
|
return this.iconSize() || (this.variant === 'poll' ? '2xl' : 'xl');
|
|
165
184
|
}
|
|
166
185
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizCardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
167
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: EclQuizCardComponent, isStandalone: true, selector: "
|
|
186
|
+
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 }); }
|
|
168
187
|
}
|
|
169
188
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizCardComponent, decorators: [{
|
|
170
189
|
type: Component,
|
|
171
|
-
args: [{ selector: '
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
190
|
+
args: [{ selector: 'li[eclQuizCard]', host: {
|
|
191
|
+
'[attr.id]': 'id()',
|
|
192
|
+
'[attr.aria-labelledby]': 'questionId()',
|
|
193
|
+
'[class]': 'cssClasses',
|
|
194
|
+
'[attr.tabindex]': 'tabIndex',
|
|
195
|
+
'[style.transform]': 'styleTransform',
|
|
196
|
+
'(click)': 'onClick()',
|
|
197
|
+
'(keydown)': 'onKeydown($event)',
|
|
198
|
+
}, 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>" }]
|
|
199
|
+
}], 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: [{
|
|
176
200
|
type: Output
|
|
177
201
|
}], frontElementRef: [{
|
|
178
202
|
type: ViewChild,
|
|
@@ -189,35 +213,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
189
213
|
}], contentElementRef: [{
|
|
190
214
|
type: ViewChild,
|
|
191
215
|
args: ['contentElement']
|
|
192
|
-
}], cssClasses: [{
|
|
193
|
-
type: HostBinding,
|
|
194
|
-
args: ['class']
|
|
195
|
-
}], role: [{
|
|
196
|
-
type: HostBinding,
|
|
197
|
-
args: ['attr.role']
|
|
198
|
-
}], ariaRoleDescription: [{
|
|
199
|
-
type: HostBinding,
|
|
200
|
-
args: ['attr.aria-roledescription']
|
|
201
|
-
}], ariaHidden: [{
|
|
202
|
-
type: HostBinding,
|
|
203
|
-
args: ['attr.aria-hidden']
|
|
204
|
-
}, {
|
|
205
|
-
type: Input
|
|
206
|
-
}], tabIndex: [{
|
|
207
|
-
type: HostBinding,
|
|
208
|
-
args: ['attr.tabindex']
|
|
209
|
-
}], ariaPressed: [{
|
|
210
|
-
type: HostBinding,
|
|
211
|
-
args: ['attr.aria-pressed']
|
|
212
|
-
}], styleTransform: [{
|
|
213
|
-
type: HostBinding,
|
|
214
|
-
args: ['style.tranform']
|
|
215
|
-
}], onClick: [{
|
|
216
|
-
type: HostListener,
|
|
217
|
-
args: ['click']
|
|
218
|
-
}], onKeydown: [{
|
|
219
|
-
type: HostListener,
|
|
220
|
-
args: ['keydown', ['$event']]
|
|
221
216
|
}] } });
|
|
222
217
|
|
|
223
218
|
/**
|
|
@@ -242,8 +237,6 @@ class EclQuizComponent extends ECLBaseDirective {
|
|
|
242
237
|
this.activeIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeIndex" }] : /* istanbul ignore next */ []));
|
|
243
238
|
/** Total number of snap points. */
|
|
244
239
|
this.totalSnaps = signal(0, ...(ngDevMode ? [{ debugName: "totalSnaps" }] : /* istanbul ignore next */ []));
|
|
245
|
-
/** Live region text for screen readers. */
|
|
246
|
-
this.liveRegionText = signal('', ...(ngDevMode ? [{ debugName: "liveRegionText" }] : /* istanbul ignore next */ []));
|
|
247
240
|
/** Counter text for mobile display. */
|
|
248
241
|
this.counterText = signal('', ...(ngDevMode ? [{ debugName: "counterText" }] : /* istanbul ignore next */ []));
|
|
249
242
|
/** Whether the previous button is disabled. */
|
|
@@ -253,7 +246,6 @@ class EclQuizComponent extends ECLBaseDirective {
|
|
|
253
246
|
/** Whether navigation controls should be shown. */
|
|
254
247
|
this.showControls = signal(false, ...(ngDevMode ? [{ debugName: "showControls" }] : /* istanbul ignore next */ []));
|
|
255
248
|
this.cd = inject(ChangeDetectorRef);
|
|
256
|
-
this.translateService = inject(TranslateService);
|
|
257
249
|
/** Subscribed Embla events. */
|
|
258
250
|
this.subscribeToEvents = ['select', 'init', 'reInit'];
|
|
259
251
|
}
|
|
@@ -265,10 +257,6 @@ class EclQuizComponent extends ECLBaseDirective {
|
|
|
265
257
|
.join(' ')
|
|
266
258
|
.trim();
|
|
267
259
|
}
|
|
268
|
-
// @HostBinding('attr.data-ecl-auto-init')
|
|
269
|
-
// get autoInit(): string {
|
|
270
|
-
// return 'Quiz';
|
|
271
|
-
// }
|
|
272
260
|
ngAfterContentInit() {
|
|
273
261
|
if (this.cards && this.cards.length > 1) {
|
|
274
262
|
this.showControls.set(true);
|
|
@@ -425,7 +413,6 @@ class EclQuizComponent extends ECLBaseDirective {
|
|
|
425
413
|
this.nextDisabled.set(!canScrollNext);
|
|
426
414
|
this.showControls.set(canScrollPrev || canScrollNext);
|
|
427
415
|
this.updateCounter();
|
|
428
|
-
this.updateLiveRegion();
|
|
429
416
|
}
|
|
430
417
|
/** Update the counter text (mobile). */
|
|
431
418
|
updateCounter() {
|
|
@@ -433,13 +420,6 @@ class EclQuizComponent extends ECLBaseDirective {
|
|
|
433
420
|
const current = this.activeIndex() + 1;
|
|
434
421
|
this.counterText.set(`${current} / ${total}`);
|
|
435
422
|
}
|
|
436
|
-
/** Update the live region for screen readers. */
|
|
437
|
-
updateLiveRegion() {
|
|
438
|
-
const totalCards = this.getCardsCount();
|
|
439
|
-
const totalGroups = this.totalSnaps();
|
|
440
|
-
const currentGroup = this.activeIndex() + 1;
|
|
441
|
-
this.liveRegionText.set(this.translateService.instant('ecl.quiz.SHOWING-SLIDE', { current: currentGroup, totalSlides: totalCards, totalGroups }));
|
|
442
|
-
}
|
|
443
423
|
/** Move focus to the last dot button when Escape is pressed. */
|
|
444
424
|
escapeSlider() {
|
|
445
425
|
if (this.dotButtons && this.dotButtons.length > 0) {
|
|
@@ -447,50 +427,46 @@ class EclQuizComponent extends ECLBaseDirective {
|
|
|
447
427
|
lastDot.nativeElement.focus();
|
|
448
428
|
}
|
|
449
429
|
}
|
|
450
|
-
/** Propagate the variant
|
|
430
|
+
/** Propagate the variant to all child cards. */
|
|
451
431
|
propagateVariant() {
|
|
452
432
|
const v = this.variant();
|
|
453
|
-
const isCarousel = this.cards.length > 1;
|
|
454
433
|
this.cards?.forEach(card => {
|
|
455
434
|
card.variant = v;
|
|
456
|
-
card.ariaRoleDescription = isCarousel ? 'slide' : null;
|
|
457
435
|
});
|
|
458
436
|
}
|
|
459
437
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
460
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: EclQuizComponent, isStandalone: true, selector: "
|
|
438
|
+
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 }); }
|
|
461
439
|
}
|
|
462
440
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: EclQuizComponent, decorators: [{
|
|
463
441
|
type: Component,
|
|
464
|
-
args: [{ selector: '
|
|
442
|
+
args: [{ selector: 'section[eclQuiz]', host: {
|
|
443
|
+
'[class]': 'cssClasses',
|
|
444
|
+
'(keydown)': 'onKeydown($event)',
|
|
445
|
+
}, imports: [
|
|
465
446
|
TranslateModule,
|
|
466
447
|
EclIconComponent,
|
|
467
448
|
EmblaCarouselDirective,
|
|
468
|
-
], 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
|
|
449
|
+
], 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" }]
|
|
469
450
|
}], 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: [{
|
|
470
451
|
type: ContentChildren,
|
|
471
|
-
args: [forwardRef(() => EclQuizCardComponent)]
|
|
452
|
+
args: [forwardRef(() => EclQuizCardComponent), { descendants: true }]
|
|
472
453
|
}], emblaRef: [{
|
|
473
454
|
type: ViewChild,
|
|
474
455
|
args: [EmblaCarouselDirective]
|
|
475
456
|
}], dotButtons: [{
|
|
476
457
|
type: ViewChildren,
|
|
477
458
|
args: ['dotButton']
|
|
478
|
-
}], cssClasses: [{
|
|
479
|
-
type: HostBinding,
|
|
480
|
-
args: ['class']
|
|
481
|
-
}], onKeydown: [{
|
|
482
|
-
type: HostListener,
|
|
483
|
-
args: ['keydown', ['$event']]
|
|
484
459
|
}] } });
|
|
485
460
|
|
|
486
461
|
const EUI_ECL_QUIZ = [
|
|
487
462
|
EclQuizComponent,
|
|
488
463
|
EclQuizCardComponent,
|
|
464
|
+
EclQuizListDirective,
|
|
489
465
|
];
|
|
490
466
|
|
|
491
467
|
/**
|
|
492
468
|
* Generated bundle index. Do not edit.
|
|
493
469
|
*/
|
|
494
470
|
|
|
495
|
-
export { EUI_ECL_QUIZ, EclQuizCardComponent, EclQuizComponent };
|
|
471
|
+
export { EUI_ECL_QUIZ, EclQuizCardComponent, EclQuizComponent, EclQuizListDirective };
|
|
496
472
|
//# sourceMappingURL=eui-ecl-components-ecl-quiz.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-ecl-components-ecl-quiz.mjs","sources":["../../components/ecl-quiz/ecl-quiz-card.component.ts","../../components/ecl-quiz/ecl-quiz-card.component.html","../../components/ecl-quiz/ecl-quiz.component.ts","../../components/ecl-quiz/ecl-quiz.component.html","../../components/ecl-quiz/index.ts","../../components/ecl-quiz/eui-ecl-components-ecl-quiz.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n Input,\n Output,\n ViewChild,\n booleanAttribute,\n input,\n} from '@angular/core';\nimport { ECLBaseDirective } from '@eui/ecl/core';\nimport { EclIconComponent } from '@eui/ecl/components/ecl-icon';\nimport { TranslateModule } from '@ngx-translate/core';\n\nexport interface EclQuizCardFlipEvent {\n flipped: boolean;\n selectedOptionIndex?: number;\n isCorrect?: boolean;\n}\n\n/**\n * ECL Quiz Card component – represents a single card in the quiz.\n *\n * For the 'reveal' variant, the entire card is clickable to flip.\n * For the 'poll' variant, individual options trigger the flip.\n */\n@Component({\n selector: 'div[eclQuizCard]',\n templateUrl: './ecl-quiz-card.component.html',\n imports: [EclIconComponent, TranslateModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EclQuizCardComponent extends ECLBaseDirective {\n\n /**\n * The question text displayed on the front of the card.\n */\n question = input<string>('');\n\n /**\n * The answer text displayed on the back of the card.\n * Used in 'reveal' variant or as explanation in 'poll' variant.\n */\n answer = input<string>('');\n\n /**\n * The answer title (e.g. \"The correct answer is A.\") for poll variant.\n */\n answerTitle = input<string>('');\n\n /**\n * Category label displayed in the card header (poll variant).\n */\n category = input<string>('');\n\n /**\n * Icon name for the card header.\n * Defaults to 'sparkle' for reveal, 'question' for poll.\n */\n icon = input<string>('');\n\n /**\n * Icon size for the card header.\n */\n iconSize = input<'xs' | 's' | 'm' | 'l' | 'xl' | '2xl'>('xl');\n\n /**\n * The variant of the quiz, set by the parent EclQuizComponent.\n */\n variant: 'poll' | 'reveal' = 'reveal';\n\n /**\n * Options for the poll variant. Each option has text and a match flag.\n */\n options = input<Array<{ text: string; match: boolean }>>([]);\n\n /**\n * Whether this card is currently active/visible in the slider.\n */\n @Input({ transform: booleanAttribute }) isActive = false;\n\n /**\n * Emitted when the card is flipped.\n */\n @Output() cardFlip = new EventEmitter<EclQuizCardFlipEvent>();\n\n @ViewChild('frontElement') frontElementRef: ElementRef;\n @ViewChild('backElement') backElementRef: ElementRef;\n @ViewChild('questionElement') questionElementRef: ElementRef;\n @ViewChild('answerElement') answerElementRef: ElementRef;\n @ViewChild('contentElement') contentElementRef: ElementRef;\n\n /** Whether the card is currently flipped (showing back). */\n isFlipped = false;\n\n /** Index of the selected option (poll variant). */\n selectedOptionIndex: number | null = null;\n\n /** Whether the selected option is correct (poll variant). */\n isCorrect: boolean | null = null;\n\n @HostBinding('class')\n get cssClasses(): string {\n return [\n super.getCssClasses('ecl-quiz-card'),\n this.isFlipped ? 'ecl-quiz-card__flipped' : '',\n ]\n .join(' ')\n .trim();\n }\n\n @HostBinding('attr.role')\n role = 'group';\n\n @HostBinding('attr.aria-roledescription')\n ariaRoleDescription: string | null = null;\n\n @HostBinding('attr.aria-hidden')\n @Input() ariaHidden: string | null = null;\n\n @HostBinding('attr.tabindex')\n get tabIndex(): number | null {\n return this.variant === 'reveal' ? 0 : null;\n }\n\n @HostBinding('attr.aria-pressed')\n get ariaPressed(): string | null {\n return this.variant === 'reveal' ? String(this.isFlipped) : null;\n }\n\n @HostBinding('style.tranform')\n styleTransform = 'translate3d(0px, 0px, 0px)';\n\n /**\n * Handle click on the card itself (reveal variant).\n */\n @HostListener('click')\n onClick(): void {\n if (this.variant === 'reveal') {\n this.flipCard();\n }\n }\n\n /**\n * Handle keyboard events (Enter/Space to flip for reveal variant).\n */\n @HostListener('keydown', ['$event'])\n onKeydown(event: KeyboardEvent): void {\n if (this.variant === 'reveal' && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n this.flipCard();\n }\n }\n\n /**\n * Handle option click (poll variant).\n */\n onOptionClick(optionIndex: number): void {\n if (this.isFlipped) {\n return;\n }\n const optionsList = this.options();\n this.selectedOptionIndex = optionIndex;\n this.isCorrect = optionsList[optionIndex]?.match ?? false;\n this.flipCard();\n }\n\n /**\n * Handle keyboard on option (poll variant).\n */\n onOptionKeydown(event: KeyboardEvent, optionIndex: number): void {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.onOptionClick(optionIndex);\n }\n }\n\n /**\n * Flip the card between front and back.\n */\n flipCard(): void {\n this.isFlipped = !this.isFlipped;\n const event: EclQuizCardFlipEvent = { flipped: this.isFlipped };\n if (this.variant === 'poll') {\n event.selectedOptionIndex = this.selectedOptionIndex;\n event.isCorrect = this.isCorrect;\n }\n this.cardFlip.emit(event);\n }\n\n /** Get the native front element for height calculations. */\n getFrontElement(): HTMLElement | null {\n return this.frontElementRef?.nativeElement ?? null;\n }\n\n /** Get the native back element for height calculations. */\n getBackElement(): HTMLElement | null {\n return this.backElementRef?.nativeElement ?? null;\n }\n\n /** Get the native question element for height calculations. */\n getQuestionElement(): HTMLElement | null {\n return this.questionElementRef?.nativeElement ?? null;\n }\n\n /** Get the native answer element for height calculations. */\n getAnswerElement(): HTMLElement | null {\n return this.answerElementRef?.nativeElement ?? null;\n }\n\n /** Get the native content element for height calculations. */\n getContentElement(): HTMLElement | null {\n return this.contentElementRef?.nativeElement ?? null;\n }\n\n /** Get the resolved icon name based on variant. */\n getIconName(): string {\n if (this.icon()) {\n return this.icon();\n }\n return this.variant === 'poll' ? 'question' : 'sparkle';\n }\n\n /** Get the resolved icon size. */\n getIconSize(): string {\n return this.iconSize() || (this.variant === 'poll' ? '2xl' : 'xl');\n }\n}\n","<div 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\n [icon]=\"getIconName()\"\n [size]=\"getIconSize()\"\n iconSet=\"phosphor\">\n </ecl-icon>\n </div>\n @if (category()) {\n <span class=\"ecl-quiz-card__category\">{{ category() }}</span>\n }\n </div>\n\n <div class=\"ecl-quiz-card__question\" #questionElement>{{ question() }}</div>\n\n @if (variant === 'reveal') {\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 <div class=\"ecl-quiz-card__options\">\n @for (option of options(); let i = $index; track i) {\n <div\n class=\"ecl-quiz-card__option\"\n role=\"button\"\n [attr.tabindex]=\"0\"\n [attr.aria-pressed]=\"selectedOptionIndex === i ? 'true' : 'false'\"\n [attr.data-match]=\"option.match\"\n (click)=\"onOptionClick(i)\"\n (keydown)=\"onOptionKeydown($event, i)\">\n {{ option.text }}\n </div>\n }\n </div>\n }\n </div>\n\n <!-- Back face -->\n <div\n class=\"ecl-quiz-card__back\"\n #backElement\n [hidden]=\"!isFlipped\"\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\n [icon]=\"getIconName()\"\n [size]=\"getIconSize()\"\n 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\n icon=\"check-circle\"\n iconSet=\"phosphor\"\n size=\"2xl\"\n class=\"ecl-quiz-card__icon--success\">\n </ecl-icon>\n <ecl-icon\n icon=\"x-circle\"\n size=\"2xl\"\n iconSet=\"phosphor\"\n class=\"ecl-quiz-card__icon--error\">\n </ecl-icon>\n </div>\n <span class=\"ecl-quiz-card__category ecl-quiz-card__category--success\">Correct</span>\n <span class=\"ecl-quiz-card__category ecl-quiz-card__category--error\">Incorrect</span>\n }\n </div>\n\n <div class=\"ecl-quiz-card__answer\" #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 <div class=\"ecl-quiz-card__options\" role=\"list\">\n @for (option of options(); let i = $index; track i) {\n <div\n class=\"ecl-quiz-card__option\"\n role=\"listitem\"\n [class.ecl-quiz-card__option--selected]=\"selectedOptionIndex === i\"\n [attr.data-match]=\"option.match\">\n {{ option.text }}\n </div>\n }\n </div>\n }\n </div>\n</div>\n","import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n forwardRef,\n HostBinding,\n HostListener,\n inject,\n input,\n QueryList,\n signal,\n ViewChild,\n ViewChildren\n} from '@angular/core';\nimport { EclIconComponent } from '@eui/ecl/components/ecl-icon';\nimport { ECLBaseDirective } from '@eui/ecl/core';\nimport { TranslateModule, TranslateService } from '@ngx-translate/core';\nimport { EmblaCarouselDirective, EmblaCarouselType, EmblaEventType } from 'embla-carousel-angular';\nimport { EclQuizCardComponent } from './ecl-quiz-card.component';\n\n/**\n * ECL Quiz component – renders a carousel of quiz cards with navigation.\n * Supports two variants: 'reveal' (flip cards) and 'poll' (multiple choice).\n *\n * Uses Embla Carousel (via embla-carousel-angular) to match the ECL vanilla\n * implementation which also uses Embla internally.\n */\n@Component({\n selector: 'div[eclQuiz]',\n templateUrl: './ecl-quiz.component.html',\n imports: [\n TranslateModule,\n EclIconComponent,\n EmblaCarouselDirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EclQuizComponent extends ECLBaseDirective implements AfterContentInit, AfterViewInit {\n\n /** Quiz variant: 'reveal' for flip cards, 'poll' for multiple choice. */\n variant = input<'poll' | 'reveal'>('reveal');\n\n /** Title displayed in the quiz header. */\n eclTitle = input<string>('');\n\n /** Description displayed below the title. */\n eclDescription = input<string>('');\n\n /** Embla carousel options matching ECL's configuration. */\n emblaOptions = { loop: false, align: 'start' as const };\n\n @ContentChildren(forwardRef(() => EclQuizCardComponent))\n cards: QueryList<EclQuizCardComponent>;\n\n @ViewChild(EmblaCarouselDirective) emblaRef: EmblaCarouselDirective;\n @ViewChildren('dotButton') dotButtons: QueryList<ElementRef>;\n\n /** Current snap index. */\n activeIndex = signal(0);\n\n /** Total number of snap points. */\n totalSnaps = signal(0);\n\n /** Live region text for screen readers. */\n liveRegionText = signal('');\n\n /** Counter text for mobile display. */\n counterText = signal('');\n\n /** Whether the previous button is disabled. */\n prevDisabled = signal(true);\n\n /** Whether the next button is disabled. */\n nextDisabled = signal(true);\n\n /** Whether navigation controls should be shown. */\n showControls = signal(false);\n\n private cd = inject(ChangeDetectorRef);\n private translateService = inject(TranslateService);\n private emblaApi: EmblaCarouselType | undefined;\n\n @HostBinding('class')\n get cssClasses(): string {\n return [\n super.getCssClasses('ecl-quiz'),\n `ecl-quiz--${this.variant()}`,\n ]\n .join(' ')\n .trim();\n }\n\n // @HostBinding('attr.data-ecl-auto-init')\n // get autoInit(): string {\n // return 'Quiz';\n // }\n\n ngAfterContentInit(): void {\n if (this.cards && this.cards.length > 1) {\n this.showControls.set(true);\n }\n this.propagateVariant();\n this.cards.changes.subscribe(() => this.propagateVariant());\n }\n\n ngAfterViewInit(): void {\n // Give Embla time to initialize\n setTimeout(() => {\n this.initEmbla();\n });\n }\n\n /** Handle keyboard events. */\n @HostListener('keydown', ['$event'])\n onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n this.escapeSlider();\n }\n }\n\n /** Navigate to the previous snap. */\n onPrevClick(): void {\n if (this.emblaRef) {\n this.emblaRef.scrollPrev();\n }\n }\n\n /** Navigate to the next snap. */\n onNextClick(): void {\n if (this.emblaRef) {\n this.emblaRef.scrollNext();\n }\n }\n\n /** Navigate to a specific snap index. */\n goTo(index: number): void {\n if (this.emblaRef) {\n this.emblaRef.scrollTo(index);\n }\n }\n\n /** Returns the total number of cards. */\n getCardsCount(): number {\n return this.cards?.length ?? 0;\n }\n\n /** Returns an array of indices for dot rendering. */\n getDotIndices(): number[] {\n return Array.from({ length: this.totalSnaps() }, (_, i) => i);\n }\n\n /** Called by the emblaChange event from the directive. */\n onEmblaChange(eventName: string): void {\n if (!this.emblaApi) {\n this.emblaApi = this.emblaRef?.emblaApi;\n }\n if (!this.emblaApi) {\n return;\n }\n\n if (eventName === 'select' || eventName === 'init' || eventName === 'reInit') {\n this.syncState();\n }\n\n if (eventName === 'reInit') {\n this.checkHeight();\n }\n }\n\n /** Subscribed Embla events. */\n subscribeToEvents: EmblaEventType[] = ['select', 'init', 'reInit'];\n\n /**\n * Equalizes the height of all cards based on the tallest content.\n * Mirrors the ECL vanilla `checkHeight()` logic.\n */\n checkHeight(): void {\n if (!this.cards || this.cards.length === 0) {\n return;\n }\n\n let maxTextHeight = 0;\n let maxHeight = 0;\n\n const cardsArray = this.cards.toArray();\n\n // First pass: find the tallest question/answer text\n cardsArray.forEach((card) => {\n const frontEl = card.getFrontElement();\n const backEl = card.getBackElement();\n const questionEl = card.getQuestionElement();\n const answerEl = card.getAnswerElement();\n\n if (!frontEl || !backEl || !questionEl || !answerEl) {\n return;\n }\n\n frontEl.style.position = 'static';\n backEl.style.position = 'static';\n\n questionEl.style.minHeight = '';\n answerEl.style.minHeight = '';\n\n const heightQuestion = questionEl.scrollHeight;\n const heightAnswer = answerEl.scrollHeight;\n const heightText = Math.max(heightQuestion, heightAnswer);\n\n if (heightText > maxTextHeight) {\n maxTextHeight = heightText;\n }\n\n frontEl.style.position = '';\n backEl.style.position = '';\n });\n\n // Second pass: apply min-height and find tallest card\n cardsArray.forEach((card) => {\n const frontEl = card.getFrontElement();\n const backEl = card.getBackElement();\n const questionEl = card.getQuestionElement();\n const answerEl = card.getAnswerElement();\n const contentEl = card.getContentElement();\n\n if (!frontEl || !backEl || !questionEl || !answerEl || !contentEl) {\n return;\n }\n\n frontEl.style.position = 'static';\n backEl.style.position = 'static';\n contentEl.style.height = '';\n\n questionEl.style.minHeight = maxTextHeight + 'px';\n answerEl.style.minHeight = maxTextHeight + 'px';\n\n const heightFront = frontEl.scrollHeight;\n const heightBack = backEl.scrollHeight;\n const height = Math.max(heightFront, heightBack);\n\n const minHeight = parseFloat(getComputedStyle(frontEl).getPropertyValue('min-height')) || 345;\n\n if (height > minHeight && height > maxHeight) {\n maxHeight = height;\n }\n\n frontEl.style.position = '';\n backEl.style.position = '';\n });\n\n // Third pass: apply uniform height\n if (maxHeight > 0) {\n cardsArray.forEach((card) => {\n const contentEl = card.getContentElement();\n if (contentEl) {\n contentEl.style.height = maxHeight + 'px';\n }\n });\n }\n }\n\n /** Initialize Embla and wire up state syncing. */\n private initEmbla(): void {\n if (!this.emblaRef) {\n return;\n }\n\n this.emblaApi = this.emblaRef.emblaApi;\n\n if (!this.emblaApi) {\n return;\n }\n\n this.syncState();\n this.checkHeight();\n this.cd.detectChanges();\n }\n\n /** Sync component state from Embla API. */\n private syncState(): void {\n if (!this.emblaApi) {\n return;\n }\n\n const snapList = this.emblaApi.scrollSnapList();\n const selectedSnap = this.emblaApi.selectedScrollSnap();\n const canScrollPrev = this.emblaApi.canScrollPrev();\n const canScrollNext = this.emblaApi.canScrollNext();\n\n this.totalSnaps.set(snapList.length);\n this.activeIndex.set(selectedSnap);\n this.prevDisabled.set(!canScrollPrev);\n this.nextDisabled.set(!canScrollNext);\n this.showControls.set(canScrollPrev || canScrollNext);\n\n this.updateCounter();\n this.updateLiveRegion();\n }\n\n /** Update the counter text (mobile). */\n private updateCounter(): void {\n const total = this.totalSnaps();\n const current = this.activeIndex() + 1;\n this.counterText.set(`${current} / ${total}`);\n }\n\n /** Update the live region for screen readers. */\n private updateLiveRegion(): void {\n const totalCards = this.getCardsCount();\n const totalGroups = this.totalSnaps();\n const currentGroup = this.activeIndex() + 1;\n this.liveRegionText.set(\n this.translateService.instant('ecl.quiz.SHOWING-SLIDE', { current: currentGroup, totalSlides: totalCards, totalGroups })\n );\n }\n\n /** Move focus to the last dot button when Escape is pressed. */\n private escapeSlider(): void {\n if (this.dotButtons && this.dotButtons.length > 0) {\n const lastDot = this.dotButtons.last;\n lastDot.nativeElement.focus();\n }\n }\n\n /** Propagate the variant and aria-roledescription to all child cards. */\n private propagateVariant(): void {\n const v = this.variant();\n const isCarousel = this.cards.length > 1;\n this.cards?.forEach(card => {\n card.variant = v;\n card.ariaRoleDescription = isCarousel ? 'slide' : null;\n });\n }\n}\n","@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 <div class=\"ecl-quiz__list\">\n <ng-content></ng-content>\n </div>\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<div class=\"ecl-quiz__live-region\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveRegionText() }}</div>\n","import { EclQuizComponent } from './ecl-quiz.component';\nimport { EclQuizCardComponent } from './ecl-quiz-card.component';\n\nexport * from './ecl-quiz.component';\nexport * from './ecl-quiz-card.component';\n\nexport const EUI_ECL_QUIZ = [\n EclQuizComponent,\n EclQuizCardComponent,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAuBA;;;;;AAKG;AAOG,MAAO,oBAAqB,SAAQ,gBAAgB,CAAA;AAN1D,IAAA,WAAA,GAAA;;AAQ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,eAAA,EACgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,+jEAAA,EAAA;;sBAgB9C,eAAe;AAAC,gBAAA,IAAA,EAAA,CAAA,UAAU,CAAC,MAAM,oBAAoB,CAAC;;sBAGtD,SAAS;uBAAC,sBAAsB;;sBAChC,YAAY;uBAAC,WAAW;;sBA2BxB,WAAW;uBAAC,OAAO;;sBA+BnB,YAAY;uBAAC,SAAS,EAAE,CAAC,QAAQ,CAAC;;;AE/GhC,MAAM,YAAY,GAAG;IAC1B,gBAAgB;IAChB,oBAAoB;;;ACRtB;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"eui-ecl-components-ecl-quiz.mjs","sources":["../../components/ecl-quiz/ecl-quiz-card.component.ts","../../components/ecl-quiz/ecl-quiz-card.component.html","../../components/ecl-quiz/ecl-quiz.component.ts","../../components/ecl-quiz/ecl-quiz.component.html","../../components/ecl-quiz/index.ts","../../components/ecl-quiz/eui-ecl-components-ecl-quiz.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n Directive,\n ElementRef,\n EventEmitter,\n HostBinding,\n HostListener,\n input,\n Output,\n signal,\n ViewChild\n} from '@angular/core';\nimport { EclIconComponent } from '@eui/ecl/components/ecl-icon';\nimport { ECLBaseDirective } from '@eui/ecl/core';\nimport { TranslateModule } from '@ngx-translate/core';\n\nexport interface EclQuizCardFlipEvent {\n flipped: boolean;\n selectedOptionIndex?: number;\n isCorrect?: boolean;\n}\n\n@Directive({\n selector: 'ol[eclQuizList]',\n})\nexport class EclQuizListDirective {\n @HostBinding('class.ecl-quiz__list') hasClass = true;\n}\n\n/**\n * ECL Quiz Card component – represents a single card in the quiz.\n *\n * For the 'reveal' variant, the entire card is clickable to flip.\n * For the 'poll' variant, individual options trigger the flip.\n */\n@Component({\n selector: 'li[eclQuizCard]',\n host: {\n '[attr.id]': 'id()',\n '[attr.aria-labelledby]': 'questionId()',\n '[class]': 'cssClasses',\n '[attr.tabindex]': 'tabIndex',\n '[style.transform]': 'styleTransform',\n '(click)': 'onClick()',\n '(keydown)': 'onKeydown($event)',\n },\n templateUrl: './ecl-quiz-card.component.html',\n imports: [EclIconComponent, TranslateModule],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EclQuizCardComponent extends ECLBaseDirective {\n\n /**\n * Unique identifier for the card, used for accessibility attributes.\n * If not provided, a unique ID is generated automatically.\n */\n id = input<string>(`ecl-quiz-card-${crypto.randomUUID()}`);\n\n /**\n * Unique identifier for the question element.\n */\n questionId = computed(() => `${this.id()}-question`);\n\n /**\n * Unique identifier for the answer element.\n */\n answerId = computed(() => `${this.id()}-answer`);\n\n /**\n * The question text displayed on the front of the card.\n */\n question = input<string>('');\n\n /**\n * The answer text displayed on the back of the card.\n * Used in 'reveal' variant or as explanation in 'poll' variant.\n */\n answer = input<string>('');\n\n /**\n * The answer title (e.g. \"The correct answer is A.\") for poll variant.\n */\n answerTitle = input<string>('');\n\n /**\n * Category label displayed in the card header (poll variant).\n */\n category = input<string>('');\n\n /**\n * Icon name for the card header.\n * Defaults to 'sparkle' for reveal, 'question' for poll.\n */\n icon = input<string>('');\n\n /**\n * Icon size for the card header.\n */\n iconSize = input<'xs' | 's' | 'm' | 'l' | 'xl' | '2xl'>('xl');\n\n /**\n * The variant of the quiz, set by the parent EclQuizComponent.\n */\n variant: 'poll' | 'reveal' = 'reveal';\n\n /**\n * Options for the poll variant. Each option has text and a match flag.\n */\n options = input<Array<{ text: string; match: boolean }>>([]);\n\n /**\n * Emitted when the card is flipped.\n */\n @Output() cardFlip = new EventEmitter<EclQuizCardFlipEvent>();\n\n @ViewChild('frontElement') frontElementRef: ElementRef;\n @ViewChild('backElement') backElementRef: ElementRef;\n @ViewChild('questionElement') questionElementRef: ElementRef;\n @ViewChild('answerElement') answerElementRef: ElementRef;\n @ViewChild('contentElement') contentElementRef: ElementRef;\n\n /** Whether the card is currently flipped (showing back). */\n isFlipped = signal(false);\n\n /** Index of the selected option (poll variant). */\n selectedOptionIndex = signal<number | null>(null);\n\n /** Whether the selected option is correct (poll variant). */\n isCorrect = signal<boolean | null>(null);\n\n get cssClasses(): string {\n return [\n super.getCssClasses('ecl-quiz-card'),\n this.isFlipped() ? 'ecl-quiz-card__flipped' : '',\n ]\n .join(' ')\n .trim();\n }\n\n get tabIndex(): number | null {\n return this.variant === 'reveal' ? 0 : null;\n }\n\n readonly styleTransform = 'translate3d(0px, 0px, 0px)';\n\n /**\n * Handle click on the card itself (reveal variant).\n */\n onClick(): void {\n if (this.variant === 'reveal') {\n this.flipCard();\n }\n }\n\n /**\n * Handle keyboard events (Enter/Space to flip for reveal variant).\n */\n onKeydown(event: KeyboardEvent): void {\n if (this.variant === 'reveal' && (event.key === 'Enter' || event.key === ' ')) {\n event.preventDefault();\n this.flipCard();\n }\n }\n\n /**\n * Handle option click (poll variant).\n */\n onOptionClick(optionIndex: number): void {\n if (this.isFlipped()) {\n return;\n }\n const optionsList = this.options();\n this.selectedOptionIndex.set(optionIndex);\n this.isCorrect.set(optionsList[optionIndex]?.match ?? false);\n this.flipCard();\n }\n\n /**\n * Handle keyboard on option (poll variant).\n */\n onOptionKeydown(event: KeyboardEvent, optionIndex: number): void {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.onOptionClick(optionIndex);\n }\n }\n\n /**\n * Flip the card between front and back.\n */\n flipCard(): void {\n this.isFlipped.update(v => !v);\n const event: EclQuizCardFlipEvent = { flipped: this.isFlipped() };\n if (this.variant === 'poll') {\n event.selectedOptionIndex = this.selectedOptionIndex();\n event.isCorrect = this.isCorrect();\n }\n this.cardFlip.emit(event);\n }\n\n /** Get the native front element for height calculations. */\n getFrontElement(): HTMLElement | null {\n return this.frontElementRef?.nativeElement ?? null;\n }\n\n /** Get the native back element for height calculations. */\n getBackElement(): HTMLElement | null {\n return this.backElementRef?.nativeElement ?? null;\n }\n\n /** Get the native question element for height calculations. */\n getQuestionElement(): HTMLElement | null {\n return this.questionElementRef?.nativeElement ?? null;\n }\n\n /** Get the native answer element for height calculations. */\n getAnswerElement(): HTMLElement | null {\n return this.answerElementRef?.nativeElement ?? null;\n }\n\n /** Get the native content element for height calculations. */\n getContentElement(): HTMLElement | null {\n return this.contentElementRef?.nativeElement ?? null;\n }\n\n /** Get the resolved icon name based on variant. */\n getIconName(): string {\n if (this.icon()) {\n return this.icon();\n }\n return this.variant === 'poll' ? 'question' : 'sparkle';\n }\n\n /** Get the resolved icon size. */\n getIconSize(): string {\n return this.iconSize() || (this.variant === 'poll' ? '2xl' : 'xl');\n }\n}\n","<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>","import {\n AfterContentInit,\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n ElementRef,\n forwardRef,\n HostBinding,\n inject,\n input,\n QueryList,\n signal,\n ViewChild,\n ViewChildren\n} from '@angular/core';\nimport { EclIconComponent } from '@eui/ecl/components/ecl-icon';\nimport { ECLBaseDirective } from '@eui/ecl/core';\nimport { TranslateModule } from '@ngx-translate/core';\nimport { EmblaCarouselDirective, EmblaCarouselType, EmblaEventType } from 'embla-carousel-angular';\nimport { EclQuizCardComponent } from './ecl-quiz-card.component';\n\n/**\n * ECL Quiz component – renders a carousel of quiz cards with navigation.\n * Supports two variants: 'reveal' (flip cards) and 'poll' (multiple choice).\n *\n * Uses Embla Carousel (via embla-carousel-angular) to match the ECL vanilla\n * implementation which also uses Embla internally.\n */\n@Component({\n selector: 'section[eclQuiz]',\n templateUrl: './ecl-quiz.component.html',\n host: {\n '[class]': 'cssClasses',\n '(keydown)': 'onKeydown($event)',\n },\n imports: [\n TranslateModule,\n EclIconComponent,\n EmblaCarouselDirective,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class EclQuizComponent extends ECLBaseDirective implements AfterContentInit, AfterViewInit {\n\n /** Quiz variant: 'reveal' for flip cards, 'poll' for multiple choice. */\n variant = input<'poll' | 'reveal'>('reveal');\n\n /** Title displayed in the quiz header. */\n eclTitle = input<string>('');\n\n /** Description displayed below the title. */\n eclDescription = input<string>('');\n\n /** Embla carousel options matching ECL's configuration. */\n emblaOptions = { loop: false, align: 'start' as const };\n\n @ContentChildren(forwardRef(() => EclQuizCardComponent), { descendants: true })\n cards: QueryList<EclQuizCardComponent>;\n\n @ViewChild(EmblaCarouselDirective) emblaRef: EmblaCarouselDirective;\n @ViewChildren('dotButton') dotButtons: QueryList<ElementRef>;\n\n /** Current snap index. */\n activeIndex = signal(0);\n\n /** Total number of snap points. */\n totalSnaps = signal(0);\n\n /** Counter text for mobile display. */\n counterText = signal('');\n\n /** Whether the previous button is disabled. */\n prevDisabled = signal(true);\n\n /** Whether the next button is disabled. */\n nextDisabled = signal(true);\n\n /** Whether navigation controls should be shown. */\n showControls = signal(false);\n\n private cd = inject(ChangeDetectorRef);\n private emblaApi: EmblaCarouselType | undefined;\n\n get cssClasses(): string {\n return [\n super.getCssClasses('ecl-quiz'),\n `ecl-quiz--${this.variant()}`,\n ]\n .join(' ')\n .trim();\n }\n\n ngAfterContentInit(): void {\n if (this.cards && this.cards.length > 1) {\n this.showControls.set(true);\n }\n this.propagateVariant();\n this.cards.changes.subscribe(() => this.propagateVariant());\n }\n\n ngAfterViewInit(): void {\n // Give Embla time to initialize\n setTimeout(() => {\n this.initEmbla();\n });\n }\n\n /** Handle keyboard events. */\n onKeydown(event: KeyboardEvent): void {\n if (event.key === 'Escape') {\n this.escapeSlider();\n }\n }\n\n /** Navigate to the previous snap. */\n onPrevClick(): void {\n if (this.emblaRef) {\n this.emblaRef.scrollPrev();\n }\n }\n\n /** Navigate to the next snap. */\n onNextClick(): void {\n if (this.emblaRef) {\n this.emblaRef.scrollNext();\n }\n }\n\n /** Navigate to a specific snap index. */\n goTo(index: number): void {\n if (this.emblaRef) {\n this.emblaRef.scrollTo(index);\n }\n }\n\n /** Returns the total number of cards. */\n getCardsCount(): number {\n return this.cards?.length ?? 0;\n }\n\n /** Returns an array of indices for dot rendering. */\n getDotIndices(): number[] {\n return Array.from({ length: this.totalSnaps() }, (_, i) => i);\n }\n\n /** Called by the emblaChange event from the directive. */\n onEmblaChange(eventName: string): void {\n if (!this.emblaApi) {\n this.emblaApi = this.emblaRef?.emblaApi;\n }\n if (!this.emblaApi) {\n return;\n }\n\n if (eventName === 'select' || eventName === 'init' || eventName === 'reInit') {\n this.syncState();\n }\n\n if (eventName === 'reInit') {\n this.checkHeight();\n }\n }\n\n /** Subscribed Embla events. */\n subscribeToEvents: EmblaEventType[] = ['select', 'init', 'reInit'];\n\n /**\n * Equalizes the height of all cards based on the tallest content.\n * Mirrors the ECL vanilla `checkHeight()` logic.\n */\n checkHeight(): void {\n if (!this.cards || this.cards.length === 0) {\n return;\n }\n\n let maxTextHeight = 0;\n let maxHeight = 0;\n\n const cardsArray = this.cards.toArray();\n\n // First pass: find the tallest question/answer text\n cardsArray.forEach((card) => {\n const frontEl = card.getFrontElement();\n const backEl = card.getBackElement();\n const questionEl = card.getQuestionElement();\n const answerEl = card.getAnswerElement();\n\n if (!frontEl || !backEl || !questionEl || !answerEl) {\n return;\n }\n\n frontEl.style.position = 'static';\n backEl.style.position = 'static';\n\n questionEl.style.minHeight = '';\n answerEl.style.minHeight = '';\n\n const heightQuestion = questionEl.scrollHeight;\n const heightAnswer = answerEl.scrollHeight;\n const heightText = Math.max(heightQuestion, heightAnswer);\n\n if (heightText > maxTextHeight) {\n maxTextHeight = heightText;\n }\n\n frontEl.style.position = '';\n backEl.style.position = '';\n });\n\n // Second pass: apply min-height and find tallest card\n cardsArray.forEach((card) => {\n const frontEl = card.getFrontElement();\n const backEl = card.getBackElement();\n const questionEl = card.getQuestionElement();\n const answerEl = card.getAnswerElement();\n const contentEl = card.getContentElement();\n\n if (!frontEl || !backEl || !questionEl || !answerEl || !contentEl) {\n return;\n }\n\n frontEl.style.position = 'static';\n backEl.style.position = 'static';\n contentEl.style.height = '';\n\n questionEl.style.minHeight = maxTextHeight + 'px';\n answerEl.style.minHeight = maxTextHeight + 'px';\n\n const heightFront = frontEl.scrollHeight;\n const heightBack = backEl.scrollHeight;\n const height = Math.max(heightFront, heightBack);\n\n const minHeight = parseFloat(getComputedStyle(frontEl).getPropertyValue('min-height')) || 345;\n\n if (height > minHeight && height > maxHeight) {\n maxHeight = height;\n }\n\n frontEl.style.position = '';\n backEl.style.position = '';\n });\n\n // Third pass: apply uniform height\n if (maxHeight > 0) {\n cardsArray.forEach((card) => {\n const contentEl = card.getContentElement();\n if (contentEl) {\n contentEl.style.height = maxHeight + 'px';\n }\n });\n }\n }\n\n /** Initialize Embla and wire up state syncing. */\n private initEmbla(): void {\n if (!this.emblaRef) {\n return;\n }\n\n this.emblaApi = this.emblaRef.emblaApi;\n\n if (!this.emblaApi) {\n return;\n }\n\n this.syncState();\n this.checkHeight();\n this.cd.detectChanges();\n }\n\n /** Sync component state from Embla API. */\n private syncState(): void {\n if (!this.emblaApi) {\n return;\n }\n\n const snapList = this.emblaApi.scrollSnapList();\n const selectedSnap = this.emblaApi.selectedScrollSnap();\n const canScrollPrev = this.emblaApi.canScrollPrev();\n const canScrollNext = this.emblaApi.canScrollNext();\n\n this.totalSnaps.set(snapList.length);\n this.activeIndex.set(selectedSnap);\n this.prevDisabled.set(!canScrollPrev);\n this.nextDisabled.set(!canScrollNext);\n this.showControls.set(canScrollPrev || canScrollNext);\n\n this.updateCounter();\n }\n\n /** Update the counter text (mobile). */\n private updateCounter(): void {\n const total = this.totalSnaps();\n const current = this.activeIndex() + 1;\n this.counterText.set(`${current} / ${total}`);\n }\n\n /** Move focus to the last dot button when Escape is pressed. */\n private escapeSlider(): void {\n if (this.dotButtons && this.dotButtons.length > 0) {\n const lastDot = this.dotButtons.last;\n lastDot.nativeElement.focus();\n }\n }\n\n /** Propagate the variant to all child cards. */\n private propagateVariant(): void {\n const v = this.variant();\n this.cards?.forEach(card => {\n card.variant = v;\n });\n }\n}\n","@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","import { EclQuizComponent } from './ecl-quiz.component';\nimport { EclQuizCardComponent, EclQuizListDirective } from './ecl-quiz-card.component';\n\nexport * from './ecl-quiz.component';\nexport * from './ecl-quiz-card.component';\n\nexport const EUI_ECL_QUIZ = [\n EclQuizComponent,\n EclQuizCardComponent,\n EclQuizListDirective,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MA2Ba,oBAAoB,CAAA;AAHjC,IAAA,WAAA,GAAA;QAIyC,IAAA,CAAA,QAAQ,GAAG,IAAI;AACvD,IAAA;+GAFY,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAApB,oB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