forty-cdk 0.41.0 → 0.42.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.
- package/button/README.md +5 -5
- package/calendar/README.md +23 -23
- package/carousel/README.md +2 -1
- package/checkbox/README.md +9 -9
- package/combobox/README.md +22 -18
- package/context-menu/README.md +1 -1
- package/date-adapter/README.md +1 -1
- package/date-field/README.md +2 -2
- package/date-picker/README.md +8 -8
- package/dialog/README.md +1 -1
- package/drag-drop/README.md +54 -14
- package/drawer/README.md +4 -3
- package/dropdown-menu/README.md +1 -1
- package/fesm2022/forty-cdk-accordion.mjs +16 -15
- package/fesm2022/forty-cdk-accordion.mjs.map +1 -1
- package/fesm2022/forty-cdk-aspect-ratio.mjs +3 -3
- package/fesm2022/forty-cdk-avatar.mjs +9 -9
- package/fesm2022/forty-cdk-breadcrumbs.mjs +9 -9
- package/fesm2022/forty-cdk-button.mjs +12 -16
- package/fesm2022/forty-cdk-button.mjs.map +1 -1
- package/fesm2022/forty-cdk-calendar.mjs +63 -48
- package/fesm2022/forty-cdk-calendar.mjs.map +1 -1
- package/fesm2022/forty-cdk-carousel.mjs +46 -34
- package/fesm2022/forty-cdk-carousel.mjs.map +1 -1
- package/fesm2022/forty-cdk-checkbox.mjs +9 -7
- package/fesm2022/forty-cdk-checkbox.mjs.map +1 -1
- package/fesm2022/forty-cdk-combobox.mjs +105 -90
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
- package/fesm2022/forty-cdk-context-menu.mjs +11 -9
- package/fesm2022/forty-cdk-context-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-core-anchored.mjs +647 -501
- package/fesm2022/forty-cdk-core-anchored.mjs.map +1 -1
- package/fesm2022/forty-cdk-core-overlay.mjs +73 -41
- package/fesm2022/forty-cdk-core-overlay.mjs.map +1 -1
- package/fesm2022/forty-cdk-core.mjs +626 -183
- package/fesm2022/forty-cdk-core.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-adapter.mjs +7 -4
- package/fesm2022/forty-cdk-date-adapter.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-field.mjs +48 -41
- package/fesm2022/forty-cdk-date-field.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-picker.mjs +78 -63
- package/fesm2022/forty-cdk-date-picker.mjs.map +1 -1
- package/fesm2022/forty-cdk-defaults.mjs +9 -9
- package/fesm2022/forty-cdk-defaults.mjs.map +1 -1
- package/fesm2022/forty-cdk-dialog.mjs +38 -37
- package/fesm2022/forty-cdk-dialog.mjs.map +1 -1
- package/fesm2022/forty-cdk-disclosure.mjs +9 -9
- package/fesm2022/forty-cdk-drag-drop.mjs +106 -76
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
- package/fesm2022/forty-cdk-drawer.mjs +61 -53
- package/fesm2022/forty-cdk-drawer.mjs.map +1 -1
- package/fesm2022/forty-cdk-dropdown-menu.mjs +11 -9
- package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-field.mjs +23 -22
- package/fesm2022/forty-cdk-field.mjs.map +1 -1
- package/fesm2022/forty-cdk-fieldset.mjs +6 -6
- package/fesm2022/forty-cdk-file-upload.mjs +9 -9
- package/fesm2022/forty-cdk-hover-card.mjs +59 -22
- package/fesm2022/forty-cdk-hover-card.mjs.map +1 -1
- package/fesm2022/forty-cdk-input.mjs +6 -10
- package/fesm2022/forty-cdk-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-internationalized-date.mjs +6 -6
- package/fesm2022/forty-cdk-listbox.mjs +162 -81
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
- package/fesm2022/forty-cdk-menu.mjs +144 -82
- package/fesm2022/forty-cdk-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-menubar.mjs +51 -36
- package/fesm2022/forty-cdk-menubar.mjs.map +1 -1
- package/fesm2022/forty-cdk-meter.mjs +6 -6
- package/fesm2022/forty-cdk-navigation-menu.mjs +29 -28
- package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-number-input.mjs +14 -15
- package/fesm2022/forty-cdk-number-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-otp-input.mjs +8 -8
- package/fesm2022/forty-cdk-otp-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-pagination.mjs +16 -15
- package/fesm2022/forty-cdk-pagination.mjs.map +1 -1
- package/fesm2022/forty-cdk-pane-resizer.mjs +8 -7
- package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -1
- package/fesm2022/forty-cdk-popover.mjs +37 -40
- package/fesm2022/forty-cdk-popover.mjs.map +1 -1
- package/fesm2022/forty-cdk-progress.mjs +6 -6
- package/fesm2022/forty-cdk-radio-group.mjs +26 -17
- package/fesm2022/forty-cdk-radio-group.mjs.map +1 -1
- package/fesm2022/forty-cdk-scroll-area.mjs +22 -21
- package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -1
- package/fesm2022/forty-cdk-search.mjs +9 -11
- package/fesm2022/forty-cdk-search.mjs.map +1 -1
- package/fesm2022/forty-cdk-select.mjs +138 -120
- package/fesm2022/forty-cdk-select.mjs.map +1 -1
- package/fesm2022/forty-cdk-separator.mjs +3 -3
- package/fesm2022/forty-cdk-slider.mjs +21 -20
- package/fesm2022/forty-cdk-slider.mjs.map +1 -1
- package/fesm2022/forty-cdk-stepper.mjs +39 -37
- package/fesm2022/forty-cdk-stepper.mjs.map +1 -1
- package/fesm2022/forty-cdk-switch.mjs +6 -4
- package/fesm2022/forty-cdk-switch.mjs.map +1 -1
- package/fesm2022/forty-cdk-table-virtualization.mjs +3 -3
- package/fesm2022/forty-cdk-table.mjs +149 -131
- package/fesm2022/forty-cdk-table.mjs.map +1 -1
- package/fesm2022/forty-cdk-tabs.mjs +21 -16
- package/fesm2022/forty-cdk-tabs.mjs.map +1 -1
- package/fesm2022/forty-cdk-testing.mjs +1 -0
- package/fesm2022/forty-cdk-testing.mjs.map +1 -1
- package/fesm2022/forty-cdk-time-field.mjs +48 -41
- package/fesm2022/forty-cdk-time-field.mjs.map +1 -1
- package/fesm2022/forty-cdk-time-picker.mjs +80 -58
- package/fesm2022/forty-cdk-time-picker.mjs.map +1 -1
- package/fesm2022/forty-cdk-toast.mjs +53 -29
- package/fesm2022/forty-cdk-toast.mjs.map +1 -1
- package/fesm2022/forty-cdk-toggle.mjs +30 -21
- package/fesm2022/forty-cdk-toggle.mjs.map +1 -1
- package/fesm2022/forty-cdk-toolbar.mjs +46 -51
- package/fesm2022/forty-cdk-toolbar.mjs.map +1 -1
- package/fesm2022/forty-cdk-tooltip.mjs +70 -30
- package/fesm2022/forty-cdk-tooltip.mjs.map +1 -1
- package/fesm2022/forty-cdk-tree.mjs +268 -111
- package/fesm2022/forty-cdk-tree.mjs.map +1 -1
- package/fesm2022/forty-cdk-virtual-reorder.mjs +64 -62
- package/fesm2022/forty-cdk-virtual-reorder.mjs.map +1 -1
- package/fesm2022/forty-cdk-virtualization.mjs +10 -9
- package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
- package/field/README.md +5 -12
- package/hover-card/README.md +2 -0
- package/input/README.md +4 -3
- package/listbox/README.md +46 -41
- package/menu/README.md +24 -22
- package/menubar/README.md +19 -19
- package/number-input/README.md +2 -1
- package/otp-input/README.md +2 -1
- package/package.json +1 -1
- package/pagination/README.md +9 -9
- package/radio-group/README.md +11 -11
- package/search/README.md +7 -5
- package/select/README.md +10 -10
- package/slider/README.md +1 -1
- package/stepper/README.md +2 -1
- package/switch/README.md +11 -11
- package/table/README.md +1 -1
- package/tabs/README.md +2 -2
- package/time-field/README.md +2 -2
- package/time-picker/README.md +21 -18
- package/toast/README.md +1 -1
- package/toggle/README.md +4 -4
- package/toolbar/README.md +5 -5
- package/tooltip/README.md +1 -0
- package/tree/README.md +52 -38
- package/types/forty-cdk-accordion.d.ts +6 -35
- package/types/forty-cdk-avatar.d.ts +0 -37
- package/types/forty-cdk-button.d.ts +4 -2
- package/types/forty-cdk-calendar.d.ts +16 -49
- package/types/forty-cdk-carousel.d.ts +11 -82
- package/types/forty-cdk-combobox.d.ts +19 -390
- package/types/forty-cdk-context-menu.d.ts +12 -40
- package/types/forty-cdk-core-anchored.d.ts +459 -466
- package/types/forty-cdk-core-overlay.d.ts +37 -39
- package/types/forty-cdk-core.d.ts +628 -590
- package/types/forty-cdk-date-adapter.d.ts +5 -0
- package/types/forty-cdk-date-field.d.ts +15 -41
- package/types/forty-cdk-date-picker.d.ts +35 -70
- package/types/forty-cdk-defaults.d.ts +29 -296
- package/types/forty-cdk-dialog.d.ts +3 -19
- package/types/forty-cdk-disclosure.d.ts +0 -5
- package/types/forty-cdk-drag-drop.d.ts +20 -24
- package/types/forty-cdk-drawer.d.ts +14 -35
- package/types/forty-cdk-dropdown-menu.d.ts +14 -10
- package/types/forty-cdk-field.d.ts +9 -9
- package/types/forty-cdk-file-upload.d.ts +0 -5
- package/types/forty-cdk-hover-card.d.ts +14 -50
- package/types/forty-cdk-listbox.d.ts +70 -171
- package/types/forty-cdk-menu.d.ts +55 -21
- package/types/forty-cdk-menubar.d.ts +21 -13
- package/types/forty-cdk-meter.d.ts +0 -7
- package/types/forty-cdk-navigation-menu.d.ts +6 -101
- package/types/forty-cdk-otp-input.d.ts +0 -17
- package/types/forty-cdk-pagination.d.ts +6 -24
- package/types/forty-cdk-pane-resizer.d.ts +6 -5
- package/types/forty-cdk-popover.d.ts +9 -45
- package/types/forty-cdk-progress.d.ts +0 -7
- package/types/forty-cdk-radio-group.d.ts +10 -35
- package/types/forty-cdk-scroll-area.d.ts +7 -37
- package/types/forty-cdk-select.d.ts +48 -375
- package/types/forty-cdk-slider.d.ts +5 -15
- package/types/forty-cdk-stepper.d.ts +5 -31
- package/types/forty-cdk-table.d.ts +13 -333
- package/types/forty-cdk-tabs.d.ts +6 -42
- package/types/forty-cdk-time-field.d.ts +15 -41
- package/types/forty-cdk-time-picker.d.ts +19 -112
- package/types/forty-cdk-toast.d.ts +1 -125
- package/types/forty-cdk-toggle.d.ts +2 -2
- package/types/forty-cdk-toolbar.d.ts +10 -11
- package/types/forty-cdk-tooltip.d.ts +19 -31
- package/types/forty-cdk-tree.d.ts +45 -260
- package/types/forty-cdk-virtual-reorder.d.ts +7 -4
- package/types/forty-cdk-virtualization.d.ts +2 -28
- package/virtual-reorder/README.md +8 -1
- package/virtualization/README.md +17 -17
package/dropdown-menu/README.md
CHANGED
|
@@ -109,7 +109,7 @@ A settings-style dropdown built from the full menu vocabulary: `forMenuGroup` wi
|
|
|
109
109
|
| `dir` | `input<'ltr' \| 'rtl' \| null>` | Writing direction. `null` inherits the nearest `[dir]` / `<html dir>`, else `'ltr'`. In RTL, ArrowLeft opens submenus and ArrowRight closes them. The swap is automatic. Inherited by every nested `[forMenuSub]` underneath unless overridden.<br>**Default:** `null` |
|
|
110
110
|
| `disabled` | `input<boolean>` | When `true`, trigger interactions are ignored and every item of the menu and its submenus is disabled. An open menu stays open, and keyboard navigation, Tab and Escape keep working.<br>**Default:** `false` |
|
|
111
111
|
| `dismissible` | `input<boolean>` | When `false`, Escape and outside interactions don't close.<br>**Default:** `true` |
|
|
112
|
-
| `returnFocus` | `input<boolean>` | When `true`, focus returns to the trigger on close.<br>**Default:** `true`
|
|
112
|
+
| `returnFocus` | `input<boolean>` | When `true`, focus returns to the trigger on close, except after an outside or Tab close.<br>**Default:** `true` |
|
|
113
113
|
| `ariaLabel` | `input<string \| null>` | Manual `aria-label` on `[forMenuContent]` if the trigger isn't a meaningful name.<br>**Default:** `null` |
|
|
114
114
|
| `escapeKeyDown` | `output<VetoableNativeEvent<KeyboardEvent>>` | Output. Escape pressed while the menu is the topmost dismissible layer.<br>**Default:** — |
|
|
115
115
|
| `pointerDownOutside` | `output<VetoableNativeEvent<PointerEvent>>` | Output. Pointer-down on a target outside content + trigger.<br>**Default:** — |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { Directive, ElementRef, InjectionToken, booleanAttribute, computed, inject, input, model, signal } from "@angular/core";
|
|
3
|
-
import { Collection, IdGenerator, adoptHostId, assertRootContext, hostButtonType, hostLabelledBy, injectTextDirection, moveIndex, orphanContextError, reflectDisabled, registerHandle, resolveListNavigation } from "forty-cdk/core";
|
|
3
|
+
import { Collection, IdGenerator, adoptHostId, assertRootContext, hostButtonType, hostLabelledBy, injectReflectedDirection, injectTextDirection, moveIndex, orphanContextError, reflectDisabled, registerHandle, resolveListNavigation } from "forty-cdk/core";
|
|
4
4
|
const FOR_ACCORDION_CONTEXT = new InjectionToken("FOR_ACCORDION_CONTEXT");
|
|
5
5
|
const FOR_ACCORDION_ITEM_CONTEXT = new InjectionToken("FOR_ACCORDION_ITEM_CONTEXT");
|
|
6
6
|
function injectAccordionContext(piece) {
|
|
@@ -50,6 +50,7 @@ var ForAccordion = class ForAccordion {
|
|
|
50
50
|
alias: "dir"
|
|
51
51
|
});
|
|
52
52
|
dir = injectTextDirection(this._dirInput);
|
|
53
|
+
reflectedDir = injectReflectedDirection(this._dirInput);
|
|
53
54
|
loop = input(true, {
|
|
54
55
|
...ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {},
|
|
55
56
|
transform: booleanAttribute
|
|
@@ -90,7 +91,7 @@ var ForAccordion = class ForAccordion {
|
|
|
90
91
|
}
|
|
91
92
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
92
93
|
minVersion: "12.0.0",
|
|
93
|
-
version: "22.2.
|
|
94
|
+
version: "22.2.4",
|
|
94
95
|
ngImport: i0,
|
|
95
96
|
type: ForAccordion,
|
|
96
97
|
deps: [],
|
|
@@ -98,7 +99,7 @@ var ForAccordion = class ForAccordion {
|
|
|
98
99
|
});
|
|
99
100
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
100
101
|
minVersion: "17.1.0",
|
|
101
|
-
version: "22.2.
|
|
102
|
+
version: "22.2.4",
|
|
102
103
|
type: ForAccordion,
|
|
103
104
|
isStandalone: true,
|
|
104
105
|
selector: "[forAccordion]",
|
|
@@ -157,7 +158,7 @@ var ForAccordion = class ForAccordion {
|
|
|
157
158
|
host: { properties: {
|
|
158
159
|
"attr.data-orientation": "orientation()",
|
|
159
160
|
"attr.data-disabled": "disabled() ? \"\" : null",
|
|
160
|
-
"attr.dir": "
|
|
161
|
+
"attr.dir": "reflectedDir()"
|
|
161
162
|
} },
|
|
162
163
|
providers: [{
|
|
163
164
|
provide: FOR_ACCORDION_CONTEXT,
|
|
@@ -169,7 +170,7 @@ var ForAccordion = class ForAccordion {
|
|
|
169
170
|
};
|
|
170
171
|
i0.ɵɵngDeclareClassMetadata({
|
|
171
172
|
minVersion: "12.0.0",
|
|
172
|
-
version: "22.2.
|
|
173
|
+
version: "22.2.4",
|
|
173
174
|
ngImport: i0,
|
|
174
175
|
type: ForAccordion,
|
|
175
176
|
decorators: [{
|
|
@@ -180,7 +181,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
180
181
|
host: {
|
|
181
182
|
"[attr.data-orientation]": "orientation()",
|
|
182
183
|
"[attr.data-disabled]": "disabled() ? \"\" : null",
|
|
183
|
-
"[attr.dir]": "
|
|
184
|
+
"[attr.dir]": "reflectedDir()"
|
|
184
185
|
},
|
|
185
186
|
providers: [{
|
|
186
187
|
provide: FOR_ACCORDION_CONTEXT,
|
|
@@ -277,7 +278,7 @@ var ForAccordionItem = class ForAccordionItem {
|
|
|
277
278
|
}
|
|
278
279
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
279
280
|
minVersion: "12.0.0",
|
|
280
|
-
version: "22.2.
|
|
281
|
+
version: "22.2.4",
|
|
281
282
|
ngImport: i0,
|
|
282
283
|
type: ForAccordionItem,
|
|
283
284
|
deps: [],
|
|
@@ -285,7 +286,7 @@ var ForAccordionItem = class ForAccordionItem {
|
|
|
285
286
|
});
|
|
286
287
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
287
288
|
minVersion: "17.1.0",
|
|
288
|
-
version: "22.2.
|
|
289
|
+
version: "22.2.4",
|
|
289
290
|
type: ForAccordionItem,
|
|
290
291
|
isStandalone: true,
|
|
291
292
|
selector: "[forAccordionItem]",
|
|
@@ -320,7 +321,7 @@ var ForAccordionItem = class ForAccordionItem {
|
|
|
320
321
|
};
|
|
321
322
|
i0.ɵɵngDeclareClassMetadata({
|
|
322
323
|
minVersion: "12.0.0",
|
|
323
|
-
version: "22.2.
|
|
324
|
+
version: "22.2.4",
|
|
324
325
|
ngImport: i0,
|
|
325
326
|
type: ForAccordionItem,
|
|
326
327
|
decorators: [{
|
|
@@ -387,7 +388,7 @@ var ForAccordionTrigger = class ForAccordionTrigger {
|
|
|
387
388
|
}
|
|
388
389
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
389
390
|
minVersion: "12.0.0",
|
|
390
|
-
version: "22.2.
|
|
391
|
+
version: "22.2.4",
|
|
391
392
|
ngImport: i0,
|
|
392
393
|
type: ForAccordionTrigger,
|
|
393
394
|
deps: [],
|
|
@@ -395,7 +396,7 @@ var ForAccordionTrigger = class ForAccordionTrigger {
|
|
|
395
396
|
});
|
|
396
397
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
397
398
|
minVersion: "14.0.0",
|
|
398
|
-
version: "22.2.
|
|
399
|
+
version: "22.2.4",
|
|
399
400
|
type: ForAccordionTrigger,
|
|
400
401
|
isStandalone: true,
|
|
401
402
|
selector: "[forAccordionTrigger]",
|
|
@@ -421,7 +422,7 @@ var ForAccordionTrigger = class ForAccordionTrigger {
|
|
|
421
422
|
};
|
|
422
423
|
i0.ɵɵngDeclareClassMetadata({
|
|
423
424
|
minVersion: "12.0.0",
|
|
424
|
-
version: "22.2.
|
|
425
|
+
version: "22.2.4",
|
|
425
426
|
ngImport: i0,
|
|
426
427
|
type: ForAccordionTrigger,
|
|
427
428
|
decorators: [{
|
|
@@ -454,7 +455,7 @@ var ForAccordionContent = class ForAccordionContent {
|
|
|
454
455
|
}
|
|
455
456
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
456
457
|
minVersion: "12.0.0",
|
|
457
|
-
version: "22.2.
|
|
458
|
+
version: "22.2.4",
|
|
458
459
|
ngImport: i0,
|
|
459
460
|
type: ForAccordionContent,
|
|
460
461
|
deps: [],
|
|
@@ -462,7 +463,7 @@ var ForAccordionContent = class ForAccordionContent {
|
|
|
462
463
|
});
|
|
463
464
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
464
465
|
minVersion: "14.0.0",
|
|
465
|
-
version: "22.2.
|
|
466
|
+
version: "22.2.4",
|
|
466
467
|
type: ForAccordionContent,
|
|
467
468
|
isStandalone: true,
|
|
468
469
|
selector: "[forAccordionContent]",
|
|
@@ -481,7 +482,7 @@ var ForAccordionContent = class ForAccordionContent {
|
|
|
481
482
|
};
|
|
482
483
|
i0.ɵɵngDeclareClassMetadata({
|
|
483
484
|
minVersion: "12.0.0",
|
|
484
|
-
version: "22.2.
|
|
485
|
+
version: "22.2.4",
|
|
485
486
|
ngImport: i0,
|
|
486
487
|
type: ForAccordionContent,
|
|
487
488
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forty-cdk-accordion.mjs","names":[],"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"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport {\n assertRootContext,\n type ListNavigationAction,\n orphanContextError,\n type WritingDirection,\n} 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 *\n * Part of the registration protocol, so it is never exported from\n * `public-api.ts` — see {@link AccordionContext}.\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}\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\n/**\n * DI token for the accordion's coordination surface, provided by `[forAccordion]`.\n *\n * Publicly typed as the read surface {@link ForAccordionContext}, 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 trigger-registration protocol, so a wrapper re-providing it must alias it\n * to the root: `{ provide: FOR_ACCORDION_CONTEXT, useExisting: MyAccordion }`, where\n * `MyAccordion` extends `ForAccordion`. A value that merely satisfies the declared type\n * resolves too, and is rejected in dev mode by the first piece to reach the protocol.\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\n/**\n * The accordion's internal coordination surface: everything\n * {@link ForAccordionContext} publishes plus the trigger-registration protocol\n * the root drives keyboard navigation from.\n *\n * Never exported from `public-api.ts`. It is the type the pieces read\n * {@link FOR_ACCORDION_CONTEXT} at, so a consumer who injects that token gets\n * the read surface while the pieces get the wiring protocol. `ForAccordion`\n * declares the protocol members TS-`private`, which keeps them out of the\n * emitted `.d.ts` while `useExisting` still satisfies this contract at runtime.\n */\nexport interface AccordionContext extends ForAccordionContext {\n registerTrigger(handle: ForAccordionTriggerHandle): void;\n unregisterTrigger(handle: ForAccordionTriggerHandle): void;\n}\n\nexport function injectAccordionContext(piece: string): AccordionContext {\n const ctx = inject(FOR_ACCORDION_CONTEXT, { optional: true }) as AccordionContext | null;\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-ACCORDION-001',\n piece,\n root: '[forAccordion]',\n token: 'FOR_ACCORDION_CONTEXT',\n });\n }\n assertRootContext({\n entryPoint: 'accordion',\n token: 'FOR_ACCORDION_CONTEXT',\n root: '[forAccordion]',\n piece,\n probe: () => ctx.registerTrigger,\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 orphanContextError({\n code: 'FORCDK-ACCORDION-002',\n piece,\n root: '[forAccordionItem]',\n token: 'FOR_ACCORDION_ITEM_CONTEXT',\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 private registerTrigger(handle: ForAccordionTriggerHandle): void {\n this.#triggers.register(handle);\n }\n\n private 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 private 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 rationale. Bind via\n * `[disabled]`; read the composed {@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 {\n hostButtonType,\n registerHandle,\n reflectDisabled,\n resolveListNavigation,\n} 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 '[attr.type]': 'buttonType()',\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-disabled]': 'item.disabled() ? \"\" : null',\n '[attr.data-orientation]': 'parent.orientation()',\n '(click)': 'item.toggle()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForAccordionTrigger {\n private readonly buttonType = hostButtonType();\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly parent = injectAccordionContext('ForAccordionTrigger');\n private 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 to that rule:\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 private 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 private 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 { hostLabelledBy } from 'forty-cdk/core';\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-hidden]': 'item.expanded() ? null : \"true\"',\n '[attr.inert]': 'item.expanded() ? null : \"\"',\n '[attr.data-state]': 'item.expanded() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'item.disabled() ? \"\" : null',\n '[attr.data-orientation]': 'parent.orientation()',\n },\n})\nexport class ForAccordionContent {\n private readonly parent = injectAccordionContext('ForAccordionContent');\n private readonly item = injectAccordionItemContext('ForAccordionContent');\n\n private readonly labelledBy = hostLabelledBy(() => this.item.triggerId());\n\n constructor() {\n this.item.adoptContentId(inject<ElementRef<HTMLElement>>(ElementRef).nativeElement);\n }\n}\n"],"mappings":";;;AA0EA,MAAa,wBAAwB,IAAI,eACvC,uBAAuB;AAGzB,MAAa,6BAA6B,IAAI,eAC5C,4BAA4B;AAmB9B,SAAgB,uBAAuB,OAAa;CAClD,MAAM,MAAM,OAAO,uBAAuB,EAAE,UAAU,KAAI,CAAE;CAC5D,IAAI,CAAC,KACH,MAAM,mBAAmB;EACvB,MAAM;EACN;EACA,MAAM;EACN,OAAO;CACR,CAAA;CAEH,kBAAkB;EAChB,YAAY;EACZ,OAAO;EACP,MAAM;EACN;EACA,aAAa,IAAI;CAClB,CAAA;CACD,OAAO;AACT;AAEA,SAAgB,2BAA2B,OAAa;CACtD,MAAM,MAAM,OAAO,4BAA4B,EAAE,UAAU,KAAI,CAAE;CACjE,IAAI,CAAC,KACH,MAAM,mBAAmB;EACvB,MAAM;EACN;EACA,MAAM;EACN,OAAO;CACR,CAAA;CAEH,OAAO;AACT;AClFA,IAAa,eAAb,MAAa,aAAY;CACd,YAAY,IAAI,WAAU;CAG1B,WAAW,MAAM,OAAK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BAAgB;IAChB,qBAAqB;IACrB,wBAAwB;IACxB,2BAA2B;GAC5B;EACF,CAAA"}
|
|
1
|
+
{"version":3,"file":"forty-cdk-accordion.mjs","names":[],"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"],"sourcesContent":["import { inject, InjectionToken, type Signal } from '@angular/core';\n\nimport {\n assertRootContext,\n type ListNavigationAction,\n orphanContextError,\n type WritingDirection,\n} 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 *\n * Part of the registration protocol, so it is never exported from\n * `public-api.ts` — see {@link AccordionContext}.\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}\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\n/**\n * DI token for the accordion's coordination surface, provided by `[forAccordion]`.\n *\n * Publicly typed as the read surface {@link ForAccordionContext}, 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 trigger-registration protocol, so a wrapper re-providing it must alias it\n * to the root: `{ provide: FOR_ACCORDION_CONTEXT, useExisting: MyAccordion }`, where\n * `MyAccordion` extends `ForAccordion`. A value that merely satisfies the declared type\n * resolves too, and is rejected in dev mode by the first piece to reach the protocol.\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\n/**\n * The accordion's internal coordination surface: everything\n * {@link ForAccordionContext} publishes plus the trigger-registration protocol\n * the root drives keyboard navigation from.\n *\n * Never exported from `public-api.ts`. It is the type the pieces read\n * {@link FOR_ACCORDION_CONTEXT} at, so a consumer who injects that token gets\n * the read surface while the pieces get the wiring protocol. `ForAccordion`\n * declares the protocol members TS-`private`, which keeps them out of the\n * emitted `.d.ts` while `useExisting` still satisfies this contract at runtime.\n */\nexport interface AccordionContext extends ForAccordionContext {\n registerTrigger(handle: ForAccordionTriggerHandle): void;\n unregisterTrigger(handle: ForAccordionTriggerHandle): void;\n}\n\nexport function injectAccordionContext(piece: string): AccordionContext {\n const ctx = inject(FOR_ACCORDION_CONTEXT, { optional: true }) as AccordionContext | null;\n if (!ctx) {\n throw orphanContextError({\n code: 'FORCDK-ACCORDION-001',\n piece,\n root: '[forAccordion]',\n token: 'FOR_ACCORDION_CONTEXT',\n });\n }\n assertRootContext({\n entryPoint: 'accordion',\n token: 'FOR_ACCORDION_CONTEXT',\n root: '[forAccordion]',\n piece,\n probe: () => ctx.registerTrigger,\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 orphanContextError({\n code: 'FORCDK-ACCORDION-002',\n piece,\n root: '[forAccordionItem]',\n token: 'FOR_ACCORDION_ITEM_CONTEXT',\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 injectReflectedDirection,\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]': 'reflectedDir()',\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 unset (default `null`),\n * the inherited ambient direction is resolved from the nearest ancestor carrying a `dir`\n * attribute (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins. The\n * resolved value is reflected to the host `dir` attribute when a direction is set or declared,\n * and drives arrow-key semantics.\n */\n readonly _dirInput = input<WritingDirection | null>(null, { alias: 'dir' });\n readonly dir = injectTextDirection(this._dirInput);\n private readonly reflectedDir = injectReflectedDirection(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 private registerTrigger(handle: ForAccordionTriggerHandle): void {\n this.#triggers.register(handle);\n }\n\n private 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 private 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 rationale. Bind via\n * `[disabled]`; read the composed {@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 {\n hostButtonType,\n registerHandle,\n reflectDisabled,\n resolveListNavigation,\n} 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 '[attr.type]': 'buttonType()',\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-disabled]': 'item.disabled() ? \"\" : null',\n '[attr.data-orientation]': 'parent.orientation()',\n '(click)': 'item.toggle()',\n '(keydown)': 'onKeyDown($event)',\n },\n})\nexport class ForAccordionTrigger {\n private readonly buttonType = hostButtonType();\n\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly parent = injectAccordionContext('ForAccordionTrigger');\n private 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 to that rule:\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 private 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 private 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 { hostLabelledBy } from 'forty-cdk/core';\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-hidden]': 'item.expanded() ? null : \"true\"',\n '[attr.inert]': 'item.expanded() ? null : \"\"',\n '[attr.data-state]': 'item.expanded() ? \"open\" : \"closed\"',\n '[attr.data-disabled]': 'item.disabled() ? \"\" : null',\n '[attr.data-orientation]': 'parent.orientation()',\n },\n})\nexport class ForAccordionContent {\n private readonly parent = injectAccordionContext('ForAccordionContent');\n private readonly item = injectAccordionItemContext('ForAccordionContent');\n\n private readonly labelledBy = hostLabelledBy(() => this.item.triggerId());\n\n constructor() {\n this.item.adoptContentId(inject<ElementRef<HTMLElement>>(ElementRef).nativeElement);\n }\n}\n"],"mappings":";;;AA0EA,MAAa,wBAAwB,IAAI,eACvC,uBAAuB;AAGzB,MAAa,6BAA6B,IAAI,eAC5C,4BAA4B;AAmB9B,SAAgB,uBAAuB,OAAa;CAClD,MAAM,MAAM,OAAO,uBAAuB,EAAE,UAAU,KAAI,CAAE;CAC5D,IAAI,CAAC,KACH,MAAM,mBAAmB;EACvB,MAAM;EACN;EACA,MAAM;EACN,OAAO;CACR,CAAA;CAEH,kBAAkB;EAChB,YAAY;EACZ,OAAO;EACP,MAAM;EACN;EACA,aAAa,IAAI;CAClB,CAAA;CACD,OAAO;AACT;AAEA,SAAgB,2BAA2B,OAAa;CACtD,MAAM,MAAM,OAAO,4BAA4B,EAAE,UAAU,KAAI,CAAE;CACjE,IAAI,CAAC,KACH,MAAM,mBAAmB;EACvB,MAAM;EACN;EACA,MAAM;EACN,OAAO;CACR,CAAA;CAEH,OAAO;AACT;ACjFA,IAAa,eAAb,MAAa,aAAY;CACd,YAAY,IAAI,WAAU;CAG1B,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CASrD,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAOrD,cAAc,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAOxD,cAAc,MAAiC,YAAW,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAS1D,YAAY,MAA+B,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;EAAI,OAAO;CAAK,CAAA;CAC/D,MAAM,oBAAoB,KAAK,SAAS;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SAAS,uBAAuB,qBAAqB;CACrD,OAAO,2BAA2B,qBAAqB;CAEvD,aAAa,qBAAqB,KAAK,KAAK,UAAS,CAAE;CAExE,cAAA;EACE,KAAK,KAAK,eAAe,OAAgC,UAAU,CAAC,CAAC,aAAa;CACpF;CARW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAmB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAnB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAmB,cAAA;EAAA,UAAA;EAAA,MAAA,EAAA,YAAA;GAAA,MAAA;GAAA,aAAA;GAAA,oBAAA;GAAA,cAAA;GAAA,mBAAA;GAAA,sBAAA;GAAA,yBAAA;EAAA,EAAA;EAAA,UAAA,CAAA,qBAAA;EAAA,UAAA;CAAA,CAAA;;AAAnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAb/B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,UAAU;GACV,MAAM;IACJ,QAAQ;IACR,eAAe;IACf,sBAAsB;IACtB,gBAAgB;IAChB,qBAAqB;IACrB,wBAAwB;IACxB,2BAA2B;GAC5B;EACF,CAAA"}
|
|
@@ -11,7 +11,7 @@ var ForAspectRatio = class ForAspectRatio {
|
|
|
11
11
|
}, ...ngDevMode ? [{ debugName: "resolvedRatio" }] : /* istanbul ignore next */ []);
|
|
12
12
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
13
13
|
minVersion: "12.0.0",
|
|
14
|
-
version: "22.2.
|
|
14
|
+
version: "22.2.4",
|
|
15
15
|
ngImport: i0,
|
|
16
16
|
type: ForAspectRatio,
|
|
17
17
|
deps: [],
|
|
@@ -19,7 +19,7 @@ var ForAspectRatio = class ForAspectRatio {
|
|
|
19
19
|
});
|
|
20
20
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
21
21
|
minVersion: "17.1.0",
|
|
22
|
-
version: "22.2.
|
|
22
|
+
version: "22.2.4",
|
|
23
23
|
type: ForAspectRatio,
|
|
24
24
|
isStandalone: true,
|
|
25
25
|
selector: "[forAspectRatio]",
|
|
@@ -37,7 +37,7 @@ var ForAspectRatio = class ForAspectRatio {
|
|
|
37
37
|
};
|
|
38
38
|
i0.ɵɵngDeclareClassMetadata({
|
|
39
39
|
minVersion: "12.0.0",
|
|
40
|
-
version: "22.2.
|
|
40
|
+
version: "22.2.4",
|
|
41
41
|
ngImport: i0,
|
|
42
42
|
type: ForAspectRatio,
|
|
43
43
|
decorators: [{
|
|
@@ -92,7 +92,7 @@ var ForAvatar = class ForAvatar {
|
|
|
92
92
|
}
|
|
93
93
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
94
94
|
minVersion: "12.0.0",
|
|
95
|
-
version: "22.2.
|
|
95
|
+
version: "22.2.4",
|
|
96
96
|
ngImport: i0,
|
|
97
97
|
type: ForAvatar,
|
|
98
98
|
deps: [],
|
|
@@ -100,7 +100,7 @@ var ForAvatar = class ForAvatar {
|
|
|
100
100
|
});
|
|
101
101
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
102
102
|
minVersion: "17.1.0",
|
|
103
|
-
version: "22.2.
|
|
103
|
+
version: "22.2.4",
|
|
104
104
|
type: ForAvatar,
|
|
105
105
|
isStandalone: true,
|
|
106
106
|
selector: "[forAvatar]",
|
|
@@ -122,7 +122,7 @@ var ForAvatar = class ForAvatar {
|
|
|
122
122
|
};
|
|
123
123
|
i0.ɵɵngDeclareClassMetadata({
|
|
124
124
|
minVersion: "12.0.0",
|
|
125
|
-
version: "22.2.
|
|
125
|
+
version: "22.2.4",
|
|
126
126
|
ngImport: i0,
|
|
127
127
|
type: ForAvatar,
|
|
128
128
|
decorators: [{
|
|
@@ -233,7 +233,7 @@ var ForAvatarImage = class ForAvatarImage {
|
|
|
233
233
|
#requestSrc = null;
|
|
234
234
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
235
235
|
minVersion: "12.0.0",
|
|
236
|
-
version: "22.2.
|
|
236
|
+
version: "22.2.4",
|
|
237
237
|
ngImport: i0,
|
|
238
238
|
type: ForAvatarImage,
|
|
239
239
|
deps: [],
|
|
@@ -241,7 +241,7 @@ var ForAvatarImage = class ForAvatarImage {
|
|
|
241
241
|
});
|
|
242
242
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
243
243
|
minVersion: "14.0.0",
|
|
244
|
-
version: "22.2.
|
|
244
|
+
version: "22.2.4",
|
|
245
245
|
type: ForAvatarImage,
|
|
246
246
|
isStandalone: true,
|
|
247
247
|
selector: "img[forAvatarImage]",
|
|
@@ -259,7 +259,7 @@ var ForAvatarImage = class ForAvatarImage {
|
|
|
259
259
|
};
|
|
260
260
|
i0.ɵɵngDeclareClassMetadata({
|
|
261
261
|
minVersion: "12.0.0",
|
|
262
|
-
version: "22.2.
|
|
262
|
+
version: "22.2.4",
|
|
263
263
|
ngImport: i0,
|
|
264
264
|
type: ForAvatarImage,
|
|
265
265
|
decorators: [{
|
|
@@ -284,7 +284,7 @@ var ForAvatarFallback = class ForAvatarFallback {
|
|
|
284
284
|
parent = injectAvatarContext("ForAvatarFallback");
|
|
285
285
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
286
286
|
minVersion: "12.0.0",
|
|
287
|
-
version: "22.2.
|
|
287
|
+
version: "22.2.4",
|
|
288
288
|
ngImport: i0,
|
|
289
289
|
type: ForAvatarFallback,
|
|
290
290
|
deps: [],
|
|
@@ -292,7 +292,7 @@ var ForAvatarFallback = class ForAvatarFallback {
|
|
|
292
292
|
});
|
|
293
293
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
294
294
|
minVersion: "14.0.0",
|
|
295
|
-
version: "22.2.
|
|
295
|
+
version: "22.2.4",
|
|
296
296
|
type: ForAvatarFallback,
|
|
297
297
|
isStandalone: true,
|
|
298
298
|
selector: "[forAvatarFallback]",
|
|
@@ -303,7 +303,7 @@ var ForAvatarFallback = class ForAvatarFallback {
|
|
|
303
303
|
};
|
|
304
304
|
i0.ɵɵngDeclareClassMetadata({
|
|
305
305
|
minVersion: "12.0.0",
|
|
306
|
-
version: "22.2.
|
|
306
|
+
version: "22.2.4",
|
|
307
307
|
ngImport: i0,
|
|
308
308
|
type: ForAvatarFallback,
|
|
309
309
|
decorators: [{
|
|
@@ -8,7 +8,7 @@ var ForBreadcrumbs = class ForBreadcrumbs {
|
|
|
8
8
|
resolvedAriaLabel = hostAriaLabel(() => resolveTextInput(this.ariaLabel(), this.#defaults.label) || null);
|
|
9
9
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
10
10
|
minVersion: "12.0.0",
|
|
11
|
-
version: "22.2.
|
|
11
|
+
version: "22.2.4",
|
|
12
12
|
ngImport: i0,
|
|
13
13
|
type: ForBreadcrumbs,
|
|
14
14
|
deps: [],
|
|
@@ -16,7 +16,7 @@ var ForBreadcrumbs = class ForBreadcrumbs {
|
|
|
16
16
|
});
|
|
17
17
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
18
18
|
minVersion: "17.1.0",
|
|
19
|
-
version: "22.2.
|
|
19
|
+
version: "22.2.4",
|
|
20
20
|
type: ForBreadcrumbs,
|
|
21
21
|
isStandalone: true,
|
|
22
22
|
selector: "[forBreadcrumbs]",
|
|
@@ -37,7 +37,7 @@ var ForBreadcrumbs = class ForBreadcrumbs {
|
|
|
37
37
|
};
|
|
38
38
|
i0.ɵɵngDeclareClassMetadata({
|
|
39
39
|
minVersion: "12.0.0",
|
|
40
|
-
version: "22.2.
|
|
40
|
+
version: "22.2.4",
|
|
41
41
|
ngImport: i0,
|
|
42
42
|
type: ForBreadcrumbs,
|
|
43
43
|
decorators: [{
|
|
@@ -67,7 +67,7 @@ var ForBreadcrumbItem = class ForBreadcrumbItem {
|
|
|
67
67
|
});
|
|
68
68
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
69
69
|
minVersion: "12.0.0",
|
|
70
|
-
version: "22.2.
|
|
70
|
+
version: "22.2.4",
|
|
71
71
|
ngImport: i0,
|
|
72
72
|
type: ForBreadcrumbItem,
|
|
73
73
|
deps: [],
|
|
@@ -75,7 +75,7 @@ var ForBreadcrumbItem = class ForBreadcrumbItem {
|
|
|
75
75
|
});
|
|
76
76
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
77
77
|
minVersion: "17.1.0",
|
|
78
|
-
version: "22.2.
|
|
78
|
+
version: "22.2.4",
|
|
79
79
|
type: ForBreadcrumbItem,
|
|
80
80
|
isStandalone: true,
|
|
81
81
|
selector: "[forBreadcrumbItem]",
|
|
@@ -93,7 +93,7 @@ var ForBreadcrumbItem = class ForBreadcrumbItem {
|
|
|
93
93
|
};
|
|
94
94
|
i0.ɵɵngDeclareClassMetadata({
|
|
95
95
|
minVersion: "12.0.0",
|
|
96
|
-
version: "22.2.
|
|
96
|
+
version: "22.2.4",
|
|
97
97
|
ngImport: i0,
|
|
98
98
|
type: ForBreadcrumbItem,
|
|
99
99
|
decorators: [{
|
|
@@ -116,7 +116,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
116
116
|
var ForBreadcrumbSeparator = class ForBreadcrumbSeparator {
|
|
117
117
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
118
118
|
minVersion: "12.0.0",
|
|
119
|
-
version: "22.2.
|
|
119
|
+
version: "22.2.4",
|
|
120
120
|
ngImport: i0,
|
|
121
121
|
type: ForBreadcrumbSeparator,
|
|
122
122
|
deps: [],
|
|
@@ -124,7 +124,7 @@ var ForBreadcrumbSeparator = class ForBreadcrumbSeparator {
|
|
|
124
124
|
});
|
|
125
125
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
126
126
|
minVersion: "14.0.0",
|
|
127
|
-
version: "22.2.
|
|
127
|
+
version: "22.2.4",
|
|
128
128
|
type: ForBreadcrumbSeparator,
|
|
129
129
|
isStandalone: true,
|
|
130
130
|
selector: "[forBreadcrumbSeparator]",
|
|
@@ -135,7 +135,7 @@ var ForBreadcrumbSeparator = class ForBreadcrumbSeparator {
|
|
|
135
135
|
};
|
|
136
136
|
i0.ɵɵngDeclareClassMetadata({
|
|
137
137
|
minVersion: "12.0.0",
|
|
138
|
-
version: "22.2.
|
|
138
|
+
version: "22.2.4",
|
|
139
139
|
ngImport: i0,
|
|
140
140
|
type: ForBreadcrumbSeparator,
|
|
141
141
|
decorators: [{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { DOCUMENT, DestroyRef, Directive, ElementRef, Injectable, PLATFORM_ID, booleanAttribute, computed, inject, input, output, signal } from "@angular/core";
|
|
3
|
-
import { FOR_FIELDSET_CONTEXT, injectSyntheticActivation, isNonTouchPointer } from "forty-cdk/core";
|
|
3
|
+
import { FOR_FIELDSET_CONTEXT, injectDisabledClickGuard, injectSyntheticActivation, isNonTouchPointer } from "forty-cdk/core";
|
|
4
4
|
import { isPlatformBrowser } from "@angular/common";
|
|
5
5
|
var InputModality = class InputModality {
|
|
6
6
|
#document = inject(DOCUMENT);
|
|
@@ -27,7 +27,7 @@ var InputModality = class InputModality {
|
|
|
27
27
|
}
|
|
28
28
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
29
29
|
minVersion: "12.0.0",
|
|
30
|
-
version: "22.2.
|
|
30
|
+
version: "22.2.4",
|
|
31
31
|
ngImport: i0,
|
|
32
32
|
type: InputModality,
|
|
33
33
|
deps: [],
|
|
@@ -35,7 +35,7 @@ var InputModality = class InputModality {
|
|
|
35
35
|
});
|
|
36
36
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
37
37
|
minVersion: "12.0.0",
|
|
38
|
-
version: "22.2.
|
|
38
|
+
version: "22.2.4",
|
|
39
39
|
ngImport: i0,
|
|
40
40
|
type: InputModality,
|
|
41
41
|
providedIn: "root"
|
|
@@ -43,7 +43,7 @@ var InputModality = class InputModality {
|
|
|
43
43
|
};
|
|
44
44
|
i0.ɵɵngDeclareClassMetadata({
|
|
45
45
|
minVersion: "12.0.0",
|
|
46
|
-
version: "22.2.
|
|
46
|
+
version: "22.2.4",
|
|
47
47
|
ngImport: i0,
|
|
48
48
|
type: InputModality,
|
|
49
49
|
decorators: [{
|
|
@@ -129,15 +129,11 @@ var ForButton = class ForButton {
|
|
|
129
129
|
resolvedRole = this.#activation.nativeButton ? null : "button";
|
|
130
130
|
resolvedTabindex = this.#activation.tabindex;
|
|
131
131
|
constructor() {
|
|
132
|
+
injectDisabledClickGuard({ disabled: this.effectiveDisabled });
|
|
132
133
|
if (this.#activation.nativeButton && !this.#host.hasAttribute("type")) this.#host.setAttribute("type", "button");
|
|
133
134
|
}
|
|
134
|
-
onClick(
|
|
135
|
-
if (this.effectiveDisabled())
|
|
136
|
-
event.preventDefault();
|
|
137
|
-
event.stopImmediatePropagation();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
this.activate.emit();
|
|
135
|
+
onClick() {
|
|
136
|
+
if (!this.effectiveDisabled()) this.activate.emit();
|
|
141
137
|
}
|
|
142
138
|
onKeydown(event) {
|
|
143
139
|
this.#activation.keydown(event);
|
|
@@ -154,7 +150,7 @@ var ForButton = class ForButton {
|
|
|
154
150
|
}
|
|
155
151
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
156
152
|
minVersion: "12.0.0",
|
|
157
|
-
version: "22.2.
|
|
153
|
+
version: "22.2.4",
|
|
158
154
|
ngImport: i0,
|
|
159
155
|
type: ForButton,
|
|
160
156
|
deps: [],
|
|
@@ -162,7 +158,7 @@ var ForButton = class ForButton {
|
|
|
162
158
|
});
|
|
163
159
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
164
160
|
minVersion: "17.1.0",
|
|
165
|
-
version: "22.2.
|
|
161
|
+
version: "22.2.4",
|
|
166
162
|
type: ForButton,
|
|
167
163
|
isStandalone: true,
|
|
168
164
|
selector: "[forButton]",
|
|
@@ -176,7 +172,7 @@ var ForButton = class ForButton {
|
|
|
176
172
|
outputs: { activate: "activate" },
|
|
177
173
|
host: {
|
|
178
174
|
listeners: {
|
|
179
|
-
"click": "onClick(
|
|
175
|
+
"click": "onClick()",
|
|
180
176
|
"keydown": "onKeydown($event)",
|
|
181
177
|
"keyup": "onKeyup($event)",
|
|
182
178
|
"focusin": "onFocusIn()",
|
|
@@ -198,7 +194,7 @@ var ForButton = class ForButton {
|
|
|
198
194
|
};
|
|
199
195
|
i0.ɵɵngDeclareClassMetadata({
|
|
200
196
|
minVersion: "12.0.0",
|
|
201
|
-
version: "22.2.
|
|
197
|
+
version: "22.2.4",
|
|
202
198
|
ngImport: i0,
|
|
203
199
|
type: ForButton,
|
|
204
200
|
decorators: [{
|
|
@@ -214,7 +210,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
214
210
|
"[attr.data-pressed]": "pressed() ? '' : null",
|
|
215
211
|
"[attr.data-hovered]": "hovered() ? '' : null",
|
|
216
212
|
"[attr.data-focus-visible]": "focusVisible() ? '' : null",
|
|
217
|
-
"(click)": "onClick(
|
|
213
|
+
"(click)": "onClick()",
|
|
218
214
|
"(keydown)": "onKeydown($event)",
|
|
219
215
|
"(keyup)": "onKeyup($event)",
|
|
220
216
|
"(focusin)": "onFocusIn()",
|