forty-cdk 0.6.0 → 0.7.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 (136) hide show
  1. package/accordion/README.md +9 -7
  2. package/calendar/README.md +1 -1
  3. package/combobox/README.md +1 -1
  4. package/context-menu/README.md +9 -0
  5. package/date-picker/README.md +12 -13
  6. package/date-range-field/README.md +7 -7
  7. package/dialog/README.md +7 -7
  8. package/drag-drop/README.md +9 -8
  9. package/drawer/README.md +9 -7
  10. package/fesm2022/forty-cdk-accordion.mjs +30 -11
  11. package/fesm2022/forty-cdk-accordion.mjs.map +1 -1
  12. package/fesm2022/forty-cdk-avatar.mjs +4 -3
  13. package/fesm2022/forty-cdk-avatar.mjs.map +1 -1
  14. package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -1
  15. package/fesm2022/forty-cdk-calendar.mjs +1 -1
  16. package/fesm2022/forty-cdk-calendar.mjs.map +1 -1
  17. package/fesm2022/forty-cdk-carousel.mjs +13 -2
  18. package/fesm2022/forty-cdk-carousel.mjs.map +1 -1
  19. package/fesm2022/forty-cdk-combobox.mjs +88 -56
  20. package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
  21. package/fesm2022/forty-cdk-context-menu.mjs +62 -5
  22. package/fesm2022/forty-cdk-context-menu.mjs.map +1 -1
  23. package/fesm2022/forty-cdk-core.mjs +531 -120
  24. package/fesm2022/forty-cdk-core.mjs.map +1 -1
  25. package/fesm2022/forty-cdk-date-field.mjs +12 -0
  26. package/fesm2022/forty-cdk-date-field.mjs.map +1 -1
  27. package/fesm2022/forty-cdk-date-picker.mjs +17 -10
  28. package/fesm2022/forty-cdk-date-picker.mjs.map +1 -1
  29. package/fesm2022/forty-cdk-date-range-field.mjs +26 -5
  30. package/fesm2022/forty-cdk-date-range-field.mjs.map +1 -1
  31. package/fesm2022/forty-cdk-dialog.mjs +47 -11
  32. package/fesm2022/forty-cdk-dialog.mjs.map +1 -1
  33. package/fesm2022/forty-cdk-drag-drop.mjs +50 -7
  34. package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
  35. package/fesm2022/forty-cdk-drawer.mjs +38 -18
  36. package/fesm2022/forty-cdk-drawer.mjs.map +1 -1
  37. package/fesm2022/forty-cdk-field.mjs +51 -30
  38. package/fesm2022/forty-cdk-field.mjs.map +1 -1
  39. package/fesm2022/forty-cdk-file-upload.mjs +53 -10
  40. package/fesm2022/forty-cdk-file-upload.mjs.map +1 -1
  41. package/fesm2022/forty-cdk-hover-card.mjs +32 -14
  42. package/fesm2022/forty-cdk-hover-card.mjs.map +1 -1
  43. package/fesm2022/forty-cdk-listbox.mjs +37 -1
  44. package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
  45. package/fesm2022/forty-cdk-menu.mjs +191 -218
  46. package/fesm2022/forty-cdk-menu.mjs.map +1 -1
  47. package/fesm2022/forty-cdk-menubar.mjs +36 -28
  48. package/fesm2022/forty-cdk-menubar.mjs.map +1 -1
  49. package/fesm2022/forty-cdk-navigation-menu.mjs +10 -2
  50. package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -1
  51. package/fesm2022/forty-cdk-number-input.mjs +32 -10
  52. package/fesm2022/forty-cdk-number-input.mjs.map +1 -1
  53. package/fesm2022/forty-cdk-otp-input.mjs +3 -0
  54. package/fesm2022/forty-cdk-otp-input.mjs.map +1 -1
  55. package/fesm2022/forty-cdk-pagination.mjs +20 -8
  56. package/fesm2022/forty-cdk-pagination.mjs.map +1 -1
  57. package/fesm2022/forty-cdk-pane-resizer.mjs +18 -2
  58. package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -1
  59. package/fesm2022/forty-cdk-radio-group.mjs +28 -14
  60. package/fesm2022/forty-cdk-radio-group.mjs.map +1 -1
  61. package/fesm2022/forty-cdk-scroll-area.mjs +18 -3
  62. package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -1
  63. package/fesm2022/forty-cdk-select.mjs +58 -12
  64. package/fesm2022/forty-cdk-select.mjs.map +1 -1
  65. package/fesm2022/forty-cdk-slider.mjs +20 -4
  66. package/fesm2022/forty-cdk-slider.mjs.map +1 -1
  67. package/fesm2022/forty-cdk-stepper.mjs +8 -1
  68. package/fesm2022/forty-cdk-stepper.mjs.map +1 -1
  69. package/fesm2022/forty-cdk-table.mjs +272 -25
  70. package/fesm2022/forty-cdk-table.mjs.map +1 -1
  71. package/fesm2022/forty-cdk-time-field.mjs +12 -0
  72. package/fesm2022/forty-cdk-time-field.mjs.map +1 -1
  73. package/fesm2022/forty-cdk-time-range-field.mjs +26 -5
  74. package/fesm2022/forty-cdk-time-range-field.mjs.map +1 -1
  75. package/fesm2022/forty-cdk-toast.mjs +24 -22
  76. package/fesm2022/forty-cdk-toast.mjs.map +1 -1
  77. package/fesm2022/forty-cdk-toggle.mjs +15 -0
  78. package/fesm2022/forty-cdk-toggle.mjs.map +1 -1
  79. package/fesm2022/forty-cdk-tooltip.mjs +53 -25
  80. package/fesm2022/forty-cdk-tooltip.mjs.map +1 -1
  81. package/fesm2022/forty-cdk-tree.mjs +109 -16
  82. package/fesm2022/forty-cdk-tree.mjs.map +1 -1
  83. package/fesm2022/forty-cdk-virtualization.mjs +20 -9
  84. package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
  85. package/field/README.md +13 -10
  86. package/file-upload/README.md +5 -0
  87. package/menu/README.md +3 -1
  88. package/package.json +1 -1
  89. package/radio-group/README.md +13 -11
  90. package/scroll-area/README.md +18 -2
  91. package/stepper/README.md +2 -2
  92. package/table/README.md +11 -8
  93. package/time-range-field/README.md +7 -7
  94. package/toast/README.md +10 -10
  95. package/tree/README.md +1 -1
  96. package/types/forty-cdk-accordion.d.ts +28 -8
  97. package/types/forty-cdk-calendar.d.ts +5 -17
  98. package/types/forty-cdk-carousel.d.ts +1 -0
  99. package/types/forty-cdk-combobox.d.ts +54 -26
  100. package/types/forty-cdk-context-menu.d.ts +22 -1
  101. package/types/forty-cdk-core.d.ts +270 -44
  102. package/types/forty-cdk-date-field.d.ts +8 -1
  103. package/types/forty-cdk-date-picker.d.ts +14 -12
  104. package/types/forty-cdk-date-range-field.d.ts +23 -10
  105. package/types/forty-cdk-dialog.d.ts +57 -8
  106. package/types/forty-cdk-drag-drop.d.ts +1 -0
  107. package/types/forty-cdk-drawer.d.ts +44 -14
  108. package/types/forty-cdk-dropdown-menu.d.ts +1 -0
  109. package/types/forty-cdk-field.d.ts +20 -13
  110. package/types/forty-cdk-file-upload.d.ts +13 -1
  111. package/types/forty-cdk-hover-card.d.ts +11 -1
  112. package/types/forty-cdk-internationalized-date.d.ts +1 -0
  113. package/types/forty-cdk-listbox.d.ts +17 -0
  114. package/types/forty-cdk-menu.d.ts +87 -49
  115. package/types/forty-cdk-menubar.d.ts +16 -9
  116. package/types/forty-cdk-navigation-menu.d.ts +2 -1
  117. package/types/forty-cdk-number-input.d.ts +15 -3
  118. package/types/forty-cdk-pagination.d.ts +24 -2
  119. package/types/forty-cdk-pane-resizer.d.ts +10 -0
  120. package/types/forty-cdk-popover.d.ts +1 -0
  121. package/types/forty-cdk-radio-group.d.ts +24 -12
  122. package/types/forty-cdk-scroll-area.d.ts +16 -1
  123. package/types/forty-cdk-select.d.ts +38 -0
  124. package/types/forty-cdk-slider.d.ts +10 -0
  125. package/types/forty-cdk-stepper.d.ts +7 -0
  126. package/types/forty-cdk-table.d.ts +80 -8
  127. package/types/forty-cdk-tabs.d.ts +1 -0
  128. package/types/forty-cdk-time-field.d.ts +8 -1
  129. package/types/forty-cdk-time-picker.d.ts +1 -0
  130. package/types/forty-cdk-time-range-field.d.ts +23 -10
  131. package/types/forty-cdk-toast.d.ts +3 -3
  132. package/types/forty-cdk-toggle.d.ts +10 -0
  133. package/types/forty-cdk-toolbar.d.ts +1 -0
  134. package/types/forty-cdk-tooltip.d.ts +41 -6
  135. package/types/forty-cdk-tree.d.ts +17 -1
  136. package/types/forty-cdk-virtualization.d.ts +16 -0
