forty-cdk 0.23.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/dialog/README.md +10 -0
  2. package/drawer/README.md +10 -0
  3. package/fesm2022/forty-cdk-avatar.mjs.map +1 -1
  4. package/fesm2022/forty-cdk-carousel.mjs.map +1 -1
  5. package/fesm2022/forty-cdk-combobox.mjs +0 -15
  6. package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
  7. package/fesm2022/forty-cdk-context-menu.mjs +0 -15
  8. package/fesm2022/forty-cdk-context-menu.mjs.map +1 -1
  9. package/fesm2022/forty-cdk-core-overlay.mjs +6 -22
  10. package/fesm2022/forty-cdk-core-overlay.mjs.map +1 -1
  11. package/fesm2022/forty-cdk-core.mjs +0 -15
  12. package/fesm2022/forty-cdk-core.mjs.map +1 -1
  13. package/fesm2022/forty-cdk-date-field.mjs.map +1 -1
  14. package/fesm2022/forty-cdk-date-picker.mjs +0 -8
  15. package/fesm2022/forty-cdk-date-picker.mjs.map +1 -1
  16. package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
  17. package/fesm2022/forty-cdk-hover-card.mjs +13 -3
  18. package/fesm2022/forty-cdk-hover-card.mjs.map +1 -1
  19. package/fesm2022/forty-cdk-listbox.mjs +90 -9
  20. package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
  21. package/fesm2022/forty-cdk-menu.mjs +0 -5
  22. package/fesm2022/forty-cdk-menu.mjs.map +1 -1
  23. package/fesm2022/forty-cdk-menubar.mjs +0 -3
  24. package/fesm2022/forty-cdk-menubar.mjs.map +1 -1
  25. package/fesm2022/forty-cdk-meter.mjs.map +1 -1
  26. package/fesm2022/forty-cdk-navigation-menu.mjs +6 -9
  27. package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -1
  28. package/fesm2022/forty-cdk-number-input.mjs.map +1 -1
  29. package/fesm2022/forty-cdk-popover.mjs +13 -9
  30. package/fesm2022/forty-cdk-popover.mjs.map +1 -1
  31. package/fesm2022/forty-cdk-radio-group.mjs.map +1 -1
  32. package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -1
  33. package/fesm2022/forty-cdk-select.mjs +70 -20
  34. package/fesm2022/forty-cdk-select.mjs.map +1 -1
  35. package/fesm2022/forty-cdk-table.mjs +1 -15
  36. package/fesm2022/forty-cdk-table.mjs.map +1 -1
  37. package/fesm2022/forty-cdk-tabs.mjs +4 -5
  38. package/fesm2022/forty-cdk-tabs.mjs.map +1 -1
  39. package/fesm2022/forty-cdk-time-field.mjs.map +1 -1
  40. package/fesm2022/forty-cdk-time-picker.mjs +75 -11
  41. package/fesm2022/forty-cdk-time-picker.mjs.map +1 -1
  42. package/fesm2022/forty-cdk-toast.mjs +0 -1
  43. package/fesm2022/forty-cdk-toast.mjs.map +1 -1
  44. package/fesm2022/forty-cdk-tooltip.mjs +13 -4
  45. package/fesm2022/forty-cdk-tooltip.mjs.map +1 -1
  46. package/fesm2022/forty-cdk-tree.mjs +0 -5
  47. package/fesm2022/forty-cdk-tree.mjs.map +1 -1
  48. package/hover-card/README.md +2 -0
  49. package/listbox/README.md +19 -7
  50. package/menu/README.md +1 -2
  51. package/menubar/README.md +7 -7
  52. package/navigation-menu/README.md +1 -1
  53. package/package.json +1 -1
  54. package/popover/README.md +2 -0
  55. package/select/README.md +18 -4
  56. package/shared/README.md +61 -0
  57. package/stepper/README.md +12 -0
  58. package/table/README.md +12 -0
  59. package/tabs/README.md +12 -1
  60. package/time-picker/README.md +12 -1
  61. package/tooltip/README.md +2 -0
  62. package/types/forty-cdk-avatar.d.ts +2 -1
  63. package/types/forty-cdk-carousel.d.ts +1 -1
  64. package/types/forty-cdk-combobox.d.ts +23 -35
  65. package/types/forty-cdk-context-menu.d.ts +22 -37
  66. package/types/forty-cdk-core-overlay.d.ts +36 -54
  67. package/types/forty-cdk-core.d.ts +12 -27
  68. package/types/forty-cdk-date-field.d.ts +8 -8
  69. package/types/forty-cdk-date-picker.d.ts +23 -31
  70. package/types/forty-cdk-drag-drop.d.ts +3 -3
  71. package/types/forty-cdk-hover-card.d.ts +26 -6
  72. package/types/forty-cdk-listbox.d.ts +40 -14
  73. package/types/forty-cdk-menu.d.ts +7 -11
  74. package/types/forty-cdk-menubar.d.ts +0 -2
  75. package/types/forty-cdk-meter.d.ts +1 -0
  76. package/types/forty-cdk-navigation-menu.d.ts +7 -9
  77. package/types/forty-cdk-number-input.d.ts +1 -1
  78. package/types/forty-cdk-popover.d.ts +27 -18
  79. package/types/forty-cdk-radio-group.d.ts +1 -1
  80. package/types/forty-cdk-scroll-area.d.ts +2 -1
  81. package/types/forty-cdk-select.d.ts +67 -41
  82. package/types/forty-cdk-table.d.ts +39 -53
  83. package/types/forty-cdk-tabs.d.ts +12 -13
  84. package/types/forty-cdk-time-field.d.ts +4 -4
  85. package/types/forty-cdk-time-picker.d.ts +78 -8
  86. package/types/forty-cdk-toast.d.ts +4 -5
  87. package/types/forty-cdk-tooltip.d.ts +22 -7
  88. package/types/forty-cdk-tree.d.ts +9 -14
