@angular/aria 21.1.0-next.0 → 21.1.0-next.2

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 (56) hide show
  1. package/fesm2022/_combobox-chunk.mjs +425 -0
  2. package/fesm2022/_combobox-chunk.mjs.map +1 -0
  3. package/fesm2022/_combobox-listbox-chunk.mjs +522 -0
  4. package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -0
  5. package/fesm2022/_combobox-popup-chunk.mjs +46 -0
  6. package/fesm2022/_combobox-popup-chunk.mjs.map +1 -0
  7. package/fesm2022/_list-navigation-chunk.mjs +116 -0
  8. package/fesm2022/_list-navigation-chunk.mjs.map +1 -0
  9. package/fesm2022/_pointer-event-manager-chunk.mjs +134 -0
  10. package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -0
  11. package/fesm2022/_widget-chunk.mjs +4 -246
  12. package/fesm2022/_widget-chunk.mjs.map +1 -1
  13. package/fesm2022/accordion.mjs +64 -51
  14. package/fesm2022/accordion.mjs.map +1 -1
  15. package/fesm2022/aria.mjs +1 -1
  16. package/fesm2022/aria.mjs.map +1 -1
  17. package/fesm2022/combobox.mjs +120 -144
  18. package/fesm2022/combobox.mjs.map +1 -1
  19. package/fesm2022/grid.mjs +285 -261
  20. package/fesm2022/grid.mjs.map +1 -1
  21. package/fesm2022/listbox.mjs +205 -193
  22. package/fesm2022/listbox.mjs.map +1 -1
  23. package/fesm2022/menu.mjs +301 -283
  24. package/fesm2022/menu.mjs.map +1 -1
  25. package/fesm2022/private.mjs +15 -938
  26. package/fesm2022/private.mjs.map +1 -1
  27. package/fesm2022/tabs.mjs +209 -195
  28. package/fesm2022/tabs.mjs.map +1 -1
  29. package/fesm2022/toolbar.mjs +59 -47
  30. package/fesm2022/toolbar.mjs.map +1 -1
  31. package/fesm2022/tree.mjs +43 -41
  32. package/fesm2022/tree.mjs.map +1 -1
  33. package/package.json +2 -2
  34. package/types/_combobox-chunk.d.ts +98 -0
  35. package/types/_combobox-chunk.d2.ts +193 -0
  36. package/types/_grid-chunk.d.ts +3 -210
  37. package/types/_list-chunk.d.ts +212 -0
  38. package/types/_list-navigation-chunk.d.ts +212 -0
  39. package/types/_listbox-chunk.d.ts +106 -0
  40. package/types/accordion.d.ts +52 -49
  41. package/types/combobox.d.ts +25 -111
  42. package/types/grid.d.ts +37 -32
  43. package/types/listbox.d.ts +8 -5
  44. package/types/menu.d.ts +113 -113
  45. package/types/private.d.ts +12 -498
  46. package/types/tabs.d.ts +89 -84
  47. package/types/toolbar.d.ts +69 -66
  48. package/types/tree.d.ts +106 -103
  49. package/_adev_assets/aria-accordion.json +0 -743
  50. package/_adev_assets/aria-combobox.json +0 -607
  51. package/_adev_assets/aria-grid.json +0 -901
  52. package/_adev_assets/aria-listbox.json +0 -544
  53. package/_adev_assets/aria-menu.json +0 -1049
  54. package/_adev_assets/aria-tabs.json +0 -880
  55. package/_adev_assets/aria-toolbar.json +0 -545
  56. package/_adev_assets/aria-tree.json +0 -861