@@ -56,17 +56,19 @@ export class DemoFaq {
56
56
 
57
57
  ### `ForAccordion`
58
58
 
59
- | Property | Type | Description |
60
- | ------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
61
- | `value` | `model<readonly string[]>` | Currently open item values. In single mode the array has 0 or 1 element.<br>**Default:** — |
62
- | `multiple` | `input<boolean>` | When true, multiple items can be open simultaneously.<br>**Default:** `false` |
63
- | `collapsible` | `input<boolean>` | Single mode only: when true, the open item can be collapsed by clicking it. Otherwise once any item is open, exactly one stays open.<br>**Default:** `false` |
64
- | `orientation` | `input<'horizontal' \| 'vertical'>` | Layout direction of the trigger list. In horizontal mode ArrowLeft/Right replace ArrowUp/Down.<br>**Default:** `'vertical'` |
65
- | `dir` | `input<'ltr' \| 'rtl'>` | Writing direction. Only relevant in horizontal mode — swaps the meaning of Left/Right arrows.<br>**Default:** — |
59
+ | Property | Type | Description |
60
+ | ------------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
61
+ | `value` | `model<readonly string[]>` | Currently open item values. In single mode the array has 0 or 1 element.<br>**Default:** — |
62
+ | `multiple` | `input<boolean>` | When true, multiple items can be open simultaneously.<br>**Default:** `false` |
63
+ | `collapsible` | `input<boolean>` | Single mode only: when true, the open item can be collapsed by clicking it. Otherwise once any item is open, exactly one stays open.<br>**Default:** `false` |
64
+ | `disabled` | `input<boolean>` | When true, disables every item — each trigger reflects the native `disabled` attribute and cannot toggle. Composes with a per-item `[disabled]`.<br>**Default:** `false` |
65
+ | `orientation` | `input<'horizontal' \| 'vertical'>` | Layout direction of the trigger list. In horizontal mode ArrowLeft/Right replace ArrowUp/Down.<br>**Default:** `'vertical'` |
66
+ | `dir` | `input<'ltr' \| 'rtl'>` | Writing direction. Only relevant in horizontal mode — swaps the meaning of Left/Right arrows.<br>**Default:** — |
66
67
 
67
68
  | Data attribute | Values |
68
69
  | ------------------ | -------------------------- |
69
70
  | `data-orientation` | `horizontal` \| `vertical` |
71
+ | `data-disabled` | present \| absent |
70
72
 
71
73
  ### `ForAccordionItem`
72
74
 
@@ -125,7 +125,7 @@ The library is styleless: style the boolean `data-*` hooks on `[forCalendarCell]
125
125
  | ------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
126
126
  | `value` | `model<D \| null>` | Two-way bindable selected date, or `null`. Used in `selectionMode="single"`. `(valueChange)` fires only on internal selection.<br>**Default:** `null` |
127
127
  | `selectionMode` | `input<'single' \| 'range'>` | `'single'` (default) keeps the single-date `value` flow. `'range'` switches to anchor → commit and exposes `range`.<br>**Default:** `'single'` |
128
- | `range` | `model<CalendarDateRange<D> \| null>` | Two-way bindable committed range. Only used in `selectionMode="range"`. `(rangeChange)` fires only on internal commits/clears.<br>**Default:** `null` |
128
+ | `range` | `model<DateRange<D> \| null>` | Two-way bindable committed range. Only used in `selectionMode="range"`. `(rangeChange)` fires only on internal commits/clears.<br>**Default:** `null` |
129
129
  | `minRangeLength` | `input<number \| null>` | Minimum inclusive day count. A commit shorter than this is a no-op.<br>**Default:** `null` (no minimum) |
130
130
  | `maxRangeLength` | `input<number \| null>` | Maximum inclusive day count. A commit longer than this is a no-op.<br>**Default:** `null` (no maximum) |
131
131
  | `min` | `input<D \| null>` | Minimum selectable date (inclusive). Earlier dates are unavailable.<br>**Default:** `null` |
@@ -22,7 +22,7 @@ The editable (default) anatomy — an `<input>` that filters a portaled listbox
22
22
  ```html
23
23
  <div forCombobox [(query)]="query" [(value)]="value">
24
24
  <input forComboboxInput placeholder="Search…" />
25
- <button forComboboxClear aria-label="Clear">×</button>
25
+ <button forComboboxClear>×</button>
26
26
 
27
27
  <!-- @if (open()) { -->
28
28
  <div forComboboxContent>
@@ -154,4 +154,13 @@ forty-cdk ships no styles. Add your own class to each piece — the for\* select
154
154
  - **Virtual anchor.** Right-click captures a 0×0 rect at the pointer location. `Shift+F10` and `ContextMenu` snapshot the bounding rect of the focused element (or the trigger if focus is on it directly), so the menu floats off the element under attention. Both forms feed floating-ui's `flip` and `shift` middleware, so corners and screen edges work without special-casing.
155
155
  - **Keyboard activators only fire while focus is inside the trigger.** Keyboard events dispatch to the focused element, so `Shift+F10` / `ContextMenu` anywhere outside the trigger goes to the browser default. The trigger is focusable by default (host-bound `tabindex="-1"`), so this works out of the box; use `tabindex="0"` if you want the region itself reachable via Tab.
156
156
  - **Native menu suppressed.** The trigger calls `event.preventDefault()` on `contextmenu` and on the keyboard activators. Set `disabled` to let the browser's native menu surface for that region.
157
+ - **Touch long-press.** The trigger runs its own long-press timer (a `touch` `pointerdown` held ~500 ms, without lifting or moving past a small tolerance, opens the menu at the touch point). This is required because iOS Safari never fires the `contextmenu` event a long-press synthesizes elsewhere; where the browser does synthesize it (Android, desktop touch emulation) the two paths stay mutually exclusive, so the menu opens exactly once. For the press to survive on iOS, suppress the native callout / text-selection on the trigger with CSS — otherwise the OS gesture cancels the press:
158
+
159
+ ```css
160
+ .context-menu-trigger {
161
+ -webkit-touch-callout: none;
162
+ user-select: none;
163
+ }
164
+ ```
165
+
157
166
  - **Mount equals open.** Same convention as the rest of the library — wrap `[forMenuContent]` in `@if (open())` and use `animate.enter` / `animate.leave` for transitions.
@@ -267,12 +267,12 @@ The value display (`[forDatePickerValue]`) automatically appends the time to its
267
267
 
268
268
  ## Range selection
269
269
 
270
- Set `selectionMode="range"` on both the picker root and the projected calendar and bind `[(range)]` to a `CalendarDateRange<D> | null` signal.
270
+ Set `selectionMode="range"` on both the picker root and the projected calendar and bind `[(range)]` to a `DateRange<D> | null` signal.
271
271
 
272
272
  ```ts
273
- import { type CalendarDateRange } from 'forty-cdk/calendar';
273
+ import { type DateRange } from 'forty-cdk/date-picker';
274
274
 
275
- readonly dateRange = signal<CalendarDateRange<CalendarDate> | null>(null);
275
+ readonly dateRange = signal<DateRange<CalendarDate> | null>(null);
276
276
  ```
277
277
 
278
278
  ```html
@@ -303,25 +303,24 @@ readonly dateRange = signal<CalendarDateRange<CalendarDate> | null>(null);
303
303
 
304
304
  **v1 scope.** Range mode is day-granular only (`granularity` / time is not supported in v1). The `[(range)]` model is not a `FormValueControl` target — it does not integrate with `[formField]` in v1. `minRangeLength` / `maxRangeLength` are configured on the projected `[forCalendar]` directly.
305
305
 
306
- | New input / model | Type | Description |
307
- | ----------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------- |
308
- | `selectionMode` | `input<'single' \| 'range'>` | `'single'` keeps the existing `value` flow. `'range'` switches to range mode. |
309
- | `range` | `model<CalendarDateRange<D> \| null>` | Two-way bindable committed range. `(rangeChange)` fires only on commit / clear. Default `null`. |
310
- | `rangeSeparator` | `input<string>` | String placed between start and end in the formatted display. Default `' – '`. |
306
+ | New input / model | Type | Description |
307
+ | ----------------- | ----------------------------- | ----------------------------------------------------------------------------------------------- |
308
+ | `selectionMode` | `input<'single' \| 'range'>` | `'single'` keeps the existing `value` flow. `'range'` switches to range mode. |
309
+ | `range` | `model<DateRange<D> \| null>` | Two-way bindable committed range. `(rangeChange)` fires only on commit / clear. Default `null`. |
310
+ | `rangeSeparator` | `input<string>` | String placed between start and end in the formatted display. Default `' – '`. |
311
311
 
312
312
  ## Range as a Signal Forms value — `ForDateRangePicker`
313
313
 
314
- `ForDatePicker[selectionMode="range"]` exposes the range through a plain two-way `[(range)]` model with **no** form contract — so a range inside a form has to be hand-wired. `ForDateRangePicker` (selector `[forDateRangePicker]`) is the form-capable sibling: it is the root **and** the form value, implementing `FormValueControl<CalendarDateRange<D> | null>`, so the committed range auto-wires with `[formField]` exactly like any other control.
314
+ `ForDatePicker[selectionMode="range"]` exposes the range through a plain two-way `[(range)]` model with **no** form contract — so a range inside a form has to be hand-wired. `ForDateRangePicker` (selector `[forDateRangePicker]`) is the form-capable sibling: it is the root **and** the form value, implementing `FormValueControl<DateRange<D> | null>`, so the committed range auto-wires with `[formField]` exactly like any other control.
315
315
 
316
316
  It reuses the same pieces — `[forDatePickerTrigger]`, `[forDatePickerContent]`, `[forDatePickerValue]`, `[forDatePickerAnchor]` — through a shared base, and provides `FOR_DATE_PICKER_CONTEXT` so they resolve under it. Project a `[forCalendar]` in `selectionMode="range"` and bind its range to the picker's `value`; the two-click anchor → commit flow keeps `value` `null` until both endpoints are chosen (the form never sees a half-entered range), and `start <= end` is an invariant. Range is day-granular in v1 (no time composition).
317
317
 
318
318
  ```ts
319
- import { type CalendarDateRange } from 'forty-cdk/calendar';
320
- import { ForDateRangePicker } from 'forty-cdk/date-picker';
319
+ import { type DateRange, ForDateRangePicker } from 'forty-cdk/date-picker';
321
320
  import { form } from '@angular/forms/signals';
322
321
 
323
322
  interface Booking {
324
- stay: CalendarDateRange<CalendarDate> | null;
323
+ stay: DateRange<CalendarDate> | null;
325
324
  }
326
325
  readonly model = signal<Booking>({ stay: null });
327
326
  readonly booking = form(this.model, (p) => required(p.stay));
@@ -355,7 +354,7 @@ readonly booking = form(this.model, (p) => required(p.stay));
355
354
  </div>
356
355
  ```
357
356
 
358
- - **Form value.** The committed `CalendarDateRange<D> | null` is the `value` model. `null` is the empty state — pair it with `required(p.stay)` so `invalid()` flips when the form demands a range and none is committed. `touched` fires on commit and on close, exactly like the single-date picker.
357
+ - **Form value.** The committed `DateRange<D> | null` is the `value` model. `null` is the empty state — pair it with `required(p.stay)` so `invalid()` flips when the form demands a range and none is committed. `touched` fires on commit and on close, exactly like the single-date picker.
359
358
  - **Validity.** `start <= end` is guaranteed by construction and is never an error. Forward `minDate` / `maxDate` to the calendar's `[min]` / `[max]`, and `minRangeLength` / `maxRangeLength` to the calendar's `[minRangeLength]` / `[maxRangeLength]` (a too-short / too-long range is rejected as a no-op by the calendar's two-click flow).
360
359
  - **Native submission.** When `name` is set, two hidden inputs `<name>-start` / `<name>-end` mirror the committed endpoints as ISO `YYYY-MM-DD` for native `<form>` posts.
361
360
  - **Bounds naming.** `minDate` / `maxDate` (not `min` / `max`) for the same reason as `ForDatePicker` — and additionally because `FormUiControl.min` / `max` are typed `NonNullable<TValue>` (the range object itself), which is meaningless as a bound.
@@ -4,7 +4,7 @@ A segmented date (and optional time) range input over a pluggable date adapter:
4
4
 
5
5
  Headless, segmented, spin-editable — the keyboard-first, form-capable counterpart to [DateRangePicker](../date-picker/README.md). There is **no single WAI-ARIA APG pattern** for a range field; it is a composition of two labelled `role="group"` endpoints (start / end), each holding a row of spinbutton segments — the same machinery as [DateField](../date-field/README.md) — nested inside one outer `role="group"`. Segment **order** and separators follow the runtime locale (`MM/DD/YYYY` vs `DD.MM.YYYY` vs `YYYY/MM/DD`).
6
6
 
7
- `ForDateRangeField` implements `FormValueControl<CalendarDateRange<D> | null>` from `@angular/forms/signals` — the **same** contract as `ForDateRangePicker` — so the committed range auto-wires with `[formField]` and auto-associates inside a `[forField]` (label / description / error) with no extra markup. The value stays `null` until **both** endpoints are fully entered and ordered (`start <= end`); a half-entered or out-of-order range never reaches the form.
7
+ `ForDateRangeField` implements `FormValueControl<DateRange<D> | null>` from `@angular/forms/signals` — the **same** contract as `ForDateRangePicker` — so the committed range auto-wires with `[formField]` and auto-associates inside a `[forField]` (label / description / error) with no extra markup. The value stays `null` until **both** endpoints are fully entered and ordered (`start <= end`); a half-entered or out-of-order range never reaches the form.
8
8
 
9
9
  ## Date adapter
10
10
 
@@ -43,8 +43,8 @@ Pick one (required). All date math goes through the same pluggable `DateAdapter<
43
43
  ```ts
44
44
  import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
45
45
  import { CalendarDate } from '@internationalized/date';
46
- import { CalendarDateRange } from 'forty-cdk/calendar';
47
46
  import {
47
+ type DateRange,
48
48
  ForDateRangeField,
49
49
  ForDateRangeFieldEnd,
50
50
  ForDateRangeFieldLiteral,
@@ -91,7 +91,7 @@ import {
91
91
  `,
92
92
  })
