@angular/aria 21.2.1 → 21.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/fesm2022/_accordion-chunk.mjs +24 -18
  2. package/fesm2022/_accordion-chunk.mjs.map +1 -1
  3. package/fesm2022/_combobox-chunk.mjs.map +1 -1
  4. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -1
  5. package/fesm2022/_combobox-tree-chunk.mjs.map +1 -1
  6. package/fesm2022/_deferred-content-chunk.mjs +6 -6
  7. package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
  8. package/fesm2022/_expansion-chunk.mjs.map +1 -1
  9. package/fesm2022/_list-chunk.mjs.map +1 -1
  10. package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
  11. package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
  12. package/fesm2022/_menu-chunk.mjs.map +1 -1
  13. package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -1
  14. package/fesm2022/_signal-like-chunk.mjs.map +1 -1
  15. package/fesm2022/_tabs-chunk.mjs.map +1 -1
  16. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
  17. package/fesm2022/_widget-chunk.mjs +3 -2
  18. package/fesm2022/_widget-chunk.mjs.map +1 -1
  19. package/fesm2022/accordion.mjs +56 -123
  20. package/fesm2022/accordion.mjs.map +1 -1
  21. package/fesm2022/aria.mjs +1 -1
  22. package/fesm2022/aria.mjs.map +1 -1
  23. package/fesm2022/combobox.mjs +15 -15
  24. package/fesm2022/combobox.mjs.map +1 -1
  25. package/fesm2022/grid.mjs +19 -15
  26. package/fesm2022/grid.mjs.map +1 -1
  27. package/fesm2022/listbox.mjs +6 -6
  28. package/fesm2022/listbox.mjs.map +1 -1
  29. package/fesm2022/menu.mjs +15 -15
  30. package/fesm2022/menu.mjs.map +1 -1
  31. package/fesm2022/private.mjs +1 -1
  32. package/fesm2022/tabs.mjs +15 -15
  33. package/fesm2022/tabs.mjs.map +1 -1
  34. package/fesm2022/toolbar.mjs +9 -9
  35. package/fesm2022/toolbar.mjs.map +1 -1
  36. package/fesm2022/tree.mjs +9 -9
  37. package/fesm2022/tree.mjs.map +1 -1
  38. package/package.json +2 -2
  39. package/resources/code-examples.db +0 -0
  40. package/types/_accordion-chunk.d.ts +11 -31
  41. package/types/_grid-chunk.d.ts +2 -0
  42. package/types/_list-navigation-chunk.d.ts +0 -2
  43. package/types/accordion.d.ts +31 -35
  44. package/types/private.d.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/aria",
3
- "version": "21.2.1",
3
+ "version": "21.2.3",
4
4
  "description": "Angular Aria",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "homepage": "https://github.com/angular/components#readme",
14
14
  "peerDependencies": {
15
- "@angular/cdk": "21.2.1",
15
+ "@angular/cdk": "21.2.3",
16
16
  "@angular/core": "^21.0.0 || ^22.0.0"
17
17
  },
