@angular/aria 21.1.0-next.0 → 21.1.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/_combobox-chunk.mjs +425 -0
- package/fesm2022/_combobox-chunk.mjs.map +1 -0
- package/fesm2022/_combobox-listbox-chunk.mjs +522 -0
- package/fesm2022/_combobox-listbox-chunk.mjs.map +1 -0
- package/fesm2022/_combobox-popup-chunk.mjs +46 -0
- package/fesm2022/_combobox-popup-chunk.mjs.map +1 -0
- package/fesm2022/_list-navigation-chunk.mjs +116 -0
- package/fesm2022/_list-navigation-chunk.mjs.map +1 -0
- package/fesm2022/_pointer-event-manager-chunk.mjs +134 -0
- package/fesm2022/_pointer-event-manager-chunk.mjs.map +1 -0
- package/fesm2022/_widget-chunk.mjs +4 -246
- package/fesm2022/_widget-chunk.mjs.map +1 -1
- package/fesm2022/accordion.mjs +64 -51
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/aria.mjs +1 -1
- package/fesm2022/aria.mjs.map +1 -1
- package/fesm2022/combobox.mjs +120 -144
- package/fesm2022/combobox.mjs.map +1 -1
- package/fesm2022/grid.mjs +285 -261
- package/fesm2022/grid.mjs.map +1 -1
- package/fesm2022/listbox.mjs +205 -193
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +301 -283
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/private.mjs +15 -938
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/tabs.mjs +209 -195
- package/fesm2022/tabs.mjs.map +1 -1
- package/fesm2022/toolbar.mjs +59 -47
- package/fesm2022/toolbar.mjs.map +1 -1
- package/fesm2022/tree.mjs +43 -41
- package/fesm2022/tree.mjs.map +1 -1
- package/package.json +2 -2
- package/types/_combobox-chunk.d.ts +98 -0
- package/types/_combobox-chunk.d2.ts +193 -0
- package/types/_grid-chunk.d.ts +3 -210
- package/types/_list-chunk.d.ts +212 -0
- package/types/_list-navigation-chunk.d.ts +212 -0
- package/types/_listbox-chunk.d.ts +106 -0
- package/types/accordion.d.ts +52 -49
- package/types/combobox.d.ts +25 -111
- package/types/grid.d.ts +37 -32
- package/types/listbox.d.ts +8 -5
- package/types/menu.d.ts +113 -113
- package/types/private.d.ts +12 -498
- package/types/tabs.d.ts +89 -84
- package/types/toolbar.d.ts +69 -66
- package/types/tree.d.ts +106 -103
- package/_adev_assets/aria-accordion.json +0 -743
- package/_adev_assets/aria-combobox.json +0 -607
- package/_adev_assets/aria-grid.json +0 -901
- package/_adev_assets/aria-listbox.json +0 -544
- package/_adev_assets/aria-menu.json +0 -1049
- package/_adev_assets/aria-tabs.json +0 -880
- package/_adev_assets/aria-toolbar.json +0 -545
- package/_adev_assets/aria-tree.json +0 -861
package/fesm2022/menu.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input, computed, booleanAttribute, effect, Directive, contentChildren, signal, output, afterRenderEffect, untracked
|
|
2
|
+
import { inject, ElementRef, input, computed, booleanAttribute, effect, Directive, InjectionToken, model, contentChildren, signal, output, afterRenderEffect, untracked } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/aria/private';
|
|
4
|
-
import { MenuTriggerPattern,
|
|
5
|
-
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
4
|
+
import { MenuTriggerPattern, MenuItemPattern, MenuBarPattern, DeferredContentAware, MenuPattern, DeferredContent } from '@angular/aria/private';
|
|
6
5
|
import { Directionality } from '@angular/cdk/bidi';
|
|
6
|
+
import { _IdGenerator } from '@angular/cdk/a11y';
|
|
7
7
|
|
|
8
8
|
class MenuTrigger {
|
|
9
9
|
_elementRef = inject(ElementRef);
|
|
@@ -18,18 +18,18 @@ class MenuTrigger {
|
|
|
18
18
|
hasPopup = computed(() => this._pattern.hasPopup(), ...(ngDevMode ? [{
|
|
19
19
|
debugName: "hasPopup"
|
|
20
20
|
}] : []));
|
|
21
|
-
disabled = input(false,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
disabled = input(false, {
|
|
22
|
+
...(ngDevMode ? {
|
|
23
|
+
debugName: "disabled"
|
|
24
|
+
} : {}),
|
|
25
25
|
transform: booleanAttribute
|
|
26
|
-
}
|
|
27
|
-
softDisabled = input(true,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
});
|
|
27
|
+
softDisabled = input(true, {
|
|
28
|
+
...(ngDevMode ? {
|
|
29
|
+
debugName: "softDisabled"
|
|
30
|
+
} : {}),
|
|
31
31
|
transform: booleanAttribute
|
|
32
|
-
}
|
|
32
|
+
});
|
|
33
33
|
_pattern = new MenuTriggerPattern({
|
|
34
34
|
textDirection: this.textDirection,
|
|
35
35
|
element: computed(() => this._elementRef.nativeElement),
|
|
@@ -49,7 +49,7 @@ class MenuTrigger {
|
|
|
49
49
|
}
|
|
50
50
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
51
51
|
minVersion: "12.0.0",
|
|
52
|
-
version: "21.0.
|
|
52
|
+
version: "21.0.3",
|
|
53
53
|
ngImport: i0,
|
|
54
54
|
type: MenuTrigger,
|
|
55
55
|
deps: [],
|
|
@@ -57,7 +57,7 @@ class MenuTrigger {
|
|
|
57
57
|
});
|
|
58
58
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
59
59
|
minVersion: "17.1.0",
|
|
60
|
-
version: "21.0.
|
|
60
|
+
version: "21.0.3",
|
|
61
61
|
type: MenuTrigger,
|
|
62
62
|
isStandalone: true,
|
|
63
63
|
selector: "button[ngMenuTrigger]",
|
|
@@ -106,7 +106,7 @@ class MenuTrigger {
|
|
|
106
106
|
}
|
|
107
107
|
i0.ɵɵngDeclareClassMetadata({
|
|
108
108
|
minVersion: "12.0.0",
|
|
109
|
-
version: "21.0.
|
|
109
|
+
version: "21.0.3",
|
|
110
110
|
ngImport: i0,
|
|
111
111
|
type: MenuTrigger,
|
|
112
112
|
decorators: [{
|
|
@@ -156,87 +156,54 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
156
156
|
}]
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
_allItems = contentChildren(MenuItem, ...(ngDevMode ? [{
|
|
164
|
-
debugName: "_allItems",
|
|
165
|
-
descendants: true
|
|
166
|
-
}] : [{
|
|
167
|
-
descendants: true
|
|
168
|
-
}]));
|
|
169
|
-
_items = computed(() => this._allItems().filter(i => i.parent === this), ...(ngDevMode ? [{
|
|
170
|
-
debugName: "_items"
|
|
171
|
-
}] : []));
|
|
159
|
+
|
|
160
|
+
const MENU_COMPONENT = new InjectionToken('MENU_COMPONENT');
|
|
161
|
+
|
|
162
|
+
class MenuItem {
|
|
172
163
|
_elementRef = inject(ElementRef);
|
|
173
164
|
element = this._elementRef.nativeElement;
|
|
174
|
-
|
|
175
|
-
id = input(inject(_IdGenerator).getId('ng-menu-', true), ...(ngDevMode ? [{
|
|
165
|
+
id = input(inject(_IdGenerator).getId('ng-menu-item-', true), ...(ngDevMode ? [{
|
|
176
166
|
debugName: "id"
|
|
177
167
|
}] : []));
|
|
178
|
-
|
|
179
|
-
debugName: "
|
|
180
|
-
transform: booleanAttribute
|
|
181
|
-
}] : [{
|
|
182
|
-
transform: booleanAttribute
|
|
183
|
-
}]));
|
|
184
|
-
typeaheadDelay = input(500, ...(ngDevMode ? [{
|
|
185
|
-
debugName: "typeaheadDelay"
|
|
168
|
+
value = input.required(...(ngDevMode ? [{
|
|
169
|
+
debugName: "value"
|
|
186
170
|
}] : []));
|
|
187
171
|
disabled = input(false, ...(ngDevMode ? [{
|
|
188
|
-
debugName: "disabled"
|
|
189
|
-
transform: booleanAttribute
|
|
190
|
-
}] : [{
|
|
191
|
-
transform: booleanAttribute
|
|
192
|
-
}]));
|
|
193
|
-
parent = signal(undefined, ...(ngDevMode ? [{
|
|
194
|
-
debugName: "parent"
|
|
172
|
+
debugName: "disabled"
|
|
195
173
|
}] : []));
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
visible = computed(() => this._pattern.visible(), ...(ngDevMode ? [{
|
|
199
|
-
debugName: "visible"
|
|
174
|
+
searchTerm = model('', ...(ngDevMode ? [{
|
|
175
|
+
debugName: "searchTerm"
|
|
200
176
|
}] : []));
|
|
201
|
-
|
|
202
|
-
|
|
177
|
+
parent = inject(MENU_COMPONENT, {
|
|
178
|
+
optional: true
|
|
179
|
+
});
|
|
180
|
+
submenu = input(undefined, ...(ngDevMode ? [{
|
|
181
|
+
debugName: "submenu"
|
|
203
182
|
}] : []));
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
183
|
+
active = computed(() => this._pattern.active(), ...(ngDevMode ? [{
|
|
184
|
+
debugName: "active"
|
|
185
|
+
}] : []));
|
|
186
|
+
expanded = computed(() => this._pattern.expanded(), ...(ngDevMode ? [{
|
|
187
|
+
debugName: "expanded"
|
|
207
188
|
}] : []));
|
|
189
|
+
hasPopup = computed(() => this._pattern.hasPopup(), ...(ngDevMode ? [{
|
|
190
|
+
debugName: "hasPopup"
|
|
191
|
+
}] : []));
|
|
192
|
+
_pattern = new MenuItemPattern({
|
|
193
|
+
id: this.id,
|
|
194
|
+
value: this.value,
|
|
195
|
+
element: computed(() => this._elementRef.nativeElement),
|
|
196
|
+
disabled: this.disabled,
|
|
197
|
+
searchTerm: this.searchTerm,
|
|
198
|
+
parent: computed(() => this.parent?._pattern),
|
|
199
|
+
submenu: computed(() => this.submenu()?._pattern)
|
|
200
|
+
});
|
|
208
201
|
constructor() {
|
|
209
|
-
this.
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
softDisabled: () => true,
|
|
215
|
-
focusMode: () => 'roving',
|
|
216
|
-
orientation: () => 'vertical',
|
|
217
|
-
selectionMode: () => 'explicit',
|
|
218
|
-
activeItem: signal(undefined),
|
|
219
|
-
element: computed(() => this._elementRef.nativeElement),
|
|
220
|
-
onSelect: value => this.onSelect.emit(value)
|
|
221
|
-
});
|
|
222
|
-
afterRenderEffect(() => {
|
|
223
|
-
const parent = this.parent();
|
|
224
|
-
if (parent instanceof MenuItem && parent.parent instanceof MenuBar) {
|
|
225
|
-
this._deferredContentAware?.contentVisible.set(true);
|
|
226
|
-
} else {
|
|
227
|
-
this._deferredContentAware?.contentVisible.set(this._pattern.visible() || !!this.parent()?._pattern.hasBeenFocused());
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
afterRenderEffect(() => {
|
|
231
|
-
if (this._pattern.visible()) {
|
|
232
|
-
const activeItem = untracked(() => this._pattern.inputs.activeItem());
|
|
233
|
-
this._pattern.listBehavior.goto(activeItem);
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
afterRenderEffect(() => {
|
|
237
|
-
if (!this._pattern.hasBeenFocused() && this._items().length) {
|
|
238
|
-
untracked(() => this._pattern.setDefaultState());
|
|
239
|
-
}
|
|
202
|
+
effect(() => this.submenu()?.parent.set(this));
|
|
203
|
+
}
|
|
204
|
+
open() {
|
|
205
|
+
this._pattern.open({
|
|
206
|
+
first: true
|
|
240
207
|
});
|
|
241
208
|
}
|
|
242
209
|
close() {
|
|
@@ -244,18 +211,18 @@ class Menu {
|
|
|
244
211
|
}
|
|
245
212
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
246
213
|
minVersion: "12.0.0",
|
|
247
|
-
version: "21.0.
|
|
214
|
+
version: "21.0.3",
|
|
248
215
|
ngImport: i0,
|
|
249
|
-
type:
|
|
216
|
+
type: MenuItem,
|
|
250
217
|
deps: [],
|
|
251
218
|
target: i0.ɵɵFactoryTarget.Directive
|
|
252
219
|
});
|
|
253
220
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
254
|
-
minVersion: "17.
|
|
255
|
-
version: "21.0.
|
|
256
|
-
type:
|
|
221
|
+
minVersion: "17.1.0",
|
|
222
|
+
version: "21.0.3",
|
|
223
|
+
type: MenuItem,
|
|
257
224
|
isStandalone: true,
|
|
258
|
-
selector: "[
|
|
225
|
+
selector: "[ngMenuItem]",
|
|
259
226
|
inputs: {
|
|
260
227
|
id: {
|
|
261
228
|
classPropertyName: "id",
|
|
@@ -264,111 +231,82 @@ class Menu {
|
|
|
264
231
|
isRequired: false,
|
|
265
232
|
transformFunction: null
|
|
266
233
|
},
|
|
267
|
-
|
|
268
|
-
classPropertyName: "
|
|
269
|
-
publicName: "
|
|
234
|
+
value: {
|
|
235
|
+
classPropertyName: "value",
|
|
236
|
+
publicName: "value",
|
|
270
237
|
isSignal: true,
|
|
271
|
-
isRequired:
|
|
238
|
+
isRequired: true,
|
|
272
239
|
transformFunction: null
|
|
273
240
|
},
|
|
274
|
-
|
|
275
|
-
classPropertyName: "
|
|
276
|
-
publicName: "
|
|
241
|
+
disabled: {
|
|
242
|
+
classPropertyName: "disabled",
|
|
243
|
+
publicName: "disabled",
|
|
277
244
|
isSignal: true,
|
|
278
245
|
isRequired: false,
|
|
279
246
|
transformFunction: null
|
|
280
247
|
},
|
|
281
|
-
|
|
282
|
-
classPropertyName: "
|
|
283
|
-
publicName: "
|
|
248
|
+
searchTerm: {
|
|
249
|
+
classPropertyName: "searchTerm",
|
|
250
|
+
publicName: "searchTerm",
|
|
284
251
|
isSignal: true,
|
|
285
252
|
isRequired: false,
|
|
286
253
|
transformFunction: null
|
|
287
254
|
},
|
|
288
|
-
|
|
289
|
-
classPropertyName: "
|
|
290
|
-
publicName: "
|
|
255
|
+
submenu: {
|
|
256
|
+
classPropertyName: "submenu",
|
|
257
|
+
publicName: "submenu",
|
|
291
258
|
isSignal: true,
|
|
292
259
|
isRequired: false,
|
|
293
260
|
transformFunction: null
|
|
294
261
|
}
|
|
295
262
|
},
|
|
296
263
|
outputs: {
|
|
297
|
-
|
|
264
|
+
searchTerm: "searchTermChange"
|
|
298
265
|
},
|
|
299
266
|
host: {
|
|
300
267
|
attributes: {
|
|
301
|
-
"role": "
|
|
268
|
+
"role": "menuitem"
|
|
302
269
|
},
|
|
303
270
|
listeners: {
|
|
304
|
-
"
|
|
305
|
-
"mouseover": "_pattern.onMouseOver($event)",
|
|
306
|
-
"mouseout": "_pattern.onMouseOut($event)",
|
|
307
|
-
"focusout": "_pattern.onFocusOut($event)",
|
|
308
|
-
"focusin": "_pattern.onFocusIn()",
|
|
309
|
-
"click": "_pattern.onClick($event)"
|
|
271
|
+
"focusin": "_pattern.onFocusIn()"
|
|
310
272
|
},
|
|
311
273
|
properties: {
|
|
312
|
-
"attr.
|
|
274
|
+
"attr.tabindex": "_pattern.tabIndex()",
|
|
275
|
+
"attr.data-active": "active()",
|
|
276
|
+
"attr.aria-haspopup": "hasPopup()",
|
|
277
|
+
"attr.aria-expanded": "expanded()",
|
|
313
278
|
"attr.aria-disabled": "_pattern.disabled()",
|
|
314
|
-
"attr.
|
|
315
|
-
"attr.data-visible": "visible()"
|
|
279
|
+
"attr.aria-controls": "_pattern.submenu()?.id()"
|
|
316
280
|
}
|
|
317
281
|
},
|
|
318
|
-
|
|
319
|
-
propertyName: "_allItems",
|
|
320
|
-
predicate: MenuItem,
|
|
321
|
-
descendants: true,
|
|
322
|
-
isSignal: true
|
|
323
|
-
}],
|
|
324
|
-
exportAs: ["ngMenu"],
|
|
325
|
-
hostDirectives: [{
|
|
326
|
-
directive: i1.DeferredContentAware,
|
|
327
|
-
inputs: ["preserveContent", "preserveContent"]
|
|
328
|
-
}],
|
|
282
|
+
exportAs: ["ngMenuItem"],
|
|
329
283
|
ngImport: i0
|
|
330
284
|
});
|
|
331
285
|
}
|
|
332
286
|
i0.ɵɵngDeclareClassMetadata({
|
|
333
287
|
minVersion: "12.0.0",
|
|
334
|
-
version: "21.0.
|
|
288
|
+
version: "21.0.3",
|
|
335
289
|
ngImport: i0,
|
|
336
|
-
type:
|
|
290
|
+
type: MenuItem,
|
|
337
291
|
decorators: [{
|
|
338
292
|
type: Directive,
|
|
339
293
|
args: [{
|
|
340
|
-
selector: '[
|
|
341
|
-
exportAs: '
|
|
294
|
+
selector: '[ngMenuItem]',
|
|
295
|
+
exportAs: 'ngMenuItem',
|
|
342
296
|
host: {
|
|
343
|
-
'role': '
|
|
344
|
-
'[attr.id]': '_pattern.id()',
|
|
345
|
-
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
346
|
-
'[attr.tabindex]': 'tabIndex()',
|
|
347
|
-
'[attr.data-visible]': 'visible()',
|
|
348
|
-
'(keydown)': '_pattern.onKeydown($event)',
|
|
349
|
-
'(mouseover)': '_pattern.onMouseOver($event)',
|
|
350
|
-
'(mouseout)': '_pattern.onMouseOut($event)',
|
|
351
|
-
'(focusout)': '_pattern.onFocusOut($event)',
|
|
297
|
+
'role': 'menuitem',
|
|
352
298
|
'(focusin)': '_pattern.onFocusIn()',
|
|
353
|
-
'
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
299
|
+
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
300
|
+
'[attr.data-active]': 'active()',
|
|
301
|
+
'[attr.aria-haspopup]': 'hasPopup()',
|
|
302
|
+
'[attr.aria-expanded]': 'expanded()',
|
|
303
|
+
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
304
|
+
'[attr.aria-controls]': '_pattern.submenu()?.id()'
|
|
305
|
+
}
|
|
359
306
|
}]
|
|
360
307
|
}],
|
|
361
308
|
ctorParameters: () => [],
|
|
362
309
|
propDecorators: {
|
|
363
|
-
_allItems: [{
|
|
364
|
-
type: i0.ContentChildren,
|
|
365
|
-
args: [i0.forwardRef(() => MenuItem), {
|
|
366
|
-
...{
|
|
367
|
-
descendants: true
|
|
368
|
-
},
|
|
369
|
-
isSignal: true
|
|
370
|
-
}]
|
|
371
|
-
}],
|
|
372
310
|
id: [{
|
|
373
311
|
type: i0.Input,
|
|
374
312
|
args: [{
|
|
@@ -377,76 +315,76 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
377
315
|
required: false
|
|
378
316
|
}]
|
|
379
317
|
}],
|
|
380
|
-
|
|
318
|
+
value: [{
|
|
381
319
|
type: i0.Input,
|
|
382
320
|
args: [{
|
|
383
321
|
isSignal: true,
|
|
384
|
-
alias: "
|
|
385
|
-
required:
|
|
322
|
+
alias: "value",
|
|
323
|
+
required: true
|
|
386
324
|
}]
|
|
387
325
|
}],
|
|
388
|
-
|
|
326
|
+
disabled: [{
|
|
389
327
|
type: i0.Input,
|
|
390
328
|
args: [{
|
|
391
329
|
isSignal: true,
|
|
392
|
-
alias: "
|
|
330
|
+
alias: "disabled",
|
|
393
331
|
required: false
|
|
394
332
|
}]
|
|
395
333
|
}],
|
|
396
|
-
|
|
334
|
+
searchTerm: [{
|
|
397
335
|
type: i0.Input,
|
|
398
336
|
args: [{
|
|
399
337
|
isSignal: true,
|
|
400
|
-
alias: "
|
|
338
|
+
alias: "searchTerm",
|
|
401
339
|
required: false
|
|
402
340
|
}]
|
|
403
|
-
}
|
|
404
|
-
onSelect: [{
|
|
341
|
+
}, {
|
|
405
342
|
type: i0.Output,
|
|
406
|
-
args: ["
|
|
343
|
+
args: ["searchTermChange"]
|
|
407
344
|
}],
|
|
408
|
-
|
|
345
|
+
submenu: [{
|
|
409
346
|
type: i0.Input,
|
|
410
347
|
args: [{
|
|
411
348
|
isSignal: true,
|
|
412
|
-
alias: "
|
|
349
|
+
alias: "submenu",
|
|
413
350
|
required: false
|
|
414
351
|
}]
|
|
415
352
|
}]
|
|
416
353
|
}
|
|
417
354
|
});
|
|
355
|
+
|
|
418
356
|
class MenuBar {
|
|
419
|
-
_allItems = contentChildren(MenuItem,
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
357
|
+
_allItems = contentChildren(MenuItem, {
|
|
358
|
+
...(ngDevMode ? {
|
|
359
|
+
debugName: "_allItems"
|
|
360
|
+
} : {}),
|
|
423
361
|
descendants: true
|
|
424
|
-
}
|
|
362
|
+
});
|
|
425
363
|
_items = () => this._allItems().filter(i => i.parent === this);
|
|
426
364
|
_elementRef = inject(ElementRef);
|
|
427
365
|
element = this._elementRef.nativeElement;
|
|
428
|
-
disabled = input(false,
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
366
|
+
disabled = input(false, {
|
|
367
|
+
...(ngDevMode ? {
|
|
368
|
+
debugName: "disabled"
|
|
369
|
+
} : {}),
|
|
432
370
|
transform: booleanAttribute
|
|
433
|
-
}
|
|
434
|
-
softDisabled = input(true,
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
371
|
+
});
|
|
372
|
+
softDisabled = input(true, {
|
|
373
|
+
...(ngDevMode ? {
|
|
374
|
+
debugName: "softDisabled"
|
|
375
|
+
} : {}),
|
|
438
376
|
transform: booleanAttribute
|
|
439
|
-
}
|
|
377
|
+
});
|
|
440
378
|
textDirection = inject(Directionality).valueSignal;
|
|
441
379
|
values = model([], ...(ngDevMode ? [{
|
|
442
380
|
debugName: "values"
|
|
443
381
|
}] : []));
|
|
444
|
-
wrap = input(true,
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
382
|
+
wrap = input(true, {
|
|
383
|
+
...(ngDevMode ? {
|
|
384
|
+
debugName: "wrap"
|
|
385
|
+
} : {}),
|
|
448
386
|
transform: booleanAttribute
|
|
449
|
-
}
|
|
387
|
+
});
|
|
450
388
|
typeaheadDelay = input(500, ...(ngDevMode ? [{
|
|
451
389
|
debugName: "typeaheadDelay"
|
|
452
390
|
}] : []));
|
|
@@ -482,7 +420,7 @@ class MenuBar {
|
|
|
482
420
|
}
|
|
483
421
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
484
422
|
minVersion: "12.0.0",
|
|
485
|
-
version: "21.0.
|
|
423
|
+
version: "21.0.3",
|
|
486
424
|
ngImport: i0,
|
|
487
425
|
type: MenuBar,
|
|
488
426
|
deps: [],
|
|
@@ -490,7 +428,7 @@ class MenuBar {
|
|
|
490
428
|
});
|
|
491
429
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
492
430
|
minVersion: "17.2.0",
|
|
493
|
-
version: "21.0.
|
|
431
|
+
version: "21.0.3",
|
|
494
432
|
type: MenuBar,
|
|
495
433
|
isStandalone: true,
|
|
496
434
|
selector: "[ngMenuBar]",
|
|
@@ -552,6 +490,10 @@ class MenuBar {
|
|
|
552
490
|
"attr.tabindex": "_pattern.tabIndex()"
|
|
553
491
|
}
|
|
554
492
|
},
|
|
493
|
+
providers: [{
|
|
494
|
+
provide: MENU_COMPONENT,
|
|
495
|
+
useExisting: MenuBar
|
|
496
|
+
}],
|
|
555
497
|
queries: [{
|
|
556
498
|
propertyName: "_allItems",
|
|
557
499
|
predicate: MenuItem,
|
|
@@ -564,7 +506,7 @@ class MenuBar {
|
|
|
564
506
|
}
|
|
565
507
|
i0.ɵɵngDeclareClassMetadata({
|
|
566
508
|
minVersion: "12.0.0",
|
|
567
|
-
version: "21.0.
|
|
509
|
+
version: "21.0.3",
|
|
568
510
|
ngImport: i0,
|
|
569
511
|
type: MenuBar,
|
|
570
512
|
decorators: [{
|
|
@@ -582,7 +524,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
582
524
|
'(click)': '_pattern.onClick($event)',
|
|
583
525
|
'(focusin)': '_pattern.onFocusIn()',
|
|
584
526
|
'(focusout)': '_pattern.onFocusOut($event)'
|
|
585
|
-
}
|
|
527
|
+
},
|
|
528
|
+
providers: [{
|
|
529
|
+
provide: MENU_COMPONENT,
|
|
530
|
+
useExisting: MenuBar
|
|
531
|
+
}]
|
|
586
532
|
}]
|
|
587
533
|
}],
|
|
588
534
|
ctorParameters: () => [],
|
|
@@ -645,55 +591,88 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
645
591
|
}]
|
|
646
592
|
}
|
|
647
593
|
});
|
|
648
|
-
|
|
594
|
+
|
|
595
|
+
class Menu {
|
|
596
|
+
_deferredContentAware = inject(DeferredContentAware, {
|
|
597
|
+
optional: true
|
|
598
|
+
});
|
|
599
|
+
_allItems = contentChildren(MenuItem, {
|
|
600
|
+
...(ngDevMode ? {
|
|
601
|
+
debugName: "_allItems"
|
|
602
|
+
} : {}),
|
|
603
|
+
descendants: true
|
|
604
|
+
});
|
|
605
|
+
_items = computed(() => this._allItems().filter(i => i.parent === this), ...(ngDevMode ? [{
|
|
606
|
+
debugName: "_items"
|
|
607
|
+
}] : []));
|
|
649
608
|
_elementRef = inject(ElementRef);
|
|
650
609
|
element = this._elementRef.nativeElement;
|
|
651
|
-
|
|
610
|
+
textDirection = inject(Directionality).valueSignal;
|
|
611
|
+
id = input(inject(_IdGenerator).getId('ng-menu-', true), ...(ngDevMode ? [{
|
|
652
612
|
debugName: "id"
|
|
653
613
|
}] : []));
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
}] : []));
|
|
660
|
-
searchTerm = model('', ...(ngDevMode ? [{
|
|
661
|
-
debugName: "searchTerm"
|
|
662
|
-
}] : []));
|
|
663
|
-
_menu = inject(Menu, {
|
|
664
|
-
optional: true
|
|
614
|
+
wrap = input(true, {
|
|
615
|
+
...(ngDevMode ? {
|
|
616
|
+
debugName: "wrap"
|
|
617
|
+
} : {}),
|
|
618
|
+
transform: booleanAttribute
|
|
665
619
|
});
|
|
666
|
-
|
|
667
|
-
|
|
620
|
+
typeaheadDelay = input(500, ...(ngDevMode ? [{
|
|
621
|
+
debugName: "typeaheadDelay"
|
|
622
|
+
}] : []));
|
|
623
|
+
disabled = input(false, {
|
|
624
|
+
...(ngDevMode ? {
|
|
625
|
+
debugName: "disabled"
|
|
626
|
+
} : {}),
|
|
627
|
+
transform: booleanAttribute
|
|
668
628
|
});
|
|
669
|
-
parent =
|
|
670
|
-
|
|
671
|
-
debugName: "submenu"
|
|
629
|
+
parent = signal(undefined, ...(ngDevMode ? [{
|
|
630
|
+
debugName: "parent"
|
|
672
631
|
}] : []));
|
|
673
|
-
|
|
674
|
-
|
|
632
|
+
_pattern;
|
|
633
|
+
_itemPatterns = () => this._items().map(i => i._pattern);
|
|
634
|
+
visible = computed(() => this._pattern.visible(), ...(ngDevMode ? [{
|
|
635
|
+
debugName: "visible"
|
|
675
636
|
}] : []));
|
|
676
|
-
|
|
677
|
-
debugName: "
|
|
637
|
+
tabIndex = computed(() => this._pattern.tabIndex(), ...(ngDevMode ? [{
|
|
638
|
+
debugName: "tabIndex"
|
|
678
639
|
}] : []));
|
|
679
|
-
|
|
680
|
-
|
|
640
|
+
onSelect = output();
|
|
641
|
+
expansionDelay = input(100, ...(ngDevMode ? [{
|
|
642
|
+
debugName: "expansionDelay"
|
|
681
643
|
}] : []));
|
|
682
|
-
_pattern = new MenuItemPattern({
|
|
683
|
-
id: this.id,
|
|
684
|
-
value: this.value,
|
|
685
|
-
element: computed(() => this._elementRef.nativeElement),
|
|
686
|
-
disabled: this.disabled,
|
|
687
|
-
searchTerm: this.searchTerm,
|
|
688
|
-
parent: computed(() => this.parent?._pattern),
|
|
689
|
-
submenu: computed(() => this.submenu()?._pattern)
|
|
690
|
-
});
|
|
691
644
|
constructor() {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
645
|
+
this._pattern = new MenuPattern({
|
|
646
|
+
...this,
|
|
647
|
+
parent: computed(() => this.parent()?._pattern),
|
|
648
|
+
items: this._itemPatterns,
|
|
649
|
+
multi: () => false,
|
|
650
|
+
softDisabled: () => true,
|
|
651
|
+
focusMode: () => 'roving',
|
|
652
|
+
orientation: () => 'vertical',
|
|
653
|
+
selectionMode: () => 'explicit',
|
|
654
|
+
activeItem: signal(undefined),
|
|
655
|
+
element: computed(() => this._elementRef.nativeElement),
|
|
656
|
+
onSelect: value => this.onSelect.emit(value)
|
|
657
|
+
});
|
|
658
|
+
afterRenderEffect(() => {
|
|
659
|
+
const parent = this.parent();
|
|
660
|
+
if (parent instanceof MenuItem && parent.parent instanceof MenuBar) {
|
|
661
|
+
this._deferredContentAware?.contentVisible.set(true);
|
|
662
|
+
} else {
|
|
663
|
+
this._deferredContentAware?.contentVisible.set(this._pattern.visible() || !!this.parent()?._pattern.hasBeenFocused());
|
|
664
|
+
}
|
|
665
|
+
});
|
|
666
|
+
afterRenderEffect(() => {
|
|
667
|
+
if (this._pattern.visible()) {
|
|
668
|
+
const activeItem = untracked(() => this._pattern.inputs.activeItem());
|
|
669
|
+
this._pattern.listBehavior.goto(activeItem);
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
afterRenderEffect(() => {
|
|
673
|
+
if (!this._pattern.hasBeenFocused() && !this._pattern.hasBeenHovered() && this._items().length) {
|
|
674
|
+
untracked(() => this._pattern.setDefaultState());
|
|
675
|
+
}
|
|
697
676
|
});
|
|
698
677
|
}
|
|
699
678
|
close() {
|
|
@@ -701,18 +680,18 @@ class MenuItem {
|
|
|
701
680
|
}
|
|
702
681
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
703
682
|
minVersion: "12.0.0",
|
|
704
|
-
version: "21.0.
|
|
683
|
+
version: "21.0.3",
|
|
705
684
|
ngImport: i0,
|
|
706
|
-
type:
|
|
685
|
+
type: Menu,
|
|
707
686
|
deps: [],
|
|
708
687
|
target: i0.ɵɵFactoryTarget.Directive
|
|
709
688
|
});
|
|
710
689
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
711
|
-
minVersion: "17.
|
|
712
|
-
version: "21.0.
|
|
713
|
-
type:
|
|
690
|
+
minVersion: "17.2.0",
|
|
691
|
+
version: "21.0.3",
|
|
692
|
+
type: Menu,
|
|
714
693
|
isStandalone: true,
|
|
715
|
-
selector: "[
|
|
694
|
+
selector: "[ngMenu]",
|
|
716
695
|
inputs: {
|
|
717
696
|
id: {
|
|
718
697
|
classPropertyName: "id",
|
|
@@ -721,82 +700,119 @@ class MenuItem {
|
|
|
721
700
|
isRequired: false,
|
|
722
701
|
transformFunction: null
|
|
723
702
|
},
|
|
724
|
-
|
|
725
|
-
classPropertyName: "
|
|
726
|
-
publicName: "
|
|
703
|
+
wrap: {
|
|
704
|
+
classPropertyName: "wrap",
|
|
705
|
+
publicName: "wrap",
|
|
727
706
|
isSignal: true,
|
|
728
|
-
isRequired:
|
|
707
|
+
isRequired: false,
|
|
729
708
|
transformFunction: null
|
|
730
709
|
},
|
|
731
|
-
|
|
732
|
-
classPropertyName: "
|
|
733
|
-
publicName: "
|
|
710
|
+
typeaheadDelay: {
|
|
711
|
+
classPropertyName: "typeaheadDelay",
|
|
712
|
+
publicName: "typeaheadDelay",
|
|
734
713
|
isSignal: true,
|
|
735
714
|
isRequired: false,
|
|
736
715
|
transformFunction: null
|
|
737
716
|
},
|
|
738
|
-
|
|
739
|
-
classPropertyName: "
|
|
740
|
-
publicName: "
|
|
717
|
+
disabled: {
|
|
718
|
+
classPropertyName: "disabled",
|
|
719
|
+
publicName: "disabled",
|
|
741
720
|
isSignal: true,
|
|
742
721
|
isRequired: false,
|
|
743
722
|
transformFunction: null
|
|
744
723
|
},
|
|
745
|
-
|
|
746
|
-
classPropertyName: "
|
|
747
|
-
publicName: "
|
|
724
|
+
expansionDelay: {
|
|
725
|
+
classPropertyName: "expansionDelay",
|
|
726
|
+
publicName: "expansionDelay",
|
|
748
727
|
isSignal: true,
|
|
749
728
|
isRequired: false,
|
|
750
729
|
transformFunction: null
|
|
751
730
|
}
|
|
752
731
|
},
|
|
753
732
|
outputs: {
|
|
754
|
-
|
|
733
|
+
onSelect: "onSelect"
|
|
755
734
|
},
|
|
756
735
|
host: {
|
|
757
736
|
attributes: {
|
|
758
|
-
"role": "
|
|
737
|
+
"role": "menu"
|
|
759
738
|
},
|
|
760
739
|
listeners: {
|
|
761
|
-
"
|
|
740
|
+
"keydown": "_pattern.onKeydown($event)",
|
|
741
|
+
"mouseover": "_pattern.onMouseOver($event)",
|
|
742
|
+
"mouseout": "_pattern.onMouseOut($event)",
|
|
743
|
+
"focusout": "_pattern.onFocusOut($event)",
|
|
744
|
+
"focusin": "_pattern.onFocusIn()",
|
|
745
|
+
"click": "_pattern.onClick($event)"
|
|
762
746
|
},
|
|
763
747
|
properties: {
|
|
764
|
-
"attr.
|
|
765
|
-
"attr.data-active": "active()",
|
|
766
|
-
"attr.aria-haspopup": "hasPopup()",
|
|
767
|
-
"attr.aria-expanded": "expanded()",
|
|
748
|
+
"attr.id": "_pattern.id()",
|
|
768
749
|
"attr.aria-disabled": "_pattern.disabled()",
|
|
769
|
-
"attr.
|
|
750
|
+
"attr.tabindex": "tabIndex()",
|
|
751
|
+
"attr.data-visible": "visible()"
|
|
770
752
|
}
|
|
771
753
|
},
|
|
772
|
-
|
|
754
|
+
providers: [{
|
|
755
|
+
provide: MENU_COMPONENT,
|
|
756
|
+
useExisting: Menu
|
|
757
|
+
}],
|
|
758
|
+
queries: [{
|
|
759
|
+
propertyName: "_allItems",
|
|
760
|
+
predicate: MenuItem,
|
|
761
|
+
descendants: true,
|
|
762
|
+
isSignal: true
|
|
763
|
+
}],
|
|
764
|
+
exportAs: ["ngMenu"],
|
|
765
|
+
hostDirectives: [{
|
|
766
|
+
directive: i1.DeferredContentAware,
|
|
767
|
+
inputs: ["preserveContent", "preserveContent"]
|
|
768
|
+
}],
|
|
773
769
|
ngImport: i0
|
|
774
770
|
});
|
|
775
771
|
}
|
|
776
772
|
i0.ɵɵngDeclareClassMetadata({
|
|
777
773
|
minVersion: "12.0.0",
|
|
778
|
-
version: "21.0.
|
|
774
|
+
version: "21.0.3",
|
|
779
775
|
ngImport: i0,
|
|
780
|
-
type:
|
|
776
|
+
type: Menu,
|
|
781
777
|
decorators: [{
|
|
782
778
|
type: Directive,
|
|
783
779
|
args: [{
|
|
784
|
-
selector: '[
|
|
785
|
-
exportAs: '
|
|
780
|
+
selector: '[ngMenu]',
|
|
781
|
+
exportAs: 'ngMenu',
|
|
786
782
|
host: {
|
|
787
|
-
'role': '
|
|
788
|
-
'
|
|
789
|
-
'[attr.tabindex]': '_pattern.tabIndex()',
|
|
790
|
-
'[attr.data-active]': 'active()',
|
|
791
|
-
'[attr.aria-haspopup]': 'hasPopup()',
|
|
792
|
-
'[attr.aria-expanded]': 'expanded()',
|
|
783
|
+
'role': 'menu',
|
|
784
|
+
'[attr.id]': '_pattern.id()',
|
|
793
785
|
'[attr.aria-disabled]': '_pattern.disabled()',
|
|
794
|
-
'[attr.
|
|
795
|
-
|
|
786
|
+
'[attr.tabindex]': 'tabIndex()',
|
|
787
|
+
'[attr.data-visible]': 'visible()',
|
|
788
|
+
'(keydown)': '_pattern.onKeydown($event)',
|
|
789
|
+
'(mouseover)': '_pattern.onMouseOver($event)',
|
|
790
|
+
'(mouseout)': '_pattern.onMouseOut($event)',
|
|
791
|
+
'(focusout)': '_pattern.onFocusOut($event)',
|
|
792
|
+
'(focusin)': '_pattern.onFocusIn()',
|
|
793
|
+
'(click)': '_pattern.onClick($event)'
|
|
794
|
+
},
|
|
795
|
+
hostDirectives: [{
|
|
796
|
+
directive: DeferredContentAware,
|
|
797
|
+
inputs: ['preserveContent']
|
|
798
|
+
}],
|
|
799
|
+
providers: [{
|
|
800
|
+
provide: MENU_COMPONENT,
|
|
801
|
+
useExisting: Menu
|
|
802
|
+
}]
|
|
796
803
|
}]
|
|
797
804
|
}],
|
|
798
805
|
ctorParameters: () => [],
|
|
799
806
|
propDecorators: {
|
|
807
|
+
_allItems: [{
|
|
808
|
+
type: i0.ContentChildren,
|
|
809
|
+
args: [i0.forwardRef(() => MenuItem), {
|
|
810
|
+
...{
|
|
811
|
+
descendants: true
|
|
812
|
+
},
|
|
813
|
+
isSignal: true
|
|
814
|
+
}]
|
|
815
|
+
}],
|
|
800
816
|
id: [{
|
|
801
817
|
type: i0.Input,
|
|
802
818
|
args: [{
|
|
@@ -805,47 +821,49 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
805
821
|
required: false
|
|
806
822
|
}]
|
|
807
823
|
}],
|
|
808
|
-
|
|
824
|
+
wrap: [{
|
|
809
825
|
type: i0.Input,
|
|
810
826
|
args: [{
|
|
811
827
|
isSignal: true,
|
|
812
|
-
alias: "
|
|
813
|
-
required:
|
|
828
|
+
alias: "wrap",
|
|
829
|
+
required: false
|
|
814
830
|
}]
|
|
815
831
|
}],
|
|
816
|
-
|
|
832
|
+
typeaheadDelay: [{
|
|
817
833
|
type: i0.Input,
|
|
818
834
|
args: [{
|
|
819
835
|
isSignal: true,
|
|
820
|
-
alias: "
|
|
836
|
+
alias: "typeaheadDelay",
|
|
821
837
|
required: false
|
|
822
838
|
}]
|
|
823
839
|
}],
|
|
824
|
-
|
|
840
|
+
disabled: [{
|
|
825
841
|
type: i0.Input,
|
|
826
842
|
args: [{
|
|
827
843
|
isSignal: true,
|
|
828
|
-
alias: "
|
|
844
|
+
alias: "disabled",
|
|
829
845
|
required: false
|
|
830
846
|
}]
|
|
831
|
-
},
|
|
847
|
+
}],
|
|
848
|
+
onSelect: [{
|
|
832
849
|
type: i0.Output,
|
|
833
|
-
args: ["
|
|
850
|
+
args: ["onSelect"]
|
|
834
851
|
}],
|
|
835
|
-
|
|
852
|
+
expansionDelay: [{
|
|
836
853
|
type: i0.Input,
|
|
837
854
|
args: [{
|
|
838
855
|
isSignal: true,
|
|
839
|
-
alias: "
|
|
856
|
+
alias: "expansionDelay",
|
|
840
857
|
required: false
|
|
841
858
|
}]
|
|
842
859
|
}]
|
|
843
860
|
}
|
|
844
861
|
});
|
|
862
|
+
|
|
845
863
|
class MenuContent {
|
|
846
864
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
847
865
|
minVersion: "12.0.0",
|
|
848
|
-
version: "21.0.
|
|
866
|
+
version: "21.0.3",
|
|
849
867
|
ngImport: i0,
|
|
850
868
|
type: MenuContent,
|
|
851
869
|
deps: [],
|
|
@@ -853,7 +871,7 @@ class MenuContent {
|
|
|
853
871
|
});
|
|
854
872
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
855
873
|
minVersion: "14.0.0",
|
|
856
|
-
version: "21.0.
|
|
874
|
+
version: "21.0.3",
|
|
857
875
|
type: MenuContent,
|
|
858
876
|
isStandalone: true,
|
|
859
877
|
selector: "ng-template[ngMenuContent]",
|
|
@@ -866,7 +884,7 @@ class MenuContent {
|
|
|
866
884
|
}
|
|
867
885
|
i0.ɵɵngDeclareClassMetadata({
|
|
868
886
|
minVersion: "12.0.0",
|
|
869
|
-
version: "21.0.
|
|
887
|
+
version: "21.0.3",
|
|
870
888
|
ngImport: i0,
|
|
871
889
|
type: MenuContent,
|
|
872
890
|
decorators: [{
|