@eui/ecl 22.0.0-alpha.58 → 22.0.0-alpha.59
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/docs/changelog.html +33 -0
- package/docs/js/search/search_index.js +2 -2
- package/docs/json/documentation.json +26 -26
- package/docs/llms.txt +1 -1
- package/docs/properties.html +1 -1
- package/fesm2022/eui-ecl-components-ecl-carousel.mjs +4 -8
- package/fesm2022/eui-ecl-components-ecl-carousel.mjs.map +1 -1
- package/package.json +1 -1
- package/types/eui-ecl-components-ecl-carousel.d.ts +0 -1
- package/types/eui-ecl-components-ecl-carousel.d.ts.map +1 -1
|
@@ -53626,7 +53626,7 @@
|
|
|
53626
53626
|
},
|
|
53627
53627
|
{
|
|
53628
53628
|
"name": "EclCarouselComponent",
|
|
53629
|
-
"id": "component-EclCarouselComponent-
|
|
53629
|
+
"id": "component-EclCarouselComponent-eeeb5ea1d9682d08eb8ce62ed1c3616439306cdbc5762905a408abc7480fdabb190197e5ea84179eaa8698071b355edcdacf04a82fd5f281b8ef5f261d0b91a8",
|
|
53630
53630
|
"file": "packages/ecl/components/ecl-carousel/ecl-carousel.component.ts",
|
|
53631
53631
|
"encapsulation": [],
|
|
53632
53632
|
"entryComponents": [],
|
|
@@ -53819,7 +53819,7 @@
|
|
|
53819
53819
|
"indexKey": "",
|
|
53820
53820
|
"optional": false,
|
|
53821
53821
|
"description": "<p>Returns the computed CSS class list for the component.</p>\n",
|
|
53822
|
-
"line":
|
|
53822
|
+
"line": 222,
|
|
53823
53823
|
"rawdescription": "\n\nReturns the computed CSS class list for the component.\n",
|
|
53824
53824
|
"modifierKind": [
|
|
53825
53825
|
124,
|
|
@@ -54199,7 +54199,7 @@
|
|
|
54199
54199
|
"optional": false,
|
|
54200
54200
|
"returnType": "void",
|
|
54201
54201
|
"typeParameters": [],
|
|
54202
|
-
"line":
|
|
54202
|
+
"line": 243,
|
|
54203
54203
|
"deprecated": false,
|
|
54204
54204
|
"deprecationMessage": "",
|
|
54205
54205
|
"rawdescription": "\n\nAngular lifecycle hook: initializes RTL detection and the Embla plugins.\n",
|
|
@@ -54341,8 +54341,8 @@
|
|
|
54341
54341
|
"jsdoctags": [
|
|
54342
54342
|
{
|
|
54343
54343
|
"name": {
|
|
54344
|
-
"pos":
|
|
54345
|
-
"end":
|
|
54344
|
+
"pos": 13982,
|
|
54345
|
+
"end": 13991,
|
|
54346
54346
|
"kind": 80,
|
|
54347
54347
|
"id": 0,
|
|
54348
54348
|
"flags": 16842752,
|
|
@@ -54356,8 +54356,8 @@
|
|
|
54356
54356
|
"deprecationMessage": "",
|
|
54357
54357
|
"defaultValue": "true",
|
|
54358
54358
|
"tagName": {
|
|
54359
|
-
"pos":
|
|
54360
|
-
"end":
|
|
54359
|
+
"pos": 13976,
|
|
54360
|
+
"end": 13981,
|
|
54361
54361
|
"kind": 80,
|
|
54362
54362
|
"id": 0,
|
|
54363
54363
|
"flags": 16842752,
|
|
@@ -54615,7 +54615,7 @@
|
|
|
54615
54615
|
"description": "<p>Carousel (slideshow) component following the ECL design system.\nRenders a sequence of <code>EclCarouselItemComponent</code> slides with autoplay, keyboard navigation,\nresponsive breakpoint awareness, and RTL layout support.</p>\n<p>The slide engine is powered by Embla (via <code>embla-carousel-angular</code>), matching the upstream\nECL implementation: an infinite <code>loop</code>, the <code>Autoplay</code> plugin driving the teaser loading bars,\nand a slider pager with previous/next/play/pause controls, a counter, and a tablist of teaser\nbuttons (one per slide).</p>\n<ul>\n<li>Selector: <code>ecl-carousel</code>.</li>\n<li>Project <code>ecl-carousel-item</code> elements as slides (also via <code>contentChildren</code>).</li>\n<li><code>ariaLabel</code> — ARIA label for the carousel landmark; aliased as <code>aria-label</code>.</li>\n<li><code>isAutoplay</code> — enables automatic slide advancement; boolean attribute.</li>\n<li><code>playInterval</code> — milliseconds between automatic transitions; default <code>5000</code>.</li>\n<li><code>slide</code> — emits <code>EclSlideEvent</code> when the active slide changes.</li>\n</ul>\n",
|
|
54616
54616
|
"rawdescription": "\n\nCarousel (slideshow) component following the ECL design system.\nRenders a sequence of `EclCarouselItemComponent` slides with autoplay, keyboard navigation,\nresponsive breakpoint awareness, and RTL layout support.\n\nThe slide engine is powered by Embla (via `embla-carousel-angular`), matching the upstream\nECL implementation: an infinite `loop`, the `Autoplay` plugin driving the teaser loading bars,\nand a slider pager with previous/next/play/pause controls, a counter, and a tablist of teaser\nbuttons (one per slide).\n\n- Selector: `ecl-carousel`.\n- Project `ecl-carousel-item` elements as slides (also via `contentChildren`).\n- `ariaLabel` — ARIA label for the carousel landmark; aliased as `aria-label`.\n- `isAutoplay` — enables automatic slide advancement; boolean attribute.\n- `playInterval` — milliseconds between automatic transitions; default `5000`.\n- `slide` — emits `EclSlideEvent` when the active slide changes.\n",
|
|
54617
54617
|
"type": "component",
|
|
54618
|
-
"sourceCode": "import { BreakpointObserver } from '@angular/cdk/layout';\nimport {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n DOCUMENT,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChildren,\n forwardRef,\n inject,\n input,\n numberAttribute,\n output,\n signal,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { EUI_ECL_SLIDER } from '@eui/ecl/components/ecl-slider';\nimport { ECLBaseDirective, EclRtlService, KeyCode } from '@eui/ecl/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport {\n EmblaEventType,\n EmblaOptionsType,\n EmblaPluginType,\n} from 'embla-carousel';\nimport { EmblaCarouselDirective } from 'embla-carousel-angular';\nimport Autoplay from 'embla-carousel-autoplay';\nimport { Subject, auditTime, fromEvent, takeUntil } from 'rxjs';\nimport { EclCarouselItemComponent } from './ecl-carousel-item.component';\nimport { EclSlideEvent } from './events/ecl-slide.event';\n\n/**\n * Number of teaser buttons visible at once on the desktop breakpoint.\n */\nconst VISIBLE_TEASERS = 4;\n\n/**\n * Carousel (slideshow) component following the ECL design system.\n * Renders a sequence of `EclCarouselItemComponent` slides with autoplay, keyboard navigation,\n * responsive breakpoint awareness, and RTL layout support.\n *\n * The slide engine is powered by Embla (via `embla-carousel-angular`), matching the upstream\n * ECL implementation: an infinite `loop`, the `Autoplay` plugin driving the teaser loading bars,\n * and a slider pager with previous/next/play/pause controls, a counter, and a tablist of teaser\n * buttons (one per slide).\n *\n * - Selector: `ecl-carousel`.\n * - Project `ecl-carousel-item` elements as slides (also via `contentChildren`).\n * - `ariaLabel` — ARIA label for the carousel landmark; aliased as `aria-label`.\n * - `isAutoplay` — enables automatic slide advancement; boolean attribute.\n * - `playInterval` — milliseconds between automatic transitions; default `5000`.\n * - `slide` — emits `EclSlideEvent` when the active slide changes.\n */\n@Component({\n selector: 'ecl-carousel',\n templateUrl: './ecl-carousel.component.html',\n imports: [\n TranslatePipe,\n EmblaCarouselDirective,\n ...EUI_ECL_SLIDER,\n ],\n host: {\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-roledescription]': '\"carousel\"',\n '[class]': 'cssClasses()',\n // Drives the teaser loading-bar animation duration (see @eui/styles).\n // It has no CSS fallback, so without it the progress animation never\n // runs; it must match the autoplay delay.\n '[style.--ecl-carousel-slide-duration]': 'playInterval() + \"ms\"',\n },\n})\nexport class EclCarouselComponent extends ECLBaseDirective implements OnInit, OnDestroy, AfterContentInit {\n /**\n * Aria-label for screen readers to describe the carousel.\n */\n readonly ariaLabel = input<string | null>('Carousel description here', { alias: 'aria-label' });\n\n /**\n * Determines whether the carousel should autoplay.\n */\n readonly isAutoplay = input<boolean, unknown>(undefined, { transform: booleanAttribute });\n\n /**\n * Interval in milliseconds between automatic slide transitions.\n */\n readonly playInterval = input(5000, { transform: numberAttribute });\n\n /**\n * Event emitted when a slide change occurs.\n */\n readonly slide = output<EclSlideEvent>();\n\n /**\n * Reference to the main carousel viewport element (the Embla root).\n */\n readonly carouselContainerElement = viewChild<ElementRef>('carouselContainer');\n\n /**\n * Collection of slide components rendered inside the carousel.\n */\n readonly slides = contentChildren(forwardRef(() => EclCarouselItemComponent));\n\n /**\n * Indicates whether autoplay is currently active.\n */\n readonly isPlaying = signal(false);\n\n /**\n * Indicates whether autoplay was manually paused (via the pause button or\n * on mobile). When paused this way the loading bar is cleared.\n */\n readonly isPausedForced = signal(false);\n\n /**\n * Indicates whether the layout is currently in RTL mode.\n */\n isRtl = false;\n\n /**\n * Zero-based index of the currently active slide (mirrors Embla's selected snap).\n */\n private activeIndex = 0;\n\n /**\n * Start index of the currently visible teaser window (desktop only).\n */\n private teaserWindowStart = 0;\n\n /**\n * Indicates whether autoplay is temporarily paused by hover/focus. Unlike a\n * manual pause, the loading bar stays visible and frozen at its current\n * progress (matching ECL), resuming when the pointer/focus leaves.\n */\n protected readonly isHoverPaused = signal(false);\n\n /**\n * Whether the current viewport is at the mobile breakpoint. A signal so the\n * template can react (the pager drops play/pause on mobile, matching ECL,\n * where play/pause is a desktop-only control).\n */\n protected readonly isMobileBreakpoint = signal(false);\n\n /**\n * Whether the viewport is at or above the ECL desktop breakpoint (1140px).\n * This is the boundary the ECL CSS uses to show the play/pause controls and\n * the teaser tablist (and to hide the mobile dots). A signal so the pager\n * variant can react: play/pause only renders at/above this width, matching\n * the CSS so the pause button never leaks onto narrower viewports.\n */\n protected readonly isDesktopBreakpointActive = signal(false);\n\n /**\n * Embla options, mirroring the upstream ECL configuration.\n */\n protected emblaOptions: EmblaOptionsType = {\n loop: true,\n align: 'start',\n duration: 20,\n };\n\n /**\n * Embla plugins. Built once so the Embla directive does not needlessly re-init.\n */\n protected emblaPlugins: EmblaPluginType[] = [];\n\n /**\n * Embla events the component reacts to.\n */\n protected readonly emblaEvents: EmblaEventType[] = [\n 'select',\n 'reInit',\n 'autoplay:timerset',\n ];\n\n /**\n * Reference to the Embla directive driving the slide engine.\n */\n private readonly embla = viewChild<EmblaCarouselDirective>('embla');\n\n /**\n * References to the teaser navigation buttons corresponding to each slide.\n */\n private readonly teaserButtons = viewChildren<ElementRef>('teaserButton');\n\n /**\n * References to the teaser loading-bar completion elements (one per slide),\n * used to restart the progress animation when the active slide changes.\n */\n private readonly loadingBars = viewChildren<ElementRef>('loadingBar');\n\n private isTabletBreakpoint = false;\n private isLargeBreakpoint = false;\n private isDesktopBreakpoint = false;\n\n private destroy$: Subject<boolean> = new Subject<boolean>();\n\n /**\n * Debounce interval (ms) used internally for timing and transitions.\n */\n private readonly TIMEOUT_INTERVAL = 400;\n private readonly cdkBreakpointObserver = inject(BreakpointObserver);\n private readonly cd = inject(ChangeDetectorRef);\n private readonly renderer2 = inject(Renderer2);\n private readonly eclRtlService = inject(EclRtlService);\n private readonly translate = inject(TranslateService);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly window = this.document.defaultView;\n /**\n * Host element, used to locate the slider pager's play/pause buttons by their\n * ECL classes for focus management after a play/pause toggle.\n */\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Returns the computed CSS class list for the component.\n */\n protected readonly cssClasses = computed<string>(() =>\n super.getCssClasses('ecl-carousel'));\n\n constructor() {\n super();\n afterNextRender(() => {\n this.observeElementSizeChanges();\n this.observeBreakpointChanges();\n this.syncFromEmbla();\n\n if (this.window) {\n fromEvent(this.window, 'resize')\n .pipe(auditTime(50), takeUntil(this.destroy$))\n .subscribe(() => this.observeElementSizeChanges());\n }\n });\n }\n\n /**\n * Angular lifecycle hook: initializes RTL detection and the Embla plugins.\n */\n ngOnInit(): void {\n this.emblaOptions = {\n ...this.emblaOptions,\n direction: this.isRtl ? 'rtl' : 'ltr',\n };\n const autoplayDesired = this.isAutoplayDesired();\n // Reflect the initial play state so the current slide's loading bar is\n // shown on load (the plugin self-starts via playOnInit).\n this.isPlaying.set(autoplayDesired);\n this.emblaPlugins = [\n Autoplay({\n delay: this.playInterval(),\n // Autoplay is on by default (matching ECL) unless explicitly\n // disabled via [isAutoplay]=\"false\". Letting the plugin start\n // itself avoids a race with Embla's own initialization.\n playOnInit: autoplayDesired,\n stopOnInteraction: false,\n stopOnMouseEnter: true,\n stopOnFocusIn: true,\n }),\n ];\n this.handleRtlChangeState();\n }\n\n /**\n * Angular lifecycle hook: called after content (slides) is initialized.\n */\n ngAfterContentInit(): void {\n setTimeout(() => {\n this.initSlides();\n });\n }\n\n /**\n * Angular lifecycle hook: cleans up subscriptions.\n */\n ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.unsubscribe();\n }\n\n /**\n * Returns whether the carousel has padding applied (e.g., on desktop breakpoint).\n */\n isPadded(): boolean {\n return this.isDesktopBreakpoint;\n }\n\n /**\n * Checks whether there are enough slides to render controls.\n */\n hasControls(): boolean {\n return this.getSlidesCount() > 1;\n }\n\n /**\n * Retrieves the current active slide index (zero-based).\n */\n getCurrentSlideIndex(): number {\n return this.activeIndex;\n }\n\n /**\n * Returns the 1-based position of the active slide (for the counter).\n */\n getCounterCurrent(): number {\n return this.activeIndex + 1;\n }\n\n /**\n * Returns the total number of slides (for the counter).\n */\n getCounterTotal(): number {\n return this.getSlidesCount();\n }\n\n /**\n * Dot indices for the mobile slider pager (one dot per slide). The dots are\n * hidden on desktop via the ECL CSS (`.ecl-carousel__dots { display: none }`)\n * and shown at the mobile breakpoint.\n */\n getDotIndices(): number[] {\n return Array.from({ length: this.getSlidesCount() }, (_unused, dotIndex) => dotIndex);\n }\n\n /**\n * Pre-translated accessible label for each pager dot. Translated here since\n * the shared `ecl-slider-pager` receives plain strings.\n */\n getDotAriaLabels(): string[] {\n const total = this.getSlidesCount();\n return Array.from({ length: total }, (_unused, dotIndex) =>\n this.translate.instant('ecl.carousel.GO-TO-SLIDE', {\n current: dotIndex + 1,\n total,\n }),\n );\n }\n\n /**\n * Returns whether a teaser button should be visible in the current window.\n */\n isTeaserVisible(index: number): boolean {\n const count = this.getSlidesCount();\n if (count <= VISIBLE_TEASERS) {\n return true;\n }\n const position = ((index - this.teaserWindowStart) % count + count) % count;\n return position < VISIBLE_TEASERS;\n }\n\n /**\n * Returns the flex order of a teaser button within the visible window.\n */\n getTeaserOrder(index: number): number {\n const count = this.getSlidesCount();\n return ((index - this.teaserWindowStart) % count + count) % count;\n }\n\n /**\n * Whether the pager should show the \"pause\" control (i.e. autoplay is\n * actively running). While the pointer/focus hover-pauses the carousel the\n * timer is suspended, so the pager must show \"play\" even though a manual\n * pause was not triggered. Mirrors upstream ECL, where hovering flips the\n * control to play.\n */\n protected isPagerPlaying(): boolean {\n return this.isPlaying() && !this.isHoverPaused();\n }\n\n /**\n * Pager variant by breakpoint. Below the ECL desktop breakpoint (1140px)\n * the carousel shows only the dots navigation (prev / dots / next);\n * play/pause is a desktop-only control in ECL. Rendering `'dots'` there\n * avoids the pager's inline play/pause `display` style (which would\n * otherwise beat the ECL CSS and leave the pause button visible on narrower\n * viewports). At/above 1140px the dots are hidden by CSS, so\n * `'play-pause-dots'` yields play/pause + prev/next + teasers.\n *\n * The 1140px boundary mirrors the media query the ECL CSS uses to toggle\n * `.ecl-carousel__play/__pause` and `.ecl-carousel__teasers`.\n */\n protected pagerVariant(): 'dots' | 'play-pause-dots' {\n return this.isDesktopBreakpointActive() ? 'play-pause-dots' : 'dots';\n }\n\n /**\n * Handles the throttled Embla events the component subscribed to.\n */\n protected onEmblaEvent(event: EmblaEventType): void {\n switch (event) {\n case 'select':\n case 'reInit':\n this.syncFromEmbla();\n break;\n case 'autoplay:timerset':\n // Fired each time the autoplay timer (re)starts for the current\n // slide; replay the loading-bar fill animation from zero.\n this.restartActiveLoadingBar();\n break;\n default:\n break;\n }\n }\n\n /**\n * Starts autoplay.\n *\n * @param moveFocus when true (a user clicked play) focus moves to the pause\n * button. Auto-starts (e.g. on breakpoint changes) pass false so the\n * page is not scrolled to the carousel on load.\n */\n protected onPlayClick(moveFocus = true): void {\n this.getAutoplay()?.play();\n this.isPlaying.set(true);\n this.isPausedForced.set(false);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n if (moveFocus) {\n this.focusPagerButton('.ecl-carousel__pause');\n }\n }\n\n /**\n * Stops autoplay and focuses the play button.\n */\n protected onPauseClick(): void {\n // Pause (not full stop): halt the autoplay timer but keep the active\n // teaser loading bar visible, frozen at its current progress (matching\n // upstream ECL's `handleAutoPlay(false, true)`). The installed\n // embla-carousel-autoplay exposes no `pause()`, so we call `stop()`\n // WITHOUT `reset()` — the frozen bar is driven by our `is-paused` CSS\n // class, not the plugin. A full stop+reset (which clears the bar) only\n // happens on prev/next/teaser navigation via `stopAutoplay()`.\n this.getAutoplay()?.stop();\n this.isPlaying.set(false);\n this.isPausedForced.set(true);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n this.focusPagerButton('.ecl-carousel__play');\n }\n\n /**\n * Navigates to the next slide and stops autoplay.\n */\n protected onNextSlideClick(): void {\n this.stopAutoplay();\n this.embla()?.scrollNext();\n }\n\n /**\n * Navigates to the previous slide and stops autoplay.\n */\n protected onPreviousSlideClick(): void {\n this.stopAutoplay();\n this.embla()?.scrollPrev();\n }\n\n /**\n * Handles user interaction with a teaser button: activates the matching slide.\n */\n protected onTeaserClick(index: number): void {\n this.stopAutoplay();\n this.embla()?.scrollTo(index);\n }\n\n /**\n * Handles a dot activation from the mobile slider pager: scrolls to the\n * matching slide and stops autoplay (same behavior as a teaser click).\n */\n protected onDotClick(index: number): void {\n this.stopAutoplay();\n this.embla()?.scrollTo(index);\n }\n\n /**\n * Handles keyboard navigation (ArrowLeft/ArrowRight) across teaser buttons.\n */\n protected onTeaserKeyboardPress(event: KeyboardEvent, index: number): void {\n if (event.key !== KeyCode.ARROW_RIGHT && event.key !== KeyCode.ARROW_LEFT) {\n return;\n }\n event.preventDefault();\n const direction = event.key === KeyCode.ARROW_RIGHT ? 1 : -1;\n const count = this.getSlidesCount();\n const nextIndex = (index + direction + count) % count;\n this.stopAutoplay();\n this.embla()?.scrollTo(nextIndex);\n this.focusOnButton(this.teaserButtons()[nextIndex]);\n }\n\n /**\n * Freezes the loading bar while the pointer/focus is over the carousel.\n * The Embla autoplay plugin pauses the timer itself (stopOnMouseEnter /\n * stopOnFocusIn); this only mirrors that as a visible paused state.\n */\n protected onViewportPause(): void {\n if (this.isPlaying() && !this.isPausedForced()) {\n this.isHoverPaused.set(true);\n this.cd.detectChanges();\n }\n }\n\n /**\n * Resumes the loading bar once the pointer/focus leaves the carousel.\n */\n protected onViewportResume(): void {\n if (this.isHoverPaused()) {\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n }\n }\n\n /**\n * Sets focus on the specified button.\n */\n private focusOnButton(button: ElementRef): void {\n if (!button) {\n return;\n }\n button.nativeElement.focus();\n }\n\n /**\n * Focuses the slider pager button matching the given ECL class selector\n * (e.g. `.ecl-carousel__play`). Used after a play/pause toggle so focus\n * follows the now-visible control, since the pager swaps play/pause\n * visibility via CSS. No-op if the button is not rendered (e.g. mobile).\n */\n private focusPagerButton(selector: string): void {\n const button = this.hostEl.nativeElement.querySelector<HTMLElement>(selector);\n button?.focus();\n }\n\n /**\n * Returns the Embla autoplay plugin instance, but only when the carousel\n * actually has more than one scroll snap.\n *\n * The `embla-carousel-autoplay` plugin skips its own initialization when\n * `scrollSnapList().length <= 1` (see the plugin's `init`), which leaves its\n * internal `delay` lookup table undefined. Calling `play()` in that state\n * throws (`delay[selectedScrollSnap()]` -> reading `0` of undefined). This\n * happens whenever Embla cannot lay out multiple snaps — notably in a jsdom\n * test or during SSR. Gating on the same `> 1` condition the plugin uses\n * keeps autoplay a safe no-op until the carousel is genuinely slideable.\n */\n private getAutoplay() {\n const api = this.embla()?.emblaApi;\n if (!api || api.scrollSnapList().length <= 1) {\n return undefined;\n }\n return api.plugins()?.autoplay;\n }\n\n /**\n * Whether autoplay should run. On by default (matching ECL); only disabled\n * when the consumer explicitly sets `[isAutoplay]=\"false\"`.\n */\n private isAutoplayDesired(): boolean {\n const isAutoplay = this.isAutoplay();\n return isAutoplay || isAutoplay === undefined;\n }\n\n /**\n * Stops autoplay and resets it (mirrors ECL's `handleAutoPlay(true)`),\n * clearing the loading-bar state.\n */\n private stopAutoplay(): void {\n const autoplay = this.getAutoplay();\n autoplay?.stop();\n autoplay?.reset();\n this.isPlaying.set(false);\n this.isPausedForced.set(false);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n }\n\n /**\n * Synchronizes component state from Embla's current selected snap:\n * active index, slide `isCurrent` flags, teaser window and the slide event.\n */\n private syncFromEmbla(): void {\n const api = this.embla()?.emblaApi;\n if (!api) {\n return;\n }\n const selected = api.selectedScrollSnap();\n this.setActiveIndex(selected);\n this.updateTeaserWindow();\n this.slide.emit(new EclSlideEvent(this.slides().at(this.activeIndex)));\n this.cd.detectChanges();\n }\n\n /**\n * Subscribes to RTL layout state changes to adapt carousel direction.\n */\n private handleRtlChangeState(): void {\n this.eclRtlService.currentRtlState$.pipe(takeUntil(this.destroy$)).subscribe((rtlState) => {\n const changed = this.isRtl !== rtlState;\n this.isRtl = rtlState;\n if (changed) {\n this.emblaOptions = {\n ...this.emblaOptions,\n direction: this.isRtl ? 'rtl' : 'ltr',\n };\n this.cd.detectChanges();\n }\n });\n }\n\n /**\n * Initializes slides (index, ARIA label, banner height management).\n */\n private initSlides(): void {\n const slides = this.slides();\n slides.forEach((item, idx) => {\n item.index.set(idx);\n item.ariaLabel.set(`slide ${idx + 1} of ${slides.length}`);\n item.isCurrent.set(idx === 0);\n const banner = item.banner();\n if (banner) {\n banner.skipHeightManagement = true;\n }\n });\n this.cd.detectChanges();\n }\n\n /**\n * Updates the active index and synchronizes slide active/inert state.\n */\n private setActiveIndex(index: number): void {\n this.activeIndex = index;\n this.slides().forEach((item, idx) => {\n item.isCurrent.set(idx === index);\n });\n }\n\n /**\n * Restarts the CSS progress animation on the active slide's loading bar.\n * The animation uses `forwards`, so re-applying the `is-active` class alone\n * will not replay it; the animation must be reset explicitly.\n */\n private restartActiveLoadingBar(): void {\n if (!this.getAutoplay()?.isPlaying()) {\n return;\n }\n const bar = this.loadingBars()[this.activeIndex]?.nativeElement as HTMLElement | undefined;\n if (!bar) {\n return;\n }\n bar.style.animation = 'none';\n // Force reflow so the browser registers the reset before re-enabling.\n void bar.offsetWidth;\n bar.style.animation = '';\n }\n\n /**\n * Advances the visible teaser window when the active slide moves out of it.\n */\n private updateTeaserWindow(): void {\n const count = this.getSlidesCount();\n if (count <= VISIBLE_TEASERS) {\n this.teaserWindowStart = 0;\n return;\n }\n const firstHiddenIndex = (this.teaserWindowStart + VISIBLE_TEASERS) % count;\n if (this.activeIndex === firstHiddenIndex) {\n this.teaserWindowStart = firstHiddenIndex;\n }\n }\n\n /**\n * Returns the number of actual visible slides.\n */\n private getSlidesCount(): number {\n return this.slides()?.length ?? 0;\n }\n\n /**\n * Observes screen breakpoint changes to adjust autoplay and layout behavior.\n */\n private observeBreakpointChanges(): void {\n this.cdkBreakpointObserver\n .observe([\n '(max-width: 768px)',\n '(min-width: 998px)',\n '(min-width: 1140px)',\n '(min-width: 1140px) and (max-width: 1260px)',\n ])\n .pipe(takeUntil(this.destroy$))\n .subscribe((result) => {\n this.isMobileBreakpoint.set(result.breakpoints['(max-width: 768px)']);\n this.isTabletBreakpoint = result.breakpoints['(min-width: 998px)'];\n this.isLargeBreakpoint = result.breakpoints['(min-width: 1140px)'];\n this.isDesktopBreakpointActive.set(result.breakpoints['(min-width: 1140px)']);\n this.isDesktopBreakpoint = result.breakpoints['(min-width: 1140px) and (max-width: 1260px)'];\n\n // Deactivate autoplay on mobile; (re)activate it on larger\n // screens if autoplay is desired. Focus is never moved here so\n // the page is not scrolled to the carousel on load/resize.\n if (this.isMobileBreakpoint()) {\n this.stopAutoplay();\n return;\n }\n\n if (this.isTabletBreakpoint && this.isAutoplayDesired() && !this.isPausedForced()) {\n this.onPlayClick(false);\n }\n });\n }\n\n /**\n * Observes changes to the carousel's viewport element size using a timeout debounce.\n */\n private observeElementSizeChanges(): void {\n setTimeout(() => {\n if (this.isLargeBreakpoint) {\n this.checkBannerHeights();\n } else {\n this.resetHeight();\n }\n this.embla()?.reInit();\n }, this.TIMEOUT_INTERVAL);\n }\n\n /**\n * Normalizes the height of all banners to match the tallest banner.\n */\n private checkBannerHeights(): void {\n this.slides().forEach((slide) => {\n const banner = slide.banner();\n if (banner) {\n banner.calculateHeight();\n }\n });\n\n const heightValues = this.slides().map((slide) => {\n const el = slide.banner()?.el.nativeElement;\n if (!el) return undefined;\n\n const styleHeight = el.style.height;\n\n if (styleHeight === 'auto' || styleHeight === '') {\n return el.offsetHeight;\n }\n\n const height = parseInt(styleHeight, 10);\n if (Number.isNaN(height) || height === 100) {\n return 1;\n }\n\n return height;\n });\n\n const elementHeights = heightValues.filter((h) => h !== undefined) as number[];\n const tallestElementHeight = Math.max(...elementHeights);\n\n const slides = this.slides();\n if (tallestElementHeight > 1 && elementHeights.length === slides.length) {\n slides.forEach((slide) => {\n const banner = slide.banner();\n if (!banner) return;\n\n const el = banner.el.nativeElement;\n const bannerImage = banner.eclBannerImage();\n const bannerVideo = banner.eclBannerVideo();\n\n this.renderer2.setStyle(el, 'height', `${tallestElementHeight}px`);\n this.renderer2.setStyle(el, 'aspect-ratio', 'auto');\n\n if (bannerImage) {\n this.renderer2.setStyle(bannerImage.el.nativeElement, 'aspect-ratio', 'auto');\n }\n if (bannerVideo) {\n this.renderer2.setStyle(bannerVideo.el.nativeElement, 'aspect-ratio', 'auto');\n }\n });\n }\n }\n\n /**\n * Clears all explicit banner height and aspect ratio styling for smaller breakpoints.\n */\n private resetHeight(): void {\n this.slides().forEach((slide) => {\n const banner = slide.banner();\n if (banner) {\n const bannerImage = banner.eclBannerImage();\n const bannerVideo = banner.eclBannerVideo();\n this.renderer2.removeStyle(banner.el.nativeElement, 'height');\n this.renderer2.removeStyle(banner.el.nativeElement, 'aspect-ratio');\n if (bannerImage) {\n this.renderer2.removeStyle(bannerImage.el.nativeElement, 'aspect-ratio');\n }\n if (bannerVideo) {\n this.renderer2.removeStyle(bannerVideo.el.nativeElement, 'aspect-ratio');\n }\n }\n });\n }\n}\n",
|
|
54618
|
+
"sourceCode": "import { BreakpointObserver } from '@angular/cdk/layout';\nimport {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n DOCUMENT,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChildren,\n forwardRef,\n inject,\n input,\n numberAttribute,\n output,\n signal,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { EUI_ECL_SLIDER } from '@eui/ecl/components/ecl-slider';\nimport { ECLBaseDirective, EclRtlService, KeyCode } from '@eui/ecl/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport {\n EmblaEventType,\n EmblaOptionsType,\n EmblaPluginType,\n} from 'embla-carousel';\nimport { EmblaCarouselDirective } from 'embla-carousel-angular';\nimport Autoplay from 'embla-carousel-autoplay';\nimport { Subject, auditTime, fromEvent, takeUntil } from 'rxjs';\nimport { EclCarouselItemComponent } from './ecl-carousel-item.component';\nimport { EclSlideEvent } from './events/ecl-slide.event';\n\n/**\n * Number of teaser buttons visible at once on the desktop breakpoint.\n */\nconst VISIBLE_TEASERS = 4;\n\n/**\n * Carousel (slideshow) component following the ECL design system.\n * Renders a sequence of `EclCarouselItemComponent` slides with autoplay, keyboard navigation,\n * responsive breakpoint awareness, and RTL layout support.\n *\n * The slide engine is powered by Embla (via `embla-carousel-angular`), matching the upstream\n * ECL implementation: an infinite `loop`, the `Autoplay` plugin driving the teaser loading bars,\n * and a slider pager with previous/next/play/pause controls, a counter, and a tablist of teaser\n * buttons (one per slide).\n *\n * - Selector: `ecl-carousel`.\n * - Project `ecl-carousel-item` elements as slides (also via `contentChildren`).\n * - `ariaLabel` — ARIA label for the carousel landmark; aliased as `aria-label`.\n * - `isAutoplay` — enables automatic slide advancement; boolean attribute.\n * - `playInterval` — milliseconds between automatic transitions; default `5000`.\n * - `slide` — emits `EclSlideEvent` when the active slide changes.\n */\n@Component({\n selector: 'ecl-carousel',\n templateUrl: './ecl-carousel.component.html',\n imports: [\n TranslatePipe,\n EmblaCarouselDirective,\n ...EUI_ECL_SLIDER,\n ],\n host: {\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-roledescription]': '\"carousel\"',\n '[class]': 'cssClasses()',\n // Drives the teaser loading-bar animation duration (see @eui/styles).\n // It has no CSS fallback, so without it the progress animation never\n // runs; it must match the autoplay delay.\n '[style.--ecl-carousel-slide-duration]': 'playInterval() + \"ms\"',\n },\n})\nexport class EclCarouselComponent extends ECLBaseDirective implements OnInit, OnDestroy, AfterContentInit {\n /**\n * Aria-label for screen readers to describe the carousel.\n */\n readonly ariaLabel = input<string | null>('Carousel description here', { alias: 'aria-label' });\n\n /**\n * Determines whether the carousel should autoplay.\n */\n readonly isAutoplay = input<boolean, unknown>(undefined, { transform: booleanAttribute });\n\n /**\n * Interval in milliseconds between automatic slide transitions.\n */\n readonly playInterval = input(5000, { transform: numberAttribute });\n\n /**\n * Event emitted when a slide change occurs.\n */\n readonly slide = output<EclSlideEvent>();\n\n /**\n * Reference to the main carousel viewport element (the Embla root).\n */\n readonly carouselContainerElement = viewChild<ElementRef>('carouselContainer');\n\n /**\n * Collection of slide components rendered inside the carousel.\n */\n readonly slides = contentChildren(forwardRef(() => EclCarouselItemComponent));\n\n /**\n * Indicates whether autoplay is currently active.\n */\n readonly isPlaying = signal(false);\n\n /**\n * Indicates whether autoplay was manually paused (via the pause button or\n * on mobile). When paused this way the loading bar is cleared.\n */\n readonly isPausedForced = signal(false);\n\n /**\n * Indicates whether the layout is currently in RTL mode.\n */\n isRtl = false;\n\n /**\n * Zero-based index of the currently active slide (mirrors Embla's selected snap).\n */\n private activeIndex = 0;\n\n /**\n * Start index of the currently visible teaser window (desktop only).\n */\n private teaserWindowStart = 0;\n\n /**\n * Indicates whether autoplay is temporarily paused by hover/focus. Unlike a\n * manual pause, the loading bar stays visible and frozen at its current\n * progress (matching ECL), resuming when the pointer/focus leaves.\n */\n protected readonly isHoverPaused = signal(false);\n\n /**\n * Whether the current viewport is at the mobile breakpoint. A signal so the\n * template can react (the pager drops play/pause on mobile, matching ECL,\n * where play/pause is a desktop-only control).\n */\n protected readonly isMobileBreakpoint = signal(false);\n\n /**\n * Whether the viewport is at or above the ECL desktop breakpoint (1140px).\n * This is the boundary the ECL CSS uses to show the play/pause controls and\n * the teaser tablist (and to hide the mobile dots). A signal so the pager\n * variant can react: play/pause only renders at/above this width, matching\n * the CSS so the pause button never leaks onto narrower viewports.\n */\n protected readonly isDesktopBreakpointActive = signal(false);\n\n /**\n * Embla options, mirroring the upstream ECL configuration.\n */\n protected emblaOptions: EmblaOptionsType = {\n loop: true,\n align: 'start',\n duration: 20,\n };\n\n /**\n * Embla plugins. Built once so the Embla directive does not needlessly re-init.\n */\n protected emblaPlugins: EmblaPluginType[] = [];\n\n /**\n * Embla events the component reacts to.\n */\n protected readonly emblaEvents: EmblaEventType[] = [\n 'select',\n 'reInit',\n 'autoplay:timerset',\n ];\n\n /**\n * Reference to the Embla directive driving the slide engine.\n */\n private readonly embla = viewChild<EmblaCarouselDirective>('embla');\n\n /**\n * References to the teaser navigation buttons corresponding to each slide.\n */\n private readonly teaserButtons = viewChildren<ElementRef>('teaserButton');\n\n /**\n * References to the teaser loading-bar completion elements (one per slide),\n * used to restart the progress animation when the active slide changes.\n */\n private readonly loadingBars = viewChildren<ElementRef>('loadingBar');\n\n private isLargeBreakpoint = false;\n private isDesktopBreakpoint = false;\n\n private destroy$: Subject<boolean> = new Subject<boolean>();\n\n /**\n * Debounce interval (ms) used internally for timing and transitions.\n */\n private readonly TIMEOUT_INTERVAL = 400;\n private readonly cdkBreakpointObserver = inject(BreakpointObserver);\n private readonly cd = inject(ChangeDetectorRef);\n private readonly renderer2 = inject(Renderer2);\n private readonly eclRtlService = inject(EclRtlService);\n private readonly translate = inject(TranslateService);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly window = this.document.defaultView;\n /**\n * Host element, used to locate the slider pager's play/pause buttons by their\n * ECL classes for focus management after a play/pause toggle.\n */\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Returns the computed CSS class list for the component.\n */\n protected readonly cssClasses = computed<string>(() =>\n super.getCssClasses('ecl-carousel'));\n\n constructor() {\n super();\n afterNextRender(() => {\n this.observeElementSizeChanges();\n this.observeBreakpointChanges();\n this.syncFromEmbla();\n\n if (this.window) {\n fromEvent(this.window, 'resize')\n .pipe(auditTime(50), takeUntil(this.destroy$))\n .subscribe(() => this.observeElementSizeChanges());\n }\n });\n }\n\n /**\n * Angular lifecycle hook: initializes RTL detection and the Embla plugins.\n */\n ngOnInit(): void {\n this.emblaOptions = {\n ...this.emblaOptions,\n direction: this.isRtl ? 'rtl' : 'ltr',\n };\n // Autoplay is a desktop-only affordance (matching upstream ECL): it\n // must never run below the desktop breakpoint (xl, 1140px). The plugin\n // therefore does NOT self-start (`playOnInit: false`);\n // `observeBreakpointChanges` starts it only at/above the desktop\n // breakpoint and stops it on every smaller viewport (mobile and\n // tablet). `isPlaying` starts `false` so the loading bar is not shown\n // until autoplay actually begins.\n this.isPlaying.set(false);\n this.emblaPlugins = [\n Autoplay({\n delay: this.playInterval(),\n playOnInit: false,\n stopOnInteraction: false,\n stopOnMouseEnter: true,\n stopOnFocusIn: true,\n }),\n ];\n this.handleRtlChangeState();\n }\n\n /**\n * Angular lifecycle hook: called after content (slides) is initialized.\n */\n ngAfterContentInit(): void {\n setTimeout(() => {\n this.initSlides();\n });\n }\n\n /**\n * Angular lifecycle hook: cleans up subscriptions.\n */\n ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.unsubscribe();\n }\n\n /**\n * Returns whether the carousel has padding applied (e.g., on desktop breakpoint).\n */\n isPadded(): boolean {\n return this.isDesktopBreakpoint;\n }\n\n /**\n * Checks whether there are enough slides to render controls.\n */\n hasControls(): boolean {\n return this.getSlidesCount() > 1;\n }\n\n /**\n * Retrieves the current active slide index (zero-based).\n */\n getCurrentSlideIndex(): number {\n return this.activeIndex;\n }\n\n /**\n * Returns the 1-based position of the active slide (for the counter).\n */\n getCounterCurrent(): number {\n return this.activeIndex + 1;\n }\n\n /**\n * Returns the total number of slides (for the counter).\n */\n getCounterTotal(): number {\n return this.getSlidesCount();\n }\n\n /**\n * Dot indices for the mobile slider pager (one dot per slide). The dots are\n * hidden on desktop via the ECL CSS (`.ecl-carousel__dots { display: none }`)\n * and shown at the mobile breakpoint.\n */\n getDotIndices(): number[] {\n return Array.from({ length: this.getSlidesCount() }, (_unused, dotIndex) => dotIndex);\n }\n\n /**\n * Pre-translated accessible label for each pager dot. Translated here since\n * the shared `ecl-slider-pager` receives plain strings.\n */\n getDotAriaLabels(): string[] {\n const total = this.getSlidesCount();\n return Array.from({ length: total }, (_unused, dotIndex) =>\n this.translate.instant('ecl.carousel.GO-TO-SLIDE', {\n current: dotIndex + 1,\n total,\n }),\n );\n }\n\n /**\n * Returns whether a teaser button should be visible in the current window.\n */\n isTeaserVisible(index: number): boolean {\n const count = this.getSlidesCount();\n if (count <= VISIBLE_TEASERS) {\n return true;\n }\n const position = ((index - this.teaserWindowStart) % count + count) % count;\n return position < VISIBLE_TEASERS;\n }\n\n /**\n * Returns the flex order of a teaser button within the visible window.\n */\n getTeaserOrder(index: number): number {\n const count = this.getSlidesCount();\n return ((index - this.teaserWindowStart) % count + count) % count;\n }\n\n /**\n * Whether the pager should show the \"pause\" control (i.e. autoplay is\n * actively running). While the pointer/focus hover-pauses the carousel the\n * timer is suspended, so the pager must show \"play\" even though a manual\n * pause was not triggered. Mirrors upstream ECL, where hovering flips the\n * control to play.\n */\n protected isPagerPlaying(): boolean {\n return this.isPlaying() && !this.isHoverPaused();\n }\n\n /**\n * Pager variant by breakpoint. Below the ECL desktop breakpoint (1140px)\n * the carousel shows only the dots navigation (prev / dots / next);\n * play/pause is a desktop-only control in ECL. Rendering `'dots'` there\n * avoids the pager's inline play/pause `display` style (which would\n * otherwise beat the ECL CSS and leave the pause button visible on narrower\n * viewports). At/above 1140px the dots are hidden by CSS, so\n * `'play-pause-dots'` yields play/pause + prev/next + teasers.\n *\n * The 1140px boundary mirrors the media query the ECL CSS uses to toggle\n * `.ecl-carousel__play/__pause` and `.ecl-carousel__teasers`.\n */\n protected pagerVariant(): 'dots' | 'play-pause-dots' {\n return this.isDesktopBreakpointActive() ? 'play-pause-dots' : 'dots';\n }\n\n /**\n * Handles the throttled Embla events the component subscribed to.\n */\n protected onEmblaEvent(event: EmblaEventType): void {\n switch (event) {\n case 'select':\n case 'reInit':\n this.syncFromEmbla();\n break;\n case 'autoplay:timerset':\n // Fired each time the autoplay timer (re)starts for the current\n // slide; replay the loading-bar fill animation from zero.\n this.restartActiveLoadingBar();\n break;\n default:\n break;\n }\n }\n\n /**\n * Starts autoplay.\n *\n * @param moveFocus when true (a user clicked play) focus moves to the pause\n * button. Auto-starts (e.g. on breakpoint changes) pass false so the\n * page is not scrolled to the carousel on load.\n */\n protected onPlayClick(moveFocus = true): void {\n this.getAutoplay()?.play();\n this.isPlaying.set(true);\n this.isPausedForced.set(false);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n if (moveFocus) {\n this.focusPagerButton('.ecl-carousel__pause');\n }\n }\n\n /**\n * Stops autoplay and focuses the play button.\n */\n protected onPauseClick(): void {\n // Pause (not full stop): halt the autoplay timer but keep the active\n // teaser loading bar visible, frozen at its current progress (matching\n // upstream ECL's `handleAutoPlay(false, true)`). The installed\n // embla-carousel-autoplay exposes no `pause()`, so we call `stop()`\n // WITHOUT `reset()` — the frozen bar is driven by our `is-paused` CSS\n // class, not the plugin. A full stop+reset (which clears the bar) only\n // happens on prev/next/teaser navigation via `stopAutoplay()`.\n this.getAutoplay()?.stop();\n this.isPlaying.set(false);\n this.isPausedForced.set(true);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n this.focusPagerButton('.ecl-carousel__play');\n }\n\n /**\n * Navigates to the next slide and stops autoplay.\n */\n protected onNextSlideClick(): void {\n this.stopAutoplay();\n this.embla()?.scrollNext();\n }\n\n /**\n * Navigates to the previous slide and stops autoplay.\n */\n protected onPreviousSlideClick(): void {\n this.stopAutoplay();\n this.embla()?.scrollPrev();\n }\n\n /**\n * Handles user interaction with a teaser button: activates the matching slide.\n */\n protected onTeaserClick(index: number): void {\n this.stopAutoplay();\n this.embla()?.scrollTo(index);\n }\n\n /**\n * Handles a dot activation from the mobile slider pager: scrolls to the\n * matching slide and stops autoplay (same behavior as a teaser click).\n */\n protected onDotClick(index: number): void {\n this.stopAutoplay();\n this.embla()?.scrollTo(index);\n }\n\n /**\n * Handles keyboard navigation (ArrowLeft/ArrowRight) across teaser buttons.\n */\n protected onTeaserKeyboardPress(event: KeyboardEvent, index: number): void {\n if (event.key !== KeyCode.ARROW_RIGHT && event.key !== KeyCode.ARROW_LEFT) {\n return;\n }\n event.preventDefault();\n const direction = event.key === KeyCode.ARROW_RIGHT ? 1 : -1;\n const count = this.getSlidesCount();\n const nextIndex = (index + direction + count) % count;\n this.stopAutoplay();\n this.embla()?.scrollTo(nextIndex);\n this.focusOnButton(this.teaserButtons()[nextIndex]);\n }\n\n /**\n * Freezes the loading bar while the pointer/focus is over the carousel.\n * The Embla autoplay plugin pauses the timer itself (stopOnMouseEnter /\n * stopOnFocusIn); this only mirrors that as a visible paused state.\n */\n protected onViewportPause(): void {\n if (this.isPlaying() && !this.isPausedForced()) {\n this.isHoverPaused.set(true);\n this.cd.detectChanges();\n }\n }\n\n /**\n * Resumes the loading bar once the pointer/focus leaves the carousel.\n */\n protected onViewportResume(): void {\n if (this.isHoverPaused()) {\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n }\n }\n\n /**\n * Sets focus on the specified button.\n */\n private focusOnButton(button: ElementRef): void {\n if (!button) {\n return;\n }\n button.nativeElement.focus();\n }\n\n /**\n * Focuses the slider pager button matching the given ECL class selector\n * (e.g. `.ecl-carousel__play`). Used after a play/pause toggle so focus\n * follows the now-visible control, since the pager swaps play/pause\n * visibility via CSS. No-op if the button is not rendered (e.g. mobile).\n */\n private focusPagerButton(selector: string): void {\n const button = this.hostEl.nativeElement.querySelector<HTMLElement>(selector);\n button?.focus();\n }\n\n /**\n * Returns the Embla autoplay plugin instance, but only when the carousel\n * actually has more than one scroll snap.\n *\n * The `embla-carousel-autoplay` plugin skips its own initialization when\n * `scrollSnapList().length <= 1` (see the plugin's `init`), which leaves its\n * internal `delay` lookup table undefined. Calling `play()` in that state\n * throws (`delay[selectedScrollSnap()]` -> reading `0` of undefined). This\n * happens whenever Embla cannot lay out multiple snaps — notably in a jsdom\n * test or during SSR. Gating on the same `> 1` condition the plugin uses\n * keeps autoplay a safe no-op until the carousel is genuinely slideable.\n */\n private getAutoplay() {\n const api = this.embla()?.emblaApi;\n if (!api || api.scrollSnapList().length <= 1) {\n return undefined;\n }\n return api.plugins()?.autoplay;\n }\n\n /**\n * Whether autoplay should run. On by default (matching ECL); only disabled\n * when the consumer explicitly sets `[isAutoplay]=\"false\"`.\n */\n private isAutoplayDesired(): boolean {\n const isAutoplay = this.isAutoplay();\n return isAutoplay || isAutoplay === undefined;\n }\n\n /**\n * Stops autoplay and resets it (mirrors ECL's `handleAutoPlay(true)`),\n * clearing the loading-bar state.\n */\n private stopAutoplay(): void {\n const autoplay = this.getAutoplay();\n autoplay?.stop();\n autoplay?.reset();\n this.isPlaying.set(false);\n this.isPausedForced.set(false);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n }\n\n /**\n * Synchronizes component state from Embla's current selected snap:\n * active index, slide `isCurrent` flags, teaser window and the slide event.\n */\n private syncFromEmbla(): void {\n const api = this.embla()?.emblaApi;\n if (!api) {\n return;\n }\n const selected = api.selectedScrollSnap();\n this.setActiveIndex(selected);\n this.updateTeaserWindow();\n this.slide.emit(new EclSlideEvent(this.slides().at(this.activeIndex)));\n this.cd.detectChanges();\n }\n\n /**\n * Subscribes to RTL layout state changes to adapt carousel direction.\n */\n private handleRtlChangeState(): void {\n this.eclRtlService.currentRtlState$.pipe(takeUntil(this.destroy$)).subscribe((rtlState) => {\n const changed = this.isRtl !== rtlState;\n this.isRtl = rtlState;\n if (changed) {\n this.emblaOptions = {\n ...this.emblaOptions,\n direction: this.isRtl ? 'rtl' : 'ltr',\n };\n this.cd.detectChanges();\n }\n });\n }\n\n /**\n * Initializes slides (index, ARIA label, banner height management).\n */\n private initSlides(): void {\n const slides = this.slides();\n slides.forEach((item, idx) => {\n item.index.set(idx);\n item.ariaLabel.set(`slide ${idx + 1} of ${slides.length}`);\n item.isCurrent.set(idx === 0);\n const banner = item.banner();\n if (banner) {\n banner.skipHeightManagement = true;\n }\n });\n this.cd.detectChanges();\n }\n\n /**\n * Updates the active index and synchronizes slide active/inert state.\n */\n private setActiveIndex(index: number): void {\n this.activeIndex = index;\n this.slides().forEach((item, idx) => {\n item.isCurrent.set(idx === index);\n });\n }\n\n /**\n * Restarts the CSS progress animation on the active slide's loading bar.\n * The animation uses `forwards`, so re-applying the `is-active` class alone\n * will not replay it; the animation must be reset explicitly.\n */\n private restartActiveLoadingBar(): void {\n if (!this.getAutoplay()?.isPlaying()) {\n return;\n }\n const bar = this.loadingBars()[this.activeIndex]?.nativeElement as HTMLElement | undefined;\n if (!bar) {\n return;\n }\n bar.style.animation = 'none';\n // Force reflow so the browser registers the reset before re-enabling.\n void bar.offsetWidth;\n bar.style.animation = '';\n }\n\n /**\n * Advances the visible teaser window when the active slide moves out of it.\n */\n private updateTeaserWindow(): void {\n const count = this.getSlidesCount();\n if (count <= VISIBLE_TEASERS) {\n this.teaserWindowStart = 0;\n return;\n }\n const firstHiddenIndex = (this.teaserWindowStart + VISIBLE_TEASERS) % count;\n if (this.activeIndex === firstHiddenIndex) {\n this.teaserWindowStart = firstHiddenIndex;\n }\n }\n\n /**\n * Returns the number of actual visible slides.\n */\n private getSlidesCount(): number {\n return this.slides()?.length ?? 0;\n }\n\n /**\n * Observes screen breakpoint changes to adjust autoplay and layout behavior.\n */\n private observeBreakpointChanges(): void {\n this.cdkBreakpointObserver\n .observe([\n '(max-width: 768px)',\n '(min-width: 1140px)',\n '(min-width: 1140px) and (max-width: 1260px)',\n ])\n .pipe(takeUntil(this.destroy$))\n .subscribe((result) => {\n this.isMobileBreakpoint.set(result.breakpoints['(max-width: 768px)']);\n this.isLargeBreakpoint = result.breakpoints['(min-width: 1140px)'];\n this.isDesktopBreakpointActive.set(result.breakpoints['(min-width: 1140px)']);\n this.isDesktopBreakpoint = result.breakpoints['(min-width: 1140px) and (max-width: 1260px)'];\n\n // Autoplay is desktop-only (matching upstream ECL): it runs only\n // at/above the desktop breakpoint (xl, 1140px) and is stopped on\n // every smaller viewport, including tablet. Focus is never moved\n // here so the page is not scrolled to the carousel on\n // load/resize.\n if (!this.isLargeBreakpoint) {\n this.stopAutoplay();\n return;\n }\n\n if (this.isAutoplayDesired() && !this.isPausedForced()) {\n this.onPlayClick(false);\n }\n });\n }\n\n /**\n * Observes changes to the carousel's viewport element size using a timeout debounce.\n */\n private observeElementSizeChanges(): void {\n setTimeout(() => {\n if (this.isLargeBreakpoint) {\n this.checkBannerHeights();\n } else {\n this.resetHeight();\n }\n this.embla()?.reInit();\n }, this.TIMEOUT_INTERVAL);\n }\n\n /**\n * Normalizes the height of all banners to match the tallest banner.\n */\n private checkBannerHeights(): void {\n this.slides().forEach((slide) => {\n const banner = slide.banner();\n if (banner) {\n banner.calculateHeight();\n }\n });\n\n const heightValues = this.slides().map((slide) => {\n const el = slide.banner()?.el.nativeElement;\n if (!el) return undefined;\n\n const styleHeight = el.style.height;\n\n if (styleHeight === 'auto' || styleHeight === '') {\n return el.offsetHeight;\n }\n\n const height = parseInt(styleHeight, 10);\n if (Number.isNaN(height) || height === 100) {\n return 1;\n }\n\n return height;\n });\n\n const elementHeights = heightValues.filter((h) => h !== undefined) as number[];\n const tallestElementHeight = Math.max(...elementHeights);\n\n const slides = this.slides();\n if (tallestElementHeight > 1 && elementHeights.length === slides.length) {\n slides.forEach((slide) => {\n const banner = slide.banner();\n if (!banner) return;\n\n const el = banner.el.nativeElement;\n const bannerImage = banner.eclBannerImage();\n const bannerVideo = banner.eclBannerVideo();\n\n this.renderer2.setStyle(el, 'height', `${tallestElementHeight}px`);\n this.renderer2.setStyle(el, 'aspect-ratio', 'auto');\n\n if (bannerImage) {\n this.renderer2.setStyle(bannerImage.el.nativeElement, 'aspect-ratio', 'auto');\n }\n if (bannerVideo) {\n this.renderer2.setStyle(bannerVideo.el.nativeElement, 'aspect-ratio', 'auto');\n }\n });\n }\n }\n\n /**\n * Clears all explicit banner height and aspect ratio styling for smaller breakpoints.\n */\n private resetHeight(): void {\n this.slides().forEach((slide) => {\n const banner = slide.banner();\n if (banner) {\n const bannerImage = banner.eclBannerImage();\n const bannerVideo = banner.eclBannerVideo();\n this.renderer2.removeStyle(banner.el.nativeElement, 'height');\n this.renderer2.removeStyle(banner.el.nativeElement, 'aspect-ratio');\n if (bannerImage) {\n this.renderer2.removeStyle(bannerImage.el.nativeElement, 'aspect-ratio');\n }\n if (bannerVideo) {\n this.renderer2.removeStyle(bannerVideo.el.nativeElement, 'aspect-ratio');\n }\n }\n });\n }\n}\n",
|
|
54619
54619
|
"assetsDirs": [],
|
|
54620
54620
|
"styleUrlsData": "",
|
|
54621
54621
|
"stylesData": "",
|
|
@@ -54637,7 +54637,7 @@
|
|
|
54637
54637
|
"deprecated": false,
|
|
54638
54638
|
"deprecationMessage": "",
|
|
54639
54639
|
"args": [],
|
|
54640
|
-
"line":
|
|
54640
|
+
"line": 223,
|
|
54641
54641
|
"rawdescription": "\n"
|
|
54642
54642
|
},
|
|
54643
54643
|
"extends": [
|
|
@@ -106915,7 +106915,7 @@
|
|
|
106915
106915
|
"name": "ARROW_SIZE",
|
|
106916
106916
|
"ctype": "miscellaneous",
|
|
106917
106917
|
"subtype": "variable",
|
|
106918
|
-
"file": "packages/ecl/components/ecl-site-header/
|
|
106918
|
+
"file": "packages/ecl/components/ecl-site-header/language/ecl-site-header-language.component.ts",
|
|
106919
106919
|
"coverageIgnore": false,
|
|
106920
106920
|
"deprecated": false,
|
|
106921
106921
|
"deprecationMessage": "",
|
|
@@ -106928,7 +106928,7 @@
|
|
|
106928
106928
|
"name": "ARROW_SIZE",
|
|
106929
106929
|
"ctype": "miscellaneous",
|
|
106930
106930
|
"subtype": "variable",
|
|
106931
|
-
"file": "packages/ecl/components/ecl-site-header/
|
|
106931
|
+
"file": "packages/ecl/components/ecl-site-header/login/ecl-site-header-login.component.ts",
|
|
106932
106932
|
"coverageIgnore": false,
|
|
106933
106933
|
"deprecated": false,
|
|
106934
106934
|
"deprecationMessage": "",
|
|
@@ -108396,6 +108396,21 @@
|
|
|
108396
108396
|
}
|
|
108397
108397
|
],
|
|
108398
108398
|
"groupedVariables": {
|
|
108399
|
+
"packages/ecl/components/ecl-site-header/language/ecl-site-header-language.component.ts": [
|
|
108400
|
+
{
|
|
108401
|
+
"name": "ARROW_SIZE",
|
|
108402
|
+
"ctype": "miscellaneous",
|
|
108403
|
+
"subtype": "variable",
|
|
108404
|
+
"file": "packages/ecl/components/ecl-site-header/language/ecl-site-header-language.component.ts",
|
|
108405
|
+
"coverageIgnore": false,
|
|
108406
|
+
"deprecated": false,
|
|
108407
|
+
"deprecationMessage": "",
|
|
108408
|
+
"type": "string",
|
|
108409
|
+
"defaultValue": "'0.5rem'",
|
|
108410
|
+
"rawdescription": "Half the arrow's own width, matching ECL's `arrowSize`.",
|
|
108411
|
+
"description": "<p>Half the arrow's own width, matching ECL's <code>arrowSize</code>.</p>\n"
|
|
108412
|
+
}
|
|
108413
|
+
],
|
|
108399
108414
|
"packages/ecl/components/ecl-site-header/login/ecl-site-header-login.component.ts": [
|
|
108400
108415
|
{
|
|
108401
108416
|
"name": "ARROW_SIZE",
|
|
@@ -108424,21 +108439,6 @@
|
|
|
108424
108439
|
"description": "<p>Debounce for the resize recomputation, matching ECL's <code>handleResize</code>.</p>\n"
|
|
108425
108440
|
}
|
|
108426
108441
|
],
|
|
108427
|
-
"packages/ecl/components/ecl-site-header/language/ecl-site-header-language.component.ts": [
|
|
108428
|
-
{
|
|
108429
|
-
"name": "ARROW_SIZE",
|
|
108430
|
-
"ctype": "miscellaneous",
|
|
108431
|
-
"subtype": "variable",
|
|
108432
|
-
"file": "packages/ecl/components/ecl-site-header/language/ecl-site-header-language.component.ts",
|
|
108433
|
-
"coverageIgnore": false,
|
|
108434
|
-
"deprecated": false,
|
|
108435
|
-
"deprecationMessage": "",
|
|
108436
|
-
"type": "string",
|
|
108437
|
-
"defaultValue": "'0.5rem'",
|
|
108438
|
-
"rawdescription": "Half the arrow's own width, matching ECL's `arrowSize`.",
|
|
108439
|
-
"description": "<p>Half the arrow's own width, matching ECL's <code>arrowSize</code>.</p>\n"
|
|
108440
|
-
}
|
|
108441
|
-
],
|
|
108442
108442
|
"packages/ecl/components/ecl-site-header/search/ecl-site-header-search.component.ts": [
|
|
108443
108443
|
{
|
|
108444
108444
|
"name": "ARROW_SIZE",
|
package/docs/llms.txt
CHANGED
package/docs/properties.html
CHANGED
|
@@ -182,7 +182,6 @@ var EclCarouselComponent = class EclCarouselComponent extends ECLBaseDirective {
|
|
|
182
182
|
this.embla = viewChild("embla", ...ngDevMode ? [{ debugName: "embla" }] : /* istanbul ignore next */ []);
|
|
183
183
|
this.teaserButtons = viewChildren("teaserButton", ...ngDevMode ? [{ debugName: "teaserButtons" }] : /* istanbul ignore next */ []);
|
|
184
184
|
this.loadingBars = viewChildren("loadingBar", ...ngDevMode ? [{ debugName: "loadingBars" }] : /* istanbul ignore next */ []);
|
|
185
|
-
this.isTabletBreakpoint = false;
|
|
186
185
|
this.isLargeBreakpoint = false;
|
|
187
186
|
this.isDesktopBreakpoint = false;
|
|
188
187
|
this.destroy$ = new Subject();
|
|
@@ -208,11 +207,10 @@ var EclCarouselComponent = class EclCarouselComponent extends ECLBaseDirective {
|
|
|
208
207
|
...this.emblaOptions,
|
|
209
208
|
direction: this.isRtl ? "rtl" : "ltr"
|
|
210
209
|
};
|
|
211
|
-
|
|
212
|
-
this.isPlaying.set(autoplayDesired);
|
|
210
|
+
this.isPlaying.set(false);
|
|
213
211
|
this.emblaPlugins = [Autoplay({
|
|
214
212
|
delay: this.playInterval(),
|
|
215
|
-
playOnInit:
|
|
213
|
+
playOnInit: false,
|
|
216
214
|
stopOnInteraction: false,
|
|
217
215
|
stopOnMouseEnter: true,
|
|
218
216
|
stopOnFocusIn: true
|
|
@@ -418,20 +416,18 @@ var EclCarouselComponent = class EclCarouselComponent extends ECLBaseDirective {
|
|
|
418
416
|
observeBreakpointChanges() {
|
|
419
417
|
this.cdkBreakpointObserver.observe([
|
|
420
418
|
"(max-width: 768px)",
|
|
421
|
-
"(min-width: 998px)",
|
|
422
419
|
"(min-width: 1140px)",
|
|
423
420
|
"(min-width: 1140px) and (max-width: 1260px)"
|
|
424
421
|
]).pipe(takeUntil(this.destroy$)).subscribe((result) => {
|
|
425
422
|
this.isMobileBreakpoint.set(result.breakpoints["(max-width: 768px)"]);
|
|
426
|
-
this.isTabletBreakpoint = result.breakpoints["(min-width: 998px)"];
|
|
427
423
|
this.isLargeBreakpoint = result.breakpoints["(min-width: 1140px)"];
|
|
428
424
|
this.isDesktopBreakpointActive.set(result.breakpoints["(min-width: 1140px)"]);
|
|
429
425
|
this.isDesktopBreakpoint = result.breakpoints["(min-width: 1140px) and (max-width: 1260px)"];
|
|
430
|
-
if (this.
|
|
426
|
+
if (!this.isLargeBreakpoint) {
|
|
431
427
|
this.stopAutoplay();
|
|
432
428
|
return;
|
|
433
429
|
}
|
|
434
|
-
if (this.
|
|
430
|
+
if (this.isAutoplayDesired() && !this.isPausedForced()) this.onPlayClick(false);
|
|
435
431
|
});
|
|
436
432
|
}
|
|
437
433
|
observeElementSizeChanges() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-ecl-components-ecl-carousel.mjs","names":[],"sources":["../../components/ecl-carousel/events/ecl-slide.event.ts","../../components/ecl-carousel/ecl-carousel-item.component.ts","../../components/ecl-carousel/ecl-carousel-item.component.html","../../components/ecl-carousel/ecl-carousel.component.ts","../../components/ecl-carousel/ecl-carousel.component.html","../../components/ecl-carousel/index.ts"],"sourcesContent":["import { EclBaseEvent } from '@eui/ecl/core';\nimport { EclCarouselItem } from '../models/ecl-carousel-item.model';\n\n/**\n * Event emitted by `EclCarouselComponent` when the active slide changes, and by\n * `EclCarouselItemComponent` when a slide is clicked.\n * Carries the `EclCarouselItem` that became active or was clicked.\n */\nexport class EclSlideEvent extends EclBaseEvent {\n /**\n * @param item The carousel item that was activated or clicked.\n */\n constructor(public item: EclCarouselItem) {\n super();\n }\n}","import {\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n contentChild,\n} from '@angular/core';\nimport { ECLBaseDirective } from '@eui/ecl/core';\nimport { EclBannerComponent } from '@eui/ecl/components/ecl-banner';\nimport { EclSlideEvent } from './events/ecl-slide.event';\nimport { EclCarouselItem } from './models/ecl-carousel-item.model';\n\n/**\n * Single slide item for use inside an `EclCarouselComponent`.\n * Renders a `role=\"tabpanel\"` element with an `aria-roledescription=\"slide\"` and handles\n * the `inert` attribute so only the active slide is interactive.\n *\n * - Selector: `ecl-carousel-item`.\n * - `isCurrent` (input alias) — initial active state; kept as a `linkedSignal` so the parent\n * carousel can update it imperatively as the user navigates.\n * - `slideClick` — emits `EclSlideEvent` when the slide is clicked.\n * - `index` / `ariaLabel` — writable signals assigned by the parent carousel.\n * - Project an optional `EclBannerComponent` inside the slide for banner-style slides.\n */\n@Component({\n selector: 'ecl-carousel-item',\n templateUrl: './ecl-carousel-item.component.html',\n host: {\n role: 'tabpanel',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-roledescription]': '\"slide\"',\n '[attr.inert]': '!isCurrent() || undefined',\n '[class]': 'cssClasses()',\n '(click)': 'onSlideClick()',\n },\n styles: [\n `\n /* TODO: remove by implementing full ECL specs */\n :host:before {\n left: 0 !important;\n display: none;\n }\n `,\n ],\n})\nexport class EclCarouselItemComponent extends ECLBaseDirective implements EclCarouselItem {\n el = inject(ElementRef);\n\n /**\n * The aria-label for the slide, assigned dynamically by the carousel.\n */\n readonly ariaLabel = signal<string | undefined>(undefined);\n\n /**\n * Input controlling whether this slide starts as the active/visible one.\n * Automatically coerced to a boolean value.\n */\n readonly isCurrentInput = input(false, { alias: 'isCurrent', transform: booleanAttribute });\n\n /**\n * Indicates whether this slide is currently active/visible.\n * Seeded from the `isCurrent` input but can be updated imperatively by the\n * parent carousel as the user navigates between slides.\n */\n readonly isCurrent = linkedSignal(() => this.isCurrentInput());\n\n /**\n * Text shown in the carousel teaser (navigation) button for this slide.\n * Optional; when empty, no teaser label is rendered for the slide.\n */\n readonly teaserText = input<string>('');\n\n /**\n * Emits an event when the slide is clicked.\n */\n readonly slideClick = output<EclSlideEvent>();\n\n /**\n * Optionally captures a banner component projected into the slide.\n */\n readonly banner = contentChild(forwardRef(() => EclBannerComponent));\n\n /**\n * Internal slide index, assigned dynamically by the carousel.\n */\n readonly index = signal<number | undefined>(undefined);\n\n /**\n * Computes the slide's CSS class.\n */\n protected readonly cssClasses = computed<string>(() =>\n super.getCssClasses('ecl-carousel__slide'));\n\n /**\n * Handles click events on the slide and emits a slideClick event.\n */\n onSlideClick(): void {\n this.slideClick.emit(new EclSlideEvent(this));\n }\n}\n","<ng-content></ng-content>\n","import { BreakpointObserver } from '@angular/cdk/layout';\nimport {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n DOCUMENT,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChildren,\n forwardRef,\n inject,\n input,\n numberAttribute,\n output,\n signal,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { EUI_ECL_SLIDER } from '@eui/ecl/components/ecl-slider';\nimport { ECLBaseDirective, EclRtlService, KeyCode } from '@eui/ecl/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport {\n EmblaEventType,\n EmblaOptionsType,\n EmblaPluginType,\n} from 'embla-carousel';\nimport { EmblaCarouselDirective } from 'embla-carousel-angular';\nimport Autoplay from 'embla-carousel-autoplay';\nimport { Subject, auditTime, fromEvent, takeUntil } from 'rxjs';\nimport { EclCarouselItemComponent } from './ecl-carousel-item.component';\nimport { EclSlideEvent } from './events/ecl-slide.event';\n\n/**\n * Number of teaser buttons visible at once on the desktop breakpoint.\n */\nconst VISIBLE_TEASERS = 4;\n\n/**\n * Carousel (slideshow) component following the ECL design system.\n * Renders a sequence of `EclCarouselItemComponent` slides with autoplay, keyboard navigation,\n * responsive breakpoint awareness, and RTL layout support.\n *\n * The slide engine is powered by Embla (via `embla-carousel-angular`), matching the upstream\n * ECL implementation: an infinite `loop`, the `Autoplay` plugin driving the teaser loading bars,\n * and a slider pager with previous/next/play/pause controls, a counter, and a tablist of teaser\n * buttons (one per slide).\n *\n * - Selector: `ecl-carousel`.\n * - Project `ecl-carousel-item` elements as slides (also via `contentChildren`).\n * - `ariaLabel` — ARIA label for the carousel landmark; aliased as `aria-label`.\n * - `isAutoplay` — enables automatic slide advancement; boolean attribute.\n * - `playInterval` — milliseconds between automatic transitions; default `5000`.\n * - `slide` — emits `EclSlideEvent` when the active slide changes.\n */\n@Component({\n selector: 'ecl-carousel',\n templateUrl: './ecl-carousel.component.html',\n imports: [\n TranslatePipe,\n EmblaCarouselDirective,\n ...EUI_ECL_SLIDER,\n ],\n host: {\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-roledescription]': '\"carousel\"',\n '[class]': 'cssClasses()',\n // Drives the teaser loading-bar animation duration (see @eui/styles).\n // It has no CSS fallback, so without it the progress animation never\n // runs; it must match the autoplay delay.\n '[style.--ecl-carousel-slide-duration]': 'playInterval() + \"ms\"',\n },\n})\nexport class EclCarouselComponent extends ECLBaseDirective implements OnInit, OnDestroy, AfterContentInit {\n /**\n * Aria-label for screen readers to describe the carousel.\n */\n readonly ariaLabel = input<string | null>('Carousel description here', { alias: 'aria-label' });\n\n /**\n * Determines whether the carousel should autoplay.\n */\n readonly isAutoplay = input<boolean, unknown>(undefined, { transform: booleanAttribute });\n\n /**\n * Interval in milliseconds between automatic slide transitions.\n */\n readonly playInterval = input(5000, { transform: numberAttribute });\n\n /**\n * Event emitted when a slide change occurs.\n */\n readonly slide = output<EclSlideEvent>();\n\n /**\n * Reference to the main carousel viewport element (the Embla root).\n */\n readonly carouselContainerElement = viewChild<ElementRef>('carouselContainer');\n\n /**\n * Collection of slide components rendered inside the carousel.\n */\n readonly slides = contentChildren(forwardRef(() => EclCarouselItemComponent));\n\n /**\n * Indicates whether autoplay is currently active.\n */\n readonly isPlaying = signal(false);\n\n /**\n * Indicates whether autoplay was manually paused (via the pause button or\n * on mobile). When paused this way the loading bar is cleared.\n */\n readonly isPausedForced = signal(false);\n\n /**\n * Indicates whether the layout is currently in RTL mode.\n */\n isRtl = false;\n\n /**\n * Zero-based index of the currently active slide (mirrors Embla's selected snap).\n */\n private activeIndex = 0;\n\n /**\n * Start index of the currently visible teaser window (desktop only).\n */\n private teaserWindowStart = 0;\n\n /**\n * Indicates whether autoplay is temporarily paused by hover/focus. Unlike a\n * manual pause, the loading bar stays visible and frozen at its current\n * progress (matching ECL), resuming when the pointer/focus leaves.\n */\n protected readonly isHoverPaused = signal(false);\n\n /**\n * Whether the current viewport is at the mobile breakpoint. A signal so the\n * template can react (the pager drops play/pause on mobile, matching ECL,\n * where play/pause is a desktop-only control).\n */\n protected readonly isMobileBreakpoint = signal(false);\n\n /**\n * Whether the viewport is at or above the ECL desktop breakpoint (1140px).\n * This is the boundary the ECL CSS uses to show the play/pause controls and\n * the teaser tablist (and to hide the mobile dots). A signal so the pager\n * variant can react: play/pause only renders at/above this width, matching\n * the CSS so the pause button never leaks onto narrower viewports.\n */\n protected readonly isDesktopBreakpointActive = signal(false);\n\n /**\n * Embla options, mirroring the upstream ECL configuration.\n */\n protected emblaOptions: EmblaOptionsType = {\n loop: true,\n align: 'start',\n duration: 20,\n };\n\n /**\n * Embla plugins. Built once so the Embla directive does not needlessly re-init.\n */\n protected emblaPlugins: EmblaPluginType[] = [];\n\n /**\n * Embla events the component reacts to.\n */\n protected readonly emblaEvents: EmblaEventType[] = [\n 'select',\n 'reInit',\n 'autoplay:timerset',\n ];\n\n /**\n * Reference to the Embla directive driving the slide engine.\n */\n private readonly embla = viewChild<EmblaCarouselDirective>('embla');\n\n /**\n * References to the teaser navigation buttons corresponding to each slide.\n */\n private readonly teaserButtons = viewChildren<ElementRef>('teaserButton');\n\n /**\n * References to the teaser loading-bar completion elements (one per slide),\n * used to restart the progress animation when the active slide changes.\n */\n private readonly loadingBars = viewChildren<ElementRef>('loadingBar');\n\n private isTabletBreakpoint = false;\n private isLargeBreakpoint = false;\n private isDesktopBreakpoint = false;\n\n private destroy$: Subject<boolean> = new Subject<boolean>();\n\n /**\n * Debounce interval (ms) used internally for timing and transitions.\n */\n private readonly TIMEOUT_INTERVAL = 400;\n private readonly cdkBreakpointObserver = inject(BreakpointObserver);\n private readonly cd = inject(ChangeDetectorRef);\n private readonly renderer2 = inject(Renderer2);\n private readonly eclRtlService = inject(EclRtlService);\n private readonly translate = inject(TranslateService);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly window = this.document.defaultView;\n /**\n * Host element, used to locate the slider pager's play/pause buttons by their\n * ECL classes for focus management after a play/pause toggle.\n */\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Returns the computed CSS class list for the component.\n */\n protected readonly cssClasses = computed<string>(() =>\n super.getCssClasses('ecl-carousel'));\n\n constructor() {\n super();\n afterNextRender(() => {\n this.observeElementSizeChanges();\n this.observeBreakpointChanges();\n this.syncFromEmbla();\n\n if (this.window) {\n fromEvent(this.window, 'resize')\n .pipe(auditTime(50), takeUntil(this.destroy$))\n .subscribe(() => this.observeElementSizeChanges());\n }\n });\n }\n\n /**\n * Angular lifecycle hook: initializes RTL detection and the Embla plugins.\n */\n ngOnInit(): void {\n this.emblaOptions = {\n ...this.emblaOptions,\n direction: this.isRtl ? 'rtl' : 'ltr',\n };\n const autoplayDesired = this.isAutoplayDesired();\n // Reflect the initial play state so the current slide's loading bar is\n // shown on load (the plugin self-starts via playOnInit).\n this.isPlaying.set(autoplayDesired);\n this.emblaPlugins = [\n Autoplay({\n delay: this.playInterval(),\n // Autoplay is on by default (matching ECL) unless explicitly\n // disabled via [isAutoplay]=\"false\". Letting the plugin start\n // itself avoids a race with Embla's own initialization.\n playOnInit: autoplayDesired,\n stopOnInteraction: false,\n stopOnMouseEnter: true,\n stopOnFocusIn: true,\n }),\n ];\n this.handleRtlChangeState();\n }\n\n /**\n * Angular lifecycle hook: called after content (slides) is initialized.\n */\n ngAfterContentInit(): void {\n setTimeout(() => {\n this.initSlides();\n });\n }\n\n /**\n * Angular lifecycle hook: cleans up subscriptions.\n */\n ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.unsubscribe();\n }\n\n /**\n * Returns whether the carousel has padding applied (e.g., on desktop breakpoint).\n */\n isPadded(): boolean {\n return this.isDesktopBreakpoint;\n }\n\n /**\n * Checks whether there are enough slides to render controls.\n */\n hasControls(): boolean {\n return this.getSlidesCount() > 1;\n }\n\n /**\n * Retrieves the current active slide index (zero-based).\n */\n getCurrentSlideIndex(): number {\n return this.activeIndex;\n }\n\n /**\n * Returns the 1-based position of the active slide (for the counter).\n */\n getCounterCurrent(): number {\n return this.activeIndex + 1;\n }\n\n /**\n * Returns the total number of slides (for the counter).\n */\n getCounterTotal(): number {\n return this.getSlidesCount();\n }\n\n /**\n * Dot indices for the mobile slider pager (one dot per slide). The dots are\n * hidden on desktop via the ECL CSS (`.ecl-carousel__dots { display: none }`)\n * and shown at the mobile breakpoint.\n */\n getDotIndices(): number[] {\n return Array.from({ length: this.getSlidesCount() }, (_unused, dotIndex) => dotIndex);\n }\n\n /**\n * Pre-translated accessible label for each pager dot. Translated here since\n * the shared `ecl-slider-pager` receives plain strings.\n */\n getDotAriaLabels(): string[] {\n const total = this.getSlidesCount();\n return Array.from({ length: total }, (_unused, dotIndex) =>\n this.translate.instant('ecl.carousel.GO-TO-SLIDE', {\n current: dotIndex + 1,\n total,\n }),\n );\n }\n\n /**\n * Returns whether a teaser button should be visible in the current window.\n */\n isTeaserVisible(index: number): boolean {\n const count = this.getSlidesCount();\n if (count <= VISIBLE_TEASERS) {\n return true;\n }\n const position = ((index - this.teaserWindowStart) % count + count) % count;\n return position < VISIBLE_TEASERS;\n }\n\n /**\n * Returns the flex order of a teaser button within the visible window.\n */\n getTeaserOrder(index: number): number {\n const count = this.getSlidesCount();\n return ((index - this.teaserWindowStart) % count + count) % count;\n }\n\n /**\n * Whether the pager should show the \"pause\" control (i.e. autoplay is\n * actively running). While the pointer/focus hover-pauses the carousel the\n * timer is suspended, so the pager must show \"play\" even though a manual\n * pause was not triggered. Mirrors upstream ECL, where hovering flips the\n * control to play.\n */\n protected isPagerPlaying(): boolean {\n return this.isPlaying() && !this.isHoverPaused();\n }\n\n /**\n * Pager variant by breakpoint. Below the ECL desktop breakpoint (1140px)\n * the carousel shows only the dots navigation (prev / dots / next);\n * play/pause is a desktop-only control in ECL. Rendering `'dots'` there\n * avoids the pager's inline play/pause `display` style (which would\n * otherwise beat the ECL CSS and leave the pause button visible on narrower\n * viewports). At/above 1140px the dots are hidden by CSS, so\n * `'play-pause-dots'` yields play/pause + prev/next + teasers.\n *\n * The 1140px boundary mirrors the media query the ECL CSS uses to toggle\n * `.ecl-carousel__play/__pause` and `.ecl-carousel__teasers`.\n */\n protected pagerVariant(): 'dots' | 'play-pause-dots' {\n return this.isDesktopBreakpointActive() ? 'play-pause-dots' : 'dots';\n }\n\n /**\n * Handles the throttled Embla events the component subscribed to.\n */\n protected onEmblaEvent(event: EmblaEventType): void {\n switch (event) {\n case 'select':\n case 'reInit':\n this.syncFromEmbla();\n break;\n case 'autoplay:timerset':\n // Fired each time the autoplay timer (re)starts for the current\n // slide; replay the loading-bar fill animation from zero.\n this.restartActiveLoadingBar();\n break;\n default:\n break;\n }\n }\n\n /**\n * Starts autoplay.\n *\n * @param moveFocus when true (a user clicked play) focus moves to the pause\n * button. Auto-starts (e.g. on breakpoint changes) pass false so the\n * page is not scrolled to the carousel on load.\n */\n protected onPlayClick(moveFocus = true): void {\n this.getAutoplay()?.play();\n this.isPlaying.set(true);\n this.isPausedForced.set(false);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n if (moveFocus) {\n this.focusPagerButton('.ecl-carousel__pause');\n }\n }\n\n /**\n * Stops autoplay and focuses the play button.\n */\n protected onPauseClick(): void {\n // Pause (not full stop): halt the autoplay timer but keep the active\n // teaser loading bar visible, frozen at its current progress (matching\n // upstream ECL's `handleAutoPlay(false, true)`). The installed\n // embla-carousel-autoplay exposes no `pause()`, so we call `stop()`\n // WITHOUT `reset()` — the frozen bar is driven by our `is-paused` CSS\n // class, not the plugin. A full stop+reset (which clears the bar) only\n // happens on prev/next/teaser navigation via `stopAutoplay()`.\n this.getAutoplay()?.stop();\n this.isPlaying.set(false);\n this.isPausedForced.set(true);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n this.focusPagerButton('.ecl-carousel__play');\n }\n\n /**\n * Navigates to the next slide and stops autoplay.\n */\n protected onNextSlideClick(): void {\n this.stopAutoplay();\n this.embla()?.scrollNext();\n }\n\n /**\n * Navigates to the previous slide and stops autoplay.\n */\n protected onPreviousSlideClick(): void {\n this.stopAutoplay();\n this.embla()?.scrollPrev();\n }\n\n /**\n * Handles user interaction with a teaser button: activates the matching slide.\n */\n protected onTeaserClick(index: number): void {\n this.stopAutoplay();\n this.embla()?.scrollTo(index);\n }\n\n /**\n * Handles a dot activation from the mobile slider pager: scrolls to the\n * matching slide and stops autoplay (same behavior as a teaser click).\n */\n protected onDotClick(index: number): void {\n this.stopAutoplay();\n this.embla()?.scrollTo(index);\n }\n\n /**\n * Handles keyboard navigation (ArrowLeft/ArrowRight) across teaser buttons.\n */\n protected onTeaserKeyboardPress(event: KeyboardEvent, index: number): void {\n if (event.key !== KeyCode.ARROW_RIGHT && event.key !== KeyCode.ARROW_LEFT) {\n return;\n }\n event.preventDefault();\n const direction = event.key === KeyCode.ARROW_RIGHT ? 1 : -1;\n const count = this.getSlidesCount();\n const nextIndex = (index + direction + count) % count;\n this.stopAutoplay();\n this.embla()?.scrollTo(nextIndex);\n this.focusOnButton(this.teaserButtons()[nextIndex]);\n }\n\n /**\n * Freezes the loading bar while the pointer/focus is over the carousel.\n * The Embla autoplay plugin pauses the timer itself (stopOnMouseEnter /\n * stopOnFocusIn); this only mirrors that as a visible paused state.\n */\n protected onViewportPause(): void {\n if (this.isPlaying() && !this.isPausedForced()) {\n this.isHoverPaused.set(true);\n this.cd.detectChanges();\n }\n }\n\n /**\n * Resumes the loading bar once the pointer/focus leaves the carousel.\n */\n protected onViewportResume(): void {\n if (this.isHoverPaused()) {\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n }\n }\n\n /**\n * Sets focus on the specified button.\n */\n private focusOnButton(button: ElementRef): void {\n if (!button) {\n return;\n }\n button.nativeElement.focus();\n }\n\n /**\n * Focuses the slider pager button matching the given ECL class selector\n * (e.g. `.ecl-carousel__play`). Used after a play/pause toggle so focus\n * follows the now-visible control, since the pager swaps play/pause\n * visibility via CSS. No-op if the button is not rendered (e.g. mobile).\n */\n private focusPagerButton(selector: string): void {\n const button = this.hostEl.nativeElement.querySelector<HTMLElement>(selector);\n button?.focus();\n }\n\n /**\n * Returns the Embla autoplay plugin instance, but only when the carousel\n * actually has more than one scroll snap.\n *\n * The `embla-carousel-autoplay` plugin skips its own initialization when\n * `scrollSnapList().length <= 1` (see the plugin's `init`), which leaves its\n * internal `delay` lookup table undefined. Calling `play()` in that state\n * throws (`delay[selectedScrollSnap()]` -> reading `0` of undefined). This\n * happens whenever Embla cannot lay out multiple snaps — notably in a jsdom\n * test or during SSR. Gating on the same `> 1` condition the plugin uses\n * keeps autoplay a safe no-op until the carousel is genuinely slideable.\n */\n private getAutoplay() {\n const api = this.embla()?.emblaApi;\n if (!api || api.scrollSnapList().length <= 1) {\n return undefined;\n }\n return api.plugins()?.autoplay;\n }\n\n /**\n * Whether autoplay should run. On by default (matching ECL); only disabled\n * when the consumer explicitly sets `[isAutoplay]=\"false\"`.\n */\n private isAutoplayDesired(): boolean {\n const isAutoplay = this.isAutoplay();\n return isAutoplay || isAutoplay === undefined;\n }\n\n /**\n * Stops autoplay and resets it (mirrors ECL's `handleAutoPlay(true)`),\n * clearing the loading-bar state.\n */\n private stopAutoplay(): void {\n const autoplay = this.getAutoplay();\n autoplay?.stop();\n autoplay?.reset();\n this.isPlaying.set(false);\n this.isPausedForced.set(false);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n }\n\n /**\n * Synchronizes component state from Embla's current selected snap:\n * active index, slide `isCurrent` flags, teaser window and the slide event.\n */\n private syncFromEmbla(): void {\n const api = this.embla()?.emblaApi;\n if (!api) {\n return;\n }\n const selected = api.selectedScrollSnap();\n this.setActiveIndex(selected);\n this.updateTeaserWindow();\n this.slide.emit(new EclSlideEvent(this.slides().at(this.activeIndex)));\n this.cd.detectChanges();\n }\n\n /**\n * Subscribes to RTL layout state changes to adapt carousel direction.\n */\n private handleRtlChangeState(): void {\n this.eclRtlService.currentRtlState$.pipe(takeUntil(this.destroy$)).subscribe((rtlState) => {\n const changed = this.isRtl !== rtlState;\n this.isRtl = rtlState;\n if (changed) {\n this.emblaOptions = {\n ...this.emblaOptions,\n direction: this.isRtl ? 'rtl' : 'ltr',\n };\n this.cd.detectChanges();\n }\n });\n }\n\n /**\n * Initializes slides (index, ARIA label, banner height management).\n */\n private initSlides(): void {\n const slides = this.slides();\n slides.forEach((item, idx) => {\n item.index.set(idx);\n item.ariaLabel.set(`slide ${idx + 1} of ${slides.length}`);\n item.isCurrent.set(idx === 0);\n const banner = item.banner();\n if (banner) {\n banner.skipHeightManagement = true;\n }\n });\n this.cd.detectChanges();\n }\n\n /**\n * Updates the active index and synchronizes slide active/inert state.\n */\n private setActiveIndex(index: number): void {\n this.activeIndex = index;\n this.slides().forEach((item, idx) => {\n item.isCurrent.set(idx === index);\n });\n }\n\n /**\n * Restarts the CSS progress animation on the active slide's loading bar.\n * The animation uses `forwards`, so re-applying the `is-active` class alone\n * will not replay it; the animation must be reset explicitly.\n */\n private restartActiveLoadingBar(): void {\n if (!this.getAutoplay()?.isPlaying()) {\n return;\n }\n const bar = this.loadingBars()[this.activeIndex]?.nativeElement as HTMLElement | undefined;\n if (!bar) {\n return;\n }\n bar.style.animation = 'none';\n // Force reflow so the browser registers the reset before re-enabling.\n void bar.offsetWidth;\n bar.style.animation = '';\n }\n\n /**\n * Advances the visible teaser window when the active slide moves out of it.\n */\n private updateTeaserWindow(): void {\n const count = this.getSlidesCount();\n if (count <= VISIBLE_TEASERS) {\n this.teaserWindowStart = 0;\n return;\n }\n const firstHiddenIndex = (this.teaserWindowStart + VISIBLE_TEASERS) % count;\n if (this.activeIndex === firstHiddenIndex) {\n this.teaserWindowStart = firstHiddenIndex;\n }\n }\n\n /**\n * Returns the number of actual visible slides.\n */\n private getSlidesCount(): number {\n return this.slides()?.length ?? 0;\n }\n\n /**\n * Observes screen breakpoint changes to adjust autoplay and layout behavior.\n */\n private observeBreakpointChanges(): void {\n this.cdkBreakpointObserver\n .observe([\n '(max-width: 768px)',\n '(min-width: 998px)',\n '(min-width: 1140px)',\n '(min-width: 1140px) and (max-width: 1260px)',\n ])\n .pipe(takeUntil(this.destroy$))\n .subscribe((result) => {\n this.isMobileBreakpoint.set(result.breakpoints['(max-width: 768px)']);\n this.isTabletBreakpoint = result.breakpoints['(min-width: 998px)'];\n this.isLargeBreakpoint = result.breakpoints['(min-width: 1140px)'];\n this.isDesktopBreakpointActive.set(result.breakpoints['(min-width: 1140px)']);\n this.isDesktopBreakpoint = result.breakpoints['(min-width: 1140px) and (max-width: 1260px)'];\n\n // Deactivate autoplay on mobile; (re)activate it on larger\n // screens if autoplay is desired. Focus is never moved here so\n // the page is not scrolled to the carousel on load/resize.\n if (this.isMobileBreakpoint()) {\n this.stopAutoplay();\n return;\n }\n\n if (this.isTabletBreakpoint && this.isAutoplayDesired() && !this.isPausedForced()) {\n this.onPlayClick(false);\n }\n });\n }\n\n /**\n * Observes changes to the carousel's viewport element size using a timeout debounce.\n */\n private observeElementSizeChanges(): void {\n setTimeout(() => {\n if (this.isLargeBreakpoint) {\n this.checkBannerHeights();\n } else {\n this.resetHeight();\n }\n this.embla()?.reInit();\n }, this.TIMEOUT_INTERVAL);\n }\n\n /**\n * Normalizes the height of all banners to match the tallest banner.\n */\n private checkBannerHeights(): void {\n this.slides().forEach((slide) => {\n const banner = slide.banner();\n if (banner) {\n banner.calculateHeight();\n }\n });\n\n const heightValues = this.slides().map((slide) => {\n const el = slide.banner()?.el.nativeElement;\n if (!el) return undefined;\n\n const styleHeight = el.style.height;\n\n if (styleHeight === 'auto' || styleHeight === '') {\n return el.offsetHeight;\n }\n\n const height = parseInt(styleHeight, 10);\n if (Number.isNaN(height) || height === 100) {\n return 1;\n }\n\n return height;\n });\n\n const elementHeights = heightValues.filter((h) => h !== undefined) as number[];\n const tallestElementHeight = Math.max(...elementHeights);\n\n const slides = this.slides();\n if (tallestElementHeight > 1 && elementHeights.length === slides.length) {\n slides.forEach((slide) => {\n const banner = slide.banner();\n if (!banner) return;\n\n const el = banner.el.nativeElement;\n const bannerImage = banner.eclBannerImage();\n const bannerVideo = banner.eclBannerVideo();\n\n this.renderer2.setStyle(el, 'height', `${tallestElementHeight}px`);\n this.renderer2.setStyle(el, 'aspect-ratio', 'auto');\n\n if (bannerImage) {\n this.renderer2.setStyle(bannerImage.el.nativeElement, 'aspect-ratio', 'auto');\n }\n if (bannerVideo) {\n this.renderer2.setStyle(bannerVideo.el.nativeElement, 'aspect-ratio', 'auto');\n }\n });\n }\n }\n\n /**\n * Clears all explicit banner height and aspect ratio styling for smaller breakpoints.\n */\n private resetHeight(): void {\n this.slides().forEach((slide) => {\n const banner = slide.banner();\n if (banner) {\n const bannerImage = banner.eclBannerImage();\n const bannerVideo = banner.eclBannerVideo();\n this.renderer2.removeStyle(banner.el.nativeElement, 'height');\n this.renderer2.removeStyle(banner.el.nativeElement, 'aspect-ratio');\n if (bannerImage) {\n this.renderer2.removeStyle(bannerImage.el.nativeElement, 'aspect-ratio');\n }\n if (bannerVideo) {\n this.renderer2.removeStyle(bannerVideo.el.nativeElement, 'aspect-ratio');\n }\n }\n });\n }\n}\n","@if (hasControls()) {\n<div class=\"ecl-carousel__controls\">\n <div class=\"ecl-container\">\n <div class=\"ecl-carousel__navigation\">\n <div class=\"ecl-carousel__pager-container\">\n <ecl-slider-pager\n class=\"ecl-carousel__pager\"\n [variant]=\"pagerVariant()\"\n size=\"m\"\n [isPlaying]=\"isPagerPlaying()\"\n [activeIndex]=\"getCurrentSlideIndex()\"\n [dotIndices]=\"getDotIndices()\"\n [dotAriaLabels]=\"getDotAriaLabels()\"\n prevExtraClasses=\"ecl-carousel__prev\"\n nextExtraClasses=\"ecl-carousel__next\"\n dotsExtraClasses=\"ecl-carousel__dots\"\n dotExtraClasses=\"ecl-carousel__dot\"\n playExtraClasses=\"ecl-carousel__play\"\n pauseExtraClasses=\"ecl-carousel__pause\"\n (play)=\"onPlayClick()\"\n (pause)=\"onPauseClick()\"\n (prev)=\"onPreviousSlideClick()\"\n (next)=\"onNextSlideClick()\"\n (goTo)=\"onDotClick($event)\">\n </ecl-slider-pager>\n <div class=\"ecl-carousel__counter\" dir=\"ltr\">\n {{ getCounterCurrent() }} {{ ('ecl.common.OF' | translate) }} {{ getCounterTotal() }}\n </div>\n </div>\n\n <div class=\"ecl-carousel__teasers\" role=\"tablist\">\n @for (slide of slides(); let i = $index; track slide) {\n <button #teaserButton type=\"button\" class=\"ecl-carousel__teaser-button\" role=\"tab\"\n [attr.data-ecl-carousel-slide-index]=\"i\"\n [attr.aria-current]=\"i === getCurrentSlideIndex() ? true : null\"\n [attr.tabindex]=\"i === getCurrentSlideIndex() ? null : -1\"\n [style.display]=\"isTeaserVisible(i) ? null : 'none'\"\n [style.pointer-events]=\"isTeaserVisible(i) ? null : 'none'\"\n [style.order]=\"getTeaserOrder(i)\" (click)=\"onTeaserClick(i)\"\n (keydown)=\"onTeaserKeyboardPress($event, i)\">\n <span class=\"ecl-carousel__teaser-loading-bar\" aria-hidden=\"true\"\n [class.is-active]=\"(isPlaying() || isHoverPaused() || isPausedForced()) && i === getCurrentSlideIndex()\"\n [class.is-paused]=\"(isHoverPaused() || isPausedForced()) && i === getCurrentSlideIndex()\">\n <span #loadingBar class=\"ecl-carousel__teaser-loading-bar-completion\"></span>\n </span>\n <span class=\"ecl-carousel__teaser-content\">\n @if (slide.teaserText()) {\n <span class=\"ecl-carousel__teaser-title\">{{ slide.teaserText() }}</span>\n }\n </span>\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n}\n<div #carouselContainer class=\"ecl-carousel__viewport\" [class.ecl-carousel-container--padded]=\"isPadded()\"\n emblaCarousel #embla=\"emblaCarousel\" [options]=\"emblaOptions\" [plugins]=\"emblaPlugins\"\n [subscribeToEvents]=\"emblaEvents\" (emblaChange)=\"onEmblaEvent($event)\"\n (mouseenter)=\"onViewportPause()\" (mouseleave)=\"onViewportResume()\"\n (focusin)=\"onViewportPause()\" (focusout)=\"onViewportResume()\">\n <div class=\"ecl-carousel__slides\">\n <ng-content></ng-content>\n </div>\n</div>\n","import { EclCarouselComponent } from './ecl-carousel.component';\nimport { EclCarouselItemComponent } from './ecl-carousel-item.component';\n\nexport * from './ecl-carousel.component';\nexport * from './ecl-carousel-item.component';\nexport * from './events/ecl-slide.event';\nexport * from './models/ecl-carousel-item.model';\n\nexport const EUI_ECL_CAROUSEL = [\n EclCarouselComponent,\n EclCarouselItemComponent,\n] as const;\n"],"mappings":";;;;;;;;;;;AAQA,IAAa,gBAAb,cAAmC,aAAY;CAI3C,YAAmB,MAAqB;EACpC,MAAK;EADU,KAAA,OAAA;CAEnB;AACH;ACoCD,IAAa,2BAAb,MAAa,iCAAiC,iBAAgB;CArB9D,cAAA;;EAsBI,KAAA,KAAK,OAAO,UAAU;EAKb,KAAA,YAAY,OAA2B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAMjD,KAAA,iBAAiB,MAAM,OAAK;GAAA,GAAA,YAAA,EAAA,WAAA,iBAAA,+BAAA,CAAA;GAAI,OAAO;GAAa,WAAW;EAAgB,CA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AA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,0BAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,qBAAmB,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAK3C,iBAAiB,wBAAwB,GAAC,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CA6EjB,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAKR,gBAAc,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAMhB,cAAY,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA;AE1LxE,MAAa,mBAAmB,CAC9B,sBACA,wBACQ"}
|
|
1
|
+
{"version":3,"file":"eui-ecl-components-ecl-carousel.mjs","names":[],"sources":["../../components/ecl-carousel/events/ecl-slide.event.ts","../../components/ecl-carousel/ecl-carousel-item.component.ts","../../components/ecl-carousel/ecl-carousel-item.component.html","../../components/ecl-carousel/ecl-carousel.component.ts","../../components/ecl-carousel/ecl-carousel.component.html","../../components/ecl-carousel/index.ts"],"sourcesContent":["import { EclBaseEvent } from '@eui/ecl/core';\nimport { EclCarouselItem } from '../models/ecl-carousel-item.model';\n\n/**\n * Event emitted by `EclCarouselComponent` when the active slide changes, and by\n * `EclCarouselItemComponent` when a slide is clicked.\n * Carries the `EclCarouselItem` that became active or was clicked.\n */\nexport class EclSlideEvent extends EclBaseEvent {\n /**\n * @param item The carousel item that was activated or clicked.\n */\n constructor(public item: EclCarouselItem) {\n super();\n }\n}","import {\n Component,\n ElementRef,\n booleanAttribute,\n computed,\n forwardRef,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n contentChild,\n} from '@angular/core';\nimport { ECLBaseDirective } from '@eui/ecl/core';\nimport { EclBannerComponent } from '@eui/ecl/components/ecl-banner';\nimport { EclSlideEvent } from './events/ecl-slide.event';\nimport { EclCarouselItem } from './models/ecl-carousel-item.model';\n\n/**\n * Single slide item for use inside an `EclCarouselComponent`.\n * Renders a `role=\"tabpanel\"` element with an `aria-roledescription=\"slide\"` and handles\n * the `inert` attribute so only the active slide is interactive.\n *\n * - Selector: `ecl-carousel-item`.\n * - `isCurrent` (input alias) — initial active state; kept as a `linkedSignal` so the parent\n * carousel can update it imperatively as the user navigates.\n * - `slideClick` — emits `EclSlideEvent` when the slide is clicked.\n * - `index` / `ariaLabel` — writable signals assigned by the parent carousel.\n * - Project an optional `EclBannerComponent` inside the slide for banner-style slides.\n */\n@Component({\n selector: 'ecl-carousel-item',\n templateUrl: './ecl-carousel-item.component.html',\n host: {\n role: 'tabpanel',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-roledescription]': '\"slide\"',\n '[attr.inert]': '!isCurrent() || undefined',\n '[class]': 'cssClasses()',\n '(click)': 'onSlideClick()',\n },\n styles: [\n `\n /* TODO: remove by implementing full ECL specs */\n :host:before {\n left: 0 !important;\n display: none;\n }\n `,\n ],\n})\nexport class EclCarouselItemComponent extends ECLBaseDirective implements EclCarouselItem {\n el = inject(ElementRef);\n\n /**\n * The aria-label for the slide, assigned dynamically by the carousel.\n */\n readonly ariaLabel = signal<string | undefined>(undefined);\n\n /**\n * Input controlling whether this slide starts as the active/visible one.\n * Automatically coerced to a boolean value.\n */\n readonly isCurrentInput = input(false, { alias: 'isCurrent', transform: booleanAttribute });\n\n /**\n * Indicates whether this slide is currently active/visible.\n * Seeded from the `isCurrent` input but can be updated imperatively by the\n * parent carousel as the user navigates between slides.\n */\n readonly isCurrent = linkedSignal(() => this.isCurrentInput());\n\n /**\n * Text shown in the carousel teaser (navigation) button for this slide.\n * Optional; when empty, no teaser label is rendered for the slide.\n */\n readonly teaserText = input<string>('');\n\n /**\n * Emits an event when the slide is clicked.\n */\n readonly slideClick = output<EclSlideEvent>();\n\n /**\n * Optionally captures a banner component projected into the slide.\n */\n readonly banner = contentChild(forwardRef(() => EclBannerComponent));\n\n /**\n * Internal slide index, assigned dynamically by the carousel.\n */\n readonly index = signal<number | undefined>(undefined);\n\n /**\n * Computes the slide's CSS class.\n */\n protected readonly cssClasses = computed<string>(() =>\n super.getCssClasses('ecl-carousel__slide'));\n\n /**\n * Handles click events on the slide and emits a slideClick event.\n */\n onSlideClick(): void {\n this.slideClick.emit(new EclSlideEvent(this));\n }\n}\n","<ng-content></ng-content>\n","import { BreakpointObserver } from '@angular/cdk/layout';\nimport {\n AfterContentInit,\n ChangeDetectorRef,\n Component,\n DOCUMENT,\n ElementRef,\n OnDestroy,\n OnInit,\n Renderer2,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChildren,\n forwardRef,\n inject,\n input,\n numberAttribute,\n output,\n signal,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { EUI_ECL_SLIDER } from '@eui/ecl/components/ecl-slider';\nimport { ECLBaseDirective, EclRtlService, KeyCode } from '@eui/ecl/core';\nimport { TranslatePipe, TranslateService } from '@ngx-translate/core';\nimport {\n EmblaEventType,\n EmblaOptionsType,\n EmblaPluginType,\n} from 'embla-carousel';\nimport { EmblaCarouselDirective } from 'embla-carousel-angular';\nimport Autoplay from 'embla-carousel-autoplay';\nimport { Subject, auditTime, fromEvent, takeUntil } from 'rxjs';\nimport { EclCarouselItemComponent } from './ecl-carousel-item.component';\nimport { EclSlideEvent } from './events/ecl-slide.event';\n\n/**\n * Number of teaser buttons visible at once on the desktop breakpoint.\n */\nconst VISIBLE_TEASERS = 4;\n\n/**\n * Carousel (slideshow) component following the ECL design system.\n * Renders a sequence of `EclCarouselItemComponent` slides with autoplay, keyboard navigation,\n * responsive breakpoint awareness, and RTL layout support.\n *\n * The slide engine is powered by Embla (via `embla-carousel-angular`), matching the upstream\n * ECL implementation: an infinite `loop`, the `Autoplay` plugin driving the teaser loading bars,\n * and a slider pager with previous/next/play/pause controls, a counter, and a tablist of teaser\n * buttons (one per slide).\n *\n * - Selector: `ecl-carousel`.\n * - Project `ecl-carousel-item` elements as slides (also via `contentChildren`).\n * - `ariaLabel` — ARIA label for the carousel landmark; aliased as `aria-label`.\n * - `isAutoplay` — enables automatic slide advancement; boolean attribute.\n * - `playInterval` — milliseconds between automatic transitions; default `5000`.\n * - `slide` — emits `EclSlideEvent` when the active slide changes.\n */\n@Component({\n selector: 'ecl-carousel',\n templateUrl: './ecl-carousel.component.html',\n imports: [\n TranslatePipe,\n EmblaCarouselDirective,\n ...EUI_ECL_SLIDER,\n ],\n host: {\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-roledescription]': '\"carousel\"',\n '[class]': 'cssClasses()',\n // Drives the teaser loading-bar animation duration (see @eui/styles).\n // It has no CSS fallback, so without it the progress animation never\n // runs; it must match the autoplay delay.\n '[style.--ecl-carousel-slide-duration]': 'playInterval() + \"ms\"',\n },\n})\nexport class EclCarouselComponent extends ECLBaseDirective implements OnInit, OnDestroy, AfterContentInit {\n /**\n * Aria-label for screen readers to describe the carousel.\n */\n readonly ariaLabel = input<string | null>('Carousel description here', { alias: 'aria-label' });\n\n /**\n * Determines whether the carousel should autoplay.\n */\n readonly isAutoplay = input<boolean, unknown>(undefined, { transform: booleanAttribute });\n\n /**\n * Interval in milliseconds between automatic slide transitions.\n */\n readonly playInterval = input(5000, { transform: numberAttribute });\n\n /**\n * Event emitted when a slide change occurs.\n */\n readonly slide = output<EclSlideEvent>();\n\n /**\n * Reference to the main carousel viewport element (the Embla root).\n */\n readonly carouselContainerElement = viewChild<ElementRef>('carouselContainer');\n\n /**\n * Collection of slide components rendered inside the carousel.\n */\n readonly slides = contentChildren(forwardRef(() => EclCarouselItemComponent));\n\n /**\n * Indicates whether autoplay is currently active.\n */\n readonly isPlaying = signal(false);\n\n /**\n * Indicates whether autoplay was manually paused (via the pause button or\n * on mobile). When paused this way the loading bar is cleared.\n */\n readonly isPausedForced = signal(false);\n\n /**\n * Indicates whether the layout is currently in RTL mode.\n */\n isRtl = false;\n\n /**\n * Zero-based index of the currently active slide (mirrors Embla's selected snap).\n */\n private activeIndex = 0;\n\n /**\n * Start index of the currently visible teaser window (desktop only).\n */\n private teaserWindowStart = 0;\n\n /**\n * Indicates whether autoplay is temporarily paused by hover/focus. Unlike a\n * manual pause, the loading bar stays visible and frozen at its current\n * progress (matching ECL), resuming when the pointer/focus leaves.\n */\n protected readonly isHoverPaused = signal(false);\n\n /**\n * Whether the current viewport is at the mobile breakpoint. A signal so the\n * template can react (the pager drops play/pause on mobile, matching ECL,\n * where play/pause is a desktop-only control).\n */\n protected readonly isMobileBreakpoint = signal(false);\n\n /**\n * Whether the viewport is at or above the ECL desktop breakpoint (1140px).\n * This is the boundary the ECL CSS uses to show the play/pause controls and\n * the teaser tablist (and to hide the mobile dots). A signal so the pager\n * variant can react: play/pause only renders at/above this width, matching\n * the CSS so the pause button never leaks onto narrower viewports.\n */\n protected readonly isDesktopBreakpointActive = signal(false);\n\n /**\n * Embla options, mirroring the upstream ECL configuration.\n */\n protected emblaOptions: EmblaOptionsType = {\n loop: true,\n align: 'start',\n duration: 20,\n };\n\n /**\n * Embla plugins. Built once so the Embla directive does not needlessly re-init.\n */\n protected emblaPlugins: EmblaPluginType[] = [];\n\n /**\n * Embla events the component reacts to.\n */\n protected readonly emblaEvents: EmblaEventType[] = [\n 'select',\n 'reInit',\n 'autoplay:timerset',\n ];\n\n /**\n * Reference to the Embla directive driving the slide engine.\n */\n private readonly embla = viewChild<EmblaCarouselDirective>('embla');\n\n /**\n * References to the teaser navigation buttons corresponding to each slide.\n */\n private readonly teaserButtons = viewChildren<ElementRef>('teaserButton');\n\n /**\n * References to the teaser loading-bar completion elements (one per slide),\n * used to restart the progress animation when the active slide changes.\n */\n private readonly loadingBars = viewChildren<ElementRef>('loadingBar');\n\n private isLargeBreakpoint = false;\n private isDesktopBreakpoint = false;\n\n private destroy$: Subject<boolean> = new Subject<boolean>();\n\n /**\n * Debounce interval (ms) used internally for timing and transitions.\n */\n private readonly TIMEOUT_INTERVAL = 400;\n private readonly cdkBreakpointObserver = inject(BreakpointObserver);\n private readonly cd = inject(ChangeDetectorRef);\n private readonly renderer2 = inject(Renderer2);\n private readonly eclRtlService = inject(EclRtlService);\n private readonly translate = inject(TranslateService);\n private readonly document = inject<Document>(DOCUMENT);\n private readonly window = this.document.defaultView;\n /**\n * Host element, used to locate the slider pager's play/pause buttons by their\n * ECL classes for focus management after a play/pause toggle.\n */\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Returns the computed CSS class list for the component.\n */\n protected readonly cssClasses = computed<string>(() =>\n super.getCssClasses('ecl-carousel'));\n\n constructor() {\n super();\n afterNextRender(() => {\n this.observeElementSizeChanges();\n this.observeBreakpointChanges();\n this.syncFromEmbla();\n\n if (this.window) {\n fromEvent(this.window, 'resize')\n .pipe(auditTime(50), takeUntil(this.destroy$))\n .subscribe(() => this.observeElementSizeChanges());\n }\n });\n }\n\n /**\n * Angular lifecycle hook: initializes RTL detection and the Embla plugins.\n */\n ngOnInit(): void {\n this.emblaOptions = {\n ...this.emblaOptions,\n direction: this.isRtl ? 'rtl' : 'ltr',\n };\n // Autoplay is a desktop-only affordance (matching upstream ECL): it\n // must never run below the desktop breakpoint (xl, 1140px). The plugin\n // therefore does NOT self-start (`playOnInit: false`);\n // `observeBreakpointChanges` starts it only at/above the desktop\n // breakpoint and stops it on every smaller viewport (mobile and\n // tablet). `isPlaying` starts `false` so the loading bar is not shown\n // until autoplay actually begins.\n this.isPlaying.set(false);\n this.emblaPlugins = [\n Autoplay({\n delay: this.playInterval(),\n playOnInit: false,\n stopOnInteraction: false,\n stopOnMouseEnter: true,\n stopOnFocusIn: true,\n }),\n ];\n this.handleRtlChangeState();\n }\n\n /**\n * Angular lifecycle hook: called after content (slides) is initialized.\n */\n ngAfterContentInit(): void {\n setTimeout(() => {\n this.initSlides();\n });\n }\n\n /**\n * Angular lifecycle hook: cleans up subscriptions.\n */\n ngOnDestroy(): void {\n this.destroy$.next(true);\n this.destroy$.unsubscribe();\n }\n\n /**\n * Returns whether the carousel has padding applied (e.g., on desktop breakpoint).\n */\n isPadded(): boolean {\n return this.isDesktopBreakpoint;\n }\n\n /**\n * Checks whether there are enough slides to render controls.\n */\n hasControls(): boolean {\n return this.getSlidesCount() > 1;\n }\n\n /**\n * Retrieves the current active slide index (zero-based).\n */\n getCurrentSlideIndex(): number {\n return this.activeIndex;\n }\n\n /**\n * Returns the 1-based position of the active slide (for the counter).\n */\n getCounterCurrent(): number {\n return this.activeIndex + 1;\n }\n\n /**\n * Returns the total number of slides (for the counter).\n */\n getCounterTotal(): number {\n return this.getSlidesCount();\n }\n\n /**\n * Dot indices for the mobile slider pager (one dot per slide). The dots are\n * hidden on desktop via the ECL CSS (`.ecl-carousel__dots { display: none }`)\n * and shown at the mobile breakpoint.\n */\n getDotIndices(): number[] {\n return Array.from({ length: this.getSlidesCount() }, (_unused, dotIndex) => dotIndex);\n }\n\n /**\n * Pre-translated accessible label for each pager dot. Translated here since\n * the shared `ecl-slider-pager` receives plain strings.\n */\n getDotAriaLabels(): string[] {\n const total = this.getSlidesCount();\n return Array.from({ length: total }, (_unused, dotIndex) =>\n this.translate.instant('ecl.carousel.GO-TO-SLIDE', {\n current: dotIndex + 1,\n total,\n }),\n );\n }\n\n /**\n * Returns whether a teaser button should be visible in the current window.\n */\n isTeaserVisible(index: number): boolean {\n const count = this.getSlidesCount();\n if (count <= VISIBLE_TEASERS) {\n return true;\n }\n const position = ((index - this.teaserWindowStart) % count + count) % count;\n return position < VISIBLE_TEASERS;\n }\n\n /**\n * Returns the flex order of a teaser button within the visible window.\n */\n getTeaserOrder(index: number): number {\n const count = this.getSlidesCount();\n return ((index - this.teaserWindowStart) % count + count) % count;\n }\n\n /**\n * Whether the pager should show the \"pause\" control (i.e. autoplay is\n * actively running). While the pointer/focus hover-pauses the carousel the\n * timer is suspended, so the pager must show \"play\" even though a manual\n * pause was not triggered. Mirrors upstream ECL, where hovering flips the\n * control to play.\n */\n protected isPagerPlaying(): boolean {\n return this.isPlaying() && !this.isHoverPaused();\n }\n\n /**\n * Pager variant by breakpoint. Below the ECL desktop breakpoint (1140px)\n * the carousel shows only the dots navigation (prev / dots / next);\n * play/pause is a desktop-only control in ECL. Rendering `'dots'` there\n * avoids the pager's inline play/pause `display` style (which would\n * otherwise beat the ECL CSS and leave the pause button visible on narrower\n * viewports). At/above 1140px the dots are hidden by CSS, so\n * `'play-pause-dots'` yields play/pause + prev/next + teasers.\n *\n * The 1140px boundary mirrors the media query the ECL CSS uses to toggle\n * `.ecl-carousel__play/__pause` and `.ecl-carousel__teasers`.\n */\n protected pagerVariant(): 'dots' | 'play-pause-dots' {\n return this.isDesktopBreakpointActive() ? 'play-pause-dots' : 'dots';\n }\n\n /**\n * Handles the throttled Embla events the component subscribed to.\n */\n protected onEmblaEvent(event: EmblaEventType): void {\n switch (event) {\n case 'select':\n case 'reInit':\n this.syncFromEmbla();\n break;\n case 'autoplay:timerset':\n // Fired each time the autoplay timer (re)starts for the current\n // slide; replay the loading-bar fill animation from zero.\n this.restartActiveLoadingBar();\n break;\n default:\n break;\n }\n }\n\n /**\n * Starts autoplay.\n *\n * @param moveFocus when true (a user clicked play) focus moves to the pause\n * button. Auto-starts (e.g. on breakpoint changes) pass false so the\n * page is not scrolled to the carousel on load.\n */\n protected onPlayClick(moveFocus = true): void {\n this.getAutoplay()?.play();\n this.isPlaying.set(true);\n this.isPausedForced.set(false);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n if (moveFocus) {\n this.focusPagerButton('.ecl-carousel__pause');\n }\n }\n\n /**\n * Stops autoplay and focuses the play button.\n */\n protected onPauseClick(): void {\n // Pause (not full stop): halt the autoplay timer but keep the active\n // teaser loading bar visible, frozen at its current progress (matching\n // upstream ECL's `handleAutoPlay(false, true)`). The installed\n // embla-carousel-autoplay exposes no `pause()`, so we call `stop()`\n // WITHOUT `reset()` — the frozen bar is driven by our `is-paused` CSS\n // class, not the plugin. A full stop+reset (which clears the bar) only\n // happens on prev/next/teaser navigation via `stopAutoplay()`.\n this.getAutoplay()?.stop();\n this.isPlaying.set(false);\n this.isPausedForced.set(true);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n this.focusPagerButton('.ecl-carousel__play');\n }\n\n /**\n * Navigates to the next slide and stops autoplay.\n */\n protected onNextSlideClick(): void {\n this.stopAutoplay();\n this.embla()?.scrollNext();\n }\n\n /**\n * Navigates to the previous slide and stops autoplay.\n */\n protected onPreviousSlideClick(): void {\n this.stopAutoplay();\n this.embla()?.scrollPrev();\n }\n\n /**\n * Handles user interaction with a teaser button: activates the matching slide.\n */\n protected onTeaserClick(index: number): void {\n this.stopAutoplay();\n this.embla()?.scrollTo(index);\n }\n\n /**\n * Handles a dot activation from the mobile slider pager: scrolls to the\n * matching slide and stops autoplay (same behavior as a teaser click).\n */\n protected onDotClick(index: number): void {\n this.stopAutoplay();\n this.embla()?.scrollTo(index);\n }\n\n /**\n * Handles keyboard navigation (ArrowLeft/ArrowRight) across teaser buttons.\n */\n protected onTeaserKeyboardPress(event: KeyboardEvent, index: number): void {\n if (event.key !== KeyCode.ARROW_RIGHT && event.key !== KeyCode.ARROW_LEFT) {\n return;\n }\n event.preventDefault();\n const direction = event.key === KeyCode.ARROW_RIGHT ? 1 : -1;\n const count = this.getSlidesCount();\n const nextIndex = (index + direction + count) % count;\n this.stopAutoplay();\n this.embla()?.scrollTo(nextIndex);\n this.focusOnButton(this.teaserButtons()[nextIndex]);\n }\n\n /**\n * Freezes the loading bar while the pointer/focus is over the carousel.\n * The Embla autoplay plugin pauses the timer itself (stopOnMouseEnter /\n * stopOnFocusIn); this only mirrors that as a visible paused state.\n */\n protected onViewportPause(): void {\n if (this.isPlaying() && !this.isPausedForced()) {\n this.isHoverPaused.set(true);\n this.cd.detectChanges();\n }\n }\n\n /**\n * Resumes the loading bar once the pointer/focus leaves the carousel.\n */\n protected onViewportResume(): void {\n if (this.isHoverPaused()) {\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n }\n }\n\n /**\n * Sets focus on the specified button.\n */\n private focusOnButton(button: ElementRef): void {\n if (!button) {\n return;\n }\n button.nativeElement.focus();\n }\n\n /**\n * Focuses the slider pager button matching the given ECL class selector\n * (e.g. `.ecl-carousel__play`). Used after a play/pause toggle so focus\n * follows the now-visible control, since the pager swaps play/pause\n * visibility via CSS. No-op if the button is not rendered (e.g. mobile).\n */\n private focusPagerButton(selector: string): void {\n const button = this.hostEl.nativeElement.querySelector<HTMLElement>(selector);\n button?.focus();\n }\n\n /**\n * Returns the Embla autoplay plugin instance, but only when the carousel\n * actually has more than one scroll snap.\n *\n * The `embla-carousel-autoplay` plugin skips its own initialization when\n * `scrollSnapList().length <= 1` (see the plugin's `init`), which leaves its\n * internal `delay` lookup table undefined. Calling `play()` in that state\n * throws (`delay[selectedScrollSnap()]` -> reading `0` of undefined). This\n * happens whenever Embla cannot lay out multiple snaps — notably in a jsdom\n * test or during SSR. Gating on the same `> 1` condition the plugin uses\n * keeps autoplay a safe no-op until the carousel is genuinely slideable.\n */\n private getAutoplay() {\n const api = this.embla()?.emblaApi;\n if (!api || api.scrollSnapList().length <= 1) {\n return undefined;\n }\n return api.plugins()?.autoplay;\n }\n\n /**\n * Whether autoplay should run. On by default (matching ECL); only disabled\n * when the consumer explicitly sets `[isAutoplay]=\"false\"`.\n */\n private isAutoplayDesired(): boolean {\n const isAutoplay = this.isAutoplay();\n return isAutoplay || isAutoplay === undefined;\n }\n\n /**\n * Stops autoplay and resets it (mirrors ECL's `handleAutoPlay(true)`),\n * clearing the loading-bar state.\n */\n private stopAutoplay(): void {\n const autoplay = this.getAutoplay();\n autoplay?.stop();\n autoplay?.reset();\n this.isPlaying.set(false);\n this.isPausedForced.set(false);\n this.isHoverPaused.set(false);\n this.cd.detectChanges();\n }\n\n /**\n * Synchronizes component state from Embla's current selected snap:\n * active index, slide `isCurrent` flags, teaser window and the slide event.\n */\n private syncFromEmbla(): void {\n const api = this.embla()?.emblaApi;\n if (!api) {\n return;\n }\n const selected = api.selectedScrollSnap();\n this.setActiveIndex(selected);\n this.updateTeaserWindow();\n this.slide.emit(new EclSlideEvent(this.slides().at(this.activeIndex)));\n this.cd.detectChanges();\n }\n\n /**\n * Subscribes to RTL layout state changes to adapt carousel direction.\n */\n private handleRtlChangeState(): void {\n this.eclRtlService.currentRtlState$.pipe(takeUntil(this.destroy$)).subscribe((rtlState) => {\n const changed = this.isRtl !== rtlState;\n this.isRtl = rtlState;\n if (changed) {\n this.emblaOptions = {\n ...this.emblaOptions,\n direction: this.isRtl ? 'rtl' : 'ltr',\n };\n this.cd.detectChanges();\n }\n });\n }\n\n /**\n * Initializes slides (index, ARIA label, banner height management).\n */\n private initSlides(): void {\n const slides = this.slides();\n slides.forEach((item, idx) => {\n item.index.set(idx);\n item.ariaLabel.set(`slide ${idx + 1} of ${slides.length}`);\n item.isCurrent.set(idx === 0);\n const banner = item.banner();\n if (banner) {\n banner.skipHeightManagement = true;\n }\n });\n this.cd.detectChanges();\n }\n\n /**\n * Updates the active index and synchronizes slide active/inert state.\n */\n private setActiveIndex(index: number): void {\n this.activeIndex = index;\n this.slides().forEach((item, idx) => {\n item.isCurrent.set(idx === index);\n });\n }\n\n /**\n * Restarts the CSS progress animation on the active slide's loading bar.\n * The animation uses `forwards`, so re-applying the `is-active` class alone\n * will not replay it; the animation must be reset explicitly.\n */\n private restartActiveLoadingBar(): void {\n if (!this.getAutoplay()?.isPlaying()) {\n return;\n }\n const bar = this.loadingBars()[this.activeIndex]?.nativeElement as HTMLElement | undefined;\n if (!bar) {\n return;\n }\n bar.style.animation = 'none';\n // Force reflow so the browser registers the reset before re-enabling.\n void bar.offsetWidth;\n bar.style.animation = '';\n }\n\n /**\n * Advances the visible teaser window when the active slide moves out of it.\n */\n private updateTeaserWindow(): void {\n const count = this.getSlidesCount();\n if (count <= VISIBLE_TEASERS) {\n this.teaserWindowStart = 0;\n return;\n }\n const firstHiddenIndex = (this.teaserWindowStart + VISIBLE_TEASERS) % count;\n if (this.activeIndex === firstHiddenIndex) {\n this.teaserWindowStart = firstHiddenIndex;\n }\n }\n\n /**\n * Returns the number of actual visible slides.\n */\n private getSlidesCount(): number {\n return this.slides()?.length ?? 0;\n }\n\n /**\n * Observes screen breakpoint changes to adjust autoplay and layout behavior.\n */\n private observeBreakpointChanges(): void {\n this.cdkBreakpointObserver\n .observe([\n '(max-width: 768px)',\n '(min-width: 1140px)',\n '(min-width: 1140px) and (max-width: 1260px)',\n ])\n .pipe(takeUntil(this.destroy$))\n .subscribe((result) => {\n this.isMobileBreakpoint.set(result.breakpoints['(max-width: 768px)']);\n this.isLargeBreakpoint = result.breakpoints['(min-width: 1140px)'];\n this.isDesktopBreakpointActive.set(result.breakpoints['(min-width: 1140px)']);\n this.isDesktopBreakpoint = result.breakpoints['(min-width: 1140px) and (max-width: 1260px)'];\n\n // Autoplay is desktop-only (matching upstream ECL): it runs only\n // at/above the desktop breakpoint (xl, 1140px) and is stopped on\n // every smaller viewport, including tablet. Focus is never moved\n // here so the page is not scrolled to the carousel on\n // load/resize.\n if (!this.isLargeBreakpoint) {\n this.stopAutoplay();\n return;\n }\n\n if (this.isAutoplayDesired() && !this.isPausedForced()) {\n this.onPlayClick(false);\n }\n });\n }\n\n /**\n * Observes changes to the carousel's viewport element size using a timeout debounce.\n */\n private observeElementSizeChanges(): void {\n setTimeout(() => {\n if (this.isLargeBreakpoint) {\n this.checkBannerHeights();\n } else {\n this.resetHeight();\n }\n this.embla()?.reInit();\n }, this.TIMEOUT_INTERVAL);\n }\n\n /**\n * Normalizes the height of all banners to match the tallest banner.\n */\n private checkBannerHeights(): void {\n this.slides().forEach((slide) => {\n const banner = slide.banner();\n if (banner) {\n banner.calculateHeight();\n }\n });\n\n const heightValues = this.slides().map((slide) => {\n const el = slide.banner()?.el.nativeElement;\n if (!el) return undefined;\n\n const styleHeight = el.style.height;\n\n if (styleHeight === 'auto' || styleHeight === '') {\n return el.offsetHeight;\n }\n\n const height = parseInt(styleHeight, 10);\n if (Number.isNaN(height) || height === 100) {\n return 1;\n }\n\n return height;\n });\n\n const elementHeights = heightValues.filter((h) => h !== undefined) as number[];\n const tallestElementHeight = Math.max(...elementHeights);\n\n const slides = this.slides();\n if (tallestElementHeight > 1 && elementHeights.length === slides.length) {\n slides.forEach((slide) => {\n const banner = slide.banner();\n if (!banner) return;\n\n const el = banner.el.nativeElement;\n const bannerImage = banner.eclBannerImage();\n const bannerVideo = banner.eclBannerVideo();\n\n this.renderer2.setStyle(el, 'height', `${tallestElementHeight}px`);\n this.renderer2.setStyle(el, 'aspect-ratio', 'auto');\n\n if (bannerImage) {\n this.renderer2.setStyle(bannerImage.el.nativeElement, 'aspect-ratio', 'auto');\n }\n if (bannerVideo) {\n this.renderer2.setStyle(bannerVideo.el.nativeElement, 'aspect-ratio', 'auto');\n }\n });\n }\n }\n\n /**\n * Clears all explicit banner height and aspect ratio styling for smaller breakpoints.\n */\n private resetHeight(): void {\n this.slides().forEach((slide) => {\n const banner = slide.banner();\n if (banner) {\n const bannerImage = banner.eclBannerImage();\n const bannerVideo = banner.eclBannerVideo();\n this.renderer2.removeStyle(banner.el.nativeElement, 'height');\n this.renderer2.removeStyle(banner.el.nativeElement, 'aspect-ratio');\n if (bannerImage) {\n this.renderer2.removeStyle(bannerImage.el.nativeElement, 'aspect-ratio');\n }\n if (bannerVideo) {\n this.renderer2.removeStyle(bannerVideo.el.nativeElement, 'aspect-ratio');\n }\n }\n });\n }\n}\n","@if (hasControls()) {\n<div class=\"ecl-carousel__controls\">\n <div class=\"ecl-container\">\n <div class=\"ecl-carousel__navigation\">\n <div class=\"ecl-carousel__pager-container\">\n <ecl-slider-pager\n class=\"ecl-carousel__pager\"\n [variant]=\"pagerVariant()\"\n size=\"m\"\n [isPlaying]=\"isPagerPlaying()\"\n [activeIndex]=\"getCurrentSlideIndex()\"\n [dotIndices]=\"getDotIndices()\"\n [dotAriaLabels]=\"getDotAriaLabels()\"\n prevExtraClasses=\"ecl-carousel__prev\"\n nextExtraClasses=\"ecl-carousel__next\"\n dotsExtraClasses=\"ecl-carousel__dots\"\n dotExtraClasses=\"ecl-carousel__dot\"\n playExtraClasses=\"ecl-carousel__play\"\n pauseExtraClasses=\"ecl-carousel__pause\"\n (play)=\"onPlayClick()\"\n (pause)=\"onPauseClick()\"\n (prev)=\"onPreviousSlideClick()\"\n (next)=\"onNextSlideClick()\"\n (goTo)=\"onDotClick($event)\">\n </ecl-slider-pager>\n <div class=\"ecl-carousel__counter\" dir=\"ltr\">\n {{ getCounterCurrent() }} {{ ('ecl.common.OF' | translate) }} {{ getCounterTotal() }}\n </div>\n </div>\n\n <div class=\"ecl-carousel__teasers\" role=\"tablist\">\n @for (slide of slides(); let i = $index; track slide) {\n <button #teaserButton type=\"button\" class=\"ecl-carousel__teaser-button\" role=\"tab\"\n [attr.data-ecl-carousel-slide-index]=\"i\"\n [attr.aria-current]=\"i === getCurrentSlideIndex() ? true : null\"\n [attr.tabindex]=\"i === getCurrentSlideIndex() ? null : -1\"\n [style.display]=\"isTeaserVisible(i) ? null : 'none'\"\n [style.pointer-events]=\"isTeaserVisible(i) ? null : 'none'\"\n [style.order]=\"getTeaserOrder(i)\" (click)=\"onTeaserClick(i)\"\n (keydown)=\"onTeaserKeyboardPress($event, i)\">\n <span class=\"ecl-carousel__teaser-loading-bar\" aria-hidden=\"true\"\n [class.is-active]=\"(isPlaying() || isHoverPaused() || isPausedForced()) && i === getCurrentSlideIndex()\"\n [class.is-paused]=\"(isHoverPaused() || isPausedForced()) && i === getCurrentSlideIndex()\">\n <span #loadingBar class=\"ecl-carousel__teaser-loading-bar-completion\"></span>\n </span>\n <span class=\"ecl-carousel__teaser-content\">\n @if (slide.teaserText()) {\n <span class=\"ecl-carousel__teaser-title\">{{ slide.teaserText() }}</span>\n }\n </span>\n </button>\n }\n </div>\n </div>\n </div>\n</div>\n}\n<div #carouselContainer class=\"ecl-carousel__viewport\" [class.ecl-carousel-container--padded]=\"isPadded()\"\n emblaCarousel #embla=\"emblaCarousel\" [options]=\"emblaOptions\" [plugins]=\"emblaPlugins\"\n [subscribeToEvents]=\"emblaEvents\" (emblaChange)=\"onEmblaEvent($event)\"\n (mouseenter)=\"onViewportPause()\" (mouseleave)=\"onViewportResume()\"\n (focusin)=\"onViewportPause()\" (focusout)=\"onViewportResume()\">\n <div class=\"ecl-carousel__slides\">\n <ng-content></ng-content>\n </div>\n</div>\n","import { EclCarouselComponent } from './ecl-carousel.component';\nimport { EclCarouselItemComponent } from './ecl-carousel-item.component';\n\nexport * from './ecl-carousel.component';\nexport * from './ecl-carousel-item.component';\nexport * from './events/ecl-slide.event';\nexport * from './models/ecl-carousel-item.model';\n\nexport const EUI_ECL_CAROUSEL = [\n EclCarouselComponent,\n EclCarouselItemComponent,\n] as const;\n"],"mappings":";;;;;;;;;;;AAQA,IAAa,gBAAb,cAAmC,aAAY;CAI3C,YAAmB,MAAqB;EACpC,MAAK;EADU,KAAA,OAAA;CAEnB;AACH;ACoCD,IAAa,2BAAb,MAAa,iCAAiC,iBAAgB;CArB9D,cAAA;;EAsBI,KAAA,KAAK,OAAO,UAAU;EAKb,KAAA,YAAY,OAA2B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAMjD,KAAA,iBAAiB,MAAM,OAAK;GAAA,GAAA,YAAA,EAAA,WAAA,iBAAA,+BAAA,CAAA;GAAI,OAAO;GAAa,WAAW;EAAgB,CAAA;EAO/E,KAAA,YAAY,mBAAmB,KAAK,eAAc,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAMrD,KAAA,aAAa,MAAc,I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A,CAAA,qBAAmB,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAK3C,iBAAiB,wBAAwB,GAAC,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CA6EjB,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAKR,gBAAc,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAMhB,cAAY,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA;AE1LxE,MAAa,mBAAmB,CAC9B,sBACA,wBACQ"}
|
package/package.json
CHANGED
|
@@ -132,7 +132,6 @@ export declare class EclCarouselComponent extends ECLBaseDirective implements On
|
|
|
132
132
|
* used to restart the progress animation when the active slide changes.
|
|
133
133
|
*/
|
|
134
134
|
private readonly loadingBars;
|
|
135
|
-
private isTabletBreakpoint;
|
|
136
135
|
private isLargeBreakpoint;
|
|
137
136
|
private isDesktopBreakpoint;
|
|
138
137
|
private destroy$;
|