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

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 (105) hide show
  1. package/fesm2022/_accordion-chunk.mjs +1 -1
  2. package/fesm2022/_accordion-chunk.mjs.map +1 -1
  3. package/fesm2022/_click-event-manager-chunk.mjs +1 -1
  4. package/fesm2022/_click-event-manager-chunk.mjs.map +1 -1
  5. package/fesm2022/{_signal-like-chunk.mjs → _collection-chunk.mjs} +51 -3
  6. package/fesm2022/_collection-chunk.mjs.map +1 -0
  7. package/fesm2022/_deferred-content-chunk.mjs +16 -14
  8. package/fesm2022/_deferred-content-chunk.mjs.map +1 -1
  9. package/fesm2022/_expansion-chunk.mjs.map +1 -1
  10. package/fesm2022/_list-chunk.mjs +4 -1
  11. package/fesm2022/_list-chunk.mjs.map +1 -1
  12. package/fesm2022/_list-navigation-chunk.mjs +4 -2
  13. package/fesm2022/_list-navigation-chunk.mjs.map +1 -1
  14. package/fesm2022/_list-typeahead-chunk.mjs +1 -1
  15. package/fesm2022/_list-typeahead-chunk.mjs.map +1 -1
  16. package/fesm2022/_menu-chunk.mjs +1 -1
  17. package/fesm2022/_menu-chunk.mjs.map +1 -1
  18. package/fesm2022/{_combobox-listbox-chunk.mjs → _option-chunk.mjs} +6 -50
  19. package/fesm2022/_option-chunk.mjs.map +1 -0
  20. package/fesm2022/_tabs-chunk.mjs +22 -47
  21. package/fesm2022/_tabs-chunk.mjs.map +1 -1
  22. package/fesm2022/_toolbar-widget-group-chunk.mjs +1 -1
  23. package/fesm2022/_toolbar-widget-group-chunk.mjs.map +1 -1
  24. package/fesm2022/_transforms-chunk.mjs +8 -0
  25. package/fesm2022/_transforms-chunk.mjs.map +1 -0
  26. package/fesm2022/{_combobox-tree-chunk.mjs → _tree-chunk.mjs} +3 -48
  27. package/fesm2022/_tree-chunk.mjs.map +1 -0
  28. package/fesm2022/_widget-chunk.mjs +84 -21
  29. package/fesm2022/_widget-chunk.mjs.map +1 -1
  30. package/fesm2022/accordion-testing.mjs.map +1 -1
  31. package/fesm2022/accordion.mjs +32 -57
  32. package/fesm2022/accordion.mjs.map +1 -1
  33. package/fesm2022/aria.mjs +1 -1
  34. package/fesm2022/aria.mjs.map +1 -1
  35. package/fesm2022/combobox-testing.mjs +79 -0
  36. package/fesm2022/combobox-testing.mjs.map +1 -0
  37. package/fesm2022/combobox.mjs +287 -296
  38. package/fesm2022/combobox.mjs.map +1 -1
  39. package/fesm2022/grid-testing.mjs +80 -0
  40. package/fesm2022/grid-testing.mjs.map +1 -0
  41. package/fesm2022/grid.mjs +113 -86
  42. package/fesm2022/grid.mjs.map +1 -1
  43. package/fesm2022/listbox-testing.mjs +4 -0
  44. package/fesm2022/listbox-testing.mjs.map +1 -1
  45. package/fesm2022/listbox.mjs +231 -225
  46. package/fesm2022/listbox.mjs.map +1 -1
  47. package/fesm2022/menu-testing.mjs +11 -0
  48. package/fesm2022/menu-testing.mjs.map +1 -1
  49. package/fesm2022/menu.mjs +66 -84
  50. package/fesm2022/menu.mjs.map +1 -1
  51. package/fesm2022/private.mjs +166 -9
  52. package/fesm2022/private.mjs.map +1 -1
  53. package/fesm2022/tabs-testing.mjs.map +1 -1
  54. package/fesm2022/tabs.mjs +241 -222
  55. package/fesm2022/tabs.mjs.map +1 -1
  56. package/fesm2022/toolbar-testing.mjs +5 -1
  57. package/fesm2022/toolbar-testing.mjs.map +1 -1
  58. package/fesm2022/toolbar.mjs +23 -33
  59. package/fesm2022/toolbar.mjs.map +1 -1
  60. package/fesm2022/tree-testing.mjs +12 -0
  61. package/fesm2022/tree-testing.mjs.map +1 -1
  62. package/fesm2022/tree.mjs +160 -156
  63. package/fesm2022/tree.mjs.map +1 -1
  64. package/package.json +10 -2
  65. package/types/_accordion-chunk.d.ts +2 -2
  66. package/types/_collection-chunk.d.ts +42 -0
  67. package/types/_expansion-chunk.d.ts +1 -1
  68. package/types/_grid-chunk.d.ts +23 -9
  69. package/types/_keyboard-event-manager-chunk.d.ts +1 -1
  70. package/types/_list-chunk.d.ts +1 -1
  71. package/types/_list-navigation-chunk.d.ts +1 -1
  72. package/types/_listbox-chunk.d.ts +1 -1
  73. package/types/_menu-chunk.d.ts +1 -1
  74. package/types/_tabs-chunk.d.ts +8 -43
  75. package/types/_toolbar-chunk.d.ts +1 -1
  76. package/types/_tree-chunk.d.ts +1 -1
  77. package/types/accordion.d.ts +7 -13
  78. package/types/combobox-testing.d.ts +63 -0
  79. package/types/combobox.d.ts +96 -192
  80. package/types/grid-testing.d.ts +83 -0
  81. package/types/grid.d.ts +102 -90
  82. package/types/listbox-testing.d.ts +25 -0
  83. package/types/listbox.d.ts +60 -63
  84. package/types/menu-testing.d.ts +6 -0
  85. package/types/menu.d.ts +24 -17
  86. package/types/private.d.ts +115 -133
  87. package/types/tabs.d.ts +26 -24
  88. package/types/toolbar-testing.d.ts +4 -0
  89. package/types/toolbar.d.ts +5 -6
  90. package/types/tree-testing.d.ts +8 -0
  91. package/types/tree.d.ts +11 -15
  92. package/fesm2022/_combobox-chunk.mjs +0 -429
  93. package/fesm2022/_combobox-chunk.mjs.map +0 -1
  94. package/fesm2022/_combobox-listbox-chunk.mjs.map +0 -1
  95. package/fesm2022/_combobox-tree-chunk.mjs.map +0 -1
  96. package/fesm2022/_element-chunk.mjs +0 -6
  97. package/fesm2022/_element-chunk.mjs.map +0 -1
  98. package/fesm2022/_pointer-event-manager-chunk.mjs +0 -54
  99. package/fesm2022/_pointer-event-manager-chunk.mjs.map +0 -1
  100. package/fesm2022/_signal-like-chunk.mjs.map +0 -1
  101. package/resources/code-examples.db +0 -0
  102. package/types/_combobox-chunk.d.ts +0 -194
  103. package/types/_element-chunk.d.ts +0 -10
  104. package/types/_pointer-event-manager-chunk.d.ts +0 -34
  105. package/types/_signal-like-chunk.d.ts +0 -14