93
93
  export class StayField {
94
- readonly stay = signal<CalendarDateRange<CalendarDate> | null>(null);
94
+ readonly stay = signal<DateRange<CalendarDate> | null>(null);
95
95
  }
96
96
  ```
97
97
 
@@ -101,8 +101,8 @@ export class StayField {
101
101
  import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
102
102
  import { form } from '@angular/forms/signals';
103
103
  import { CalendarDate } from '@internationalized/date';
104
- import { CalendarDateRange } from 'forty-cdk/calendar';
105
104
  import {
105
+ type DateRange,
106
106
  ForDateRangeField,
107
107
  ForDateRangeFieldEnd,
108
108
  ForDateRangeFieldLiteral,
@@ -149,7 +149,7 @@ import {
149
149
  `,
150
150
  })
151
151
  export class StayFormField {
152
- readonly model = signal({ stay: null as CalendarDateRange<CalendarDate> | null });
152
+ readonly model = signal({ stay: null as DateRange<CalendarDate> | null });
153
153
  readonly booking = form(this.model);
154
154
  }
155
155
  ```
@@ -160,7 +160,7 @@ export class StayFormField {
160
160
 
161
161
  | Property | Type | Description |
162
162
  | ------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
163
- | `value` | `model<CalendarDateRange<D> \| null>` | Two-way bindable committed range, or `null` while incomplete or out of order. The `FormValueControl` backing.<br>**Default:** `null` |
163
+ | `value` | `model<DateRange<D> \| null>` | Two-way bindable committed range, or `null` while incomplete or out of order. The `FormValueControl` backing.<br>**Default:** `null` |
164
164
  | `minDate` | `input<D \| null>` | Minimum date (inclusive) for both endpoints. A composed endpoint below it is clamped up. Named `minDate` — see note below.<br>**Default:** `null` |
165
165
  | `maxDate` | `input<D \| null>` | Maximum date (inclusive) for both endpoints. A composed endpoint above it is clamped down.<br>**Default:** `null` |
166
166
  | `granularity` | `input<'day' \| 'hour' \| 'minute' \| 'second'>` | Date-time precision shared by both endpoints. `'day'` is date-only; coarser-than-day appends time segments.<br>**Default:** `'day'` |
@@ -193,7 +193,7 @@ Plus the shared `FormUiControl` members from `@angular/forms/signals`: `disabled
193
193
 
194
194
  ## Ordering
195
195
 
196
- The two endpoints are typed independently, so order is not guaranteed by construction the way the picker's two-click flow guarantees it. The field preserves the `CalendarDateRange` `end >= start` invariant by **never emitting an out-of-order range**: when both endpoints are complete but `start > end`, the typed segments are kept (not silently rewritten), `value` stays `null`, and the root reflects `aria-invalid="true"` + `data-range-error` so the disorder is perceivable and stylable. Editing either endpoint back into order emits the range.
196
+ The two endpoints are typed independently, so order is not guaranteed by construction the way the picker's two-click flow guarantees it. The field preserves the `DateRange` `end >= start` invariant by **never emitting an out-of-order range**: when both endpoints are complete but `start > end`, the typed segments are kept (not silently rewritten), `value` stays `null`, and the root reflects `aria-invalid="true"` + `data-range-error` so the disorder is perceivable and stylable. Editing either endpoint back into order emits the range.
197
197
 
198
198
  ## Date-time range
199
199
 
package/dialog/README.md CHANGED
@@ -125,7 +125,7 @@ export class DemoHost {
125
125
  ConfirmDialog,
126
126
  { data: { message: 'Are you sure?' } },
127
127
  );
128
- const result = await ref.closed; // 'confirm' | 'cancel' | undefined
128
+ const { result } = await ref.closed; // result: 'confirm' | 'cancel' | undefined
129
129
  if (result === 'confirm') {
130
130
  /* ... */
131
131
  }
