forty-cdk 0.34.0 → 0.35.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/README.md +4 -3
- package/calendar/README.md +2 -2
- package/carousel/README.md +11 -6
- package/checkbox/README.md +17 -2
- package/fesm2022/forty-cdk-accordion.mjs +502 -378
- package/fesm2022/forty-cdk-accordion.mjs.map +1 -1
- package/fesm2022/forty-cdk-aspect-ratio.mjs +61 -69
- package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -1
- package/fesm2022/forty-cdk-avatar.mjs +314 -350
- package/fesm2022/forty-cdk-avatar.mjs.map +1 -1
- package/fesm2022/forty-cdk-breadcrumbs.mjs +152 -119
- package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -1
- package/fesm2022/forty-cdk-breakpoints.mjs +44 -80
- package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -1
- package/fesm2022/forty-cdk-button.mjs +235 -337
- package/fesm2022/forty-cdk-button.mjs.map +1 -1
- package/fesm2022/forty-cdk-calendar.mjs +2087 -1950
- package/fesm2022/forty-cdk-calendar.mjs.map +1 -1
- package/fesm2022/forty-cdk-carousel.mjs +1246 -1031
- package/fesm2022/forty-cdk-carousel.mjs.map +1 -1
- package/fesm2022/forty-cdk-checkbox.mjs +233 -241
- package/fesm2022/forty-cdk-checkbox.mjs.map +1 -1
- package/fesm2022/forty-cdk-combobox.mjs +2862 -3190
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
- package/fesm2022/forty-cdk-context-menu.mjs +532 -530
- package/fesm2022/forty-cdk-context-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-core-overlay.mjs +3307 -5194
- package/fesm2022/forty-cdk-core-overlay.mjs.map +1 -1
- package/fesm2022/forty-cdk-core.mjs +4453 -8427
- package/fesm2022/forty-cdk-core.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-adapter.mjs +129 -175
- package/fesm2022/forty-cdk-date-adapter.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-field.mjs +1114 -1086
- package/fesm2022/forty-cdk-date-field.mjs.map +1 -1
- package/fesm2022/forty-cdk-date-picker.mjs +1390 -1548
- package/fesm2022/forty-cdk-date-picker.mjs.map +1 -1
- package/fesm2022/forty-cdk-defaults.mjs +537 -1359
- package/fesm2022/forty-cdk-defaults.mjs.map +1 -1
- package/fesm2022/forty-cdk-dialog.mjs +901 -694
- package/fesm2022/forty-cdk-dialog.mjs.map +1 -1
- package/fesm2022/forty-cdk-disclosure.mjs +254 -182
- package/fesm2022/forty-cdk-disclosure.mjs.map +1 -1
- package/fesm2022/forty-cdk-drag-drop.mjs +1776 -1768
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -1
- package/fesm2022/forty-cdk-drawer.mjs +1835 -2105
- package/fesm2022/forty-cdk-drawer.mjs.map +1 -1
- package/fesm2022/forty-cdk-dropdown-menu.mjs +451 -375
- package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-field.mjs +563 -669
- package/fesm2022/forty-cdk-field.mjs.map +1 -1
- package/fesm2022/forty-cdk-fieldset.mjs +162 -203
- package/fesm2022/forty-cdk-fieldset.mjs.map +1 -1
- package/fesm2022/forty-cdk-file-upload.mjs +383 -316
- package/fesm2022/forty-cdk-file-upload.mjs.map +1 -1
- package/fesm2022/forty-cdk-hover-card.mjs +600 -612
- package/fesm2022/forty-cdk-hover-card.mjs.map +1 -1
- package/fesm2022/forty-cdk-input.mjs +230 -277
- package/fesm2022/forty-cdk-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-internationalized-date.mjs +183 -247
- package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +1486 -1586
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -1
- package/fesm2022/forty-cdk-menu.mjs +1924 -1744
- package/fesm2022/forty-cdk-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-menubar.mjs +789 -910
- package/fesm2022/forty-cdk-menubar.mjs.map +1 -1
- package/fesm2022/forty-cdk-meter.mjs +312 -210
- package/fesm2022/forty-cdk-meter.mjs.map +1 -1
- package/fesm2022/forty-cdk-navigation-menu.mjs +1231 -1325
- package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -1
- package/fesm2022/forty-cdk-number-input.mjs +694 -843
- package/fesm2022/forty-cdk-number-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-otp-input.mjs +554 -561
- package/fesm2022/forty-cdk-otp-input.mjs.map +1 -1
- package/fesm2022/forty-cdk-pagination.mjs +493 -362
- package/fesm2022/forty-cdk-pagination.mjs.map +1 -1
- package/fesm2022/forty-cdk-pane-resizer.mjs +470 -416
- package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -1
- package/fesm2022/forty-cdk-popover.mjs +846 -720
- package/fesm2022/forty-cdk-popover.mjs.map +1 -1
- package/fesm2022/forty-cdk-progress.mjs +265 -223
- package/fesm2022/forty-cdk-progress.mjs.map +1 -1
- package/fesm2022/forty-cdk-radio-group.mjs +468 -431
- package/fesm2022/forty-cdk-radio-group.mjs.map +1 -1
- package/fesm2022/forty-cdk-scroll-area.mjs +860 -934
- package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -1
- package/fesm2022/forty-cdk-search.mjs +281 -328
- package/fesm2022/forty-cdk-search.mjs.map +1 -1
- package/fesm2022/forty-cdk-select.mjs +1872 -1874
- package/fesm2022/forty-cdk-select.mjs.map +1 -1
- package/fesm2022/forty-cdk-separator.mjs +92 -67
- package/fesm2022/forty-cdk-separator.mjs.map +1 -1
- package/fesm2022/forty-cdk-shared.mjs +4 -8
- package/fesm2022/forty-cdk-slider.mjs +881 -877
- package/fesm2022/forty-cdk-slider.mjs.map +1 -1
- package/fesm2022/forty-cdk-stepper.mjs +1160 -919
- package/fesm2022/forty-cdk-stepper.mjs.map +1 -1
- package/fesm2022/forty-cdk-switch.mjs +140 -146
- package/fesm2022/forty-cdk-switch.mjs.map +1 -1
- package/fesm2022/forty-cdk-table-virtualization.mjs +258 -375
- package/fesm2022/forty-cdk-table-virtualization.mjs.map +1 -1
- package/fesm2022/forty-cdk-table.mjs +4718 -4851
- package/fesm2022/forty-cdk-table.mjs.map +1 -1
- package/fesm2022/forty-cdk-tabs.mjs +566 -403
- package/fesm2022/forty-cdk-tabs.mjs.map +1 -1
- package/fesm2022/forty-cdk-testing.mjs +233 -385
- package/fesm2022/forty-cdk-testing.mjs.map +1 -1
- package/fesm2022/forty-cdk-time-field.mjs +1148 -1143
- package/fesm2022/forty-cdk-time-field.mjs.map +1 -1
- package/fesm2022/forty-cdk-time-picker.mjs +1303 -1190
- package/fesm2022/forty-cdk-time-picker.mjs.map +1 -1
- package/fesm2022/forty-cdk-toast.mjs +1473 -1562
- package/fesm2022/forty-cdk-toast.mjs.map +1 -1
- package/fesm2022/forty-cdk-toggle.mjs +555 -536
- package/fesm2022/forty-cdk-toggle.mjs.map +1 -1
- package/fesm2022/forty-cdk-toolbar.mjs +503 -388
- package/fesm2022/forty-cdk-toolbar.mjs.map +1 -1
- package/fesm2022/forty-cdk-tooltip.mjs +602 -600
- package/fesm2022/forty-cdk-tooltip.mjs.map +1 -1
- package/fesm2022/forty-cdk-tree.mjs +2427 -2644
- package/fesm2022/forty-cdk-tree.mjs.map +1 -1
- package/fesm2022/forty-cdk-virtual-reorder.mjs +399 -487
- package/fesm2022/forty-cdk-virtual-reorder.mjs.map +1 -1
- package/fesm2022/forty-cdk-virtualization.mjs +552 -603
- package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
- package/fesm2022/forty-cdk-visually-hidden.mjs +1 -6
- package/fesm2022/forty-cdk.mjs +0 -4
- package/input/README.md +1 -1
- package/navigation-menu/README.md +19 -9
- package/number-input/README.md +1 -1
- package/package.json +7 -6
- package/separator/README.md +4 -4
- package/shared/README.md +80 -1
- package/slider/README.md +19 -12
- package/table/README.md +22 -20
- package/table-virtualization/README.md +29 -7
- package/toast/README.md +2 -1
- package/toolbar/README.md +4 -4
- package/tree/README.md +44 -23
- package/types/forty-cdk-accordion.d.ts +210 -167
- package/types/forty-cdk-aspect-ratio.d.ts +23 -20
- package/types/forty-cdk-avatar.d.ts +73 -58
- package/types/forty-cdk-breadcrumbs.d.ts +43 -35
- package/types/forty-cdk-breakpoints.d.ts +42 -47
- package/types/forty-cdk-button.d.ts +47 -42
- package/types/forty-cdk-calendar.d.ts +712 -590
- package/types/forty-cdk-carousel.d.ts +497 -392
- package/types/forty-cdk-checkbox.d.ts +55 -46
- package/types/forty-cdk-combobox.d.ts +1254 -1059
- package/types/forty-cdk-context-menu.d.ts +322 -258
- package/types/forty-cdk-core-overlay.d.ts +2758 -2429
- package/types/forty-cdk-core.d.ts +2974 -2732
- package/types/forty-cdk-date-adapter.d.ts +195 -200
- package/types/forty-cdk-date-field.d.ts +472 -335
- package/types/forty-cdk-date-picker.d.ts +617 -475
- package/types/forty-cdk-defaults.d.ts +1495 -1251
- package/types/forty-cdk-dialog.d.ts +367 -338
- package/types/forty-cdk-disclosure.d.ts +78 -61
- package/types/forty-cdk-drag-drop.d.ts +570 -483
- package/types/forty-cdk-drawer.d.ts +711 -633
- package/types/forty-cdk-dropdown-menu.d.ts +236 -177
- package/types/forty-cdk-field.d.ts +194 -178
- package/types/forty-cdk-fieldset.d.ts +84 -83
- package/types/forty-cdk-file-upload.d.ts +152 -126
- package/types/forty-cdk-hover-card.d.ts +245 -210
- package/types/forty-cdk-input.d.ts +36 -36
- package/types/forty-cdk-internationalized-date.d.ts +81 -85
- package/types/forty-cdk-listbox.d.ts +570 -485
- package/types/forty-cdk-menu.d.ts +673 -543
- package/types/forty-cdk-menubar.d.ts +529 -462
- package/types/forty-cdk-meter.d.ts +130 -88
- package/types/forty-cdk-navigation-menu.d.ts +453 -379
- package/types/forty-cdk-number-input.d.ts +243 -199
- package/types/forty-cdk-otp-input.d.ts +194 -129
- package/types/forty-cdk-pagination.d.ts +239 -168
- package/types/forty-cdk-pane-resizer.d.ts +195 -133
- package/types/forty-cdk-popover.d.ts +381 -327
- package/types/forty-cdk-progress.d.ts +114 -87
- package/types/forty-cdk-radio-group.d.ts +189 -135
- package/types/forty-cdk-scroll-area.d.ts +329 -297
- package/types/forty-cdk-search.d.ts +103 -99
- package/types/forty-cdk-select.d.ts +874 -716
- package/types/forty-cdk-separator.d.ts +30 -22
- package/types/forty-cdk-shared.d.ts +4 -3
- package/types/forty-cdk-slider.d.ts +335 -278
- package/types/forty-cdk-stepper.d.ts +588 -505
- package/types/forty-cdk-switch.d.ts +26 -22
- package/types/forty-cdk-table-virtualization.d.ts +88 -70
- package/types/forty-cdk-table.d.ts +1970 -1356
- package/types/forty-cdk-tabs.d.ts +245 -191
- package/types/forty-cdk-testing.d.ts +38 -46
- package/types/forty-cdk-time-field.d.ts +508 -366
- package/types/forty-cdk-time-picker.d.ts +552 -432
- package/types/forty-cdk-toast.d.ts +643 -479
- package/types/forty-cdk-toggle.d.ts +212 -167
- package/types/forty-cdk-toolbar.d.ts +188 -142
- package/types/forty-cdk-tooltip.d.ts +301 -257
- package/types/forty-cdk-tree.d.ts +797 -650
- package/types/forty-cdk-virtual-reorder.d.ts +36 -27
- package/types/forty-cdk-virtualization.d.ts +295 -218
- package/types/forty-cdk-visually-hidden.d.ts +2 -1
- package/types/forty-cdk.d.ts +1 -2
- package/virtualization/README.md +20 -11
- package/fesm2022/forty-cdk-shared.mjs.map +0 -1
- package/fesm2022/forty-cdk-visually-hidden.mjs.map +0 -1
- package/fesm2022/forty-cdk.mjs.map +0 -1
|
@@ -1,383 +1,507 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const FOR_ACCORDION_CONTEXT = new InjectionToken('FOR_ACCORDION_CONTEXT');
|
|
16
|
-
const FOR_ACCORDION_ITEM_CONTEXT = new InjectionToken('FOR_ACCORDION_ITEM_CONTEXT');
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
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";
|
|
4
|
+
const FOR_ACCORDION_CONTEXT = new InjectionToken("FOR_ACCORDION_CONTEXT");
|
|
5
|
+
const FOR_ACCORDION_ITEM_CONTEXT = new InjectionToken("FOR_ACCORDION_ITEM_CONTEXT");
|
|
17
6
|
function injectAccordionContext(piece) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
return ctx;
|
|
7
|
+
const ctx = inject(FOR_ACCORDION_CONTEXT, { optional: true });
|
|
8
|
+
if (!ctx) throw orphanContextError({
|
|
9
|
+
code: "FORCDK-ACCORDION-001",
|
|
10
|
+
piece,
|
|
11
|
+
root: "[forAccordion]",
|
|
12
|
+
token: "FOR_ACCORDION_CONTEXT"
|
|
13
|
+
});
|
|
14
|
+
assertRootContext({
|
|
15
|
+
entryPoint: "accordion",
|
|
16
|
+
token: "FOR_ACCORDION_CONTEXT",
|
|
17
|
+
root: "[forAccordion]",
|
|
18
|
+
piece,
|
|
19
|
+
probe: () => ctx.registerTrigger
|
|
20
|
+
});
|
|
21
|
+
return ctx;
|
|
35
22
|
}
|
|
36
23
|
function injectAccordionItemContext(piece) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
return ctx;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
class ForAccordion {
|
|
72
|
-
#triggers = new Collection();
|
|
73
|
-
|
|
74
|
-
multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
collapsible = input(false, { ...(ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
orientation = input('vertical', /* @ts-ignore */
|
|
95
|
-
...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
_dirInput = input(null, { ...(ngDevMode ? { debugName: "_dirInput" } : /* istanbul ignore next */ {}), alias: 'dir' });
|
|
105
|
-
dir = injectTextDirection(this._dirInput);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
loop = input(true, { ...(ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
value = model([], /* @ts-ignore */
|
|
120
|
-
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
121
|
-
isExpanded(itemValue) {
|
|
122
|
-
return this.value().includes(itemValue);
|
|
123
|
-
}
|
|
124
|
-
toggle(itemValue) {
|
|
125
|
-
const current = this.value();
|
|
126
|
-
const isOpen = current.includes(itemValue);
|
|
127
|
-
if (isOpen) {
|
|
128
|
-
if (!this.canCollapse(itemValue)) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
this.value.set(current.filter((v) => v !== itemValue));
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
if (this.multiple()) {
|
|
135
|
-
this.value.set([...current, itemValue]);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
this.value.set([itemValue]);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
canCollapse(_itemValue) {
|
|
142
|
-
return this.multiple() || this.collapsible();
|
|
143
|
-
}
|
|
144
|
-
focusByOffset(currentTrigger, action) {
|
|
145
|
-
const triggers = this.#triggers.items();
|
|
146
|
-
if (triggers.length === 0) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const currentIndex = triggers.findIndex((t) => t.host === currentTrigger);
|
|
150
|
-
if (currentIndex === -1 && action !== 'first' && action !== 'last') {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, triggers.length, action, {
|
|
154
|
-
loop: this.loop(),
|
|
155
|
-
isDisabled: (i) => triggers[i]?.disabled() ?? false,
|
|
156
|
-
});
|
|
157
|
-
if (next !== null) {
|
|
158
|
-
triggers[next]?.host.focus();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
registerTrigger(handle) {
|
|
162
|
-
this.#triggers.register(handle);
|
|
163
|
-
}
|
|
164
|
-
unregisterTrigger(handle) {
|
|
165
|
-
this.#triggers.unregister(handle);
|
|
166
|
-
}
|
|
167
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordion, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
168
|
-
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 });
|
|
169
|
-
}
|
|
170
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordion, decorators: [{
|
|
171
|
-
type: Directive,
|
|
172
|
-
args: [{
|
|
173
|
-
selector: '[forAccordion]',
|
|
174
|
-
exportAs: 'forAccordion',
|
|
175
|
-
host: {
|
|
176
|
-
'[attr.data-orientation]': 'orientation()',
|
|
177
|
-
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
178
|
-
'[attr.dir]': 'dir()',
|
|
179
|
-
},
|
|
180
|
-
providers: [{ provide: FOR_ACCORDION_CONTEXT, useExisting: ForAccordion }],
|
|
181
|
-
}]
|
|
182
|
-
}], 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"] }] } });
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
class ForAccordionItem {
|
|
190
|
-
parent = injectAccordionContext('ForAccordionItem');
|
|
191
|
-
#idGen = inject(IdGenerator);
|
|
192
|
-
|
|
193
|
-
value = input.required(/* @ts-ignore */
|
|
194
|
-
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'disabled' });
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
disabled = computed(() => this.disabledInput() || this.parent.disabled(), /* @ts-ignore */
|
|
211
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
212
|
-
#triggerId = signal(this.#idGen.next('for-accordion-trigger'), /* @ts-ignore */
|
|
213
|
-
...(ngDevMode ? [{ debugName: "#triggerId" }] : /* istanbul ignore next */ []));
|
|
214
|
-
#contentId = signal(this.#idGen.next('for-accordion-content'), /* @ts-ignore */
|
|
215
|
-
...(ngDevMode ? [{ debugName: "#contentId" }] : /* istanbul ignore next */ []));
|
|
216
|
-
triggerId = this.#triggerId.asReadonly();
|
|
217
|
-
contentId = this.#contentId.asReadonly();
|
|
218
|
-
expanded = computed(() => this.parent.isExpanded(this.value()), /* @ts-ignore */
|
|
219
|
-
...(ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []));
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
adoptTriggerId(el) {
|
|
226
|
-
adoptHostId(el, this.#triggerId);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
adoptContentId(el) {
|
|
230
|
-
adoptHostId(el, this.#contentId);
|
|
231
|
-
}
|
|
232
|
-
toggle() {
|
|
233
|
-
if (this.disabled()) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
this.parent.toggle(this.value());
|
|
237
|
-
}
|
|
238
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordionItem, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
239
|
-
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 });
|
|
240
|
-
}
|
|
241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordionItem, decorators: [{
|
|
242
|
-
type: Directive,
|
|
243
|
-
args: [{
|
|
244
|
-
selector: '[forAccordionItem]',
|
|
245
|
-
exportAs: 'forAccordionItem',
|
|
246
|
-
host: {
|
|
247
|
-
'[attr.data-state]': 'expanded() ? "open" : "closed"',
|
|
248
|
-
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
249
|
-
'[attr.data-orientation]': 'parent.orientation()',
|
|
250
|
-
},
|
|
251
|
-
providers: [{ provide: FOR_ACCORDION_ITEM_CONTEXT, useExisting: ForAccordionItem }],
|
|
252
|
-
}]
|
|
253
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
class ForAccordionTrigger {
|
|
269
|
-
buttonType = hostButtonType();
|
|
270
|
-
#host = inject(ElementRef);
|
|
271
|
-
parent = injectAccordionContext('ForAccordionTrigger');
|
|
272
|
-
item = injectAccordionItemContext('ForAccordionTrigger');
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
ariaDisabled = computed(() => {
|
|
288
|
-
if (this.item.disabled()) {
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
return this.item.expanded() && !this.parent.canCollapse(this.item.value());
|
|
292
|
-
}, /* @ts-ignore */
|
|
293
|
-
...(ngDevMode ? [{ debugName: "ariaDisabled" }] : /* istanbul ignore next */ []));
|
|
294
|
-
constructor() {
|
|
295
|
-
this.item.adoptTriggerId(this.#host.nativeElement);
|
|
296
|
-
const handle = {
|
|
297
|
-
host: this.#host.nativeElement,
|
|
298
|
-
disabled: this.item.disabled,
|
|
299
|
-
};
|
|
300
|
-
registerHandle(handle, (h) => this.parent.registerTrigger(h), (h) => this.parent.unregisterTrigger(h));
|
|
301
|
-
reflectDisabled(this.item.disabled);
|
|
302
|
-
}
|
|
303
|
-
onKeyDown(event) {
|
|
304
|
-
const action = resolveListNavigation(event, {
|
|
305
|
-
orientation: this.parent.orientation(),
|
|
306
|
-
dir: this.parent.dir(),
|
|
307
|
-
});
|
|
308
|
-
if (!action) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
event.preventDefault();
|
|
312
|
-
this.parent.focusByOffset(this.#host.nativeElement, action);
|
|
313
|
-
}
|
|
314
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordionTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
315
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: ForAccordionTrigger, isStandalone: true, selector: "[forAccordionTrigger]", host: { listeners: { "click": "item.toggle()", "keydown": "onKeyDown($event)" }, properties: { "attr.type": "buttonType()", "id": "item.triggerId()", "attr.aria-expanded": "item.expanded() ? \"true\" : \"false\"", "attr.aria-controls": "item.expanded() ? item.contentId() : null", "attr.aria-disabled": "ariaDisabled() ? \"true\" : null", "attr.data-state": "item.expanded() ? \"open\" : \"closed\"", "attr.data-disabled": "item.disabled() ? \"\" : null", "attr.data-orientation": "parent.orientation()" } }, exportAs: ["forAccordionTrigger"], ngImport: i0 });
|
|
316
|
-
}
|
|
317
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordionTrigger, decorators: [{
|
|
318
|
-
type: Directive,
|
|
319
|
-
args: [{
|
|
320
|
-
selector: '[forAccordionTrigger]',
|
|
321
|
-
exportAs: 'forAccordionTrigger',
|
|
322
|
-
host: {
|
|
323
|
-
'[attr.type]': 'buttonType()',
|
|
324
|
-
'[id]': 'item.triggerId()',
|
|
325
|
-
'[attr.aria-expanded]': 'item.expanded() ? "true" : "false"',
|
|
326
|
-
'[attr.aria-controls]': 'item.expanded() ? item.contentId() : null',
|
|
327
|
-
'[attr.aria-disabled]': 'ariaDisabled() ? "true" : null',
|
|
328
|
-
'[attr.data-state]': 'item.expanded() ? "open" : "closed"',
|
|
329
|
-
'[attr.data-disabled]': 'item.disabled() ? "" : null',
|
|
330
|
-
'[attr.data-orientation]': 'parent.orientation()',
|
|
331
|
-
'(click)': 'item.toggle()',
|
|
332
|
-
'(keydown)': 'onKeyDown($event)',
|
|
333
|
-
},
|
|
334
|
-
}]
|
|
335
|
-
}], ctorParameters: () => [] });
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
class ForAccordionContent {
|
|
352
|
-
parent = injectAccordionContext('ForAccordionContent');
|
|
353
|
-
item = injectAccordionItemContext('ForAccordionContent');
|
|
354
|
-
labelledBy = hostLabelledBy(() => this.item.triggerId());
|
|
355
|
-
constructor() {
|
|
356
|
-
this.item.adoptContentId(inject(ElementRef).nativeElement);
|
|
357
|
-
}
|
|
358
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: ForAccordionContent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
359
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: ForAccordionContent, isStandalone: true, selector: "[forAccordionContent]", host: { properties: { "id": "item.contentId()", "attr.role": "\"region\"", "attr.aria-hidden": "item.expanded() ? null : \"true\"", "attr.inert": "item.expanded() ? null : \"\"", "attr.data-state": "item.expanded() ? \"open\" : \"closed\"", "attr.data-disabled": "item.disabled() ? \"\" : null", "attr.data-orientation": "parent.orientation()" } }, exportAs: ["forAccordionContent"], ngImport: i0 });
|
|
24
|
+
const ctx = inject(FOR_ACCORDION_ITEM_CONTEXT, { optional: true });
|
|
25
|
+
if (!ctx) throw orphanContextError({
|
|
26
|
+
code: "FORCDK-ACCORDION-002",
|
|
27
|
+
piece,
|
|
28
|
+
root: "[forAccordionItem]",
|
|
29
|
+
token: "FOR_ACCORDION_ITEM_CONTEXT"
|
|
30
|
+
});
|
|
31
|
+
return ctx;
|
|
360
32
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
33
|
+
var ForAccordion = class ForAccordion {
|
|
34
|
+
#triggers = new Collection();
|
|
35
|
+
multiple = input(false, {
|
|
36
|
+
...ngDevMode ? { debugName: "multiple" } : /* istanbul ignore next */ {},
|
|
37
|
+
transform: booleanAttribute
|
|
38
|
+
});
|
|
39
|
+
disabled = input(false, {
|
|
40
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
41
|
+
transform: booleanAttribute
|
|
42
|
+
});
|
|
43
|
+
collapsible = input(false, {
|
|
44
|
+
...ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {},
|
|
45
|
+
transform: booleanAttribute
|
|
46
|
+
});
|
|
47
|
+
orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
|
|
48
|
+
_dirInput = input(null, {
|
|
49
|
+
...ngDevMode ? { debugName: "_dirInput" } : /* istanbul ignore next */ {},
|
|
50
|
+
alias: "dir"
|
|
51
|
+
});
|
|
52
|
+
dir = injectTextDirection(this._dirInput);
|
|
53
|
+
loop = input(true, {
|
|
54
|
+
...ngDevMode ? { debugName: "loop" } : /* istanbul ignore next */ {},
|
|
55
|
+
transform: booleanAttribute
|
|
56
|
+
});
|
|
57
|
+
value = model([], ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
58
|
+
isExpanded(itemValue) {
|
|
59
|
+
return this.value().includes(itemValue);
|
|
60
|
+
}
|
|
61
|
+
toggle(itemValue) {
|
|
62
|
+
const current = this.value();
|
|
63
|
+
if (current.includes(itemValue)) {
|
|
64
|
+
if (!this.canCollapse(itemValue)) return;
|
|
65
|
+
this.value.set(current.filter((v) => v !== itemValue));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (this.multiple()) this.value.set([...current, itemValue]);
|
|
69
|
+
else this.value.set([itemValue]);
|
|
70
|
+
}
|
|
71
|
+
canCollapse(_itemValue) {
|
|
72
|
+
return this.multiple() || this.collapsible();
|
|
73
|
+
}
|
|
74
|
+
focusByOffset(currentTrigger, action) {
|
|
75
|
+
const triggers = this.#triggers.items();
|
|
76
|
+
if (triggers.length === 0) return;
|
|
77
|
+
const currentIndex = triggers.findIndex((t) => t.host === currentTrigger);
|
|
78
|
+
if (currentIndex === -1 && action !== "first" && action !== "last") return;
|
|
79
|
+
const next = moveIndex(currentIndex < 0 ? 0 : currentIndex, triggers.length, action, {
|
|
80
|
+
loop: this.loop(),
|
|
81
|
+
isDisabled: (i) => triggers[i]?.disabled() ?? false
|
|
82
|
+
});
|
|
83
|
+
if (next !== null) triggers[next]?.host.focus();
|
|
84
|
+
}
|
|
85
|
+
registerTrigger(handle) {
|
|
86
|
+
this.#triggers.register(handle);
|
|
87
|
+
}
|
|
88
|
+
unregisterTrigger(handle) {
|
|
89
|
+
this.#triggers.unregister(handle);
|
|
90
|
+
}
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
92
|
+
minVersion: "12.0.0",
|
|
93
|
+
version: "22.2.2",
|
|
94
|
+
ngImport: i0,
|
|
95
|
+
type: ForAccordion,
|
|
96
|
+
deps: [],
|
|
97
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
98
|
+
});
|
|
99
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
100
|
+
minVersion: "17.1.0",
|
|
101
|
+
version: "22.2.2",
|
|
102
|
+
type: ForAccordion,
|
|
103
|
+
isStandalone: true,
|
|
104
|
+
selector: "[forAccordion]",
|
|
105
|
+
inputs: {
|
|
106
|
+
multiple: {
|
|
107
|
+
classPropertyName: "multiple",
|
|
108
|
+
publicName: "multiple",
|
|
109
|
+
isSignal: true,
|
|
110
|
+
isRequired: false,
|
|
111
|
+
transformFunction: null
|
|
112
|
+
},
|
|
113
|
+
disabled: {
|
|
114
|
+
classPropertyName: "disabled",
|
|
115
|
+
publicName: "disabled",
|
|
116
|
+
isSignal: true,
|
|
117
|
+
isRequired: false,
|
|
118
|
+
transformFunction: null
|
|
119
|
+
},
|
|
120
|
+
collapsible: {
|
|
121
|
+
classPropertyName: "collapsible",
|
|
122
|
+
publicName: "collapsible",
|
|
123
|
+
isSignal: true,
|
|
124
|
+
isRequired: false,
|
|
125
|
+
transformFunction: null
|
|
126
|
+
},
|
|
127
|
+
orientation: {
|
|
128
|
+
classPropertyName: "orientation",
|
|
129
|
+
publicName: "orientation",
|
|
130
|
+
isSignal: true,
|
|
131
|
+
isRequired: false,
|
|
132
|
+
transformFunction: null
|
|
133
|
+
},
|
|
134
|
+
_dirInput: {
|
|
135
|
+
classPropertyName: "_dirInput",
|
|
136
|
+
publicName: "dir",
|
|
137
|
+
isSignal: true,
|
|
138
|
+
isRequired: false,
|
|
139
|
+
transformFunction: null
|
|
140
|
+
},
|
|
141
|
+
loop: {
|
|
142
|
+
classPropertyName: "loop",
|
|
143
|
+
publicName: "loop",
|
|
144
|
+
isSignal: true,
|
|
145
|
+
isRequired: false,
|
|
146
|
+
transformFunction: null
|
|
147
|
+
},
|
|
148
|
+
value: {
|
|
149
|
+
classPropertyName: "value",
|
|
150
|
+
publicName: "value",
|
|
151
|
+
isSignal: true,
|
|
152
|
+
isRequired: false,
|
|
153
|
+
transformFunction: null
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
outputs: { value: "valueChange" },
|
|
157
|
+
host: { properties: {
|
|
158
|
+
"attr.data-orientation": "orientation()",
|
|
159
|
+
"attr.data-disabled": "disabled() ? \"\" : null",
|
|
160
|
+
"attr.dir": "dir()"
|
|
161
|
+
} },
|
|
162
|
+
providers: [{
|
|
163
|
+
provide: FOR_ACCORDION_CONTEXT,
|
|
164
|
+
useExisting: ForAccordion
|
|
165
|
+
}],
|
|
166
|
+
exportAs: ["forAccordion"],
|
|
167
|
+
ngImport: i0
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
171
|
+
minVersion: "12.0.0",
|
|
172
|
+
version: "22.2.2",
|
|
173
|
+
ngImport: i0,
|
|
174
|
+
type: ForAccordion,
|
|
175
|
+
decorators: [{
|
|
176
|
+
type: Directive,
|
|
177
|
+
args: [{
|
|
178
|
+
selector: "[forAccordion]",
|
|
179
|
+
exportAs: "forAccordion",
|
|
180
|
+
host: {
|
|
181
|
+
"[attr.data-orientation]": "orientation()",
|
|
182
|
+
"[attr.data-disabled]": "disabled() ? \"\" : null",
|
|
183
|
+
"[attr.dir]": "dir()"
|
|
184
|
+
},
|
|
185
|
+
providers: [{
|
|
186
|
+
provide: FOR_ACCORDION_CONTEXT,
|
|
187
|
+
useExisting: ForAccordion
|
|
188
|
+
}]
|
|
189
|
+
}]
|
|
190
|
+
}],
|
|
191
|
+
propDecorators: {
|
|
192
|
+
multiple: [{
|
|
193
|
+
type: i0.Input,
|
|
194
|
+
args: [{
|
|
195
|
+
isSignal: true,
|
|
196
|
+
alias: "multiple",
|
|
197
|
+
required: false
|
|
198
|
+
}]
|
|
199
|
+
}],
|
|
200
|
+
disabled: [{
|
|
201
|
+
type: i0.Input,
|
|
202
|
+
args: [{
|
|
203
|
+
isSignal: true,
|
|
204
|
+
alias: "disabled",
|
|
205
|
+
required: false
|
|
206
|
+
}]
|
|
207
|
+
}],
|
|
208
|
+
collapsible: [{
|
|
209
|
+
type: i0.Input,
|
|
210
|
+
args: [{
|
|
211
|
+
isSignal: true,
|
|
212
|
+
alias: "collapsible",
|
|
213
|
+
required: false
|
|
214
|
+
}]
|
|
215
|
+
}],
|
|
216
|
+
orientation: [{
|
|
217
|
+
type: i0.Input,
|
|
218
|
+
args: [{
|
|
219
|
+
isSignal: true,
|
|
220
|
+
alias: "orientation",
|
|
221
|
+
required: false
|
|
222
|
+
}]
|
|
223
|
+
}],
|
|
224
|
+
_dirInput: [{
|
|
225
|
+
type: i0.Input,
|
|
226
|
+
args: [{
|
|
227
|
+
isSignal: true,
|
|
228
|
+
alias: "dir",
|
|
229
|
+
required: false
|
|
230
|
+
}]
|
|
231
|
+
}],
|
|
232
|
+
loop: [{
|
|
233
|
+
type: i0.Input,
|
|
234
|
+
args: [{
|
|
235
|
+
isSignal: true,
|
|
236
|
+
alias: "loop",
|
|
237
|
+
required: false
|
|
238
|
+
}]
|
|
239
|
+
}],
|
|
240
|
+
value: [{
|
|
241
|
+
type: i0.Input,
|
|
242
|
+
args: [{
|
|
243
|
+
isSignal: true,
|
|
244
|
+
alias: "value",
|
|
245
|
+
required: false
|
|
246
|
+
}]
|
|
247
|
+
}, {
|
|
248
|
+
type: i0.Output,
|
|
249
|
+
args: ["valueChange"]
|
|
250
|
+
}]
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
var ForAccordionItem = class ForAccordionItem {
|
|
254
|
+
parent = injectAccordionContext("ForAccordionItem");
|
|
255
|
+
#idGen = inject(IdGenerator);
|
|
256
|
+
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
257
|
+
disabledInput = input(false, {
|
|
258
|
+
...ngDevMode ? { debugName: "disabledInput" } : /* istanbul ignore next */ {},
|
|
259
|
+
transform: booleanAttribute,
|
|
260
|
+
alias: "disabled"
|
|
261
|
+
});
|
|
262
|
+
disabled = computed(() => this.disabledInput() || this.parent.disabled(), ...ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []);
|
|
263
|
+
#triggerId = signal(this.#idGen.next("for-accordion-trigger"), ...ngDevMode ? [{ debugName: "#triggerId" }] : /* istanbul ignore next */ []);
|
|
264
|
+
#contentId = signal(this.#idGen.next("for-accordion-content"), ...ngDevMode ? [{ debugName: "#contentId" }] : /* istanbul ignore next */ []);
|
|
265
|
+
triggerId = this.#triggerId.asReadonly();
|
|
266
|
+
contentId = this.#contentId.asReadonly();
|
|
267
|
+
expanded = computed(() => this.parent.isExpanded(this.value()), ...ngDevMode ? [{ debugName: "expanded" }] : /* istanbul ignore next */ []);
|
|
268
|
+
adoptTriggerId(el) {
|
|
269
|
+
adoptHostId(el, this.#triggerId);
|
|
270
|
+
}
|
|
271
|
+
adoptContentId(el) {
|
|
272
|
+
adoptHostId(el, this.#contentId);
|
|
273
|
+
}
|
|
274
|
+
toggle() {
|
|
275
|
+
if (this.disabled()) return;
|
|
276
|
+
this.parent.toggle(this.value());
|
|
277
|
+
}
|
|
278
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
279
|
+
minVersion: "12.0.0",
|
|
280
|
+
version: "22.2.2",
|
|
281
|
+
ngImport: i0,
|
|
282
|
+
type: ForAccordionItem,
|
|
283
|
+
deps: [],
|
|
284
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
285
|
+
});
|
|
286
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
287
|
+
minVersion: "17.1.0",
|
|
288
|
+
version: "22.2.2",
|
|
289
|
+
type: ForAccordionItem,
|
|
290
|
+
isStandalone: true,
|
|
291
|
+
selector: "[forAccordionItem]",
|
|
292
|
+
inputs: {
|
|
293
|
+
value: {
|
|
294
|
+
classPropertyName: "value",
|
|
295
|
+
publicName: "value",
|
|
296
|
+
isSignal: true,
|
|
297
|
+
isRequired: true,
|
|
298
|
+
transformFunction: null
|
|
299
|
+
},
|
|
300
|
+
disabledInput: {
|
|
301
|
+
classPropertyName: "disabledInput",
|
|
302
|
+
publicName: "disabled",
|
|
303
|
+
isSignal: true,
|
|
304
|
+
isRequired: false,
|
|
305
|
+
transformFunction: null
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
host: { properties: {
|
|
309
|
+
"attr.data-state": "expanded() ? \"open\" : \"closed\"",
|
|
310
|
+
"attr.data-disabled": "disabled() ? \"\" : null",
|
|
311
|
+
"attr.data-orientation": "parent.orientation()"
|
|
312
|
+
} },
|
|
313
|
+
providers: [{
|
|
314
|
+
provide: FOR_ACCORDION_ITEM_CONTEXT,
|
|
315
|
+
useExisting: ForAccordionItem
|
|
316
|
+
}],
|
|
317
|
+
exportAs: ["forAccordionItem"],
|
|
318
|
+
ngImport: i0
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
322
|
+
minVersion: "12.0.0",
|
|
323
|
+
version: "22.2.2",
|
|
324
|
+
ngImport: i0,
|
|
325
|
+
type: ForAccordionItem,
|
|
326
|
+
decorators: [{
|
|
327
|
+
type: Directive,
|
|
328
|
+
args: [{
|
|
329
|
+
selector: "[forAccordionItem]",
|
|
330
|
+
exportAs: "forAccordionItem",
|
|
331
|
+
host: {
|
|
332
|
+
"[attr.data-state]": "expanded() ? \"open\" : \"closed\"",
|
|
333
|
+
"[attr.data-disabled]": "disabled() ? \"\" : null",
|
|
334
|
+
"[attr.data-orientation]": "parent.orientation()"
|
|
335
|
+
},
|
|
336
|
+
providers: [{
|
|
337
|
+
provide: FOR_ACCORDION_ITEM_CONTEXT,
|
|
338
|
+
useExisting: ForAccordionItem
|
|
339
|
+
}]
|
|
340
|
+
}]
|
|
341
|
+
}],
|
|
342
|
+
propDecorators: {
|
|
343
|
+
value: [{
|
|
344
|
+
type: i0.Input,
|
|
345
|
+
args: [{
|
|
346
|
+
isSignal: true,
|
|
347
|
+
alias: "value",
|
|
348
|
+
required: true
|
|
349
|
+
}]
|
|
350
|
+
}],
|
|
351
|
+
disabledInput: [{
|
|
352
|
+
type: i0.Input,
|
|
353
|
+
args: [{
|
|
354
|
+
isSignal: true,
|
|
355
|
+
alias: "disabled",
|
|
356
|
+
required: false
|
|
357
|
+
}]
|
|
358
|
+
}]
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
var ForAccordionTrigger = class ForAccordionTrigger {
|
|
362
|
+
buttonType = hostButtonType();
|
|
363
|
+
#host = inject(ElementRef);
|
|
364
|
+
parent = injectAccordionContext("ForAccordionTrigger");
|
|
365
|
+
item = injectAccordionItemContext("ForAccordionTrigger");
|
|
366
|
+
ariaDisabled = computed(() => {
|
|
367
|
+
if (this.item.disabled()) return false;
|
|
368
|
+
return this.item.expanded() && !this.parent.canCollapse(this.item.value());
|
|
369
|
+
}, ...ngDevMode ? [{ debugName: "ariaDisabled" }] : /* istanbul ignore next */ []);
|
|
370
|
+
constructor() {
|
|
371
|
+
this.item.adoptTriggerId(this.#host.nativeElement);
|
|
372
|
+
const handle = {
|
|
373
|
+
host: this.#host.nativeElement,
|
|
374
|
+
disabled: this.item.disabled
|
|
375
|
+
};
|
|
376
|
+
registerHandle(handle, (h) => this.parent.registerTrigger(h), (h) => this.parent.unregisterTrigger(h));
|
|
377
|
+
reflectDisabled(this.item.disabled);
|
|
378
|
+
}
|
|
379
|
+
onKeyDown(event) {
|
|
380
|
+
const action = resolveListNavigation(event, {
|
|
381
|
+
orientation: this.parent.orientation(),
|
|
382
|
+
dir: this.parent.dir()
|
|
383
|
+
});
|
|
384
|
+
if (!action) return;
|
|
385
|
+
event.preventDefault();
|
|
386
|
+
this.parent.focusByOffset(this.#host.nativeElement, action);
|
|
387
|
+
}
|
|
388
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
389
|
+
minVersion: "12.0.0",
|
|
390
|
+
version: "22.2.2",
|
|
391
|
+
ngImport: i0,
|
|
392
|
+
type: ForAccordionTrigger,
|
|
393
|
+
deps: [],
|
|
394
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
395
|
+
});
|
|
396
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
397
|
+
minVersion: "14.0.0",
|
|
398
|
+
version: "22.2.2",
|
|
399
|
+
type: ForAccordionTrigger,
|
|
400
|
+
isStandalone: true,
|
|
401
|
+
selector: "[forAccordionTrigger]",
|
|
402
|
+
host: {
|
|
403
|
+
listeners: {
|
|
404
|
+
"click": "item.toggle()",
|
|
405
|
+
"keydown": "onKeyDown($event)"
|
|
406
|
+
},
|
|
407
|
+
properties: {
|
|
408
|
+
"attr.type": "buttonType()",
|
|
409
|
+
"id": "item.triggerId()",
|
|
410
|
+
"attr.aria-expanded": "item.expanded() ? \"true\" : \"false\"",
|
|
411
|
+
"attr.aria-controls": "item.expanded() ? item.contentId() : null",
|
|
412
|
+
"attr.aria-disabled": "ariaDisabled() ? \"true\" : null",
|
|
413
|
+
"attr.data-state": "item.expanded() ? \"open\" : \"closed\"",
|
|
414
|
+
"attr.data-disabled": "item.disabled() ? \"\" : null",
|
|
415
|
+
"attr.data-orientation": "parent.orientation()"
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
exportAs: ["forAccordionTrigger"],
|
|
419
|
+
ngImport: i0
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
423
|
+
minVersion: "12.0.0",
|
|
424
|
+
version: "22.2.2",
|
|
425
|
+
ngImport: i0,
|
|
426
|
+
type: ForAccordionTrigger,
|
|
427
|
+
decorators: [{
|
|
428
|
+
type: Directive,
|
|
429
|
+
args: [{
|
|
430
|
+
selector: "[forAccordionTrigger]",
|
|
431
|
+
exportAs: "forAccordionTrigger",
|
|
432
|
+
host: {
|
|
433
|
+
"[attr.type]": "buttonType()",
|
|
434
|
+
"[id]": "item.triggerId()",
|
|
435
|
+
"[attr.aria-expanded]": "item.expanded() ? \"true\" : \"false\"",
|
|
436
|
+
"[attr.aria-controls]": "item.expanded() ? item.contentId() : null",
|
|
437
|
+
"[attr.aria-disabled]": "ariaDisabled() ? \"true\" : null",
|
|
438
|
+
"[attr.data-state]": "item.expanded() ? \"open\" : \"closed\"",
|
|
439
|
+
"[attr.data-disabled]": "item.disabled() ? \"\" : null",
|
|
440
|
+
"[attr.data-orientation]": "parent.orientation()",
|
|
441
|
+
"(click)": "item.toggle()",
|
|
442
|
+
"(keydown)": "onKeyDown($event)"
|
|
443
|
+
}
|
|
444
|
+
}]
|
|
445
|
+
}],
|
|
446
|
+
ctorParameters: () => []
|
|
447
|
+
});
|
|
448
|
+
var ForAccordionContent = class ForAccordionContent {
|
|
449
|
+
parent = injectAccordionContext("ForAccordionContent");
|
|
450
|
+
item = injectAccordionItemContext("ForAccordionContent");
|
|
451
|
+
labelledBy = hostLabelledBy(() => this.item.triggerId());
|
|
452
|
+
constructor() {
|
|
453
|
+
this.item.adoptContentId(inject(ElementRef).nativeElement);
|
|
454
|
+
}
|
|
455
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
456
|
+
minVersion: "12.0.0",
|
|
457
|
+
version: "22.2.2",
|
|
458
|
+
ngImport: i0,
|
|
459
|
+
type: ForAccordionContent,
|
|
460
|
+
deps: [],
|
|
461
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
462
|
+
});
|
|
463
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
464
|
+
minVersion: "14.0.0",
|
|
465
|
+
version: "22.2.2",
|
|
466
|
+
type: ForAccordionContent,
|
|
467
|
+
isStandalone: true,
|
|
468
|
+
selector: "[forAccordionContent]",
|
|
469
|
+
host: { properties: {
|
|
470
|
+
"id": "item.contentId()",
|
|
471
|
+
"attr.role": "\"region\"",
|
|
472
|
+
"attr.aria-hidden": "item.expanded() ? null : \"true\"",
|
|
473
|
+
"attr.inert": "item.expanded() ? null : \"\"",
|
|
474
|
+
"attr.data-state": "item.expanded() ? \"open\" : \"closed\"",
|
|
475
|
+
"attr.data-disabled": "item.disabled() ? \"\" : null",
|
|
476
|
+
"attr.data-orientation": "parent.orientation()"
|
|
477
|
+
} },
|
|
478
|
+
exportAs: ["forAccordionContent"],
|
|
479
|
+
ngImport: i0
|
|
480
|
+
});
|
|
481
|
+
};
|
|
482
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
483
|
+
minVersion: "12.0.0",
|
|
484
|
+
version: "22.2.2",
|
|
485
|
+
ngImport: i0,
|
|
486
|
+
type: ForAccordionContent,
|
|
487
|
+
decorators: [{
|
|
488
|
+
type: Directive,
|
|
489
|
+
args: [{
|
|
490
|
+
selector: "[forAccordionContent]",
|
|
491
|
+
exportAs: "forAccordionContent",
|
|
492
|
+
host: {
|
|
493
|
+
"[id]": "item.contentId()",
|
|
494
|
+
"[attr.role]": "\"region\"",
|
|
495
|
+
"[attr.aria-hidden]": "item.expanded() ? null : \"true\"",
|
|
496
|
+
"[attr.inert]": "item.expanded() ? null : \"\"",
|
|
497
|
+
"[attr.data-state]": "item.expanded() ? \"open\" : \"closed\"",
|
|
498
|
+
"[attr.data-disabled]": "item.disabled() ? \"\" : null",
|
|
499
|
+
"[attr.data-orientation]": "parent.orientation()"
|
|
500
|
+
}
|
|
501
|
+
}]
|
|
502
|
+
}],
|
|
503
|
+
ctorParameters: () => []
|
|
504
|
+
});
|
|
382
505
|
export { FOR_ACCORDION_CONTEXT, FOR_ACCORDION_ITEM_CONTEXT, ForAccordion, ForAccordionContent, ForAccordionItem, ForAccordionTrigger };
|
|
383
|
-
|
|
506
|
+
|
|
507
|
+
//# sourceMappingURL=forty-cdk-accordion.mjs.map
|