@angular/aria 22.0.0-next.6 → 22.0.0-next.7

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 (70) hide show
  1. package/fesm2022/_accordion-chunk.mjs.map +1 -1
  2. package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
  3. package/fesm2022/_combobox-chunk.mjs +51 -2
  4. package/fesm2022/_combobox-chunk.mjs.map +1 -1
  5. package/fesm2022/_combobox-listbox-chunk.mjs +3 -0
  6. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -1
  7. package/fesm2022/_combobox-tree-chunk.mjs.map +1 -1
  8. package/fesm2022/_deferred-content-chunk.mjs +16 -14
  9. package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
  10. package/fesm2022/_element-chunk.mjs.map +1 -1
  11. package/fesm2022/_expansion-chunk.mjs.map +1 -1
  12. package/fesm2022/_list-chunk.mjs.map +1 -1
  13. package/fesm2022/_list-navigation-chunk.mjs +3 -1
  14. package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
  15. package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
  16. package/fesm2022/_menu-chunk.mjs.map +1 -1
  17. package/fesm2022/_signal-like-chunk.mjs +0 -1
  18. package/fesm2022/_signal-like-chunk.mjs.map +1 -1
  19. package/fesm2022/_tabs-chunk.mjs +22 -47
  20. package/fesm2022/_tabs-chunk.mjs.map +1 -1
  21. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
  22. package/fesm2022/_widget-chunk.mjs +55 -13
  23. package/fesm2022/_widget-chunk.mjs.map +1 -1
  24. package/fesm2022/accordion-testing.mjs.map +1 -1
  25. package/fesm2022/accordion.mjs +16 -14
  26. package/fesm2022/accordion.mjs.map +1 -1
  27. package/fesm2022/aria.mjs +1 -1
  28. package/fesm2022/aria.mjs.map +1 -1
  29. package/fesm2022/combobox.mjs +59 -34
  30. package/fesm2022/combobox.mjs.map +1 -1
  31. package/fesm2022/grid-testing.mjs +72 -0
  32. package/fesm2022/grid-testing.mjs.map +1 -0
  33. package/fesm2022/grid.mjs +83 -37
  34. package/fesm2022/grid.mjs.map +1 -1
  35. package/fesm2022/listbox-testing.mjs.map +1 -1
  36. package/fesm2022/listbox.mjs +58 -31
  37. package/fesm2022/listbox.mjs.map +1 -1
  38. package/fesm2022/menu-testing.mjs.map +1 -1
  39. package/fesm2022/menu.mjs +41 -35
  40. package/fesm2022/menu.mjs.map +1 -1
  41. package/fesm2022/private.mjs +156 -5
  42. package/fesm2022/private.mjs.map +1 -1
  43. package/fesm2022/simple-combobox.mjs +443 -0
  44. package/fesm2022/simple-combobox.mjs.map +1 -0
  45. package/fesm2022/tabs-testing.mjs.map +1 -1
  46. package/fesm2022/tabs.mjs +243 -218
  47. package/fesm2022/tabs.mjs.map +1 -1
  48. package/fesm2022/toolbar-testing.mjs.map +1 -1
  49. package/fesm2022/toolbar.mjs +11 -11
  50. package/fesm2022/toolbar.mjs.map +1 -1
  51. package/fesm2022/tree-testing.mjs.map +1 -1
  52. package/fesm2022/tree.mjs +65 -33
  53. package/fesm2022/tree.mjs.map +1 -1
  54. package/package.json +10 -2
  55. package/types/_combobox-chunk.d.ts +32 -2
  56. package/types/_grid-chunk.d.ts +16 -8
  57. package/types/_tabs-chunk.d.ts +7 -42
  58. package/types/combobox.d.ts +4 -3
  59. package/types/grid-testing.d.ts +79 -0
  60. package/types/grid.d.ts +14 -6
  61. package/types/listbox.d.ts +8 -6
  62. package/types/menu.d.ts +7 -4
  63. package/types/private.d.ts +106 -10
  64. package/types/simple-combobox.d.ts +124 -0
  65. package/types/tabs.d.ts +79 -74
  66. package/types/tree.d.ts +5 -2
  67. package/fesm2022/_pointer-event-manager-chunk.mjs +0 -54
  68. package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
  69. package/resources/code-examples.db +0 -0
  70. package/types/_pointer-event-manager-chunk.d.ts +0 -34
