@angular/aria 22.0.0-next.4 → 22.0.0-next.6
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/fesm2022/_accordion-chunk.mjs +5 -5
- package/fesm2022/_accordion-chunk.mjs.map +1 -1
- package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-chunk.mjs +5 -5
- package/fesm2022/_combobox-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-listbox-chunk.mjs +1 -1
- package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -1
- package/fesm2022/_combobox-tree-chunk.mjs +6 -6
- package/fesm2022/_combobox-tree-chunk.mjs.map +1 -1
- package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
- package/fesm2022/_element-chunk.mjs +6 -0
- package/fesm2022/_element-chunk.mjs.map +1 -0
- package/fesm2022/_expansion-chunk.mjs.map +1 -1
- package/fesm2022/_list-chunk.mjs.map +1 -1
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
- package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
- package/fesm2022/_menu-chunk.mjs.map +1 -1
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -1
- package/fesm2022/_signal-like-chunk.mjs.map +1 -1
- package/fesm2022/_tabs-chunk.mjs +1 -1
- package/fesm2022/_tabs-chunk.mjs.map +1 -1
- package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
- package/fesm2022/_widget-chunk.mjs +12 -166
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion-testing.mjs +61 -0
- package/fesm2022/accordion-testing.mjs.map +1 -0
- package/fesm2022/accordion.mjs +208 -183
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +14 -85
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox-testing.mjs +55 -0
- package/fesm2022/listbox-testing.mjs.map +1 -0
- package/fesm2022/listbox.mjs +1 -1
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu-testing.mjs +75 -0
- package/fesm2022/menu-testing.mjs.map +1 -0
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +2 -1
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs-testing.mjs +57 -0
- package/fesm2022/tabs-testing.mjs.map +1 -0
- package/fesm2022/tabs.mjs +3 -5
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar-testing.mjs +56 -0
- package/fesm2022/toolbar-testing.mjs.map +1 -0
- package/fesm2022/toolbar.mjs +8 -6
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree-testing.mjs +88 -0
- package/fesm2022/tree-testing.mjs.map +1 -0
- package/fesm2022/tree.mjs +4 -6
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +26 -2
- package/resources/code-examples.db +0 -0
- package/types/_accordion-chunk.d.ts +10 -9
- package/types/_click-event-manager-chunk.d.ts +1 -1
- package/types/_combobox-chunk.d.ts +23 -23
- package/types/_element-chunk.d.ts +10 -0
- package/types/_expansion-chunk.d.ts +1 -1
- package/types/_grid-chunk.d.ts +11 -49
- package/types/_keyboard-event-manager-chunk.d.ts +2 -2
- package/types/_list-chunk.d.ts +19 -18
- package/types/_list-navigation-chunk.d.ts +6 -16
- package/types/_listbox-chunk.d.ts +27 -27
- package/types/_menu-chunk.d.ts +51 -51
- package/types/_pointer-event-manager-chunk.d.ts +1 -1
- package/types/_signal-like-chunk.d.ts +14 -0
- package/types/_tabs-chunk.d.ts +2 -1
- package/types/_toolbar-chunk.d.ts +1 -1
- package/types/_tree-chunk.d.ts +18 -17
- package/types/accordion-testing.d.ts +63 -0
- package/types/accordion.d.ts +69 -55
- package/types/combobox.d.ts +6 -5
- package/types/grid.d.ts +8 -14
- package/types/listbox-testing.d.ts +39 -0
- package/types/listbox.d.ts +19 -18
- package/types/menu-testing.d.ts +50 -0
- package/types/menu.d.ts +4 -3
- package/types/private.d.ts +46 -44
- package/types/tabs-testing.d.ts +57 -0
- package/types/tabs.d.ts +3 -5
- package/types/toolbar-testing.d.ts +72 -0
- package/types/toolbar.d.ts +3 -2
- package/types/tree-testing.d.ts +75 -0
- package/types/tree.d.ts +5 -6
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ComponentHarness, HarnessPredicate, ContentContainerComponentHarness } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
var AccordionSection;
|
|
4
|
+
(function (AccordionSection) {
|
|
5
|
+
AccordionSection["TRIGGER"] = "[ngAccordionTrigger]";
|
|
6
|
+
AccordionSection["PANEL"] = "[ngAccordionPanel]";
|
|
7
|
+
})(AccordionSection || (AccordionSection = {}));
|
|
8
|
+
class AccordionHarness extends ContentContainerComponentHarness {
|
|
9
|
+
static hostSelector = '[ngAccordionTrigger]';
|
|
10
|
+
static with(options = {}) {
|
|
11
|
+
return new HarnessPredicate(AccordionHarness, options).addOption('title', options.title, (harness, title) => HarnessPredicate.stringMatches(harness.getTitle(), title)).addOption('expanded', options.expanded, async (harness, expanded) => (await harness.isExpanded()) === expanded).addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);
|
|
12
|
+
}
|
|
13
|
+
async getRootHarnessLoader() {
|
|
14
|
+
const panelId = await (await this.host()).getAttribute('aria-controls');
|
|
15
|
+
const documentRoot = await this.documentRootLocatorFactory().rootHarnessLoader();
|
|
16
|
+
return documentRoot.getChildLoader(`[ngAccordionPanel][id="${panelId}"]`);
|
|
17
|
+
}
|
|
18
|
+
async isExpanded() {
|
|
19
|
+
return (await (await this.host()).getAttribute('aria-expanded')) === 'true';
|
|
20
|
+
}
|
|
21
|
+
async isDisabled() {
|
|
22
|
+
return (await (await this.host()).getAttribute('aria-disabled')) === 'true';
|
|
23
|
+
}
|
|
24
|
+
async getTitle() {
|
|
25
|
+
return (await this.host()).text();
|
|
26
|
+
}
|
|
27
|
+
async toggle() {
|
|
28
|
+
await (await this.host()).click();
|
|
29
|
+
}
|
|
30
|
+
async expand() {
|
|
31
|
+
if (!(await this.isExpanded())) {
|
|
32
|
+
await this.toggle();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async collapse() {
|
|
36
|
+
if (await this.isExpanded()) {
|
|
37
|
+
await this.toggle();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
async focus() {
|
|
41
|
+
await (await this.host()).focus();
|
|
42
|
+
}
|
|
43
|
+
async blur() {
|
|
44
|
+
await (await this.host()).blur();
|
|
45
|
+
}
|
|
46
|
+
async isFocused() {
|
|
47
|
+
return (await this.host()).isFocused();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
class AccordionGroupHarness extends ComponentHarness {
|
|
51
|
+
static hostSelector = '[ngAccordionGroup]';
|
|
52
|
+
static with(options = {}) {
|
|
53
|
+
return new HarnessPredicate(AccordionGroupHarness, options);
|
|
54
|
+
}
|
|
55
|
+
async getAccordions(filters = {}) {
|
|
56
|
+
return this.locatorForAll(AccordionHarness.with(filters))();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { AccordionGroupHarness, AccordionHarness, AccordionSection };
|
|
61
|
+
//# sourceMappingURL=accordion-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accordion-testing.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/src/aria/accordion/testing/accordion-harness.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n ComponentHarness,\n ContentContainerComponentHarness,\n HarnessPredicate,\n} from '@angular/cdk/testing';\nimport {AccordionHarnessFilters, AccordionGroupHarnessFilters} from './accordion-harness-filters';\n\n/** Selectors for the sections that may contain user content. */\nexport enum AccordionSection {\n TRIGGER = '[ngAccordionTrigger]',\n PANEL = '[ngAccordionPanel]',\n}\n\n/** Harness for interacting with a standard ngAccordion item in tests. */\nexport class AccordionHarness extends ContentContainerComponentHarness<AccordionSection> {\n static hostSelector = '[ngAccordionTrigger]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for an accordion\n * with specific attributes.\n */\n static with(options: AccordionHarnessFilters = {}): HarnessPredicate<AccordionHarness> {\n return new HarnessPredicate(AccordionHarness, options)\n .addOption('title', options.title, (harness, title) =>\n HarnessPredicate.stringMatches(harness.getTitle(), title),\n )\n .addOption(\n 'expanded',\n options.expanded,\n async (harness, expanded) => (await harness.isExpanded()) === expanded,\n )\n .addOption(\n 'disabled',\n options.disabled,\n async (harness, disabled) => (await harness.isDisabled()) === disabled,\n );\n }\n\n /** Overrides the internal loader to automatically resolve queries inside the associated panel. */\n protected override async getRootHarnessLoader() {\n const panelId = await (await this.host()).getAttribute('aria-controls');\n const documentRoot = await this.documentRootLocatorFactory().rootHarnessLoader();\n return documentRoot.getChildLoader(`[ngAccordionPanel][id=\"${panelId}\"]`);\n }\n\n /** Whether the accordion is expanded. */\n async isExpanded(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /** Whether the accordion is disabled. */\n async isDisabled(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-disabled')) === 'true';\n }\n\n /** Gets the title text of the accordion. */\n async getTitle(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Toggles the expanded state of the accordion by clicking on the trigger. */\n async toggle(): Promise<void> {\n await (await this.host()).click();\n }\n\n /** Expands the accordion if collapsed. */\n async expand(): Promise<void> {\n if (!(await this.isExpanded())) {\n await this.toggle();\n }\n }\n\n /** Collapses the accordion if expanded. */\n async collapse(): Promise<void> {\n if (await this.isExpanded()) {\n await this.toggle();\n }\n }\n\n /** Focuses the accordion trigger. */\n async focus(): Promise<void> {\n await (await this.host()).focus();\n }\n\n /** Blurs the accordion trigger. */\n async blur(): Promise<void> {\n await (await this.host()).blur();\n }\n\n /** Whether the accordion trigger is focused. */\n async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n}\n\n/** Harness for interacting with an `ngAccordionGroup` in tests. */\nexport class AccordionGroupHarness extends ComponentHarness {\n static hostSelector = '[ngAccordionGroup]';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for an accordion group with specific attributes.\n */\n static with(options: AccordionGroupHarnessFilters = {}): HarnessPredicate<AccordionGroupHarness> {\n return new HarnessPredicate(AccordionGroupHarness, options);\n }\n\n /** Gets all accordions within this group. */\n async getAccordions(filters: AccordionHarnessFilters = {}): Promise<AccordionHarness[]> {\n return this.locatorForAll(AccordionHarness.with(filters))();\n }\n}\n"],"names":["AccordionSection","AccordionHarness","ContentContainerComponentHarness","hostSelector","with","options","HarnessPredicate","addOption","title","harness","stringMatches","getTitle","expanded","isExpanded","disabled","isDisabled","getRootHarnessLoader","panelId","host","getAttribute","documentRoot","documentRootLocatorFactory","rootHarnessLoader","getChildLoader","text","toggle","click","expand","collapse","focus","blur","isFocused","AccordionGroupHarness","ComponentHarness","getAccordions","filters","locatorForAll"],"mappings":"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"}
|
package/fesm2022/accordion.mjs
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, computed, afterRenderEffect, Directive, InjectionToken,
|
|
2
|
+
import { inject, ElementRef, input, computed, afterRenderEffect, Directive, InjectionToken, signal, booleanAttribute, model } from '@angular/core';
|
|
3
3
|
import { DeferredContentAware, DeferredContent } from './_deferred-content-chunk.mjs';
|
|
4
4
|
import { Directionality } from '@angular/cdk/bidi';
|
|
5
|
+
import { sortDirectives } from './_element-chunk.mjs';
|
|
6
|
+
import { AccordionGroupPattern, AccordionTriggerPattern } from './_accordion-chunk.mjs';
|
|
5
7
|
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
6
|
-
import { AccordionTriggerPattern, AccordionGroupPattern } from './_accordion-chunk.mjs';
|
|
7
8
|
import './_expansion-chunk.mjs';
|
|
8
9
|
import './_list-navigation-chunk.mjs';
|
|
9
10
|
import './_signal-like-chunk.mjs';
|
|
10
11
|
import '@angular/core/primitives/signals';
|
|
11
|
-
import './
|
|
12
|
+
import './_click-event-manager-chunk.mjs';
|
|
12
13
|
|
|
13
14
|
class AccordionPanel {
|
|
15
|
+
_elementRef = inject(ElementRef);
|
|
16
|
+
element = this._elementRef.nativeElement;
|
|
14
17
|
_deferredContentAware = inject(DeferredContentAware);
|
|
15
18
|
id = input(inject(_IdGenerator).getId('ng-accordion-panel-', true), ...(ngDevMode ? [{
|
|
16
19
|
debugName: "id"
|
|
@@ -111,112 +114,126 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
111
114
|
|
|
112
115
|
const ACCORDION_GROUP = new InjectionToken('ACCORDION_GROUP');
|
|
113
116
|
|
|
114
|
-
class
|
|
117
|
+
class AccordionGroup {
|
|
115
118
|
_elementRef = inject(ElementRef);
|
|
116
119
|
element = this._elementRef.nativeElement;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
debugName: "panel"
|
|
120
|
+
_triggers = signal(new Set(), ...(ngDevMode ? [{
|
|
121
|
+
debugName: "_triggers"
|
|
120
122
|
}] : []));
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
_sortedTriggers = computed(() => {
|
|
124
|
+
const triggers = [...this._triggers()];
|
|
125
|
+
const sortFn = triggers[0]?.index() === undefined ? sortDirectives : (a, b) => a.index() - b.index();
|
|
126
|
+
return triggers.sort(sortFn);
|
|
127
|
+
}, ...(ngDevMode ? [{
|
|
128
|
+
debugName: "_sortedTriggers"
|
|
123
129
|
}] : []));
|
|
124
|
-
|
|
125
|
-
|
|
130
|
+
_triggerPatterns = computed(() => {
|
|
131
|
+
return this._sortedTriggers().map(t => t._pattern);
|
|
132
|
+
}, ...(ngDevMode ? [{
|
|
133
|
+
debugName: "_triggerPatterns"
|
|
126
134
|
}] : []));
|
|
135
|
+
textDirection = inject(Directionality).valueSignal;
|
|
127
136
|
disabled = input(false, {
|
|
128
137
|
...(ngDevMode ? {
|
|
129
138
|
debugName: "disabled"
|
|
130
139
|
} : {}),
|
|
131
140
|
transform: booleanAttribute
|
|
132
141
|
});
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
142
|
+
multiExpandable = input(true, {
|
|
143
|
+
...(ngDevMode ? {
|
|
144
|
+
debugName: "multiExpandable"
|
|
145
|
+
} : {}),
|
|
146
|
+
transform: booleanAttribute
|
|
147
|
+
});
|
|
148
|
+
softDisabled = input(true, {
|
|
149
|
+
...(ngDevMode ? {
|
|
150
|
+
debugName: "softDisabled"
|
|
151
|
+
} : {}),
|
|
152
|
+
transform: booleanAttribute
|
|
153
|
+
});
|
|
154
|
+
wrap = input(false, {
|
|
155
|
+
...(ngDevMode ? {
|
|
156
|
+
debugName: "wrap"
|
|
157
|
+
} : {}),
|
|
158
|
+
transform: booleanAttribute
|
|
159
|
+
});
|
|
160
|
+
_pattern = new AccordionGroupPattern({
|
|
161
|
+
...this,
|
|
162
|
+
element: () => this.element,
|
|
163
|
+
activeItem: signal(undefined),
|
|
164
|
+
items: this._triggerPatterns,
|
|
165
|
+
orientation: () => 'vertical'
|
|
166
|
+
});
|
|
167
|
+
expandAll() {
|
|
168
|
+
this._pattern.expandAll();
|
|
148
169
|
}
|
|
149
|
-
|
|
150
|
-
this._pattern.
|
|
170
|
+
collapseAll() {
|
|
171
|
+
this._pattern.collapseAll();
|
|
151
172
|
}
|
|
152
|
-
|
|
153
|
-
this.
|
|
173
|
+
_registerTrigger(trigger) {
|
|
174
|
+
this._triggers().add(trigger);
|
|
175
|
+
this._triggers.set(new Set(this._triggers()));
|
|
154
176
|
}
|
|
155
|
-
|
|
156
|
-
this.
|
|
177
|
+
_unregisterTrigger(trigger) {
|
|
178
|
+
this._triggers().delete(trigger);
|
|
179
|
+
this._triggers.set(new Set(this._triggers()));
|
|
157
180
|
}
|
|
158
181
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
159
182
|
minVersion: "12.0.0",
|
|
160
183
|
version: "22.0.0-next.6",
|
|
161
184
|
ngImport: i0,
|
|
162
|
-
type:
|
|
185
|
+
type: AccordionGroup,
|
|
163
186
|
deps: [],
|
|
164
187
|
target: i0.ɵɵFactoryTarget.Directive
|
|
165
188
|
});
|
|
166
189
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
167
190
|
minVersion: "17.1.0",
|
|
168
191
|
version: "22.0.0-next.6",
|
|
169
|
-
type:
|
|
192
|
+
type: AccordionGroup,
|
|
170
193
|
isStandalone: true,
|
|
171
|
-
selector: "[
|
|
194
|
+
selector: "[ngAccordionGroup]",
|
|
172
195
|
inputs: {
|
|
173
|
-
|
|
174
|
-
classPropertyName: "
|
|
175
|
-
publicName: "
|
|
196
|
+
disabled: {
|
|
197
|
+
classPropertyName: "disabled",
|
|
198
|
+
publicName: "disabled",
|
|
176
199
|
isSignal: true,
|
|
177
|
-
isRequired:
|
|
200
|
+
isRequired: false,
|
|
178
201
|
transformFunction: null
|
|
179
202
|
},
|
|
180
|
-
|
|
181
|
-
classPropertyName: "
|
|
182
|
-
publicName: "
|
|
203
|
+
multiExpandable: {
|
|
204
|
+
classPropertyName: "multiExpandable",
|
|
205
|
+
publicName: "multiExpandable",
|
|
183
206
|
isSignal: true,
|
|
184
207
|
isRequired: false,
|
|
185
208
|
transformFunction: null
|
|
186
209
|
},
|
|
187
|
-
|
|
188
|
-
classPropertyName: "
|
|
189
|
-
publicName: "
|
|
210
|
+
softDisabled: {
|
|
211
|
+
classPropertyName: "softDisabled",
|
|
212
|
+
publicName: "softDisabled",
|
|
190
213
|
isSignal: true,
|
|
191
214
|
isRequired: false,
|
|
192
215
|
transformFunction: null
|
|
193
216
|
},
|
|
194
|
-
|
|
195
|
-
classPropertyName: "
|
|
196
|
-
publicName: "
|
|
217
|
+
wrap: {
|
|
218
|
+
classPropertyName: "wrap",
|
|
219
|
+
publicName: "wrap",
|
|
197
220
|
isSignal: true,
|
|
198
221
|
isRequired: false,
|
|
199
222
|
transformFunction: null
|
|
200
223
|
}
|
|
201
224
|
},
|
|
202
|
-
outputs: {
|
|
203
|
-
expanded: "expandedChange"
|
|
204
|
-
},
|
|
205
225
|
host: {
|
|
206
|
-
|
|
207
|
-
"
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"attr.data-active": "active()",
|
|
211
|
-
"id": "id()",
|
|
212
|
-
"attr.aria-expanded": "expanded()",
|
|
213
|
-
"attr.aria-controls": "_pattern.controls()",
|
|
214
|
-
"attr.aria-disabled": "_pattern.disabled()",
|
|
215
|
-
"attr.disabled": "_pattern.hardDisabled() ? true : null",
|
|
216
|
-
"attr.tabindex": "_pattern.tabIndex()"
|
|
226
|
+
listeners: {
|
|
227
|
+
"keydown": "_pattern.onKeydown($event)",
|
|
228
|
+
"click": "_pattern.onClick($event)",
|
|
229
|
+
"focusin": "_pattern.onFocus($event)"
|
|
217
230
|
}
|
|
218
231
|
},
|
|
219
|
-
|
|
232
|
+
providers: [{
|
|
233
|
+
provide: ACCORDION_GROUP,
|
|
234
|
+
useExisting: AccordionGroup
|
|
235
|
+
}],
|
|
236
|
+
exportAs: ["ngAccordionGroup"],
|
|
220
237
|
ngImport: i0
|
|
221
238
|
});
|
|
222
239
|
}
|
|
@@ -224,175 +241,180 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
224
241
|
minVersion: "12.0.0",
|
|
225
242
|
version: "22.0.0-next.6",
|
|
226
243
|
ngImport: i0,
|
|
227
|
-
type:
|
|
244
|
+
type: AccordionGroup,
|
|
228
245
|
decorators: [{
|
|
229
246
|
type: Directive,
|
|
230
247
|
args: [{
|
|
231
|
-
selector: '[
|
|
232
|
-
exportAs: '
|
|
248
|
+
selector: '[ngAccordionGroup]',
|
|
249
|
+
exportAs: 'ngAccordionGroup',
|
|
233
250
|
host: {
|
|
234
|
-
'
|
|
235
|
-
'
|
|
236
|
-
'
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
251
|
+
'(keydown)': '_pattern.onKeydown($event)',
|
|
252
|
+
'(click)': '_pattern.onClick($event)',
|
|
253
|
+
'(focusin)': '_pattern.onFocus($event)'
|
|
254
|
+
},
|
|
255
|
+
providers: [{
|
|
256
|
+
provide: ACCORDION_GROUP,
|
|
257
|
+
useExisting: AccordionGroup
|
|
258
|
+
}]
|
|
243
259
|
}]
|
|
244
260
|
}],
|
|
245
261
|
propDecorators: {
|
|
246
|
-
|
|
262
|
+
disabled: [{
|
|
247
263
|
type: i0.Input,
|
|
248
264
|
args: [{
|
|
249
265
|
isSignal: true,
|
|
250
|
-
alias: "
|
|
251
|
-
required:
|
|
266
|
+
alias: "disabled",
|
|
267
|
+
required: false
|
|
252
268
|
}]
|
|
253
269
|
}],
|
|
254
|
-
|
|
270
|
+
multiExpandable: [{
|
|
255
271
|
type: i0.Input,
|
|
256
272
|
args: [{
|
|
257
273
|
isSignal: true,
|
|
258
|
-
alias: "
|
|
274
|
+
alias: "multiExpandable",
|
|
259
275
|
required: false
|
|
260
276
|
}]
|
|
261
277
|
}],
|
|
262
|
-
|
|
278
|
+
softDisabled: [{
|
|
263
279
|
type: i0.Input,
|
|
264
280
|
args: [{
|
|
265
281
|
isSignal: true,
|
|
266
|
-
alias: "
|
|
282
|
+
alias: "softDisabled",
|
|
267
283
|
required: false
|
|
268
284
|
}]
|
|
269
285
|
}],
|
|
270
|
-
|
|
286
|
+
wrap: [{
|
|
271
287
|
type: i0.Input,
|
|
272
288
|
args: [{
|
|
273
289
|
isSignal: true,
|
|
274
|
-
alias: "
|
|
290
|
+
alias: "wrap",
|
|
275
291
|
required: false
|
|
276
292
|
}]
|
|
277
|
-
}, {
|
|
278
|
-
type: i0.Output,
|
|
279
|
-
args: ["expandedChange"]
|
|
280
293
|
}]
|
|
281
294
|
}
|
|
282
295
|
});
|
|
283
296
|
|
|
284
|
-
class
|
|
297
|
+
class AccordionTrigger {
|
|
285
298
|
_elementRef = inject(ElementRef);
|
|
286
299
|
element = this._elementRef.nativeElement;
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
300
|
+
_accordionGroup = inject(ACCORDION_GROUP);
|
|
301
|
+
panel = input.required(...(ngDevMode ? [{
|
|
302
|
+
debugName: "panel"
|
|
303
|
+
}] : []));
|
|
304
|
+
id = input(inject(_IdGenerator).getId('ng-accordion-trigger-', true), ...(ngDevMode ? [{
|
|
305
|
+
debugName: "id"
|
|
306
|
+
}] : []));
|
|
307
|
+
panelId = computed(() => this.panel().id(), ...(ngDevMode ? [{
|
|
308
|
+
debugName: "panelId"
|
|
295
309
|
}] : []));
|
|
296
|
-
textDirection = inject(Directionality).valueSignal;
|
|
297
310
|
disabled = input(false, {
|
|
298
311
|
...(ngDevMode ? {
|
|
299
312
|
debugName: "disabled"
|
|
300
313
|
} : {}),
|
|
301
314
|
transform: booleanAttribute
|
|
302
315
|
});
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
...this,
|
|
323
|
-
element: () => this.element,
|
|
324
|
-
activeItem: signal(undefined),
|
|
325
|
-
items: this._triggerPatterns,
|
|
326
|
-
orientation: () => 'vertical'
|
|
327
|
-
});
|
|
328
|
-
expandAll() {
|
|
329
|
-
this._pattern.expandAll();
|
|
316
|
+
index = input(...(ngDevMode ? [undefined, {
|
|
317
|
+
debugName: "index"
|
|
318
|
+
}] : []));
|
|
319
|
+
expanded = model(false, ...(ngDevMode ? [{
|
|
320
|
+
debugName: "expanded"
|
|
321
|
+
}] : []));
|
|
322
|
+
active = computed(() => this._pattern.active(), ...(ngDevMode ? [{
|
|
323
|
+
debugName: "active"
|
|
324
|
+
}] : []));
|
|
325
|
+
_pattern;
|
|
326
|
+
ngOnInit() {
|
|
327
|
+
this._pattern = new AccordionTriggerPattern({
|
|
328
|
+
...this,
|
|
329
|
+
element: () => this.element,
|
|
330
|
+
accordionGroup: () => this._accordionGroup._pattern,
|
|
331
|
+
accordionPanelId: this.panelId
|
|
332
|
+
});
|
|
333
|
+
this.panel()._pattern = this._pattern;
|
|
334
|
+
this._accordionGroup._registerTrigger(this);
|
|
330
335
|
}
|
|
331
|
-
|
|
332
|
-
this.
|
|
336
|
+
ngOnDestroy() {
|
|
337
|
+
this.panel()._pattern = undefined;
|
|
338
|
+
this._accordionGroup._unregisterTrigger(this);
|
|
339
|
+
}
|
|
340
|
+
expand() {
|
|
341
|
+
this._pattern.open();
|
|
342
|
+
}
|
|
343
|
+
collapse() {
|
|
344
|
+
this._pattern.close();
|
|
345
|
+
}
|
|
346
|
+
toggle() {
|
|
347
|
+
this._pattern.toggle();
|
|
333
348
|
}
|
|
334
349
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
335
350
|
minVersion: "12.0.0",
|
|
336
351
|
version: "22.0.0-next.6",
|
|
337
352
|
ngImport: i0,
|
|
338
|
-
type:
|
|
353
|
+
type: AccordionTrigger,
|
|
339
354
|
deps: [],
|
|
340
355
|
target: i0.ɵɵFactoryTarget.Directive
|
|
341
356
|
});
|
|
342
357
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
343
|
-
minVersion: "17.
|
|
358
|
+
minVersion: "17.1.0",
|
|
344
359
|
version: "22.0.0-next.6",
|
|
345
|
-
type:
|
|
360
|
+
type: AccordionTrigger,
|
|
346
361
|
isStandalone: true,
|
|
347
|
-
selector: "[
|
|
362
|
+
selector: "[ngAccordionTrigger]",
|
|
348
363
|
inputs: {
|
|
349
|
-
|
|
350
|
-
classPropertyName: "
|
|
351
|
-
publicName: "
|
|
364
|
+
panel: {
|
|
365
|
+
classPropertyName: "panel",
|
|
366
|
+
publicName: "panel",
|
|
367
|
+
isSignal: true,
|
|
368
|
+
isRequired: true,
|
|
369
|
+
transformFunction: null
|
|
370
|
+
},
|
|
371
|
+
id: {
|
|
372
|
+
classPropertyName: "id",
|
|
373
|
+
publicName: "id",
|
|
352
374
|
isSignal: true,
|
|
353
375
|
isRequired: false,
|
|
354
376
|
transformFunction: null
|
|
355
377
|
},
|
|
356
|
-
|
|
357
|
-
classPropertyName: "
|
|
358
|
-
publicName: "
|
|
378
|
+
disabled: {
|
|
379
|
+
classPropertyName: "disabled",
|
|
380
|
+
publicName: "disabled",
|
|
359
381
|
isSignal: true,
|
|
360
382
|
isRequired: false,
|
|
361
383
|
transformFunction: null
|
|
362
384
|
},
|
|
363
|
-
|
|
364
|
-
classPropertyName: "
|
|
365
|
-
publicName: "
|
|
385
|
+
index: {
|
|
386
|
+
classPropertyName: "index",
|
|
387
|
+
publicName: "index",
|
|
366
388
|
isSignal: true,
|
|
367
389
|
isRequired: false,
|
|
368
390
|
transformFunction: null
|
|
369
391
|
},
|
|
370
|
-
|
|
371
|
-
classPropertyName: "
|
|
372
|
-
publicName: "
|
|
392
|
+
expanded: {
|
|
393
|
+
classPropertyName: "expanded",
|
|
394
|
+
publicName: "expanded",
|
|
373
395
|
isSignal: true,
|
|
374
396
|
isRequired: false,
|
|
375
397
|
transformFunction: null
|
|
376
398
|
}
|
|
377
399
|
},
|
|
400
|
+
outputs: {
|
|
401
|
+
expanded: "expandedChange"
|
|
402
|
+
},
|
|
378
403
|
host: {
|
|
379
|
-
|
|
380
|
-
"
|
|
381
|
-
|
|
382
|
-
|
|
404
|
+
attributes: {
|
|
405
|
+
"role": "button"
|
|
406
|
+
},
|
|
407
|
+
properties: {
|
|
408
|
+
"attr.data-active": "active()",
|
|
409
|
+
"id": "id()",
|
|
410
|
+
"attr.aria-expanded": "expanded()",
|
|
411
|
+
"attr.aria-controls": "_pattern.controls()",
|
|
412
|
+
"attr.aria-disabled": "_pattern.disabled()",
|
|
413
|
+
"attr.disabled": "_pattern.hardDisabled() ? true : null",
|
|
414
|
+
"attr.tabindex": "_pattern.tabIndex()"
|
|
383
415
|
}
|
|
384
416
|
},
|
|
385
|
-
|
|
386
|
-
provide: ACCORDION_GROUP,
|
|
387
|
-
useExisting: AccordionGroup
|
|
388
|
-
}],
|
|
389
|
-
queries: [{
|
|
390
|
-
propertyName: "_triggers",
|
|
391
|
-
predicate: AccordionTrigger,
|
|
392
|
-
descendants: true,
|
|
393
|
-
isSignal: true
|
|
394
|
-
}],
|
|
395
|
-
exportAs: ["ngAccordionGroup"],
|
|
417
|
+
exportAs: ["ngAccordionTrigger"],
|
|
396
418
|
ngImport: i0
|
|
397
419
|
});
|
|
398
420
|
}
|
|
@@ -400,64 +422,67 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
400
422
|
minVersion: "12.0.0",
|
|
401
423
|
version: "22.0.0-next.6",
|
|
402
424
|
ngImport: i0,
|
|
403
|
-
type:
|
|
425
|
+
type: AccordionTrigger,
|
|
404
426
|
decorators: [{
|
|
405
427
|
type: Directive,
|
|
406
428
|
args: [{
|
|
407
|
-
selector: '[
|
|
408
|
-
exportAs: '
|
|
429
|
+
selector: '[ngAccordionTrigger]',
|
|
430
|
+
exportAs: 'ngAccordionTrigger',
|
|
409
431
|
host: {
|
|
410
|
-
'
|
|
411
|
-
'
|
|
412
|
-
'
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
432
|
+
'[attr.data-active]': 'active()',
|
|
433
|
+
'role': 'button',
|
|
434
|
+
'[id]': 'id()',
|
|
435
|
+
'[attr.aria-expanded]': 'expanded()',
|
|
436
|
+
'[attr.aria-controls]': '_pattern.controls()',
|
|
437
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
438
|
+
'[attr.disabled]': '_pattern.hardDisabled() ? true : null',
|
|
439
|
+
'[attr.tabindex]': '_pattern.tabIndex()'
|
|
440
|
+
}
|
|
418
441
|
}]
|
|
419
442
|
}],
|
|
420
443
|
propDecorators: {
|
|
421
|
-
|
|
422
|
-
type: i0.
|
|
423
|
-
args: [
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
isSignal: true
|
|
444
|
+
panel: [{
|
|
445
|
+
type: i0.Input,
|
|
446
|
+
args: [{
|
|
447
|
+
isSignal: true,
|
|
448
|
+
alias: "panel",
|
|
449
|
+
required: true
|
|
428
450
|
}]
|
|
429
451
|
}],
|
|
430
|
-
|
|
452
|
+
id: [{
|
|
431
453
|
type: i0.Input,
|
|
432
454
|
args: [{
|
|
433
455
|
isSignal: true,
|
|
434
|
-
alias: "
|
|
456
|
+
alias: "id",
|
|
435
457
|
required: false
|
|
436
458
|
}]
|
|
437
459
|
}],
|
|
438
|
-
|
|
460
|
+
disabled: [{
|
|
439
461
|
type: i0.Input,
|
|
440
462
|
args: [{
|
|
441
463
|
isSignal: true,
|
|
442
|
-
alias: "
|
|
464
|
+
alias: "disabled",
|
|
443
465
|
required: false
|
|
444
466
|
}]
|
|
445
467
|
}],
|
|
446
|
-
|
|
468
|
+
index: [{
|
|
447
469
|
type: i0.Input,
|
|
448
470
|
args: [{
|
|
449
471
|
isSignal: true,
|
|
450
|
-
alias: "
|
|
472
|
+
alias: "index",
|
|
451
473
|
required: false
|
|
452
474
|
}]
|
|
453
475
|
}],
|
|
454
|
-
|
|
476
|
+
expanded: [{
|
|
455
477
|
type: i0.Input,
|
|
456
478
|
args: [{
|
|
457
479
|
isSignal: true,
|
|
458
|
-
alias: "
|
|
480
|
+
alias: "expanded",
|
|
459
481
|
required: false
|
|
460
482
|
}]
|
|
483
|
+
}, {
|
|
484
|
+
type: i0.Output,
|
|
485
|
+
args: ["expandedChange"]
|
|
461
486
|
}]
|
|
462
487
|
}
|
|
463
488
|
});
|