18
18
  "devDependencies": {
Binary file
@@ -5,8 +5,6 @@ import { ListNavigationInputs, ListFocusInputs, ListNavigation, ListFocus, Signa
5
5
 
6
6
  /** Inputs of the AccordionGroupPattern. */
7
7
  interface AccordionGroupInputs extends Omit<ListNavigationInputs<AccordionTriggerPattern> & ListFocusInputs<AccordionTriggerPattern> & Omit<ListExpansionInputs, 'items'>, 'focusMode'> {
8
- /** A function that returns the trigger associated with a given element. */
9
- getItem: (e: Element | null | undefined) => AccordionTriggerPattern | undefined;
10
8
  }
11
9
  /** A pattern controls the nested Accordions. */
12
10
  declare class AccordionGroupPattern {
@@ -34,15 +32,19 @@ declare class AccordionGroupPattern {
34
32
  onFocus(event: FocusEvent): void;
35
33
  /** Toggles the expansion state of the active accordion item. */
36
34
  toggle(): void;
35
+ /** Expands all accordion panels if multi-expandable. */
36
+ expandAll(): void;
37
+ /** Collapses all accordion panels. */
38
+ collapseAll(): void;
39
+ /** Finds the trigger pattern for a given element. */
40
+ private _findTriggerPattern;
37
41
  }
38
42
  /** Inputs for the AccordionTriggerPattern. */
39
43
  interface AccordionTriggerInputs extends Omit<ListNavigationItem & ListFocusItem, 'index'>, Omit<ExpansionItem, 'expandable'> {
40
- /** A local unique identifier for the trigger's corresponding panel. */
41
- panelId: SignalLike<string>;
42
44
  /** The parent accordion group that controls this trigger. */
43
45
  accordionGroup: SignalLike<AccordionGroupPattern>;
44
- /** The accordion panel controlled by this trigger. */
45
- accordionPanel: SignalLike<AccordionPanelPattern | undefined>;
46
+ /** The accordion panel id controlled by this trigger. */
47
+ accordionPanelId: SignalLike<string>;
46
48
  }
47
49
  /** A pattern controls the expansion state of an accordion. */
48
50
  declare class AccordionTriggerPattern implements ListNavigationItem, ListFocusItem, ExpansionItem {
@@ -58,15 +60,13 @@ declare class AccordionTriggerPattern implements ListNavigationItem, ListFocusIt
58
60
  /** Whether the trigger is active. */
59
61
  readonly active: SignalLike<boolean>;
60
62
  /** Id of the accordion panel controlled by the trigger. */
61
- readonly controls: SignalLike<string | undefined>;
63
+ readonly controls: SignalLike<string>;
62
64
  /** The tabindex of the trigger. */
63
65
  readonly tabIndex: SignalLike<-1 | 0>;
64
66
  /** Whether the trigger is disabled. Disabling an accordion group disables all the triggers. */
65
67
  readonly disabled: SignalLike<boolean>;
66
68
  /** Whether the trigger is hard disabled. */
67
69
  readonly hardDisabled: SignalLike<boolean>;
68
- /** The index of the trigger within its accordion group. */
69
- readonly index: SignalLike<number>;
70
70
  constructor(inputs: AccordionTriggerInputs);
71
71
  /** Opens the accordion panel. */
72
72
  open(): void;
@@ -75,26 +75,6 @@ declare class AccordionTriggerPattern implements ListNavigationItem, ListFocusIt
75
75
  /** Toggles the accordion panel. */
76
76
  toggle(): void;
77
77
  }
78
- /** Represents the required inputs for the AccordionPanelPattern. */
79
- interface AccordionPanelInputs {
80
- /** A global unique identifier for the panel. */
81
- id: SignalLike<string>;
82
- /** A local unique identifier for the panel, matching its trigger's panelId. */
83
- panelId: SignalLike<string>;
84
- /** The parent accordion trigger that controls this panel. */
85
- accordionTrigger: SignalLike<AccordionTriggerPattern | undefined>;
86
- }
87
- /** Represents an accordion panel. */
88
- declare class AccordionPanelPattern {
89
- readonly inputs: AccordionPanelInputs;
90
- /** A global unique identifier for the panel. */
91
- id: SignalLike<string>;
92
- /** The parent accordion trigger that controls this panel. */
93
- accordionTrigger: SignalLike<AccordionTriggerPattern | undefined>;
94
- /** Whether the accordion panel is hidden. True if the associated trigger is not expanded. */
95
- hidden: SignalLike<boolean>;
96
- constructor(inputs: AccordionPanelInputs);
97
- }
98
78
 
99
- export { AccordionGroupPattern, AccordionPanelPattern, AccordionTriggerPattern };
100
- export type { AccordionGroupInputs, AccordionPanelInputs, AccordionTriggerInputs };
79
+ export { AccordionGroupPattern, AccordionTriggerPattern };
80
+ export type { AccordionGroupInputs, AccordionTriggerInputs };
@@ -523,6 +523,8 @@ declare class GridPattern {
523
523
  readonly tabIndex: SignalLike<0 | -1>;
524
524
  /** Whether the grid is disabled. */
525
525
  readonly disabled: SignalLike<boolean>;
526
+ /** Whether the grid is multi-selectable. */
527
+ readonly multiSelectable: SignalLike<boolean | undefined>;
526
528
  /** The ID of the currently active descendant cell. */
527
529
  readonly activeDescendant: SignalLike<string | undefined>;
528
530
  /** The currently active cell. */
@@ -18,8 +18,6 @@ interface ListFocusItem {
18
18
  element: SignalLike<HTMLElement | undefined>;
19
19
  /** Whether an item is disabled. */
20
20
  disabled: SignalLike<boolean>;
21
- /** The index of the item in the list. */
22
- index: SignalLike<number>;
23
21
  }
24
22
  /** Represents the required inputs for a collection that contains focusable items. */
25
23
  interface ListFocusInputs<T extends ListFocusItem> {
@@ -1,6 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { WritableSignal } from '@angular/core';
3
- import { AccordionTriggerPattern, AccordionPanelPattern, AccordionGroupPattern } from './_accordion-chunk.js';
2
+ import { OnInit } from '@angular/core';
3
+ import { AccordionTriggerPattern, AccordionGroupPattern } from './_accordion-chunk.js';
4
4
  import { DeferredContentAware, DeferredContent } from './_deferred-content-chunk.js';
5
5
  import * as _angular_cdk_bidi from '@angular/cdk/bidi';
6
6
  import './_keyboard-event-manager-chunk.js';
@@ -11,15 +11,15 @@ import './_expansion-chunk.js';
11
11
  /**
12
12
  * The content panel of an accordion item that is conditionally visible.
13
13
  *
14
- * This directive is a container for the content that is shown or hidden. It requires
15
- * a `panelId` that must match the `panelId` of its corresponding `ngAccordionTrigger`.
14
+ * This directive is a container for the content that is shown or hidden. It should
15
+ * expose a template reference that will be used by the corresponding `ngAccordionTrigger`.
16
16
  * The content within the panel should be provided using an `ng-template` with the
17
17
  * `ngAccordionContent` directive so that the content is not rendered on the page until the trigger
18
18
  * is expanded. It applies `role="region"` for accessibility and uses the `inert` attribute to hide
19
19
  * its content from assistive technologies when not visible.
20
20
  *
21
21
  * ```html
22
- * <div ngAccordionPanel panelId="unique-id-1">
22
+ * <div ngAccordionPanel #panel="ngAccordionPanel">
23
23
  * <ng-template ngAccordionContent>
24
24
  * <p>This content is lazily rendered and will be shown when the panel is expanded.</p>
25
25
  * </ng-template>
@@ -34,14 +34,14 @@ declare class AccordionPanel {
34
34
  private readonly _deferredContentAware;
35
35
  /** A global unique identifier for the panel. */
36
36
  readonly id: _angular_core.InputSignal<string>;
37
- /** A local unique identifier for the panel, used to match with its trigger's `panelId`. */
38
- readonly panelId: _angular_core.InputSignal<string>;
39
37
  /** Whether the accordion panel is visible. True if the associated trigger is expanded. */
40
38
  readonly visible: _angular_core.Signal<boolean>;
41
- /** The parent accordion trigger pattern that controls this panel. This is set by AccordionGroup. */
42
- readonly _accordionTriggerPattern: WritableSignal<AccordionTriggerPattern | undefined>;
43
- /** The UI pattern instance for this panel. */
44
- readonly _pattern: AccordionPanelPattern;
39
+ /**
40
+ * The pattern for the accordion trigger that controls this panel.
41
+ * This is set by the trigger when it initializes.
42
+ * There is no need for a panel pattern, as the trigger has all the necessary logic.
43
+ */
44
+ _pattern?: AccordionTriggerPattern;
45
45
  constructor();
46
46
  /** Expands this item. */
47
47
  expand(): void;
@@ -50,7 +50,7 @@ declare class AccordionPanel {
50
50
  /** Toggles the expansion state of this item. */
51
51
  toggle(): void;
52
52
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionPanel, never>;
53
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionPanel, "[ngAccordionPanel]", ["ngAccordionPanel"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "panelId": { "alias": "panelId"; "required": true; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
53
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionPanel, "[ngAccordionPanel]", ["ngAccordionPanel"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
54
54
  }
55
55
 
56
56
  /**
@@ -62,12 +62,12 @@ declare class AccordionPanel {
62
62
  * It supports both single and multiple expansion modes.
63
63
  *
64
64
  * ```html
65
- * <div ngAccordionGroup [multiExpandable]="true" [(expandedPanels)]="expandedItems">
65
+ * <div ngAccordionGroup [multiExpandable]="true">
66
66
  * <div class="accordion-item">
67
67
  * <h3>
68
- * <button ngAccordionTrigger panelId="item-1">Item 1</button>
68
+ * <button ngAccordionTrigger [panel]="panel1">Item 1</button>
69
69
  * </h3>
70
- * <div ngAccordionPanel panelId="item-1">
70
+ * <div ngAccordionPanel #panel1="ngAccordionPanel">
71
71
  * <ng-template ngAccordionContent>
72
72
  * <p>Content for Item 1.</p>
73
73
  * </ng-template>
@@ -75,9 +75,9 @@ declare class AccordionPanel {
75
75
  * </div>
76
76
  * <div class="accordion-item">
77
77
  * <h3>
78
- * <button ngAccordionTrigger panelId="item-2">Item 2</button>
78
+ * <button ngAccordionTrigger [panel]="panel2">Item 2</button>
79
79
  * </h3>
80
- * <div ngAccordionPanel panelId="item-2">
80
+ * <div ngAccordionPanel #panel2="ngAccordionPanel">
81
81
  * <ng-template ngAccordionContent>
82
82
  * <p>Content for Item 2.</p>
83
83
  * </ng-template>
@@ -96,10 +96,8 @@ declare class AccordionGroup {
96
96
  readonly element: HTMLElement;
97
97
  /** The AccordionTriggers nested inside this group. */
98
98
  private readonly _triggers;
99
- /** The AccordionTrigger patterns nested inside this group. */
99
+ /** The corresponding patterns for the accordion triggers. */
100
100
  private readonly _triggerPatterns;
101
- /** The AccordionPanels nested inside this group. */
102
- private readonly _panels;
103
101
  /** The text direction (ltr or rtl). */
104
102
  readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
105
103
  /** Whether the entire accordion group is disabled. */
@@ -115,28 +113,25 @@ declare class AccordionGroup {
115
113
  readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
116
114
  /** The UI pattern instance for this accordion group. */
117
115
  readonly _pattern: AccordionGroupPattern;
118
- constructor();
119
116
  /** Expands all accordion panels if multi-expandable. */
120
117
  expandAll(): void;
121
118
  /** Collapses all accordion panels. */
122
119
  collapseAll(): void;
123
- /** Gets the trigger pattern for a given element. */
124
- private _getItem;
125
120
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionGroup, never>;
126
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, {}, ["_triggers", "_panels"], never, true, never>;
121
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionGroup, "[ngAccordionGroup]", ["ngAccordionGroup"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "multiExpandable": { "alias": "multiExpandable"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; }, {}, ["_triggers"], never, true, never>;
127
122
  }
128
123
 
129
124
  /**
130
125
  * The trigger that toggles the visibility of its associated `ngAccordionPanel`.
131
126
  *
132
- * This directive requires a `panelId` that must match the `panelId` of the `ngAccordionPanel` it
133
- * controls. When clicked, it will expand or collapse the panel. It also handles keyboard
127
+ * This directive requires the `panel` input be set to the template reference of the `ngAccordionPanel`
128
+ * it controls. When clicked, it will expand or collapse the panel. It also handles keyboard
134
129
  * interactions for navigation within the `ngAccordionGroup`. It applies `role="button"` and manages
135
130
  * `aria-expanded`, `aria-controls`, and `aria-disabled` attributes for accessibility.
136
131
  * The `disabled` input can be used to disable the trigger.
137
132
  *
138
133
  * ```html
139
- * <button ngAccordionTrigger panelId="unique-id-1">
134
+ * <button ngAccordionTrigger [panel]="panel">
140
135
  * Accordion Trigger Text
141
136
  * </button>
142
137
  * ```
@@ -144,27 +139,28 @@ declare class AccordionGroup {
144
139
  * @developerPreview 21.0
145
140
  * @see [Accordion](guide/aria/accordion)
146
141
  */
147
- declare class AccordionTrigger {
142
+ declare class AccordionTrigger implements OnInit {
148
143
  /** A reference to the trigger element. */
149
144
  private readonly _elementRef;
150
145
  /** A reference to the trigger element. */
151
146
  readonly element: HTMLElement;
152
147
  /** The parent AccordionGroup. */
153
148
  private readonly _accordionGroup;
154
- /** A unique identifier for the widget. */
149
+ /** The associated AccordionPanel. */
150
+ readonly panel: _angular_core.InputSignal<AccordionPanel>;
151
+ /** The unique identifier for the trigger. */
155
152
  readonly id: _angular_core.InputSignal<string>;
156
- /** A local unique identifier for the trigger, used to match with its panel's `panelId`. */
157
- readonly panelId: _angular_core.InputSignal<string>;
153
+ /** The unique identifier for the correspondingtrigger panel. */
154
+ readonly panelId: _angular_core.Signal<string>;
158
155
  /** Whether the trigger is disabled. */
159
156
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
160
157
  /** Whether the corresponding panel is expanded. */
161
158
  readonly expanded: _angular_core.ModelSignal<boolean>;
162
159
  /** Whether the trigger is active. */
163
160
  readonly active: _angular_core.Signal<boolean>;
164
- /** The accordion panel pattern controlled by this trigger. This is set by AccordionGroup. */
165
- readonly _accordionPanelPattern: WritableSignal<AccordionPanelPattern | undefined>;
166
161
  /** The UI pattern instance for this trigger. */
167
- readonly _pattern: AccordionTriggerPattern;
162
+ _pattern: AccordionTriggerPattern;
163
+ ngOnInit(): void;
168
164
  /** Expands this item. */
169
165
  expand(): void;
170
166
  /** Collapses this item. */
@@ -172,7 +168,7 @@ declare class AccordionTrigger {
172
168
  /** Toggles the expansion state of this item. */
173
169
  toggle(): void;
174
170
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionTrigger, never>;
175
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionTrigger, "[ngAccordionTrigger]", ["ngAccordionTrigger"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "panelId": { "alias": "panelId"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, never, true, never>;
171
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AccordionTrigger, "[ngAccordionTrigger]", ["ngAccordionTrigger"], { "panel": { "alias": "panel"; "required": true; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; }, never, never, true, never>;
176
172
  }
177
173
 
178
174
  /**
@@ -7,7 +7,7 @@ export { WritableSignalLike, computed, convertGetterSetterToWritableSignalLike,
7
7
  export { MenuBarInputs, MenuBarPattern, MenuInputs, MenuItemInputs, MenuItemPattern, MenuPattern, MenuTriggerInputs, MenuTriggerPattern } from './_menu-chunk.js';
8
8
  export { TabInputs, TabListInputs, TabListPattern, TabPanelInputs, TabPanelPattern, TabPattern } from './_tabs-chunk.js';
9
9
  export { ToolbarInputs, ToolbarPattern, ToolbarWidgetGroupInputs, ToolbarWidgetGroupPattern, ToolbarWidgetInputs, ToolbarWidgetPattern } from './_toolbar-chunk.js';
10
- export { AccordionGroupInputs, AccordionGroupPattern, AccordionPanelInputs, AccordionPanelPattern, AccordionTriggerInputs, AccordionTriggerPattern } from './_accordion-chunk.js';
10
+ export { AccordionGroupInputs, AccordionGroupPattern, AccordionTriggerInputs, AccordionTriggerPattern } from './_accordion-chunk.js';
11
11
  import { TreeInputs, TreeItemPattern, TreePattern } from './_tree-chunk.js';
12
12
  export { TreeItemInputs } from './_tree-chunk.js';
13
13
  export { GridCellInputs, GridCellPattern, GridCellWidgetInputs, GridCellWidgetPattern, GridInputs, GridPattern, GridRowInputs, GridRowPattern } from './_grid-chunk.js';