@@ -4,7 +4,6 @@ import { ComboboxListboxControls, ComboboxTreeControls, ComboboxDialogPattern, C
4
4
  import { DeferredContentAware, DeferredContent } from './_deferred-content-chunk.js';
5
5
  import './_keyboard-event-manager-chunk.js';
6
6
  import './_signal-like-chunk.js';
7
- import './_pointer-event-manager-chunk.js';
8
7
  import './_list-chunk.js';
9
8
  import './_list-navigation-chunk.js';
10
9
 
@@ -132,16 +131,18 @@ declare class ComboboxDialog {
132
131
  /** The dialog element. */
133
132
  private readonly _elementRef;
134
133
  /** A reference to the dialog element. */
135
- readonly element: HTMLElement;
134
+ readonly element: HTMLDialogElement;
136
135
  /** The combobox that the dialog belongs to. */
137
136
  readonly combobox: Combobox<any>;
137
+ /** The unique identifier for the trigger. */
138
+ readonly id: _angular_core.InputSignal<string>;
138
139
  /** A reference to the parent combobox popup, if one exists. */
139
140
  private readonly _popup;
140
141
  readonly _pattern: ComboboxDialogPattern;
141
142
  constructor();
142
143
  close(): void;
143
144
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxDialog, never>;
144
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxDialog, "dialog[ngComboboxDialog]", ["ngComboboxDialog"], {}, {}, never, never, true, [{ directive: typeof ComboboxPopup; inputs: {}; outputs: {}; }]>;
145
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxDialog, "dialog[ngComboboxDialog]", ["ngComboboxDialog"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof ComboboxPopup; inputs: {}; outputs: {}; }]>;
145
146
  }
146
147
 
147
148
  /**
@@ -0,0 +1,79 @@
1
+ import { BaseHarnessFilters, ContentContainerComponentHarness, HarnessPredicate, ComponentHarness } from '@angular/cdk/testing';
2
+
3
+ /** Filters for locating a `GridCellHarness`. */
4
+ interface GridCellHarnessFilters extends BaseHarnessFilters {
5
+ /** Only find instances whose text matches the given value. */
6
+ text?: string | RegExp;
7
+ /** Only find instances whose selected state matches the given value. */
8
+ selected?: boolean;
9
+ /** Only find instances whose disabled state matches the given value. */
10
+ disabled?: boolean;
11
+ }
12
+ /** Filters for locating a `GridRowHarness`. */
13
+ interface GridRowHarnessFilters extends BaseHarnessFilters {
14
+ }
15
+ /** Filters for locating a `GridHarness`. */
16
+ interface GridHarnessFilters extends BaseHarnessFilters {
17
+ /** Only find instances whose disabled state matches the given value. */
18
+ disabled?: boolean;
19
+ }
20
+
21
+ /** Harness for interacting with a standard ngGridCell in tests. */
22
+ declare class GridCellHarness extends ContentContainerComponentHarness {
23
+ static hostSelector: string;
24
+ /**
25
+ * Gets a `HarnessPredicate` that can be used to search for a grid cell with specific attributes.
26
+ * @param options Options for filtering which cell instances are considered a match.
27
+ * @return a `HarnessPredicate` configured with the given options.
28
+ */
29
+ static with(options?: GridCellHarnessFilters): HarnessPredicate<GridCellHarness>;
30
+ /** Whether the cell is selected. */
31
+ isSelected(): Promise<boolean>;
32
+ /** Whether the cell is disabled. */
33
+ isDisabled(): Promise<boolean>;
34
+ /** Gets the text content of the cell. */
35
+ getText(): Promise<string>;
36
+ /** Clicks the cell. */
37
+ click(): Promise<void>;
38
+ /** Focuses the cell. */
39
+ focus(): Promise<void>;
40
+ /** Blurs the cell. */
41
+ blur(): Promise<void>;
42
+ }
43
+ /** Harness for interacting with a standard ngGridRow in tests. */
44
+ declare class GridRowHarness extends ComponentHarness {
45
+ static hostSelector: string;
46
+ /**
47
+ * Gets a `HarnessPredicate` that can be used to search for a grid row with specific attributes.
48
+ * @param options Options for filtering which row instances are considered a match.
49
+ * @return a `HarnessPredicate` configured with the given options.
50
+ */
51
+ static with(options?: GridRowHarnessFilters): HarnessPredicate<GridRowHarness>;
52
+ /** Gets all cells in the row. */
53
+ getCells(filters?: GridCellHarnessFilters): Promise<GridCellHarness[]>;
54
+ /** Gets the text of the cells in the row. */
55
+ getCellTextByIndex(filters?: GridCellHarnessFilters): Promise<string[]>;
56
+ }
57
+ /** Harness for interacting with a standard ngGrid in tests. */
58
+ declare class GridHarness extends ComponentHarness {
59
+ static hostSelector: string;
60
+ /**
61
+ * Gets a `HarnessPredicate` that can be used to search for a grid with specific attributes.
62
+ * @param options Options for filtering which grid instances are considered a match.
63
+ * @return a `HarnessPredicate` configured with the given options.
64
+ */
65
+ static with(options?: GridHarnessFilters): HarnessPredicate<GridHarness>;
66
+ /** Whether the grid is disabled. */
67
+ isDisabled(): Promise<boolean>;
68
+ /** Whether the grid is multi-selectable. */
69
+ isMultiSelectable(): Promise<boolean>;
70
+ /** Gets all rows in the grid. */
71
+ getRows(filters?: GridRowHarnessFilters): Promise<GridRowHarness[]>;
72
+ /** Gets all cells in the grid. */
73
+ getCells(filters?: GridCellHarnessFilters): Promise<GridCellHarness[]>;
74
+ /** Gets the text inside the entire grid organized by rows. */
75
+ getCellTextByIndex(): Promise<string[][]>;
76
+ }
77
+
78
+ export { GridCellHarness, GridHarness, GridRowHarness };
79
+ export type { GridCellHarnessFilters, GridHarnessFilters, GridRowHarnessFilters };
package/types/grid.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { Signal, ElementRef } from '@angular/core';
2
+ import { Signal, EventEmitter } from '@angular/core';
3
3
  import * as _angular_cdk_bidi from '@angular/cdk/bidi';