@@ -0,0 +1,212 @@
1
+ import * as _angular_core from '@angular/core';
2
+
3
+ /**
4
+ * Options that are applicable to all event handlers.
5
+ *
6
+ * This library has not yet had a need for stopPropagationImmediate.
7
+ */
8
+ interface EventHandlerOptions {
9
+ stopPropagation: boolean;
10
+ preventDefault: boolean;
11
+ }
12
+ /** A basic event handler. */
13
+ type EventHandler<T extends Event> = (event: T) => void;
14
+ /** A function that determines whether an event is to be handled. */
15
+ type EventMatcher<T extends Event> = (event: T) => boolean;
16
+ /** A config that specifies how to handle a particular event. */
17
+ interface EventHandlerConfig<T extends Event> extends EventHandlerOptions {
18
+ matcher: EventMatcher<T>;
19
+ handler: EventHandler<T>;
20
+ }
21
+ /** Bit flag representation of the possible modifier keys that can be present on an event. */
22
+ declare enum Modifier {
23
+ None = 0,
24
+ Ctrl = 1,
25
+ Shift = 2,
26
+ Alt = 4,
27
+ Meta = 8,
28
+ Any = "Any"
29
+ }
30
+ type ModifierInputs = Modifier | Modifier[];
31
+ /**
32
+ * Abstract base class for all event managers.
33
+ *
34
+ * Event managers are designed to normalize how event handlers are authored and create a safety net
35
+ * for common event handling gotchas like remembering to call preventDefault or stopPropagation.
36
+ */
37
+ declare abstract class EventManager<T extends Event> {
38
+ protected configs: EventHandlerConfig<T>[];
39
+ abstract options: EventHandlerOptions;
40
+ /** Runs the handlers that match with the given event. */
41
+ handle(event: T): void;
42
+ /** Configures the event manager to handle specific events. (See subclasses for more). */
43
+ abstract on(...args: [...unknown[]]): this;
44
+ }
45
+
46
+ type SignalLike<T> = () => T;
47
+ interface WritableSignalLike<T> extends SignalLike<T> {
48
+ set(value: T): void;
49
+ update(updateFn: (value: T) => T): void;
50
+ }
51
+ /** Converts a getter setter style signal to a WritableSignalLike. */
52
+ declare function convertGetterSetterToWritableSignalLike<T>(getter: () => T, setter: (v: T) => void): WritableSignalLike<T>;
53
+
54
+ /**
55
+ * Used to represent a keycode.
56
+ *
57
+ * This is used to match whether an events keycode should be handled. The ability to match using a
58
+ * string, SignalLike, or Regexp gives us more flexibility when authoring event handlers.
59
+ */
60
+ type KeyCode = string | SignalLike<string> | RegExp;
61
+ /**
62
+ * An event manager that is specialized for handling keyboard events. By default this manager stops
63
+ * propagation and prevents default on all events it handles.
64
+ */
65
+ declare class KeyboardEventManager<T extends KeyboardEvent> extends EventManager<T> {
66
+ options: EventHandlerOptions;
67
+ /** Configures this event manager to handle events with a specific key and no modifiers. */
68
+ on(key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;
69
+ /** Configures this event manager to handle events with a specific modifer and key combination. */
70
+ on(modifiers: ModifierInputs, key: KeyCode, handler: EventHandler<T>, options?: Partial<EventHandlerOptions>): this;
71
+ private _normalizeInputs;
72
+ private _isMatch;
73
+ }
74
+
75
+ /**
76
+ * The different mouse buttons that may appear on a pointer event.
77
+ */
78
+ declare enum MouseButton {
79
+ Main = 0,
80
+ Auxiliary = 1,
81
+ Secondary = 2
82
+ }
83
+ /** An event manager that is specialized for handling pointer events. */
84
+ declare class PointerEventManager<T extends PointerEvent> extends EventManager<T> {
85
+ options: EventHandlerOptions;
86
+ /**
87
+ * Configures this event manager to handle events with a specific modifer and mouse button
88
+ * combination.
89
+ */
90
+ on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;
91
+ /**
92
+ * Configures this event manager to handle events with a specific mouse button and no modifiers.
93
+ */
94
+ on(modifiers: ModifierInputs, handler: EventHandler<T>): this;
95
+ /**
96
+ * Configures this event manager to handle events with the main mouse button and no modifiers.
97
+ *
98
+ * @param handler The handler function
99
+ * @param options Options for whether to stop propagation or prevent default.
100
+ */
101
+ on(handler: EventHandler<T>): this;
102
+ private _normalizeInputs;
103
+ _isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
104
+ }
105
+
106
+ /** Represents an item in a collection, such as a listbox option, than may receive focus. */
107
+ interface ListFocusItem {
108
+ /** A unique identifier for the item. */
109
+ id: SignalLike<string>;
110
+ /** The html element that should receive focus. */
111
+ element: SignalLike<HTMLElement | undefined>;
112
+ /** Whether an item is disabled. */
113
+ disabled: SignalLike<boolean>;
114
+ /** The index of the item in the list. */
115
+ index: SignalLike<number>;
116
+ }
117
+ /** Represents the required inputs for a collection that contains focusable items. */
118
+ interface ListFocusInputs<T extends ListFocusItem> {
119
+ /** The focus strategy used by the list. */
120
+ focusMode: SignalLike<'roving' | 'activedescendant'>;
121
+ /** Whether the list is disabled. */
122
+ disabled: SignalLike<boolean>;
123
+ /** The items in the list. */
124
+ items: SignalLike<T[]>;
125
+ /** The active item. */
126
+ activeItem: WritableSignalLike<T | undefined>;
127
+ /** Whether disabled items in the list should be focusable. */
128
+ softDisabled: SignalLike<boolean>;
129
+ element: SignalLike<HTMLElement | undefined>;
130
+ }
131
+ /** Controls focus for a list of items. */
132
+ declare class ListFocus<T extends ListFocusItem> {
133
+ readonly inputs: ListFocusInputs<T>;
134
+ /** The last item that was active. */
135
+ prevActiveItem: _angular_core.WritableSignal<T | undefined>;
136
+ /** The index of the last item that was active. */
137
+ prevActiveIndex: _angular_core.Signal<number>;
138
+ /** The current active index in the list. */
139
+ activeIndex: _angular_core.Signal<number>;
140
+ constructor(inputs: ListFocusInputs<T>);
141
+ /** Whether the list is in a disabled state. */
142
+ isListDisabled(): boolean;
143
+ /** The id of the current active item. */
144
+ getActiveDescendant(): string | undefined;
145
+ /** The tab index for the list. */
146
+ getListTabIndex(): -1 | 0;
147
+ /** Returns the tab index for the given item. */
148
+ getItemTabIndex(item: T): -1 | 0;
149
+ /** Moves focus to the given item if it is focusable. */
150
+ focus(item: T, opts?: {
151
+ focusElement?: boolean;
152
+ }): boolean;
153
+ /** Returns true if the given item can be navigated to. */
154
+ isFocusable(item: T): boolean;
155
+ }
156
+
157
+ /** Represents an item in a collection, such as a listbox option, than can be navigated to. */
158
+ interface ListNavigationItem extends ListFocusItem {
159
+ }
160
+ /** Represents the required inputs for a collection that has navigable items. */
161
+ interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {
162
+ /** Whether focus should wrap when navigating. */
163
+ wrap: SignalLike<boolean>;
164
+ /** Whether the list is vertically or horizontally oriented. */
165
+ orientation: SignalLike<'vertical' | 'horizontal'>;
166
+ /** The direction that text is read based on the users locale. */
167
+ textDirection: SignalLike<'rtl' | 'ltr'>;
168
+ }
169
+ /** Controls navigation for a list of items. */
170
+ declare class ListNavigation<T extends ListNavigationItem> {
171
+ readonly inputs: ListNavigationInputs<T> & {
172
+ focusManager: ListFocus<T>;
173
+ };
174
+ constructor(inputs: ListNavigationInputs<T> & {
175
+ focusManager: ListFocus<T>;
176
+ });
177
+ /** Navigates to the given item. */
178
+ goto(item?: T, opts?: {
179
+ focusElement?: boolean;
180
+ }): boolean;
181
+ /** Navigates to the next item in the list. */
182
+ next(opts?: {
183
+ focusElement?: boolean;
184
+ }): boolean;
185
+ /** Peeks the next item in the list. */
186
+ peekNext(): T | undefined;
187
+ /** Navigates to the previous item in the list. */
188
+ prev(opts?: {
189
+ focusElement?: boolean;
190
+ }): boolean;
191
+ /** Peeks the previous item in the list. */
192
+ peekPrev(): T | undefined;
193
+ /** Navigates to the first item in the list. */
194
+ first(opts?: {
195
+ focusElement?: boolean;
196
+ }): boolean;
197
+ /** Navigates to the last item in the list. */
198
+ last(opts?: {
199
+ focusElement?: boolean;
200
+ }): boolean;
201
+ /** Gets the first focusable item from the given list of items. */
202
+ peekFirst(items?: T[]): T | undefined;
203
+ /** Gets the last focusable item from the given list of items. */
204
+ peekLast(items?: T[]): T | undefined;
205
+ /** Advances to the next or previous focusable item in the list based on the given delta. */
206
+ private _advance;
207
+ /** Peeks the next or previous focusable item in the list based on the given delta. */
208
+ private _peek;
209
+ }
210
+
211
+ export { KeyboardEventManager, ListFocus, ListNavigation, PointerEventManager, convertGetterSetterToWritableSignalLike };
212
+ export type { ListFocusInputs, ListFocusItem, ListNavigationInputs, ListNavigationItem, SignalLike, WritableSignalLike };
@@ -0,0 +1,106 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { SignalLike, KeyboardEventManager, PointerEventManager } from './_list-navigation-chunk.js';
3
+ import { ListItem, ListInputs, List } from './_list-chunk.js';
4
+
5
+ /**
6
+ * Represents the properties exposed by a listbox that need to be accessed by an option.
7
+ * This exists to avoid circular dependency errors between the listbox and option.
8
+ */
9
+ interface ListboxPattern$1<V> {
10
+ inputs: ListInputs<OptionPattern<V>, V>;
11
+ listBehavior: List<OptionPattern<V>, V>;
12
+ }
13
+ /** Represents the required inputs for an option in a listbox. */
14
+ interface OptionInputs<V> extends Omit<ListItem<V>, 'index' | 'selectable'> {
15
+ listbox: SignalLike<ListboxPattern$1<V> | undefined>;
16
+ }
17
+ /** Represents an option in a listbox. */
18
+ declare class OptionPattern<V> {
19
+ /** A unique identifier for the option. */
20
+ id: SignalLike<string>;
21
+ /** The value of the option. */
22
+ value: SignalLike<V>;
23
+ /** The position of the option in the list. */
24
+ index: _angular_core.Signal<number>;
25
+ /** Whether the option is active. */
26
+ active: _angular_core.Signal<boolean>;
27
+ /** Whether the option is selected. */
28
+ selected: _angular_core.Signal<boolean | undefined>;
29
+ /** Whether the option is selectable. */
30
+ selectable: () => boolean;
31
+ /** Whether the option is disabled. */
32
+ disabled: SignalLike<boolean>;
33
+ /** The text used by the typeahead search. */
34
+ searchTerm: SignalLike<string>;
35
+ /** A reference to the parent listbox. */
36
+ listbox: SignalLike<ListboxPattern$1<V> | undefined>;
37
+ /** The tab index of the option. */
38
+ tabIndex: _angular_core.Signal<0 | -1 | undefined>;
39
+ /** The html element that should receive focus. */
40
+ element: SignalLike<HTMLElement | undefined>;
41
+ constructor(args: OptionInputs<V>);
42
+ }
43
+
44
+ /** Represents the required inputs for a listbox. */
45
+ type ListboxInputs<V> = ListInputs<OptionPattern<V>, V> & {
46
+ /** A unique identifier for the listbox. */
47
+ id: SignalLike<string>;
48
+ /** Whether the listbox is readonly. */
49
+ readonly: SignalLike<boolean>;
50
+ };
51
+ /** Controls the state of a listbox. */
52
+ declare class ListboxPattern<V> {
53
+ readonly inputs: ListboxInputs<V>;
54
+ listBehavior: List<OptionPattern<V>, V>;
55
+ /** Whether the list is vertically or horizontally oriented. */
56
+ orientation: SignalLike<'vertical' | 'horizontal'>;
57
+ /** Whether the listbox is disabled. */
58
+ disabled: _angular_core.Signal<boolean>;
59
+ /** Whether the listbox is readonly. */
60
+ readonly: SignalLike<boolean>;
61
+ /** The tab index of the listbox. */
62
+ tabIndex: SignalLike<-1 | 0>;
63
+ /** The id of the current active item. */
64
+ activeDescendant: _angular_core.Signal<string | undefined>;
65
+ /** Whether multiple items in the list can be selected at once. */
66
+ multi: SignalLike<boolean>;
67
+ /** The number of items in the listbox. */
68
+ setsize: _angular_core.Signal<number>;
69
+ /** Whether the listbox selection follows focus. */
70
+ followFocus: _angular_core.Signal<boolean>;
71
+ /** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
72
+ wrap: _angular_core.WritableSignal<boolean>;
73
+ /** The key used to navigate to the previous item in the list. */
74
+ prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
75
+ /** The key used to navigate to the next item in the list. */
76
+ nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
77
+ /** Represents the space key. Does nothing when the user is actively using typeahead. */
78
+ dynamicSpaceKey: _angular_core.Signal<"" | " ">;
79
+ /** The regexp used to decide if a key should trigger typeahead. */
80
+ typeaheadRegexp: RegExp;
81
+ /** The keydown event manager for the listbox. */
82
+ keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
83
+ /** The pointerdown event manager for the listbox. */
84
+ pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
85
+ constructor(inputs: ListboxInputs<V>);
86
+ /** Returns a set of violations */
87
+ validate(): string[];
88
+ /** Handles keydown events for the listbox. */
89
+ onKeydown(event: KeyboardEvent): void;
90
+ onPointerdown(event: PointerEvent): void;
91
+ /**
92
+ * Sets the listbox to it's default initial state.
93
+ *
94
+ * Sets the active index of the listbox to the first focusable selected
95
+ * item if one exists. Otherwise, sets focus to the first focusable item.
96
+ *
97
+ * This method should be called once the listbox and it's options are properly initialized,
98
+ * meaning the ListboxPattern and OptionPatterns should have references to each other before this
99
+ * is called.
100
+ */
101
+ setDefaultState(): void;
102
+ protected _getItem(e: PointerEvent): OptionPattern<V> | undefined;
103
+ }
104
+
105
+ export { ListboxPattern, OptionPattern };
106
+ export type { ListboxInputs, OptionInputs };
@@ -1,8 +1,8 @@
1
- import * as _angular_cdk_bidi from '@angular/cdk/bidi';
2
1
  import * as _angular_core from '@angular/core';
3
2
  import { WritableSignal } from '@angular/core';
4
3
  import * as i1 from '@angular/aria/private';
5
4
  import { AccordionTriggerPattern, AccordionPanelPattern, AccordionGroupPattern } from '@angular/aria/private';
5
+ import * as _angular_cdk_bidi from '@angular/cdk/bidi';
6
6
 
7
7
  /**
8
8
  * The content panel of an accordion item that is conditionally visible.
@@ -47,53 +47,7 @@ declare class AccordionPanel {
47
47
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionPanel, never>;
48
48
  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 i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
49
49
  }
50
- /**
51
- * The trigger that toggles the visibility of its associated `ngAccordionPanel`.
52
- *
53
- * This directive requires a `panelId` that must match the `panelId` of the `ngAccordionPanel` it
54
- * controls. When clicked, it will expand or collapse the panel. It also handles keyboard
55
- * interactions for navigation within the `ngAccordionGroup`. It applies `role="button"` and manages
56
- * `aria-expanded`, `aria-controls`, and `aria-disabled` attributes for accessibility.
57
- * The `disabled` input can be used to disable the trigger.
58
- *
59
- * ```html
60
- * <button ngAccordionTrigger panelId="unique-id-1">
61
- * Accordion Trigger Text
62
- * </button>
63
- * ```
64
- *
65
- * @developerPreview 21.0
66
- */
67
- declare class AccordionTrigger {
68
- /** A reference to the trigger element. */
69
- private readonly _elementRef;
70
- /** A reference to the trigger element. */
71
- readonly element: HTMLElement;
72
- /** The parent AccordionGroup. */
73
- private readonly _accordionGroup;
74
- /** A unique identifier for the widget. */
75
- readonly id: _angular_core.InputSignal<string>;
76
- /** A local unique identifier for the trigger, used to match with its panel's `panelId`. */
77
- readonly panelId: _angular_core.InputSignal<string>;
78
- /** Whether the trigger is disabled. */
79
- readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
80
- /** Whether the corresponding panel is expanded. */
81
- readonly expanded: _angular_core.ModelSignal<boolean>;
82
- /** Whether the trigger is active. */
83
- readonly active: _angular_core.Signal<boolean>;
84
- /** The accordion panel pattern controlled by this trigger. This is set by AccordionGroup. */
85
- readonly _accordionPanelPattern: WritableSignal<AccordionPanelPattern | undefined>;
86
- /** The UI pattern instance for this trigger. */
87
- readonly _pattern: AccordionTriggerPattern;
88
- /** Expands this item. */
89
- expand(): void;
90
- /** Collapses this item. */
91
- collapse(): void;
92
- /** Toggles the expansion state of this item. */
93
- toggle(): void;
94
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionTrigger, never>;
95
- 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>;
96
- }
50
+
97
51
  /**
98
52
  * A container for a group of accordion items. It manages the overall state and
99
53
  * interactions of the accordion, such as keyboard navigation and expansion mode.
@@ -141,7 +95,7 @@ declare class AccordionGroup {
141
95
  /** The AccordionPanels nested inside this group. */
142
96
  private readonly _panels;
143
97
  /** The text direction (ltr or rtl). */
144
- readonly textDirection: WritableSignal<_angular_cdk_bidi.Direction>;
98
+ readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
145
99
  /** Whether the entire accordion group is disabled. */
146
100
  readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
147
101
  /** Whether multiple accordion items can be expanded simultaneously. */
@@ -165,6 +119,55 @@ declare class AccordionGroup {
165
119
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionGroup, never>;
166
120
  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>;
167
121
  }
122
+
123
+ /**
124
+ * The trigger that toggles the visibility of its associated `ngAccordionPanel`.
125
+ *
126
+ * This directive requires a `panelId` that must match the `panelId` of the `ngAccordionPanel` it
127
+ * controls. When clicked, it will expand or collapse the panel. It also handles keyboard
128
+ * interactions for navigation within the `ngAccordionGroup`. It applies `role="button"` and manages
129
+ * `aria-expanded`, `aria-controls`, and `aria-disabled` attributes for accessibility.
130
+ * The `disabled` input can be used to disable the trigger.
131
+ *
132
+ * ```html
133
+ * <button ngAccordionTrigger panelId="unique-id-1">
134
+ * Accordion Trigger Text
135
+ * </button>
136
+ * ```
137
+ *
138
+ * @developerPreview 21.0
139
+ */
140
+ declare class AccordionTrigger {
141
+ /** A reference to the trigger element. */
142
+ private readonly _elementRef;
143
+ /** A reference to the trigger element. */
144
+ readonly element: HTMLElement;
145
+ /** The parent AccordionGroup. */
146
+ private readonly _accordionGroup;
147
+ /** A unique identifier for the widget. */
148
+ readonly id: _angular_core.InputSignal<string>;
149
+ /** A local unique identifier for the trigger, used to match with its panel's `panelId`. */
150
+ readonly panelId: _angular_core.InputSignal<string>;
151
+ /** Whether the trigger is disabled. */
152
+ readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
153
+ /** Whether the corresponding panel is expanded. */
154
+ readonly expanded: _angular_core.ModelSignal<boolean>;
155
+ /** Whether the trigger is active. */
156
+ readonly active: _angular_core.Signal<boolean>;
157
+ /** The accordion panel pattern controlled by this trigger. This is set by AccordionGroup. */
158
+ readonly _accordionPanelPattern: WritableSignal<AccordionPanelPattern | undefined>;
159
+ /** The UI pattern instance for this trigger. */
160
+ readonly _pattern: AccordionTriggerPattern;
161
+ /** Expands this item. */
162
+ expand(): void;
163
+ /** Collapses this item. */
164
+ collapse(): void;
165
+ /** Toggles the expansion state of this item. */
166
+ toggle(): void;
167
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AccordionTrigger, never>;
168
+ 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>;
169
+ }
170
+
168
171
  /**
169
172
  * A structural directive that provides a mechanism for lazily rendering the content for an
170
173
  * `ngAccordionPanel`.
@@ -1,81 +1,42 @@
1
+ import { Combobox, ComboboxPopup } from './_combobox-chunk.js';
2
+ import { ComboboxDialogPattern } from './_combobox-chunk.d2.ts';
1
3
  import * as _angular_core from '@angular/core';
2
- import { WritableSignal } from '@angular/core';
3
- import * as _angular_cdk_bidi from '@angular/cdk/bidi';
4
4
  import * as i1 from '@angular/aria/private';
5
- import { ComboboxPattern, ComboboxDialogPattern, ComboboxListboxControls, ComboboxTreeControls } from '@angular/aria/private';
5
+ import '@angular/cdk/bidi';
6
+ import './_list-navigation-chunk.js';
7
+ import './_list-chunk.js';
6
8
 
7
9
  /**
8
- * The container element that wraps a combobox input and popup, and orchestrates its behavior.
9
- *
10
- * The `ngCombobox` directive is the main entry point for creating a combobox and customizing its
11
- * behavior. It coordinates the interactions between the `ngComboboxInput` and the popup, which
12
- * is defined by a `ng-template` with the `ngComboboxPopupContainer` directive. If using the
13
- * `CdkOverlay`, the `cdkConnectedOverlay` directive takes the place of `ngComboboxPopupContainer`.
10
+ * Integrates a native `<dialog>` element with the combobox, allowing for
11
+ * a modal or non-modal popup experience. It handles the opening and closing of the dialog
12
+ * based on the combobox's expanded state.
14
13
  *
15
14
  * ```html
16
- * <div ngCombobox filterMode="highlight">
17
- * <input
18
- * ngComboboxInput
19
- * placeholder="Search for a state..."
20
- * [(value)]="searchString"
21
- * />
22
- *
23
- * <ng-template ngComboboxPopupContainer>
24
- * <div ngListbox [(value)]="selectedValue">
25
- * @for (option of filteredOptions(); track option) {
26
- * <div ngOption [value]="option" [label]="option">
27
- * <span>{{option}}</span>
28
- * </div>
29
- * }
30
- * </div>
31
- * </ng-template>
32
- * </div>
15
+ * <ng-template ngComboboxPopupContainer>
16
+ * <dialog ngComboboxDialog class="example-dialog">
17
+ * <!-- ... dialog content ... -->
18
+ * </dialog>
19
+ * </ng-template>
33
20
  * ```
34
21
  *
35
22
  * @developerPreview 21.0
36
23
  */
37
- declare class Combobox<V> {
38
- /** The directionality (LTR / RTL) context for the application (or a subtree of it). */
39
- private readonly _directionality;
40
- /** A signal wrapper for directionality. */
41
- protected textDirection: _angular_core.Signal<_angular_cdk_bidi.Direction>;
42
- /** The element that the combobox is attached to. */
24
+ declare class ComboboxDialog {
25
+ /** The dialog element. */
43
26
  private readonly _elementRef;
44
- /** A reference to the combobox element. */
27
+ /** A reference to the dialog element. */
45
28
  readonly element: HTMLElement;
46
- /** The DeferredContentAware host directive. */
47
- private readonly _deferredContentAware;
48
- /** The combobox popup. */
49
- readonly popup: _angular_core.Signal<ComboboxPopup<V> | undefined>;
50
- /**
51
- * The filter mode for the combobox.
52
- * - `manual`: The consumer is responsible for filtering the options.
53
- * - `auto-select`: The combobox automatically selects the first matching option.
54
- * - `highlight`: The combobox highlights matching text in the options without changing selection.
55
- */
56
- filterMode: _angular_core.InputSignal<"manual" | "auto-select" | "highlight">;
57
- /** Whether the combobox is disabled. */
58
- readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
59
- /** Whether the combobox is read-only. */
60
- readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
61
- /** The value of the first matching item in the popup. */
62
- readonly firstMatch: _angular_core.InputSignal<V | undefined>;
63
- /** Whether the combobox is expanded. */
64
- readonly expanded: _angular_core.Signal<boolean>;
65
- /** Whether the combobox popup should always be expanded, regardless of user interaction. */
66
- readonly alwaysExpanded: _angular_core.InputSignalWithTransform<boolean, unknown>;
67
- /** Input element connected to the combobox, if any. */
68
- readonly inputElement: _angular_core.Signal<HTMLInputElement | undefined>;
69
- /** The combobox ui pattern. */
70
- readonly _pattern: ComboboxPattern<any, V>;
29
+ /** The combobox that the dialog belongs to. */
30
+ readonly combobox: Combobox<any>;
31
+ /** A reference to the parent combobox popup, if one exists. */
32
+ private readonly _popup;
33
+ _pattern: ComboboxDialogPattern;
71
34
  constructor();
72
- /** Opens the combobox to the selected item. */
73
- open(): void;
74
- /** Closes the combobox. */
75
35
  close(): void;
76
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<Combobox<any>, never>;
77
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Combobox<any>, "[ngCombobox]", ["ngCombobox"], { "filterMode": { "alias": "filterMode"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "firstMatch": { "alias": "firstMatch"; "required": false; "isSignal": true; }; "alwaysExpanded": { "alias": "alwaysExpanded"; "required": false; "isSignal": true; }; }, {}, ["popup"], never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
36
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxDialog, never>;
37
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxDialog, "dialog[ngComboboxDialog]", ["ngComboboxDialog"], {}, {}, never, never, true, [{ directive: typeof ComboboxPopup; inputs: {}; outputs: {}; }]>;
78
38
  }
39
+
79
40
  /**
80
41
  * An input that is part of a combobox. It is responsible for displaying the
81
42
  * current value and handling user input for filtering and selection.
@@ -107,6 +68,7 @@ declare class ComboboxInput {
107
68
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxInput, never>;
108
69
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxInput, "input[ngComboboxInput]", ["ngComboboxInput"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
109
70
  }
71
+
110
72
  /**
111
73
  * A structural directive that marks the `ng-template` to be used as the popup
112
74
  * for a combobox. This content is conditionally rendered.
@@ -141,53 +103,5 @@ declare class ComboboxPopupContainer {
141
103
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxPopupContainer, never>;
142
104
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxPopupContainer, "ng-template[ngComboboxPopupContainer]", ["ngComboboxPopupContainer"], {}, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
143
105
  }
144
- /**
145
- * Identifies an element as a popup for an `ngCombobox`.
146
- *
147
- * This directive acts as a bridge, allowing the `ngCombobox` to discover and interact
148
- * with the underlying control (e.g., `ngListbox`, `ngTree`, or `ngComboboxDialog`) that
149
- * manages the options. It's primarily used as a host directive and is responsible for
150
- * exposing the popup's control pattern to the parent combobox.
151
- *
152
- * @developerPreview 21.0
153
- */
154
- declare class ComboboxPopup<V> {
155
- /** The combobox that the popup belongs to. */
156
- readonly combobox: Combobox<V> | null;
157
- /** The popup controls exposed to the combobox. */
158
- readonly _controls: WritableSignal<ComboboxDialogPattern | ComboboxListboxControls<any, V> | ComboboxTreeControls<any, V> | undefined>;
159
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxPopup<any>, never>;
160
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxPopup<any>, "[ngComboboxPopup]", ["ngComboboxPopup"], {}, {}, never, never, true, never>;
161
- }
162
- /**
163
- * Integrates a native `<dialog>` element with the combobox, allowing for
164
- * a modal or non-modal popup experience. It handles the opening and closing of the dialog
165
- * based on the combobox's expanded state.
166
- *
167
- * ```html
168
- * <ng-template ngComboboxPopupContainer>
169
- * <dialog ngComboboxDialog class="example-dialog">
170
- * <!-- ... dialog content ... -->
171
- * </dialog>
172
- * </ng-template>
173
- * ```
174
- *
175
- * @developerPreview 21.0
176
- */
177
- declare class ComboboxDialog {
178
- /** The dialog element. */
179
- private readonly _elementRef;
180
- /** A reference to the dialog element. */
181
- readonly element: HTMLElement;
182
- /** The combobox that the dialog belongs to. */
183
- readonly combobox: Combobox<any>;
184
- /** A reference to the parent combobox popup, if one exists. */
185
- private readonly _popup;
186
- _pattern: ComboboxDialogPattern;
187
- constructor();
188
- close(): void;
189
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ComboboxDialog, never>;
190
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ComboboxDialog, "dialog[ngComboboxDialog]", ["ngComboboxDialog"], {}, {}, never, never, true, [{ directive: typeof ComboboxPopup; inputs: {}; outputs: {}; }]>;
191
- }
192
106
 
193
107
  export { Combobox, ComboboxDialog, ComboboxInput, ComboboxPopup, ComboboxPopupContainer };