package/dialog/README.md CHANGED
@@ -349,6 +349,16 @@ Implements the [WAI-ARIA Modal Dialog pattern](https://www.w3.org/WAI/ARIA/apg/p
349
349
  - `alert: true` interrupts assistive tech aggressively — only for genuine alerts (lost connection, unsaved changes warning), not for general confirms.
350
350
  - Don't put interactive overlays (popovers, menus) outside the focus trap while a modal dialog is open — they won't be reachable. For a non-modal floating surface anchored to a trigger, use `[forPopover]` instead.
351
351
 
352
+ ## Known limitations
353
+
354
+ Two shapes are correct by design and still break something a consumer can only discover by hitting it. Both live in markup a design system produces routinely, and neither shows up in devtools: every role and `aria-*` stays correct, so the symptom is a keyboard or screen-reader one. The library-wide statement, with the same detail for every primitive, is [Shadow DOM](../shared/README.md#shadow-dom) in `forty-cdk/shared`.
355
+
356
+ **A shadow host that renders a focusable after its `<slot>` breaks the trap's `Tab` cycle.** The trap resolves its first / last pair by walking the surface's composed tree, and that walk visits slotted content after the host's whole shadow tree, whereas the browser sequences it at the `<slot>`'s position. Initial focus can land on a control that is not the visually first one, and a `Tab` at the dialog's real last control is not recognised as the cycle's end — focus leaves the surface (with the page `inert`, usually onto the browser's own UI) and the next `Tab` is pulled back to whichever control the walk thinks is first. That is the configuration you are in whenever you wrap a third-party web component, or your own `ViewEncapsulation.ShadowDom` component, inside the dialog. **Workaround:** render a host's own focusables before its `<slot>`, or project them instead of shadowing them; `initialFocus="container"` fixes the initial-focus half only, since the cycle's edges are re-resolved on every `Tab` press. Details and markup: [Focusable order](../shared/README.md#focusable-order-is-composed-only-for-a-host-that-renders-no-slot).
357
+
358
+ **A `keydown` handler inside the dialog that calls `stopPropagation()` swallows Escape.** The dismissible-layer stack observes `Escape` on `document` in the bubble phase — a deliberate trade-off recorded on `DismissibleLayerStack` — so an event stopped inside the surface never arrives, and `Escape` silently stops dismissing while the backdrop click and `[forDialogClose]` keep working. **Workaround:** narrow the `stopPropagation()` to the keys you actually handle. Keeping the dialog open on `Escape` is the separate, supported job of the vetoable `(escapeKeyDown)` output. Details: [Escape is observed on the bubble phase](../shared/README.md#escape-is-observed-on-the-bubble-phase).
359
+
360
+ A third known limit does not apply to this primitive but is easy to hit inside one: a [Tabs](../tabs) or [Stepper](../stepper) panel rendered in a dialog cannot re-measure its focusable content across a shadow boundary, so its own tab stop can go stale — see [that entry](../shared/README.md#a-panels-focusable-content-measurement-does-not-re-measure-across-a-boundary).
361
+
352
362
  ## Styling
353
363
 
354
364
  forty-cdk ships no styles. Add your own class to each piece — the `for*` selectors are the behavior API, not a styling contract (see [Styling forty-cdk](../../../docs/styling.md)). Key your CSS off the reflected `data-*` attributes listed per piece in the [API](#api) section.
package/drawer/README.md CHANGED
@@ -581,6 +581,16 @@ Implements the [WAI-ARIA Modal Dialog pattern](https://www.w3.org/WAI/ARIA/apg/p
581
581
 
582
582
  Keyboard: **Escape** closes the topmost drawer when `dismissible`; **Tab / Shift+Tab** cycles focus inside the drawer when `modal`; **Click** on `[forDrawerBackdrop]` closes when `dismissible`.
583
583
 
584
+ ## Known limitations
585
+
586
+ Two shapes are correct by design and still break something a consumer can only discover by hitting it. Both live in markup a design system produces routinely, and neither shows up in devtools: every role and `aria-*` stays correct, so the symptom is a keyboard or screen-reader one. The library-wide statement, with the same detail for every primitive, is [Shadow DOM](../shared/README.md#shadow-dom) in `forty-cdk/shared`.
587
+
588
+ **A shadow host that renders a focusable after its `<slot>` breaks the trap's `Tab` cycle.** The trap resolves its first / last pair by walking the surface's composed tree, and that walk visits slotted content after the host's whole shadow tree, whereas the browser sequences it at the `<slot>`'s position. Initial focus can land on a control that is not the visually first one, and a `Tab` at the drawer's real last control is not recognised as the cycle's end — focus leaves the surface (with the page `inert`, usually onto the browser's own UI) and the next `Tab` is pulled back to whichever control the walk thinks is first. That is the configuration you are in whenever you wrap a third-party web component, or your own `ViewEncapsulation.ShadowDom` component, inside the drawer. **Workaround:** render a host's own focusables before its `<slot>`, or project them instead of shadowing them; `initialFocus="container"` fixes the initial-focus half only, since the cycle's edges are re-resolved on every `Tab` press. Details and markup: [Focusable order](../shared/README.md#focusable-order-is-composed-only-for-a-host-that-renders-no-slot).
589
+
590
+ **A `keydown` handler inside the drawer that calls `stopPropagation()` swallows Escape.** The dismissible-layer stack observes `Escape` on `document` in the bubble phase — a deliberate trade-off recorded on `DismissibleLayerStack` — so an event stopped inside the surface never arrives, and `Escape` silently stops dismissing while swipe-to-dismiss, the backdrop click and `[forDrawerClose]` keep working. Only the topmost drawer's `Escape` is affected; see [Nested drawers](#nested-drawers) for the stacking contract. **Workaround:** narrow the `stopPropagation()` to the keys you actually handle. Keeping the drawer open on `Escape` is the separate, supported job of the vetoable `(escapeKeyDown)` output. Details: [Escape is observed on the bubble phase](../shared/README.md#escape-is-observed-on-the-bubble-phase).
591
+
592
+ A third known limit does not apply to this primitive but is easy to hit inside one: a [Tabs](../tabs) or [Stepper](../stepper) panel rendered in a drawer cannot re-measure its focusable content across a shadow boundary, so its own tab stop can go stale — see [that entry](../shared/README.md#a-panels-focusable-content-measurement-does-not-re-measure-across-a-boundary).
593
+
584
594
  ## Styling
585
595
 
586
596
  forty-cdk ships no styles. Add your own class to each piece — the `for*` selectors are the behavior API, not a styling contract (see [Styling forty-cdk](../../../docs/styling.md)). Key your CSS off the reflected `data-*` attributes listed per piece in the [API](#api) section.
@@ -1 +1 @@
1
- {"version":3,"file":"forty-cdk-avatar.mjs","sources":["../../../projects/forty-cdk/avatar/src/avatar-context.ts","../../../projects/forty-cdk/avatar/src/avatar-defaults.ts","../../../projects/forty-cdk/avatar/src/avatar.ts","../../../projects/forty-cdk/avatar/src/avatar-image.ts","../../../projects/forty-cdk/avatar/src/avatar-fallback.ts","../../../projects/forty-cdk/avatar/src/forty-cdk-avatar.ts"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport { assertRootContext, orphanContextError } from 'forty-cdk/core';\n\n/**\n * Lifecycle stages of the avatar's image:\n * - `idle`: no `src` set yet.\n * - `loading`: `src` set, waiting for the network.\n * - `loaded`: image rendered successfully.\n * - `error`: image failed to load.\n */\nexport type ForAvatarStatus = 'idle' | 'loading' | 'loaded' | 'error';\n\nexport interface ForAvatarContext {\n /** Current status of the avatar's image. */\n readonly status: Signal<ForAvatarStatus>;\n /**\n * `true` when the consumer should render the fallback. Drives `@if` in\n * the consumer's template. Honors `fallbackDelayMs` for `idle` / `loading`\n * states; `error` flips it to `true` immediately.\n */\n readonly shouldShowFallback: Signal<boolean>;\n}\n\n/**\n * The avatar's piece-coordination surface: the one call `[forAvatarImage]`\n * makes so the root can transition its state machine.\n *\n * Deliberately **not** part of {@link ForAvatarContext} and never exported from\n * `public-api.ts` — a consumer drives the status by binding `[src]`, never by\n * reporting a transition into the root.\n */\nexport interface AvatarPieceContext {\n /** Reported by `[forAvatarImage]` so the root can transition its state machine. */\n reportStatus(status: ForAvatarStatus): void;\n}\n\n/**\n * The avatar's internal coordination surface: everything\n * {@link ForAvatarContext} publishes plus the {@link AvatarPieceContext} call.\n *\n * Never exported from `public-api.ts`. It is the type the pieces read\n * {@link FOR_AVATAR_CONTEXT} at, so a consumer who injects that token gets the\n * read surface while `[forAvatarImage]` gets the transition channel. `ForAvatar`\n * declares `reportStatus` TS-`private`, which keeps it out of the emitted\n * `.d.ts` while `useExisting` still satisfies this contract at runtime.\n */\nexport interface AvatarContext extends ForAvatarContext, AvatarPieceContext {}\n\n/**\n * DI token for the avatar's coordination surface, provided by `[forAvatar]`.\n *\n * Publicly typed as the read surface {@link ForAvatarContext}, which is the whole of\n * what the token promises a consumer. `[forAvatarImage]` reads the same token at an\n * internal type that adds the status-report channel, so a wrapper re-providing it must\n * alias it to the root: `{ provide: FOR_AVATAR_CONTEXT, useExisting: MyAvatar }`, where\n * `MyAvatar` extends `ForAvatar`. A value that merely satisfies the declared type\n * resolves too, and is rejected in dev mode by the first piece to reach the channel.\n */\nexport const FOR_AVATAR_CONTEXT = new InjectionToken<ForAvatarContext>('FOR_AVATAR_CONTEXT');\n\n/**\n * The constant half of both resolvers' {@link assertRootContext} calls, so the\n * fallback and the image state the same requirement.\n */\nconst ROOT_ASSERTION = {\n entryPoint: 'avatar',\n token: 'FOR_AVATAR_CONTEXT',\n root: '[forAvatar]',\n};\n\n/**\n * Injects the nearest {@link ForAvatarContext}, throwing a descriptive error\n * when used outside a `[forAvatar]` element.\n *\n * @param piece Name of the calling directive, used in the error message.\n */\nexport function injectAvatarContext(piece: string): AvatarContext {\n const ctx = inject(FOR_AVATAR_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-AVATAR-001',\n piece,\n root: '[forAvatar]',\n token: 'FOR_AVATAR_CONTEXT',\n });\n }\n const widened = ctx as AvatarContext;\n assertRootContext({\n ...ROOT_ASSERTION,\n piece,\n probe: () => widened.reportStatus,\n });\n return widened;\n}\n\n/**\n * `[forAvatarImage]`'s own resolver. It reports a distinct failure from the rest\n * of the anatomy — the image is the piece that drives the state machine, so an\n * orphaned one silently never transitions — and therefore carries its own code\n * rather than routing through {@link injectAvatarContext}.\n */\nexport function injectAvatarImageContext(): AvatarContext {\n const ctx = inject(FOR_AVATAR_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-AVATAR-002',\n piece: 'ForAvatarImage',\n root: '[forAvatar]',\n token: 'FOR_AVATAR_CONTEXT',\n });\n }\n const widened = ctx as AvatarContext;\n assertRootContext({\n ...ROOT_ASSERTION,\n piece: 'ForAvatarImage',\n probe: () => widened.reportStatus,\n });\n return widened;\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant avatars in the surrounding injector\n * scope. Configure with `provideForAvatarDefaults` either at the\n * application root or in any component's `providers` array; partial\n * overrides merge with the parent scope.\n */\nexport interface ForAvatarDefaults {\n /**\n * Milliseconds to defer the fallback for fast loads, avoiding a brief\n * \"initials → image\" flicker. Set to `0` to show immediately during\n * `idle` / `loading`, or to e.g. `500` to skip rendering during quick\n * cached loads. `error` always shows the fallback immediately.\n */\n fallbackDelayMs: number;\n}\n\n/**\n * Library fallback for avatar defaults, read at the root injector when no\n * consumer has called `provideForAvatarDefaults`. Exported for the shared defaults\n * contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_AVATAR_FALLBACK_DEFAULTS: ForAvatarDefaults = {\n fallbackDelayMs: 0,\n};\n\nconst { token, provideDefaults } = createDefaults<ForAvatarDefaults>(\n 'FOR_AVATAR_DEFAULTS',\n FOR_AVATAR_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved avatar defaults for the current scope. */\nexport const FOR_AVATAR_DEFAULTS = token;\n\n/**\n * Configures forty-cdk avatar defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForAvatarDefaults(defaults: Partial<ForAvatarDefaults> = {}): Provider[] {\n return provideDefaults(defaults);\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n linkedSignal,\n numberAttribute,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\n\nimport { FOR_AVATAR_CONTEXT, type ForAvatarContext, type ForAvatarStatus } from './avatar-context';\nimport { FOR_AVATAR_DEFAULTS } from './avatar-defaults';\n\n/**\n * Headless avatar root. Tracks the load lifecycle of an inner\n * `[forAvatarImage]` and exposes `status` + `shouldShowFallback` so the\n * consumer can swap the image for fallback content (initials, generic icon)\n * via `@if`.\n *\n * No ARIA role is imposed — avatars are typically presentational. If the\n * surrounding component conveys identity (a person's name in the header,\n * a chat bubble), the consumer should provide an `aria-label` on the\n * relevant ancestor or pair the avatar with visible text.\n *\n * @example\n * ```html\n * <span forAvatar #a=\"forAvatar\" fallbackDelayMs=\"500\">\n * <img forAvatarImage [src]=\"user.avatarUrl\" [alt]=\"user.name\" />\n * @if (a.shouldShowFallback()) {\n * <span forAvatarFallback>{{ user.initials }}</span>\n * }\n * </span>\n * ```\n */\n@Directive({\n selector: '[forAvatar]',\n exportAs: 'forAvatar',\n host: {\n '[attr.data-status]': 'status()',\n },\n providers: [{ provide: FOR_AVATAR_CONTEXT, useExisting: ForAvatar }],\n})\nexport class ForAvatar implements ForAvatarContext {\n readonly #defaults = inject(FOR_AVATAR_DEFAULTS);\n\n /**\n * Milliseconds to defer the fallback for fast loads, avoiding a brief\n * \"initials → image\" flicker. Set to `0` (default) to show immediately\n * during `idle` / `loading`, or to e.g. `500` to skip rendering during\n * quick cached loads. `error` always shows the fallback immediately.\n * The default is read from `provideForAvatarDefaults` for the\n * surrounding scope.\n */\n readonly fallbackDelayMs = input(this.#defaults.fallbackDelayMs, {\n transform: (value: unknown) => {\n const parsed = numberAttribute(value);\n return Number.isFinite(parsed) ? parsed : this.#defaults.fallbackDelayMs;\n },\n });\n\n readonly #status = signal<ForAvatarStatus>('idle');\n readonly status = this.#status.asReadonly();\n\n // Whether the deferred-fallback timer has fired for the current status/delay.\n // `linkedSignal` resets it to `false` whenever the source changes (the\n // canonical replacement for resetting state inside an effect); the timer\n // callback in the constructor flips it to `true`.\n readonly #timerElapsed = linkedSignal<{ status: ForAvatarStatus; delay: number }, boolean>({\n source: () => ({ status: this.#status(), delay: this.fallbackDelayMs() }),\n computation: () => false,\n });\n #timer: ReturnType<typeof setTimeout> | null = null;\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n readonly shouldShowFallback = computed(() => {\n const status = this.#status();\n if (status === 'loaded') return false;\n if (status === 'error') return true;\n // idle | loading: an immediate (delay <= 0) gate shows the fallback right\n // away; a deferred gate waits for the timer armed in the effect below.\n if (this.fallbackDelayMs() <= 0) return true;\n return this.#timerElapsed();\n });\n\n private reportStatus(status: ForAvatarStatus): void {\n this.#status.set(status);\n }\n\n constructor() {\n // Imperative timer integration: the effect's only job is to (re)arm a\n // setTimeout for the deferred-fallback case (idle | loading with a positive\n // delay). The synchronous branches (loaded / error / delay <= 0) are pure\n // derivations and live in `shouldShowFallback`. The signal write happens\n // inside the timer callback, which runs outside the effect's reactive\n // scope, so this does NOT create a self-cycle in the reactive graph.\n effect(() => {\n const status = this.#status();\n const delay = this.fallbackDelayMs();\n this.#cancelTimer();\n if (this.#isBrowser && (status === 'idle' || status === 'loading') && delay > 0) {\n this.#timer = setTimeout(() => {\n this.#timer = null;\n this.#timerElapsed.set(true);\n }, delay);\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.#cancelTimer());\n }\n\n #cancelTimer(): void {\n if (this.#timer !== null) {\n clearTimeout(this.#timer);\n this.#timer = null;\n }\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n output,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { type ForAvatarStatus, injectAvatarImageContext } from './avatar-context';\n\n/**\n * Wraps an `<img>` and reports its load lifecycle to the surrounding\n * `[forAvatar]`. The native `src` / `alt` bindings are owned by the\n * consumer — this directive only observes.\n *\n * Reflects `data-status` on the image element so the consumer can hide it\n * via CSS while loading or after an error (e.g. `img[data-status=\"error\"]\n * { display: none }`).\n */\n@Directive({\n selector: 'img[forAvatarImage]',\n exportAs: 'forAvatarImage',\n host: {\n '[attr.data-status]': 'status()',\n '(load)': 'onLoad()',\n '(error)': 'onError()',\n },\n})\nexport class ForAvatarImage {\n readonly #host = inject<ElementRef<HTMLImageElement>>(ElementRef).nativeElement;\n readonly #parent = injectAvatarImageContext();\n\n /**\n * Emits whenever the image lifecycle transitions to a new state. Useful\n * if the consumer wants to log analytics, swap to a different src on\n * error, etc.\n */\n readonly loadStatusChange = output<ForAvatarStatus>();\n\n constructor() {\n const parent = this.#parent;\n const host = this.#host;\n\n let destroyed = false;\n inject(DestroyRef).onDestroy(() => (destroyed = true));\n\n afterNextRender(() => {\n this.#syncFromAttr();\n });\n\n if (isPlatformBrowser(inject(PLATFORM_ID)) && typeof MutationObserver !== 'undefined') {\n const observer = new MutationObserver(() => {\n this.#syncFromAttr();\n });\n observer.observe(host, { attributes: true, attributeFilter: ['src'] });\n inject(DestroyRef).onDestroy(() => observer.disconnect());\n }\n\n // Re-emit upstream whenever the parent's status changes due to our writes.\n // De-dupe on the (request, status) pair rather than status alone: a new\n // `src` opens a fresh request token, so an identical status (e.g. a second\n // image that also `loaded`) still re-reports for the new request, while a\n // repeated status within the same request is suppressed.\n let last: ForAvatarStatus | null = null;\n let lastReportedToken = -1;\n const emit = (status: ForAvatarStatus): void => {\n if (destroyed) return;\n if (last === status && lastReportedToken === this.#requestToken) return;\n last = status;\n lastReportedToken = this.#requestToken;\n parent.reportStatus(status);\n this.loadStatusChange.emit(status);\n };\n this.#emit = emit;\n }\n\n protected status(): ForAvatarStatus {\n return this.#parent.status();\n }\n\n protected onLoad(): void {\n // Ignore a `load` that fires for a request the host has already moved past\n // (the native event can arrive after `src` was reassigned).\n if (!this.#isCurrentRequest()) return;\n if (!this.#host.complete) return;\n this.#emit('loaded');\n }\n\n protected onError(): void {\n if (!this.#isCurrentRequest()) return;\n if (!this.#host.complete) return;\n this.#emit('error');\n }\n\n /**\n * Cheap string-identity fast-path: true when the `src` the host currently\n * carries is the one the latest `#syncFromAttr` observed, so a native\n * load/error event has not drifted away from the in-flight request. This\n * proves src-attribute stability only; request *completeness* (a late event\n * from a superseded resource that happens to share the current src) is\n * verified separately in onLoad/onError via `this.#host.complete`.\n */\n #isCurrentRequest(): boolean {\n return this.#host.getAttribute('src') === this.#requestSrc;\n }\n\n #syncFromAttr(): void {\n const src = this.#host.getAttribute('src');\n this.#requestToken++;\n this.#requestSrc = src;\n if (!src) {\n this.#emit('idle');\n return;\n }\n if (this.#host.complete) {\n // Cached image: load/error events may not fire — derive from naturalWidth.\n if (this.#host.naturalWidth > 0) {\n this.#emit('loaded');\n return;\n }\n // A complete image with zero intrinsic width is ambiguous: it may be a\n // broken image OR a valid SVG with no intrinsic dimensions. Don't\n // pessimistically flag `error` and hide a valid image — verify with\n // `decode()`, which resolves for a decodable (even zero-size) image and\n // rejects for a broken one. Stay `loading` until it settles.\n this.#emit('loading');\n this.#verifyCachedZeroSize(src);\n return;\n }\n this.#emit('loading');\n }\n\n #verifyCachedZeroSize(src: string): void {\n const decode = this.#host.decode?.bind(this.#host);\n if (!decode) {\n // No `decode()` (older engines / jsdom): keep the legacy heuristic.\n this.#emit('error');\n return;\n }\n decode().then(\n () => {\n if (this.#host.getAttribute('src') === src) {\n this.#emit('loaded');\n }\n },\n () => {\n if (this.#host.getAttribute('src') === src) {\n this.#emit('error');\n }\n },\n );\n }\n\n // Initialized in constructor.\n #emit!: (status: ForAvatarStatus) => void;\n\n /** Monotonic id bumped on every `src` change so stale events are ignored. */\n #requestToken = 0;\n /** The `src` the latest `#syncFromAttr` observed, used to match native events. */\n #requestSrc: string | null = null;\n}\n","import { Directive } from '@angular/core';\n\nimport { injectAvatarContext } from './avatar-context';\n\n/**\n * Marker for the avatar's fallback content (initials, generic icon, …).\n * Reflects `data-status` from the parent `[forAvatar]` so the consumer can\n * style for the `error` state separately from `idle` / `loading` if needed.\n *\n * The decision of *whether* to render the fallback lives on the root —\n * drive `@if` with `forAvatar.shouldShowFallback()`.\n */\n@Directive({\n selector: '[forAvatarFallback]',\n exportAs: 'forAvatarFallback',\n host: {\n '[attr.data-status]': 'parent.status()',\n },\n})\nexport class ForAvatarFallback {\n protected readonly parent = injectAvatarContext('ForAvatarFallback');\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAiDA;;;;;;;;;AASG;MACU,kBAAkB,GAAG,IAAI,cAAc,CAAmB,oBAAoB;AAE3F;;;AAGG;AACH,MAAM,cAAc,GAAG;AACrB,IAAA,UAAU,EAAE,QAAQ;AACpB,IAAA,KAAK,EAAE,oBAAoB;AAC3B,IAAA,IAAI,EAAE,aAAa;CACpB;AAED;;;;;AAKG;AACG,SAAU,mBAAmB,CAAC,KAAa,EAAA;AAC/C,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1D,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,kBAAkB,CAAC;AACvB,YAAA,IAAI,EAAE,mBAAmB;YACzB,KAAK;AACL,YAAA,IAAI,EAAE,aAAa;AACnB,YAAA,KAAK,EAAE,oBAAoB;AAC5B,SAAA,CAAC;IACJ;IACA,MAAM,OAAO,GAAG,GAAoB;AACpC,IAAA,iBAAiB,CAAC;AAChB,QAAA,GAAG,cAAc;QACjB,KAAK;AACL,QAAA,KAAK,EAAE,MAAM,OAAO,CAAC,YAAY;AAClC,KAAA,CAAC;AACF,IAAA,OAAO,OAAO;AAChB;AAEA;;;;;AAKG;SACa,wBAAwB,GAAA;AACtC,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1D,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,kBAAkB,CAAC;AACvB,YAAA,IAAI,EAAE,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,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAT1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE;AACJ,wBAAA,oBAAoB,EAAE,UAAU;AAChC,wBAAA,QAAQ,EAAE,UAAU;AACpB,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACF,iBAAA;;;AC1BD;;;;;;;AAOG;MAQU,iBAAiB,CAAA;AACT,IAAA,MAAM,GAAG,mBAAmB,CAAC,mBAAmB,CAAC;uGADzD,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAP7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,IAAI,EAAE;AACJ,wBAAA,oBAAoB,EAAE,iBAAiB;AACxC,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;;;;"}
1
+ {"version":3,"file":"forty-cdk-avatar.mjs","sources":["../../../projects/forty-cdk/avatar/src/avatar-context.ts","../../../projects/forty-cdk/avatar/src/avatar-defaults.ts","../../../projects/forty-cdk/avatar/src/avatar.ts","../../../projects/forty-cdk/avatar/src/avatar-image.ts","../../../projects/forty-cdk/avatar/src/avatar-fallback.ts","../../../projects/forty-cdk/avatar/src/forty-cdk-avatar.ts"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport { assertRootContext, orphanContextError } from 'forty-cdk/core';\n\n/**\n * Lifecycle stages of the avatar's image:\n * - `idle`: no `src` set yet.\n * - `loading`: `src` set, waiting for the network.\n * - `loaded`: image rendered successfully.\n * - `error`: image failed to load.\n */\nexport type ForAvatarStatus = 'idle' | 'loading' | 'loaded' | 'error';\n\n/** Read surface `[forAvatar]` publishes through {@link FOR_AVATAR_CONTEXT}. */\nexport interface ForAvatarContext {\n /** Current status of the avatar's image. */\n readonly status: Signal<ForAvatarStatus>;\n /**\n * `true` when the consumer should render the fallback. Drives `@if` in\n * the consumer's template. Honors `fallbackDelayMs` for `idle` / `loading`\n * states; `error` flips it to `true` immediately.\n */\n readonly shouldShowFallback: Signal<boolean>;\n}\n\n/**\n * The avatar's piece-coordination surface: the one call `[forAvatarImage]`\n * makes so the root can transition its state machine.\n *\n * **Not** part of {@link ForAvatarContext} and never exported from\n * `public-api.ts` — a consumer drives the status by binding `[src]`, never by\n * reporting a transition into the root.\n */\nexport interface AvatarPieceContext {\n /** Reported by `[forAvatarImage]` so the root can transition its state machine. */\n reportStatus(status: ForAvatarStatus): void;\n}\n\n/**\n * The avatar's internal coordination surface: everything\n * {@link ForAvatarContext} publishes plus the {@link AvatarPieceContext} call.\n *\n * Never exported from `public-api.ts`. It is the type the pieces read\n * {@link FOR_AVATAR_CONTEXT} at, so a consumer who injects that token gets the\n * read surface while `[forAvatarImage]` gets the transition channel. `ForAvatar`\n * declares `reportStatus` TS-`private`, which keeps it out of the emitted\n * `.d.ts` while `useExisting` still satisfies this contract at runtime.\n */\nexport interface AvatarContext extends ForAvatarContext, AvatarPieceContext {}\n\n/**\n * DI token for the avatar's coordination surface, provided by `[forAvatar]`.\n *\n * Publicly typed as the read surface {@link ForAvatarContext}, which is the whole of\n * what the token promises a consumer. `[forAvatarImage]` reads the same token at an\n * internal type that adds the status-report channel, so a wrapper re-providing it must\n * alias it to the root: `{ provide: FOR_AVATAR_CONTEXT, useExisting: MyAvatar }`, where\n * `MyAvatar` extends `ForAvatar`. A value that merely satisfies the declared type\n * resolves too, and is rejected in dev mode by the first piece to reach the channel.\n */\nexport const FOR_AVATAR_CONTEXT = new InjectionToken<ForAvatarContext>('FOR_AVATAR_CONTEXT');\n\n/**\n * The constant half of both resolvers' {@link assertRootContext} calls, so the\n * fallback and the image state the same requirement.\n */\nconst ROOT_ASSERTION = {\n entryPoint: 'avatar',\n token: 'FOR_AVATAR_CONTEXT',\n root: '[forAvatar]',\n};\n\n/**\n * Injects the nearest {@link ForAvatarContext}, throwing a descriptive error\n * when used outside a `[forAvatar]` element.\n *\n * @param piece Name of the calling directive, used in the error message.\n */\nexport function injectAvatarContext(piece: string): AvatarContext {\n const ctx = inject(FOR_AVATAR_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-AVATAR-001',\n piece,\n root: '[forAvatar]',\n token: 'FOR_AVATAR_CONTEXT',\n });\n }\n const widened = ctx as AvatarContext;\n assertRootContext({\n ...ROOT_ASSERTION,\n piece,\n probe: () => widened.reportStatus,\n });\n return widened;\n}\n\n/**\n * `[forAvatarImage]`'s own resolver. It reports a distinct failure from the rest\n * of the anatomy — the image is the piece that drives the state machine, so an\n * orphaned one silently never transitions — and therefore carries its own code\n * rather than routing through {@link injectAvatarContext}.\n */\nexport function injectAvatarImageContext(): AvatarContext {\n const ctx = inject(FOR_AVATAR_CONTEXT, { optional: true });\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-AVATAR-002',\n piece: 'ForAvatarImage',\n root: '[forAvatar]',\n token: 'FOR_AVATAR_CONTEXT',\n });\n }\n const widened = ctx as AvatarContext;\n assertRootContext({\n ...ROOT_ASSERTION,\n piece: 'ForAvatarImage',\n probe: () => widened.reportStatus,\n });\n return widened;\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant avatars in the surrounding injector\n * scope. Configure with `provideForAvatarDefaults` either at the\n * application root or in any component's `providers` array; partial\n * overrides merge with the parent scope.\n */\nexport interface ForAvatarDefaults {\n /**\n * Milliseconds to defer the fallback for fast loads, avoiding a brief\n * \"initials → image\" flicker. Set to `0` to show immediately during\n * `idle` / `loading`, or to e.g. `500` to skip rendering during quick\n * cached loads. `error` always shows the fallback immediately.\n */\n fallbackDelayMs: number;\n}\n\n/**\n * Library fallback for avatar defaults, read at the root injector when no\n * consumer has called `provideForAvatarDefaults`. Exported for the shared defaults\n * contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_AVATAR_FALLBACK_DEFAULTS: ForAvatarDefaults = {\n fallbackDelayMs: 0,\n};\n\nconst { token, provideDefaults } = createDefaults<ForAvatarDefaults>(\n 'FOR_AVATAR_DEFAULTS',\n FOR_AVATAR_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved avatar defaults for the current scope. */\nexport const FOR_AVATAR_DEFAULTS = token;\n\n/**\n * Configures forty-cdk avatar defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForAvatarDefaults(defaults: Partial<ForAvatarDefaults> = {}): Provider[] {\n return provideDefaults(defaults);\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n linkedSignal,\n numberAttribute,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\n\nimport { FOR_AVATAR_CONTEXT, type ForAvatarContext, type ForAvatarStatus } from './avatar-context';\nimport { FOR_AVATAR_DEFAULTS } from './avatar-defaults';\n\n/**\n * Headless avatar root. Tracks the load lifecycle of an inner\n * `[forAvatarImage]` and exposes `status` + `shouldShowFallback` so the\n * consumer can swap the image for fallback content (initials, generic icon)\n * via `@if`.\n *\n * No ARIA role is imposed — avatars are typically presentational. If the\n * surrounding component conveys identity (a person's name in the header,\n * a chat bubble), the consumer should provide an `aria-label` on the\n * relevant ancestor or pair the avatar with visible text.\n *\n * @example\n * ```html\n * <span forAvatar #a=\"forAvatar\" fallbackDelayMs=\"500\">\n * <img forAvatarImage [src]=\"user.avatarUrl\" [alt]=\"user.name\" />\n * @if (a.shouldShowFallback()) {\n * <span forAvatarFallback>{{ user.initials }}</span>\n * }\n * </span>\n * ```\n */\n@Directive({\n selector: '[forAvatar]',\n exportAs: 'forAvatar',\n host: {\n '[attr.data-status]': 'status()',\n },\n providers: [{ provide: FOR_AVATAR_CONTEXT, useExisting: ForAvatar }],\n})\nexport class ForAvatar implements ForAvatarContext {\n readonly #defaults = inject(FOR_AVATAR_DEFAULTS);\n\n /**\n * Milliseconds to defer the fallback for fast loads, avoiding a brief\n * \"initials → image\" flicker. Set to `0` (default) to show immediately\n * during `idle` / `loading`, or to e.g. `500` to skip rendering during\n * quick cached loads. `error` always shows the fallback immediately.\n * The default is read from `provideForAvatarDefaults` for the\n * surrounding scope.\n */\n readonly fallbackDelayMs = input(this.#defaults.fallbackDelayMs, {\n transform: (value: unknown) => {\n const parsed = numberAttribute(value);\n return Number.isFinite(parsed) ? parsed : this.#defaults.fallbackDelayMs;\n },\n });\n\n readonly #status = signal<ForAvatarStatus>('idle');\n readonly status = this.#status.asReadonly();\n\n // Whether the deferred-fallback timer has fired for the current status/delay.\n // `linkedSignal` resets it to `false` whenever the source changes (the\n // canonical replacement for resetting state inside an effect); the timer\n // callback in the constructor flips it to `true`.\n readonly #timerElapsed = linkedSignal<{ status: ForAvatarStatus; delay: number }, boolean>({\n source: () => ({ status: this.#status(), delay: this.fallbackDelayMs() }),\n computation: () => false,\n });\n #timer: ReturnType<typeof setTimeout> | null = null;\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n readonly shouldShowFallback = computed(() => {\n const status = this.#status();\n if (status === 'loaded') return false;\n if (status === 'error') return true;\n // idle | loading: an immediate (delay <= 0) gate shows the fallback right\n // away; a deferred gate waits for the timer armed in the effect below.\n if (this.fallbackDelayMs() <= 0) return true;\n return this.#timerElapsed();\n });\n\n private reportStatus(status: ForAvatarStatus): void {\n this.#status.set(status);\n }\n\n constructor() {\n // Imperative timer integration: the effect's only job is to (re)arm a\n // setTimeout for the deferred-fallback case (idle | loading with a positive\n // delay). The synchronous branches (loaded / error / delay <= 0) are pure\n // derivations and live in `shouldShowFallback`. The signal write happens\n // inside the timer callback, which runs outside the effect's reactive\n // scope, so this does NOT create a self-cycle in the reactive graph.\n effect(() => {\n const status = this.#status();\n const delay = this.fallbackDelayMs();\n this.#cancelTimer();\n if (this.#isBrowser && (status === 'idle' || status === 'loading') && delay > 0) {\n this.#timer = setTimeout(() => {\n this.#timer = null;\n this.#timerElapsed.set(true);\n }, delay);\n }\n });\n\n inject(DestroyRef).onDestroy(() => this.#cancelTimer());\n }\n\n #cancelTimer(): void {\n if (this.#timer !== null) {\n clearTimeout(this.#timer);\n this.#timer = null;\n }\n }\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n output,\n PLATFORM_ID,\n} from '@angular/core';\n\nimport { type ForAvatarStatus, injectAvatarImageContext } from './avatar-context';\n\n/**\n * Wraps an `<img>` and reports its load lifecycle to the surrounding\n * `[forAvatar]`. The native `src` / `alt` bindings are owned by the\n * consumer — this directive only observes.\n *\n * Reflects `data-status` on the image element so the consumer can hide it\n * via CSS while loading or after an error (e.g. `img[data-status=\"error\"]\n * { display: none }`).\n */\n@Directive({\n selector: 'img[forAvatarImage]',\n exportAs: 'forAvatarImage',\n host: {\n '[attr.data-status]': 'status()',\n '(load)': 'onLoad()',\n '(error)': 'onError()',\n },\n})\nexport class ForAvatarImage {\n readonly #host = inject<ElementRef<HTMLImageElement>>(ElementRef).nativeElement;\n readonly #parent = injectAvatarImageContext();\n\n /**\n * Emits whenever the image lifecycle transitions to a new state. Useful\n * if the consumer wants to log analytics, swap to a different src on\n * error, etc.\n */\n readonly loadStatusChange = output<ForAvatarStatus>();\n\n constructor() {\n const parent = this.#parent;\n const host = this.#host;\n\n let destroyed = false;\n inject(DestroyRef).onDestroy(() => (destroyed = true));\n\n afterNextRender(() => {\n this.#syncFromAttr();\n });\n\n if (isPlatformBrowser(inject(PLATFORM_ID)) && typeof MutationObserver !== 'undefined') {\n const observer = new MutationObserver(() => {\n this.#syncFromAttr();\n });\n observer.observe(host, { attributes: true, attributeFilter: ['src'] });\n inject(DestroyRef).onDestroy(() => observer.disconnect());\n }\n\n // Re-emit upstream whenever the parent's status changes due to our writes.\n // De-dupe on the (request, status) pair rather than status alone: a new\n // `src` opens a fresh request token, so an identical status (e.g. a second\n // image that also `loaded`) still re-reports for the new request, while a\n // repeated status within the same request is suppressed.\n let last: ForAvatarStatus | null = null;\n let lastReportedToken = -1;\n const emit = (status: ForAvatarStatus): void => {\n if (destroyed) return;\n if (last === status && lastReportedToken === this.#requestToken) return;\n last = status;\n lastReportedToken = this.#requestToken;\n parent.reportStatus(status);\n this.loadStatusChange.emit(status);\n };\n this.#emit = emit;\n }\n\n protected status(): ForAvatarStatus {\n return this.#parent.status();\n }\n\n protected onLoad(): void {\n // Ignore a `load` that fires for a request the host has already moved past\n // (the native event can arrive after `src` was reassigned).\n if (!this.#isCurrentRequest()) return;\n if (!this.#host.complete) return;\n this.#emit('loaded');\n }\n\n protected onError(): void {\n if (!this.#isCurrentRequest()) return;\n if (!this.#host.complete) return;\n this.#emit('error');\n }\n\n /**\n * Cheap string-identity fast-path: true when the `src` the host currently\n * carries is the one the latest `#syncFromAttr` observed, so a native\n * load/error event has not drifted away from the in-flight request. This\n * proves src-attribute stability only; request *completeness* (a late event\n * from a superseded resource that happens to share the current src) is\n * verified separately in onLoad/onError via `this.#host.complete`.\n */\n #isCurrentRequest(): boolean {\n return this.#host.getAttribute('src') === this.#requestSrc;\n }\n\n #syncFromAttr(): void {\n const src = this.#host.getAttribute('src');\n this.#requestToken++;\n this.#requestSrc = src;\n if (!src) {\n this.#emit('idle');\n return;\n }\n if (this.#host.complete) {\n // Cached image: load/error events may not fire — derive from naturalWidth.\n if (this.#host.naturalWidth > 0) {\n this.#emit('loaded');\n return;\n }\n // A complete image with zero intrinsic width is ambiguous: it may be a\n // broken image OR a valid SVG with no intrinsic dimensions. Don't\n // pessimistically flag `error` and hide a valid image — verify with\n // `decode()`, which resolves for a decodable (even zero-size) image and\n // rejects for a broken one. Stay `loading` until it settles.\n this.#emit('loading');\n this.#verifyCachedZeroSize(src);\n return;\n }\n this.#emit('loading');\n }\n\n #verifyCachedZeroSize(src: string): void {\n const decode = this.#host.decode?.bind(this.#host);\n if (!decode) {\n // No `decode()` (older engines / jsdom): keep the legacy heuristic.\n this.#emit('error');\n return;\n }\n decode().then(\n () => {\n if (this.#host.getAttribute('src') === src) {\n this.#emit('loaded');\n }\n },\n () => {\n if (this.#host.getAttribute('src') === src) {\n this.#emit('error');\n }\n },\n );\n }\n\n // Initialized in constructor.\n #emit!: (status: ForAvatarStatus) => void;\n\n /** Monotonic id bumped on every `src` change so stale events are ignored. */\n #requestToken = 0;\n /** The `src` the latest `#syncFromAttr` observed, used to match native events. */\n #requestSrc: string | null = null;\n}\n","import { Directive } from '@angular/core';\n\nimport { injectAvatarContext } from './avatar-context';\n\n/**\n * Marker for the avatar's fallback content (initials, generic icon, …).\n * Reflects `data-status` from the parent `[forAvatar]` so the consumer can\n * style for the `error` state separately from `idle` / `loading` if needed.\n *\n * The decision of *whether* to render the fallback lives on the root —\n * drive `@if` with `forAvatar.shouldShowFallback()`.\n */\n@Directive({\n selector: '[forAvatarFallback]',\n exportAs: 'forAvatarFallback',\n host: {\n '[attr.data-status]': 'parent.status()',\n },\n})\nexport class ForAvatarFallback {\n protected readonly parent = injectAvatarContext('ForAvatarFallback');\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAkDA;;;;;;;;;AASG;MACU,kBAAkB,GAAG,IAAI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,EAAE,UAAU;AACpB,wBAAA,SAAS,EAAE,WAAW;AACvB,qBAAA;AACF,iBAAA;;;AC1BD;;;;;;;AAOG;MAQU,iBAAiB,CAAA;AACT,IAAA,MAAM,GAAG,mBAAmB,CAAC,mBAAmB,CAAC;uGADzD,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,kBAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAP7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,IAAI,EAAE;AACJ,wBAAA,oBAAoB,EAAE,iBAAiB;AACxC,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"forty-cdk-carousel.mjs","sources":["../../../projects/forty-cdk/carousel/src/carousel-context.ts","../../../projects/forty-cdk/carousel/src/carousel-defaults.ts","../../../projects/forty-cdk/carousel/src/carousel.ts","../../../projects/forty-cdk/carousel/src/carousel-viewport.ts","../../../projects/forty-cdk/carousel/src/carousel-track.ts","../../../projects/forty-cdk/carousel/src/carousel-slide.ts","../../../projects/forty-cdk/carousel/src/carousel-previous.ts","../../../projects/forty-cdk/carousel/src/carousel-next.ts","../../../projects/forty-cdk/carousel/src/carousel-indicators.ts","../../../projects/forty-cdk/carousel/src/carousel-indicator.ts","../../../projects/forty-cdk/carousel/src/carousel-rotation-control.ts","../../../projects/forty-cdk/carousel/src/carousel-drag.ts","../../../projects/forty-cdk/carousel/src/forty-cdk-carousel.ts"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport {\n assertRootContext,\n type ListNavigationAction,\n orphanContextError,\n type RovingTabindex,\n type WritingDirection,\n} from 'forty-cdk/core';\n\n/** Alignment of the active slide within the viewport. */\nexport type CarouselAlign = 'start' | 'center' | 'end';\n\n/**\n * Internal handle for a registered slide. Part of the registration protocol, so\n * it is never exported from `public-api.ts` — see {@link CarouselContext}.\n */\nexport interface ForCarouselSlideHandle {\n readonly host: HTMLElement;\n}\n\n/**\n * Internal handle for a registered indicator (dot). Part of the registration\n * protocol, so it is never exported from `public-api.ts` — see\n * {@link CarouselContext}.\n */\nexport interface ForCarouselIndicatorHandle {\n readonly host: HTMLElement;\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Internal handle for the registered viewport. Part of the registration\n * protocol, so it is never exported from `public-api.ts` — see\n * {@link CarouselContext}.\n */\nexport interface ForCarouselViewportHandle {\n readonly host: HTMLElement;\n readonly id: string;\n}\n\n/**\n * Coordination contract owned by `ForCarousel`. Slides and indicators\n * register with the root so index lookups, geometry computations, and\n * keyboard navigation are all driven from a single source of truth.\n */\nexport interface ForCarouselContext {\n readonly activeIndex: Signal<number>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n readonly dir: Signal<WritingDirection>;\n readonly loop: Signal<boolean>;\n readonly align: Signal<CarouselAlign>;\n readonly slidesPerView: Signal<number>;\n readonly slideCount: Signal<number>;\n\n /** Whether auto-rotation is currently \"on\" (user intent). Drives the rotation control's label. */\n readonly playing: Signal<boolean>;\n /** Whether the carousel is actively auto-rotating right now (`playing && !paused`). Drives the viewport's `aria-live`. */\n readonly rotating: Signal<boolean>;\n\n canScrollPrev(): boolean;\n canScrollNext(): boolean;\n scrollPrev(): void;\n scrollNext(): void;\n scrollTo(index: number): void;\n\n /** Toggle auto-rotation on/off (the explicit, sticky user choice). Called by the rotation control. */\n toggleAutoplay(): void;\n\n isCurrent(index: number): boolean;\n isFirstEnabledIndicator(el: HTMLElement): boolean;\n hasCurrentIndicator(): boolean;\n}\n\n/**\n * The carousel's piece-coordination surface: the roving tracker the indicators\n * share, the DOM-order index lookups, the viewport id the rotation control\n * points `aria-controls` at, and the localizable positional labels.\n *\n * Deliberately **not** part of {@link ForCarouselContext} and never exported\n * from `public-api.ts` — a consumer drives the carousel through `scrollTo` /\n * `scrollNext`, never through the indicators' shared tab stop.\n */\nexport interface CarouselPieceContext {\n readonly roving: RovingTabindex;\n\n navigate(currentIndicator: HTMLElement, action: ListNavigationAction): void;\n\n viewportId(): string | null;\n\n indexOfSlide(host: HTMLElement): number;\n indexOfIndicator(host: HTMLElement): number;\n\n /** Resolve the positional slide `aria-label` (`\"N of M\"` by default). `position` is 1-based. */\n slideLabel(position: number): string;\n /** Resolve the indicator `aria-label` (`\"Go to slide N\"` by default). `position` is 1-based. */\n indicatorLabel(position: number): string;\n\n isInView(index: number): boolean;\n}\n\n/**\n * DI token providing the carousel context to descendant pieces.\n *\n * Publicly typed as the read surface {@link ForCarouselContext}, which is the whole of\n * what the token promises a consumer. The pieces read the same token at an internal type\n * that adds the slide / indicator / viewport registration protocol, so a wrapper\n * re-providing it must alias it to the root: `{ provide: FOR_CAROUSEL_CONTEXT,\n * useExisting: MyCarousel }`, where `MyCarousel` extends `ForCarousel`. A value that\n * merely satisfies the declared type resolves too, and is rejected in dev mode by the\n * first piece to reach the protocol.\n */\nexport const FOR_CAROUSEL_CONTEXT = new InjectionToken<ForCarouselContext>('FOR_CAROUSEL_CONTEXT');\n\n/**\n * The carousel's internal coordination surface: everything\n * {@link ForCarouselContext} publishes plus the {@link CarouselPieceContext}\n * members and the slide / indicator / viewport registration protocol the index\n * lookups, geometry observer and roving tabindex are driven from.\n *\n * Never exported from `public-api.ts`. It is the type the pieces read\n * {@link FOR_CAROUSEL_CONTEXT} at, so a consumer who injects that token gets the\n * read surface while the pieces get the wiring protocol. `ForCarousel` declares\n * the protocol members TS-`private`, which keeps them out of the emitted\n * `.d.ts` while `useExisting` still satisfies this contract at runtime.\n */\nexport interface CarouselContext extends ForCarouselContext, CarouselPieceContext {\n registerSlide(handle: ForCarouselSlideHandle): void;\n unregisterSlide(handle: ForCarouselSlideHandle): void;\n registerIndicator(handle: ForCarouselIndicatorHandle): void;\n unregisterIndicator(handle: ForCarouselIndicatorHandle): void;\n registerViewport(handle: ForCarouselViewportHandle): void;\n unregisterViewport(handle: ForCarouselViewportHandle): void;\n}\n\nexport function injectCarouselContext(piece: string): CarouselContext {\n const ctx = inject(FOR_CAROUSEL_CONTEXT, { optional: true }) as CarouselContext | null;\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-CAROUSEL-001',\n piece,\n root: '[forCarousel]',\n token: 'FOR_CAROUSEL_CONTEXT',\n });\n }\n assertRootContext({\n entryPoint: 'carousel',\n token: 'FOR_CAROUSEL_CONTEXT',\n root: '[forCarousel]',\n piece,\n probe: () => ctx.registerSlide,\n });\n return ctx;\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\nimport { type CarouselAlign } from './carousel-context';\n\n/**\n * Defaults inherited by descendant carousels in the surrounding injector scope.\n * Configure with `provideForCarouselDefaults` either at the application root\n * or in any component's `providers` array; partial overrides merge with\n * the parent scope.\n */\nexport interface ForCarouselDefaults {\n /**\n * Whether index wrap-around is enabled. When `true`, `next` past the last\n * slide wraps to index 0 and `prev` before index 0 wraps to the last slide.\n */\n loop: boolean;\n /**\n * Alignment of the active slide within the viewport. `'start'` (default):\n * the active slide's leading edge aligns with the viewport's leading edge.\n * `'center'` / `'end'` offset accordingly.\n */\n align: CarouselAlign;\n /**\n * Number of slides visible simultaneously in the viewport. Slide width is\n * set to `100% / slidesPerView` by the consumer's CSS.\n */\n slidesPerView: number;\n /**\n * When `true` (and the carousel is not looping), clamps the track offset so the\n * trailing slides align flush to the viewport's trailing edge instead of\n * overscrolling into empty space when `slidesPerView > 1`. The indicator/slide\n * mapping is unchanged — only the visual offset is contained. Default `false`.\n */\n containScroll: boolean;\n /** Whether the carousel auto-rotates on mount (when not under reduced-motion). Default `false`. */\n autoplay: boolean;\n /** Milliseconds between automatic slide advances. Default `5000`. */\n autoplayInterval: number;\n /**\n * Builds the default positional `aria-label` for each slide (`\"N of M\"`).\n * Override to localize centrally. `position` is the 1-based slide index and\n * `total` is the slide count. A per-slide `ariaLabel` still takes precedence.\n */\n slideLabel: (position: number, total: number) => string;\n /**\n * Builds the default `aria-label` for each indicator dot (`\"Go to slide N\"`).\n * Override to localize centrally. `position` is the 1-based slide index. A\n * per-indicator `ariaLabel` still takes precedence.\n */\n indicatorLabel: (position: number) => string;\n /**\n * Accessible name for `[forCarouselRotationControl]` while rotation is\n * **stopped** (activating the control starts it), for controls that don't set\n * `[startLabel]` locally. Localize it here to translate every carousel\n * rotation control in the scope.\n */\n rotationStartLabel: string;\n /**\n * Accessible name for `[forCarouselRotationControl]` while rotation is\n * **playing** (activating the control stops it), for controls that don't set\n * `[stopLabel]` locally. Localize it here to translate every carousel\n * rotation control in the scope.\n */\n rotationStopLabel: string;\n}\n\n/**\n * Library fallback for carousel defaults, read at the root injector when no\n * consumer has called `provideForCarouselDefaults`. Exported for the shared\n * defaults contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_CAROUSEL_FALLBACK_DEFAULTS: ForCarouselDefaults = {\n loop: false,\n align: 'start',\n slidesPerView: 1,\n containScroll: false,\n autoplay: false,\n autoplayInterval: 5000,\n slideLabel: (position, total) => `${position} of ${total}`,\n indicatorLabel: (position) => `Go to slide ${position}`,\n rotationStartLabel: 'Start automatic slide show',\n rotationStopLabel: 'Stop automatic slide show',\n};\n\nconst { token, provideDefaults } = createDefaults<ForCarouselDefaults>(\n 'FOR_CAROUSEL_DEFAULTS',\n FOR_CAROUSEL_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved carousel defaults for the current scope. */\nexport const FOR_CAROUSEL_DEFAULTS = token;\n\n/**\n * Configures forty-cdk carousel defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForCarouselDefaults(\n defaults: Partial<ForCarouselDefaults> = {},\n): Provider[] {\n return provideDefaults(defaults);\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n model,\n numberAttribute,\n PLATFORM_ID,\n signal,\n untracked,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n Collection,\n createSingleSlot,\n firstEnabledHost,\n fortyWarn,\n hostAriaLabel,\n injectElementSize,\n injectPauseController,\n injectPrefersReducedMotion,\n injectTextDirection,\n type ListNavigationAction,\n moveIndex,\n type PauseController,\n RovingTabindex,\n type WritingDirection,\n} from 'forty-cdk/core';\nimport {\n type CarouselAlign,\n FOR_CAROUSEL_CONTEXT,\n type ForCarouselContext,\n type ForCarouselIndicatorHandle,\n type ForCarouselSlideHandle,\n type ForCarouselViewportHandle,\n} from './carousel-context';\nimport { FOR_CAROUSEL_DEFAULTS } from './carousel-defaults';\n\n/**\n * Root of the Carousel primitive. Owns the active index, slide collection,\n * indicator collection, roving tabindex tracker, and computed geometry CSS\n * variables. Provides the shared context to descendant pieces.\n *\n * Implements the [WAI-ARIA APG Carousel pattern](https://www.w3.org/WAI/ARIA/apg/patterns/carousel/).\n *\n * With no `[forCarouselIndicators]` rendered this is a basic carousel driven\n * by prev/next buttons only. Adding an indicator group enables APG picker\n * semantics: roving tabindex, arrow/Home/End navigation with automatic\n * activation.\n */\n@Directive({\n selector: '[forCarousel]',\n exportAs: 'forCarousel',\n host: {\n role: 'group',\n 'aria-roledescription': 'carousel',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-align]': 'align()',\n '[attr.dir]': 'dir()',\n '[style.--for-carousel-offset]': 'offset()',\n '[style.--for-carousel-active-index]': 'activeIndex()',\n '[style.--for-carousel-slide-count]': 'slideCount()',\n '[style.--for-carousel-slides-per-view]': 'slidesPerView()',\n '[style.--for-carousel-viewport-width]': 'viewportWidth()',\n '[style.--for-carousel-viewport-height]': 'viewportHeight()',\n '[attr.data-autoplay]': 'autoplay() ? \"\" : null',\n '[attr.data-rotating]': 'rotating() ? \"\" : null',\n '(pointerenter)': 'onAutoplayPause(\"hover\")',\n '(pointerleave)': 'onAutoplayResume(\"hover\")',\n '(focusin)': 'onAutoplayPause(\"focus\")',\n '(focusout)': 'onAutoplayFocusOut($event)',\n },\n providers: [{ provide: FOR_CAROUSEL_CONTEXT, useExisting: ForCarousel }],\n})\nexport class ForCarousel implements ForCarouselContext {\n readonly #defaults = inject(FOR_CAROUSEL_DEFAULTS);\n\n /**\n * Two-way bindable. The zero-based index of the current (leading) slide.\n * The `model()` change emitter (`(activeIndexChange)`) fires only on internal\n * navigation (prev/next button clicks, indicator arrow-key or click), never\n * on consumer writes via `[(activeIndex)]`.\n */\n readonly activeIndex = model<number>(0);\n\n /** Scroll axis. `'horizontal'` (default) or `'vertical'`. */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /**\n * Whether index wrap-around is enabled. When `true`, `next` past the last\n * slide wraps to index 0; `prev` before index 0 wraps to the last. Default\n * comes from `provideForCarouselDefaults` or the library fallback (`false`).\n */\n readonly loop = input(this.#defaults.loop, { transform: booleanAttribute });\n\n /**\n * Alignment of the active slide within the viewport. Affects the\n * `--for-carousel-offset` computation. Default from `provideForCarouselDefaults`\n * or `'start'`.\n */\n readonly align = input<CarouselAlign>(this.#defaults.align);\n\n /**\n * Number of slides simultaneously visible in the viewport. Slide width\n * should be set to `calc(100% / var(--for-carousel-slides-per-view))` in\n * the consumer's CSS. Default from `provideForCarouselDefaults` or `1`.\n */\n readonly slidesPerView = input(this.#defaults.slidesPerView, { transform: numberAttribute });\n\n /**\n * When `true` and the carousel is not looping, clamps `--for-carousel-offset` so the\n * trailing slides align flush to the viewport's trailing edge instead of overscrolling\n * into empty space (relevant when `slidesPerView > 1`). The one-indicator-per-slide\n * mapping is preserved — `activeIndex` still reaches the last slide; only the visual\n * offset is contained. No effect when `loop` is enabled or `slidesPerView` is 1.\n * Default from `provideForCarouselDefaults` or `false`.\n */\n readonly containScroll = input(this.#defaults.containScroll, { transform: booleanAttribute });\n\n /**\n * Accessible label for the carousel root (`role=\"group\"`). Should describe\n * the carousel's purpose without using the word \"carousel\" (APG guidance).\n * When null (default), no `aria-label` is emitted; use `aria-labelledby`\n * instead when a visible heading labels the carousel.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n /**\n * Whether the carousel auto-rotates. When `true` and the user has not\n * explicitly stopped it, rotation starts on mount — *unless*\n * `prefers-reduced-motion: reduce` is set, which suppresses auto-start\n * (the user can still start it via the rotation control). Default from\n * `provideForCarouselDefaults` or `false`.\n *\n * APG requires a `[forCarouselRotationControl]` to be present whenever\n * autoplay is enabled. The directive does not enforce this — see the README.\n */\n readonly autoplay = input(this.#defaults.autoplay, { transform: booleanAttribute });\n\n /**\n * Milliseconds between automatic slide advances while rotating. Values\n * `<= 0` disable the timer. Default from `provideForCarouselDefaults` or `5000`.\n */\n readonly autoplayInterval = input(this.#defaults.autoplayInterval, {\n transform: numberAttribute,\n });\n\n /**\n * Writing direction. When unset (default `null`), the inherited ambient\n * direction is resolved from the nearest ancestor carrying a `dir` attribute\n * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.\n * The resolved value is reflected to the host `dir` attribute and swaps\n * ArrowLeft / ArrowRight semantics on the indicator group in RTL.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n /** Roving tabindex tracker for the indicator group. */\n private readonly roving = new RovingTabindex(() => this.#indicators.items());\n\n readonly #destroyRef = inject(DestroyRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #element = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #prefersReducedMotion = injectPrefersReducedMotion();\n\n readonly #userPlaying = signal<boolean | null>(null);\n\n /** Whether auto-rotation is \"on\" (user intent). Sticky once the user decides. */\n readonly playing = computed(\n () => this.#userPlaying() ?? (this.autoplay() && !this.#prefersReducedMotion()),\n );\n\n readonly #pause: PauseController<'hover' | 'focus' | 'visibility'> = injectPauseController();\n\n /** Whether the carousel is actively auto-rotating right now. */\n readonly rotating = computed(() => this.playing() && !this.#pause.paused());\n\n #timerHandle: ReturnType<typeof setInterval> | null = null;\n\n readonly #slides = new Collection<ForCarouselSlideHandle>();\n readonly #indicators = new Collection<ForCarouselIndicatorHandle>();\n\n readonly #viewport = createSingleSlot<ForCarouselViewportHandle>({\n primitive: 'carousel',\n owner: '[forCarousel]',\n claimant: '[forCarouselViewport]',\n });\n readonly #viewportEl = computed(() => this.#viewport.value()?.host ?? null);\n readonly #viewportBox = injectElementSize(this.#viewportEl);\n\n /** Total number of registered slides. Reactive. */\n readonly slideCount = computed(() => this.#slides.items().length);\n\n readonly #firstEnabledIndicatorHost = computed(() => firstEnabledHost(this.#indicators.items()));\n\n /**\n * The `--for-carousel-offset` value to apply via `transform` on the track.\n * Pure arithmetic — no layout measurement — so it is safe in Vitest.\n */\n readonly offset = computed(() => {\n const perView = Math.max(1, this.slidesPerView());\n const slideSizePct = 100 / perView;\n const base = -(this.activeIndex() * slideSizePct);\n const align = this.align();\n const adjust =\n align === 'center' ? (100 - slideSizePct) / 2 : align === 'end' ? 100 - slideSizePct : 0;\n const raw = base + adjust;\n if (this.containScroll() && !this.loop()) {\n const minOffset = -(Math.max(0, this.slideCount() - perView) * slideSizePct);\n return `${Math.min(0, Math.max(minOffset, raw))}%`;\n }\n return `${raw}%`;\n });\n\n /** The measured viewport width, or `null` before first measurement / on the server. */\n readonly viewportWidth = computed(() => {\n const box = this.#viewportBox();\n return box ? `${box.width}px` : null;\n });\n\n /** The measured viewport height, or `null` before first measurement / on the server. */\n readonly viewportHeight = computed(() => {\n const box = this.#viewportBox();\n return box ? `${box.height}px` : null;\n });\n\n constructor() {\n effect(() => {\n const rotating = this.rotating();\n const interval = this.autoplayInterval();\n untracked(() => this.#syncTimer(rotating, interval));\n });\n this.#destroyRef.onDestroy(() => this.#clearTimer());\n\n if (isDevMode()) {\n let warned = false;\n effect(() => {\n const slides = this.slideCount();\n const indicators = this.#indicators.items().length;\n if (indicators === 0 || indicators === slides) {\n warned = false;\n } else if (!warned) {\n warned = true;\n fortyWarn({\n code: 'FORCDK-CAROUSEL-002',\n message: `${indicators} [forCarouselIndicator] element(s) are registered for ${slides} slide(s).`,\n cause:\n 'The picker targets slide i from the indicator at DOM index i, so a mismatched count ' +\n 'desynchronizes the active-indicator state.',\n fix: 'Render exactly one [forCarouselIndicator] per [forCarouselSlide].',\n });\n }\n });\n }\n }\n\n /** Returns `true` when scrolling backward is possible given the current loop/index state. */\n canScrollPrev(): boolean {\n return moveIndex(this.activeIndex(), this.slideCount(), 'prev', { loop: this.loop() }) !== null;\n }\n\n /** Returns `true` when scrolling forward is possible given the current loop/index state. */\n canScrollNext(): boolean {\n return moveIndex(this.activeIndex(), this.slideCount(), 'next', { loop: this.loop() }) !== null;\n }\n\n /** Navigate to the previous slide. No-op at index 0 when not looping. */\n scrollPrev(): void {\n this.#move('prev');\n }\n\n /** Navigate to the next slide. No-op at the last index when not looping. */\n scrollNext(): void {\n this.#move('next');\n }\n\n /**\n * Navigate to the slide at `index`. Clamps to `[0, slideCount-1]` when not\n * looping; wraps modulo `slideCount` when looping.\n */\n scrollTo(index: number): void {\n const count = this.slideCount();\n if (count === 0) {\n return;\n }\n const target = this.loop()\n ? ((index % count) + count) % count\n : Math.max(0, Math.min(index, count - 1));\n this.activeIndex.set(target);\n }\n\n /**\n * Move focus from `currentIndicator` according to `action` and activate the\n * target slide (automatic activation). Used by `ForCarouselIndicator`'s\n * keydown handler.\n */\n private navigate(currentIndicator: HTMLElement, action: ListNavigationAction): void {\n const indicators = this.#indicators.items();\n if (indicators.length === 0) {\n return;\n }\n const currentIndex = indicators.findIndex((i) => i.host === currentIndicator);\n const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, indicators.length, action, {\n loop: this.loop(),\n isDisabled: (i) => indicators[i]!.disabled(),\n });\n if (next === null) {\n return;\n }\n indicators[next]!.host.focus();\n this.scrollTo(next);\n }\n\n private registerSlide(handle: ForCarouselSlideHandle): void {\n this.#slides.register(handle);\n }\n\n private unregisterSlide(handle: ForCarouselSlideHandle): void {\n this.#slides.unregister(handle);\n }\n\n private registerIndicator(handle: ForCarouselIndicatorHandle): void {\n this.#indicators.register(handle);\n }\n\n private unregisterIndicator(handle: ForCarouselIndicatorHandle): void {\n this.#indicators.unregister(handle);\n this.roving.unregister(handle.host);\n }\n\n /** Called by `ForCarouselViewport` at construction to wire the geometry observer. */\n private registerViewport(handle: ForCarouselViewportHandle): void {\n this.#viewport.register(handle);\n }\n\n /**\n * Called by `ForCarouselViewport` on destroy so an unmounted viewport stops\n * being observed and prev / next drop their stale `aria-controls`.\n */\n private unregisterViewport(handle: ForCarouselViewportHandle): void {\n this.#viewport.unregister(handle);\n }\n\n /** The id of the registered viewport element, or `null` if none is mounted. */\n private viewportId(): string | null {\n return this.#viewport.value()?.id ?? null;\n }\n\n /** DOM-order index of the registered slide whose host equals `host`, or -1. */\n private indexOfSlide(host: HTMLElement): number {\n return this.#slides.indexOfHost(host);\n }\n\n /** DOM-order index of the registered indicator whose host equals `host`, or -1. */\n private indexOfIndicator(host: HTMLElement): number {\n return this.#indicators.indexOfHost(host);\n }\n\n /**\n * Resolve the positional slide `aria-label` from the scope's defaults\n * (`\"N of M\"` unless localized via `provideForCarouselDefaults`).\n * `position` is the 1-based slide index.\n */\n private slideLabel(position: number): string {\n return this.#defaults.slideLabel(position, this.slideCount());\n }\n\n /**\n * Resolve the indicator `aria-label` from the scope's defaults\n * (`\"Go to slide N\"` unless localized via `provideForCarouselDefaults`).\n * `position` is the 1-based slide index.\n */\n private indicatorLabel(position: number): string {\n return this.#defaults.indicatorLabel(position);\n }\n\n /** Returns `true` when `index` is the current active slide index. */\n isCurrent(index: number): boolean {\n return index === this.activeIndex();\n }\n\n /**\n * Returns `true` when `index` falls within the visible window\n * `[activeIndex, activeIndex + slidesPerView - 1]`.\n */\n private isInView(index: number): boolean {\n const start = this.activeIndex();\n return index >= start && index < start + Math.max(1, this.slidesPerView());\n }\n\n /**\n * Returns `true` when `el` is the host of the first non-disabled indicator\n * in DOM order. Used by the tabindex fallback when no indicator is current.\n */\n isFirstEnabledIndicator(el: HTMLElement): boolean {\n return this.#firstEnabledIndicatorHost() === el;\n }\n\n /**\n * Returns `true` when at least one registered, non-disabled indicator\n * matches the current `activeIndex`. Used by the tabindex ladder to decide\n * whether the first-enabled fallback must reclaim the tab stop.\n *\n * Assumes the one-indicator-per-slide mapping the rest of the picker is built\n * on: the indicator at DOM index `i` targets slide `i`. A mismatched indicator\n * count is dev-guarded at construction by the `FORCDK-CAROUSEL-002` warning.\n */\n hasCurrentIndicator(): boolean {\n const active = this.activeIndex();\n return this.#indicators.items().some((i, idx) => idx === active && !i.disabled());\n }\n\n /** Start auto-rotation (explicit, sticky). Overrides the reduced-motion auto-start gate. */\n play(): void {\n this.#userPlaying.set(true);\n }\n\n /** Stop auto-rotation (explicit, sticky). Hover/focus/visibility changes will not restart it. */\n pause(): void {\n this.#userPlaying.set(false);\n }\n\n /** Toggle auto-rotation. Called by `[forCarouselRotationControl]`. */\n toggleAutoplay(): void {\n this.#userPlaying.set(!this.playing());\n }\n\n protected onAutoplayPause(reason: 'hover' | 'focus'): void {\n this.#pause.apply(reason);\n }\n\n protected onAutoplayResume(reason: 'hover' | 'focus'): void {\n this.#pause.release(reason);\n }\n\n protected onAutoplayFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.#element.nativeElement.contains(next)) {\n return;\n }\n this.#pause.release('focus');\n }\n\n #syncTimer(rotating: boolean, interval: number): void {\n this.#clearTimer();\n if (this.#isBrowser && rotating && interval > 0) {\n this.#timerHandle = setInterval(() => this.#advance(), interval);\n }\n }\n\n #advance(): void {\n const count = this.slideCount();\n if (count > 0) {\n this.activeIndex.set((this.activeIndex() + 1) % count);\n }\n }\n\n #clearTimer(): void {\n if (this.#timerHandle !== null) {\n clearInterval(this.#timerHandle);\n this.#timerHandle = null;\n }\n }\n\n #move(action: ListNavigationAction): void {\n const next = moveIndex(this.activeIndex(), this.slideCount(), action, { loop: this.loop() });\n if (next !== null) {\n this.activeIndex.set(next);\n }\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { hostId, registerHandle } from 'forty-cdk/core';\nimport { type ForCarouselViewportHandle, injectCarouselContext } from './carousel-context';\n\n/**\n * Clips the visible window of the carousel track. Acts as the APG-mandated\n * live region for screen-reader announcements. `aria-live` flips between\n * `\"off\"` while the carousel is actively auto-rotating (so advancing slides\n * do not bombard the screen reader) and `\"polite\"` at all other times so\n * manual navigation is announced. Also serves as the `aria-controls` target\n * for the prev/next buttons.\n *\n * Registers itself with the carousel root on construction so the root's\n * `injectElementSize` observer starts and prev/next's `aria-controls` resolves.\n * There must be exactly one viewport per carousel. Unregisters on destroy, so\n * an unmounted viewport stops being observed and prev / next stop pointing\n * `aria-controls` at a dead id.\n */\n@Directive({\n selector: '[forCarouselViewport]',\n exportAs: 'forCarouselViewport',\n host: {\n '[id]': 'id()',\n 'aria-atomic': 'false',\n '[attr.aria-live]': 'ctx.rotating() ? \"off\" : \"polite\"',\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForCarouselViewport {\n protected readonly ctx = injectCarouselContext('ForCarouselViewport');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The resolved id of this element — generated or adopted from a consumer-set static `id`. */\n readonly id = hostId('for-carousel-viewport');\n\n constructor() {\n const handle: ForCarouselViewportHandle = { host: this.#host.nativeElement, id: this.id() };\n registerHandle(\n handle,\n (h) => this.ctx.registerViewport(h),\n (h) => this.ctx.unregisterViewport(h),\n );\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * The flex container of slides. The consumer's CSS reads\n * `--for-carousel-offset` (inherited from the root) and applies it as a\n * `transform: translateX(...)` / `translateY(...)` on this element.\n * The directive adds no animation or transform itself.\n *\n * Reflects `data-orientation` so the consumer can select the correct CSS\n * axis via `[data-orientation=\"vertical\"] [forCarouselTrack] { ... }`.\n */\n@Directive({\n selector: '[forCarouselTrack]',\n exportAs: 'forCarouselTrack',\n host: {\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForCarouselTrack {\n protected readonly ctx = injectCarouselContext('ForCarouselTrack');\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * One slide in the carousel track. Carries `role=\"group\"` and\n * `aria-roledescription=\"slide\"` per the WAI-ARIA APG Carousel pattern.\n *\n * The default `aria-label` is the positional `\"N of M\"` string (APG mandates\n * a positional label on each slide). Set `ariaLabel` to override with a\n * semantically richer label for the specific slide content.\n *\n * Off-view slides (outside `[activeIndex, activeIndex + slidesPerView - 1]`)\n * are hidden from the accessibility tree and focus order via\n * `aria-hidden=\"true\"` + `inert`.\n */\n@Directive({\n selector: '[forCarouselSlide]',\n exportAs: 'forCarouselSlide',\n host: {\n role: 'group',\n 'aria-roledescription': 'slide',\n '[attr.aria-label]': 'ariaLabel() || positionLabel()',\n '[attr.data-state]': 'current() ? \"active\" : \"inactive\"',\n '[attr.data-in-view]': 'inView() ? \"\" : null',\n '[attr.aria-hidden]': 'inView() ? null : \"true\"',\n '[attr.inert]': 'inView() ? null : \"\"',\n },\n})\nexport class ForCarouselSlide {\n protected readonly ctx = injectCarouselContext('ForCarouselSlide');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Override the default positional `aria-label` (`\"N of M\"`). Use this to\n * provide a semantically richer label when the slide's content has a\n * meaningful title (e.g. the product name). When `null` (default), the\n * positional label is used automatically. Localize that default format\n * app-wide via `provideForCarouselDefaults`'s `slideLabel`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n readonly #index = computed(() => this.ctx.indexOfSlide(this.#host.nativeElement));\n\n /** Whether this is the current (active) slide. */\n protected readonly current = computed(() => this.ctx.isCurrent(this.#index()));\n\n /** Whether this slide is within the visible window. */\n protected readonly inView = computed(() => this.ctx.isInView(this.#index()));\n\n /** The positional `\"N of M\"` label used when no explicit `ariaLabel` is set. */\n protected readonly positionLabel = computed(() => {\n const i = this.#index();\n return i < 0 ? null : this.ctx.slideLabel(i + 1);\n });\n\n constructor() {\n const handle = { host: this.#host.nativeElement };\n registerHandle(\n handle,\n (h) => this.ctx.registerSlide(h),\n (h) => this.ctx.unregisterSlide(h),\n );\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostButtonType, hostAriaLabel } from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * Previous-slide button. Apply on a `<button>` so Enter/Space activation is\n * native. Disabled at index 0 when the carousel is not looping; when `loop` is\n * `true` it is never disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a button that auto-disables at\n * index 0 while focused keeps DOM focus instead of being ejected from the focus\n * order. Activation is a no-op while disabled.\n *\n * Points `aria-controls` at the viewport's id so screen readers announce the\n * relationship. Clicking does not move focus (APG).\n */\n@Directive({\n selector: '[forCarouselPrevious]',\n exportAs: 'forCarouselPrevious',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.aria-controls]': 'ctx.viewportId()',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : null',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : null',\n '(click)': 'activate()',\n },\n})\nexport class ForCarouselPrevious {\n protected readonly buttonType = hostButtonType();\n\n protected readonly ctx = injectCarouselContext('ForCarouselPrevious');\n\n /**\n * Accessible label for this button (e.g. \"Previous slide\"). When `null`\n * (default), no `aria-label` is emitted — the consumer should supply a\n * visible label or set this input.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n protected readonly isDisabled = computed(() => !this.ctx.canScrollPrev());\n\n protected activate(): void {\n if (this.isDisabled()) {\n return;\n }\n this.ctx.scrollPrev();\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostButtonType, hostAriaLabel } from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * Next-slide button. Apply on a `<button>` so Enter/Space activation is\n * native. Disabled at the last index when the carousel is not looping; when\n * `loop` is `true` it is never disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a button that auto-disables at the\n * last slide while focused keeps DOM focus instead of being ejected from the\n * focus order. Activation is a no-op while disabled.\n *\n * Points `aria-controls` at the viewport's id so screen readers announce the\n * relationship. Clicking does not move focus (APG).\n */\n@Directive({\n selector: '[forCarouselNext]',\n exportAs: 'forCarouselNext',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.aria-controls]': 'ctx.viewportId()',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : null',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : null',\n '(click)': 'activate()',\n },\n})\nexport class ForCarouselNext {\n protected readonly buttonType = hostButtonType();\n\n protected readonly ctx = injectCarouselContext('ForCarouselNext');\n\n /**\n * Accessible label for this button (e.g. \"Next slide\"). When `null`\n * (default), no `aria-label` is emitted — the consumer should supply a\n * visible label or set this input.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n protected readonly isDisabled = computed(() => !this.ctx.canScrollNext());\n\n protected activate(): void {\n if (this.isDisabled()) {\n return;\n }\n this.ctx.scrollNext();\n }\n}\n","import { Directive, input } from '@angular/core';\n\nimport { hostAriaLabel } from 'forty-cdk/core';\n\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * The slide-picker group (dot navigation). Renders as `role=\"group\"` and\n * should receive an `ariaLabel` describing its purpose (e.g. \"Choose slide\n * to display\") per the WAI-ARIA APG Carousel pattern.\n *\n * Keyboard navigation (ArrowLeft/Right, Home/End) and automatic activation\n * live on each `[forCarouselIndicator]` child, not on this container.\n */\n@Directive({\n selector: '[forCarouselIndicators]',\n exportAs: 'forCarouselIndicators',\n host: {\n role: 'group',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForCarouselIndicators {\n protected readonly ctx = injectCarouselContext('ForCarouselIndicators');\n\n /**\n * Accessible label for the picker group (e.g. \"Choose slide to display\").\n * APG recommends labelling the group so screen readers can distinguish it\n * from other landmarks.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n}\n","import { booleanAttribute, computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport {\n hostButtonType,\n registerHandle,\n resolveListNavigation,\n rovingTabStop,\n} from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * One indicator (dot) in the slide picker. Apply on a `<button>` so\n * Enter/Space activation is native. Uses roving tabindex — only the current\n * dot owns `tabindex=0`; all others have `tabindex=-1`. Arrow/Home/End\n * navigation activates the target slide automatically (APG \"grouped/tabbed\n * picker\" variant).\n *\n * The current indicator is marked with `aria-current=\"true\"` (truthy-only).\n * Disabled indicators receive `aria-disabled=\"true\"` and `data-disabled` but\n * stay focusable (custom-role rule) so assistive tech can announce them.\n */\n@Directive({\n selector: '[forCarouselIndicator]',\n exportAs: 'forCarouselIndicator',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'ariaLabel() || positionLabel()',\n '[attr.aria-current]': 'current() ? \"true\" : null',\n '[attr.data-state]': 'current() ? \"active\" : \"inactive\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.tabindex]': 'tabindex()',\n '(click)': 'onClick()',\n '(focus)': 'onFocus()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForCarouselIndicator {\n protected readonly buttonType = hostButtonType();\n\n protected readonly ctx = injectCarouselContext('ForCarouselIndicator');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Override the default positional `aria-label` (e.g. `\"Go to slide 1\"`).\n * Use this to provide a more descriptive label when the slide has a title.\n * Localize that default format app-wide via `provideForCarouselDefaults`'s\n * `indicatorLabel`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Disables this indicator. Disabled indicators remain focusable (for\n * assistive tech) but ignore click and keyboard activation.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly #index = computed(() => this.ctx.indexOfIndicator(this.#host.nativeElement));\n\n /** Whether this indicator corresponds to the current active slide. */\n protected readonly current = computed(() => this.ctx.isCurrent(this.#index()));\n\n /** Default positional label used when no explicit `ariaLabel` is set. */\n protected readonly positionLabel = computed(() => {\n const i = this.#index();\n return i < 0 ? null : this.ctx.indicatorLabel(i + 1);\n });\n\n /**\n * APG roving tabindex: user-driven roving owns it once any indicator has\n * been focused. Before that, fall back to \"current slide's indicator, else\n * first enabled\".\n */\n protected readonly tabindex = computed<-1 | 0>(() =>\n rovingTabStop({\n disabled: this.disabled(),\n selected: this.current(),\n hasSelected: this.ctx.hasCurrentIndicator(),\n isFirstEnabled: this.ctx.isFirstEnabledIndicator(this.#host.nativeElement),\n roving: this.ctx.roving,\n host: this.#host.nativeElement,\n }),\n );\n\n constructor() {\n const handle = { host: this.#host.nativeElement, disabled: this.disabled };\n registerHandle(\n handle,\n (h) => this.ctx.registerIndicator(h),\n (h) => this.ctx.unregisterIndicator(h),\n );\n }\n\n protected onClick(): void {\n if (this.disabled()) {\n return;\n }\n this.ctx.scrollTo(this.#index());\n }\n\n protected onFocus(): void {\n if (this.disabled()) {\n return;\n }\n this.ctx.roving.setActive(this.#host.nativeElement);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.disabled()) {\n return;\n }\n const action = resolveListNavigation(event, {\n orientation: this.ctx.orientation(),\n dir: this.ctx.dir(),\n });\n if (!action) {\n return;\n }\n event.preventDefault();\n this.ctx.navigate(this.#host.nativeElement, action);\n }\n}\n","import { computed, Directive, inject, input } from '@angular/core';\n\nimport { hostButtonType } from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\nimport { FOR_CAROUSEL_DEFAULTS } from './carousel-defaults';\n\n/**\n * Play/pause control for carousel auto-rotation. Apply on a `<button>` so\n * Enter/Space activation is native. Its accessible name swaps with the\n * rotation state — `stopLabel` while rotating, `startLabel` while stopped —\n * per the WAI-ARIA APG Carousel pattern, which forbids `aria-pressed` here.\n * Both labels default to the scope's `rotationStopLabel` / `rotationStartLabel`\n * (`provideForCarouselDefaults`), so they can be localized centrally.\n *\n * Place this control **first** in the carousel's DOM/tab order so assistive\n * technology users meet it before the rotating content (APG requirement).\n *\n * Reflects a boolean `data-playing` attribute (present while rotation is on)\n * as the styling hook for swapping a play/pause icon.\n */\n@Directive({\n selector: '[forCarouselRotationControl]',\n exportAs: 'forCarouselRotationControl',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'label()',\n '[attr.data-playing]': 'ctx.playing() ? \"\" : null',\n '(click)': 'ctx.toggleAutoplay()',\n },\n})\nexport class ForCarouselRotationControl {\n protected readonly buttonType = hostButtonType();\n\n protected readonly ctx = injectCarouselContext('ForCarouselRotationControl');\n readonly #defaults = inject(FOR_CAROUSEL_DEFAULTS);\n\n /**\n * Accessible name shown while rotation is **stopped** (the button will start\n * it). Defaults to the scope's `rotationStartLabel` (`'Start automatic slide\n * show'` unless overridden via `provideForCarouselDefaults`); set `null` to\n * drop `aria-label` when the button already carries a visible text label.\n */\n readonly startLabel = input<string | null>(this.#defaults.rotationStartLabel);\n\n /**\n * Accessible name shown while rotation is **playing** (the button will stop\n * it). Defaults to the scope's `rotationStopLabel` (`'Stop automatic slide\n * show'` unless overridden via `provideForCarouselDefaults`); set `null` to\n * drop `aria-label` when the button already carries a visible text label.\n */\n readonly stopLabel = input<string | null>(this.#defaults.rotationStopLabel);\n\n /** The current accessible name — `stopLabel` while playing, else `startLabel`. */\n protected readonly label = computed(\n () => (this.ctx.playing() ? this.stopLabel() : this.startLabel()) || null,\n );\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n attachSwipeDismiss,\n type SwipeDirection,\n type SwipeEventDetail,\n isScrollableAtEdge,\n injectPrefersReducedMotion,\n flickVelocity,\n FLICK_STALE_VELOCITY_MS,\n FLICK_VELOCITY_PX_PER_MS,\n} from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * Opt-in pointer drag / swipe directive for the Carousel viewport. Apply on the\n * `[forCarouselViewport]` element to enable horizontal or vertical drag-to-navigate.\n *\n * Publishes `--for-carousel-swipe-movement-x` (horizontal) or\n * `--for-carousel-swipe-movement-y` (vertical) in px during the gesture — only\n * the property matching `orientation` is written — so the consumer can\n * compose it with `--for-carousel-offset` for live track motion. Reflects\n * `data-dragging` while the gesture is armed. Sets `touch-action` automatically\n * to free the cross axis for page scrolling.\n *\n * Under `prefers-reduced-motion: reduce` the live offset is suppressed, but the\n * gesture still snaps `activeIndex` on release (D3).\n */\n@Directive({\n selector: '[forCarouselDrag]',\n exportAs: 'forCarouselDrag',\n host: {\n '[style.--for-carousel-swipe-movement-x]': 'swipeMovementX()',\n '[style.--for-carousel-swipe-movement-y]': 'swipeMovementY()',\n '[attr.data-dragging]': \"dragging() ? '' : null\",\n '[style.touch-action]': 'touchAction()',\n '(dragstart)': 'onDragStart($event)',\n },\n})\nexport class ForCarouselDrag {\n protected readonly ctx = injectCarouselContext('ForCarouselDrag');\n\n /** Disable pointer drag without removing the directive. Default `false`. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #destroyRef = inject(DestroyRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #prefersReducedMotion = injectPrefersReducedMotion();\n\n readonly #dragging = signal(false);\n readonly #dragPx = signal(0);\n\n /** Whether a drag gesture is currently armed (reflected as `data-dragging`). */\n readonly dragging = this.#dragging.asReadonly();\n\n /** `touch-action` for the viewport: capture the primary axis, free the cross axis. */\n readonly touchAction = computed<string | null>(() => {\n if (this.disabled()) return null;\n return this.ctx.orientation() === 'vertical' ? 'pan-x' : 'pan-y';\n });\n\n /** Live px displacement along the primary axis; `null` at rest and under reduced motion (D3). */\n readonly #swipeMovement = computed<string | null>(() => {\n if (this.#prefersReducedMotion()) return null;\n const px = this.#dragPx();\n return this.#dragging() && px !== 0 ? `${px}px` : null;\n });\n\n /** Live px displacement published as `--for-carousel-swipe-movement-x`; `null` on a vertical carousel. */\n readonly swipeMovementX = computed<string | null>(() =>\n this.ctx.orientation() === 'vertical' ? null : this.#swipeMovement(),\n );\n\n /** Live px displacement published as `--for-carousel-swipe-movement-y`; `null` on a horizontal carousel. */\n readonly swipeMovementY = computed<string | null>(() =>\n this.ctx.orientation() === 'vertical' ? this.#swipeMovement() : null,\n );\n\n #startPrimary = 0;\n #lastPrimary = 0;\n #lastTime = 0;\n #velocity = 0;\n #slideSizePx = 0;\n\n constructor() {\n if (!this.#isBrowser) return;\n const cleanup = attachSwipeDismiss({\n element: this.#host.nativeElement,\n getDirections: () => this.#directions(),\n getThreshold: () => 1,\n canBegin: (d) => this.#canBegin(d),\n onSwipeStart: (d) => this.#onStart(d),\n onSwipeMove: (d) => this.#onMove(d),\n onSwipeEnd: (d) => this.#onRelease(d),\n onSwipeCancel: (d) => this.#onRelease(d),\n });\n this.#destroyRef.onDestroy(cleanup);\n }\n\n protected onDragStart(event: Event): void {\n if (this.#dragging()) event.preventDefault();\n }\n\n #directions(): readonly SwipeDirection[] {\n if (this.disabled()) return [];\n return this.ctx.orientation() === 'vertical' ? ['up', 'down'] : ['left', 'right'];\n }\n\n #primary(event: PointerEvent): number {\n return this.ctx.orientation() === 'vertical' ? event.clientY : event.clientX;\n }\n\n /** +1 if a positive primary-axis delta moves toward a higher index, else -1. */\n #nextPerPx(): number {\n // horizontal LTR: finger left (clientX↓) → next → -1\n // horizontal RTL: finger right (clientX↑) → next → +1\n // vertical: finger up (clientY↓) → next → -1\n return this.ctx.orientation() === 'horizontal' && this.ctx.dir() === 'rtl' ? 1 : -1;\n }\n\n #canBegin(detail: SwipeEventDetail): boolean {\n const target = detail.originalEvent.target as Element | null;\n return !(target && isScrollableAtEdge(target, detail.direction, this.#host.nativeElement));\n }\n\n #onStart(detail: SwipeEventDetail): void {\n const rect = this.#host.nativeElement.getBoundingClientRect();\n const axisSize = this.ctx.orientation() === 'vertical' ? rect.height : rect.width;\n this.#slideSizePx = axisSize / Math.max(1, this.ctx.slidesPerView());\n\n const p = this.#primary(detail.originalEvent);\n this.#startPrimary = p;\n this.#lastPrimary = p;\n this.#lastTime = detail.originalEvent.timeStamp || 0;\n this.#velocity = 0;\n this.#dragPx.set(0);\n this.#dragging.set(true);\n }\n\n #onMove(detail: SwipeEventDetail): void {\n if (!this.#dragging()) return;\n const event = detail.originalEvent;\n const p = this.#primary(event);\n const now = event.timeStamp || this.#lastTime + 1;\n const dt = Math.max(1, now - this.#lastTime);\n this.#velocity = (p - this.#lastPrimary) / dt;\n this.#lastPrimary = p;\n this.#lastTime = now;\n this.#dragPx.set(p - this.#startPrimary);\n }\n\n #onRelease(detail: SwipeEventDetail): void {\n if (!this.#dragging()) return;\n const dragPx = this.#dragPx();\n const releaseTime = detail.originalEvent.timeStamp || this.#lastTime;\n const staleVelocity = releaseTime - this.#lastTime > FLICK_STALE_VELOCITY_MS;\n this.#dragging.set(false);\n this.#dragPx.set(0);\n\n if (this.#slideSizePx <= 0) return;\n\n const sign = this.#nextPerPx();\n const slidesDragged = (dragPx * sign) / this.#slideSizePx;\n const velocityTowardNext = flickVelocity(this.#velocity * sign, staleVelocity);\n const target = resolveDragIndex(this.ctx.activeIndex(), slidesDragged, velocityTowardNext);\n this.ctx.scrollTo(target);\n }\n}\n\n/**\n * Pure nearest-index snap with velocity bias. `slidesDragged` is signed (positive\n * toward a higher index); `velocityTowardNext` is px/ms (positive toward a higher\n * index). A fast flick rounds toward the flick direction instead of to nearest.\n * Returns a raw (possibly out-of-range) index; the caller's `scrollTo` normalizes it.\n */\nexport function resolveDragIndex(\n activeIndex: number,\n slidesDragged: number,\n velocityTowardNext: number,\n): number {\n const float = activeIndex + slidesDragged;\n if (velocityTowardNext >= FLICK_VELOCITY_PX_PER_MS) return Math.ceil(float);\n if (velocityTowardNext <= -FLICK_VELOCITY_PX_PER_MS) return Math.floor(float);\n return Math.round(float);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAqGA;;;;;;;;;;AAUG;MACU,oBAAoB,GAAG,IAAI,cAAc,CAAqB,sBAAsB;AAuB3F,SAAU,qBAAqB,CAAC,KAAa,EAAA;AACjD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAA2B;IACtF,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,kBAAkB,CAAC;AACvB,YAAA,IAAI,EAAE,qBAAqB;YAC3B,KAAK;AACL,YAAA,IAAI,EAAE,eAAe;AACrB,YAAA,KAAK,EAAE,sBAAsB;AAC9B,SAAA,CAAC;IACJ;AACA,IAAA,iBAAiB,CAAC;AAChB,QAAA,UAAU,EAAE,UAAU;AACtB,QAAA,KAAK,EAAE,sBAAsB;AAC7B,QAAA,IAAI,EAAE,eAAe;QACrB,KAAK;AACL,QAAA,KAAK,EAAE,MAAM,GAAG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A,CAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE;AACJ,wBAAA,yCAAyC,EAAE,kBAAkB;AAC7D,wBAAA,yCAAyC,EAAE,kBAAkB;AAC7D,wBAAA,sBAAsB,EAAE,wBAAwB;AAChD,wBAAA,sBAAsB,EAAE,eAAe;AACvC,wBAAA,aAAa,EAAE,qBAAqB;AACrC,qBAAA;AACF,iBAAA;;AAoID;;;;;AAKG;SACa,gBAAgB,CAC9B,WAAmB,EACnB,aAAqB,EACrB,kBAA0B,EAAA;AAE1B,IAAA,MAAM,KAAK,GAAG,WAAW,GAAG,aAAa;IACzC,IAAI,kBAAkB,IAAI,wBAAwB;AAAE,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3E,IAAI,kBAAkB,IAAI,CAAC,wBAAwB;AAAE,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AAC7E,IAAA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;AAC1B;;ACpMA;;AAEG;;;;"}
1
+ {"version":3,"file":"forty-cdk-carousel.mjs","sources":["../../../projects/forty-cdk/carousel/src/carousel-context.ts","../../../projects/forty-cdk/carousel/src/carousel-defaults.ts","../../../projects/forty-cdk/carousel/src/carousel.ts","../../../projects/forty-cdk/carousel/src/carousel-viewport.ts","../../../projects/forty-cdk/carousel/src/carousel-track.ts","../../../projects/forty-cdk/carousel/src/carousel-slide.ts","../../../projects/forty-cdk/carousel/src/carousel-previous.ts","../../../projects/forty-cdk/carousel/src/carousel-next.ts","../../../projects/forty-cdk/carousel/src/carousel-indicators.ts","../../../projects/forty-cdk/carousel/src/carousel-indicator.ts","../../../projects/forty-cdk/carousel/src/carousel-rotation-control.ts","../../../projects/forty-cdk/carousel/src/carousel-drag.ts","../../../projects/forty-cdk/carousel/src/forty-cdk-carousel.ts"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport {\n assertRootContext,\n type ListNavigationAction,\n orphanContextError,\n type RovingTabindex,\n type WritingDirection,\n} from 'forty-cdk/core';\n\n/** Alignment of the active slide within the viewport. */\nexport type CarouselAlign = 'start' | 'center' | 'end';\n\n/**\n * Internal handle for a registered slide. Part of the registration protocol, so\n * it is never exported from `public-api.ts` — see {@link CarouselContext}.\n */\nexport interface ForCarouselSlideHandle {\n readonly host: HTMLElement;\n}\n\n/**\n * Internal handle for a registered indicator (dot). Part of the registration\n * protocol, so it is never exported from `public-api.ts` — see\n * {@link CarouselContext}.\n */\nexport interface ForCarouselIndicatorHandle {\n readonly host: HTMLElement;\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Internal handle for the registered viewport. Part of the registration\n * protocol, so it is never exported from `public-api.ts` — see\n * {@link CarouselContext}.\n */\nexport interface ForCarouselViewportHandle {\n readonly host: HTMLElement;\n readonly id: string;\n}\n\n/**\n * Coordination contract owned by `ForCarousel`. Slides and indicators\n * register with the root so index lookups, geometry computations, and\n * keyboard navigation are all driven from a single source of truth.\n */\nexport interface ForCarouselContext {\n readonly activeIndex: Signal<number>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n readonly dir: Signal<WritingDirection>;\n readonly loop: Signal<boolean>;\n readonly align: Signal<CarouselAlign>;\n readonly slidesPerView: Signal<number>;\n readonly slideCount: Signal<number>;\n\n /** Whether auto-rotation is currently \"on\" (user intent). Drives the rotation control's label. */\n readonly playing: Signal<boolean>;\n /** Whether the carousel is actively auto-rotating right now (`playing && !paused`). Drives the viewport's `aria-live`. */\n readonly rotating: Signal<boolean>;\n\n canScrollPrev(): boolean;\n canScrollNext(): boolean;\n scrollPrev(): void;\n scrollNext(): void;\n scrollTo(index: number): void;\n\n /** Toggle auto-rotation on/off (the explicit, sticky user choice). Called by the rotation control. */\n toggleAutoplay(): void;\n\n isCurrent(index: number): boolean;\n isFirstEnabledIndicator(el: HTMLElement): boolean;\n hasCurrentIndicator(): boolean;\n}\n\n/**\n * The carousel's piece-coordination surface: the roving tracker the indicators\n * share, the DOM-order index lookups, the viewport id the rotation control\n * points `aria-controls` at, and the localizable positional labels.\n *\n * **Not** part of {@link ForCarouselContext} and never exported\n * from `public-api.ts` — a consumer drives the carousel through `scrollTo` /\n * `scrollNext`, never through the indicators' shared tab stop.\n */\nexport interface CarouselPieceContext {\n readonly roving: RovingTabindex;\n\n navigate(currentIndicator: HTMLElement, action: ListNavigationAction): void;\n\n viewportId(): string | null;\n\n indexOfSlide(host: HTMLElement): number;\n indexOfIndicator(host: HTMLElement): number;\n\n /** Resolve the positional slide `aria-label` (`\"N of M\"` by default). `position` is 1-based. */\n slideLabel(position: number): string;\n /** Resolve the indicator `aria-label` (`\"Go to slide N\"` by default). `position` is 1-based. */\n indicatorLabel(position: number): string;\n\n isInView(index: number): boolean;\n}\n\n/**\n * DI token providing the carousel context to descendant pieces.\n *\n * Publicly typed as the read surface {@link ForCarouselContext}, which is the whole of\n * what the token promises a consumer. The pieces read the same token at an internal type\n * that adds the slide / indicator / viewport registration protocol, so a wrapper\n * re-providing it must alias it to the root: `{ provide: FOR_CAROUSEL_CONTEXT,\n * useExisting: MyCarousel }`, where `MyCarousel` extends `ForCarousel`. A value that\n * merely satisfies the declared type resolves too, and is rejected in dev mode by the\n * first piece to reach the protocol.\n */\nexport const FOR_CAROUSEL_CONTEXT = new InjectionToken<ForCarouselContext>('FOR_CAROUSEL_CONTEXT');\n\n/**\n * The carousel's internal coordination surface: everything\n * {@link ForCarouselContext} publishes plus the {@link CarouselPieceContext}\n * members and the slide / indicator / viewport registration protocol the index\n * lookups, geometry observer and roving tabindex are driven from.\n *\n * Never exported from `public-api.ts`. It is the type the pieces read\n * {@link FOR_CAROUSEL_CONTEXT} at, so a consumer who injects that token gets the\n * read surface while the pieces get the wiring protocol. `ForCarousel` declares\n * the protocol members TS-`private`, which keeps them out of the emitted\n * `.d.ts` while `useExisting` still satisfies this contract at runtime.\n */\nexport interface CarouselContext extends ForCarouselContext, CarouselPieceContext {\n registerSlide(handle: ForCarouselSlideHandle): void;\n unregisterSlide(handle: ForCarouselSlideHandle): void;\n registerIndicator(handle: ForCarouselIndicatorHandle): void;\n unregisterIndicator(handle: ForCarouselIndicatorHandle): void;\n registerViewport(handle: ForCarouselViewportHandle): void;\n unregisterViewport(handle: ForCarouselViewportHandle): void;\n}\n\nexport function injectCarouselContext(piece: string): CarouselContext {\n const ctx = inject(FOR_CAROUSEL_CONTEXT, { optional: true }) as CarouselContext | null;\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-CAROUSEL-001',\n piece,\n root: '[forCarousel]',\n token: 'FOR_CAROUSEL_CONTEXT',\n });\n }\n assertRootContext({\n entryPoint: 'carousel',\n token: 'FOR_CAROUSEL_CONTEXT',\n root: '[forCarousel]',\n piece,\n probe: () => ctx.registerSlide,\n });\n return ctx;\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\nimport { type CarouselAlign } from './carousel-context';\n\n/**\n * Defaults inherited by descendant carousels in the surrounding injector scope.\n * Configure with `provideForCarouselDefaults` either at the application root\n * or in any component's `providers` array; partial overrides merge with\n * the parent scope.\n */\nexport interface ForCarouselDefaults {\n /**\n * Whether index wrap-around is enabled. When `true`, `next` past the last\n * slide wraps to index 0 and `prev` before index 0 wraps to the last slide.\n */\n loop: boolean;\n /**\n * Alignment of the active slide within the viewport. `'start'` (default):\n * the active slide's leading edge aligns with the viewport's leading edge.\n * `'center'` / `'end'` offset accordingly.\n */\n align: CarouselAlign;\n /**\n * Number of slides visible simultaneously in the viewport. Slide width is\n * set to `100% / slidesPerView` by the consumer's CSS.\n */\n slidesPerView: number;\n /**\n * When `true` (and the carousel is not looping), clamps the track offset so the\n * trailing slides align flush to the viewport's trailing edge instead of\n * overscrolling into empty space when `slidesPerView > 1`. The indicator/slide\n * mapping is unchanged — only the visual offset is contained. Default `false`.\n */\n containScroll: boolean;\n /** Whether the carousel auto-rotates on mount (when not under reduced-motion). Default `false`. */\n autoplay: boolean;\n /** Milliseconds between automatic slide advances. Default `5000`. */\n autoplayInterval: number;\n /**\n * Builds the default positional `aria-label` for each slide (`\"N of M\"`).\n * Override to localize centrally. `position` is the 1-based slide index and\n * `total` is the slide count. A per-slide `ariaLabel` still takes precedence.\n */\n slideLabel: (position: number, total: number) => string;\n /**\n * Builds the default `aria-label` for each indicator dot (`\"Go to slide N\"`).\n * Override to localize centrally. `position` is the 1-based slide index. A\n * per-indicator `ariaLabel` still takes precedence.\n */\n indicatorLabel: (position: number) => string;\n /**\n * Accessible name for `[forCarouselRotationControl]` while rotation is\n * **stopped** (activating the control starts it), for controls that don't set\n * `[startLabel]` locally. Localize it here to translate every carousel\n * rotation control in the scope.\n */\n rotationStartLabel: string;\n /**\n * Accessible name for `[forCarouselRotationControl]` while rotation is\n * **playing** (activating the control stops it), for controls that don't set\n * `[stopLabel]` locally. Localize it here to translate every carousel\n * rotation control in the scope.\n */\n rotationStopLabel: string;\n}\n\n/**\n * Library fallback for carousel defaults, read at the root injector when no\n * consumer has called `provideForCarouselDefaults`. Exported for the shared\n * defaults contract spec; not re-exported from the primitive's public entry.\n */\nexport const FOR_CAROUSEL_FALLBACK_DEFAULTS: ForCarouselDefaults = {\n loop: false,\n align: 'start',\n slidesPerView: 1,\n containScroll: false,\n autoplay: false,\n autoplayInterval: 5000,\n slideLabel: (position, total) => `${position} of ${total}`,\n indicatorLabel: (position) => `Go to slide ${position}`,\n rotationStartLabel: 'Start automatic slide show',\n rotationStopLabel: 'Stop automatic slide show',\n};\n\nconst { token, provideDefaults } = createDefaults<ForCarouselDefaults>(\n 'FOR_CAROUSEL_DEFAULTS',\n FOR_CAROUSEL_FALLBACK_DEFAULTS,\n);\n\n/** Token holding the resolved carousel defaults for the current scope. */\nexport const FOR_CAROUSEL_DEFAULTS = token;\n\n/**\n * Configures forty-cdk carousel defaults for this injector scope. Partial\n * overrides inherit unspecified keys from the parent scope (or library\n * defaults at the root).\n */\nexport function provideForCarouselDefaults(\n defaults: Partial<ForCarouselDefaults> = {},\n): Provider[] {\n return provideDefaults(defaults);\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n model,\n numberAttribute,\n PLATFORM_ID,\n signal,\n untracked,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n Collection,\n createSingleSlot,\n firstEnabledHost,\n fortyWarn,\n hostAriaLabel,\n injectElementSize,\n injectPauseController,\n injectPrefersReducedMotion,\n injectTextDirection,\n type ListNavigationAction,\n moveIndex,\n type PauseController,\n RovingTabindex,\n type WritingDirection,\n} from 'forty-cdk/core';\nimport {\n type CarouselAlign,\n FOR_CAROUSEL_CONTEXT,\n type ForCarouselContext,\n type ForCarouselIndicatorHandle,\n type ForCarouselSlideHandle,\n type ForCarouselViewportHandle,\n} from './carousel-context';\nimport { FOR_CAROUSEL_DEFAULTS } from './carousel-defaults';\n\n/**\n * Root of the Carousel primitive. Owns the active index, slide collection,\n * indicator collection, roving tabindex tracker, and computed geometry CSS\n * variables. Provides the shared context to descendant pieces.\n *\n * Implements the [WAI-ARIA APG Carousel pattern](https://www.w3.org/WAI/ARIA/apg/patterns/carousel/).\n *\n * With no `[forCarouselIndicators]` rendered this is a basic carousel driven\n * by prev/next buttons only. Adding an indicator group enables APG picker\n * semantics: roving tabindex, arrow/Home/End navigation with automatic\n * activation.\n */\n@Directive({\n selector: '[forCarousel]',\n exportAs: 'forCarousel',\n host: {\n role: 'group',\n 'aria-roledescription': 'carousel',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-align]': 'align()',\n '[attr.dir]': 'dir()',\n '[style.--for-carousel-offset]': 'offset()',\n '[style.--for-carousel-active-index]': 'activeIndex()',\n '[style.--for-carousel-slide-count]': 'slideCount()',\n '[style.--for-carousel-slides-per-view]': 'slidesPerView()',\n '[style.--for-carousel-viewport-width]': 'viewportWidth()',\n '[style.--for-carousel-viewport-height]': 'viewportHeight()',\n '[attr.data-autoplay]': 'autoplay() ? \"\" : null',\n '[attr.data-rotating]': 'rotating() ? \"\" : null',\n '(pointerenter)': 'onAutoplayPause(\"hover\")',\n '(pointerleave)': 'onAutoplayResume(\"hover\")',\n '(focusin)': 'onAutoplayPause(\"focus\")',\n '(focusout)': 'onAutoplayFocusOut($event)',\n },\n providers: [{ provide: FOR_CAROUSEL_CONTEXT, useExisting: ForCarousel }],\n})\nexport class ForCarousel implements ForCarouselContext {\n readonly #defaults = inject(FOR_CAROUSEL_DEFAULTS);\n\n /**\n * Two-way bindable. The zero-based index of the current (leading) slide.\n * The `model()` change emitter (`(activeIndexChange)`) fires only on internal\n * navigation (prev/next button clicks, indicator arrow-key or click), never\n * on consumer writes via `[(activeIndex)]`.\n */\n readonly activeIndex = model<number>(0);\n\n /** Scroll axis. `'horizontal'` (default) or `'vertical'`. */\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /**\n * Whether index wrap-around is enabled. When `true`, `next` past the last\n * slide wraps to index 0; `prev` before index 0 wraps to the last. Default\n * comes from `provideForCarouselDefaults` or the library fallback (`false`).\n */\n readonly loop = input(this.#defaults.loop, { transform: booleanAttribute });\n\n /**\n * Alignment of the active slide within the viewport. Affects the\n * `--for-carousel-offset` computation. Default from `provideForCarouselDefaults`\n * or `'start'`.\n */\n readonly align = input<CarouselAlign>(this.#defaults.align);\n\n /**\n * Number of slides simultaneously visible in the viewport. Slide width\n * should be set to `calc(100% / var(--for-carousel-slides-per-view))` in\n * the consumer's CSS. Default from `provideForCarouselDefaults` or `1`.\n */\n readonly slidesPerView = input(this.#defaults.slidesPerView, { transform: numberAttribute });\n\n /**\n * When `true` and the carousel is not looping, clamps `--for-carousel-offset` so the\n * trailing slides align flush to the viewport's trailing edge instead of overscrolling\n * into empty space (relevant when `slidesPerView > 1`). The one-indicator-per-slide\n * mapping is preserved — `activeIndex` still reaches the last slide; only the visual\n * offset is contained. No effect when `loop` is enabled or `slidesPerView` is 1.\n * Default from `provideForCarouselDefaults` or `false`.\n */\n readonly containScroll = input(this.#defaults.containScroll, { transform: booleanAttribute });\n\n /**\n * Accessible label for the carousel root (`role=\"group\"`). Should describe\n * the carousel's purpose without using the word \"carousel\" (APG guidance).\n * When null (default), no `aria-label` is emitted; use `aria-labelledby`\n * instead when a visible heading labels the carousel.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n /**\n * Whether the carousel auto-rotates. When `true` and the user has not\n * explicitly stopped it, rotation starts on mount — *unless*\n * `prefers-reduced-motion: reduce` is set, which suppresses auto-start\n * (the user can still start it via the rotation control). Default from\n * `provideForCarouselDefaults` or `false`.\n *\n * APG requires a `[forCarouselRotationControl]` to be present whenever\n * autoplay is enabled. The directive does not enforce this — see the README.\n */\n readonly autoplay = input(this.#defaults.autoplay, { transform: booleanAttribute });\n\n /**\n * Milliseconds between automatic slide advances while rotating. Values\n * `<= 0` disable the timer. Default from `provideForCarouselDefaults` or `5000`.\n */\n readonly autoplayInterval = input(this.#defaults.autoplayInterval, {\n transform: numberAttribute,\n });\n\n /**\n * Writing direction. When unset (default `null`), the inherited ambient\n * direction is resolved from the nearest ancestor carrying a `dir` attribute\n * (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.\n * The resolved value is reflected to the host `dir` attribute and swaps\n * ArrowLeft / ArrowRight semantics on the indicator group in RTL.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n /** Roving tabindex tracker for the indicator group. */\n private readonly roving = new RovingTabindex(() => this.#indicators.items());\n\n readonly #destroyRef = inject(DestroyRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #element = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #prefersReducedMotion = injectPrefersReducedMotion();\n\n readonly #userPlaying = signal<boolean | null>(null);\n\n /** Whether auto-rotation is \"on\" (user intent). Sticky once the user decides. */\n readonly playing = computed(\n () => this.#userPlaying() ?? (this.autoplay() && !this.#prefersReducedMotion()),\n );\n\n readonly #pause: PauseController<'hover' | 'focus' | 'visibility'> = injectPauseController();\n\n /** Whether the carousel is actively auto-rotating right now. */\n readonly rotating = computed(() => this.playing() && !this.#pause.paused());\n\n #timerHandle: ReturnType<typeof setInterval> | null = null;\n\n readonly #slides = new Collection<ForCarouselSlideHandle>();\n readonly #indicators = new Collection<ForCarouselIndicatorHandle>();\n\n readonly #viewport = createSingleSlot<ForCarouselViewportHandle>({\n primitive: 'carousel',\n owner: '[forCarousel]',\n claimant: '[forCarouselViewport]',\n });\n readonly #viewportEl = computed(() => this.#viewport.value()?.host ?? null);\n readonly #viewportBox = injectElementSize(this.#viewportEl);\n\n /** Total number of registered slides. Reactive. */\n readonly slideCount = computed(() => this.#slides.items().length);\n\n readonly #firstEnabledIndicatorHost = computed(() => firstEnabledHost(this.#indicators.items()));\n\n /**\n * The `--for-carousel-offset` value to apply via `transform` on the track.\n * Pure arithmetic — no layout measurement — so it is safe in Vitest.\n */\n readonly offset = computed(() => {\n const perView = Math.max(1, this.slidesPerView());\n const slideSizePct = 100 / perView;\n const base = -(this.activeIndex() * slideSizePct);\n const align = this.align();\n const adjust =\n align === 'center' ? (100 - slideSizePct) / 2 : align === 'end' ? 100 - slideSizePct : 0;\n const raw = base + adjust;\n if (this.containScroll() && !this.loop()) {\n const minOffset = -(Math.max(0, this.slideCount() - perView) * slideSizePct);\n return `${Math.min(0, Math.max(minOffset, raw))}%`;\n }\n return `${raw}%`;\n });\n\n /** The measured viewport width, or `null` before first measurement / on the server. */\n readonly viewportWidth = computed(() => {\n const box = this.#viewportBox();\n return box ? `${box.width}px` : null;\n });\n\n /** The measured viewport height, or `null` before first measurement / on the server. */\n readonly viewportHeight = computed(() => {\n const box = this.#viewportBox();\n return box ? `${box.height}px` : null;\n });\n\n constructor() {\n effect(() => {\n const rotating = this.rotating();\n const interval = this.autoplayInterval();\n untracked(() => this.#syncTimer(rotating, interval));\n });\n this.#destroyRef.onDestroy(() => this.#clearTimer());\n\n if (isDevMode()) {\n let warned = false;\n effect(() => {\n const slides = this.slideCount();\n const indicators = this.#indicators.items().length;\n if (indicators === 0 || indicators === slides) {\n warned = false;\n } else if (!warned) {\n warned = true;\n fortyWarn({\n code: 'FORCDK-CAROUSEL-002',\n message: `${indicators} [forCarouselIndicator] element(s) are registered for ${slides} slide(s).`,\n cause:\n 'The picker targets slide i from the indicator at DOM index i, so a mismatched count ' +\n 'desynchronizes the active-indicator state.',\n fix: 'Render exactly one [forCarouselIndicator] per [forCarouselSlide].',\n });\n }\n });\n }\n }\n\n /** Returns `true` when scrolling backward is possible given the current loop/index state. */\n canScrollPrev(): boolean {\n return moveIndex(this.activeIndex(), this.slideCount(), 'prev', { loop: this.loop() }) !== null;\n }\n\n /** Returns `true` when scrolling forward is possible given the current loop/index state. */\n canScrollNext(): boolean {\n return moveIndex(this.activeIndex(), this.slideCount(), 'next', { loop: this.loop() }) !== null;\n }\n\n /** Navigate to the previous slide. No-op at index 0 when not looping. */\n scrollPrev(): void {\n this.#move('prev');\n }\n\n /** Navigate to the next slide. No-op at the last index when not looping. */\n scrollNext(): void {\n this.#move('next');\n }\n\n /**\n * Navigate to the slide at `index`. Clamps to `[0, slideCount-1]` when not\n * looping; wraps modulo `slideCount` when looping.\n */\n scrollTo(index: number): void {\n const count = this.slideCount();\n if (count === 0) {\n return;\n }\n const target = this.loop()\n ? ((index % count) + count) % count\n : Math.max(0, Math.min(index, count - 1));\n this.activeIndex.set(target);\n }\n\n /**\n * Move focus from `currentIndicator` according to `action` and activate the\n * target slide (automatic activation). Used by `ForCarouselIndicator`'s\n * keydown handler.\n */\n private navigate(currentIndicator: HTMLElement, action: ListNavigationAction): void {\n const indicators = this.#indicators.items();\n if (indicators.length === 0) {\n return;\n }\n const currentIndex = indicators.findIndex((i) => i.host === currentIndicator);\n const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, indicators.length, action, {\n loop: this.loop(),\n isDisabled: (i) => indicators[i]!.disabled(),\n });\n if (next === null) {\n return;\n }\n indicators[next]!.host.focus();\n this.scrollTo(next);\n }\n\n private registerSlide(handle: ForCarouselSlideHandle): void {\n this.#slides.register(handle);\n }\n\n private unregisterSlide(handle: ForCarouselSlideHandle): void {\n this.#slides.unregister(handle);\n }\n\n private registerIndicator(handle: ForCarouselIndicatorHandle): void {\n this.#indicators.register(handle);\n }\n\n private unregisterIndicator(handle: ForCarouselIndicatorHandle): void {\n this.#indicators.unregister(handle);\n this.roving.unregister(handle.host);\n }\n\n /** Called by `ForCarouselViewport` at construction to wire the geometry observer. */\n private registerViewport(handle: ForCarouselViewportHandle): void {\n this.#viewport.register(handle);\n }\n\n /**\n * Called by `ForCarouselViewport` on destroy so an unmounted viewport stops\n * being observed and prev / next drop their stale `aria-controls`.\n */\n private unregisterViewport(handle: ForCarouselViewportHandle): void {\n this.#viewport.unregister(handle);\n }\n\n /** The id of the registered viewport element, or `null` if none is mounted. */\n private viewportId(): string | null {\n return this.#viewport.value()?.id ?? null;\n }\n\n /** DOM-order index of the registered slide whose host equals `host`, or -1. */\n private indexOfSlide(host: HTMLElement): number {\n return this.#slides.indexOfHost(host);\n }\n\n /** DOM-order index of the registered indicator whose host equals `host`, or -1. */\n private indexOfIndicator(host: HTMLElement): number {\n return this.#indicators.indexOfHost(host);\n }\n\n /**\n * Resolve the positional slide `aria-label` from the scope's defaults\n * (`\"N of M\"` unless localized via `provideForCarouselDefaults`).\n * `position` is the 1-based slide index.\n */\n private slideLabel(position: number): string {\n return this.#defaults.slideLabel(position, this.slideCount());\n }\n\n /**\n * Resolve the indicator `aria-label` from the scope's defaults\n * (`\"Go to slide N\"` unless localized via `provideForCarouselDefaults`).\n * `position` is the 1-based slide index.\n */\n private indicatorLabel(position: number): string {\n return this.#defaults.indicatorLabel(position);\n }\n\n /** Returns `true` when `index` is the current active slide index. */\n isCurrent(index: number): boolean {\n return index === this.activeIndex();\n }\n\n /**\n * Returns `true` when `index` falls within the visible window\n * `[activeIndex, activeIndex + slidesPerView - 1]`.\n */\n private isInView(index: number): boolean {\n const start = this.activeIndex();\n return index >= start && index < start + Math.max(1, this.slidesPerView());\n }\n\n /**\n * Returns `true` when `el` is the host of the first non-disabled indicator\n * in DOM order. Used by the tabindex fallback when no indicator is current.\n */\n isFirstEnabledIndicator(el: HTMLElement): boolean {\n return this.#firstEnabledIndicatorHost() === el;\n }\n\n /**\n * Returns `true` when at least one registered, non-disabled indicator\n * matches the current `activeIndex`. Used by the tabindex ladder to decide\n * whether the first-enabled fallback must reclaim the tab stop.\n *\n * Assumes the one-indicator-per-slide mapping the rest of the picker is built\n * on: the indicator at DOM index `i` targets slide `i`. A mismatched indicator\n * count is dev-guarded at construction by the `FORCDK-CAROUSEL-002` warning.\n */\n hasCurrentIndicator(): boolean {\n const active = this.activeIndex();\n return this.#indicators.items().some((i, idx) => idx === active && !i.disabled());\n }\n\n /** Start auto-rotation (explicit, sticky). Overrides the reduced-motion auto-start gate. */\n play(): void {\n this.#userPlaying.set(true);\n }\n\n /** Stop auto-rotation (explicit, sticky). Hover/focus/visibility changes will not restart it. */\n pause(): void {\n this.#userPlaying.set(false);\n }\n\n /** Toggle auto-rotation. Called by `[forCarouselRotationControl]`. */\n toggleAutoplay(): void {\n this.#userPlaying.set(!this.playing());\n }\n\n protected onAutoplayPause(reason: 'hover' | 'focus'): void {\n this.#pause.apply(reason);\n }\n\n protected onAutoplayResume(reason: 'hover' | 'focus'): void {\n this.#pause.release(reason);\n }\n\n protected onAutoplayFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (next && this.#element.nativeElement.contains(next)) {\n return;\n }\n this.#pause.release('focus');\n }\n\n #syncTimer(rotating: boolean, interval: number): void {\n this.#clearTimer();\n if (this.#isBrowser && rotating && interval > 0) {\n this.#timerHandle = setInterval(() => this.#advance(), interval);\n }\n }\n\n #advance(): void {\n const count = this.slideCount();\n if (count > 0) {\n this.activeIndex.set((this.activeIndex() + 1) % count);\n }\n }\n\n #clearTimer(): void {\n if (this.#timerHandle !== null) {\n clearInterval(this.#timerHandle);\n this.#timerHandle = null;\n }\n }\n\n #move(action: ListNavigationAction): void {\n const next = moveIndex(this.activeIndex(), this.slideCount(), action, { loop: this.loop() });\n if (next !== null) {\n this.activeIndex.set(next);\n }\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { hostId, registerHandle } from 'forty-cdk/core';\nimport { type ForCarouselViewportHandle, injectCarouselContext } from './carousel-context';\n\n/**\n * Clips the visible window of the carousel track. Acts as the APG-mandated\n * live region for screen-reader announcements. `aria-live` flips between\n * `\"off\"` while the carousel is actively auto-rotating (so advancing slides\n * do not bombard the screen reader) and `\"polite\"` at all other times so\n * manual navigation is announced. Also serves as the `aria-controls` target\n * for the prev/next buttons.\n *\n * Registers itself with the carousel root on construction so the root's\n * `injectElementSize` observer starts and prev/next's `aria-controls` resolves.\n * There must be exactly one viewport per carousel. Unregisters on destroy, so\n * an unmounted viewport stops being observed and prev / next stop pointing\n * `aria-controls` at a dead id.\n */\n@Directive({\n selector: '[forCarouselViewport]',\n exportAs: 'forCarouselViewport',\n host: {\n '[id]': 'id()',\n 'aria-atomic': 'false',\n '[attr.aria-live]': 'ctx.rotating() ? \"off\" : \"polite\"',\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForCarouselViewport {\n protected readonly ctx = injectCarouselContext('ForCarouselViewport');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /** The resolved id of this element — generated or adopted from a consumer-set static `id`. */\n readonly id = hostId('for-carousel-viewport');\n\n constructor() {\n const handle: ForCarouselViewportHandle = { host: this.#host.nativeElement, id: this.id() };\n registerHandle(\n handle,\n (h) => this.ctx.registerViewport(h),\n (h) => this.ctx.unregisterViewport(h),\n );\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * The flex container of slides. The consumer's CSS reads\n * `--for-carousel-offset` (inherited from the root) and applies it as a\n * `transform: translateX(...)` / `translateY(...)` on this element.\n * The directive adds no animation or transform itself.\n *\n * Reflects `data-orientation` so the consumer can select the correct CSS\n * axis via `[data-orientation=\"vertical\"] [forCarouselTrack] { ... }`.\n */\n@Directive({\n selector: '[forCarouselTrack]',\n exportAs: 'forCarouselTrack',\n host: {\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForCarouselTrack {\n protected readonly ctx = injectCarouselContext('ForCarouselTrack');\n}\n","import { computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport { registerHandle } from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * One slide in the carousel track. Carries `role=\"group\"` and\n * `aria-roledescription=\"slide\"` per the WAI-ARIA APG Carousel pattern.\n *\n * The default `aria-label` is the positional `\"N of M\"` string (APG mandates\n * a positional label on each slide). Set `ariaLabel` to override with a\n * semantically richer label for the specific slide content.\n *\n * Off-view slides (outside `[activeIndex, activeIndex + slidesPerView - 1]`)\n * are hidden from the accessibility tree and focus order via\n * `aria-hidden=\"true\"` + `inert`.\n */\n@Directive({\n selector: '[forCarouselSlide]',\n exportAs: 'forCarouselSlide',\n host: {\n role: 'group',\n 'aria-roledescription': 'slide',\n '[attr.aria-label]': 'ariaLabel() || positionLabel()',\n '[attr.data-state]': 'current() ? \"active\" : \"inactive\"',\n '[attr.data-in-view]': 'inView() ? \"\" : null',\n '[attr.aria-hidden]': 'inView() ? null : \"true\"',\n '[attr.inert]': 'inView() ? null : \"\"',\n },\n})\nexport class ForCarouselSlide {\n protected readonly ctx = injectCarouselContext('ForCarouselSlide');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Override the default positional `aria-label` (`\"N of M\"`). Use this to\n * provide a semantically richer label when the slide's content has a\n * meaningful title (e.g. the product name). When `null` (default), the\n * positional label is used automatically. Localize that default format\n * app-wide via `provideForCarouselDefaults`'s `slideLabel`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n readonly #index = computed(() => this.ctx.indexOfSlide(this.#host.nativeElement));\n\n /** Whether this is the current (active) slide. */\n protected readonly current = computed(() => this.ctx.isCurrent(this.#index()));\n\n /** Whether this slide is within the visible window. */\n protected readonly inView = computed(() => this.ctx.isInView(this.#index()));\n\n /** The positional `\"N of M\"` label used when no explicit `ariaLabel` is set. */\n protected readonly positionLabel = computed(() => {\n const i = this.#index();\n return i < 0 ? null : this.ctx.slideLabel(i + 1);\n });\n\n constructor() {\n const handle = { host: this.#host.nativeElement };\n registerHandle(\n handle,\n (h) => this.ctx.registerSlide(h),\n (h) => this.ctx.unregisterSlide(h),\n );\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostButtonType, hostAriaLabel } from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * Previous-slide button. Apply on a `<button>` so Enter/Space activation is\n * native. Disabled at index 0 when the carousel is not looping; when `loop` is\n * `true` it is never disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a button that auto-disables at\n * index 0 while focused keeps DOM focus instead of being ejected from the focus\n * order. Activation is a no-op while disabled.\n *\n * Points `aria-controls` at the viewport's id so screen readers announce the\n * relationship. Clicking does not move focus (APG).\n */\n@Directive({\n selector: '[forCarouselPrevious]',\n exportAs: 'forCarouselPrevious',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.aria-controls]': 'ctx.viewportId()',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : null',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : null',\n '(click)': 'activate()',\n },\n})\nexport class ForCarouselPrevious {\n protected readonly buttonType = hostButtonType();\n\n protected readonly ctx = injectCarouselContext('ForCarouselPrevious');\n\n /**\n * Accessible label for this button (e.g. \"Previous slide\"). When `null`\n * (default), no `aria-label` is emitted — the consumer should supply a\n * visible label or set this input.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n protected readonly isDisabled = computed(() => !this.ctx.canScrollPrev());\n\n protected activate(): void {\n if (this.isDisabled()) {\n return;\n }\n this.ctx.scrollPrev();\n }\n}\n","import { computed, Directive, input } from '@angular/core';\n\nimport { hostButtonType, hostAriaLabel } from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * Next-slide button. Apply on a `<button>` so Enter/Space activation is\n * native. Disabled at the last index when the carousel is not looping; when\n * `loop` is `true` it is never disabled.\n *\n * Reflects the disabled state through `aria-disabled` + `data-disabled` only —\n * never the native `disabled` attribute — so a button that auto-disables at the\n * last slide while focused keeps DOM focus instead of being ejected from the\n * focus order. Activation is a no-op while disabled.\n *\n * Points `aria-controls` at the viewport's id so screen readers announce the\n * relationship. Clicking does not move focus (APG).\n */\n@Directive({\n selector: '[forCarouselNext]',\n exportAs: 'forCarouselNext',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.aria-controls]': 'ctx.viewportId()',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : null',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : null',\n '(click)': 'activate()',\n },\n})\nexport class ForCarouselNext {\n protected readonly buttonType = hostButtonType();\n\n protected readonly ctx = injectCarouselContext('ForCarouselNext');\n\n /**\n * Accessible label for this button (e.g. \"Next slide\"). When `null`\n * (default), no `aria-label` is emitted — the consumer should supply a\n * visible label or set this input.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n\n protected readonly isDisabled = computed(() => !this.ctx.canScrollNext());\n\n protected activate(): void {\n if (this.isDisabled()) {\n return;\n }\n this.ctx.scrollNext();\n }\n}\n","import { Directive, input } from '@angular/core';\n\nimport { hostAriaLabel } from 'forty-cdk/core';\n\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * The slide-picker group (dot navigation). Renders as `role=\"group\"` and\n * should receive an `ariaLabel` describing its purpose (e.g. \"Choose slide\n * to display\") per the WAI-ARIA APG Carousel pattern.\n *\n * Keyboard navigation (ArrowLeft/Right, Home/End) and automatic activation\n * live on each `[forCarouselIndicator]` child, not on this container.\n */\n@Directive({\n selector: '[forCarouselIndicators]',\n exportAs: 'forCarouselIndicators',\n host: {\n role: 'group',\n '[attr.aria-label]': 'resolvedAriaLabel()',\n '[attr.data-orientation]': 'ctx.orientation()',\n },\n})\nexport class ForCarouselIndicators {\n protected readonly ctx = injectCarouselContext('ForCarouselIndicators');\n\n /**\n * Accessible label for the picker group (e.g. \"Choose slide to display\").\n * APG recommends labelling the group so screen readers can distinguish it\n * from other landmarks.\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = hostAriaLabel(() => this.ariaLabel() || null);\n}\n","import { booleanAttribute, computed, Directive, ElementRef, inject, input } from '@angular/core';\n\nimport {\n hostButtonType,\n registerHandle,\n resolveListNavigation,\n rovingTabStop,\n} from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * One indicator (dot) in the slide picker. Apply on a `<button>` so\n * Enter/Space activation is native. Uses roving tabindex — only the current\n * dot owns `tabindex=0`; all others have `tabindex=-1`. Arrow/Home/End\n * navigation activates the target slide automatically (APG \"grouped/tabbed\n * picker\" variant).\n *\n * The current indicator is marked with `aria-current=\"true\"` (truthy-only).\n * Disabled indicators receive `aria-disabled=\"true\"` and `data-disabled` but\n * stay focusable (custom-role rule) so assistive tech can announce them.\n */\n@Directive({\n selector: '[forCarouselIndicator]',\n exportAs: 'forCarouselIndicator',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'ariaLabel() || positionLabel()',\n '[attr.aria-current]': 'current() ? \"true\" : null',\n '[attr.data-state]': 'current() ? \"active\" : \"inactive\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\n '[attr.tabindex]': 'tabindex()',\n '(click)': 'onClick()',\n '(focus)': 'onFocus()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForCarouselIndicator {\n protected readonly buttonType = hostButtonType();\n\n protected readonly ctx = injectCarouselContext('ForCarouselIndicator');\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Override the default positional `aria-label` (e.g. `\"Go to slide 1\"`).\n * Use this to provide a more descriptive label when the slide has a title.\n * Localize that default format app-wide via `provideForCarouselDefaults`'s\n * `indicatorLabel`.\n */\n readonly ariaLabel = input<string | null>(null);\n\n /**\n * Disables this indicator. Disabled indicators remain focusable (for\n * assistive tech) but ignore click and keyboard activation.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly #index = computed(() => this.ctx.indexOfIndicator(this.#host.nativeElement));\n\n /** Whether this indicator corresponds to the current active slide. */\n protected readonly current = computed(() => this.ctx.isCurrent(this.#index()));\n\n /** Default positional label used when no explicit `ariaLabel` is set. */\n protected readonly positionLabel = computed(() => {\n const i = this.#index();\n return i < 0 ? null : this.ctx.indicatorLabel(i + 1);\n });\n\n /**\n * APG roving tabindex: user-driven roving owns it once any indicator has\n * been focused. Before that, fall back to \"current slide's indicator, else\n * first enabled\".\n */\n protected readonly tabindex = computed<-1 | 0>(() =>\n rovingTabStop({\n disabled: this.disabled(),\n selected: this.current(),\n hasSelected: this.ctx.hasCurrentIndicator(),\n isFirstEnabled: this.ctx.isFirstEnabledIndicator(this.#host.nativeElement),\n roving: this.ctx.roving,\n host: this.#host.nativeElement,\n }),\n );\n\n constructor() {\n const handle = { host: this.#host.nativeElement, disabled: this.disabled };\n registerHandle(\n handle,\n (h) => this.ctx.registerIndicator(h),\n (h) => this.ctx.unregisterIndicator(h),\n );\n }\n\n protected onClick(): void {\n if (this.disabled()) {\n return;\n }\n this.ctx.scrollTo(this.#index());\n }\n\n protected onFocus(): void {\n if (this.disabled()) {\n return;\n }\n this.ctx.roving.setActive(this.#host.nativeElement);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (this.disabled()) {\n return;\n }\n const action = resolveListNavigation(event, {\n orientation: this.ctx.orientation(),\n dir: this.ctx.dir(),\n });\n if (!action) {\n return;\n }\n event.preventDefault();\n this.ctx.navigate(this.#host.nativeElement, action);\n }\n}\n","import { computed, Directive, inject, input } from '@angular/core';\n\nimport { hostButtonType } from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\nimport { FOR_CAROUSEL_DEFAULTS } from './carousel-defaults';\n\n/**\n * Play/pause control for carousel auto-rotation. Apply on a `<button>` so\n * Enter/Space activation is native. Its accessible name swaps with the\n * rotation state — `stopLabel` while rotating, `startLabel` while stopped —\n * per the WAI-ARIA APG Carousel pattern, which forbids `aria-pressed` here.\n * Both labels default to the scope's `rotationStopLabel` / `rotationStartLabel`\n * (`provideForCarouselDefaults`), so they can be localized centrally.\n *\n * Place this control **first** in the carousel's DOM/tab order so assistive\n * technology users meet it before the rotating content (APG requirement).\n *\n * Reflects a boolean `data-playing` attribute (present while rotation is on)\n * as the styling hook for swapping a play/pause icon.\n */\n@Directive({\n selector: '[forCarouselRotationControl]',\n exportAs: 'forCarouselRotationControl',\n host: {\n '[attr.type]': 'buttonType()',\n '[attr.aria-label]': 'label()',\n '[attr.data-playing]': 'ctx.playing() ? \"\" : null',\n '(click)': 'ctx.toggleAutoplay()',\n },\n})\nexport class ForCarouselRotationControl {\n protected readonly buttonType = hostButtonType();\n\n protected readonly ctx = injectCarouselContext('ForCarouselRotationControl');\n readonly #defaults = inject(FOR_CAROUSEL_DEFAULTS);\n\n /**\n * Accessible name shown while rotation is **stopped** (the button will start\n * it). Defaults to the scope's `rotationStartLabel` (`'Start automatic slide\n * show'` unless overridden via `provideForCarouselDefaults`); set `null` to\n * drop `aria-label` when the button already carries a visible text label.\n */\n readonly startLabel = input<string | null>(this.#defaults.rotationStartLabel);\n\n /**\n * Accessible name shown while rotation is **playing** (the button will stop\n * it). Defaults to the scope's `rotationStopLabel` (`'Stop automatic slide\n * show'` unless overridden via `provideForCarouselDefaults`); set `null` to\n * drop `aria-label` when the button already carries a visible text label.\n */\n readonly stopLabel = input<string | null>(this.#defaults.rotationStopLabel);\n\n /** The current accessible name — `stopLabel` while playing, else `startLabel`. */\n protected readonly label = computed(\n () => (this.ctx.playing() ? this.stopLabel() : this.startLabel()) || null,\n );\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\nimport {\n attachSwipeDismiss,\n type SwipeDirection,\n type SwipeEventDetail,\n isScrollableAtEdge,\n injectPrefersReducedMotion,\n flickVelocity,\n FLICK_STALE_VELOCITY_MS,\n FLICK_VELOCITY_PX_PER_MS,\n} from 'forty-cdk/core';\nimport { injectCarouselContext } from './carousel-context';\n\n/**\n * Opt-in pointer drag / swipe directive for the Carousel viewport. Apply on the\n * `[forCarouselViewport]` element to enable horizontal or vertical drag-to-navigate.\n *\n * Publishes `--for-carousel-swipe-movement-x` (horizontal) or\n * `--for-carousel-swipe-movement-y` (vertical) in px during the gesture — only\n * the property matching `orientation` is written — so the consumer can\n * compose it with `--for-carousel-offset` for live track motion. Reflects\n * `data-dragging` while the gesture is armed. Sets `touch-action` automatically\n * to free the cross axis for page scrolling.\n *\n * Under `prefers-reduced-motion: reduce` the live offset is suppressed, but the\n * gesture still snaps `activeIndex` on release (D3).\n */\n@Directive({\n selector: '[forCarouselDrag]',\n exportAs: 'forCarouselDrag',\n host: {\n '[style.--for-carousel-swipe-movement-x]': 'swipeMovementX()',\n '[style.--for-carousel-swipe-movement-y]': 'swipeMovementY()',\n '[attr.data-dragging]': \"dragging() ? '' : null\",\n '[style.touch-action]': 'touchAction()',\n '(dragstart)': 'onDragStart($event)',\n },\n})\nexport class ForCarouselDrag {\n protected readonly ctx = injectCarouselContext('ForCarouselDrag');\n\n /** Disable pointer drag without removing the directive. Default `false`. */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #destroyRef = inject(DestroyRef);\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n readonly #prefersReducedMotion = injectPrefersReducedMotion();\n\n readonly #dragging = signal(false);\n readonly #dragPx = signal(0);\n\n /** Whether a drag gesture is currently armed (reflected as `data-dragging`). */\n readonly dragging = this.#dragging.asReadonly();\n\n /** `touch-action` for the viewport: capture the primary axis, free the cross axis. */\n readonly touchAction = computed<string | null>(() => {\n if (this.disabled()) return null;\n return this.ctx.orientation() === 'vertical' ? 'pan-x' : 'pan-y';\n });\n\n /** Live px displacement along the primary axis; `null` at rest and under reduced motion (D3). */\n readonly #swipeMovement = computed<string | null>(() => {\n if (this.#prefersReducedMotion()) return null;\n const px = this.#dragPx();\n return this.#dragging() && px !== 0 ? `${px}px` : null;\n });\n\n /** Live px displacement published as `--for-carousel-swipe-movement-x`; `null` on a vertical carousel. */\n readonly swipeMovementX = computed<string | null>(() =>\n this.ctx.orientation() === 'vertical' ? null : this.#swipeMovement(),\n );\n\n /** Live px displacement published as `--for-carousel-swipe-movement-y`; `null` on a horizontal carousel. */\n readonly swipeMovementY = computed<string | null>(() =>\n this.ctx.orientation() === 'vertical' ? this.#swipeMovement() : null,\n );\n\n #startPrimary = 0;\n #lastPrimary = 0;\n #lastTime = 0;\n #velocity = 0;\n #slideSizePx = 0;\n\n constructor() {\n if (!this.#isBrowser) return;\n const cleanup = attachSwipeDismiss({\n element: this.#host.nativeElement,\n getDirections: () => this.#directions(),\n getThreshold: () => 1,\n canBegin: (d) => this.#canBegin(d),\n onSwipeStart: (d) => this.#onStart(d),\n onSwipeMove: (d) => this.#onMove(d),\n onSwipeEnd: (d) => this.#onRelease(d),\n onSwipeCancel: (d) => this.#onRelease(d),\n });\n this.#destroyRef.onDestroy(cleanup);\n }\n\n protected onDragStart(event: Event): void {\n if (this.#dragging()) event.preventDefault();\n }\n\n #directions(): readonly SwipeDirection[] {\n if (this.disabled()) return [];\n return this.ctx.orientation() === 'vertical' ? ['up', 'down'] : ['left', 'right'];\n }\n\n #primary(event: PointerEvent): number {\n return this.ctx.orientation() === 'vertical' ? event.clientY : event.clientX;\n }\n\n /** +1 if a positive primary-axis delta moves toward a higher index, else -1. */\n #nextPerPx(): number {\n // horizontal LTR: finger left (clientX↓) → next → -1\n // horizontal RTL: finger right (clientX↑) → next → +1\n // vertical: finger up (clientY↓) → next → -1\n return this.ctx.orientation() === 'horizontal' && this.ctx.dir() === 'rtl' ? 1 : -1;\n }\n\n #canBegin(detail: SwipeEventDetail): boolean {\n const target = detail.originalEvent.target as Element | null;\n return !(target && isScrollableAtEdge(target, detail.direction, this.#host.nativeElement));\n }\n\n #onStart(detail: SwipeEventDetail): void {\n const rect = this.#host.nativeElement.getBoundingClientRect();\n const axisSize = this.ctx.orientation() === 'vertical' ? rect.height : rect.width;\n this.#slideSizePx = axisSize / Math.max(1, this.ctx.slidesPerView());\n\n const p = this.#primary(detail.originalEvent);\n this.#startPrimary = p;\n this.#lastPrimary = p;\n this.#lastTime = detail.originalEvent.timeStamp || 0;\n this.#velocity = 0;\n this.#dragPx.set(0);\n this.#dragging.set(true);\n }\n\n #onMove(detail: SwipeEventDetail): void {\n if (!this.#dragging()) return;\n const event = detail.originalEvent;\n const p = this.#primary(event);\n const now = event.timeStamp || this.#lastTime + 1;\n const dt = Math.max(1, now - this.#lastTime);\n this.#velocity = (p - this.#lastPrimary) / dt;\n this.#lastPrimary = p;\n this.#lastTime = now;\n this.#dragPx.set(p - this.#startPrimary);\n }\n\n #onRelease(detail: SwipeEventDetail): void {\n if (!this.#dragging()) return;\n const dragPx = this.#dragPx();\n const releaseTime = detail.originalEvent.timeStamp || this.#lastTime;\n const staleVelocity = releaseTime - this.#lastTime > FLICK_STALE_VELOCITY_MS;\n this.#dragging.set(false);\n this.#dragPx.set(0);\n\n if (this.#slideSizePx <= 0) return;\n\n const sign = this.#nextPerPx();\n const slidesDragged = (dragPx * sign) / this.#slideSizePx;\n const velocityTowardNext = flickVelocity(this.#velocity * sign, staleVelocity);\n const target = resolveDragIndex(this.ctx.activeIndex(), slidesDragged, velocityTowardNext);\n this.ctx.scrollTo(target);\n }\n}\n\n/**\n * Pure nearest-index snap with velocity bias. `slidesDragged` is signed (positive\n * toward a higher index); `velocityTowardNext` is px/ms (positive toward a higher\n * index). A fast flick rounds toward the flick direction instead of to nearest.\n * Returns a raw (possibly out-of-range) index; the caller's `scrollTo` normalizes it.\n */\nexport function resolveDragIndex(\n activeIndex: number,\n slidesDragged: number,\n velocityTowardNext: number,\n): number {\n const float = activeIndex + slidesDragged;\n if (velocityTowardNext >= FLICK_VELOCITY_PX_PER_MS) return Math.ceil(float);\n if (velocityTowardNext <= -FLICK_VELOCITY_PX_PER_MS) return Math.floor(float);\n return Math.round(float);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAqGA;;;;;;;;;;AAUG;MACU,oBAAoB,GAAG,IAAI,cAAc,CAAqB,sBAAsB;AAuB3F,SAAU,qBAAqB,CAAC,KAAa,EAAA;AACjD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,oBAAoB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAA2B;IACtF,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,kBAAkB,CAAC;AACvB,YAAA,IAAI,EAAE,qBAAqB;YAC3B,KAAK;AACL,YAAA,IAAI,EAAE,eAAe;AACrB,YAAA,KAAK,EAAE,sBAAsB;AAC9B,SAAA,CAAC;IACJ;AACA,IAAA,iBAAiB,CAAC;AAChB,QAAA,UAAU,EAAE,UAAU;AACtB,QAAA,KAAK,EAAE,sBAAsB;A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