4
- import { GridPattern, GridCellPattern, GridRowPattern, GridCellWidgetPattern } from './_grid-chunk.js';
4
+ import { GridPattern, GridCellPattern, GridRowPattern, ElementResolver, GridCellWidgetPattern } from './_grid-chunk.js';
5
5
  import './_signal-like-chunk.js';
6
6
  import './_keyboard-event-manager-chunk.js';
7
- import './_pointer-event-manager-chunk.js';
7
+ import './_click-event-manager-chunk.js';
8
8
 
9
9
  /**
10
10
  * The container for a grid. It provides keyboard navigation and focus management for the grid's
@@ -77,13 +77,19 @@ declare class Grid {
77
77
  * - `explicit`: Cells are selected explicitly by the user (e.g., via click or spacebar).
78
78
  */
79
79
  readonly selectionMode: _angular_core.InputSignal<"follow" | "explicit">;
80
+ /** The tabindex of the grid. */
81
+ readonly tabIndex: _angular_core.InputSignalWithTransform<number | undefined, string | number | undefined>;
80
82
  /** The UI pattern for the grid. */
81
83
  readonly _pattern: GridPattern;
84
+ /** The ID of the active descendant in the grid. */
85
+ readonly activeDescendant: Signal<string | undefined>;
82
86
  constructor();
87
+ /** Scrolls the active cell into view. */
88
+ scrollActiveCellIntoView(options?: ScrollIntoViewOptions): void;
83
89
  /** Gets the cell pattern for a given element. */
84
90
  private _getCell;