@@ -1,194 +0,0 @@
1
- import { KeyboardEventManager } from './_keyboard-event-manager-chunk.js';
2
- import { PointerEventManager } from './_pointer-event-manager-chunk.js';
3
- import { SignalLike, WritableSignalLike } from './_signal-like-chunk.js';
4
- import { ListItem } from './_list-chunk.js';
5
-
6
- /** Represents the required inputs for a combobox. */
7
- interface ComboboxInputs<T extends ListItem<V>, V> {
8
- /** The controls for the popup associated with the combobox. */
9
- popupControls: SignalLike<ComboboxListboxControls<T, V> | ComboboxTreeControls<T, V> | ComboboxDialogPattern | undefined>;
10
- /** The HTML input element that serves as the combobox input. */
11
- inputEl: SignalLike<HTMLInputElement | undefined>;
12
- /** The HTML element that serves as the combobox container. */
13
- containerEl: SignalLike<HTMLElement | undefined>;
14
- /** The filtering mode for the combobox. */
15
- filterMode: SignalLike<'manual' | 'auto-select' | 'highlight'>;
16
- /** The current value of the combobox. */
17
- inputValue?: WritableSignalLike<string>;
18
- /** The value of the first matching item in the popup. */
19
- firstMatch: SignalLike<V | undefined>;
20
- /** Whether the combobox is disabled. */
21
- disabled: SignalLike<boolean>;
22
- /** Whether the combobox is read-only. */
23
- readonly: SignalLike<boolean>;
24
- /** Whether the combobox is in a right-to-left context. */
25
- textDirection: SignalLike<'rtl' | 'ltr'>;
26
- /** Whether the combobox is always expanded. */
27
- alwaysExpanded: SignalLike<boolean>;
28
- }
29
- /** An interface that allows combobox popups to expose the necessary controls for the combobox. */
30
- interface ComboboxListboxControls<T extends ListItem<V>, V> {
31
- /** A unique identifier for the popup. */
32
- readonly id: () => string;
33
- /** The ARIA role for the popup. */
34
- role: SignalLike<'listbox' | 'tree' | 'grid'>;
35
- /** Whether multiple items in the popup can be selected at once. */
36
- multi: SignalLike<boolean>;
37
- /** The ID of the active item in the popup. */
38
- activeId: SignalLike<string | undefined>;
39
- /** The list of items in the popup. */
40
- items: SignalLike<T[]>;
41
- /** Navigates to the given item in the popup. */
42
- focus: (item: T, opts?: {
43
- focusElement?: boolean;
44
- }) => void;
45
- /** Navigates to the next item in the popup. */
46
- next: () => void;
47
- /** Navigates to the previous item in the popup. */
48
- prev: () => void;
49
- /** Navigates to the first item in the popup. */
50
- first: () => void;
51
- /** Navigates to the last item in the popup. */
52
- last: () => void;
53
- /** Selects the current item in the popup. */
54
- select: (item?: T) => void;
55
- /** Toggles the selection state of the given item in the popup. */
56
- toggle: (item?: T) => void;
57
- /** Clears the selection state of the popup. */
58
- clearSelection: () => void;
59
- /** Removes focus from any item in the popup. */
60
- unfocus: () => void;
61
- /** Returns the item corresponding to the given event. */
62
- getItem: (e: PointerEvent) => T | undefined;
63
- /** Returns the currently active (focused) item in the popup. */
64
- getActiveItem: () => T | undefined;
65
- /** Returns the currently selected items in the popup. */
66
- getSelectedItems: () => T[];
67
- /** Sets the value of the combobox based on the selected item. */
68
- setValue: (value: V | undefined) => void;
69
- }
70
- interface ComboboxTreeControls<T extends ListItem<V>, V> extends ComboboxListboxControls<T, V> {
71
- /** Whether the currently active item in the popup is collapsible. */
72
- isItemCollapsible: () => boolean;
73
- /** Expands the currently active item in the popup. */
74
- expandItem: () => void;
75
- /** Collapses the currently active item in the popup. */
76
- collapseItem: () => void;
77
- /** Checks if the currently active item in the popup is expandable. */
78
- isItemExpandable: (item?: T) => boolean;
79
- /** Expands all nodes in the tree. */
80
- expandAll: () => void;
81
- /** Collapses all nodes in the tree. */
82
- collapseAll: () => void;
83
- /** Toggles the expansion state of the currently active item in the popup. */
84
- toggleExpansion: (item?: T) => void;
85
- /** Whether the current active item is selectable. */
86
- isItemSelectable: (item?: T) => boolean;
87
- }
88
- /** Controls the state of a combobox. */
89
- declare class ComboboxPattern<T extends ListItem<V>, V> {
90
- readonly inputs: ComboboxInputs<T, V>;
91
- /** Whether the combobox is expanded. */
92
- readonly expanded: WritableSignalLike<boolean>;
93
- /** Whether the combobox is disabled. */
94
- readonly disabled: () => boolean;
95
- /** The ID of the active item in the combobox. */
96
- readonly activeDescendant: SignalLike<string | null>;
97
- /** The currently highlighted item in the combobox. */
98
- readonly highlightedItem: WritableSignalLike<T | undefined>;
99
- /** Whether the most recent input event was a deletion. */
100
- private _isDeleting;
101
- /** Whether the combobox is focused. */
102
- readonly isFocused: WritableSignalLike<boolean>;
103
- /** Whether the combobox has ever been focused. */
104
- readonly hasBeenInteracted: WritableSignalLike<boolean>;
105
- /** The key used to navigate to the previous item in the list. */
106
- readonly expandKey: SignalLike<"ArrowLeft" | "ArrowRight">;
107
- /** The key used to navigate to the next item in the list. */
108
- readonly collapseKey: SignalLike<"ArrowLeft" | "ArrowRight">;
109
- /** The ID of the popup associated with the combobox. */
110
- readonly popupId: SignalLike<string | null>;
111
- /** The autocomplete behavior of the combobox. */
112
- readonly autocomplete: SignalLike<"both" | "list">;
113
- /** The ARIA role of the popup associated with the combobox. */
114
- readonly hasPopup: SignalLike<"listbox" | "tree" | "grid" | "dialog" | null>;
115
- /** Whether the combobox is read-only. */
116
- readonly readonly: SignalLike<true | null>;
117
- /** Returns the listbox controls for the combobox. */
118
- readonly listControls: () => ComboboxListboxControls<T, V> | null | undefined;
119
- /** Returns the tree controls for the combobox. */
120
- readonly treeControls: () => ComboboxTreeControls<T, V> | null;
121
- /** The keydown event manager for the combobox. */
122
- readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
123
- /** The click event manager for the combobox. */
124
- readonly click: SignalLike<PointerEventManager<PointerEvent>>;
125
- constructor(inputs: ComboboxInputs<T, V>);
126
- /** Handles keydown events for the combobox. */
127
- onKeydown(event: KeyboardEvent): void;
128
- /** Handles click events for the combobox. */
129
- onClick(event: MouseEvent): void;
130
- /** Handles input events for the combobox. */
131
- onInput(event: Event): void;
132
- /** Handles focus in events for the combobox. */
133
- onFocusIn(): void;
134
- /** Handles focus out events for the combobox. */
135
- onFocusOut(event: FocusEvent): void;
136
- /** The first matching item in the combobox. */
137
- readonly firstMatch: SignalLike<T | undefined>;
138
- /** Handles filtering logic for the combobox. */
139
- onFilter(): void;
140
- /** Highlights the currently selected item in the combobox. */
141
- highlight(): void;
142
- /** Closes the combobox. */
143
- close(opts?: {
144
- reset: boolean;
145
- }): void;
146
- /** Opens the combobox. */
147
- open(nav?: {
148
- first?: boolean;
149
- last?: boolean;
150
- selected?: boolean;
151
- }): void;
152
- /** Navigates to the next focusable item in the combobox popup. */
153
- next(): void;
154
- /** Navigates to the previous focusable item in the combobox popup. */
155
- prev(): void;
156
- /** Navigates to the first focusable item in the combobox popup. */
157
- first(): void;
158
- /** Navigates to the last focusable item in the combobox popup. */
159
- last(): void;
160
- /** Collapses the currently focused item in the combobox. */
161
- collapseItem(): void;
162
- /** Expands the currently focused item in the combobox. */
163
- expandItem(): void;
164
- /** Selects an item in the combobox popup. */
165
- select(opts?: {
166
- item?: T;
167
- commit?: boolean;
168
- close?: boolean;
169
- }): void;
170
- /** Updates the value of the input based on the currently selected item. */
171
- commit(): void;
172
- /** Navigates and handles additional actions based on filter mode. */
173
- private _navigate;
174
- }
175
- declare class ComboboxDialogPattern {
176
- readonly inputs: {
177
- combobox: ComboboxPattern<any, any>;
178
- element: SignalLike<HTMLDialogElement>;
179
- id: SignalLike<string>;
180
- };
181
- readonly id: () => string;
182
- readonly role: () => "dialog";
183
- readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
184
- constructor(inputs: {
185
- combobox: ComboboxPattern<any, any>;
186
- element: SignalLike<HTMLDialogElement>;
187
- id: SignalLike<string>;
188
- });
189
- onKeydown(event: KeyboardEvent): void;
190
- onClick(event: MouseEvent): void;
191
- }
192
-
193
- export { ComboboxDialogPattern, ComboboxPattern };
194
- export type { ComboboxInputs, ComboboxListboxControls, ComboboxTreeControls };
@@ -1,10 +0,0 @@
1
- interface HasElement {
2
- element: HTMLElement;
3
- }
4
- /**
5
- * Sort directives by their document order.
6
- */
7
- declare function sortDirectives(a: HasElement, b: HasElement): 1 | -1;
8
-
9
- export { sortDirectives };
10
- export type { HasElement };
@@ -1,34 +0,0 @@
1
- import { EventManager, EventHandlerOptions, ModifierInputs, EventHandler } from './_keyboard-event-manager-chunk.js';
2
-
3
- /**
4
- * The different mouse buttons that may appear on a pointer event.
5
- */
6
- declare enum MouseButton {
7
- Main = 0,
8
- Auxiliary = 1,
9
- Secondary = 2
10
- }
11
- /** An event manager that is specialized for handling pointer events. */
12
- declare class PointerEventManager<T extends PointerEvent> extends EventManager<T> {
13
- readonly options: EventHandlerOptions;
14
- /**
15
- * Configures this event manager to handle events with a specific modifer and mouse button
16
- * combination.
17
- */
18
- on(button: MouseButton, modifiers: ModifierInputs, handler: EventHandler<T>): this;
19
- /**
20
- * Configures this event manager to handle events with a specific mouse button and no modifiers.
21
- */
22
- on(modifiers: ModifierInputs, handler: EventHandler<T>): this;
23
- /**
24
- * Configures this event manager to handle events with the main mouse button and no modifiers.
25
- *
26
- * @param handler The handler function
27
- * @param options Options for whether to stop propagation or prevent default.
28
- */
29
- on(handler: EventHandler<T>): this;
30
- private _normalizeInputs;
31
- _isMatch(event: PointerEvent, button: MouseButton, modifiers: ModifierInputs): boolean;
32
- }
33
-
34
- export { PointerEventManager };
@@ -1,14 +0,0 @@
1
- type SignalLike<T> = () => T;
2
- interface WritableSignalLike<T> extends SignalLike<T> {
3
- set(value: T): void;
4
- update(updateFn: (value: T) => T): void;
5
- asReadonly(): SignalLike<T>;
6
- }
7
- /** Converts a getter setter style signal to a WritableSignalLike. */
8
- declare function convertGetterSetterToWritableSignalLike<T>(getter: () => T, setter: (v: T) => void): WritableSignalLike<T>;
9
- declare function computed<T>(computation: () => T): SignalLike<T>;
10
- declare function signal<T>(initialValue: T): WritableSignalLike<T>;
11
- declare function linkedSignal<T>(sourceFn: () => T): WritableSignalLike<T>;
12
-
13
- export { computed, convertGetterSetterToWritableSignalLike, linkedSignal, signal };
14
- export type { SignalLike, WritableSignalLike };