@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/fesm2022/menu.mjs
CHANGED
|
@@ -1,21 +1,52 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input,
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { inject, ElementRef, input, computed, booleanAttribute, effect, Directive, contentChildren, signal, output, afterRenderEffect, untracked, model } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/aria/private';
|
|
4
|
+
import { MenuTriggerPattern, DeferredContentAware, MenuPattern, MenuBarPattern, MenuItemPattern, DeferredContent } from '@angular/aria/private';
|
|
5
|
+
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
5
6
|
import { Directionality } from '@angular/cdk/bidi';
|
|
6
7
|
|
|
7
8
|
class MenuTrigger {
|
|
8
9
|
_elementRef = inject(ElementRef);
|
|
9
10
|
element = this._elementRef.nativeElement;
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
textDirection = inject(Directionality).valueSignal;
|
|
12
|
+
menu = input(undefined, ...(ngDevMode ? [{
|
|
13
|
+
debugName: "menu"
|
|
14
|
+
}] : []));
|
|
15
|
+
expanded = computed(() => this._pattern.expanded(), ...(ngDevMode ? [{
|
|
16
|
+
debugName: "expanded"
|
|
12
17
|
}] : []));
|
|
13
|
-
|
|
18
|
+
hasPopup = computed(() => this._pattern.hasPopup(), ...(ngDevMode ? [{
|
|
19
|
+
debugName: "hasPopup"
|
|
20
|
+
}] : []));
|
|
21
|
+
disabled = input(false, ...(ngDevMode ? [{
|
|
22
|
+
debugName: "disabled",
|
|
23
|
+
transform: booleanAttribute
|
|
24
|
+
}] : [{
|
|
25
|
+
transform: booleanAttribute
|
|
26
|
+
}]));
|
|
27
|
+
softDisabled = input(true, ...(ngDevMode ? [{
|
|
28
|
+
debugName: "softDisabled",
|
|
29
|
+
transform: booleanAttribute
|
|
30
|
+
}] : [{
|
|
31
|
+
transform: booleanAttribute
|
|
32
|
+
}]));
|
|
14
33
|
_pattern = new MenuTriggerPattern({
|
|
15
|
-
|
|
34
|
+
textDirection: this.textDirection,
|
|
16
35
|
element: computed(() => this._elementRef.nativeElement),
|
|
17
|
-
|
|
36
|
+
menu: computed(() => this.menu()?._pattern),
|
|
37
|
+
disabled: () => this.disabled()
|
|
18
38
|
});
|
|
39
|
+
constructor() {
|
|
40
|
+
effect(() => this.menu()?.parent.set(this));
|
|
41
|
+
}
|
|
42
|
+
open() {
|
|
43
|
+
this._pattern.open({
|
|
44
|
+
first: true
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
close() {
|
|
48
|
+
this._pattern.close();
|
|
49
|
+
}
|
|
19
50
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
20
51
|
minVersion: "12.0.0",
|
|
21
52
|
version: "20.2.0-next.2",
|
|
@@ -31,30 +62,43 @@ class MenuTrigger {
|
|
|
31
62
|
isStandalone: true,
|
|
32
63
|
selector: "button[ngMenuTrigger]",
|
|
33
64
|
inputs: {
|
|
34
|
-
|
|
35
|
-
classPropertyName: "
|
|
36
|
-
publicName: "
|
|
65
|
+
menu: {
|
|
66
|
+
classPropertyName: "menu",
|
|
67
|
+
publicName: "menu",
|
|
68
|
+
isSignal: true,
|
|
69
|
+
isRequired: false,
|
|
70
|
+
transformFunction: null
|
|
71
|
+
},
|
|
72
|
+
disabled: {
|
|
73
|
+
classPropertyName: "disabled",
|
|
74
|
+
publicName: "disabled",
|
|
75
|
+
isSignal: true,
|
|
76
|
+
isRequired: false,
|
|
77
|
+
transformFunction: null
|
|
78
|
+
},
|
|
79
|
+
softDisabled: {
|
|
80
|
+
classPropertyName: "softDisabled",
|
|
81
|
+
publicName: "softDisabled",
|
|
37
82
|
isSignal: true,
|
|
38
83
|
isRequired: false,
|
|
39
84
|
transformFunction: null
|
|
40
85
|
}
|
|
41
86
|
},
|
|
42
|
-
outputs: {
|
|
43
|
-
onSubmit: "onSubmit"
|
|
44
|
-
},
|
|
45
87
|
host: {
|
|
46
88
|
listeners: {
|
|
47
89
|
"click": "_pattern.onClick()",
|
|
48
90
|
"keydown": "_pattern.onKeydown($event)",
|
|
49
|
-
"focusout": "_pattern.onFocusOut($event)"
|
|
91
|
+
"focusout": "_pattern.onFocusOut($event)",
|
|
92
|
+
"focusin": "_pattern.onFocusIn()"
|
|
50
93
|
},
|
|
51
94
|
properties: {
|
|
52
|
-
"attr.tabindex": "_pattern.
|
|
53
|
-
"attr.
|
|
54
|
-
"attr.aria-
|
|
55
|
-
"attr.aria-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
"attr.tabindex": "_pattern.tabIndex()",
|
|
96
|
+
"attr.disabled": "!softDisabled() && _pattern.disabled() ? true : null",
|
|
97
|
+
"attr.aria-disabled": "_pattern.disabled()",
|
|
98
|
+
"attr.aria-haspopup": "hasPopup()",
|
|
99
|
+
"attr.aria-expanded": "expanded()",
|
|
100
|
+
"attr.aria-controls": "_pattern.menu()?.id()"
|
|
101
|
+
}
|
|
58
102
|
},
|
|
59
103
|
exportAs: ["ngMenuTrigger"],
|
|
60
104
|
ngImport: i0
|
|
@@ -71,19 +115,25 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
71
115
|
selector: 'button[ngMenuTrigger]',
|
|
72
116
|
exportAs: 'ngMenuTrigger',
|
|
73
117
|
host: {
|
|
74
|
-
'
|
|
75
|
-
'[attr.
|
|
76
|
-
'[attr.aria-
|
|
77
|
-
'[attr.aria-
|
|
78
|
-
'[attr.aria-
|
|
118
|
+
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
119
|
+
'[attr.disabled]': '!softDisabled() && _pattern.disabled() ? true : null',
|
|
120
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
121
|
+
'[attr.aria-haspopup]': 'hasPopup()',
|
|
122
|
+
'[attr.aria-expanded]': 'expanded()',
|
|
123
|
+
'[attr.aria-controls]': '_pattern.menu()?.id()',
|
|
79
124
|
'(click)': '_pattern.onClick()',
|
|
80
125
|
'(keydown)': '_pattern.onKeydown($event)',
|
|
81
|
-
'(focusout)': '_pattern.onFocusOut($event)'
|
|
126
|
+
'(focusout)': '_pattern.onFocusOut($event)',
|
|
127
|
+
'(focusin)': '_pattern.onFocusIn()'
|
|
82
128
|
}
|
|
83
129
|
}]
|
|
84
|
-
}]
|
|
130
|
+
}],
|
|
131
|
+
ctorParameters: () => []
|
|
85
132
|
});
|
|
86
133
|
class Menu {
|
|
134
|
+
_deferredContentAware = inject(DeferredContentAware, {
|
|
135
|
+
optional: true
|
|
136
|
+
});
|
|
87
137
|
_allItems = contentChildren(MenuItem, ...(ngDevMode ? [{
|
|
88
138
|
debugName: "_allItems",
|
|
89
139
|
descendants: true
|
|
@@ -95,67 +145,75 @@ class Menu {
|
|
|
95
145
|
}] : []));
|
|
96
146
|
_elementRef = inject(ElementRef);
|
|
97
147
|
element = this._elementRef.nativeElement;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
initialValue: this._directionality.value
|
|
101
|
-
});
|
|
102
|
-
submenu = input(undefined, ...(ngDevMode ? [{
|
|
103
|
-
debugName: "submenu"
|
|
104
|
-
}] : []));
|
|
105
|
-
id = input(Math.random().toString(36).substring(2, 10), ...(ngDevMode ? [{
|
|
148
|
+
textDirection = inject(Directionality).valueSignal;
|
|
149
|
+
id = input(inject(_IdGenerator).getId('ng-menu-', true), ...(ngDevMode ? [{
|
|
106
150
|
debugName: "id"
|
|
107
151
|
}] : []));
|
|
108
152
|
wrap = input(true, ...(ngDevMode ? [{
|
|
109
|
-
debugName: "wrap"
|
|
110
|
-
|
|
111
|
-
|
|
153
|
+
debugName: "wrap",
|
|
154
|
+
transform: booleanAttribute
|
|
155
|
+
}] : [{
|
|
156
|
+
transform: booleanAttribute
|
|
157
|
+
}]));
|
|
158
|
+
typeaheadDelay = input(500, ...(ngDevMode ? [{
|
|
112
159
|
debugName: "typeaheadDelay"
|
|
113
160
|
}] : []));
|
|
114
|
-
|
|
161
|
+
disabled = input(false, ...(ngDevMode ? [{
|
|
162
|
+
debugName: "disabled",
|
|
163
|
+
transform: booleanAttribute
|
|
164
|
+
}] : [{
|
|
165
|
+
transform: booleanAttribute
|
|
166
|
+
}]));
|
|
167
|
+
parent = signal(undefined, ...(ngDevMode ? [{
|
|
115
168
|
debugName: "parent"
|
|
116
169
|
}] : []));
|
|
117
170
|
_pattern;
|
|
118
171
|
items = () => this._items().map(i => i._pattern);
|
|
119
|
-
|
|
120
|
-
debugName: "
|
|
172
|
+
visible = computed(() => this._pattern.visible(), ...(ngDevMode ? [{
|
|
173
|
+
debugName: "visible"
|
|
174
|
+
}] : []));
|
|
175
|
+
tabIndex = computed(() => this._pattern.tabIndex(), ...(ngDevMode ? [{
|
|
176
|
+
debugName: "tabIndex"
|
|
177
|
+
}] : []));
|
|
178
|
+
onSelect = output();
|
|
179
|
+
expansionDelay = input(100, ...(ngDevMode ? [{
|
|
180
|
+
debugName: "expansionDelay"
|
|
121
181
|
}] : []));
|
|
122
|
-
onSubmit = output();
|
|
123
182
|
constructor() {
|
|
124
183
|
this._pattern = new MenuPattern({
|
|
125
184
|
...this,
|
|
126
185
|
parent: computed(() => this.parent()?._pattern),
|
|
127
186
|
multi: () => false,
|
|
128
|
-
|
|
187
|
+
softDisabled: () => true,
|
|
129
188
|
focusMode: () => 'roving',
|
|
130
189
|
orientation: () => 'vertical',
|
|
131
190
|
selectionMode: () => 'explicit',
|
|
132
191
|
activeItem: signal(undefined),
|
|
133
192
|
element: computed(() => this._elementRef.nativeElement),
|
|
134
|
-
|
|
193
|
+
onSelect: value => this.onSelect.emit(value)
|
|
135
194
|
});
|
|
136
195
|
afterRenderEffect(() => {
|
|
137
|
-
|
|
196
|
+
const parent = this.parent();
|
|
197
|
+
if (parent instanceof MenuItem && parent.parent instanceof MenuBar) {
|
|
198
|
+
this._deferredContentAware?.contentVisible.set(true);
|
|
199
|
+
} else {
|
|
200
|
+
this._deferredContentAware?.contentVisible.set(this._pattern.visible() || !!this.parent()?._pattern.hasBeenFocused());
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
afterRenderEffect(() => {
|
|
204
|
+
if (this._pattern.visible()) {
|
|
138
205
|
const activeItem = untracked(() => this._pattern.inputs.activeItem());
|
|
139
206
|
this._pattern.listBehavior.goto(activeItem);
|
|
140
207
|
}
|
|
141
208
|
});
|
|
142
209
|
afterRenderEffect(() => {
|
|
143
|
-
if (!this._pattern.hasBeenFocused()) {
|
|
144
|
-
this._pattern.setDefaultState();
|
|
210
|
+
if (!this._pattern.hasBeenFocused() && this._items().length) {
|
|
211
|
+
untracked(() => this._pattern.setDefaultState());
|
|
145
212
|
}
|
|
146
213
|
});
|
|
147
214
|
}
|
|
148
|
-
close(
|
|
149
|
-
this._pattern.
|
|
150
|
-
}
|
|
151
|
-
closeAll(opts) {
|
|
152
|
-
const root = this._pattern.root();
|
|
153
|
-
if (root instanceof MenuTriggerPattern) {
|
|
154
|
-
root.close(opts);
|
|
155
|
-
}
|
|
156
|
-
if (root instanceof MenuPattern || root instanceof MenuBarPattern) {
|
|
157
|
-
root.inputs.activeItem()?.close(opts);
|
|
158
|
-
}
|
|
215
|
+
close() {
|
|
216
|
+
this._pattern.close();
|
|
159
217
|
}
|
|
160
218
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
161
219
|
minVersion: "12.0.0",
|
|
@@ -172,13 +230,6 @@ class Menu {
|
|
|
172
230
|
isStandalone: true,
|
|
173
231
|
selector: "[ngMenu]",
|
|
174
232
|
inputs: {
|
|
175
|
-
submenu: {
|
|
176
|
-
classPropertyName: "submenu",
|
|
177
|
-
publicName: "submenu",
|
|
178
|
-
isSignal: true,
|
|
179
|
-
isRequired: false,
|
|
180
|
-
transformFunction: null
|
|
181
|
-
},
|
|
182
233
|
id: {
|
|
183
234
|
classPropertyName: "id",
|
|
184
235
|
publicName: "id",
|
|
@@ -200,16 +251,23 @@ class Menu {
|
|
|
200
251
|
isRequired: false,
|
|
201
252
|
transformFunction: null
|
|
202
253
|
},
|
|
203
|
-
|
|
204
|
-
classPropertyName: "
|
|
205
|
-
publicName: "
|
|
254
|
+
disabled: {
|
|
255
|
+
classPropertyName: "disabled",
|
|
256
|
+
publicName: "disabled",
|
|
257
|
+
isSignal: true,
|
|
258
|
+
isRequired: false,
|
|
259
|
+
transformFunction: null
|
|
260
|
+
},
|
|
261
|
+
expansionDelay: {
|
|
262
|
+
classPropertyName: "expansionDelay",
|
|
263
|
+
publicName: "expansionDelay",
|
|
206
264
|
isSignal: true,
|
|
207
265
|
isRequired: false,
|
|
208
266
|
transformFunction: null
|
|
209
267
|
}
|
|
210
268
|
},
|
|
211
269
|
outputs: {
|
|
212
|
-
|
|
270
|
+
onSelect: "onSelect"
|
|
213
271
|
},
|
|
214
272
|
host: {
|
|
215
273
|
attributes: {
|
|
@@ -225,9 +283,10 @@ class Menu {
|
|
|
225
283
|
},
|
|
226
284
|
properties: {
|
|
227
285
|
"attr.id": "_pattern.id()",
|
|
228
|
-
"attr.
|
|
229
|
-
|
|
230
|
-
|
|
286
|
+
"attr.aria-disabled": "_pattern.disabled()",
|
|
287
|
+
"attr.tabindex": "tabIndex()",
|
|
288
|
+
"attr.data-visible": "visible()"
|
|
289
|
+
}
|
|
231
290
|
},
|
|
232
291
|
queries: [{
|
|
233
292
|
propertyName: "_allItems",
|
|
@@ -236,6 +295,10 @@ class Menu {
|
|
|
236
295
|
isSignal: true
|
|
237
296
|
}],
|
|
238
297
|
exportAs: ["ngMenu"],
|
|
298
|
+
hostDirectives: [{
|
|
299
|
+
directive: i1.DeferredContentAware,
|
|
300
|
+
inputs: ["preserveContent", "preserveContent"]
|
|
301
|
+
}],
|
|
239
302
|
ngImport: i0
|
|
240
303
|
});
|
|
241
304
|
}
|
|
@@ -251,16 +314,21 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
251
314
|
exportAs: 'ngMenu',
|
|
252
315
|
host: {
|
|
253
316
|
'role': 'menu',
|
|
254
|
-
'class': 'ng-menu',
|
|
255
317
|
'[attr.id]': '_pattern.id()',
|
|
256
|
-
'[attr.
|
|
318
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
319
|
+
'[attr.tabindex]': 'tabIndex()',
|
|
320
|
+
'[attr.data-visible]': 'visible()',
|
|
257
321
|
'(keydown)': '_pattern.onKeydown($event)',
|
|
258
322
|
'(mouseover)': '_pattern.onMouseOver($event)',
|
|
259
323
|
'(mouseout)': '_pattern.onMouseOut($event)',
|
|
260
324
|
'(focusout)': '_pattern.onFocusOut($event)',
|
|
261
325
|
'(focusin)': '_pattern.onFocusIn()',
|
|
262
326
|
'(click)': '_pattern.onClick($event)'
|
|
263
|
-
}
|
|
327
|
+
},
|
|
328
|
+
hostDirectives: [{
|
|
329
|
+
directive: DeferredContentAware,
|
|
330
|
+
inputs: ['preserveContent']
|
|
331
|
+
}]
|
|
264
332
|
}]
|
|
265
333
|
}],
|
|
266
334
|
ctorParameters: () => []
|
|
@@ -275,33 +343,45 @@ class MenuBar {
|
|
|
275
343
|
_items = () => this._allItems().filter(i => i.parent === this);
|
|
276
344
|
_elementRef = inject(ElementRef);
|
|
277
345
|
element = this._elementRef.nativeElement;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
346
|
+
disabled = input(false, ...(ngDevMode ? [{
|
|
347
|
+
debugName: "disabled",
|
|
348
|
+
transform: booleanAttribute
|
|
349
|
+
}] : [{
|
|
350
|
+
transform: booleanAttribute
|
|
351
|
+
}]));
|
|
352
|
+
softDisabled = input(true, ...(ngDevMode ? [{
|
|
353
|
+
debugName: "softDisabled",
|
|
354
|
+
transform: booleanAttribute
|
|
355
|
+
}] : [{
|
|
356
|
+
transform: booleanAttribute
|
|
357
|
+
}]));
|
|
358
|
+
textDirection = inject(Directionality).valueSignal;
|
|
359
|
+
values = model([], ...(ngDevMode ? [{
|
|
360
|
+
debugName: "values"
|
|
284
361
|
}] : []));
|
|
285
362
|
wrap = input(true, ...(ngDevMode ? [{
|
|
286
|
-
debugName: "wrap"
|
|
287
|
-
|
|
288
|
-
|
|
363
|
+
debugName: "wrap",
|
|
364
|
+
transform: booleanAttribute
|
|
365
|
+
}] : [{
|
|
366
|
+
transform: booleanAttribute
|
|
367
|
+
}]));
|
|
368
|
+
typeaheadDelay = input(500, ...(ngDevMode ? [{
|
|
289
369
|
debugName: "typeaheadDelay"
|
|
290
370
|
}] : []));
|
|
291
371
|
_pattern;
|
|
292
372
|
items = signal([], ...(ngDevMode ? [{
|
|
293
373
|
debugName: "items"
|
|
294
374
|
}] : []));
|
|
295
|
-
|
|
375
|
+
onSelect = output();
|
|
296
376
|
constructor() {
|
|
297
377
|
this._pattern = new MenuBarPattern({
|
|
298
378
|
...this,
|
|
299
379
|
multi: () => false,
|
|
300
|
-
|
|
380
|
+
softDisabled: () => true,
|
|
301
381
|
focusMode: () => 'roving',
|
|
302
382
|
orientation: () => 'horizontal',
|
|
303
383
|
selectionMode: () => 'explicit',
|
|
304
|
-
|
|
384
|
+
onSelect: value => this.onSelect.emit(value),
|
|
305
385
|
activeItem: signal(undefined),
|
|
306
386
|
element: computed(() => this._elementRef.nativeElement)
|
|
307
387
|
});
|
|
@@ -314,6 +394,9 @@ class MenuBar {
|
|
|
314
394
|
}
|
|
315
395
|
});
|
|
316
396
|
}
|
|
397
|
+
close() {
|
|
398
|
+
this._pattern.close();
|
|
399
|
+
}
|
|
317
400
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
318
401
|
minVersion: "12.0.0",
|
|
319
402
|
version: "20.2.0-next.2",
|
|
@@ -329,9 +412,23 @@ class MenuBar {
|
|
|
329
412
|
isStandalone: true,
|
|
330
413
|
selector: "[ngMenuBar]",
|
|
331
414
|
inputs: {
|
|
332
|
-
|
|
333
|
-
classPropertyName: "
|
|
334
|
-
publicName: "
|
|
415
|
+
disabled: {
|
|
416
|
+
classPropertyName: "disabled",
|
|
417
|
+
publicName: "disabled",
|
|
418
|
+
isSignal: true,
|
|
419
|
+
isRequired: false,
|
|
420
|
+
transformFunction: null
|
|
421
|
+
},
|
|
422
|
+
softDisabled: {
|
|
423
|
+
classPropertyName: "softDisabled",
|
|
424
|
+
publicName: "softDisabled",
|
|
425
|
+
isSignal: true,
|
|
426
|
+
isRequired: false,
|
|
427
|
+
transformFunction: null
|
|
428
|
+
},
|
|
429
|
+
values: {
|
|
430
|
+
classPropertyName: "values",
|
|
431
|
+
publicName: "values",
|
|
335
432
|
isSignal: true,
|
|
336
433
|
isRequired: false,
|
|
337
434
|
transformFunction: null
|
|
@@ -352,8 +449,8 @@ class MenuBar {
|
|
|
352
449
|
}
|
|
353
450
|
},
|
|
354
451
|
outputs: {
|
|
355
|
-
|
|
356
|
-
|
|
452
|
+
values: "valuesChange",
|
|
453
|
+
onSelect: "onSelect"
|
|
357
454
|
},
|
|
358
455
|
host: {
|
|
359
456
|
attributes: {
|
|
@@ -366,7 +463,11 @@ class MenuBar {
|
|
|
366
463
|
"focusin": "_pattern.onFocusIn()",
|
|
367
464
|
"focusout": "_pattern.onFocusOut($event)"
|
|
368
465
|
},
|
|
369
|
-
|
|
466
|
+
properties: {
|
|
467
|
+
"attr.disabled": "!softDisabled() && _pattern.disabled() ? true : null",
|
|
468
|
+
"attr.aria-disabled": "_pattern.disabled()",
|
|
469
|
+
"attr.tabindex": "_pattern.tabIndex()"
|
|
470
|
+
}
|
|
370
471
|
},
|
|
371
472
|
queries: [{
|
|
372
473
|
propertyName: "_allItems",
|
|
@@ -390,7 +491,9 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
390
491
|
exportAs: 'ngMenuBar',
|
|
391
492
|
host: {
|
|
392
493
|
'role': 'menubar',
|
|
393
|
-
'
|
|
494
|
+
'[attr.disabled]': '!softDisabled() && _pattern.disabled() ? true : null',
|
|
495
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
496
|
+
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
394
497
|
'(keydown)': '_pattern.onKeydown($event)',
|
|
395
498
|
'(mouseover)': '_pattern.onMouseOver($event)',
|
|
396
499
|
'(click)': '_pattern.onClick($event)',
|
|
@@ -404,7 +507,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
404
507
|
class MenuItem {
|
|
405
508
|
_elementRef = inject(ElementRef);
|
|
406
509
|
element = this._elementRef.nativeElement;
|
|
407
|
-
id = input(
|
|
510
|
+
id = input(inject(_IdGenerator).getId('ng-menu-item-', true), ...(ngDevMode ? [{
|
|
408
511
|
debugName: "id"
|
|
409
512
|
}] : []));
|
|
410
513
|
value = input.required(...(ngDevMode ? [{
|
|
@@ -426,6 +529,15 @@ class MenuItem {
|
|
|
426
529
|
submenu = input(undefined, ...(ngDevMode ? [{
|
|
427
530
|
debugName: "submenu"
|
|
428
531
|
}] : []));
|
|
532
|
+
active = computed(() => this._pattern.active(), ...(ngDevMode ? [{
|
|
533
|
+
debugName: "active"
|
|
534
|
+
}] : []));
|
|
535
|
+
expanded = computed(() => this._pattern.expanded(), ...(ngDevMode ? [{
|
|
536
|
+
debugName: "expanded"
|
|
537
|
+
}] : []));
|
|
538
|
+
hasPopup = computed(() => this._pattern.hasPopup(), ...(ngDevMode ? [{
|
|
539
|
+
debugName: "hasPopup"
|
|
540
|
+
}] : []));
|
|
429
541
|
_pattern = new MenuItemPattern({
|
|
430
542
|
id: this.id,
|
|
431
543
|
value: this.value,
|
|
@@ -435,6 +547,17 @@ class MenuItem {
|
|
|
435
547
|
parent: computed(() => this.parent?._pattern),
|
|
436
548
|
submenu: computed(() => this.submenu()?._pattern)
|
|
437
549
|
});
|
|
550
|
+
constructor() {
|
|
551
|
+
effect(() => this.submenu()?.parent.set(this));
|
|
552
|
+
}
|
|
553
|
+
open() {
|
|
554
|
+
this._pattern.open({
|
|
555
|
+
first: true
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
close() {
|
|
559
|
+
this._pattern.close();
|
|
560
|
+
}
|
|
438
561
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
439
562
|
minVersion: "12.0.0",
|
|
440
563
|
version: "20.2.0-next.2",
|
|
@@ -493,15 +616,17 @@ class MenuItem {
|
|
|
493
616
|
attributes: {
|
|
494
617
|
"role": "menuitem"
|
|
495
618
|
},
|
|
619
|
+
listeners: {
|
|
620
|
+
"focusin": "_pattern.onFocusIn()"
|
|
621
|
+
},
|
|
496
622
|
properties: {
|
|
497
|
-
"attr.tabindex": "_pattern.
|
|
498
|
-
"attr.data-active": "
|
|
499
|
-
"attr.aria-haspopup": "
|
|
500
|
-
"attr.aria-expanded": "
|
|
623
|
+
"attr.tabindex": "_pattern.tabIndex()",
|
|
624
|
+
"attr.data-active": "active()",
|
|
625
|
+
"attr.aria-haspopup": "hasPopup()",
|
|
626
|
+
"attr.aria-expanded": "expanded()",
|
|
501
627
|
"attr.aria-disabled": "_pattern.disabled()",
|
|
502
628
|
"attr.aria-controls": "_pattern.submenu()?.id()"
|
|
503
|
-
}
|
|
504
|
-
classAttribute: "ng-menu-item"
|
|
629
|
+
}
|
|
505
630
|
},
|
|
506
631
|
exportAs: ["ngMenuItem"],
|
|
507
632
|
ngImport: i0
|
|
@@ -519,17 +644,54 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
519
644
|
exportAs: 'ngMenuItem',
|
|
520
645
|
host: {
|
|
521
646
|
'role': 'menuitem',
|
|
522
|
-
'
|
|
523
|
-
'[attr.tabindex]': '_pattern.
|
|
524
|
-
'[attr.data-active]': '
|
|
525
|
-
'[attr.aria-haspopup]': '
|
|
526
|
-
'[attr.aria-expanded]': '
|
|
647
|
+
'(focusin)': '_pattern.onFocusIn()',
|
|
648
|
+
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
649
|
+
'[attr.data-active]': 'active()',
|
|
650
|
+
'[attr.aria-haspopup]': 'hasPopup()',
|
|
651
|
+
'[attr.aria-expanded]': 'expanded()',
|
|
527
652
|
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
528
653
|
'[attr.aria-controls]': '_pattern.submenu()?.id()'
|
|
529
654
|
}
|
|
530
655
|
}]
|
|
656
|
+
}],
|
|
657
|
+
ctorParameters: () => []
|
|
658
|
+
});
|
|
659
|
+
class MenuContent {
|
|
660
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
661
|
+
minVersion: "12.0.0",
|
|
662
|
+
version: "20.2.0-next.2",
|
|
663
|
+
ngImport: i0,
|
|
664
|
+
type: MenuContent,
|
|
665
|
+
deps: [],
|
|
666
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
667
|
+
});
|
|
668
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
669
|
+
minVersion: "14.0.0",
|
|
670
|
+
version: "20.2.0-next.2",
|
|
671
|
+
type: MenuContent,
|
|
672
|
+
isStandalone: true,
|
|
673
|
+
selector: "ng-template[ngMenuContent]",
|
|
674
|
+
exportAs: ["ngMenuContent"],
|
|
675
|
+
hostDirectives: [{
|
|
676
|
+
directive: i1.DeferredContent
|
|
677
|
+
}],
|
|
678
|
+
ngImport: i0
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
682
|
+
minVersion: "12.0.0",
|
|
683
|
+
version: "20.2.0-next.2",
|
|
684
|
+
ngImport: i0,
|
|
685
|
+
type: MenuContent,
|
|
686
|
+
decorators: [{
|
|
687
|
+
type: Directive,
|
|
688
|
+
args: [{
|
|
689
|
+
selector: 'ng-template[ngMenuContent]',
|
|
690
|
+
exportAs: 'ngMenuContent',
|
|
691
|
+
hostDirectives: [DeferredContent]
|
|
692
|
+
}]
|
|
531
693
|
}]
|
|
532
694
|
});
|
|
533
695
|
|
|
534
|
-
export { Menu, MenuBar, MenuItem, MenuTrigger };
|
|
696
|
+
export { Menu, MenuBar, MenuContent, MenuItem, MenuTrigger };
|
|
535
697
|
//# sourceMappingURL=menu.mjs.map
|