85
91
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Grid, never>;
86
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Grid, "[ngGrid]", ["ngGrid"], { "enableSelection": { "alias": "enableSelection"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "rowWrap": { "alias": "rowWrap"; "required": false; "isSignal": true; }; "colWrap": { "alias": "colWrap"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; }, {}, ["_rows"], never, true, never>;
92
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Grid, "[ngGrid]", ["ngGrid"], { "enableSelection": { "alias": "enableSelection"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "rowWrap": { "alias": "rowWrap"; "required": false; "isSignal": true; }; "colWrap": { "alias": "colWrap"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; }, {}, ["_rows"], never, true, never>;
87
93
  }
88
94
 
89
95
  /**
@@ -106,6 +112,8 @@ declare class GridCell {
106
112
  private readonly _renderer;
107
113
  /** A reference to the host element. */
108
114
  readonly element: HTMLElement;
115
+ /** Emits when the cell is activated via Enter/Space (simple widgets only). */
116
+ readonly activated: EventEmitter<KeyboardEvent>;
109
117
  /** Whether the cell is currently active (focused). */
110
118
  readonly active: Signal<boolean>;
111
119
  /** The widget contained within this cell, if any. */
@@ -148,7 +156,7 @@ declare class GridCell {
148
156
  /** Gets the cell widget pattern for a given element. */
149
157
  private _getWidget;
150
158
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<GridCell, never>;
151
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<GridCell, "[ngGridCell]", ["ngGridCell"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "rowSpan": { "alias": "rowSpan"; "required": false; "isSignal": true; }; "colSpan": { "alias": "colSpan"; "required": false; "isSignal": true; }; "rowIndex": { "alias": "rowIndex"; "required": false; "isSignal": true; }; "colIndex": { "alias": "colIndex"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; }, ["_widget"], never, true, never>;
159
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<GridCell, "[ngGridCell]", ["ngGridCell"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "rowSpan": { "alias": "rowSpan"; "required": false; "isSignal": true; }; "colSpan": { "alias": "colSpan"; "required": false; "isSignal": true; }; "rowIndex": { "alias": "rowIndex"; "required": false; "isSignal": true; }; "colIndex": { "alias": "colIndex"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "activated": "activated"; "selected": "selectedChange"; }, ["_widget"], never, true, never>;
152
160
  }
153
161
 
154
162
  /**
@@ -219,7 +227,7 @@ declare class GridCellWidget {
219
227
  /** Whether the widget is disabled. */
220
228
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
221
229
  /** The target that will receive focus instead of the widget. */
222
- readonly focusTarget: _angular_core.InputSignal<ElementRef<any> | HTMLElement | undefined>;
230
+ readonly focusTarget: _angular_core.InputSignal<ElementResolver<HTMLElement>>;
223
231
  /** Emits when the widget is activated. */
224
232
  readonly activated: _angular_core.OutputEmitterRef<KeyboardEvent | FocusEvent | undefined>;
225
233
  /** Emits when the widget is deactivated. */
@@ -1,5 +1,6 @@
1
1
  import * as _angular_cdk_bidi from '@angular/cdk/bidi';
2
2
  import * as _angular_core from '@angular/core';
3
+ import { Signal } from '@angular/core';
3
4
  import { OptionPattern, ListboxPattern } from './_listbox-chunk.js';
4
5
  import { ComboboxPopup } from './combobox.js';
5
6
  export { Combobox as ɵɵCombobox, ComboboxDialog as ɵɵComboboxDialog, ComboboxInput as ɵɵComboboxInput, ComboboxPopupContainer as ɵɵComboboxPopupContainer } from './combobox.js';
@@ -9,7 +10,6 @@ import './_list-navigation-chunk.js';
9
10
  import './_keyboard-event-manager-chunk.js';
10
11
  import './_click-event-manager-chunk.js';
11
12
  import './_combobox-chunk.js';
12
- import './_pointer-event-manager-chunk.js';
13
13
  import './_deferred-content-chunk.js';
14
14
 
15
15
  /**
@@ -48,9 +48,9 @@ declare class Listbox<V> {
48
48
  /** The Options nested inside of the Listbox. */
49
49
  private readonly _options;
50
50
  /** A signal wrapper for directionality. */
51
- protected readonly textDirection: _angular_core.Signal<_angular_cdk_bidi.Direction>;
51
+ protected readonly textDirection: Signal<_angular_cdk_bidi.Direction>;
52
52
  /** The Option UIPatterns of the child Options. */
53
- protected readonly items: _angular_core.Signal<OptionPattern<V>[]>;
53
+ protected readonly items: Signal<OptionPattern<V>[]>;
54
54
  /** Whether the list is vertically or horizontally oriented. */
55
55
  readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal">;
56
56
  /** Whether multiple items in the list can be selected at once. */
@@ -80,16 +80,20 @@ declare class Listbox<V> {
80
80
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
81
81
  /** Whether the listbox is readonly. */
82
82
  readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
83
+ /** The tabindex of the listbox. */
84
+ readonly tabIndex: _angular_core.InputSignalWithTransform<number | undefined, string | number | undefined>;
83
85
  /** The values of the currently selected items. */
84
86
  readonly value: _angular_core.ModelSignal<V[]>;
85
87
  /** The Listbox UIPattern. */
86
88
  readonly _pattern: ListboxPattern<V>;
89
+ /** The ID of the active descendant in the listbox. */
90
+ readonly activeDescendant: Signal<string | undefined>;
87
91
  constructor();
88
92
  scrollActiveItemIntoView(options?: ScrollIntoViewOptions): void;
89
93
  /** Navigates to the first item in the listbox. */
90
94
  gotoFirst(): void;
91
95
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<Listbox<any>, never>;
92
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Listbox<any>, "[ngListbox]", ["ngListbox"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["_options"], never, true, [{ directive: typeof ComboboxPopup; inputs: {}; outputs: {}; }]>;
96
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Listbox<any>, "[ngListbox]", ["ngListbox"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "multi": { "alias": "multi"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "focusMode": { "alias": "focusMode"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "tabIndex": { "alias": "tabIndex"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, ["_options"], never, true, [{ directive: typeof ComboboxPopup; inputs: {}; outputs: {}; }]>;
93
97
  }
94
98
 
95
99
  /**
@@ -121,8 +125,6 @@ declare class Option<V> {
121
125
  private readonly _listbox;
122
126
  /** A unique identifier for the option. */
123
127
  readonly id: _angular_core.InputSignal<string>;
124
- /** The text used by the typeahead search. */
125
- protected readonly searchTerm: _angular_core.Signal<string>;
126
128
  /** The parent Listbox UIPattern. */
127
129
  private readonly _listboxPattern;
128
130
  /** The value of the option. */
package/types/menu.d.ts CHANGED
@@ -175,11 +175,14 @@ declare class Menu<V> {
175
175
  /** The menu ui pattern instance. */
176
176
  readonly _pattern: MenuPattern<V>;
177
177
  /**
178
- * The menu items as a writable signal.
178
+ * The menu item patterns for the menu items that are direct children of this menu, passed
179
+ * to the menu pattern.
179
180
  *
180
- * TODO(wagnermaciel): This would normally be a computed, but using a computed causes a bug where
181
- * sometimes the items array is empty. The bug can be reproduced by switching this to use a
182
- * computed and then quickly opening and closing menus in the dev app.
181
+ * Note: contentChildren has an issue where it will return a successively smaller list
182
+ * each time that the menu is open and closed, eventually resulting in an empty list.
183
+ * The workaround is to trigger a recomputation of this signal whenever the menu is opened
184
+ * or closed, by calling this._pattern.visible() in the signal body. Otherwise, computed could
185
+ * not be used and would have to rebuild the list each time this method is called.
183
186
  */
184
187
  private readonly _itemPatterns;
185
188
  /** Whether the menu is visible. */
@@ -2,25 +2,24 @@ import { ComboboxPattern, ComboboxListboxControls, ComboboxTreeControls } from '
2
2
  export { ComboboxDialogPattern, ComboboxInputs } from './_combobox-chunk.js';
3
3
  import { ListboxInputs, OptionPattern, ListboxPattern } from './_listbox-chunk.js';
4
4
  export { OptionInputs } from './_listbox-chunk.js';
5
- import { SignalLike } from './_signal-like-chunk.js';
6
- export { WritableSignalLike, computed, convertGetterSetterToWritableSignalLike, linkedSignal, signal } from './_signal-like-chunk.js';
5
+ import { SignalLike, WritableSignalLike } from './_signal-like-chunk.js';
6
+ export { computed, convertGetterSetterToWritableSignalLike, linkedSignal, signal } from './_signal-like-chunk.js';
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
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
- export { GridCellInputs, GridCellPattern, GridCellWidgetInputs, GridCellWidgetPattern, GridInputs, GridPattern, GridRowInputs, GridRowPattern } from './_grid-chunk.js';
13
+ export { ElementResolver, GridCellInputs, GridCellPattern, GridCellWidgetInputs, GridCellWidgetPattern, GridInputs, GridPattern, GridRowInputs, GridRowPattern, resolveElement } from './_grid-chunk.js';
14
14
  export { DeferredContent, DeferredContentAware } from './_deferred-content-chunk.js';
15
15
  export { HasElement, sortDirectives } from './_element-chunk.js';
16
+ import * as _angular_core from '@angular/core';
17
+ import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
18
+ import { ClickEventManager } from './_click-event-manager-chunk.js';
19
+ import { ExpansionItem } from './_expansion-chunk.js';
16
20
  export { untracked } from '@angular/core/primitives/signals';
17
- import './_keyboard-event-manager-chunk.js';
18
- import './_pointer-event-manager-chunk.js';
19
21
  import './_list-chunk.js';
20
22
  import './_list-navigation-chunk.js';
21
- import './_click-event-manager-chunk.js';
22
- import './_expansion-chunk.js';
23
- import '@angular/core';
24
23
 
25
24
  type ComboboxListboxInputs<V> = ListboxInputs<V> & {
26
25
  /** The combobox controlling the listbox. */
@@ -141,5 +140,102 @@ declare class ComboboxTreePattern<V> extends TreePattern<V> implements ComboboxT
141
140
  readonly isItemSelectable: (item?: TreeItemPattern<V> | undefined) => boolean;
142
141
  }
143
142
 
144
- export { ComboboxListboxControls, ComboboxListboxPattern, ComboboxPattern, ComboboxTreeControls, ComboboxTreePattern, ListboxInputs, ListboxPattern, OptionPattern, SignalLike, TreeInputs, TreeItemPattern, TreePattern };
145
- export type { ComboboxListboxInputs, ComboboxTreeInputs };
143
+ /** Represents the required inputs for a simple combobox. */
144
+ interface SimpleComboboxInputs extends ExpansionItem {
145
+ /** Whether the combobox should always remain expanded. */
146
+ alwaysExpanded: SignalLike<boolean>;
147
+ /** The value of the combobox. */
148
+ value: WritableSignalLike<string>;
149
+ /** The element that the combobox is attached to. */
150
+ element: SignalLike<HTMLElement>;
151
+ /** The popup associated with the combobox. */
152
+ popup: SignalLike<SimpleComboboxPopupPattern | undefined>;
153
+ /** An inline suggestion to be displayed in the input. */
154
+ inlineSuggestion: SignalLike<string | undefined>;
155
+ /** Whether the combobox is disabled. */
156
+ disabled: SignalLike<boolean>;
157
+ }
158
+ /** Controls the state of a simple combobox. */
159
+ declare class SimpleComboboxPattern {
160
+ readonly inputs: SimpleComboboxInputs;
161
+ /** The expanded state of the combobox. */
162
+ readonly isExpanded: _angular_core.Signal<boolean>;
163
+ /** The value of the combobox. */
164
+ readonly value: WritableSignalLike<string>;
165
+ /** The element that the combobox is attached to. */
166
+ readonly element: () => HTMLElement;
167
+ /** Whether the combobox is disabled. */
168
+ readonly disabled: () => boolean;
169
+ /** An inline suggestion to be displayed in the input. */
170
+ readonly inlineSuggestion: () => string | undefined;
171
+ /** The ID of the active descendant in the popup. */
172
+ readonly activeDescendant: _angular_core.Signal<string | undefined>;
173
+ /** The ID of the popup. */
174
+ readonly popupId: _angular_core.Signal<string | undefined>;
175
+ /** The type of the popup. */
176
+ readonly popupType: _angular_core.Signal<"listbox" | "tree" | "grid" | "dialog" | undefined>;
177
+ /** The autocomplete behavior of the combobox. */
178
+ readonly autocomplete: _angular_core.Signal<"none" | "inline" | "list" | "both">;
179
+ /** A relay for keyboard events to the popup. */
180
+ readonly keyboardEventRelay: _angular_core.WritableSignal<KeyboardEvent | undefined>;
181
+ /** Whether the combobox is focused. */
182
+ readonly isFocused: _angular_core.WritableSignal<boolean>;
183
+ /** Whether the most recent input event was a deletion. */
184
+ readonly isDeleting: _angular_core.WritableSignal<boolean>;
185
+ /** Whether the combobox is editable (i.e., an input or textarea). */
186
+ readonly isEditable: _angular_core.Signal<boolean>;
187
+ /** The keydown event manager for the combobox. */
188
+ keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
189
+ /** The click event manager for the combobox. */
190
+ click: _angular_core.Signal<ClickEventManager<PointerEvent>>;
191
+ constructor(inputs: SimpleComboboxInputs);
192
+ /** Handles keydown events for the combobox. */
193
+ onKeydown(event: KeyboardEvent): void;
194
+ /** Handles click events for the combobox. */
195
+ onClick(event: PointerEvent): void;
196
+ /** Handles focus in events for the combobox. */
197
+ onFocusin(): void;
198
+ /** Handles focus out events for the combobox. */
199
+ onFocusout(event: FocusEvent): void;
200
+ /** Handles input events for the combobox. */
201
+ onInput(event: Event): void;
202
+ /** Highlights the currently selected item in the combobox. */
203
+ highlightEffect(): void;
204
+ /** Relays keyboard events to the popup. */
205
+ keyboardEventRelayEffect(): void;
206
+ /** Closes the popup when focus leaves the combobox and popup. */
207
+ closePopupOnBlurEffect(): void;
208
+ }
209
+ /** Represents the required inputs for a simple combobox popup. */
210
+ interface SimpleComboboxPopupInputs {
211
+ /** The type of the popup. */
212
+ popupType: SignalLike<'listbox' | 'tree' | 'grid' | 'dialog'>;
213
+ /** The element that serves as the control target for the popup. */
214
+ controlTarget: SignalLike<HTMLElement | undefined>;
215
+ /** The ID of the active descendant in the popup. */
216
+ activeDescendant: SignalLike<string | undefined>;
217
+ /** The ID of the popup. */
218
+ popupId: SignalLike<string | undefined>;
219
+ }
220
+ /** Controls the state of a simple combobox popup. */
221
+ declare class SimpleComboboxPopupPattern {
222
+ readonly inputs: SimpleComboboxPopupInputs;
223
+ /** The type of the popup. */
224
+ readonly popupType: () => "listbox" | "tree" | "grid" | "dialog";
225
+ /** The element that serves as the control target for the popup. */
226
+ readonly controlTarget: () => HTMLElement | undefined;
227
+ /** The ID of the active descendant in the popup. */
228
+ readonly activeDescendant: () => string | undefined;
229
+ /** The ID of the popup. */
230
+ readonly popupId: () => string | undefined;
231
+ /** Whether the popup is focused. */
232
+ readonly isFocused: _angular_core.WritableSignal<boolean>;
233
+ constructor(inputs: SimpleComboboxPopupInputs);
234
+ /** Handles focus in events for the popup. */
235
+ onFocusin(): void;
236
+ /** Handles focus out events for the popup. */
237
+ onFocusout(event: FocusEvent): void;
238
+ }
239
+
240
+ export { ComboboxListboxControls, ComboboxListboxPattern, ComboboxPattern, ComboboxTreeControls, ComboboxTreePattern, ListboxInputs, ListboxPattern, OptionPattern, SignalLike, SimpleComboboxPattern, SimpleComboboxPopupPattern, TreeInputs, TreeItemPattern, TreePattern, WritableSignalLike };
241
+ export type { ComboboxListboxInputs, ComboboxTreeInputs, SimpleComboboxInputs, SimpleComboboxPopupInputs };
@@ -0,0 +1,124 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { OnInit, OnDestroy } from '@angular/core';
3
+ import * as i1 from '@angular/aria/private';
4
+ import { SimpleComboboxPopupPattern, DeferredContentAware, SimpleComboboxPattern } from '@angular/aria/private';
5
+ export { DeferredContent as ɵɵDeferredContent, DeferredContentAware as ɵɵDeferredContentAware } from './_deferred-content-chunk.js';
6
+
7
+ /**
8
+ * Identifies an element as a widget within a combobox popup.
9
+ *
10
+ * This directive should be applied to the element that contains the options or content
11
+ * of the popup. It handles the communication of ID and active descendant information
12
+ * to the combobox.
13
+ */
14
+ declare class ComboboxWidget implements OnInit, OnDestroy {
15
+ /** The element that the popup widget is attached to. */
16
+ private readonly _elementRef;
17
+ private readonly _popup;
18
+ /** A reference to the popup widget element. */
19
+ readonly element: HTMLElement;
20
+ /** The ID of the popup widget. */
21
+ readonly popupId: _angular_core.WritableSignal<string | undefined>;
22
+ /** The ID of the active descendant in the widget. */
23
+ readonly activeDescendant: _angular_core.InputSignal<string | undefined>;
24
+ private _observer;
25
+ constructor();
26
+ ngOnInit(): void;
27
+ ngOnDestroy(): void;
28
+ /** Handles focus in events for the widget. */
29
+ onFocusin(): void;
30
+ /** Handles focus out events for the widget. */
31
+ onFocusout(event: FocusEvent): void;
32
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxWidget, never>;
33
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxWidget, "[ngComboboxWidget]", ["ngComboboxWidget"], { "activeDescendant": { "alias": "activeDescendant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
34
+ }
35
+
36
+ /**
37
+ * A structural directive that marks the `ng-template` to be used as the popup
38
+ * for a combobox. This content is conditionally rendered.
39
+ *
40
+ * The content of the popup can be any element with the `ngComboboxWidget` directive.
41
+ *
42
+ * ```html
43
+ * <ng-template ngComboboxPopup>
44
+ * <div ngComboboxWidget>
45
+ * <!-- ... options ... -->
46
+ * </div>
47
+ * </ng-template>
48
+ * ```
49
+ */
50
+ declare class ComboboxPopup implements OnInit, OnDestroy {
51
+ private readonly _deferredContent;
52
+ /** The combobox that the popup belongs to. */
53
+ readonly combobox: _angular_core.InputSignal<Combobox>;
54
+ /** The widget contained within the popup. */
55
+ readonly _widget: _angular_core.WritableSignal<ComboboxWidget | undefined>;
56
+ /** The element that serves as the control target for the popup. */
57
+ readonly controlTarget: _angular_core.Signal<HTMLElement | undefined>;
58
+ /** The ID of the popup. */
59
+ readonly popupId: _angular_core.Signal<string | undefined>;
60
+ /** The ID of the active descendant in the popup. */
61
+ readonly activeDescendant: _angular_core.Signal<string | undefined>;
62
+ /** The type of the popup (e.g., listbox, tree, grid, dialog). */
63
+ readonly popupType: _angular_core.InputSignal<"listbox" | "tree" | "grid" | "dialog">;
64
+ /** The popup pattern. */
65
+ readonly _pattern: SimpleComboboxPopupPattern;
66
+ ngOnInit(): void;
67
+ ngOnDestroy(): void;
68
+ /** Registers a widget with the popup. */
69
+ _registerWidget(widget: ComboboxWidget): void;
70
+ /** Unregisters the widget from the popup. */
71
+ _unregisterWidget(): void;
72
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxPopup, never>;
73
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxPopup, "ng-template[ngComboboxPopup]", ["ngComboboxPopup"], { "combobox": { "alias": "combobox"; "required": true; "isSignal": true; }; "popupType": { "alias": "popupType"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
74
+ }
75
+
76
+ /**
77
+ * The container element that wraps a combobox input and popup, and orchestrates its behavior.
78
+ *
79
+ * The `ngCombobox` directive is the main entry point for creating a combobox and customizing its
80
+ * behavior. It coordinates the interactions between the input and the popup.
81
+ *
82
+ * ```html
83
+ * <div ngCombobox [(expanded)]="expanded">
84
+ * <input ngComboboxInput />
85
+ *
86
+ * <ng-template ngComboboxPopup>
87
+ * <div ngComboboxWidget>
88
+ * <!-- ... options ... -->
89
+ * </div>
90
+ * </ng-template>
91
+ * </div>
92
+ * ```
93
+ */
94
+ declare class Combobox extends DeferredContentAware implements OnInit {
95
+ private readonly _renderer;
96
+ /** The element that the combobox is attached to. */
97
+ private readonly _elementRef;
98
+ /** A reference to the input element. */
99
+ readonly element: HTMLElement;
100
+ /** The popup associated with the combobox. */
101
+ readonly _popup: _angular_core.WritableSignal<ComboboxPopup | undefined>;
102
+ /** Whether the combobox is disabled. */
103
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
104
+ /** Whether the combobox should always remain expanded. */
105
+ readonly alwaysExpanded: _angular_core.InputSignalWithTransform<boolean, unknown>;
106
+ /** Whether the combobox is expanded. */
107
+ readonly expanded: _angular_core.ModelSignal<boolean>;
108
+ /** The value of the combobox input. */
109
+ readonly value: _angular_core.ModelSignal<string>;
110
+ /** An inline suggestion to be displayed in the input. */
111
+ readonly inlineSuggestion: _angular_core.InputSignal<string | undefined>;
112
+ /** The combobox ui pattern. */
113
+ readonly _pattern: SimpleComboboxPattern;
114
+ constructor();
115
+ ngOnInit(): void;
116
+ /** Registers a popup with the combobox. */
117
+ _registerPopup(popup: ComboboxPopup): void;
118
+ /** Unregisters the popup from the combobox. */
119
+ _unregisterPopup(): void;
120
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<Combobox, never>;
121
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Combobox, "[ngCombobox]", ["ngCombobox"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "alwaysExpanded": { "alias": "alwaysExpanded"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "inlineSuggestion": { "alias": "inlineSuggestion"; "required": false; "isSignal": true; }; }, { "expanded": "expandedChange"; "value": "valueChange"; }, never, never, true, never>;
122
+ }
123
+
124
+ export { Combobox, ComboboxPopup, ComboboxWidget };