@@ -302,12 +302,12 @@ The dialog still installs the focus trap (so Tab cycles inside once focus enters
302
302
 
303
303
  ## Programmatic API
304
304
 
305
- | Symbol | Description |
306
- | ----------------------- | ------------------------------------------------------------------------------------------------------------------- |
307
- | `ForDialogManager` | Injectable. `open(component, config?)` returns a `ForDialogRef<R>`. |
308
- | `ForDialogRef<R>` | `close(result?)`, `closed: Promise<R \| undefined>`, `result: Signal<R \| undefined>`, `isClosed: Signal<boolean>`. |
309
- | `FOR_DIALOG_DATA` | Token for the `data` payload. Inject in the opened component. |
310
- | `injectDialogData<T>()` | Typed accessor for `FOR_DIALOG_DATA`. Returns `T \| null` — `null` when `open()` got no `data`. |
305
+ | Symbol | Description |
306
+ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
307
+ | `ForDialogManager` | Injectable. `open(component, config?)` returns a `ForDialogRef<R>`. |
308
+ | `ForDialogRef<R>` | `close(result?)`, `closed: Promise<{ reason: ForDialogCloseReason; result: R \| undefined }>`, `result: Signal<R \| undefined>`, `isClosed: Signal<boolean>`. |
309
+ | `FOR_DIALOG_DATA` | Token for the `data` payload. Inject in the opened component. |
310
+ | `injectDialogData<T>()` | Typed accessor for `FOR_DIALOG_DATA`. Returns `T \| null` — `null` when `open()` got no `data`. |
311
311
 
312
312
  ### `ForDialogOpenConfig`
313
313
 
@@ -7,14 +7,15 @@ whole dialog around by its header — see [`[forFreeDrag]`](#free-drag).
7
7
 
8
8
  ## Keyboard
9
9
 
10
- | State | Key | Action |
11
- | ------ | ----------- | ------------------------------------------ |
12
- | Idle | Arrow keys | Move roving focus between items |
13
- | Idle | Home / End | Jump to first / last item |
14
- | Idle | Space/Enter | **Lift** the focused item |
15
- | Lifted | Arrow keys | Step the logical drop position |
16
- | Lifted | Space/Enter | **Drop** (commits and emits `(dragDrop)`) |
17
- | Lifted | Escape | **Cancel** (no event, focus stays on item) |
10
+ | State | Key | Action |
11
+ | ------ | ----------- | ------------------------------------------------- |
12
+ | Idle | Arrow keys | Move roving focus between items |
13
+ | Idle | Home / End | Jump to first / last item |
14
+ | Idle | Space/Enter | **Lift** the focused item |
15
+ | Lifted | Arrow keys | Step the logical drop position |
16
+ | Lifted | Home / End | Jump the lifted item to the first / last position |
17
+ | Lifted | Space/Enter | **Drop** (commits and emits `(dragDrop)`) |
18
+ | Lifted | Escape | **Cancel** (no event, focus stays on item) |
18
19
 
19
20
  Arrow direction follows the list's `orientation` and respects RTL via `dir`. In
20
21
  `orientation="mixed"` every arrow key steps the lifted item linearly in DOM order.
package/drawer/README.md CHANGED
@@ -127,7 +127,7 @@ import {
127
127
  ></div>
128
128
  <div forDrawerHandle aria-hidden="true"></div>
129
129
  <h2 forDrawerTitle>Delete account?</h2>
130
- <p forDrawerDescription>{{ data.message }}</p>
130
+ <p forDrawerDescription>{{ data?.message }}</p>
131
131
  <button forDrawerClose [closeWith]="'cancel'">Cancel</button>
132
132
  <button forDrawerClose [closeWith]="'confirm'">Confirm</button>
133
133
  `,
@@ -150,7 +150,7 @@ class DemoHost {
150
150
  side: 'bottom',
151
151
  snapPoints: ['148px', 1],
152
152
  });
153
- const result = await ref.closed;
153
+ const { result } = await ref.closed;
154
154
  if (result === 'confirm') {
155
155
  // ...
156
156
  }
@@ -158,6 +158,8 @@ class DemoHost {
158
158
  }
159
159
  ```
160
160
 
161
+ `injectDrawerData<T>()` is typed `T | null`: the manager provides `null` when `open()` is called without `data`, so guard (`data?.message`) before dereferencing the payload. `await ref.closed` resolves `{ reason, result }` — the `reason` (a `ForDrawerCloseReason`) tells apart an imperative `close()` (`'programmatic'`) from Escape / backdrop / outside / swipe / close-button dismissals.
162
+
161
163
  Drawers opened by the manager join the same `ForDrawerStack` as declarative ones, so mixed stacking (a programmatic drawer over a declarative parent, or vice versa) reflects correct `data-depth` / `data-state-nested` and routes Escape through the LIFO dismissable layer.
162
164
 
163
165
  **Styling the programmatic overlay root.** The manager creates the `[forDrawer]` host for you and it is class-less. Pass `class` / `classList` to style it — the tokens land on the real host alongside `data-side` / `data-state` / the `--for-drawer-translate` custom property, so positioning CSS keyed on `data-side` works:
@@ -186,22 +188,22 @@ this.#drawers.open(ConfirmDrawer, {
186
188
 
187
189
  `class` is a single or space-separated string; `classList` is an array or space-separated string; both merge and de-dup and never clobber the host attributes. This replaces the old `inject(FOR_DRAWER_CONTEXT).hostElement.classList.add('my-drawer')` workaround.
188
190
 
189
- **Observing drag / release / active snap point.** A snap-point drawer opened imperatively has the same observability as the declarative `(dragMove)` / `(release)` / `(activeSnapPointChange)` outputs via the `onDrag` / `onRelease` / `onActiveSnapPointChange` config callbacks:
191
+ **Observing drag / release / active snap point.** A snap-point drawer opened imperatively has the same observability as the declarative `(dragMove)` / `(release)` / `(activeSnapPointChange)` outputs, via config callbacks of the same name:
190
192
 
191
193
  ```ts
192
194
  this.#drawers.open(ConfirmDrawer, {
193
195
  data,
194
196
  snapPoints: ['148px', '50%', 1],
195
197
  defaultSnapPoint: '148px',
196
- onDrag: ({ percentageDragged }) => this.dragProgress.set(percentageDragged),
197
- onRelease: ({ willClose, nextSnapPoint }) => {
198
+ dragMove: ({ percentageDragged }) => this.dragProgress.set(percentageDragged),
199
+ release: ({ willClose, nextSnapPoint }) => {
198
200
  /* … */
199
201
  },
200
- onActiveSnapPointChange: (snap) => this.activeSnap.set(snap),
202
+ activeSnapPointChange: (snap) => this.activeSnap.set(snap),
201
203
  });
202
204
  ```
203
205
 
204
- `onActiveSnapPointChange` fires with the landed snap on the mount-time default and every drag release — the read-back the declarative API exposes through `[(activeSnapPoint)]`. All three subscriptions are released automatically when the drawer closes.
206
+ `activeSnapPointChange` fires with the landed snap on the mount-time default and every drag release — the read-back the declarative API exposes through `[(activeSnapPoint)]`. All three subscriptions are released automatically when the drawer closes.
205
207
 
206
208
  ### Per-channel dismissal (Escape-only drawers)
207
209
 
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, input, booleanAttribute, model, Directive, signal, computed, ElementRef } from '@angular/core';
2
+ import { InjectionToken, inject, input, booleanAttribute, model, Directive, computed, signal, ElementRef } from '@angular/core';
3
3
  import { Collection, injectTextDirection, moveIndex, IdGenerator, adoptHostId, registerHandle, reflectDisabled, resolveListNavigation, createDefaults } from 'forty-cdk/core';
4
4
 
5
5
  const FOR_ACCORDION_CONTEXT = new InjectionToken('FOR_ACCORDION_CONTEXT');
@@ -45,6 +45,14 @@ class ForAccordion {
45
45
  #triggers = new Collection();
46
46
  /** When true, multiple items can be expanded simultaneously. */
47
47
  multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
48
+ /**
49
+ * When true, the whole accordion is disabled: every item's trigger reflects
50
+ * the native `disabled` attribute (dropped from the Tab order and skipped by
51
+ * arrow-key navigation) and cannot toggle. Composes with a per-item
52
+ * `[disabled]` — an item is effectively disabled when either is set. Mirrors
53
+ * the root `disabled` on `ForTabs` / `ForStepper` / `ForDisclosure`.
54
+ */
55
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
48
56
  /**
49
57
  * Single mode only: when true, the open item can be collapsed by clicking
50
58
  * its trigger. When false, exactly one item stays open at all times once
@@ -130,7 +138,7 @@ class ForAccordion {
130
138
  this.#triggers.unregister(handle);
131
139
  }
132
140
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordion, deps: [], target: i0.ɵɵFactoryTarget.Directive });
133
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: ForAccordion, isStandalone: true, selector: "[forAccordion]", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, _dirInput: { classPropertyName: "_dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-orientation": "orientation()", "attr.dir": "dir()" } }, providers: [{ provide: FOR_ACCORDION_CONTEXT, useExisting: ForAccordion }], exportAs: ["forAccordion"], ngImport: i0 });
141
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: ForAccordion, isStandalone: true, selector: "[forAccordion]", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, collapsible: { classPropertyName: "collapsible", publicName: "collapsible", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, _dirInput: { classPropertyName: "_dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, loop: { classPropertyName: "loop", publicName: "loop", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-orientation": "orientation()", "attr.data-disabled": "disabled() ? \"\" : null", "attr.dir": "dir()" } }, providers: [{ provide: FOR_ACCORDION_CONTEXT, useExisting: ForAccordion }], exportAs: ["forAccordion"], ngImport: i0 });
134
142
  }
135
143
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordion, decorators: [{
136
144
  type: Directive,
@@ -139,11 +147,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
139
147
  exportAs: 'forAccordion',
140
148
  host: {
141
149
  '[attr.data-orientation]': 'orientation()',
150
+ '[attr.data-disabled]': 'disabled() ? "" : null',
142
151
  '[attr.dir]': 'dir()',
143
152
  },
144
153
  providers: [{ provide: FOR_ACCORDION_CONTEXT, useExisting: ForAccordion }],
145
154
  }]
146
- }], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], _dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
155
+ }], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], collapsible: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsible", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], _dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], loop: [{ type: i0.Input, args: [{ isSignal: true, alias: "loop", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
147
156
 
148
157
  /**
149
158
  * One section of a `ForAccordion`. Owns the unique `value` identifying this
@@ -157,13 +166,23 @@ class ForAccordionItem {
157
166
  value = input.required(/* @ts-ignore */
158
167
  ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
159
168
  /**
160
- * When true, the trigger ignores clicks and reflects the native `disabled`
161
- * attribute (not `aria-disabled`). The trigger is therefore dropped from the
162
- * Tab order and skipped by arrow-key navigation, but stays in the
163
- * accessibility tree so screen readers still announce it. See
164
- * `ForAccordionTrigger` for the rationale (rule #561 D2).
169
+ * When true, this item's trigger ignores clicks and reflects the native
170
+ * `disabled` attribute (not `aria-disabled`): dropped from the Tab order and
171
+ * skipped by arrow-key navigation, but kept in the accessibility tree so
172
+ * screen readers still announce it. See `ForAccordionTrigger` for the
173
+ * rationale (rule #561 D2). Bind via `[disabled]`; read the composed
174
+ * {@link disabled} for state.
165
175
  */
166
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
176
+ disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'disabled' });
177
+ /**
178
+ * Effective disabled: this item's own `[disabled]` OR'd with the root
179
+ * `[forAccordion]`'s `disabled`. Everything that gates on the item's disabled
180
+ * state — native attribute reflection, trigger click, arrow-navigation skip,
181
+ * `data-disabled` — reads this, so disabling the whole accordion disables
182
+ * every item.
183
+ */
184
+ disabled = computed(() => this.disabledInput() || this.parent.disabled(), /* @ts-ignore */
185
+ ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
167
186
  #triggerId = signal(this.#idGen.next('for-accordion-trigger'), /* @ts-ignore */
168
187
  ...(ngDevMode ? [{ debugName: "#triggerId" }] : /* istanbul ignore next */ []));
169
188
  #contentId = signal(this.#idGen.next('for-accordion-content'), /* @ts-ignore */
@@ -191,7 +210,7 @@ class ForAccordionItem {
191
210
  this.parent.toggle(this.value());
192
211
  }
193
212
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
194
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: ForAccordionItem, isStandalone: true, selector: "[forAccordionItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-state": "expanded() ? \"open\" : \"closed\"", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-orientation": "parent.orientation()" } }, providers: [{ provide: FOR_ACCORDION_ITEM_CONTEXT, useExisting: ForAccordionItem }], exportAs: ["forAccordionItem"], ngImport: i0 });
213
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: ForAccordionItem, isStandalone: true, selector: "[forAccordionItem]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-state": "expanded() ? \"open\" : \"closed\"", "attr.data-disabled": "disabled() ? \"\" : null", "attr.data-orientation": "parent.orientation()" } }, providers: [{ provide: FOR_ACCORDION_ITEM_CONTEXT, useExisting: ForAccordionItem }], exportAs: ["forAccordionItem"], ngImport: i0 });
195
214
  }
