@angular/aria 0.0.1 → 21.0.0-next.10

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 (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -0
  3. package/fesm2022/_widget-chunk.mjs +990 -0
  4. package/fesm2022/_widget-chunk.mjs.map +1 -0
  5. package/fesm2022/accordion.mjs +192 -0
  6. package/fesm2022/accordion.mjs.map +1 -0
  7. package/fesm2022/aria.mjs +7 -0
  8. package/fesm2022/aria.mjs.map +1 -0
  9. package/fesm2022/combobox.mjs +145 -0
  10. package/fesm2022/combobox.mjs.map +1 -0
  11. package/fesm2022/deferred-content.mjs +60 -0
  12. package/fesm2022/deferred-content.mjs.map +1 -0
  13. package/fesm2022/grid.mjs +213 -0
  14. package/fesm2022/grid.mjs.map +1 -0
  15. package/fesm2022/listbox.mjs +200 -0
  16. package/fesm2022/listbox.mjs.map +1 -0
  17. package/fesm2022/menu.mjs +302 -0
  18. package/fesm2022/menu.mjs.map +1 -0
  19. package/fesm2022/radio-group.mjs +197 -0
  20. package/fesm2022/radio-group.mjs.map +1 -0
  21. package/fesm2022/tabs.mjs +299 -0
  22. package/fesm2022/tabs.mjs.map +1 -0
  23. package/fesm2022/toolbar.mjs +218 -0
  24. package/fesm2022/toolbar.mjs.map +1 -0
  25. package/fesm2022/tree.mjs +288 -0
  26. package/fesm2022/tree.mjs.map +1 -0
  27. package/fesm2022/ui-patterns.mjs +2951 -0
  28. package/fesm2022/ui-patterns.mjs.map +1 -0
  29. package/package.json +86 -3
  30. package/types/_grid-chunk.d.ts +546 -0
  31. package/types/accordion.d.ts +92 -0
  32. package/types/aria.d.ts +6 -0
  33. package/types/combobox.d.ts +60 -0
  34. package/types/deferred-content.d.ts +38 -0
  35. package/types/grid.d.ts +111 -0
  36. package/types/listbox.d.ts +95 -0
  37. package/types/menu.d.ts +158 -0
  38. package/types/radio-group.d.ts +82 -0
  39. package/types/tabs.d.ts +156 -0
  40. package/types/toolbar.d.ts +113 -0
  41. package/types/tree.d.ts +135 -0
  42. package/types/ui-patterns.d.ts +1604 -0
@@ -0,0 +1,1604 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+ import { SignalLike, WritableSignalLike, KeyboardEventManager, PointerEventManager } from './_grid-chunk.js';
4
+ export { GridCellInputs, GridCellPattern, GridCellWidgetInputs, GridCellWidgetPattern, GridInputs, GridPattern, GridRowInputs, GridRowPattern, convertGetterSetterToWritableSignalLike } from './_grid-chunk.js';
5
+
6
+ /** Represents an item in a collection, such as a listbox option, than may receive focus. */
7
+ interface ListFocusItem {
8
+ /** A unique identifier for the item. */
9
+ id: SignalLike<string>;
10
+ /** The html element that should receive focus. */
11
+ element: SignalLike<HTMLElement>;
12
+ /** Whether an item is disabled. */
13
+ disabled: SignalLike<boolean>;
14
+ /** The index of the item in the list. */
15
+ index: SignalLike<number>;
16
+ }
17
+ /** Represents the required inputs for a collection that contains focusable items. */
18
+ interface ListFocusInputs<T extends ListFocusItem> {
19
+ /** The focus strategy used by the list. */
20
+ focusMode: SignalLike<'roving' | 'activedescendant'>;
21
+ /** Whether the list is disabled. */
22
+ disabled: SignalLike<boolean>;
23
+ /** The items in the list. */
24
+ items: SignalLike<T[]>;
25
+ /** The active item. */
26
+ activeItem: WritableSignalLike<T | undefined>;
27
+ /** Whether disabled items in the list should be skipped when navigating. */
28
+ skipDisabled: SignalLike<boolean>;
29
+ element: SignalLike<HTMLElement | undefined>;
30
+ }
31
+ /** Controls focus for a list of items. */
32
+ declare class ListFocus<T extends ListFocusItem> {
33
+ readonly inputs: ListFocusInputs<T>;
34
+ /** The last item that was active. */
35
+ prevActiveItem: _angular_core.WritableSignal<T | undefined>;
36
+ /** The index of the last item that was active. */
37
+ prevActiveIndex: _angular_core.Signal<number>;
38
+ /** The current active index in the list. */
39
+ activeIndex: _angular_core.Signal<number>;
40
+ constructor(inputs: ListFocusInputs<T>);
41
+ /** Whether the list is in a disabled state. */
42
+ isListDisabled(): boolean;
43
+ /** The id of the current active item. */
44
+ getActiveDescendant(): string | undefined;
45
+ /** The tabindex for the list. */
46
+ getListTabindex(): -1 | 0;
47
+ /** Returns the tabindex for the given item. */
48
+ getItemTabindex(item: T): -1 | 0;
49
+ /** Moves focus to the given item if it is focusable. */
50
+ focus(item: T, opts?: {
51
+ focusElement?: boolean;
52
+ }): boolean;
53
+ /** Returns true if the given item can be navigated to. */
54
+ isFocusable(item: T): boolean;
55
+ }
56
+
57
+ /** Represents an item in a collection, such as a listbox option, than can be navigated to. */
58
+ interface ListNavigationItem extends ListFocusItem {
59
+ }
60
+ /** Represents the required inputs for a collection that has navigable items. */
61
+ interface ListNavigationInputs<T extends ListNavigationItem> extends ListFocusInputs<T> {
62
+ /** Whether focus should wrap when navigating. */
63
+ wrap: SignalLike<boolean>;
64
+ /** Whether the list is vertically or horizontally oriented. */
65
+ orientation: SignalLike<'vertical' | 'horizontal'>;
66
+ /** The direction that text is read based on the users locale. */
67
+ textDirection: SignalLike<'rtl' | 'ltr'>;
68
+ }
69
+ /** Controls navigation for a list of items. */
70
+ declare class ListNavigation<T extends ListNavigationItem> {
71
+ readonly inputs: ListNavigationInputs<T> & {
72
+ focusManager: ListFocus<T>;
73
+ };
74
+ constructor(inputs: ListNavigationInputs<T> & {
75
+ focusManager: ListFocus<T>;
76
+ });
77
+ /** Navigates to the given item. */
78
+ goto(item?: T, opts?: {
79
+ focusElement?: boolean;
80
+ }): boolean;
81
+ /** Navigates to the next item in the list. */
82
+ next(opts?: {
83
+ focusElement?: boolean;
84
+ }): boolean;
85
+ /** Peeks the next item in the list. */
86
+ peekNext(): T | undefined;
87
+ /** Navigates to the previous item in the list. */
88
+ prev(opts?: {
89
+ focusElement?: boolean;
90
+ }): boolean;
91
+ /** Peeks the previous item in the list. */
92
+ peekPrev(): T | undefined;
93
+ /** Navigates to the first item in the list. */
94
+ first(opts?: {
95
+ focusElement?: boolean;
96
+ }): boolean;
97
+ /** Navigates to the last item in the list. */
98
+ last(opts?: {
99
+ focusElement?: boolean;
100
+ }): boolean;
101
+ /** Advances to the next or previous focusable item in the list based on the given delta. */
102
+ private _advance;
103
+ /** Peeks the next or previous focusable item in the list based on the given delta. */
104
+ private _peek;
105
+ }
106
+
107
+ /** Represents an item in a collection, such as a listbox option, than can be selected. */
108
+ interface ListSelectionItem<V> extends ListFocusItem {
109
+ /** The value of the item. */
110
+ value: SignalLike<V>;
111
+ /** Whether the item is selectable. */
112
+ selectable: SignalLike<boolean>;
113
+ }
114
+ /** Represents the required inputs for a collection that contains selectable items. */
115
+ interface ListSelectionInputs<T extends ListSelectionItem<V>, V> extends ListFocusInputs<T> {
116
+ /** Whether multiple items in the list can be selected at once. */
117
+ multi: SignalLike<boolean>;
118
+ /** The current value of the list selection. */
119
+ value: WritableSignalLike<V[]>;
120
+ /** The selection strategy used by the list. */
121
+ selectionMode: SignalLike<'follow' | 'explicit'>;
122
+ }
123
+ /** Controls selection for a list of items. */
124
+ declare class ListSelection<T extends ListSelectionItem<V>, V> {
125
+ readonly inputs: ListSelectionInputs<T, V> & {
126
+ focusManager: ListFocus<T>;
127
+ };
128
+ /** The start index to use for range selection. */
129
+ rangeStartIndex: _angular_core.WritableSignal<number>;
130
+ /** The end index to use for range selection. */
131
+ rangeEndIndex: _angular_core.WritableSignal<number>;
132
+ /** The currently selected items. */
133
+ selectedItems: _angular_core.Signal<T[]>;
134
+ constructor(inputs: ListSelectionInputs<T, V> & {
135
+ focusManager: ListFocus<T>;
136
+ });
137
+ /** Selects the item at the current active index. */
138
+ select(item?: ListSelectionItem<V>, opts?: {
139
+ anchor: boolean;
140
+ }): void;
141
+ /** Deselects the item at the current active index. */
142
+ deselect(item?: T | null): void;
143
+ /** Toggles the item at the current active index. */
144
+ toggle(): void;
145
+ /** Toggles only the item at the current active index. */
146
+ toggleOne(): void;
147
+ /** Selects all items in the list. */
148
+ selectAll(): void;
149
+ /** Deselects all items in the list. */
150
+ deselectAll(): void;
151
+ /**
152
+ * Selects all items in the list or deselects all
153
+ * items in the list if all items are already selected.
154
+ */
155
+ toggleAll(): void;
156
+ /** Sets the selection to only the current active item. */
157
+ selectOne(): void;
158
+ /**
159
+ * Selects all items in the list up to the anchor item.
160
+ *
161
+ * Deselects all items that were previously within the
162
+ * selected range that are now outside of the selected range
163
+ */
164
+ selectRange(opts?: {
165
+ anchor: boolean;
166
+ }): void;
167
+ /** Marks the given index as the start of a range selection. */
168
+ beginRangeSelection(index?: number): void;
169
+ /** Returns the items in the list starting from the given index. */
170
+ private _getItemsFromIndex;
171
+ }
172
+
173
+ /**
174
+ * Represents an item in a collection, such as a listbox option, than can be navigated to by
175
+ * typeahead.
176
+ */
177
+ interface ListTypeaheadItem extends ListFocusItem {
178
+ /** The text used by the typeahead search. */
179
+ searchTerm: SignalLike<string>;
180
+ }
181
+ /**
182
+ * Represents the required inputs for a collection that contains items that can be navigated to by
183
+ * typeahead.
184
+ */
185
+ interface ListTypeaheadInputs<T extends ListTypeaheadItem> extends ListFocusInputs<T> {
186
+ /** The amount of time before the typeahead search is reset. */
187
+ typeaheadDelay: SignalLike<number>;
188
+ }
189
+ /** Controls typeahead for a list of items. */
190
+ declare class ListTypeahead<T extends ListTypeaheadItem> {
191
+ readonly inputs: ListTypeaheadInputs<T> & {
192
+ focusManager: ListFocus<T>;
193
+ };
194
+ /** A reference to the timeout for resetting the typeahead search. */
195
+ timeout?: ReturnType<typeof setTimeout> | undefined;
196
+ /** The focus controller of the parent list. */
197
+ focusManager: ListFocus<T>;
198
+ /** Whether the user is actively typing a typeahead search query. */
199
+ isTyping: _angular_core.Signal<boolean>;
200
+ /** Keeps track of the characters that typeahead search is being called with. */
201
+ private _query;
202
+ /** The index where that the typeahead search was initiated from. */
203
+ private _startIndex;
204
+ constructor(inputs: ListTypeaheadInputs<T> & {
205
+ focusManager: ListFocus<T>;
206
+ });
207
+ /** Performs a typeahead search, appending the given character to the search string. */
208
+ search(char: string): boolean;
209
+ /**
210
+ * Returns the first item whose search term matches the
211
+ * current query starting from the the current anchor index.
212
+ */
213
+ private _getItem;
214
+ }
215
+
216
+ /** The operations that the list can perform after navigation. */
217
+ interface NavOptions {
218
+ toggle?: boolean;
219
+ select?: boolean;
220
+ selectOne?: boolean;
221
+ selectRange?: boolean;
222
+ anchor?: boolean;
223
+ focusElement?: boolean;
224
+ }
225
+ /** Represents an item in the list. */
226
+ type ListItem<V> = ListTypeaheadItem & ListNavigationItem & ListSelectionItem<V> & ListFocusItem;
227
+ /** The necessary inputs for the list behavior. */
228
+ type ListInputs<T extends ListItem<V>, V> = ListFocusInputs<T> & ListNavigationInputs<T> & ListSelectionInputs<T, V> & ListTypeaheadInputs<T>;
229
+ /** Controls the state of a list. */
230
+ declare class List<T extends ListItem<V>, V> {
231
+ readonly inputs: ListInputs<T, V>;
232
+ /** Controls navigation for the list. */
233
+ navigationBehavior: ListNavigation<T>;
234
+ /** Controls selection for the list. */
235
+ selectionBehavior: ListSelection<T, V>;
236
+ /** Controls typeahead for the list. */
237
+ typeaheadBehavior: ListTypeahead<T>;
238
+ /** Controls focus for the list. */
239
+ focusBehavior: ListFocus<T>;
240
+ /** Whether the list is disabled. */
241
+ disabled: _angular_core.Signal<boolean>;
242
+ /** The id of the current active item. */
243
+ activedescendant: _angular_core.Signal<string | undefined>;
244
+ /** The tabindex of the list. */
245
+ tabindex: _angular_core.Signal<0 | -1>;
246
+ /** The index of the currently active item in the list. */
247
+ activeIndex: _angular_core.Signal<number>;
248
+ /**
249
+ * The uncommitted index for selecting a range of options.
250
+ *
251
+ * NOTE: This is subtly distinct from the "rangeStartIndex" in the ListSelection behavior.
252
+ * The anchorIndex does not necessarily represent the start of a range, but represents the most
253
+ * recent index where the user showed intent to begin a range selection. Usually, this is wherever
254
+ * the user most recently pressed the "Shift" key, but if the user presses shift + space to select
255
+ * from the anchor, the user is not intending to start a new range from this index.
256
+ *
257
+ * In other words, "rangeStartIndex" is only set when a user commits to starting a range selection
258
+ * while "anchorIndex" is set whenever a user indicates they may be starting a range selection.
259
+ */
260
+ private _anchorIndex;
261
+ /** Whether the list should wrap. Used to disable wrapping while range selecting. */
262
+ private _wrap;
263
+ constructor(inputs: ListInputs<T, V>);
264
+ /** Returns the tabindex for the given item. */
265
+ getItemTabindex(item: T): 0 | -1;
266
+ /** Navigates to the first option in the list. */
267
+ first(opts?: NavOptions): void;
268
+ /** Navigates to the last option in the list. */
269
+ last(opts?: NavOptions): void;
270
+ /** Navigates to the next option in the list. */
271
+ next(opts?: NavOptions): void;
272
+ /** Navigates to the previous option in the list. */
273
+ prev(opts?: NavOptions): void;
274
+ /** Navigates to the given item in the list. */
275
+ goto(item: T, opts?: NavOptions): void;
276
+ /** Removes focus from the list. */
277
+ unfocus(): void;
278
+ /** Marks the given index as the potential start of a range selection. */
279
+ anchor(index: number): void;
280
+ /** Handles typeahead search navigation for the list. */
281
+ search(char: string, opts?: NavOptions): void;
282
+ /** Checks if the list is currently typing for typeahead search. */
283
+ isTyping(): boolean;
284
+ /** Selects the currently active item in the list. */
285
+ select(item?: T): void;
286
+ /** Sets the selection to only the current active item. */
287
+ selectOne(): void;
288
+ /** Deselects the currently active item in the list. */
289
+ deselect(): void;
290
+ /** Deselects all items in the list. */
291
+ deselectAll(): void;
292
+ /** Toggles the currently active item in the list. */
293
+ toggle(): void;
294
+ /** Toggles the currently active item in the list, deselecting all other items. */
295
+ toggleOne(): void;
296
+ /** Toggles the selection of all items in the list. */
297
+ toggleAll(): void;
298
+ /** Checks if the given item is able to receive focus. */
299
+ isFocusable(item: T): boolean;
300
+ /** Handles updating selection for the list. */
301
+ updateSelection(opts?: NavOptions): void;
302
+ /**
303
+ * Safely performs a navigation operation.
304
+ *
305
+ * Handles conditionally disabling wrapping for when a navigation
306
+ * operation is occurring while the user is selecting a range of options.
307
+ *
308
+ * Handles boilerplate calling of focus & selection operations. Also ensures these
309
+ * additional operations are only called if the navigation operation moved focus to a new option.
310
+ */
311
+ private _navigate;
312
+ }
313
+
314
+ /** Represents the required inputs for a combobox. */
315
+ interface ComboboxInputs<T extends ListItem<V>, V> {
316
+ /** The controls for the popup associated with the combobox. */
317
+ popupControls: SignalLike<ComboboxListboxControls<T, V> | ComboboxTreeControls<T, V> | undefined>;
318
+ /** The HTML input element that serves as the combobox input. */
319
+ inputEl: SignalLike<HTMLInputElement | undefined>;
320
+ /** The HTML element that serves as the combobox container. */
321
+ containerEl: SignalLike<HTMLElement | undefined>;
322
+ /** The filtering mode for the combobox. */
323
+ filterMode: SignalLike<'manual' | 'auto-select' | 'highlight'>;
324
+ /** The current value of the combobox. */
325
+ inputValue?: WritableSignalLike<string>;
326
+ /** The value of the first matching item in the popup. */
327
+ firstMatch: SignalLike<V | undefined>;
328
+ /** Whether the combobox is disabled. */
329
+ disabled: SignalLike<boolean>;
330
+ /** Whether the combobox is read-only. */
331
+ readonly: SignalLike<boolean>;
332
+ /** Whether the combobox is in a right-to-left context. */
333
+ textDirection: SignalLike<'rtl' | 'ltr'>;
334
+ }
335
+ /** An interface that allows combobox popups to expose the necessary controls for the combobox. */
336
+ interface ComboboxListboxControls<T extends ListItem<V>, V> {
337
+ /** A unique identifier for the popup. */
338
+ id: () => string;
339
+ /** The ARIA role for the popup. */
340
+ role: SignalLike<'listbox' | 'tree' | 'grid'>;
341
+ /** The ID of the active item in the popup. */
342
+ activeId: SignalLike<string | undefined>;
343
+ /** The list of items in the popup. */
344
+ items: SignalLike<T[]>;
345
+ /** Navigates to the given item in the popup. */
346
+ focus: (item: T) => void;
347
+ /** Navigates to the next item in the popup. */
348
+ next: () => void;
349
+ /** Navigates to the previous item in the popup. */
350
+ prev: () => void;
351
+ /** Navigates to the first item in the popup. */
352
+ first: () => void;
353
+ /** Navigates to the last item in the popup. */
354
+ last: () => void;
355
+ /** Selects the current item in the popup. */
356
+ select: (item?: T) => void;
357
+ /** Clears the selection state of the popup. */
358
+ clearSelection: () => void;
359
+ /** Removes focus from any item in the popup. */
360
+ unfocus: () => void;
361
+ /** Returns the item corresponding to the given event. */
362
+ getItem: (e: PointerEvent) => T | undefined;
363
+ /** Returns the currently selected item in the popup. */
364
+ getSelectedItem: () => T | undefined;
365
+ /** Sets the value of the combobox based on the selected item. */
366
+ setValue: (value: V | undefined) => void;
367
+ }
368
+ interface ComboboxTreeControls<T extends ListItem<V>, V> extends ComboboxListboxControls<T, V> {
369
+ /** Whether the currently active item in the popup is collapsible. */
370
+ isItemCollapsible: () => boolean;
371
+ /** Expands the currently active item in the popup. */
372
+ expandItem: () => void;
373
+ /** Collapses the currently active item in the popup. */
374
+ collapseItem: () => void;
375
+ /** Checks if the currently active item in the popup is expandable. */
376
+ isItemExpandable: () => boolean;
377
+ /** Expands all nodes in the tree. */
378
+ expandAll: () => void;
379
+ /** Collapses all nodes in the tree. */
380
+ collapseAll: () => void;
381
+ }
382
+ /** Controls the state of a combobox. */
383
+ declare class ComboboxPattern<T extends ListItem<V>, V> {
384
+ readonly inputs: ComboboxInputs<T, V>;
385
+ /** Whether the combobox is expanded. */
386
+ expanded: _angular_core.WritableSignal<boolean>;
387
+ /** The ID of the active item in the combobox. */
388
+ activedescendant: _angular_core.Signal<string | null>;
389
+ /** The currently highlighted item in the combobox. */
390
+ highlightedItem: _angular_core.WritableSignal<T | undefined>;
391
+ /** Whether the most recent input event was a deletion. */
392
+ isDeleting: boolean;
393
+ /** Whether the combobox is focused. */
394
+ isFocused: _angular_core.WritableSignal<boolean>;
395
+ /** The key used to navigate to the previous item in the list. */
396
+ expandKey: _angular_core.Signal<"ArrowLeft" | "ArrowRight">;
397
+ /** The key used to navigate to the next item in the list. */
398
+ collapseKey: _angular_core.Signal<"ArrowLeft" | "ArrowRight">;
399
+ /** The ID of the popup associated with the combobox. */
400
+ popupId: _angular_core.Signal<string | null>;
401
+ /** The autocomplete behavior of the combobox. */
402
+ autocomplete: _angular_core.Signal<"both" | "list">;
403
+ /** The ARIA role of the popup associated with the combobox. */
404
+ hasPopup: _angular_core.Signal<"listbox" | "tree" | "grid" | null>;
405
+ /** Whether the combobox is interactive. */
406
+ isInteractive: _angular_core.Signal<boolean>;
407
+ /** The keydown event manager for the combobox. */
408
+ keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
409
+ /** The pointerup event manager for the combobox. */
410
+ pointerup: _angular_core.Signal<PointerEventManager<PointerEvent>>;
411
+ constructor(inputs: ComboboxInputs<T, V>);
412
+ /** Handles keydown events for the combobox. */
413
+ onKeydown(event: KeyboardEvent): void;
414
+ /** Handles pointerup events for the combobox. */
415
+ onPointerup(event: PointerEvent): void;
416
+ /** Handles input events for the combobox. */
417
+ onInput(event: Event): void;
418
+ /** Handles focus in events for the combobox. */
419
+ onFocusIn(): void;
420
+ /** Handles focus out events for the combobox. */
421
+ onFocusOut(event: FocusEvent): void;
422
+ /** The first matching item in the combobox. */
423
+ firstMatch: _angular_core.Signal<T | undefined>;
424
+ /** Handles filtering logic for the combobox. */
425
+ onFilter(): void;
426
+ /** Highlights the currently selected item in the combobox. */
427
+ highlight(): void;
428
+ /** Closes the combobox. */
429
+ close(): void;
430
+ /** Opens the combobox. */
431
+ open(nav?: {
432
+ first?: boolean;
433
+ last?: boolean;
434
+ }): void;
435
+ /** Navigates to the next focusable item in the combobox popup. */
436
+ next(): void;
437
+ /** Navigates to the previous focusable item in the combobox popup. */
438
+ prev(): void;
439
+ /** Navigates to the first focusable item in the combobox popup. */
440
+ first(): void;
441
+ /** Navigates to the last focusable item in the combobox popup. */
442
+ last(): void;
443
+ /** Collapses the currently focused item in the combobox. */
444
+ collapseItem(): void;
445
+ /** Expands the currently focused item in the combobox. */
446
+ expandItem(): void;
447
+ /** Selects an item in the combobox popup. */
448
+ select(opts?: {
449
+ item?: T;
450
+ commit?: boolean;
451
+ close?: boolean;
452
+ }): void;
453
+ /** Updates the value of the input based on the currently selected item. */
454
+ commit(): void;
455
+ /** Navigates and handles additional actions based on filter mode. */
456
+ private _navigate;
457
+ }
458
+
459
+ /**
460
+ * Represents the properties exposed by a listbox that need to be accessed by an option.
461
+ * This exists to avoid circular dependency errors between the listbox and option.
462
+ */
463
+ interface ListboxPattern$1<V> {
464
+ inputs: ListInputs<OptionPattern<V>, V>;
465
+ listBehavior: List<OptionPattern<V>, V>;
466
+ }
467
+ /** Represents the required inputs for an option in a listbox. */
468
+ interface OptionInputs<V> extends Omit<ListItem<V>, 'index' | 'selectable'> {
469
+ listbox: SignalLike<ListboxPattern$1<V> | undefined>;
470
+ }
471
+ /** Represents an option in a listbox. */
472
+ declare class OptionPattern<V> {
473
+ /** A unique identifier for the option. */
474
+ id: SignalLike<string>;
475
+ /** The value of the option. */
476
+ value: SignalLike<V>;
477
+ /** The position of the option in the list. */
478
+ index: _angular_core.Signal<number>;
479
+ /** Whether the option is active. */
480
+ active: _angular_core.Signal<boolean>;
481
+ /** Whether the option is selected. */
482
+ selected: _angular_core.Signal<boolean | undefined>;
483
+ /** Whether the option is selectable. */
484
+ selectable: () => boolean;
485
+ /** Whether the option is disabled. */
486
+ disabled: SignalLike<boolean>;
487
+ /** The text used by the typeahead search. */
488
+ searchTerm: SignalLike<string>;
489
+ /** A reference to the parent listbox. */
490
+ listbox: SignalLike<ListboxPattern$1<V> | undefined>;
491
+ /** The tabindex of the option. */
492
+ tabindex: _angular_core.Signal<0 | -1 | undefined>;
493
+ /** The html element that should receive focus. */
494
+ element: SignalLike<HTMLElement>;
495
+ constructor(args: OptionInputs<V>);
496
+ }
497
+
498
+ /** Represents the required inputs for a listbox. */
499
+ type ListboxInputs<V> = ListInputs<OptionPattern<V>, V> & {
500
+ /** A unique identifier for the listbox. */
501
+ id: SignalLike<string>;
502
+ /** Whether the listbox is readonly. */
503
+ readonly: SignalLike<boolean>;
504
+ };
505
+ /** Controls the state of a listbox. */
506
+ declare class ListboxPattern<V> {
507
+ readonly inputs: ListboxInputs<V>;
508
+ listBehavior: List<OptionPattern<V>, V>;
509
+ /** Whether the list is vertically or horizontally oriented. */
510
+ orientation: SignalLike<'vertical' | 'horizontal'>;
511
+ /** Whether the listbox is disabled. */
512
+ disabled: _angular_core.Signal<boolean>;
513
+ /** Whether the listbox is readonly. */
514
+ readonly: SignalLike<boolean>;
515
+ /** The tabindex of the listbox. */
516
+ tabindex: SignalLike<-1 | 0>;
517
+ /** The id of the current active item. */
518
+ activedescendant: _angular_core.Signal<string | undefined>;
519
+ /** Whether multiple items in the list can be selected at once. */
520
+ multi: SignalLike<boolean>;
521
+ /** The number of items in the listbox. */
522
+ setsize: _angular_core.Signal<number>;
523
+ /** Whether the listbox selection follows focus. */
524
+ followFocus: _angular_core.Signal<boolean>;
525
+ /** Whether the listbox should wrap. Used to disable wrapping while range selecting. */
526
+ wrap: _angular_core.WritableSignal<boolean>;
527
+ /** The key used to navigate to the previous item in the list. */
528
+ prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
529
+ /** The key used to navigate to the next item in the list. */
530
+ nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
531
+ /** Represents the space key. Does nothing when the user is actively using typeahead. */
532
+ dynamicSpaceKey: _angular_core.Signal<"" | " ">;
533
+ /** The regexp used to decide if a key should trigger typeahead. */
534
+ typeaheadRegexp: RegExp;
535
+ /** The keydown event manager for the listbox. */
536
+ keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
537
+ /** The pointerdown event manager for the listbox. */
538
+ pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
539
+ constructor(inputs: ListboxInputs<V>);
540
+ /** Returns a set of violations */
541
+ validate(): string[];
542
+ /** Handles keydown events for the listbox. */
543
+ onKeydown(event: KeyboardEvent): void;
544
+ onPointerdown(event: PointerEvent): void;
545
+ /**
546
+ * Sets the listbox to it's default initial state.
547
+ *
548
+ * Sets the active index of the listbox to the first focusable selected
549
+ * item if one exists. Otherwise, sets focus to the first focusable item.
550
+ *
551
+ * This method should be called once the listbox and it's options are properly initialized,
552
+ * meaning the ListboxPattern and OptionPatterns should have references to each other before this
553
+ * is called.
554
+ */
555
+ setDefaultState(): void;
556
+ protected _getItem(e: PointerEvent): OptionPattern<V> | undefined;
557
+ }
558
+
559
+ type ComboboxListboxInputs<V> = ListboxInputs<V> & {
560
+ /** The combobox controlling the listbox. */
561
+ combobox: SignalLike<ComboboxPattern<OptionPattern<V>, V> | undefined>;
562
+ };
563
+ declare class ComboboxListboxPattern<V> extends ListboxPattern<V> implements ComboboxListboxControls<OptionPattern<V>, V> {
564
+ readonly inputs: ComboboxListboxInputs<V>;
565
+ /** A unique identifier for the popup. */
566
+ id: _angular_core.Signal<string>;
567
+ /** The ARIA role for the listbox. */
568
+ role: _angular_core.Signal<"listbox">;
569
+ /** The id of the active (focused) item in the listbox. */
570
+ activeId: _angular_core.Signal<string | undefined>;
571
+ /** The list of options in the listbox. */
572
+ items: SignalLike<OptionPattern<V>[]>;
573
+ /** The tabindex for the listbox. Always -1 because the combobox handles focus. */
574
+ tabindex: SignalLike<-1 | 0>;
575
+ constructor(inputs: ComboboxListboxInputs<V>);
576
+ /** Noop. The combobox handles keydown events. */
577
+ onKeydown(_: KeyboardEvent): void;
578
+ /** Noop. The combobox handles pointerdown events. */
579
+ onPointerdown(_: PointerEvent): void;
580
+ /** Noop. The combobox controls the open state. */
581
+ setDefaultState(): void;
582
+ /** Navigates to the specified item in the listbox. */
583
+ focus: (item: OptionPattern<V>) => void;
584
+ /** Navigates to the next focusable item in the listbox. */
585
+ next: () => void;
586
+ /** Navigates to the previous focusable item in the listbox. */
587
+ prev: () => void;
588
+ /** Navigates to the last focusable item in the listbox. */
589
+ last: () => void;
590
+ /** Navigates to the first focusable item in the listbox. */
591
+ first: () => void;
592
+ /** Unfocuses the currently focused item in the listbox. */
593
+ unfocus: () => void;
594
+ /** Selects the specified item in the listbox. */
595
+ select: (item?: OptionPattern<V>) => void;
596
+ /** Clears the selection in the listbox. */
597
+ clearSelection: () => void;
598
+ /** Retrieves the OptionPattern associated with a pointer event. */
599
+ getItem: (e: PointerEvent) => OptionPattern<V> | undefined;
600
+ /** Retrieves the currently selected item in the listbox. */
601
+ getSelectedItem: () => OptionPattern<V> | undefined;
602
+ /** Sets the value of the combobox listbox. */
603
+ setValue: (value: V | undefined) => void;
604
+ }
605
+
606
+ /** The inputs for the MenuBarPattern class. */
607
+ interface MenuBarInputs<V> extends Omit<ListInputs<MenuItemPattern<V>, V>, 'disabled'> {
608
+ /** The menu items contained in the menu. */
609
+ items: SignalLike<MenuItemPattern<V>[]>;
610
+ /** Callback function triggered when a menu item is selected. */
611
+ onSubmit?: (value: V) => void;
612
+ }
613
+ /** The inputs for the MenuPattern class. */
614
+ interface MenuInputs<V> extends Omit<ListInputs<MenuItemPattern<V>, V>, 'value' | 'disabled'> {
615
+ /** The unique ID of the menu. */
616
+ id: SignalLike<string>;
617
+ /** The menu items contained in the menu. */
618
+ items: SignalLike<MenuItemPattern<V>[]>;
619
+ /** A reference to the parent menu or menu trigger. */
620
+ parent: SignalLike<MenuTriggerPattern<V> | MenuItemPattern<V> | undefined>;
621
+ /** Callback function triggered when a menu item is selected. */
622
+ onSubmit?: (value: V) => void;
623
+ }
624
+ /** The inputs for the MenuTriggerPattern class. */
625
+ interface MenuTriggerInputs<V> {
626
+ /** A reference to the menu trigger element. */
627
+ element: SignalLike<HTMLElement | undefined>;
628
+ /** A reference to the submenu associated with the menu trigger. */
629
+ submenu: SignalLike<MenuPattern<V> | undefined>;
630
+ /** Callback function triggered when a menu item is selected. */
631
+ onSubmit?: (value: V) => void;
632
+ }
633
+ /** The inputs for the MenuItemPattern class. */
634
+ interface MenuItemInputs<V> extends Omit<ListItem<V>, 'index' | 'selectable'> {
635
+ /** A reference to the parent menu or menu trigger. */
636
+ parent: SignalLike<MenuPattern<V> | MenuBarPattern<V> | undefined>;
637
+ /** A reference to the submenu associated with the menu item. */
638
+ submenu: SignalLike<MenuPattern<V> | undefined>;
639
+ }
640
+ /** The menu ui pattern class. */
641
+ declare class MenuPattern<V> {
642
+ readonly inputs: MenuInputs<V>;
643
+ /** The unique ID of the menu. */
644
+ id: SignalLike<string>;
645
+ /** The role of the menu. */
646
+ role: () => string;
647
+ /** Whether the menu is visible. */
648
+ isVisible: Signal<boolean>;
649
+ /** Controls list behavior for the menu items. */
650
+ listBehavior: List<MenuItemPattern<V>, V>;
651
+ /** Whether the menu or any of its child elements are currently focused. */
652
+ isFocused: _angular_core.WritableSignal<boolean>;
653
+ /** Whether the menu has received focus. */
654
+ hasBeenFocused: _angular_core.WritableSignal<boolean>;
655
+ /** Whether the menu should be focused on mouse over. */
656
+ shouldFocus: Signal<boolean>;
657
+ /** The key used to expand sub-menus. */
658
+ private _expandKey;
659
+ /** The key used to collapse sub-menus. */
660
+ private _collapseKey;
661
+ /** Represents the space key. Does nothing when the user is actively using typeahead. */
662
+ dynamicSpaceKey: Signal<"" | " ">;
663
+ /** The regexp used to decide if a key should trigger typeahead. */
664
+ typeaheadRegexp: RegExp;
665
+ /** The root of the menu. */
666
+ root: Signal<MenuTriggerPattern<V> | MenuBarPattern<V> | MenuPattern<V> | undefined>;
667
+ /** Handles keyboard events for the menu. */
668
+ keydownManager: Signal<KeyboardEventManager<KeyboardEvent>>;
669
+ constructor(inputs: MenuInputs<V>);
670
+ /** Sets the default state for the menu. */
671
+ setDefaultState(): void;
672
+ /** Handles keyboard events for the menu. */
673
+ onKeydown(event: KeyboardEvent): void;
674
+ /** Handles mouseover events for the menu. */
675
+ onMouseOver(event: MouseEvent): void;
676
+ /** Handles mouseout events for the menu. */
677
+ onMouseOut(event: MouseEvent): void;
678
+ /** Handles click events for the menu. */
679
+ onClick(event: MouseEvent): void;
680
+ /** Handles focusin events for the menu. */
681
+ onFocusIn(): void;
682
+ /** Handles the focusout event for the menu. */
683
+ onFocusOut(event: FocusEvent): void;
684
+ /** Focuses the previous menu item. */
685
+ prev(): void;
686
+ /** Focuses the next menu item. */
687
+ next(): void;
688
+ /** Focuses the first menu item. */
689
+ first(): void;
690
+ /** Focuses the last menu item. */
691
+ last(): void;
692
+ /** Triggers the active menu item. */
693
+ trigger(): void;
694
+ /** Submits the menu. */
695
+ submit(item?: MenuItemPattern<V> | undefined): void;
696
+ /** Collapses the current menu or focuses the previous item in the menubar. */
697
+ collapse(): void;
698
+ /** Expands the current menu or focuses the next item in the menubar. */
699
+ expand(): void;
700
+ /** Closes the menu and all parent menus. */
701
+ closeAll(): void;
702
+ }
703
+ /** The menubar ui pattern class. */
704
+ declare class MenuBarPattern<V> {
705
+ readonly inputs: MenuBarInputs<V>;
706
+ /** Controls list behavior for the menu items. */
707
+ listBehavior: List<MenuItemPattern<V>, V>;
708
+ /** The key used to navigate to the next item. */
709
+ private _nextKey;
710
+ /** The key used to navigate to the previous item. */
711
+ private _previousKey;
712
+ /** Represents the space key. Does nothing when the user is actively using typeahead. */
713
+ dynamicSpaceKey: Signal<"" | " ">;
714
+ /** The regexp used to decide if a key should trigger typeahead. */
715
+ typeaheadRegexp: RegExp;
716
+ /** Whether the menubar or any of its children are currently focused. */
717
+ isFocused: _angular_core.WritableSignal<boolean>;
718
+ /** Whether the menubar has been focused. */
719
+ hasBeenFocused: _angular_core.WritableSignal<boolean>;
720
+ /** Handles keyboard events for the menu. */
721
+ keydownManager: Signal<KeyboardEventManager<KeyboardEvent>>;
722
+ constructor(inputs: MenuBarInputs<V>);
723
+ /** Sets the default state for the menubar. */
724
+ setDefaultState(): void;
725
+ /** Handles keyboard events for the menu. */
726
+ onKeydown(event: KeyboardEvent): void;
727
+ /** Handles click events for the menu bar. */
728
+ onClick(event: MouseEvent): void;
729
+ /** Handles mouseover events for the menu bar. */
730
+ onMouseOver(event: MouseEvent): void;
731
+ /** Handles focusin events for the menu bar. */
732
+ onFocusIn(): void;
733
+ /** Handles focusout events for the menu bar. */
734
+ onFocusOut(event: FocusEvent): void;
735
+ /** Goes to and optionally focuses the specified menu item. */
736
+ goto(item: MenuItemPattern<V>, opts?: {
737
+ focusElement?: boolean;
738
+ }): void;
739
+ /** Focuses the next menu item. */
740
+ next(): void;
741
+ /** Focuses the previous menu item. */
742
+ prev(): void;
743
+ /** Closes the menubar and refocuses the root menu bar item. */
744
+ close(): void;
745
+ }
746
+ /** The menu trigger ui pattern class. */
747
+ declare class MenuTriggerPattern<V> {
748
+ readonly inputs: MenuTriggerInputs<V>;
749
+ /** Whether the menu is expanded. */
750
+ expanded: _angular_core.WritableSignal<boolean>;
751
+ /** The role of the menu trigger. */
752
+ role: () => string;
753
+ /** Whether the menu trigger has a popup. */
754
+ hasPopup: () => boolean;
755
+ /** The submenu associated with the trigger. */
756
+ submenu: SignalLike<MenuPattern<V> | undefined>;
757
+ /** The tabindex of the menu trigger. */
758
+ tabindex: Signal<-1 | 0>;
759
+ /** Handles keyboard events for the menu trigger. */
760
+ keydownManager: Signal<KeyboardEventManager<KeyboardEvent>>;
761
+ constructor(inputs: MenuTriggerInputs<V>);
762
+ /** Handles keyboard events for the menu trigger. */
763
+ onKeydown(event: KeyboardEvent): void;
764
+ /** Handles click events for the menu trigger. */
765
+ onClick(): void;
766
+ /** Handles focusout events for the menu trigger. */
767
+ onFocusOut(event: FocusEvent): void;
768
+ /** Opens the menu. */
769
+ open(opts?: {
770
+ first?: boolean;
771
+ last?: boolean;
772
+ }): void;
773
+ /** Closes the menu. */
774
+ close(opts?: {
775
+ refocus?: boolean;
776
+ }): void;
777
+ }
778
+ /** The menu item ui pattern class. */
779
+ declare class MenuItemPattern<V> implements ListItem<V> {
780
+ readonly inputs: MenuItemInputs<V>;
781
+ /** The value of the menu item. */
782
+ value: SignalLike<V>;
783
+ /** The unique ID of the menu item. */
784
+ id: SignalLike<string>;
785
+ /** Whether the menu item is disabled. */
786
+ disabled: SignalLike<boolean>;
787
+ /** The search term for the menu item. */
788
+ searchTerm: SignalLike<string>;
789
+ /** The element of the menu item. */
790
+ element: SignalLike<HTMLElement>;
791
+ /** Whether the menu item is active. */
792
+ isActive: Signal<boolean>;
793
+ /** The tabindex of the menu item. */
794
+ tabindex: Signal<0 | -1>;
795
+ /** The position of the menu item in the menu. */
796
+ index: Signal<number>;
797
+ /** Whether the menu item is expanded. */
798
+ expanded: Signal<boolean | null>;
799
+ /** Whether the menu item is expanded. */
800
+ _expanded: _angular_core.WritableSignal<boolean>;
801
+ /** The ID of the menu that the menu item controls. */
802
+ controls: _angular_core.WritableSignal<string | undefined>;
803
+ /** The role of the menu item. */
804
+ role: () => string;
805
+ /** Whether the menu item has a popup. */
806
+ hasPopup: Signal<boolean>;
807
+ /** The submenu associated with the menu item. */
808
+ submenu: SignalLike<MenuPattern<V> | undefined>;
809
+ /** Whether the menu item is selectable. */
810
+ selectable: SignalLike<boolean>;
811
+ constructor(inputs: MenuItemInputs<V>);
812
+ /** Opens the submenu. */
813
+ open(opts?: {
814
+ first?: boolean;
815
+ last?: boolean;
816
+ }): void;
817
+ /** Closes the submenu. */
818
+ close(opts?: {
819
+ refocus?: boolean;
820
+ }): void;
821
+ }
822
+
823
+ /** Represents the required inputs for a radio button in a radio group. */
824
+ interface RadioButtonInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'index' | 'selectable'> {
825
+ /** A reference to the parent radio group. */
826
+ group: SignalLike<RadioGroupPattern<V> | undefined>;
827
+ }
828
+ /** Represents a radio button within a radio group. */
829
+ declare class RadioButtonPattern<V> {
830
+ readonly inputs: RadioButtonInputs<V>;
831
+ /** A unique identifier for the radio button. */
832
+ readonly id: SignalLike<string>;
833
+ /** The value associated with the radio button. */
834
+ readonly value: SignalLike<V>;
835
+ /** The position of the radio button within the group. */
836
+ readonly index: SignalLike<number>;
837
+ /** Whether the radio button is currently the active one (focused). */
838
+ readonly active: _angular_core.Signal<boolean>;
839
+ /** Whether the radio button is selected. */
840
+ readonly selected: SignalLike<boolean>;
841
+ /** Whether the radio button is selectable. */
842
+ readonly selectable: () => boolean;
843
+ /** Whether the radio button is disabled. */
844
+ readonly disabled: SignalLike<boolean>;
845
+ /** A reference to the parent radio group. */
846
+ readonly group: SignalLike<RadioGroupPattern<V> | undefined>;
847
+ /** The tabindex of the radio button. */
848
+ readonly tabindex: _angular_core.Signal<0 | -1 | undefined>;
849
+ /** The HTML element associated with the radio button. */
850
+ readonly element: SignalLike<HTMLElement>;
851
+ /** The search term for typeahead. */
852
+ readonly searchTerm: () => string;
853
+ constructor(inputs: RadioButtonInputs<V>);
854
+ }
855
+
856
+ /** Represents the required inputs for a radio group. */
857
+ type RadioGroupInputs<V> = Omit<ListInputs<RadioButtonPattern<V>, V>, 'multi' | 'selectionMode' | 'wrap' | 'typeaheadDelay'> & {
858
+ /** Whether the radio group is disabled. */
859
+ disabled: SignalLike<boolean>;
860
+ /** Whether the radio group is readonly. */
861
+ readonly: SignalLike<boolean>;
862
+ /** A function that returns the radio button associated with a given element. */
863
+ getItem: (e: PointerEvent) => RadioButtonPattern<V> | undefined;
864
+ };
865
+ /** Controls the state of a radio group. */
866
+ declare class RadioGroupPattern<V> {
867
+ readonly inputs: RadioGroupInputs<V>;
868
+ /** The list behavior for the radio group. */
869
+ readonly listBehavior: List<RadioButtonPattern<V>, V>;
870
+ /** Whether the radio group is vertically or horizontally oriented. */
871
+ readonly orientation: SignalLike<'vertical' | 'horizontal'>;
872
+ /** Whether focus should wrap when navigating. */
873
+ readonly wrap: _angular_core.WritableSignal<boolean>;
874
+ /** The selection strategy used by the radio group. */
875
+ readonly selectionMode: _angular_core.WritableSignal<"follow" | "explicit">;
876
+ /** Whether the radio group is disabled. */
877
+ readonly disabled: _angular_core.Signal<boolean>;
878
+ /** The currently selected radio button. */
879
+ readonly selectedItem: _angular_core.Signal<RadioButtonPattern<V>>;
880
+ /** Whether the radio group is readonly. */
881
+ readonly readonly: _angular_core.Signal<boolean>;
882
+ /** The tabindex of the radio group. */
883
+ readonly tabindex: _angular_core.Signal<0 | -1>;
884
+ /** The id of the current active radio button (if using activedescendant). */
885
+ readonly activedescendant: _angular_core.Signal<string | undefined>;
886
+ /** The key used to navigate to the previous radio button. */
887
+ private readonly _prevKey;
888
+ /** The key used to navigate to the next radio button. */
889
+ private readonly _nextKey;
890
+ /** The keydown event manager for the radio group. */
891
+ readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
892
+ /** The pointerdown event manager for the radio group. */
893
+ readonly pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
894
+ constructor(inputs: RadioGroupInputs<V>);
895
+ /** Handles keydown events for the radio group. */
896
+ onKeydown(event: KeyboardEvent): void;
897
+ /** Handles pointerdown events for the radio group. */
898
+ onPointerdown(event: PointerEvent): void;
899
+ /**
900
+ * Sets the radio group to its default initial state.
901
+ *
902
+ * Sets the active index to the selected radio button if one exists and is focusable.
903
+ * Otherwise, sets the active index to the first focusable radio button.
904
+ */
905
+ setDefaultState(): void;
906
+ /** Validates the state of the radio group and returns a list of accessibility violations. */
907
+ validate(): string[];
908
+ }
909
+
910
+ /** Represents the required inputs for a toolbar widget in a toolbar. */
911
+ interface ToolbarWidgetInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'value' | 'index' | 'selectable'> {
912
+ /** A reference to the parent toolbar. */
913
+ toolbar: SignalLike<ToolbarPattern<V>>;
914
+ }
915
+ declare class ToolbarWidgetPattern<V> implements ListItem<V> {
916
+ readonly inputs: ToolbarWidgetInputs<V>;
917
+ /** A unique identifier for the widget. */
918
+ readonly id: SignalLike<string>;
919
+ /** The html element that should receive focus. */
920
+ readonly element: SignalLike<HTMLElement>;
921
+ /** Whether the widget is disabled. */
922
+ readonly disabled: SignalLike<boolean>;
923
+ /** A reference to the parent toolbar. */
924
+ readonly toolbar: SignalLike<ToolbarPattern<V>>;
925
+ /** The tabindex of the widgdet. */
926
+ readonly tabindex: _angular_core.Signal<0 | -1>;
927
+ /** The text used by the typeahead search. */
928
+ readonly searchTerm: () => string;
929
+ /** The value associated with the widget. */
930
+ readonly value: () => V;
931
+ /** Whether the widget is selectable. */
932
+ readonly selectable: () => boolean;
933
+ /** The position of the widget within the toolbar. */
934
+ readonly index: _angular_core.Signal<number>;
935
+ /** Whether the widget is currently the active one (focused). */
936
+ readonly active: _angular_core.Signal<boolean>;
937
+ constructor(inputs: ToolbarWidgetInputs<V>);
938
+ }
939
+
940
+ /** An interface that allows sub patterns to expose the necessary controls for the toolbar. */
941
+ interface ToolbarWidgetGroupControls {
942
+ /** Whether the widget group is currently on the first item. */
943
+ isOnFirstItem(): boolean;
944
+ /** Whether the widget group is currently on the last item. */
945
+ isOnLastItem(): boolean;
946
+ /** Navigates to the next widget in the group. */
947
+ next(wrap: boolean): void;
948
+ /** Navigates to the previous widget in the group. */
949
+ prev(wrap: boolean): void;
950
+ /** Navigates to the first widget in the group. */
951
+ first(): void;
952
+ /** Navigates to the last widget in the group. */
953
+ last(): void;
954
+ /** Removes focus from the widget group. */
955
+ unfocus(): void;
956
+ /** Triggers the action of the currently active widget in the group. */
957
+ trigger(): void;
958
+ /** Navigates to the widget targeted by a pointer event. */
959
+ goto(event: PointerEvent): void;
960
+ /** Sets the widget group to its default initial state. */
961
+ setDefaultState(): void;
962
+ }
963
+ /** Represents the required inputs for a toolbar widget group. */
964
+ interface ToolbarWidgetGroupInputs<V> extends Omit<ListItem<V>, 'searchTerm' | 'value' | 'index' | 'selectable'> {
965
+ /** A reference to the parent toolbar. */
966
+ toolbar: SignalLike<ToolbarPattern<V> | undefined>;
967
+ /** The controls for the sub patterns associated with the toolbar. */
968
+ controls: SignalLike<ToolbarWidgetGroupControls | undefined>;
969
+ }
970
+ /** A group of widgets within a toolbar that provides nested navigation. */
971
+ declare class ToolbarWidgetGroupPattern<V> implements ListItem<V> {
972
+ readonly inputs: ToolbarWidgetGroupInputs<V>;
973
+ /** A unique identifier for the widget. */
974
+ readonly id: SignalLike<string>;
975
+ /** The html element that should receive focus. */
976
+ readonly element: SignalLike<HTMLElement>;
977
+ /** Whether the widget is disabled. */
978
+ readonly disabled: SignalLike<boolean>;
979
+ /** A reference to the parent toolbar. */
980
+ readonly toolbar: SignalLike<ToolbarPattern<V> | undefined>;
981
+ /** The text used by the typeahead search. */
982
+ readonly searchTerm: () => string;
983
+ /** The value associated with the widget. */
984
+ readonly value: () => V;
985
+ /** Whether the widget is selectable. */
986
+ readonly selectable: () => boolean;
987
+ /** The position of the widget within the toolbar. */
988
+ readonly index: _angular_core.Signal<number>;
989
+ /** The actions that can be performed on the widget group. */
990
+ readonly controls: SignalLike<ToolbarWidgetGroupControls>;
991
+ /** Default toolbar widget group controls when no controls provided. */
992
+ private readonly _defaultControls;
993
+ constructor(inputs: ToolbarWidgetGroupInputs<V>);
994
+ }
995
+
996
+ /** Represents the required inputs for a toolbar. */
997
+ type ToolbarInputs<V> = Omit<ListInputs<ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V>, V>, 'multi' | 'typeaheadDelay' | 'value' | 'selectionMode' | 'focusMode'> & {
998
+ /** A function that returns the toolbar item associated with a given element. */
999
+ getItem: (e: Element) => ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V> | undefined;
1000
+ };
1001
+ /** Controls the state of a toolbar. */
1002
+ declare class ToolbarPattern<V> {
1003
+ readonly inputs: ToolbarInputs<V>;
1004
+ /** The list behavior for the toolbar. */
1005
+ readonly listBehavior: List<ToolbarWidgetPattern<V> | ToolbarWidgetGroupPattern<V>, V>;
1006
+ /** Whether the tablist is vertically or horizontally oriented. */
1007
+ readonly orientation: SignalLike<'vertical' | 'horizontal'>;
1008
+ /** Whether disabled items in the group should be skipped when navigating. */
1009
+ readonly skipDisabled: SignalLike<boolean>;
1010
+ /** Whether the toolbar is disabled. */
1011
+ readonly disabled: _angular_core.Signal<boolean>;
1012
+ /** The tabindex of the toolbar (if using activedescendant). */
1013
+ readonly tabindex: _angular_core.Signal<0 | -1>;
1014
+ /** The id of the current active widget (if using activedescendant). */
1015
+ readonly activedescendant: _angular_core.Signal<string | undefined>;
1016
+ /** The key used to navigate to the previous widget. */
1017
+ private readonly _prevKey;
1018
+ /** The key used to navigate to the next widget. */
1019
+ private readonly _nextKey;
1020
+ /** The alternate key used to navigate to the previous widget. */
1021
+ private readonly _altPrevKey;
1022
+ /** The alternate key used to navigate to the next widget. */
1023
+ private readonly _altNextKey;
1024
+ /** The keydown event manager for the toolbar. */
1025
+ private readonly _keydown;
1026
+ /** The pointerdown event manager for the toolbar. */
1027
+ private readonly _pointerdown;
1028
+ /** Navigates to the next widget in the toolbar. */
1029
+ private _next;
1030
+ /** Navigates to the previous widget in the toolbar. */
1031
+ private _prev;
1032
+ private _groupNext;
1033
+ private _groupPrev;
1034
+ /** Triggers the action of the currently active widget. */
1035
+ private _trigger;
1036
+ /** Navigates to the first widget in the toolbar. */
1037
+ private _first;
1038
+ /** Navigates to the last widget in the toolbar. */
1039
+ private _last;
1040
+ /** Navigates to the widget targeted by a pointer event. */
1041
+ private _goto;
1042
+ constructor(inputs: ToolbarInputs<V>);
1043
+ /** Handles keydown events for the toolbar. */
1044
+ onKeydown(event: KeyboardEvent): void;
1045
+ /** Handles pointerdown events for the toolbar. */
1046
+ onPointerdown(event: PointerEvent): void;
1047
+ /**
1048
+ * Sets the toolbar to its default initial state.
1049
+ *
1050
+ * Sets the active index to the selected widget if one exists and is focusable.
1051
+ * Otherwise, sets the active index to the first focusable widget.
1052
+ */
1053
+ setDefaultState(): void;
1054
+ /** Validates the state of the toolbar and returns a list of accessibility violations. */
1055
+ validate(): string[];
1056
+ }
1057
+
1058
+ /** Represents the required inputs for a toolbar controlled radio group. */
1059
+ type ToolbarRadioGroupInputs<V> = RadioGroupInputs<V> & {
1060
+ /** The toolbar controlling the radio group. */
1061
+ toolbar: SignalLike<ToolbarPattern<V> | undefined>;
1062
+ };
1063
+ /** Controls the state of a radio group in a toolbar. */
1064
+ declare class ToolbarRadioGroupPattern<V> extends RadioGroupPattern<V> implements ToolbarWidgetGroupControls {
1065
+ readonly inputs: ToolbarRadioGroupInputs<V>;
1066
+ constructor(inputs: ToolbarRadioGroupInputs<V>);
1067
+ /** Noop. The toolbar handles keydown events. */
1068
+ onKeydown(_: KeyboardEvent): void;
1069
+ /** Noop. The toolbar handles pointerdown events. */
1070
+ onPointerdown(_: PointerEvent): void;
1071
+ /** Whether the radio group is currently on the first item. */
1072
+ isOnFirstItem(): boolean;
1073
+ /** Whether the radio group is currently on the last item. */
1074
+ isOnLastItem(): boolean;
1075
+ /** Navigates to the next radio button in the group. */
1076
+ next(wrap: boolean): void;
1077
+ /** Navigates to the previous radio button in the group. */
1078
+ prev(wrap: boolean): void;
1079
+ /** Navigates to the first radio button in the group. */
1080
+ first(): void;
1081
+ /** Navigates to the last radio button in the group. */
1082
+ last(): void;
1083
+ /** Removes focus from the radio group. */
1084
+ unfocus(): void;
1085
+ /** Triggers the action of the currently active radio button in the group. */
1086
+ trigger(): void;
1087
+ /** Navigates to the radio button targeted by a pointer event. */
1088
+ goto(e: PointerEvent): void;
1089
+ }
1090
+
1091
+ /** Represents an item that can be expanded or collapsed. */
1092
+ interface ExpansionItem {
1093
+ /** Whether the item is expandable. */
1094
+ expandable: SignalLike<boolean>;
1095
+ /** Used to uniquely identify an expansion item. */
1096
+ expansionId: SignalLike<string>;
1097
+ /** Whether the expansion is disabled. */
1098
+ disabled: SignalLike<boolean>;
1099
+ }
1100
+ interface ExpansionControl extends ExpansionItem {
1101
+ }
1102
+ /**
1103
+ * Controls a single item's expansion state and interactions,
1104
+ * delegating actual state changes to an Expansion manager.
1105
+ */
1106
+ declare class ExpansionControl {
1107
+ readonly inputs: ExpansionItem & {
1108
+ expansionManager: ListExpansion;
1109
+ };
1110
+ /** Whether this specific item is currently expanded. Derived from the Expansion manager. */
1111
+ readonly isExpanded: _angular_core.Signal<boolean>;
1112
+ /** Whether this item can be expanded. */
1113
+ readonly isExpandable: _angular_core.Signal<boolean>;
1114
+ constructor(inputs: ExpansionItem & {
1115
+ expansionManager: ListExpansion;
1116
+ });
1117
+ /** Requests the Expansion manager to open this item. */
1118
+ open(): void;
1119
+ /** Requests the Expansion manager to close this item. */
1120
+ close(): void;
1121
+ /** Requests the Expansion manager to toggle this item. */
1122
+ toggle(): void;
1123
+ }
1124
+ /** Represents the required inputs for an expansion behavior. */
1125
+ interface ListExpansionInputs {
1126
+ /** Whether multiple items can be expanded at once. */
1127
+ multiExpandable: SignalLike<boolean>;
1128
+ /** An array of ids of the currently expanded items. */
1129
+ expandedIds: WritableSignalLike<string[]>;
1130
+ /** An array of expansion items. */
1131
+ items: SignalLike<ExpansionItem[]>;
1132
+ /** Whether all expansions are disabled. */
1133
+ disabled: SignalLike<boolean>;
1134
+ }
1135
+ /** Manages the expansion state of a list of items. */
1136
+ declare class ListExpansion {
1137
+ readonly inputs: ListExpansionInputs;
1138
+ /** A signal holding an array of ids of the currently expanded items. */
1139
+ expandedIds: WritableSignalLike<string[]>;
1140
+ constructor(inputs: ListExpansionInputs);
1141
+ /** Opens the specified item. */
1142
+ open(item: ExpansionItem): void;
1143
+ /** Closes the specified item. */
1144
+ close(item: ExpansionItem): void;
1145
+ /** Toggles the expansion state of the specified item. */
1146
+ toggle(item: ExpansionItem): void;
1147
+ /** Opens all focusable items in the list. */
1148
+ openAll(): void;
1149
+ /** Closes all focusable items in the list. */
1150
+ closeAll(): void;
1151
+ /** Checks whether the specified item is expandable / collapsible. */
1152
+ isExpandable(item: ExpansionItem): boolean;
1153
+ /** Checks whether the specified item is currently expanded. */
1154
+ isExpanded(item: ExpansionItem): boolean;
1155
+ }
1156
+
1157
+ /** Represents the required inputs for the label control. */
1158
+ interface LabelControlInputs {
1159
+ /** The default `aria-labelledby` ids. */
1160
+ defaultLabelledBy: SignalLike<string[]>;
1161
+ }
1162
+ /** Represents the optional inputs for the label control. */
1163
+ interface LabelControlOptionalInputs {
1164
+ /** The `aria-label`. */
1165
+ label?: SignalLike<string | undefined>;
1166
+ /** The user-provided `aria-labelledby` ids. */
1167
+ labelledBy?: SignalLike<string[]>;
1168
+ }
1169
+ /** Controls label and description of an element. */
1170
+ declare class LabelControl {
1171
+ readonly inputs: LabelControlInputs & LabelControlOptionalInputs;
1172
+ /** The `aria-label`. */
1173
+ readonly label: _angular_core.Signal<string | undefined>;
1174
+ /** The `aria-labelledby` ids. */
1175
+ readonly labelledBy: _angular_core.Signal<string[]>;
1176
+ constructor(inputs: LabelControlInputs & LabelControlOptionalInputs);
1177
+ }
1178
+
1179
+ /** The required inputs to tabs. */
1180
+ interface TabInputs extends Omit<ListItem<string>, 'searchTerm' | 'index' | 'selectable'>, Omit<ExpansionItem, 'expansionId' | 'expandable'> {
1181
+ /** The parent tablist that controls the tab. */
1182
+ tablist: SignalLike<TabListPattern>;
1183
+ /** The remote tabpanel controlled by the tab. */
1184
+ tabpanel: SignalLike<TabPanelPattern | undefined>;
1185
+ }
1186
+ /** A tab in a tablist. */
1187
+ declare class TabPattern {
1188
+ readonly inputs: TabInputs;
1189
+ /** Controls expansion for this tab. */
1190
+ readonly expansion: ExpansionControl;
1191
+ /** A global unique identifier for the tab. */
1192
+ readonly id: SignalLike<string>;
1193
+ /** The index of the tab. */
1194
+ readonly index: _angular_core.Signal<number>;
1195
+ /** A local unique identifier for the tab. */
1196
+ readonly value: SignalLike<string>;
1197
+ /** Whether the tab is disabled. */
1198
+ readonly disabled: SignalLike<boolean>;
1199
+ /** The html element that should receive focus. */
1200
+ readonly element: SignalLike<HTMLElement>;
1201
+ /** Whether the tab is selectable. */
1202
+ readonly selectable: () => boolean;
1203
+ /** The text used by the typeahead search. */
1204
+ readonly searchTerm: () => string;
1205
+ /** Whether this tab has expandable content. */
1206
+ readonly expandable: _angular_core.Signal<boolean>;
1207
+ /** The unique identifier used by the expansion behavior. */
1208
+ readonly expansionId: _angular_core.Signal<string>;
1209
+ /** Whether the tab is expanded. */
1210
+ readonly expanded: _angular_core.Signal<boolean>;
1211
+ /** Whether the tab is active. */
1212
+ readonly active: _angular_core.Signal<boolean>;
1213
+ /** Whether the tab is selected. */
1214
+ readonly selected: _angular_core.Signal<boolean>;
1215
+ /** The tabindex of the tab. */
1216
+ readonly tabindex: _angular_core.Signal<0 | -1>;
1217
+ /** The id of the tabpanel associated with the tab. */
1218
+ readonly controls: _angular_core.Signal<string | undefined>;
1219
+ constructor(inputs: TabInputs);
1220
+ }
1221
+ /** The required inputs for the tabpanel. */
1222
+ interface TabPanelInputs extends LabelControlOptionalInputs {
1223
+ id: SignalLike<string>;
1224
+ tab: SignalLike<TabPattern | undefined>;
1225
+ value: SignalLike<string>;
1226
+ }
1227
+ /** A tabpanel associated with a tab. */
1228
+ declare class TabPanelPattern {
1229
+ readonly inputs: TabPanelInputs;
1230
+ /** A global unique identifier for the tabpanel. */
1231
+ readonly id: SignalLike<string>;
1232
+ /** A local unique identifier for the tabpanel. */
1233
+ readonly value: SignalLike<string>;
1234
+ /** Controls label for this tabpanel. */
1235
+ readonly labelManager: LabelControl;
1236
+ /** Whether the tabpanel is hidden. */
1237
+ readonly hidden: _angular_core.Signal<boolean>;
1238
+ /** The tabindex of this tabpanel. */
1239
+ readonly tabindex: _angular_core.Signal<0 | -1>;
1240
+ /** The aria-labelledby value for this tabpanel. */
1241
+ readonly labelledBy: _angular_core.Signal<string | undefined>;
1242
+ constructor(inputs: TabPanelInputs);
1243
+ }
1244
+ /** The required inputs for the tablist. */
1245
+ type TabListInputs = Omit<ListInputs<TabPattern, string>, 'multi' | 'typeaheadDelay'> & Omit<ListExpansionInputs, 'multiExpandable' | 'expandedIds' | 'items'>;
1246
+ /** Controls the state of a tablist. */
1247
+ declare class TabListPattern {
1248
+ readonly inputs: TabListInputs;
1249
+ /** The list behavior for the tablist. */
1250
+ readonly listBehavior: List<TabPattern, string>;
1251
+ /** Controls expansion for the tablist. */
1252
+ readonly expansionManager: ListExpansion;
1253
+ /** Whether the tablist is vertically or horizontally oriented. */
1254
+ readonly orientation: SignalLike<'vertical' | 'horizontal'>;
1255
+ /** Whether the tablist is disabled. */
1256
+ readonly disabled: SignalLike<boolean>;
1257
+ /** The tabindex of the tablist. */
1258
+ readonly tabindex: _angular_core.Signal<0 | -1>;
1259
+ /** The id of the current active tab. */
1260
+ readonly activedescendant: _angular_core.Signal<string | undefined>;
1261
+ /** Whether selection should follow focus. */
1262
+ readonly followFocus: _angular_core.Signal<boolean>;
1263
+ /** The key used to navigate to the previous tab in the tablist. */
1264
+ readonly prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
1265
+ /** The key used to navigate to the next item in the list. */
1266
+ readonly nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
1267
+ /** The keydown event manager for the tablist. */
1268
+ readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
1269
+ /** The pointerdown event manager for the tablist. */
1270
+ readonly pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
1271
+ constructor(inputs: TabListInputs);
1272
+ /**
1273
+ * Sets the tablist to its default initial state.
1274
+ *
1275
+ * Sets the active index of the tablist to the first focusable selected
1276
+ * tab if one exists. Otherwise, sets focus to the first focusable tab.
1277
+ *
1278
+ * This method should be called once the tablist and its tabs are properly initialized.
1279
+ */
1280
+ setDefaultState(): void;
1281
+ /** Handles keydown events for the tablist. */
1282
+ onKeydown(event: KeyboardEvent): void;
1283
+ /** The pointerdown event manager for the tablist. */
1284
+ onPointerdown(event: PointerEvent): void;
1285
+ /** Returns the tab item associated with the given pointer event. */
1286
+ private _getItem;
1287
+ }
1288
+
1289
+ /** Inputs of the AccordionGroupPattern. */
1290
+ type AccordionGroupInputs = Omit<ListNavigationInputs<AccordionTriggerPattern> & ListFocusInputs<AccordionTriggerPattern> & Omit<ListExpansionInputs, 'items'>, 'focusMode'>;
1291
+ interface AccordionGroupPattern extends AccordionGroupInputs {
1292
+ }
1293
+ /** A pattern controls the nested Accordions. */
1294
+ declare class AccordionGroupPattern {
1295
+ readonly inputs: AccordionGroupInputs;
1296
+ /** Controls navigation for the group. */
1297
+ navigation: ListNavigation<AccordionTriggerPattern>;
1298
+ /** Controls focus for the group. */
1299
+ focusManager: ListFocus<AccordionTriggerPattern>;
1300
+ /** Controls expansion for the group. */
1301
+ expansionManager: ListExpansion;
1302
+ constructor(inputs: AccordionGroupInputs);
1303
+ }
1304
+ /** Inputs for the AccordionTriggerPattern. */
1305
+ type AccordionTriggerInputs = Omit<ListNavigationItem & ListFocusItem, 'index'> & Omit<ExpansionItem, 'expansionId' | 'expandable'> & {
1306
+ /** A local unique identifier for the trigger. */
1307
+ value: SignalLike<string>;
1308
+ /** The parent accordion group that controls this trigger. */
1309
+ accordionGroup: SignalLike<AccordionGroupPattern>;
1310
+ /** The accordion panel controlled by this trigger. */
1311
+ accordionPanel: SignalLike<AccordionPanelPattern | undefined>;
1312
+ };
1313
+ interface AccordionTriggerPattern extends AccordionTriggerInputs {
1314
+ }
1315
+ /** A pattern controls the expansion state of an accordion. */
1316
+ declare class AccordionTriggerPattern {
1317
+ readonly inputs: AccordionTriggerInputs;
1318
+ /** Whether this tab has expandable content. */
1319
+ expandable: SignalLike<boolean>;
1320
+ /** The unique identifier used by the expansion behavior. */
1321
+ expansionId: SignalLike<string>;
1322
+ /** Whether an accordion is expanded. */
1323
+ expanded: SignalLike<boolean>;
1324
+ /** Controls the expansion state for the trigger. */
1325
+ expansionControl: ExpansionControl;
1326
+ /** Whether the trigger is active. */
1327
+ active: _angular_core.Signal<boolean>;
1328
+ /** Id of the accordion panel controlled by the trigger. */
1329
+ controls: _angular_core.Signal<string | undefined>;
1330
+ /** The tabindex of the trigger. */
1331
+ tabindex: _angular_core.Signal<-1 | 0>;
1332
+ /** Whether the trigger is disabled. Disabling an accordion group disables all the triggers. */
1333
+ disabled: _angular_core.Signal<boolean>;
1334
+ /** The index of the trigger within its accordion group. */
1335
+ index: _angular_core.Signal<number>;
1336
+ constructor(inputs: AccordionTriggerInputs);
1337
+ /** The key used to navigate to the previous accordion trigger. */
1338
+ prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
1339
+ /** The key used to navigate to the next accordion trigger. */
1340
+ nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
1341
+ /** The keydown event manager for the accordion trigger. */
1342
+ keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
1343
+ /** The pointerdown event manager for the accordion trigger. */
1344
+ pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
1345
+ /** Handles keydown events on the trigger, delegating to the group if not disabled. */
1346
+ onKeydown(event: KeyboardEvent): void;
1347
+ /** Handles pointerdown events on the trigger, delegating to the group if not disabled. */
1348
+ onPointerdown(event: PointerEvent): void;
1349
+ /** Handles focus events on the trigger. This ensures the tabbing changes the active index. */
1350
+ onFocus(event: FocusEvent): void;
1351
+ private _getItem;
1352
+ }
1353
+ /** Represents the required inputs for the AccordionPanelPattern. */
1354
+ interface AccordionPanelInputs {
1355
+ /** A global unique identifier for the panel. */
1356
+ id: SignalLike<string>;
1357
+ /** A local unique identifier for the panel, matching its trigger's value. */
1358
+ value: SignalLike<string>;
1359
+ /** The parent accordion trigger that controls this panel. */
1360
+ accordionTrigger: SignalLike<AccordionTriggerPattern | undefined>;
1361
+ }
1362
+ interface AccordionPanelPattern extends AccordionPanelInputs {
1363
+ }
1364
+ /** Represents an accordion panel. */
1365
+ declare class AccordionPanelPattern {
1366
+ readonly inputs: AccordionPanelInputs;
1367
+ /** Whether the accordion panel is hidden. True if the associated trigger is not expanded. */
1368
+ hidden: SignalLike<boolean>;
1369
+ constructor(inputs: AccordionPanelInputs);
1370
+ }
1371
+
1372
+ /** Represents the required inputs for a tree item. */
1373
+ interface TreeItemInputs<V> extends Omit<ListItem<V>, 'index'> {
1374
+ /** The parent item. */
1375
+ parent: SignalLike<TreeItemPattern<V> | TreePattern<V>>;
1376
+ /** Whether this item has children. Children can be lazily loaded. */
1377
+ hasChildren: SignalLike<boolean>;
1378
+ /** The children items. */
1379
+ children: SignalLike<TreeItemPattern<V>[]>;
1380
+ /** The tree pattern this item belongs to. */
1381
+ tree: SignalLike<TreePattern<V>>;
1382
+ }
1383
+ /**
1384
+ * Represents an item in a Tree.
1385
+ */
1386
+ declare class TreeItemPattern<V> implements ListItem<V>, ExpansionItem {
1387
+ readonly inputs: TreeItemInputs<V>;
1388
+ /** A unique identifier for this item. */
1389
+ readonly id: SignalLike<string>;
1390
+ /** The value of this item. */
1391
+ readonly value: SignalLike<V>;
1392
+ /** A reference to the item element. */
1393
+ readonly element: SignalLike<HTMLElement>;
1394
+ /** Whether the item is disabled. */
1395
+ readonly disabled: SignalLike<boolean>;
1396
+ /** The text used by the typeahead search. */
1397
+ readonly searchTerm: SignalLike<string>;
1398
+ /** The tree pattern this item belongs to. */
1399
+ readonly tree: SignalLike<TreePattern<V>>;
1400
+ /** The parent item. */
1401
+ readonly parent: SignalLike<TreeItemPattern<V> | TreePattern<V>>;
1402
+ /** The children items. */
1403
+ readonly children: SignalLike<TreeItemPattern<V>[]>;
1404
+ /** The position of this item among its siblings. */
1405
+ readonly index: _angular_core.Signal<number>;
1406
+ /** The unique identifier used by the expansion behavior. */
1407
+ readonly expansionId: SignalLike<string>;
1408
+ /** Controls expansion for child items. */
1409
+ readonly expansionManager: ListExpansion;
1410
+ /** Controls expansion for this item. */
1411
+ readonly expansion: ExpansionControl;
1412
+ /** Whether the item is expandable. It's expandable if children item exist. */
1413
+ readonly expandable: SignalLike<boolean>;
1414
+ /** Whether the item is selectable. */
1415
+ readonly selectable: SignalLike<boolean>;
1416
+ /** The level of the current item in a tree. */
1417
+ readonly level: SignalLike<number>;
1418
+ /** Whether this item is currently expanded. */
1419
+ readonly expanded: _angular_core.Signal<boolean>;
1420
+ /** Whether this item is visible. */
1421
+ readonly visible: _angular_core.Signal<boolean>;
1422
+ /** The number of items under the same parent at the same level. */
1423
+ readonly setsize: _angular_core.Signal<number>;
1424
+ /** The position of this item among its siblings (1-based). */
1425
+ readonly posinset: _angular_core.Signal<number>;
1426
+ /** Whether the item is active. */
1427
+ readonly active: _angular_core.Signal<boolean>;
1428
+ /** The tabindex of the item. */
1429
+ readonly tabindex: _angular_core.Signal<0 | -1>;
1430
+ /** Whether the item is selected. */
1431
+ readonly selected: SignalLike<boolean | undefined>;
1432
+ /** The current type of this item. */
1433
+ readonly current: SignalLike<string | undefined>;
1434
+ constructor(inputs: TreeItemInputs<V>);
1435
+ }
1436
+ /** The selection operations that the tree can perform. */
1437
+ interface SelectOptions {
1438
+ toggle?: boolean;
1439
+ selectOne?: boolean;
1440
+ selectRange?: boolean;
1441
+ anchor?: boolean;
1442
+ }
1443
+ /** Represents the required inputs for a tree. */
1444
+ interface TreeInputs<V> extends Omit<ListInputs<TreeItemPattern<V>, V>, 'items'> {
1445
+ /** A unique identifier for the tree. */
1446
+ id: SignalLike<string>;
1447
+ /** All items in the tree, in document order (DFS-like, a flattened list). */
1448
+ allItems: SignalLike<TreeItemPattern<V>[]>;
1449
+ /** Whether the tree is in navigation mode. */
1450
+ nav: SignalLike<boolean>;
1451
+ /** The aria-current type. */
1452
+ currentType: SignalLike<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>;
1453
+ }
1454
+ interface TreePattern<V> extends TreeInputs<V> {
1455
+ }
1456
+ /** Controls the state and interactions of a tree view. */
1457
+ declare class TreePattern<V> {
1458
+ readonly inputs: TreeInputs<V>;
1459
+ /** The list behavior for the tree. */
1460
+ readonly listBehavior: List<TreeItemPattern<V>, V>;
1461
+ /** Controls expansion for direct children of the tree root (top-level items). */
1462
+ readonly expansionManager: ListExpansion;
1463
+ /** The root level is 0. */
1464
+ readonly level: () => number;
1465
+ /** The root is always expanded. */
1466
+ readonly expanded: () => boolean;
1467
+ /** The tabindex of the tree. */
1468
+ readonly tabindex: SignalLike<-1 | 0>;
1469
+ /** The id of the current active item. */
1470
+ readonly activedescendant: _angular_core.Signal<string | undefined>;
1471
+ /** The direct children of the root (top-level tree items). */
1472
+ readonly children: _angular_core.Signal<TreeItemPattern<V>[]>;
1473
+ /** All currently visible tree items. An item is visible if their parent is expanded. */
1474
+ readonly visibleItems: _angular_core.Signal<TreeItemPattern<V>[]>;
1475
+ /** Whether the tree selection follows focus. */
1476
+ readonly followFocus: _angular_core.Signal<boolean>;
1477
+ /** The key for navigating to the previous item. */
1478
+ readonly prevKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
1479
+ /** The key for navigating to the next item. */
1480
+ readonly nextKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
1481
+ /** The key for collapsing an item or moving to its parent. */
1482
+ readonly collapseKey: _angular_core.Signal<"ArrowUp" | "ArrowRight" | "ArrowLeft">;
1483
+ /** The key for expanding an item or moving to its first child. */
1484
+ readonly expandKey: _angular_core.Signal<"ArrowRight" | "ArrowLeft" | "ArrowDown">;
1485
+ /** Represents the space key. Does nothing when the user is actively using typeahead. */
1486
+ readonly dynamicSpaceKey: _angular_core.Signal<"" | " ">;
1487
+ /** Regular expression to match characters for typeahead. */
1488
+ readonly typeaheadRegexp: RegExp;
1489
+ /** The keydown event manager for the tree. */
1490
+ readonly keydown: _angular_core.Signal<KeyboardEventManager<KeyboardEvent>>;
1491
+ /** The pointerdown event manager for the tree. */
1492
+ pointerdown: _angular_core.Signal<PointerEventManager<PointerEvent>>;
1493
+ /** A unique identifier for the tree. */
1494
+ id: SignalLike<string>;
1495
+ /** Whether the tree is in navigation mode. */
1496
+ nav: SignalLike<boolean>;
1497
+ /** The aria-current type. */
1498
+ currentType: SignalLike<'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false'>;
1499
+ /** All items in the tree, in document order (DFS-like, a flattened list). */
1500
+ allItems: SignalLike<TreeItemPattern<V>[]>;
1501
+ /** Whether the tree is disabled. */
1502
+ disabled: SignalLike<boolean>;
1503
+ /** The currently active item in the tree. */
1504
+ activeItem: WritableSignalLike<TreeItemPattern<V> | undefined>;
1505
+ /** Whether disabled items should be skipped when navigating. */
1506
+ skipDisabled: SignalLike<boolean>;
1507
+ /** Whether the focus should wrap when navigating past the first or last item. */
1508
+ wrap: SignalLike<boolean>;
1509
+ /** The orientation of the tree. */
1510
+ orientation: SignalLike<'vertical' | 'horizontal'>;
1511
+ /** The text direction of the tree. */
1512
+ textDirection: SignalLike<'ltr' | 'rtl'>;
1513
+ /** Whether multiple items can be selected at the same time. */
1514
+ multi: SignalLike<boolean>;
1515
+ /** The selection mode of the tree. */
1516
+ selectionMode: SignalLike<'follow' | 'explicit'>;
1517
+ /** The delay in milliseconds to wait before clearing the typeahead buffer. */
1518
+ typeaheadDelay: SignalLike<number>;
1519
+ /** The current value of the tree (the selected items). */
1520
+ value: WritableSignalLike<V[]>;
1521
+ constructor(inputs: TreeInputs<V>);
1522
+ /**
1523
+ * Sets the tree to it's default initial state.
1524
+ *
1525
+ * Sets the active index of the tree to the first focusable selected tree item if one exists.
1526
+ * Otherwise, sets focus to the first focusable tree item.
1527
+ */
1528
+ setDefaultState(): void;
1529
+ /** Handles keydown events on the tree. */
1530
+ onKeydown(event: KeyboardEvent): void;
1531
+ /** Handles pointerdown events on the tree. */
1532
+ onPointerdown(event: PointerEvent): void;
1533
+ /** Navigates to the given tree item in the tree. */
1534
+ goto(e: PointerEvent, opts?: SelectOptions): void;
1535
+ /** Toggles to expand or collapse a tree item. */
1536
+ toggleExpansion(item?: TreeItemPattern<V>): void;
1537
+ /** Expands a tree item. */
1538
+ expand(opts?: SelectOptions): void;
1539
+ /** Expands all sibling tree items including itself. */
1540
+ expandSiblings(item?: TreeItemPattern<V>): void;
1541
+ /** Collapses a tree item. */
1542
+ collapse(opts?: SelectOptions): void;
1543
+ /** Retrieves the TreeItemPattern associated with a DOM event, if any. */
1544
+ protected _getItem(event: Event): TreeItemPattern<V> | undefined;
1545
+ }
1546
+
1547
+ type ComboboxTreeInputs<V> = TreeInputs<V> & {
1548
+ /** The combobox controlling the tree. */
1549
+ combobox: SignalLike<ComboboxPattern<TreeItemPattern<V>, V> | undefined>;
1550
+ };
1551
+ declare class ComboboxTreePattern<V> extends TreePattern<V> implements ComboboxTreeControls<TreeItemPattern<V>, V> {
1552
+ readonly inputs: ComboboxTreeInputs<V>;
1553
+ /** Whether the currently focused item is collapsible. */
1554
+ isItemCollapsible: () => boolean;
1555
+ /** The ARIA role for the tree. */
1556
+ role: () => "tree";
1557
+ activeId: _angular_core.Signal<string | undefined>;
1558
+ /** The list of items in the tree. */
1559
+ items: _angular_core.Signal<TreeItemPattern<V>[]>;
1560
+ /** The tabindex for the tree. Always -1 because the combobox handles focus. */
1561
+ tabindex: SignalLike<-1 | 0>;
1562
+ constructor(inputs: ComboboxTreeInputs<V>);
1563
+ /** Noop. The combobox handles keydown events. */
1564
+ onKeydown(_: KeyboardEvent): void;
1565
+ /** Noop. The combobox handles pointerdown events. */
1566
+ onPointerdown(_: PointerEvent): void;
1567
+ /** Noop. The combobox controls the open state. */
1568
+ setDefaultState(): void;
1569
+ /** Navigates to the specified item in the tree. */
1570
+ focus: (item: TreeItemPattern<V>) => void;
1571
+ /** Navigates to the next focusable item in the tree. */
1572
+ next: () => void;
1573
+ /** Navigates to the previous focusable item in the tree. */
1574
+ prev: () => void;
1575
+ /** Navigates to the last focusable item in the tree. */
1576
+ last: () => void;
1577
+ /** Navigates to the first focusable item in the tree. */
1578
+ first: () => void;
1579
+ /** Unfocuses the currently focused item in the tree. */
1580
+ unfocus: () => void;
1581
+ /** Selects the specified item in the tree or the current active item if not provided. */
1582
+ select: (item?: TreeItemPattern<V>) => void;
1583
+ /** Clears the selection in the tree. */
1584
+ clearSelection: () => void;
1585
+ /** Retrieves the TreeItemPattern associated with a pointer event. */
1586
+ getItem: (e: PointerEvent) => TreeItemPattern<V> | undefined;
1587
+ /** Retrieves the currently selected item in the tree */
1588
+ getSelectedItem: () => TreeItemPattern<V> | undefined;
1589
+ /** Sets the value of the combobox tree. */
1590
+ setValue: (value: V | undefined) => void;
1591
+ /** Expands the currently focused item if it is expandable. */
1592
+ expandItem: () => void;
1593
+ /** Collapses the currently focused item if it is expandable. */
1594
+ collapseItem: () => void;
1595
+ /** Whether the specified item or the currently active item is expandable. */
1596
+ isItemExpandable(item?: TreeItemPattern<V> | undefined): boolean;
1597
+ /** Expands all of the tree items. */
1598
+ expandAll: () => void;
1599
+ /** Collapses all of the tree items. */
1600
+ collapseAll: () => void;
1601
+ }
1602
+
1603
+ export { AccordionGroupPattern, AccordionPanelPattern, AccordionTriggerPattern, ComboboxListboxPattern, ComboboxPattern, ComboboxTreePattern, ListboxPattern, MenuBarPattern, MenuItemPattern, MenuPattern, MenuTriggerPattern, OptionPattern, RadioButtonPattern, RadioGroupPattern, SignalLike, TabListPattern, TabPanelPattern, TabPattern, ToolbarPattern, ToolbarRadioGroupPattern, ToolbarWidgetGroupPattern, ToolbarWidgetPattern, TreeItemPattern, TreePattern, WritableSignalLike };
1604
+ export type { AccordionGroupInputs, AccordionPanelInputs, AccordionTriggerInputs, ComboboxInputs, ComboboxListboxControls, ComboboxListboxInputs, ComboboxTreeControls, ComboboxTreeInputs, ListboxInputs, MenuBarInputs, MenuInputs, MenuItemInputs, MenuTriggerInputs, OptionInputs, RadioButtonInputs, RadioGroupInputs, TabInputs, TabListInputs, TabPanelInputs, ToolbarInputs, ToolbarRadioGroupInputs, ToolbarWidgetGroupControls, ToolbarWidgetGroupInputs, ToolbarWidgetInputs, TreeInputs, TreeItemInputs };