@angular/aria 21.0.0-rc.0 → 21.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_adev_assets/aria-accordion.json +443 -59
- package/_adev_assets/aria-combobox.json +345 -37
- package/_adev_assets/aria-grid.json +408 -71
- package/_adev_assets/aria-listbox.json +115 -35
- package/_adev_assets/aria-menu.json +492 -167
- package/_adev_assets/aria-tabs.json +272 -88
- package/_adev_assets/aria-toolbar.json +151 -133
- package/_adev_assets/aria-tree.json +182 -35
- package/fesm2022/_widget-chunk.mjs +643 -190
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +129 -77
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +140 -27
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +254 -68
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +54 -44
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +270 -108
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +752 -785
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +101 -71
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +87 -64
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +105 -60
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -10
- package/types/_grid-chunk.d.ts +326 -83
- package/types/accordion.d.ts +134 -35
- package/types/combobox.d.ts +146 -13
- package/types/grid.d.ts +159 -32
- package/types/listbox.d.ts +59 -28
- package/types/menu.d.ts +151 -55
- package/types/private.d.ts +449 -567
- package/types/tabs.d.ts +121 -41
- package/types/toolbar.d.ts +74 -51
- package/types/tree.d.ts +116 -45
- package/_adev_assets/aria-radio-group.json +0 -389
- package/fesm2022/deferred-content.mjs +0 -99
- package/fesm2022/deferred-content.mjs.map +0 -1
- package/fesm2022/radio-group.mjs +0 -338
- package/fesm2022/radio-group.mjs.map +0 -1
- package/types/deferred-content.d.ts +0 -38
- package/types/radio-group.d.ts +0 -84
package/types/menu.d.ts
CHANGED
|
@@ -1,67 +1,101 @@
|
|
|
1
|
-
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
2
1
|
import * as _angular_core from '@angular/core';
|
|
3
2
|
import { Signal } from '@angular/core';
|
|
3
|
+
import * as _angular_cdk_bidi from '@angular/cdk/bidi';
|
|
4
|
+
import * as i1 from '@angular/aria/private';
|
|
4
5
|
import { MenuTriggerPattern, MenuPattern, MenuItemPattern, SignalLike, MenuBarPattern } from '@angular/aria/private';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* A trigger for a menu.
|
|
8
9
|
*
|
|
9
|
-
* The
|
|
10
|
-
*
|
|
10
|
+
* The `ngMenuTrigger` directive is used to open and close menus. It can be applied to
|
|
11
|
+
* any interactive element (e.g., a button) to associate it with a `ngMenu` instance.
|
|
12
|
+
* It also supports linking to sub-menus when applied to a `ngMenuItem`.
|
|
13
|
+
*
|
|
14
|
+
* ```html
|
|
15
|
+
* <button ngMenuTrigger [menu]="myMenu">Open Menu</button>
|
|
16
|
+
*
|
|
17
|
+
* <div ngMenu #myMenu="ngMenu">
|
|
18
|
+
* <div ngMenuItem>Item 1</div>
|
|
19
|
+
* <div ngMenuItem>Item 2</div>
|
|
20
|
+
* </div>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @developerPreview 21.0
|
|
11
24
|
*/
|
|
12
25
|
declare class MenuTrigger<V> {
|
|
13
|
-
/** A reference to the
|
|
26
|
+
/** A reference to the host element. */
|
|
14
27
|
private readonly _elementRef;
|
|
15
|
-
/** A reference to the
|
|
16
|
-
readonly element:
|
|
17
|
-
/** The
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
28
|
+
/** A reference to the host element. */
|
|
29
|
+
readonly element: HTMLElement;
|
|
30
|
+
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
31
|
+
readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
|
|
32
|
+
/** The menu associated with the trigger. */
|
|
33
|
+
menu: _angular_core.InputSignal<Menu<V> | undefined>;
|
|
34
|
+
/** Whether the menu is expanded. */
|
|
35
|
+
readonly expanded: Signal<boolean>;
|
|
36
|
+
/** Whether the menu trigger has a popup. */
|
|
37
|
+
readonly hasPopup: Signal<boolean>;
|
|
38
|
+
/** Whether the menu trigger is disabled. */
|
|
39
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
40
|
+
/** Whether the menu trigger is soft disabled. */
|
|
41
|
+
readonly softDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
21
42
|
/** The menu trigger ui pattern instance. */
|
|
22
|
-
|
|
43
|
+
_pattern: MenuTriggerPattern<V>;
|
|
44
|
+
constructor();
|
|
45
|
+
/** Opens the menu focusing on the first menu item. */
|
|
46
|
+
open(): void;
|
|
47
|
+
/** Closes the menu. */
|
|
48
|
+
close(): void;
|
|
23
49
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuTrigger<any>, never>;
|
|
24
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuTrigger<any>, "button[ngMenuTrigger]", ["ngMenuTrigger"], { "
|
|
50
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuTrigger<any>, "button[ngMenuTrigger]", ["ngMenuTrigger"], { "menu": { "alias": "menu"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
25
51
|
}
|
|
26
52
|
/**
|
|
27
53
|
* A list of menu items.
|
|
28
54
|
*
|
|
29
|
-
* A
|
|
30
|
-
* menus to create sub-menus.
|
|
55
|
+
* A `ngMenu` is used to offer a list of menu item choices to users. Menus can be nested
|
|
56
|
+
* within other menus to create sub-menus. It works in conjunction with `ngMenuTrigger`
|
|
57
|
+
* and `ngMenuItem` directives.
|
|
31
58
|
*
|
|
32
59
|
* ```html
|
|
33
|
-
* <button ngMenuTrigger menu="
|
|
60
|
+
* <button ngMenuTrigger [menu]="myMenu">Options</button>
|
|
34
61
|
*
|
|
35
|
-
* <div ngMenu #
|
|
62
|
+
* <div ngMenu #myMenu="ngMenu">
|
|
36
63
|
* <div ngMenuItem>Star</div>
|
|
37
64
|
* <div ngMenuItem>Edit</div>
|
|
38
|
-
* <div ngMenuItem>
|
|
65
|
+
* <div ngMenuItem [submenu]="subMenu">More</div>
|
|
66
|
+
* </div>
|
|
67
|
+
*
|
|
68
|
+
* <div ngMenu #subMenu="ngMenu">
|
|
69
|
+
* <div ngMenuItem>Sub Item 1</div>
|
|
70
|
+
* <div ngMenuItem>Sub Item 2</div>
|
|
39
71
|
* </div>
|
|
40
72
|
* ```
|
|
73
|
+
*
|
|
74
|
+
* @developerPreview 21.0
|
|
41
75
|
*/
|
|
42
76
|
declare class Menu<V> {
|
|
77
|
+
/** The DeferredContentAware host directive. */
|
|
78
|
+
private readonly _deferredContentAware;
|
|
43
79
|
/** The menu items contained in the menu. */
|
|
44
80
|
readonly _allItems: Signal<readonly MenuItem<V>[]>;
|
|
45
81
|
/** The menu items that are direct children of this menu. */
|
|
46
82
|
readonly _items: Signal<MenuItem<V>[]>;
|
|
47
|
-
/** A reference to the
|
|
83
|
+
/** A reference to the host element. */
|
|
48
84
|
private readonly _elementRef;
|
|
49
|
-
/** A reference to the
|
|
85
|
+
/** A reference to the host element. */
|
|
50
86
|
readonly element: HTMLElement;
|
|
51
87
|
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
52
|
-
|
|
53
|
-
/** A signal wrapper for directionality. */
|
|
54
|
-
readonly textDirection: Signal<_angular_cdk_bidi.Direction>;
|
|
55
|
-
/** The submenu associated with the menu. */
|
|
56
|
-
readonly submenu: _angular_core.InputSignal<Menu<V> | undefined>;
|
|
88
|
+
readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
|
|
57
89
|
/** The unique ID of the menu. */
|
|
58
90
|
readonly id: _angular_core.InputSignal<string>;
|
|
59
91
|
/** Whether the menu should wrap its items. */
|
|
60
|
-
readonly wrap: _angular_core.
|
|
61
|
-
/** The delay in
|
|
92
|
+
readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
93
|
+
/** The delay in milliseconds before the typeahead buffer is cleared. */
|
|
62
94
|
readonly typeaheadDelay: _angular_core.InputSignal<number>;
|
|
95
|
+
/** Whether the menu is disabled. */
|
|
96
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
63
97
|
/** A reference to the parent menu item or menu trigger. */
|
|
64
|
-
readonly parent: _angular_core.
|
|
98
|
+
readonly parent: _angular_core.WritableSignal<MenuTrigger<V> | MenuItem<V> | undefined>;
|
|
65
99
|
/** The menu ui pattern instance. */
|
|
66
100
|
readonly _pattern: MenuPattern<V>;
|
|
67
101
|
/**
|
|
@@ -73,65 +107,95 @@ declare class Menu<V> {
|
|
|
73
107
|
*/
|
|
74
108
|
readonly items: () => MenuItemPattern<V>[];
|
|
75
109
|
/** Whether the menu is visible. */
|
|
76
|
-
|
|
110
|
+
readonly visible: Signal<boolean>;
|
|
111
|
+
/** The tab index of the menu. */
|
|
112
|
+
readonly tabIndex: Signal<0 | -1>;
|
|
77
113
|
/** A callback function triggered when a menu item is selected. */
|
|
78
|
-
|
|
114
|
+
onSelect: _angular_core.OutputEmitterRef<V>;
|
|
115
|
+
/** The delay in milliseconds before expanding sub-menus on hover. */
|
|
116
|
+
readonly expansionDelay: _angular_core.InputSignal<number>;
|
|
79
117
|
constructor();
|
|
80
118
|
/** Closes the menu. */
|
|
81
|
-
close(
|
|
82
|
-
refocus?: boolean;
|
|
83
|
-
}): void;
|
|
84
|
-
/** Closes all parent menus. */
|
|
85
|
-
closeAll(opts?: {
|
|
86
|
-
refocus?: boolean;
|
|
87
|
-
}): void;
|
|
119
|
+
close(): void;
|
|
88
120
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Menu<any>, never>;
|
|
89
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Menu<any>, "[ngMenu]", ["ngMenu"], { "
|
|
121
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<Menu<any>, "[ngMenu]", ["ngMenu"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "expansionDelay": { "alias": "expansionDelay"; "required": false; "isSignal": true; }; }, { "onSelect": "onSelect"; }, ["_allItems"], never, true, [{ directive: typeof i1.DeferredContentAware; inputs: { "preserveContent": "preserveContent"; }; outputs: {}; }]>;
|
|
90
122
|
}
|
|
91
123
|
/**
|
|
92
124
|
* A menu bar of menu items.
|
|
93
125
|
*
|
|
94
|
-
* Like the
|
|
95
|
-
* menubar is used to display a persistent, top-level,
|
|
96
|
-
*
|
|
126
|
+
* Like the `ngMenu`, a `ngMenuBar` is used to offer a list of menu item choices to users.
|
|
127
|
+
* However, a menubar is used to display a persistent, top-level, always-visible set of
|
|
128
|
+
* menu item choices, typically found at the top of an application window.
|
|
129
|
+
*
|
|
130
|
+
* ```html
|
|
131
|
+
* <div ngMenuBar>
|
|
132
|
+
* <button ngMenuTrigger [menu]="fileMenu">File</button>
|
|
133
|
+
* <button ngMenuTrigger [menu]="editMenu">Edit</button>
|
|
134
|
+
* </div>
|
|
135
|
+
*
|
|
136
|
+
* <div ngMenu #fileMenu="ngMenu">
|
|
137
|
+
* <div ngMenuItem>New</div>
|
|
138
|
+
* <div ngMenuItem>Open</div>
|
|
139
|
+
* </div>
|
|
140
|
+
*
|
|
141
|
+
* <div ngMenu #editMenu="ngMenu">
|
|
142
|
+
* <div ngMenuItem>Cut</div>
|
|
143
|
+
* <div ngMenuItem>Copy</div>
|
|
144
|
+
* </div>
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* @developerPreview 21.0
|
|
97
148
|
*/
|
|
98
149
|
declare class MenuBar<V> {
|
|
99
150
|
/** The menu items contained in the menubar. */
|
|
100
151
|
readonly _allItems: Signal<readonly MenuItem<V>[]>;
|
|
101
152
|
readonly _items: SignalLike<MenuItem<V>[]>;
|
|
102
|
-
/** A reference to the
|
|
153
|
+
/** A reference to the host element. */
|
|
103
154
|
private readonly _elementRef;
|
|
104
|
-
/** A reference to the
|
|
155
|
+
/** A reference to the host element. */
|
|
105
156
|
readonly element: HTMLElement;
|
|
157
|
+
/** Whether the menubar is disabled. */
|
|
158
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
159
|
+
/** Whether the menubar is soft disabled. */
|
|
160
|
+
readonly softDisabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
106
161
|
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
readonly
|
|
110
|
-
/** The value of the menu. */
|
|
111
|
-
readonly value: _angular_core.ModelSignal<V[]>;
|
|
162
|
+
readonly textDirection: _angular_core.WritableSignal<_angular_cdk_bidi.Direction>;
|
|
163
|
+
/** The values of the currently selected menu items. */
|
|
164
|
+
readonly values: _angular_core.ModelSignal<V[]>;
|
|
112
165
|
/** Whether the menu should wrap its items. */
|
|
113
|
-
readonly wrap: _angular_core.
|
|
114
|
-
/** The delay in
|
|
166
|
+
readonly wrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
167
|
+
/** The delay in milliseconds before the typeahead buffer is cleared. */
|
|
115
168
|
readonly typeaheadDelay: _angular_core.InputSignal<number>;
|
|
116
169
|
/** The menu ui pattern instance. */
|
|
117
170
|
readonly _pattern: MenuBarPattern<V>;
|
|
118
171
|
/** The menu items as a writable signal. */
|
|
119
172
|
readonly items: _angular_core.WritableSignal<MenuItemPattern<V>[]>;
|
|
120
173
|
/** A callback function triggered when a menu item is selected. */
|
|
121
|
-
|
|
174
|
+
onSelect: _angular_core.OutputEmitterRef<V>;
|
|
122
175
|
constructor();
|
|
176
|
+
/** Closes the menubar. */
|
|
177
|
+
close(): void;
|
|
123
178
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuBar<any>, never>;
|
|
124
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuBar<any>, "[ngMenuBar]", ["ngMenuBar"], { "
|
|
179
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuBar<any>, "[ngMenuBar]", ["ngMenuBar"], { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "softDisabled": { "alias": "softDisabled"; "required": false; "isSignal": true; }; "values": { "alias": "values"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "typeaheadDelay": { "alias": "typeaheadDelay"; "required": false; "isSignal": true; }; }, { "values": "valuesChange"; "onSelect": "onSelect"; }, ["_allItems"], never, true, never>;
|
|
125
180
|
}
|
|
126
181
|
/**
|
|
127
182
|
* An item in a Menu.
|
|
128
183
|
*
|
|
129
|
-
*
|
|
184
|
+
* `ngMenuItem` directives can be used in `ngMenu` and `ngMenuBar` to represent a choice
|
|
185
|
+
* or action a user can take. They can also act as triggers for sub-menus.
|
|
186
|
+
*
|
|
187
|
+
* ```html
|
|
188
|
+
* <div ngMenuItem (onSelect)="doAction()">Action Item</div>
|
|
189
|
+
*
|
|
190
|
+
* <div ngMenuItem [submenu]="anotherMenu">Submenu Trigger</div>
|
|
191
|
+
* ```
|
|
192
|
+
*
|
|
193
|
+
* @developerPreview 21.0
|
|
130
194
|
*/
|
|
131
195
|
declare class MenuItem<V> {
|
|
132
|
-
/** A reference to the
|
|
196
|
+
/** A reference to the host element. */
|
|
133
197
|
private readonly _elementRef;
|
|
134
|
-
/** A reference to the
|
|
198
|
+
/** A reference to the host element. */
|
|
135
199
|
readonly element: HTMLElement;
|
|
136
200
|
/** The unique ID of the menu item. */
|
|
137
201
|
readonly id: _angular_core.InputSignal<string>;
|
|
@@ -149,10 +213,42 @@ declare class MenuItem<V> {
|
|
|
149
213
|
readonly parent: Menu<V> | MenuBar<V> | null;
|
|
150
214
|
/** The submenu associated with the menu item. */
|
|
151
215
|
readonly submenu: _angular_core.InputSignal<Menu<V> | undefined>;
|
|
216
|
+
/** Whether the menu item is active. */
|
|
217
|
+
readonly active: Signal<boolean>;
|
|
218
|
+
/** Whether the menu is expanded. */
|
|
219
|
+
readonly expanded: Signal<boolean | null>;
|
|
220
|
+
/** Whether the menu item has a popup. */
|
|
221
|
+
readonly hasPopup: Signal<boolean>;
|
|
152
222
|
/** The menu item ui pattern instance. */
|
|
153
223
|
readonly _pattern: MenuItemPattern<V>;
|
|
224
|
+
constructor();
|
|
225
|
+
/** Opens the submenu focusing on the first menu item. */
|
|
226
|
+
open(): void;
|
|
227
|
+
/** Closes the submenu. */
|
|
228
|
+
close(): void;
|
|
154
229
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuItem<any>, never>;
|
|
155
230
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuItem<any>, "[ngMenuItem]", ["ngMenuItem"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "searchTerm": { "alias": "searchTerm"; "required": false; "isSignal": true; }; "submenu": { "alias": "submenu"; "required": false; "isSignal": true; }; }, { "searchTerm": "searchTermChange"; }, never, never, true, never>;
|
|
156
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* Defers the rendering of the menu content.
|
|
234
|
+
*
|
|
235
|
+
* This structural directive should be applied to an `ng-template` within a `ngMenu`
|
|
236
|
+
* or `ngMenuBar` to lazily render its content only when the menu is opened.
|
|
237
|
+
*
|
|
238
|
+
* ```html
|
|
239
|
+
* <div ngMenu #myMenu="ngMenu">
|
|
240
|
+
* <ng-template ngMenuContent>
|
|
241
|
+
* <div ngMenuItem>Lazy Item 1</div>
|
|
242
|
+
* <div ngMenuItem>Lazy Item 2</div>
|
|
243
|
+
* </ng-template>
|
|
244
|
+
* </div>
|
|
245
|
+
* ```
|
|
246
|
+
*
|
|
247
|
+
* @developerPreview 21.0
|
|
248
|
+
*/
|
|
249
|
+
declare class MenuContent {
|
|
250
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuContent, never>;
|
|
251
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MenuContent, "ng-template[ngMenuContent]", ["ngMenuContent"], {}, {}, never, never, true, [{ directive: typeof i1.DeferredContent; inputs: {}; outputs: {}; }]>;
|
|
252
|
+
}
|
|
157
253
|
|
|
158
|
-
export { Menu, MenuBar, MenuItem, MenuTrigger };
|
|
254
|
+
export { Menu, MenuBar, MenuContent, MenuItem, MenuTrigger };
|