196
215
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordionItem, decorators: [{
197
216
  type: Directive,
@@ -205,7 +224,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
205
224
  },
206
225
  providers: [{ provide: FOR_ACCORDION_ITEM_CONTEXT, useExisting: ForAccordionItem }],
207
226
  }]
208
- }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
227
+ }], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
209
228
 
210
229
  /**
211
230
  * Header button for a `ForAccordionItem`. Apply on a `<button>` wrapped in a
@@ -1 +1 @@
1
- {"version":3,"file":"forty-cdk-accordion.mjs","sources":["../../../projects/forty-cdk/accordion/src/accordion-context.ts","../../../projects/forty-cdk/accordion/src/accordion.ts","../../../projects/forty-cdk/accordion/src/accordion-item.ts","../../../projects/forty-cdk/accordion/src/accordion-trigger.ts","../../../projects/forty-cdk/accordion/src/accordion-content.ts","../../../projects/forty-cdk/accordion/src/accordion-defaults.ts","../../../projects/forty-cdk/accordion/src/forty-cdk-accordion.ts"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport { type ListNavigationAction, type WritingDirection } from 'forty-cdk/core';\n\n/**\n * Registry entry for one `ForAccordionTrigger`. Triggers register their host\n * element so the root can drive keyboard navigation over its own triggers\n * without an unscoped DOM query that would leak into nested accordions.\n */\nexport interface ForAccordionTriggerHandle {\n readonly host: HTMLElement;\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Coordination contract owned by the `ForAccordion` root.\n * Items derive their state from this context; triggers route clicks and\n * keyboard navigation through it.\n */\nexport interface ForAccordionContext {\n readonly multiple: Signal<boolean>;\n readonly collapsible: Signal<boolean>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n readonly dir: Signal<WritingDirection>;\n isExpanded(itemValue: string): boolean;\n toggle(itemValue: string): void;\n /** Whether the given item is allowed to collapse right now. */\n canCollapse(itemValue: string): boolean;\n /**\n * Focus a sibling trigger relative to the one currently focused. Disabled\n * triggers are skipped. `currentTrigger` is the element from which the\n * keyboard event originated. Navigation stays within this accordion's own\n * registered triggers, so a nested accordion does not cross-contaminate.\n */\n focusByOffset(currentTrigger: HTMLElement, action: ListNavigationAction): void;\n registerTrigger(handle: ForAccordionTriggerHandle): void;\n unregisterTrigger(handle: ForAccordionTriggerHandle): void;\n}\n\n/**\n * Per-item state contract. Provided by `ForAccordionItem`, consumed by\n * its `ForAccordionTrigger` and `ForAccordionContent`.\n */\nexport interface ForAccordionItemContext {\n readonly expanded: Signal<boolean>;\n readonly disabled: Signal<boolean>;\n readonly value: Signal<string>;\n readonly triggerId: Signal<string>;\n readonly contentId: Signal<string>;\n /** Adopts a consumer-set static `id` on the trigger host into `triggerId`. */\n adoptTriggerId(el: HTMLElement): void;\n /** Adopts a consumer-set static `id` on the content host into `contentId`. */\n adoptContentId(el: HTMLElement): void;\n toggle(): void;\n}\n\nexport const FOR_ACCORDION_CONTEXT = new InjectionToken<ForAccordionContext>(\n 'FOR_ACCORDION_CONTEXT',\n);\n\nexport const FOR_ACCORDION_ITEM_CONTEXT = new InjectionToken<ForAccordionItemContext>(\n 'FOR_ACCORDION_ITEM_CONTEXT',\n);\n\nexport function injectAccordionContext(piece: string): ForAccordionContext {\n const ctx = inject(FOR_ACCORDION_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(`[forty-cdk/accordion] ${piece} must be used inside a [forAccordion] element.`);\n }\n return ctx;\n}\n\nexport function injectAccordionItemContext(piece: string): ForAccordionItemContext {\n const ctx = inject(FOR_ACCORDION_ITEM_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(\n `[forty-cdk/accordion] ${piece} must be used inside a [forAccordionItem] element.`,\n );\n }\n return ctx;\n}\n","import { booleanAttribute, Directive, input, model } from '@angular/core';\n\nimport {\n Collection,\n type ListNavigationAction,\n moveIndex,\n type WritingDirection,\n injectTextDirection,\n} from 'forty-cdk/core';\nimport {\n FOR_ACCORDION_CONTEXT,\n type ForAccordionContext,\n type ForAccordionTriggerHandle,\n} from './accordion-context';\n\n/**\n * Root of the Accordion primitive. Holds the open value(s) and orchestrates\n * single/multiple expansion, collapse rules, and keyboard navigation between\n * triggers.\n *\n * Implements the [WAI-ARIA Accordion pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).\n *\n * State is modeled as `value: readonly string[]` regardless of mode:\n * - In single mode (`multiple=false`, default), the array has 0 or 1 element.\n * - In multiple mode, any number of items can be open.\n *\n * @example\n * ```html\n * <div forAccordion [(value)]=\"open\" collapsible>\n * <div forAccordionItem value=\"a\">\n * <h3><button type=\"button\" forAccordionTrigger>A</button></h3>\n * <section forAccordionContent>...</section>\n * </div>\n * <div forAccordionItem value=\"b\">...</div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[forAccordion]',\n exportAs: 'forAccordion',\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.dir]': 'dir()',\n },\n providers: [{ provide: FOR_ACCORDION_CONTEXT, useExisting: ForAccordion }],\n})\nexport class ForAccordion implements ForAccordionContext {\n readonly #triggers = new Collection<ForAccordionTriggerHandle>();\n\n /** When true, multiple items can be expanded simultaneously. */\n readonly multiple = input(false, { transform: booleanAttribute });\n\n /**\n * Single mode only: when true, the open item can be collapsed by clicking\n * its trigger. When false, exactly one item stays open at all times once\n * any has been opened.\n */\n readonly collapsible = input(false, { transform: booleanAttribute });\n\n /**\n * Layout direction of the trigger list. `'vertical'` (default) maps\n * ArrowUp/Down to prev/next; `'horizontal'` maps ArrowLeft/Right (with RTL\n * swap when `dir='rtl'`).\n */\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n /**\n * Writing direction. Only relevant when `orientation='horizontal'`. When\n * unset (default `null`), the inherited ambient direction is resolved from\n * the nearest ancestor carrying a `dir` attribute (or `<html dir>`),\n * defaulting to `'ltr'`. An explicit `[dir]` always wins. The resolved\n * value is reflected to the host `dir` attribute and drives arrow-key\n * semantics.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n /**\n * When true (default), arrow navigation between triggers wraps at the ends —\n * moving past the last trigger focuses the first and vice versa. Set `false`\n * to stop at the boundaries. Mirrors the `loop` input on `ForTabs` and\n * `ForListbox`.\n */\n readonly loop = input(true, { transform: booleanAttribute });\n\n /**\n * Two-way bindable. List of currently expanded item values. In single\n * mode the array has 0 or 1 element. The `model()` change emitter\n * (`(valueChange)`) fires only on internal toggles, never on consumer\n * writes via `[(value)]` — observe transitions without binding back.\n */\n readonly value = model<readonly string[]>([]);\n\n isExpanded(itemValue: string): boolean {\n return this.value().includes(itemValue);\n }\n\n toggle(itemValue: string): void {\n const current = this.value();\n const isOpen = current.includes(itemValue);\n\n if (isOpen) {\n if (!this.canCollapse(itemValue)) {\n return;\n }\n this.value.set(current.filter((v) => v !== itemValue));\n return;\n }\n\n if (this.multiple()) {\n this.value.set([...current, itemValue]);\n } else {\n this.value.set([itemValue]);\n }\n }\n\n canCollapse(_itemValue: string): boolean {\n return this.multiple() || this.collapsible();\n }\n\n focusByOffset(currentTrigger: HTMLElement, action: ListNavigationAction): void {\n const triggers = this.#triggers.items();\n if (triggers.length === 0) {\n return;\n }\n const currentIndex = triggers.findIndex((t) => t.host === currentTrigger);\n if (currentIndex === -1 && action !== 'first' && action !== 'last') {\n return;\n }\n const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, triggers.length, action, {\n loop: this.loop(),\n isDisabled: (i) => triggers[i]?.disabled() ?? false,\n });\n if (next !== null) {\n triggers[next]?.host.focus();\n }\n }\n\n registerTrigger(handle: ForAccordionTriggerHandle): void {\n this.#triggers.register(handle);\n }\n\n unregisterTrigger(handle: ForAccordionTriggerHandle): void {\n this.#triggers.unregister(handle);\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input, signal } from '@angular/core';\n\nimport { adoptHostId, IdGenerator } from 'forty-cdk/core';\nimport {\n FOR_ACCORDION_ITEM_CONTEXT,\n type ForAccordionItemContext,\n injectAccordionContext,\n} from './accordion-context';\n\n/**\n * One section of a `ForAccordion`. Owns the unique `value` identifying this\n * item to the root and exposes the per-item context that the trigger and\n * content read.\n */\n@Directive({\n selector: '[forAccordionItem]',\n exportAs: 'forAccordionItem',\n host: {\n '[attr.data-state]': 'expanded() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-orientation]': 'parent.orientation()',\n },\n providers: [{ provide: FOR_ACCORDION_ITEM_CONTEXT, useExisting: ForAccordionItem }],\n})\nexport class ForAccordionItem implements ForAccordionItemContext {\n protected readonly parent = injectAccordionContext('ForAccordionItem');\n readonly #idGen = inject(IdGenerator);\n\n /** Unique identifier of this item within the accordion. Required. */\n readonly value = input.required<string>();\n\n /**\n * When true, the trigger ignores clicks and reflects the native `disabled`\n * attribute (not `aria-disabled`). The trigger is therefore dropped from the\n * Tab order and skipped by arrow-key navigation, but stays in the\n * accessibility tree so screen readers still announce it. See\n * `ForAccordionTrigger` for the rationale (rule #561 D2).\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n readonly #triggerId = signal(this.#idGen.next('for-accordion-trigger'));\n readonly #contentId = signal(this.#idGen.next('for-accordion-content'));\n\n readonly triggerId = this.#triggerId.asReadonly();\n readonly contentId = this.#contentId.asReadonly();\n\n readonly expanded = computed(() => this.parent.isExpanded(this.value()));\n\n /**\n * Adopts a consumer-set static `id` on the `[forAccordionTrigger]` host into\n * `triggerId` (preserving anchors / external `aria-labelledby` references /\n * label `for`) instead of letting the `[id]` host binding clobber it.\n */\n adoptTriggerId(el: HTMLElement): void {\n adoptHostId(el, this.#triggerId);\n }\n\n /** Adopts a consumer-set static `id` on the content host into `contentId`. */\n adoptContentId(el: HTMLElement): void {\n adoptHostId(el, this.#contentId);\n }\n\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n this.parent.toggle(this.value());\n }\n}\n","import { computed, Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, reflectDisabled, resolveListNavigation } from 'forty-cdk/core';\nimport { injectAccordionContext, injectAccordionItemContext } from './accordion-context';\n\n/**\n * Header button for a `ForAccordionItem`. Apply on a `<button>` wrapped in a\n * heading element (`<h2>`–`<h6>`) so APG landmark navigation works. The\n * directive host-binds `type=\"button\"` so a trigger inside a `<form>` never\n * submits it on toggle.\n *\n * Handles ARIA wiring, click-to-toggle, and the recommended keyboard\n * navigation (ArrowDown / ArrowUp / Home / End).\n *\n * `aria-controls` is emitted only while the item is expanded — mirroring the\n * overlay triggers' open-only gating — so the reference never dangles at an\n * unmounted panel under the recommended `@if (item.expanded())` mount pattern.\n */\n@Directive({\n selector: '[forAccordionTrigger]',\n exportAs: 'forAccordionTrigger',\n host: {\n type: 'button',\n '[id]': 'item.triggerId()',\n '[attr.aria-expanded]': 'item.expanded() ? \"true\" : \"false\"',\n '[attr.aria-controls]': 'item.expanded() ? item.contentId() : null',\n '[attr.aria-disabled]': 'ariaDisabled() ? \"true\" : null',\n '[attr.data-state]': 'item.expanded() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'parent.orientation()',\n '(click)': 'item.toggle()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForAccordionTrigger {\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n protected readonly parent = injectAccordionContext('ForAccordionTrigger');\n protected readonly item = injectAccordionItemContext('ForAccordionTrigger');\n\n /**\n * APG: aria-disabled is true only when the panel is open AND the accordion\n * disallows collapse. A real `disabled` item is reflected via the native\n * `disabled` attribute instead — the sanctioned exception in rule #561 (D2):\n * the trigger is a real single-purpose `<button>`, not a roving collection\n * item (every trigger stays independently in the Tab order; the arrow-key\n * navigation is an APG-optional enhancement layered on top, not a\n * roving-tabindex collection), so native `disabled` is correct here. The\n * button stays in the accessibility tree — screen readers still announce it\n * as unavailable in browse mode — while being dropped from the Tab order and\n * the arrow-key navigation (which `focusByOffset` already skips), keeping\n * disabled triggers uniformly unreachable. The APG Accordion pattern does not\n * require disabled headers to remain focusable.\n */\n protected readonly ariaDisabled = computed(() => {\n if (this.item.disabled()) {\n return false;\n }\n return this.item.expanded() && !this.parent.canCollapse(this.item.value());\n });\n\n constructor() {\n this.item.adoptTriggerId(this.#host.nativeElement);\n const handle = {\n host: this.#host.nativeElement,\n disabled: this.item.disabled,\n };\n registerHandle(\n handle,\n (h) => this.parent.registerTrigger(h),\n (h) => this.parent.unregisterTrigger(h),\n );\n reflectDisabled(this.item.disabled);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n const action = resolveListNavigation(event, {\n orientation: this.parent.orientation(),\n dir: this.parent.dir(),\n });\n if (!action) {\n return;\n }\n event.preventDefault();\n this.parent.focusByOffset(this.#host.nativeElement, action);\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { injectAccordionContext, injectAccordionItemContext } from './accordion-context';\n\n/**\n * Panel revealed by a `ForAccordionTrigger`. The directive does not manage\n * DOM presence — wrap with `@if (item.expanded())` so panels mount and\n * unmount with the expanded state and `animate.enter` / `animate.leave`\n * work natively. If the consumer prefers to keep the panel mounted (for\n * CSS-only transitions or to preserve internal state), the directive\n * reflects `aria-hidden=\"true\"` and `inert` while closed so the panel is\n * removed from the accessibility tree and focus order automatically.\n *\n * APG note: `role=\"region\"` adds the panel to the landmark navigation tree.\n * If the accordion has 6+ simultaneously expandable panels, consider not\n * using region — the directive will gain an opt-out input when this comes up\n * in real usage.\n */\n@Directive({\n selector: '[forAccordionContent]',\n exportAs: 'forAccordionContent',\n host: {\n '[id]': 'item.contentId()',\n '[attr.role]': '\"region\"',\n '[attr.aria-labelledby]': 'item.triggerId()',\n '[attr.aria-hidden]': 'item.expanded() ? null : \"true\"',\n '[attr.inert]': 'item.expanded() ? null : \"\"',\n '[attr.data-state]': 'item.expanded() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'parent.orientation()',\n },\n})\nexport class ForAccordionContent {\n protected readonly parent = injectAccordionContext('ForAccordionContent');\n protected readonly item = injectAccordionItemContext('ForAccordionContent');\n\n constructor() {\n this.item.adoptContentId(inject<ElementRef<HTMLElement>>(ElementRef).nativeElement);\n }\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant accordions in the surrounding injector\n * scope. Configure with `provideForAccordionDefaults`. The shape is a stub\n * today — present so future per-scope tuning can land without churning the\n * public surface.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface ForAccordionDefaults {}\n\nconst FALLBACK: ForAccordionDefaults = {};\n\nconst { token, provideDefaults } = createDefaults<ForAccordionDefaults>(\n 'FOR_ACCORDION_DEFAULTS',\n FALLBACK,\n);\n\n/** Token holding the resolved accordion defaults for the current scope. */\nexport const FOR_ACCORDION_DEFAULTS = token;\n\n/**\n * Configures forty-cdk accordion 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 provideForAccordionDefaults(\n defaults: Partial<ForAccordionDefaults> = {},\n): Provider[] {\n return provideDefaults(defaults);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAwDa,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB;MAGZ,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B;AAGxB,SAAU,sBAAsB,CAAC,KAAa,EAAA;AAClD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7D,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,KAAK,CAAA,8CAAA,CAAgD,CAAC;IACjG;AACA,IAAA,OAAO,GAAG;AACZ;AAEM,SAAU,0BAA0B,CAAC,KAAa,EAAA;AACtD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAClE,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,IAAI,KAAK,CACb,yBAAyB,KA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A,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,kBAAkB;AAC1B,wBAAA,aAAa,EAAE,UAAU;AACzB,wBAAA,wBAAwB,EAAE,kBAAkB;AAC5C,wBAAA,oBAAoB,EAAE,iCAAiC;AACvD,wBAAA,cAAc,EAAE,6BAA6B;AAC7C,wBAAA,mBAAmB,EAAE,qCAAqC;AAC1D,wBAAA,yBAAyB,EAAE,sBAAsB;AAClD,qBAAA;AACF,iBAAA;;;ACjBD,MAAM,QAAQ,GAAyB,EAAE;AAEzC,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,cAAc,CAC/C,wBAAwB,EACxB,QAAQ,CACT;AAED;AACO,MAAM,sBAAsB,GAAG;AAEtC;;;;AAIG;AACG,SAAU,2BAA2B,CACzC,QAAA,GAA0C,EAAE,EAAA;AAE5C,IAAA,OAAO,eAAe,CAAC,QAAQ,CAAC;AAClC;;AChCA;;AAEG;;;;"}
1
+ {"version":3,"file":"forty-cdk-accordion.mjs","sources":["../../../projects/forty-cdk/accordion/src/accordion-context.ts","../../../projects/forty-cdk/accordion/src/accordion.ts","../../../projects/forty-cdk/accordion/src/accordion-item.ts","../../../projects/forty-cdk/accordion/src/accordion-trigger.ts","../../../projects/forty-cdk/accordion/src/accordion-content.ts","../../../projects/forty-cdk/accordion/src/accordion-defaults.ts","../../../projects/forty-cdk/accordion/src/forty-cdk-accordion.ts"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport { type ListNavigationAction, type WritingDirection } from 'forty-cdk/core';\n\n/**\n * Registry entry for one `ForAccordionTrigger`. Triggers register their host\n * element so the root can drive keyboard navigation over its own triggers\n * without an unscoped DOM query that would leak into nested accordions.\n */\nexport interface ForAccordionTriggerHandle {\n readonly host: HTMLElement;\n readonly disabled: Signal<boolean>;\n}\n\n/**\n * Coordination contract owned by the `ForAccordion` root.\n * Items derive their state from this context; triggers route clicks and\n * keyboard navigation through it.\n */\nexport interface ForAccordionContext {\n readonly multiple: Signal<boolean>;\n readonly collapsible: Signal<boolean>;\n /** Whether the whole accordion is disabled; each item ORs this into its own disabled state. */\n readonly disabled: Signal<boolean>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n readonly dir: Signal<WritingDirection>;\n isExpanded(itemValue: string): boolean;\n toggle(itemValue: string): void;\n /** Whether the given item is allowed to collapse right now. */\n canCollapse(itemValue: string): boolean;\n /**\n * Focus a sibling trigger relative to the one currently focused. Disabled\n * triggers are skipped. `currentTrigger` is the element from which the\n * keyboard event originated. Navigation stays within this accordion's own\n * registered triggers, so a nested accordion does not cross-contaminate.\n */\n focusByOffset(currentTrigger: HTMLElement, action: ListNavigationAction): void;\n registerTrigger(handle: ForAccordionTriggerHandle): void;\n unregisterTrigger(handle: ForAccordionTriggerHandle): void;\n}\n\n/**\n * Per-item state contract. Provided by `ForAccordionItem`, consumed by\n * its `ForAccordionTrigger` and `ForAccordionContent`.\n */\nexport interface ForAccordionItemContext {\n readonly expanded: Signal<boolean>;\n readonly disabled: Signal<boolean>;\n readonly value: Signal<string>;\n readonly triggerId: Signal<string>;\n readonly contentId: Signal<string>;\n /** Adopts a consumer-set static `id` on the trigger host into `triggerId`. */\n adoptTriggerId(el: HTMLElement): void;\n /** Adopts a consumer-set static `id` on the content host into `contentId`. */\n adoptContentId(el: HTMLElement): void;\n toggle(): void;\n}\n\nexport const FOR_ACCORDION_CONTEXT = new InjectionToken<ForAccordionContext>(\n 'FOR_ACCORDION_CONTEXT',\n);\n\nexport const FOR_ACCORDION_ITEM_CONTEXT = new InjectionToken<ForAccordionItemContext>(\n 'FOR_ACCORDION_ITEM_CONTEXT',\n);\n\nexport function injectAccordionContext(piece: string): ForAccordionContext {\n const ctx = inject(FOR_ACCORDION_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(`[forty-cdk/accordion] ${piece} must be used inside a [forAccordion] element.`);\n }\n return ctx;\n}\n\nexport function injectAccordionItemContext(piece: string): ForAccordionItemContext {\n const ctx = inject(FOR_ACCORDION_ITEM_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(\n `[forty-cdk/accordion] ${piece} must be used inside a [forAccordionItem] element.`,\n );\n }\n return ctx;\n}\n","import { booleanAttribute, Directive, input, model } from '@angular/core';\n\nimport {\n Collection,\n type ListNavigationAction,\n moveIndex,\n type WritingDirection,\n injectTextDirection,\n} from 'forty-cdk/core';\nimport {\n FOR_ACCORDION_CONTEXT,\n type ForAccordionContext,\n type ForAccordionTriggerHandle,\n} from './accordion-context';\n\n/**\n * Root of the Accordion primitive. Holds the open value(s) and orchestrates\n * single/multiple expansion, collapse rules, and keyboard navigation between\n * triggers.\n *\n * Implements the [WAI-ARIA Accordion pattern](https://www.w3.org/WAI/ARIA/apg/patterns/accordion/).\n *\n * State is modeled as `value: readonly string[]` regardless of mode:\n * - In single mode (`multiple=false`, default), the array has 0 or 1 element.\n * - In multiple mode, any number of items can be open.\n *\n * @example\n * ```html\n * <div forAccordion [(value)]=\"open\" collapsible>\n * <div forAccordionItem value=\"a\">\n * <h3><button type=\"button\" forAccordionTrigger>A</button></h3>\n * <section forAccordionContent>...</section>\n * </div>\n * <div forAccordionItem value=\"b\">...</div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[forAccordion]',\n exportAs: 'forAccordion',\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.dir]': 'dir()',\n },\n providers: [{ provide: FOR_ACCORDION_CONTEXT, useExisting: ForAccordion }],\n})\nexport class ForAccordion implements ForAccordionContext {\n readonly #triggers = new Collection<ForAccordionTriggerHandle>();\n\n /** When true, multiple items can be expanded simultaneously. */\n readonly multiple = input(false, { transform: booleanAttribute });\n\n /**\n * When true, the whole accordion is disabled: every item's trigger reflects\n * the native `disabled` attribute (dropped from the Tab order and skipped by\n * arrow-key navigation) and cannot toggle. Composes with a per-item\n * `[disabled]` — an item is effectively disabled when either is set. Mirrors\n * the root `disabled` on `ForTabs` / `ForStepper` / `ForDisclosure`.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Single mode only: when true, the open item can be collapsed by clicking\n * its trigger. When false, exactly one item stays open at all times once\n * any has been opened.\n */\n readonly collapsible = input(false, { transform: booleanAttribute });\n\n /**\n * Layout direction of the trigger list. `'vertical'` (default) maps\n * ArrowUp/Down to prev/next; `'horizontal'` maps ArrowLeft/Right (with RTL\n * swap when `dir='rtl'`).\n */\n readonly orientation = input<'horizontal' | 'vertical'>('vertical');\n\n /**\n * Writing direction. Only relevant when `orientation='horizontal'`. When\n * unset (default `null`), the inherited ambient direction is resolved from\n * the nearest ancestor carrying a `dir` attribute (or `<html dir>`),\n * defaulting to `'ltr'`. An explicit `[dir]` always wins. The resolved\n * value is reflected to the host `dir` attribute and drives arrow-key\n * semantics.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n\n /**\n * When true (default), arrow navigation between triggers wraps at the ends —\n * moving past the last trigger focuses the first and vice versa. Set `false`\n * to stop at the boundaries. Mirrors the `loop` input on `ForTabs` and\n * `ForListbox`.\n */\n readonly loop = input(true, { transform: booleanAttribute });\n\n /**\n * Two-way bindable. List of currently expanded item values. In single\n * mode the array has 0 or 1 element. The `model()` change emitter\n * (`(valueChange)`) fires only on internal toggles, never on consumer\n * writes via `[(value)]` — observe transitions without binding back.\n */\n readonly value = model<readonly string[]>([]);\n\n isExpanded(itemValue: string): boolean {\n return this.value().includes(itemValue);\n }\n\n toggle(itemValue: string): void {\n const current = this.value();\n const isOpen = current.includes(itemValue);\n\n if (isOpen) {\n if (!this.canCollapse(itemValue)) {\n return;\n }\n this.value.set(current.filter((v) => v !== itemValue));\n return;\n }\n\n if (this.multiple()) {\n this.value.set([...current, itemValue]);\n } else {\n this.value.set([itemValue]);\n }\n }\n\n canCollapse(_itemValue: string): boolean {\n return this.multiple() || this.collapsible();\n }\n\n focusByOffset(currentTrigger: HTMLElement, action: ListNavigationAction): void {\n const triggers = this.#triggers.items();\n if (triggers.length === 0) {\n return;\n }\n const currentIndex = triggers.findIndex((t) => t.host === currentTrigger);\n if (currentIndex === -1 && action !== 'first' && action !== 'last') {\n return;\n }\n const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, triggers.length, action, {\n loop: this.loop(),\n isDisabled: (i) => triggers[i]?.disabled() ?? false,\n });\n if (next !== null) {\n triggers[next]?.host.focus();\n }\n }\n\n registerTrigger(handle: ForAccordionTriggerHandle): void {\n this.#triggers.register(handle);\n }\n\n unregisterTrigger(handle: ForAccordionTriggerHandle): void {\n this.#triggers.unregister(handle);\n }\n}\n","import { booleanAttribute, computed, Directive, inject, input, signal } from '@angular/core';\n\nimport { adoptHostId, IdGenerator } from 'forty-cdk/core';\nimport {\n FOR_ACCORDION_ITEM_CONTEXT,\n type ForAccordionItemContext,\n injectAccordionContext,\n} from './accordion-context';\n\n/**\n * One section of a `ForAccordion`. Owns the unique `value` identifying this\n * item to the root and exposes the per-item context that the trigger and\n * content read.\n */\n@Directive({\n selector: '[forAccordionItem]',\n exportAs: 'forAccordionItem',\n host: {\n '[attr.data-state]': 'expanded() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'disabled() ? \"\" : null',\n '[attr.data-orientation]': 'parent.orientation()',\n },\n providers: [{ provide: FOR_ACCORDION_ITEM_CONTEXT, useExisting: ForAccordionItem }],\n})\nexport class ForAccordionItem implements ForAccordionItemContext {\n protected readonly parent = injectAccordionContext('ForAccordionItem');\n readonly #idGen = inject(IdGenerator);\n\n /** Unique identifier of this item within the accordion. Required. */\n readonly value = input.required<string>();\n\n /**\n * When true, this item's trigger ignores clicks and reflects the native\n * `disabled` attribute (not `aria-disabled`): dropped from the Tab order and\n * skipped by arrow-key navigation, but kept in the accessibility tree so\n * screen readers still announce it. See `ForAccordionTrigger` for the\n * rationale (rule #561 D2). Bind via `[disabled]`; read the composed\n * {@link disabled} for state.\n */\n readonly disabledInput = input(false, { transform: booleanAttribute, alias: 'disabled' });\n\n /**\n * Effective disabled: this item's own `[disabled]` OR'd with the root\n * `[forAccordion]`'s `disabled`. Everything that gates on the item's disabled\n * state — native attribute reflection, trigger click, arrow-navigation skip,\n * `data-disabled` — reads this, so disabling the whole accordion disables\n * every item.\n */\n readonly disabled = computed(() => this.disabledInput() || this.parent.disabled());\n\n readonly #triggerId = signal(this.#idGen.next('for-accordion-trigger'));\n readonly #contentId = signal(this.#idGen.next('for-accordion-content'));\n\n readonly triggerId = this.#triggerId.asReadonly();\n readonly contentId = this.#contentId.asReadonly();\n\n readonly expanded = computed(() => this.parent.isExpanded(this.value()));\n\n /**\n * Adopts a consumer-set static `id` on the `[forAccordionTrigger]` host into\n * `triggerId` (preserving anchors / external `aria-labelledby` references /\n * label `for`) instead of letting the `[id]` host binding clobber it.\n */\n adoptTriggerId(el: HTMLElement): void {\n adoptHostId(el, this.#triggerId);\n }\n\n /** Adopts a consumer-set static `id` on the content host into `contentId`. */\n adoptContentId(el: HTMLElement): void {\n adoptHostId(el, this.#contentId);\n }\n\n toggle(): void {\n if (this.disabled()) {\n return;\n }\n this.parent.toggle(this.value());\n }\n}\n","import { computed, Directive, ElementRef, inject } from '@angular/core';\n\nimport { registerHandle, reflectDisabled, resolveListNavigation } from 'forty-cdk/core';\nimport { injectAccordionContext, injectAccordionItemContext } from './accordion-context';\n\n/**\n * Header button for a `ForAccordionItem`. Apply on a `<button>` wrapped in a\n * heading element (`<h2>`–`<h6>`) so APG landmark navigation works. The\n * directive host-binds `type=\"button\"` so a trigger inside a `<form>` never\n * submits it on toggle.\n *\n * Handles ARIA wiring, click-to-toggle, and the recommended keyboard\n * navigation (ArrowDown / ArrowUp / Home / End).\n *\n * `aria-controls` is emitted only while the item is expanded — mirroring the\n * overlay triggers' open-only gating — so the reference never dangles at an\n * unmounted panel under the recommended `@if (item.expanded())` mount pattern.\n */\n@Directive({\n selector: '[forAccordionTrigger]',\n exportAs: 'forAccordionTrigger',\n host: {\n type: 'button',\n '[id]': 'item.triggerId()',\n '[attr.aria-expanded]': 'item.expanded() ? \"true\" : \"false\"',\n '[attr.aria-controls]': 'item.expanded() ? item.contentId() : null',\n '[attr.aria-disabled]': 'ariaDisabled() ? \"true\" : null',\n '[attr.data-state]': 'item.expanded() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'parent.orientation()',\n '(click)': 'item.toggle()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForAccordionTrigger {\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n protected readonly parent = injectAccordionContext('ForAccordionTrigger');\n protected readonly item = injectAccordionItemContext('ForAccordionTrigger');\n\n /**\n * APG: aria-disabled is true only when the panel is open AND the accordion\n * disallows collapse. A real `disabled` item is reflected via the native\n * `disabled` attribute instead — the sanctioned exception in rule #561 (D2):\n * the trigger is a real single-purpose `<button>`, not a roving collection\n * item (every trigger stays independently in the Tab order; the arrow-key\n * navigation is an APG-optional enhancement layered on top, not a\n * roving-tabindex collection), so native `disabled` is correct here. The\n * button stays in the accessibility tree — screen readers still announce it\n * as unavailable in browse mode — while being dropped from the Tab order and\n * the arrow-key navigation (which `focusByOffset` already skips), keeping\n * disabled triggers uniformly unreachable. The APG Accordion pattern does not\n * require disabled headers to remain focusable.\n */\n protected readonly ariaDisabled = computed(() => {\n if (this.item.disabled()) {\n return false;\n }\n return this.item.expanded() && !this.parent.canCollapse(this.item.value());\n });\n\n constructor() {\n this.item.adoptTriggerId(this.#host.nativeElement);\n const handle = {\n host: this.#host.nativeElement,\n disabled: this.item.disabled,\n };\n registerHandle(\n handle,\n (h) => this.parent.registerTrigger(h),\n (h) => this.parent.unregisterTrigger(h),\n );\n reflectDisabled(this.item.disabled);\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n const action = resolveListNavigation(event, {\n orientation: this.parent.orientation(),\n dir: this.parent.dir(),\n });\n if (!action) {\n return;\n }\n event.preventDefault();\n this.parent.focusByOffset(this.#host.nativeElement, action);\n }\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\nimport { injectAccordionContext, injectAccordionItemContext } from './accordion-context';\n\n/**\n * Panel revealed by a `ForAccordionTrigger`. The directive does not manage\n * DOM presence — wrap with `@if (item.expanded())` so panels mount and\n * unmount with the expanded state and `animate.enter` / `animate.leave`\n * work natively. If the consumer prefers to keep the panel mounted (for\n * CSS-only transitions or to preserve internal state), the directive\n * reflects `aria-hidden=\"true\"` and `inert` while closed so the panel is\n * removed from the accessibility tree and focus order automatically.\n *\n * APG note: `role=\"region\"` adds the panel to the landmark navigation tree.\n * If the accordion has 6+ simultaneously expandable panels, consider not\n * using region — the directive will gain an opt-out input when this comes up\n * in real usage.\n */\n@Directive({\n selector: '[forAccordionContent]',\n exportAs: 'forAccordionContent',\n host: {\n '[id]': 'item.contentId()',\n '[attr.role]': '\"region\"',\n '[attr.aria-labelledby]': 'item.triggerId()',\n '[attr.aria-hidden]': 'item.expanded() ? null : \"true\"',\n '[attr.inert]': 'item.expanded() ? null : \"\"',\n '[attr.data-state]': 'item.expanded() ? \"open\" : \"closed\"',\n '[attr.data-orientation]': 'parent.orientation()',\n },\n})\nexport class ForAccordionContent {\n protected readonly parent = injectAccordionContext('ForAccordionContent');\n protected readonly item = injectAccordionItemContext('ForAccordionContent');\n\n constructor() {\n this.item.adoptContentId(inject<ElementRef<HTMLElement>>(ElementRef).nativeElement);\n }\n}\n","import { type Provider } from '@angular/core';\n\nimport { createDefaults } from 'forty-cdk/core';\n\n/**\n * Defaults inherited by descendant accordions in the surrounding injector\n * scope. Configure with `provideForAccordionDefaults`. The shape is a stub\n * today — present so future per-scope tuning can land without churning the\n * public surface.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\nexport interface ForAccordionDefaults {}\n\nconst FALLBACK: ForAccordionDefaults = {};\n\nconst { token, provideDefaults } = createDefaults<ForAccordionDefaults>(\n 'FOR_ACCORDION_DEFAULTS',\n FALLBACK,\n);\n\n/** Token holding the resolved accordion defaults for the current scope. */\nexport const FOR_ACCORDION_DEFAULTS = token;\n\n/**\n * Configures forty-cdk accordion 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 provideForAccordionDefaults(\n defaults: Partial<ForAccordionDefaults> = {},\n): Provider[] {\n return provideDefaults(defaults);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MA0Da,qBAAqB,GAAG,IAAI,cAAc,CACrD,uBAAuB;MAGZ,0BAA0B,GAAG,IAAI,cAAc,CAC1D,4BAA4B;AAGxB,SAAU,sBAAsB,CAAC,KAAa,EAAA;AAClD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC7D,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,IAAI,KAAK,CAAC,yBAAyB,KAAK,CAAA,8CAAA,CAAgD,CAAC;IACjG;AACA,IAAA,OAAO,GAAG;AACZ;AAEM,SAAU,0BAA0B,CAAC,KAAa,EAAA;AACtD,IAAA,MAAM,GAAG,GAAG,MAAM,CAAC,0BAA0B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAClE,IAAI,CAAC,GAAG,EAAE;AACR,QAAA,MAAM,IAAI,KAAK,CACb,yBAAyB,KAAK,CAAA,kDAAA,CAAoD,CACnF;IACH;AACA,IAAA,OAAO,GAAG;AACZ;;ACnEA;;;;;;;;;;;;;;;;;;;;;AAqBG;MAWU,YAAY,CAAA;AACd,IAAA,SAAS,GAAG,IAAI,UAAU,EAA6B;;IAGvD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEjE;;;;;;AAMG;IACM,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEjE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AA,EAAA,yCAAA,EAAA,uBAAA,EAAA,sBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAb/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,uBAAuB;AACjC,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,IAAI,EAAE;AACJ,wBAAA,MAAM,EAAE,kBAAkB;AAC1B,wBAAA,aAAa,EAAE,UAAU;AACzB,wBAAA,wBAAwB,EAAE,kBAAkB;AAC5C,wBAAA,oBAAoB,EAAE,iCAAiC;AACvD,wBAAA,cAAc,EAAE,6BAA6B;AAC7C,wBAAA,mBAAmB,EAAE,qCAAqC;AAC1D,wBAAA,yBAAyB,EAAE,sBAAsB;AAClD,qBAAA;AACF,iBAAA;;;ACjBD,MAAM,QAAQ,GAAyB,EAAE;AAEzC,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,GAAG,cAAc,CAC/C,wBAAwB,EACxB,QAAQ,CACT;AAED;AACO,MAAM,sBAAsB,GAAG;AAEtC;;;;AAIG;AACG,SAAU,2BAA2B,CACzC,QAAA,GAA0C,EAAE,EAAA;AAE5C,IAAA,OAAO,eAAe,CAAC,QAAQ,CAAC;AAClC;;AChCA;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
+ import { isPlatformBrowser } from '@angular/common';
1
2
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, input, numberAttribute, signal, linkedSignal, computed, effect, DestroyRef, Directive, ElementRef, output, afterNextRender, PLATFORM_ID } from '@angular/core';
3
+ import { InjectionToken, inject, input, numberAttribute, signal, linkedSignal, PLATFORM_ID, computed, effect, DestroyRef, Directive, ElementRef, output, afterNextRender } from '@angular/core';
3
4
  import { createDefaults } from 'forty-cdk/core';
4
- import { isPlatformBrowser } from '@angular/common';
5
5
 
6
6
  const FOR_AVATAR_CONTEXT = new InjectionToken('FOR_AVATAR_CONTEXT');
7
7
  /**
@@ -80,6 +80,7 @@ class ForAvatar {
80
80
  #timerElapsed = linkedSignal({ ...(ngDevMode ? { debugName: "#timerElapsed" } : /* istanbul ignore next */ {}), source: () => ({ status: this.#status(), delay: this.fallbackDelayMs() }),
81
81
  computation: () => false });
82
82
  #timer = null;
83
+ #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
83
84
  shouldShowFallback = computed(() => {
84
85
  const status = this.#status();
85
86
  if (status === 'loaded')
@@ -108,7 +109,7 @@ class ForAvatar {
108
109
  const status = this.#status();
109
110
  const delay = this.fallbackDelayMs();
110
111
  this.#cancelTimer();
111
- if ((status === 'idle' || status === 'loading') && delay > 0) {
112
+ if (this.#isBrowser && (status === 'idle' || status === 'loading') && delay > 0) {
112
113
  this.#timer = setTimeout(() => {
113
114
  this.#timer = null;
114
115
  this.#timerElapsed.set(true);